From ebcf77af1bf59818f6ea507d935b980c86e176fa Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 2 Feb 2024 14:54:54 +1030 Subject: [PATCH 01/16] JSON: don't return a raw result string for "stop" and "recover". In general, results should always be an object, so we can add new fields later (e.g. warnings!). But we violated this for "stop", and when "recover" used the same infrastructure, it started doing the same thing. I'm assuming nobody cares, so we don't need to do a deprecation cycle. Changelog-Changed: JSON-RPC: `stop` and `recover` now return a JSON object (not a raw string!) like every other command does. Signed-off-by: Rusty Russell --- .msggen.json | 10 +++++++ cln-grpc/proto/node.proto | 5 ++++ cln-grpc/src/convert.rs | 1 + cln-rpc/src/model.rs | 26 +++++++++++++++++++ contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py | 1 + .../pyln/grpc/primitives_pb2.py | 1 + contrib/pyln-testing/pyln/testing/grpc2py.py | 1 + doc/lightning-stop.7.md | 7 +++-- doc/schemas/stop.schema.json | 18 ++++++++++--- lightningd/jsonrpc.c | 5 ++-- 10 files changed, 67 insertions(+), 8 deletions(-) diff --git a/.msggen.json b/.msggen.json index c6265fc81be4..08001d78e210 100644 --- a/.msggen.json +++ b/.msggen.json @@ -334,6 +334,9 @@ "complete": 1, "pending": 0 }, + "StopResult": { + "Shutdown complete": 0 + }, "WaitIndexname": { "created": 0, "deleted": 2, @@ -1687,6 +1690,9 @@ "StaticbackupResponse": { "StaticBackup.scb[]": 1 }, + "StopResponse": { + "Stop.result": 1 + }, "TxdiscardRequest": { "TxDiscard.txid": 1 }, @@ -5982,6 +5988,10 @@ "added": "pre-v0.10.1", "deprecated": null }, + "Stop.result": { + "added": "v24.05", + "deprecated": false + }, "TxDiscard": { "added": "pre-v0.10.1", "deprecated": null diff --git a/cln-grpc/proto/node.proto b/cln-grpc/proto/node.proto index b8dba61dd5c7..a2afa82d1b32 100644 --- a/cln-grpc/proto/node.proto +++ b/cln-grpc/proto/node.proto @@ -1951,6 +1951,11 @@ message StopRequest { } message StopResponse { + // Stop.result + enum StopResult { + SHUTDOWN_COMPLETE = 0; + } + optional StopResult result = 1; } message PreapprovekeysendRequest { diff --git a/cln-grpc/src/convert.rs b/cln-grpc/src/convert.rs index 5fdd39205079..10d60399020b 100644 --- a/cln-grpc/src/convert.rs +++ b/cln-grpc/src/convert.rs @@ -1825,6 +1825,7 @@ impl From for pb::WaitResponse { impl From for pb::StopResponse { fn from(c: responses::StopResponse) -> Self { Self { + result: c.result.map(|v| v as i32), } } } diff --git a/cln-rpc/src/model.rs b/cln-rpc/src/model.rs index 4dd6f404e0a3..e5c83d3bad36 100644 --- a/cln-rpc/src/model.rs +++ b/cln-rpc/src/model.rs @@ -5951,8 +5951,34 @@ pub mod responses { } } + #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] + pub enum StopResult { + #[serde(rename = "Shutdown complete")] + SHUTDOWN_COMPLETE, + } + + impl TryFrom for StopResult { + type Error = anyhow::Error; + fn try_from(c: i32) -> Result { + match c { + 0 => Ok(StopResult::SHUTDOWN_COMPLETE), + o => Err(anyhow::anyhow!("Unknown variant {} for enum StopResult", o)), + } + } + } + + impl ToString for StopResult { + fn to_string(&self) -> String { + match self { + StopResult::SHUTDOWN_COMPLETE => "SHUTDOWN_COMPLETE", + }.to_string() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct StopResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub result: Option, } impl TryFrom for StopResponse { diff --git a/contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py b/contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py index 02d56edc51f4..49c5cf315d41 100644 --- a/contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py +++ b/contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py @@ -20,6 +20,7 @@ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'node_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None _globals['_GETINFOREQUEST']._serialized_start=37 _globals['_GETINFOREQUEST']._serialized_end=53 diff --git a/contrib/pyln-grpc-proto/pyln/grpc/primitives_pb2.py b/contrib/pyln-grpc-proto/pyln/grpc/primitives_pb2.py index c0ce0d478484..72544a2af6ac 100644 --- a/contrib/pyln-grpc-proto/pyln/grpc/primitives_pb2.py +++ b/contrib/pyln-grpc-proto/pyln/grpc/primitives_pb2.py @@ -19,6 +19,7 @@ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'primitives_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None _globals['_CHANNELSIDE']._serialized_start=718 _globals['_CHANNELSIDE']._serialized_end=754 diff --git a/contrib/pyln-testing/pyln/testing/grpc2py.py b/contrib/pyln-testing/pyln/testing/grpc2py.py index 5d94587c43fc..5ba5bc5d317a 100644 --- a/contrib/pyln-testing/pyln/testing/grpc2py.py +++ b/contrib/pyln-testing/pyln/testing/grpc2py.py @@ -1515,6 +1515,7 @@ def wait2py(m): def stop2py(m): return remove_default({ + "result": str(m.result), # EnumField in generate_composite }) diff --git a/doc/lightning-stop.7.md b/doc/lightning-stop.7.md index 874d2422dd6c..00f4ffd15b93 100644 --- a/doc/lightning-stop.7.md +++ b/doc/lightning-stop.7.md @@ -25,7 +25,10 @@ RETURN VALUE ------------ [comment]: # (GENERATE-FROM-SCHEMA-START) -On success, returns a single element (string) (always "Shutdown complete") +On success, an object is returned, containing: + +- **result** (string) (always "Shutdown complete") *(added v24.05)* + [comment]: # (GENERATE-FROM-SCHEMA-END) Once it has returned, the daemon has cleaned up completely, and if @@ -43,4 +46,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:d070207640745cfc9b9ba26e5d023e96a3befcdde9a2c9b17d48d46dafb460f9) +[comment]: # ( SHA256STAMP:879e99c76bb615e2c7f7356ff24b748ef42ff11cf692d1f199c60aacf9c09e0b) diff --git a/doc/schemas/stop.schema.json b/doc/schemas/stop.schema.json index 00105c74383b..cad72d8f63a4 100644 --- a/doc/schemas/stop.schema.json +++ b/doc/schemas/stop.schema.json @@ -1,7 +1,17 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "type": "string", - "enum": [ - "Shutdown complete" - ] + "type": "object", + "additionalProperties": false, + "required": [ + "result" + ], + "properties": { + "result": { + "type": "string", + "added": "v24.05", + "enum": [ + "Shutdown complete" + ] + } + } } diff --git a/lightningd/jsonrpc.c b/lightningd/jsonrpc.c index 48d4e16736b4..b3ce25a41824 100644 --- a/lightningd/jsonrpc.c +++ b/lightningd/jsonrpc.c @@ -213,16 +213,17 @@ static struct command_result *prepare_stop_conn(struct command *cmd, cmd->ld->stop_conn = cmd->jcon->conn; - /* This is the one place where result is a literal string. */ jout = json_out_new(tmpctx); json_out_start(jout, NULL, '{'); json_out_addstr(jout, "jsonrpc", "2.0"); /* Copy input id token exactly */ memcpy(json_out_member_direct(jout, "id", strlen(cmd->id)), cmd->id, strlen(cmd->id)); + json_out_start(jout, "result", '{'); json_out_addstr(jout, "result", why); json_out_end(jout, '}'); - json_out_finished(jout); + json_out_end(jout, '}'); + json_out_finished(jout); /* Add two \n */ memcpy(json_out_direct(jout, 2), "\n\n", strlen("\n\n")); From ca32cb889f3e4210d62b35ae10499b466920a288 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 2 Feb 2024 14:55:14 +1030 Subject: [PATCH 02/16] Add type `sat`. We actually use this in multiple places for requests. The key difference between this and msat is what we do when presented with a raw number! I prefer insisting on explicit suffixes, for this reason, but at least this will document the field correctly! Signed-off-by: Rusty Russell --- contrib/pyln-testing/pyln/testing/fixtures.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/contrib/pyln-testing/pyln/testing/fixtures.py b/contrib/pyln-testing/pyln/testing/fixtures.py index 7b89de6ee7fc..a1fb7fb7131a 100644 --- a/contrib/pyln-testing/pyln/testing/fixtures.py +++ b/contrib/pyln-testing/pyln/testing/fixtures.py @@ -348,6 +348,16 @@ def is_msat_request(checker, instance): except TypeError: return False + def is_sat(checker, instance): + """sat fields can be raw integers, sats, btc.""" + try: + # For plain integers, this gives the wrong value by 1000, + # but all we care about is the type here. + Millisatoshi(instance) + return True + except TypeError: + return False + def is_msat_response(checker, instance): """A positive integer""" return type(instance) is int and instance >= 0 @@ -396,6 +406,7 @@ def is_msat_or_any(checker, instance): "u16": is_u16, "u8": is_u8, "pubkey": is_pubkey, + "sat": is_sat, "msat": is_msat, "msat_or_all": is_msat_or_all, "msat_or_any": is_msat_or_any, From 7ee36299543b0891118559f67ae20c15734a356f Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Fri, 2 Feb 2024 14:55:15 +1030 Subject: [PATCH 03/16] Add type `currency` for offers amount field. Eg.`1.50USD`. --- contrib/msggen/msggen/schema.json | 18 ++++++-- contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py | 46 ++++++++++--------- contrib/pyln-testing/pyln/testing/fixtures.py | 8 ++++ 3 files changed, 46 insertions(+), 26 deletions(-) diff --git a/contrib/msggen/msggen/schema.json b/contrib/msggen/msggen/schema.json index cacad7b088c2..6f0e27768894 100644 --- a/contrib/msggen/msggen/schema.json +++ b/contrib/msggen/msggen/schema.json @@ -15676,10 +15676,20 @@ }, "stop.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", - "type": "string", - "enum": [ - "Shutdown complete" - ] + "type": "object", + "additionalProperties": false, + "required": [ + "result" + ], + "properties": { + "result": { + "type": "string", + "added": "v24.05", + "enum": [ + "Shutdown complete" + ] + } + } }, "txdiscard.request.json": { "$schema": "http://json-schema.org/draft-07/schema#", diff --git a/contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py b/contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py index 49c5cf315d41..68ca1cac77cd 100644 --- a/contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py +++ b/contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py @@ -14,7 +14,7 @@ from pyln.grpc import primitives_pb2 as primitives__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\nnode.proto\x12\x03\x63ln\x1a\x10primitives.proto\"\x10\n\x0eGetinfoRequest\"\xc1\x04\n\x0fGetinfoResponse\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x12\n\x05\x61lias\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\r\n\x05\x63olor\x18\x03 \x01(\x0c\x12\x11\n\tnum_peers\x18\x04 \x01(\r\x12\x1c\n\x14num_pending_channels\x18\x05 \x01(\r\x12\x1b\n\x13num_active_channels\x18\x06 \x01(\r\x12\x1d\n\x15num_inactive_channels\x18\x07 \x01(\r\x12\x0f\n\x07version\x18\x08 \x01(\t\x12\x15\n\rlightning_dir\x18\t \x01(\t\x12\x33\n\x0cour_features\x18\n \x01(\x0b\x32\x18.cln.GetinfoOur_featuresH\x01\x88\x01\x01\x12\x13\n\x0b\x62lockheight\x18\x0b \x01(\r\x12\x0f\n\x07network\x18\x0c \x01(\t\x12(\n\x13\x66\x65\x65s_collected_msat\x18\r \x01(\x0b\x32\x0b.cln.Amount\x12$\n\x07\x61\x64\x64ress\x18\x0e \x03(\x0b\x32\x13.cln.GetinfoAddress\x12$\n\x07\x62inding\x18\x0f \x03(\x0b\x32\x13.cln.GetinfoBinding\x12\"\n\x15warning_bitcoind_sync\x18\x10 \x01(\tH\x02\x88\x01\x01\x12$\n\x17warning_lightningd_sync\x18\x11 \x01(\tH\x03\x88\x01\x01\x42\x08\n\x06_aliasB\x0f\n\r_our_featuresB\x18\n\x16_warning_bitcoind_syncB\x1a\n\x18_warning_lightningd_sync\"S\n\x13GetinfoOur_features\x12\x0c\n\x04init\x18\x01 \x01(\x0c\x12\x0c\n\x04node\x18\x02 \x01(\x0c\x12\x0f\n\x07\x63hannel\x18\x03 \x01(\x0c\x12\x0f\n\x07invoice\x18\x04 \x01(\x0c\"\xc4\x01\n\x0eGetinfoAddress\x12\x39\n\titem_type\x18\x01 \x01(\x0e\x32&.cln.GetinfoAddress.GetinfoAddressType\x12\x0c\n\x04port\x18\x02 \x01(\r\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x00\x88\x01\x01\"G\n\x12GetinfoAddressType\x12\x07\n\x03\x44NS\x10\x00\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\n\n\x08_address\"\x8a\x02\n\x0eGetinfoBinding\x12\x39\n\titem_type\x18\x01 \x01(\x0e\x32&.cln.GetinfoBinding.GetinfoBindingType\x12\x14\n\x07\x61\x64\x64ress\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04port\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x13\n\x06socket\x18\x04 \x01(\tH\x02\x88\x01\x01\"_\n\x12GetinfoBindingType\x12\x10\n\x0cLOCAL_SOCKET\x10\x00\x12\r\n\tWEBSOCKET\x10\x05\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\n\n\x08_addressB\x07\n\x05_portB\t\n\x07_socket\"H\n\x10ListpeersRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x12\n\x05level\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x05\n\x03_idB\x08\n\x06_level\"7\n\x11ListpeersResponse\x12\"\n\x05peers\x18\x01 \x03(\x0b\x32\x13.cln.ListpeersPeers\"\x8e\x02\n\x0eListpeersPeers\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x11\n\tconnected\x18\x02 \x01(\x08\x12\x19\n\x0cnum_channels\x18\x08 \x01(\rH\x00\x88\x01\x01\x12#\n\x03log\x18\x03 \x03(\x0b\x32\x16.cln.ListpeersPeersLog\x12-\n\x08\x63hannels\x18\x04 \x03(\x0b\x32\x1b.cln.ListpeersPeersChannels\x12\x0f\n\x07netaddr\x18\x05 \x03(\t\x12\x18\n\x0bremote_addr\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x15\n\x08\x66\x65\x61tures\x18\x06 \x01(\x0cH\x02\x88\x01\x01\x42\x0f\n\r_num_channelsB\x0e\n\x0c_remote_addrB\x0b\n\t_features\"\xfd\x02\n\x11ListpeersPeersLog\x12?\n\titem_type\x18\x01 \x01(\x0e\x32,.cln.ListpeersPeersLog.ListpeersPeersLogType\x12\x18\n\x0bnum_skipped\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x11\n\x04time\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06source\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x10\n\x03log\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x14\n\x07node_id\x18\x06 \x01(\x0cH\x04\x88\x01\x01\x12\x11\n\x04\x64\x61ta\x18\x07 \x01(\x0cH\x05\x88\x01\x01\"i\n\x15ListpeersPeersLogType\x12\x0b\n\x07SKIPPED\x10\x00\x12\n\n\x06\x42ROKEN\x10\x01\x12\x0b\n\x07UNUSUAL\x10\x02\x12\x08\n\x04INFO\x10\x03\x12\t\n\x05\x44\x45\x42UG\x10\x04\x12\t\n\x05IO_IN\x10\x05\x12\n\n\x06IO_OUT\x10\x06\x42\x0e\n\x0c_num_skippedB\x07\n\x05_timeB\t\n\x07_sourceB\x06\n\x04_logB\n\n\x08_node_idB\x07\n\x05_data\"\x95\x18\n\x16ListpeersPeersChannels\x12\x46\n\x05state\x18\x01 \x01(\x0e\x32\x37.cln.ListpeersPeersChannels.ListpeersPeersChannelsState\x12\x19\n\x0cscratch_txid\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x38\n\x07\x66\x65\x65rate\x18\x03 \x01(\x0b\x32\".cln.ListpeersPeersChannelsFeerateH\x01\x88\x01\x01\x12\x12\n\x05owner\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x1d\n\x10short_channel_id\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x17\n\nchannel_id\x18\x06 \x01(\x0cH\x04\x88\x01\x01\x12\x19\n\x0c\x66unding_txid\x18\x07 \x01(\x0cH\x05\x88\x01\x01\x12\x1b\n\x0e\x66unding_outnum\x18\x08 \x01(\rH\x06\x88\x01\x01\x12\x1c\n\x0finitial_feerate\x18\t \x01(\tH\x07\x88\x01\x01\x12\x19\n\x0clast_feerate\x18\n \x01(\tH\x08\x88\x01\x01\x12\x19\n\x0cnext_feerate\x18\x0b \x01(\tH\t\x88\x01\x01\x12\x1a\n\rnext_fee_step\x18\x0c \x01(\rH\n\x88\x01\x01\x12\x35\n\x08inflight\x18\r \x03(\x0b\x32#.cln.ListpeersPeersChannelsInflight\x12\x15\n\x08\x63lose_to\x18\x0e \x01(\x0cH\x0b\x88\x01\x01\x12\x14\n\x07private\x18\x0f \x01(\x08H\x0c\x88\x01\x01\x12 \n\x06opener\x18\x10 \x01(\x0e\x32\x10.cln.ChannelSide\x12%\n\x06\x63loser\x18\x11 \x01(\x0e\x32\x10.cln.ChannelSideH\r\x88\x01\x01\x12\x10\n\x08\x66\x65\x61tures\x18\x12 \x03(\t\x12\x38\n\x07\x66unding\x18\x13 \x01(\x0b\x32\".cln.ListpeersPeersChannelsFundingH\x0e\x88\x01\x01\x12$\n\nto_us_msat\x18\x14 \x01(\x0b\x32\x0b.cln.AmountH\x0f\x88\x01\x01\x12(\n\x0emin_to_us_msat\x18\x15 \x01(\x0b\x32\x0b.cln.AmountH\x10\x88\x01\x01\x12(\n\x0emax_to_us_msat\x18\x16 \x01(\x0b\x32\x0b.cln.AmountH\x11\x88\x01\x01\x12$\n\ntotal_msat\x18\x17 \x01(\x0b\x32\x0b.cln.AmountH\x12\x88\x01\x01\x12\'\n\rfee_base_msat\x18\x18 \x01(\x0b\x32\x0b.cln.AmountH\x13\x88\x01\x01\x12(\n\x1b\x66\x65\x65_proportional_millionths\x18\x19 \x01(\rH\x14\x88\x01\x01\x12)\n\x0f\x64ust_limit_msat\x18\x1a \x01(\x0b\x32\x0b.cln.AmountH\x15\x88\x01\x01\x12\x30\n\x16max_total_htlc_in_msat\x18\x1b \x01(\x0b\x32\x0b.cln.AmountH\x16\x88\x01\x01\x12,\n\x12their_reserve_msat\x18\x1c \x01(\x0b\x32\x0b.cln.AmountH\x17\x88\x01\x01\x12*\n\x10our_reserve_msat\x18\x1d \x01(\x0b\x32\x0b.cln.AmountH\x18\x88\x01\x01\x12(\n\x0espendable_msat\x18\x1e \x01(\x0b\x32\x0b.cln.AmountH\x19\x88\x01\x01\x12)\n\x0freceivable_msat\x18\x1f \x01(\x0b\x32\x0b.cln.AmountH\x1a\x88\x01\x01\x12.\n\x14minimum_htlc_in_msat\x18 \x01(\x0b\x32\x0b.cln.AmountH\x1b\x88\x01\x01\x12/\n\x15minimum_htlc_out_msat\x18\x30 \x01(\x0b\x32\x0b.cln.AmountH\x1c\x88\x01\x01\x12/\n\x15maximum_htlc_out_msat\x18\x31 \x01(\x0b\x32\x0b.cln.AmountH\x1d\x88\x01\x01\x12 \n\x13their_to_self_delay\x18! \x01(\rH\x1e\x88\x01\x01\x12\x1e\n\x11our_to_self_delay\x18\" \x01(\rH\x1f\x88\x01\x01\x12\x1f\n\x12max_accepted_htlcs\x18# \x01(\rH \x88\x01\x01\x12\x34\n\x05\x61lias\x18\x32 \x01(\x0b\x32 .cln.ListpeersPeersChannelsAliasH!\x88\x01\x01\x12\x0e\n\x06status\x18% \x03(\t\x12 \n\x13in_payments_offered\x18& \x01(\x04H\"\x88\x01\x01\x12)\n\x0fin_offered_msat\x18\' \x01(\x0b\x32\x0b.cln.AmountH#\x88\x01\x01\x12\"\n\x15in_payments_fulfilled\x18( \x01(\x04H$\x88\x01\x01\x12+\n\x11in_fulfilled_msat\x18) \x01(\x0b\x32\x0b.cln.AmountH%\x88\x01\x01\x12!\n\x14out_payments_offered\x18* \x01(\x04H&\x88\x01\x01\x12*\n\x10out_offered_msat\x18+ \x01(\x0b\x32\x0b.cln.AmountH\'\x88\x01\x01\x12#\n\x16out_payments_fulfilled\x18, \x01(\x04H(\x88\x01\x01\x12,\n\x12out_fulfilled_msat\x18- \x01(\x0b\x32\x0b.cln.AmountH)\x88\x01\x01\x12/\n\x05htlcs\x18. \x03(\x0b\x32 .cln.ListpeersPeersChannelsHtlcs\x12\x1a\n\rclose_to_addr\x18/ \x01(\tH*\x88\x01\x01\"\xe0\x02\n\x1bListpeersPeersChannelsState\x12\x0c\n\x08OPENINGD\x10\x00\x12\x1c\n\x18\x43HANNELD_AWAITING_LOCKIN\x10\x01\x12\x13\n\x0f\x43HANNELD_NORMAL\x10\x02\x12\x1a\n\x16\x43HANNELD_SHUTTING_DOWN\x10\x03\x12\x18\n\x14\x43LOSINGD_SIGEXCHANGE\x10\x04\x12\x15\n\x11\x43LOSINGD_COMPLETE\x10\x05\x12\x17\n\x13\x41WAITING_UNILATERAL\x10\x06\x12\x16\n\x12\x46UNDING_SPEND_SEEN\x10\x07\x12\x0b\n\x07ONCHAIN\x10\x08\x12\x17\n\x13\x44UALOPEND_OPEN_INIT\x10\t\x12\x1d\n\x19\x44UALOPEND_AWAITING_LOCKIN\x10\n\x12\x1c\n\x18\x44UALOPEND_OPEN_COMMITTED\x10\x0b\x12\x1f\n\x1b\x44UALOPEND_OPEN_COMMIT_READY\x10\x0c\x42\x0f\n\r_scratch_txidB\n\n\x08_feerateB\x08\n\x06_ownerB\x13\n\x11_short_channel_idB\r\n\x0b_channel_idB\x0f\n\r_funding_txidB\x11\n\x0f_funding_outnumB\x12\n\x10_initial_feerateB\x0f\n\r_last_feerateB\x0f\n\r_next_feerateB\x10\n\x0e_next_fee_stepB\x0b\n\t_close_toB\n\n\x08_privateB\t\n\x07_closerB\n\n\x08_fundingB\r\n\x0b_to_us_msatB\x11\n\x0f_min_to_us_msatB\x11\n\x0f_max_to_us_msatB\r\n\x0b_total_msatB\x10\n\x0e_fee_base_msatB\x1e\n\x1c_fee_proportional_millionthsB\x12\n\x10_dust_limit_msatB\x19\n\x17_max_total_htlc_in_msatB\x15\n\x13_their_reserve_msatB\x13\n\x11_our_reserve_msatB\x11\n\x0f_spendable_msatB\x12\n\x10_receivable_msatB\x17\n\x15_minimum_htlc_in_msatB\x18\n\x16_minimum_htlc_out_msatB\x18\n\x16_maximum_htlc_out_msatB\x16\n\x14_their_to_self_delayB\x14\n\x12_our_to_self_delayB\x15\n\x13_max_accepted_htlcsB\x08\n\x06_aliasB\x16\n\x14_in_payments_offeredB\x12\n\x10_in_offered_msatB\x18\n\x16_in_payments_fulfilledB\x14\n\x12_in_fulfilled_msatB\x17\n\x15_out_payments_offeredB\x13\n\x11_out_offered_msatB\x19\n\x17_out_payments_fulfilledB\x15\n\x13_out_fulfilled_msatB\x10\n\x0e_close_to_addr\"=\n\x1dListpeersPeersChannelsFeerate\x12\r\n\x05perkw\x18\x01 \x01(\r\x12\r\n\x05perkb\x18\x02 \x01(\r\"\xf3\x01\n\x1eListpeersPeersChannelsInflight\x12\x14\n\x0c\x66unding_txid\x18\x01 \x01(\x0c\x12\x16\n\x0e\x66unding_outnum\x18\x02 \x01(\r\x12\x0f\n\x07\x66\x65\x65rate\x18\x03 \x01(\t\x12\'\n\x12total_funding_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10our_funding_msat\x18\x05 \x01(\x0b\x32\x0b.cln.Amount\x12\x1a\n\rsplice_amount\x18\x07 \x01(\x12H\x00\x88\x01\x01\x12\x14\n\x0cscratch_txid\x18\x06 \x01(\x0c\x42\x10\n\x0e_splice_amount\"\x9b\x02\n\x1dListpeersPeersChannelsFunding\x12%\n\x0bpushed_msat\x18\x03 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12%\n\x10local_funds_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12&\n\x11remote_funds_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\'\n\rfee_paid_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\'\n\rfee_rcvd_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x42\x0e\n\x0c_pushed_msatB\x10\n\x0e_fee_paid_msatB\x10\n\x0e_fee_rcvd_msat\"[\n\x1bListpeersPeersChannelsAlias\x12\x12\n\x05local\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06remote\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_localB\t\n\x07_remote\"\xf1\x02\n\x1bListpeersPeersChannelsHtlcs\x12X\n\tdirection\x18\x01 \x01(\x0e\x32\x45.cln.ListpeersPeersChannelsHtlcs.ListpeersPeersChannelsHtlcsDirection\x12\n\n\x02id\x18\x02 \x01(\x04\x12 \n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x0e\n\x06\x65xpiry\x18\x04 \x01(\r\x12\x14\n\x0cpayment_hash\x18\x05 \x01(\x0c\x12\x1a\n\rlocal_trimmed\x18\x06 \x01(\x08H\x00\x88\x01\x01\x12\x13\n\x06status\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x1d\n\x05state\x18\x08 \x01(\x0e\x32\x0e.cln.HtlcState\"7\n$ListpeersPeersChannelsHtlcsDirection\x12\x06\n\x02IN\x10\x00\x12\x07\n\x03OUT\x10\x01\x42\x10\n\x0e_local_trimmedB\t\n\x07_status\"0\n\x10ListfundsRequest\x12\x12\n\x05spent\x18\x01 \x01(\x08H\x00\x88\x01\x01\x42\x08\n\x06_spent\"e\n\x11ListfundsResponse\x12&\n\x07outputs\x18\x01 \x03(\x0b\x32\x15.cln.ListfundsOutputs\x12(\n\x08\x63hannels\x18\x02 \x03(\x0b\x32\x16.cln.ListfundsChannels\"\x83\x03\n\x10ListfundsOutputs\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x0e\n\x06output\x18\x02 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x14\n\x0cscriptpubkey\x18\x04 \x01(\x0c\x12\x14\n\x07\x61\x64\x64ress\x18\x05 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0credeemscript\x18\x06 \x01(\x0cH\x01\x88\x01\x01\x12<\n\x06status\x18\x07 \x01(\x0e\x32,.cln.ListfundsOutputs.ListfundsOutputsStatus\x12\x10\n\x08reserved\x18\t \x01(\x08\x12\x18\n\x0b\x62lockheight\x18\x08 \x01(\rH\x02\x88\x01\x01\"Q\n\x16ListfundsOutputsStatus\x12\x0f\n\x0bUNCONFIRMED\x10\x00\x12\r\n\tCONFIRMED\x10\x01\x12\t\n\x05SPENT\x10\x02\x12\x0c\n\x08IMMATURE\x10\x03\x42\n\n\x08_addressB\x0f\n\r_redeemscriptB\x0e\n\x0c_blockheight\"\xab\x02\n\x11ListfundsChannels\x12\x0f\n\x07peer_id\x18\x01 \x01(\x0c\x12$\n\x0four_amount_msat\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\x12 \n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x14\n\x0c\x66unding_txid\x18\x04 \x01(\x0c\x12\x16\n\x0e\x66unding_output\x18\x05 \x01(\r\x12\x11\n\tconnected\x18\x06 \x01(\x08\x12 \n\x05state\x18\x07 \x01(\x0e\x32\x11.cln.ChannelState\x12\x17\n\nchannel_id\x18\t \x01(\x0cH\x00\x88\x01\x01\x12\x1d\n\x10short_channel_id\x18\x08 \x01(\tH\x01\x88\x01\x01\x42\r\n\x0b_channel_idB\x13\n\x11_short_channel_id\"\xdd\x02\n\x0eSendpayRequest\x12 \n\x05route\x18\x01 \x03(\x0b\x32\x11.cln.SendpayRoute\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\x0c\x12\x12\n\x05label\x18\x03 \x01(\tH\x00\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x1b\n\x0epayment_secret\x18\x06 \x01(\x0cH\x03\x88\x01\x01\x12\x13\n\x06partid\x18\x07 \x01(\rH\x04\x88\x01\x01\x12\x1a\n\rlocalinvreqid\x18\x0b \x01(\x0cH\x05\x88\x01\x01\x12\x14\n\x07groupid\x18\t \x01(\x04H\x06\x88\x01\x01\x42\x08\n\x06_labelB\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\x11\n\x0f_payment_secretB\t\n\x07_partidB\x10\n\x0e_localinvreqidB\n\n\x08_groupid\"\xad\x05\n\x0fSendpayResponse\x12\x1a\n\rcreated_index\x18\x10 \x01(\x04H\x00\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x11 \x01(\x04H\x01\x88\x01\x01\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x14\n\x07groupid\x18\x02 \x01(\x04H\x02\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x32\n\x06status\x18\x04 \x01(\x0e\x32\".cln.SendpayResponse.SendpayStatus\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x06 \x01(\x0cH\x04\x88\x01\x01\x12\x12\n\ncreated_at\x18\x07 \x01(\x04\x12\x19\n\x0c\x63ompleted_at\x18\x0f \x01(\x04H\x05\x88\x01\x01\x12%\n\x10\x61mount_sent_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\t \x01(\tH\x06\x88\x01\x01\x12\x13\n\x06partid\x18\n \x01(\x04H\x07\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x0b \x01(\tH\x08\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x0c \x01(\tH\t\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\r \x01(\x0cH\n\x88\x01\x01\x12\x14\n\x07message\x18\x0e \x01(\tH\x0b\x88\x01\x01\"*\n\rSendpayStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x42\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\n\n\x08_groupidB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x0f\n\r_completed_atB\x08\n\x06_labelB\t\n\x07_partidB\t\n\x07_bolt11B\t\n\x07_bolt12B\x13\n\x11_payment_preimageB\n\n\x08_message\"\\\n\x0cSendpayRoute\x12 \n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.Amount\x12\n\n\x02id\x18\x02 \x01(\x0c\x12\r\n\x05\x64\x65lay\x18\x03 \x01(\r\x12\x0f\n\x07\x63hannel\x18\x04 \x01(\t\"\x93\x01\n\x13ListchannelsRequest\x12\x1d\n\x10short_channel_id\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06source\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x03 \x01(\x0cH\x02\x88\x01\x01\x42\x13\n\x11_short_channel_idB\t\n\x07_sourceB\x0e\n\x0c_destination\"C\n\x14ListchannelsResponse\x12+\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x19.cln.ListchannelsChannels\"\xb3\x03\n\x14ListchannelsChannels\x12\x0e\n\x06source\x18\x01 \x01(\x0c\x12\x13\n\x0b\x64\x65stination\x18\x02 \x01(\x0c\x12\x18\n\x10short_channel_id\x18\x03 \x01(\t\x12\x11\n\tdirection\x18\x10 \x01(\r\x12\x0e\n\x06public\x18\x04 \x01(\x08\x12 \n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.Amount\x12\x15\n\rmessage_flags\x18\x06 \x01(\r\x12\x15\n\rchannel_flags\x18\x07 \x01(\r\x12\x0e\n\x06\x61\x63tive\x18\x08 \x01(\x08\x12\x13\n\x0blast_update\x18\t \x01(\r\x12\x1d\n\x15\x62\x61se_fee_millisatoshi\x18\n \x01(\r\x12\x19\n\x11\x66\x65\x65_per_millionth\x18\x0b \x01(\r\x12\r\n\x05\x64\x65lay\x18\x0c \x01(\r\x12&\n\x11htlc_minimum_msat\x18\r \x01(\x0b\x32\x0b.cln.Amount\x12+\n\x11htlc_maximum_msat\x18\x0e \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x10\n\x08\x66\x65\x61tures\x18\x0f \x01(\x0c\x42\x14\n\x12_htlc_maximum_msat\"#\n\x10\x41\x64\x64gossipRequest\x12\x0f\n\x07message\x18\x01 \x01(\x0c\"\x13\n\x11\x41\x64\x64gossipResponse\"o\n\x17\x41utocleaninvoiceRequest\x12\x17\n\nexpired_by\x18\x01 \x01(\x04H\x00\x88\x01\x01\x12\x1a\n\rcycle_seconds\x18\x02 \x01(\x04H\x01\x88\x01\x01\x42\r\n\x0b_expired_byB\x10\n\x0e_cycle_seconds\"\x81\x01\n\x18\x41utocleaninvoiceResponse\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\x17\n\nexpired_by\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x1a\n\rcycle_seconds\x18\x03 \x01(\x04H\x01\x88\x01\x01\x42\r\n\x0b_expired_byB\x10\n\x0e_cycle_seconds\"U\n\x13\x43heckmessageRequest\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\r\n\x05zbase\x18\x02 \x01(\t\x12\x13\n\x06pubkey\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x42\t\n\x07_pubkey\"8\n\x14\x43heckmessageResponse\x12\x10\n\x08verified\x18\x01 \x01(\x08\x12\x0e\n\x06pubkey\x18\x02 \x01(\x0c\"\xcb\x02\n\x0c\x43loseRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x1e\n\x11unilateraltimeout\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x03 \x01(\tH\x01\x88\x01\x01\x12!\n\x14\x66\x65\x65_negotiation_step\x18\x04 \x01(\tH\x02\x88\x01\x01\x12)\n\rwrong_funding\x18\x05 \x01(\x0b\x32\r.cln.OutpointH\x03\x88\x01\x01\x12\x1f\n\x12\x66orce_lease_closed\x18\x06 \x01(\x08H\x04\x88\x01\x01\x12\x1e\n\x08\x66\x65\x65range\x18\x07 \x03(\x0b\x32\x0c.cln.FeerateB\x14\n\x12_unilateraltimeoutB\x0e\n\x0c_destinationB\x17\n\x15_fee_negotiation_stepB\x10\n\x0e_wrong_fundingB\x15\n\x13_force_lease_closed\"\xab\x01\n\rCloseResponse\x12/\n\titem_type\x18\x01 \x01(\x0e\x32\x1c.cln.CloseResponse.CloseType\x12\x0f\n\x02tx\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x11\n\x04txid\x18\x03 \x01(\x0cH\x01\x88\x01\x01\"5\n\tCloseType\x12\n\n\x06MUTUAL\x10\x00\x12\x0e\n\nUNILATERAL\x10\x01\x12\x0c\n\x08UNOPENED\x10\x02\x42\x05\n\x03_txB\x07\n\x05_txid\"T\n\x0e\x43onnectRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\x04host\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04port\x18\x03 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_hostB\x07\n\x05_port\"\xb4\x01\n\x0f\x43onnectResponse\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x10\n\x08\x66\x65\x61tures\x18\x02 \x01(\x0c\x12\x38\n\tdirection\x18\x03 \x01(\x0e\x32%.cln.ConnectResponse.ConnectDirection\x12$\n\x07\x61\x64\x64ress\x18\x04 \x01(\x0b\x32\x13.cln.ConnectAddress\"#\n\x10\x43onnectDirection\x12\x06\n\x02IN\x10\x00\x12\x07\n\x03OUT\x10\x01\"\xfb\x01\n\x0e\x43onnectAddress\x12\x39\n\titem_type\x18\x01 \x01(\x0e\x32&.cln.ConnectAddress.ConnectAddressType\x12\x13\n\x06socket\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x11\n\x04port\x18\x04 \x01(\rH\x02\x88\x01\x01\"P\n\x12\x43onnectAddressType\x12\x10\n\x0cLOCAL_SOCKET\x10\x00\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\t\n\x07_socketB\n\n\x08_addressB\x07\n\x05_port\"J\n\x14\x43reateinvoiceRequest\x12\x11\n\tinvstring\x18\x01 \x01(\t\x12\r\n\x05label\x18\x02 \x01(\t\x12\x10\n\x08preimage\x18\x03 \x01(\x0c\"\xfe\x05\n\x15\x43reateinvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x06\x62olt11\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x04 \x01(\x0c\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12>\n\x06status\x18\x06 \x01(\x0e\x32..cln.CreateinvoiceResponse.CreateinvoiceStatus\x12\x13\n\x0b\x64\x65scription\x18\x07 \x01(\t\x12\x12\n\nexpires_at\x18\x08 \x01(\x04\x12\x1a\n\rcreated_index\x18\x10 \x01(\x04H\x03\x88\x01\x01\x12\x16\n\tpay_index\x18\t \x01(\x04H\x04\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x05\x88\x01\x01\x12\x14\n\x07paid_at\x18\x0b \x01(\x04H\x06\x88\x01\x01\x12;\n\rpaid_outpoint\x18\x11 \x01(\x0b\x32\x1f.cln.CreateinvoicePaid_outpointH\x07\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\x08\x88\x01\x01\x12\x1b\n\x0elocal_offer_id\x18\r \x01(\x0cH\t\x88\x01\x01\x12\x1e\n\x11invreq_payer_note\x18\x0f \x01(\tH\n\x88\x01\x01\"8\n\x13\x43reateinvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x12\n\n\x06UNPAID\x10\x02\x42\t\n\x07_bolt11B\t\n\x07_bolt12B\x0e\n\x0c_amount_msatB\x10\n\x0e_created_indexB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x10\n\x0e_paid_outpointB\x13\n\x11_payment_preimageB\x11\n\x0f_local_offer_idB\x14\n\x12_invreq_payer_note\"X\n\x1a\x43reateinvoicePaid_outpoint\x12\x11\n\x04txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x13\n\x06outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_txidB\t\n\x07_outnum\"\xb4\x02\n\x10\x44\x61tastoreRequest\x12\x0b\n\x03key\x18\x05 \x03(\t\x12\x13\n\x06string\x18\x06 \x01(\tH\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12\x36\n\x04mode\x18\x03 \x01(\x0e\x32#.cln.DatastoreRequest.DatastoreModeH\x02\x88\x01\x01\x12\x17\n\ngeneration\x18\x04 \x01(\x04H\x03\x88\x01\x01\"p\n\rDatastoreMode\x12\x0f\n\x0bMUST_CREATE\x10\x00\x12\x10\n\x0cMUST_REPLACE\x10\x01\x12\x15\n\x11\x43REATE_OR_REPLACE\x10\x02\x12\x0f\n\x0bMUST_APPEND\x10\x03\x12\x14\n\x10\x43REATE_OR_APPEND\x10\x04\x42\t\n\x07_stringB\x06\n\x04_hexB\x07\n\x05_modeB\r\n\x0b_generation\"\x82\x01\n\x11\x44\x61tastoreResponse\x12\x0b\n\x03key\x18\x05 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x12\x13\n\x06string\x18\x04 \x01(\tH\x02\x88\x01\x01\x42\r\n\x0b_generationB\x06\n\x04_hexB\t\n\x07_string\"\x17\n\x15\x44\x61tastoreusageRequest\"k\n\x16\x44\x61tastoreusageResponse\x12>\n\x0e\x64\x61tastoreusage\x18\x01 \x01(\x0b\x32!.cln.DatastoreusageDatastoreusageH\x00\x88\x01\x01\x42\x11\n\x0f_datastoreusage\"b\n\x1c\x44\x61tastoreusageDatastoreusage\x12\x10\n\x03key\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x18\n\x0btotal_bytes\x18\x02 \x01(\x04H\x01\x88\x01\x01\x42\x06\n\x04_keyB\x0e\n\x0c_total_bytes\"\x9d\x01\n\x12\x43reateonionRequest\x12\"\n\x04hops\x18\x01 \x03(\x0b\x32\x14.cln.CreateonionHops\x12\x11\n\tassocdata\x18\x02 \x01(\x0c\x12\x18\n\x0bsession_key\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x12\x17\n\nonion_size\x18\x04 \x01(\rH\x01\x88\x01\x01\x42\x0e\n\x0c_session_keyB\r\n\x0b_onion_size\"<\n\x13\x43reateonionResponse\x12\r\n\x05onion\x18\x01 \x01(\x0c\x12\x16\n\x0eshared_secrets\x18\x02 \x03(\x0c\"2\n\x0f\x43reateonionHops\x12\x0e\n\x06pubkey\x18\x01 \x01(\x0c\x12\x0f\n\x07payload\x18\x02 \x01(\x0c\"J\n\x13\x44\x65ldatastoreRequest\x12\x0b\n\x03key\x18\x03 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\r\n\x0b_generation\"\x85\x01\n\x14\x44\x65ldatastoreResponse\x12\x0b\n\x03key\x18\x05 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x12\x13\n\x06string\x18\x04 \x01(\tH\x02\x88\x01\x01\x42\r\n\x0b_generationB\x06\n\x04_hexB\t\n\x07_string\"H\n\x18\x44\x65lexpiredinvoiceRequest\x12\x1a\n\rmaxexpirytime\x18\x01 \x01(\x04H\x00\x88\x01\x01\x42\x10\n\x0e_maxexpirytime\"\x1b\n\x19\x44\x65lexpiredinvoiceResponse\"\xb6\x01\n\x11\x44\x65linvoiceRequest\x12\r\n\x05label\x18\x01 \x01(\t\x12\x37\n\x06status\x18\x02 \x01(\x0e\x32\'.cln.DelinvoiceRequest.DelinvoiceStatus\x12\x15\n\x08\x64\x65sconly\x18\x03 \x01(\x08H\x00\x88\x01\x01\"5\n\x10\x44\x65linvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x12\n\n\x06UNPAID\x10\x02\x42\x0b\n\t_desconly\"\xa1\x04\n\x12\x44\x65linvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x06\x62olt11\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x03 \x01(\tH\x01\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x06 \x01(\x0c\x12\x1a\n\rcreated_index\x18\x0c \x01(\x04H\x04\x88\x01\x01\x12\x1a\n\rupdated_index\x18\r \x01(\x04H\x05\x88\x01\x01\x12\x38\n\x06status\x18\x07 \x01(\x0e\x32(.cln.DelinvoiceResponse.DelinvoiceStatus\x12\x12\n\nexpires_at\x18\x08 \x01(\x04\x12\x1b\n\x0elocal_offer_id\x18\t \x01(\x0cH\x06\x88\x01\x01\x12\x1e\n\x11invreq_payer_note\x18\x0b \x01(\tH\x07\x88\x01\x01\"5\n\x10\x44\x65linvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x12\n\n\x06UNPAID\x10\x02\x42\t\n\x07_bolt11B\t\n\x07_bolt12B\x0e\n\x0c_amount_msatB\x0e\n\x0c_descriptionB\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\x11\n\x0f_local_offer_idB\x14\n\x12_invreq_payer_note\"\xfa\x01\n\x0eInvoiceRequest\x12%\n\x0b\x61mount_msat\x18\n \x01(\x0b\x32\x10.cln.AmountOrAny\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\r\n\x05label\x18\x03 \x01(\t\x12\x13\n\x06\x65xpiry\x18\x07 \x01(\x04H\x00\x88\x01\x01\x12\x11\n\tfallbacks\x18\x04 \x03(\t\x12\x15\n\x08preimage\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x11\n\x04\x63ltv\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x19\n\x0c\x64\x65schashonly\x18\t \x01(\x08H\x03\x88\x01\x01\x42\t\n\x07_expiryB\x0b\n\t_preimageB\x07\n\x05_cltvB\x0f\n\r_deschashonly\"\x95\x03\n\x0fInvoiceResponse\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\x0c\x12\x16\n\x0epayment_secret\x18\x03 \x01(\x0c\x12\x12\n\nexpires_at\x18\x04 \x01(\x04\x12\x1a\n\rcreated_index\x18\n \x01(\x04H\x00\x88\x01\x01\x12\x1d\n\x10warning_capacity\x18\x05 \x01(\tH\x01\x88\x01\x01\x12\x1c\n\x0fwarning_offline\x18\x06 \x01(\tH\x02\x88\x01\x01\x12\x1d\n\x10warning_deadends\x18\x07 \x01(\tH\x03\x88\x01\x01\x12#\n\x16warning_private_unused\x18\x08 \x01(\tH\x04\x88\x01\x01\x12\x18\n\x0bwarning_mpp\x18\t \x01(\tH\x05\x88\x01\x01\x42\x10\n\x0e_created_indexB\x13\n\x11_warning_capacityB\x12\n\x10_warning_offlineB\x13\n\x11_warning_deadendsB\x19\n\x17_warning_private_unusedB\x0e\n\x0c_warning_mpp\"#\n\x14ListdatastoreRequest\x12\x0b\n\x03key\x18\x02 \x03(\t\"G\n\x15ListdatastoreResponse\x12.\n\tdatastore\x18\x01 \x03(\x0b\x32\x1b.cln.ListdatastoreDatastore\"\x87\x01\n\x16ListdatastoreDatastore\x12\x0b\n\x03key\x18\x01 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x12\x13\n\x06string\x18\x04 \x01(\tH\x02\x88\x01\x01\x42\r\n\x0b_generationB\x06\n\x04_hexB\t\n\x07_string\"\xde\x02\n\x13ListinvoicesRequest\x12\x12\n\x05label\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x16\n\tinvstring\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x03 \x01(\x0cH\x02\x88\x01\x01\x12\x15\n\x08offer_id\x18\x04 \x01(\tH\x03\x88\x01\x01\x12>\n\x05index\x18\x05 \x01(\x0e\x32*.cln.ListinvoicesRequest.ListinvoicesIndexH\x04\x88\x01\x01\x12\x12\n\x05start\x18\x06 \x01(\x04H\x05\x88\x01\x01\x12\x12\n\x05limit\x18\x07 \x01(\rH\x06\x88\x01\x01\"-\n\x11ListinvoicesIndex\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07UPDATED\x10\x01\x42\x08\n\x06_labelB\x0c\n\n_invstringB\x0f\n\r_payment_hashB\x0b\n\t_offer_idB\x08\n\x06_indexB\x08\n\x06_startB\x08\n\x06_limit\"C\n\x14ListinvoicesResponse\x12+\n\x08invoices\x18\x01 \x03(\x0b\x32\x19.cln.ListinvoicesInvoices\"\xd4\x06\n\x14ListinvoicesInvoices\x12\r\n\x05label\x18\x01 \x01(\t\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x44\n\x06status\x18\x04 \x01(\x0e\x32\x34.cln.ListinvoicesInvoices.ListinvoicesInvoicesStatus\x12\x12\n\nexpires_at\x18\x05 \x01(\x04\x12%\n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x08 \x01(\tH\x03\x88\x01\x01\x12\x1b\n\x0elocal_offer_id\x18\t \x01(\x0cH\x04\x88\x01\x01\x12\x1e\n\x11invreq_payer_note\x18\x0f \x01(\tH\x05\x88\x01\x01\x12\x1a\n\rcreated_index\x18\x10 \x01(\x04H\x06\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x11 \x01(\x04H\x07\x88\x01\x01\x12\x16\n\tpay_index\x18\x0b \x01(\x04H\x08\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\x0c \x01(\x0b\x32\x0b.cln.AmountH\t\x88\x01\x01\x12\x14\n\x07paid_at\x18\r \x01(\x04H\n\x88\x01\x01\x12\x42\n\rpaid_outpoint\x18\x12 \x01(\x0b\x32&.cln.ListinvoicesInvoicesPaid_outpointH\x0b\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0e \x01(\x0cH\x0c\x88\x01\x01\"?\n\x1aListinvoicesInvoicesStatus\x12\n\n\x06UNPAID\x10\x00\x12\x08\n\x04PAID\x10\x01\x12\x0b\n\x07\x45XPIRED\x10\x02\x42\x0e\n\x0c_descriptionB\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\t\n\x07_bolt12B\x11\n\x0f_local_offer_idB\x14\n\x12_invreq_payer_noteB\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x10\n\x0e_paid_outpointB\x13\n\x11_payment_preimage\"_\n!ListinvoicesInvoicesPaid_outpoint\x12\x11\n\x04txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x13\n\x06outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_txidB\t\n\x07_outnum\"\x8a\x03\n\x10SendonionRequest\x12\r\n\x05onion\x18\x01 \x01(\x0c\x12*\n\tfirst_hop\x18\x02 \x01(\x0b\x32\x17.cln.SendonionFirst_hop\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x12\n\x05label\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x16\n\x0eshared_secrets\x18\x05 \x03(\x0c\x12\x13\n\x06partid\x18\x06 \x01(\rH\x01\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x02\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x0c \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\t \x01(\x0cH\x04\x88\x01\x01\x12\x1a\n\rlocalinvreqid\x18\r \x01(\x0cH\x05\x88\x01\x01\x12\x14\n\x07groupid\x18\x0b \x01(\x04H\x06\x88\x01\x01\x42\x08\n\x06_labelB\t\n\x07_partidB\t\n\x07_bolt11B\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x10\n\x0e_localinvreqidB\n\n\x08_groupid\"\xe7\x04\n\x11SendonionResponse\x12\x1a\n\rcreated_index\x18\x0e \x01(\x04H\x00\x88\x01\x01\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\x0c\x12\x36\n\x06status\x18\x03 \x01(\x0e\x32&.cln.SendonionResponse.SendonionStatus\x12%\n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x05 \x01(\x0cH\x02\x88\x01\x01\x12\x12\n\ncreated_at\x18\x06 \x01(\x04\x12%\n\x10\x61mount_sent_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\x08 \x01(\tH\x03\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\t \x01(\tH\x04\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\n \x01(\tH\x05\x88\x01\x01\x12\x13\n\x06partid\x18\r \x01(\x04H\x06\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x0f \x01(\x04H\x07\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0b \x01(\x0cH\x08\x88\x01\x01\x12\x14\n\x07message\x18\x0c \x01(\tH\t\x88\x01\x01\",\n\x0fSendonionStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x42\x10\n\x0e_created_indexB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x08\n\x06_labelB\t\n\x07_bolt11B\t\n\x07_bolt12B\t\n\x07_partidB\x10\n\x0e_updated_indexB\x13\n\x11_payment_preimageB\n\n\x08_message\"Q\n\x12SendonionFirst_hop\x12\n\n\x02id\x18\x01 \x01(\x0c\x12 \n\x0b\x61mount_msat\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\x12\r\n\x05\x64\x65lay\x18\x03 \x01(\r\"\xa0\x03\n\x13ListsendpaysRequest\x12\x13\n\x06\x62olt11\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12@\n\x06status\x18\x03 \x01(\x0e\x32+.cln.ListsendpaysRequest.ListsendpaysStatusH\x02\x88\x01\x01\x12>\n\x05index\x18\x04 \x01(\x0e\x32*.cln.ListsendpaysRequest.ListsendpaysIndexH\x03\x88\x01\x01\x12\x12\n\x05start\x18\x05 \x01(\x04H\x04\x88\x01\x01\x12\x12\n\x05limit\x18\x06 \x01(\rH\x05\x88\x01\x01\";\n\x12ListsendpaysStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\"-\n\x11ListsendpaysIndex\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07UPDATED\x10\x01\x42\t\n\x07_bolt11B\x0f\n\r_payment_hashB\t\n\x07_statusB\x08\n\x06_indexB\x08\n\x06_startB\x08\n\x06_limit\"C\n\x14ListsendpaysResponse\x12+\n\x08payments\x18\x01 \x03(\x0b\x32\x19.cln.ListsendpaysPayments\"\xd0\x05\n\x14ListsendpaysPayments\x12\x1a\n\rcreated_index\x18\x10 \x01(\x04H\x00\x88\x01\x01\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x0f\n\x07groupid\x18\x02 \x01(\x04\x12\x13\n\x06partid\x18\x0f \x01(\x04H\x01\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x1a\n\rupdated_index\x18\x11 \x01(\x04H\x02\x88\x01\x01\x12\x44\n\x06status\x18\x04 \x01(\x0e\x32\x34.cln.ListsendpaysPayments.ListsendpaysPaymentsStatus\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x06 \x01(\x0cH\x04\x88\x01\x01\x12\x12\n\ncreated_at\x18\x07 \x01(\x04\x12%\n\x10\x61mount_sent_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\t \x01(\tH\x05\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\n \x01(\tH\x06\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x0e \x01(\tH\x07\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x0b \x01(\tH\x08\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\t\x88\x01\x01\x12\x17\n\nerroronion\x18\r \x01(\x0cH\n\x88\x01\x01\"C\n\x1aListsendpaysPaymentsStatus\x12\x0b\n\x07PENDING\x10\x00\x12\n\n\x06\x46\x41ILED\x10\x01\x12\x0c\n\x08\x43OMPLETE\x10\x02\x42\x10\n\x0e_created_indexB\t\n\x07_partidB\x10\n\x0e_updated_indexB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x08\n\x06_labelB\t\n\x07_bolt11B\x0e\n\x0c_descriptionB\t\n\x07_bolt12B\x13\n\x11_payment_preimageB\r\n\x0b_erroronion\"\x19\n\x17ListtransactionsRequest\"S\n\x18ListtransactionsResponse\x12\x37\n\x0ctransactions\x18\x01 \x03(\x0b\x32!.cln.ListtransactionsTransactions\"\xf8\x01\n\x1cListtransactionsTransactions\x12\x0c\n\x04hash\x18\x01 \x01(\x0c\x12\r\n\x05rawtx\x18\x02 \x01(\x0c\x12\x13\n\x0b\x62lockheight\x18\x03 \x01(\r\x12\x0f\n\x07txindex\x18\x04 \x01(\r\x12\x10\n\x08locktime\x18\x07 \x01(\r\x12\x0f\n\x07version\x18\x08 \x01(\r\x12\x37\n\x06inputs\x18\t \x03(\x0b\x32\'.cln.ListtransactionsTransactionsInputs\x12\x39\n\x07outputs\x18\n \x03(\x0b\x32(.cln.ListtransactionsTransactionsOutputs\"S\n\"ListtransactionsTransactionsInputs\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\r\n\x05index\x18\x02 \x01(\r\x12\x10\n\x08sequence\x18\x03 \x01(\r\"l\n#ListtransactionsTransactionsOutputs\x12\r\n\x05index\x18\x01 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12\x14\n\x0cscriptPubKey\x18\x03 \x01(\x0c\"\xda\x03\n\nPayRequest\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\x12%\n\x0b\x61mount_msat\x18\r \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x12\n\x05label\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x17\n\nriskfactor\x18\x08 \x01(\x01H\x02\x88\x01\x01\x12\x1a\n\rmaxfeepercent\x18\x04 \x01(\x01H\x03\x88\x01\x01\x12\x16\n\tretry_for\x18\x05 \x01(\rH\x04\x88\x01\x01\x12\x15\n\x08maxdelay\x18\x06 \x01(\rH\x05\x88\x01\x01\x12#\n\texemptfee\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x1a\n\rlocalinvreqid\x18\x0e \x01(\x0cH\x07\x88\x01\x01\x12\x0f\n\x07\x65xclude\x18\n \x03(\t\x12 \n\x06maxfee\x18\x0b \x01(\x0b\x32\x0b.cln.AmountH\x08\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x0c \x01(\tH\t\x88\x01\x01\x42\x0e\n\x0c_amount_msatB\x08\n\x06_labelB\r\n\x0b_riskfactorB\x10\n\x0e_maxfeepercentB\x0c\n\n_retry_forB\x0b\n\t_maxdelayB\x0c\n\n_exemptfeeB\x10\n\x0e_localinvreqidB\t\n\x07_maxfeeB\x0e\n\x0c_description\"\xfb\x02\n\x0bPayResponse\x12\x18\n\x10payment_preimage\x18\x01 \x01(\x0c\x12\x18\n\x0b\x64\x65stination\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x12\n\ncreated_at\x18\x04 \x01(\x01\x12\r\n\x05parts\x18\x05 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10\x61mount_sent_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\'\n\x1awarning_partial_completion\x18\x08 \x01(\tH\x01\x88\x01\x01\x12*\n\x06status\x18\t \x01(\x0e\x32\x1a.cln.PayResponse.PayStatus\"2\n\tPayStatus\x12\x0c\n\x08\x43OMPLETE\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x42\x0e\n\x0c_destinationB\x1d\n\x1b_warning_partial_completion\"*\n\x10ListnodesRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x05\n\x03_id\"7\n\x11ListnodesResponse\x12\"\n\x05nodes\x18\x01 \x03(\x0b\x32\x13.cln.ListnodesNodes\"\xe1\x01\n\x0eListnodesNodes\x12\x0e\n\x06nodeid\x18\x01 \x01(\x0c\x12\x1b\n\x0elast_timestamp\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x12\n\x05\x61lias\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x12\n\x05\x63olor\x18\x04 \x01(\x0cH\x02\x88\x01\x01\x12\x15\n\x08\x66\x65\x61tures\x18\x05 \x01(\x0cH\x03\x88\x01\x01\x12/\n\taddresses\x18\x06 \x03(\x0b\x32\x1c.cln.ListnodesNodesAddressesB\x11\n\x0f_last_timestampB\x08\n\x06_aliasB\x08\n\x06_colorB\x0b\n\t_features\"\xe8\x01\n\x17ListnodesNodesAddresses\x12K\n\titem_type\x18\x01 \x01(\x0e\x32\x38.cln.ListnodesNodesAddresses.ListnodesNodesAddressesType\x12\x0c\n\x04port\x18\x02 \x01(\r\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x00\x88\x01\x01\"P\n\x1bListnodesNodesAddressesType\x12\x07\n\x03\x44NS\x10\x00\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\n\n\x08_address\"g\n\x15WaitanyinvoiceRequest\x12\x1a\n\rlastpay_index\x18\x01 \x01(\x04H\x00\x88\x01\x01\x12\x14\n\x07timeout\x18\x02 \x01(\x04H\x01\x88\x01\x01\x42\x10\n\x0e_lastpay_indexB\n\n\x08_timeout\"\xbf\x05\n\x16WaitanyinvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12@\n\x06status\x18\x04 \x01(\x0e\x32\x30.cln.WaitanyinvoiceResponse.WaitanyinvoiceStatus\x12\x12\n\nexpires_at\x18\x05 \x01(\x04\x12%\n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x08 \x01(\tH\x02\x88\x01\x01\x12\x1a\n\rcreated_index\x18\r \x01(\x04H\x03\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x0e \x01(\x04H\x04\x88\x01\x01\x12\x16\n\tpay_index\x18\t \x01(\x04H\x05\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x14\n\x07paid_at\x18\x0b \x01(\x04H\x07\x88\x01\x01\x12<\n\rpaid_outpoint\x18\x0f \x01(\x0b\x32 .cln.WaitanyinvoicePaid_outpointH\x08\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\t\x88\x01\x01\"-\n\x14WaitanyinvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x42\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\t\n\x07_bolt12B\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x10\n\x0e_paid_outpointB\x13\n\x11_payment_preimage\"Y\n\x1bWaitanyinvoicePaid_outpoint\x12\x11\n\x04txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x13\n\x06outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_txidB\t\n\x07_outnum\"#\n\x12WaitinvoiceRequest\x12\r\n\x05label\x18\x01 \x01(\t\"\xb0\x05\n\x13WaitinvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12:\n\x06status\x18\x04 \x01(\x0e\x32*.cln.WaitinvoiceResponse.WaitinvoiceStatus\x12\x12\n\nexpires_at\x18\x05 \x01(\x04\x12%\n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x08 \x01(\tH\x02\x88\x01\x01\x12\x1a\n\rcreated_index\x18\r \x01(\x04H\x03\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x0e \x01(\x04H\x04\x88\x01\x01\x12\x16\n\tpay_index\x18\t \x01(\x04H\x05\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x14\n\x07paid_at\x18\x0b \x01(\x04H\x07\x88\x01\x01\x12\x39\n\rpaid_outpoint\x18\x0f \x01(\x0b\x32\x1d.cln.WaitinvoicePaid_outpointH\x08\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\t\x88\x01\x01\"*\n\x11WaitinvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x42\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\t\n\x07_bolt12B\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x10\n\x0e_paid_outpointB\x13\n\x11_payment_preimage\"V\n\x18WaitinvoicePaid_outpoint\x12\x11\n\x04txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x13\n\x06outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_txidB\t\n\x07_outnum\"\x8e\x01\n\x12WaitsendpayRequest\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x14\n\x07timeout\x18\x03 \x01(\rH\x00\x88\x01\x01\x12\x13\n\x06partid\x18\x02 \x01(\x04H\x01\x88\x01\x01\x12\x14\n\x07groupid\x18\x04 \x01(\x04H\x02\x88\x01\x01\x42\n\n\x08_timeoutB\t\n\x07_partidB\n\n\x08_groupid\"\x8e\x05\n\x13WaitsendpayResponse\x12\x1a\n\rcreated_index\x18\x0f \x01(\x04H\x00\x88\x01\x01\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x14\n\x07groupid\x18\x02 \x01(\x04H\x01\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12:\n\x06status\x18\x04 \x01(\x0e\x32*.cln.WaitsendpayResponse.WaitsendpayStatus\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x06 \x01(\x0cH\x03\x88\x01\x01\x12\x12\n\ncreated_at\x18\x07 \x01(\x04\x12\x1a\n\rupdated_index\x18\x10 \x01(\x04H\x04\x88\x01\x01\x12\x19\n\x0c\x63ompleted_at\x18\x0e \x01(\x01H\x05\x88\x01\x01\x12%\n\x10\x61mount_sent_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\t \x01(\tH\x06\x88\x01\x01\x12\x13\n\x06partid\x18\n \x01(\x04H\x07\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x0b \x01(\tH\x08\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x0c \x01(\tH\t\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\r \x01(\x0cH\n\x88\x01\x01\"!\n\x11WaitsendpayStatus\x12\x0c\n\x08\x43OMPLETE\x10\x00\x42\x10\n\x0e_created_indexB\n\n\x08_groupidB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x10\n\x0e_updated_indexB\x0f\n\r_completed_atB\x08\n\x06_labelB\t\n\x07_partidB\t\n\x07_bolt11B\t\n\x07_bolt12B\x13\n\x11_payment_preimage\"\x97\x01\n\x0eNewaddrRequest\x12@\n\x0b\x61\x64\x64resstype\x18\x01 \x01(\x0e\x32&.cln.NewaddrRequest.NewaddrAddresstypeH\x00\x88\x01\x01\"3\n\x12NewaddrAddresstype\x12\n\n\x06\x42\x45\x43H32\x10\x00\x12\x08\n\x04P2TR\x10\x03\x12\x07\n\x03\x41LL\x10\x02\x42\x0e\n\x0c_addresstype\"M\n\x0fNewaddrResponse\x12\x11\n\x04p2tr\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06\x62\x65\x63h32\x18\x01 \x01(\tH\x01\x88\x01\x01\x42\x07\n\x05_p2trB\t\n\x07_bech32\"\xca\x01\n\x0fWithdrawRequest\x12\x13\n\x0b\x64\x65stination\x18\x01 \x01(\t\x12&\n\x07satoshi\x18\x02 \x01(\x0b\x32\x10.cln.AmountOrAllH\x00\x88\x01\x01\x12\"\n\x07\x66\x65\x65rate\x18\x05 \x01(\x0b\x32\x0c.cln.FeerateH\x01\x88\x01\x01\x12\x14\n\x07minconf\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\x1c\n\x05utxos\x18\x04 \x03(\x0b\x32\r.cln.OutpointB\n\n\x08_satoshiB\n\n\x08_feerateB\n\n\x08_minconf\":\n\x10WithdrawResponse\x12\n\n\x02tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\x12\x0c\n\x04psbt\x18\x03 \x01(\t\"\x82\x03\n\x0eKeysendRequest\x12\x13\n\x0b\x64\x65stination\x18\x01 \x01(\x0c\x12 \n\x0b\x61mount_msat\x18\n \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x1a\n\rmaxfeepercent\x18\x04 \x01(\x01H\x01\x88\x01\x01\x12\x16\n\tretry_for\x18\x05 \x01(\rH\x02\x88\x01\x01\x12\x15\n\x08maxdelay\x18\x06 \x01(\rH\x03\x88\x01\x01\x12#\n\texemptfee\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x12+\n\nroutehints\x18\x08 \x01(\x0b\x32\x12.cln.RoutehintListH\x05\x88\x01\x01\x12&\n\textratlvs\x18\t \x01(\x0b\x32\x0e.cln.TlvStreamH\x06\x88\x01\x01\x42\x08\n\x06_labelB\x10\n\x0e_maxfeepercentB\x0c\n\n_retry_forB\x0b\n\t_maxdelayB\x0c\n\n_exemptfeeB\r\n\x0b_routehintsB\x0c\n\n_extratlvs\"\xf2\x02\n\x0fKeysendResponse\x12\x18\n\x10payment_preimage\x18\x01 \x01(\x0c\x12\x18\n\x0b\x64\x65stination\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x12\n\ncreated_at\x18\x04 \x01(\x01\x12\r\n\x05parts\x18\x05 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10\x61mount_sent_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\'\n\x1awarning_partial_completion\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\x32\n\x06status\x18\t \x01(\x0e\x32\".cln.KeysendResponse.KeysendStatus\"\x1d\n\rKeysendStatus\x12\x0c\n\x08\x43OMPLETE\x10\x00\x42\x0e\n\x0c_destinationB\x1d\n\x1b_warning_partial_completion\"\xa4\x03\n\x0f\x46undpsbtRequest\x12!\n\x07satoshi\x18\x01 \x01(\x0b\x32\x10.cln.AmountOrAll\x12\x1d\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.Feerate\x12\x13\n\x0bstartweight\x18\x03 \x01(\r\x12\x14\n\x07minconf\x18\x04 \x01(\rH\x00\x88\x01\x01\x12\x14\n\x07reserve\x18\x05 \x01(\rH\x01\x88\x01\x01\x12\x15\n\x08locktime\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x1f\n\x12min_witness_weight\x18\x07 \x01(\rH\x03\x88\x01\x01\x12\x1d\n\x10\x65xcess_as_change\x18\x08 \x01(\x08H\x04\x88\x01\x01\x12\x17\n\nnonwrapped\x18\t \x01(\x08H\x05\x88\x01\x01\x12#\n\x16opening_anchor_channel\x18\n \x01(\x08H\x06\x88\x01\x01\x42\n\n\x08_minconfB\n\n\x08_reserveB\x0b\n\t_locktimeB\x15\n\x13_min_witness_weightB\x13\n\x11_excess_as_changeB\r\n\x0b_nonwrappedB\x19\n\x17_opening_anchor_channel\"\xd9\x01\n\x10\x46undpsbtResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x16\n\x0e\x66\x65\x65rate_per_kw\x18\x02 \x01(\r\x12\x1e\n\x16\x65stimated_final_weight\x18\x03 \x01(\r\x12 \n\x0b\x65xcess_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\x1a\n\rchange_outnum\x18\x05 \x01(\rH\x00\x88\x01\x01\x12/\n\x0creservations\x18\x06 \x03(\x0b\x32\x19.cln.FundpsbtReservationsB\x10\n\x0e_change_outnum\"u\n\x14\x46undpsbtReservations\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x0c\n\x04vout\x18\x02 \x01(\r\x12\x14\n\x0cwas_reserved\x18\x03 \x01(\x08\x12\x10\n\x08reserved\x18\x04 \x01(\x08\x12\x19\n\x11reserved_to_block\x18\x05 \x01(\r\"A\n\x0fSendpsbtRequest\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x14\n\x07reserve\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\n\n\x08_reserve\",\n\x10SendpsbtResponse\x12\n\n\x02tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\"1\n\x0fSignpsbtRequest\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x10\n\x08signonly\x18\x02 \x03(\r\"\'\n\x10SignpsbtResponse\x12\x13\n\x0bsigned_psbt\x18\x01 \x01(\t\"\x9b\x03\n\x0fUtxopsbtRequest\x12\x1c\n\x07satoshi\x18\x01 \x01(\x0b\x32\x0b.cln.Amount\x12\x1d\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.Feerate\x12\x13\n\x0bstartweight\x18\x03 \x01(\r\x12\x1c\n\x05utxos\x18\x04 \x03(\x0b\x32\r.cln.Outpoint\x12\x14\n\x07reserve\x18\x05 \x01(\rH\x00\x88\x01\x01\x12\x17\n\nreservedok\x18\x08 \x01(\x08H\x01\x88\x01\x01\x12\x15\n\x08locktime\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x1f\n\x12min_witness_weight\x18\x07 \x01(\rH\x03\x88\x01\x01\x12\x1d\n\x10\x65xcess_as_change\x18\t \x01(\x08H\x04\x88\x01\x01\x12#\n\x16opening_anchor_channel\x18\n \x01(\x08H\x05\x88\x01\x01\x42\n\n\x08_reserveB\r\n\x0b_reservedokB\x0b\n\t_locktimeB\x15\n\x13_min_witness_weightB\x13\n\x11_excess_as_changeB\x19\n\x17_opening_anchor_channel\"\xd9\x01\n\x10UtxopsbtResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x16\n\x0e\x66\x65\x65rate_per_kw\x18\x02 \x01(\r\x12\x1e\n\x16\x65stimated_final_weight\x18\x03 \x01(\r\x12 \n\x0b\x65xcess_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\x1a\n\rchange_outnum\x18\x05 \x01(\rH\x00\x88\x01\x01\x12/\n\x0creservations\x18\x06 \x03(\x0b\x32\x19.cln.UtxopsbtReservationsB\x10\n\x0e_change_outnum\"u\n\x14UtxopsbtReservations\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x0c\n\x04vout\x18\x02 \x01(\r\x12\x14\n\x0cwas_reserved\x18\x03 \x01(\x08\x12\x10\n\x08reserved\x18\x04 \x01(\x08\x12\x19\n\x11reserved_to_block\x18\x05 \x01(\r\" \n\x10TxdiscardRequest\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\"6\n\x11TxdiscardResponse\x12\x13\n\x0bunsigned_tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\"\xa4\x01\n\x10TxprepareRequest\x12 \n\x07outputs\x18\x05 \x03(\x0b\x32\x0f.cln.OutputDesc\x12\"\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.FeerateH\x00\x88\x01\x01\x12\x14\n\x07minconf\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x1c\n\x05utxos\x18\x04 \x03(\x0b\x32\r.cln.OutpointB\n\n\x08_feerateB\n\n\x08_minconf\"D\n\x11TxprepareResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x13\n\x0bunsigned_tx\x18\x02 \x01(\x0c\x12\x0c\n\x04txid\x18\x03 \x01(\x0c\"\x1d\n\rTxsendRequest\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\"8\n\x0eTxsendResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\n\n\x02tx\x18\x02 \x01(\x0c\x12\x0c\n\x04txid\x18\x03 \x01(\x0c\"1\n\x17ListpeerchannelsRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x05\n\x03_id\"K\n\x18ListpeerchannelsResponse\x12/\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x1d.cln.ListpeerchannelsChannels\"\x8a\x1b\n\x18ListpeerchannelsChannels\x12\x14\n\x07peer_id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x1b\n\x0epeer_connected\x18\x02 \x01(\x08H\x01\x88\x01\x01\x12O\n\x05state\x18\x03 \x01(\x0e\x32;.cln.ListpeerchannelsChannels.ListpeerchannelsChannelsStateH\x02\x88\x01\x01\x12\x19\n\x0cscratch_txid\x18\x04 \x01(\x0cH\x03\x88\x01\x01\x12:\n\x07updates\x18\x37 \x01(\x0b\x32$.cln.ListpeerchannelsChannelsUpdatesH\x04\x88\x01\x01\x12\x1e\n\x11ignore_fee_limits\x18\x36 \x01(\x08H\x05\x88\x01\x01\x12\x17\n\nlost_state\x18\x39 \x01(\x08H\x06\x88\x01\x01\x12:\n\x07\x66\x65\x65rate\x18\x06 \x01(\x0b\x32$.cln.ListpeerchannelsChannelsFeerateH\x07\x88\x01\x01\x12\x12\n\x05owner\x18\x07 \x01(\tH\x08\x88\x01\x01\x12\x1d\n\x10short_channel_id\x18\x08 \x01(\tH\t\x88\x01\x01\x12\x17\n\nchannel_id\x18\t \x01(\x0cH\n\x88\x01\x01\x12\x19\n\x0c\x66unding_txid\x18\n \x01(\x0cH\x0b\x88\x01\x01\x12\x1b\n\x0e\x66unding_outnum\x18\x0b \x01(\rH\x0c\x88\x01\x01\x12\x1c\n\x0finitial_feerate\x18\x0c \x01(\tH\r\x88\x01\x01\x12\x19\n\x0clast_feerate\x18\r \x01(\tH\x0e\x88\x01\x01\x12\x19\n\x0cnext_feerate\x18\x0e \x01(\tH\x0f\x88\x01\x01\x12\x1a\n\rnext_fee_step\x18\x0f \x01(\rH\x10\x88\x01\x01\x12\x37\n\x08inflight\x18\x10 \x03(\x0b\x32%.cln.ListpeerchannelsChannelsInflight\x12\x15\n\x08\x63lose_to\x18\x11 \x01(\x0cH\x11\x88\x01\x01\x12\x14\n\x07private\x18\x12 \x01(\x08H\x12\x88\x01\x01\x12%\n\x06opener\x18\x13 \x01(\x0e\x32\x10.cln.ChannelSideH\x13\x88\x01\x01\x12%\n\x06\x63loser\x18\x14 \x01(\x0e\x32\x10.cln.ChannelSideH\x14\x88\x01\x01\x12:\n\x07\x66unding\x18\x16 \x01(\x0b\x32$.cln.ListpeerchannelsChannelsFundingH\x15\x88\x01\x01\x12$\n\nto_us_msat\x18\x17 \x01(\x0b\x32\x0b.cln.AmountH\x16\x88\x01\x01\x12(\n\x0emin_to_us_msat\x18\x18 \x01(\x0b\x32\x0b.cln.AmountH\x17\x88\x01\x01\x12(\n\x0emax_to_us_msat\x18\x19 \x01(\x0b\x32\x0b.cln.AmountH\x18\x88\x01\x01\x12$\n\ntotal_msat\x18\x1a \x01(\x0b\x32\x0b.cln.AmountH\x19\x88\x01\x01\x12\'\n\rfee_base_msat\x18\x1b \x01(\x0b\x32\x0b.cln.AmountH\x1a\x88\x01\x01\x12(\n\x1b\x66\x65\x65_proportional_millionths\x18\x1c \x01(\rH\x1b\x88\x01\x01\x12)\n\x0f\x64ust_limit_msat\x18\x1d \x01(\x0b\x32\x0b.cln.AmountH\x1c\x88\x01\x01\x12\x30\n\x16max_total_htlc_in_msat\x18\x1e \x01(\x0b\x32\x0b.cln.AmountH\x1d\x88\x01\x01\x12,\n\x12their_reserve_msat\x18\x1f \x01(\x0b\x32\x0b.cln.AmountH\x1e\x88\x01\x01\x12*\n\x10our_reserve_msat\x18 \x01(\x0b\x32\x0b.cln.AmountH\x1f\x88\x01\x01\x12(\n\x0espendable_msat\x18! \x01(\x0b\x32\x0b.cln.AmountH \x88\x01\x01\x12)\n\x0freceivable_msat\x18\" \x01(\x0b\x32\x0b.cln.AmountH!\x88\x01\x01\x12.\n\x14minimum_htlc_in_msat\x18# \x01(\x0b\x32\x0b.cln.AmountH\"\x88\x01\x01\x12/\n\x15minimum_htlc_out_msat\x18$ \x01(\x0b\x32\x0b.cln.AmountH#\x88\x01\x01\x12/\n\x15maximum_htlc_out_msat\x18% \x01(\x0b\x32\x0b.cln.AmountH$\x88\x01\x01\x12 \n\x13their_to_self_delay\x18& \x01(\rH%\x88\x01\x01\x12\x1e\n\x11our_to_self_delay\x18\' \x01(\rH&\x88\x01\x01\x12\x1f\n\x12max_accepted_htlcs\x18( \x01(\rH\'\x88\x01\x01\x12\x36\n\x05\x61lias\x18) \x01(\x0b\x32\".cln.ListpeerchannelsChannelsAliasH(\x88\x01\x01\x12\x0e\n\x06status\x18+ \x03(\t\x12 \n\x13in_payments_offered\x18, \x01(\x04H)\x88\x01\x01\x12)\n\x0fin_offered_msat\x18- \x01(\x0b\x32\x0b.cln.AmountH*\x88\x01\x01\x12\"\n\x15in_payments_fulfilled\x18. \x01(\x04H+\x88\x01\x01\x12+\n\x11in_fulfilled_msat\x18/ \x01(\x0b\x32\x0b.cln.AmountH,\x88\x01\x01\x12!\n\x14out_payments_offered\x18\x30 \x01(\x04H-\x88\x01\x01\x12*\n\x10out_offered_msat\x18\x31 \x01(\x0b\x32\x0b.cln.AmountH.\x88\x01\x01\x12#\n\x16out_payments_fulfilled\x18\x32 \x01(\x04H/\x88\x01\x01\x12,\n\x12out_fulfilled_msat\x18\x33 \x01(\x0b\x32\x0b.cln.AmountH0\x88\x01\x01\x12#\n\x16last_stable_connection\x18\x38 \x01(\x04H1\x88\x01\x01\x12\x31\n\x05htlcs\x18\x34 \x03(\x0b\x32\".cln.ListpeerchannelsChannelsHtlcs\x12\x1a\n\rclose_to_addr\x18\x35 \x01(\tH2\x88\x01\x01\"\x80\x03\n\x1dListpeerchannelsChannelsState\x12\x0c\n\x08OPENINGD\x10\x00\x12\x1c\n\x18\x43HANNELD_AWAITING_LOCKIN\x10\x01\x12\x13\n\x0f\x43HANNELD_NORMAL\x10\x02\x12\x1a\n\x16\x43HANNELD_SHUTTING_DOWN\x10\x03\x12\x18\n\x14\x43LOSINGD_SIGEXCHANGE\x10\x04\x12\x15\n\x11\x43LOSINGD_COMPLETE\x10\x05\x12\x17\n\x13\x41WAITING_UNILATERAL\x10\x06\x12\x16\n\x12\x46UNDING_SPEND_SEEN\x10\x07\x12\x0b\n\x07ONCHAIN\x10\x08\x12\x17\n\x13\x44UALOPEND_OPEN_INIT\x10\t\x12\x1d\n\x19\x44UALOPEND_AWAITING_LOCKIN\x10\n\x12\x1c\n\x18\x43HANNELD_AWAITING_SPLICE\x10\x0b\x12\x1c\n\x18\x44UALOPEND_OPEN_COMMITTED\x10\x0c\x12\x1f\n\x1b\x44UALOPEND_OPEN_COMMIT_READY\x10\rB\n\n\x08_peer_idB\x11\n\x0f_peer_connectedB\x08\n\x06_stateB\x0f\n\r_scratch_txidB\n\n\x08_updatesB\x14\n\x12_ignore_fee_limitsB\r\n\x0b_lost_stateB\n\n\x08_feerateB\x08\n\x06_ownerB\x13\n\x11_short_channel_idB\r\n\x0b_channel_idB\x0f\n\r_funding_txidB\x11\n\x0f_funding_outnumB\x12\n\x10_initial_feerateB\x0f\n\r_last_feerateB\x0f\n\r_next_feerateB\x10\n\x0e_next_fee_stepB\x0b\n\t_close_toB\n\n\x08_privateB\t\n\x07_openerB\t\n\x07_closerB\n\n\x08_fundingB\r\n\x0b_to_us_msatB\x11\n\x0f_min_to_us_msatB\x11\n\x0f_max_to_us_msatB\r\n\x0b_total_msatB\x10\n\x0e_fee_base_msatB\x1e\n\x1c_fee_proportional_millionthsB\x12\n\x10_dust_limit_msatB\x19\n\x17_max_total_htlc_in_msatB\x15\n\x13_their_reserve_msatB\x13\n\x11_our_reserve_msatB\x11\n\x0f_spendable_msatB\x12\n\x10_receivable_msatB\x17\n\x15_minimum_htlc_in_msatB\x18\n\x16_minimum_htlc_out_msatB\x18\n\x16_maximum_htlc_out_msatB\x16\n\x14_their_to_self_delayB\x14\n\x12_our_to_self_delayB\x15\n\x13_max_accepted_htlcsB\x08\n\x06_aliasB\x16\n\x14_in_payments_offeredB\x12\n\x10_in_offered_msatB\x18\n\x16_in_payments_fulfilledB\x14\n\x12_in_fulfilled_msatB\x17\n\x15_out_payments_offeredB\x13\n\x11_out_offered_msatB\x19\n\x17_out_payments_fulfilledB\x15\n\x13_out_fulfilled_msatB\x19\n\x17_last_stable_connectionB\x10\n\x0e_close_to_addr\"\xb6\x01\n\x1fListpeerchannelsChannelsUpdates\x12=\n\x05local\x18\x01 \x01(\x0b\x32).cln.ListpeerchannelsChannelsUpdatesLocalH\x00\x88\x01\x01\x12?\n\x06remote\x18\x02 \x01(\x0b\x32*.cln.ListpeerchannelsChannelsUpdatesRemoteH\x01\x88\x01\x01\x42\x08\n\x06_localB\t\n\x07_remote\"\xe7\x02\n$ListpeerchannelsChannelsUpdatesLocal\x12+\n\x11htlc_minimum_msat\x18\x01 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12+\n\x11htlc_maximum_msat\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x1e\n\x11\x63ltv_expiry_delta\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\'\n\rfee_base_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12(\n\x1b\x66\x65\x65_proportional_millionths\x18\x05 \x01(\rH\x04\x88\x01\x01\x42\x14\n\x12_htlc_minimum_msatB\x14\n\x12_htlc_maximum_msatB\x14\n\x12_cltv_expiry_deltaB\x10\n\x0e_fee_base_msatB\x1e\n\x1c_fee_proportional_millionths\"\xe8\x02\n%ListpeerchannelsChannelsUpdatesRemote\x12+\n\x11htlc_minimum_msat\x18\x01 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12+\n\x11htlc_maximum_msat\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x1e\n\x11\x63ltv_expiry_delta\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\'\n\rfee_base_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12(\n\x1b\x66\x65\x65_proportional_millionths\x18\x05 \x01(\rH\x04\x88\x01\x01\x42\x14\n\x12_htlc_minimum_msatB\x14\n\x12_htlc_maximum_msatB\x14\n\x12_cltv_expiry_deltaB\x10\n\x0e_fee_base_msatB\x1e\n\x1c_fee_proportional_millionths\"]\n\x1fListpeerchannelsChannelsFeerate\x12\x12\n\x05perkw\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x12\n\x05perkb\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x08\n\x06_perkwB\x08\n\x06_perkb\"\x80\x03\n ListpeerchannelsChannelsInflight\x12\x19\n\x0c\x66unding_txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x1b\n\x0e\x66unding_outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x14\n\x07\x66\x65\x65rate\x18\x03 \x01(\tH\x02\x88\x01\x01\x12,\n\x12total_funding_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x1a\n\rsplice_amount\x18\x07 \x01(\x12H\x04\x88\x01\x01\x12*\n\x10our_funding_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x05\x88\x01\x01\x12\x19\n\x0cscratch_txid\x18\x06 \x01(\x0cH\x06\x88\x01\x01\x42\x0f\n\r_funding_txidB\x11\n\x0f_funding_outnumB\n\n\x08_feerateB\x15\n\x13_total_funding_msatB\x10\n\x0e_splice_amountB\x13\n\x11_our_funding_msatB\x0f\n\r_scratch_txid\"\xd2\x02\n\x1fListpeerchannelsChannelsFunding\x12%\n\x0bpushed_msat\x18\x01 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12*\n\x10local_funds_msat\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12+\n\x11remote_funds_msat\x18\x03 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12\'\n\rfee_paid_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\'\n\rfee_rcvd_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x42\x0e\n\x0c_pushed_msatB\x13\n\x11_local_funds_msatB\x14\n\x12_remote_funds_msatB\x10\n\x0e_fee_paid_msatB\x10\n\x0e_fee_rcvd_msat\"]\n\x1dListpeerchannelsChannelsAlias\x12\x12\n\x05local\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06remote\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_localB\t\n\x07_remote\"\xe2\x03\n\x1dListpeerchannelsChannelsHtlcs\x12\x61\n\tdirection\x18\x01 \x01(\x0e\x32I.cln.ListpeerchannelsChannelsHtlcs.ListpeerchannelsChannelsHtlcsDirectionH\x00\x88\x01\x01\x12\x0f\n\x02id\x18\x02 \x01(\x04H\x01\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12\x13\n\x06\x65xpiry\x18\x04 \x01(\rH\x03\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x05 \x01(\x0cH\x04\x88\x01\x01\x12\x1a\n\rlocal_trimmed\x18\x06 \x01(\x08H\x05\x88\x01\x01\x12\x13\n\x06status\x18\x07 \x01(\tH\x06\x88\x01\x01\x12\"\n\x05state\x18\x08 \x01(\x0e\x32\x0e.cln.HtlcStateH\x07\x88\x01\x01\"9\n&ListpeerchannelsChannelsHtlcsDirection\x12\x06\n\x02IN\x10\x00\x12\x07\n\x03OUT\x10\x01\x42\x0c\n\n_directionB\x05\n\x03_idB\x0e\n\x0c_amount_msatB\t\n\x07_expiryB\x0f\n\r_payment_hashB\x10\n\x0e_local_trimmedB\t\n\x07_statusB\x08\n\x06_state\"3\n\x19ListclosedchannelsRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x05\n\x03_id\"[\n\x1aListclosedchannelsResponse\x12=\n\x0e\x63losedchannels\x18\x01 \x03(\x0b\x32%.cln.ListclosedchannelsClosedchannels\"\xf2\t\n ListclosedchannelsClosedchannels\x12\x14\n\x07peer_id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x12\n\nchannel_id\x18\x02 \x01(\x0c\x12\x1d\n\x10short_channel_id\x18\x03 \x01(\tH\x01\x88\x01\x01\x12>\n\x05\x61lias\x18\x04 \x01(\x0b\x32*.cln.ListclosedchannelsClosedchannelsAliasH\x02\x88\x01\x01\x12 \n\x06opener\x18\x05 \x01(\x0e\x32\x10.cln.ChannelSide\x12%\n\x06\x63loser\x18\x06 \x01(\x0e\x32\x10.cln.ChannelSideH\x03\x88\x01\x01\x12\x0f\n\x07private\x18\x07 \x01(\x08\x12\x1f\n\x17total_local_commitments\x18\t \x01(\x04\x12 \n\x18total_remote_commitments\x18\n \x01(\x04\x12\x18\n\x10total_htlcs_sent\x18\x0b \x01(\x04\x12\x14\n\x0c\x66unding_txid\x18\x0c \x01(\x0c\x12\x16\n\x0e\x66unding_outnum\x18\r \x01(\r\x12\x0e\n\x06leased\x18\x0e \x01(\x08\x12/\n\x15\x66unding_fee_paid_msat\x18\x0f \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x12/\n\x15\x66unding_fee_rcvd_msat\x18\x10 \x01(\x0b\x32\x0b.cln.AmountH\x05\x88\x01\x01\x12-\n\x13\x66unding_pushed_msat\x18\x11 \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x1f\n\ntotal_msat\x18\x12 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10\x66inal_to_us_msat\x18\x13 \x01(\x0b\x32\x0b.cln.Amount\x12#\n\x0emin_to_us_msat\x18\x14 \x01(\x0b\x32\x0b.cln.Amount\x12#\n\x0emax_to_us_msat\x18\x15 \x01(\x0b\x32\x0b.cln.Amount\x12!\n\x14last_commitment_txid\x18\x16 \x01(\x0cH\x07\x88\x01\x01\x12\x32\n\x18last_commitment_fee_msat\x18\x17 \x01(\x0b\x32\x0b.cln.AmountH\x08\x88\x01\x01\x12\x66\n\x0b\x63lose_cause\x18\x18 \x01(\x0e\x32Q.cln.ListclosedchannelsClosedchannels.ListclosedchannelsClosedchannelsClose_cause\x12#\n\x16last_stable_connection\x18\x19 \x01(\x04H\t\x88\x01\x01\"v\n+ListclosedchannelsClosedchannelsClose_cause\x12\x0b\n\x07UNKNOWN\x10\x00\x12\t\n\x05LOCAL\x10\x01\x12\x08\n\x04USER\x10\x02\x12\n\n\x06REMOTE\x10\x03\x12\x0c\n\x08PROTOCOL\x10\x04\x12\x0b\n\x07ONCHAIN\x10\x05\x42\n\n\x08_peer_idB\x13\n\x11_short_channel_idB\x08\n\x06_aliasB\t\n\x07_closerB\x18\n\x16_funding_fee_paid_msatB\x18\n\x16_funding_fee_rcvd_msatB\x16\n\x14_funding_pushed_msatB\x17\n\x15_last_commitment_txidB\x1b\n\x19_last_commitment_fee_msatB\x19\n\x17_last_stable_connection\"e\n%ListclosedchannelsClosedchannelsAlias\x12\x12\n\x05local\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06remote\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_localB\t\n\x07_remote\"L\n\x10\x44\x65\x63odepayRequest\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_description\"\x8d\x04\n\x11\x44\x65\x63odepayResponse\x12\x10\n\x08\x63urrency\x18\x01 \x01(\t\x12\x12\n\ncreated_at\x18\x02 \x01(\x04\x12\x0e\n\x06\x65xpiry\x18\x03 \x01(\x04\x12\r\n\x05payee\x18\x04 \x01(\x0c\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x06 \x01(\x0c\x12\x11\n\tsignature\x18\x07 \x01(\t\x12\x18\n\x0b\x64\x65scription\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\x1d\n\x10\x64\x65scription_hash\x18\t \x01(\x0cH\x02\x88\x01\x01\x12\x1d\n\x15min_final_cltv_expiry\x18\n \x01(\r\x12\x1b\n\x0epayment_secret\x18\x0b \x01(\x0cH\x03\x88\x01\x01\x12\x15\n\x08\x66\x65\x61tures\x18\x0c \x01(\x0cH\x04\x88\x01\x01\x12\x1d\n\x10payment_metadata\x18\r \x01(\x0cH\x05\x88\x01\x01\x12*\n\tfallbacks\x18\x0e \x03(\x0b\x32\x17.cln.DecodepayFallbacks\x12\"\n\x05\x65xtra\x18\x10 \x03(\x0b\x32\x13.cln.DecodepayExtraB\x0e\n\x0c_amount_msatB\x0e\n\x0c_descriptionB\x13\n\x11_description_hashB\x11\n\x0f_payment_secretB\x0b\n\t_featuresB\x13\n\x11_payment_metadata\"\xd0\x01\n\x12\x44\x65\x63odepayFallbacks\x12\x41\n\titem_type\x18\x01 \x01(\x0e\x32..cln.DecodepayFallbacks.DecodepayFallbacksType\x12\x11\n\x04\x61\x64\x64r\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x0b\n\x03hex\x18\x03 \x01(\x0c\"N\n\x16\x44\x65\x63odepayFallbacksType\x12\t\n\x05P2PKH\x10\x00\x12\x08\n\x04P2SH\x10\x01\x12\n\n\x06P2WPKH\x10\x02\x12\t\n\x05P2WSH\x10\x03\x12\x08\n\x04P2TR\x10\x04\x42\x07\n\x05_addr\"+\n\x0e\x44\x65\x63odepayExtra\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\t\"\x1f\n\rDecodeRequest\x12\x0e\n\x06string\x18\x01 \x01(\t\"\xe8!\n\x0e\x44\x65\x63odeResponse\x12\x31\n\titem_type\x18\x01 \x01(\x0e\x32\x1e.cln.DecodeResponse.DecodeType\x12\r\n\x05valid\x18\x02 \x01(\x08\x12\x15\n\x08offer_id\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x12\x14\n\x0coffer_chains\x18\x04 \x03(\x0c\x12\x1b\n\x0eoffer_metadata\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x1b\n\x0eoffer_currency\x18\x06 \x01(\tH\x02\x88\x01\x01\x12+\n\x1ewarning_unknown_offer_currency\x18\x07 \x01(\tH\x03\x88\x01\x01\x12 \n\x13\x63urrency_minor_unit\x18\x08 \x01(\rH\x04\x88\x01\x01\x12\x19\n\x0coffer_amount\x18\t \x01(\x04H\x05\x88\x01\x01\x12+\n\x11offer_amount_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x1e\n\x11offer_description\x18\x0b \x01(\tH\x07\x88\x01\x01\x12\x19\n\x0coffer_issuer\x18\x0c \x01(\tH\x08\x88\x01\x01\x12\x1b\n\x0eoffer_features\x18\r \x01(\x0cH\t\x88\x01\x01\x12\"\n\x15offer_absolute_expiry\x18\x0e \x01(\x04H\n\x88\x01\x01\x12\x1f\n\x12offer_quantity_max\x18\x0f \x01(\x04H\x0b\x88\x01\x01\x12+\n\x0boffer_paths\x18\x10 \x03(\x0b\x32\x16.cln.DecodeOffer_paths\x12\x1a\n\roffer_node_id\x18\x11 \x01(\x0cH\x0c\x88\x01\x01\x12*\n\x1dwarning_missing_offer_node_id\x18\x14 \x01(\tH\r\x88\x01\x01\x12.\n!warning_invalid_offer_description\x18\x15 \x01(\tH\x0e\x88\x01\x01\x12.\n!warning_missing_offer_description\x18\x16 \x01(\tH\x0f\x88\x01\x01\x12+\n\x1ewarning_invalid_offer_currency\x18\x17 \x01(\tH\x10\x88\x01\x01\x12)\n\x1cwarning_invalid_offer_issuer\x18\x18 \x01(\tH\x11\x88\x01\x01\x12\x1c\n\x0finvreq_metadata\x18\x19 \x01(\x0cH\x12\x88\x01\x01\x12\x1c\n\x0finvreq_payer_id\x18\x1a \x01(\x0cH\x13\x88\x01\x01\x12\x19\n\x0cinvreq_chain\x18\x1b \x01(\x0cH\x14\x88\x01\x01\x12,\n\x12invreq_amount_msat\x18\x1c \x01(\x0b\x32\x0b.cln.AmountH\x15\x88\x01\x01\x12\x1c\n\x0finvreq_features\x18\x1d \x01(\x0cH\x16\x88\x01\x01\x12\x1c\n\x0finvreq_quantity\x18\x1e \x01(\x04H\x17\x88\x01\x01\x12\x1e\n\x11invreq_payer_note\x18\x1f \x01(\tH\x18\x88\x01\x01\x12&\n\x19invreq_recurrence_counter\x18 \x01(\rH\x19\x88\x01\x01\x12$\n\x17invreq_recurrence_start\x18! \x01(\rH\x1a\x88\x01\x01\x12,\n\x1fwarning_missing_invreq_metadata\x18# \x01(\tH\x1b\x88\x01\x01\x12,\n\x1fwarning_missing_invreq_payer_id\x18$ \x01(\tH\x1c\x88\x01\x01\x12.\n!warning_invalid_invreq_payer_note\x18% \x01(\tH\x1d\x88\x01\x01\x12\x36\n)warning_missing_invoice_request_signature\x18& \x01(\tH\x1e\x88\x01\x01\x12\x36\n)warning_invalid_invoice_request_signature\x18\' \x01(\tH\x1f\x88\x01\x01\x12\x1f\n\x12invoice_created_at\x18) \x01(\x04H \x88\x01\x01\x12$\n\x17invoice_relative_expiry\x18* \x01(\rH!\x88\x01\x01\x12!\n\x14invoice_payment_hash\x18+ \x01(\x0cH\"\x88\x01\x01\x12-\n\x13invoice_amount_msat\x18, \x01(\x0b\x32\x0b.cln.AmountH#\x88\x01\x01\x12\x37\n\x11invoice_fallbacks\x18- \x03(\x0b\x32\x1c.cln.DecodeInvoice_fallbacks\x12\x1d\n\x10invoice_features\x18. \x01(\x0cH$\x88\x01\x01\x12\x1c\n\x0finvoice_node_id\x18/ \x01(\x0cH%\x88\x01\x01\x12(\n\x1binvoice_recurrence_basetime\x18\x30 \x01(\x04H&\x88\x01\x01\x12*\n\x1dwarning_missing_invoice_paths\x18\x32 \x01(\tH\'\x88\x01\x01\x12/\n\"warning_missing_invoice_blindedpay\x18\x33 \x01(\tH(\x88\x01\x01\x12/\n\"warning_missing_invoice_created_at\x18\x34 \x01(\tH)\x88\x01\x01\x12\x31\n$warning_missing_invoice_payment_hash\x18\x35 \x01(\tH*\x88\x01\x01\x12+\n\x1ewarning_missing_invoice_amount\x18\x36 \x01(\tH+\x88\x01\x01\x12\x38\n+warning_missing_invoice_recurrence_basetime\x18\x37 \x01(\tH,\x88\x01\x01\x12,\n\x1fwarning_missing_invoice_node_id\x18\x38 \x01(\tH-\x88\x01\x01\x12.\n!warning_missing_invoice_signature\x18\x39 \x01(\tH.\x88\x01\x01\x12.\n!warning_invalid_invoice_signature\x18: \x01(\tH/\x88\x01\x01\x12\'\n\tfallbacks\x18; \x03(\x0b\x32\x14.cln.DecodeFallbacks\x12\x17\n\ncreated_at\x18< \x01(\x04H0\x88\x01\x01\x12\x13\n\x06\x65xpiry\x18= \x01(\x04H1\x88\x01\x01\x12\x12\n\x05payee\x18> \x01(\x0cH2\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18? \x01(\x0cH3\x88\x01\x01\x12\x1d\n\x10\x64\x65scription_hash\x18@ \x01(\x0cH4\x88\x01\x01\x12\"\n\x15min_final_cltv_expiry\x18\x41 \x01(\rH5\x88\x01\x01\x12\x1b\n\x0epayment_secret\x18\x42 \x01(\x0cH6\x88\x01\x01\x12\x1d\n\x10payment_metadata\x18\x43 \x01(\x0cH7\x88\x01\x01\x12\x1f\n\x05\x65xtra\x18\x45 \x03(\x0b\x32\x10.cln.DecodeExtra\x12\x16\n\tunique_id\x18\x46 \x01(\tH8\x88\x01\x01\x12\x14\n\x07version\x18G \x01(\tH9\x88\x01\x01\x12\x13\n\x06string\x18H \x01(\tH:\x88\x01\x01\x12-\n\x0crestrictions\x18I \x03(\x0b\x32\x17.cln.DecodeRestrictions\x12&\n\x19warning_rune_invalid_utf8\x18J \x01(\tH;\x88\x01\x01\x12\x10\n\x03hex\x18K \x01(\x0cH<\x88\x01\x01\x12\x16\n\tdecrypted\x18L \x01(\x0cH=\x88\x01\x01\"\x83\x01\n\nDecodeType\x12\x10\n\x0c\x42OLT12_OFFER\x10\x00\x12\x12\n\x0e\x42OLT12_INVOICE\x10\x01\x12\x1a\n\x16\x42OLT12_INVOICE_REQUEST\x10\x02\x12\x12\n\x0e\x42OLT11_INVOICE\x10\x03\x12\x08\n\x04RUNE\x10\x04\x12\x15\n\x11\x45MERGENCY_RECOVER\x10\x05\x42\x0b\n\t_offer_idB\x11\n\x0f_offer_metadataB\x11\n\x0f_offer_currencyB!\n\x1f_warning_unknown_offer_currencyB\x16\n\x14_currency_minor_unitB\x0f\n\r_offer_amountB\x14\n\x12_offer_amount_msatB\x14\n\x12_offer_descriptionB\x0f\n\r_offer_issuerB\x11\n\x0f_offer_featuresB\x18\n\x16_offer_absolute_expiryB\x15\n\x13_offer_quantity_maxB\x10\n\x0e_offer_node_idB \n\x1e_warning_missing_offer_node_idB$\n\"_warning_invalid_offer_descriptionB$\n\"_warning_missing_offer_descriptionB!\n\x1f_warning_invalid_offer_currencyB\x1f\n\x1d_warning_invalid_offer_issuerB\x12\n\x10_invreq_metadataB\x12\n\x10_invreq_payer_idB\x0f\n\r_invreq_chainB\x15\n\x13_invreq_amount_msatB\x12\n\x10_invreq_featuresB\x12\n\x10_invreq_quantityB\x14\n\x12_invreq_payer_noteB\x1c\n\x1a_invreq_recurrence_counterB\x1a\n\x18_invreq_recurrence_startB\"\n _warning_missing_invreq_metadataB\"\n _warning_missing_invreq_payer_idB$\n\"_warning_invalid_invreq_payer_noteB,\n*_warning_missing_invoice_request_signatureB,\n*_warning_invalid_invoice_request_signatureB\x15\n\x13_invoice_created_atB\x1a\n\x18_invoice_relative_expiryB\x17\n\x15_invoice_payment_hashB\x16\n\x14_invoice_amount_msatB\x13\n\x11_invoice_featuresB\x12\n\x10_invoice_node_idB\x1e\n\x1c_invoice_recurrence_basetimeB \n\x1e_warning_missing_invoice_pathsB%\n#_warning_missing_invoice_blindedpayB%\n#_warning_missing_invoice_created_atB\'\n%_warning_missing_invoice_payment_hashB!\n\x1f_warning_missing_invoice_amountB.\n,_warning_missing_invoice_recurrence_basetimeB\"\n _warning_missing_invoice_node_idB$\n\"_warning_missing_invoice_signatureB$\n\"_warning_invalid_invoice_signatureB\r\n\x0b_created_atB\t\n\x07_expiryB\x08\n\x06_payeeB\x0f\n\r_payment_hashB\x13\n\x11_description_hashB\x18\n\x16_min_final_cltv_expiryB\x11\n\x0f_payment_secretB\x13\n\x11_payment_metadataB\x0c\n\n_unique_idB\n\n\x08_versionB\t\n\x07_stringB\x1c\n\x1a_warning_rune_invalid_utf8B\x06\n\x04_hexB\x0c\n\n_decrypted\"<\n\x11\x44\x65\x63odeOffer_paths\x12\x15\n\rfirst_node_id\x18\x01 \x01(\x0c\x12\x10\n\x08\x62linding\x18\x02 \x01(\x0c\"\x8a\x01\n\x1f\x44\x65\x63odeOffer_recurrencePaywindow\x12\x16\n\x0eseconds_before\x18\x01 \x01(\r\x12\x15\n\rseconds_after\x18\x02 \x01(\r\x12 \n\x13proportional_amount\x18\x03 \x01(\x08H\x00\x88\x01\x01\x42\x16\n\x14_proportional_amount\"T\n\x17\x44\x65\x63odeInvoice_pathsPath\x12\x17\n\x0f\x62linded_node_id\x18\x01 \x01(\x0c\x12 \n\x18\x65ncrypted_recipient_data\x18\x02 \x01(\x0c\"Y\n\x17\x44\x65\x63odeInvoice_fallbacks\x12\x0f\n\x07version\x18\x01 \x01(\r\x12\x0b\n\x03hex\x18\x02 \x01(\x0c\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_address\"w\n\x0f\x44\x65\x63odeFallbacks\x12\x36\n)warning_invoice_fallbacks_version_invalid\x18\x01 \x01(\tH\x00\x88\x01\x01\x42,\n*_warning_invoice_fallbacks_version_invalid\"(\n\x0b\x44\x65\x63odeExtra\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\t\";\n\x12\x44\x65\x63odeRestrictions\x12\x14\n\x0c\x61lternatives\x18\x01 \x03(\t\x12\x0f\n\x07summary\x18\x02 \x01(\t\"=\n\x11\x44isconnectRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x12\n\x05\x66orce\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\x08\n\x06_force\"\x14\n\x12\x44isconnectResponse\"k\n\x0f\x46\x65\x65ratesRequest\x12\x31\n\x05style\x18\x01 \x01(\x0e\x32\".cln.FeeratesRequest.FeeratesStyle\"%\n\rFeeratesStyle\x12\t\n\x05PERKB\x10\x00\x12\t\n\x05PERKW\x10\x01\"\x9c\x02\n\x10\x46\x65\x65ratesResponse\x12%\n\x18warning_missing_feerates\x18\x01 \x01(\tH\x00\x88\x01\x01\x12&\n\x05perkb\x18\x02 \x01(\x0b\x32\x12.cln.FeeratesPerkbH\x01\x88\x01\x01\x12&\n\x05perkw\x18\x03 \x01(\x0b\x32\x12.cln.FeeratesPerkwH\x02\x88\x01\x01\x12\x46\n\x15onchain_fee_estimates\x18\x04 \x01(\x0b\x32\".cln.FeeratesOnchain_fee_estimatesH\x03\x88\x01\x01\x42\x1b\n\x19_warning_missing_feeratesB\x08\n\x06_perkbB\x08\n\x06_perkwB\x18\n\x16_onchain_fee_estimates\"\xd3\x03\n\rFeeratesPerkb\x12\x16\n\x0emin_acceptable\x18\x01 \x01(\r\x12\x16\n\x0emax_acceptable\x18\x02 \x01(\r\x12\x12\n\x05\x66loor\x18\n \x01(\rH\x00\x88\x01\x01\x12.\n\testimates\x18\t \x03(\x0b\x32\x1b.cln.FeeratesPerkbEstimates\x12\x14\n\x07opening\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x19\n\x0cmutual_close\x18\x04 \x01(\rH\x02\x88\x01\x01\x12\x1d\n\x10unilateral_close\x18\x05 \x01(\rH\x03\x88\x01\x01\x12$\n\x17unilateral_anchor_close\x18\x0b \x01(\rH\x04\x88\x01\x01\x12\x1a\n\rdelayed_to_us\x18\x06 \x01(\rH\x05\x88\x01\x01\x12\x1c\n\x0fhtlc_resolution\x18\x07 \x01(\rH\x06\x88\x01\x01\x12\x14\n\x07penalty\x18\x08 \x01(\rH\x07\x88\x01\x01\x42\x08\n\x06_floorB\n\n\x08_openingB\x0f\n\r_mutual_closeB\x13\n\x11_unilateral_closeB\x1a\n\x18_unilateral_anchor_closeB\x10\n\x0e_delayed_to_usB\x12\n\x10_htlc_resolutionB\n\n\x08_penalty\"\x96\x01\n\x16\x46\x65\x65ratesPerkbEstimates\x12\x17\n\nblockcount\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x14\n\x07\x66\x65\x65rate\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x1d\n\x10smoothed_feerate\x18\x03 \x01(\rH\x02\x88\x01\x01\x42\r\n\x0b_blockcountB\n\n\x08_feerateB\x13\n\x11_smoothed_feerate\"\xd3\x03\n\rFeeratesPerkw\x12\x16\n\x0emin_acceptable\x18\x01 \x01(\r\x12\x16\n\x0emax_acceptable\x18\x02 \x01(\r\x12\x12\n\x05\x66loor\x18\n \x01(\rH\x00\x88\x01\x01\x12.\n\testimates\x18\t \x03(\x0b\x32\x1b.cln.FeeratesPerkwEstimates\x12\x14\n\x07opening\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x19\n\x0cmutual_close\x18\x04 \x01(\rH\x02\x88\x01\x01\x12\x1d\n\x10unilateral_close\x18\x05 \x01(\rH\x03\x88\x01\x01\x12$\n\x17unilateral_anchor_close\x18\x0b \x01(\rH\x04\x88\x01\x01\x12\x1a\n\rdelayed_to_us\x18\x06 \x01(\rH\x05\x88\x01\x01\x12\x1c\n\x0fhtlc_resolution\x18\x07 \x01(\rH\x06\x88\x01\x01\x12\x14\n\x07penalty\x18\x08 \x01(\rH\x07\x88\x01\x01\x42\x08\n\x06_floorB\n\n\x08_openingB\x0f\n\r_mutual_closeB\x13\n\x11_unilateral_closeB\x1a\n\x18_unilateral_anchor_closeB\x10\n\x0e_delayed_to_usB\x12\n\x10_htlc_resolutionB\n\n\x08_penalty\"\x96\x01\n\x16\x46\x65\x65ratesPerkwEstimates\x12\x17\n\nblockcount\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x14\n\x07\x66\x65\x65rate\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x1d\n\x10smoothed_feerate\x18\x03 \x01(\rH\x02\x88\x01\x01\x42\r\n\x0b_blockcountB\n\n\x08_feerateB\x13\n\x11_smoothed_feerate\"\x9b\x02\n\x1d\x46\x65\x65ratesOnchain_fee_estimates\x12 \n\x18opening_channel_satoshis\x18\x01 \x01(\x04\x12\x1d\n\x15mutual_close_satoshis\x18\x02 \x01(\x04\x12!\n\x19unilateral_close_satoshis\x18\x03 \x01(\x04\x12\x30\n#unilateral_close_nonanchor_satoshis\x18\x06 \x01(\x04H\x00\x88\x01\x01\x12\x1d\n\x15htlc_timeout_satoshis\x18\x04 \x01(\x04\x12\x1d\n\x15htlc_success_satoshis\x18\x05 \x01(\x04\x42&\n$_unilateral_close_nonanchor_satoshis\"\xe9\x02\n\x13\x46\x65tchinvoiceRequest\x12\r\n\x05offer\x18\x01 \x01(\t\x12%\n\x0b\x61mount_msat\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x15\n\x08quantity\x18\x03 \x01(\x04H\x01\x88\x01\x01\x12\x1f\n\x12recurrence_counter\x18\x04 \x01(\x04H\x02\x88\x01\x01\x12\x1d\n\x10recurrence_start\x18\x05 \x01(\x01H\x03\x88\x01\x01\x12\x1d\n\x10recurrence_label\x18\x06 \x01(\tH\x04\x88\x01\x01\x12\x14\n\x07timeout\x18\x07 \x01(\x01H\x05\x88\x01\x01\x12\x17\n\npayer_note\x18\x08 \x01(\tH\x06\x88\x01\x01\x42\x0e\n\x0c_amount_msatB\x0b\n\t_quantityB\x15\n\x13_recurrence_counterB\x13\n\x11_recurrence_startB\x13\n\x11_recurrence_labelB\n\n\x08_timeoutB\r\n\x0b_payer_note\"\x9a\x01\n\x14\x46\x65tchinvoiceResponse\x12\x0f\n\x07invoice\x18\x01 \x01(\t\x12)\n\x07\x63hanges\x18\x02 \x01(\x0b\x32\x18.cln.FetchinvoiceChanges\x12\x36\n\x0bnext_period\x18\x03 \x01(\x0b\x32\x1c.cln.FetchinvoiceNext_periodH\x00\x88\x01\x01\x42\x0e\n\x0c_next_period\"\x82\x02\n\x13\x46\x65tchinvoiceChanges\x12!\n\x14\x64\x65scription_appended\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x1b\n\x0evendor_removed\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06vendor\x18\x04 \x01(\tH\x03\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x42\x17\n\x15_description_appendedB\x0e\n\x0c_descriptionB\x11\n\x0f_vendor_removedB\t\n\x07_vendorB\x0e\n\x0c_amount_msat\"~\n\x17\x46\x65tchinvoiceNext_period\x12\x0f\n\x07\x63ounter\x18\x01 \x01(\x04\x12\x11\n\tstarttime\x18\x02 \x01(\x04\x12\x0f\n\x07\x65ndtime\x18\x03 \x01(\x04\x12\x17\n\x0fpaywindow_start\x18\x04 \x01(\x04\x12\x15\n\rpaywindow_end\x18\x05 \x01(\x04\"\xfb\x03\n\x12\x46undchannelRequest\x12\n\n\x02id\x18\t \x01(\x0c\x12 \n\x06\x61mount\x18\x01 \x01(\x0b\x32\x10.cln.AmountOrAll\x12\"\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.FeerateH\x00\x88\x01\x01\x12\x15\n\x08\x61nnounce\x18\x03 \x01(\x08H\x01\x88\x01\x01\x12\x14\n\x07minconf\x18\n \x01(\rH\x02\x88\x01\x01\x12#\n\tpush_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x15\n\x08\x63lose_to\x18\x06 \x01(\tH\x04\x88\x01\x01\x12%\n\x0brequest_amt\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x05\x88\x01\x01\x12\x1a\n\rcompact_lease\x18\x08 \x01(\tH\x06\x88\x01\x01\x12\x1c\n\x05utxos\x18\x0b \x03(\x0b\x32\r.cln.Outpoint\x12\x15\n\x08mindepth\x18\x0c \x01(\rH\x07\x88\x01\x01\x12!\n\x07reserve\x18\r \x01(\x0b\x32\x0b.cln.AmountH\x08\x88\x01\x01\x12\x14\n\x0c\x63hannel_type\x18\x0e \x03(\rB\n\n\x08_feerateB\x0b\n\t_announceB\n\n\x08_minconfB\x0c\n\n_push_msatB\x0b\n\t_close_toB\x0e\n\x0c_request_amtB\x10\n\x0e_compact_leaseB\x0b\n\t_mindepthB\n\n\x08_reserve\"\xe5\x01\n\x13\x46undchannelResponse\x12\n\n\x02tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\x12\x0e\n\x06outnum\x18\x03 \x01(\r\x12\x12\n\nchannel_id\x18\x04 \x01(\x0c\x12\x37\n\x0c\x63hannel_type\x18\x07 \x01(\x0b\x32\x1c.cln.FundchannelChannel_typeH\x00\x88\x01\x01\x12\x15\n\x08\x63lose_to\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x15\n\x08mindepth\x18\x06 \x01(\rH\x02\x88\x01\x01\x42\x0f\n\r_channel_typeB\x0b\n\t_close_toB\x0b\n\t_mindepth\"L\n\x17\x46undchannelChannel_type\x12\x0c\n\x04\x62its\x18\x01 \x03(\r\x12#\n\x05names\x18\x02 \x03(\x0e\x32\x14.cln.ChannelTypeName\"\xec\x01\n\x0fGetrouteRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12 \n\x0b\x61mount_msat\x18\t \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\nriskfactor\x18\x03 \x01(\x04\x12\x11\n\x04\x63ltv\x18\x04 \x01(\rH\x00\x88\x01\x01\x12\x13\n\x06\x66romid\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x18\n\x0b\x66uzzpercent\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x0f\n\x07\x65xclude\x18\x07 \x03(\t\x12\x14\n\x07maxhops\x18\x08 \x01(\rH\x03\x88\x01\x01\x42\x07\n\x05_cltvB\t\n\x07_fromidB\x0e\n\x0c_fuzzpercentB\n\n\x08_maxhops\"5\n\x10GetrouteResponse\x12!\n\x05route\x18\x01 \x03(\x0b\x32\x12.cln.GetrouteRoute\"\xc5\x01\n\rGetrouteRoute\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x0f\n\x07\x63hannel\x18\x02 \x01(\t\x12\x11\n\tdirection\x18\x03 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\r\n\x05\x64\x65lay\x18\x05 \x01(\r\x12\x34\n\x05style\x18\x06 \x01(\x0e\x32%.cln.GetrouteRoute.GetrouteRouteStyle\"\x1d\n\x12GetrouteRouteStyle\x12\x07\n\x03TLV\x10\x00\"\xb7\x03\n\x13ListforwardsRequest\x12@\n\x06status\x18\x01 \x01(\x0e\x32+.cln.ListforwardsRequest.ListforwardsStatusH\x00\x88\x01\x01\x12\x17\n\nin_channel\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x18\n\x0bout_channel\x18\x03 \x01(\tH\x02\x88\x01\x01\x12>\n\x05index\x18\x04 \x01(\x0e\x32*.cln.ListforwardsRequest.ListforwardsIndexH\x03\x88\x01\x01\x12\x12\n\x05start\x18\x05 \x01(\x04H\x04\x88\x01\x01\x12\x12\n\x05limit\x18\x06 \x01(\rH\x05\x88\x01\x01\"L\n\x12ListforwardsStatus\x12\x0b\n\x07OFFERED\x10\x00\x12\x0b\n\x07SETTLED\x10\x01\x12\x10\n\x0cLOCAL_FAILED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\"-\n\x11ListforwardsIndex\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07UPDATED\x10\x01\x42\t\n\x07_statusB\r\n\x0b_in_channelB\x0e\n\x0c_out_channelB\x08\n\x06_indexB\x08\n\x06_startB\x08\n\x06_limit\"C\n\x14ListforwardsResponse\x12+\n\x08\x66orwards\x18\x01 \x03(\x0b\x32\x19.cln.ListforwardsForwards\"\xba\x05\n\x14ListforwardsForwards\x12\x1a\n\rcreated_index\x18\x0c \x01(\x04H\x00\x88\x01\x01\x12\x12\n\nin_channel\x18\x01 \x01(\t\x12\x17\n\nin_htlc_id\x18\n \x01(\x04H\x01\x88\x01\x01\x12\x1c\n\x07in_msat\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\x12\x44\n\x06status\x18\x03 \x01(\x0e\x32\x34.cln.ListforwardsForwards.ListforwardsForwardsStatus\x12\x15\n\rreceived_time\x18\x04 \x01(\x01\x12\x18\n\x0bout_channel\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x18\n\x0bout_htlc_id\x18\x0b \x01(\x04H\x03\x88\x01\x01\x12\x1a\n\rupdated_index\x18\r \x01(\x04H\x04\x88\x01\x01\x12G\n\x05style\x18\t \x01(\x0e\x32\x33.cln.ListforwardsForwards.ListforwardsForwardsStyleH\x05\x88\x01\x01\x12\"\n\x08\x66\x65\x65_msat\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\"\n\x08out_msat\x18\x08 \x01(\x0b\x32\x0b.cln.AmountH\x07\x88\x01\x01\"T\n\x1aListforwardsForwardsStatus\x12\x0b\n\x07OFFERED\x10\x00\x12\x0b\n\x07SETTLED\x10\x01\x12\x10\n\x0cLOCAL_FAILED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\"0\n\x19ListforwardsForwardsStyle\x12\n\n\x06LEGACY\x10\x00\x12\x07\n\x03TLV\x10\x01\x42\x10\n\x0e_created_indexB\r\n\x0b_in_htlc_idB\x0e\n\x0c_out_channelB\x0e\n\x0c_out_htlc_idB\x10\n\x0e_updated_indexB\x08\n\x06_styleB\x0b\n\t_fee_msatB\x0b\n\t_out_msat\"a\n\x11ListoffersRequest\x12\x15\n\x08offer_id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x18\n\x0b\x61\x63tive_only\x18\x02 \x01(\x08H\x01\x88\x01\x01\x42\x0b\n\t_offer_idB\x0e\n\x0c_active_only\";\n\x12ListoffersResponse\x12%\n\x06offers\x18\x01 \x03(\x0b\x32\x15.cln.ListoffersOffers\"\x84\x01\n\x10ListoffersOffers\x12\x10\n\x08offer_id\x18\x01 \x01(\x0c\x12\x0e\n\x06\x61\x63tive\x18\x02 \x01(\x08\x12\x12\n\nsingle_use\x18\x03 \x01(\x08\x12\x0e\n\x06\x62olt12\x18\x04 \x01(\t\x12\x0c\n\x04used\x18\x05 \x01(\x08\x12\x12\n\x05label\x18\x06 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_label\"\xdb\x01\n\x0fListpaysRequest\x12\x13\n\x06\x62olt11\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12\x38\n\x06status\x18\x03 \x01(\x0e\x32#.cln.ListpaysRequest.ListpaysStatusH\x02\x88\x01\x01\"7\n\x0eListpaysStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x42\t\n\x07_bolt11B\x0f\n\r_payment_hashB\t\n\x07_status\"3\n\x10ListpaysResponse\x12\x1f\n\x04pays\x18\x01 \x03(\x0b\x32\x11.cln.ListpaysPays\"\xff\x04\n\x0cListpaysPays\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x34\n\x06status\x18\x02 \x01(\x0e\x32$.cln.ListpaysPays.ListpaysPaysStatus\x12\x18\n\x0b\x64\x65stination\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x12\x12\n\ncreated_at\x18\x04 \x01(\x04\x12\x19\n\x0c\x63ompleted_at\x18\x0c \x01(\x04H\x01\x88\x01\x01\x12\x12\n\x05label\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x06 \x01(\tH\x03\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x0b \x01(\tH\x04\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x07 \x01(\tH\x05\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x08 \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12*\n\x10\x61mount_sent_msat\x18\t \x01(\x0b\x32\x0b.cln.AmountH\x07\x88\x01\x01\x12\x15\n\x08preimage\x18\r \x01(\x0cH\x08\x88\x01\x01\x12\x1c\n\x0fnumber_of_parts\x18\x0e \x01(\x04H\t\x88\x01\x01\x12\x17\n\nerroronion\x18\n \x01(\x0cH\n\x88\x01\x01\";\n\x12ListpaysPaysStatus\x12\x0b\n\x07PENDING\x10\x00\x12\n\n\x06\x46\x41ILED\x10\x01\x12\x0c\n\x08\x43OMPLETE\x10\x02\x42\x0e\n\x0c_destinationB\x0f\n\r_completed_atB\x08\n\x06_labelB\t\n\x07_bolt11B\x0e\n\x0c_descriptionB\t\n\x07_bolt12B\x0e\n\x0c_amount_msatB\x13\n\x11_amount_sent_msatB\x0b\n\t_preimageB\x12\n\x10_number_of_partsB\r\n\x0b_erroronion\"*\n\x10ListhtlcsRequest\x12\x0f\n\x02id\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x05\n\x03_id\"7\n\x11ListhtlcsResponse\x12\"\n\x05htlcs\x18\x01 \x03(\x0b\x32\x13.cln.ListhtlcsHtlcs\"\x89\x02\n\x0eListhtlcsHtlcs\x12\x18\n\x10short_channel_id\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\x04\x12\x0e\n\x06\x65xpiry\x18\x03 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12>\n\tdirection\x18\x05 \x01(\x0e\x32+.cln.ListhtlcsHtlcs.ListhtlcsHtlcsDirection\x12\x14\n\x0cpayment_hash\x18\x06 \x01(\x0c\x12\x1d\n\x05state\x18\x07 \x01(\x0e\x32\x0e.cln.HtlcState\"*\n\x17ListhtlcsHtlcsDirection\x12\x07\n\x03OUT\x10\x00\x12\x06\n\x02IN\x10\x01\"\xc1\x03\n\x0cOfferRequest\x12\x0e\n\x06\x61mount\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x13\n\x06issuer\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x12\n\x05label\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x19\n\x0cquantity_max\x18\x05 \x01(\x04H\x02\x88\x01\x01\x12\x1c\n\x0f\x61\x62solute_expiry\x18\x06 \x01(\x04H\x03\x88\x01\x01\x12\x17\n\nrecurrence\x18\x07 \x01(\tH\x04\x88\x01\x01\x12\x1c\n\x0frecurrence_base\x18\x08 \x01(\tH\x05\x88\x01\x01\x12!\n\x14recurrence_paywindow\x18\t \x01(\tH\x06\x88\x01\x01\x12\x1d\n\x10recurrence_limit\x18\n \x01(\x04H\x07\x88\x01\x01\x12\x17\n\nsingle_use\x18\x0b \x01(\x08H\x08\x88\x01\x01\x42\t\n\x07_issuerB\x08\n\x06_labelB\x0f\n\r_quantity_maxB\x12\n\x10_absolute_expiryB\r\n\x0b_recurrenceB\x12\n\x10_recurrence_baseB\x17\n\x15_recurrence_paywindowB\x13\n\x11_recurrence_limitB\r\n\x0b_single_use\"\x92\x01\n\rOfferResponse\x12\x10\n\x08offer_id\x18\x01 \x01(\x0c\x12\x0e\n\x06\x61\x63tive\x18\x02 \x01(\x08\x12\x12\n\nsingle_use\x18\x03 \x01(\x08\x12\x0e\n\x06\x62olt12\x18\x04 \x01(\t\x12\x0c\n\x04used\x18\x05 \x01(\x08\x12\x0f\n\x07\x63reated\x18\x06 \x01(\x08\x12\x12\n\x05label\x18\x07 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_label\"Y\n\x0bPingRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x10\n\x03len\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x16\n\tpongbytes\x18\x03 \x01(\rH\x01\x88\x01\x01\x42\x06\n\x04_lenB\x0c\n\n_pongbytes\"\x1e\n\x0cPingResponse\x12\x0e\n\x06totlen\x18\x01 \x01(\r\"4\n\x14SendcustommsgRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\x0b\n\x03msg\x18\x02 \x01(\x0c\"\'\n\x15SendcustommsgResponse\x12\x0e\n\x06status\x18\x01 \x01(\t\"\xaa\x02\n\x11SetchannelRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12!\n\x07\x66\x65\x65\x62\x61se\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x13\n\x06\x66\x65\x65ppm\x18\x03 \x01(\rH\x01\x88\x01\x01\x12!\n\x07htlcmin\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12!\n\x07htlcmax\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x19\n\x0c\x65nforcedelay\x18\x06 \x01(\rH\x04\x88\x01\x01\x12\x1c\n\x0fignorefeelimits\x18\x07 \x01(\x08H\x05\x88\x01\x01\x42\n\n\x08_feebaseB\t\n\x07_feeppmB\n\n\x08_htlcminB\n\n\x08_htlcmaxB\x0f\n\r_enforcedelayB\x12\n\x10_ignorefeelimits\"?\n\x12SetchannelResponse\x12)\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x17.cln.SetchannelChannels\"\xca\x03\n\x12SetchannelChannels\x12\x0f\n\x07peer_id\x18\x01 \x01(\x0c\x12\x12\n\nchannel_id\x18\x02 \x01(\x0c\x12\x1d\n\x10short_channel_id\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\"\n\rfee_base_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12#\n\x1b\x66\x65\x65_proportional_millionths\x18\x05 \x01(\r\x12\x1e\n\x11ignore_fee_limits\x18\n \x01(\x08H\x01\x88\x01\x01\x12*\n\x15minimum_htlc_out_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12$\n\x17warning_htlcmin_too_low\x18\x07 \x01(\tH\x02\x88\x01\x01\x12*\n\x15maximum_htlc_out_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x18warning_htlcmax_too_high\x18\t \x01(\tH\x03\x88\x01\x01\x42\x13\n\x11_short_channel_idB\x14\n\x12_ignore_fee_limitsB\x1a\n\x18_warning_htlcmin_too_lowB\x1b\n\x19_warning_htlcmax_too_high\"\'\n\x12SigninvoiceRequest\x12\x11\n\tinvstring\x18\x01 \x01(\t\"%\n\x13SigninvoiceResponse\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\"%\n\x12SignmessageRequest\x12\x0f\n\x07message\x18\x01 \x01(\t\"F\n\x13SignmessageResponse\x12\x11\n\tsignature\x18\x01 \x01(\x0c\x12\r\n\x05recid\x18\x02 \x01(\x0c\x12\r\n\x05zbase\x18\x03 \x01(\t\"O\n\x16WaitblockheightRequest\x12\x13\n\x0b\x62lockheight\x18\x01 \x01(\r\x12\x14\n\x07timeout\x18\x02 \x01(\rH\x00\x88\x01\x01\x42\n\n\x08_timeout\".\n\x17WaitblockheightResponse\x12\x13\n\x0b\x62lockheight\x18\x01 \x01(\r\"\xf9\x01\n\x0bWaitRequest\x12\x31\n\tsubsystem\x18\x01 \x01(\x0e\x32\x1e.cln.WaitRequest.WaitSubsystem\x12\x31\n\tindexname\x18\x02 \x01(\x0e\x32\x1e.cln.WaitRequest.WaitIndexname\x12\x11\n\tnextvalue\x18\x03 \x01(\x04\"9\n\rWaitSubsystem\x12\x0c\n\x08INVOICES\x10\x00\x12\x0c\n\x08\x46ORWARDS\x10\x01\x12\x0c\n\x08SENDPAYS\x10\x02\"6\n\rWaitIndexname\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07UPDATED\x10\x01\x12\x0b\n\x07\x44\x45LETED\x10\x02\"\xe3\x01\n\x0cWaitResponse\x12\x32\n\tsubsystem\x18\x01 \x01(\x0e\x32\x1f.cln.WaitResponse.WaitSubsystem\x12\x14\n\x07\x63reated\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x14\n\x07updated\x18\x03 \x01(\x04H\x01\x88\x01\x01\x12\x14\n\x07\x64\x65leted\x18\x04 \x01(\x04H\x02\x88\x01\x01\"9\n\rWaitSubsystem\x12\x0c\n\x08INVOICES\x10\x00\x12\x0c\n\x08\x46ORWARDS\x10\x01\x12\x0c\n\x08SENDPAYS\x10\x02\x42\n\n\x08_createdB\n\n\x08_updatedB\n\n\x08_deleted\"\r\n\x0bStopRequest\"\x0e\n\x0cStopResponse\"\xa7\x01\n\x18PreapprovekeysendRequest\x12\x18\n\x0b\x64\x65stination\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x42\x0e\n\x0c_destinationB\x0f\n\r_payment_hashB\x0e\n\x0c_amount_msat\"\x1b\n\x19PreapprovekeysendResponse\":\n\x18PreapproveinvoiceRequest\x12\x13\n\x06\x62olt11\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\t\n\x07_bolt11\"\x1b\n\x19PreapproveinvoiceResponse\"\x15\n\x13StaticbackupRequest\"#\n\x14StaticbackupResponse\x12\x0b\n\x03scb\x18\x01 \x03(\x0c\"\x97\x01\n\x15\x42kprlistincomeRequest\x12\x1d\n\x10\x63onsolidate_fees\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x17\n\nstart_time\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x15\n\x08\x65nd_time\x18\x03 \x01(\rH\x02\x88\x01\x01\x42\x13\n\x11_consolidate_feesB\r\n\x0b_start_timeB\x0b\n\t_end_time\"Q\n\x16\x42kprlistincomeResponse\x12\x37\n\rincome_events\x18\x01 \x03(\x0b\x32 .cln.BkprlistincomeIncome_events\"\xb5\x02\n\x1b\x42kprlistincomeIncome_events\x12\x0f\n\x07\x61\x63\x63ount\x18\x01 \x01(\t\x12\x0b\n\x03tag\x18\x02 \x01(\t\x12 \n\x0b\x63redit_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x1f\n\ndebit_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\x10\n\x08\x63urrency\x18\x05 \x01(\t\x12\x11\n\ttimestamp\x18\x06 \x01(\r\x12\x18\n\x0b\x64\x65scription\x18\x07 \x01(\tH\x00\x88\x01\x01\x12\x15\n\x08outpoint\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\x11\n\x04txid\x18\t \x01(\x0cH\x02\x88\x01\x01\x12\x17\n\npayment_id\x18\n \x01(\x0cH\x03\x88\x01\x01\x42\x0e\n\x0c_descriptionB\x0b\n\t_outpointB\x07\n\x05_txidB\r\n\x0b_payment_id2\xe2 \n\x04Node\x12\x36\n\x07Getinfo\x12\x13.cln.GetinfoRequest\x1a\x14.cln.GetinfoResponse\"\x00\x12<\n\tListPeers\x12\x15.cln.ListpeersRequest\x1a\x16.cln.ListpeersResponse\"\x00\x12<\n\tListFunds\x12\x15.cln.ListfundsRequest\x1a\x16.cln.ListfundsResponse\"\x00\x12\x36\n\x07SendPay\x12\x13.cln.SendpayRequest\x1a\x14.cln.SendpayResponse\"\x00\x12\x45\n\x0cListChannels\x12\x18.cln.ListchannelsRequest\x1a\x19.cln.ListchannelsResponse\"\x00\x12<\n\tAddGossip\x12\x15.cln.AddgossipRequest\x1a\x16.cln.AddgossipResponse\"\x00\x12Q\n\x10\x41utoCleanInvoice\x12\x1c.cln.AutocleaninvoiceRequest\x1a\x1d.cln.AutocleaninvoiceResponse\"\x00\x12\x45\n\x0c\x43heckMessage\x12\x18.cln.CheckmessageRequest\x1a\x19.cln.CheckmessageResponse\"\x00\x12\x30\n\x05\x43lose\x12\x11.cln.CloseRequest\x1a\x12.cln.CloseResponse\"\x00\x12:\n\x0b\x43onnectPeer\x12\x13.cln.ConnectRequest\x1a\x14.cln.ConnectResponse\"\x00\x12H\n\rCreateInvoice\x12\x19.cln.CreateinvoiceRequest\x1a\x1a.cln.CreateinvoiceResponse\"\x00\x12<\n\tDatastore\x12\x15.cln.DatastoreRequest\x1a\x16.cln.DatastoreResponse\"\x00\x12K\n\x0e\x44\x61tastoreUsage\x12\x1a.cln.DatastoreusageRequest\x1a\x1b.cln.DatastoreusageResponse\"\x00\x12\x42\n\x0b\x43reateOnion\x12\x17.cln.CreateonionRequest\x1a\x18.cln.CreateonionResponse\"\x00\x12\x45\n\x0c\x44\x65lDatastore\x12\x18.cln.DeldatastoreRequest\x1a\x19.cln.DeldatastoreResponse\"\x00\x12T\n\x11\x44\x65lExpiredInvoice\x12\x1d.cln.DelexpiredinvoiceRequest\x1a\x1e.cln.DelexpiredinvoiceResponse\"\x00\x12?\n\nDelInvoice\x12\x16.cln.DelinvoiceRequest\x1a\x17.cln.DelinvoiceResponse\"\x00\x12\x36\n\x07Invoice\x12\x13.cln.InvoiceRequest\x1a\x14.cln.InvoiceResponse\"\x00\x12H\n\rListDatastore\x12\x19.cln.ListdatastoreRequest\x1a\x1a.cln.ListdatastoreResponse\"\x00\x12\x45\n\x0cListInvoices\x12\x18.cln.ListinvoicesRequest\x1a\x19.cln.ListinvoicesResponse\"\x00\x12<\n\tSendOnion\x12\x15.cln.SendonionRequest\x1a\x16.cln.SendonionResponse\"\x00\x12\x45\n\x0cListSendPays\x12\x18.cln.ListsendpaysRequest\x1a\x19.cln.ListsendpaysResponse\"\x00\x12Q\n\x10ListTransactions\x12\x1c.cln.ListtransactionsRequest\x1a\x1d.cln.ListtransactionsResponse\"\x00\x12*\n\x03Pay\x12\x0f.cln.PayRequest\x1a\x10.cln.PayResponse\"\x00\x12<\n\tListNodes\x12\x15.cln.ListnodesRequest\x1a\x16.cln.ListnodesResponse\"\x00\x12K\n\x0eWaitAnyInvoice\x12\x1a.cln.WaitanyinvoiceRequest\x1a\x1b.cln.WaitanyinvoiceResponse\"\x00\x12\x42\n\x0bWaitInvoice\x12\x17.cln.WaitinvoiceRequest\x1a\x18.cln.WaitinvoiceResponse\"\x00\x12\x42\n\x0bWaitSendPay\x12\x17.cln.WaitsendpayRequest\x1a\x18.cln.WaitsendpayResponse\"\x00\x12\x36\n\x07NewAddr\x12\x13.cln.NewaddrRequest\x1a\x14.cln.NewaddrResponse\"\x00\x12\x39\n\x08Withdraw\x12\x14.cln.WithdrawRequest\x1a\x15.cln.WithdrawResponse\"\x00\x12\x36\n\x07KeySend\x12\x13.cln.KeysendRequest\x1a\x14.cln.KeysendResponse\"\x00\x12\x39\n\x08\x46undPsbt\x12\x14.cln.FundpsbtRequest\x1a\x15.cln.FundpsbtResponse\"\x00\x12\x39\n\x08SendPsbt\x12\x14.cln.SendpsbtRequest\x1a\x15.cln.SendpsbtResponse\"\x00\x12\x39\n\x08SignPsbt\x12\x14.cln.SignpsbtRequest\x1a\x15.cln.SignpsbtResponse\"\x00\x12\x39\n\x08UtxoPsbt\x12\x14.cln.UtxopsbtRequest\x1a\x15.cln.UtxopsbtResponse\"\x00\x12<\n\tTxDiscard\x12\x15.cln.TxdiscardRequest\x1a\x16.cln.TxdiscardResponse\"\x00\x12<\n\tTxPrepare\x12\x15.cln.TxprepareRequest\x1a\x16.cln.TxprepareResponse\"\x00\x12\x33\n\x06TxSend\x12\x12.cln.TxsendRequest\x1a\x13.cln.TxsendResponse\"\x00\x12Q\n\x10ListPeerChannels\x12\x1c.cln.ListpeerchannelsRequest\x1a\x1d.cln.ListpeerchannelsResponse\"\x00\x12W\n\x12ListClosedChannels\x12\x1e.cln.ListclosedchannelsRequest\x1a\x1f.cln.ListclosedchannelsResponse\"\x00\x12<\n\tDecodePay\x12\x15.cln.DecodepayRequest\x1a\x16.cln.DecodepayResponse\"\x00\x12\x33\n\x06\x44\x65\x63ode\x12\x12.cln.DecodeRequest\x1a\x13.cln.DecodeResponse\"\x00\x12?\n\nDisconnect\x12\x16.cln.DisconnectRequest\x1a\x17.cln.DisconnectResponse\"\x00\x12\x39\n\x08\x46\x65\x65rates\x12\x14.cln.FeeratesRequest\x1a\x15.cln.FeeratesResponse\"\x00\x12\x45\n\x0c\x46\x65tchInvoice\x12\x18.cln.FetchinvoiceRequest\x1a\x19.cln.FetchinvoiceResponse\"\x00\x12\x42\n\x0b\x46undChannel\x12\x17.cln.FundchannelRequest\x1a\x18.cln.FundchannelResponse\"\x00\x12\x39\n\x08GetRoute\x12\x14.cln.GetrouteRequest\x1a\x15.cln.GetrouteResponse\"\x00\x12\x45\n\x0cListForwards\x12\x18.cln.ListforwardsRequest\x1a\x19.cln.ListforwardsResponse\"\x00\x12?\n\nListOffers\x12\x16.cln.ListoffersRequest\x1a\x17.cln.ListoffersResponse\"\x00\x12\x39\n\x08ListPays\x12\x14.cln.ListpaysRequest\x1a\x15.cln.ListpaysResponse\"\x00\x12<\n\tListHtlcs\x12\x15.cln.ListhtlcsRequest\x1a\x16.cln.ListhtlcsResponse\"\x00\x12\x30\n\x05Offer\x12\x11.cln.OfferRequest\x1a\x12.cln.OfferResponse\"\x00\x12-\n\x04Ping\x12\x10.cln.PingRequest\x1a\x11.cln.PingResponse\"\x00\x12H\n\rSendCustomMsg\x12\x19.cln.SendcustommsgRequest\x1a\x1a.cln.SendcustommsgResponse\"\x00\x12?\n\nSetChannel\x12\x16.cln.SetchannelRequest\x1a\x17.cln.SetchannelResponse\"\x00\x12\x42\n\x0bSignInvoice\x12\x17.cln.SigninvoiceRequest\x1a\x18.cln.SigninvoiceResponse\"\x00\x12\x42\n\x0bSignMessage\x12\x17.cln.SignmessageRequest\x1a\x18.cln.SignmessageResponse\"\x00\x12N\n\x0fWaitBlockHeight\x12\x1b.cln.WaitblockheightRequest\x1a\x1c.cln.WaitblockheightResponse\"\x00\x12-\n\x04Wait\x12\x10.cln.WaitRequest\x1a\x11.cln.WaitResponse\"\x00\x12-\n\x04Stop\x12\x10.cln.StopRequest\x1a\x11.cln.StopResponse\"\x00\x12T\n\x11PreApproveKeysend\x12\x1d.cln.PreapprovekeysendRequest\x1a\x1e.cln.PreapprovekeysendResponse\"\x00\x12T\n\x11PreApproveInvoice\x12\x1d.cln.PreapproveinvoiceRequest\x1a\x1e.cln.PreapproveinvoiceResponse\"\x00\x12\x45\n\x0cStaticBackup\x12\x18.cln.StaticbackupRequest\x1a\x19.cln.StaticbackupResponse\"\x00\x12K\n\x0e\x42kprListIncome\x12\x1a.cln.BkprlistincomeRequest\x1a\x1b.cln.BkprlistincomeResponse\"\x00\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\nnode.proto\x12\x03\x63ln\x1a\x10primitives.proto\"\x10\n\x0eGetinfoRequest\"\xc1\x04\n\x0fGetinfoResponse\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x12\n\x05\x61lias\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\r\n\x05\x63olor\x18\x03 \x01(\x0c\x12\x11\n\tnum_peers\x18\x04 \x01(\r\x12\x1c\n\x14num_pending_channels\x18\x05 \x01(\r\x12\x1b\n\x13num_active_channels\x18\x06 \x01(\r\x12\x1d\n\x15num_inactive_channels\x18\x07 \x01(\r\x12\x0f\n\x07version\x18\x08 \x01(\t\x12\x15\n\rlightning_dir\x18\t \x01(\t\x12\x33\n\x0cour_features\x18\n \x01(\x0b\x32\x18.cln.GetinfoOur_featuresH\x01\x88\x01\x01\x12\x13\n\x0b\x62lockheight\x18\x0b \x01(\r\x12\x0f\n\x07network\x18\x0c \x01(\t\x12(\n\x13\x66\x65\x65s_collected_msat\x18\r \x01(\x0b\x32\x0b.cln.Amount\x12$\n\x07\x61\x64\x64ress\x18\x0e \x03(\x0b\x32\x13.cln.GetinfoAddress\x12$\n\x07\x62inding\x18\x0f \x03(\x0b\x32\x13.cln.GetinfoBinding\x12\"\n\x15warning_bitcoind_sync\x18\x10 \x01(\tH\x02\x88\x01\x01\x12$\n\x17warning_lightningd_sync\x18\x11 \x01(\tH\x03\x88\x01\x01\x42\x08\n\x06_aliasB\x0f\n\r_our_featuresB\x18\n\x16_warning_bitcoind_syncB\x1a\n\x18_warning_lightningd_sync\"S\n\x13GetinfoOur_features\x12\x0c\n\x04init\x18\x01 \x01(\x0c\x12\x0c\n\x04node\x18\x02 \x01(\x0c\x12\x0f\n\x07\x63hannel\x18\x03 \x01(\x0c\x12\x0f\n\x07invoice\x18\x04 \x01(\x0c\"\xc4\x01\n\x0eGetinfoAddress\x12\x39\n\titem_type\x18\x01 \x01(\x0e\x32&.cln.GetinfoAddress.GetinfoAddressType\x12\x0c\n\x04port\x18\x02 \x01(\r\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x00\x88\x01\x01\"G\n\x12GetinfoAddressType\x12\x07\n\x03\x44NS\x10\x00\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\n\n\x08_address\"\x8a\x02\n\x0eGetinfoBinding\x12\x39\n\titem_type\x18\x01 \x01(\x0e\x32&.cln.GetinfoBinding.GetinfoBindingType\x12\x14\n\x07\x61\x64\x64ress\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04port\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x13\n\x06socket\x18\x04 \x01(\tH\x02\x88\x01\x01\"_\n\x12GetinfoBindingType\x12\x10\n\x0cLOCAL_SOCKET\x10\x00\x12\r\n\tWEBSOCKET\x10\x05\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\n\n\x08_addressB\x07\n\x05_portB\t\n\x07_socket\"H\n\x10ListpeersRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x12\n\x05level\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x05\n\x03_idB\x08\n\x06_level\"7\n\x11ListpeersResponse\x12\"\n\x05peers\x18\x01 \x03(\x0b\x32\x13.cln.ListpeersPeers\"\x8e\x02\n\x0eListpeersPeers\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x11\n\tconnected\x18\x02 \x01(\x08\x12\x19\n\x0cnum_channels\x18\x08 \x01(\rH\x00\x88\x01\x01\x12#\n\x03log\x18\x03 \x03(\x0b\x32\x16.cln.ListpeersPeersLog\x12-\n\x08\x63hannels\x18\x04 \x03(\x0b\x32\x1b.cln.ListpeersPeersChannels\x12\x0f\n\x07netaddr\x18\x05 \x03(\t\x12\x18\n\x0bremote_addr\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x15\n\x08\x66\x65\x61tures\x18\x06 \x01(\x0cH\x02\x88\x01\x01\x42\x0f\n\r_num_channelsB\x0e\n\x0c_remote_addrB\x0b\n\t_features\"\xfd\x02\n\x11ListpeersPeersLog\x12?\n\titem_type\x18\x01 \x01(\x0e\x32,.cln.ListpeersPeersLog.ListpeersPeersLogType\x12\x18\n\x0bnum_skipped\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x11\n\x04time\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06source\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x10\n\x03log\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x14\n\x07node_id\x18\x06 \x01(\x0cH\x04\x88\x01\x01\x12\x11\n\x04\x64\x61ta\x18\x07 \x01(\x0cH\x05\x88\x01\x01\"i\n\x15ListpeersPeersLogType\x12\x0b\n\x07SKIPPED\x10\x00\x12\n\n\x06\x42ROKEN\x10\x01\x12\x0b\n\x07UNUSUAL\x10\x02\x12\x08\n\x04INFO\x10\x03\x12\t\n\x05\x44\x45\x42UG\x10\x04\x12\t\n\x05IO_IN\x10\x05\x12\n\n\x06IO_OUT\x10\x06\x42\x0e\n\x0c_num_skippedB\x07\n\x05_timeB\t\n\x07_sourceB\x06\n\x04_logB\n\n\x08_node_idB\x07\n\x05_data\"\x95\x18\n\x16ListpeersPeersChannels\x12\x46\n\x05state\x18\x01 \x01(\x0e\x32\x37.cln.ListpeersPeersChannels.ListpeersPeersChannelsState\x12\x19\n\x0cscratch_txid\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x38\n\x07\x66\x65\x65rate\x18\x03 \x01(\x0b\x32\".cln.ListpeersPeersChannelsFeerateH\x01\x88\x01\x01\x12\x12\n\x05owner\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x1d\n\x10short_channel_id\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x17\n\nchannel_id\x18\x06 \x01(\x0cH\x04\x88\x01\x01\x12\x19\n\x0c\x66unding_txid\x18\x07 \x01(\x0cH\x05\x88\x01\x01\x12\x1b\n\x0e\x66unding_outnum\x18\x08 \x01(\rH\x06\x88\x01\x01\x12\x1c\n\x0finitial_feerate\x18\t \x01(\tH\x07\x88\x01\x01\x12\x19\n\x0clast_feerate\x18\n \x01(\tH\x08\x88\x01\x01\x12\x19\n\x0cnext_feerate\x18\x0b \x01(\tH\t\x88\x01\x01\x12\x1a\n\rnext_fee_step\x18\x0c \x01(\rH\n\x88\x01\x01\x12\x35\n\x08inflight\x18\r \x03(\x0b\x32#.cln.ListpeersPeersChannelsInflight\x12\x15\n\x08\x63lose_to\x18\x0e \x01(\x0cH\x0b\x88\x01\x01\x12\x14\n\x07private\x18\x0f \x01(\x08H\x0c\x88\x01\x01\x12 \n\x06opener\x18\x10 \x01(\x0e\x32\x10.cln.ChannelSide\x12%\n\x06\x63loser\x18\x11 \x01(\x0e\x32\x10.cln.ChannelSideH\r\x88\x01\x01\x12\x10\n\x08\x66\x65\x61tures\x18\x12 \x03(\t\x12\x38\n\x07\x66unding\x18\x13 \x01(\x0b\x32\".cln.ListpeersPeersChannelsFundingH\x0e\x88\x01\x01\x12$\n\nto_us_msat\x18\x14 \x01(\x0b\x32\x0b.cln.AmountH\x0f\x88\x01\x01\x12(\n\x0emin_to_us_msat\x18\x15 \x01(\x0b\x32\x0b.cln.AmountH\x10\x88\x01\x01\x12(\n\x0emax_to_us_msat\x18\x16 \x01(\x0b\x32\x0b.cln.AmountH\x11\x88\x01\x01\x12$\n\ntotal_msat\x18\x17 \x01(\x0b\x32\x0b.cln.AmountH\x12\x88\x01\x01\x12\'\n\rfee_base_msat\x18\x18 \x01(\x0b\x32\x0b.cln.AmountH\x13\x88\x01\x01\x12(\n\x1b\x66\x65\x65_proportional_millionths\x18\x19 \x01(\rH\x14\x88\x01\x01\x12)\n\x0f\x64ust_limit_msat\x18\x1a \x01(\x0b\x32\x0b.cln.AmountH\x15\x88\x01\x01\x12\x30\n\x16max_total_htlc_in_msat\x18\x1b \x01(\x0b\x32\x0b.cln.AmountH\x16\x88\x01\x01\x12,\n\x12their_reserve_msat\x18\x1c \x01(\x0b\x32\x0b.cln.AmountH\x17\x88\x01\x01\x12*\n\x10our_reserve_msat\x18\x1d \x01(\x0b\x32\x0b.cln.AmountH\x18\x88\x01\x01\x12(\n\x0espendable_msat\x18\x1e \x01(\x0b\x32\x0b.cln.AmountH\x19\x88\x01\x01\x12)\n\x0freceivable_msat\x18\x1f \x01(\x0b\x32\x0b.cln.AmountH\x1a\x88\x01\x01\x12.\n\x14minimum_htlc_in_msat\x18 \x01(\x0b\x32\x0b.cln.AmountH\x1b\x88\x01\x01\x12/\n\x15minimum_htlc_out_msat\x18\x30 \x01(\x0b\x32\x0b.cln.AmountH\x1c\x88\x01\x01\x12/\n\x15maximum_htlc_out_msat\x18\x31 \x01(\x0b\x32\x0b.cln.AmountH\x1d\x88\x01\x01\x12 \n\x13their_to_self_delay\x18! \x01(\rH\x1e\x88\x01\x01\x12\x1e\n\x11our_to_self_delay\x18\" \x01(\rH\x1f\x88\x01\x01\x12\x1f\n\x12max_accepted_htlcs\x18# \x01(\rH \x88\x01\x01\x12\x34\n\x05\x61lias\x18\x32 \x01(\x0b\x32 .cln.ListpeersPeersChannelsAliasH!\x88\x01\x01\x12\x0e\n\x06status\x18% \x03(\t\x12 \n\x13in_payments_offered\x18& \x01(\x04H\"\x88\x01\x01\x12)\n\x0fin_offered_msat\x18\' \x01(\x0b\x32\x0b.cln.AmountH#\x88\x01\x01\x12\"\n\x15in_payments_fulfilled\x18( \x01(\x04H$\x88\x01\x01\x12+\n\x11in_fulfilled_msat\x18) \x01(\x0b\x32\x0b.cln.AmountH%\x88\x01\x01\x12!\n\x14out_payments_offered\x18* \x01(\x04H&\x88\x01\x01\x12*\n\x10out_offered_msat\x18+ \x01(\x0b\x32\x0b.cln.AmountH\'\x88\x01\x01\x12#\n\x16out_payments_fulfilled\x18, \x01(\x04H(\x88\x01\x01\x12,\n\x12out_fulfilled_msat\x18- \x01(\x0b\x32\x0b.cln.AmountH)\x88\x01\x01\x12/\n\x05htlcs\x18. \x03(\x0b\x32 .cln.ListpeersPeersChannelsHtlcs\x12\x1a\n\rclose_to_addr\x18/ \x01(\tH*\x88\x01\x01\"\xe0\x02\n\x1bListpeersPeersChannelsState\x12\x0c\n\x08OPENINGD\x10\x00\x12\x1c\n\x18\x43HANNELD_AWAITING_LOCKIN\x10\x01\x12\x13\n\x0f\x43HANNELD_NORMAL\x10\x02\x12\x1a\n\x16\x43HANNELD_SHUTTING_DOWN\x10\x03\x12\x18\n\x14\x43LOSINGD_SIGEXCHANGE\x10\x04\x12\x15\n\x11\x43LOSINGD_COMPLETE\x10\x05\x12\x17\n\x13\x41WAITING_UNILATERAL\x10\x06\x12\x16\n\x12\x46UNDING_SPEND_SEEN\x10\x07\x12\x0b\n\x07ONCHAIN\x10\x08\x12\x17\n\x13\x44UALOPEND_OPEN_INIT\x10\t\x12\x1d\n\x19\x44UALOPEND_AWAITING_LOCKIN\x10\n\x12\x1c\n\x18\x44UALOPEND_OPEN_COMMITTED\x10\x0b\x12\x1f\n\x1b\x44UALOPEND_OPEN_COMMIT_READY\x10\x0c\x42\x0f\n\r_scratch_txidB\n\n\x08_feerateB\x08\n\x06_ownerB\x13\n\x11_short_channel_idB\r\n\x0b_channel_idB\x0f\n\r_funding_txidB\x11\n\x0f_funding_outnumB\x12\n\x10_initial_feerateB\x0f\n\r_last_feerateB\x0f\n\r_next_feerateB\x10\n\x0e_next_fee_stepB\x0b\n\t_close_toB\n\n\x08_privateB\t\n\x07_closerB\n\n\x08_fundingB\r\n\x0b_to_us_msatB\x11\n\x0f_min_to_us_msatB\x11\n\x0f_max_to_us_msatB\r\n\x0b_total_msatB\x10\n\x0e_fee_base_msatB\x1e\n\x1c_fee_proportional_millionthsB\x12\n\x10_dust_limit_msatB\x19\n\x17_max_total_htlc_in_msatB\x15\n\x13_their_reserve_msatB\x13\n\x11_our_reserve_msatB\x11\n\x0f_spendable_msatB\x12\n\x10_receivable_msatB\x17\n\x15_minimum_htlc_in_msatB\x18\n\x16_minimum_htlc_out_msatB\x18\n\x16_maximum_htlc_out_msatB\x16\n\x14_their_to_self_delayB\x14\n\x12_our_to_self_delayB\x15\n\x13_max_accepted_htlcsB\x08\n\x06_aliasB\x16\n\x14_in_payments_offeredB\x12\n\x10_in_offered_msatB\x18\n\x16_in_payments_fulfilledB\x14\n\x12_in_fulfilled_msatB\x17\n\x15_out_payments_offeredB\x13\n\x11_out_offered_msatB\x19\n\x17_out_payments_fulfilledB\x15\n\x13_out_fulfilled_msatB\x10\n\x0e_close_to_addr\"=\n\x1dListpeersPeersChannelsFeerate\x12\r\n\x05perkw\x18\x01 \x01(\r\x12\r\n\x05perkb\x18\x02 \x01(\r\"\xf3\x01\n\x1eListpeersPeersChannelsInflight\x12\x14\n\x0c\x66unding_txid\x18\x01 \x01(\x0c\x12\x16\n\x0e\x66unding_outnum\x18\x02 \x01(\r\x12\x0f\n\x07\x66\x65\x65rate\x18\x03 \x01(\t\x12\'\n\x12total_funding_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10our_funding_msat\x18\x05 \x01(\x0b\x32\x0b.cln.Amount\x12\x1a\n\rsplice_amount\x18\x07 \x01(\x12H\x00\x88\x01\x01\x12\x14\n\x0cscratch_txid\x18\x06 \x01(\x0c\x42\x10\n\x0e_splice_amount\"\x9b\x02\n\x1dListpeersPeersChannelsFunding\x12%\n\x0bpushed_msat\x18\x03 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12%\n\x10local_funds_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12&\n\x11remote_funds_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\'\n\rfee_paid_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\'\n\rfee_rcvd_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x42\x0e\n\x0c_pushed_msatB\x10\n\x0e_fee_paid_msatB\x10\n\x0e_fee_rcvd_msat\"[\n\x1bListpeersPeersChannelsAlias\x12\x12\n\x05local\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06remote\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_localB\t\n\x07_remote\"\xf1\x02\n\x1bListpeersPeersChannelsHtlcs\x12X\n\tdirection\x18\x01 \x01(\x0e\x32\x45.cln.ListpeersPeersChannelsHtlcs.ListpeersPeersChannelsHtlcsDirection\x12\n\n\x02id\x18\x02 \x01(\x04\x12 \n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x0e\n\x06\x65xpiry\x18\x04 \x01(\r\x12\x14\n\x0cpayment_hash\x18\x05 \x01(\x0c\x12\x1a\n\rlocal_trimmed\x18\x06 \x01(\x08H\x00\x88\x01\x01\x12\x13\n\x06status\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x1d\n\x05state\x18\x08 \x01(\x0e\x32\x0e.cln.HtlcState\"7\n$ListpeersPeersChannelsHtlcsDirection\x12\x06\n\x02IN\x10\x00\x12\x07\n\x03OUT\x10\x01\x42\x10\n\x0e_local_trimmedB\t\n\x07_status\"0\n\x10ListfundsRequest\x12\x12\n\x05spent\x18\x01 \x01(\x08H\x00\x88\x01\x01\x42\x08\n\x06_spent\"e\n\x11ListfundsResponse\x12&\n\x07outputs\x18\x01 \x03(\x0b\x32\x15.cln.ListfundsOutputs\x12(\n\x08\x63hannels\x18\x02 \x03(\x0b\x32\x16.cln.ListfundsChannels\"\x83\x03\n\x10ListfundsOutputs\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x0e\n\x06output\x18\x02 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x14\n\x0cscriptpubkey\x18\x04 \x01(\x0c\x12\x14\n\x07\x61\x64\x64ress\x18\x05 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0credeemscript\x18\x06 \x01(\x0cH\x01\x88\x01\x01\x12<\n\x06status\x18\x07 \x01(\x0e\x32,.cln.ListfundsOutputs.ListfundsOutputsStatus\x12\x10\n\x08reserved\x18\t \x01(\x08\x12\x18\n\x0b\x62lockheight\x18\x08 \x01(\rH\x02\x88\x01\x01\"Q\n\x16ListfundsOutputsStatus\x12\x0f\n\x0bUNCONFIRMED\x10\x00\x12\r\n\tCONFIRMED\x10\x01\x12\t\n\x05SPENT\x10\x02\x12\x0c\n\x08IMMATURE\x10\x03\x42\n\n\x08_addressB\x0f\n\r_redeemscriptB\x0e\n\x0c_blockheight\"\xab\x02\n\x11ListfundsChannels\x12\x0f\n\x07peer_id\x18\x01 \x01(\x0c\x12$\n\x0four_amount_msat\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\x12 \n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x14\n\x0c\x66unding_txid\x18\x04 \x01(\x0c\x12\x16\n\x0e\x66unding_output\x18\x05 \x01(\r\x12\x11\n\tconnected\x18\x06 \x01(\x08\x12 \n\x05state\x18\x07 \x01(\x0e\x32\x11.cln.ChannelState\x12\x17\n\nchannel_id\x18\t \x01(\x0cH\x00\x88\x01\x01\x12\x1d\n\x10short_channel_id\x18\x08 \x01(\tH\x01\x88\x01\x01\x42\r\n\x0b_channel_idB\x13\n\x11_short_channel_id\"\xdd\x02\n\x0eSendpayRequest\x12 \n\x05route\x18\x01 \x03(\x0b\x32\x11.cln.SendpayRoute\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\x0c\x12\x12\n\x05label\x18\x03 \x01(\tH\x00\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x1b\n\x0epayment_secret\x18\x06 \x01(\x0cH\x03\x88\x01\x01\x12\x13\n\x06partid\x18\x07 \x01(\rH\x04\x88\x01\x01\x12\x1a\n\rlocalinvreqid\x18\x0b \x01(\x0cH\x05\x88\x01\x01\x12\x14\n\x07groupid\x18\t \x01(\x04H\x06\x88\x01\x01\x42\x08\n\x06_labelB\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\x11\n\x0f_payment_secretB\t\n\x07_partidB\x10\n\x0e_localinvreqidB\n\n\x08_groupid\"\xad\x05\n\x0fSendpayResponse\x12\x1a\n\rcreated_index\x18\x10 \x01(\x04H\x00\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x11 \x01(\x04H\x01\x88\x01\x01\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x14\n\x07groupid\x18\x02 \x01(\x04H\x02\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x32\n\x06status\x18\x04 \x01(\x0e\x32\".cln.SendpayResponse.SendpayStatus\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x06 \x01(\x0cH\x04\x88\x01\x01\x12\x12\n\ncreated_at\x18\x07 \x01(\x04\x12\x19\n\x0c\x63ompleted_at\x18\x0f \x01(\x04H\x05\x88\x01\x01\x12%\n\x10\x61mount_sent_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\t \x01(\tH\x06\x88\x01\x01\x12\x13\n\x06partid\x18\n \x01(\x04H\x07\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x0b \x01(\tH\x08\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x0c \x01(\tH\t\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\r \x01(\x0cH\n\x88\x01\x01\x12\x14\n\x07message\x18\x0e \x01(\tH\x0b\x88\x01\x01\"*\n\rSendpayStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x42\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\n\n\x08_groupidB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x0f\n\r_completed_atB\x08\n\x06_labelB\t\n\x07_partidB\t\n\x07_bolt11B\t\n\x07_bolt12B\x13\n\x11_payment_preimageB\n\n\x08_message\"\\\n\x0cSendpayRoute\x12 \n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.Amount\x12\n\n\x02id\x18\x02 \x01(\x0c\x12\r\n\x05\x64\x65lay\x18\x03 \x01(\r\x12\x0f\n\x07\x63hannel\x18\x04 \x01(\t\"\x93\x01\n\x13ListchannelsRequest\x12\x1d\n\x10short_channel_id\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06source\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x03 \x01(\x0cH\x02\x88\x01\x01\x42\x13\n\x11_short_channel_idB\t\n\x07_sourceB\x0e\n\x0c_destination\"C\n\x14ListchannelsResponse\x12+\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x19.cln.ListchannelsChannels\"\xb3\x03\n\x14ListchannelsChannels\x12\x0e\n\x06source\x18\x01 \x01(\x0c\x12\x13\n\x0b\x64\x65stination\x18\x02 \x01(\x0c\x12\x18\n\x10short_channel_id\x18\x03 \x01(\t\x12\x11\n\tdirection\x18\x10 \x01(\r\x12\x0e\n\x06public\x18\x04 \x01(\x08\x12 \n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.Amount\x12\x15\n\rmessage_flags\x18\x06 \x01(\r\x12\x15\n\rchannel_flags\x18\x07 \x01(\r\x12\x0e\n\x06\x61\x63tive\x18\x08 \x01(\x08\x12\x13\n\x0blast_update\x18\t \x01(\r\x12\x1d\n\x15\x62\x61se_fee_millisatoshi\x18\n \x01(\r\x12\x19\n\x11\x66\x65\x65_per_millionth\x18\x0b \x01(\r\x12\r\n\x05\x64\x65lay\x18\x0c \x01(\r\x12&\n\x11htlc_minimum_msat\x18\r \x01(\x0b\x32\x0b.cln.Amount\x12+\n\x11htlc_maximum_msat\x18\x0e \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x10\n\x08\x66\x65\x61tures\x18\x0f \x01(\x0c\x42\x14\n\x12_htlc_maximum_msat\"#\n\x10\x41\x64\x64gossipRequest\x12\x0f\n\x07message\x18\x01 \x01(\x0c\"\x13\n\x11\x41\x64\x64gossipResponse\"o\n\x17\x41utocleaninvoiceRequest\x12\x17\n\nexpired_by\x18\x01 \x01(\x04H\x00\x88\x01\x01\x12\x1a\n\rcycle_seconds\x18\x02 \x01(\x04H\x01\x88\x01\x01\x42\r\n\x0b_expired_byB\x10\n\x0e_cycle_seconds\"\x81\x01\n\x18\x41utocleaninvoiceResponse\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\x17\n\nexpired_by\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x1a\n\rcycle_seconds\x18\x03 \x01(\x04H\x01\x88\x01\x01\x42\r\n\x0b_expired_byB\x10\n\x0e_cycle_seconds\"U\n\x13\x43heckmessageRequest\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\r\n\x05zbase\x18\x02 \x01(\t\x12\x13\n\x06pubkey\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x42\t\n\x07_pubkey\"8\n\x14\x43heckmessageResponse\x12\x10\n\x08verified\x18\x01 \x01(\x08\x12\x0e\n\x06pubkey\x18\x02 \x01(\x0c\"\xcb\x02\n\x0c\x43loseRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x1e\n\x11unilateraltimeout\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x03 \x01(\tH\x01\x88\x01\x01\x12!\n\x14\x66\x65\x65_negotiation_step\x18\x04 \x01(\tH\x02\x88\x01\x01\x12)\n\rwrong_funding\x18\x05 \x01(\x0b\x32\r.cln.OutpointH\x03\x88\x01\x01\x12\x1f\n\x12\x66orce_lease_closed\x18\x06 \x01(\x08H\x04\x88\x01\x01\x12\x1e\n\x08\x66\x65\x65range\x18\x07 \x03(\x0b\x32\x0c.cln.FeerateB\x14\n\x12_unilateraltimeoutB\x0e\n\x0c_destinationB\x17\n\x15_fee_negotiation_stepB\x10\n\x0e_wrong_fundingB\x15\n\x13_force_lease_closed\"\xab\x01\n\rCloseResponse\x12/\n\titem_type\x18\x01 \x01(\x0e\x32\x1c.cln.CloseResponse.CloseType\x12\x0f\n\x02tx\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x11\n\x04txid\x18\x03 \x01(\x0cH\x01\x88\x01\x01\"5\n\tCloseType\x12\n\n\x06MUTUAL\x10\x00\x12\x0e\n\nUNILATERAL\x10\x01\x12\x0c\n\x08UNOPENED\x10\x02\x42\x05\n\x03_txB\x07\n\x05_txid\"T\n\x0e\x43onnectRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\x04host\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04port\x18\x03 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_hostB\x07\n\x05_port\"\xb4\x01\n\x0f\x43onnectResponse\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x10\n\x08\x66\x65\x61tures\x18\x02 \x01(\x0c\x12\x38\n\tdirection\x18\x03 \x01(\x0e\x32%.cln.ConnectResponse.ConnectDirection\x12$\n\x07\x61\x64\x64ress\x18\x04 \x01(\x0b\x32\x13.cln.ConnectAddress\"#\n\x10\x43onnectDirection\x12\x06\n\x02IN\x10\x00\x12\x07\n\x03OUT\x10\x01\"\xfb\x01\n\x0e\x43onnectAddress\x12\x39\n\titem_type\x18\x01 \x01(\x0e\x32&.cln.ConnectAddress.ConnectAddressType\x12\x13\n\x06socket\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x11\n\x04port\x18\x04 \x01(\rH\x02\x88\x01\x01\"P\n\x12\x43onnectAddressType\x12\x10\n\x0cLOCAL_SOCKET\x10\x00\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\t\n\x07_socketB\n\n\x08_addressB\x07\n\x05_port\"J\n\x14\x43reateinvoiceRequest\x12\x11\n\tinvstring\x18\x01 \x01(\t\x12\r\n\x05label\x18\x02 \x01(\t\x12\x10\n\x08preimage\x18\x03 \x01(\x0c\"\xfe\x05\n\x15\x43reateinvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x06\x62olt11\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x04 \x01(\x0c\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12>\n\x06status\x18\x06 \x01(\x0e\x32..cln.CreateinvoiceResponse.CreateinvoiceStatus\x12\x13\n\x0b\x64\x65scription\x18\x07 \x01(\t\x12\x12\n\nexpires_at\x18\x08 \x01(\x04\x12\x1a\n\rcreated_index\x18\x10 \x01(\x04H\x03\x88\x01\x01\x12\x16\n\tpay_index\x18\t \x01(\x04H\x04\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x05\x88\x01\x01\x12\x14\n\x07paid_at\x18\x0b \x01(\x04H\x06\x88\x01\x01\x12;\n\rpaid_outpoint\x18\x11 \x01(\x0b\x32\x1f.cln.CreateinvoicePaid_outpointH\x07\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\x08\x88\x01\x01\x12\x1b\n\x0elocal_offer_id\x18\r \x01(\x0cH\t\x88\x01\x01\x12\x1e\n\x11invreq_payer_note\x18\x0f \x01(\tH\n\x88\x01\x01\"8\n\x13\x43reateinvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x12\n\n\x06UNPAID\x10\x02\x42\t\n\x07_bolt11B\t\n\x07_bolt12B\x0e\n\x0c_amount_msatB\x10\n\x0e_created_indexB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x10\n\x0e_paid_outpointB\x13\n\x11_payment_preimageB\x11\n\x0f_local_offer_idB\x14\n\x12_invreq_payer_note\"X\n\x1a\x43reateinvoicePaid_outpoint\x12\x11\n\x04txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x13\n\x06outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_txidB\t\n\x07_outnum\"\xb4\x02\n\x10\x44\x61tastoreRequest\x12\x0b\n\x03key\x18\x05 \x03(\t\x12\x13\n\x06string\x18\x06 \x01(\tH\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12\x36\n\x04mode\x18\x03 \x01(\x0e\x32#.cln.DatastoreRequest.DatastoreModeH\x02\x88\x01\x01\x12\x17\n\ngeneration\x18\x04 \x01(\x04H\x03\x88\x01\x01\"p\n\rDatastoreMode\x12\x0f\n\x0bMUST_CREATE\x10\x00\x12\x10\n\x0cMUST_REPLACE\x10\x01\x12\x15\n\x11\x43REATE_OR_REPLACE\x10\x02\x12\x0f\n\x0bMUST_APPEND\x10\x03\x12\x14\n\x10\x43REATE_OR_APPEND\x10\x04\x42\t\n\x07_stringB\x06\n\x04_hexB\x07\n\x05_modeB\r\n\x0b_generation\"\x82\x01\n\x11\x44\x61tastoreResponse\x12\x0b\n\x03key\x18\x05 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x12\x13\n\x06string\x18\x04 \x01(\tH\x02\x88\x01\x01\x42\r\n\x0b_generationB\x06\n\x04_hexB\t\n\x07_string\"\x17\n\x15\x44\x61tastoreusageRequest\"k\n\x16\x44\x61tastoreusageResponse\x12>\n\x0e\x64\x61tastoreusage\x18\x01 \x01(\x0b\x32!.cln.DatastoreusageDatastoreusageH\x00\x88\x01\x01\x42\x11\n\x0f_datastoreusage\"b\n\x1c\x44\x61tastoreusageDatastoreusage\x12\x10\n\x03key\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x18\n\x0btotal_bytes\x18\x02 \x01(\x04H\x01\x88\x01\x01\x42\x06\n\x04_keyB\x0e\n\x0c_total_bytes\"\x9d\x01\n\x12\x43reateonionRequest\x12\"\n\x04hops\x18\x01 \x03(\x0b\x32\x14.cln.CreateonionHops\x12\x11\n\tassocdata\x18\x02 \x01(\x0c\x12\x18\n\x0bsession_key\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x12\x17\n\nonion_size\x18\x04 \x01(\rH\x01\x88\x01\x01\x42\x0e\n\x0c_session_keyB\r\n\x0b_onion_size\"<\n\x13\x43reateonionResponse\x12\r\n\x05onion\x18\x01 \x01(\x0c\x12\x16\n\x0eshared_secrets\x18\x02 \x03(\x0c\"2\n\x0f\x43reateonionHops\x12\x0e\n\x06pubkey\x18\x01 \x01(\x0c\x12\x0f\n\x07payload\x18\x02 \x01(\x0c\"J\n\x13\x44\x65ldatastoreRequest\x12\x0b\n\x03key\x18\x03 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\r\n\x0b_generation\"\x85\x01\n\x14\x44\x65ldatastoreResponse\x12\x0b\n\x03key\x18\x05 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x12\x13\n\x06string\x18\x04 \x01(\tH\x02\x88\x01\x01\x42\r\n\x0b_generationB\x06\n\x04_hexB\t\n\x07_string\"H\n\x18\x44\x65lexpiredinvoiceRequest\x12\x1a\n\rmaxexpirytime\x18\x01 \x01(\x04H\x00\x88\x01\x01\x42\x10\n\x0e_maxexpirytime\"\x1b\n\x19\x44\x65lexpiredinvoiceResponse\"\xb6\x01\n\x11\x44\x65linvoiceRequest\x12\r\n\x05label\x18\x01 \x01(\t\x12\x37\n\x06status\x18\x02 \x01(\x0e\x32\'.cln.DelinvoiceRequest.DelinvoiceStatus\x12\x15\n\x08\x64\x65sconly\x18\x03 \x01(\x08H\x00\x88\x01\x01\"5\n\x10\x44\x65linvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x12\n\n\x06UNPAID\x10\x02\x42\x0b\n\t_desconly\"\xa1\x04\n\x12\x44\x65linvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x06\x62olt11\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x03 \x01(\tH\x01\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x06 \x01(\x0c\x12\x1a\n\rcreated_index\x18\x0c \x01(\x04H\x04\x88\x01\x01\x12\x1a\n\rupdated_index\x18\r \x01(\x04H\x05\x88\x01\x01\x12\x38\n\x06status\x18\x07 \x01(\x0e\x32(.cln.DelinvoiceResponse.DelinvoiceStatus\x12\x12\n\nexpires_at\x18\x08 \x01(\x04\x12\x1b\n\x0elocal_offer_id\x18\t \x01(\x0cH\x06\x88\x01\x01\x12\x1e\n\x11invreq_payer_note\x18\x0b \x01(\tH\x07\x88\x01\x01\"5\n\x10\x44\x65linvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x12\n\n\x06UNPAID\x10\x02\x42\t\n\x07_bolt11B\t\n\x07_bolt12B\x0e\n\x0c_amount_msatB\x0e\n\x0c_descriptionB\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\x11\n\x0f_local_offer_idB\x14\n\x12_invreq_payer_note\"\xfa\x01\n\x0eInvoiceRequest\x12%\n\x0b\x61mount_msat\x18\n \x01(\x0b\x32\x10.cln.AmountOrAny\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\r\n\x05label\x18\x03 \x01(\t\x12\x13\n\x06\x65xpiry\x18\x07 \x01(\x04H\x00\x88\x01\x01\x12\x11\n\tfallbacks\x18\x04 \x03(\t\x12\x15\n\x08preimage\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x11\n\x04\x63ltv\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x19\n\x0c\x64\x65schashonly\x18\t \x01(\x08H\x03\x88\x01\x01\x42\t\n\x07_expiryB\x0b\n\t_preimageB\x07\n\x05_cltvB\x0f\n\r_deschashonly\"\x95\x03\n\x0fInvoiceResponse\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\x0c\x12\x16\n\x0epayment_secret\x18\x03 \x01(\x0c\x12\x12\n\nexpires_at\x18\x04 \x01(\x04\x12\x1a\n\rcreated_index\x18\n \x01(\x04H\x00\x88\x01\x01\x12\x1d\n\x10warning_capacity\x18\x05 \x01(\tH\x01\x88\x01\x01\x12\x1c\n\x0fwarning_offline\x18\x06 \x01(\tH\x02\x88\x01\x01\x12\x1d\n\x10warning_deadends\x18\x07 \x01(\tH\x03\x88\x01\x01\x12#\n\x16warning_private_unused\x18\x08 \x01(\tH\x04\x88\x01\x01\x12\x18\n\x0bwarning_mpp\x18\t \x01(\tH\x05\x88\x01\x01\x42\x10\n\x0e_created_indexB\x13\n\x11_warning_capacityB\x12\n\x10_warning_offlineB\x13\n\x11_warning_deadendsB\x19\n\x17_warning_private_unusedB\x0e\n\x0c_warning_mpp\"#\n\x14ListdatastoreRequest\x12\x0b\n\x03key\x18\x02 \x03(\t\"G\n\x15ListdatastoreResponse\x12.\n\tdatastore\x18\x01 \x03(\x0b\x32\x1b.cln.ListdatastoreDatastore\"\x87\x01\n\x16ListdatastoreDatastore\x12\x0b\n\x03key\x18\x01 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x12\x13\n\x06string\x18\x04 \x01(\tH\x02\x88\x01\x01\x42\r\n\x0b_generationB\x06\n\x04_hexB\t\n\x07_string\"\xde\x02\n\x13ListinvoicesRequest\x12\x12\n\x05label\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x16\n\tinvstring\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x03 \x01(\x0cH\x02\x88\x01\x01\x12\x15\n\x08offer_id\x18\x04 \x01(\tH\x03\x88\x01\x01\x12>\n\x05index\x18\x05 \x01(\x0e\x32*.cln.ListinvoicesRequest.ListinvoicesIndexH\x04\x88\x01\x01\x12\x12\n\x05start\x18\x06 \x01(\x04H\x05\x88\x01\x01\x12\x12\n\x05limit\x18\x07 \x01(\rH\x06\x88\x01\x01\"-\n\x11ListinvoicesIndex\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07UPDATED\x10\x01\x42\x08\n\x06_labelB\x0c\n\n_invstringB\x0f\n\r_payment_hashB\x0b\n\t_offer_idB\x08\n\x06_indexB\x08\n\x06_startB\x08\n\x06_limit\"C\n\x14ListinvoicesResponse\x12+\n\x08invoices\x18\x01 \x03(\x0b\x32\x19.cln.ListinvoicesInvoices\"\xd4\x06\n\x14ListinvoicesInvoices\x12\r\n\x05label\x18\x01 \x01(\t\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x44\n\x06status\x18\x04 \x01(\x0e\x32\x34.cln.ListinvoicesInvoices.ListinvoicesInvoicesStatus\x12\x12\n\nexpires_at\x18\x05 \x01(\x04\x12%\n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x08 \x01(\tH\x03\x88\x01\x01\x12\x1b\n\x0elocal_offer_id\x18\t \x01(\x0cH\x04\x88\x01\x01\x12\x1e\n\x11invreq_payer_note\x18\x0f \x01(\tH\x05\x88\x01\x01\x12\x1a\n\rcreated_index\x18\x10 \x01(\x04H\x06\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x11 \x01(\x04H\x07\x88\x01\x01\x12\x16\n\tpay_index\x18\x0b \x01(\x04H\x08\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\x0c \x01(\x0b\x32\x0b.cln.AmountH\t\x88\x01\x01\x12\x14\n\x07paid_at\x18\r \x01(\x04H\n\x88\x01\x01\x12\x42\n\rpaid_outpoint\x18\x12 \x01(\x0b\x32&.cln.ListinvoicesInvoicesPaid_outpointH\x0b\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0e \x01(\x0cH\x0c\x88\x01\x01\"?\n\x1aListinvoicesInvoicesStatus\x12\n\n\x06UNPAID\x10\x00\x12\x08\n\x04PAID\x10\x01\x12\x0b\n\x07\x45XPIRED\x10\x02\x42\x0e\n\x0c_descriptionB\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\t\n\x07_bolt12B\x11\n\x0f_local_offer_idB\x14\n\x12_invreq_payer_noteB\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x10\n\x0e_paid_outpointB\x13\n\x11_payment_preimage\"_\n!ListinvoicesInvoicesPaid_outpoint\x12\x11\n\x04txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x13\n\x06outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_txidB\t\n\x07_outnum\"\x8a\x03\n\x10SendonionRequest\x12\r\n\x05onion\x18\x01 \x01(\x0c\x12*\n\tfirst_hop\x18\x02 \x01(\x0b\x32\x17.cln.SendonionFirst_hop\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x12\n\x05label\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x16\n\x0eshared_secrets\x18\x05 \x03(\x0c\x12\x13\n\x06partid\x18\x06 \x01(\rH\x01\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x02\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x0c \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\t \x01(\x0cH\x04\x88\x01\x01\x12\x1a\n\rlocalinvreqid\x18\r \x01(\x0cH\x05\x88\x01\x01\x12\x14\n\x07groupid\x18\x0b \x01(\x04H\x06\x88\x01\x01\x42\x08\n\x06_labelB\t\n\x07_partidB\t\n\x07_bolt11B\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x10\n\x0e_localinvreqidB\n\n\x08_groupid\"\xe7\x04\n\x11SendonionResponse\x12\x1a\n\rcreated_index\x18\x0e \x01(\x04H\x00\x88\x01\x01\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\x0c\x12\x36\n\x06status\x18\x03 \x01(\x0e\x32&.cln.SendonionResponse.SendonionStatus\x12%\n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x05 \x01(\x0cH\x02\x88\x01\x01\x12\x12\n\ncreated_at\x18\x06 \x01(\x04\x12%\n\x10\x61mount_sent_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\x08 \x01(\tH\x03\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\t \x01(\tH\x04\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\n \x01(\tH\x05\x88\x01\x01\x12\x13\n\x06partid\x18\r \x01(\x04H\x06\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x0f \x01(\x04H\x07\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0b \x01(\x0cH\x08\x88\x01\x01\x12\x14\n\x07message\x18\x0c \x01(\tH\t\x88\x01\x01\",\n\x0fSendonionStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x42\x10\n\x0e_created_indexB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x08\n\x06_labelB\t\n\x07_bolt11B\t\n\x07_bolt12B\t\n\x07_partidB\x10\n\x0e_updated_indexB\x13\n\x11_payment_preimageB\n\n\x08_message\"Q\n\x12SendonionFirst_hop\x12\n\n\x02id\x18\x01 \x01(\x0c\x12 \n\x0b\x61mount_msat\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\x12\r\n\x05\x64\x65lay\x18\x03 \x01(\r\"\xa0\x03\n\x13ListsendpaysRequest\x12\x13\n\x06\x62olt11\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12@\n\x06status\x18\x03 \x01(\x0e\x32+.cln.ListsendpaysRequest.ListsendpaysStatusH\x02\x88\x01\x01\x12>\n\x05index\x18\x04 \x01(\x0e\x32*.cln.ListsendpaysRequest.ListsendpaysIndexH\x03\x88\x01\x01\x12\x12\n\x05start\x18\x05 \x01(\x04H\x04\x88\x01\x01\x12\x12\n\x05limit\x18\x06 \x01(\rH\x05\x88\x01\x01\";\n\x12ListsendpaysStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\"-\n\x11ListsendpaysIndex\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07UPDATED\x10\x01\x42\t\n\x07_bolt11B\x0f\n\r_payment_hashB\t\n\x07_statusB\x08\n\x06_indexB\x08\n\x06_startB\x08\n\x06_limit\"C\n\x14ListsendpaysResponse\x12+\n\x08payments\x18\x01 \x03(\x0b\x32\x19.cln.ListsendpaysPayments\"\xd0\x05\n\x14ListsendpaysPayments\x12\x1a\n\rcreated_index\x18\x10 \x01(\x04H\x00\x88\x01\x01\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x0f\n\x07groupid\x18\x02 \x01(\x04\x12\x13\n\x06partid\x18\x0f \x01(\x04H\x01\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x1a\n\rupdated_index\x18\x11 \x01(\x04H\x02\x88\x01\x01\x12\x44\n\x06status\x18\x04 \x01(\x0e\x32\x34.cln.ListsendpaysPayments.ListsendpaysPaymentsStatus\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x06 \x01(\x0cH\x04\x88\x01\x01\x12\x12\n\ncreated_at\x18\x07 \x01(\x04\x12%\n\x10\x61mount_sent_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\t \x01(\tH\x05\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\n \x01(\tH\x06\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x0e \x01(\tH\x07\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x0b \x01(\tH\x08\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\t\x88\x01\x01\x12\x17\n\nerroronion\x18\r \x01(\x0cH\n\x88\x01\x01\"C\n\x1aListsendpaysPaymentsStatus\x12\x0b\n\x07PENDING\x10\x00\x12\n\n\x06\x46\x41ILED\x10\x01\x12\x0c\n\x08\x43OMPLETE\x10\x02\x42\x10\n\x0e_created_indexB\t\n\x07_partidB\x10\n\x0e_updated_indexB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x08\n\x06_labelB\t\n\x07_bolt11B\x0e\n\x0c_descriptionB\t\n\x07_bolt12B\x13\n\x11_payment_preimageB\r\n\x0b_erroronion\"\x19\n\x17ListtransactionsRequest\"S\n\x18ListtransactionsResponse\x12\x37\n\x0ctransactions\x18\x01 \x03(\x0b\x32!.cln.ListtransactionsTransactions\"\xf8\x01\n\x1cListtransactionsTransactions\x12\x0c\n\x04hash\x18\x01 \x01(\x0c\x12\r\n\x05rawtx\x18\x02 \x01(\x0c\x12\x13\n\x0b\x62lockheight\x18\x03 \x01(\r\x12\x0f\n\x07txindex\x18\x04 \x01(\r\x12\x10\n\x08locktime\x18\x07 \x01(\r\x12\x0f\n\x07version\x18\x08 \x01(\r\x12\x37\n\x06inputs\x18\t \x03(\x0b\x32\'.cln.ListtransactionsTransactionsInputs\x12\x39\n\x07outputs\x18\n \x03(\x0b\x32(.cln.ListtransactionsTransactionsOutputs\"S\n\"ListtransactionsTransactionsInputs\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\r\n\x05index\x18\x02 \x01(\r\x12\x10\n\x08sequence\x18\x03 \x01(\r\"l\n#ListtransactionsTransactionsOutputs\x12\r\n\x05index\x18\x01 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12\x14\n\x0cscriptPubKey\x18\x03 \x01(\x0c\"\xda\x03\n\nPayRequest\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\x12%\n\x0b\x61mount_msat\x18\r \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x12\n\x05label\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x17\n\nriskfactor\x18\x08 \x01(\x01H\x02\x88\x01\x01\x12\x1a\n\rmaxfeepercent\x18\x04 \x01(\x01H\x03\x88\x01\x01\x12\x16\n\tretry_for\x18\x05 \x01(\rH\x04\x88\x01\x01\x12\x15\n\x08maxdelay\x18\x06 \x01(\rH\x05\x88\x01\x01\x12#\n\texemptfee\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x1a\n\rlocalinvreqid\x18\x0e \x01(\x0cH\x07\x88\x01\x01\x12\x0f\n\x07\x65xclude\x18\n \x03(\t\x12 \n\x06maxfee\x18\x0b \x01(\x0b\x32\x0b.cln.AmountH\x08\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x0c \x01(\tH\t\x88\x01\x01\x42\x0e\n\x0c_amount_msatB\x08\n\x06_labelB\r\n\x0b_riskfactorB\x10\n\x0e_maxfeepercentB\x0c\n\n_retry_forB\x0b\n\t_maxdelayB\x0c\n\n_exemptfeeB\x10\n\x0e_localinvreqidB\t\n\x07_maxfeeB\x0e\n\x0c_description\"\xfb\x02\n\x0bPayResponse\x12\x18\n\x10payment_preimage\x18\x01 \x01(\x0c\x12\x18\n\x0b\x64\x65stination\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x12\n\ncreated_at\x18\x04 \x01(\x01\x12\r\n\x05parts\x18\x05 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10\x61mount_sent_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\'\n\x1awarning_partial_completion\x18\x08 \x01(\tH\x01\x88\x01\x01\x12*\n\x06status\x18\t \x01(\x0e\x32\x1a.cln.PayResponse.PayStatus\"2\n\tPayStatus\x12\x0c\n\x08\x43OMPLETE\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x42\x0e\n\x0c_destinationB\x1d\n\x1b_warning_partial_completion\"*\n\x10ListnodesRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x05\n\x03_id\"7\n\x11ListnodesResponse\x12\"\n\x05nodes\x18\x01 \x03(\x0b\x32\x13.cln.ListnodesNodes\"\xe1\x01\n\x0eListnodesNodes\x12\x0e\n\x06nodeid\x18\x01 \x01(\x0c\x12\x1b\n\x0elast_timestamp\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x12\n\x05\x61lias\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x12\n\x05\x63olor\x18\x04 \x01(\x0cH\x02\x88\x01\x01\x12\x15\n\x08\x66\x65\x61tures\x18\x05 \x01(\x0cH\x03\x88\x01\x01\x12/\n\taddresses\x18\x06 \x03(\x0b\x32\x1c.cln.ListnodesNodesAddressesB\x11\n\x0f_last_timestampB\x08\n\x06_aliasB\x08\n\x06_colorB\x0b\n\t_features\"\xe8\x01\n\x17ListnodesNodesAddresses\x12K\n\titem_type\x18\x01 \x01(\x0e\x32\x38.cln.ListnodesNodesAddresses.ListnodesNodesAddressesType\x12\x0c\n\x04port\x18\x02 \x01(\r\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x00\x88\x01\x01\"P\n\x1bListnodesNodesAddressesType\x12\x07\n\x03\x44NS\x10\x00\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\n\n\x08_address\"g\n\x15WaitanyinvoiceRequest\x12\x1a\n\rlastpay_index\x18\x01 \x01(\x04H\x00\x88\x01\x01\x12\x14\n\x07timeout\x18\x02 \x01(\x04H\x01\x88\x01\x01\x42\x10\n\x0e_lastpay_indexB\n\n\x08_timeout\"\xbf\x05\n\x16WaitanyinvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12@\n\x06status\x18\x04 \x01(\x0e\x32\x30.cln.WaitanyinvoiceResponse.WaitanyinvoiceStatus\x12\x12\n\nexpires_at\x18\x05 \x01(\x04\x12%\n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x08 \x01(\tH\x02\x88\x01\x01\x12\x1a\n\rcreated_index\x18\r \x01(\x04H\x03\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x0e \x01(\x04H\x04\x88\x01\x01\x12\x16\n\tpay_index\x18\t \x01(\x04H\x05\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x14\n\x07paid_at\x18\x0b \x01(\x04H\x07\x88\x01\x01\x12<\n\rpaid_outpoint\x18\x0f \x01(\x0b\x32 .cln.WaitanyinvoicePaid_outpointH\x08\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\t\x88\x01\x01\"-\n\x14WaitanyinvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x42\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\t\n\x07_bolt12B\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x10\n\x0e_paid_outpointB\x13\n\x11_payment_preimage\"Y\n\x1bWaitanyinvoicePaid_outpoint\x12\x11\n\x04txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x13\n\x06outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_txidB\t\n\x07_outnum\"#\n\x12WaitinvoiceRequest\x12\r\n\x05label\x18\x01 \x01(\t\"\xb0\x05\n\x13WaitinvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12:\n\x06status\x18\x04 \x01(\x0e\x32*.cln.WaitinvoiceResponse.WaitinvoiceStatus\x12\x12\n\nexpires_at\x18\x05 \x01(\x04\x12%\n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x08 \x01(\tH\x02\x88\x01\x01\x12\x1a\n\rcreated_index\x18\r \x01(\x04H\x03\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x0e \x01(\x04H\x04\x88\x01\x01\x12\x16\n\tpay_index\x18\t \x01(\x04H\x05\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x14\n\x07paid_at\x18\x0b \x01(\x04H\x07\x88\x01\x01\x12\x39\n\rpaid_outpoint\x18\x0f \x01(\x0b\x32\x1d.cln.WaitinvoicePaid_outpointH\x08\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\t\x88\x01\x01\"*\n\x11WaitinvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x42\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\t\n\x07_bolt12B\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x10\n\x0e_paid_outpointB\x13\n\x11_payment_preimage\"V\n\x18WaitinvoicePaid_outpoint\x12\x11\n\x04txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x13\n\x06outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_txidB\t\n\x07_outnum\"\x8e\x01\n\x12WaitsendpayRequest\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x14\n\x07timeout\x18\x03 \x01(\rH\x00\x88\x01\x01\x12\x13\n\x06partid\x18\x02 \x01(\x04H\x01\x88\x01\x01\x12\x14\n\x07groupid\x18\x04 \x01(\x04H\x02\x88\x01\x01\x42\n\n\x08_timeoutB\t\n\x07_partidB\n\n\x08_groupid\"\x8e\x05\n\x13WaitsendpayResponse\x12\x1a\n\rcreated_index\x18\x0f \x01(\x04H\x00\x88\x01\x01\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x14\n\x07groupid\x18\x02 \x01(\x04H\x01\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12:\n\x06status\x18\x04 \x01(\x0e\x32*.cln.WaitsendpayResponse.WaitsendpayStatus\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x06 \x01(\x0cH\x03\x88\x01\x01\x12\x12\n\ncreated_at\x18\x07 \x01(\x04\x12\x1a\n\rupdated_index\x18\x10 \x01(\x04H\x04\x88\x01\x01\x12\x19\n\x0c\x63ompleted_at\x18\x0e \x01(\x01H\x05\x88\x01\x01\x12%\n\x10\x61mount_sent_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\t \x01(\tH\x06\x88\x01\x01\x12\x13\n\x06partid\x18\n \x01(\x04H\x07\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x0b \x01(\tH\x08\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x0c \x01(\tH\t\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\r \x01(\x0cH\n\x88\x01\x01\"!\n\x11WaitsendpayStatus\x12\x0c\n\x08\x43OMPLETE\x10\x00\x42\x10\n\x0e_created_indexB\n\n\x08_groupidB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x10\n\x0e_updated_indexB\x0f\n\r_completed_atB\x08\n\x06_labelB\t\n\x07_partidB\t\n\x07_bolt11B\t\n\x07_bolt12B\x13\n\x11_payment_preimage\"\x97\x01\n\x0eNewaddrRequest\x12@\n\x0b\x61\x64\x64resstype\x18\x01 \x01(\x0e\x32&.cln.NewaddrRequest.NewaddrAddresstypeH\x00\x88\x01\x01\"3\n\x12NewaddrAddresstype\x12\n\n\x06\x42\x45\x43H32\x10\x00\x12\x08\n\x04P2TR\x10\x03\x12\x07\n\x03\x41LL\x10\x02\x42\x0e\n\x0c_addresstype\"M\n\x0fNewaddrResponse\x12\x11\n\x04p2tr\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06\x62\x65\x63h32\x18\x01 \x01(\tH\x01\x88\x01\x01\x42\x07\n\x05_p2trB\t\n\x07_bech32\"\xca\x01\n\x0fWithdrawRequest\x12\x13\n\x0b\x64\x65stination\x18\x01 \x01(\t\x12&\n\x07satoshi\x18\x02 \x01(\x0b\x32\x10.cln.AmountOrAllH\x00\x88\x01\x01\x12\"\n\x07\x66\x65\x65rate\x18\x05 \x01(\x0b\x32\x0c.cln.FeerateH\x01\x88\x01\x01\x12\x14\n\x07minconf\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\x1c\n\x05utxos\x18\x04 \x03(\x0b\x32\r.cln.OutpointB\n\n\x08_satoshiB\n\n\x08_feerateB\n\n\x08_minconf\":\n\x10WithdrawResponse\x12\n\n\x02tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\x12\x0c\n\x04psbt\x18\x03 \x01(\t\"\x82\x03\n\x0eKeysendRequest\x12\x13\n\x0b\x64\x65stination\x18\x01 \x01(\x0c\x12 \n\x0b\x61mount_msat\x18\n \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x1a\n\rmaxfeepercent\x18\x04 \x01(\x01H\x01\x88\x01\x01\x12\x16\n\tretry_for\x18\x05 \x01(\rH\x02\x88\x01\x01\x12\x15\n\x08maxdelay\x18\x06 \x01(\rH\x03\x88\x01\x01\x12#\n\texemptfee\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x12+\n\nroutehints\x18\x08 \x01(\x0b\x32\x12.cln.RoutehintListH\x05\x88\x01\x01\x12&\n\textratlvs\x18\t \x01(\x0b\x32\x0e.cln.TlvStreamH\x06\x88\x01\x01\x42\x08\n\x06_labelB\x10\n\x0e_maxfeepercentB\x0c\n\n_retry_forB\x0b\n\t_maxdelayB\x0c\n\n_exemptfeeB\r\n\x0b_routehintsB\x0c\n\n_extratlvs\"\xf2\x02\n\x0fKeysendResponse\x12\x18\n\x10payment_preimage\x18\x01 \x01(\x0c\x12\x18\n\x0b\x64\x65stination\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x12\n\ncreated_at\x18\x04 \x01(\x01\x12\r\n\x05parts\x18\x05 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10\x61mount_sent_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\'\n\x1awarning_partial_completion\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\x32\n\x06status\x18\t \x01(\x0e\x32\".cln.KeysendResponse.KeysendStatus\"\x1d\n\rKeysendStatus\x12\x0c\n\x08\x43OMPLETE\x10\x00\x42\x0e\n\x0c_destinationB\x1d\n\x1b_warning_partial_completion\"\xa4\x03\n\x0f\x46undpsbtRequest\x12!\n\x07satoshi\x18\x01 \x01(\x0b\x32\x10.cln.AmountOrAll\x12\x1d\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.Feerate\x12\x13\n\x0bstartweight\x18\x03 \x01(\r\x12\x14\n\x07minconf\x18\x04 \x01(\rH\x00\x88\x01\x01\x12\x14\n\x07reserve\x18\x05 \x01(\rH\x01\x88\x01\x01\x12\x15\n\x08locktime\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x1f\n\x12min_witness_weight\x18\x07 \x01(\rH\x03\x88\x01\x01\x12\x1d\n\x10\x65xcess_as_change\x18\x08 \x01(\x08H\x04\x88\x01\x01\x12\x17\n\nnonwrapped\x18\t \x01(\x08H\x05\x88\x01\x01\x12#\n\x16opening_anchor_channel\x18\n \x01(\x08H\x06\x88\x01\x01\x42\n\n\x08_minconfB\n\n\x08_reserveB\x0b\n\t_locktimeB\x15\n\x13_min_witness_weightB\x13\n\x11_excess_as_changeB\r\n\x0b_nonwrappedB\x19\n\x17_opening_anchor_channel\"\xd9\x01\n\x10\x46undpsbtResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x16\n\x0e\x66\x65\x65rate_per_kw\x18\x02 \x01(\r\x12\x1e\n\x16\x65stimated_final_weight\x18\x03 \x01(\r\x12 \n\x0b\x65xcess_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\x1a\n\rchange_outnum\x18\x05 \x01(\rH\x00\x88\x01\x01\x12/\n\x0creservations\x18\x06 \x03(\x0b\x32\x19.cln.FundpsbtReservationsB\x10\n\x0e_change_outnum\"u\n\x14\x46undpsbtReservations\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x0c\n\x04vout\x18\x02 \x01(\r\x12\x14\n\x0cwas_reserved\x18\x03 \x01(\x08\x12\x10\n\x08reserved\x18\x04 \x01(\x08\x12\x19\n\x11reserved_to_block\x18\x05 \x01(\r\"A\n\x0fSendpsbtRequest\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x14\n\x07reserve\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\n\n\x08_reserve\",\n\x10SendpsbtResponse\x12\n\n\x02tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\"1\n\x0fSignpsbtRequest\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x10\n\x08signonly\x18\x02 \x03(\r\"\'\n\x10SignpsbtResponse\x12\x13\n\x0bsigned_psbt\x18\x01 \x01(\t\"\x9b\x03\n\x0fUtxopsbtRequest\x12\x1c\n\x07satoshi\x18\x01 \x01(\x0b\x32\x0b.cln.Amount\x12\x1d\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.Feerate\x12\x13\n\x0bstartweight\x18\x03 \x01(\r\x12\x1c\n\x05utxos\x18\x04 \x03(\x0b\x32\r.cln.Outpoint\x12\x14\n\x07reserve\x18\x05 \x01(\rH\x00\x88\x01\x01\x12\x17\n\nreservedok\x18\x08 \x01(\x08H\x01\x88\x01\x01\x12\x15\n\x08locktime\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x1f\n\x12min_witness_weight\x18\x07 \x01(\rH\x03\x88\x01\x01\x12\x1d\n\x10\x65xcess_as_change\x18\t \x01(\x08H\x04\x88\x01\x01\x12#\n\x16opening_anchor_channel\x18\n \x01(\x08H\x05\x88\x01\x01\x42\n\n\x08_reserveB\r\n\x0b_reservedokB\x0b\n\t_locktimeB\x15\n\x13_min_witness_weightB\x13\n\x11_excess_as_changeB\x19\n\x17_opening_anchor_channel\"\xd9\x01\n\x10UtxopsbtResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x16\n\x0e\x66\x65\x65rate_per_kw\x18\x02 \x01(\r\x12\x1e\n\x16\x65stimated_final_weight\x18\x03 \x01(\r\x12 \n\x0b\x65xcess_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\x1a\n\rchange_outnum\x18\x05 \x01(\rH\x00\x88\x01\x01\x12/\n\x0creservations\x18\x06 \x03(\x0b\x32\x19.cln.UtxopsbtReservationsB\x10\n\x0e_change_outnum\"u\n\x14UtxopsbtReservations\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x0c\n\x04vout\x18\x02 \x01(\r\x12\x14\n\x0cwas_reserved\x18\x03 \x01(\x08\x12\x10\n\x08reserved\x18\x04 \x01(\x08\x12\x19\n\x11reserved_to_block\x18\x05 \x01(\r\" \n\x10TxdiscardRequest\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\"6\n\x11TxdiscardResponse\x12\x13\n\x0bunsigned_tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\"\xa4\x01\n\x10TxprepareRequest\x12 \n\x07outputs\x18\x05 \x03(\x0b\x32\x0f.cln.OutputDesc\x12\"\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.FeerateH\x00\x88\x01\x01\x12\x14\n\x07minconf\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x1c\n\x05utxos\x18\x04 \x03(\x0b\x32\r.cln.OutpointB\n\n\x08_feerateB\n\n\x08_minconf\"D\n\x11TxprepareResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x13\n\x0bunsigned_tx\x18\x02 \x01(\x0c\x12\x0c\n\x04txid\x18\x03 \x01(\x0c\"\x1d\n\rTxsendRequest\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\"8\n\x0eTxsendResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\n\n\x02tx\x18\x02 \x01(\x0c\x12\x0c\n\x04txid\x18\x03 \x01(\x0c\"1\n\x17ListpeerchannelsRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x05\n\x03_id\"K\n\x18ListpeerchannelsResponse\x12/\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x1d.cln.ListpeerchannelsChannels\"\x8a\x1b\n\x18ListpeerchannelsChannels\x12\x14\n\x07peer_id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x1b\n\x0epeer_connected\x18\x02 \x01(\x08H\x01\x88\x01\x01\x12O\n\x05state\x18\x03 \x01(\x0e\x32;.cln.ListpeerchannelsChannels.ListpeerchannelsChannelsStateH\x02\x88\x01\x01\x12\x19\n\x0cscratch_txid\x18\x04 \x01(\x0cH\x03\x88\x01\x01\x12:\n\x07updates\x18\x37 \x01(\x0b\x32$.cln.ListpeerchannelsChannelsUpdatesH\x04\x88\x01\x01\x12\x1e\n\x11ignore_fee_limits\x18\x36 \x01(\x08H\x05\x88\x01\x01\x12\x17\n\nlost_state\x18\x39 \x01(\x08H\x06\x88\x01\x01\x12:\n\x07\x66\x65\x65rate\x18\x06 \x01(\x0b\x32$.cln.ListpeerchannelsChannelsFeerateH\x07\x88\x01\x01\x12\x12\n\x05owner\x18\x07 \x01(\tH\x08\x88\x01\x01\x12\x1d\n\x10short_channel_id\x18\x08 \x01(\tH\t\x88\x01\x01\x12\x17\n\nchannel_id\x18\t \x01(\x0cH\n\x88\x01\x01\x12\x19\n\x0c\x66unding_txid\x18\n \x01(\x0cH\x0b\x88\x01\x01\x12\x1b\n\x0e\x66unding_outnum\x18\x0b \x01(\rH\x0c\x88\x01\x01\x12\x1c\n\x0finitial_feerate\x18\x0c \x01(\tH\r\x88\x01\x01\x12\x19\n\x0clast_feerate\x18\r \x01(\tH\x0e\x88\x01\x01\x12\x19\n\x0cnext_feerate\x18\x0e \x01(\tH\x0f\x88\x01\x01\x12\x1a\n\rnext_fee_step\x18\x0f \x01(\rH\x10\x88\x01\x01\x12\x37\n\x08inflight\x18\x10 \x03(\x0b\x32%.cln.ListpeerchannelsChannelsInflight\x12\x15\n\x08\x63lose_to\x18\x11 \x01(\x0cH\x11\x88\x01\x01\x12\x14\n\x07private\x18\x12 \x01(\x08H\x12\x88\x01\x01\x12%\n\x06opener\x18\x13 \x01(\x0e\x32\x10.cln.ChannelSideH\x13\x88\x01\x01\x12%\n\x06\x63loser\x18\x14 \x01(\x0e\x32\x10.cln.ChannelSideH\x14\x88\x01\x01\x12:\n\x07\x66unding\x18\x16 \x01(\x0b\x32$.cln.ListpeerchannelsChannelsFundingH\x15\x88\x01\x01\x12$\n\nto_us_msat\x18\x17 \x01(\x0b\x32\x0b.cln.AmountH\x16\x88\x01\x01\x12(\n\x0emin_to_us_msat\x18\x18 \x01(\x0b\x32\x0b.cln.AmountH\x17\x88\x01\x01\x12(\n\x0emax_to_us_msat\x18\x19 \x01(\x0b\x32\x0b.cln.AmountH\x18\x88\x01\x01\x12$\n\ntotal_msat\x18\x1a \x01(\x0b\x32\x0b.cln.AmountH\x19\x88\x01\x01\x12\'\n\rfee_base_msat\x18\x1b \x01(\x0b\x32\x0b.cln.AmountH\x1a\x88\x01\x01\x12(\n\x1b\x66\x65\x65_proportional_millionths\x18\x1c \x01(\rH\x1b\x88\x01\x01\x12)\n\x0f\x64ust_limit_msat\x18\x1d \x01(\x0b\x32\x0b.cln.AmountH\x1c\x88\x01\x01\x12\x30\n\x16max_total_htlc_in_msat\x18\x1e \x01(\x0b\x32\x0b.cln.AmountH\x1d\x88\x01\x01\x12,\n\x12their_reserve_msat\x18\x1f \x01(\x0b\x32\x0b.cln.AmountH\x1e\x88\x01\x01\x12*\n\x10our_reserve_msat\x18 \x01(\x0b\x32\x0b.cln.AmountH\x1f\x88\x01\x01\x12(\n\x0espendable_msat\x18! \x01(\x0b\x32\x0b.cln.AmountH \x88\x01\x01\x12)\n\x0freceivable_msat\x18\" \x01(\x0b\x32\x0b.cln.AmountH!\x88\x01\x01\x12.\n\x14minimum_htlc_in_msat\x18# \x01(\x0b\x32\x0b.cln.AmountH\"\x88\x01\x01\x12/\n\x15minimum_htlc_out_msat\x18$ \x01(\x0b\x32\x0b.cln.AmountH#\x88\x01\x01\x12/\n\x15maximum_htlc_out_msat\x18% \x01(\x0b\x32\x0b.cln.AmountH$\x88\x01\x01\x12 \n\x13their_to_self_delay\x18& \x01(\rH%\x88\x01\x01\x12\x1e\n\x11our_to_self_delay\x18\' \x01(\rH&\x88\x01\x01\x12\x1f\n\x12max_accepted_htlcs\x18( \x01(\rH\'\x88\x01\x01\x12\x36\n\x05\x61lias\x18) \x01(\x0b\x32\".cln.ListpeerchannelsChannelsAliasH(\x88\x01\x01\x12\x0e\n\x06status\x18+ \x03(\t\x12 \n\x13in_payments_offered\x18, \x01(\x04H)\x88\x01\x01\x12)\n\x0fin_offered_msat\x18- \x01(\x0b\x32\x0b.cln.AmountH*\x88\x01\x01\x12\"\n\x15in_payments_fulfilled\x18. \x01(\x04H+\x88\x01\x01\x12+\n\x11in_fulfilled_msat\x18/ \x01(\x0b\x32\x0b.cln.AmountH,\x88\x01\x01\x12!\n\x14out_payments_offered\x18\x30 \x01(\x04H-\x88\x01\x01\x12*\n\x10out_offered_msat\x18\x31 \x01(\x0b\x32\x0b.cln.AmountH.\x88\x01\x01\x12#\n\x16out_payments_fulfilled\x18\x32 \x01(\x04H/\x88\x01\x01\x12,\n\x12out_fulfilled_msat\x18\x33 \x01(\x0b\x32\x0b.cln.AmountH0\x88\x01\x01\x12#\n\x16last_stable_connection\x18\x38 \x01(\x04H1\x88\x01\x01\x12\x31\n\x05htlcs\x18\x34 \x03(\x0b\x32\".cln.ListpeerchannelsChannelsHtlcs\x12\x1a\n\rclose_to_addr\x18\x35 \x01(\tH2\x88\x01\x01\"\x80\x03\n\x1dListpeerchannelsChannelsState\x12\x0c\n\x08OPENINGD\x10\x00\x12\x1c\n\x18\x43HANNELD_AWAITING_LOCKIN\x10\x01\x12\x13\n\x0f\x43HANNELD_NORMAL\x10\x02\x12\x1a\n\x16\x43HANNELD_SHUTTING_DOWN\x10\x03\x12\x18\n\x14\x43LOSINGD_SIGEXCHANGE\x10\x04\x12\x15\n\x11\x43LOSINGD_COMPLETE\x10\x05\x12\x17\n\x13\x41WAITING_UNILATERAL\x10\x06\x12\x16\n\x12\x46UNDING_SPEND_SEEN\x10\x07\x12\x0b\n\x07ONCHAIN\x10\x08\x12\x17\n\x13\x44UALOPEND_OPEN_INIT\x10\t\x12\x1d\n\x19\x44UALOPEND_AWAITING_LOCKIN\x10\n\x12\x1c\n\x18\x43HANNELD_AWAITING_SPLICE\x10\x0b\x12\x1c\n\x18\x44UALOPEND_OPEN_COMMITTED\x10\x0c\x12\x1f\n\x1b\x44UALOPEND_OPEN_COMMIT_READY\x10\rB\n\n\x08_peer_idB\x11\n\x0f_peer_connectedB\x08\n\x06_stateB\x0f\n\r_scratch_txidB\n\n\x08_updatesB\x14\n\x12_ignore_fee_limitsB\r\n\x0b_lost_stateB\n\n\x08_feerateB\x08\n\x06_ownerB\x13\n\x11_short_channel_idB\r\n\x0b_channel_idB\x0f\n\r_funding_txidB\x11\n\x0f_funding_outnumB\x12\n\x10_initial_feerateB\x0f\n\r_last_feerateB\x0f\n\r_next_feerateB\x10\n\x0e_next_fee_stepB\x0b\n\t_close_toB\n\n\x08_privateB\t\n\x07_openerB\t\n\x07_closerB\n\n\x08_fundingB\r\n\x0b_to_us_msatB\x11\n\x0f_min_to_us_msatB\x11\n\x0f_max_to_us_msatB\r\n\x0b_total_msatB\x10\n\x0e_fee_base_msatB\x1e\n\x1c_fee_proportional_millionthsB\x12\n\x10_dust_limit_msatB\x19\n\x17_max_total_htlc_in_msatB\x15\n\x13_their_reserve_msatB\x13\n\x11_our_reserve_msatB\x11\n\x0f_spendable_msatB\x12\n\x10_receivable_msatB\x17\n\x15_minimum_htlc_in_msatB\x18\n\x16_minimum_htlc_out_msatB\x18\n\x16_maximum_htlc_out_msatB\x16\n\x14_their_to_self_delayB\x14\n\x12_our_to_self_delayB\x15\n\x13_max_accepted_htlcsB\x08\n\x06_aliasB\x16\n\x14_in_payments_offeredB\x12\n\x10_in_offered_msatB\x18\n\x16_in_payments_fulfilledB\x14\n\x12_in_fulfilled_msatB\x17\n\x15_out_payments_offeredB\x13\n\x11_out_offered_msatB\x19\n\x17_out_payments_fulfilledB\x15\n\x13_out_fulfilled_msatB\x19\n\x17_last_stable_connectionB\x10\n\x0e_close_to_addr\"\xb6\x01\n\x1fListpeerchannelsChannelsUpdates\x12=\n\x05local\x18\x01 \x01(\x0b\x32).cln.ListpeerchannelsChannelsUpdatesLocalH\x00\x88\x01\x01\x12?\n\x06remote\x18\x02 \x01(\x0b\x32*.cln.ListpeerchannelsChannelsUpdatesRemoteH\x01\x88\x01\x01\x42\x08\n\x06_localB\t\n\x07_remote\"\xe7\x02\n$ListpeerchannelsChannelsUpdatesLocal\x12+\n\x11htlc_minimum_msat\x18\x01 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12+\n\x11htlc_maximum_msat\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x1e\n\x11\x63ltv_expiry_delta\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\'\n\rfee_base_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12(\n\x1b\x66\x65\x65_proportional_millionths\x18\x05 \x01(\rH\x04\x88\x01\x01\x42\x14\n\x12_htlc_minimum_msatB\x14\n\x12_htlc_maximum_msatB\x14\n\x12_cltv_expiry_deltaB\x10\n\x0e_fee_base_msatB\x1e\n\x1c_fee_proportional_millionths\"\xe8\x02\n%ListpeerchannelsChannelsUpdatesRemote\x12+\n\x11htlc_minimum_msat\x18\x01 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12+\n\x11htlc_maximum_msat\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x1e\n\x11\x63ltv_expiry_delta\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\'\n\rfee_base_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12(\n\x1b\x66\x65\x65_proportional_millionths\x18\x05 \x01(\rH\x04\x88\x01\x01\x42\x14\n\x12_htlc_minimum_msatB\x14\n\x12_htlc_maximum_msatB\x14\n\x12_cltv_expiry_deltaB\x10\n\x0e_fee_base_msatB\x1e\n\x1c_fee_proportional_millionths\"]\n\x1fListpeerchannelsChannelsFeerate\x12\x12\n\x05perkw\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x12\n\x05perkb\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x08\n\x06_perkwB\x08\n\x06_perkb\"\x80\x03\n ListpeerchannelsChannelsInflight\x12\x19\n\x0c\x66unding_txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x1b\n\x0e\x66unding_outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x14\n\x07\x66\x65\x65rate\x18\x03 \x01(\tH\x02\x88\x01\x01\x12,\n\x12total_funding_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x1a\n\rsplice_amount\x18\x07 \x01(\x12H\x04\x88\x01\x01\x12*\n\x10our_funding_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x05\x88\x01\x01\x12\x19\n\x0cscratch_txid\x18\x06 \x01(\x0cH\x06\x88\x01\x01\x42\x0f\n\r_funding_txidB\x11\n\x0f_funding_outnumB\n\n\x08_feerateB\x15\n\x13_total_funding_msatB\x10\n\x0e_splice_amountB\x13\n\x11_our_funding_msatB\x0f\n\r_scratch_txid\"\xd2\x02\n\x1fListpeerchannelsChannelsFunding\x12%\n\x0bpushed_msat\x18\x01 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12*\n\x10local_funds_msat\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12+\n\x11remote_funds_msat\x18\x03 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12\'\n\rfee_paid_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\'\n\rfee_rcvd_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x42\x0e\n\x0c_pushed_msatB\x13\n\x11_local_funds_msatB\x14\n\x12_remote_funds_msatB\x10\n\x0e_fee_paid_msatB\x10\n\x0e_fee_rcvd_msat\"]\n\x1dListpeerchannelsChannelsAlias\x12\x12\n\x05local\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06remote\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_localB\t\n\x07_remote\"\xe2\x03\n\x1dListpeerchannelsChannelsHtlcs\x12\x61\n\tdirection\x18\x01 \x01(\x0e\x32I.cln.ListpeerchannelsChannelsHtlcs.ListpeerchannelsChannelsHtlcsDirectionH\x00\x88\x01\x01\x12\x0f\n\x02id\x18\x02 \x01(\x04H\x01\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12\x13\n\x06\x65xpiry\x18\x04 \x01(\rH\x03\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x05 \x01(\x0cH\x04\x88\x01\x01\x12\x1a\n\rlocal_trimmed\x18\x06 \x01(\x08H\x05\x88\x01\x01\x12\x13\n\x06status\x18\x07 \x01(\tH\x06\x88\x01\x01\x12\"\n\x05state\x18\x08 \x01(\x0e\x32\x0e.cln.HtlcStateH\x07\x88\x01\x01\"9\n&ListpeerchannelsChannelsHtlcsDirection\x12\x06\n\x02IN\x10\x00\x12\x07\n\x03OUT\x10\x01\x42\x0c\n\n_directionB\x05\n\x03_idB\x0e\n\x0c_amount_msatB\t\n\x07_expiryB\x0f\n\r_payment_hashB\x10\n\x0e_local_trimmedB\t\n\x07_statusB\x08\n\x06_state\"3\n\x19ListclosedchannelsRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x05\n\x03_id\"[\n\x1aListclosedchannelsResponse\x12=\n\x0e\x63losedchannels\x18\x01 \x03(\x0b\x32%.cln.ListclosedchannelsClosedchannels\"\xf2\t\n ListclosedchannelsClosedchannels\x12\x14\n\x07peer_id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x12\n\nchannel_id\x18\x02 \x01(\x0c\x12\x1d\n\x10short_channel_id\x18\x03 \x01(\tH\x01\x88\x01\x01\x12>\n\x05\x61lias\x18\x04 \x01(\x0b\x32*.cln.ListclosedchannelsClosedchannelsAliasH\x02\x88\x01\x01\x12 \n\x06opener\x18\x05 \x01(\x0e\x32\x10.cln.ChannelSide\x12%\n\x06\x63loser\x18\x06 \x01(\x0e\x32\x10.cln.ChannelSideH\x03\x88\x01\x01\x12\x0f\n\x07private\x18\x07 \x01(\x08\x12\x1f\n\x17total_local_commitments\x18\t \x01(\x04\x12 \n\x18total_remote_commitments\x18\n \x01(\x04\x12\x18\n\x10total_htlcs_sent\x18\x0b \x01(\x04\x12\x14\n\x0c\x66unding_txid\x18\x0c \x01(\x0c\x12\x16\n\x0e\x66unding_outnum\x18\r \x01(\r\x12\x0e\n\x06leased\x18\x0e \x01(\x08\x12/\n\x15\x66unding_fee_paid_msat\x18\x0f \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x12/\n\x15\x66unding_fee_rcvd_msat\x18\x10 \x01(\x0b\x32\x0b.cln.AmountH\x05\x88\x01\x01\x12-\n\x13\x66unding_pushed_msat\x18\x11 \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x1f\n\ntotal_msat\x18\x12 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10\x66inal_to_us_msat\x18\x13 \x01(\x0b\x32\x0b.cln.Amount\x12#\n\x0emin_to_us_msat\x18\x14 \x01(\x0b\x32\x0b.cln.Amount\x12#\n\x0emax_to_us_msat\x18\x15 \x01(\x0b\x32\x0b.cln.Amount\x12!\n\x14last_commitment_txid\x18\x16 \x01(\x0cH\x07\x88\x01\x01\x12\x32\n\x18last_commitment_fee_msat\x18\x17 \x01(\x0b\x32\x0b.cln.AmountH\x08\x88\x01\x01\x12\x66\n\x0b\x63lose_cause\x18\x18 \x01(\x0e\x32Q.cln.ListclosedchannelsClosedchannels.ListclosedchannelsClosedchannelsClose_cause\x12#\n\x16last_stable_connection\x18\x19 \x01(\x04H\t\x88\x01\x01\"v\n+ListclosedchannelsClosedchannelsClose_cause\x12\x0b\n\x07UNKNOWN\x10\x00\x12\t\n\x05LOCAL\x10\x01\x12\x08\n\x04USER\x10\x02\x12\n\n\x06REMOTE\x10\x03\x12\x0c\n\x08PROTOCOL\x10\x04\x12\x0b\n\x07ONCHAIN\x10\x05\x42\n\n\x08_peer_idB\x13\n\x11_short_channel_idB\x08\n\x06_aliasB\t\n\x07_closerB\x18\n\x16_funding_fee_paid_msatB\x18\n\x16_funding_fee_rcvd_msatB\x16\n\x14_funding_pushed_msatB\x17\n\x15_last_commitment_txidB\x1b\n\x19_last_commitment_fee_msatB\x19\n\x17_last_stable_connection\"e\n%ListclosedchannelsClosedchannelsAlias\x12\x12\n\x05local\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06remote\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_localB\t\n\x07_remote\"L\n\x10\x44\x65\x63odepayRequest\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_description\"\x8d\x04\n\x11\x44\x65\x63odepayResponse\x12\x10\n\x08\x63urrency\x18\x01 \x01(\t\x12\x12\n\ncreated_at\x18\x02 \x01(\x04\x12\x0e\n\x06\x65xpiry\x18\x03 \x01(\x04\x12\r\n\x05payee\x18\x04 \x01(\x0c\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x06 \x01(\x0c\x12\x11\n\tsignature\x18\x07 \x01(\t\x12\x18\n\x0b\x64\x65scription\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\x1d\n\x10\x64\x65scription_hash\x18\t \x01(\x0cH\x02\x88\x01\x01\x12\x1d\n\x15min_final_cltv_expiry\x18\n \x01(\r\x12\x1b\n\x0epayment_secret\x18\x0b \x01(\x0cH\x03\x88\x01\x01\x12\x15\n\x08\x66\x65\x61tures\x18\x0c \x01(\x0cH\x04\x88\x01\x01\x12\x1d\n\x10payment_metadata\x18\r \x01(\x0cH\x05\x88\x01\x01\x12*\n\tfallbacks\x18\x0e \x03(\x0b\x32\x17.cln.DecodepayFallbacks\x12\"\n\x05\x65xtra\x18\x10 \x03(\x0b\x32\x13.cln.DecodepayExtraB\x0e\n\x0c_amount_msatB\x0e\n\x0c_descriptionB\x13\n\x11_description_hashB\x11\n\x0f_payment_secretB\x0b\n\t_featuresB\x13\n\x11_payment_metadata\"\xd0\x01\n\x12\x44\x65\x63odepayFallbacks\x12\x41\n\titem_type\x18\x01 \x01(\x0e\x32..cln.DecodepayFallbacks.DecodepayFallbacksType\x12\x11\n\x04\x61\x64\x64r\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x0b\n\x03hex\x18\x03 \x01(\x0c\"N\n\x16\x44\x65\x63odepayFallbacksType\x12\t\n\x05P2PKH\x10\x00\x12\x08\n\x04P2SH\x10\x01\x12\n\n\x06P2WPKH\x10\x02\x12\t\n\x05P2WSH\x10\x03\x12\x08\n\x04P2TR\x10\x04\x42\x07\n\x05_addr\"+\n\x0e\x44\x65\x63odepayExtra\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\t\"\x1f\n\rDecodeRequest\x12\x0e\n\x06string\x18\x01 \x01(\t\"\xe8!\n\x0e\x44\x65\x63odeResponse\x12\x31\n\titem_type\x18\x01 \x01(\x0e\x32\x1e.cln.DecodeResponse.DecodeType\x12\r\n\x05valid\x18\x02 \x01(\x08\x12\x15\n\x08offer_id\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x12\x14\n\x0coffer_chains\x18\x04 \x03(\x0c\x12\x1b\n\x0eoffer_metadata\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x1b\n\x0eoffer_currency\x18\x06 \x01(\tH\x02\x88\x01\x01\x12+\n\x1ewarning_unknown_offer_currency\x18\x07 \x01(\tH\x03\x88\x01\x01\x12 \n\x13\x63urrency_minor_unit\x18\x08 \x01(\rH\x04\x88\x01\x01\x12\x19\n\x0coffer_amount\x18\t \x01(\x04H\x05\x88\x01\x01\x12+\n\x11offer_amount_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x1e\n\x11offer_description\x18\x0b \x01(\tH\x07\x88\x01\x01\x12\x19\n\x0coffer_issuer\x18\x0c \x01(\tH\x08\x88\x01\x01\x12\x1b\n\x0eoffer_features\x18\r \x01(\x0cH\t\x88\x01\x01\x12\"\n\x15offer_absolute_expiry\x18\x0e \x01(\x04H\n\x88\x01\x01\x12\x1f\n\x12offer_quantity_max\x18\x0f \x01(\x04H\x0b\x88\x01\x01\x12+\n\x0boffer_paths\x18\x10 \x03(\x0b\x32\x16.cln.DecodeOffer_paths\x12\x1a\n\roffer_node_id\x18\x11 \x01(\x0cH\x0c\x88\x01\x01\x12*\n\x1dwarning_missing_offer_node_id\x18\x14 \x01(\tH\r\x88\x01\x01\x12.\n!warning_invalid_offer_description\x18\x15 \x01(\tH\x0e\x88\x01\x01\x12.\n!warning_missing_offer_description\x18\x16 \x01(\tH\x0f\x88\x01\x01\x12+\n\x1ewarning_invalid_offer_currency\x18\x17 \x01(\tH\x10\x88\x01\x01\x12)\n\x1cwarning_invalid_offer_issuer\x18\x18 \x01(\tH\x11\x88\x01\x01\x12\x1c\n\x0finvreq_metadata\x18\x19 \x01(\x0cH\x12\x88\x01\x01\x12\x1c\n\x0finvreq_payer_id\x18\x1a \x01(\x0cH\x13\x88\x01\x01\x12\x19\n\x0cinvreq_chain\x18\x1b \x01(\x0cH\x14\x88\x01\x01\x12,\n\x12invreq_amount_msat\x18\x1c \x01(\x0b\x32\x0b.cln.AmountH\x15\x88\x01\x01\x12\x1c\n\x0finvreq_features\x18\x1d \x01(\x0cH\x16\x88\x01\x01\x12\x1c\n\x0finvreq_quantity\x18\x1e \x01(\x04H\x17\x88\x01\x01\x12\x1e\n\x11invreq_payer_note\x18\x1f \x01(\tH\x18\x88\x01\x01\x12&\n\x19invreq_recurrence_counter\x18 \x01(\rH\x19\x88\x01\x01\x12$\n\x17invreq_recurrence_start\x18! \x01(\rH\x1a\x88\x01\x01\x12,\n\x1fwarning_missing_invreq_metadata\x18# \x01(\tH\x1b\x88\x01\x01\x12,\n\x1fwarning_missing_invreq_payer_id\x18$ \x01(\tH\x1c\x88\x01\x01\x12.\n!warning_invalid_invreq_payer_note\x18% \x01(\tH\x1d\x88\x01\x01\x12\x36\n)warning_missing_invoice_request_signature\x18& \x01(\tH\x1e\x88\x01\x01\x12\x36\n)warning_invalid_invoice_request_signature\x18\' \x01(\tH\x1f\x88\x01\x01\x12\x1f\n\x12invoice_created_at\x18) \x01(\x04H \x88\x01\x01\x12$\n\x17invoice_relative_expiry\x18* \x01(\rH!\x88\x01\x01\x12!\n\x14invoice_payment_hash\x18+ \x01(\x0cH\"\x88\x01\x01\x12-\n\x13invoice_amount_msat\x18, \x01(\x0b\x32\x0b.cln.AmountH#\x88\x01\x01\x12\x37\n\x11invoice_fallbacks\x18- \x03(\x0b\x32\x1c.cln.DecodeInvoice_fallbacks\x12\x1d\n\x10invoice_features\x18. \x01(\x0cH$\x88\x01\x01\x12\x1c\n\x0finvoice_node_id\x18/ \x01(\x0cH%\x88\x01\x01\x12(\n\x1binvoice_recurrence_basetime\x18\x30 \x01(\x04H&\x88\x01\x01\x12*\n\x1dwarning_missing_invoice_paths\x18\x32 \x01(\tH\'\x88\x01\x01\x12/\n\"warning_missing_invoice_blindedpay\x18\x33 \x01(\tH(\x88\x01\x01\x12/\n\"warning_missing_invoice_created_at\x18\x34 \x01(\tH)\x88\x01\x01\x12\x31\n$warning_missing_invoice_payment_hash\x18\x35 \x01(\tH*\x88\x01\x01\x12+\n\x1ewarning_missing_invoice_amount\x18\x36 \x01(\tH+\x88\x01\x01\x12\x38\n+warning_missing_invoice_recurrence_basetime\x18\x37 \x01(\tH,\x88\x01\x01\x12,\n\x1fwarning_missing_invoice_node_id\x18\x38 \x01(\tH-\x88\x01\x01\x12.\n!warning_missing_invoice_signature\x18\x39 \x01(\tH.\x88\x01\x01\x12.\n!warning_invalid_invoice_signature\x18: \x01(\tH/\x88\x01\x01\x12\'\n\tfallbacks\x18; \x03(\x0b\x32\x14.cln.DecodeFallbacks\x12\x17\n\ncreated_at\x18< \x01(\x04H0\x88\x01\x01\x12\x13\n\x06\x65xpiry\x18= \x01(\x04H1\x88\x01\x01\x12\x12\n\x05payee\x18> \x01(\x0cH2\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18? \x01(\x0cH3\x88\x01\x01\x12\x1d\n\x10\x64\x65scription_hash\x18@ \x01(\x0cH4\x88\x01\x01\x12\"\n\x15min_final_cltv_expiry\x18\x41 \x01(\rH5\x88\x01\x01\x12\x1b\n\x0epayment_secret\x18\x42 \x01(\x0cH6\x88\x01\x01\x12\x1d\n\x10payment_metadata\x18\x43 \x01(\x0cH7\x88\x01\x01\x12\x1f\n\x05\x65xtra\x18\x45 \x03(\x0b\x32\x10.cln.DecodeExtra\x12\x16\n\tunique_id\x18\x46 \x01(\tH8\x88\x01\x01\x12\x14\n\x07version\x18G \x01(\tH9\x88\x01\x01\x12\x13\n\x06string\x18H \x01(\tH:\x88\x01\x01\x12-\n\x0crestrictions\x18I \x03(\x0b\x32\x17.cln.DecodeRestrictions\x12&\n\x19warning_rune_invalid_utf8\x18J \x01(\tH;\x88\x01\x01\x12\x10\n\x03hex\x18K \x01(\x0cH<\x88\x01\x01\x12\x16\n\tdecrypted\x18L \x01(\x0cH=\x88\x01\x01\"\x83\x01\n\nDecodeType\x12\x10\n\x0c\x42OLT12_OFFER\x10\x00\x12\x12\n\x0e\x42OLT12_INVOICE\x10\x01\x12\x1a\n\x16\x42OLT12_INVOICE_REQUEST\x10\x02\x12\x12\n\x0e\x42OLT11_INVOICE\x10\x03\x12\x08\n\x04RUNE\x10\x04\x12\x15\n\x11\x45MERGENCY_RECOVER\x10\x05\x42\x0b\n\t_offer_idB\x11\n\x0f_offer_metadataB\x11\n\x0f_offer_currencyB!\n\x1f_warning_unknown_offer_currencyB\x16\n\x14_currency_minor_unitB\x0f\n\r_offer_amountB\x14\n\x12_offer_amount_msatB\x14\n\x12_offer_descriptionB\x0f\n\r_offer_issuerB\x11\n\x0f_offer_featuresB\x18\n\x16_offer_absolute_expiryB\x15\n\x13_offer_quantity_maxB\x10\n\x0e_offer_node_idB \n\x1e_warning_missing_offer_node_idB$\n\"_warning_invalid_offer_descriptionB$\n\"_warning_missing_offer_descriptionB!\n\x1f_warning_invalid_offer_currencyB\x1f\n\x1d_warning_invalid_offer_issuerB\x12\n\x10_invreq_metadataB\x12\n\x10_invreq_payer_idB\x0f\n\r_invreq_chainB\x15\n\x13_invreq_amount_msatB\x12\n\x10_invreq_featuresB\x12\n\x10_invreq_quantityB\x14\n\x12_invreq_payer_noteB\x1c\n\x1a_invreq_recurrence_counterB\x1a\n\x18_invreq_recurrence_startB\"\n _warning_missing_invreq_metadataB\"\n _warning_missing_invreq_payer_idB$\n\"_warning_invalid_invreq_payer_noteB,\n*_warning_missing_invoice_request_signatureB,\n*_warning_invalid_invoice_request_signatureB\x15\n\x13_invoice_created_atB\x1a\n\x18_invoice_relative_expiryB\x17\n\x15_invoice_payment_hashB\x16\n\x14_invoice_amount_msatB\x13\n\x11_invoice_featuresB\x12\n\x10_invoice_node_idB\x1e\n\x1c_invoice_recurrence_basetimeB \n\x1e_warning_missing_invoice_pathsB%\n#_warning_missing_invoice_blindedpayB%\n#_warning_missing_invoice_created_atB\'\n%_warning_missing_invoice_payment_hashB!\n\x1f_warning_missing_invoice_amountB.\n,_warning_missing_invoice_recurrence_basetimeB\"\n _warning_missing_invoice_node_idB$\n\"_warning_missing_invoice_signatureB$\n\"_warning_invalid_invoice_signatureB\r\n\x0b_created_atB\t\n\x07_expiryB\x08\n\x06_payeeB\x0f\n\r_payment_hashB\x13\n\x11_description_hashB\x18\n\x16_min_final_cltv_expiryB\x11\n\x0f_payment_secretB\x13\n\x11_payment_metadataB\x0c\n\n_unique_idB\n\n\x08_versionB\t\n\x07_stringB\x1c\n\x1a_warning_rune_invalid_utf8B\x06\n\x04_hexB\x0c\n\n_decrypted\"<\n\x11\x44\x65\x63odeOffer_paths\x12\x15\n\rfirst_node_id\x18\x01 \x01(\x0c\x12\x10\n\x08\x62linding\x18\x02 \x01(\x0c\"\x8a\x01\n\x1f\x44\x65\x63odeOffer_recurrencePaywindow\x12\x16\n\x0eseconds_before\x18\x01 \x01(\r\x12\x15\n\rseconds_after\x18\x02 \x01(\r\x12 \n\x13proportional_amount\x18\x03 \x01(\x08H\x00\x88\x01\x01\x42\x16\n\x14_proportional_amount\"T\n\x17\x44\x65\x63odeInvoice_pathsPath\x12\x17\n\x0f\x62linded_node_id\x18\x01 \x01(\x0c\x12 \n\x18\x65ncrypted_recipient_data\x18\x02 \x01(\x0c\"Y\n\x17\x44\x65\x63odeInvoice_fallbacks\x12\x0f\n\x07version\x18\x01 \x01(\r\x12\x0b\n\x03hex\x18\x02 \x01(\x0c\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_address\"w\n\x0f\x44\x65\x63odeFallbacks\x12\x36\n)warning_invoice_fallbacks_version_invalid\x18\x01 \x01(\tH\x00\x88\x01\x01\x42,\n*_warning_invoice_fallbacks_version_invalid\"(\n\x0b\x44\x65\x63odeExtra\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\t\";\n\x12\x44\x65\x63odeRestrictions\x12\x14\n\x0c\x61lternatives\x18\x01 \x03(\t\x12\x0f\n\x07summary\x18\x02 \x01(\t\"=\n\x11\x44isconnectRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x12\n\x05\x66orce\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\x08\n\x06_force\"\x14\n\x12\x44isconnectResponse\"k\n\x0f\x46\x65\x65ratesRequest\x12\x31\n\x05style\x18\x01 \x01(\x0e\x32\".cln.FeeratesRequest.FeeratesStyle\"%\n\rFeeratesStyle\x12\t\n\x05PERKB\x10\x00\x12\t\n\x05PERKW\x10\x01\"\x9c\x02\n\x10\x46\x65\x65ratesResponse\x12%\n\x18warning_missing_feerates\x18\x01 \x01(\tH\x00\x88\x01\x01\x12&\n\x05perkb\x18\x02 \x01(\x0b\x32\x12.cln.FeeratesPerkbH\x01\x88\x01\x01\x12&\n\x05perkw\x18\x03 \x01(\x0b\x32\x12.cln.FeeratesPerkwH\x02\x88\x01\x01\x12\x46\n\x15onchain_fee_estimates\x18\x04 \x01(\x0b\x32\".cln.FeeratesOnchain_fee_estimatesH\x03\x88\x01\x01\x42\x1b\n\x19_warning_missing_feeratesB\x08\n\x06_perkbB\x08\n\x06_perkwB\x18\n\x16_onchain_fee_estimates\"\xd3\x03\n\rFeeratesPerkb\x12\x16\n\x0emin_acceptable\x18\x01 \x01(\r\x12\x16\n\x0emax_acceptable\x18\x02 \x01(\r\x12\x12\n\x05\x66loor\x18\n \x01(\rH\x00\x88\x01\x01\x12.\n\testimates\x18\t \x03(\x0b\x32\x1b.cln.FeeratesPerkbEstimates\x12\x14\n\x07opening\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x19\n\x0cmutual_close\x18\x04 \x01(\rH\x02\x88\x01\x01\x12\x1d\n\x10unilateral_close\x18\x05 \x01(\rH\x03\x88\x01\x01\x12$\n\x17unilateral_anchor_close\x18\x0b \x01(\rH\x04\x88\x01\x01\x12\x1a\n\rdelayed_to_us\x18\x06 \x01(\rH\x05\x88\x01\x01\x12\x1c\n\x0fhtlc_resolution\x18\x07 \x01(\rH\x06\x88\x01\x01\x12\x14\n\x07penalty\x18\x08 \x01(\rH\x07\x88\x01\x01\x42\x08\n\x06_floorB\n\n\x08_openingB\x0f\n\r_mutual_closeB\x13\n\x11_unilateral_closeB\x1a\n\x18_unilateral_anchor_closeB\x10\n\x0e_delayed_to_usB\x12\n\x10_htlc_resolutionB\n\n\x08_penalty\"\x96\x01\n\x16\x46\x65\x65ratesPerkbEstimates\x12\x17\n\nblockcount\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x14\n\x07\x66\x65\x65rate\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x1d\n\x10smoothed_feerate\x18\x03 \x01(\rH\x02\x88\x01\x01\x42\r\n\x0b_blockcountB\n\n\x08_feerateB\x13\n\x11_smoothed_feerate\"\xd3\x03\n\rFeeratesPerkw\x12\x16\n\x0emin_acceptable\x18\x01 \x01(\r\x12\x16\n\x0emax_acceptable\x18\x02 \x01(\r\x12\x12\n\x05\x66loor\x18\n \x01(\rH\x00\x88\x01\x01\x12.\n\testimates\x18\t \x03(\x0b\x32\x1b.cln.FeeratesPerkwEstimates\x12\x14\n\x07opening\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x19\n\x0cmutual_close\x18\x04 \x01(\rH\x02\x88\x01\x01\x12\x1d\n\x10unilateral_close\x18\x05 \x01(\rH\x03\x88\x01\x01\x12$\n\x17unilateral_anchor_close\x18\x0b \x01(\rH\x04\x88\x01\x01\x12\x1a\n\rdelayed_to_us\x18\x06 \x01(\rH\x05\x88\x01\x01\x12\x1c\n\x0fhtlc_resolution\x18\x07 \x01(\rH\x06\x88\x01\x01\x12\x14\n\x07penalty\x18\x08 \x01(\rH\x07\x88\x01\x01\x42\x08\n\x06_floorB\n\n\x08_openingB\x0f\n\r_mutual_closeB\x13\n\x11_unilateral_closeB\x1a\n\x18_unilateral_anchor_closeB\x10\n\x0e_delayed_to_usB\x12\n\x10_htlc_resolutionB\n\n\x08_penalty\"\x96\x01\n\x16\x46\x65\x65ratesPerkwEstimates\x12\x17\n\nblockcount\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x14\n\x07\x66\x65\x65rate\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x1d\n\x10smoothed_feerate\x18\x03 \x01(\rH\x02\x88\x01\x01\x42\r\n\x0b_blockcountB\n\n\x08_feerateB\x13\n\x11_smoothed_feerate\"\x9b\x02\n\x1d\x46\x65\x65ratesOnchain_fee_estimates\x12 \n\x18opening_channel_satoshis\x18\x01 \x01(\x04\x12\x1d\n\x15mutual_close_satoshis\x18\x02 \x01(\x04\x12!\n\x19unilateral_close_satoshis\x18\x03 \x01(\x04\x12\x30\n#unilateral_close_nonanchor_satoshis\x18\x06 \x01(\x04H\x00\x88\x01\x01\x12\x1d\n\x15htlc_timeout_satoshis\x18\x04 \x01(\x04\x12\x1d\n\x15htlc_success_satoshis\x18\x05 \x01(\x04\x42&\n$_unilateral_close_nonanchor_satoshis\"\xe9\x02\n\x13\x46\x65tchinvoiceRequest\x12\r\n\x05offer\x18\x01 \x01(\t\x12%\n\x0b\x61mount_msat\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x15\n\x08quantity\x18\x03 \x01(\x04H\x01\x88\x01\x01\x12\x1f\n\x12recurrence_counter\x18\x04 \x01(\x04H\x02\x88\x01\x01\x12\x1d\n\x10recurrence_start\x18\x05 \x01(\x01H\x03\x88\x01\x01\x12\x1d\n\x10recurrence_label\x18\x06 \x01(\tH\x04\x88\x01\x01\x12\x14\n\x07timeout\x18\x07 \x01(\x01H\x05\x88\x01\x01\x12\x17\n\npayer_note\x18\x08 \x01(\tH\x06\x88\x01\x01\x42\x0e\n\x0c_amount_msatB\x0b\n\t_quantityB\x15\n\x13_recurrence_counterB\x13\n\x11_recurrence_startB\x13\n\x11_recurrence_labelB\n\n\x08_timeoutB\r\n\x0b_payer_note\"\x9a\x01\n\x14\x46\x65tchinvoiceResponse\x12\x0f\n\x07invoice\x18\x01 \x01(\t\x12)\n\x07\x63hanges\x18\x02 \x01(\x0b\x32\x18.cln.FetchinvoiceChanges\x12\x36\n\x0bnext_period\x18\x03 \x01(\x0b\x32\x1c.cln.FetchinvoiceNext_periodH\x00\x88\x01\x01\x42\x0e\n\x0c_next_period\"\x82\x02\n\x13\x46\x65tchinvoiceChanges\x12!\n\x14\x64\x65scription_appended\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x1b\n\x0evendor_removed\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06vendor\x18\x04 \x01(\tH\x03\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x42\x17\n\x15_description_appendedB\x0e\n\x0c_descriptionB\x11\n\x0f_vendor_removedB\t\n\x07_vendorB\x0e\n\x0c_amount_msat\"~\n\x17\x46\x65tchinvoiceNext_period\x12\x0f\n\x07\x63ounter\x18\x01 \x01(\x04\x12\x11\n\tstarttime\x18\x02 \x01(\x04\x12\x0f\n\x07\x65ndtime\x18\x03 \x01(\x04\x12\x17\n\x0fpaywindow_start\x18\x04 \x01(\x04\x12\x15\n\rpaywindow_end\x18\x05 \x01(\x04\"\xfb\x03\n\x12\x46undchannelRequest\x12\n\n\x02id\x18\t \x01(\x0c\x12 \n\x06\x61mount\x18\x01 \x01(\x0b\x32\x10.cln.AmountOrAll\x12\"\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.FeerateH\x00\x88\x01\x01\x12\x15\n\x08\x61nnounce\x18\x03 \x01(\x08H\x01\x88\x01\x01\x12\x14\n\x07minconf\x18\n \x01(\rH\x02\x88\x01\x01\x12#\n\tpush_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x15\n\x08\x63lose_to\x18\x06 \x01(\tH\x04\x88\x01\x01\x12%\n\x0brequest_amt\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x05\x88\x01\x01\x12\x1a\n\rcompact_lease\x18\x08 \x01(\tH\x06\x88\x01\x01\x12\x1c\n\x05utxos\x18\x0b \x03(\x0b\x32\r.cln.Outpoint\x12\x15\n\x08mindepth\x18\x0c \x01(\rH\x07\x88\x01\x01\x12!\n\x07reserve\x18\r \x01(\x0b\x32\x0b.cln.AmountH\x08\x88\x01\x01\x12\x14\n\x0c\x63hannel_type\x18\x0e \x03(\rB\n\n\x08_feerateB\x0b\n\t_announceB\n\n\x08_minconfB\x0c\n\n_push_msatB\x0b\n\t_close_toB\x0e\n\x0c_request_amtB\x10\n\x0e_compact_leaseB\x0b\n\t_mindepthB\n\n\x08_reserve\"\xe5\x01\n\x13\x46undchannelResponse\x12\n\n\x02tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\x12\x0e\n\x06outnum\x18\x03 \x01(\r\x12\x12\n\nchannel_id\x18\x04 \x01(\x0c\x12\x37\n\x0c\x63hannel_type\x18\x07 \x01(\x0b\x32\x1c.cln.FundchannelChannel_typeH\x00\x88\x01\x01\x12\x15\n\x08\x63lose_to\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x15\n\x08mindepth\x18\x06 \x01(\rH\x02\x88\x01\x01\x42\x0f\n\r_channel_typeB\x0b\n\t_close_toB\x0b\n\t_mindepth\"L\n\x17\x46undchannelChannel_type\x12\x0c\n\x04\x62its\x18\x01 \x03(\r\x12#\n\x05names\x18\x02 \x03(\x0e\x32\x14.cln.ChannelTypeName\"\xec\x01\n\x0fGetrouteRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12 \n\x0b\x61mount_msat\x18\t \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\nriskfactor\x18\x03 \x01(\x04\x12\x11\n\x04\x63ltv\x18\x04 \x01(\rH\x00\x88\x01\x01\x12\x13\n\x06\x66romid\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x18\n\x0b\x66uzzpercent\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x0f\n\x07\x65xclude\x18\x07 \x03(\t\x12\x14\n\x07maxhops\x18\x08 \x01(\rH\x03\x88\x01\x01\x42\x07\n\x05_cltvB\t\n\x07_fromidB\x0e\n\x0c_fuzzpercentB\n\n\x08_maxhops\"5\n\x10GetrouteResponse\x12!\n\x05route\x18\x01 \x03(\x0b\x32\x12.cln.GetrouteRoute\"\xc5\x01\n\rGetrouteRoute\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x0f\n\x07\x63hannel\x18\x02 \x01(\t\x12\x11\n\tdirection\x18\x03 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\r\n\x05\x64\x65lay\x18\x05 \x01(\r\x12\x34\n\x05style\x18\x06 \x01(\x0e\x32%.cln.GetrouteRoute.GetrouteRouteStyle\"\x1d\n\x12GetrouteRouteStyle\x12\x07\n\x03TLV\x10\x00\"\xb7\x03\n\x13ListforwardsRequest\x12@\n\x06status\x18\x01 \x01(\x0e\x32+.cln.ListforwardsRequest.ListforwardsStatusH\x00\x88\x01\x01\x12\x17\n\nin_channel\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x18\n\x0bout_channel\x18\x03 \x01(\tH\x02\x88\x01\x01\x12>\n\x05index\x18\x04 \x01(\x0e\x32*.cln.ListforwardsRequest.ListforwardsIndexH\x03\x88\x01\x01\x12\x12\n\x05start\x18\x05 \x01(\x04H\x04\x88\x01\x01\x12\x12\n\x05limit\x18\x06 \x01(\rH\x05\x88\x01\x01\"L\n\x12ListforwardsStatus\x12\x0b\n\x07OFFERED\x10\x00\x12\x0b\n\x07SETTLED\x10\x01\x12\x10\n\x0cLOCAL_FAILED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\"-\n\x11ListforwardsIndex\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07UPDATED\x10\x01\x42\t\n\x07_statusB\r\n\x0b_in_channelB\x0e\n\x0c_out_channelB\x08\n\x06_indexB\x08\n\x06_startB\x08\n\x06_limit\"C\n\x14ListforwardsResponse\x12+\n\x08\x66orwards\x18\x01 \x03(\x0b\x32\x19.cln.ListforwardsForwards\"\xba\x05\n\x14ListforwardsForwards\x12\x1a\n\rcreated_index\x18\x0c \x01(\x04H\x00\x88\x01\x01\x12\x12\n\nin_channel\x18\x01 \x01(\t\x12\x17\n\nin_htlc_id\x18\n \x01(\x04H\x01\x88\x01\x01\x12\x1c\n\x07in_msat\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\x12\x44\n\x06status\x18\x03 \x01(\x0e\x32\x34.cln.ListforwardsForwards.ListforwardsForwardsStatus\x12\x15\n\rreceived_time\x18\x04 \x01(\x01\x12\x18\n\x0bout_channel\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x18\n\x0bout_htlc_id\x18\x0b \x01(\x04H\x03\x88\x01\x01\x12\x1a\n\rupdated_index\x18\r \x01(\x04H\x04\x88\x01\x01\x12G\n\x05style\x18\t \x01(\x0e\x32\x33.cln.ListforwardsForwards.ListforwardsForwardsStyleH\x05\x88\x01\x01\x12\"\n\x08\x66\x65\x65_msat\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\"\n\x08out_msat\x18\x08 \x01(\x0b\x32\x0b.cln.AmountH\x07\x88\x01\x01\"T\n\x1aListforwardsForwardsStatus\x12\x0b\n\x07OFFERED\x10\x00\x12\x0b\n\x07SETTLED\x10\x01\x12\x10\n\x0cLOCAL_FAILED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\"0\n\x19ListforwardsForwardsStyle\x12\n\n\x06LEGACY\x10\x00\x12\x07\n\x03TLV\x10\x01\x42\x10\n\x0e_created_indexB\r\n\x0b_in_htlc_idB\x0e\n\x0c_out_channelB\x0e\n\x0c_out_htlc_idB\x10\n\x0e_updated_indexB\x08\n\x06_styleB\x0b\n\t_fee_msatB\x0b\n\t_out_msat\"a\n\x11ListoffersRequest\x12\x15\n\x08offer_id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x18\n\x0b\x61\x63tive_only\x18\x02 \x01(\x08H\x01\x88\x01\x01\x42\x0b\n\t_offer_idB\x0e\n\x0c_active_only\";\n\x12ListoffersResponse\x12%\n\x06offers\x18\x01 \x03(\x0b\x32\x15.cln.ListoffersOffers\"\x84\x01\n\x10ListoffersOffers\x12\x10\n\x08offer_id\x18\x01 \x01(\x0c\x12\x0e\n\x06\x61\x63tive\x18\x02 \x01(\x08\x12\x12\n\nsingle_use\x18\x03 \x01(\x08\x12\x0e\n\x06\x62olt12\x18\x04 \x01(\t\x12\x0c\n\x04used\x18\x05 \x01(\x08\x12\x12\n\x05label\x18\x06 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_label\"\xdb\x01\n\x0fListpaysRequest\x12\x13\n\x06\x62olt11\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12\x38\n\x06status\x18\x03 \x01(\x0e\x32#.cln.ListpaysRequest.ListpaysStatusH\x02\x88\x01\x01\"7\n\x0eListpaysStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x42\t\n\x07_bolt11B\x0f\n\r_payment_hashB\t\n\x07_status\"3\n\x10ListpaysResponse\x12\x1f\n\x04pays\x18\x01 \x03(\x0b\x32\x11.cln.ListpaysPays\"\xff\x04\n\x0cListpaysPays\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x34\n\x06status\x18\x02 \x01(\x0e\x32$.cln.ListpaysPays.ListpaysPaysStatus\x12\x18\n\x0b\x64\x65stination\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x12\x12\n\ncreated_at\x18\x04 \x01(\x04\x12\x19\n\x0c\x63ompleted_at\x18\x0c \x01(\x04H\x01\x88\x01\x01\x12\x12\n\x05label\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x06 \x01(\tH\x03\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x0b \x01(\tH\x04\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x07 \x01(\tH\x05\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x08 \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12*\n\x10\x61mount_sent_msat\x18\t \x01(\x0b\x32\x0b.cln.AmountH\x07\x88\x01\x01\x12\x15\n\x08preimage\x18\r \x01(\x0cH\x08\x88\x01\x01\x12\x1c\n\x0fnumber_of_parts\x18\x0e \x01(\x04H\t\x88\x01\x01\x12\x17\n\nerroronion\x18\n \x01(\x0cH\n\x88\x01\x01\";\n\x12ListpaysPaysStatus\x12\x0b\n\x07PENDING\x10\x00\x12\n\n\x06\x46\x41ILED\x10\x01\x12\x0c\n\x08\x43OMPLETE\x10\x02\x42\x0e\n\x0c_destinationB\x0f\n\r_completed_atB\x08\n\x06_labelB\t\n\x07_bolt11B\x0e\n\x0c_descriptionB\t\n\x07_bolt12B\x0e\n\x0c_amount_msatB\x13\n\x11_amount_sent_msatB\x0b\n\t_preimageB\x12\n\x10_number_of_partsB\r\n\x0b_erroronion\"*\n\x10ListhtlcsRequest\x12\x0f\n\x02id\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x05\n\x03_id\"7\n\x11ListhtlcsResponse\x12\"\n\x05htlcs\x18\x01 \x03(\x0b\x32\x13.cln.ListhtlcsHtlcs\"\x89\x02\n\x0eListhtlcsHtlcs\x12\x18\n\x10short_channel_id\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\x04\x12\x0e\n\x06\x65xpiry\x18\x03 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12>\n\tdirection\x18\x05 \x01(\x0e\x32+.cln.ListhtlcsHtlcs.ListhtlcsHtlcsDirection\x12\x14\n\x0cpayment_hash\x18\x06 \x01(\x0c\x12\x1d\n\x05state\x18\x07 \x01(\x0e\x32\x0e.cln.HtlcState\"*\n\x17ListhtlcsHtlcsDirection\x12\x07\n\x03OUT\x10\x00\x12\x06\n\x02IN\x10\x01\"\xc1\x03\n\x0cOfferRequest\x12\x0e\n\x06\x61mount\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x13\n\x06issuer\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x12\n\x05label\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x19\n\x0cquantity_max\x18\x05 \x01(\x04H\x02\x88\x01\x01\x12\x1c\n\x0f\x61\x62solute_expiry\x18\x06 \x01(\x04H\x03\x88\x01\x01\x12\x17\n\nrecurrence\x18\x07 \x01(\tH\x04\x88\x01\x01\x12\x1c\n\x0frecurrence_base\x18\x08 \x01(\tH\x05\x88\x01\x01\x12!\n\x14recurrence_paywindow\x18\t \x01(\tH\x06\x88\x01\x01\x12\x1d\n\x10recurrence_limit\x18\n \x01(\x04H\x07\x88\x01\x01\x12\x17\n\nsingle_use\x18\x0b \x01(\x08H\x08\x88\x01\x01\x42\t\n\x07_issuerB\x08\n\x06_labelB\x0f\n\r_quantity_maxB\x12\n\x10_absolute_expiryB\r\n\x0b_recurrenceB\x12\n\x10_recurrence_baseB\x17\n\x15_recurrence_paywindowB\x13\n\x11_recurrence_limitB\r\n\x0b_single_use\"\x92\x01\n\rOfferResponse\x12\x10\n\x08offer_id\x18\x01 \x01(\x0c\x12\x0e\n\x06\x61\x63tive\x18\x02 \x01(\x08\x12\x12\n\nsingle_use\x18\x03 \x01(\x08\x12\x0e\n\x06\x62olt12\x18\x04 \x01(\t\x12\x0c\n\x04used\x18\x05 \x01(\x08\x12\x0f\n\x07\x63reated\x18\x06 \x01(\x08\x12\x12\n\x05label\x18\x07 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_label\"Y\n\x0bPingRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x10\n\x03len\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x16\n\tpongbytes\x18\x03 \x01(\rH\x01\x88\x01\x01\x42\x06\n\x04_lenB\x0c\n\n_pongbytes\"\x1e\n\x0cPingResponse\x12\x0e\n\x06totlen\x18\x01 \x01(\r\"4\n\x14SendcustommsgRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\x0b\n\x03msg\x18\x02 \x01(\x0c\"\'\n\x15SendcustommsgResponse\x12\x0e\n\x06status\x18\x01 \x01(\t\"\xaa\x02\n\x11SetchannelRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12!\n\x07\x66\x65\x65\x62\x61se\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x13\n\x06\x66\x65\x65ppm\x18\x03 \x01(\rH\x01\x88\x01\x01\x12!\n\x07htlcmin\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12!\n\x07htlcmax\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x19\n\x0c\x65nforcedelay\x18\x06 \x01(\rH\x04\x88\x01\x01\x12\x1c\n\x0fignorefeelimits\x18\x07 \x01(\x08H\x05\x88\x01\x01\x42\n\n\x08_feebaseB\t\n\x07_feeppmB\n\n\x08_htlcminB\n\n\x08_htlcmaxB\x0f\n\r_enforcedelayB\x12\n\x10_ignorefeelimits\"?\n\x12SetchannelResponse\x12)\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x17.cln.SetchannelChannels\"\xca\x03\n\x12SetchannelChannels\x12\x0f\n\x07peer_id\x18\x01 \x01(\x0c\x12\x12\n\nchannel_id\x18\x02 \x01(\x0c\x12\x1d\n\x10short_channel_id\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\"\n\rfee_base_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12#\n\x1b\x66\x65\x65_proportional_millionths\x18\x05 \x01(\r\x12\x1e\n\x11ignore_fee_limits\x18\n \x01(\x08H\x01\x88\x01\x01\x12*\n\x15minimum_htlc_out_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12$\n\x17warning_htlcmin_too_low\x18\x07 \x01(\tH\x02\x88\x01\x01\x12*\n\x15maximum_htlc_out_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x18warning_htlcmax_too_high\x18\t \x01(\tH\x03\x88\x01\x01\x42\x13\n\x11_short_channel_idB\x14\n\x12_ignore_fee_limitsB\x1a\n\x18_warning_htlcmin_too_lowB\x1b\n\x19_warning_htlcmax_too_high\"\'\n\x12SigninvoiceRequest\x12\x11\n\tinvstring\x18\x01 \x01(\t\"%\n\x13SigninvoiceResponse\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\"%\n\x12SignmessageRequest\x12\x0f\n\x07message\x18\x01 \x01(\t\"F\n\x13SignmessageResponse\x12\x11\n\tsignature\x18\x01 \x01(\x0c\x12\r\n\x05recid\x18\x02 \x01(\x0c\x12\r\n\x05zbase\x18\x03 \x01(\t\"O\n\x16WaitblockheightRequest\x12\x13\n\x0b\x62lockheight\x18\x01 \x01(\r\x12\x14\n\x07timeout\x18\x02 \x01(\rH\x00\x88\x01\x01\x42\n\n\x08_timeout\".\n\x17WaitblockheightResponse\x12\x13\n\x0b\x62lockheight\x18\x01 \x01(\r\"\xf9\x01\n\x0bWaitRequest\x12\x31\n\tsubsystem\x18\x01 \x01(\x0e\x32\x1e.cln.WaitRequest.WaitSubsystem\x12\x31\n\tindexname\x18\x02 \x01(\x0e\x32\x1e.cln.WaitRequest.WaitIndexname\x12\x11\n\tnextvalue\x18\x03 \x01(\x04\"9\n\rWaitSubsystem\x12\x0c\n\x08INVOICES\x10\x00\x12\x0c\n\x08\x46ORWARDS\x10\x01\x12\x0c\n\x08SENDPAYS\x10\x02\"6\n\rWaitIndexname\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07UPDATED\x10\x01\x12\x0b\n\x07\x44\x45LETED\x10\x02\"\xe3\x01\n\x0cWaitResponse\x12\x32\n\tsubsystem\x18\x01 \x01(\x0e\x32\x1f.cln.WaitResponse.WaitSubsystem\x12\x14\n\x07\x63reated\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x14\n\x07updated\x18\x03 \x01(\x04H\x01\x88\x01\x01\x12\x14\n\x07\x64\x65leted\x18\x04 \x01(\x04H\x02\x88\x01\x01\"9\n\rWaitSubsystem\x12\x0c\n\x08INVOICES\x10\x00\x12\x0c\n\x08\x46ORWARDS\x10\x01\x12\x0c\n\x08SENDPAYS\x10\x02\x42\n\n\x08_createdB\n\n\x08_updatedB\n\n\x08_deleted\"\r\n\x0bStopRequest\"q\n\x0cStopResponse\x12\x31\n\x06result\x18\x01 \x01(\x0e\x32\x1c.cln.StopResponse.StopResultH\x00\x88\x01\x01\"#\n\nStopResult\x12\x15\n\x11SHUTDOWN_COMPLETE\x10\x00\x42\t\n\x07_result\"\xa7\x01\n\x18PreapprovekeysendRequest\x12\x18\n\x0b\x64\x65stination\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x42\x0e\n\x0c_destinationB\x0f\n\r_payment_hashB\x0e\n\x0c_amount_msat\"\x1b\n\x19PreapprovekeysendResponse\":\n\x18PreapproveinvoiceRequest\x12\x13\n\x06\x62olt11\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\t\n\x07_bolt11\"\x1b\n\x19PreapproveinvoiceResponse\"\x15\n\x13StaticbackupRequest\"#\n\x14StaticbackupResponse\x12\x0b\n\x03scb\x18\x01 \x03(\x0c\"\x97\x01\n\x15\x42kprlistincomeRequest\x12\x1d\n\x10\x63onsolidate_fees\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x17\n\nstart_time\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x15\n\x08\x65nd_time\x18\x03 \x01(\rH\x02\x88\x01\x01\x42\x13\n\x11_consolidate_feesB\r\n\x0b_start_timeB\x0b\n\t_end_time\"Q\n\x16\x42kprlistincomeResponse\x12\x37\n\rincome_events\x18\x01 \x03(\x0b\x32 .cln.BkprlistincomeIncome_events\"\xb5\x02\n\x1b\x42kprlistincomeIncome_events\x12\x0f\n\x07\x61\x63\x63ount\x18\x01 \x01(\t\x12\x0b\n\x03tag\x18\x02 \x01(\t\x12 \n\x0b\x63redit_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x1f\n\ndebit_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\x10\n\x08\x63urrency\x18\x05 \x01(\t\x12\x11\n\ttimestamp\x18\x06 \x01(\r\x12\x18\n\x0b\x64\x65scription\x18\x07 \x01(\tH\x00\x88\x01\x01\x12\x15\n\x08outpoint\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\x11\n\x04txid\x18\t \x01(\x0cH\x02\x88\x01\x01\x12\x17\n\npayment_id\x18\n \x01(\x0cH\x03\x88\x01\x01\x42\x0e\n\x0c_descriptionB\x0b\n\t_outpointB\x07\n\x05_txidB\r\n\x0b_payment_id2\xe2 \n\x04Node\x12\x36\n\x07Getinfo\x12\x13.cln.GetinfoRequest\x1a\x14.cln.GetinfoResponse\"\x00\x12<\n\tListPeers\x12\x15.cln.ListpeersRequest\x1a\x16.cln.ListpeersResponse\"\x00\x12<\n\tListFunds\x12\x15.cln.ListfundsRequest\x1a\x16.cln.ListfundsResponse\"\x00\x12\x36\n\x07SendPay\x12\x13.cln.SendpayRequest\x1a\x14.cln.SendpayResponse\"\x00\x12\x45\n\x0cListChannels\x12\x18.cln.ListchannelsRequest\x1a\x19.cln.ListchannelsResponse\"\x00\x12<\n\tAddGossip\x12\x15.cln.AddgossipRequest\x1a\x16.cln.AddgossipResponse\"\x00\x12Q\n\x10\x41utoCleanInvoice\x12\x1c.cln.AutocleaninvoiceRequest\x1a\x1d.cln.AutocleaninvoiceResponse\"\x00\x12\x45\n\x0c\x43heckMessage\x12\x18.cln.CheckmessageRequest\x1a\x19.cln.CheckmessageResponse\"\x00\x12\x30\n\x05\x43lose\x12\x11.cln.CloseRequest\x1a\x12.cln.CloseResponse\"\x00\x12:\n\x0b\x43onnectPeer\x12\x13.cln.ConnectRequest\x1a\x14.cln.ConnectResponse\"\x00\x12H\n\rCreateInvoice\x12\x19.cln.CreateinvoiceRequest\x1a\x1a.cln.CreateinvoiceResponse\"\x00\x12<\n\tDatastore\x12\x15.cln.DatastoreRequest\x1a\x16.cln.DatastoreResponse\"\x00\x12K\n\x0e\x44\x61tastoreUsage\x12\x1a.cln.DatastoreusageRequest\x1a\x1b.cln.DatastoreusageResponse\"\x00\x12\x42\n\x0b\x43reateOnion\x12\x17.cln.CreateonionRequest\x1a\x18.cln.CreateonionResponse\"\x00\x12\x45\n\x0c\x44\x65lDatastore\x12\x18.cln.DeldatastoreRequest\x1a\x19.cln.DeldatastoreResponse\"\x00\x12T\n\x11\x44\x65lExpiredInvoice\x12\x1d.cln.DelexpiredinvoiceRequest\x1a\x1e.cln.DelexpiredinvoiceResponse\"\x00\x12?\n\nDelInvoice\x12\x16.cln.DelinvoiceRequest\x1a\x17.cln.DelinvoiceResponse\"\x00\x12\x36\n\x07Invoice\x12\x13.cln.InvoiceRequest\x1a\x14.cln.InvoiceResponse\"\x00\x12H\n\rListDatastore\x12\x19.cln.ListdatastoreRequest\x1a\x1a.cln.ListdatastoreResponse\"\x00\x12\x45\n\x0cListInvoices\x12\x18.cln.ListinvoicesRequest\x1a\x19.cln.ListinvoicesResponse\"\x00\x12<\n\tSendOnion\x12\x15.cln.SendonionRequest\x1a\x16.cln.SendonionResponse\"\x00\x12\x45\n\x0cListSendPays\x12\x18.cln.ListsendpaysRequest\x1a\x19.cln.ListsendpaysResponse\"\x00\x12Q\n\x10ListTransactions\x12\x1c.cln.ListtransactionsRequest\x1a\x1d.cln.ListtransactionsResponse\"\x00\x12*\n\x03Pay\x12\x0f.cln.PayRequest\x1a\x10.cln.PayResponse\"\x00\x12<\n\tListNodes\x12\x15.cln.ListnodesRequest\x1a\x16.cln.ListnodesResponse\"\x00\x12K\n\x0eWaitAnyInvoice\x12\x1a.cln.WaitanyinvoiceRequest\x1a\x1b.cln.WaitanyinvoiceResponse\"\x00\x12\x42\n\x0bWaitInvoice\x12\x17.cln.WaitinvoiceRequest\x1a\x18.cln.WaitinvoiceResponse\"\x00\x12\x42\n\x0bWaitSendPay\x12\x17.cln.WaitsendpayRequest\x1a\x18.cln.WaitsendpayResponse\"\x00\x12\x36\n\x07NewAddr\x12\x13.cln.NewaddrRequest\x1a\x14.cln.NewaddrResponse\"\x00\x12\x39\n\x08Withdraw\x12\x14.cln.WithdrawRequest\x1a\x15.cln.WithdrawResponse\"\x00\x12\x36\n\x07KeySend\x12\x13.cln.KeysendRequest\x1a\x14.cln.KeysendResponse\"\x00\x12\x39\n\x08\x46undPsbt\x12\x14.cln.FundpsbtRequest\x1a\x15.cln.FundpsbtResponse\"\x00\x12\x39\n\x08SendPsbt\x12\x14.cln.SendpsbtRequest\x1a\x15.cln.SendpsbtResponse\"\x00\x12\x39\n\x08SignPsbt\x12\x14.cln.SignpsbtRequest\x1a\x15.cln.SignpsbtResponse\"\x00\x12\x39\n\x08UtxoPsbt\x12\x14.cln.UtxopsbtRequest\x1a\x15.cln.UtxopsbtResponse\"\x00\x12<\n\tTxDiscard\x12\x15.cln.TxdiscardRequest\x1a\x16.cln.TxdiscardResponse\"\x00\x12<\n\tTxPrepare\x12\x15.cln.TxprepareRequest\x1a\x16.cln.TxprepareResponse\"\x00\x12\x33\n\x06TxSend\x12\x12.cln.TxsendRequest\x1a\x13.cln.TxsendResponse\"\x00\x12Q\n\x10ListPeerChannels\x12\x1c.cln.ListpeerchannelsRequest\x1a\x1d.cln.ListpeerchannelsResponse\"\x00\x12W\n\x12ListClosedChannels\x12\x1e.cln.ListclosedchannelsRequest\x1a\x1f.cln.ListclosedchannelsResponse\"\x00\x12<\n\tDecodePay\x12\x15.cln.DecodepayRequest\x1a\x16.cln.DecodepayResponse\"\x00\x12\x33\n\x06\x44\x65\x63ode\x12\x12.cln.DecodeRequest\x1a\x13.cln.DecodeResponse\"\x00\x12?\n\nDisconnect\x12\x16.cln.DisconnectRequest\x1a\x17.cln.DisconnectResponse\"\x00\x12\x39\n\x08\x46\x65\x65rates\x12\x14.cln.FeeratesRequest\x1a\x15.cln.FeeratesResponse\"\x00\x12\x45\n\x0c\x46\x65tchInvoice\x12\x18.cln.FetchinvoiceRequest\x1a\x19.cln.FetchinvoiceResponse\"\x00\x12\x42\n\x0b\x46undChannel\x12\x17.cln.FundchannelRequest\x1a\x18.cln.FundchannelResponse\"\x00\x12\x39\n\x08GetRoute\x12\x14.cln.GetrouteRequest\x1a\x15.cln.GetrouteResponse\"\x00\x12\x45\n\x0cListForwards\x12\x18.cln.ListforwardsRequest\x1a\x19.cln.ListforwardsResponse\"\x00\x12?\n\nListOffers\x12\x16.cln.ListoffersRequest\x1a\x17.cln.ListoffersResponse\"\x00\x12\x39\n\x08ListPays\x12\x14.cln.ListpaysRequest\x1a\x15.cln.ListpaysResponse\"\x00\x12<\n\tListHtlcs\x12\x15.cln.ListhtlcsRequest\x1a\x16.cln.ListhtlcsResponse\"\x00\x12\x30\n\x05Offer\x12\x11.cln.OfferRequest\x1a\x12.cln.OfferResponse\"\x00\x12-\n\x04Ping\x12\x10.cln.PingRequest\x1a\x11.cln.PingResponse\"\x00\x12H\n\rSendCustomMsg\x12\x19.cln.SendcustommsgRequest\x1a\x1a.cln.SendcustommsgResponse\"\x00\x12?\n\nSetChannel\x12\x16.cln.SetchannelRequest\x1a\x17.cln.SetchannelResponse\"\x00\x12\x42\n\x0bSignInvoice\x12\x17.cln.SigninvoiceRequest\x1a\x18.cln.SigninvoiceResponse\"\x00\x12\x42\n\x0bSignMessage\x12\x17.cln.SignmessageRequest\x1a\x18.cln.SignmessageResponse\"\x00\x12N\n\x0fWaitBlockHeight\x12\x1b.cln.WaitblockheightRequest\x1a\x1c.cln.WaitblockheightResponse\"\x00\x12-\n\x04Wait\x12\x10.cln.WaitRequest\x1a\x11.cln.WaitResponse\"\x00\x12-\n\x04Stop\x12\x10.cln.StopRequest\x1a\x11.cln.StopResponse\"\x00\x12T\n\x11PreApproveKeysend\x12\x1d.cln.PreapprovekeysendRequest\x1a\x1e.cln.PreapprovekeysendResponse\"\x00\x12T\n\x11PreApproveInvoice\x12\x1d.cln.PreapproveinvoiceRequest\x1a\x1e.cln.PreapproveinvoiceResponse\"\x00\x12\x45\n\x0cStaticBackup\x12\x18.cln.StaticbackupRequest\x1a\x19.cln.StaticbackupResponse\"\x00\x12K\n\x0e\x42kprListIncome\x12\x1a.cln.BkprlistincomeRequest\x1a\x1b.cln.BkprlistincomeResponse\"\x00\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -483,25 +483,27 @@ _globals['_STOPREQUEST']._serialized_start=48407 _globals['_STOPREQUEST']._serialized_end=48420 _globals['_STOPRESPONSE']._serialized_start=48422 - _globals['_STOPRESPONSE']._serialized_end=48436 - _globals['_PREAPPROVEKEYSENDREQUEST']._serialized_start=48439 - _globals['_PREAPPROVEKEYSENDREQUEST']._serialized_end=48606 - _globals['_PREAPPROVEKEYSENDRESPONSE']._serialized_start=48608 - _globals['_PREAPPROVEKEYSENDRESPONSE']._serialized_end=48635 - _globals['_PREAPPROVEINVOICEREQUEST']._serialized_start=48637 - _globals['_PREAPPROVEINVOICEREQUEST']._serialized_end=48695 - _globals['_PREAPPROVEINVOICERESPONSE']._serialized_start=48697 - _globals['_PREAPPROVEINVOICERESPONSE']._serialized_end=48724 - _globals['_STATICBACKUPREQUEST']._serialized_start=48726 - _globals['_STATICBACKUPREQUEST']._serialized_end=48747 - _globals['_STATICBACKUPRESPONSE']._serialized_start=48749 - _globals['_STATICBACKUPRESPONSE']._serialized_end=48784 - _globals['_BKPRLISTINCOMEREQUEST']._serialized_start=48787 - _globals['_BKPRLISTINCOMEREQUEST']._serialized_end=48938 - _globals['_BKPRLISTINCOMERESPONSE']._serialized_start=48940 - _globals['_BKPRLISTINCOMERESPONSE']._serialized_end=49021 - _globals['_BKPRLISTINCOMEINCOME_EVENTS']._serialized_start=49024 - _globals['_BKPRLISTINCOMEINCOME_EVENTS']._serialized_end=49333 - _globals['_NODE']._serialized_start=49336 - _globals['_NODE']._serialized_end=53530 + _globals['_STOPRESPONSE']._serialized_end=48535 + _globals['_STOPRESPONSE_STOPRESULT']._serialized_start=48489 + _globals['_STOPRESPONSE_STOPRESULT']._serialized_end=48524 + _globals['_PREAPPROVEKEYSENDREQUEST']._serialized_start=48538 + _globals['_PREAPPROVEKEYSENDREQUEST']._serialized_end=48705 + _globals['_PREAPPROVEKEYSENDRESPONSE']._serialized_start=48707 + _globals['_PREAPPROVEKEYSENDRESPONSE']._serialized_end=48734 + _globals['_PREAPPROVEINVOICEREQUEST']._serialized_start=48736 + _globals['_PREAPPROVEINVOICEREQUEST']._serialized_end=48794 + _globals['_PREAPPROVEINVOICERESPONSE']._serialized_start=48796 + _globals['_PREAPPROVEINVOICERESPONSE']._serialized_end=48823 + _globals['_STATICBACKUPREQUEST']._serialized_start=48825 + _globals['_STATICBACKUPREQUEST']._serialized_end=48846 + _globals['_STATICBACKUPRESPONSE']._serialized_start=48848 + _globals['_STATICBACKUPRESPONSE']._serialized_end=48883 + _globals['_BKPRLISTINCOMEREQUEST']._serialized_start=48886 + _globals['_BKPRLISTINCOMEREQUEST']._serialized_end=49037 + _globals['_BKPRLISTINCOMERESPONSE']._serialized_start=49039 + _globals['_BKPRLISTINCOMERESPONSE']._serialized_end=49120 + _globals['_BKPRLISTINCOMEINCOME_EVENTS']._serialized_start=49123 + _globals['_BKPRLISTINCOMEINCOME_EVENTS']._serialized_end=49432 + _globals['_NODE']._serialized_start=49435 + _globals['_NODE']._serialized_end=53629 # @@protoc_insertion_point(module_scope) diff --git a/contrib/pyln-testing/pyln/testing/fixtures.py b/contrib/pyln-testing/pyln/testing/fixtures.py index a1fb7fb7131a..aa770388bd61 100644 --- a/contrib/pyln-testing/pyln/testing/fixtures.py +++ b/contrib/pyln-testing/pyln/testing/fixtures.py @@ -392,6 +392,13 @@ def is_msat_or_any(checker, instance): return True return is_msat_request(checker, instance) + def is_currency(checker, instance): + """currency including currency code""" + pattern = re.compile(r'^\d+(\.\d+)?[A-Z][A-Z][A-Z]$') + if pattern.match(instance): + return True + return False + # "msat" for request can be many forms if is_request: is_msat = is_msat_request @@ -410,6 +417,7 @@ def is_msat_or_any(checker, instance): "msat": is_msat, "msat_or_all": is_msat_or_all, "msat_or_any": is_msat_or_any, + "currency": is_currency, "txid": is_txid, "signature": is_signature, "bip340sig": is_bip340sig, From 9d6e987c4508aea239051e6246f57fa98772e4dd Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Fri, 2 Feb 2024 15:18:15 +1030 Subject: [PATCH 04/16] doc: Adding missing `*.request.json` Some rpc commands did not have their corresponding *.request.json files to generate the consolidated json --- contrib/msggen/msggen/schema.json | 604 ++++++++++++++++++ doc/schemas/bkpr-channelsapy.request.json | 16 + doc/schemas/bkpr-dumpincomecsv.request.json | 30 + doc/schemas/bkpr-inspect.request.json | 14 + .../bkpr-listaccountevents.request.json | 12 + doc/schemas/bkpr-listbalances.request.json | 7 + doc/schemas/check.request.json | 14 + doc/schemas/disableoffer.request.json | 14 + doc/schemas/funderupdate.request.json | 77 +++ doc/schemas/getlog.request.json | 19 + doc/schemas/help.request.json | 12 + doc/schemas/listconfigs.request.json | 12 + doc/schemas/multiwithdraw.request.json | 33 + doc/schemas/notifications.request.json | 14 + doc/schemas/openchannel_abort.request.json | 14 + doc/schemas/openchannel_bump.request.json | 28 + doc/schemas/openchannel_signed.request.json | 19 + doc/schemas/openchannel_update.request.json | 19 + doc/schemas/parsefeerate.request.json | 14 + doc/schemas/plugin.request.json | 29 + doc/schemas/recover.request.json | 14 + doc/schemas/renepay.request.json | 42 ++ doc/schemas/renepaystatus.request.json | 12 + doc/schemas/reserveinputs.request.json | 22 + doc/schemas/sendinvoice.request.json | 38 ++ doc/schemas/sendonionmessage.request.json | 42 ++ doc/schemas/setpsbtversion.request.json | 19 + doc/schemas/unreserveinputs.request.json | 18 + 28 files changed, 1208 insertions(+) create mode 100644 doc/schemas/bkpr-channelsapy.request.json create mode 100644 doc/schemas/bkpr-dumpincomecsv.request.json create mode 100644 doc/schemas/bkpr-inspect.request.json create mode 100644 doc/schemas/bkpr-listaccountevents.request.json create mode 100644 doc/schemas/bkpr-listbalances.request.json create mode 100644 doc/schemas/check.request.json create mode 100644 doc/schemas/disableoffer.request.json create mode 100644 doc/schemas/funderupdate.request.json create mode 100644 doc/schemas/getlog.request.json create mode 100644 doc/schemas/help.request.json create mode 100644 doc/schemas/listconfigs.request.json create mode 100644 doc/schemas/multiwithdraw.request.json create mode 100644 doc/schemas/notifications.request.json create mode 100644 doc/schemas/openchannel_abort.request.json create mode 100644 doc/schemas/openchannel_bump.request.json create mode 100644 doc/schemas/openchannel_signed.request.json create mode 100644 doc/schemas/openchannel_update.request.json create mode 100644 doc/schemas/parsefeerate.request.json create mode 100644 doc/schemas/plugin.request.json create mode 100644 doc/schemas/recover.request.json create mode 100644 doc/schemas/renepay.request.json create mode 100644 doc/schemas/renepaystatus.request.json create mode 100644 doc/schemas/reserveinputs.request.json create mode 100644 doc/schemas/sendinvoice.request.json create mode 100644 doc/schemas/sendonionmessage.request.json create mode 100644 doc/schemas/setpsbtversion.request.json create mode 100644 doc/schemas/unreserveinputs.request.json diff --git a/contrib/msggen/msggen/schema.json b/contrib/msggen/msggen/schema.json index 6f0e27768894..d25cecc9d1c8 100644 --- a/contrib/msggen/msggen/schema.json +++ b/contrib/msggen/msggen/schema.json @@ -669,6 +669,22 @@ "additionalProperties": false, "properties": {} }, + "bkpr-channelsapy.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "start_time": { + "type": "u64", + "description": "UNIX timestamp (in seconds) to filter events after the provided timestamp. Defaults to zero" + }, + "end_time": { + "type": "u64", + "description": "UNIX timestamp (in seconds) to filter events up to and at the provided timestamp. Defaults to max-int" + } + } + }, "bkpr-channelsapy.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -793,6 +809,36 @@ } } }, + "bkpr-dumpincomecsv.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "csv_format" + ], + "properties": { + "csv_format": { + "type": "string", + "description": "CSV format to use. See RETURN VALUE for options" + }, + "csv_file": { + "type": "string", + "description": "on-disk destination of the generated CSV file" + }, + "consolidate_fees": { + "type": "boolean", + "description": "if true, we emit a single, consolidated event for any onchain-fees for a txid and account. Otherwise, events for every update to the onchain fee calculation for this account and txid will be printed. Defaults to true. Note that this means that the events emitted are non-stable, i.e. calling **dumpincomecsv** twice may result in different onchain fee events being emitted, depending on how much information we've logged for that transaction" + }, + "start_time": { + "type": "u64", + "description": "UNIX timestamp (in seconds) that filters events after the provided timestamp. Defaults to zero" + }, + "end_time": { + "type": "u64", + "description": "UNIX timestamp (in seconds) that filters events up to and at the provided timestamp. Defaults to max-int" + } + } + }, "bkpr-dumpincomecsv.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -818,6 +864,20 @@ } } }, + "bkpr-inspect.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "account" + ], + "properties": { + "account": { + "type": "string", + "description": "channel account to inspect" + } + } + }, "bkpr-inspect.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -968,6 +1028,18 @@ } } }, + "bkpr-listaccountevents.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "account": { + "type": "string", + "description": "receive events for the specified account" + } + } + }, "bkpr-listaccountevents.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -1156,6 +1228,13 @@ } } }, + "bkpr-listbalances.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [], + "properties": {} + }, "bkpr-listbalances.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -1388,6 +1467,20 @@ } } }, + "check.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": true, + "required": [ + "command_to_check" + ], + "properties": { + "command_to_check": { + "type": "string", + "description": "name of the relevant command" + } + } + }, "check.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -4642,6 +4735,20 @@ } } }, + "disableoffer.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "offer_id" + ], + "properties": { + "offer_id": { + "type": "hash", + "description": "the id we use to identify this offer" + } + } + }, "disableoffer.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -5432,6 +5539,83 @@ } } }, + "funderupdate.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "policy": { + "type": "string", + "enum": [ + "match", + "available", + "fixed" + ], + "description": "funder plugin will use to decide how much captial to commit to a v2 open channel request.\n\tThere are three policy options, detailed below:\n\t* `match` -- Contribute *policy_mod* percent of their requested funds.\n\tValid *policy_mod* values are 0 to 200. If this is a channel lease\n\trequest, we match based on their requested funds. If it is not a\n\tchannel lease request (and *lease_only* is false), then we match\n\ttheir funding amount. Note: any lease match less than 100 will\n\tlikely fail, as clients will not accept a lease less than their request.\n\t* `available` -- Contribute *policy_mod* percent of our available\n\tnode wallet funds. Valid *policy_mod* values are 0 to 100.\n\t* `fixed` -- Contributes a fixed *policy_mod* sats to v2 channel open requests.\n\tDefault is fixed" + }, + "policy_mod": { + "type": "sat", + "description": "number or 'modification' to apply to the policy. Default is 0sats" + }, + "leases_only": { + "type": "boolean", + "description": "only contribute funds to `option_will_fund` requests which pay to lease funds. It will fund any v2 open request using *policy* even if it's they're not seeking to lease funds. Note that `option_will_fund` commits funds for 4032 blocks (~1mo). Must also set *lease_fee_base_msat*, *lease_fee_basis*, *funding_weight*, *channel_fee_max_base_msat*, and *channel_fee_max_proportional_thousandths* to advertise available channel leases. Defaults to *False*" + }, + "min_their_funding_msat": { + "type": "msat", + "description": "minimum funding sats that we require in order to activate our contribution policy to the v2 open. Defaults to 10k sats" + }, + "max_their_funding_msat": { + "type": "msat", + "description": "maximum funding sats that we will consider to activate our contribution policy to the v2 open. Any channel open above this will not be funded. Defaults to no max (`UINT_MAX`)" + }, + "per_channel_min_msat": { + "type": "msat", + "description": "minimum amount that we will contribute to a channel open. Defaults to 10k sats" + }, + "per_channel_max_msat": { + "type": "msat", + "description": "maximum amount that we will contribute to a channel open. Defaults to no max (`UINT_MAX`)" + }, + "reserve_tank_msat": { + "type": "msat", + "description": "amount of sats to leave available in the node wallet. Defaults to zero sats" + }, + "fuzz_percent": { + "type": "u32", + "description": "a percentage to fuzz the resulting contribution amount by. Valid values are 0 to 100. Note that turning this on with (match, 100) policy will randomly fail `option_will_fund` leases, as most clients expect an exact or greater match of their `requested_funds`. Defaults to 0% (no fuzz)" + }, + "fund_probability": { + "type": "u32", + "description": "the percent of v2 channel open requests to apply our policy to. Valid values are integers from 0 (fund 0% of all open requests) to 100 (fund every request). Useful for randomizing opens that receive funds. Useful for randomizing opens that receive funds. Defaults to 100" + }, + "lease_fee_base_msat": { + "type": "msat", + "description": "flat fee for a channel lease. Node will receive this much extra added to their channel balance, paid by the opening node. Defaults to 2k sats. Note that the minimum is 1sat" + }, + "lease_fee_basis": { + "type": "u32", + "description": "a basis fee that's calculated as 1/10k of the total requested funds the peer is asking for. Node will receive the total of *lease_fee_basis* times requested funds / 10k satoshis added to their channel balance, paid by the opening node. Default is 0.65% (65 basis points)" + }, + "funding_weight": { + "type": "u32", + "description": "to calculate the fee the peer will compensate your node for its contributing inputs to the funding transaction. The total fee is calculated as the `open_channel2`.`funding_feerate_perkw` times this *funding_weight* divided by 1000. Node will have this funding fee added to their channel balance, paid by the opening node. Default is 2 inputs + 1 P2WPKH output" + }, + "channel_fee_max_base_msat": { + "type": "msat", + "description": "a commitment to a maximum `channel_fee_base_msat` that your node will charge for routing payments over this leased channel during the lease duration. Default is 5k sats" + }, + "channel_fee_max_proportional_thousandths": { + "type": "u32", + "description": "a commitment to a maximum `channel_fee_proportional_millionths` that your node will charge for routing payments over this leased channel during the lease duration. Note that it's denominated in 'thousandths'. A setting of `1` is equal to 1k ppm; `5` is 5k ppm, etc. Default is 100 (100k ppm)" + }, + "compact_lease": { + "type": "hex", + "description": "a compact description of the channel lease params. When opening a channel, passed in to `fundchannel` to indicate the terms we expect from the peer" + } + } + }, "funderupdate.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -5949,6 +6133,25 @@ } } }, + "getlog.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "level": { + "type": "string", + "enum": [ + "broken", + "unusual", + "info", + "debug", + "io" + ], + "description": "a string that represents the log level. The default is *info*" + } + } + }, "getlog.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -6212,6 +6415,18 @@ } } }, + "help.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "command": { + "type": "string", + "description": "command to get information about" + } + } + }, "help.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -6914,6 +7129,18 @@ } } }, + "listconfigs.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "config": { + "type": "string", + "description": "configuration option name to restrict return" + } + } + }, "listconfigs.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -13379,6 +13606,39 @@ } } }, + "multiwithdraw.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "outputs" + ], + "properties": { + "outputs": { + "type": "array", + "items": { + "type": "outputdesc" + }, + "description": "an array containing objects of the form `{address: amount}`. The `amount` may be the string *all*, indicating that all onchain funds be sent to the specified address. Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" + }, + "feerate": { + "type": "feerate", + "description": "feerate used for the withdrawals. See NOTES in lightning-feerates(7) for possible values. The default is *normal*" + }, + "minconf": { + "type": "u32", + "description": "minimum number of confirmations that used outputs should have. Default is 1", + "default": 1 + }, + "utxos": { + "type": "array", + "items": { + "type": "outpoint", + "description": "utxos to be used to be withdrawn from, as an array of `txid:vout`. These must be drawn from the node's available UTXO set" + } + } + } + }, "multiwithdraw.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -13431,6 +13691,20 @@ } } }, + "notifications.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "enable" + ], + "properties": { + "enable": { + "type": "boolean", + "description": "whether to enable or disable notifications" + } + } + }, "notifications.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -13537,6 +13811,20 @@ } } }, + "openchannel_abort.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "channel_id" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": "channel id of the channel to be aborted" + } + } + }, "openchannel_abort.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -13563,6 +13851,34 @@ } } }, + "openchannel_bump.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "channel_id", + "amount", + "initialpsbt" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": "id of the channel to RBF" + }, + "amount": { + "type": "sat", + "description": "satoshi value that we will contribute to the channel. This value will be _added_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel" + }, + "initialpsbt": { + "type": "string", + "description": "the funded, incomplete PSBT that specifies the UTXOs and change output for our channel contribution. It can be updated, see `openchannel_update`; *initialpsbt* must have at least one input. Must have the Non-Witness UTXO (PSBT_IN_NON_WITNESS_UTXO) set for every input. An error (code 309) will be returned if this requirement is not met" + }, + "funding_feerate": { + "type": "feerate", + "description": "feerate for the funding transaction. Defaults to 1/64th greater than the last feerate used for this channel" + } + } + }, "openchannel_bump.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -13762,6 +14078,25 @@ } } }, + "openchannel_signed.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "channel_id", + "signed_psbt" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": "id of the channel" + }, + "signed_psbt": { + "type": "string", + "description": "the PSBT returned from `openchannel_update` (where *commitments_secured* was true) with partial signatures or finalized witness stacks included for every input that we contributed to the PSBT" + } + } + }, "openchannel_signed.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -13788,6 +14123,25 @@ } } }, + "openchannel_update.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "channel_id", + "psbt" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": "id of the channel" + }, + "psbt": { + "type": "string", + "description": "updated PSBT to be sent to the peer. May be identical to the PSBT last returned by either `openchannel_init` or `openchannel_update`" + } + } + }, "openchannel_update.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -13865,6 +14219,20 @@ } } }, + "parsefeerate.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "feerate_str" + ], + "properties": { + "feerate_str": { + "type": "string", + "description": "The feerate string to parse" + } + } + }, "parsefeerate.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -14024,6 +14392,35 @@ } } }, + "plugin.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": true, + "required": [ + "subcommand" + ], + "properties": { + "subcommand": { + "type": "string", + "enum": [ + "start", + "stop", + "rescan", + "startdir", + "list" + ], + "description": "determines what action is taken" + }, + "plugin": { + "type": "string", + "description": "*path* or *name* of a plugin executable to start or stop" + }, + "directory": { + "type": "string", + "description": "*path* of a directory containing plugins" + } + } + }, "plugin.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -14180,6 +14577,20 @@ "additionalProperties": false, "properties": {} }, + "recover.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "hsmsecret" + ], + "properties": { + "hsmsecret": { + "type": "string", + "description": "either a codex32 secret starting with `cl1` as returned by `hsmtool getcodexsecret`, or a raw 64 character hex string" + } + } + }, "recoverchannel.request.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -14212,6 +14623,48 @@ } } }, + "renepay.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "invstring" + ], + "properties": { + "invstring": { + "type": "string", + "description": "bolt11 invoice which the RPC command attempts to pay. Currently, **renepay** supports bolt11 invoices only" + }, + "amount_msat": { + "type": "msat", + "description": "if the *invstring* does not contain an amount, *amount_msat* is required, otherwise if it is specified it must be *null*. in millisatoshi precision; it can be a whole number, or a whole number with suffix *msat* or *sat*, or a three decimal point number with suffix *sat*, or an 1 to 11 decimal point number suffixed by *btc*" + }, + "maxfee": { + "type": "msat", + "description": "*maxfee* is a hard bound, in the sense that the command will never attempt a payment when the fees exceed that value" + }, + "maxdelay": { + "type": "u32", + "description": "overrides the value of `max-locktime-blocks` for this payment. It serves to limit the locktime of funds in the payment HTLC measured in blocks" + }, + "retry_for": { + "type": "u32", + "description": "measured in seconds specifies how much time it is allowed for the command to keep retrying the payment. Defaults to 60 seconds" + }, + "description": { + "type": "string", + "description": "only required for bolt11 invoices which do not contain a description themselves, but contain a description hash: in this case *description* is required. *description* is then checked against the hash inside the invoice before it will be paid" + }, + "label": { + "type": "string", + "description": "used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7)" + }, + "dev_use_shadow": { + "hidden": true, + "type": "boolean" + } + } + }, "renepay.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "added": "v23.08", @@ -14266,6 +14719,18 @@ } } }, + "renepaystatus.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "invstring": { + "type": "string", + "description": "if specified, the command will return a list of payment attempts whose invoice matches *invstring*, otherwise all payments with be listed" + } + } + }, "renepaystatus.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "added": "v23.08", @@ -14349,6 +14814,28 @@ } } }, + "reserveinputs.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "psbt" + ], + "properties": { + "psbt": { + "type": "string", + "description": "the PSBT to reserve inputs from" + }, + "exclusive": { + "type": "boolean", + "description": "If set to *False*, existing reservations are simply extended, rather than causing failure" + }, + "reserve": { + "type": "u32", + "description": "the number of blocks to reserve. By default, reservations are for the next 72 blocks (approximately 6 hours)" + } + } + }, "reserveinputs.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -14430,6 +14917,44 @@ } } }, + "sendinvoice.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "invreq", + "label" + ], + "properties": { + "invreq": { + "type": "string", + "description": "the bolt12 invoice_request string beginning with `lnr1`" + }, + "label": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "description": "the unique label to use for this invoice" + }, + "amount_msat": { + "type": "msat", + "description": "required if the *offer* does not specify an amount at all, or specifies it in a different currency. Otherwise you may set it (e.g. to provide a tip), and if not it defaults to the amount contained in the offer (multiplied by *quantity* if any)" + }, + "timeout": { + "type": "u32", + "description": "seconds to wait for the offering node to pay the invoice or return an error, default 90 seconds. This will also be the timeout on the invoice that is sent" + }, + "quantity": { + "type": "u64", + "description": "quantity is is required if the offer specifies quantity_max, otherwise it is not allowed" + } + } + }, "sendinvoice.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -14754,6 +15279,48 @@ } ] }, + "sendonionmessage.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "first_id", + "blinding", + "hops" + ], + "properties": { + "first_id": { + "type": "pubkey", + "description": "the (presumably well-known) public key of the start of the path" + }, + "blinding": { + "type": "pubkey", + "description": "blinding factor for this path" + }, + "hops": { + "type": "array", + "description": "", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "node", + "tlv" + ], + "properties": { + "node": { + "type": "pubkey", + "description": "public key of the node" + }, + "tlv": { + "type": "u8", + "description": "contains a hexidecimal TLV to include" + } + } + } + } + } + }, "sendonionmessage.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -15251,6 +15818,25 @@ } } }, + "setpsbtversion.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "psbt", + "version" + ], + "properties": { + "psbt": { + "type": "string", + "description": "the PSBT to change versions" + }, + "version": { + "type": "u32", + "description": "the version to set" + } + } + }, "showrunes.request.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -15809,6 +16395,24 @@ } } }, + "unreserveinputs.request.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "psbt" + ], + "properties": { + "psbt": { + "type": "string", + "description": "inputs to unreserve are the inputs specified in the passed-in *psbt*" + }, + "reserve": { + "type": "u32", + "description": "the number of blocks to decrease reservation by; default is 72" + } + } + }, "unreserveinputs.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", diff --git a/doc/schemas/bkpr-channelsapy.request.json b/doc/schemas/bkpr-channelsapy.request.json new file mode 100644 index 000000000000..7f272df97761 --- /dev/null +++ b/doc/schemas/bkpr-channelsapy.request.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "start_time": { + "type": "u64", + "description": "UNIX timestamp (in seconds) to filter events after the provided timestamp. Defaults to zero" + }, + "end_time": { + "type": "u64", + "description": "UNIX timestamp (in seconds) to filter events up to and at the provided timestamp. Defaults to max-int" + } + } +} diff --git a/doc/schemas/bkpr-dumpincomecsv.request.json b/doc/schemas/bkpr-dumpincomecsv.request.json new file mode 100644 index 000000000000..af9f9492f85f --- /dev/null +++ b/doc/schemas/bkpr-dumpincomecsv.request.json @@ -0,0 +1,30 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "csv_format" + ], + "properties": { + "csv_format": { + "type": "string", + "description": "CSV format to use. See RETURN VALUE for options" + }, + "csv_file": { + "type": "string", + "description": "on-disk destination of the generated CSV file" + }, + "consolidate_fees": { + "type": "boolean", + "description": "if true, we emit a single, consolidated event for any onchain-fees for a txid and account. Otherwise, events for every update to the onchain fee calculation for this account and txid will be printed. Defaults to true. Note that this means that the events emitted are non-stable, i.e. calling **dumpincomecsv** twice may result in different onchain fee events being emitted, depending on how much information we've logged for that transaction" + }, + "start_time": { + "type": "u64", + "description": "UNIX timestamp (in seconds) that filters events after the provided timestamp. Defaults to zero" + }, + "end_time": { + "type": "u64", + "description": "UNIX timestamp (in seconds) that filters events up to and at the provided timestamp. Defaults to max-int" + } + } +} diff --git a/doc/schemas/bkpr-inspect.request.json b/doc/schemas/bkpr-inspect.request.json new file mode 100644 index 000000000000..3cd8d6decb72 --- /dev/null +++ b/doc/schemas/bkpr-inspect.request.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "account" + ], + "properties": { + "account": { + "type": "string", + "description": "channel account to inspect" + } + } +} diff --git a/doc/schemas/bkpr-listaccountevents.request.json b/doc/schemas/bkpr-listaccountevents.request.json new file mode 100644 index 000000000000..c1a60465824a --- /dev/null +++ b/doc/schemas/bkpr-listaccountevents.request.json @@ -0,0 +1,12 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "account": { + "type": "string", + "description": "receive events for the specified account" + } + } +} diff --git a/doc/schemas/bkpr-listbalances.request.json b/doc/schemas/bkpr-listbalances.request.json new file mode 100644 index 000000000000..65571ad4c703 --- /dev/null +++ b/doc/schemas/bkpr-listbalances.request.json @@ -0,0 +1,7 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [], + "properties": {} +} diff --git a/doc/schemas/check.request.json b/doc/schemas/check.request.json new file mode 100644 index 000000000000..82b1b5be47f0 --- /dev/null +++ b/doc/schemas/check.request.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": true, + "required": [ + "command_to_check" + ], + "properties": { + "command_to_check": { + "type": "string", + "description": "name of the relevant command" + } + } +} diff --git a/doc/schemas/disableoffer.request.json b/doc/schemas/disableoffer.request.json new file mode 100644 index 000000000000..1cb8cb0e74d3 --- /dev/null +++ b/doc/schemas/disableoffer.request.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "offer_id" + ], + "properties": { + "offer_id": { + "type": "hash", + "description": "the id we use to identify this offer" + } + } +} diff --git a/doc/schemas/funderupdate.request.json b/doc/schemas/funderupdate.request.json new file mode 100644 index 000000000000..702825807af5 --- /dev/null +++ b/doc/schemas/funderupdate.request.json @@ -0,0 +1,77 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "policy": { + "type": "string", + "enum": [ + "match", + "available", + "fixed" + ], + "description": "funder plugin will use to decide how much captial to commit to a v2 open channel request.\n\tThere are three policy options, detailed below:\n\t* `match` -- Contribute *policy_mod* percent of their requested funds.\n\tValid *policy_mod* values are 0 to 200. If this is a channel lease\n\trequest, we match based on their requested funds. If it is not a\n\tchannel lease request (and *lease_only* is false), then we match\n\ttheir funding amount. Note: any lease match less than 100 will\n\tlikely fail, as clients will not accept a lease less than their request.\n\t* `available` -- Contribute *policy_mod* percent of our available\n\tnode wallet funds. Valid *policy_mod* values are 0 to 100.\n\t* `fixed` -- Contributes a fixed *policy_mod* sats to v2 channel open requests.\n\tDefault is fixed" + }, + "policy_mod": { + "type": "sat", + "description": "number or 'modification' to apply to the policy. Default is 0sats" + }, + "leases_only": { + "type": "boolean", + "description": "only contribute funds to `option_will_fund` requests which pay to lease funds. It will fund any v2 open request using *policy* even if it's they're not seeking to lease funds. Note that `option_will_fund` commits funds for 4032 blocks (~1mo). Must also set *lease_fee_base_msat*, *lease_fee_basis*, *funding_weight*, *channel_fee_max_base_msat*, and *channel_fee_max_proportional_thousandths* to advertise available channel leases. Defaults to *False*" + }, + "min_their_funding_msat": { + "type": "msat", + "description": "minimum funding sats that we require in order to activate our contribution policy to the v2 open. Defaults to 10k sats" + }, + "max_their_funding_msat": { + "type": "msat", + "description": "maximum funding sats that we will consider to activate our contribution policy to the v2 open. Any channel open above this will not be funded. Defaults to no max (`UINT_MAX`)" + }, + "per_channel_min_msat": { + "type": "msat", + "description": "minimum amount that we will contribute to a channel open. Defaults to 10k sats" + }, + "per_channel_max_msat": { + "type": "msat", + "description": "maximum amount that we will contribute to a channel open. Defaults to no max (`UINT_MAX`)" + }, + "reserve_tank_msat": { + "type": "msat", + "description": "amount of sats to leave available in the node wallet. Defaults to zero sats" + }, + "fuzz_percent": { + "type": "u32", + "description": "a percentage to fuzz the resulting contribution amount by. Valid values are 0 to 100. Note that turning this on with (match, 100) policy will randomly fail `option_will_fund` leases, as most clients expect an exact or greater match of their `requested_funds`. Defaults to 0% (no fuzz)" + }, + "fund_probability": { + "type": "u32", + "description": "the percent of v2 channel open requests to apply our policy to. Valid values are integers from 0 (fund 0% of all open requests) to 100 (fund every request). Useful for randomizing opens that receive funds. Useful for randomizing opens that receive funds. Defaults to 100" + }, + "lease_fee_base_msat": { + "type": "msat", + "description": "flat fee for a channel lease. Node will receive this much extra added to their channel balance, paid by the opening node. Defaults to 2k sats. Note that the minimum is 1sat" + }, + "lease_fee_basis": { + "type": "u32", + "description": "a basis fee that's calculated as 1/10k of the total requested funds the peer is asking for. Node will receive the total of *lease_fee_basis* times requested funds / 10k satoshis added to their channel balance, paid by the opening node. Default is 0.65% (65 basis points)" + }, + "funding_weight": { + "type": "u32", + "description": "to calculate the fee the peer will compensate your node for its contributing inputs to the funding transaction. The total fee is calculated as the `open_channel2`.`funding_feerate_perkw` times this *funding_weight* divided by 1000. Node will have this funding fee added to their channel balance, paid by the opening node. Default is 2 inputs + 1 P2WPKH output" + }, + "channel_fee_max_base_msat": { + "type": "msat", + "description": "a commitment to a maximum `channel_fee_base_msat` that your node will charge for routing payments over this leased channel during the lease duration. Default is 5k sats" + }, + "channel_fee_max_proportional_thousandths": { + "type": "u32", + "description": "a commitment to a maximum `channel_fee_proportional_millionths` that your node will charge for routing payments over this leased channel during the lease duration. Note that it's denominated in 'thousandths'. A setting of `1` is equal to 1k ppm; `5` is 5k ppm, etc. Default is 100 (100k ppm)" + }, + "compact_lease": { + "type": "hex", + "description": "a compact description of the channel lease params. When opening a channel, passed in to `fundchannel` to indicate the terms we expect from the peer" + } + } +} diff --git a/doc/schemas/getlog.request.json b/doc/schemas/getlog.request.json new file mode 100644 index 000000000000..a6fcfec8f4c2 --- /dev/null +++ b/doc/schemas/getlog.request.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "level": { + "type": "string", + "enum": [ + "broken", + "unusual", + "info", + "debug", + "io" + ], + "description": "a string that represents the log level. The default is *info*" + } + } +} diff --git a/doc/schemas/help.request.json b/doc/schemas/help.request.json new file mode 100644 index 000000000000..0c634d982549 --- /dev/null +++ b/doc/schemas/help.request.json @@ -0,0 +1,12 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "command": { + "type": "string", + "description": "command to get information about" + } + } +} diff --git a/doc/schemas/listconfigs.request.json b/doc/schemas/listconfigs.request.json new file mode 100644 index 000000000000..1bdf9677ecb5 --- /dev/null +++ b/doc/schemas/listconfigs.request.json @@ -0,0 +1,12 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "config": { + "type": "string", + "description": "configuration option name to restrict return" + } + } +} diff --git a/doc/schemas/multiwithdraw.request.json b/doc/schemas/multiwithdraw.request.json new file mode 100644 index 000000000000..5085cbbb774d --- /dev/null +++ b/doc/schemas/multiwithdraw.request.json @@ -0,0 +1,33 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "outputs" + ], + "properties": { + "outputs": { + "type": "array", + "items": { + "type": "outputdesc" + }, + "description": "an array containing objects of the form `{address: amount}`. The `amount` may be the string *all*, indicating that all onchain funds be sent to the specified address. Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" + }, + "feerate": { + "type": "feerate", + "description": "feerate used for the withdrawals. See NOTES in lightning-feerates(7) for possible values. The default is *normal*" + }, + "minconf": { + "type": "u32", + "description": "minimum number of confirmations that used outputs should have. Default is 1", + "default": 1 + }, + "utxos": { + "type": "array", + "items": { + "type": "outpoint", + "description": "utxos to be used to be withdrawn from, as an array of `txid:vout`. These must be drawn from the node's available UTXO set" + } + } + } +} diff --git a/doc/schemas/notifications.request.json b/doc/schemas/notifications.request.json new file mode 100644 index 000000000000..3542605b2322 --- /dev/null +++ b/doc/schemas/notifications.request.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "enable" + ], + "properties": { + "enable": { + "type": "boolean", + "description": "whether to enable or disable notifications" + } + } +} diff --git a/doc/schemas/openchannel_abort.request.json b/doc/schemas/openchannel_abort.request.json new file mode 100644 index 000000000000..574a44ef9417 --- /dev/null +++ b/doc/schemas/openchannel_abort.request.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "channel_id" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": "channel id of the channel to be aborted" + } + } +} diff --git a/doc/schemas/openchannel_bump.request.json b/doc/schemas/openchannel_bump.request.json new file mode 100644 index 000000000000..1d40501f6dd0 --- /dev/null +++ b/doc/schemas/openchannel_bump.request.json @@ -0,0 +1,28 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "channel_id", + "amount", + "initialpsbt" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": "id of the channel to RBF" + }, + "amount": { + "type": "sat", + "description": "satoshi value that we will contribute to the channel. This value will be _added_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel" + }, + "initialpsbt": { + "type": "string", + "description": "the funded, incomplete PSBT that specifies the UTXOs and change output for our channel contribution. It can be updated, see `openchannel_update`; *initialpsbt* must have at least one input. Must have the Non-Witness UTXO (PSBT_IN_NON_WITNESS_UTXO) set for every input. An error (code 309) will be returned if this requirement is not met" + }, + "funding_feerate": { + "type": "feerate", + "description": "feerate for the funding transaction. Defaults to 1/64th greater than the last feerate used for this channel" + } + } +} diff --git a/doc/schemas/openchannel_signed.request.json b/doc/schemas/openchannel_signed.request.json new file mode 100644 index 000000000000..903639b22ca2 --- /dev/null +++ b/doc/schemas/openchannel_signed.request.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "channel_id", + "signed_psbt" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": "id of the channel" + }, + "signed_psbt": { + "type": "string", + "description": "the PSBT returned from `openchannel_update` (where *commitments_secured* was true) with partial signatures or finalized witness stacks included for every input that we contributed to the PSBT" + } + } +} diff --git a/doc/schemas/openchannel_update.request.json b/doc/schemas/openchannel_update.request.json new file mode 100644 index 000000000000..b32f52330ad6 --- /dev/null +++ b/doc/schemas/openchannel_update.request.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "channel_id", + "psbt" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": "id of the channel" + }, + "psbt": { + "type": "string", + "description": "updated PSBT to be sent to the peer. May be identical to the PSBT last returned by either `openchannel_init` or `openchannel_update`" + } + } +} diff --git a/doc/schemas/parsefeerate.request.json b/doc/schemas/parsefeerate.request.json new file mode 100644 index 000000000000..7646e2c5709e --- /dev/null +++ b/doc/schemas/parsefeerate.request.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "feerate_str" + ], + "properties": { + "feerate_str": { + "type": "string", + "description": "The feerate string to parse" + } + } +} diff --git a/doc/schemas/plugin.request.json b/doc/schemas/plugin.request.json new file mode 100644 index 000000000000..c72dd08f9480 --- /dev/null +++ b/doc/schemas/plugin.request.json @@ -0,0 +1,29 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": true, + "required": [ + "subcommand" + ], + "properties": { + "subcommand": { + "type": "string", + "enum": [ + "start", + "stop", + "rescan", + "startdir", + "list" + ], + "description": "determines what action is taken" + }, + "plugin": { + "type": "string", + "description": "*path* or *name* of a plugin executable to start or stop" + }, + "directory": { + "type": "string", + "description": "*path* of a directory containing plugins" + } + } +} diff --git a/doc/schemas/recover.request.json b/doc/schemas/recover.request.json new file mode 100644 index 000000000000..2e983f6f3b93 --- /dev/null +++ b/doc/schemas/recover.request.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "hsmsecret" + ], + "properties": { + "hsmsecret": { + "type": "string", + "description": "either a codex32 secret starting with `cl1` as returned by `hsmtool getcodexsecret`, or a raw 64 character hex string" + } + } +} diff --git a/doc/schemas/renepay.request.json b/doc/schemas/renepay.request.json new file mode 100644 index 000000000000..91c1e266d018 --- /dev/null +++ b/doc/schemas/renepay.request.json @@ -0,0 +1,42 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "invstring" + ], + "properties": { + "invstring": { + "type": "string", + "description": "bolt11 invoice which the RPC command attempts to pay. Currently, **renepay** supports bolt11 invoices only" + }, + "amount_msat": { + "type": "msat", + "description": "if the *invstring* does not contain an amount, *amount_msat* is required, otherwise if it is specified it must be *null*. in millisatoshi precision; it can be a whole number, or a whole number with suffix *msat* or *sat*, or a three decimal point number with suffix *sat*, or an 1 to 11 decimal point number suffixed by *btc*" + }, + "maxfee": { + "type": "msat", + "description": "*maxfee* is a hard bound, in the sense that the command will never attempt a payment when the fees exceed that value" + }, + "maxdelay": { + "type": "u32", + "description": "overrides the value of `max-locktime-blocks` for this payment. It serves to limit the locktime of funds in the payment HTLC measured in blocks" + }, + "retry_for": { + "type": "u32", + "description": "measured in seconds specifies how much time it is allowed for the command to keep retrying the payment. Defaults to 60 seconds" + }, + "description": { + "type": "string", + "description": "only required for bolt11 invoices which do not contain a description themselves, but contain a description hash: in this case *description* is required. *description* is then checked against the hash inside the invoice before it will be paid" + }, + "label": { + "type": "string", + "description": "used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7)" + }, + "dev_use_shadow": { + "hidden": true, + "type": "boolean" + } + } +} diff --git a/doc/schemas/renepaystatus.request.json b/doc/schemas/renepaystatus.request.json new file mode 100644 index 000000000000..a332dd2c96bb --- /dev/null +++ b/doc/schemas/renepaystatus.request.json @@ -0,0 +1,12 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "invstring": { + "type": "string", + "description": "if specified, the command will return a list of payment attempts whose invoice matches *invstring*, otherwise all payments with be listed" + } + } +} diff --git a/doc/schemas/reserveinputs.request.json b/doc/schemas/reserveinputs.request.json new file mode 100644 index 000000000000..b7eadaab7d36 --- /dev/null +++ b/doc/schemas/reserveinputs.request.json @@ -0,0 +1,22 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "psbt" + ], + "properties": { + "psbt": { + "type": "string", + "description": "the PSBT to reserve inputs from" + }, + "exclusive": { + "type": "boolean", + "description": "If set to *False*, existing reservations are simply extended, rather than causing failure" + }, + "reserve": { + "type": "u32", + "description": "the number of blocks to reserve. By default, reservations are for the next 72 blocks (approximately 6 hours)" + } + } +} diff --git a/doc/schemas/sendinvoice.request.json b/doc/schemas/sendinvoice.request.json new file mode 100644 index 000000000000..ea5f6a118c9a --- /dev/null +++ b/doc/schemas/sendinvoice.request.json @@ -0,0 +1,38 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "invreq", + "label" + ], + "properties": { + "invreq": { + "type": "string", + "description": "the bolt12 invoice_request string beginning with `lnr1`" + }, + "label": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "description": "the unique label to use for this invoice" + }, + "amount_msat": { + "type": "msat", + "description": "required if the *offer* does not specify an amount at all, or specifies it in a different currency. Otherwise you may set it (e.g. to provide a tip), and if not it defaults to the amount contained in the offer (multiplied by *quantity* if any)" + }, + "timeout": { + "type": "u32", + "description": "seconds to wait for the offering node to pay the invoice or return an error, default 90 seconds. This will also be the timeout on the invoice that is sent" + }, + "quantity": { + "type": "u64", + "description": "quantity is is required if the offer specifies quantity_max, otherwise it is not allowed" + } + } +} diff --git a/doc/schemas/sendonionmessage.request.json b/doc/schemas/sendonionmessage.request.json new file mode 100644 index 000000000000..74bc5df6fec0 --- /dev/null +++ b/doc/schemas/sendonionmessage.request.json @@ -0,0 +1,42 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "first_id", + "blinding", + "hops" + ], + "properties": { + "first_id": { + "type": "pubkey", + "description": "the (presumably well-known) public key of the start of the path" + }, + "blinding": { + "type": "pubkey", + "description": "blinding factor for this path" + }, + "hops": { + "type": "array", + "description": "", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "node", + "tlv" + ], + "properties": { + "node": { + "type": "pubkey", + "description": "public key of the node" + }, + "tlv": { + "type": "u8", + "description": "contains a hexidecimal TLV to include" + } + } + } + } + } +} diff --git a/doc/schemas/setpsbtversion.request.json b/doc/schemas/setpsbtversion.request.json new file mode 100644 index 000000000000..c6abb424a22f --- /dev/null +++ b/doc/schemas/setpsbtversion.request.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "psbt", + "version" + ], + "properties": { + "psbt": { + "type": "string", + "description": "the PSBT to change versions" + }, + "version": { + "type": "u32", + "description": "the version to set" + } + } +} diff --git a/doc/schemas/unreserveinputs.request.json b/doc/schemas/unreserveinputs.request.json new file mode 100644 index 000000000000..c4f12479bbc8 --- /dev/null +++ b/doc/schemas/unreserveinputs.request.json @@ -0,0 +1,18 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "psbt" + ], + "properties": { + "psbt": { + "type": "string", + "description": "inputs to unreserve are the inputs specified in the passed-in *psbt*" + }, + "reserve": { + "type": "u32", + "description": "the number of blocks to decrease reservation by; default is 72" + } + } +} From bbd155dc177cf6e1d36ee6095d87c5b834b86b33 Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Fri, 2 Feb 2024 15:18:30 +1030 Subject: [PATCH 05/16] doc: Adding missing `*.schema.json` Adding missing *.schema.json files for rpc commands to create consolidated json files. Updating and deleting other as per requirement. --- contrib/msggen/msggen/schema.json | 91 ++++++++++++-------------- doc/schemas/commando.schema.json | 12 ++++ doc/schemas/recover.schema.json | 17 +++++ doc/schemas/setchannelfee.schema.json | 48 -------------- doc/schemas/setpsbtversion.schema.json | 12 ++++ 5 files changed, 84 insertions(+), 96 deletions(-) create mode 100644 doc/schemas/commando.schema.json create mode 100644 doc/schemas/recover.schema.json delete mode 100644 doc/schemas/setchannelfee.schema.json create mode 100644 doc/schemas/setpsbtversion.schema.json diff --git a/contrib/msggen/msggen/schema.json b/contrib/msggen/msggen/schema.json index d25cecc9d1c8..cf1f67c5fe87 100644 --- a/contrib/msggen/msggen/schema.json +++ b/contrib/msggen/msggen/schema.json @@ -1965,6 +1965,18 @@ } } }, + "commando.schema.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "any": { + "type": "object", + "description": "the return depends on the *method* invoked" + } + } + }, "connect.request.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -14591,6 +14603,23 @@ } } }, + "recover.schema.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "result" + ], + "properties": { + "result": { + "type": "string", + "added": "v24.05", + "enum": [ + "Recovery restart in progress" + ] + } + } + }, "recoverchannel.request.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -15693,54 +15722,6 @@ } } }, - "setchannelfee.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "base", - "ppm", - "channels" - ], - "properties": { - "base": { - "type": "u32", - "description": "The fee_base_msat value" - }, - "ppm": { - "type": "u32", - "description": "The fee_proportional_millionths value" - }, - "channels": { - "type": "array", - "description": "channel(s) whose rate is now set", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "peer_id", - "channel_id" - ], - "properties": { - "peer_id": { - "type": "pubkey", - "description": "The node_id of the peer" - }, - "channel_id": { - "type": "hex", - "description": "The channel_id of the channel", - "minLength": 64, - "maxLength": 64 - }, - "short_channel_id": { - "type": "short_channel_id", - "description": "the short_channel_id (if locked in)" - } - } - } - } - } - }, "setconfig.request.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", @@ -15837,6 +15818,20 @@ } } }, + "setpsbtversion.schema.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "psbt" + ], + "properties": { + "psbt": { + "type": "string", + "description": "a converted PSBT of the requested version" + } + } + }, "showrunes.request.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", diff --git a/doc/schemas/commando.schema.json b/doc/schemas/commando.schema.json new file mode 100644 index 000000000000..dd8cbd873345 --- /dev/null +++ b/doc/schemas/commando.schema.json @@ -0,0 +1,12 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "any": { + "type": "object", + "description": "the return depends on the *method* invoked" + } + } +} diff --git a/doc/schemas/recover.schema.json b/doc/schemas/recover.schema.json new file mode 100644 index 000000000000..ea6b907f2dfb --- /dev/null +++ b/doc/schemas/recover.schema.json @@ -0,0 +1,17 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "result" + ], + "properties": { + "result": { + "type": "string", + "added": "v24.05", + "enum": [ + "Recovery restart in progress" + ] + } + } +} diff --git a/doc/schemas/setchannelfee.schema.json b/doc/schemas/setchannelfee.schema.json deleted file mode 100644 index 9f6113a0a88d..000000000000 --- a/doc/schemas/setchannelfee.schema.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "base", - "ppm", - "channels" - ], - "properties": { - "base": { - "type": "u32", - "description": "The fee_base_msat value" - }, - "ppm": { - "type": "u32", - "description": "The fee_proportional_millionths value" - }, - "channels": { - "type": "array", - "description": "channel(s) whose rate is now set", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "peer_id", - "channel_id" - ], - "properties": { - "peer_id": { - "type": "pubkey", - "description": "The node_id of the peer" - }, - "channel_id": { - "type": "hex", - "description": "The channel_id of the channel", - "minLength": 64, - "maxLength": 64 - }, - "short_channel_id": { - "type": "short_channel_id", - "description": "the short_channel_id (if locked in)" - } - } - } - } - } -} diff --git a/doc/schemas/setpsbtversion.schema.json b/doc/schemas/setpsbtversion.schema.json new file mode 100644 index 000000000000..ac11f52e773b --- /dev/null +++ b/doc/schemas/setpsbtversion.schema.json @@ -0,0 +1,12 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": ["psbt"], + "properties": { + "psbt": { + "type": "string", + "description": "a converted PSBT of the requested version" + } + } +} From f5de75effd3c573d9c5a4eb0c9ee4f2d398bc4f1 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 2 Feb 2024 15:17:43 +1030 Subject: [PATCH 06/16] doc: Updated parameter descriptions for *.request.json Added descriptions for rpc command parameters This also performs the following fixes: 1. delforward parameters are compulsory (required). 2. disableinvoicerequest request added `added` field. 3. invoice request order fixed (label then description, not vice-versa!). 4. listpeers log levels are a proper enum 5. description parameter documented for sendonion requests. 6. deprecatred amount_msat removed from sendpay request. 7. sendpay request partid type fixed to u64 (was u16!) 8. sendpay request localinvreqid type tightened to hash (was hex) 9. sendpay request payment_metadata and description fields documented. 10. sendpsbt request reserve type fixed to u32 (was boolean) 11. utxopsbt request satoshi type fixed to msat_or_all (was msat) 12. withdraw request parameter satoshi is compulsory (required) 13. fundchannel_start request amount is sat, not msat_or_all. 14. openchannel_init request amount is sat, not msat 15. openchannel_init close_to is a string, not hex. 16: invoice labels can be strings OR numbers. Signed-off-by: Rusty Russell --- .msggen.json | 21 + cln-grpc/proto/node.proto | 28 +- cln-grpc/src/convert.rs | 42 +- cln-rpc/src/model.rs | 74 +- contrib/msggen/msggen/schema.json | 836 ++++++++++------ contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py | 944 +++++++++--------- doc/schemas/addgossip.request.json | 2 +- doc/schemas/addpsbtoutput.request.json | 15 +- doc/schemas/autoclean-once.request.json | 4 +- doc/schemas/autoclean-status.request.json | 2 +- doc/schemas/batching.request.json | 2 +- doc/schemas/bkpr-listincome.request.json | 6 +- doc/schemas/checkmessage.request.json | 6 +- doc/schemas/close.request.json | 14 +- doc/schemas/commando-rune.request.json | 2 +- doc/schemas/connect.request.json | 6 +- doc/schemas/createinvoice.request.json | 11 +- doc/schemas/createonion.request.json | 16 +- doc/schemas/createrune.request.json | 2 +- doc/schemas/datastore.request.json | 13 +- doc/schemas/datastoreusage.request.json | 2 +- doc/schemas/decode.request.json | 3 +- doc/schemas/decodepay.request.json | 6 +- doc/schemas/deldatastore.request.json | 4 +- doc/schemas/delexpiredinvoice.request.json | 2 +- doc/schemas/delforward.request.json | 13 +- doc/schemas/delinvoice.request.json | 13 +- doc/schemas/delpay.request.json | 9 +- .../disableinvoicerequest.request.json | 3 +- doc/schemas/disconnect.request.json | 6 +- doc/schemas/feerates.request.json | 1 + doc/schemas/fetchinvoice.request.json | 16 +- doc/schemas/fundchannel.request.json | 29 +- doc/schemas/fundchannel_cancel.request.json | 2 +- doc/schemas/fundchannel_complete.request.json | 4 +- doc/schemas/fundchannel_start.request.json | 14 +- doc/schemas/fundpsbt.request.json | 29 +- doc/schemas/getroute.request.json | 16 +- doc/schemas/invoice.request.json | 36 +- doc/schemas/invoicerequest.request.json | 12 +- doc/schemas/keysend.request.json | 24 +- doc/schemas/listchannels.request.json | 6 +- doc/schemas/listclosedchannels.request.json | 2 +- doc/schemas/listdatastore.request.json | 5 +- doc/schemas/listforwards.request.json | 13 +- doc/schemas/listfunds.request.json | 2 +- doc/schemas/listhtlcs.request.json | 2 +- doc/schemas/listinvoicerequests.request.json | 4 +- doc/schemas/listinvoices.request.json | 21 +- doc/schemas/listnodes.request.json | 3 +- doc/schemas/listpays.request.json | 7 +- doc/schemas/listpeerchannels.request.json | 2 +- doc/schemas/listpeers.request.json | 10 +- doc/schemas/listsendpays.request.json | 15 +- doc/schemas/makesecret.request.json | 4 +- doc/schemas/multifundchannel.request.json | 50 +- doc/schemas/newaddr.request.json | 1 + doc/schemas/openchannel_init.request.json | 27 +- doc/schemas/pay.request.json | 34 +- doc/schemas/ping.request.json | 9 +- doc/schemas/preapproveinvoice.request.json | 1 + doc/schemas/preapprovekeysend.request.json | 4 +- doc/schemas/recoverchannel.request.json | 12 +- doc/schemas/sendcustommsg.request.json | 6 +- doc/schemas/sendonion.request.json | 43 +- doc/schemas/sendonionmessage.request.json | 2 +- doc/schemas/sendpay.request.json | 52 +- doc/schemas/sendpsbt.request.json | 6 +- doc/schemas/setchannel.request.json | 21 +- doc/schemas/setconfig.request.json | 18 +- doc/schemas/showrunes.request.json | 2 +- doc/schemas/signinvoice.request.json | 2 +- doc/schemas/signmessage.request.json | 3 +- doc/schemas/signpsbt.request.json | 4 +- doc/schemas/splice_init.request.json | 2 +- doc/schemas/splice_update.request.json | 2 +- doc/schemas/txdiscard.request.json | 3 +- doc/schemas/txprepare.request.json | 8 +- doc/schemas/txsend.request.json | 3 +- doc/schemas/utxopsbt.request.json | 27 +- doc/schemas/wait.request.json | 5 +- doc/schemas/waitanyinvoice.request.json | 6 +- doc/schemas/waitblockheight.request.json | 4 +- doc/schemas/waitinvoice.request.json | 10 +- doc/schemas/waitsendpay.request.json | 12 +- doc/schemas/withdraw.request.json | 16 +- 86 files changed, 1653 insertions(+), 1128 deletions(-) diff --git a/.msggen.json b/.msggen.json index 08001d78e210..fa522b2c7baf 100644 --- a/.msggen.json +++ b/.msggen.json @@ -235,6 +235,12 @@ "ONCHAIN": 8, "OPENINGD": 0 }, + "ListpeersLevel": { + "debug": 1, + "info": 2, + "io": 0, + "unusual": 3 + }, "ListpeersPeersChannelsHtlcsDirection": { "in": 0, "out": 1 @@ -1566,6 +1572,7 @@ "SendonionRequest": { "SendOnion.amount_msat": 12, "SendOnion.bolt11": 7, + "SendOnion.description": 14, "SendOnion.destination": 9, "SendOnion.first_hop": 2, "SendOnion.groupid": 11, @@ -1598,6 +1605,7 @@ "SendpayRequest": { "SendPay.amount_msat": 10, "SendPay.bolt11": 5, + "SendPay.description": 13, "SendPay.groupid": 9, "SendPay.label": 3, "SendPay.localinvreqid": 11, @@ -1605,6 +1613,7 @@ "SendPay.msatoshi": 4, "SendPay.partid": 7, "SendPay.payment_hash": 2, + "SendPay.payment_metadata": 12, "SendPay.payment_secret": 6, "SendPay.route[]": 1 }, @@ -5664,6 +5673,10 @@ "added": "v23.11", "deprecated": false }, + "SendOnion.description": { + "added": "v0.11.0", + "deprecated": false + }, "SendOnion.destination": { "added": "pre-v0.10.1", "deprecated": false @@ -5764,6 +5777,10 @@ "added": "v23.11", "deprecated": false }, + "SendPay.description": { + "added": "v0.11.0", + "deprecated": false + }, "SendPay.destination": { "added": "pre-v0.10.1", "deprecated": false @@ -5796,6 +5813,10 @@ "added": "pre-v0.10.1", "deprecated": false }, + "SendPay.payment_metadata": { + "added": "v0.11.0", + "deprecated": false + }, "SendPay.payment_preimage": { "added": "pre-v0.10.1", "deprecated": false diff --git a/cln-grpc/proto/node.proto b/cln-grpc/proto/node.proto index a2afa82d1b32..9292eae7b069 100644 --- a/cln-grpc/proto/node.proto +++ b/cln-grpc/proto/node.proto @@ -135,8 +135,15 @@ message GetinfoBinding { } message ListpeersRequest { + // ListPeers.level + enum ListpeersLevel { + IO = 0; + DEBUG = 1; + INFO = 2; + UNUSUAL = 3; + } optional bytes id = 1; - optional string level = 2; + optional ListpeersLevel level = 2; } message ListpeersResponse { @@ -333,9 +340,11 @@ message SendpayRequest { optional Amount amount_msat = 10; optional string bolt11 = 5; optional bytes payment_secret = 6; - optional uint32 partid = 7; + optional uint64 partid = 7; optional bytes localinvreqid = 11; optional uint64 groupid = 9; + optional bytes payment_metadata = 12; + optional string description = 13; } message SendpayResponse { @@ -364,10 +373,10 @@ message SendpayResponse { } message SendpayRoute { - Amount amount_msat = 5; bytes id = 2; - uint32 delay = 3; string channel = 4; + uint32 delay = 3; + Amount amount_msat = 5; } message ListchannelsRequest { @@ -485,7 +494,6 @@ message ConnectAddress { message CreateinvoiceRequest { string invstring = 1; - string label = 2; bytes preimage = 3; } @@ -625,8 +633,8 @@ message DelinvoiceResponse { message InvoiceRequest { AmountOrAny amount_msat = 10; - string description = 2; string label = 3; + string description = 2; optional uint64 expiry = 7; repeated string fallbacks = 4; optional bytes preimage = 5; @@ -724,6 +732,7 @@ message SendonionRequest { optional bytes destination = 9; optional bytes localinvreqid = 13; optional uint64 groupid = 11; + optional string description = 14; } message SendonionResponse { @@ -933,7 +942,6 @@ message WaitanyinvoicePaid_outpoint { } message WaitinvoiceRequest { - string label = 1; } message WaitinvoiceResponse { @@ -1011,7 +1019,7 @@ message NewaddrResponse { message WithdrawRequest { string destination = 1; - optional AmountOrAll satoshi = 2; + AmountOrAll satoshi = 2; optional Feerate feerate = 5; optional uint32 minconf = 3; repeated Outpoint utxos = 4; @@ -1083,7 +1091,7 @@ message FundpsbtReservations { message SendpsbtRequest { string psbt = 1; - optional bool reserve = 2; + optional uint32 reserve = 2; } message SendpsbtResponse { @@ -1101,7 +1109,7 @@ message SignpsbtResponse { } message UtxopsbtRequest { - Amount satoshi = 1; + AmountOrAll satoshi = 1; Feerate feerate = 2; uint32 startweight = 3; repeated Outpoint utxos = 4; diff --git a/cln-grpc/src/convert.rs b/cln-grpc/src/convert.rs index 10d60399020b..0f60980cf07e 100644 --- a/cln-grpc/src/convert.rs +++ b/cln-grpc/src/convert.rs @@ -1897,7 +1897,7 @@ impl From for pb::ListpeersRequest { fn from(c: requests::ListpeersRequest) -> Self { Self { id: c.id.map(|v| v.serialize().to_vec()), // Rule #2 for type pubkey? - level: c.level, // Rule #2 for type string? + level: c.level.map(|v| v as i32), } } } @@ -1915,10 +1915,10 @@ impl From for pb::ListfundsRequest { impl From for pb::SendpayRoute { fn from(c: requests::SendpayRoute) -> Self { Self { - amount_msat: Some(c.amount_msat.into()), // Rule #2 for type msat id: c.id.serialize().to_vec(), // Rule #2 for type pubkey - delay: c.delay.into(), // Rule #2 for type u16 channel: c.channel.to_string(), // Rule #2 for type short_channel_id + delay: c.delay, // Rule #2 for type u32 + amount_msat: Some(c.amount_msat.into()), // Rule #2 for type msat } } } @@ -1934,9 +1934,11 @@ impl From for pb::SendpayRequest { amount_msat: c.amount_msat.map(|f| f.into()), // Rule #2 for type msat? bolt11: c.bolt11, // Rule #2 for type string? payment_secret: c.payment_secret.map(|v| v.to_vec()), // Rule #2 for type secret? - partid: c.partid.map(|v| v.into()), // Rule #2 for type u16? + partid: c.partid, // Rule #2 for type u64? localinvreqid: c.localinvreqid.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex? groupid: c.groupid, // Rule #2 for type u64? + payment_metadata: c.payment_metadata.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex? + description: c.description, // Rule #2 for type string? } } } @@ -2014,7 +2016,6 @@ impl From for pb::CreateinvoiceRequest { fn from(c: requests::CreateinvoiceRequest) -> Self { Self { invstring: c.invstring, // Rule #2 for type string - label: c.label, // Rule #2 for type string preimage: hex::decode(&c.preimage).unwrap(), // Rule #2 for type hex } } @@ -2101,8 +2102,8 @@ impl From for pb::InvoiceRequest { fn from(c: requests::InvoiceRequest) -> Self { Self { amount_msat: Some(c.amount_msat.into()), // Rule #2 for type msat_or_any - description: c.description, // Rule #2 for type string label: c.label, // Rule #2 for type string + description: c.description, // Rule #2 for type string expiry: c.expiry, // Rule #2 for type u64? // Field: Invoice.fallbacks[] fallbacks: c.fallbacks.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 @@ -2165,6 +2166,7 @@ impl From for pb::SendonionRequest { destination: c.destination.map(|v| v.serialize().to_vec()), // Rule #2 for type pubkey? localinvreqid: c.localinvreqid.map(|v| >::as_ref(&v).to_vec()), // Rule #2 for type hash? groupid: c.groupid, // Rule #2 for type u64? + description: c.description, // Rule #2 for type string? } } } @@ -2235,7 +2237,6 @@ impl From for pb::WaitanyinvoiceRequest { impl From for pb::WaitinvoiceRequest { fn from(c: requests::WaitinvoiceRequest) -> Self { Self { - label: c.label, // Rule #2 for type string } } } @@ -2266,7 +2267,7 @@ impl From for pb::WithdrawRequest { fn from(c: requests::WithdrawRequest) -> Self { Self { destination: c.destination, // Rule #2 for type string - satoshi: c.satoshi.map(|o|o.into()), // Rule #2 for type msat_or_all? + satoshi: Some(c.satoshi.into()), // Rule #2 for type msat_or_all feerate: c.feerate.map(|o|o.into()), // Rule #2 for type feerate? minconf: c.minconf.map(|v| v.into()), // Rule #2 for type u16? // Field: Withdraw.utxos[] @@ -2315,7 +2316,7 @@ impl From for pb::SendpsbtRequest { fn from(c: requests::SendpsbtRequest) -> Self { Self { psbt: c.psbt, // Rule #2 for type string - reserve: c.reserve, // Rule #2 for type boolean? + reserve: c.reserve, // Rule #2 for type u32? } } } @@ -2335,7 +2336,7 @@ impl From for pb::SignpsbtRequest { impl From for pb::UtxopsbtRequest { fn from(c: requests::UtxopsbtRequest) -> Self { Self { - satoshi: Some(c.satoshi.into()), // Rule #2 for type msat + satoshi: Some(c.satoshi.into()), // Rule #2 for type msat_or_all feerate: Some(c.feerate.into()), // Rule #2 for type feerate startweight: c.startweight, // Rule #2 for type u32 // Field: UtxoPsbt.utxos[] @@ -2693,7 +2694,7 @@ impl From for requests::ListpeersRequest { fn from(c: pb::ListpeersRequest) -> Self { Self { id: c.id.map(|v| PublicKey::from_slice(&v).unwrap()), // Rule #1 for type pubkey? - level: c.level, // Rule #1 for type string? + level: c.level.map(|v| v.try_into().unwrap()), } } } @@ -2711,10 +2712,10 @@ impl From for requests::ListfundsRequest { impl From for requests::SendpayRoute { fn from(c: pb::SendpayRoute) -> Self { Self { - amount_msat: c.amount_msat.unwrap().into(), // Rule #1 for type msat id: PublicKey::from_slice(&c.id).unwrap(), // Rule #1 for type pubkey - delay: c.delay as u16, // Rule #1 for type u16 channel: cln_rpc::primitives::ShortChannelId::from_str(&c.channel).unwrap(), // Rule #1 for type short_channel_id + delay: c.delay, // Rule #1 for type u32 + amount_msat: c.amount_msat.unwrap().into(), // Rule #1 for type msat } } } @@ -2729,9 +2730,11 @@ impl From for requests::SendpayRequest { amount_msat: c.amount_msat.map(|a| a.into()), // Rule #1 for type msat? bolt11: c.bolt11, // Rule #1 for type string? payment_secret: c.payment_secret.map(|v| v.try_into().unwrap()), // Rule #1 for type secret? - partid: c.partid.map(|v| v as u16), // Rule #1 for type u16? + partid: c.partid, // Rule #1 for type u64? localinvreqid: c.localinvreqid.map(|v| hex::encode(v)), // Rule #1 for type hex? groupid: c.groupid, // Rule #1 for type u64? + payment_metadata: c.payment_metadata.map(|v| hex::encode(v)), // Rule #1 for type hex? + description: c.description, // Rule #1 for type string? } } } @@ -2808,7 +2811,6 @@ impl From for requests::CreateinvoiceRequest { fn from(c: pb::CreateinvoiceRequest) -> Self { Self { invstring: c.invstring, // Rule #1 for type string - label: c.label, // Rule #1 for type string preimage: hex::encode(&c.preimage), // Rule #1 for type hex } } @@ -2892,8 +2894,8 @@ impl From for requests::InvoiceRequest { fn from(c: pb::InvoiceRequest) -> Self { Self { amount_msat: c.amount_msat.unwrap().into(), // Rule #1 for type msat_or_any - description: c.description, // Rule #1 for type string label: c.label, // Rule #1 for type string + description: c.description, // Rule #1 for type string expiry: c.expiry, // Rule #1 for type u64? fallbacks: Some(c.fallbacks.into_iter().map(|s| s.into()).collect()), // Rule #4 preimage: c.preimage.map(|v| hex::encode(v)), // Rule #1 for type hex? @@ -2953,6 +2955,7 @@ impl From for requests::SendonionRequest { destination: c.destination.map(|v| PublicKey::from_slice(&v).unwrap()), // Rule #1 for type pubkey? localinvreqid: c.localinvreqid.map(|v| Sha256::from_slice(&v).unwrap()), // Rule #1 for type hash? groupid: c.groupid, // Rule #1 for type u64? + description: c.description, // Rule #1 for type string? } } } @@ -3022,7 +3025,6 @@ impl From for requests::WaitanyinvoiceRequest { impl From for requests::WaitinvoiceRequest { fn from(c: pb::WaitinvoiceRequest) -> Self { Self { - label: c.label, // Rule #1 for type string } } } @@ -3053,7 +3055,7 @@ impl From for requests::WithdrawRequest { fn from(c: pb::WithdrawRequest) -> Self { Self { destination: c.destination, // Rule #1 for type string - satoshi: c.satoshi.map(|a| a.into()), // Rule #1 for type msat_or_all? + satoshi: c.satoshi.unwrap().into(), // Rule #1 for type msat_or_all feerate: c.feerate.map(|a| a.into()), // Rule #1 for type feerate? minconf: c.minconf.map(|v| v as u16), // Rule #1 for type u16? utxos: Some(c.utxos.into_iter().map(|s| s.into()).collect()), // Rule #4 @@ -3101,7 +3103,7 @@ impl From for requests::SendpsbtRequest { fn from(c: pb::SendpsbtRequest) -> Self { Self { psbt: c.psbt, // Rule #1 for type string - reserve: c.reserve, // Rule #1 for type boolean? + reserve: c.reserve, // Rule #1 for type u32? } } } @@ -3120,7 +3122,7 @@ impl From for requests::SignpsbtRequest { impl From for requests::UtxopsbtRequest { fn from(c: pb::UtxopsbtRequest) -> Self { Self { - satoshi: c.satoshi.unwrap().into(), // Rule #1 for type msat + satoshi: c.satoshi.unwrap().into(), // Rule #1 for type msat_or_all feerate: c.feerate.unwrap().into(), // Rule #1 for type feerate startweight: c.startweight, // Rule #1 for type u32 utxos: c.utxos.into_iter().map(|s| s.into()).collect(), // Rule #4 diff --git a/cln-rpc/src/model.rs b/cln-rpc/src/model.rs index e5c83d3bad36..a1d5b5ee585c 100644 --- a/cln-rpc/src/model.rs +++ b/cln-rpc/src/model.rs @@ -195,12 +195,49 @@ pub mod requests { "getinfo" } } + /// supplying level will show log entries related to that peer at the given log level + #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] + pub enum ListpeersLevel { + #[serde(rename = "io")] + IO, + #[serde(rename = "debug")] + DEBUG, + #[serde(rename = "info")] + INFO, + #[serde(rename = "unusual")] + UNUSUAL, + } + + impl TryFrom for ListpeersLevel { + type Error = anyhow::Error; + fn try_from(c: i32) -> Result { + match c { + 0 => Ok(ListpeersLevel::IO), + 1 => Ok(ListpeersLevel::DEBUG), + 2 => Ok(ListpeersLevel::INFO), + 3 => Ok(ListpeersLevel::UNUSUAL), + o => Err(anyhow::anyhow!("Unknown variant {} for enum ListpeersLevel", o)), + } + } + } + + impl ToString for ListpeersLevel { + fn to_string(&self) -> String { + match self { + ListpeersLevel::IO => "IO", + ListpeersLevel::DEBUG => "DEBUG", + ListpeersLevel::INFO => "INFO", + ListpeersLevel::UNUSUAL => "UNUSUAL", + }.to_string() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct ListpeersRequest { #[serde(skip_serializing_if = "Option::is_none")] pub id: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub level: Option, + pub level: Option, } impl From for Request { @@ -245,10 +282,10 @@ pub mod requests { } #[derive(Clone, Debug, Deserialize, Serialize)] pub struct SendpayRoute { - pub amount_msat: Amount, pub id: PublicKey, - pub delay: u16, pub channel: ShortChannelId, + pub delay: u32, + pub amount_msat: Amount, } #[derive(Clone, Debug, Deserialize, Serialize)] @@ -264,11 +301,15 @@ pub mod requests { #[serde(skip_serializing_if = "Option::is_none")] pub payment_secret: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub partid: Option, + pub partid: Option, #[serde(skip_serializing_if = "Option::is_none")] pub localinvreqid: Option, #[serde(skip_serializing_if = "Option::is_none")] pub groupid: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_metadata: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, } impl From for Request { @@ -450,7 +491,6 @@ pub mod requests { #[derive(Clone, Debug, Deserialize, Serialize)] pub struct CreateinvoiceRequest { pub invstring: String, - pub label: String, pub preimage: String, } @@ -471,6 +511,7 @@ pub mod requests { "createinvoice" } } + /// - `must-create`: fails if it already exists. - `must-replace`: fails if it doesn't already exist. - `create-or-replace`: never fails. - `must-append`: must already exist, append this to what's already there. - `create-or-append`: append if anything is there, otherwise create. Default is `must-create` #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum DatastoreMode { #[serde(rename = "must-create")] @@ -642,6 +683,7 @@ pub mod requests { "delexpiredinvoice" } } + /// label of the invoice to be deleted. The caller should be particularly aware of the error case caused by the *status* changing just before this command is invoked! #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum DelinvoiceStatus { #[serde(rename = "paid")] @@ -703,8 +745,8 @@ pub mod requests { #[derive(Clone, Debug, Deserialize, Serialize)] pub struct InvoiceRequest { pub amount_msat: AmountOrAny, - pub description: String, pub label: String, + pub description: String, #[serde(skip_serializing_if = "Option::is_none")] pub expiry: Option, #[serde(skip_serializing_if = "crate::is_none_or_empty")] @@ -757,6 +799,7 @@ pub mod requests { "listdatastore" } } + /// if neither *in_channel* nor *out_channel* is specified, it controls ordering. Defaults to `created` #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ListinvoicesIndex { #[serde(rename = "created")] @@ -848,6 +891,8 @@ pub mod requests { pub localinvreqid: Option, #[serde(skip_serializing_if = "Option::is_none")] pub groupid: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, } impl From for Request { @@ -867,6 +912,7 @@ pub mod requests { "sendonion" } } + /// Whether the invoice has been paid, pending, or failed #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ListsendpaysStatus { #[serde(rename = "pending")] @@ -899,6 +945,7 @@ pub mod requests { } } + /// if neither bolt11 or payment_hash is specified, `index` controls ordering, by `created` (default) or `updated` #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ListsendpaysIndex { #[serde(rename = "created")] @@ -1075,7 +1122,6 @@ pub mod requests { } #[derive(Clone, Debug, Deserialize, Serialize)] pub struct WaitinvoiceRequest { - pub label: String, } impl From for Request { @@ -1123,6 +1169,7 @@ pub mod requests { "waitsendpay" } } + /// it specifies the type of address wanted; currently *bech32* (e.g. `tb1qu9j4lg5f9rgjyfhvfd905vw46eg39czmktxqgg` on bitcoin testnet or `bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej` on bitcoin mainnet), or *p2tr* taproot addresses. The special value *all* generates all known address types for the same underlying key. Defaults to *bech32* address #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum NewaddrAddresstype { #[serde(rename = "bech32")] @@ -1181,8 +1228,7 @@ pub mod requests { #[derive(Clone, Debug, Deserialize, Serialize)] pub struct WithdrawRequest { pub destination: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub satoshi: Option, + pub satoshi: AmountOrAll, #[serde(skip_serializing_if = "Option::is_none")] pub feerate: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -1287,7 +1333,7 @@ pub mod requests { pub struct SendpsbtRequest { pub psbt: String, #[serde(skip_serializing_if = "Option::is_none")] - pub reserve: Option, + pub reserve: Option, } impl From for Request { @@ -1333,7 +1379,7 @@ pub mod requests { } #[derive(Clone, Debug, Deserialize, Serialize)] pub struct UtxopsbtRequest { - pub satoshi: Amount, + pub satoshi: AmountOrAll, pub feerate: Feerate, pub startweight: u32, pub utxos: Vec, @@ -1556,6 +1602,7 @@ pub mod requests { "disconnect" } } + /// *perkw* - provide feerate in units of satoshis per 1000 weight (e.g. the minimum fee is usually `253perkw`) *perkb* - provide feerate in units of satoshis per 1000 virtual bytes (eg. the minimum fee is usually `1000perkb`) #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum FeeratesStyle { #[serde(rename = "perkb")] @@ -1722,6 +1769,7 @@ pub mod requests { "getroute" } } + /// if specified, then only the forwards with the given status are returned #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ListforwardsStatus { #[serde(rename = "offered")] @@ -1758,6 +1806,7 @@ pub mod requests { } } + /// if neither *in_channel* nor *out_channel* is specified, it controls ordering. Defaults to `created` #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ListforwardsIndex { #[serde(rename = "created")] @@ -1844,6 +1893,7 @@ pub mod requests { "listoffers" } } + /// to filter the payment by status #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ListpaysStatus { #[serde(rename = "pending")] @@ -2118,6 +2168,7 @@ pub mod requests { "waitblockheight" } } + /// the subsystem to get the next index value from #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum WaitSubsystem { #[serde(rename = "invoices")] @@ -2150,6 +2201,7 @@ pub mod requests { } } + /// the name of the index to get the next value for #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum WaitIndexname { #[serde(rename = "created")] diff --git a/contrib/msggen/msggen/schema.json b/contrib/msggen/msggen/schema.json index cf1f67c5fe87..38871ad24ddc 100644 --- a/contrib/msggen/msggen/schema.json +++ b/contrib/msggen/msggen/schema.json @@ -9,7 +9,7 @@ "properties": { "message": { "type": "hex", - "description": "The raw, hex-encoded, gossip message to add to the local gossip view." + "description": "The raw, hex-encoded, gossip message to add to the local gossip view" } } }, @@ -29,17 +29,20 @@ "added": "v23.11", "properties": { "satoshi": { - "type": "msat" - }, - "locktime": { - "type": "u32" + "type": "msat", + "description": "the satoshi value of the output. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" }, "initialpsbt": { "type": "string", - "description": "the (optional) base 64 encoded PSBT to begin with. If not specified, one will be generated automatically" + "description": "base 64 encoded PSBT to add the output to. If not specified, one will be generated automatically" + }, + "locktime": { + "type": "u32", + "description": "if not set, it is set to a recent block height (if no initial psbt is specified)" }, "destination": { - "type": "string" + "type": "string", + "description": "if it is not set, an internal address is generated" } } }, @@ -87,11 +90,11 @@ "paidinvoices", "expiredinvoices" ], - "description": "What subsystem to clean" + "description": "What subsystem to clean. Currently supported subsystems are:\t* `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`).\t* `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`).\t* `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`).\t* `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`).\t* `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`).\t* `paidinvoices`: invoices which were paid (`paid` in listinvoices `status)" }, "age": { "type": "u64", - "description": "How many seconds old an entry must be to delete it" + "description": "non-zero number in seconds. How many seconds old an entry must be to delete it" } } }, @@ -235,7 +238,7 @@ "paidinvoices", "expiredinvoices" ], - "description": "What subsystem to ask about" + "description": "What subsystem to ask about. Currently supported subsystems are:\t* `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`).\t* `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`).\t* `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`).\t* `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`).\t* `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`).\t* `paidinvoices`: invoices which were paid (`paid` in listinvoices `status)" } } }, @@ -659,7 +662,7 @@ "properties": { "enable": { "type": "boolean", - "description": "Whether to enable or disable transaction batching" + "description": "whether to enable or disable transaction batching. Defaults to *False*" } } }, @@ -1339,15 +1342,15 @@ "properties": { "consolidate_fees": { "type": "boolean", - "description": "A brief description about consolidate_fees" + "description": "if true, we emit a single, consolidated event for any onchain-fees for a txid and account. Otherwise, events for every update to the onchain fee calculation for this account and txid will be printed. Defaults to true. Note that this means that the events emitted are non-stable, i.e. calling **listincome** twice may result in different onchain fee events being emitted, depending on how much information we've logged for that transaction" }, "start_time": { "type": "u32", - "description": "Filters the events after the time" + "description": "UNIX timestamp (in seconds) that filters events after the provided timestamp. Defaults to zero" }, "end_time": { "type": "u32", - "description": "Filters the events up to the timestamp" + "description": "UNIX timestamp (in seconds) that filters events up to and at the provided timestamp. Defaults to max-int" } } }, @@ -1506,15 +1509,15 @@ "properties": { "message": { "type": "string", - "description": "Message to be checked against the signature." + "description": "Message to be checked against the signature" }, "zbase": { "type": "string", - "description": "The Zbase32 encoded signature to verify." + "description": "The Zbase32 encoded signature to verify" }, "pubkey": { "type": "pubkey", - "description": "The Zbase32 encoded signature to verify." + "description": "The Zbase32 encoded signature to verify" } } }, @@ -1599,34 +1602,34 @@ "properties": { "id": { "type": "string", - "description": "peer id, channel id or short_channel_id" + "description": "peer id, channel id or short_channel_id. If the given *id* is a peer ID (66 hex digits as a string), then it applies to the active channel of the direct peer corresponding to the given peer ID. If the given *id* is a channel ID (64 hex digits as a string, or the short channel ID *blockheight:txindex:outindex* form), then it applies to that channel" }, "unilateraltimeout": { "type": "u32", - "description": "" + "description": "if it is not zero, the command will unilaterally close the channel when that number of seconds is reached. If *unilateraltimeout* is zero, then the command will wait indefinitely until the peer is online and can negotiate a mutual close. The default is 2 days (172800 seconds)" }, "destination": { "type": "string", - "description": "" + "description": "any Bitcoin bech32 type. If it isn't specified, the default is a Core Lightning wallet address. If the peer hasn't offered the option_shutdown_anysegwit` feature, then taproot addresses (or other v1+ segwit) are not allowed. Tell your friends to upgrade!" }, "fee_negotiation_step": { "type": "string", - "description": "" + "description": "it controls how closing fee negotiation is performed assuming the peer proposes a fee that is different than our estimate. (Note that modern peers use the quick-close protocol which does not allow negotiation: see *feerange* instead)\tOn every negotiation step we must give up some amount from our proposal towards the peer's proposal. This parameter can be an integer in which case it is interpreted as number of satoshis to step at a time. Or it can be an integer followed by `%` to designate a percentage of the interval to give up. A few examples, assuming the peer proposes a closing fee of 3000 satoshi and our estimate shows it must be 4000:\t- `10`: our next proposal will be 4000-10=3990.\t- `10%`: our next proposal will be 4000-(10% of (4000-3000))=3900.\t- '1': our next proposal will be 3999. This is the most extreme case when we insist on our fee as much as possible.\t- `100%`: our next proposal will be 3000. This is the most relaxed case when we quickly accept the peer's proposal.\tThe default is `50%`" }, "wrong_funding": { "type": "outpoint", - "description": "" + "description": "it can only be specified if both sides have offered the `shutdown_wrong_funding` feature (enabled by the **experimental-shutdown-wrong-funding** option): it must be a transaction id followed by a colon then the output number. Instead of negotiating a shutdown to spend the expected funding transaction, the shutdown transaction will spend this output instead. This is only allowed if this peer opened the channel and the channel is unused: it can rescue openings which have been manually miscreated" }, "force_lease_closed": { "type": "boolean", - "description": "" + "description": "if the channel has funds leased to the peer (option_will_fund), we prevent initiation of a mutual close unless this flag is passed in. Defaults to false" }, "feerange": { "type": "array", "items": { "type": "feerate" }, - "description": "" + "description": "an optional array [ *min*, *max* ], indicating the minimum and maximum feerates to offer: the peer will obey these if it supports the quick-close protocol. *slow* and *unilateral_close* are the defaults.\tNote that the maximum fee will be capped at the final commitment transaction fee (unless the experimental anchor-outputs option is negotiated)" } } }, @@ -1896,7 +1899,7 @@ "enum": [ "readonly" ], - "description": "readonly string to indicate standard readonly restrictions." + "description": "readonly string to indicate standard readonly restrictions" } ] } @@ -1987,15 +1990,15 @@ "properties": { "id": { "type": "string", - "description": "" + "description": "the target node's public key. As a convenience, *id* may be of the form *id@host* or *id@host:port*. In this case, the *host* and *port* parameters must be omitted. This can fail if your C-lightning node is a fresh install that has not connected to any peers yet (your node has no gossip yet), or if the target *id* is a fresh install that has no channels yet (nobody will gossip about a node until it has one published channel)" }, "host": { "type": "string", - "description": "The hostname of the node." + "description": "the peer's hostname or IP address.\tIf *host* is not specified (or doesn't work), the connection will be attempted to an IP belonging to *id* obtained through gossip with other already connected peers.\tIf *host* begins with a `/` it is interpreted as a local path and the connection will be made to that local socket (see **bind-addr** in lightningd-config(5))" }, "port": { "type": "u16", - "description": "Port to try connecting to" + "description": "the peer's port number. If not specified, the *port* depends on the current network:\t- bitcoin **mainnet**: 9735.\t- bitcoin **testnet**: 19735.\t- bitcoin **signet**: 39735.\t- bitcoin **regtest**: 19846" } } }, @@ -2124,8 +2127,15 @@ "description": "" }, "label": { - "type": "string", - "description": "" + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "description": "a unique string or number (which is treated as a string, so `01` is different from `1`); it is never revealed to other nodes on the lightning network, but it can be used to query the status of this invoice" }, "preimage": { "type": "hex", @@ -2249,7 +2259,7 @@ "properties": { "hops": { "type": "array", - "description": "", + "description": "a JSON list of dicts, each specifying a node and the payload destined for that node", "items": { "type": "object", "additionalProperties": false, @@ -2259,23 +2269,27 @@ ], "properties": { "pubkey": { - "type": "pubkey" + "type": "pubkey", + "description": "node pubkey" }, "payload": { - "type": "hex" + "type": "hex", + "description": "payload to be sent to the node" } } } }, "assocdata": { "type": "hex", - "description": "" + "description": "the associated data that the onion should commit to. If the onion is to be used to send a payment later it MUST match the `payment_hash` of the payment in order to be valid" }, "session_key": { - "type": "secret" + "type": "secret", + "description": "can be used to specify a secret that is used to generate the shared secrets used to encrypt the onion for each hop. It should only be used for testing or if a specific shared secret is important. If not specified it will be securely generated internally, and the shared secrets will be returned" }, "onion_size": { - "type": "u16" + "type": "u16", + "description": "a size different from the default payment onion (1300 bytes). May be used for custom protocols like trampoline routing" } } }, @@ -2330,7 +2344,7 @@ "enum": [ "readonly" ], - "description": "readonly string to indicate standard readonly restrictions." + "description": "readonly string to indicate standard readonly restrictions" } ] } @@ -2368,10 +2382,11 @@ ], "properties": { "key": { + "description": "a key can either have children or a value, never both: parents are created and removed automatically", "oneOf": [ { "type": "array", - "description": "key is an array of values (though a single value is treated as a one-element array), to form a heirarchy. Using the first element of the key as the plugin name (e.g. [ 'summary' ]) is recommended. A key can either have children or a value, never both: parents are created and removed automatically.", + "description": "an array of values to form a hierarchy (though a single value is treated as a one-element array). Using the first element of the key as the plugin name (e.g. `[ 'summary' ]`) is recommended", "items": { "type": "string" } @@ -2383,26 +2398,26 @@ }, "string": { "type": "string", - "description": "" + "description": "data to be saved in string format" }, "hex": { "type": "hex", - "description": "" + "description": "data to be saved in hex format" }, "mode": { "type": "string", + "description": "\t- `must-create`: fails if it already exists.\t- `must-replace`: fails if it doesn't already exist.\t- `create-or-replace`: never fails.\t- `must-append`: must already exist, append this to what's already there.\t- `create-or-append`: append if anything is there, otherwise create.\tDefault is `must-create`", "enum": [ "must-create", "must-replace", "create-or-replace", "must-append", "create-or-append" - ], - "description": "" + ] }, "generation": { "type": "u64", - "description": "If specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with mode \u201cmust-replace\u201d or \u201cmust-append\u201d." + "description": "if specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with *mode* `must-replace` or `must-append`" } } }, @@ -2446,7 +2461,7 @@ "oneOf": [ { "type": "array", - "description": "key is an array of values (though a single value is treated as a one-element array). Used as the starting point to traverse the datastore.", + "description": "key is an array of values (though a single value is treated as a one-element array). Used as the starting point to traverse the datastore", "items": { "type": "string" } @@ -2496,7 +2511,8 @@ ], "properties": { "string": { - "type": "string" + "type": "string", + "description": "value to be decoded\t- a *bolt11* or *bolt12* string (optionally prefixed by `lightning:` or `LIGHTNING:`) as specified by the BOLT 11 and BOLT 12 specifications.\t- a *rune* as created by lightning-commando-rune(7).\t- an *emergency_recover* string generated by hsmtool like `lightning-hsmtool getemergencyrecover `. It holds `emergency.recover` contents and starts with `clnemerg1`" } } }, @@ -4058,10 +4074,12 @@ ], "properties": { "bolt11": { - "type": "string" + "type": "string", + "description": "bolt11 invoice to decode" }, "description": { - "type": "string" + "type": "string", + "description": "description of the invoice to decode" } } }, @@ -4243,7 +4261,7 @@ "oneOf": [ { "type": "array", - "description": "key is an array of values (though a single value is treated as a one-element array), to form a heirarchy. Using the first element of the key as the plugin name (e.g. [ 'summary' ]) is recommended. A key can either have children or a value, never both: parents are created and removed automatically.", + "description": "key is an array of values (though a single value is treated as a one-element array), to form a heirarchy. Using the first element of the key as the plugin name (e.g. [ 'summary' ]) is recommended. A key can either have children or a value, never both: parents are created and removed automatically", "items": { "type": "string" } @@ -4255,7 +4273,7 @@ }, "generation": { "type": "u64", - "description": "If specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with mode \u201cmust-replace\u201d or \u201cmust-append\u201d." + "description": "If specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with mode \u201cmust-replace\u201d or \u201cmust-append\u201d" } } }, @@ -4296,7 +4314,7 @@ "properties": { "maxexpirytime": { "type": "u64", - "description": "" + "description": "invoice expiry time in seconds. If not specified then all expired invoices are deleted" } } }, @@ -4310,16 +4328,23 @@ "delforward.request.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", - "required": [], + "required": [ + "in_channel", + "in_htlc_id", + "status" + ], "properties": { "in_channel": { - "type": "short_channel_id" + "type": "short_channel_id", + "description": "only the matching forwards on the given inbound channel are deleted.\tNote: for **listforwards** entries without an *in_htlc_id* entry (no longer created in v22.11, but can exist from older versions), a value of 18446744073709551615 can be used, but then it will delete *all* entries without *in_htlc_id* for this *in_channel* and *status*" }, "in_htlc_id": { - "type": "u64" + "type": "u64", + "description": "the unique HTLC id the sender gave this (not present if incoming channel was closed before ugprade to v22.11)" }, "status": { "type": "string", + "description": "the status of the forward to delete. You cannot delete forwards which have status *offered* (i.e. are currently active)", "enum": [ "settled", "local_failed", @@ -4347,17 +4372,17 @@ "label": { "oneOf": [ { - "type": "string", - "description": "" + "type": "string" }, { - "type": "integer", - "description": "" + "type": "u64" } - ] + ], + "description": "label of the invoice to be deleted" }, "status": { "type": "string", + "description": "label of the invoice to be deleted. The caller should be particularly aware of the error case caused by the *status* changing just before this command is invoked!", "enum": [ "paid", "expired", @@ -4365,7 +4390,8 @@ ] }, "desconly": { - "type": "boolean" + "type": "boolean", + "description": "if set to True, the invoice is not deleted, but has its description removed (this can save space with very large descriptions, as would be used with lightning-invoice(7) *deschashonly*" } } }, @@ -4572,20 +4598,23 @@ "properties": { "payment_hash": { "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" + "description": "the unique identifier of a payment" }, "status": { "type": "string", + "description": "expected status of the payment. Only deletes if the payment status matches. Deleting a `pending` payment will return an error", "enum": [ "complete", "failed" ] }, "partid": { - "type": "u64" + "type": "u64", + "description": "specific partid to delete (must be paired with *groupid*)" }, "groupid": { - "type": "u64" + "type": "u64", + "description": "specific groupid to delete (must be paired with *partid*)" } } }, @@ -4695,13 +4724,14 @@ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, + "added": "v22.11", "required": [ "invreq_id" ], "properties": { "invreq_id": { "type": "string", - "description": "" + "description": "a specific invoice can be disabled by providing the `invreq_id`, which is presented by lightning-invoicerequest(7)" } } }, @@ -4811,10 +4841,12 @@ ], "properties": { "id": { - "type": "pubkey" + "type": "pubkey", + "description": "the public key of the peer to terminate the connection.\tIt can be discovered in the output of the listpeers command, which returns a set of peers:\t{\t\t'peers': [\t\t\t{\t\t\t'id': '0563aea81...',\t\t\t'connected': true,\t\t\t...\t\t}\t\t]\t}" }, "force": { - "type": "boolean" + "type": "boolean", + "description": "if set to True, it will disconnect even with an active channel" } } }, @@ -4858,6 +4890,7 @@ "properties": { "style": { "type": "string", + "description": "\t*perkw* - provide feerate in units of satoshis per 1000 weight (e.g. the minimum fee is usually `253perkw`)\t*perkb* - provide feerate in units of satoshis per 1000 virtual bytes (eg. the minimum fee is usually `1000perkb`)", "enum": [ "perkb", "perkw" @@ -5113,35 +5146,35 @@ "properties": { "offer": { "type": "string", - "description": "" + "description": "offer string to get an actual invoice that can be paid" }, "amount_msat": { "type": "msat", - "description": "amount_msat is required if the offer does not specify an amount at all, otherwise it is optional (but presumably if you set it to less than the offer, you will get an error from the issuer)." + "description": "required if the offer does not specify an amount at all, otherwise it is optional (but presumably if you set it to less than the offer, you will get an error from the issuer)" }, "quantity": { "type": "u64", - "description": "quantity is is required if the offer specifies quantity_max, otherwise it is not allowed." + "description": "required if the offer specifies quantity_max, otherwise it is not allowed" }, "recurrence_counter": { "type": "u64", - "description": "recurrence_counter is required if the offer specifies recurrence, otherwise it is not allowed. recurrence_counter should first be set to 0, and incremented for each successive invoice in a given series." + "description": "required if the offer specifies recurrence, otherwise it is not allowed. recurrence_counter should first be set to 0, and incremented for each successive invoice in a given series" }, "recurrence_start": { "type": "number", - "description": "recurrence_start is required if the offer specifies recurrence_base with start_any_period set, otherwise it is not allowed. It indicates what period number to start at." + "description": "required if the offer specifies recurrence_base with start_any_period set, otherwise it is not allowed. It indicates what period number to start at" }, "recurrence_label": { "type": "string", - "description": "recurrence_label is required if recurrence_counter is set, and otherwise is not allowed. It must be the same as prior fetchinvoice calls for the same recurrence, as it is used to link them together." + "description": "required if recurrence_counter is set, and otherwise is not allowed. It must be the same as prior fetchinvoice calls for the same recurrence, as it is used to link them together" }, "timeout": { "type": "number", - "description": "timeout is an optional timeout; if we don't get a reply before this we fail (default, 60 seconds)." + "description": "if we don't get a reply before this we fail (default, 60 seconds)" }, "payer_note": { "type": "string", - "description": "payer_note is an optional payer note to ask the issuer to include in the fetched invoice." + "description": "to ask the issuer to include in the fetched invoice" } } }, @@ -5233,34 +5266,43 @@ "properties": { "id": { "type": "pubkey", - "description": "id is the peer id obtained from connect." + "description": "id is the peer id obtained from connect" }, "amount": { - "type": "msat_or_all" + "type": "msat_or_all", + "description": "the amount in satoshis taken from the internal wallet to fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). The string *all* can be used to specify all available funds (or 16777215 satoshi if more is available and large channels were not negotiated with the peer). Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The value cannot be less than the dust limit, currently set to 546, nor more than 16777215 satoshi (unless large channels were negotiated with the peer)" }, "feerate": { - "type": "feerate" + "type": "feerate", + "description": "used for the opening transaction and (unless *option_anchors_zero_fee_htlc_tx* is negotiated), as initial feerate for commitment and HTLC transactions (see NOTES in lightning-feerates(7)). The default is *normal*" }, "announce": { - "type": "boolean" + "type": "boolean", + "description": "whether to announce this channel or not. An unannounced channel is considered private. Defaults to *True*" }, "minconf": { - "type": "u32" + "type": "u32", + "description": "the minimum number of confirmations that used outputs should have. Default is 1" }, "push_msat": { - "type": "msat" + "type": "msat", + "description": "the amount of millisatoshis to push to the channel peer at open. Note that this is a gift to the peer -- these satoshis are added to the initial balance of the peer at channel start and are largely unrecoverable once pushed" }, "close_to": { - "type": "string" + "type": "string", + "description": "a Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. Returns `close_to` set to closing script iff is negotiated" }, "request_amt": { - "type": "msat" + "type": "msat", + "description": "an amount of liquidity you'd like to lease from the peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*" }, "compact_lease": { - "type": "string" + "type": "string", + "description": "a compact represenation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel" }, "utxos": { "type": "array", + "description": "the utxos to be used to fund the channel, as an array of `txid:vout`", "items": { "type": "outpoint" } @@ -5271,7 +5313,7 @@ }, "reserve": { "type": "msat", - "description": "The amount we want the peer to maintain on its side" + "description": "the amount we want the peer to maintain on its side of the channel. Default is 1% of the funding amount. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" }, "channel_type": { "added": "v24.02", @@ -5369,7 +5411,7 @@ "properties": { "id": { "type": "pubkey", - "description": "the node id of the remote peer with which to cancel" + "description": "node id of the remote peer with which to cancel" } } }, @@ -5398,11 +5440,11 @@ "properties": { "id": { "type": "pubkey", - "description": "id is the node id of the remote peer." + "description": "node id of the remote peer" }, "psbt": { "type": "string", - "description": "the transaction to use for funding (does not need to be signed but must be otherwise complete)" + "description": "transaction to use for funding (does not need to be signed but must be otherwise complete)" } } }, @@ -5441,27 +5483,27 @@ "properties": { "id": { "type": "pubkey", - "description": "id is the peer id obtained from connect." + "description": "node id of the remote peer" }, "amount": { - "type": "msat_or_all", - "description": "The amount that the channel will be funded." + "type": "sat", + "description": "satoshi value that the channel will be funded at. This value MUST be accurate, otherwise the negotiated commitment transactions will not encompass the correct channel value" }, "feerate": { "type": "feerate", - "description": "Sets the feerate for the subsequent commitment transaction." + "description": "feerate for subsequent commitment transactions: see **fundchannel**. Note that this is ignored for channels with *option_anchors_zero_fee_htlc_tx* (we always use a low commitment fee for these)" }, "announce": { "type": "boolean", - "description": "Whether or not to announce the channel." + "description": "whether or not to announce this channel" }, "close_to": { "type": "string", - "description": "A bitcoin address to which the channel funds should be sent to on close." + "description": "bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. Returns `close_to` set to closing script iff is negotiated" }, "push_msat": { "type": "msat", - "description": "The amount of millisatoshis to push to the channel at open. This is a gift to the peer." + "description": "amount of millisatoshis to push to the channel peer at open. Note that this is a gift to the peer -- these satoshis are added to the initial balance of the peer at channel start and are largely unrecoverable once pushed" }, "mindepth": { "type": "u32", @@ -5731,37 +5773,46 @@ ], "properties": { "satoshi": { - "type": "msat_or_all" + "type": "msat_or_all", + "description": "the minimum satoshi value of the output(s) needed (or the string `all` meaning use all unreserved inputs). If a value, it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" }, "feerate": { - "type": "feerate" + "type": "feerate", + "description": "used for the transaction as initial feerate. The default is *normal*" }, "startweight": { - "type": "u32" + "type": "u32", + "description": "the weight of the transaction before *fundpsbt* has added any inputs" }, "minconf": { - "type": "u32" + "type": "u32", + "description": "the minimum number of confirmations that used outputs should have. Default is 1" }, "reserve": { "type": "u32", - "description": "reserve is a number: if non-zero number then reserveinputs is called (successfully, with exclusive true) on the returned PSBT for this number of blocks (default: 72)." + "description": "if not zero, then *reserveinputs* is called (successfully, with *exclusive* true) on the returned PSBT for this number of blocks. Defaults to 72 blocks if unspecified" }, "locktime": { - "type": "u32" + "type": "u32", + "description": "the locktime of the transaction. if not set, it is set to a recent block height" }, "min_witness_weight": { - "type": "u32" + "type": "u32", + "description": "minimum weight to use for a UTXO's witness. If the actual witness weight is greater than the provided minimum, the actual witness weight will be used" }, "excess_as_change": { - "type": "boolean" + "type": "boolean", + "description": "flag to add a change output for the excess sats" }, "nonwrapped": { "added": "v23.02", - "type": "boolean" + "type": "boolean", + "description": "to signal to filter out any p2sh-wrapped inputs from funding this PSBT" }, "opening_anchor_channel": { "added": "v23.08", - "type": "boolean" + "type": "boolean", + "description": "to signel that it needs emergency reserve for anchors so that we can lowball our commitment tx fees, and min-emergency-msat for reserving some sats for closing anchor channels" } } }, @@ -6338,38 +6389,38 @@ "properties": { "id": { "type": "pubkey", - "description": "" + "description": "node pubkey to find the best route for the payment" }, "amount_msat": { "type": "msat", - "description": "" + "description": "amount to send. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. The 0 value is special: it ignores any *htlc_minimum_msat* setting on channels, and simply returns a possible route (if any) which is useful for simple probing" }, "riskfactor": { "type": "u64", - "description": "" + "description": "a non-negative floating-point field controls this tradeoff; it is the annual cost of your funds being stuck (as a percentage).\tFor example, if you thought the convenience of keeping your funds liquid (not stuck) was worth 20% per annum interest, *riskfactor* would be 20.\tIf you didn't care about risk, *riskfactor* would be zero" }, "cltv": { "type": "u32", - "description": "" + "description": "cltv-blocks to spare. Default is 9" }, "fromid": { "type": "pubkey", - "description": "" + "description": "the node to start the route from. Default is this node" }, "fuzzpercent": { "type": "u32", - "description": "" + "description": "used to distort fees to provide some randomization to the route generated, but it was not properly implemented and is ignored" }, "exclude": { "type": "array", - "description": "", + "description": "a JSON array of short-channel-id/direction (e.g. ['564334x877x1/0', '564195x1292x0/1' ]) or node-id which should be excluded from consideration for routing. The default is not to exclude any channels or nodes. Note if the source or destination is excluded, the command result is undefined", "items": { "type": "string" } }, "maxhops": { "type": "u32", - "description": "" + "description": "the maximum number of channels to return. Default is 20" } } }, @@ -6493,63 +6544,65 @@ "properties": { "amount_msat": { "type": "msat_or_any", - "description": "" - }, - "description": { - "type": "string", - "description": "" + "description": "the string `any`, which creates an invoice that can be paid with any amount. Otherwise it is a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*" }, "label": { "oneOf": [ { - "type": "string", - "description": "" + "type": "string" }, { - "type": "integer", - "description": "" + "type": "integer" } - ] + ], + "description": "a unique string or number (which is treated as a string, so `01` is different from `1`); it is never revealed to other nodes on the lightning network, but it can be used to query the status of this invoice" + }, + "description": { + "type": "string", + "description": "a short description of purpose of payment, e.g. *1 cup of coffee*. This value is encoded into the BOLT11 invoice and is viewable by any node you send this invoice to (unless *deschashonly* is true as described below). It must be UTF-8, and cannot use *\\u* JSON escape codes" }, "expiry": { "type": "u64", - "description": "" + "description": "the time the invoice is valid for, in seconds. If no value is provided the default of 604800 (1 week) is used" }, "fallbacks": { "type": "array", - "description": "", + "description": "one or more fallback addresses to include in the invoice (in order from most-preferred to least): note that these arrays are not currently tracked to fulfill the invoice", "items": { "type": "string" } }, "preimage": { "type": "hex", - "description": "" + "description": "a 64-digit hex string to be used as payment preimage for the created invoice. By default, if unspecified, lightningd will generate a secure pseudorandom preimage seeded from an appropriate entropy source on your system. **IMPORTANT**: if you specify the *preimage*, you are responsible, to ensure appropriate care for generating using a secure pseudorandom generator seeded with sufficient entropy, and keeping the preimage secret. This parameter is an advanced feature intended for use with cutting-edge cryptographic protocols and should not be used unless explicitly needed" }, "exposeprivatechannels": { + "description": "if specified, it overrides the default route hint logic, which will use unpublished channels only if there are no published channels", "oneOf": [ { "type": "boolean", - "description": "" + "description": "if *True* unpublished channels are always considered as a route hint candidate; if *False*, never" }, { "type": "array", + "description": "array of short channel ids (or a remote alias), only those specific channels will be considered candidates, even if they are public or dead-ends", "items": { "type": "short_channel_id" } }, { - "type": "short_channel_id" + "type": "short_channel_id", + "description": "if it is a short channel id (e.g. *1x1x3*), only this specific channel will be considered candidate, even if it is public or dead-end" } ] }, "cltv": { "type": "u32", - "description": "" + "description": "if specified, sets the *min_final_cltv_expiry* for the invoice. Otherwise, it's set to the parameter **cltv-final**" }, "deschashonly": { "type": "boolean", - "description": "" + "description": "if True, then the bolt11 returned contains a hash of the *description*, rather than the *description* itself: this allows much longer descriptions, but they must be communicated via some other mechanism. Defaults to False" } } }, @@ -6620,27 +6673,27 @@ "properties": { "amount": { "type": "msat", - "description": "" + "description": "a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*" }, "description": { "type": "string", - "description": "" + "description": "a short description of purpose of the payment, e.g. *ATM withdrawl*. This value is encoded into the resulting `invoice_request` and is viewable by anyone you expose it to. It must be UTF-8, and cannot use *\\u* JSON escape codes" }, "issuer": { "type": "string", - "description": "" + "description": "who is issuing it (i.e. you) if appropriate" }, "label": { "type": "string", - "description": "" + "description": "an internal-use name for the offer, which can be any UTF-8 string" }, "absolute_expiry": { "type": "u64", - "description": "" + "description": "the time the offer is valid until, in seconds since the first day of 1970 UTC. If not set, the `invoice_request` remains valid (though it can be deactivated by the issuer of course). This is encoded in the `invoice_request`" }, "single_use": { "type": "boolean", - "description": "" + "description": "indicates that the `invoice_request` is only valid once; we may attempt multiple payments, but as soon as one is successful no more invoices are accepted (i.e. only one person can take the money). Defaults to True" } } }, @@ -6698,25 +6751,32 @@ ], "properties": { "destination": { - "type": "pubkey" + "type": "pubkey", + "description": "the 33 byte, hex-encoded, node ID of the node that the payment should go to" }, "amount_msat": { - "type": "msat" + "type": "msat", + "description": "a whole number, or a whole number with suffix `msat` or `sat`, or a three decimal point number with suffix `sat`, or an 1 to 11 decimal point number suffixed by `btc`" }, "label": { - "type": "string" + "type": "string", + "description": "used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7)" }, "maxfeepercent": { - "type": "number" + "type": "number", + "description": "limits the money paid in fees as percentage of the total amount that is to be transferred, and defaults to *0.5*" }, "retry_for": { - "type": "u32" + "type": "u32", + "description": "until *retry_for* seconds passes, the command will keep finding routes and retrying the payment. However, a payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case. Defaults to 60 seconds" }, "maxdelay": { - "type": "u32" + "type": "u32", + "description": "number of blocks the payment may be delayed" }, "exemptfee": { - "type": "msat" + "type": "msat", + "description": "used for tiny payments which would be dominated by the fee leveraged by forwarding nodes. Setting `exemptfee` allows the `maxfeepercent` check to be skipped on fees that are smaller than *exemptfee*. Defaults to 5000 millisatoshi" }, "routehints": { "type": "array", @@ -6755,7 +6815,8 @@ "extratlvs": { "type": "object", "additionalProperties": true, - "required": [] + "required": [], + "description": "dictionary of additional fields to insert into the final tlv. The format is 'fieldnumber': 'hexstring'" } } }, @@ -6822,15 +6883,15 @@ "properties": { "short_channel_id": { "type": "short_channel_id", - "description": "If short_channel_id is a short channel id, then only known channels with a matching short_channel_id are returned. Otherwise, it must be null." + "description": "if short_channel_id is a short channel id, then only known channels with a matching short_channel_id are returned. Otherwise, it must be null" }, "source": { "type": "pubkey", - "description": "If source is a node id, then only channels leading from that node id are returned." + "description": "if source is a node id, then only channels leading from that node id are returned" }, "destination": { "type": "pubkey", - "description": "If destination is a node id, then only channels leading to that node id are returned." + "description": "if destination is a node id, then only channels leading to that node id are returned" } } }, @@ -6944,7 +7005,7 @@ "properties": { "id": { "type": "pubkey", - "description": "If supplied, limits the channels to just the peer with the given ID, if it exists." + "description": "if no *id* is supplied, then channel data on all historical channels are given. Supplying *id* will filter the results to only match channels to that peer. Note that prior to v23.05, old peers were forgotten" } } }, @@ -9157,14 +9218,13 @@ "oneOf": [ { "type": "array", - "description": "key is an array of values (though a single value is treated as a one-element array), to form a heirarchy. Using the first element of the key as the plugin name (e.g. [ 'summary' ]) is recommended. A key can either have children or a value, never both: parents are created and removed automatically.", + "description": "all immediate children of the *key* (or root children) are returned.\t\tUsing the first element of the key as the plugin name (e.g. `[ 'summary' ]`) is recommended.\t\tAn array of values to form a hierarchy (though a single value is treated as a one-element array)", "items": { "type": "string" } }, { - "type": "string", - "description": "" + "type": "string" } ] } @@ -9218,6 +9278,7 @@ "properties": { "status": { "type": "string", + "description": "if specified, then only the forwards with the given status are returned", "enum": [ "offered", "settled", @@ -9226,10 +9287,12 @@ ] }, "in_channel": { - "type": "short_channel_id" + "type": "short_channel_id", + "description": "only the matching forwards on the given inbound channel are returned" }, "out_channel": { - "type": "short_channel_id" + "type": "short_channel_id", + "description": "only the matching forwards on the given outbount channel are returned" }, "index": { "type": "string", @@ -9238,17 +9301,17 @@ "created", "updated" ], - "description": "" + "description": "if neither *in_channel* nor *out_channel* is specified, it controls ordering. Defaults to `created`" }, "start": { "type": "u64", "added": "v23.11", - "description": "" + "description": "if `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)" }, "limit": { "type": "u32", "added": "v23.11", - "description": "" + "description": "if `index` is specified, `limit` can be used to specify the maximum number of entries to return" } } }, @@ -9527,7 +9590,7 @@ "properties": { "spent": { "type": "boolean", - "description": "Should outputs that are already spent be included in the result?" + "description": "if True, then the *outputs* will include spent outputs in addition to the unspent ones. Default is False" } } }, @@ -9813,7 +9876,7 @@ "properties": { "id": { "type": "string", - "description": "channel id or short_channel_id" + "description": "a short channel id (e.g. 1x2x3) or full 64-byte hex channel id, it will only list htlcs for that channel (which must be known)" } } }, @@ -9908,11 +9971,11 @@ "properties": { "invreq_id": { "type": "string", - "description": "" + "description": "a specific invoice can be queried by providing the `invreq_id`, which is presented by lightning-invoicerequest(7), or can be calculated from a bolt12 invoice" }, "active_only": { "type": "boolean", - "description": "" + "description": "if it is *True* then only active invoice requests are returned. Default is *False*" } } }, @@ -9975,26 +10038,25 @@ "label": { "oneOf": [ { - "type": "string", - "description": "" + "type": "string" }, { - "type": "integer", - "description": "" + "type": "integer" } - ] + ], + "description": "a label used a the creation of the invoice to get a specific invoice" }, "invstring": { "type": "string", - "description": "" + "description": "the string value to query a specific invoice" }, "payment_hash": { "type": "hex", - "description": "" + "description": "a payment_hash of the invoice to get the details of a specific invoice" }, "offer_id": { "type": "string", - "description": "" + "description": "a local `offer_id` the invoice was issued for a specific invoice details" }, "index": { "type": "string", @@ -10003,17 +10065,17 @@ "created", "updated" ], - "description": "" + "description": "if neither *in_channel* nor *out_channel* is specified, it controls ordering. Defaults to `created`" }, "start": { "type": "u64", "added": "v23.08", - "description": "" + "description": "if `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)" }, "limit": { "type": "u32", "added": "v23.08", - "description": "" + "description": "if `index` is specified, `limit` can be used to specify the maximum number of entries to return" } } }, @@ -10199,7 +10261,8 @@ "additionalProperties": false, "properties": { "id": { - "type": "pubkey" + "type": "pubkey", + "description": "The public key of the node to list" } } }, @@ -10475,13 +10538,16 @@ "additionalProperties": false, "properties": { "bolt11": { - "type": "string" + "type": "string", + "description": "bolt11 string to get the payment details" }, "payment_hash": { - "type": "hash" + "type": "hash", + "description": "payment hash to get the payment details" }, "status": { "type": "string", + "description": "to filter the payment by status", "enum": [ "pending", "complete", @@ -10645,7 +10711,7 @@ "properties": { "id": { "type": "pubkey", - "description": "If supplied, limits the channels to just the peer with the given ID, if it exists." + "description": "If supplied, limits the channels to just the peer with the given ID, if it exists" } } }, @@ -11782,11 +11848,17 @@ "properties": { "id": { "type": "pubkey", - "description": "If supplied, limits the result to just the peer with the given ID, if it exists." + "description": "if supplied, limits the result to just the peer with the given ID, if it exists" }, "level": { "type": "string", - "description": "Supplying level will show log entries related to that peer at the given log level. Valid log levels are \u201cio\u201d, \u201cdebug\u201d, \u201cinfo\u201d, and \u201cunusual\u201d." + "description": "supplying level will show log entries related to that peer at the given log level", + "enum": [ + "io", + "debug", + "info", + "unusual" + ] } } }, @@ -12931,10 +13003,12 @@ "additionalProperties": false, "properties": { "bolt11": { - "type": "string" + "type": "string", + "description": "bolt11 invoice" }, "payment_hash": { - "type": "hash" + "type": "hash", + "description": "the hash of the payment_preimage" }, "status": { "type": "string", @@ -12942,7 +13016,8 @@ "pending", "complete", "failed" - ] + ], + "description": "Whether the invoice has been paid, pending, or failed" }, "index": { "type": "string", @@ -12951,17 +13026,17 @@ "created", "updated" ], - "description": "" + "description": "if neither bolt11 or payment_hash is specified, `index` controls ordering, by `created` (default) or `updated`" }, "start": { "type": "u64", "added": "v23.11", - "description": "" + "description": "if `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)" }, "limit": { "type": "u32", "added": "v23.11", - "description": "" + "description": "if `index` is specified, `limit` can be used to specify the maximum number of entries to return" } } }, @@ -13379,11 +13454,11 @@ "properties": { "hex": { "type": "hex", - "description": "This will be used for deriving the secret" + "description": "One of `hex` or `string` must be specified: `hex` can be any hex data" }, "string": { "type": "string", - "description": "This will be used for deriving the secret" + "description": "One of `hex` or `string` must be specified: `string` is a UTF-8 string interpreted literally" } } }, @@ -13411,6 +13486,7 @@ "properties": { "destinations": { "type": "array", + "description": "there must be at least one entry in *destinations*; it cannot be an empty array", "items": { "type": "object", "additionalProperties": false, @@ -13420,60 +13496,67 @@ ], "properties": { "id": { - "type": "string" + "type": "string", + "description": "node ID, with an optional *@host:port* appended to it in a manner understood by **connect**; see lightning-connect(7). Each entry in the *destinations* array must have a unique node *id*. If not already connected, **multifundchannel** will automatically attempt to connect to the node" }, "amount": { - "type": "msat_or_all" + "type": "msat", + "description": "amount in satoshis taken from the internal wallet to fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). The string *all* can be used to specify all available funds (or 16,777,215 satoshi if more is available and large channels were not negotiated with the peer). Otherwise it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The value cannot be less than the dust limit, currently 546 satoshi as of this writing, nor more than 16,777,215 satoshi (unless large channels were negotiated with the peer)" }, "announce": { - "type": "boolean" + "type": "boolean", + "description": "flag that indicates whether to announce the channel with this, default `true`. If set to `false`, the channel is unpublished" }, "push_msat": { - "type": "msat" + "type": "msat", + "description": "amount of millisatoshis to outright give to the node. This is a gift to the peer, and you do not get a proof-of-payment out of this" }, "close_to": { - "type": "string" + "type": "string", + "description": "bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script` Returns `close_to` set to closing script iff is negotiated" }, "request_amt": { - "type": "msat" + "type": "msat", + "description": "amount of liquidity you'd like to lease from peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*" }, "compact_lease": { - "type": "string" + "type": "string", + "description": "compact represenation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel to this destination" }, "mindepth": { - "description": "Number of confirmations required before we consider the channel active", - "type": "u32" + "type": "u32", + "description": "number of confirmations before we consider the channel active" }, "reserve": { "type": "msat", - "description": "The amount we want the peer to maintain on its side" - }, - "channel_type": { - "type": "array", - "items": { - "type": "u32" - } + "description": "amount we want the peer to maintain on its side of the channel. Default is 1% of the funding amount. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" } } } }, "feerate": { - "type": "feerate" + "type": "feerate", + "description": "feerate used for the opening transaction, and if *commitment_feerate* is not set, as initial feerate for commitment and HTLC transactions. See NOTES in lightning-feerates(7) for possible values. The default is *normal*" }, "minconf": { - "type": "u32" + "type": "integer", + "description": "minimum number of confirmations that used outputs should have. Default is 1", + "default": 1 }, "utxos": { "type": "array", "items": { - "type": "outpoint" + "type": "outpoint", + "description": "utxos to be used to fund the channel, as an array of `txid:vout`" } }, "minchannels": { - "type": "u32" + "type": "integer", + "description": "re-attempt funding as long as at least this many peers remain (must not be zero). The **multifundchannel** command will only fail if too many peers fail the funding process" }, "commitment_feerate": { - "type": "feerate" + "type": "feerate", + "description": "initial feerate for commitment and HTLC transactions. See *feerate* for valid values" } } }, @@ -13678,6 +13761,7 @@ "properties": { "addresstype": { "type": "string", + "description": "it specifies the type of address wanted; currently *bech32* (e.g. `tb1qu9j4lg5f9rgjyfhvfd905vw46eg39czmktxqgg` on bitcoin testnet or `bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej` on bitcoin mainnet), or *p2tr* taproot addresses. The special value *all* generates all known address types for the same underlying key. Defaults to *bech32* address", "enum": [ "bech32", "p2tr", @@ -13978,31 +14062,40 @@ ], "properties": { "id": { - "type": "pubkey" + "type": "pubkey", + "description": "node id of the remote peer" }, "amount": { - "type": "msat" + "type": "sat", + "description": "satoshi value that we will contribute to the channel. This value will be _added_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel" }, "initialpsbt": { - "type": "string" + "type": "string", + "description": "funded, incomplete PSBT that specifies the UTXOs and change output for our channel contribution. It can be updated, see `openchannel_update`; *initialpsbt* must have at least one input. Must have the Non-Witness UTXO (PSBT_IN_NON_WITNESS_UTXO) set for every input. An error (code 309) will be returned if this requirement is not met" }, "commitment_feerate": { - "type": "feerate" + "type": "feerate", + "description": "feerate for commitment transactions for non-anchor channels: see **fundchannel**. For anchor channels, it is ignored" }, "funding_feerate": { - "type": "feerate" + "type": "feerate", + "description": "feerate for the funding transaction. Defaults to 'opening' feerate" }, "announce": { - "type": "boolean" + "type": "boolean", + "description": "whether or not to announce this channel" }, "close_to": { - "type": "hex" + "type": "string", + "description": "bitcoin address to which the channel funds should be sent on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`" }, "request_amt": { - "type": "msat" + "type": "msat", + "description": "an amount of liquidity you'd like to lease from the peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*" }, "compact_lease": { - "type": "hex" + "type": "hex", + "description": "a compact represenation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel" }, "channel_type": { "type": "array", @@ -14267,34 +14360,44 @@ ], "properties": { "bolt11": { - "type": "string" + "type": "string", + "description": "bolt11 invoice, if **experimental-offers** is enabled, it can actually be a bolt12 invoice, such as one received from lightningd-fetchinvoice(7). If it does not contain an amount, *amount_msat* is required, otherwise if it is specified it must be *null*" }, "amount_msat": { - "type": "msat" + "type": "msat", + "description": "*amount_msat* is in millisatoshi precision; it can be a whole number, or a whole number with suffix *msat* or *sat*, or a three decimal point number with suffix *sat*, or an 1 to 11 decimal point number suffixed by *btc*" }, "label": { - "type": "string" + "type": "string", + "description": "it is used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7)" }, "riskfactor": { - "type": "number" + "type": "number", + "description": "the *riskfactor* is described in detail in lightning-getroute(7), and defaults to 10" }, "maxfeepercent": { - "type": "number" + "type": "number", + "description": "percentage of the amount that is to be paid. Defaults to 0.5" }, "retry_for": { - "type": "u16" + "type": "u16", + "description": "until *retry_for* seconds passes, the command will keep finding routes and retrying the payment. Defaults to 60 seconds" }, "maxdelay": { - "type": "u16" + "type": "u16", + "description": "a payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case" }, "exemptfee": { - "type": "msat" + "type": "msat", + "description": "this option can be used for tiny payments which would be dominated by the fee leveraged by forwarding nodes. Setting `exemptfee` allows the `maxfeepercent` check to be skipped on fees that are smaller than `exemptfee`. Defaults to 5000 millisatoshi" }, "localinvreqid": { - "type": "hex" + "type": "hex", + "description": "`localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7). This ensures that we only make a single payment for an offer, and that the offer is marked `used` once paid" }, "exclude": { "type": "array", + "description": "*exclude* is a JSON array of short-channel-id/direction (e.g. [ '564334x877x1/0', '564195x1292x0/1' ]) or pubkey which should be excluded from consideration for routing. The default is not to exclude any channels or nodes", "items": { "oneOf": [ { @@ -14307,10 +14410,12 @@ } }, "maxfee": { - "type": "msat" + "type": "msat", + "description": "*maxfee* overrides both *maxfeepercent* and *exemptfee* defaults (and if you specify *maxfee* you cannot specify either of those), and creates an absolute limit on what fee we will pay. This allows you to implement your own heuristics rather than the primitive ones used here" }, "description": { - "type": "string" + "type": "string", + "description": "it is only required for bolt11 invoices which do not contain a description themselves, but contain a description hash: in this case *description* is required. *description* is then checked against the hash inside the invoice before it will be paid" } } }, @@ -14380,13 +14485,16 @@ "additionalProperties": false, "properties": { "id": { - "type": "pubkey" + "type": "pubkey", + "description": "The pubkey of the node to ping" }, "len": { - "type": "u16" + "type": "u16", + "description": "the length of the ping. Defaults to 128" }, "pongbytes": { - "type": "u16" + "type": "u16", + "description": "the length of the reply. A value of 65532 to 65535 means `don't reply`. Defaults to 128" } } }, @@ -14544,6 +14652,7 @@ "properties": { "bolt11": { "type": "string", + "description": "bolt11 invoice to submit to the HSM to check", "added": "v23.02" } } @@ -14568,17 +14677,19 @@ "properties": { "destination": { "type": "pubkey", + "description": "it is a 33 byte, hex-encoded, node ID of the node that the payment should go to", "added": "v23.02" }, "payment_hash": { "type": "hex", "added": "v23.02", - "description": "the hash of the *payment_preimage* which will prove payment", + "description": "it is the unique identifier of a payment", "maxLength": 64, "minLength": 64 }, "amount_msat": { "type": "msat", + "description": "the amount to send in millisatoshi precision; it can be a whole number, or a whole number with suffix `msat` or `sat`, or a three decimal point number with suffix `sat`, or an 1 to 11 decimal point number suffixed by `btc`", "added": "v23.02" } } @@ -14627,11 +14738,13 @@ "required": [ "scb" ], - "scb": { - "type": "array", - "description": "SCB of the channels in an array", - "items": { - "type": "hexstr" + "properties": { + "scb": { + "type": "array", + "description": "SCB of the channels in an array", + "items": { + "type": "hexstr" + } } } }, @@ -14925,10 +15038,12 @@ "additionalProperties": false, "properties": { "node_id": { - "type": "pubkey" + "type": "pubkey", + "description": "the node specified by `node_id` must be a peer, i.e., it must have a direct connection with the node receiving the RPC call, and the connection must be established. For a method to send arbitrary messages over multiple hops, including hops that do not understand the custom message, see the `createonion` and `sendonion` RPC methods. Messages can only be injected if the connection is handled by `openingd` or `channeld`. Messages cannot be injected when the peer is handled by `onchaind` or `closingd` since these do not have a connection, or are synchronous daemons that do not handle spontaneous messages" }, "msg": { - "type": "hex" + "type": "hex", + "description": "must be a hex encoded well-formed message, including the 2-byte type prefix, but excluding the length prefix which will be added by the RPC method. The message types may not be one of the internally handled types, since that may cause issues with the internal state tracking of Core Lightning. We do (as of *v23.11*) allow sending of even types, but note that peers (as per the spec) will disconnect on receiving unknown even types" } } }, @@ -15104,10 +15219,12 @@ ], "properties": { "onion": { - "type": "hex" + "type": "hex", + "description": "hex-encoded 1366 bytes long blob that was returned by either of the tools that can generate onions. It contains the payloads destined for each hop and some metadata. Please refer to [BOLT 04][bolt04] for further details. If is specific to the route that is being used and the *payment_hash* used to construct, and therefore cannot be reused for other payments or to attempt a separate route. The custom onion can generally be created using the `devtools/onion` CLI tool, or the **createonion** RPC command" }, "first_hop": { "type": "object", + "description": "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*", "required": [ "id", "amount_msat", @@ -15115,45 +15232,62 @@ ], "properties": { "id": { - "type": "pubkey" + "type": "pubkey", + "description": "node id for the peer. Use any available channel available to this peer" }, "amount_msat": { - "type": "msat" + "type": "msat", + "description": "the amount to add an HTLC for millisatoshis" }, "delay": { - "type": "u16" + "type": "u16", + "description": "the number of blocks delay of blocks on top of the current blockheight" } } }, "payment_hash": { - "type": "hash" + "type": "hash", + "description": "specifies the 32 byte hex-encoded hash to use as a challenge to the HTLC that we are sending. It is specific to the onion and has to match the one the onion was created with" }, "label": { - "type": "string" + "type": "string", + "description": "can be used to provide a human readable reference to retrieve the payment at a later time" }, "shared_secrets": { "type": "array", + "description": "a JSON list of 32 byte hex-encoded secrets that were used when creating the onion. Core Lightning can send a payment with a custom onion without the knowledge of these secrets, however it will not be able to parse an eventual error message since that is encrypted with the shared secrets used in the onion. If *shared_secrets* is provided Core Lightning will decrypt the error, act accordingly, e.g., add a `channel_update` included in the error to its network view, and set the details in *listsendpays* correctly. If it is not provided Core Lightning will store the encrypted onion, and expose it in *listsendpays* allowing the caller to decrypt it externally. If it is not provided the Core Lightning node does not know how long the route is, which channels or nodes are involved, and what an eventual error could have been. It can therefore be used for oblivious payments", "items": { "type": "secret" } }, "partid": { - "type": "u16" + "type": "u16", + "description": "if provided and non-zero, allows for multiple parallel partial payments with the same *payment_hash*" }, "bolt11": { - "type": "string" + "type": "string", + "description": "if provided, it will be returned in *waitsendpay* and *listsendpays* results" }, "amount_msat": { - "type": "msat" + "type": "msat", + "description": "used to annotate the payment, and is returned by *waitsendpay* and *listsendpays*" }, "destination": { - "type": "pubkey" + "type": "pubkey", + "description": "if provided, it will be returned in **listpays** result" }, "localinvreqid": { - "type": "hash" + "type": "hash", + "description": "`localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7)" }, "groupid": { - "type": "u64" + "type": "u64", + "description": "grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash" + }, + "description": { + "added": "v0.11.0", + "type": "string", + "description": "if provided, it will be returned in *waitsendpay* and *listsendpays* results" } } }, @@ -15343,7 +15477,7 @@ }, "tlv": { "type": "u8", - "description": "contains a hexidecimal TLV to include" + "description": "contains a hexadecimal TLV to include" } } } @@ -15377,44 +15511,66 @@ "channel" ], "properties": { - "amount_msat": { - "type": "msat" - }, "id": { - "type": "pubkey" + "type": "pubkey", + "description": "The node at the end of this hop" + }, + "channel": { + "type": "short_channel_id", + "description": "The channel joining these nodes" }, "delay": { - "type": "u16" + "type": "u32", + "description": "The total CLTV expected by the node at the end of this hop" }, - "channel": { - "type": "short_channel_id" + "amount_msat": { + "type": "msat", + "description": "The amount expected by the node at the end of this hop" } } } }, "payment_hash": { - "type": "hash" + "type": "hash", + "description": "the hash of the payment_preimage" }, "label": { - "type": "string" + "type": "string", + "description": "the label provided when creating the invoice_request" }, "amount_msat": { - "type": "msat" + "type": "msat", + "description": "amount must be provided if *partid* is non-zero, or the payment is to-self, otherwise it must be equal to the final amount to the destination. By default it is in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*" }, "bolt11": { - "type": "string" + "type": "string", + "description": "bolt11 invoice to pay. If provided, will be returned in *waitsendpay* and *listsendpays* results" }, "payment_secret": { - "type": "secret" + "type": "secret", + "description": "value that the final recipient requires to accept the payment, as defined by the `payment_data` field in BOLT 4 and the `s` field in the BOLT 11 invoice format. It is required if *partid* is non-zero" }, "partid": { - "type": "u16" + "type": "u64", + "description": "must not be provided for self-payments. If provided and non-zero, allows for multiple parallel partial payments with the same *payment_hash*. The *amount_msat* amount (which must be provided) for each **sendpay** with matching *payment_hash* must be equal, and **sendpay** will fail if there are differing values given" }, "localinvreqid": { - "type": "hex" + "type": "hex", + "description": "indicates that this payment is being made for a local invoice_request. This ensures that we only send a payment for a single-use invoice_request once" }, "groupid": { - "type": "u64" + "type": "u64", + "description": "allows you to attach a number which appears in **listsendpays** so payments can be identified as part of a logical group. The *pay* plugin uses this to identify one attempt at a MPP payment, for example" + }, + "payment_metadata": { + "added": "v0.11.0", + "type": "hex", + "description": "placed in the final onion hop TLV" + }, + "description": { + "added": "v0.11.0", + "type": "string", + "description": "description used in the invoice" } } }, @@ -15592,10 +15748,12 @@ ], "properties": { "psbt": { - "type": "string" + "type": "string", + "description": "the fully signed psbt to be sent" }, "reserve": { - "type": "boolean" + "type": "u32", + "description": "number of blocks to increase reservation of any of our inputs by. Default is 72" } } }, @@ -15627,26 +15785,33 @@ ], "properties": { "id": { - "type": "string" + "type": "string", + "description": "should contain a scid (short channel ID), channel id or peerid (pubkey) of the channel to be modified. If *id* is set to `all`, the updates are applied to all channels in states CHANNELD_NORMAL CHANNELD_AWAITING_LOCKIN or DUALOPEND_AWAITING_LOCKIN. If *id* is a peerid, all channels with the +peer in those states are changed" }, "feebase": { - "type": "msat" + "type": "msat", + "description": "value in millisatoshi that is added as base fee to any routed payment: if omitted, it is unchanged. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*" }, "feeppm": { - "type": "u32" + "type": "u32", + "description": "value that is added proportionally per-millionths to any routed payment volume in satoshi. For example, if ppm is 1,000 and 1,000,000 satoshi is being routed through the channel, an proportional fee of 1,000 satoshi is added, resulting in a 0.1% fee" }, "htlcmin": { - "type": "msat" + "type": "msat", + "description": "value that limits how small an HTLC we will forward: if omitted, it is unchanged (the default is no lower limit). It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. Note that the peer also enforces a minimum for the channel: setting it below that will simply set it to that value with a warning. Also note that *htlcmin* only applies to forwarded HTLCs: we can still send smaller payments ourselves" }, "htlcmax": { - "type": "msat" + "type": "msat", + "description": "value that limits how large an HTLC we will forward: if omitted, it is unchanged (the default is no effective limit). It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. Note that *htlcmax* only applies to forwarded HTLCs: we can still send larger payments ourselves" }, "enforcedelay": { - "type": "u32" + "type": "u32", + "description": "number of seconds to delay before enforcing the new fees/htlc max (default 600, which is ten minutes). This gives the network a chance to catch up with the new rates and avoids rejecting HTLCs before they do. This only has an effect if rates are increased (we always allow users to overpay fees) or *htlcmax* is decreased, and only applied to a single rate increase per channel (we don't remember an arbitrary number of prior feerates) and if the node is restarted the updated configuration is enforced immediately" }, "ignorefeelimits": { "added": "v23.08", - "type": "boolean" + "type": "boolean", + "description": "if set to True means to allow the peer to set the commitment transaction fees (or closing transaction fees) to any value they want. This is dangerous: they could set an exorbitant fee (so HTLCs are unenforcable), or a tiny fee (so that commitment transactions cannot be relayed), but avoids channel breakage in case of feerate disagreements. (Note: the global `ignore_fee_limits` setting overrides this)" } } }, @@ -15732,9 +15897,23 @@ "added": "v23.08", "properties": { "config": { - "type": "string" + "type": "string", + "description": "name of the config variable which should be set to the value of the variable" }, - "val": {} + "val": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "boolean" + } + ], + "description": "value of the config variable to be set or updated" + } } }, "setconfig.schema.json": { @@ -15841,7 +16020,7 @@ "properties": { "rune": { "type": "string", - "description": "optional rune to list" + "description": "if specified, only details of that rune will be returned" } } }, @@ -15968,7 +16147,7 @@ "properties": { "invstring": { "type": "string", - "description": "" + "description": "bolt11 form, but the final signature is ignored. Minimal sanity checks are done" } } }, @@ -15995,7 +16174,8 @@ "additionalProperties": false, "properties": { "message": { - "type": "string" + "type": "string", + "description": "less that 65536 characters long message to be signed by the node" } } }, @@ -16036,10 +16216,12 @@ ], "properties": { "psbt": { - "type": "string" + "type": "string", + "description": "the psbt to be signed" }, "signonly": { "type": "array", + "description": "input numbers to sign", "items": { "type": "u32" } @@ -16088,7 +16270,7 @@ }, "force_feerate": { "type": "boolean", - "description": "By default splices will fail if the fee provided looks too high. This is to protect against accidentally setting your fee higher than intended. Set `force_feerate` to true to skip this saftey check" + "description": "by default splices will fail if the fee provided looks too high. This is to protect against accidentally setting your fee higher than intended. Set `force_feerate` to true to skip this saftey check" } } }, @@ -16167,7 +16349,7 @@ }, "psbt": { "type": "string", - "description": "the (optional) base 64 encoded PSBT to begin with. If not specified, one will be generated automatically" + "description": "the base 64 encoded PSBT returned from `splice_init` with any changes added by the user" } } }, @@ -16281,7 +16463,8 @@ ], "properties": { "txid": { - "type": "txid" + "type": "txid", + "description": "the transaction id, inputs should be unreseverd from" } } }, @@ -16313,18 +16496,22 @@ "properties": { "outputs": { "type": "array", + "description": "format is like: [{destination1: amount1}, {destination2: amount2}] or [{destination: *all*}]. It supports any number of **confirmed** outputs", "items": { "type": "outputdesc" } }, "feerate": { - "type": "feerate" + "type": "feerate", + "description": "used for the transaction as initial feerate. The default is *normal*" }, "minconf": { - "type": "u32" + "type": "u32", + "description": "the minimum number of confirmations that used outputs should have. Default is 1" }, "utxos": { "type": "array", + "description": "to be used to fund the transaction, as an array of `txid:vout`. These must be drawn from the node's available UTXO set", "items": { "type": "outpoint" } @@ -16363,7 +16550,8 @@ ], "properties": { "txid": { - "type": "txid" + "type": "txid", + "description": "The transaction id of the transaction created by **txprepare**" } } }, @@ -16538,39 +16726,48 @@ ], "properties": { "satoshi": { - "type": "msat" + "type": "msat_or_all", + "description": "the minimum satoshi value of the output(s) needed (or the string `all` meaning use all unreserved inputs). If a value, it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" }, "feerate": { - "type": "feerate" + "type": "feerate", + "description": "used for the transaction as initial feerate. The default is *normal*" }, "startweight": { - "type": "u32" + "type": "u32", + "description": "the weight of the transaction before *fundpsbt* has added any inputs" }, "utxos": { "type": "array", + "description": "an array of `txid:vout`, each of which must be reserved or available", "items": { "type": "outpoint" } }, "reserve": { "type": "u32", - "description": "reserve is a number: if non-zero number then reserveinputs is called (successfully, with exclusive true) on the returned PSBT for this number of blocks (default: 72)." + "description": "if not zero, then *reserveinputs* is called (successfully, with *exclusive* true) on the returned PSBT for this number of blocks. Defaults to 72 blocks if unspecified" }, "reservedok": { - "type": "boolean" + "type": "boolean", + "description": "if set to true, it will also fail if any of the *utxos* are already reserved. Default is false" }, "locktime": { - "type": "u32" + "type": "u32", + "description": "if not set, it is set to a recent block height" }, "min_witness_weight": { - "type": "u32" + "type": "u32", + "description": "minimum weight to use for a UTXO's witness. If the actual witness weight is greater than the provided minimum, the actual witness weight will be used" }, "excess_as_change": { - "type": "boolean" + "type": "boolean", + "description": "flag to add a change output for the excess sats" }, "opening_anchor_channel": { "added": "v23.08", - "type": "boolean" + "type": "boolean", + "description": "to signel that it needs emergency reserve for anchors so that we can lowball our commitment tx fees, and min-emergency-msat for reserving some sats for closing anchor channels" } } }, @@ -16660,6 +16857,7 @@ "properties": { "subsystem": { "type": "string", + "description": "the subsystem to get the next index value from", "enum": [ "invoices", "forwards", @@ -16668,6 +16866,7 @@ }, "indexname": { "type": "string", + "description": "the name of the index to get the next value for", "enum": [ "created", "updated", @@ -16675,7 +16874,8 @@ ] }, "nextvalue": { - "type": "u64" + "type": "u64", + "description": "the next value of the index" } } }, @@ -16875,10 +17075,12 @@ "required": [], "properties": { "lastpay_index": { - "type": "u64" + "type": "u64", + "description": "ignores any invoices paid prior to or including this index. 0 is equivalent to not specifying and negative value is invalid" }, "timeout": { - "type": "u64" + "type": "u64", + "description": "if specified, wait at most that number of seconds, which must be an integer. If the specified *timeout* is reached, this command will return with an error. You can specify this to 0 so that **waitanyinvoice** will return immediately with an error if no pending invoice is available yet. If unspecified, this command will wait indefinitely" } } }, @@ -17043,11 +17245,11 @@ "properties": { "blockheight": { "type": "u32", - "description": "The current block height (>= blockheight parameter)" + "description": "current blockheight of the blockchain if the value is greater than this number. If it is a present or past block height, then the command returns immediately" }, "timeout": { "type": "u32", - "description": "If timeout seconds is reached without the specified blockheight being reached, this command will fail with a code of 2000." + "description": "only wait up to specified seconds. Defaults to 60 seconds" } } }, @@ -17073,7 +17275,15 @@ ], "properties": { "label": { - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "description": "unique label of the invoice waiting to be paid" } } }, @@ -17237,16 +17447,20 @@ ], "properties": { "payment_hash": { - "type": "hash" + "type": "hash", + "description": "the hash of the *payment_preimage*" }, "timeout": { - "type": "u32" + "type": "u32", + "description": "a timeout in seconds, for this RPC command to return. If the *timeout* is provided and the given amount of time passes without the payment definitely succeeding or definitely failing, this command returns with a 200 error code (payment still in progress). If *timeout* is not provided this call will wait indefinitely. Indicating a *timeout* of 0 effectively makes this call a pollable query of the status of the payment" }, "partid": { - "type": "u64" + "type": "u64", + "description": "unique ID within this (multi-part) payment. It must match that of the **sendpay** command" }, "groupid": { - "type": "u64" + "type": "u64", + "description": "grouping key to disambiguate multiple attempts to pay the same payment_hash" } } }, @@ -17378,23 +17592,29 @@ "type": "object", "additionalProperties": false, "required": [ - "destination" + "destination", + "satoshi" ], "properties": { "destination": { - "type": "string" + "type": "string", + "description": "any Bitcoin accepted type, including bech32" }, "satoshi": { - "type": "msat_or_all" + "type": "msat_or_all", + "description": "the amount to be withdrawn from the internal wallet (expressed, as name suggests, in satoshi). The string *all* can be used to specify withdrawal of all available funds (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" }, "feerate": { - "type": "feerate" + "type": "feerate", + "description": "used for the withdrawal as initial feerate. The default is *normal*" }, "minconf": { - "type": "u16" + "type": "u16", + "description": "minimum number of confirmations that used outputs should have. Default is 1" }, "utxos": { "type": "array", + "description": "specifies the utxos to be used to be withdrawn from, as an array of `txid:vout`. These must be drawn from the node's available UTXO set", "items": { "type": "outpoint" } diff --git a/contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py b/contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py index 68ca1cac77cd..4d34f426420f 100644 --- a/contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py +++ b/contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py @@ -14,7 +14,7 @@ from pyln.grpc import primitives_pb2 as primitives__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\nnode.proto\x12\x03\x63ln\x1a\x10primitives.proto\"\x10\n\x0eGetinfoRequest\"\xc1\x04\n\x0fGetinfoResponse\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x12\n\x05\x61lias\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\r\n\x05\x63olor\x18\x03 \x01(\x0c\x12\x11\n\tnum_peers\x18\x04 \x01(\r\x12\x1c\n\x14num_pending_channels\x18\x05 \x01(\r\x12\x1b\n\x13num_active_channels\x18\x06 \x01(\r\x12\x1d\n\x15num_inactive_channels\x18\x07 \x01(\r\x12\x0f\n\x07version\x18\x08 \x01(\t\x12\x15\n\rlightning_dir\x18\t \x01(\t\x12\x33\n\x0cour_features\x18\n \x01(\x0b\x32\x18.cln.GetinfoOur_featuresH\x01\x88\x01\x01\x12\x13\n\x0b\x62lockheight\x18\x0b \x01(\r\x12\x0f\n\x07network\x18\x0c \x01(\t\x12(\n\x13\x66\x65\x65s_collected_msat\x18\r \x01(\x0b\x32\x0b.cln.Amount\x12$\n\x07\x61\x64\x64ress\x18\x0e \x03(\x0b\x32\x13.cln.GetinfoAddress\x12$\n\x07\x62inding\x18\x0f \x03(\x0b\x32\x13.cln.GetinfoBinding\x12\"\n\x15warning_bitcoind_sync\x18\x10 \x01(\tH\x02\x88\x01\x01\x12$\n\x17warning_lightningd_sync\x18\x11 \x01(\tH\x03\x88\x01\x01\x42\x08\n\x06_aliasB\x0f\n\r_our_featuresB\x18\n\x16_warning_bitcoind_syncB\x1a\n\x18_warning_lightningd_sync\"S\n\x13GetinfoOur_features\x12\x0c\n\x04init\x18\x01 \x01(\x0c\x12\x0c\n\x04node\x18\x02 \x01(\x0c\x12\x0f\n\x07\x63hannel\x18\x03 \x01(\x0c\x12\x0f\n\x07invoice\x18\x04 \x01(\x0c\"\xc4\x01\n\x0eGetinfoAddress\x12\x39\n\titem_type\x18\x01 \x01(\x0e\x32&.cln.GetinfoAddress.GetinfoAddressType\x12\x0c\n\x04port\x18\x02 \x01(\r\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x00\x88\x01\x01\"G\n\x12GetinfoAddressType\x12\x07\n\x03\x44NS\x10\x00\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\n\n\x08_address\"\x8a\x02\n\x0eGetinfoBinding\x12\x39\n\titem_type\x18\x01 \x01(\x0e\x32&.cln.GetinfoBinding.GetinfoBindingType\x12\x14\n\x07\x61\x64\x64ress\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04port\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x13\n\x06socket\x18\x04 \x01(\tH\x02\x88\x01\x01\"_\n\x12GetinfoBindingType\x12\x10\n\x0cLOCAL_SOCKET\x10\x00\x12\r\n\tWEBSOCKET\x10\x05\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\n\n\x08_addressB\x07\n\x05_portB\t\n\x07_socket\"H\n\x10ListpeersRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x12\n\x05level\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x05\n\x03_idB\x08\n\x06_level\"7\n\x11ListpeersResponse\x12\"\n\x05peers\x18\x01 \x03(\x0b\x32\x13.cln.ListpeersPeers\"\x8e\x02\n\x0eListpeersPeers\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x11\n\tconnected\x18\x02 \x01(\x08\x12\x19\n\x0cnum_channels\x18\x08 \x01(\rH\x00\x88\x01\x01\x12#\n\x03log\x18\x03 \x03(\x0b\x32\x16.cln.ListpeersPeersLog\x12-\n\x08\x63hannels\x18\x04 \x03(\x0b\x32\x1b.cln.ListpeersPeersChannels\x12\x0f\n\x07netaddr\x18\x05 \x03(\t\x12\x18\n\x0bremote_addr\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x15\n\x08\x66\x65\x61tures\x18\x06 \x01(\x0cH\x02\x88\x01\x01\x42\x0f\n\r_num_channelsB\x0e\n\x0c_remote_addrB\x0b\n\t_features\"\xfd\x02\n\x11ListpeersPeersLog\x12?\n\titem_type\x18\x01 \x01(\x0e\x32,.cln.ListpeersPeersLog.ListpeersPeersLogType\x12\x18\n\x0bnum_skipped\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x11\n\x04time\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06source\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x10\n\x03log\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x14\n\x07node_id\x18\x06 \x01(\x0cH\x04\x88\x01\x01\x12\x11\n\x04\x64\x61ta\x18\x07 \x01(\x0cH\x05\x88\x01\x01\"i\n\x15ListpeersPeersLogType\x12\x0b\n\x07SKIPPED\x10\x00\x12\n\n\x06\x42ROKEN\x10\x01\x12\x0b\n\x07UNUSUAL\x10\x02\x12\x08\n\x04INFO\x10\x03\x12\t\n\x05\x44\x45\x42UG\x10\x04\x12\t\n\x05IO_IN\x10\x05\x12\n\n\x06IO_OUT\x10\x06\x42\x0e\n\x0c_num_skippedB\x07\n\x05_timeB\t\n\x07_sourceB\x06\n\x04_logB\n\n\x08_node_idB\x07\n\x05_data\"\x95\x18\n\x16ListpeersPeersChannels\x12\x46\n\x05state\x18\x01 \x01(\x0e\x32\x37.cln.ListpeersPeersChannels.ListpeersPeersChannelsState\x12\x19\n\x0cscratch_txid\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x38\n\x07\x66\x65\x65rate\x18\x03 \x01(\x0b\x32\".cln.ListpeersPeersChannelsFeerateH\x01\x88\x01\x01\x12\x12\n\x05owner\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x1d\n\x10short_channel_id\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x17\n\nchannel_id\x18\x06 \x01(\x0cH\x04\x88\x01\x01\x12\x19\n\x0c\x66unding_txid\x18\x07 \x01(\x0cH\x05\x88\x01\x01\x12\x1b\n\x0e\x66unding_outnum\x18\x08 \x01(\rH\x06\x88\x01\x01\x12\x1c\n\x0finitial_feerate\x18\t \x01(\tH\x07\x88\x01\x01\x12\x19\n\x0clast_feerate\x18\n \x01(\tH\x08\x88\x01\x01\x12\x19\n\x0cnext_feerate\x18\x0b \x01(\tH\t\x88\x01\x01\x12\x1a\n\rnext_fee_step\x18\x0c \x01(\rH\n\x88\x01\x01\x12\x35\n\x08inflight\x18\r \x03(\x0b\x32#.cln.ListpeersPeersChannelsInflight\x12\x15\n\x08\x63lose_to\x18\x0e \x01(\x0cH\x0b\x88\x01\x01\x12\x14\n\x07private\x18\x0f \x01(\x08H\x0c\x88\x01\x01\x12 \n\x06opener\x18\x10 \x01(\x0e\x32\x10.cln.ChannelSide\x12%\n\x06\x63loser\x18\x11 \x01(\x0e\x32\x10.cln.ChannelSideH\r\x88\x01\x01\x12\x10\n\x08\x66\x65\x61tures\x18\x12 \x03(\t\x12\x38\n\x07\x66unding\x18\x13 \x01(\x0b\x32\".cln.ListpeersPeersChannelsFundingH\x0e\x88\x01\x01\x12$\n\nto_us_msat\x18\x14 \x01(\x0b\x32\x0b.cln.AmountH\x0f\x88\x01\x01\x12(\n\x0emin_to_us_msat\x18\x15 \x01(\x0b\x32\x0b.cln.AmountH\x10\x88\x01\x01\x12(\n\x0emax_to_us_msat\x18\x16 \x01(\x0b\x32\x0b.cln.AmountH\x11\x88\x01\x01\x12$\n\ntotal_msat\x18\x17 \x01(\x0b\x32\x0b.cln.AmountH\x12\x88\x01\x01\x12\'\n\rfee_base_msat\x18\x18 \x01(\x0b\x32\x0b.cln.AmountH\x13\x88\x01\x01\x12(\n\x1b\x66\x65\x65_proportional_millionths\x18\x19 \x01(\rH\x14\x88\x01\x01\x12)\n\x0f\x64ust_limit_msat\x18\x1a \x01(\x0b\x32\x0b.cln.AmountH\x15\x88\x01\x01\x12\x30\n\x16max_total_htlc_in_msat\x18\x1b \x01(\x0b\x32\x0b.cln.AmountH\x16\x88\x01\x01\x12,\n\x12their_reserve_msat\x18\x1c \x01(\x0b\x32\x0b.cln.AmountH\x17\x88\x01\x01\x12*\n\x10our_reserve_msat\x18\x1d \x01(\x0b\x32\x0b.cln.AmountH\x18\x88\x01\x01\x12(\n\x0espendable_msat\x18\x1e \x01(\x0b\x32\x0b.cln.AmountH\x19\x88\x01\x01\x12)\n\x0freceivable_msat\x18\x1f \x01(\x0b\x32\x0b.cln.AmountH\x1a\x88\x01\x01\x12.\n\x14minimum_htlc_in_msat\x18 \x01(\x0b\x32\x0b.cln.AmountH\x1b\x88\x01\x01\x12/\n\x15minimum_htlc_out_msat\x18\x30 \x01(\x0b\x32\x0b.cln.AmountH\x1c\x88\x01\x01\x12/\n\x15maximum_htlc_out_msat\x18\x31 \x01(\x0b\x32\x0b.cln.AmountH\x1d\x88\x01\x01\x12 \n\x13their_to_self_delay\x18! \x01(\rH\x1e\x88\x01\x01\x12\x1e\n\x11our_to_self_delay\x18\" \x01(\rH\x1f\x88\x01\x01\x12\x1f\n\x12max_accepted_htlcs\x18# \x01(\rH \x88\x01\x01\x12\x34\n\x05\x61lias\x18\x32 \x01(\x0b\x32 .cln.ListpeersPeersChannelsAliasH!\x88\x01\x01\x12\x0e\n\x06status\x18% \x03(\t\x12 \n\x13in_payments_offered\x18& \x01(\x04H\"\x88\x01\x01\x12)\n\x0fin_offered_msat\x18\' \x01(\x0b\x32\x0b.cln.AmountH#\x88\x01\x01\x12\"\n\x15in_payments_fulfilled\x18( \x01(\x04H$\x88\x01\x01\x12+\n\x11in_fulfilled_msat\x18) \x01(\x0b\x32\x0b.cln.AmountH%\x88\x01\x01\x12!\n\x14out_payments_offered\x18* \x01(\x04H&\x88\x01\x01\x12*\n\x10out_offered_msat\x18+ \x01(\x0b\x32\x0b.cln.AmountH\'\x88\x01\x01\x12#\n\x16out_payments_fulfilled\x18, \x01(\x04H(\x88\x01\x01\x12,\n\x12out_fulfilled_msat\x18- \x01(\x0b\x32\x0b.cln.AmountH)\x88\x01\x01\x12/\n\x05htlcs\x18. \x03(\x0b\x32 .cln.ListpeersPeersChannelsHtlcs\x12\x1a\n\rclose_to_addr\x18/ \x01(\tH*\x88\x01\x01\"\xe0\x02\n\x1bListpeersPeersChannelsState\x12\x0c\n\x08OPENINGD\x10\x00\x12\x1c\n\x18\x43HANNELD_AWAITING_LOCKIN\x10\x01\x12\x13\n\x0f\x43HANNELD_NORMAL\x10\x02\x12\x1a\n\x16\x43HANNELD_SHUTTING_DOWN\x10\x03\x12\x18\n\x14\x43LOSINGD_SIGEXCHANGE\x10\x04\x12\x15\n\x11\x43LOSINGD_COMPLETE\x10\x05\x12\x17\n\x13\x41WAITING_UNILATERAL\x10\x06\x12\x16\n\x12\x46UNDING_SPEND_SEEN\x10\x07\x12\x0b\n\x07ONCHAIN\x10\x08\x12\x17\n\x13\x44UALOPEND_OPEN_INIT\x10\t\x12\x1d\n\x19\x44UALOPEND_AWAITING_LOCKIN\x10\n\x12\x1c\n\x18\x44UALOPEND_OPEN_COMMITTED\x10\x0b\x12\x1f\n\x1b\x44UALOPEND_OPEN_COMMIT_READY\x10\x0c\x42\x0f\n\r_scratch_txidB\n\n\x08_feerateB\x08\n\x06_ownerB\x13\n\x11_short_channel_idB\r\n\x0b_channel_idB\x0f\n\r_funding_txidB\x11\n\x0f_funding_outnumB\x12\n\x10_initial_feerateB\x0f\n\r_last_feerateB\x0f\n\r_next_feerateB\x10\n\x0e_next_fee_stepB\x0b\n\t_close_toB\n\n\x08_privateB\t\n\x07_closerB\n\n\x08_fundingB\r\n\x0b_to_us_msatB\x11\n\x0f_min_to_us_msatB\x11\n\x0f_max_to_us_msatB\r\n\x0b_total_msatB\x10\n\x0e_fee_base_msatB\x1e\n\x1c_fee_proportional_millionthsB\x12\n\x10_dust_limit_msatB\x19\n\x17_max_total_htlc_in_msatB\x15\n\x13_their_reserve_msatB\x13\n\x11_our_reserve_msatB\x11\n\x0f_spendable_msatB\x12\n\x10_receivable_msatB\x17\n\x15_minimum_htlc_in_msatB\x18\n\x16_minimum_htlc_out_msatB\x18\n\x16_maximum_htlc_out_msatB\x16\n\x14_their_to_self_delayB\x14\n\x12_our_to_self_delayB\x15\n\x13_max_accepted_htlcsB\x08\n\x06_aliasB\x16\n\x14_in_payments_offeredB\x12\n\x10_in_offered_msatB\x18\n\x16_in_payments_fulfilledB\x14\n\x12_in_fulfilled_msatB\x17\n\x15_out_payments_offeredB\x13\n\x11_out_offered_msatB\x19\n\x17_out_payments_fulfilledB\x15\n\x13_out_fulfilled_msatB\x10\n\x0e_close_to_addr\"=\n\x1dListpeersPeersChannelsFeerate\x12\r\n\x05perkw\x18\x01 \x01(\r\x12\r\n\x05perkb\x18\x02 \x01(\r\"\xf3\x01\n\x1eListpeersPeersChannelsInflight\x12\x14\n\x0c\x66unding_txid\x18\x01 \x01(\x0c\x12\x16\n\x0e\x66unding_outnum\x18\x02 \x01(\r\x12\x0f\n\x07\x66\x65\x65rate\x18\x03 \x01(\t\x12\'\n\x12total_funding_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10our_funding_msat\x18\x05 \x01(\x0b\x32\x0b.cln.Amount\x12\x1a\n\rsplice_amount\x18\x07 \x01(\x12H\x00\x88\x01\x01\x12\x14\n\x0cscratch_txid\x18\x06 \x01(\x0c\x42\x10\n\x0e_splice_amount\"\x9b\x02\n\x1dListpeersPeersChannelsFunding\x12%\n\x0bpushed_msat\x18\x03 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12%\n\x10local_funds_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12&\n\x11remote_funds_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\'\n\rfee_paid_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\'\n\rfee_rcvd_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x42\x0e\n\x0c_pushed_msatB\x10\n\x0e_fee_paid_msatB\x10\n\x0e_fee_rcvd_msat\"[\n\x1bListpeersPeersChannelsAlias\x12\x12\n\x05local\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06remote\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_localB\t\n\x07_remote\"\xf1\x02\n\x1bListpeersPeersChannelsHtlcs\x12X\n\tdirection\x18\x01 \x01(\x0e\x32\x45.cln.ListpeersPeersChannelsHtlcs.ListpeersPeersChannelsHtlcsDirection\x12\n\n\x02id\x18\x02 \x01(\x04\x12 \n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x0e\n\x06\x65xpiry\x18\x04 \x01(\r\x12\x14\n\x0cpayment_hash\x18\x05 \x01(\x0c\x12\x1a\n\rlocal_trimmed\x18\x06 \x01(\x08H\x00\x88\x01\x01\x12\x13\n\x06status\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x1d\n\x05state\x18\x08 \x01(\x0e\x32\x0e.cln.HtlcState\"7\n$ListpeersPeersChannelsHtlcsDirection\x12\x06\n\x02IN\x10\x00\x12\x07\n\x03OUT\x10\x01\x42\x10\n\x0e_local_trimmedB\t\n\x07_status\"0\n\x10ListfundsRequest\x12\x12\n\x05spent\x18\x01 \x01(\x08H\x00\x88\x01\x01\x42\x08\n\x06_spent\"e\n\x11ListfundsResponse\x12&\n\x07outputs\x18\x01 \x03(\x0b\x32\x15.cln.ListfundsOutputs\x12(\n\x08\x63hannels\x18\x02 \x03(\x0b\x32\x16.cln.ListfundsChannels\"\x83\x03\n\x10ListfundsOutputs\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x0e\n\x06output\x18\x02 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x14\n\x0cscriptpubkey\x18\x04 \x01(\x0c\x12\x14\n\x07\x61\x64\x64ress\x18\x05 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0credeemscript\x18\x06 \x01(\x0cH\x01\x88\x01\x01\x12<\n\x06status\x18\x07 \x01(\x0e\x32,.cln.ListfundsOutputs.ListfundsOutputsStatus\x12\x10\n\x08reserved\x18\t \x01(\x08\x12\x18\n\x0b\x62lockheight\x18\x08 \x01(\rH\x02\x88\x01\x01\"Q\n\x16ListfundsOutputsStatus\x12\x0f\n\x0bUNCONFIRMED\x10\x00\x12\r\n\tCONFIRMED\x10\x01\x12\t\n\x05SPENT\x10\x02\x12\x0c\n\x08IMMATURE\x10\x03\x42\n\n\x08_addressB\x0f\n\r_redeemscriptB\x0e\n\x0c_blockheight\"\xab\x02\n\x11ListfundsChannels\x12\x0f\n\x07peer_id\x18\x01 \x01(\x0c\x12$\n\x0four_amount_msat\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\x12 \n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x14\n\x0c\x66unding_txid\x18\x04 \x01(\x0c\x12\x16\n\x0e\x66unding_output\x18\x05 \x01(\r\x12\x11\n\tconnected\x18\x06 \x01(\x08\x12 \n\x05state\x18\x07 \x01(\x0e\x32\x11.cln.ChannelState\x12\x17\n\nchannel_id\x18\t \x01(\x0cH\x00\x88\x01\x01\x12\x1d\n\x10short_channel_id\x18\x08 \x01(\tH\x01\x88\x01\x01\x42\r\n\x0b_channel_idB\x13\n\x11_short_channel_id\"\xdd\x02\n\x0eSendpayRequest\x12 \n\x05route\x18\x01 \x03(\x0b\x32\x11.cln.SendpayRoute\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\x0c\x12\x12\n\x05label\x18\x03 \x01(\tH\x00\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x1b\n\x0epayment_secret\x18\x06 \x01(\x0cH\x03\x88\x01\x01\x12\x13\n\x06partid\x18\x07 \x01(\rH\x04\x88\x01\x01\x12\x1a\n\rlocalinvreqid\x18\x0b \x01(\x0cH\x05\x88\x01\x01\x12\x14\n\x07groupid\x18\t \x01(\x04H\x06\x88\x01\x01\x42\x08\n\x06_labelB\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\x11\n\x0f_payment_secretB\t\n\x07_partidB\x10\n\x0e_localinvreqidB\n\n\x08_groupid\"\xad\x05\n\x0fSendpayResponse\x12\x1a\n\rcreated_index\x18\x10 \x01(\x04H\x00\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x11 \x01(\x04H\x01\x88\x01\x01\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x14\n\x07groupid\x18\x02 \x01(\x04H\x02\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x32\n\x06status\x18\x04 \x01(\x0e\x32\".cln.SendpayResponse.SendpayStatus\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x06 \x01(\x0cH\x04\x88\x01\x01\x12\x12\n\ncreated_at\x18\x07 \x01(\x04\x12\x19\n\x0c\x63ompleted_at\x18\x0f \x01(\x04H\x05\x88\x01\x01\x12%\n\x10\x61mount_sent_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\t \x01(\tH\x06\x88\x01\x01\x12\x13\n\x06partid\x18\n \x01(\x04H\x07\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x0b \x01(\tH\x08\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x0c \x01(\tH\t\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\r \x01(\x0cH\n\x88\x01\x01\x12\x14\n\x07message\x18\x0e \x01(\tH\x0b\x88\x01\x01\"*\n\rSendpayStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x42\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\n\n\x08_groupidB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x0f\n\r_completed_atB\x08\n\x06_labelB\t\n\x07_partidB\t\n\x07_bolt11B\t\n\x07_bolt12B\x13\n\x11_payment_preimageB\n\n\x08_message\"\\\n\x0cSendpayRoute\x12 \n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.Amount\x12\n\n\x02id\x18\x02 \x01(\x0c\x12\r\n\x05\x64\x65lay\x18\x03 \x01(\r\x12\x0f\n\x07\x63hannel\x18\x04 \x01(\t\"\x93\x01\n\x13ListchannelsRequest\x12\x1d\n\x10short_channel_id\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06source\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x03 \x01(\x0cH\x02\x88\x01\x01\x42\x13\n\x11_short_channel_idB\t\n\x07_sourceB\x0e\n\x0c_destination\"C\n\x14ListchannelsResponse\x12+\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x19.cln.ListchannelsChannels\"\xb3\x03\n\x14ListchannelsChannels\x12\x0e\n\x06source\x18\x01 \x01(\x0c\x12\x13\n\x0b\x64\x65stination\x18\x02 \x01(\x0c\x12\x18\n\x10short_channel_id\x18\x03 \x01(\t\x12\x11\n\tdirection\x18\x10 \x01(\r\x12\x0e\n\x06public\x18\x04 \x01(\x08\x12 \n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.Amount\x12\x15\n\rmessage_flags\x18\x06 \x01(\r\x12\x15\n\rchannel_flags\x18\x07 \x01(\r\x12\x0e\n\x06\x61\x63tive\x18\x08 \x01(\x08\x12\x13\n\x0blast_update\x18\t \x01(\r\x12\x1d\n\x15\x62\x61se_fee_millisatoshi\x18\n \x01(\r\x12\x19\n\x11\x66\x65\x65_per_millionth\x18\x0b \x01(\r\x12\r\n\x05\x64\x65lay\x18\x0c \x01(\r\x12&\n\x11htlc_minimum_msat\x18\r \x01(\x0b\x32\x0b.cln.Amount\x12+\n\x11htlc_maximum_msat\x18\x0e \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x10\n\x08\x66\x65\x61tures\x18\x0f \x01(\x0c\x42\x14\n\x12_htlc_maximum_msat\"#\n\x10\x41\x64\x64gossipRequest\x12\x0f\n\x07message\x18\x01 \x01(\x0c\"\x13\n\x11\x41\x64\x64gossipResponse\"o\n\x17\x41utocleaninvoiceRequest\x12\x17\n\nexpired_by\x18\x01 \x01(\x04H\x00\x88\x01\x01\x12\x1a\n\rcycle_seconds\x18\x02 \x01(\x04H\x01\x88\x01\x01\x42\r\n\x0b_expired_byB\x10\n\x0e_cycle_seconds\"\x81\x01\n\x18\x41utocleaninvoiceResponse\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\x17\n\nexpired_by\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x1a\n\rcycle_seconds\x18\x03 \x01(\x04H\x01\x88\x01\x01\x42\r\n\x0b_expired_byB\x10\n\x0e_cycle_seconds\"U\n\x13\x43heckmessageRequest\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\r\n\x05zbase\x18\x02 \x01(\t\x12\x13\n\x06pubkey\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x42\t\n\x07_pubkey\"8\n\x14\x43heckmessageResponse\x12\x10\n\x08verified\x18\x01 \x01(\x08\x12\x0e\n\x06pubkey\x18\x02 \x01(\x0c\"\xcb\x02\n\x0c\x43loseRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x1e\n\x11unilateraltimeout\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x03 \x01(\tH\x01\x88\x01\x01\x12!\n\x14\x66\x65\x65_negotiation_step\x18\x04 \x01(\tH\x02\x88\x01\x01\x12)\n\rwrong_funding\x18\x05 \x01(\x0b\x32\r.cln.OutpointH\x03\x88\x01\x01\x12\x1f\n\x12\x66orce_lease_closed\x18\x06 \x01(\x08H\x04\x88\x01\x01\x12\x1e\n\x08\x66\x65\x65range\x18\x07 \x03(\x0b\x32\x0c.cln.FeerateB\x14\n\x12_unilateraltimeoutB\x0e\n\x0c_destinationB\x17\n\x15_fee_negotiation_stepB\x10\n\x0e_wrong_fundingB\x15\n\x13_force_lease_closed\"\xab\x01\n\rCloseResponse\x12/\n\titem_type\x18\x01 \x01(\x0e\x32\x1c.cln.CloseResponse.CloseType\x12\x0f\n\x02tx\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x11\n\x04txid\x18\x03 \x01(\x0cH\x01\x88\x01\x01\"5\n\tCloseType\x12\n\n\x06MUTUAL\x10\x00\x12\x0e\n\nUNILATERAL\x10\x01\x12\x0c\n\x08UNOPENED\x10\x02\x42\x05\n\x03_txB\x07\n\x05_txid\"T\n\x0e\x43onnectRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\x04host\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04port\x18\x03 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_hostB\x07\n\x05_port\"\xb4\x01\n\x0f\x43onnectResponse\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x10\n\x08\x66\x65\x61tures\x18\x02 \x01(\x0c\x12\x38\n\tdirection\x18\x03 \x01(\x0e\x32%.cln.ConnectResponse.ConnectDirection\x12$\n\x07\x61\x64\x64ress\x18\x04 \x01(\x0b\x32\x13.cln.ConnectAddress\"#\n\x10\x43onnectDirection\x12\x06\n\x02IN\x10\x00\x12\x07\n\x03OUT\x10\x01\"\xfb\x01\n\x0e\x43onnectAddress\x12\x39\n\titem_type\x18\x01 \x01(\x0e\x32&.cln.ConnectAddress.ConnectAddressType\x12\x13\n\x06socket\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x11\n\x04port\x18\x04 \x01(\rH\x02\x88\x01\x01\"P\n\x12\x43onnectAddressType\x12\x10\n\x0cLOCAL_SOCKET\x10\x00\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\t\n\x07_socketB\n\n\x08_addressB\x07\n\x05_port\"J\n\x14\x43reateinvoiceRequest\x12\x11\n\tinvstring\x18\x01 \x01(\t\x12\r\n\x05label\x18\x02 \x01(\t\x12\x10\n\x08preimage\x18\x03 \x01(\x0c\"\xfe\x05\n\x15\x43reateinvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x06\x62olt11\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x04 \x01(\x0c\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12>\n\x06status\x18\x06 \x01(\x0e\x32..cln.CreateinvoiceResponse.CreateinvoiceStatus\x12\x13\n\x0b\x64\x65scription\x18\x07 \x01(\t\x12\x12\n\nexpires_at\x18\x08 \x01(\x04\x12\x1a\n\rcreated_index\x18\x10 \x01(\x04H\x03\x88\x01\x01\x12\x16\n\tpay_index\x18\t \x01(\x04H\x04\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x05\x88\x01\x01\x12\x14\n\x07paid_at\x18\x0b \x01(\x04H\x06\x88\x01\x01\x12;\n\rpaid_outpoint\x18\x11 \x01(\x0b\x32\x1f.cln.CreateinvoicePaid_outpointH\x07\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\x08\x88\x01\x01\x12\x1b\n\x0elocal_offer_id\x18\r \x01(\x0cH\t\x88\x01\x01\x12\x1e\n\x11invreq_payer_note\x18\x0f \x01(\tH\n\x88\x01\x01\"8\n\x13\x43reateinvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x12\n\n\x06UNPAID\x10\x02\x42\t\n\x07_bolt11B\t\n\x07_bolt12B\x0e\n\x0c_amount_msatB\x10\n\x0e_created_indexB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x10\n\x0e_paid_outpointB\x13\n\x11_payment_preimageB\x11\n\x0f_local_offer_idB\x14\n\x12_invreq_payer_note\"X\n\x1a\x43reateinvoicePaid_outpoint\x12\x11\n\x04txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x13\n\x06outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_txidB\t\n\x07_outnum\"\xb4\x02\n\x10\x44\x61tastoreRequest\x12\x0b\n\x03key\x18\x05 \x03(\t\x12\x13\n\x06string\x18\x06 \x01(\tH\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12\x36\n\x04mode\x18\x03 \x01(\x0e\x32#.cln.DatastoreRequest.DatastoreModeH\x02\x88\x01\x01\x12\x17\n\ngeneration\x18\x04 \x01(\x04H\x03\x88\x01\x01\"p\n\rDatastoreMode\x12\x0f\n\x0bMUST_CREATE\x10\x00\x12\x10\n\x0cMUST_REPLACE\x10\x01\x12\x15\n\x11\x43REATE_OR_REPLACE\x10\x02\x12\x0f\n\x0bMUST_APPEND\x10\x03\x12\x14\n\x10\x43REATE_OR_APPEND\x10\x04\x42\t\n\x07_stringB\x06\n\x04_hexB\x07\n\x05_modeB\r\n\x0b_generation\"\x82\x01\n\x11\x44\x61tastoreResponse\x12\x0b\n\x03key\x18\x05 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x12\x13\n\x06string\x18\x04 \x01(\tH\x02\x88\x01\x01\x42\r\n\x0b_generationB\x06\n\x04_hexB\t\n\x07_string\"\x17\n\x15\x44\x61tastoreusageRequest\"k\n\x16\x44\x61tastoreusageResponse\x12>\n\x0e\x64\x61tastoreusage\x18\x01 \x01(\x0b\x32!.cln.DatastoreusageDatastoreusageH\x00\x88\x01\x01\x42\x11\n\x0f_datastoreusage\"b\n\x1c\x44\x61tastoreusageDatastoreusage\x12\x10\n\x03key\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x18\n\x0btotal_bytes\x18\x02 \x01(\x04H\x01\x88\x01\x01\x42\x06\n\x04_keyB\x0e\n\x0c_total_bytes\"\x9d\x01\n\x12\x43reateonionRequest\x12\"\n\x04hops\x18\x01 \x03(\x0b\x32\x14.cln.CreateonionHops\x12\x11\n\tassocdata\x18\x02 \x01(\x0c\x12\x18\n\x0bsession_key\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x12\x17\n\nonion_size\x18\x04 \x01(\rH\x01\x88\x01\x01\x42\x0e\n\x0c_session_keyB\r\n\x0b_onion_size\"<\n\x13\x43reateonionResponse\x12\r\n\x05onion\x18\x01 \x01(\x0c\x12\x16\n\x0eshared_secrets\x18\x02 \x03(\x0c\"2\n\x0f\x43reateonionHops\x12\x0e\n\x06pubkey\x18\x01 \x01(\x0c\x12\x0f\n\x07payload\x18\x02 \x01(\x0c\"J\n\x13\x44\x65ldatastoreRequest\x12\x0b\n\x03key\x18\x03 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\r\n\x0b_generation\"\x85\x01\n\x14\x44\x65ldatastoreResponse\x12\x0b\n\x03key\x18\x05 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x12\x13\n\x06string\x18\x04 \x01(\tH\x02\x88\x01\x01\x42\r\n\x0b_generationB\x06\n\x04_hexB\t\n\x07_string\"H\n\x18\x44\x65lexpiredinvoiceRequest\x12\x1a\n\rmaxexpirytime\x18\x01 \x01(\x04H\x00\x88\x01\x01\x42\x10\n\x0e_maxexpirytime\"\x1b\n\x19\x44\x65lexpiredinvoiceResponse\"\xb6\x01\n\x11\x44\x65linvoiceRequest\x12\r\n\x05label\x18\x01 \x01(\t\x12\x37\n\x06status\x18\x02 \x01(\x0e\x32\'.cln.DelinvoiceRequest.DelinvoiceStatus\x12\x15\n\x08\x64\x65sconly\x18\x03 \x01(\x08H\x00\x88\x01\x01\"5\n\x10\x44\x65linvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x12\n\n\x06UNPAID\x10\x02\x42\x0b\n\t_desconly\"\xa1\x04\n\x12\x44\x65linvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x06\x62olt11\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x03 \x01(\tH\x01\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x06 \x01(\x0c\x12\x1a\n\rcreated_index\x18\x0c \x01(\x04H\x04\x88\x01\x01\x12\x1a\n\rupdated_index\x18\r \x01(\x04H\x05\x88\x01\x01\x12\x38\n\x06status\x18\x07 \x01(\x0e\x32(.cln.DelinvoiceResponse.DelinvoiceStatus\x12\x12\n\nexpires_at\x18\x08 \x01(\x04\x12\x1b\n\x0elocal_offer_id\x18\t \x01(\x0cH\x06\x88\x01\x01\x12\x1e\n\x11invreq_payer_note\x18\x0b \x01(\tH\x07\x88\x01\x01\"5\n\x10\x44\x65linvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x12\n\n\x06UNPAID\x10\x02\x42\t\n\x07_bolt11B\t\n\x07_bolt12B\x0e\n\x0c_amount_msatB\x0e\n\x0c_descriptionB\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\x11\n\x0f_local_offer_idB\x14\n\x12_invreq_payer_note\"\xfa\x01\n\x0eInvoiceRequest\x12%\n\x0b\x61mount_msat\x18\n \x01(\x0b\x32\x10.cln.AmountOrAny\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\r\n\x05label\x18\x03 \x01(\t\x12\x13\n\x06\x65xpiry\x18\x07 \x01(\x04H\x00\x88\x01\x01\x12\x11\n\tfallbacks\x18\x04 \x03(\t\x12\x15\n\x08preimage\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x11\n\x04\x63ltv\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x19\n\x0c\x64\x65schashonly\x18\t \x01(\x08H\x03\x88\x01\x01\x42\t\n\x07_expiryB\x0b\n\t_preimageB\x07\n\x05_cltvB\x0f\n\r_deschashonly\"\x95\x03\n\x0fInvoiceResponse\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\x0c\x12\x16\n\x0epayment_secret\x18\x03 \x01(\x0c\x12\x12\n\nexpires_at\x18\x04 \x01(\x04\x12\x1a\n\rcreated_index\x18\n \x01(\x04H\x00\x88\x01\x01\x12\x1d\n\x10warning_capacity\x18\x05 \x01(\tH\x01\x88\x01\x01\x12\x1c\n\x0fwarning_offline\x18\x06 \x01(\tH\x02\x88\x01\x01\x12\x1d\n\x10warning_deadends\x18\x07 \x01(\tH\x03\x88\x01\x01\x12#\n\x16warning_private_unused\x18\x08 \x01(\tH\x04\x88\x01\x01\x12\x18\n\x0bwarning_mpp\x18\t \x01(\tH\x05\x88\x01\x01\x42\x10\n\x0e_created_indexB\x13\n\x11_warning_capacityB\x12\n\x10_warning_offlineB\x13\n\x11_warning_deadendsB\x19\n\x17_warning_private_unusedB\x0e\n\x0c_warning_mpp\"#\n\x14ListdatastoreRequest\x12\x0b\n\x03key\x18\x02 \x03(\t\"G\n\x15ListdatastoreResponse\x12.\n\tdatastore\x18\x01 \x03(\x0b\x32\x1b.cln.ListdatastoreDatastore\"\x87\x01\n\x16ListdatastoreDatastore\x12\x0b\n\x03key\x18\x01 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x12\x13\n\x06string\x18\x04 \x01(\tH\x02\x88\x01\x01\x42\r\n\x0b_generationB\x06\n\x04_hexB\t\n\x07_string\"\xde\x02\n\x13ListinvoicesRequest\x12\x12\n\x05label\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x16\n\tinvstring\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x03 \x01(\x0cH\x02\x88\x01\x01\x12\x15\n\x08offer_id\x18\x04 \x01(\tH\x03\x88\x01\x01\x12>\n\x05index\x18\x05 \x01(\x0e\x32*.cln.ListinvoicesRequest.ListinvoicesIndexH\x04\x88\x01\x01\x12\x12\n\x05start\x18\x06 \x01(\x04H\x05\x88\x01\x01\x12\x12\n\x05limit\x18\x07 \x01(\rH\x06\x88\x01\x01\"-\n\x11ListinvoicesIndex\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07UPDATED\x10\x01\x42\x08\n\x06_labelB\x0c\n\n_invstringB\x0f\n\r_payment_hashB\x0b\n\t_offer_idB\x08\n\x06_indexB\x08\n\x06_startB\x08\n\x06_limit\"C\n\x14ListinvoicesResponse\x12+\n\x08invoices\x18\x01 \x03(\x0b\x32\x19.cln.ListinvoicesInvoices\"\xd4\x06\n\x14ListinvoicesInvoices\x12\r\n\x05label\x18\x01 \x01(\t\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x44\n\x06status\x18\x04 \x01(\x0e\x32\x34.cln.ListinvoicesInvoices.ListinvoicesInvoicesStatus\x12\x12\n\nexpires_at\x18\x05 \x01(\x04\x12%\n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x08 \x01(\tH\x03\x88\x01\x01\x12\x1b\n\x0elocal_offer_id\x18\t \x01(\x0cH\x04\x88\x01\x01\x12\x1e\n\x11invreq_payer_note\x18\x0f \x01(\tH\x05\x88\x01\x01\x12\x1a\n\rcreated_index\x18\x10 \x01(\x04H\x06\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x11 \x01(\x04H\x07\x88\x01\x01\x12\x16\n\tpay_index\x18\x0b \x01(\x04H\x08\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\x0c \x01(\x0b\x32\x0b.cln.AmountH\t\x88\x01\x01\x12\x14\n\x07paid_at\x18\r \x01(\x04H\n\x88\x01\x01\x12\x42\n\rpaid_outpoint\x18\x12 \x01(\x0b\x32&.cln.ListinvoicesInvoicesPaid_outpointH\x0b\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0e \x01(\x0cH\x0c\x88\x01\x01\"?\n\x1aListinvoicesInvoicesStatus\x12\n\n\x06UNPAID\x10\x00\x12\x08\n\x04PAID\x10\x01\x12\x0b\n\x07\x45XPIRED\x10\x02\x42\x0e\n\x0c_descriptionB\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\t\n\x07_bolt12B\x11\n\x0f_local_offer_idB\x14\n\x12_invreq_payer_noteB\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x10\n\x0e_paid_outpointB\x13\n\x11_payment_preimage\"_\n!ListinvoicesInvoicesPaid_outpoint\x12\x11\n\x04txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x13\n\x06outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_txidB\t\n\x07_outnum\"\x8a\x03\n\x10SendonionRequest\x12\r\n\x05onion\x18\x01 \x01(\x0c\x12*\n\tfirst_hop\x18\x02 \x01(\x0b\x32\x17.cln.SendonionFirst_hop\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x12\n\x05label\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x16\n\x0eshared_secrets\x18\x05 \x03(\x0c\x12\x13\n\x06partid\x18\x06 \x01(\rH\x01\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x02\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x0c \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\t \x01(\x0cH\x04\x88\x01\x01\x12\x1a\n\rlocalinvreqid\x18\r \x01(\x0cH\x05\x88\x01\x01\x12\x14\n\x07groupid\x18\x0b \x01(\x04H\x06\x88\x01\x01\x42\x08\n\x06_labelB\t\n\x07_partidB\t\n\x07_bolt11B\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x10\n\x0e_localinvreqidB\n\n\x08_groupid\"\xe7\x04\n\x11SendonionResponse\x12\x1a\n\rcreated_index\x18\x0e \x01(\x04H\x00\x88\x01\x01\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\x0c\x12\x36\n\x06status\x18\x03 \x01(\x0e\x32&.cln.SendonionResponse.SendonionStatus\x12%\n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x05 \x01(\x0cH\x02\x88\x01\x01\x12\x12\n\ncreated_at\x18\x06 \x01(\x04\x12%\n\x10\x61mount_sent_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\x08 \x01(\tH\x03\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\t \x01(\tH\x04\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\n \x01(\tH\x05\x88\x01\x01\x12\x13\n\x06partid\x18\r \x01(\x04H\x06\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x0f \x01(\x04H\x07\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0b \x01(\x0cH\x08\x88\x01\x01\x12\x14\n\x07message\x18\x0c \x01(\tH\t\x88\x01\x01\",\n\x0fSendonionStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x42\x10\n\x0e_created_indexB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x08\n\x06_labelB\t\n\x07_bolt11B\t\n\x07_bolt12B\t\n\x07_partidB\x10\n\x0e_updated_indexB\x13\n\x11_payment_preimageB\n\n\x08_message\"Q\n\x12SendonionFirst_hop\x12\n\n\x02id\x18\x01 \x01(\x0c\x12 \n\x0b\x61mount_msat\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\x12\r\n\x05\x64\x65lay\x18\x03 \x01(\r\"\xa0\x03\n\x13ListsendpaysRequest\x12\x13\n\x06\x62olt11\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12@\n\x06status\x18\x03 \x01(\x0e\x32+.cln.ListsendpaysRequest.ListsendpaysStatusH\x02\x88\x01\x01\x12>\n\x05index\x18\x04 \x01(\x0e\x32*.cln.ListsendpaysRequest.ListsendpaysIndexH\x03\x88\x01\x01\x12\x12\n\x05start\x18\x05 \x01(\x04H\x04\x88\x01\x01\x12\x12\n\x05limit\x18\x06 \x01(\rH\x05\x88\x01\x01\";\n\x12ListsendpaysStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\"-\n\x11ListsendpaysIndex\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07UPDATED\x10\x01\x42\t\n\x07_bolt11B\x0f\n\r_payment_hashB\t\n\x07_statusB\x08\n\x06_indexB\x08\n\x06_startB\x08\n\x06_limit\"C\n\x14ListsendpaysResponse\x12+\n\x08payments\x18\x01 \x03(\x0b\x32\x19.cln.ListsendpaysPayments\"\xd0\x05\n\x14ListsendpaysPayments\x12\x1a\n\rcreated_index\x18\x10 \x01(\x04H\x00\x88\x01\x01\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x0f\n\x07groupid\x18\x02 \x01(\x04\x12\x13\n\x06partid\x18\x0f \x01(\x04H\x01\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x1a\n\rupdated_index\x18\x11 \x01(\x04H\x02\x88\x01\x01\x12\x44\n\x06status\x18\x04 \x01(\x0e\x32\x34.cln.ListsendpaysPayments.ListsendpaysPaymentsStatus\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x06 \x01(\x0cH\x04\x88\x01\x01\x12\x12\n\ncreated_at\x18\x07 \x01(\x04\x12%\n\x10\x61mount_sent_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\t \x01(\tH\x05\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\n \x01(\tH\x06\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x0e \x01(\tH\x07\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x0b \x01(\tH\x08\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\t\x88\x01\x01\x12\x17\n\nerroronion\x18\r \x01(\x0cH\n\x88\x01\x01\"C\n\x1aListsendpaysPaymentsStatus\x12\x0b\n\x07PENDING\x10\x00\x12\n\n\x06\x46\x41ILED\x10\x01\x12\x0c\n\x08\x43OMPLETE\x10\x02\x42\x10\n\x0e_created_indexB\t\n\x07_partidB\x10\n\x0e_updated_indexB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x08\n\x06_labelB\t\n\x07_bolt11B\x0e\n\x0c_descriptionB\t\n\x07_bolt12B\x13\n\x11_payment_preimageB\r\n\x0b_erroronion\"\x19\n\x17ListtransactionsRequest\"S\n\x18ListtransactionsResponse\x12\x37\n\x0ctransactions\x18\x01 \x03(\x0b\x32!.cln.ListtransactionsTransactions\"\xf8\x01\n\x1cListtransactionsTransactions\x12\x0c\n\x04hash\x18\x01 \x01(\x0c\x12\r\n\x05rawtx\x18\x02 \x01(\x0c\x12\x13\n\x0b\x62lockheight\x18\x03 \x01(\r\x12\x0f\n\x07txindex\x18\x04 \x01(\r\x12\x10\n\x08locktime\x18\x07 \x01(\r\x12\x0f\n\x07version\x18\x08 \x01(\r\x12\x37\n\x06inputs\x18\t \x03(\x0b\x32\'.cln.ListtransactionsTransactionsInputs\x12\x39\n\x07outputs\x18\n \x03(\x0b\x32(.cln.ListtransactionsTransactionsOutputs\"S\n\"ListtransactionsTransactionsInputs\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\r\n\x05index\x18\x02 \x01(\r\x12\x10\n\x08sequence\x18\x03 \x01(\r\"l\n#ListtransactionsTransactionsOutputs\x12\r\n\x05index\x18\x01 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12\x14\n\x0cscriptPubKey\x18\x03 \x01(\x0c\"\xda\x03\n\nPayRequest\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\x12%\n\x0b\x61mount_msat\x18\r \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x12\n\x05label\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x17\n\nriskfactor\x18\x08 \x01(\x01H\x02\x88\x01\x01\x12\x1a\n\rmaxfeepercent\x18\x04 \x01(\x01H\x03\x88\x01\x01\x12\x16\n\tretry_for\x18\x05 \x01(\rH\x04\x88\x01\x01\x12\x15\n\x08maxdelay\x18\x06 \x01(\rH\x05\x88\x01\x01\x12#\n\texemptfee\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x1a\n\rlocalinvreqid\x18\x0e \x01(\x0cH\x07\x88\x01\x01\x12\x0f\n\x07\x65xclude\x18\n \x03(\t\x12 \n\x06maxfee\x18\x0b \x01(\x0b\x32\x0b.cln.AmountH\x08\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x0c \x01(\tH\t\x88\x01\x01\x42\x0e\n\x0c_amount_msatB\x08\n\x06_labelB\r\n\x0b_riskfactorB\x10\n\x0e_maxfeepercentB\x0c\n\n_retry_forB\x0b\n\t_maxdelayB\x0c\n\n_exemptfeeB\x10\n\x0e_localinvreqidB\t\n\x07_maxfeeB\x0e\n\x0c_description\"\xfb\x02\n\x0bPayResponse\x12\x18\n\x10payment_preimage\x18\x01 \x01(\x0c\x12\x18\n\x0b\x64\x65stination\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x12\n\ncreated_at\x18\x04 \x01(\x01\x12\r\n\x05parts\x18\x05 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10\x61mount_sent_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\'\n\x1awarning_partial_completion\x18\x08 \x01(\tH\x01\x88\x01\x01\x12*\n\x06status\x18\t \x01(\x0e\x32\x1a.cln.PayResponse.PayStatus\"2\n\tPayStatus\x12\x0c\n\x08\x43OMPLETE\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x42\x0e\n\x0c_destinationB\x1d\n\x1b_warning_partial_completion\"*\n\x10ListnodesRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x05\n\x03_id\"7\n\x11ListnodesResponse\x12\"\n\x05nodes\x18\x01 \x03(\x0b\x32\x13.cln.ListnodesNodes\"\xe1\x01\n\x0eListnodesNodes\x12\x0e\n\x06nodeid\x18\x01 \x01(\x0c\x12\x1b\n\x0elast_timestamp\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x12\n\x05\x61lias\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x12\n\x05\x63olor\x18\x04 \x01(\x0cH\x02\x88\x01\x01\x12\x15\n\x08\x66\x65\x61tures\x18\x05 \x01(\x0cH\x03\x88\x01\x01\x12/\n\taddresses\x18\x06 \x03(\x0b\x32\x1c.cln.ListnodesNodesAddressesB\x11\n\x0f_last_timestampB\x08\n\x06_aliasB\x08\n\x06_colorB\x0b\n\t_features\"\xe8\x01\n\x17ListnodesNodesAddresses\x12K\n\titem_type\x18\x01 \x01(\x0e\x32\x38.cln.ListnodesNodesAddresses.ListnodesNodesAddressesType\x12\x0c\n\x04port\x18\x02 \x01(\r\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x00\x88\x01\x01\"P\n\x1bListnodesNodesAddressesType\x12\x07\n\x03\x44NS\x10\x00\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\n\n\x08_address\"g\n\x15WaitanyinvoiceRequest\x12\x1a\n\rlastpay_index\x18\x01 \x01(\x04H\x00\x88\x01\x01\x12\x14\n\x07timeout\x18\x02 \x01(\x04H\x01\x88\x01\x01\x42\x10\n\x0e_lastpay_indexB\n\n\x08_timeout\"\xbf\x05\n\x16WaitanyinvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12@\n\x06status\x18\x04 \x01(\x0e\x32\x30.cln.WaitanyinvoiceResponse.WaitanyinvoiceStatus\x12\x12\n\nexpires_at\x18\x05 \x01(\x04\x12%\n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x08 \x01(\tH\x02\x88\x01\x01\x12\x1a\n\rcreated_index\x18\r \x01(\x04H\x03\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x0e \x01(\x04H\x04\x88\x01\x01\x12\x16\n\tpay_index\x18\t \x01(\x04H\x05\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x14\n\x07paid_at\x18\x0b \x01(\x04H\x07\x88\x01\x01\x12<\n\rpaid_outpoint\x18\x0f \x01(\x0b\x32 .cln.WaitanyinvoicePaid_outpointH\x08\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\t\x88\x01\x01\"-\n\x14WaitanyinvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x42\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\t\n\x07_bolt12B\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x10\n\x0e_paid_outpointB\x13\n\x11_payment_preimage\"Y\n\x1bWaitanyinvoicePaid_outpoint\x12\x11\n\x04txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x13\n\x06outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_txidB\t\n\x07_outnum\"#\n\x12WaitinvoiceRequest\x12\r\n\x05label\x18\x01 \x01(\t\"\xb0\x05\n\x13WaitinvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12:\n\x06status\x18\x04 \x01(\x0e\x32*.cln.WaitinvoiceResponse.WaitinvoiceStatus\x12\x12\n\nexpires_at\x18\x05 \x01(\x04\x12%\n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x08 \x01(\tH\x02\x88\x01\x01\x12\x1a\n\rcreated_index\x18\r \x01(\x04H\x03\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x0e \x01(\x04H\x04\x88\x01\x01\x12\x16\n\tpay_index\x18\t \x01(\x04H\x05\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x14\n\x07paid_at\x18\x0b \x01(\x04H\x07\x88\x01\x01\x12\x39\n\rpaid_outpoint\x18\x0f \x01(\x0b\x32\x1d.cln.WaitinvoicePaid_outpointH\x08\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\t\x88\x01\x01\"*\n\x11WaitinvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x42\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\t\n\x07_bolt12B\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x10\n\x0e_paid_outpointB\x13\n\x11_payment_preimage\"V\n\x18WaitinvoicePaid_outpoint\x12\x11\n\x04txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x13\n\x06outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_txidB\t\n\x07_outnum\"\x8e\x01\n\x12WaitsendpayRequest\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x14\n\x07timeout\x18\x03 \x01(\rH\x00\x88\x01\x01\x12\x13\n\x06partid\x18\x02 \x01(\x04H\x01\x88\x01\x01\x12\x14\n\x07groupid\x18\x04 \x01(\x04H\x02\x88\x01\x01\x42\n\n\x08_timeoutB\t\n\x07_partidB\n\n\x08_groupid\"\x8e\x05\n\x13WaitsendpayResponse\x12\x1a\n\rcreated_index\x18\x0f \x01(\x04H\x00\x88\x01\x01\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x14\n\x07groupid\x18\x02 \x01(\x04H\x01\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12:\n\x06status\x18\x04 \x01(\x0e\x32*.cln.WaitsendpayResponse.WaitsendpayStatus\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x06 \x01(\x0cH\x03\x88\x01\x01\x12\x12\n\ncreated_at\x18\x07 \x01(\x04\x12\x1a\n\rupdated_index\x18\x10 \x01(\x04H\x04\x88\x01\x01\x12\x19\n\x0c\x63ompleted_at\x18\x0e \x01(\x01H\x05\x88\x01\x01\x12%\n\x10\x61mount_sent_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\t \x01(\tH\x06\x88\x01\x01\x12\x13\n\x06partid\x18\n \x01(\x04H\x07\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x0b \x01(\tH\x08\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x0c \x01(\tH\t\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\r \x01(\x0cH\n\x88\x01\x01\"!\n\x11WaitsendpayStatus\x12\x0c\n\x08\x43OMPLETE\x10\x00\x42\x10\n\x0e_created_indexB\n\n\x08_groupidB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x10\n\x0e_updated_indexB\x0f\n\r_completed_atB\x08\n\x06_labelB\t\n\x07_partidB\t\n\x07_bolt11B\t\n\x07_bolt12B\x13\n\x11_payment_preimage\"\x97\x01\n\x0eNewaddrRequest\x12@\n\x0b\x61\x64\x64resstype\x18\x01 \x01(\x0e\x32&.cln.NewaddrRequest.NewaddrAddresstypeH\x00\x88\x01\x01\"3\n\x12NewaddrAddresstype\x12\n\n\x06\x42\x45\x43H32\x10\x00\x12\x08\n\x04P2TR\x10\x03\x12\x07\n\x03\x41LL\x10\x02\x42\x0e\n\x0c_addresstype\"M\n\x0fNewaddrResponse\x12\x11\n\x04p2tr\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06\x62\x65\x63h32\x18\x01 \x01(\tH\x01\x88\x01\x01\x42\x07\n\x05_p2trB\t\n\x07_bech32\"\xca\x01\n\x0fWithdrawRequest\x12\x13\n\x0b\x64\x65stination\x18\x01 \x01(\t\x12&\n\x07satoshi\x18\x02 \x01(\x0b\x32\x10.cln.AmountOrAllH\x00\x88\x01\x01\x12\"\n\x07\x66\x65\x65rate\x18\x05 \x01(\x0b\x32\x0c.cln.FeerateH\x01\x88\x01\x01\x12\x14\n\x07minconf\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\x1c\n\x05utxos\x18\x04 \x03(\x0b\x32\r.cln.OutpointB\n\n\x08_satoshiB\n\n\x08_feerateB\n\n\x08_minconf\":\n\x10WithdrawResponse\x12\n\n\x02tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\x12\x0c\n\x04psbt\x18\x03 \x01(\t\"\x82\x03\n\x0eKeysendRequest\x12\x13\n\x0b\x64\x65stination\x18\x01 \x01(\x0c\x12 \n\x0b\x61mount_msat\x18\n \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x1a\n\rmaxfeepercent\x18\x04 \x01(\x01H\x01\x88\x01\x01\x12\x16\n\tretry_for\x18\x05 \x01(\rH\x02\x88\x01\x01\x12\x15\n\x08maxdelay\x18\x06 \x01(\rH\x03\x88\x01\x01\x12#\n\texemptfee\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x12+\n\nroutehints\x18\x08 \x01(\x0b\x32\x12.cln.RoutehintListH\x05\x88\x01\x01\x12&\n\textratlvs\x18\t \x01(\x0b\x32\x0e.cln.TlvStreamH\x06\x88\x01\x01\x42\x08\n\x06_labelB\x10\n\x0e_maxfeepercentB\x0c\n\n_retry_forB\x0b\n\t_maxdelayB\x0c\n\n_exemptfeeB\r\n\x0b_routehintsB\x0c\n\n_extratlvs\"\xf2\x02\n\x0fKeysendResponse\x12\x18\n\x10payment_preimage\x18\x01 \x01(\x0c\x12\x18\n\x0b\x64\x65stination\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x12\n\ncreated_at\x18\x04 \x01(\x01\x12\r\n\x05parts\x18\x05 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10\x61mount_sent_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\'\n\x1awarning_partial_completion\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\x32\n\x06status\x18\t \x01(\x0e\x32\".cln.KeysendResponse.KeysendStatus\"\x1d\n\rKeysendStatus\x12\x0c\n\x08\x43OMPLETE\x10\x00\x42\x0e\n\x0c_destinationB\x1d\n\x1b_warning_partial_completion\"\xa4\x03\n\x0f\x46undpsbtRequest\x12!\n\x07satoshi\x18\x01 \x01(\x0b\x32\x10.cln.AmountOrAll\x12\x1d\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.Feerate\x12\x13\n\x0bstartweight\x18\x03 \x01(\r\x12\x14\n\x07minconf\x18\x04 \x01(\rH\x00\x88\x01\x01\x12\x14\n\x07reserve\x18\x05 \x01(\rH\x01\x88\x01\x01\x12\x15\n\x08locktime\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x1f\n\x12min_witness_weight\x18\x07 \x01(\rH\x03\x88\x01\x01\x12\x1d\n\x10\x65xcess_as_change\x18\x08 \x01(\x08H\x04\x88\x01\x01\x12\x17\n\nnonwrapped\x18\t \x01(\x08H\x05\x88\x01\x01\x12#\n\x16opening_anchor_channel\x18\n \x01(\x08H\x06\x88\x01\x01\x42\n\n\x08_minconfB\n\n\x08_reserveB\x0b\n\t_locktimeB\x15\n\x13_min_witness_weightB\x13\n\x11_excess_as_changeB\r\n\x0b_nonwrappedB\x19\n\x17_opening_anchor_channel\"\xd9\x01\n\x10\x46undpsbtResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x16\n\x0e\x66\x65\x65rate_per_kw\x18\x02 \x01(\r\x12\x1e\n\x16\x65stimated_final_weight\x18\x03 \x01(\r\x12 \n\x0b\x65xcess_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\x1a\n\rchange_outnum\x18\x05 \x01(\rH\x00\x88\x01\x01\x12/\n\x0creservations\x18\x06 \x03(\x0b\x32\x19.cln.FundpsbtReservationsB\x10\n\x0e_change_outnum\"u\n\x14\x46undpsbtReservations\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x0c\n\x04vout\x18\x02 \x01(\r\x12\x14\n\x0cwas_reserved\x18\x03 \x01(\x08\x12\x10\n\x08reserved\x18\x04 \x01(\x08\x12\x19\n\x11reserved_to_block\x18\x05 \x01(\r\"A\n\x0fSendpsbtRequest\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x14\n\x07reserve\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\n\n\x08_reserve\",\n\x10SendpsbtResponse\x12\n\n\x02tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\"1\n\x0fSignpsbtRequest\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x10\n\x08signonly\x18\x02 \x03(\r\"\'\n\x10SignpsbtResponse\x12\x13\n\x0bsigned_psbt\x18\x01 \x01(\t\"\x9b\x03\n\x0fUtxopsbtRequest\x12\x1c\n\x07satoshi\x18\x01 \x01(\x0b\x32\x0b.cln.Amount\x12\x1d\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.Feerate\x12\x13\n\x0bstartweight\x18\x03 \x01(\r\x12\x1c\n\x05utxos\x18\x04 \x03(\x0b\x32\r.cln.Outpoint\x12\x14\n\x07reserve\x18\x05 \x01(\rH\x00\x88\x01\x01\x12\x17\n\nreservedok\x18\x08 \x01(\x08H\x01\x88\x01\x01\x12\x15\n\x08locktime\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x1f\n\x12min_witness_weight\x18\x07 \x01(\rH\x03\x88\x01\x01\x12\x1d\n\x10\x65xcess_as_change\x18\t \x01(\x08H\x04\x88\x01\x01\x12#\n\x16opening_anchor_channel\x18\n \x01(\x08H\x05\x88\x01\x01\x42\n\n\x08_reserveB\r\n\x0b_reservedokB\x0b\n\t_locktimeB\x15\n\x13_min_witness_weightB\x13\n\x11_excess_as_changeB\x19\n\x17_opening_anchor_channel\"\xd9\x01\n\x10UtxopsbtResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x16\n\x0e\x66\x65\x65rate_per_kw\x18\x02 \x01(\r\x12\x1e\n\x16\x65stimated_final_weight\x18\x03 \x01(\r\x12 \n\x0b\x65xcess_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\x1a\n\rchange_outnum\x18\x05 \x01(\rH\x00\x88\x01\x01\x12/\n\x0creservations\x18\x06 \x03(\x0b\x32\x19.cln.UtxopsbtReservationsB\x10\n\x0e_change_outnum\"u\n\x14UtxopsbtReservations\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x0c\n\x04vout\x18\x02 \x01(\r\x12\x14\n\x0cwas_reserved\x18\x03 \x01(\x08\x12\x10\n\x08reserved\x18\x04 \x01(\x08\x12\x19\n\x11reserved_to_block\x18\x05 \x01(\r\" \n\x10TxdiscardRequest\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\"6\n\x11TxdiscardResponse\x12\x13\n\x0bunsigned_tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\"\xa4\x01\n\x10TxprepareRequest\x12 \n\x07outputs\x18\x05 \x03(\x0b\x32\x0f.cln.OutputDesc\x12\"\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.FeerateH\x00\x88\x01\x01\x12\x14\n\x07minconf\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x1c\n\x05utxos\x18\x04 \x03(\x0b\x32\r.cln.OutpointB\n\n\x08_feerateB\n\n\x08_minconf\"D\n\x11TxprepareResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x13\n\x0bunsigned_tx\x18\x02 \x01(\x0c\x12\x0c\n\x04txid\x18\x03 \x01(\x0c\"\x1d\n\rTxsendRequest\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\"8\n\x0eTxsendResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\n\n\x02tx\x18\x02 \x01(\x0c\x12\x0c\n\x04txid\x18\x03 \x01(\x0c\"1\n\x17ListpeerchannelsRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x05\n\x03_id\"K\n\x18ListpeerchannelsResponse\x12/\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x1d.cln.ListpeerchannelsChannels\"\x8a\x1b\n\x18ListpeerchannelsChannels\x12\x14\n\x07peer_id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x1b\n\x0epeer_connected\x18\x02 \x01(\x08H\x01\x88\x01\x01\x12O\n\x05state\x18\x03 \x01(\x0e\x32;.cln.ListpeerchannelsChannels.ListpeerchannelsChannelsStateH\x02\x88\x01\x01\x12\x19\n\x0cscratch_txid\x18\x04 \x01(\x0cH\x03\x88\x01\x01\x12:\n\x07updates\x18\x37 \x01(\x0b\x32$.cln.ListpeerchannelsChannelsUpdatesH\x04\x88\x01\x01\x12\x1e\n\x11ignore_fee_limits\x18\x36 \x01(\x08H\x05\x88\x01\x01\x12\x17\n\nlost_state\x18\x39 \x01(\x08H\x06\x88\x01\x01\x12:\n\x07\x66\x65\x65rate\x18\x06 \x01(\x0b\x32$.cln.ListpeerchannelsChannelsFeerateH\x07\x88\x01\x01\x12\x12\n\x05owner\x18\x07 \x01(\tH\x08\x88\x01\x01\x12\x1d\n\x10short_channel_id\x18\x08 \x01(\tH\t\x88\x01\x01\x12\x17\n\nchannel_id\x18\t \x01(\x0cH\n\x88\x01\x01\x12\x19\n\x0c\x66unding_txid\x18\n \x01(\x0cH\x0b\x88\x01\x01\x12\x1b\n\x0e\x66unding_outnum\x18\x0b \x01(\rH\x0c\x88\x01\x01\x12\x1c\n\x0finitial_feerate\x18\x0c \x01(\tH\r\x88\x01\x01\x12\x19\n\x0clast_feerate\x18\r \x01(\tH\x0e\x88\x01\x01\x12\x19\n\x0cnext_feerate\x18\x0e \x01(\tH\x0f\x88\x01\x01\x12\x1a\n\rnext_fee_step\x18\x0f \x01(\rH\x10\x88\x01\x01\x12\x37\n\x08inflight\x18\x10 \x03(\x0b\x32%.cln.ListpeerchannelsChannelsInflight\x12\x15\n\x08\x63lose_to\x18\x11 \x01(\x0cH\x11\x88\x01\x01\x12\x14\n\x07private\x18\x12 \x01(\x08H\x12\x88\x01\x01\x12%\n\x06opener\x18\x13 \x01(\x0e\x32\x10.cln.ChannelSideH\x13\x88\x01\x01\x12%\n\x06\x63loser\x18\x14 \x01(\x0e\x32\x10.cln.ChannelSideH\x14\x88\x01\x01\x12:\n\x07\x66unding\x18\x16 \x01(\x0b\x32$.cln.ListpeerchannelsChannelsFundingH\x15\x88\x01\x01\x12$\n\nto_us_msat\x18\x17 \x01(\x0b\x32\x0b.cln.AmountH\x16\x88\x01\x01\x12(\n\x0emin_to_us_msat\x18\x18 \x01(\x0b\x32\x0b.cln.AmountH\x17\x88\x01\x01\x12(\n\x0emax_to_us_msat\x18\x19 \x01(\x0b\x32\x0b.cln.AmountH\x18\x88\x01\x01\x12$\n\ntotal_msat\x18\x1a \x01(\x0b\x32\x0b.cln.AmountH\x19\x88\x01\x01\x12\'\n\rfee_base_msat\x18\x1b \x01(\x0b\x32\x0b.cln.AmountH\x1a\x88\x01\x01\x12(\n\x1b\x66\x65\x65_proportional_millionths\x18\x1c \x01(\rH\x1b\x88\x01\x01\x12)\n\x0f\x64ust_limit_msat\x18\x1d \x01(\x0b\x32\x0b.cln.AmountH\x1c\x88\x01\x01\x12\x30\n\x16max_total_htlc_in_msat\x18\x1e \x01(\x0b\x32\x0b.cln.AmountH\x1d\x88\x01\x01\x12,\n\x12their_reserve_msat\x18\x1f \x01(\x0b\x32\x0b.cln.AmountH\x1e\x88\x01\x01\x12*\n\x10our_reserve_msat\x18 \x01(\x0b\x32\x0b.cln.AmountH\x1f\x88\x01\x01\x12(\n\x0espendable_msat\x18! \x01(\x0b\x32\x0b.cln.AmountH \x88\x01\x01\x12)\n\x0freceivable_msat\x18\" \x01(\x0b\x32\x0b.cln.AmountH!\x88\x01\x01\x12.\n\x14minimum_htlc_in_msat\x18# \x01(\x0b\x32\x0b.cln.AmountH\"\x88\x01\x01\x12/\n\x15minimum_htlc_out_msat\x18$ \x01(\x0b\x32\x0b.cln.AmountH#\x88\x01\x01\x12/\n\x15maximum_htlc_out_msat\x18% \x01(\x0b\x32\x0b.cln.AmountH$\x88\x01\x01\x12 \n\x13their_to_self_delay\x18& \x01(\rH%\x88\x01\x01\x12\x1e\n\x11our_to_self_delay\x18\' \x01(\rH&\x88\x01\x01\x12\x1f\n\x12max_accepted_htlcs\x18( \x01(\rH\'\x88\x01\x01\x12\x36\n\x05\x61lias\x18) \x01(\x0b\x32\".cln.ListpeerchannelsChannelsAliasH(\x88\x01\x01\x12\x0e\n\x06status\x18+ \x03(\t\x12 \n\x13in_payments_offered\x18, \x01(\x04H)\x88\x01\x01\x12)\n\x0fin_offered_msat\x18- \x01(\x0b\x32\x0b.cln.AmountH*\x88\x01\x01\x12\"\n\x15in_payments_fulfilled\x18. \x01(\x04H+\x88\x01\x01\x12+\n\x11in_fulfilled_msat\x18/ \x01(\x0b\x32\x0b.cln.AmountH,\x88\x01\x01\x12!\n\x14out_payments_offered\x18\x30 \x01(\x04H-\x88\x01\x01\x12*\n\x10out_offered_msat\x18\x31 \x01(\x0b\x32\x0b.cln.AmountH.\x88\x01\x01\x12#\n\x16out_payments_fulfilled\x18\x32 \x01(\x04H/\x88\x01\x01\x12,\n\x12out_fulfilled_msat\x18\x33 \x01(\x0b\x32\x0b.cln.AmountH0\x88\x01\x01\x12#\n\x16last_stable_connection\x18\x38 \x01(\x04H1\x88\x01\x01\x12\x31\n\x05htlcs\x18\x34 \x03(\x0b\x32\".cln.ListpeerchannelsChannelsHtlcs\x12\x1a\n\rclose_to_addr\x18\x35 \x01(\tH2\x88\x01\x01\"\x80\x03\n\x1dListpeerchannelsChannelsState\x12\x0c\n\x08OPENINGD\x10\x00\x12\x1c\n\x18\x43HANNELD_AWAITING_LOCKIN\x10\x01\x12\x13\n\x0f\x43HANNELD_NORMAL\x10\x02\x12\x1a\n\x16\x43HANNELD_SHUTTING_DOWN\x10\x03\x12\x18\n\x14\x43LOSINGD_SIGEXCHANGE\x10\x04\x12\x15\n\x11\x43LOSINGD_COMPLETE\x10\x05\x12\x17\n\x13\x41WAITING_UNILATERAL\x10\x06\x12\x16\n\x12\x46UNDING_SPEND_SEEN\x10\x07\x12\x0b\n\x07ONCHAIN\x10\x08\x12\x17\n\x13\x44UALOPEND_OPEN_INIT\x10\t\x12\x1d\n\x19\x44UALOPEND_AWAITING_LOCKIN\x10\n\x12\x1c\n\x18\x43HANNELD_AWAITING_SPLICE\x10\x0b\x12\x1c\n\x18\x44UALOPEND_OPEN_COMMITTED\x10\x0c\x12\x1f\n\x1b\x44UALOPEND_OPEN_COMMIT_READY\x10\rB\n\n\x08_peer_idB\x11\n\x0f_peer_connectedB\x08\n\x06_stateB\x0f\n\r_scratch_txidB\n\n\x08_updatesB\x14\n\x12_ignore_fee_limitsB\r\n\x0b_lost_stateB\n\n\x08_feerateB\x08\n\x06_ownerB\x13\n\x11_short_channel_idB\r\n\x0b_channel_idB\x0f\n\r_funding_txidB\x11\n\x0f_funding_outnumB\x12\n\x10_initial_feerateB\x0f\n\r_last_feerateB\x0f\n\r_next_feerateB\x10\n\x0e_next_fee_stepB\x0b\n\t_close_toB\n\n\x08_privateB\t\n\x07_openerB\t\n\x07_closerB\n\n\x08_fundingB\r\n\x0b_to_us_msatB\x11\n\x0f_min_to_us_msatB\x11\n\x0f_max_to_us_msatB\r\n\x0b_total_msatB\x10\n\x0e_fee_base_msatB\x1e\n\x1c_fee_proportional_millionthsB\x12\n\x10_dust_limit_msatB\x19\n\x17_max_total_htlc_in_msatB\x15\n\x13_their_reserve_msatB\x13\n\x11_our_reserve_msatB\x11\n\x0f_spendable_msatB\x12\n\x10_receivable_msatB\x17\n\x15_minimum_htlc_in_msatB\x18\n\x16_minimum_htlc_out_msatB\x18\n\x16_maximum_htlc_out_msatB\x16\n\x14_their_to_self_delayB\x14\n\x12_our_to_self_delayB\x15\n\x13_max_accepted_htlcsB\x08\n\x06_aliasB\x16\n\x14_in_payments_offeredB\x12\n\x10_in_offered_msatB\x18\n\x16_in_payments_fulfilledB\x14\n\x12_in_fulfilled_msatB\x17\n\x15_out_payments_offeredB\x13\n\x11_out_offered_msatB\x19\n\x17_out_payments_fulfilledB\x15\n\x13_out_fulfilled_msatB\x19\n\x17_last_stable_connectionB\x10\n\x0e_close_to_addr\"\xb6\x01\n\x1fListpeerchannelsChannelsUpdates\x12=\n\x05local\x18\x01 \x01(\x0b\x32).cln.ListpeerchannelsChannelsUpdatesLocalH\x00\x88\x01\x01\x12?\n\x06remote\x18\x02 \x01(\x0b\x32*.cln.ListpeerchannelsChannelsUpdatesRemoteH\x01\x88\x01\x01\x42\x08\n\x06_localB\t\n\x07_remote\"\xe7\x02\n$ListpeerchannelsChannelsUpdatesLocal\x12+\n\x11htlc_minimum_msat\x18\x01 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12+\n\x11htlc_maximum_msat\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x1e\n\x11\x63ltv_expiry_delta\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\'\n\rfee_base_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12(\n\x1b\x66\x65\x65_proportional_millionths\x18\x05 \x01(\rH\x04\x88\x01\x01\x42\x14\n\x12_htlc_minimum_msatB\x14\n\x12_htlc_maximum_msatB\x14\n\x12_cltv_expiry_deltaB\x10\n\x0e_fee_base_msatB\x1e\n\x1c_fee_proportional_millionths\"\xe8\x02\n%ListpeerchannelsChannelsUpdatesRemote\x12+\n\x11htlc_minimum_msat\x18\x01 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12+\n\x11htlc_maximum_msat\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x1e\n\x11\x63ltv_expiry_delta\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\'\n\rfee_base_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12(\n\x1b\x66\x65\x65_proportional_millionths\x18\x05 \x01(\rH\x04\x88\x01\x01\x42\x14\n\x12_htlc_minimum_msatB\x14\n\x12_htlc_maximum_msatB\x14\n\x12_cltv_expiry_deltaB\x10\n\x0e_fee_base_msatB\x1e\n\x1c_fee_proportional_millionths\"]\n\x1fListpeerchannelsChannelsFeerate\x12\x12\n\x05perkw\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x12\n\x05perkb\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x08\n\x06_perkwB\x08\n\x06_perkb\"\x80\x03\n ListpeerchannelsChannelsInflight\x12\x19\n\x0c\x66unding_txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x1b\n\x0e\x66unding_outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x14\n\x07\x66\x65\x65rate\x18\x03 \x01(\tH\x02\x88\x01\x01\x12,\n\x12total_funding_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x1a\n\rsplice_amount\x18\x07 \x01(\x12H\x04\x88\x01\x01\x12*\n\x10our_funding_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x05\x88\x01\x01\x12\x19\n\x0cscratch_txid\x18\x06 \x01(\x0cH\x06\x88\x01\x01\x42\x0f\n\r_funding_txidB\x11\n\x0f_funding_outnumB\n\n\x08_feerateB\x15\n\x13_total_funding_msatB\x10\n\x0e_splice_amountB\x13\n\x11_our_funding_msatB\x0f\n\r_scratch_txid\"\xd2\x02\n\x1fListpeerchannelsChannelsFunding\x12%\n\x0bpushed_msat\x18\x01 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12*\n\x10local_funds_msat\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12+\n\x11remote_funds_msat\x18\x03 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12\'\n\rfee_paid_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\'\n\rfee_rcvd_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x42\x0e\n\x0c_pushed_msatB\x13\n\x11_local_funds_msatB\x14\n\x12_remote_funds_msatB\x10\n\x0e_fee_paid_msatB\x10\n\x0e_fee_rcvd_msat\"]\n\x1dListpeerchannelsChannelsAlias\x12\x12\n\x05local\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06remote\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_localB\t\n\x07_remote\"\xe2\x03\n\x1dListpeerchannelsChannelsHtlcs\x12\x61\n\tdirection\x18\x01 \x01(\x0e\x32I.cln.ListpeerchannelsChannelsHtlcs.ListpeerchannelsChannelsHtlcsDirectionH\x00\x88\x01\x01\x12\x0f\n\x02id\x18\x02 \x01(\x04H\x01\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12\x13\n\x06\x65xpiry\x18\x04 \x01(\rH\x03\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x05 \x01(\x0cH\x04\x88\x01\x01\x12\x1a\n\rlocal_trimmed\x18\x06 \x01(\x08H\x05\x88\x01\x01\x12\x13\n\x06status\x18\x07 \x01(\tH\x06\x88\x01\x01\x12\"\n\x05state\x18\x08 \x01(\x0e\x32\x0e.cln.HtlcStateH\x07\x88\x01\x01\"9\n&ListpeerchannelsChannelsHtlcsDirection\x12\x06\n\x02IN\x10\x00\x12\x07\n\x03OUT\x10\x01\x42\x0c\n\n_directionB\x05\n\x03_idB\x0e\n\x0c_amount_msatB\t\n\x07_expiryB\x0f\n\r_payment_hashB\x10\n\x0e_local_trimmedB\t\n\x07_statusB\x08\n\x06_state\"3\n\x19ListclosedchannelsRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x05\n\x03_id\"[\n\x1aListclosedchannelsResponse\x12=\n\x0e\x63losedchannels\x18\x01 \x03(\x0b\x32%.cln.ListclosedchannelsClosedchannels\"\xf2\t\n ListclosedchannelsClosedchannels\x12\x14\n\x07peer_id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x12\n\nchannel_id\x18\x02 \x01(\x0c\x12\x1d\n\x10short_channel_id\x18\x03 \x01(\tH\x01\x88\x01\x01\x12>\n\x05\x61lias\x18\x04 \x01(\x0b\x32*.cln.ListclosedchannelsClosedchannelsAliasH\x02\x88\x01\x01\x12 \n\x06opener\x18\x05 \x01(\x0e\x32\x10.cln.ChannelSide\x12%\n\x06\x63loser\x18\x06 \x01(\x0e\x32\x10.cln.ChannelSideH\x03\x88\x01\x01\x12\x0f\n\x07private\x18\x07 \x01(\x08\x12\x1f\n\x17total_local_commitments\x18\t \x01(\x04\x12 \n\x18total_remote_commitments\x18\n \x01(\x04\x12\x18\n\x10total_htlcs_sent\x18\x0b \x01(\x04\x12\x14\n\x0c\x66unding_txid\x18\x0c \x01(\x0c\x12\x16\n\x0e\x66unding_outnum\x18\r \x01(\r\x12\x0e\n\x06leased\x18\x0e \x01(\x08\x12/\n\x15\x66unding_fee_paid_msat\x18\x0f \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x12/\n\x15\x66unding_fee_rcvd_msat\x18\x10 \x01(\x0b\x32\x0b.cln.AmountH\x05\x88\x01\x01\x12-\n\x13\x66unding_pushed_msat\x18\x11 \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x1f\n\ntotal_msat\x18\x12 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10\x66inal_to_us_msat\x18\x13 \x01(\x0b\x32\x0b.cln.Amount\x12#\n\x0emin_to_us_msat\x18\x14 \x01(\x0b\x32\x0b.cln.Amount\x12#\n\x0emax_to_us_msat\x18\x15 \x01(\x0b\x32\x0b.cln.Amount\x12!\n\x14last_commitment_txid\x18\x16 \x01(\x0cH\x07\x88\x01\x01\x12\x32\n\x18last_commitment_fee_msat\x18\x17 \x01(\x0b\x32\x0b.cln.AmountH\x08\x88\x01\x01\x12\x66\n\x0b\x63lose_cause\x18\x18 \x01(\x0e\x32Q.cln.ListclosedchannelsClosedchannels.ListclosedchannelsClosedchannelsClose_cause\x12#\n\x16last_stable_connection\x18\x19 \x01(\x04H\t\x88\x01\x01\"v\n+ListclosedchannelsClosedchannelsClose_cause\x12\x0b\n\x07UNKNOWN\x10\x00\x12\t\n\x05LOCAL\x10\x01\x12\x08\n\x04USER\x10\x02\x12\n\n\x06REMOTE\x10\x03\x12\x0c\n\x08PROTOCOL\x10\x04\x12\x0b\n\x07ONCHAIN\x10\x05\x42\n\n\x08_peer_idB\x13\n\x11_short_channel_idB\x08\n\x06_aliasB\t\n\x07_closerB\x18\n\x16_funding_fee_paid_msatB\x18\n\x16_funding_fee_rcvd_msatB\x16\n\x14_funding_pushed_msatB\x17\n\x15_last_commitment_txidB\x1b\n\x19_last_commitment_fee_msatB\x19\n\x17_last_stable_connection\"e\n%ListclosedchannelsClosedchannelsAlias\x12\x12\n\x05local\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06remote\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_localB\t\n\x07_remote\"L\n\x10\x44\x65\x63odepayRequest\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_description\"\x8d\x04\n\x11\x44\x65\x63odepayResponse\x12\x10\n\x08\x63urrency\x18\x01 \x01(\t\x12\x12\n\ncreated_at\x18\x02 \x01(\x04\x12\x0e\n\x06\x65xpiry\x18\x03 \x01(\x04\x12\r\n\x05payee\x18\x04 \x01(\x0c\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x06 \x01(\x0c\x12\x11\n\tsignature\x18\x07 \x01(\t\x12\x18\n\x0b\x64\x65scription\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\x1d\n\x10\x64\x65scription_hash\x18\t \x01(\x0cH\x02\x88\x01\x01\x12\x1d\n\x15min_final_cltv_expiry\x18\n \x01(\r\x12\x1b\n\x0epayment_secret\x18\x0b \x01(\x0cH\x03\x88\x01\x01\x12\x15\n\x08\x66\x65\x61tures\x18\x0c \x01(\x0cH\x04\x88\x01\x01\x12\x1d\n\x10payment_metadata\x18\r \x01(\x0cH\x05\x88\x01\x01\x12*\n\tfallbacks\x18\x0e \x03(\x0b\x32\x17.cln.DecodepayFallbacks\x12\"\n\x05\x65xtra\x18\x10 \x03(\x0b\x32\x13.cln.DecodepayExtraB\x0e\n\x0c_amount_msatB\x0e\n\x0c_descriptionB\x13\n\x11_description_hashB\x11\n\x0f_payment_secretB\x0b\n\t_featuresB\x13\n\x11_payment_metadata\"\xd0\x01\n\x12\x44\x65\x63odepayFallbacks\x12\x41\n\titem_type\x18\x01 \x01(\x0e\x32..cln.DecodepayFallbacks.DecodepayFallbacksType\x12\x11\n\x04\x61\x64\x64r\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x0b\n\x03hex\x18\x03 \x01(\x0c\"N\n\x16\x44\x65\x63odepayFallbacksType\x12\t\n\x05P2PKH\x10\x00\x12\x08\n\x04P2SH\x10\x01\x12\n\n\x06P2WPKH\x10\x02\x12\t\n\x05P2WSH\x10\x03\x12\x08\n\x04P2TR\x10\x04\x42\x07\n\x05_addr\"+\n\x0e\x44\x65\x63odepayExtra\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\t\"\x1f\n\rDecodeRequest\x12\x0e\n\x06string\x18\x01 \x01(\t\"\xe8!\n\x0e\x44\x65\x63odeResponse\x12\x31\n\titem_type\x18\x01 \x01(\x0e\x32\x1e.cln.DecodeResponse.DecodeType\x12\r\n\x05valid\x18\x02 \x01(\x08\x12\x15\n\x08offer_id\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x12\x14\n\x0coffer_chains\x18\x04 \x03(\x0c\x12\x1b\n\x0eoffer_metadata\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x1b\n\x0eoffer_currency\x18\x06 \x01(\tH\x02\x88\x01\x01\x12+\n\x1ewarning_unknown_offer_currency\x18\x07 \x01(\tH\x03\x88\x01\x01\x12 \n\x13\x63urrency_minor_unit\x18\x08 \x01(\rH\x04\x88\x01\x01\x12\x19\n\x0coffer_amount\x18\t \x01(\x04H\x05\x88\x01\x01\x12+\n\x11offer_amount_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x1e\n\x11offer_description\x18\x0b \x01(\tH\x07\x88\x01\x01\x12\x19\n\x0coffer_issuer\x18\x0c \x01(\tH\x08\x88\x01\x01\x12\x1b\n\x0eoffer_features\x18\r \x01(\x0cH\t\x88\x01\x01\x12\"\n\x15offer_absolute_expiry\x18\x0e \x01(\x04H\n\x88\x01\x01\x12\x1f\n\x12offer_quantity_max\x18\x0f \x01(\x04H\x0b\x88\x01\x01\x12+\n\x0boffer_paths\x18\x10 \x03(\x0b\x32\x16.cln.DecodeOffer_paths\x12\x1a\n\roffer_node_id\x18\x11 \x01(\x0cH\x0c\x88\x01\x01\x12*\n\x1dwarning_missing_offer_node_id\x18\x14 \x01(\tH\r\x88\x01\x01\x12.\n!warning_invalid_offer_description\x18\x15 \x01(\tH\x0e\x88\x01\x01\x12.\n!warning_missing_offer_description\x18\x16 \x01(\tH\x0f\x88\x01\x01\x12+\n\x1ewarning_invalid_offer_currency\x18\x17 \x01(\tH\x10\x88\x01\x01\x12)\n\x1cwarning_invalid_offer_issuer\x18\x18 \x01(\tH\x11\x88\x01\x01\x12\x1c\n\x0finvreq_metadata\x18\x19 \x01(\x0cH\x12\x88\x01\x01\x12\x1c\n\x0finvreq_payer_id\x18\x1a \x01(\x0cH\x13\x88\x01\x01\x12\x19\n\x0cinvreq_chain\x18\x1b \x01(\x0cH\x14\x88\x01\x01\x12,\n\x12invreq_amount_msat\x18\x1c \x01(\x0b\x32\x0b.cln.AmountH\x15\x88\x01\x01\x12\x1c\n\x0finvreq_features\x18\x1d \x01(\x0cH\x16\x88\x01\x01\x12\x1c\n\x0finvreq_quantity\x18\x1e \x01(\x04H\x17\x88\x01\x01\x12\x1e\n\x11invreq_payer_note\x18\x1f \x01(\tH\x18\x88\x01\x01\x12&\n\x19invreq_recurrence_counter\x18 \x01(\rH\x19\x88\x01\x01\x12$\n\x17invreq_recurrence_start\x18! \x01(\rH\x1a\x88\x01\x01\x12,\n\x1fwarning_missing_invreq_metadata\x18# \x01(\tH\x1b\x88\x01\x01\x12,\n\x1fwarning_missing_invreq_payer_id\x18$ \x01(\tH\x1c\x88\x01\x01\x12.\n!warning_invalid_invreq_payer_note\x18% \x01(\tH\x1d\x88\x01\x01\x12\x36\n)warning_missing_invoice_request_signature\x18& \x01(\tH\x1e\x88\x01\x01\x12\x36\n)warning_invalid_invoice_request_signature\x18\' \x01(\tH\x1f\x88\x01\x01\x12\x1f\n\x12invoice_created_at\x18) \x01(\x04H \x88\x01\x01\x12$\n\x17invoice_relative_expiry\x18* \x01(\rH!\x88\x01\x01\x12!\n\x14invoice_payment_hash\x18+ \x01(\x0cH\"\x88\x01\x01\x12-\n\x13invoice_amount_msat\x18, \x01(\x0b\x32\x0b.cln.AmountH#\x88\x01\x01\x12\x37\n\x11invoice_fallbacks\x18- \x03(\x0b\x32\x1c.cln.DecodeInvoice_fallbacks\x12\x1d\n\x10invoice_features\x18. \x01(\x0cH$\x88\x01\x01\x12\x1c\n\x0finvoice_node_id\x18/ \x01(\x0cH%\x88\x01\x01\x12(\n\x1binvoice_recurrence_basetime\x18\x30 \x01(\x04H&\x88\x01\x01\x12*\n\x1dwarning_missing_invoice_paths\x18\x32 \x01(\tH\'\x88\x01\x01\x12/\n\"warning_missing_invoice_blindedpay\x18\x33 \x01(\tH(\x88\x01\x01\x12/\n\"warning_missing_invoice_created_at\x18\x34 \x01(\tH)\x88\x01\x01\x12\x31\n$warning_missing_invoice_payment_hash\x18\x35 \x01(\tH*\x88\x01\x01\x12+\n\x1ewarning_missing_invoice_amount\x18\x36 \x01(\tH+\x88\x01\x01\x12\x38\n+warning_missing_invoice_recurrence_basetime\x18\x37 \x01(\tH,\x88\x01\x01\x12,\n\x1fwarning_missing_invoice_node_id\x18\x38 \x01(\tH-\x88\x01\x01\x12.\n!warning_missing_invoice_signature\x18\x39 \x01(\tH.\x88\x01\x01\x12.\n!warning_invalid_invoice_signature\x18: \x01(\tH/\x88\x01\x01\x12\'\n\tfallbacks\x18; \x03(\x0b\x32\x14.cln.DecodeFallbacks\x12\x17\n\ncreated_at\x18< \x01(\x04H0\x88\x01\x01\x12\x13\n\x06\x65xpiry\x18= \x01(\x04H1\x88\x01\x01\x12\x12\n\x05payee\x18> \x01(\x0cH2\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18? \x01(\x0cH3\x88\x01\x01\x12\x1d\n\x10\x64\x65scription_hash\x18@ \x01(\x0cH4\x88\x01\x01\x12\"\n\x15min_final_cltv_expiry\x18\x41 \x01(\rH5\x88\x01\x01\x12\x1b\n\x0epayment_secret\x18\x42 \x01(\x0cH6\x88\x01\x01\x12\x1d\n\x10payment_metadata\x18\x43 \x01(\x0cH7\x88\x01\x01\x12\x1f\n\x05\x65xtra\x18\x45 \x03(\x0b\x32\x10.cln.DecodeExtra\x12\x16\n\tunique_id\x18\x46 \x01(\tH8\x88\x01\x01\x12\x14\n\x07version\x18G \x01(\tH9\x88\x01\x01\x12\x13\n\x06string\x18H \x01(\tH:\x88\x01\x01\x12-\n\x0crestrictions\x18I \x03(\x0b\x32\x17.cln.DecodeRestrictions\x12&\n\x19warning_rune_invalid_utf8\x18J \x01(\tH;\x88\x01\x01\x12\x10\n\x03hex\x18K \x01(\x0cH<\x88\x01\x01\x12\x16\n\tdecrypted\x18L \x01(\x0cH=\x88\x01\x01\"\x83\x01\n\nDecodeType\x12\x10\n\x0c\x42OLT12_OFFER\x10\x00\x12\x12\n\x0e\x42OLT12_INVOICE\x10\x01\x12\x1a\n\x16\x42OLT12_INVOICE_REQUEST\x10\x02\x12\x12\n\x0e\x42OLT11_INVOICE\x10\x03\x12\x08\n\x04RUNE\x10\x04\x12\x15\n\x11\x45MERGENCY_RECOVER\x10\x05\x42\x0b\n\t_offer_idB\x11\n\x0f_offer_metadataB\x11\n\x0f_offer_currencyB!\n\x1f_warning_unknown_offer_currencyB\x16\n\x14_currency_minor_unitB\x0f\n\r_offer_amountB\x14\n\x12_offer_amount_msatB\x14\n\x12_offer_descriptionB\x0f\n\r_offer_issuerB\x11\n\x0f_offer_featuresB\x18\n\x16_offer_absolute_expiryB\x15\n\x13_offer_quantity_maxB\x10\n\x0e_offer_node_idB \n\x1e_warning_missing_offer_node_idB$\n\"_warning_invalid_offer_descriptionB$\n\"_warning_missing_offer_descriptionB!\n\x1f_warning_invalid_offer_currencyB\x1f\n\x1d_warning_invalid_offer_issuerB\x12\n\x10_invreq_metadataB\x12\n\x10_invreq_payer_idB\x0f\n\r_invreq_chainB\x15\n\x13_invreq_amount_msatB\x12\n\x10_invreq_featuresB\x12\n\x10_invreq_quantityB\x14\n\x12_invreq_payer_noteB\x1c\n\x1a_invreq_recurrence_counterB\x1a\n\x18_invreq_recurrence_startB\"\n _warning_missing_invreq_metadataB\"\n _warning_missing_invreq_payer_idB$\n\"_warning_invalid_invreq_payer_noteB,\n*_warning_missing_invoice_request_signatureB,\n*_warning_invalid_invoice_request_signatureB\x15\n\x13_invoice_created_atB\x1a\n\x18_invoice_relative_expiryB\x17\n\x15_invoice_payment_hashB\x16\n\x14_invoice_amount_msatB\x13\n\x11_invoice_featuresB\x12\n\x10_invoice_node_idB\x1e\n\x1c_invoice_recurrence_basetimeB \n\x1e_warning_missing_invoice_pathsB%\n#_warning_missing_invoice_blindedpayB%\n#_warning_missing_invoice_created_atB\'\n%_warning_missing_invoice_payment_hashB!\n\x1f_warning_missing_invoice_amountB.\n,_warning_missing_invoice_recurrence_basetimeB\"\n _warning_missing_invoice_node_idB$\n\"_warning_missing_invoice_signatureB$\n\"_warning_invalid_invoice_signatureB\r\n\x0b_created_atB\t\n\x07_expiryB\x08\n\x06_payeeB\x0f\n\r_payment_hashB\x13\n\x11_description_hashB\x18\n\x16_min_final_cltv_expiryB\x11\n\x0f_payment_secretB\x13\n\x11_payment_metadataB\x0c\n\n_unique_idB\n\n\x08_versionB\t\n\x07_stringB\x1c\n\x1a_warning_rune_invalid_utf8B\x06\n\x04_hexB\x0c\n\n_decrypted\"<\n\x11\x44\x65\x63odeOffer_paths\x12\x15\n\rfirst_node_id\x18\x01 \x01(\x0c\x12\x10\n\x08\x62linding\x18\x02 \x01(\x0c\"\x8a\x01\n\x1f\x44\x65\x63odeOffer_recurrencePaywindow\x12\x16\n\x0eseconds_before\x18\x01 \x01(\r\x12\x15\n\rseconds_after\x18\x02 \x01(\r\x12 \n\x13proportional_amount\x18\x03 \x01(\x08H\x00\x88\x01\x01\x42\x16\n\x14_proportional_amount\"T\n\x17\x44\x65\x63odeInvoice_pathsPath\x12\x17\n\x0f\x62linded_node_id\x18\x01 \x01(\x0c\x12 \n\x18\x65ncrypted_recipient_data\x18\x02 \x01(\x0c\"Y\n\x17\x44\x65\x63odeInvoice_fallbacks\x12\x0f\n\x07version\x18\x01 \x01(\r\x12\x0b\n\x03hex\x18\x02 \x01(\x0c\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_address\"w\n\x0f\x44\x65\x63odeFallbacks\x12\x36\n)warning_invoice_fallbacks_version_invalid\x18\x01 \x01(\tH\x00\x88\x01\x01\x42,\n*_warning_invoice_fallbacks_version_invalid\"(\n\x0b\x44\x65\x63odeExtra\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\t\";\n\x12\x44\x65\x63odeRestrictions\x12\x14\n\x0c\x61lternatives\x18\x01 \x03(\t\x12\x0f\n\x07summary\x18\x02 \x01(\t\"=\n\x11\x44isconnectRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x12\n\x05\x66orce\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\x08\n\x06_force\"\x14\n\x12\x44isconnectResponse\"k\n\x0f\x46\x65\x65ratesRequest\x12\x31\n\x05style\x18\x01 \x01(\x0e\x32\".cln.FeeratesRequest.FeeratesStyle\"%\n\rFeeratesStyle\x12\t\n\x05PERKB\x10\x00\x12\t\n\x05PERKW\x10\x01\"\x9c\x02\n\x10\x46\x65\x65ratesResponse\x12%\n\x18warning_missing_feerates\x18\x01 \x01(\tH\x00\x88\x01\x01\x12&\n\x05perkb\x18\x02 \x01(\x0b\x32\x12.cln.FeeratesPerkbH\x01\x88\x01\x01\x12&\n\x05perkw\x18\x03 \x01(\x0b\x32\x12.cln.FeeratesPerkwH\x02\x88\x01\x01\x12\x46\n\x15onchain_fee_estimates\x18\x04 \x01(\x0b\x32\".cln.FeeratesOnchain_fee_estimatesH\x03\x88\x01\x01\x42\x1b\n\x19_warning_missing_feeratesB\x08\n\x06_perkbB\x08\n\x06_perkwB\x18\n\x16_onchain_fee_estimates\"\xd3\x03\n\rFeeratesPerkb\x12\x16\n\x0emin_acceptable\x18\x01 \x01(\r\x12\x16\n\x0emax_acceptable\x18\x02 \x01(\r\x12\x12\n\x05\x66loor\x18\n \x01(\rH\x00\x88\x01\x01\x12.\n\testimates\x18\t \x03(\x0b\x32\x1b.cln.FeeratesPerkbEstimates\x12\x14\n\x07opening\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x19\n\x0cmutual_close\x18\x04 \x01(\rH\x02\x88\x01\x01\x12\x1d\n\x10unilateral_close\x18\x05 \x01(\rH\x03\x88\x01\x01\x12$\n\x17unilateral_anchor_close\x18\x0b \x01(\rH\x04\x88\x01\x01\x12\x1a\n\rdelayed_to_us\x18\x06 \x01(\rH\x05\x88\x01\x01\x12\x1c\n\x0fhtlc_resolution\x18\x07 \x01(\rH\x06\x88\x01\x01\x12\x14\n\x07penalty\x18\x08 \x01(\rH\x07\x88\x01\x01\x42\x08\n\x06_floorB\n\n\x08_openingB\x0f\n\r_mutual_closeB\x13\n\x11_unilateral_closeB\x1a\n\x18_unilateral_anchor_closeB\x10\n\x0e_delayed_to_usB\x12\n\x10_htlc_resolutionB\n\n\x08_penalty\"\x96\x01\n\x16\x46\x65\x65ratesPerkbEstimates\x12\x17\n\nblockcount\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x14\n\x07\x66\x65\x65rate\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x1d\n\x10smoothed_feerate\x18\x03 \x01(\rH\x02\x88\x01\x01\x42\r\n\x0b_blockcountB\n\n\x08_feerateB\x13\n\x11_smoothed_feerate\"\xd3\x03\n\rFeeratesPerkw\x12\x16\n\x0emin_acceptable\x18\x01 \x01(\r\x12\x16\n\x0emax_acceptable\x18\x02 \x01(\r\x12\x12\n\x05\x66loor\x18\n \x01(\rH\x00\x88\x01\x01\x12.\n\testimates\x18\t \x03(\x0b\x32\x1b.cln.FeeratesPerkwEstimates\x12\x14\n\x07opening\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x19\n\x0cmutual_close\x18\x04 \x01(\rH\x02\x88\x01\x01\x12\x1d\n\x10unilateral_close\x18\x05 \x01(\rH\x03\x88\x01\x01\x12$\n\x17unilateral_anchor_close\x18\x0b \x01(\rH\x04\x88\x01\x01\x12\x1a\n\rdelayed_to_us\x18\x06 \x01(\rH\x05\x88\x01\x01\x12\x1c\n\x0fhtlc_resolution\x18\x07 \x01(\rH\x06\x88\x01\x01\x12\x14\n\x07penalty\x18\x08 \x01(\rH\x07\x88\x01\x01\x42\x08\n\x06_floorB\n\n\x08_openingB\x0f\n\r_mutual_closeB\x13\n\x11_unilateral_closeB\x1a\n\x18_unilateral_anchor_closeB\x10\n\x0e_delayed_to_usB\x12\n\x10_htlc_resolutionB\n\n\x08_penalty\"\x96\x01\n\x16\x46\x65\x65ratesPerkwEstimates\x12\x17\n\nblockcount\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x14\n\x07\x66\x65\x65rate\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x1d\n\x10smoothed_feerate\x18\x03 \x01(\rH\x02\x88\x01\x01\x42\r\n\x0b_blockcountB\n\n\x08_feerateB\x13\n\x11_smoothed_feerate\"\x9b\x02\n\x1d\x46\x65\x65ratesOnchain_fee_estimates\x12 \n\x18opening_channel_satoshis\x18\x01 \x01(\x04\x12\x1d\n\x15mutual_close_satoshis\x18\x02 \x01(\x04\x12!\n\x19unilateral_close_satoshis\x18\x03 \x01(\x04\x12\x30\n#unilateral_close_nonanchor_satoshis\x18\x06 \x01(\x04H\x00\x88\x01\x01\x12\x1d\n\x15htlc_timeout_satoshis\x18\x04 \x01(\x04\x12\x1d\n\x15htlc_success_satoshis\x18\x05 \x01(\x04\x42&\n$_unilateral_close_nonanchor_satoshis\"\xe9\x02\n\x13\x46\x65tchinvoiceRequest\x12\r\n\x05offer\x18\x01 \x01(\t\x12%\n\x0b\x61mount_msat\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x15\n\x08quantity\x18\x03 \x01(\x04H\x01\x88\x01\x01\x12\x1f\n\x12recurrence_counter\x18\x04 \x01(\x04H\x02\x88\x01\x01\x12\x1d\n\x10recurrence_start\x18\x05 \x01(\x01H\x03\x88\x01\x01\x12\x1d\n\x10recurrence_label\x18\x06 \x01(\tH\x04\x88\x01\x01\x12\x14\n\x07timeout\x18\x07 \x01(\x01H\x05\x88\x01\x01\x12\x17\n\npayer_note\x18\x08 \x01(\tH\x06\x88\x01\x01\x42\x0e\n\x0c_amount_msatB\x0b\n\t_quantityB\x15\n\x13_recurrence_counterB\x13\n\x11_recurrence_startB\x13\n\x11_recurrence_labelB\n\n\x08_timeoutB\r\n\x0b_payer_note\"\x9a\x01\n\x14\x46\x65tchinvoiceResponse\x12\x0f\n\x07invoice\x18\x01 \x01(\t\x12)\n\x07\x63hanges\x18\x02 \x01(\x0b\x32\x18.cln.FetchinvoiceChanges\x12\x36\n\x0bnext_period\x18\x03 \x01(\x0b\x32\x1c.cln.FetchinvoiceNext_periodH\x00\x88\x01\x01\x42\x0e\n\x0c_next_period\"\x82\x02\n\x13\x46\x65tchinvoiceChanges\x12!\n\x14\x64\x65scription_appended\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x1b\n\x0evendor_removed\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06vendor\x18\x04 \x01(\tH\x03\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x42\x17\n\x15_description_appendedB\x0e\n\x0c_descriptionB\x11\n\x0f_vendor_removedB\t\n\x07_vendorB\x0e\n\x0c_amount_msat\"~\n\x17\x46\x65tchinvoiceNext_period\x12\x0f\n\x07\x63ounter\x18\x01 \x01(\x04\x12\x11\n\tstarttime\x18\x02 \x01(\x04\x12\x0f\n\x07\x65ndtime\x18\x03 \x01(\x04\x12\x17\n\x0fpaywindow_start\x18\x04 \x01(\x04\x12\x15\n\rpaywindow_end\x18\x05 \x01(\x04\"\xfb\x03\n\x12\x46undchannelRequest\x12\n\n\x02id\x18\t \x01(\x0c\x12 \n\x06\x61mount\x18\x01 \x01(\x0b\x32\x10.cln.AmountOrAll\x12\"\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.FeerateH\x00\x88\x01\x01\x12\x15\n\x08\x61nnounce\x18\x03 \x01(\x08H\x01\x88\x01\x01\x12\x14\n\x07minconf\x18\n \x01(\rH\x02\x88\x01\x01\x12#\n\tpush_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x15\n\x08\x63lose_to\x18\x06 \x01(\tH\x04\x88\x01\x01\x12%\n\x0brequest_amt\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x05\x88\x01\x01\x12\x1a\n\rcompact_lease\x18\x08 \x01(\tH\x06\x88\x01\x01\x12\x1c\n\x05utxos\x18\x0b \x03(\x0b\x32\r.cln.Outpoint\x12\x15\n\x08mindepth\x18\x0c \x01(\rH\x07\x88\x01\x01\x12!\n\x07reserve\x18\r \x01(\x0b\x32\x0b.cln.AmountH\x08\x88\x01\x01\x12\x14\n\x0c\x63hannel_type\x18\x0e \x03(\rB\n\n\x08_feerateB\x0b\n\t_announceB\n\n\x08_minconfB\x0c\n\n_push_msatB\x0b\n\t_close_toB\x0e\n\x0c_request_amtB\x10\n\x0e_compact_leaseB\x0b\n\t_mindepthB\n\n\x08_reserve\"\xe5\x01\n\x13\x46undchannelResponse\x12\n\n\x02tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\x12\x0e\n\x06outnum\x18\x03 \x01(\r\x12\x12\n\nchannel_id\x18\x04 \x01(\x0c\x12\x37\n\x0c\x63hannel_type\x18\x07 \x01(\x0b\x32\x1c.cln.FundchannelChannel_typeH\x00\x88\x01\x01\x12\x15\n\x08\x63lose_to\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x15\n\x08mindepth\x18\x06 \x01(\rH\x02\x88\x01\x01\x42\x0f\n\r_channel_typeB\x0b\n\t_close_toB\x0b\n\t_mindepth\"L\n\x17\x46undchannelChannel_type\x12\x0c\n\x04\x62its\x18\x01 \x03(\r\x12#\n\x05names\x18\x02 \x03(\x0e\x32\x14.cln.ChannelTypeName\"\xec\x01\n\x0fGetrouteRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12 \n\x0b\x61mount_msat\x18\t \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\nriskfactor\x18\x03 \x01(\x04\x12\x11\n\x04\x63ltv\x18\x04 \x01(\rH\x00\x88\x01\x01\x12\x13\n\x06\x66romid\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x18\n\x0b\x66uzzpercent\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x0f\n\x07\x65xclude\x18\x07 \x03(\t\x12\x14\n\x07maxhops\x18\x08 \x01(\rH\x03\x88\x01\x01\x42\x07\n\x05_cltvB\t\n\x07_fromidB\x0e\n\x0c_fuzzpercentB\n\n\x08_maxhops\"5\n\x10GetrouteResponse\x12!\n\x05route\x18\x01 \x03(\x0b\x32\x12.cln.GetrouteRoute\"\xc5\x01\n\rGetrouteRoute\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x0f\n\x07\x63hannel\x18\x02 \x01(\t\x12\x11\n\tdirection\x18\x03 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\r\n\x05\x64\x65lay\x18\x05 \x01(\r\x12\x34\n\x05style\x18\x06 \x01(\x0e\x32%.cln.GetrouteRoute.GetrouteRouteStyle\"\x1d\n\x12GetrouteRouteStyle\x12\x07\n\x03TLV\x10\x00\"\xb7\x03\n\x13ListforwardsRequest\x12@\n\x06status\x18\x01 \x01(\x0e\x32+.cln.ListforwardsRequest.ListforwardsStatusH\x00\x88\x01\x01\x12\x17\n\nin_channel\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x18\n\x0bout_channel\x18\x03 \x01(\tH\x02\x88\x01\x01\x12>\n\x05index\x18\x04 \x01(\x0e\x32*.cln.ListforwardsRequest.ListforwardsIndexH\x03\x88\x01\x01\x12\x12\n\x05start\x18\x05 \x01(\x04H\x04\x88\x01\x01\x12\x12\n\x05limit\x18\x06 \x01(\rH\x05\x88\x01\x01\"L\n\x12ListforwardsStatus\x12\x0b\n\x07OFFERED\x10\x00\x12\x0b\n\x07SETTLED\x10\x01\x12\x10\n\x0cLOCAL_FAILED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\"-\n\x11ListforwardsIndex\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07UPDATED\x10\x01\x42\t\n\x07_statusB\r\n\x0b_in_channelB\x0e\n\x0c_out_channelB\x08\n\x06_indexB\x08\n\x06_startB\x08\n\x06_limit\"C\n\x14ListforwardsResponse\x12+\n\x08\x66orwards\x18\x01 \x03(\x0b\x32\x19.cln.ListforwardsForwards\"\xba\x05\n\x14ListforwardsForwards\x12\x1a\n\rcreated_index\x18\x0c \x01(\x04H\x00\x88\x01\x01\x12\x12\n\nin_channel\x18\x01 \x01(\t\x12\x17\n\nin_htlc_id\x18\n \x01(\x04H\x01\x88\x01\x01\x12\x1c\n\x07in_msat\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\x12\x44\n\x06status\x18\x03 \x01(\x0e\x32\x34.cln.ListforwardsForwards.ListforwardsForwardsStatus\x12\x15\n\rreceived_time\x18\x04 \x01(\x01\x12\x18\n\x0bout_channel\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x18\n\x0bout_htlc_id\x18\x0b \x01(\x04H\x03\x88\x01\x01\x12\x1a\n\rupdated_index\x18\r \x01(\x04H\x04\x88\x01\x01\x12G\n\x05style\x18\t \x01(\x0e\x32\x33.cln.ListforwardsForwards.ListforwardsForwardsStyleH\x05\x88\x01\x01\x12\"\n\x08\x66\x65\x65_msat\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\"\n\x08out_msat\x18\x08 \x01(\x0b\x32\x0b.cln.AmountH\x07\x88\x01\x01\"T\n\x1aListforwardsForwardsStatus\x12\x0b\n\x07OFFERED\x10\x00\x12\x0b\n\x07SETTLED\x10\x01\x12\x10\n\x0cLOCAL_FAILED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\"0\n\x19ListforwardsForwardsStyle\x12\n\n\x06LEGACY\x10\x00\x12\x07\n\x03TLV\x10\x01\x42\x10\n\x0e_created_indexB\r\n\x0b_in_htlc_idB\x0e\n\x0c_out_channelB\x0e\n\x0c_out_htlc_idB\x10\n\x0e_updated_indexB\x08\n\x06_styleB\x0b\n\t_fee_msatB\x0b\n\t_out_msat\"a\n\x11ListoffersRequest\x12\x15\n\x08offer_id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x18\n\x0b\x61\x63tive_only\x18\x02 \x01(\x08H\x01\x88\x01\x01\x42\x0b\n\t_offer_idB\x0e\n\x0c_active_only\";\n\x12ListoffersResponse\x12%\n\x06offers\x18\x01 \x03(\x0b\x32\x15.cln.ListoffersOffers\"\x84\x01\n\x10ListoffersOffers\x12\x10\n\x08offer_id\x18\x01 \x01(\x0c\x12\x0e\n\x06\x61\x63tive\x18\x02 \x01(\x08\x12\x12\n\nsingle_use\x18\x03 \x01(\x08\x12\x0e\n\x06\x62olt12\x18\x04 \x01(\t\x12\x0c\n\x04used\x18\x05 \x01(\x08\x12\x12\n\x05label\x18\x06 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_label\"\xdb\x01\n\x0fListpaysRequest\x12\x13\n\x06\x62olt11\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12\x38\n\x06status\x18\x03 \x01(\x0e\x32#.cln.ListpaysRequest.ListpaysStatusH\x02\x88\x01\x01\"7\n\x0eListpaysStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x42\t\n\x07_bolt11B\x0f\n\r_payment_hashB\t\n\x07_status\"3\n\x10ListpaysResponse\x12\x1f\n\x04pays\x18\x01 \x03(\x0b\x32\x11.cln.ListpaysPays\"\xff\x04\n\x0cListpaysPays\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x34\n\x06status\x18\x02 \x01(\x0e\x32$.cln.ListpaysPays.ListpaysPaysStatus\x12\x18\n\x0b\x64\x65stination\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x12\x12\n\ncreated_at\x18\x04 \x01(\x04\x12\x19\n\x0c\x63ompleted_at\x18\x0c \x01(\x04H\x01\x88\x01\x01\x12\x12\n\x05label\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x06 \x01(\tH\x03\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x0b \x01(\tH\x04\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x07 \x01(\tH\x05\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x08 \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12*\n\x10\x61mount_sent_msat\x18\t \x01(\x0b\x32\x0b.cln.AmountH\x07\x88\x01\x01\x12\x15\n\x08preimage\x18\r \x01(\x0cH\x08\x88\x01\x01\x12\x1c\n\x0fnumber_of_parts\x18\x0e \x01(\x04H\t\x88\x01\x01\x12\x17\n\nerroronion\x18\n \x01(\x0cH\n\x88\x01\x01\";\n\x12ListpaysPaysStatus\x12\x0b\n\x07PENDING\x10\x00\x12\n\n\x06\x46\x41ILED\x10\x01\x12\x0c\n\x08\x43OMPLETE\x10\x02\x42\x0e\n\x0c_destinationB\x0f\n\r_completed_atB\x08\n\x06_labelB\t\n\x07_bolt11B\x0e\n\x0c_descriptionB\t\n\x07_bolt12B\x0e\n\x0c_amount_msatB\x13\n\x11_amount_sent_msatB\x0b\n\t_preimageB\x12\n\x10_number_of_partsB\r\n\x0b_erroronion\"*\n\x10ListhtlcsRequest\x12\x0f\n\x02id\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x05\n\x03_id\"7\n\x11ListhtlcsResponse\x12\"\n\x05htlcs\x18\x01 \x03(\x0b\x32\x13.cln.ListhtlcsHtlcs\"\x89\x02\n\x0eListhtlcsHtlcs\x12\x18\n\x10short_channel_id\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\x04\x12\x0e\n\x06\x65xpiry\x18\x03 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12>\n\tdirection\x18\x05 \x01(\x0e\x32+.cln.ListhtlcsHtlcs.ListhtlcsHtlcsDirection\x12\x14\n\x0cpayment_hash\x18\x06 \x01(\x0c\x12\x1d\n\x05state\x18\x07 \x01(\x0e\x32\x0e.cln.HtlcState\"*\n\x17ListhtlcsHtlcsDirection\x12\x07\n\x03OUT\x10\x00\x12\x06\n\x02IN\x10\x01\"\xc1\x03\n\x0cOfferRequest\x12\x0e\n\x06\x61mount\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x13\n\x06issuer\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x12\n\x05label\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x19\n\x0cquantity_max\x18\x05 \x01(\x04H\x02\x88\x01\x01\x12\x1c\n\x0f\x61\x62solute_expiry\x18\x06 \x01(\x04H\x03\x88\x01\x01\x12\x17\n\nrecurrence\x18\x07 \x01(\tH\x04\x88\x01\x01\x12\x1c\n\x0frecurrence_base\x18\x08 \x01(\tH\x05\x88\x01\x01\x12!\n\x14recurrence_paywindow\x18\t \x01(\tH\x06\x88\x01\x01\x12\x1d\n\x10recurrence_limit\x18\n \x01(\x04H\x07\x88\x01\x01\x12\x17\n\nsingle_use\x18\x0b \x01(\x08H\x08\x88\x01\x01\x42\t\n\x07_issuerB\x08\n\x06_labelB\x0f\n\r_quantity_maxB\x12\n\x10_absolute_expiryB\r\n\x0b_recurrenceB\x12\n\x10_recurrence_baseB\x17\n\x15_recurrence_paywindowB\x13\n\x11_recurrence_limitB\r\n\x0b_single_use\"\x92\x01\n\rOfferResponse\x12\x10\n\x08offer_id\x18\x01 \x01(\x0c\x12\x0e\n\x06\x61\x63tive\x18\x02 \x01(\x08\x12\x12\n\nsingle_use\x18\x03 \x01(\x08\x12\x0e\n\x06\x62olt12\x18\x04 \x01(\t\x12\x0c\n\x04used\x18\x05 \x01(\x08\x12\x0f\n\x07\x63reated\x18\x06 \x01(\x08\x12\x12\n\x05label\x18\x07 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_label\"Y\n\x0bPingRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x10\n\x03len\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x16\n\tpongbytes\x18\x03 \x01(\rH\x01\x88\x01\x01\x42\x06\n\x04_lenB\x0c\n\n_pongbytes\"\x1e\n\x0cPingResponse\x12\x0e\n\x06totlen\x18\x01 \x01(\r\"4\n\x14SendcustommsgRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\x0b\n\x03msg\x18\x02 \x01(\x0c\"\'\n\x15SendcustommsgResponse\x12\x0e\n\x06status\x18\x01 \x01(\t\"\xaa\x02\n\x11SetchannelRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12!\n\x07\x66\x65\x65\x62\x61se\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x13\n\x06\x66\x65\x65ppm\x18\x03 \x01(\rH\x01\x88\x01\x01\x12!\n\x07htlcmin\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12!\n\x07htlcmax\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x19\n\x0c\x65nforcedelay\x18\x06 \x01(\rH\x04\x88\x01\x01\x12\x1c\n\x0fignorefeelimits\x18\x07 \x01(\x08H\x05\x88\x01\x01\x42\n\n\x08_feebaseB\t\n\x07_feeppmB\n\n\x08_htlcminB\n\n\x08_htlcmaxB\x0f\n\r_enforcedelayB\x12\n\x10_ignorefeelimits\"?\n\x12SetchannelResponse\x12)\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x17.cln.SetchannelChannels\"\xca\x03\n\x12SetchannelChannels\x12\x0f\n\x07peer_id\x18\x01 \x01(\x0c\x12\x12\n\nchannel_id\x18\x02 \x01(\x0c\x12\x1d\n\x10short_channel_id\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\"\n\rfee_base_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12#\n\x1b\x66\x65\x65_proportional_millionths\x18\x05 \x01(\r\x12\x1e\n\x11ignore_fee_limits\x18\n \x01(\x08H\x01\x88\x01\x01\x12*\n\x15minimum_htlc_out_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12$\n\x17warning_htlcmin_too_low\x18\x07 \x01(\tH\x02\x88\x01\x01\x12*\n\x15maximum_htlc_out_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x18warning_htlcmax_too_high\x18\t \x01(\tH\x03\x88\x01\x01\x42\x13\n\x11_short_channel_idB\x14\n\x12_ignore_fee_limitsB\x1a\n\x18_warning_htlcmin_too_lowB\x1b\n\x19_warning_htlcmax_too_high\"\'\n\x12SigninvoiceRequest\x12\x11\n\tinvstring\x18\x01 \x01(\t\"%\n\x13SigninvoiceResponse\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\"%\n\x12SignmessageRequest\x12\x0f\n\x07message\x18\x01 \x01(\t\"F\n\x13SignmessageResponse\x12\x11\n\tsignature\x18\x01 \x01(\x0c\x12\r\n\x05recid\x18\x02 \x01(\x0c\x12\r\n\x05zbase\x18\x03 \x01(\t\"O\n\x16WaitblockheightRequest\x12\x13\n\x0b\x62lockheight\x18\x01 \x01(\r\x12\x14\n\x07timeout\x18\x02 \x01(\rH\x00\x88\x01\x01\x42\n\n\x08_timeout\".\n\x17WaitblockheightResponse\x12\x13\n\x0b\x62lockheight\x18\x01 \x01(\r\"\xf9\x01\n\x0bWaitRequest\x12\x31\n\tsubsystem\x18\x01 \x01(\x0e\x32\x1e.cln.WaitRequest.WaitSubsystem\x12\x31\n\tindexname\x18\x02 \x01(\x0e\x32\x1e.cln.WaitRequest.WaitIndexname\x12\x11\n\tnextvalue\x18\x03 \x01(\x04\"9\n\rWaitSubsystem\x12\x0c\n\x08INVOICES\x10\x00\x12\x0c\n\x08\x46ORWARDS\x10\x01\x12\x0c\n\x08SENDPAYS\x10\x02\"6\n\rWaitIndexname\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07UPDATED\x10\x01\x12\x0b\n\x07\x44\x45LETED\x10\x02\"\xe3\x01\n\x0cWaitResponse\x12\x32\n\tsubsystem\x18\x01 \x01(\x0e\x32\x1f.cln.WaitResponse.WaitSubsystem\x12\x14\n\x07\x63reated\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x14\n\x07updated\x18\x03 \x01(\x04H\x01\x88\x01\x01\x12\x14\n\x07\x64\x65leted\x18\x04 \x01(\x04H\x02\x88\x01\x01\"9\n\rWaitSubsystem\x12\x0c\n\x08INVOICES\x10\x00\x12\x0c\n\x08\x46ORWARDS\x10\x01\x12\x0c\n\x08SENDPAYS\x10\x02\x42\n\n\x08_createdB\n\n\x08_updatedB\n\n\x08_deleted\"\r\n\x0bStopRequest\"q\n\x0cStopResponse\x12\x31\n\x06result\x18\x01 \x01(\x0e\x32\x1c.cln.StopResponse.StopResultH\x00\x88\x01\x01\"#\n\nStopResult\x12\x15\n\x11SHUTDOWN_COMPLETE\x10\x00\x42\t\n\x07_result\"\xa7\x01\n\x18PreapprovekeysendRequest\x12\x18\n\x0b\x64\x65stination\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x42\x0e\n\x0c_destinationB\x0f\n\r_payment_hashB\x0e\n\x0c_amount_msat\"\x1b\n\x19PreapprovekeysendResponse\":\n\x18PreapproveinvoiceRequest\x12\x13\n\x06\x62olt11\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\t\n\x07_bolt11\"\x1b\n\x19PreapproveinvoiceResponse\"\x15\n\x13StaticbackupRequest\"#\n\x14StaticbackupResponse\x12\x0b\n\x03scb\x18\x01 \x03(\x0c\"\x97\x01\n\x15\x42kprlistincomeRequest\x12\x1d\n\x10\x63onsolidate_fees\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x17\n\nstart_time\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x15\n\x08\x65nd_time\x18\x03 \x01(\rH\x02\x88\x01\x01\x42\x13\n\x11_consolidate_feesB\r\n\x0b_start_timeB\x0b\n\t_end_time\"Q\n\x16\x42kprlistincomeResponse\x12\x37\n\rincome_events\x18\x01 \x03(\x0b\x32 .cln.BkprlistincomeIncome_events\"\xb5\x02\n\x1b\x42kprlistincomeIncome_events\x12\x0f\n\x07\x61\x63\x63ount\x18\x01 \x01(\t\x12\x0b\n\x03tag\x18\x02 \x01(\t\x12 \n\x0b\x63redit_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x1f\n\ndebit_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\x10\n\x08\x63urrency\x18\x05 \x01(\t\x12\x11\n\ttimestamp\x18\x06 \x01(\r\x12\x18\n\x0b\x64\x65scription\x18\x07 \x01(\tH\x00\x88\x01\x01\x12\x15\n\x08outpoint\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\x11\n\x04txid\x18\t \x01(\x0cH\x02\x88\x01\x01\x12\x17\n\npayment_id\x18\n \x01(\x0cH\x03\x88\x01\x01\x42\x0e\n\x0c_descriptionB\x0b\n\t_outpointB\x07\n\x05_txidB\r\n\x0b_payment_id2\xe2 \n\x04Node\x12\x36\n\x07Getinfo\x12\x13.cln.GetinfoRequest\x1a\x14.cln.GetinfoResponse\"\x00\x12<\n\tListPeers\x12\x15.cln.ListpeersRequest\x1a\x16.cln.ListpeersResponse\"\x00\x12<\n\tListFunds\x12\x15.cln.ListfundsRequest\x1a\x16.cln.ListfundsResponse\"\x00\x12\x36\n\x07SendPay\x12\x13.cln.SendpayRequest\x1a\x14.cln.SendpayResponse\"\x00\x12\x45\n\x0cListChannels\x12\x18.cln.ListchannelsRequest\x1a\x19.cln.ListchannelsResponse\"\x00\x12<\n\tAddGossip\x12\x15.cln.AddgossipRequest\x1a\x16.cln.AddgossipResponse\"\x00\x12Q\n\x10\x41utoCleanInvoice\x12\x1c.cln.AutocleaninvoiceRequest\x1a\x1d.cln.AutocleaninvoiceResponse\"\x00\x12\x45\n\x0c\x43heckMessage\x12\x18.cln.CheckmessageRequest\x1a\x19.cln.CheckmessageResponse\"\x00\x12\x30\n\x05\x43lose\x12\x11.cln.CloseRequest\x1a\x12.cln.CloseResponse\"\x00\x12:\n\x0b\x43onnectPeer\x12\x13.cln.ConnectRequest\x1a\x14.cln.ConnectResponse\"\x00\x12H\n\rCreateInvoice\x12\x19.cln.CreateinvoiceRequest\x1a\x1a.cln.CreateinvoiceResponse\"\x00\x12<\n\tDatastore\x12\x15.cln.DatastoreRequest\x1a\x16.cln.DatastoreResponse\"\x00\x12K\n\x0e\x44\x61tastoreUsage\x12\x1a.cln.DatastoreusageRequest\x1a\x1b.cln.DatastoreusageResponse\"\x00\x12\x42\n\x0b\x43reateOnion\x12\x17.cln.CreateonionRequest\x1a\x18.cln.CreateonionResponse\"\x00\x12\x45\n\x0c\x44\x65lDatastore\x12\x18.cln.DeldatastoreRequest\x1a\x19.cln.DeldatastoreResponse\"\x00\x12T\n\x11\x44\x65lExpiredInvoice\x12\x1d.cln.DelexpiredinvoiceRequest\x1a\x1e.cln.DelexpiredinvoiceResponse\"\x00\x12?\n\nDelInvoice\x12\x16.cln.DelinvoiceRequest\x1a\x17.cln.DelinvoiceResponse\"\x00\x12\x36\n\x07Invoice\x12\x13.cln.InvoiceRequest\x1a\x14.cln.InvoiceResponse\"\x00\x12H\n\rListDatastore\x12\x19.cln.ListdatastoreRequest\x1a\x1a.cln.ListdatastoreResponse\"\x00\x12\x45\n\x0cListInvoices\x12\x18.cln.ListinvoicesRequest\x1a\x19.cln.ListinvoicesResponse\"\x00\x12<\n\tSendOnion\x12\x15.cln.SendonionRequest\x1a\x16.cln.SendonionResponse\"\x00\x12\x45\n\x0cListSendPays\x12\x18.cln.ListsendpaysRequest\x1a\x19.cln.ListsendpaysResponse\"\x00\x12Q\n\x10ListTransactions\x12\x1c.cln.ListtransactionsRequest\x1a\x1d.cln.ListtransactionsResponse\"\x00\x12*\n\x03Pay\x12\x0f.cln.PayRequest\x1a\x10.cln.PayResponse\"\x00\x12<\n\tListNodes\x12\x15.cln.ListnodesRequest\x1a\x16.cln.ListnodesResponse\"\x00\x12K\n\x0eWaitAnyInvoice\x12\x1a.cln.WaitanyinvoiceRequest\x1a\x1b.cln.WaitanyinvoiceResponse\"\x00\x12\x42\n\x0bWaitInvoice\x12\x17.cln.WaitinvoiceRequest\x1a\x18.cln.WaitinvoiceResponse\"\x00\x12\x42\n\x0bWaitSendPay\x12\x17.cln.WaitsendpayRequest\x1a\x18.cln.WaitsendpayResponse\"\x00\x12\x36\n\x07NewAddr\x12\x13.cln.NewaddrRequest\x1a\x14.cln.NewaddrResponse\"\x00\x12\x39\n\x08Withdraw\x12\x14.cln.WithdrawRequest\x1a\x15.cln.WithdrawResponse\"\x00\x12\x36\n\x07KeySend\x12\x13.cln.KeysendRequest\x1a\x14.cln.KeysendResponse\"\x00\x12\x39\n\x08\x46undPsbt\x12\x14.cln.FundpsbtRequest\x1a\x15.cln.FundpsbtResponse\"\x00\x12\x39\n\x08SendPsbt\x12\x14.cln.SendpsbtRequest\x1a\x15.cln.SendpsbtResponse\"\x00\x12\x39\n\x08SignPsbt\x12\x14.cln.SignpsbtRequest\x1a\x15.cln.SignpsbtResponse\"\x00\x12\x39\n\x08UtxoPsbt\x12\x14.cln.UtxopsbtRequest\x1a\x15.cln.UtxopsbtResponse\"\x00\x12<\n\tTxDiscard\x12\x15.cln.TxdiscardRequest\x1a\x16.cln.TxdiscardResponse\"\x00\x12<\n\tTxPrepare\x12\x15.cln.TxprepareRequest\x1a\x16.cln.TxprepareResponse\"\x00\x12\x33\n\x06TxSend\x12\x12.cln.TxsendRequest\x1a\x13.cln.TxsendResponse\"\x00\x12Q\n\x10ListPeerChannels\x12\x1c.cln.ListpeerchannelsRequest\x1a\x1d.cln.ListpeerchannelsResponse\"\x00\x12W\n\x12ListClosedChannels\x12\x1e.cln.ListclosedchannelsRequest\x1a\x1f.cln.ListclosedchannelsResponse\"\x00\x12<\n\tDecodePay\x12\x15.cln.DecodepayRequest\x1a\x16.cln.DecodepayResponse\"\x00\x12\x33\n\x06\x44\x65\x63ode\x12\x12.cln.DecodeRequest\x1a\x13.cln.DecodeResponse\"\x00\x12?\n\nDisconnect\x12\x16.cln.DisconnectRequest\x1a\x17.cln.DisconnectResponse\"\x00\x12\x39\n\x08\x46\x65\x65rates\x12\x14.cln.FeeratesRequest\x1a\x15.cln.FeeratesResponse\"\x00\x12\x45\n\x0c\x46\x65tchInvoice\x12\x18.cln.FetchinvoiceRequest\x1a\x19.cln.FetchinvoiceResponse\"\x00\x12\x42\n\x0b\x46undChannel\x12\x17.cln.FundchannelRequest\x1a\x18.cln.FundchannelResponse\"\x00\x12\x39\n\x08GetRoute\x12\x14.cln.GetrouteRequest\x1a\x15.cln.GetrouteResponse\"\x00\x12\x45\n\x0cListForwards\x12\x18.cln.ListforwardsRequest\x1a\x19.cln.ListforwardsResponse\"\x00\x12?\n\nListOffers\x12\x16.cln.ListoffersRequest\x1a\x17.cln.ListoffersResponse\"\x00\x12\x39\n\x08ListPays\x12\x14.cln.ListpaysRequest\x1a\x15.cln.ListpaysResponse\"\x00\x12<\n\tListHtlcs\x12\x15.cln.ListhtlcsRequest\x1a\x16.cln.ListhtlcsResponse\"\x00\x12\x30\n\x05Offer\x12\x11.cln.OfferRequest\x1a\x12.cln.OfferResponse\"\x00\x12-\n\x04Ping\x12\x10.cln.PingRequest\x1a\x11.cln.PingResponse\"\x00\x12H\n\rSendCustomMsg\x12\x19.cln.SendcustommsgRequest\x1a\x1a.cln.SendcustommsgResponse\"\x00\x12?\n\nSetChannel\x12\x16.cln.SetchannelRequest\x1a\x17.cln.SetchannelResponse\"\x00\x12\x42\n\x0bSignInvoice\x12\x17.cln.SigninvoiceRequest\x1a\x18.cln.SigninvoiceResponse\"\x00\x12\x42\n\x0bSignMessage\x12\x17.cln.SignmessageRequest\x1a\x18.cln.SignmessageResponse\"\x00\x12N\n\x0fWaitBlockHeight\x12\x1b.cln.WaitblockheightRequest\x1a\x1c.cln.WaitblockheightResponse\"\x00\x12-\n\x04Wait\x12\x10.cln.WaitRequest\x1a\x11.cln.WaitResponse\"\x00\x12-\n\x04Stop\x12\x10.cln.StopRequest\x1a\x11.cln.StopResponse\"\x00\x12T\n\x11PreApproveKeysend\x12\x1d.cln.PreapprovekeysendRequest\x1a\x1e.cln.PreapprovekeysendResponse\"\x00\x12T\n\x11PreApproveInvoice\x12\x1d.cln.PreapproveinvoiceRequest\x1a\x1e.cln.PreapproveinvoiceResponse\"\x00\x12\x45\n\x0cStaticBackup\x12\x18.cln.StaticbackupRequest\x1a\x19.cln.StaticbackupResponse\"\x00\x12K\n\x0e\x42kprListIncome\x12\x1a.cln.BkprlistincomeRequest\x1a\x1b.cln.BkprlistincomeResponse\"\x00\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\nnode.proto\x12\x03\x63ln\x1a\x10primitives.proto\"\x10\n\x0eGetinfoRequest\"\xc1\x04\n\x0fGetinfoResponse\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x12\n\x05\x61lias\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\r\n\x05\x63olor\x18\x03 \x01(\x0c\x12\x11\n\tnum_peers\x18\x04 \x01(\r\x12\x1c\n\x14num_pending_channels\x18\x05 \x01(\r\x12\x1b\n\x13num_active_channels\x18\x06 \x01(\r\x12\x1d\n\x15num_inactive_channels\x18\x07 \x01(\r\x12\x0f\n\x07version\x18\x08 \x01(\t\x12\x15\n\rlightning_dir\x18\t \x01(\t\x12\x33\n\x0cour_features\x18\n \x01(\x0b\x32\x18.cln.GetinfoOur_featuresH\x01\x88\x01\x01\x12\x13\n\x0b\x62lockheight\x18\x0b \x01(\r\x12\x0f\n\x07network\x18\x0c \x01(\t\x12(\n\x13\x66\x65\x65s_collected_msat\x18\r \x01(\x0b\x32\x0b.cln.Amount\x12$\n\x07\x61\x64\x64ress\x18\x0e \x03(\x0b\x32\x13.cln.GetinfoAddress\x12$\n\x07\x62inding\x18\x0f \x03(\x0b\x32\x13.cln.GetinfoBinding\x12\"\n\x15warning_bitcoind_sync\x18\x10 \x01(\tH\x02\x88\x01\x01\x12$\n\x17warning_lightningd_sync\x18\x11 \x01(\tH\x03\x88\x01\x01\x42\x08\n\x06_aliasB\x0f\n\r_our_featuresB\x18\n\x16_warning_bitcoind_syncB\x1a\n\x18_warning_lightningd_sync\"S\n\x13GetinfoOur_features\x12\x0c\n\x04init\x18\x01 \x01(\x0c\x12\x0c\n\x04node\x18\x02 \x01(\x0c\x12\x0f\n\x07\x63hannel\x18\x03 \x01(\x0c\x12\x0f\n\x07invoice\x18\x04 \x01(\x0c\"\xc4\x01\n\x0eGetinfoAddress\x12\x39\n\titem_type\x18\x01 \x01(\x0e\x32&.cln.GetinfoAddress.GetinfoAddressType\x12\x0c\n\x04port\x18\x02 \x01(\r\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x00\x88\x01\x01\"G\n\x12GetinfoAddressType\x12\x07\n\x03\x44NS\x10\x00\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\n\n\x08_address\"\x8a\x02\n\x0eGetinfoBinding\x12\x39\n\titem_type\x18\x01 \x01(\x0e\x32&.cln.GetinfoBinding.GetinfoBindingType\x12\x14\n\x07\x61\x64\x64ress\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04port\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x13\n\x06socket\x18\x04 \x01(\tH\x02\x88\x01\x01\"_\n\x12GetinfoBindingType\x12\x10\n\x0cLOCAL_SOCKET\x10\x00\x12\r\n\tWEBSOCKET\x10\x05\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\n\n\x08_addressB\x07\n\x05_portB\t\n\x07_socket\"\xaa\x01\n\x10ListpeersRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x38\n\x05level\x18\x02 \x01(\x0e\x32$.cln.ListpeersRequest.ListpeersLevelH\x01\x88\x01\x01\":\n\x0eListpeersLevel\x12\x06\n\x02IO\x10\x00\x12\t\n\x05\x44\x45\x42UG\x10\x01\x12\x08\n\x04INFO\x10\x02\x12\x0b\n\x07UNUSUAL\x10\x03\x42\x05\n\x03_idB\x08\n\x06_level\"7\n\x11ListpeersResponse\x12\"\n\x05peers\x18\x01 \x03(\x0b\x32\x13.cln.ListpeersPeers\"\x8e\x02\n\x0eListpeersPeers\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x11\n\tconnected\x18\x02 \x01(\x08\x12\x19\n\x0cnum_channels\x18\x08 \x01(\rH\x00\x88\x01\x01\x12#\n\x03log\x18\x03 \x03(\x0b\x32\x16.cln.ListpeersPeersLog\x12-\n\x08\x63hannels\x18\x04 \x03(\x0b\x32\x1b.cln.ListpeersPeersChannels\x12\x0f\n\x07netaddr\x18\x05 \x03(\t\x12\x18\n\x0bremote_addr\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x15\n\x08\x66\x65\x61tures\x18\x06 \x01(\x0cH\x02\x88\x01\x01\x42\x0f\n\r_num_channelsB\x0e\n\x0c_remote_addrB\x0b\n\t_features\"\xfd\x02\n\x11ListpeersPeersLog\x12?\n\titem_type\x18\x01 \x01(\x0e\x32,.cln.ListpeersPeersLog.ListpeersPeersLogType\x12\x18\n\x0bnum_skipped\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x11\n\x04time\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06source\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x10\n\x03log\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x14\n\x07node_id\x18\x06 \x01(\x0cH\x04\x88\x01\x01\x12\x11\n\x04\x64\x61ta\x18\x07 \x01(\x0cH\x05\x88\x01\x01\"i\n\x15ListpeersPeersLogType\x12\x0b\n\x07SKIPPED\x10\x00\x12\n\n\x06\x42ROKEN\x10\x01\x12\x0b\n\x07UNUSUAL\x10\x02\x12\x08\n\x04INFO\x10\x03\x12\t\n\x05\x44\x45\x42UG\x10\x04\x12\t\n\x05IO_IN\x10\x05\x12\n\n\x06IO_OUT\x10\x06\x42\x0e\n\x0c_num_skippedB\x07\n\x05_timeB\t\n\x07_sourceB\x06\n\x04_logB\n\n\x08_node_idB\x07\n\x05_data\"\x95\x18\n\x16ListpeersPeersChannels\x12\x46\n\x05state\x18\x01 \x01(\x0e\x32\x37.cln.ListpeersPeersChannels.ListpeersPeersChannelsState\x12\x19\n\x0cscratch_txid\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x38\n\x07\x66\x65\x65rate\x18\x03 \x01(\x0b\x32\".cln.ListpeersPeersChannelsFeerateH\x01\x88\x01\x01\x12\x12\n\x05owner\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x1d\n\x10short_channel_id\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x17\n\nchannel_id\x18\x06 \x01(\x0cH\x04\x88\x01\x01\x12\x19\n\x0c\x66unding_txid\x18\x07 \x01(\x0cH\x05\x88\x01\x01\x12\x1b\n\x0e\x66unding_outnum\x18\x08 \x01(\rH\x06\x88\x01\x01\x12\x1c\n\x0finitial_feerate\x18\t \x01(\tH\x07\x88\x01\x01\x12\x19\n\x0clast_feerate\x18\n \x01(\tH\x08\x88\x01\x01\x12\x19\n\x0cnext_feerate\x18\x0b \x01(\tH\t\x88\x01\x01\x12\x1a\n\rnext_fee_step\x18\x0c \x01(\rH\n\x88\x01\x01\x12\x35\n\x08inflight\x18\r \x03(\x0b\x32#.cln.ListpeersPeersChannelsInflight\x12\x15\n\x08\x63lose_to\x18\x0e \x01(\x0cH\x0b\x88\x01\x01\x12\x14\n\x07private\x18\x0f \x01(\x08H\x0c\x88\x01\x01\x12 \n\x06opener\x18\x10 \x01(\x0e\x32\x10.cln.ChannelSide\x12%\n\x06\x63loser\x18\x11 \x01(\x0e\x32\x10.cln.ChannelSideH\r\x88\x01\x01\x12\x10\n\x08\x66\x65\x61tures\x18\x12 \x03(\t\x12\x38\n\x07\x66unding\x18\x13 \x01(\x0b\x32\".cln.ListpeersPeersChannelsFundingH\x0e\x88\x01\x01\x12$\n\nto_us_msat\x18\x14 \x01(\x0b\x32\x0b.cln.AmountH\x0f\x88\x01\x01\x12(\n\x0emin_to_us_msat\x18\x15 \x01(\x0b\x32\x0b.cln.AmountH\x10\x88\x01\x01\x12(\n\x0emax_to_us_msat\x18\x16 \x01(\x0b\x32\x0b.cln.AmountH\x11\x88\x01\x01\x12$\n\ntotal_msat\x18\x17 \x01(\x0b\x32\x0b.cln.AmountH\x12\x88\x01\x01\x12\'\n\rfee_base_msat\x18\x18 \x01(\x0b\x32\x0b.cln.AmountH\x13\x88\x01\x01\x12(\n\x1b\x66\x65\x65_proportional_millionths\x18\x19 \x01(\rH\x14\x88\x01\x01\x12)\n\x0f\x64ust_limit_msat\x18\x1a \x01(\x0b\x32\x0b.cln.AmountH\x15\x88\x01\x01\x12\x30\n\x16max_total_htlc_in_msat\x18\x1b \x01(\x0b\x32\x0b.cln.AmountH\x16\x88\x01\x01\x12,\n\x12their_reserve_msat\x18\x1c \x01(\x0b\x32\x0b.cln.AmountH\x17\x88\x01\x01\x12*\n\x10our_reserve_msat\x18\x1d \x01(\x0b\x32\x0b.cln.AmountH\x18\x88\x01\x01\x12(\n\x0espendable_msat\x18\x1e \x01(\x0b\x32\x0b.cln.AmountH\x19\x88\x01\x01\x12)\n\x0freceivable_msat\x18\x1f \x01(\x0b\x32\x0b.cln.AmountH\x1a\x88\x01\x01\x12.\n\x14minimum_htlc_in_msat\x18 \x01(\x0b\x32\x0b.cln.AmountH\x1b\x88\x01\x01\x12/\n\x15minimum_htlc_out_msat\x18\x30 \x01(\x0b\x32\x0b.cln.AmountH\x1c\x88\x01\x01\x12/\n\x15maximum_htlc_out_msat\x18\x31 \x01(\x0b\x32\x0b.cln.AmountH\x1d\x88\x01\x01\x12 \n\x13their_to_self_delay\x18! \x01(\rH\x1e\x88\x01\x01\x12\x1e\n\x11our_to_self_delay\x18\" \x01(\rH\x1f\x88\x01\x01\x12\x1f\n\x12max_accepted_htlcs\x18# \x01(\rH \x88\x01\x01\x12\x34\n\x05\x61lias\x18\x32 \x01(\x0b\x32 .cln.ListpeersPeersChannelsAliasH!\x88\x01\x01\x12\x0e\n\x06status\x18% \x03(\t\x12 \n\x13in_payments_offered\x18& \x01(\x04H\"\x88\x01\x01\x12)\n\x0fin_offered_msat\x18\' \x01(\x0b\x32\x0b.cln.AmountH#\x88\x01\x01\x12\"\n\x15in_payments_fulfilled\x18( \x01(\x04H$\x88\x01\x01\x12+\n\x11in_fulfilled_msat\x18) \x01(\x0b\x32\x0b.cln.AmountH%\x88\x01\x01\x12!\n\x14out_payments_offered\x18* \x01(\x04H&\x88\x01\x01\x12*\n\x10out_offered_msat\x18+ \x01(\x0b\x32\x0b.cln.AmountH\'\x88\x01\x01\x12#\n\x16out_payments_fulfilled\x18, \x01(\x04H(\x88\x01\x01\x12,\n\x12out_fulfilled_msat\x18- \x01(\x0b\x32\x0b.cln.AmountH)\x88\x01\x01\x12/\n\x05htlcs\x18. \x03(\x0b\x32 .cln.ListpeersPeersChannelsHtlcs\x12\x1a\n\rclose_to_addr\x18/ \x01(\tH*\x88\x01\x01\"\xe0\x02\n\x1bListpeersPeersChannelsState\x12\x0c\n\x08OPENINGD\x10\x00\x12\x1c\n\x18\x43HANNELD_AWAITING_LOCKIN\x10\x01\x12\x13\n\x0f\x43HANNELD_NORMAL\x10\x02\x12\x1a\n\x16\x43HANNELD_SHUTTING_DOWN\x10\x03\x12\x18\n\x14\x43LOSINGD_SIGEXCHANGE\x10\x04\x12\x15\n\x11\x43LOSINGD_COMPLETE\x10\x05\x12\x17\n\x13\x41WAITING_UNILATERAL\x10\x06\x12\x16\n\x12\x46UNDING_SPEND_SEEN\x10\x07\x12\x0b\n\x07ONCHAIN\x10\x08\x12\x17\n\x13\x44UALOPEND_OPEN_INIT\x10\t\x12\x1d\n\x19\x44UALOPEND_AWAITING_LOCKIN\x10\n\x12\x1c\n\x18\x44UALOPEND_OPEN_COMMITTED\x10\x0b\x12\x1f\n\x1b\x44UALOPEND_OPEN_COMMIT_READY\x10\x0c\x42\x0f\n\r_scratch_txidB\n\n\x08_feerateB\x08\n\x06_ownerB\x13\n\x11_short_channel_idB\r\n\x0b_channel_idB\x0f\n\r_funding_txidB\x11\n\x0f_funding_outnumB\x12\n\x10_initial_feerateB\x0f\n\r_last_feerateB\x0f\n\r_next_feerateB\x10\n\x0e_next_fee_stepB\x0b\n\t_close_toB\n\n\x08_privateB\t\n\x07_closerB\n\n\x08_fundingB\r\n\x0b_to_us_msatB\x11\n\x0f_min_to_us_msatB\x11\n\x0f_max_to_us_msatB\r\n\x0b_total_msatB\x10\n\x0e_fee_base_msatB\x1e\n\x1c_fee_proportional_millionthsB\x12\n\x10_dust_limit_msatB\x19\n\x17_max_total_htlc_in_msatB\x15\n\x13_their_reserve_msatB\x13\n\x11_our_reserve_msatB\x11\n\x0f_spendable_msatB\x12\n\x10_receivable_msatB\x17\n\x15_minimum_htlc_in_msatB\x18\n\x16_minimum_htlc_out_msatB\x18\n\x16_maximum_htlc_out_msatB\x16\n\x14_their_to_self_delayB\x14\n\x12_our_to_self_delayB\x15\n\x13_max_accepted_htlcsB\x08\n\x06_aliasB\x16\n\x14_in_payments_offeredB\x12\n\x10_in_offered_msatB\x18\n\x16_in_payments_fulfilledB\x14\n\x12_in_fulfilled_msatB\x17\n\x15_out_payments_offeredB\x13\n\x11_out_offered_msatB\x19\n\x17_out_payments_fulfilledB\x15\n\x13_out_fulfilled_msatB\x10\n\x0e_close_to_addr\"=\n\x1dListpeersPeersChannelsFeerate\x12\r\n\x05perkw\x18\x01 \x01(\r\x12\r\n\x05perkb\x18\x02 \x01(\r\"\xf3\x01\n\x1eListpeersPeersChannelsInflight\x12\x14\n\x0c\x66unding_txid\x18\x01 \x01(\x0c\x12\x16\n\x0e\x66unding_outnum\x18\x02 \x01(\r\x12\x0f\n\x07\x66\x65\x65rate\x18\x03 \x01(\t\x12\'\n\x12total_funding_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10our_funding_msat\x18\x05 \x01(\x0b\x32\x0b.cln.Amount\x12\x1a\n\rsplice_amount\x18\x07 \x01(\x12H\x00\x88\x01\x01\x12\x14\n\x0cscratch_txid\x18\x06 \x01(\x0c\x42\x10\n\x0e_splice_amount\"\x9b\x02\n\x1dListpeersPeersChannelsFunding\x12%\n\x0bpushed_msat\x18\x03 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12%\n\x10local_funds_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12&\n\x11remote_funds_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\'\n\rfee_paid_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\'\n\rfee_rcvd_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x42\x0e\n\x0c_pushed_msatB\x10\n\x0e_fee_paid_msatB\x10\n\x0e_fee_rcvd_msat\"[\n\x1bListpeersPeersChannelsAlias\x12\x12\n\x05local\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06remote\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_localB\t\n\x07_remote\"\xf1\x02\n\x1bListpeersPeersChannelsHtlcs\x12X\n\tdirection\x18\x01 \x01(\x0e\x32\x45.cln.ListpeersPeersChannelsHtlcs.ListpeersPeersChannelsHtlcsDirection\x12\n\n\x02id\x18\x02 \x01(\x04\x12 \n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x0e\n\x06\x65xpiry\x18\x04 \x01(\r\x12\x14\n\x0cpayment_hash\x18\x05 \x01(\x0c\x12\x1a\n\rlocal_trimmed\x18\x06 \x01(\x08H\x00\x88\x01\x01\x12\x13\n\x06status\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x1d\n\x05state\x18\x08 \x01(\x0e\x32\x0e.cln.HtlcState\"7\n$ListpeersPeersChannelsHtlcsDirection\x12\x06\n\x02IN\x10\x00\x12\x07\n\x03OUT\x10\x01\x42\x10\n\x0e_local_trimmedB\t\n\x07_status\"0\n\x10ListfundsRequest\x12\x12\n\x05spent\x18\x01 \x01(\x08H\x00\x88\x01\x01\x42\x08\n\x06_spent\"e\n\x11ListfundsResponse\x12&\n\x07outputs\x18\x01 \x03(\x0b\x32\x15.cln.ListfundsOutputs\x12(\n\x08\x63hannels\x18\x02 \x03(\x0b\x32\x16.cln.ListfundsChannels\"\x83\x03\n\x10ListfundsOutputs\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x0e\n\x06output\x18\x02 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x14\n\x0cscriptpubkey\x18\x04 \x01(\x0c\x12\x14\n\x07\x61\x64\x64ress\x18\x05 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0credeemscript\x18\x06 \x01(\x0cH\x01\x88\x01\x01\x12<\n\x06status\x18\x07 \x01(\x0e\x32,.cln.ListfundsOutputs.ListfundsOutputsStatus\x12\x10\n\x08reserved\x18\t \x01(\x08\x12\x18\n\x0b\x62lockheight\x18\x08 \x01(\rH\x02\x88\x01\x01\"Q\n\x16ListfundsOutputsStatus\x12\x0f\n\x0bUNCONFIRMED\x10\x00\x12\r\n\tCONFIRMED\x10\x01\x12\t\n\x05SPENT\x10\x02\x12\x0c\n\x08IMMATURE\x10\x03\x42\n\n\x08_addressB\x0f\n\r_redeemscriptB\x0e\n\x0c_blockheight\"\xab\x02\n\x11ListfundsChannels\x12\x0f\n\x07peer_id\x18\x01 \x01(\x0c\x12$\n\x0four_amount_msat\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\x12 \n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x14\n\x0c\x66unding_txid\x18\x04 \x01(\x0c\x12\x16\n\x0e\x66unding_output\x18\x05 \x01(\r\x12\x11\n\tconnected\x18\x06 \x01(\x08\x12 \n\x05state\x18\x07 \x01(\x0e\x32\x11.cln.ChannelState\x12\x17\n\nchannel_id\x18\t \x01(\x0cH\x00\x88\x01\x01\x12\x1d\n\x10short_channel_id\x18\x08 \x01(\tH\x01\x88\x01\x01\x42\r\n\x0b_channel_idB\x13\n\x11_short_channel_id\"\xbb\x03\n\x0eSendpayRequest\x12 \n\x05route\x18\x01 \x03(\x0b\x32\x11.cln.SendpayRoute\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\x0c\x12\x12\n\x05label\x18\x03 \x01(\tH\x00\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x1b\n\x0epayment_secret\x18\x06 \x01(\x0cH\x03\x88\x01\x01\x12\x13\n\x06partid\x18\x07 \x01(\x04H\x04\x88\x01\x01\x12\x1a\n\rlocalinvreqid\x18\x0b \x01(\x0cH\x05\x88\x01\x01\x12\x14\n\x07groupid\x18\t \x01(\x04H\x06\x88\x01\x01\x12\x1d\n\x10payment_metadata\x18\x0c \x01(\x0cH\x07\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\r \x01(\tH\x08\x88\x01\x01\x42\x08\n\x06_labelB\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\x11\n\x0f_payment_secretB\t\n\x07_partidB\x10\n\x0e_localinvreqidB\n\n\x08_groupidB\x13\n\x11_payment_metadataB\x0e\n\x0c_description\"\xad\x05\n\x0fSendpayResponse\x12\x1a\n\rcreated_index\x18\x10 \x01(\x04H\x00\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x11 \x01(\x04H\x01\x88\x01\x01\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x14\n\x07groupid\x18\x02 \x01(\x04H\x02\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x32\n\x06status\x18\x04 \x01(\x0e\x32\".cln.SendpayResponse.SendpayStatus\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x06 \x01(\x0cH\x04\x88\x01\x01\x12\x12\n\ncreated_at\x18\x07 \x01(\x04\x12\x19\n\x0c\x63ompleted_at\x18\x0f \x01(\x04H\x05\x88\x01\x01\x12%\n\x10\x61mount_sent_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\t \x01(\tH\x06\x88\x01\x01\x12\x13\n\x06partid\x18\n \x01(\x04H\x07\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x0b \x01(\tH\x08\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x0c \x01(\tH\t\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\r \x01(\x0cH\n\x88\x01\x01\x12\x14\n\x07message\x18\x0e \x01(\tH\x0b\x88\x01\x01\"*\n\rSendpayStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x42\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\n\n\x08_groupidB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x0f\n\r_completed_atB\x08\n\x06_labelB\t\n\x07_partidB\t\n\x07_bolt11B\t\n\x07_bolt12B\x13\n\x11_payment_preimageB\n\n\x08_message\"\\\n\x0cSendpayRoute\x12\n\n\x02id\x18\x02 \x01(\x0c\x12\x0f\n\x07\x63hannel\x18\x04 \x01(\t\x12\r\n\x05\x64\x65lay\x18\x03 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.Amount\"\x93\x01\n\x13ListchannelsRequest\x12\x1d\n\x10short_channel_id\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06source\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x03 \x01(\x0cH\x02\x88\x01\x01\x42\x13\n\x11_short_channel_idB\t\n\x07_sourceB\x0e\n\x0c_destination\"C\n\x14ListchannelsResponse\x12+\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x19.cln.ListchannelsChannels\"\xb3\x03\n\x14ListchannelsChannels\x12\x0e\n\x06source\x18\x01 \x01(\x0c\x12\x13\n\x0b\x64\x65stination\x18\x02 \x01(\x0c\x12\x18\n\x10short_channel_id\x18\x03 \x01(\t\x12\x11\n\tdirection\x18\x10 \x01(\r\x12\x0e\n\x06public\x18\x04 \x01(\x08\x12 \n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.Amount\x12\x15\n\rmessage_flags\x18\x06 \x01(\r\x12\x15\n\rchannel_flags\x18\x07 \x01(\r\x12\x0e\n\x06\x61\x63tive\x18\x08 \x01(\x08\x12\x13\n\x0blast_update\x18\t \x01(\r\x12\x1d\n\x15\x62\x61se_fee_millisatoshi\x18\n \x01(\r\x12\x19\n\x11\x66\x65\x65_per_millionth\x18\x0b \x01(\r\x12\r\n\x05\x64\x65lay\x18\x0c \x01(\r\x12&\n\x11htlc_minimum_msat\x18\r \x01(\x0b\x32\x0b.cln.Amount\x12+\n\x11htlc_maximum_msat\x18\x0e \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x10\n\x08\x66\x65\x61tures\x18\x0f \x01(\x0c\x42\x14\n\x12_htlc_maximum_msat\"#\n\x10\x41\x64\x64gossipRequest\x12\x0f\n\x07message\x18\x01 \x01(\x0c\"\x13\n\x11\x41\x64\x64gossipResponse\"o\n\x17\x41utocleaninvoiceRequest\x12\x17\n\nexpired_by\x18\x01 \x01(\x04H\x00\x88\x01\x01\x12\x1a\n\rcycle_seconds\x18\x02 \x01(\x04H\x01\x88\x01\x01\x42\r\n\x0b_expired_byB\x10\n\x0e_cycle_seconds\"\x81\x01\n\x18\x41utocleaninvoiceResponse\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\x17\n\nexpired_by\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x1a\n\rcycle_seconds\x18\x03 \x01(\x04H\x01\x88\x01\x01\x42\r\n\x0b_expired_byB\x10\n\x0e_cycle_seconds\"U\n\x13\x43heckmessageRequest\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\r\n\x05zbase\x18\x02 \x01(\t\x12\x13\n\x06pubkey\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x42\t\n\x07_pubkey\"8\n\x14\x43heckmessageResponse\x12\x10\n\x08verified\x18\x01 \x01(\x08\x12\x0e\n\x06pubkey\x18\x02 \x01(\x0c\"\xcb\x02\n\x0c\x43loseRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x1e\n\x11unilateraltimeout\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x03 \x01(\tH\x01\x88\x01\x01\x12!\n\x14\x66\x65\x65_negotiation_step\x18\x04 \x01(\tH\x02\x88\x01\x01\x12)\n\rwrong_funding\x18\x05 \x01(\x0b\x32\r.cln.OutpointH\x03\x88\x01\x01\x12\x1f\n\x12\x66orce_lease_closed\x18\x06 \x01(\x08H\x04\x88\x01\x01\x12\x1e\n\x08\x66\x65\x65range\x18\x07 \x03(\x0b\x32\x0c.cln.FeerateB\x14\n\x12_unilateraltimeoutB\x0e\n\x0c_destinationB\x17\n\x15_fee_negotiation_stepB\x10\n\x0e_wrong_fundingB\x15\n\x13_force_lease_closed\"\xab\x01\n\rCloseResponse\x12/\n\titem_type\x18\x01 \x01(\x0e\x32\x1c.cln.CloseResponse.CloseType\x12\x0f\n\x02tx\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x11\n\x04txid\x18\x03 \x01(\x0cH\x01\x88\x01\x01\"5\n\tCloseType\x12\n\n\x06MUTUAL\x10\x00\x12\x0e\n\nUNILATERAL\x10\x01\x12\x0c\n\x08UNOPENED\x10\x02\x42\x05\n\x03_txB\x07\n\x05_txid\"T\n\x0e\x43onnectRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\x04host\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04port\x18\x03 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_hostB\x07\n\x05_port\"\xb4\x01\n\x0f\x43onnectResponse\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x10\n\x08\x66\x65\x61tures\x18\x02 \x01(\x0c\x12\x38\n\tdirection\x18\x03 \x01(\x0e\x32%.cln.ConnectResponse.ConnectDirection\x12$\n\x07\x61\x64\x64ress\x18\x04 \x01(\x0b\x32\x13.cln.ConnectAddress\"#\n\x10\x43onnectDirection\x12\x06\n\x02IN\x10\x00\x12\x07\n\x03OUT\x10\x01\"\xfb\x01\n\x0e\x43onnectAddress\x12\x39\n\titem_type\x18\x01 \x01(\x0e\x32&.cln.ConnectAddress.ConnectAddressType\x12\x13\n\x06socket\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x11\n\x04port\x18\x04 \x01(\rH\x02\x88\x01\x01\"P\n\x12\x43onnectAddressType\x12\x10\n\x0cLOCAL_SOCKET\x10\x00\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\t\n\x07_socketB\n\n\x08_addressB\x07\n\x05_port\";\n\x14\x43reateinvoiceRequest\x12\x11\n\tinvstring\x18\x01 \x01(\t\x12\x10\n\x08preimage\x18\x03 \x01(\x0c\"\xfe\x05\n\x15\x43reateinvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x06\x62olt11\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x04 \x01(\x0c\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12>\n\x06status\x18\x06 \x01(\x0e\x32..cln.CreateinvoiceResponse.CreateinvoiceStatus\x12\x13\n\x0b\x64\x65scription\x18\x07 \x01(\t\x12\x12\n\nexpires_at\x18\x08 \x01(\x04\x12\x1a\n\rcreated_index\x18\x10 \x01(\x04H\x03\x88\x01\x01\x12\x16\n\tpay_index\x18\t \x01(\x04H\x04\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x05\x88\x01\x01\x12\x14\n\x07paid_at\x18\x0b \x01(\x04H\x06\x88\x01\x01\x12;\n\rpaid_outpoint\x18\x11 \x01(\x0b\x32\x1f.cln.CreateinvoicePaid_outpointH\x07\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\x08\x88\x01\x01\x12\x1b\n\x0elocal_offer_id\x18\r \x01(\x0cH\t\x88\x01\x01\x12\x1e\n\x11invreq_payer_note\x18\x0f \x01(\tH\n\x88\x01\x01\"8\n\x13\x43reateinvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x12\n\n\x06UNPAID\x10\x02\x42\t\n\x07_bolt11B\t\n\x07_bolt12B\x0e\n\x0c_amount_msatB\x10\n\x0e_created_indexB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x10\n\x0e_paid_outpointB\x13\n\x11_payment_preimageB\x11\n\x0f_local_offer_idB\x14\n\x12_invreq_payer_note\"X\n\x1a\x43reateinvoicePaid_outpoint\x12\x11\n\x04txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x13\n\x06outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_txidB\t\n\x07_outnum\"\xb4\x02\n\x10\x44\x61tastoreRequest\x12\x0b\n\x03key\x18\x05 \x03(\t\x12\x13\n\x06string\x18\x06 \x01(\tH\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12\x36\n\x04mode\x18\x03 \x01(\x0e\x32#.cln.DatastoreRequest.DatastoreModeH\x02\x88\x01\x01\x12\x17\n\ngeneration\x18\x04 \x01(\x04H\x03\x88\x01\x01\"p\n\rDatastoreMode\x12\x0f\n\x0bMUST_CREATE\x10\x00\x12\x10\n\x0cMUST_REPLACE\x10\x01\x12\x15\n\x11\x43REATE_OR_REPLACE\x10\x02\x12\x0f\n\x0bMUST_APPEND\x10\x03\x12\x14\n\x10\x43REATE_OR_APPEND\x10\x04\x42\t\n\x07_stringB\x06\n\x04_hexB\x07\n\x05_modeB\r\n\x0b_generation\"\x82\x01\n\x11\x44\x61tastoreResponse\x12\x0b\n\x03key\x18\x05 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x12\x13\n\x06string\x18\x04 \x01(\tH\x02\x88\x01\x01\x42\r\n\x0b_generationB\x06\n\x04_hexB\t\n\x07_string\"\x17\n\x15\x44\x61tastoreusageRequest\"k\n\x16\x44\x61tastoreusageResponse\x12>\n\x0e\x64\x61tastoreusage\x18\x01 \x01(\x0b\x32!.cln.DatastoreusageDatastoreusageH\x00\x88\x01\x01\x42\x11\n\x0f_datastoreusage\"b\n\x1c\x44\x61tastoreusageDatastoreusage\x12\x10\n\x03key\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x18\n\x0btotal_bytes\x18\x02 \x01(\x04H\x01\x88\x01\x01\x42\x06\n\x04_keyB\x0e\n\x0c_total_bytes\"\x9d\x01\n\x12\x43reateonionRequest\x12\"\n\x04hops\x18\x01 \x03(\x0b\x32\x14.cln.CreateonionHops\x12\x11\n\tassocdata\x18\x02 \x01(\x0c\x12\x18\n\x0bsession_key\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x12\x17\n\nonion_size\x18\x04 \x01(\rH\x01\x88\x01\x01\x42\x0e\n\x0c_session_keyB\r\n\x0b_onion_size\"<\n\x13\x43reateonionResponse\x12\r\n\x05onion\x18\x01 \x01(\x0c\x12\x16\n\x0eshared_secrets\x18\x02 \x03(\x0c\"2\n\x0f\x43reateonionHops\x12\x0e\n\x06pubkey\x18\x01 \x01(\x0c\x12\x0f\n\x07payload\x18\x02 \x01(\x0c\"J\n\x13\x44\x65ldatastoreRequest\x12\x0b\n\x03key\x18\x03 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\r\n\x0b_generation\"\x85\x01\n\x14\x44\x65ldatastoreResponse\x12\x0b\n\x03key\x18\x05 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x12\x13\n\x06string\x18\x04 \x01(\tH\x02\x88\x01\x01\x42\r\n\x0b_generationB\x06\n\x04_hexB\t\n\x07_string\"H\n\x18\x44\x65lexpiredinvoiceRequest\x12\x1a\n\rmaxexpirytime\x18\x01 \x01(\x04H\x00\x88\x01\x01\x42\x10\n\x0e_maxexpirytime\"\x1b\n\x19\x44\x65lexpiredinvoiceResponse\"\xb6\x01\n\x11\x44\x65linvoiceRequest\x12\r\n\x05label\x18\x01 \x01(\t\x12\x37\n\x06status\x18\x02 \x01(\x0e\x32\'.cln.DelinvoiceRequest.DelinvoiceStatus\x12\x15\n\x08\x64\x65sconly\x18\x03 \x01(\x08H\x00\x88\x01\x01\"5\n\x10\x44\x65linvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x12\n\n\x06UNPAID\x10\x02\x42\x0b\n\t_desconly\"\xa1\x04\n\x12\x44\x65linvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x06\x62olt11\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x03 \x01(\tH\x01\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x06 \x01(\x0c\x12\x1a\n\rcreated_index\x18\x0c \x01(\x04H\x04\x88\x01\x01\x12\x1a\n\rupdated_index\x18\r \x01(\x04H\x05\x88\x01\x01\x12\x38\n\x06status\x18\x07 \x01(\x0e\x32(.cln.DelinvoiceResponse.DelinvoiceStatus\x12\x12\n\nexpires_at\x18\x08 \x01(\x04\x12\x1b\n\x0elocal_offer_id\x18\t \x01(\x0cH\x06\x88\x01\x01\x12\x1e\n\x11invreq_payer_note\x18\x0b \x01(\tH\x07\x88\x01\x01\"5\n\x10\x44\x65linvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x12\n\n\x06UNPAID\x10\x02\x42\t\n\x07_bolt11B\t\n\x07_bolt12B\x0e\n\x0c_amount_msatB\x0e\n\x0c_descriptionB\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\x11\n\x0f_local_offer_idB\x14\n\x12_invreq_payer_note\"\xfa\x01\n\x0eInvoiceRequest\x12%\n\x0b\x61mount_msat\x18\n \x01(\x0b\x32\x10.cln.AmountOrAny\x12\r\n\x05label\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x13\n\x06\x65xpiry\x18\x07 \x01(\x04H\x00\x88\x01\x01\x12\x11\n\tfallbacks\x18\x04 \x03(\t\x12\x15\n\x08preimage\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x11\n\x04\x63ltv\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x19\n\x0c\x64\x65schashonly\x18\t \x01(\x08H\x03\x88\x01\x01\x42\t\n\x07_expiryB\x0b\n\t_preimageB\x07\n\x05_cltvB\x0f\n\r_deschashonly\"\x95\x03\n\x0fInvoiceResponse\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\x0c\x12\x16\n\x0epayment_secret\x18\x03 \x01(\x0c\x12\x12\n\nexpires_at\x18\x04 \x01(\x04\x12\x1a\n\rcreated_index\x18\n \x01(\x04H\x00\x88\x01\x01\x12\x1d\n\x10warning_capacity\x18\x05 \x01(\tH\x01\x88\x01\x01\x12\x1c\n\x0fwarning_offline\x18\x06 \x01(\tH\x02\x88\x01\x01\x12\x1d\n\x10warning_deadends\x18\x07 \x01(\tH\x03\x88\x01\x01\x12#\n\x16warning_private_unused\x18\x08 \x01(\tH\x04\x88\x01\x01\x12\x18\n\x0bwarning_mpp\x18\t \x01(\tH\x05\x88\x01\x01\x42\x10\n\x0e_created_indexB\x13\n\x11_warning_capacityB\x12\n\x10_warning_offlineB\x13\n\x11_warning_deadendsB\x19\n\x17_warning_private_unusedB\x0e\n\x0c_warning_mpp\"#\n\x14ListdatastoreRequest\x12\x0b\n\x03key\x18\x02 \x03(\t\"G\n\x15ListdatastoreResponse\x12.\n\tdatastore\x18\x01 \x03(\x0b\x32\x1b.cln.ListdatastoreDatastore\"\x87\x01\n\x16ListdatastoreDatastore\x12\x0b\n\x03key\x18\x01 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x12\x13\n\x06string\x18\x04 \x01(\tH\x02\x88\x01\x01\x42\r\n\x0b_generationB\x06\n\x04_hexB\t\n\x07_string\"\xde\x02\n\x13ListinvoicesRequest\x12\x12\n\x05label\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x16\n\tinvstring\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x03 \x01(\x0cH\x02\x88\x01\x01\x12\x15\n\x08offer_id\x18\x04 \x01(\tH\x03\x88\x01\x01\x12>\n\x05index\x18\x05 \x01(\x0e\x32*.cln.ListinvoicesRequest.ListinvoicesIndexH\x04\x88\x01\x01\x12\x12\n\x05start\x18\x06 \x01(\x04H\x05\x88\x01\x01\x12\x12\n\x05limit\x18\x07 \x01(\rH\x06\x88\x01\x01\"-\n\x11ListinvoicesIndex\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07UPDATED\x10\x01\x42\x08\n\x06_labelB\x0c\n\n_invstringB\x0f\n\r_payment_hashB\x0b\n\t_offer_idB\x08\n\x06_indexB\x08\n\x06_startB\x08\n\x06_limit\"C\n\x14ListinvoicesResponse\x12+\n\x08invoices\x18\x01 \x03(\x0b\x32\x19.cln.ListinvoicesInvoices\"\xd4\x06\n\x14ListinvoicesInvoices\x12\r\n\x05label\x18\x01 \x01(\t\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x44\n\x06status\x18\x04 \x01(\x0e\x32\x34.cln.ListinvoicesInvoices.ListinvoicesInvoicesStatus\x12\x12\n\nexpires_at\x18\x05 \x01(\x04\x12%\n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x08 \x01(\tH\x03\x88\x01\x01\x12\x1b\n\x0elocal_offer_id\x18\t \x01(\x0cH\x04\x88\x01\x01\x12\x1e\n\x11invreq_payer_note\x18\x0f \x01(\tH\x05\x88\x01\x01\x12\x1a\n\rcreated_index\x18\x10 \x01(\x04H\x06\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x11 \x01(\x04H\x07\x88\x01\x01\x12\x16\n\tpay_index\x18\x0b \x01(\x04H\x08\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\x0c \x01(\x0b\x32\x0b.cln.AmountH\t\x88\x01\x01\x12\x14\n\x07paid_at\x18\r \x01(\x04H\n\x88\x01\x01\x12\x42\n\rpaid_outpoint\x18\x12 \x01(\x0b\x32&.cln.ListinvoicesInvoicesPaid_outpointH\x0b\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0e \x01(\x0cH\x0c\x88\x01\x01\"?\n\x1aListinvoicesInvoicesStatus\x12\n\n\x06UNPAID\x10\x00\x12\x08\n\x04PAID\x10\x01\x12\x0b\n\x07\x45XPIRED\x10\x02\x42\x0e\n\x0c_descriptionB\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\t\n\x07_bolt12B\x11\n\x0f_local_offer_idB\x14\n\x12_invreq_payer_noteB\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x10\n\x0e_paid_outpointB\x13\n\x11_payment_preimage\"_\n!ListinvoicesInvoicesPaid_outpoint\x12\x11\n\x04txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x13\n\x06outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_txidB\t\n\x07_outnum\"\xb4\x03\n\x10SendonionRequest\x12\r\n\x05onion\x18\x01 \x01(\x0c\x12*\n\tfirst_hop\x18\x02 \x01(\x0b\x32\x17.cln.SendonionFirst_hop\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x12\n\x05label\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x16\n\x0eshared_secrets\x18\x05 \x03(\x0c\x12\x13\n\x06partid\x18\x06 \x01(\rH\x01\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x02\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x0c \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\t \x01(\x0cH\x04\x88\x01\x01\x12\x1a\n\rlocalinvreqid\x18\r \x01(\x0cH\x05\x88\x01\x01\x12\x14\n\x07groupid\x18\x0b \x01(\x04H\x06\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x0e \x01(\tH\x07\x88\x01\x01\x42\x08\n\x06_labelB\t\n\x07_partidB\t\n\x07_bolt11B\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x10\n\x0e_localinvreqidB\n\n\x08_groupidB\x0e\n\x0c_description\"\xe7\x04\n\x11SendonionResponse\x12\x1a\n\rcreated_index\x18\x0e \x01(\x04H\x00\x88\x01\x01\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\x0c\x12\x36\n\x06status\x18\x03 \x01(\x0e\x32&.cln.SendonionResponse.SendonionStatus\x12%\n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x05 \x01(\x0cH\x02\x88\x01\x01\x12\x12\n\ncreated_at\x18\x06 \x01(\x04\x12%\n\x10\x61mount_sent_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\x08 \x01(\tH\x03\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\t \x01(\tH\x04\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\n \x01(\tH\x05\x88\x01\x01\x12\x13\n\x06partid\x18\r \x01(\x04H\x06\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x0f \x01(\x04H\x07\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0b \x01(\x0cH\x08\x88\x01\x01\x12\x14\n\x07message\x18\x0c \x01(\tH\t\x88\x01\x01\",\n\x0fSendonionStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x42\x10\n\x0e_created_indexB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x08\n\x06_labelB\t\n\x07_bolt11B\t\n\x07_bolt12B\t\n\x07_partidB\x10\n\x0e_updated_indexB\x13\n\x11_payment_preimageB\n\n\x08_message\"Q\n\x12SendonionFirst_hop\x12\n\n\x02id\x18\x01 \x01(\x0c\x12 \n\x0b\x61mount_msat\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\x12\r\n\x05\x64\x65lay\x18\x03 \x01(\r\"\xa0\x03\n\x13ListsendpaysRequest\x12\x13\n\x06\x62olt11\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12@\n\x06status\x18\x03 \x01(\x0e\x32+.cln.ListsendpaysRequest.ListsendpaysStatusH\x02\x88\x01\x01\x12>\n\x05index\x18\x04 \x01(\x0e\x32*.cln.ListsendpaysRequest.ListsendpaysIndexH\x03\x88\x01\x01\x12\x12\n\x05start\x18\x05 \x01(\x04H\x04\x88\x01\x01\x12\x12\n\x05limit\x18\x06 \x01(\rH\x05\x88\x01\x01\";\n\x12ListsendpaysStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\"-\n\x11ListsendpaysIndex\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07UPDATED\x10\x01\x42\t\n\x07_bolt11B\x0f\n\r_payment_hashB\t\n\x07_statusB\x08\n\x06_indexB\x08\n\x06_startB\x08\n\x06_limit\"C\n\x14ListsendpaysResponse\x12+\n\x08payments\x18\x01 \x03(\x0b\x32\x19.cln.ListsendpaysPayments\"\xd0\x05\n\x14ListsendpaysPayments\x12\x1a\n\rcreated_index\x18\x10 \x01(\x04H\x00\x88\x01\x01\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x0f\n\x07groupid\x18\x02 \x01(\x04\x12\x13\n\x06partid\x18\x0f \x01(\x04H\x01\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x1a\n\rupdated_index\x18\x11 \x01(\x04H\x02\x88\x01\x01\x12\x44\n\x06status\x18\x04 \x01(\x0e\x32\x34.cln.ListsendpaysPayments.ListsendpaysPaymentsStatus\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x06 \x01(\x0cH\x04\x88\x01\x01\x12\x12\n\ncreated_at\x18\x07 \x01(\x04\x12%\n\x10\x61mount_sent_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\t \x01(\tH\x05\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\n \x01(\tH\x06\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x0e \x01(\tH\x07\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x0b \x01(\tH\x08\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\t\x88\x01\x01\x12\x17\n\nerroronion\x18\r \x01(\x0cH\n\x88\x01\x01\"C\n\x1aListsendpaysPaymentsStatus\x12\x0b\n\x07PENDING\x10\x00\x12\n\n\x06\x46\x41ILED\x10\x01\x12\x0c\n\x08\x43OMPLETE\x10\x02\x42\x10\n\x0e_created_indexB\t\n\x07_partidB\x10\n\x0e_updated_indexB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x08\n\x06_labelB\t\n\x07_bolt11B\x0e\n\x0c_descriptionB\t\n\x07_bolt12B\x13\n\x11_payment_preimageB\r\n\x0b_erroronion\"\x19\n\x17ListtransactionsRequest\"S\n\x18ListtransactionsResponse\x12\x37\n\x0ctransactions\x18\x01 \x03(\x0b\x32!.cln.ListtransactionsTransactions\"\xf8\x01\n\x1cListtransactionsTransactions\x12\x0c\n\x04hash\x18\x01 \x01(\x0c\x12\r\n\x05rawtx\x18\x02 \x01(\x0c\x12\x13\n\x0b\x62lockheight\x18\x03 \x01(\r\x12\x0f\n\x07txindex\x18\x04 \x01(\r\x12\x10\n\x08locktime\x18\x07 \x01(\r\x12\x0f\n\x07version\x18\x08 \x01(\r\x12\x37\n\x06inputs\x18\t \x03(\x0b\x32\'.cln.ListtransactionsTransactionsInputs\x12\x39\n\x07outputs\x18\n \x03(\x0b\x32(.cln.ListtransactionsTransactionsOutputs\"S\n\"ListtransactionsTransactionsInputs\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\r\n\x05index\x18\x02 \x01(\r\x12\x10\n\x08sequence\x18\x03 \x01(\r\"l\n#ListtransactionsTransactionsOutputs\x12\r\n\x05index\x18\x01 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12\x14\n\x0cscriptPubKey\x18\x03 \x01(\x0c\"\xda\x03\n\nPayRequest\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\x12%\n\x0b\x61mount_msat\x18\r \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x12\n\x05label\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x17\n\nriskfactor\x18\x08 \x01(\x01H\x02\x88\x01\x01\x12\x1a\n\rmaxfeepercent\x18\x04 \x01(\x01H\x03\x88\x01\x01\x12\x16\n\tretry_for\x18\x05 \x01(\rH\x04\x88\x01\x01\x12\x15\n\x08maxdelay\x18\x06 \x01(\rH\x05\x88\x01\x01\x12#\n\texemptfee\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x1a\n\rlocalinvreqid\x18\x0e \x01(\x0cH\x07\x88\x01\x01\x12\x0f\n\x07\x65xclude\x18\n \x03(\t\x12 \n\x06maxfee\x18\x0b \x01(\x0b\x32\x0b.cln.AmountH\x08\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x0c \x01(\tH\t\x88\x01\x01\x42\x0e\n\x0c_amount_msatB\x08\n\x06_labelB\r\n\x0b_riskfactorB\x10\n\x0e_maxfeepercentB\x0c\n\n_retry_forB\x0b\n\t_maxdelayB\x0c\n\n_exemptfeeB\x10\n\x0e_localinvreqidB\t\n\x07_maxfeeB\x0e\n\x0c_description\"\xfb\x02\n\x0bPayResponse\x12\x18\n\x10payment_preimage\x18\x01 \x01(\x0c\x12\x18\n\x0b\x64\x65stination\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x12\n\ncreated_at\x18\x04 \x01(\x01\x12\r\n\x05parts\x18\x05 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10\x61mount_sent_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\'\n\x1awarning_partial_completion\x18\x08 \x01(\tH\x01\x88\x01\x01\x12*\n\x06status\x18\t \x01(\x0e\x32\x1a.cln.PayResponse.PayStatus\"2\n\tPayStatus\x12\x0c\n\x08\x43OMPLETE\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x42\x0e\n\x0c_destinationB\x1d\n\x1b_warning_partial_completion\"*\n\x10ListnodesRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x05\n\x03_id\"7\n\x11ListnodesResponse\x12\"\n\x05nodes\x18\x01 \x03(\x0b\x32\x13.cln.ListnodesNodes\"\xe1\x01\n\x0eListnodesNodes\x12\x0e\n\x06nodeid\x18\x01 \x01(\x0c\x12\x1b\n\x0elast_timestamp\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x12\n\x05\x61lias\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x12\n\x05\x63olor\x18\x04 \x01(\x0cH\x02\x88\x01\x01\x12\x15\n\x08\x66\x65\x61tures\x18\x05 \x01(\x0cH\x03\x88\x01\x01\x12/\n\taddresses\x18\x06 \x03(\x0b\x32\x1c.cln.ListnodesNodesAddressesB\x11\n\x0f_last_timestampB\x08\n\x06_aliasB\x08\n\x06_colorB\x0b\n\t_features\"\xe8\x01\n\x17ListnodesNodesAddresses\x12K\n\titem_type\x18\x01 \x01(\x0e\x32\x38.cln.ListnodesNodesAddresses.ListnodesNodesAddressesType\x12\x0c\n\x04port\x18\x02 \x01(\r\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x00\x88\x01\x01\"P\n\x1bListnodesNodesAddressesType\x12\x07\n\x03\x44NS\x10\x00\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\n\n\x08_address\"g\n\x15WaitanyinvoiceRequest\x12\x1a\n\rlastpay_index\x18\x01 \x01(\x04H\x00\x88\x01\x01\x12\x14\n\x07timeout\x18\x02 \x01(\x04H\x01\x88\x01\x01\x42\x10\n\x0e_lastpay_indexB\n\n\x08_timeout\"\xbf\x05\n\x16WaitanyinvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12@\n\x06status\x18\x04 \x01(\x0e\x32\x30.cln.WaitanyinvoiceResponse.WaitanyinvoiceStatus\x12\x12\n\nexpires_at\x18\x05 \x01(\x04\x12%\n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x08 \x01(\tH\x02\x88\x01\x01\x12\x1a\n\rcreated_index\x18\r \x01(\x04H\x03\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x0e \x01(\x04H\x04\x88\x01\x01\x12\x16\n\tpay_index\x18\t \x01(\x04H\x05\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x14\n\x07paid_at\x18\x0b \x01(\x04H\x07\x88\x01\x01\x12<\n\rpaid_outpoint\x18\x0f \x01(\x0b\x32 .cln.WaitanyinvoicePaid_outpointH\x08\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\t\x88\x01\x01\"-\n\x14WaitanyinvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x42\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\t\n\x07_bolt12B\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x10\n\x0e_paid_outpointB\x13\n\x11_payment_preimage\"Y\n\x1bWaitanyinvoicePaid_outpoint\x12\x11\n\x04txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x13\n\x06outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_txidB\t\n\x07_outnum\"\x14\n\x12WaitinvoiceRequest\"\xb0\x05\n\x13WaitinvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12:\n\x06status\x18\x04 \x01(\x0e\x32*.cln.WaitinvoiceResponse.WaitinvoiceStatus\x12\x12\n\nexpires_at\x18\x05 \x01(\x04\x12%\n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x08 \x01(\tH\x02\x88\x01\x01\x12\x1a\n\rcreated_index\x18\r \x01(\x04H\x03\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x0e \x01(\x04H\x04\x88\x01\x01\x12\x16\n\tpay_index\x18\t \x01(\x04H\x05\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x14\n\x07paid_at\x18\x0b \x01(\x04H\x07\x88\x01\x01\x12\x39\n\rpaid_outpoint\x18\x0f \x01(\x0b\x32\x1d.cln.WaitinvoicePaid_outpointH\x08\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\t\x88\x01\x01\"*\n\x11WaitinvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x42\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\t\n\x07_bolt12B\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x10\n\x0e_paid_outpointB\x13\n\x11_payment_preimage\"V\n\x18WaitinvoicePaid_outpoint\x12\x11\n\x04txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x13\n\x06outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_txidB\t\n\x07_outnum\"\x8e\x01\n\x12WaitsendpayRequest\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x14\n\x07timeout\x18\x03 \x01(\rH\x00\x88\x01\x01\x12\x13\n\x06partid\x18\x02 \x01(\x04H\x01\x88\x01\x01\x12\x14\n\x07groupid\x18\x04 \x01(\x04H\x02\x88\x01\x01\x42\n\n\x08_timeoutB\t\n\x07_partidB\n\n\x08_groupid\"\x8e\x05\n\x13WaitsendpayResponse\x12\x1a\n\rcreated_index\x18\x0f \x01(\x04H\x00\x88\x01\x01\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x14\n\x07groupid\x18\x02 \x01(\x04H\x01\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12:\n\x06status\x18\x04 \x01(\x0e\x32*.cln.WaitsendpayResponse.WaitsendpayStatus\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x06 \x01(\x0cH\x03\x88\x01\x01\x12\x12\n\ncreated_at\x18\x07 \x01(\x04\x12\x1a\n\rupdated_index\x18\x10 \x01(\x04H\x04\x88\x01\x01\x12\x19\n\x0c\x63ompleted_at\x18\x0e \x01(\x01H\x05\x88\x01\x01\x12%\n\x10\x61mount_sent_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\t \x01(\tH\x06\x88\x01\x01\x12\x13\n\x06partid\x18\n \x01(\x04H\x07\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x0b \x01(\tH\x08\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x0c \x01(\tH\t\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\r \x01(\x0cH\n\x88\x01\x01\"!\n\x11WaitsendpayStatus\x12\x0c\n\x08\x43OMPLETE\x10\x00\x42\x10\n\x0e_created_indexB\n\n\x08_groupidB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x10\n\x0e_updated_indexB\x0f\n\r_completed_atB\x08\n\x06_labelB\t\n\x07_partidB\t\n\x07_bolt11B\t\n\x07_bolt12B\x13\n\x11_payment_preimage\"\x97\x01\n\x0eNewaddrRequest\x12@\n\x0b\x61\x64\x64resstype\x18\x01 \x01(\x0e\x32&.cln.NewaddrRequest.NewaddrAddresstypeH\x00\x88\x01\x01\"3\n\x12NewaddrAddresstype\x12\n\n\x06\x42\x45\x43H32\x10\x00\x12\x08\n\x04P2TR\x10\x03\x12\x07\n\x03\x41LL\x10\x02\x42\x0e\n\x0c_addresstype\"M\n\x0fNewaddrResponse\x12\x11\n\x04p2tr\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06\x62\x65\x63h32\x18\x01 \x01(\tH\x01\x88\x01\x01\x42\x07\n\x05_p2trB\t\n\x07_bech32\"\xb9\x01\n\x0fWithdrawRequest\x12\x13\n\x0b\x64\x65stination\x18\x01 \x01(\t\x12!\n\x07satoshi\x18\x02 \x01(\x0b\x32\x10.cln.AmountOrAll\x12\"\n\x07\x66\x65\x65rate\x18\x05 \x01(\x0b\x32\x0c.cln.FeerateH\x00\x88\x01\x01\x12\x14\n\x07minconf\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x1c\n\x05utxos\x18\x04 \x03(\x0b\x32\r.cln.OutpointB\n\n\x08_feerateB\n\n\x08_minconf\":\n\x10WithdrawResponse\x12\n\n\x02tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\x12\x0c\n\x04psbt\x18\x03 \x01(\t\"\x82\x03\n\x0eKeysendRequest\x12\x13\n\x0b\x64\x65stination\x18\x01 \x01(\x0c\x12 \n\x0b\x61mount_msat\x18\n \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x1a\n\rmaxfeepercent\x18\x04 \x01(\x01H\x01\x88\x01\x01\x12\x16\n\tretry_for\x18\x05 \x01(\rH\x02\x88\x01\x01\x12\x15\n\x08maxdelay\x18\x06 \x01(\rH\x03\x88\x01\x01\x12#\n\texemptfee\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x12+\n\nroutehints\x18\x08 \x01(\x0b\x32\x12.cln.RoutehintListH\x05\x88\x01\x01\x12&\n\textratlvs\x18\t \x01(\x0b\x32\x0e.cln.TlvStreamH\x06\x88\x01\x01\x42\x08\n\x06_labelB\x10\n\x0e_maxfeepercentB\x0c\n\n_retry_forB\x0b\n\t_maxdelayB\x0c\n\n_exemptfeeB\r\n\x0b_routehintsB\x0c\n\n_extratlvs\"\xf2\x02\n\x0fKeysendResponse\x12\x18\n\x10payment_preimage\x18\x01 \x01(\x0c\x12\x18\n\x0b\x64\x65stination\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x12\n\ncreated_at\x18\x04 \x01(\x01\x12\r\n\x05parts\x18\x05 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10\x61mount_sent_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\'\n\x1awarning_partial_completion\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\x32\n\x06status\x18\t \x01(\x0e\x32\".cln.KeysendResponse.KeysendStatus\"\x1d\n\rKeysendStatus\x12\x0c\n\x08\x43OMPLETE\x10\x00\x42\x0e\n\x0c_destinationB\x1d\n\x1b_warning_partial_completion\"\xa4\x03\n\x0f\x46undpsbtRequest\x12!\n\x07satoshi\x18\x01 \x01(\x0b\x32\x10.cln.AmountOrAll\x12\x1d\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.Feerate\x12\x13\n\x0bstartweight\x18\x03 \x01(\r\x12\x14\n\x07minconf\x18\x04 \x01(\rH\x00\x88\x01\x01\x12\x14\n\x07reserve\x18\x05 \x01(\rH\x01\x88\x01\x01\x12\x15\n\x08locktime\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x1f\n\x12min_witness_weight\x18\x07 \x01(\rH\x03\x88\x01\x01\x12\x1d\n\x10\x65xcess_as_change\x18\x08 \x01(\x08H\x04\x88\x01\x01\x12\x17\n\nnonwrapped\x18\t \x01(\x08H\x05\x88\x01\x01\x12#\n\x16opening_anchor_channel\x18\n \x01(\x08H\x06\x88\x01\x01\x42\n\n\x08_minconfB\n\n\x08_reserveB\x0b\n\t_locktimeB\x15\n\x13_min_witness_weightB\x13\n\x11_excess_as_changeB\r\n\x0b_nonwrappedB\x19\n\x17_opening_anchor_channel\"\xd9\x01\n\x10\x46undpsbtResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x16\n\x0e\x66\x65\x65rate_per_kw\x18\x02 \x01(\r\x12\x1e\n\x16\x65stimated_final_weight\x18\x03 \x01(\r\x12 \n\x0b\x65xcess_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\x1a\n\rchange_outnum\x18\x05 \x01(\rH\x00\x88\x01\x01\x12/\n\x0creservations\x18\x06 \x03(\x0b\x32\x19.cln.FundpsbtReservationsB\x10\n\x0e_change_outnum\"u\n\x14\x46undpsbtReservations\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x0c\n\x04vout\x18\x02 \x01(\r\x12\x14\n\x0cwas_reserved\x18\x03 \x01(\x08\x12\x10\n\x08reserved\x18\x04 \x01(\x08\x12\x19\n\x11reserved_to_block\x18\x05 \x01(\r\"A\n\x0fSendpsbtRequest\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x14\n\x07reserve\x18\x02 \x01(\rH\x00\x88\x01\x01\x42\n\n\x08_reserve\",\n\x10SendpsbtResponse\x12\n\n\x02tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\"1\n\x0fSignpsbtRequest\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x10\n\x08signonly\x18\x02 \x03(\r\"\'\n\x10SignpsbtResponse\x12\x13\n\x0bsigned_psbt\x18\x01 \x01(\t\"\xa0\x03\n\x0fUtxopsbtRequest\x12!\n\x07satoshi\x18\x01 \x01(\x0b\x32\x10.cln.AmountOrAll\x12\x1d\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.Feerate\x12\x13\n\x0bstartweight\x18\x03 \x01(\r\x12\x1c\n\x05utxos\x18\x04 \x03(\x0b\x32\r.cln.Outpoint\x12\x14\n\x07reserve\x18\x05 \x01(\rH\x00\x88\x01\x01\x12\x17\n\nreservedok\x18\x08 \x01(\x08H\x01\x88\x01\x01\x12\x15\n\x08locktime\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x1f\n\x12min_witness_weight\x18\x07 \x01(\rH\x03\x88\x01\x01\x12\x1d\n\x10\x65xcess_as_change\x18\t \x01(\x08H\x04\x88\x01\x01\x12#\n\x16opening_anchor_channel\x18\n \x01(\x08H\x05\x88\x01\x01\x42\n\n\x08_reserveB\r\n\x0b_reservedokB\x0b\n\t_locktimeB\x15\n\x13_min_witness_weightB\x13\n\x11_excess_as_changeB\x19\n\x17_opening_anchor_channel\"\xd9\x01\n\x10UtxopsbtResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x16\n\x0e\x66\x65\x65rate_per_kw\x18\x02 \x01(\r\x12\x1e\n\x16\x65stimated_final_weight\x18\x03 \x01(\r\x12 \n\x0b\x65xcess_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\x1a\n\rchange_outnum\x18\x05 \x01(\rH\x00\x88\x01\x01\x12/\n\x0creservations\x18\x06 \x03(\x0b\x32\x19.cln.UtxopsbtReservationsB\x10\n\x0e_change_outnum\"u\n\x14UtxopsbtReservations\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x0c\n\x04vout\x18\x02 \x01(\r\x12\x14\n\x0cwas_reserved\x18\x03 \x01(\x08\x12\x10\n\x08reserved\x18\x04 \x01(\x08\x12\x19\n\x11reserved_to_block\x18\x05 \x01(\r\" \n\x10TxdiscardRequest\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\"6\n\x11TxdiscardResponse\x12\x13\n\x0bunsigned_tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\"\xa4\x01\n\x10TxprepareRequest\x12 \n\x07outputs\x18\x05 \x03(\x0b\x32\x0f.cln.OutputDesc\x12\"\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.FeerateH\x00\x88\x01\x01\x12\x14\n\x07minconf\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x1c\n\x05utxos\x18\x04 \x03(\x0b\x32\r.cln.OutpointB\n\n\x08_feerateB\n\n\x08_minconf\"D\n\x11TxprepareResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x13\n\x0bunsigned_tx\x18\x02 \x01(\x0c\x12\x0c\n\x04txid\x18\x03 \x01(\x0c\"\x1d\n\rTxsendRequest\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\"8\n\x0eTxsendResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\n\n\x02tx\x18\x02 \x01(\x0c\x12\x0c\n\x04txid\x18\x03 \x01(\x0c\"1\n\x17ListpeerchannelsRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x05\n\x03_id\"K\n\x18ListpeerchannelsResponse\x12/\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x1d.cln.ListpeerchannelsChannels\"\x8a\x1b\n\x18ListpeerchannelsChannels\x12\x14\n\x07peer_id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x1b\n\x0epeer_connected\x18\x02 \x01(\x08H\x01\x88\x01\x01\x12O\n\x05state\x18\x03 \x01(\x0e\x32;.cln.ListpeerchannelsChannels.ListpeerchannelsChannelsStateH\x02\x88\x01\x01\x12\x19\n\x0cscratch_txid\x18\x04 \x01(\x0cH\x03\x88\x01\x01\x12:\n\x07updates\x18\x37 \x01(\x0b\x32$.cln.ListpeerchannelsChannelsUpdatesH\x04\x88\x01\x01\x12\x1e\n\x11ignore_fee_limits\x18\x36 \x01(\x08H\x05\x88\x01\x01\x12\x17\n\nlost_state\x18\x39 \x01(\x08H\x06\x88\x01\x01\x12:\n\x07\x66\x65\x65rate\x18\x06 \x01(\x0b\x32$.cln.ListpeerchannelsChannelsFeerateH\x07\x88\x01\x01\x12\x12\n\x05owner\x18\x07 \x01(\tH\x08\x88\x01\x01\x12\x1d\n\x10short_channel_id\x18\x08 \x01(\tH\t\x88\x01\x01\x12\x17\n\nchannel_id\x18\t \x01(\x0cH\n\x88\x01\x01\x12\x19\n\x0c\x66unding_txid\x18\n \x01(\x0cH\x0b\x88\x01\x01\x12\x1b\n\x0e\x66unding_outnum\x18\x0b \x01(\rH\x0c\x88\x01\x01\x12\x1c\n\x0finitial_feerate\x18\x0c \x01(\tH\r\x88\x01\x01\x12\x19\n\x0clast_feerate\x18\r \x01(\tH\x0e\x88\x01\x01\x12\x19\n\x0cnext_feerate\x18\x0e \x01(\tH\x0f\x88\x01\x01\x12\x1a\n\rnext_fee_step\x18\x0f \x01(\rH\x10\x88\x01\x01\x12\x37\n\x08inflight\x18\x10 \x03(\x0b\x32%.cln.ListpeerchannelsChannelsInflight\x12\x15\n\x08\x63lose_to\x18\x11 \x01(\x0cH\x11\x88\x01\x01\x12\x14\n\x07private\x18\x12 \x01(\x08H\x12\x88\x01\x01\x12%\n\x06opener\x18\x13 \x01(\x0e\x32\x10.cln.ChannelSideH\x13\x88\x01\x01\x12%\n\x06\x63loser\x18\x14 \x01(\x0e\x32\x10.cln.ChannelSideH\x14\x88\x01\x01\x12:\n\x07\x66unding\x18\x16 \x01(\x0b\x32$.cln.ListpeerchannelsChannelsFundingH\x15\x88\x01\x01\x12$\n\nto_us_msat\x18\x17 \x01(\x0b\x32\x0b.cln.AmountH\x16\x88\x01\x01\x12(\n\x0emin_to_us_msat\x18\x18 \x01(\x0b\x32\x0b.cln.AmountH\x17\x88\x01\x01\x12(\n\x0emax_to_us_msat\x18\x19 \x01(\x0b\x32\x0b.cln.AmountH\x18\x88\x01\x01\x12$\n\ntotal_msat\x18\x1a \x01(\x0b\x32\x0b.cln.AmountH\x19\x88\x01\x01\x12\'\n\rfee_base_msat\x18\x1b \x01(\x0b\x32\x0b.cln.AmountH\x1a\x88\x01\x01\x12(\n\x1b\x66\x65\x65_proportional_millionths\x18\x1c \x01(\rH\x1b\x88\x01\x01\x12)\n\x0f\x64ust_limit_msat\x18\x1d \x01(\x0b\x32\x0b.cln.AmountH\x1c\x88\x01\x01\x12\x30\n\x16max_total_htlc_in_msat\x18\x1e \x01(\x0b\x32\x0b.cln.AmountH\x1d\x88\x01\x01\x12,\n\x12their_reserve_msat\x18\x1f \x01(\x0b\x32\x0b.cln.AmountH\x1e\x88\x01\x01\x12*\n\x10our_reserve_msat\x18 \x01(\x0b\x32\x0b.cln.AmountH\x1f\x88\x01\x01\x12(\n\x0espendable_msat\x18! \x01(\x0b\x32\x0b.cln.AmountH \x88\x01\x01\x12)\n\x0freceivable_msat\x18\" \x01(\x0b\x32\x0b.cln.AmountH!\x88\x01\x01\x12.\n\x14minimum_htlc_in_msat\x18# \x01(\x0b\x32\x0b.cln.AmountH\"\x88\x01\x01\x12/\n\x15minimum_htlc_out_msat\x18$ \x01(\x0b\x32\x0b.cln.AmountH#\x88\x01\x01\x12/\n\x15maximum_htlc_out_msat\x18% \x01(\x0b\x32\x0b.cln.AmountH$\x88\x01\x01\x12 \n\x13their_to_self_delay\x18& \x01(\rH%\x88\x01\x01\x12\x1e\n\x11our_to_self_delay\x18\' \x01(\rH&\x88\x01\x01\x12\x1f\n\x12max_accepted_htlcs\x18( \x01(\rH\'\x88\x01\x01\x12\x36\n\x05\x61lias\x18) \x01(\x0b\x32\".cln.ListpeerchannelsChannelsAliasH(\x88\x01\x01\x12\x0e\n\x06status\x18+ \x03(\t\x12 \n\x13in_payments_offered\x18, \x01(\x04H)\x88\x01\x01\x12)\n\x0fin_offered_msat\x18- \x01(\x0b\x32\x0b.cln.AmountH*\x88\x01\x01\x12\"\n\x15in_payments_fulfilled\x18. \x01(\x04H+\x88\x01\x01\x12+\n\x11in_fulfilled_msat\x18/ \x01(\x0b\x32\x0b.cln.AmountH,\x88\x01\x01\x12!\n\x14out_payments_offered\x18\x30 \x01(\x04H-\x88\x01\x01\x12*\n\x10out_offered_msat\x18\x31 \x01(\x0b\x32\x0b.cln.AmountH.\x88\x01\x01\x12#\n\x16out_payments_fulfilled\x18\x32 \x01(\x04H/\x88\x01\x01\x12,\n\x12out_fulfilled_msat\x18\x33 \x01(\x0b\x32\x0b.cln.AmountH0\x88\x01\x01\x12#\n\x16last_stable_connection\x18\x38 \x01(\x04H1\x88\x01\x01\x12\x31\n\x05htlcs\x18\x34 \x03(\x0b\x32\".cln.ListpeerchannelsChannelsHtlcs\x12\x1a\n\rclose_to_addr\x18\x35 \x01(\tH2\x88\x01\x01\"\x80\x03\n\x1dListpeerchannelsChannelsState\x12\x0c\n\x08OPENINGD\x10\x00\x12\x1c\n\x18\x43HANNELD_AWAITING_LOCKIN\x10\x01\x12\x13\n\x0f\x43HANNELD_NORMAL\x10\x02\x12\x1a\n\x16\x43HANNELD_SHUTTING_DOWN\x10\x03\x12\x18\n\x14\x43LOSINGD_SIGEXCHANGE\x10\x04\x12\x15\n\x11\x43LOSINGD_COMPLETE\x10\x05\x12\x17\n\x13\x41WAITING_UNILATERAL\x10\x06\x12\x16\n\x12\x46UNDING_SPEND_SEEN\x10\x07\x12\x0b\n\x07ONCHAIN\x10\x08\x12\x17\n\x13\x44UALOPEND_OPEN_INIT\x10\t\x12\x1d\n\x19\x44UALOPEND_AWAITING_LOCKIN\x10\n\x12\x1c\n\x18\x43HANNELD_AWAITING_SPLICE\x10\x0b\x12\x1c\n\x18\x44UALOPEND_OPEN_COMMITTED\x10\x0c\x12\x1f\n\x1b\x44UALOPEND_OPEN_COMMIT_READY\x10\rB\n\n\x08_peer_idB\x11\n\x0f_peer_connectedB\x08\n\x06_stateB\x0f\n\r_scratch_txidB\n\n\x08_updatesB\x14\n\x12_ignore_fee_limitsB\r\n\x0b_lost_stateB\n\n\x08_feerateB\x08\n\x06_ownerB\x13\n\x11_short_channel_idB\r\n\x0b_channel_idB\x0f\n\r_funding_txidB\x11\n\x0f_funding_outnumB\x12\n\x10_initial_feerateB\x0f\n\r_last_feerateB\x0f\n\r_next_feerateB\x10\n\x0e_next_fee_stepB\x0b\n\t_close_toB\n\n\x08_privateB\t\n\x07_openerB\t\n\x07_closerB\n\n\x08_fundingB\r\n\x0b_to_us_msatB\x11\n\x0f_min_to_us_msatB\x11\n\x0f_max_to_us_msatB\r\n\x0b_total_msatB\x10\n\x0e_fee_base_msatB\x1e\n\x1c_fee_proportional_millionthsB\x12\n\x10_dust_limit_msatB\x19\n\x17_max_total_htlc_in_msatB\x15\n\x13_their_reserve_msatB\x13\n\x11_our_reserve_msatB\x11\n\x0f_spendable_msatB\x12\n\x10_receivable_msatB\x17\n\x15_minimum_htlc_in_msatB\x18\n\x16_minimum_htlc_out_msatB\x18\n\x16_maximum_htlc_out_msatB\x16\n\x14_their_to_self_delayB\x14\n\x12_our_to_self_delayB\x15\n\x13_max_accepted_htlcsB\x08\n\x06_aliasB\x16\n\x14_in_payments_offeredB\x12\n\x10_in_offered_msatB\x18\n\x16_in_payments_fulfilledB\x14\n\x12_in_fulfilled_msatB\x17\n\x15_out_payments_offeredB\x13\n\x11_out_offered_msatB\x19\n\x17_out_payments_fulfilledB\x15\n\x13_out_fulfilled_msatB\x19\n\x17_last_stable_connectionB\x10\n\x0e_close_to_addr\"\xb6\x01\n\x1fListpeerchannelsChannelsUpdates\x12=\n\x05local\x18\x01 \x01(\x0b\x32).cln.ListpeerchannelsChannelsUpdatesLocalH\x00\x88\x01\x01\x12?\n\x06remote\x18\x02 \x01(\x0b\x32*.cln.ListpeerchannelsChannelsUpdatesRemoteH\x01\x88\x01\x01\x42\x08\n\x06_localB\t\n\x07_remote\"\xe7\x02\n$ListpeerchannelsChannelsUpdatesLocal\x12+\n\x11htlc_minimum_msat\x18\x01 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12+\n\x11htlc_maximum_msat\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x1e\n\x11\x63ltv_expiry_delta\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\'\n\rfee_base_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12(\n\x1b\x66\x65\x65_proportional_millionths\x18\x05 \x01(\rH\x04\x88\x01\x01\x42\x14\n\x12_htlc_minimum_msatB\x14\n\x12_htlc_maximum_msatB\x14\n\x12_cltv_expiry_deltaB\x10\n\x0e_fee_base_msatB\x1e\n\x1c_fee_proportional_millionths\"\xe8\x02\n%ListpeerchannelsChannelsUpdatesRemote\x12+\n\x11htlc_minimum_msat\x18\x01 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12+\n\x11htlc_maximum_msat\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x1e\n\x11\x63ltv_expiry_delta\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\'\n\rfee_base_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12(\n\x1b\x66\x65\x65_proportional_millionths\x18\x05 \x01(\rH\x04\x88\x01\x01\x42\x14\n\x12_htlc_minimum_msatB\x14\n\x12_htlc_maximum_msatB\x14\n\x12_cltv_expiry_deltaB\x10\n\x0e_fee_base_msatB\x1e\n\x1c_fee_proportional_millionths\"]\n\x1fListpeerchannelsChannelsFeerate\x12\x12\n\x05perkw\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x12\n\x05perkb\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x08\n\x06_perkwB\x08\n\x06_perkb\"\x80\x03\n ListpeerchannelsChannelsInflight\x12\x19\n\x0c\x66unding_txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x1b\n\x0e\x66unding_outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x14\n\x07\x66\x65\x65rate\x18\x03 \x01(\tH\x02\x88\x01\x01\x12,\n\x12total_funding_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x1a\n\rsplice_amount\x18\x07 \x01(\x12H\x04\x88\x01\x01\x12*\n\x10our_funding_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x05\x88\x01\x01\x12\x19\n\x0cscratch_txid\x18\x06 \x01(\x0cH\x06\x88\x01\x01\x42\x0f\n\r_funding_txidB\x11\n\x0f_funding_outnumB\n\n\x08_feerateB\x15\n\x13_total_funding_msatB\x10\n\x0e_splice_amountB\x13\n\x11_our_funding_msatB\x0f\n\r_scratch_txid\"\xd2\x02\n\x1fListpeerchannelsChannelsFunding\x12%\n\x0bpushed_msat\x18\x01 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12*\n\x10local_funds_msat\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12+\n\x11remote_funds_msat\x18\x03 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12\'\n\rfee_paid_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\'\n\rfee_rcvd_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x42\x0e\n\x0c_pushed_msatB\x13\n\x11_local_funds_msatB\x14\n\x12_remote_funds_msatB\x10\n\x0e_fee_paid_msatB\x10\n\x0e_fee_rcvd_msat\"]\n\x1dListpeerchannelsChannelsAlias\x12\x12\n\x05local\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06remote\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_localB\t\n\x07_remote\"\xe2\x03\n\x1dListpeerchannelsChannelsHtlcs\x12\x61\n\tdirection\x18\x01 \x01(\x0e\x32I.cln.ListpeerchannelsChannelsHtlcs.ListpeerchannelsChannelsHtlcsDirectionH\x00\x88\x01\x01\x12\x0f\n\x02id\x18\x02 \x01(\x04H\x01\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12\x13\n\x06\x65xpiry\x18\x04 \x01(\rH\x03\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x05 \x01(\x0cH\x04\x88\x01\x01\x12\x1a\n\rlocal_trimmed\x18\x06 \x01(\x08H\x05\x88\x01\x01\x12\x13\n\x06status\x18\x07 \x01(\tH\x06\x88\x01\x01\x12\"\n\x05state\x18\x08 \x01(\x0e\x32\x0e.cln.HtlcStateH\x07\x88\x01\x01\"9\n&ListpeerchannelsChannelsHtlcsDirection\x12\x06\n\x02IN\x10\x00\x12\x07\n\x03OUT\x10\x01\x42\x0c\n\n_directionB\x05\n\x03_idB\x0e\n\x0c_amount_msatB\t\n\x07_expiryB\x0f\n\r_payment_hashB\x10\n\x0e_local_trimmedB\t\n\x07_statusB\x08\n\x06_state\"3\n\x19ListclosedchannelsRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x05\n\x03_id\"[\n\x1aListclosedchannelsResponse\x12=\n\x0e\x63losedchannels\x18\x01 \x03(\x0b\x32%.cln.ListclosedchannelsClosedchannels\"\xf2\t\n ListclosedchannelsClosedchannels\x12\x14\n\x07peer_id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x12\n\nchannel_id\x18\x02 \x01(\x0c\x12\x1d\n\x10short_channel_id\x18\x03 \x01(\tH\x01\x88\x01\x01\x12>\n\x05\x61lias\x18\x04 \x01(\x0b\x32*.cln.ListclosedchannelsClosedchannelsAliasH\x02\x88\x01\x01\x12 \n\x06opener\x18\x05 \x01(\x0e\x32\x10.cln.ChannelSide\x12%\n\x06\x63loser\x18\x06 \x01(\x0e\x32\x10.cln.ChannelSideH\x03\x88\x01\x01\x12\x0f\n\x07private\x18\x07 \x01(\x08\x12\x1f\n\x17total_local_commitments\x18\t \x01(\x04\x12 \n\x18total_remote_commitments\x18\n \x01(\x04\x12\x18\n\x10total_htlcs_sent\x18\x0b \x01(\x04\x12\x14\n\x0c\x66unding_txid\x18\x0c \x01(\x0c\x12\x16\n\x0e\x66unding_outnum\x18\r \x01(\r\x12\x0e\n\x06leased\x18\x0e \x01(\x08\x12/\n\x15\x66unding_fee_paid_msat\x18\x0f \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x12/\n\x15\x66unding_fee_rcvd_msat\x18\x10 \x01(\x0b\x32\x0b.cln.AmountH\x05\x88\x01\x01\x12-\n\x13\x66unding_pushed_msat\x18\x11 \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x1f\n\ntotal_msat\x18\x12 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10\x66inal_to_us_msat\x18\x13 \x01(\x0b\x32\x0b.cln.Amount\x12#\n\x0emin_to_us_msat\x18\x14 \x01(\x0b\x32\x0b.cln.Amount\x12#\n\x0emax_to_us_msat\x18\x15 \x01(\x0b\x32\x0b.cln.Amount\x12!\n\x14last_commitment_txid\x18\x16 \x01(\x0cH\x07\x88\x01\x01\x12\x32\n\x18last_commitment_fee_msat\x18\x17 \x01(\x0b\x32\x0b.cln.AmountH\x08\x88\x01\x01\x12\x66\n\x0b\x63lose_cause\x18\x18 \x01(\x0e\x32Q.cln.ListclosedchannelsClosedchannels.ListclosedchannelsClosedchannelsClose_cause\x12#\n\x16last_stable_connection\x18\x19 \x01(\x04H\t\x88\x01\x01\"v\n+ListclosedchannelsClosedchannelsClose_cause\x12\x0b\n\x07UNKNOWN\x10\x00\x12\t\n\x05LOCAL\x10\x01\x12\x08\n\x04USER\x10\x02\x12\n\n\x06REMOTE\x10\x03\x12\x0c\n\x08PROTOCOL\x10\x04\x12\x0b\n\x07ONCHAIN\x10\x05\x42\n\n\x08_peer_idB\x13\n\x11_short_channel_idB\x08\n\x06_aliasB\t\n\x07_closerB\x18\n\x16_funding_fee_paid_msatB\x18\n\x16_funding_fee_rcvd_msatB\x16\n\x14_funding_pushed_msatB\x17\n\x15_last_commitment_txidB\x1b\n\x19_last_commitment_fee_msatB\x19\n\x17_last_stable_connection\"e\n%ListclosedchannelsClosedchannelsAlias\x12\x12\n\x05local\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06remote\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_localB\t\n\x07_remote\"L\n\x10\x44\x65\x63odepayRequest\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_description\"\x8d\x04\n\x11\x44\x65\x63odepayResponse\x12\x10\n\x08\x63urrency\x18\x01 \x01(\t\x12\x12\n\ncreated_at\x18\x02 \x01(\x04\x12\x0e\n\x06\x65xpiry\x18\x03 \x01(\x04\x12\r\n\x05payee\x18\x04 \x01(\x0c\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x06 \x01(\x0c\x12\x11\n\tsignature\x18\x07 \x01(\t\x12\x18\n\x0b\x64\x65scription\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\x1d\n\x10\x64\x65scription_hash\x18\t \x01(\x0cH\x02\x88\x01\x01\x12\x1d\n\x15min_final_cltv_expiry\x18\n \x01(\r\x12\x1b\n\x0epayment_secret\x18\x0b \x01(\x0cH\x03\x88\x01\x01\x12\x15\n\x08\x66\x65\x61tures\x18\x0c \x01(\x0cH\x04\x88\x01\x01\x12\x1d\n\x10payment_metadata\x18\r \x01(\x0cH\x05\x88\x01\x01\x12*\n\tfallbacks\x18\x0e \x03(\x0b\x32\x17.cln.DecodepayFallbacks\x12\"\n\x05\x65xtra\x18\x10 \x03(\x0b\x32\x13.cln.DecodepayExtraB\x0e\n\x0c_amount_msatB\x0e\n\x0c_descriptionB\x13\n\x11_description_hashB\x11\n\x0f_payment_secretB\x0b\n\t_featuresB\x13\n\x11_payment_metadata\"\xd0\x01\n\x12\x44\x65\x63odepayFallbacks\x12\x41\n\titem_type\x18\x01 \x01(\x0e\x32..cln.DecodepayFallbacks.DecodepayFallbacksType\x12\x11\n\x04\x61\x64\x64r\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x0b\n\x03hex\x18\x03 \x01(\x0c\"N\n\x16\x44\x65\x63odepayFallbacksType\x12\t\n\x05P2PKH\x10\x00\x12\x08\n\x04P2SH\x10\x01\x12\n\n\x06P2WPKH\x10\x02\x12\t\n\x05P2WSH\x10\x03\x12\x08\n\x04P2TR\x10\x04\x42\x07\n\x05_addr\"+\n\x0e\x44\x65\x63odepayExtra\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\t\"\x1f\n\rDecodeRequest\x12\x0e\n\x06string\x18\x01 \x01(\t\"\xe8!\n\x0e\x44\x65\x63odeResponse\x12\x31\n\titem_type\x18\x01 \x01(\x0e\x32\x1e.cln.DecodeResponse.DecodeType\x12\r\n\x05valid\x18\x02 \x01(\x08\x12\x15\n\x08offer_id\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x12\x14\n\x0coffer_chains\x18\x04 \x03(\x0c\x12\x1b\n\x0eoffer_metadata\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x1b\n\x0eoffer_currency\x18\x06 \x01(\tH\x02\x88\x01\x01\x12+\n\x1ewarning_unknown_offer_currency\x18\x07 \x01(\tH\x03\x88\x01\x01\x12 \n\x13\x63urrency_minor_unit\x18\x08 \x01(\rH\x04\x88\x01\x01\x12\x19\n\x0coffer_amount\x18\t \x01(\x04H\x05\x88\x01\x01\x12+\n\x11offer_amount_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x1e\n\x11offer_description\x18\x0b \x01(\tH\x07\x88\x01\x01\x12\x19\n\x0coffer_issuer\x18\x0c \x01(\tH\x08\x88\x01\x01\x12\x1b\n\x0eoffer_features\x18\r \x01(\x0cH\t\x88\x01\x01\x12\"\n\x15offer_absolute_expiry\x18\x0e \x01(\x04H\n\x88\x01\x01\x12\x1f\n\x12offer_quantity_max\x18\x0f \x01(\x04H\x0b\x88\x01\x01\x12+\n\x0boffer_paths\x18\x10 \x03(\x0b\x32\x16.cln.DecodeOffer_paths\x12\x1a\n\roffer_node_id\x18\x11 \x01(\x0cH\x0c\x88\x01\x01\x12*\n\x1dwarning_missing_offer_node_id\x18\x14 \x01(\tH\r\x88\x01\x01\x12.\n!warning_invalid_offer_description\x18\x15 \x01(\tH\x0e\x88\x01\x01\x12.\n!warning_missing_offer_description\x18\x16 \x01(\tH\x0f\x88\x01\x01\x12+\n\x1ewarning_invalid_offer_currency\x18\x17 \x01(\tH\x10\x88\x01\x01\x12)\n\x1cwarning_invalid_offer_issuer\x18\x18 \x01(\tH\x11\x88\x01\x01\x12\x1c\n\x0finvreq_metadata\x18\x19 \x01(\x0cH\x12\x88\x01\x01\x12\x1c\n\x0finvreq_payer_id\x18\x1a \x01(\x0cH\x13\x88\x01\x01\x12\x19\n\x0cinvreq_chain\x18\x1b \x01(\x0cH\x14\x88\x01\x01\x12,\n\x12invreq_amount_msat\x18\x1c \x01(\x0b\x32\x0b.cln.AmountH\x15\x88\x01\x01\x12\x1c\n\x0finvreq_features\x18\x1d \x01(\x0cH\x16\x88\x01\x01\x12\x1c\n\x0finvreq_quantity\x18\x1e \x01(\x04H\x17\x88\x01\x01\x12\x1e\n\x11invreq_payer_note\x18\x1f \x01(\tH\x18\x88\x01\x01\x12&\n\x19invreq_recurrence_counter\x18 \x01(\rH\x19\x88\x01\x01\x12$\n\x17invreq_recurrence_start\x18! \x01(\rH\x1a\x88\x01\x01\x12,\n\x1fwarning_missing_invreq_metadata\x18# \x01(\tH\x1b\x88\x01\x01\x12,\n\x1fwarning_missing_invreq_payer_id\x18$ \x01(\tH\x1c\x88\x01\x01\x12.\n!warning_invalid_invreq_payer_note\x18% \x01(\tH\x1d\x88\x01\x01\x12\x36\n)warning_missing_invoice_request_signature\x18& \x01(\tH\x1e\x88\x01\x01\x12\x36\n)warning_invalid_invoice_request_signature\x18\' \x01(\tH\x1f\x88\x01\x01\x12\x1f\n\x12invoice_created_at\x18) \x01(\x04H \x88\x01\x01\x12$\n\x17invoice_relative_expiry\x18* \x01(\rH!\x88\x01\x01\x12!\n\x14invoice_payment_hash\x18+ \x01(\x0cH\"\x88\x01\x01\x12-\n\x13invoice_amount_msat\x18, \x01(\x0b\x32\x0b.cln.AmountH#\x88\x01\x01\x12\x37\n\x11invoice_fallbacks\x18- \x03(\x0b\x32\x1c.cln.DecodeInvoice_fallbacks\x12\x1d\n\x10invoice_features\x18. \x01(\x0cH$\x88\x01\x01\x12\x1c\n\x0finvoice_node_id\x18/ \x01(\x0cH%\x88\x01\x01\x12(\n\x1binvoice_recurrence_basetime\x18\x30 \x01(\x04H&\x88\x01\x01\x12*\n\x1dwarning_missing_invoice_paths\x18\x32 \x01(\tH\'\x88\x01\x01\x12/\n\"warning_missing_invoice_blindedpay\x18\x33 \x01(\tH(\x88\x01\x01\x12/\n\"warning_missing_invoice_created_at\x18\x34 \x01(\tH)\x88\x01\x01\x12\x31\n$warning_missing_invoice_payment_hash\x18\x35 \x01(\tH*\x88\x01\x01\x12+\n\x1ewarning_missing_invoice_amount\x18\x36 \x01(\tH+\x88\x01\x01\x12\x38\n+warning_missing_invoice_recurrence_basetime\x18\x37 \x01(\tH,\x88\x01\x01\x12,\n\x1fwarning_missing_invoice_node_id\x18\x38 \x01(\tH-\x88\x01\x01\x12.\n!warning_missing_invoice_signature\x18\x39 \x01(\tH.\x88\x01\x01\x12.\n!warning_invalid_invoice_signature\x18: \x01(\tH/\x88\x01\x01\x12\'\n\tfallbacks\x18; \x03(\x0b\x32\x14.cln.DecodeFallbacks\x12\x17\n\ncreated_at\x18< \x01(\x04H0\x88\x01\x01\x12\x13\n\x06\x65xpiry\x18= \x01(\x04H1\x88\x01\x01\x12\x12\n\x05payee\x18> \x01(\x0cH2\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18? \x01(\x0cH3\x88\x01\x01\x12\x1d\n\x10\x64\x65scription_hash\x18@ \x01(\x0cH4\x88\x01\x01\x12\"\n\x15min_final_cltv_expiry\x18\x41 \x01(\rH5\x88\x01\x01\x12\x1b\n\x0epayment_secret\x18\x42 \x01(\x0cH6\x88\x01\x01\x12\x1d\n\x10payment_metadata\x18\x43 \x01(\x0cH7\x88\x01\x01\x12\x1f\n\x05\x65xtra\x18\x45 \x03(\x0b\x32\x10.cln.DecodeExtra\x12\x16\n\tunique_id\x18\x46 \x01(\tH8\x88\x01\x01\x12\x14\n\x07version\x18G \x01(\tH9\x88\x01\x01\x12\x13\n\x06string\x18H \x01(\tH:\x88\x01\x01\x12-\n\x0crestrictions\x18I \x03(\x0b\x32\x17.cln.DecodeRestrictions\x12&\n\x19warning_rune_invalid_utf8\x18J \x01(\tH;\x88\x01\x01\x12\x10\n\x03hex\x18K \x01(\x0cH<\x88\x01\x01\x12\x16\n\tdecrypted\x18L \x01(\x0cH=\x88\x01\x01\"\x83\x01\n\nDecodeType\x12\x10\n\x0c\x42OLT12_OFFER\x10\x00\x12\x12\n\x0e\x42OLT12_INVOICE\x10\x01\x12\x1a\n\x16\x42OLT12_INVOICE_REQUEST\x10\x02\x12\x12\n\x0e\x42OLT11_INVOICE\x10\x03\x12\x08\n\x04RUNE\x10\x04\x12\x15\n\x11\x45MERGENCY_RECOVER\x10\x05\x42\x0b\n\t_offer_idB\x11\n\x0f_offer_metadataB\x11\n\x0f_offer_currencyB!\n\x1f_warning_unknown_offer_currencyB\x16\n\x14_currency_minor_unitB\x0f\n\r_offer_amountB\x14\n\x12_offer_amount_msatB\x14\n\x12_offer_descriptionB\x0f\n\r_offer_issuerB\x11\n\x0f_offer_featuresB\x18\n\x16_offer_absolute_expiryB\x15\n\x13_offer_quantity_maxB\x10\n\x0e_offer_node_idB \n\x1e_warning_missing_offer_node_idB$\n\"_warning_invalid_offer_descriptionB$\n\"_warning_missing_offer_descriptionB!\n\x1f_warning_invalid_offer_currencyB\x1f\n\x1d_warning_invalid_offer_issuerB\x12\n\x10_invreq_metadataB\x12\n\x10_invreq_payer_idB\x0f\n\r_invreq_chainB\x15\n\x13_invreq_amount_msatB\x12\n\x10_invreq_featuresB\x12\n\x10_invreq_quantityB\x14\n\x12_invreq_payer_noteB\x1c\n\x1a_invreq_recurrence_counterB\x1a\n\x18_invreq_recurrence_startB\"\n _warning_missing_invreq_metadataB\"\n _warning_missing_invreq_payer_idB$\n\"_warning_invalid_invreq_payer_noteB,\n*_warning_missing_invoice_request_signatureB,\n*_warning_invalid_invoice_request_signatureB\x15\n\x13_invoice_created_atB\x1a\n\x18_invoice_relative_expiryB\x17\n\x15_invoice_payment_hashB\x16\n\x14_invoice_amount_msatB\x13\n\x11_invoice_featuresB\x12\n\x10_invoice_node_idB\x1e\n\x1c_invoice_recurrence_basetimeB \n\x1e_warning_missing_invoice_pathsB%\n#_warning_missing_invoice_blindedpayB%\n#_warning_missing_invoice_created_atB\'\n%_warning_missing_invoice_payment_hashB!\n\x1f_warning_missing_invoice_amountB.\n,_warning_missing_invoice_recurrence_basetimeB\"\n _warning_missing_invoice_node_idB$\n\"_warning_missing_invoice_signatureB$\n\"_warning_invalid_invoice_signatureB\r\n\x0b_created_atB\t\n\x07_expiryB\x08\n\x06_payeeB\x0f\n\r_payment_hashB\x13\n\x11_description_hashB\x18\n\x16_min_final_cltv_expiryB\x11\n\x0f_payment_secretB\x13\n\x11_payment_metadataB\x0c\n\n_unique_idB\n\n\x08_versionB\t\n\x07_stringB\x1c\n\x1a_warning_rune_invalid_utf8B\x06\n\x04_hexB\x0c\n\n_decrypted\"<\n\x11\x44\x65\x63odeOffer_paths\x12\x15\n\rfirst_node_id\x18\x01 \x01(\x0c\x12\x10\n\x08\x62linding\x18\x02 \x01(\x0c\"\x8a\x01\n\x1f\x44\x65\x63odeOffer_recurrencePaywindow\x12\x16\n\x0eseconds_before\x18\x01 \x01(\r\x12\x15\n\rseconds_after\x18\x02 \x01(\r\x12 \n\x13proportional_amount\x18\x03 \x01(\x08H\x00\x88\x01\x01\x42\x16\n\x14_proportional_amount\"T\n\x17\x44\x65\x63odeInvoice_pathsPath\x12\x17\n\x0f\x62linded_node_id\x18\x01 \x01(\x0c\x12 \n\x18\x65ncrypted_recipient_data\x18\x02 \x01(\x0c\"Y\n\x17\x44\x65\x63odeInvoice_fallbacks\x12\x0f\n\x07version\x18\x01 \x01(\r\x12\x0b\n\x03hex\x18\x02 \x01(\x0c\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_address\"w\n\x0f\x44\x65\x63odeFallbacks\x12\x36\n)warning_invoice_fallbacks_version_invalid\x18\x01 \x01(\tH\x00\x88\x01\x01\x42,\n*_warning_invoice_fallbacks_version_invalid\"(\n\x0b\x44\x65\x63odeExtra\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\t\";\n\x12\x44\x65\x63odeRestrictions\x12\x14\n\x0c\x61lternatives\x18\x01 \x03(\t\x12\x0f\n\x07summary\x18\x02 \x01(\t\"=\n\x11\x44isconnectRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x12\n\x05\x66orce\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\x08\n\x06_force\"\x14\n\x12\x44isconnectResponse\"k\n\x0f\x46\x65\x65ratesRequest\x12\x31\n\x05style\x18\x01 \x01(\x0e\x32\".cln.FeeratesRequest.FeeratesStyle\"%\n\rFeeratesStyle\x12\t\n\x05PERKB\x10\x00\x12\t\n\x05PERKW\x10\x01\"\x9c\x02\n\x10\x46\x65\x65ratesResponse\x12%\n\x18warning_missing_feerates\x18\x01 \x01(\tH\x00\x88\x01\x01\x12&\n\x05perkb\x18\x02 \x01(\x0b\x32\x12.cln.FeeratesPerkbH\x01\x88\x01\x01\x12&\n\x05perkw\x18\x03 \x01(\x0b\x32\x12.cln.FeeratesPerkwH\x02\x88\x01\x01\x12\x46\n\x15onchain_fee_estimates\x18\x04 \x01(\x0b\x32\".cln.FeeratesOnchain_fee_estimatesH\x03\x88\x01\x01\x42\x1b\n\x19_warning_missing_feeratesB\x08\n\x06_perkbB\x08\n\x06_perkwB\x18\n\x16_onchain_fee_estimates\"\xd3\x03\n\rFeeratesPerkb\x12\x16\n\x0emin_acceptable\x18\x01 \x01(\r\x12\x16\n\x0emax_acceptable\x18\x02 \x01(\r\x12\x12\n\x05\x66loor\x18\n \x01(\rH\x00\x88\x01\x01\x12.\n\testimates\x18\t \x03(\x0b\x32\x1b.cln.FeeratesPerkbEstimates\x12\x14\n\x07opening\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x19\n\x0cmutual_close\x18\x04 \x01(\rH\x02\x88\x01\x01\x12\x1d\n\x10unilateral_close\x18\x05 \x01(\rH\x03\x88\x01\x01\x12$\n\x17unilateral_anchor_close\x18\x0b \x01(\rH\x04\x88\x01\x01\x12\x1a\n\rdelayed_to_us\x18\x06 \x01(\rH\x05\x88\x01\x01\x12\x1c\n\x0fhtlc_resolution\x18\x07 \x01(\rH\x06\x88\x01\x01\x12\x14\n\x07penalty\x18\x08 \x01(\rH\x07\x88\x01\x01\x42\x08\n\x06_floorB\n\n\x08_openingB\x0f\n\r_mutual_closeB\x13\n\x11_unilateral_closeB\x1a\n\x18_unilateral_anchor_closeB\x10\n\x0e_delayed_to_usB\x12\n\x10_htlc_resolutionB\n\n\x08_penalty\"\x96\x01\n\x16\x46\x65\x65ratesPerkbEstimates\x12\x17\n\nblockcount\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x14\n\x07\x66\x65\x65rate\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x1d\n\x10smoothed_feerate\x18\x03 \x01(\rH\x02\x88\x01\x01\x42\r\n\x0b_blockcountB\n\n\x08_feerateB\x13\n\x11_smoothed_feerate\"\xd3\x03\n\rFeeratesPerkw\x12\x16\n\x0emin_acceptable\x18\x01 \x01(\r\x12\x16\n\x0emax_acceptable\x18\x02 \x01(\r\x12\x12\n\x05\x66loor\x18\n \x01(\rH\x00\x88\x01\x01\x12.\n\testimates\x18\t \x03(\x0b\x32\x1b.cln.FeeratesPerkwEstimates\x12\x14\n\x07opening\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x19\n\x0cmutual_close\x18\x04 \x01(\rH\x02\x88\x01\x01\x12\x1d\n\x10unilateral_close\x18\x05 \x01(\rH\x03\x88\x01\x01\x12$\n\x17unilateral_anchor_close\x18\x0b \x01(\rH\x04\x88\x01\x01\x12\x1a\n\rdelayed_to_us\x18\x06 \x01(\rH\x05\x88\x01\x01\x12\x1c\n\x0fhtlc_resolution\x18\x07 \x01(\rH\x06\x88\x01\x01\x12\x14\n\x07penalty\x18\x08 \x01(\rH\x07\x88\x01\x01\x42\x08\n\x06_floorB\n\n\x08_openingB\x0f\n\r_mutual_closeB\x13\n\x11_unilateral_closeB\x1a\n\x18_unilateral_anchor_closeB\x10\n\x0e_delayed_to_usB\x12\n\x10_htlc_resolutionB\n\n\x08_penalty\"\x96\x01\n\x16\x46\x65\x65ratesPerkwEstimates\x12\x17\n\nblockcount\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x14\n\x07\x66\x65\x65rate\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x1d\n\x10smoothed_feerate\x18\x03 \x01(\rH\x02\x88\x01\x01\x42\r\n\x0b_blockcountB\n\n\x08_feerateB\x13\n\x11_smoothed_feerate\"\x9b\x02\n\x1d\x46\x65\x65ratesOnchain_fee_estimates\x12 \n\x18opening_channel_satoshis\x18\x01 \x01(\x04\x12\x1d\n\x15mutual_close_satoshis\x18\x02 \x01(\x04\x12!\n\x19unilateral_close_satoshis\x18\x03 \x01(\x04\x12\x30\n#unilateral_close_nonanchor_satoshis\x18\x06 \x01(\x04H\x00\x88\x01\x01\x12\x1d\n\x15htlc_timeout_satoshis\x18\x04 \x01(\x04\x12\x1d\n\x15htlc_success_satoshis\x18\x05 \x01(\x04\x42&\n$_unilateral_close_nonanchor_satoshis\"\xe9\x02\n\x13\x46\x65tchinvoiceRequest\x12\r\n\x05offer\x18\x01 \x01(\t\x12%\n\x0b\x61mount_msat\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x15\n\x08quantity\x18\x03 \x01(\x04H\x01\x88\x01\x01\x12\x1f\n\x12recurrence_counter\x18\x04 \x01(\x04H\x02\x88\x01\x01\x12\x1d\n\x10recurrence_start\x18\x05 \x01(\x01H\x03\x88\x01\x01\x12\x1d\n\x10recurrence_label\x18\x06 \x01(\tH\x04\x88\x01\x01\x12\x14\n\x07timeout\x18\x07 \x01(\x01H\x05\x88\x01\x01\x12\x17\n\npayer_note\x18\x08 \x01(\tH\x06\x88\x01\x01\x42\x0e\n\x0c_amount_msatB\x0b\n\t_quantityB\x15\n\x13_recurrence_counterB\x13\n\x11_recurrence_startB\x13\n\x11_recurrence_labelB\n\n\x08_timeoutB\r\n\x0b_payer_note\"\x9a\x01\n\x14\x46\x65tchinvoiceResponse\x12\x0f\n\x07invoice\x18\x01 \x01(\t\x12)\n\x07\x63hanges\x18\x02 \x01(\x0b\x32\x18.cln.FetchinvoiceChanges\x12\x36\n\x0bnext_period\x18\x03 \x01(\x0b\x32\x1c.cln.FetchinvoiceNext_periodH\x00\x88\x01\x01\x42\x0e\n\x0c_next_period\"\x82\x02\n\x13\x46\x65tchinvoiceChanges\x12!\n\x14\x64\x65scription_appended\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x1b\n\x0evendor_removed\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06vendor\x18\x04 \x01(\tH\x03\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x42\x17\n\x15_description_appendedB\x0e\n\x0c_descriptionB\x11\n\x0f_vendor_removedB\t\n\x07_vendorB\x0e\n\x0c_amount_msat\"~\n\x17\x46\x65tchinvoiceNext_period\x12\x0f\n\x07\x63ounter\x18\x01 \x01(\x04\x12\x11\n\tstarttime\x18\x02 \x01(\x04\x12\x0f\n\x07\x65ndtime\x18\x03 \x01(\x04\x12\x17\n\x0fpaywindow_start\x18\x04 \x01(\x04\x12\x15\n\rpaywindow_end\x18\x05 \x01(\x04\"\xfb\x03\n\x12\x46undchannelRequest\x12\n\n\x02id\x18\t \x01(\x0c\x12 \n\x06\x61mount\x18\x01 \x01(\x0b\x32\x10.cln.AmountOrAll\x12\"\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.FeerateH\x00\x88\x01\x01\x12\x15\n\x08\x61nnounce\x18\x03 \x01(\x08H\x01\x88\x01\x01\x12\x14\n\x07minconf\x18\n \x01(\rH\x02\x88\x01\x01\x12#\n\tpush_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x15\n\x08\x63lose_to\x18\x06 \x01(\tH\x04\x88\x01\x01\x12%\n\x0brequest_amt\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x05\x88\x01\x01\x12\x1a\n\rcompact_lease\x18\x08 \x01(\tH\x06\x88\x01\x01\x12\x1c\n\x05utxos\x18\x0b \x03(\x0b\x32\r.cln.Outpoint\x12\x15\n\x08mindepth\x18\x0c \x01(\rH\x07\x88\x01\x01\x12!\n\x07reserve\x18\r \x01(\x0b\x32\x0b.cln.AmountH\x08\x88\x01\x01\x12\x14\n\x0c\x63hannel_type\x18\x0e \x03(\rB\n\n\x08_feerateB\x0b\n\t_announceB\n\n\x08_minconfB\x0c\n\n_push_msatB\x0b\n\t_close_toB\x0e\n\x0c_request_amtB\x10\n\x0e_compact_leaseB\x0b\n\t_mindepthB\n\n\x08_reserve\"\xe5\x01\n\x13\x46undchannelResponse\x12\n\n\x02tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\x12\x0e\n\x06outnum\x18\x03 \x01(\r\x12\x12\n\nchannel_id\x18\x04 \x01(\x0c\x12\x37\n\x0c\x63hannel_type\x18\x07 \x01(\x0b\x32\x1c.cln.FundchannelChannel_typeH\x00\x88\x01\x01\x12\x15\n\x08\x63lose_to\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x15\n\x08mindepth\x18\x06 \x01(\rH\x02\x88\x01\x01\x42\x0f\n\r_channel_typeB\x0b\n\t_close_toB\x0b\n\t_mindepth\"L\n\x17\x46undchannelChannel_type\x12\x0c\n\x04\x62its\x18\x01 \x03(\r\x12#\n\x05names\x18\x02 \x03(\x0e\x32\x14.cln.ChannelTypeName\"\xec\x01\n\x0fGetrouteRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12 \n\x0b\x61mount_msat\x18\t \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\nriskfactor\x18\x03 \x01(\x04\x12\x11\n\x04\x63ltv\x18\x04 \x01(\rH\x00\x88\x01\x01\x12\x13\n\x06\x66romid\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x18\n\x0b\x66uzzpercent\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x0f\n\x07\x65xclude\x18\x07 \x03(\t\x12\x14\n\x07maxhops\x18\x08 \x01(\rH\x03\x88\x01\x01\x42\x07\n\x05_cltvB\t\n\x07_fromidB\x0e\n\x0c_fuzzpercentB\n\n\x08_maxhops\"5\n\x10GetrouteResponse\x12!\n\x05route\x18\x01 \x03(\x0b\x32\x12.cln.GetrouteRoute\"\xc5\x01\n\rGetrouteRoute\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x0f\n\x07\x63hannel\x18\x02 \x01(\t\x12\x11\n\tdirection\x18\x03 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\r\n\x05\x64\x65lay\x18\x05 \x01(\r\x12\x34\n\x05style\x18\x06 \x01(\x0e\x32%.cln.GetrouteRoute.GetrouteRouteStyle\"\x1d\n\x12GetrouteRouteStyle\x12\x07\n\x03TLV\x10\x00\"\xb7\x03\n\x13ListforwardsRequest\x12@\n\x06status\x18\x01 \x01(\x0e\x32+.cln.ListforwardsRequest.ListforwardsStatusH\x00\x88\x01\x01\x12\x17\n\nin_channel\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x18\n\x0bout_channel\x18\x03 \x01(\tH\x02\x88\x01\x01\x12>\n\x05index\x18\x04 \x01(\x0e\x32*.cln.ListforwardsRequest.ListforwardsIndexH\x03\x88\x01\x01\x12\x12\n\x05start\x18\x05 \x01(\x04H\x04\x88\x01\x01\x12\x12\n\x05limit\x18\x06 \x01(\rH\x05\x88\x01\x01\"L\n\x12ListforwardsStatus\x12\x0b\n\x07OFFERED\x10\x00\x12\x0b\n\x07SETTLED\x10\x01\x12\x10\n\x0cLOCAL_FAILED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\"-\n\x11ListforwardsIndex\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07UPDATED\x10\x01\x42\t\n\x07_statusB\r\n\x0b_in_channelB\x0e\n\x0c_out_channelB\x08\n\x06_indexB\x08\n\x06_startB\x08\n\x06_limit\"C\n\x14ListforwardsResponse\x12+\n\x08\x66orwards\x18\x01 \x03(\x0b\x32\x19.cln.ListforwardsForwards\"\xba\x05\n\x14ListforwardsForwards\x12\x1a\n\rcreated_index\x18\x0c \x01(\x04H\x00\x88\x01\x01\x12\x12\n\nin_channel\x18\x01 \x01(\t\x12\x17\n\nin_htlc_id\x18\n \x01(\x04H\x01\x88\x01\x01\x12\x1c\n\x07in_msat\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\x12\x44\n\x06status\x18\x03 \x01(\x0e\x32\x34.cln.ListforwardsForwards.ListforwardsForwardsStatus\x12\x15\n\rreceived_time\x18\x04 \x01(\x01\x12\x18\n\x0bout_channel\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x18\n\x0bout_htlc_id\x18\x0b \x01(\x04H\x03\x88\x01\x01\x12\x1a\n\rupdated_index\x18\r \x01(\x04H\x04\x88\x01\x01\x12G\n\x05style\x18\t \x01(\x0e\x32\x33.cln.ListforwardsForwards.ListforwardsForwardsStyleH\x05\x88\x01\x01\x12\"\n\x08\x66\x65\x65_msat\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\"\n\x08out_msat\x18\x08 \x01(\x0b\x32\x0b.cln.AmountH\x07\x88\x01\x01\"T\n\x1aListforwardsForwardsStatus\x12\x0b\n\x07OFFERED\x10\x00\x12\x0b\n\x07SETTLED\x10\x01\x12\x10\n\x0cLOCAL_FAILED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\"0\n\x19ListforwardsForwardsStyle\x12\n\n\x06LEGACY\x10\x00\x12\x07\n\x03TLV\x10\x01\x42\x10\n\x0e_created_indexB\r\n\x0b_in_htlc_idB\x0e\n\x0c_out_channelB\x0e\n\x0c_out_htlc_idB\x10\n\x0e_updated_indexB\x08\n\x06_styleB\x0b\n\t_fee_msatB\x0b\n\t_out_msat\"a\n\x11ListoffersRequest\x12\x15\n\x08offer_id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x18\n\x0b\x61\x63tive_only\x18\x02 \x01(\x08H\x01\x88\x01\x01\x42\x0b\n\t_offer_idB\x0e\n\x0c_active_only\";\n\x12ListoffersResponse\x12%\n\x06offers\x18\x01 \x03(\x0b\x32\x15.cln.ListoffersOffers\"\x84\x01\n\x10ListoffersOffers\x12\x10\n\x08offer_id\x18\x01 \x01(\x0c\x12\x0e\n\x06\x61\x63tive\x18\x02 \x01(\x08\x12\x12\n\nsingle_use\x18\x03 \x01(\x08\x12\x0e\n\x06\x62olt12\x18\x04 \x01(\t\x12\x0c\n\x04used\x18\x05 \x01(\x08\x12\x12\n\x05label\x18\x06 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_label\"\xdb\x01\n\x0fListpaysRequest\x12\x13\n\x06\x62olt11\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12\x38\n\x06status\x18\x03 \x01(\x0e\x32#.cln.ListpaysRequest.ListpaysStatusH\x02\x88\x01\x01\"7\n\x0eListpaysStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x42\t\n\x07_bolt11B\x0f\n\r_payment_hashB\t\n\x07_status\"3\n\x10ListpaysResponse\x12\x1f\n\x04pays\x18\x01 \x03(\x0b\x32\x11.cln.ListpaysPays\"\xff\x04\n\x0cListpaysPays\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x34\n\x06status\x18\x02 \x01(\x0e\x32$.cln.ListpaysPays.ListpaysPaysStatus\x12\x18\n\x0b\x64\x65stination\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x12\x12\n\ncreated_at\x18\x04 \x01(\x04\x12\x19\n\x0c\x63ompleted_at\x18\x0c \x01(\x04H\x01\x88\x01\x01\x12\x12\n\x05label\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x06 \x01(\tH\x03\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x0b \x01(\tH\x04\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x07 \x01(\tH\x05\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x08 \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12*\n\x10\x61mount_sent_msat\x18\t \x01(\x0b\x32\x0b.cln.AmountH\x07\x88\x01\x01\x12\x15\n\x08preimage\x18\r \x01(\x0cH\x08\x88\x01\x01\x12\x1c\n\x0fnumber_of_parts\x18\x0e \x01(\x04H\t\x88\x01\x01\x12\x17\n\nerroronion\x18\n \x01(\x0cH\n\x88\x01\x01\";\n\x12ListpaysPaysStatus\x12\x0b\n\x07PENDING\x10\x00\x12\n\n\x06\x46\x41ILED\x10\x01\x12\x0c\n\x08\x43OMPLETE\x10\x02\x42\x0e\n\x0c_destinationB\x0f\n\r_completed_atB\x08\n\x06_labelB\t\n\x07_bolt11B\x0e\n\x0c_descriptionB\t\n\x07_bolt12B\x0e\n\x0c_amount_msatB\x13\n\x11_amount_sent_msatB\x0b\n\t_preimageB\x12\n\x10_number_of_partsB\r\n\x0b_erroronion\"*\n\x10ListhtlcsRequest\x12\x0f\n\x02id\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x05\n\x03_id\"7\n\x11ListhtlcsResponse\x12\"\n\x05htlcs\x18\x01 \x03(\x0b\x32\x13.cln.ListhtlcsHtlcs\"\x89\x02\n\x0eListhtlcsHtlcs\x12\x18\n\x10short_channel_id\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\x04\x12\x0e\n\x06\x65xpiry\x18\x03 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12>\n\tdirection\x18\x05 \x01(\x0e\x32+.cln.ListhtlcsHtlcs.ListhtlcsHtlcsDirection\x12\x14\n\x0cpayment_hash\x18\x06 \x01(\x0c\x12\x1d\n\x05state\x18\x07 \x01(\x0e\x32\x0e.cln.HtlcState\"*\n\x17ListhtlcsHtlcsDirection\x12\x07\n\x03OUT\x10\x00\x12\x06\n\x02IN\x10\x01\"\xc1\x03\n\x0cOfferRequest\x12\x0e\n\x06\x61mount\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x13\n\x06issuer\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x12\n\x05label\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x19\n\x0cquantity_max\x18\x05 \x01(\x04H\x02\x88\x01\x01\x12\x1c\n\x0f\x61\x62solute_expiry\x18\x06 \x01(\x04H\x03\x88\x01\x01\x12\x17\n\nrecurrence\x18\x07 \x01(\tH\x04\x88\x01\x01\x12\x1c\n\x0frecurrence_base\x18\x08 \x01(\tH\x05\x88\x01\x01\x12!\n\x14recurrence_paywindow\x18\t \x01(\tH\x06\x88\x01\x01\x12\x1d\n\x10recurrence_limit\x18\n \x01(\x04H\x07\x88\x01\x01\x12\x17\n\nsingle_use\x18\x0b \x01(\x08H\x08\x88\x01\x01\x42\t\n\x07_issuerB\x08\n\x06_labelB\x0f\n\r_quantity_maxB\x12\n\x10_absolute_expiryB\r\n\x0b_recurrenceB\x12\n\x10_recurrence_baseB\x17\n\x15_recurrence_paywindowB\x13\n\x11_recurrence_limitB\r\n\x0b_single_use\"\x92\x01\n\rOfferResponse\x12\x10\n\x08offer_id\x18\x01 \x01(\x0c\x12\x0e\n\x06\x61\x63tive\x18\x02 \x01(\x08\x12\x12\n\nsingle_use\x18\x03 \x01(\x08\x12\x0e\n\x06\x62olt12\x18\x04 \x01(\t\x12\x0c\n\x04used\x18\x05 \x01(\x08\x12\x0f\n\x07\x63reated\x18\x06 \x01(\x08\x12\x12\n\x05label\x18\x07 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_label\"Y\n\x0bPingRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x10\n\x03len\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x16\n\tpongbytes\x18\x03 \x01(\rH\x01\x88\x01\x01\x42\x06\n\x04_lenB\x0c\n\n_pongbytes\"\x1e\n\x0cPingResponse\x12\x0e\n\x06totlen\x18\x01 \x01(\r\"4\n\x14SendcustommsgRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\x0b\n\x03msg\x18\x02 \x01(\x0c\"\'\n\x15SendcustommsgResponse\x12\x0e\n\x06status\x18\x01 \x01(\t\"\xaa\x02\n\x11SetchannelRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12!\n\x07\x66\x65\x65\x62\x61se\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x13\n\x06\x66\x65\x65ppm\x18\x03 \x01(\rH\x01\x88\x01\x01\x12!\n\x07htlcmin\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12!\n\x07htlcmax\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x19\n\x0c\x65nforcedelay\x18\x06 \x01(\rH\x04\x88\x01\x01\x12\x1c\n\x0fignorefeelimits\x18\x07 \x01(\x08H\x05\x88\x01\x01\x42\n\n\x08_feebaseB\t\n\x07_feeppmB\n\n\x08_htlcminB\n\n\x08_htlcmaxB\x0f\n\r_enforcedelayB\x12\n\x10_ignorefeelimits\"?\n\x12SetchannelResponse\x12)\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x17.cln.SetchannelChannels\"\xca\x03\n\x12SetchannelChannels\x12\x0f\n\x07peer_id\x18\x01 \x01(\x0c\x12\x12\n\nchannel_id\x18\x02 \x01(\x0c\x12\x1d\n\x10short_channel_id\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\"\n\rfee_base_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12#\n\x1b\x66\x65\x65_proportional_millionths\x18\x05 \x01(\r\x12\x1e\n\x11ignore_fee_limits\x18\n \x01(\x08H\x01\x88\x01\x01\x12*\n\x15minimum_htlc_out_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12$\n\x17warning_htlcmin_too_low\x18\x07 \x01(\tH\x02\x88\x01\x01\x12*\n\x15maximum_htlc_out_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x18warning_htlcmax_too_high\x18\t \x01(\tH\x03\x88\x01\x01\x42\x13\n\x11_short_channel_idB\x14\n\x12_ignore_fee_limitsB\x1a\n\x18_warning_htlcmin_too_lowB\x1b\n\x19_warning_htlcmax_too_high\"\'\n\x12SigninvoiceRequest\x12\x11\n\tinvstring\x18\x01 \x01(\t\"%\n\x13SigninvoiceResponse\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\"%\n\x12SignmessageRequest\x12\x0f\n\x07message\x18\x01 \x01(\t\"F\n\x13SignmessageResponse\x12\x11\n\tsignature\x18\x01 \x01(\x0c\x12\r\n\x05recid\x18\x02 \x01(\x0c\x12\r\n\x05zbase\x18\x03 \x01(\t\"O\n\x16WaitblockheightRequest\x12\x13\n\x0b\x62lockheight\x18\x01 \x01(\r\x12\x14\n\x07timeout\x18\x02 \x01(\rH\x00\x88\x01\x01\x42\n\n\x08_timeout\".\n\x17WaitblockheightResponse\x12\x13\n\x0b\x62lockheight\x18\x01 \x01(\r\"\xf9\x01\n\x0bWaitRequest\x12\x31\n\tsubsystem\x18\x01 \x01(\x0e\x32\x1e.cln.WaitRequest.WaitSubsystem\x12\x31\n\tindexname\x18\x02 \x01(\x0e\x32\x1e.cln.WaitRequest.WaitIndexname\x12\x11\n\tnextvalue\x18\x03 \x01(\x04\"9\n\rWaitSubsystem\x12\x0c\n\x08INVOICES\x10\x00\x12\x0c\n\x08\x46ORWARDS\x10\x01\x12\x0c\n\x08SENDPAYS\x10\x02\"6\n\rWaitIndexname\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07UPDATED\x10\x01\x12\x0b\n\x07\x44\x45LETED\x10\x02\"\xe3\x01\n\x0cWaitResponse\x12\x32\n\tsubsystem\x18\x01 \x01(\x0e\x32\x1f.cln.WaitResponse.WaitSubsystem\x12\x14\n\x07\x63reated\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x14\n\x07updated\x18\x03 \x01(\x04H\x01\x88\x01\x01\x12\x14\n\x07\x64\x65leted\x18\x04 \x01(\x04H\x02\x88\x01\x01\"9\n\rWaitSubsystem\x12\x0c\n\x08INVOICES\x10\x00\x12\x0c\n\x08\x46ORWARDS\x10\x01\x12\x0c\n\x08SENDPAYS\x10\x02\x42\n\n\x08_createdB\n\n\x08_updatedB\n\n\x08_deleted\"\r\n\x0bStopRequest\"q\n\x0cStopResponse\x12\x31\n\x06result\x18\x01 \x01(\x0e\x32\x1c.cln.StopResponse.StopResultH\x00\x88\x01\x01\"#\n\nStopResult\x12\x15\n\x11SHUTDOWN_COMPLETE\x10\x00\x42\t\n\x07_result\"\xa7\x01\n\x18PreapprovekeysendRequest\x12\x18\n\x0b\x64\x65stination\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x42\x0e\n\x0c_destinationB\x0f\n\r_payment_hashB\x0e\n\x0c_amount_msat\"\x1b\n\x19PreapprovekeysendResponse\":\n\x18PreapproveinvoiceRequest\x12\x13\n\x06\x62olt11\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\t\n\x07_bolt11\"\x1b\n\x19PreapproveinvoiceResponse\"\x15\n\x13StaticbackupRequest\"#\n\x14StaticbackupResponse\x12\x0b\n\x03scb\x18\x01 \x03(\x0c\"\x97\x01\n\x15\x42kprlistincomeRequest\x12\x1d\n\x10\x63onsolidate_fees\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x17\n\nstart_time\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x15\n\x08\x65nd_time\x18\x03 \x01(\rH\x02\x88\x01\x01\x42\x13\n\x11_consolidate_feesB\r\n\x0b_start_timeB\x0b\n\t_end_time\"Q\n\x16\x42kprlistincomeResponse\x12\x37\n\rincome_events\x18\x01 \x03(\x0b\x32 .cln.BkprlistincomeIncome_events\"\xb5\x02\n\x1b\x42kprlistincomeIncome_events\x12\x0f\n\x07\x61\x63\x63ount\x18\x01 \x01(\t\x12\x0b\n\x03tag\x18\x02 \x01(\t\x12 \n\x0b\x63redit_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x1f\n\ndebit_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\x10\n\x08\x63urrency\x18\x05 \x01(\t\x12\x11\n\ttimestamp\x18\x06 \x01(\r\x12\x18\n\x0b\x64\x65scription\x18\x07 \x01(\tH\x00\x88\x01\x01\x12\x15\n\x08outpoint\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\x11\n\x04txid\x18\t \x01(\x0cH\x02\x88\x01\x01\x12\x17\n\npayment_id\x18\n \x01(\x0cH\x03\x88\x01\x01\x42\x0e\n\x0c_descriptionB\x0b\n\t_outpointB\x07\n\x05_txidB\r\n\x0b_payment_id2\xe2 \n\x04Node\x12\x36\n\x07Getinfo\x12\x13.cln.GetinfoRequest\x1a\x14.cln.GetinfoResponse\"\x00\x12<\n\tListPeers\x12\x15.cln.ListpeersRequest\x1a\x16.cln.ListpeersResponse\"\x00\x12<\n\tListFunds\x12\x15.cln.ListfundsRequest\x1a\x16.cln.ListfundsResponse\"\x00\x12\x36\n\x07SendPay\x12\x13.cln.SendpayRequest\x1a\x14.cln.SendpayResponse\"\x00\x12\x45\n\x0cListChannels\x12\x18.cln.ListchannelsRequest\x1a\x19.cln.ListchannelsResponse\"\x00\x12<\n\tAddGossip\x12\x15.cln.AddgossipRequest\x1a\x16.cln.AddgossipResponse\"\x00\x12Q\n\x10\x41utoCleanInvoice\x12\x1c.cln.AutocleaninvoiceRequest\x1a\x1d.cln.AutocleaninvoiceResponse\"\x00\x12\x45\n\x0c\x43heckMessage\x12\x18.cln.CheckmessageRequest\x1a\x19.cln.CheckmessageResponse\"\x00\x12\x30\n\x05\x43lose\x12\x11.cln.CloseRequest\x1a\x12.cln.CloseResponse\"\x00\x12:\n\x0b\x43onnectPeer\x12\x13.cln.ConnectRequest\x1a\x14.cln.ConnectResponse\"\x00\x12H\n\rCreateInvoice\x12\x19.cln.CreateinvoiceRequest\x1a\x1a.cln.CreateinvoiceResponse\"\x00\x12<\n\tDatastore\x12\x15.cln.DatastoreRequest\x1a\x16.cln.DatastoreResponse\"\x00\x12K\n\x0e\x44\x61tastoreUsage\x12\x1a.cln.DatastoreusageRequest\x1a\x1b.cln.DatastoreusageResponse\"\x00\x12\x42\n\x0b\x43reateOnion\x12\x17.cln.CreateonionRequest\x1a\x18.cln.CreateonionResponse\"\x00\x12\x45\n\x0c\x44\x65lDatastore\x12\x18.cln.DeldatastoreRequest\x1a\x19.cln.DeldatastoreResponse\"\x00\x12T\n\x11\x44\x65lExpiredInvoice\x12\x1d.cln.DelexpiredinvoiceRequest\x1a\x1e.cln.DelexpiredinvoiceResponse\"\x00\x12?\n\nDelInvoice\x12\x16.cln.DelinvoiceRequest\x1a\x17.cln.DelinvoiceResponse\"\x00\x12\x36\n\x07Invoice\x12\x13.cln.InvoiceRequest\x1a\x14.cln.InvoiceResponse\"\x00\x12H\n\rListDatastore\x12\x19.cln.ListdatastoreRequest\x1a\x1a.cln.ListdatastoreResponse\"\x00\x12\x45\n\x0cListInvoices\x12\x18.cln.ListinvoicesRequest\x1a\x19.cln.ListinvoicesResponse\"\x00\x12<\n\tSendOnion\x12\x15.cln.SendonionRequest\x1a\x16.cln.SendonionResponse\"\x00\x12\x45\n\x0cListSendPays\x12\x18.cln.ListsendpaysRequest\x1a\x19.cln.ListsendpaysResponse\"\x00\x12Q\n\x10ListTransactions\x12\x1c.cln.ListtransactionsRequest\x1a\x1d.cln.ListtransactionsResponse\"\x00\x12*\n\x03Pay\x12\x0f.cln.PayRequest\x1a\x10.cln.PayResponse\"\x00\x12<\n\tListNodes\x12\x15.cln.ListnodesRequest\x1a\x16.cln.ListnodesResponse\"\x00\x12K\n\x0eWaitAnyInvoice\x12\x1a.cln.WaitanyinvoiceRequest\x1a\x1b.cln.WaitanyinvoiceResponse\"\x00\x12\x42\n\x0bWaitInvoice\x12\x17.cln.WaitinvoiceRequest\x1a\x18.cln.WaitinvoiceResponse\"\x00\x12\x42\n\x0bWaitSendPay\x12\x17.cln.WaitsendpayRequest\x1a\x18.cln.WaitsendpayResponse\"\x00\x12\x36\n\x07NewAddr\x12\x13.cln.NewaddrRequest\x1a\x14.cln.NewaddrResponse\"\x00\x12\x39\n\x08Withdraw\x12\x14.cln.WithdrawRequest\x1a\x15.cln.WithdrawResponse\"\x00\x12\x36\n\x07KeySend\x12\x13.cln.KeysendRequest\x1a\x14.cln.KeysendResponse\"\x00\x12\x39\n\x08\x46undPsbt\x12\x14.cln.FundpsbtRequest\x1a\x15.cln.FundpsbtResponse\"\x00\x12\x39\n\x08SendPsbt\x12\x14.cln.SendpsbtRequest\x1a\x15.cln.SendpsbtResponse\"\x00\x12\x39\n\x08SignPsbt\x12\x14.cln.SignpsbtRequest\x1a\x15.cln.SignpsbtResponse\"\x00\x12\x39\n\x08UtxoPsbt\x12\x14.cln.UtxopsbtRequest\x1a\x15.cln.UtxopsbtResponse\"\x00\x12<\n\tTxDiscard\x12\x15.cln.TxdiscardRequest\x1a\x16.cln.TxdiscardResponse\"\x00\x12<\n\tTxPrepare\x12\x15.cln.TxprepareRequest\x1a\x16.cln.TxprepareResponse\"\x00\x12\x33\n\x06TxSend\x12\x12.cln.TxsendRequest\x1a\x13.cln.TxsendResponse\"\x00\x12Q\n\x10ListPeerChannels\x12\x1c.cln.ListpeerchannelsRequest\x1a\x1d.cln.ListpeerchannelsResponse\"\x00\x12W\n\x12ListClosedChannels\x12\x1e.cln.ListclosedchannelsRequest\x1a\x1f.cln.ListclosedchannelsResponse\"\x00\x12<\n\tDecodePay\x12\x15.cln.DecodepayRequest\x1a\x16.cln.DecodepayResponse\"\x00\x12\x33\n\x06\x44\x65\x63ode\x12\x12.cln.DecodeRequest\x1a\x13.cln.DecodeResponse\"\x00\x12?\n\nDisconnect\x12\x16.cln.DisconnectRequest\x1a\x17.cln.DisconnectResponse\"\x00\x12\x39\n\x08\x46\x65\x65rates\x12\x14.cln.FeeratesRequest\x1a\x15.cln.FeeratesResponse\"\x00\x12\x45\n\x0c\x46\x65tchInvoice\x12\x18.cln.FetchinvoiceRequest\x1a\x19.cln.FetchinvoiceResponse\"\x00\x12\x42\n\x0b\x46undChannel\x12\x17.cln.FundchannelRequest\x1a\x18.cln.FundchannelResponse\"\x00\x12\x39\n\x08GetRoute\x12\x14.cln.GetrouteRequest\x1a\x15.cln.GetrouteResponse\"\x00\x12\x45\n\x0cListForwards\x12\x18.cln.ListforwardsRequest\x1a\x19.cln.ListforwardsResponse\"\x00\x12?\n\nListOffers\x12\x16.cln.ListoffersRequest\x1a\x17.cln.ListoffersResponse\"\x00\x12\x39\n\x08ListPays\x12\x14.cln.ListpaysRequest\x1a\x15.cln.ListpaysResponse\"\x00\x12<\n\tListHtlcs\x12\x15.cln.ListhtlcsRequest\x1a\x16.cln.ListhtlcsResponse\"\x00\x12\x30\n\x05Offer\x12\x11.cln.OfferRequest\x1a\x12.cln.OfferResponse\"\x00\x12-\n\x04Ping\x12\x10.cln.PingRequest\x1a\x11.cln.PingResponse\"\x00\x12H\n\rSendCustomMsg\x12\x19.cln.SendcustommsgRequest\x1a\x1a.cln.SendcustommsgResponse\"\x00\x12?\n\nSetChannel\x12\x16.cln.SetchannelRequest\x1a\x17.cln.SetchannelResponse\"\x00\x12\x42\n\x0bSignInvoice\x12\x17.cln.SigninvoiceRequest\x1a\x18.cln.SigninvoiceResponse\"\x00\x12\x42\n\x0bSignMessage\x12\x17.cln.SignmessageRequest\x1a\x18.cln.SignmessageResponse\"\x00\x12N\n\x0fWaitBlockHeight\x12\x1b.cln.WaitblockheightRequest\x1a\x1c.cln.WaitblockheightResponse\"\x00\x12-\n\x04Wait\x12\x10.cln.WaitRequest\x1a\x11.cln.WaitResponse\"\x00\x12-\n\x04Stop\x12\x10.cln.StopRequest\x1a\x11.cln.StopResponse\"\x00\x12T\n\x11PreApproveKeysend\x12\x1d.cln.PreapprovekeysendRequest\x1a\x1e.cln.PreapprovekeysendResponse\"\x00\x12T\n\x11PreApproveInvoice\x12\x1d.cln.PreapproveinvoiceRequest\x1a\x1e.cln.PreapproveinvoiceResponse\"\x00\x12\x45\n\x0cStaticBackup\x12\x18.cln.StaticbackupRequest\x1a\x19.cln.StaticbackupResponse\"\x00\x12K\n\x0e\x42kprListIncome\x12\x1a.cln.BkprlistincomeRequest\x1a\x1b.cln.BkprlistincomeResponse\"\x00\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -36,474 +36,476 @@ _globals['_GETINFOBINDING']._serialized_end=1186 _globals['_GETINFOBINDING_GETINFOBINDINGTYPE']._serialized_start=1059 _globals['_GETINFOBINDING_GETINFOBINDINGTYPE']._serialized_end=1154 - _globals['_LISTPEERSREQUEST']._serialized_start=1188 - _globals['_LISTPEERSREQUEST']._serialized_end=1260 - _globals['_LISTPEERSRESPONSE']._serialized_start=1262 - _globals['_LISTPEERSRESPONSE']._serialized_end=1317 - _globals['_LISTPEERSPEERS']._serialized_start=1320 - _globals['_LISTPEERSPEERS']._serialized_end=1590 - _globals['_LISTPEERSPEERSLOG']._serialized_start=1593 - _globals['_LISTPEERSPEERSLOG']._serialized_end=1974 - _globals['_LISTPEERSPEERSLOG_LISTPEERSPEERSLOGTYPE']._serialized_start=1804 - _globals['_LISTPEERSPEERSLOG_LISTPEERSPEERSLOGTYPE']._serialized_end=1909 - _globals['_LISTPEERSPEERSCHANNELS']._serialized_start=1977 - _globals['_LISTPEERSPEERSCHANNELS']._serialized_end=5070 - _globals['_LISTPEERSPEERSCHANNELS_LISTPEERSPEERSCHANNELSSTATE']._serialized_start=3877 - _globals['_LISTPEERSPEERSCHANNELS_LISTPEERSPEERSCHANNELSSTATE']._serialized_end=4229 - _globals['_LISTPEERSPEERSCHANNELSFEERATE']._serialized_start=5072 - _globals['_LISTPEERSPEERSCHANNELSFEERATE']._serialized_end=5133 - _globals['_LISTPEERSPEERSCHANNELSINFLIGHT']._serialized_start=5136 - _globals['_LISTPEERSPEERSCHANNELSINFLIGHT']._serialized_end=5379 - _globals['_LISTPEERSPEERSCHANNELSFUNDING']._serialized_start=5382 - _globals['_LISTPEERSPEERSCHANNELSFUNDING']._serialized_end=5665 - _globals['_LISTPEERSPEERSCHANNELSALIAS']._serialized_start=5667 - _globals['_LISTPEERSPEERSCHANNELSALIAS']._serialized_end=5758 - _globals['_LISTPEERSPEERSCHANNELSHTLCS']._serialized_start=5761 - _globals['_LISTPEERSPEERSCHANNELSHTLCS']._serialized_end=6130 - _globals['_LISTPEERSPEERSCHANNELSHTLCS_LISTPEERSPEERSCHANNELSHTLCSDIRECTION']._serialized_start=6046 - _globals['_LISTPEERSPEERSCHANNELSHTLCS_LISTPEERSPEERSCHANNELSHTLCSDIRECTION']._serialized_end=6101 - _globals['_LISTFUNDSREQUEST']._serialized_start=6132 - _globals['_LISTFUNDSREQUEST']._serialized_end=6180 - _globals['_LISTFUNDSRESPONSE']._serialized_start=6182 - _globals['_LISTFUNDSRESPONSE']._serialized_end=6283 - _globals['_LISTFUNDSOUTPUTS']._serialized_start=6286 - _globals['_LISTFUNDSOUTPUTS']._serialized_end=6673 - _globals['_LISTFUNDSOUTPUTS_LISTFUNDSOUTPUTSSTATUS']._serialized_start=6547 - _globals['_LISTFUNDSOUTPUTS_LISTFUNDSOUTPUTSSTATUS']._serialized_end=6628 - _globals['_LISTFUNDSCHANNELS']._serialized_start=6676 - _globals['_LISTFUNDSCHANNELS']._serialized_end=6975 - _globals['_SENDPAYREQUEST']._serialized_start=6978 - _globals['_SENDPAYREQUEST']._serialized_end=7327 - _globals['_SENDPAYRESPONSE']._serialized_start=7330 - _globals['_SENDPAYRESPONSE']._serialized_end=8015 - _globals['_SENDPAYRESPONSE_SENDPAYSTATUS']._serialized_start=7800 - _globals['_SENDPAYRESPONSE_SENDPAYSTATUS']._serialized_end=7842 - _globals['_SENDPAYROUTE']._serialized_start=8017 - _globals['_SENDPAYROUTE']._serialized_end=8109 - _globals['_LISTCHANNELSREQUEST']._serialized_start=8112 - _globals['_LISTCHANNELSREQUEST']._serialized_end=8259 - _globals['_LISTCHANNELSRESPONSE']._serialized_start=8261 - _globals['_LISTCHANNELSRESPONSE']._serialized_end=8328 - _globals['_LISTCHANNELSCHANNELS']._serialized_start=8331 - _globals['_LISTCHANNELSCHANNELS']._serialized_end=8766 - _globals['_ADDGOSSIPREQUEST']._serialized_start=8768 - _globals['_ADDGOSSIPREQUEST']._serialized_end=8803 - _globals['_ADDGOSSIPRESPONSE']._serialized_start=8805 - _globals['_ADDGOSSIPRESPONSE']._serialized_end=8824 - _globals['_AUTOCLEANINVOICEREQUEST']._serialized_start=8826 - _globals['_AUTOCLEANINVOICEREQUEST']._serialized_end=8937 - _globals['_AUTOCLEANINVOICERESPONSE']._serialized_start=8940 - _globals['_AUTOCLEANINVOICERESPONSE']._serialized_end=9069 - _globals['_CHECKMESSAGEREQUEST']._serialized_start=9071 - _globals['_CHECKMESSAGEREQUEST']._serialized_end=9156 - _globals['_CHECKMESSAGERESPONSE']._serialized_start=9158 - _globals['_CHECKMESSAGERESPONSE']._serialized_end=9214 - _globals['_CLOSEREQUEST']._serialized_start=9217 - _globals['_CLOSEREQUEST']._serialized_end=9548 - _globals['_CLOSERESPONSE']._serialized_start=9551 - _globals['_CLOSERESPONSE']._serialized_end=9722 - _globals['_CLOSERESPONSE_CLOSETYPE']._serialized_start=9653 - _globals['_CLOSERESPONSE_CLOSETYPE']._serialized_end=9706 - _globals['_CONNECTREQUEST']._serialized_start=9724 - _globals['_CONNECTREQUEST']._serialized_end=9808 - _globals['_CONNECTRESPONSE']._serialized_start=9811 - _globals['_CONNECTRESPONSE']._serialized_end=9991 - _globals['_CONNECTRESPONSE_CONNECTDIRECTION']._serialized_start=9956 - _globals['_CONNECTRESPONSE_CONNECTDIRECTION']._serialized_end=9991 - _globals['_CONNECTADDRESS']._serialized_start=9994 - _globals['_CONNECTADDRESS']._serialized_end=10245 - _globals['_CONNECTADDRESS_CONNECTADDRESSTYPE']._serialized_start=10133 - _globals['_CONNECTADDRESS_CONNECTADDRESSTYPE']._serialized_end=10213 - _globals['_CREATEINVOICEREQUEST']._serialized_start=10247 - _globals['_CREATEINVOICEREQUEST']._serialized_end=10321 - _globals['_CREATEINVOICERESPONSE']._serialized_start=10324 - _globals['_CREATEINVOICERESPONSE']._serialized_end=11090 - _globals['_CREATEINVOICERESPONSE_CREATEINVOICESTATUS']._serialized_start=10847 - _globals['_CREATEINVOICERESPONSE_CREATEINVOICESTATUS']._serialized_end=10903 - _globals['_CREATEINVOICEPAID_OUTPOINT']._serialized_start=11092 - _globals['_CREATEINVOICEPAID_OUTPOINT']._serialized_end=11180 - _globals['_DATASTOREREQUEST']._serialized_start=11183 - _globals['_DATASTOREREQUEST']._serialized_end=11491 - _globals['_DATASTOREREQUEST_DATASTOREMODE']._serialized_start=11336 - _globals['_DATASTOREREQUEST_DATASTOREMODE']._serialized_end=11448 - _globals['_DATASTORERESPONSE']._serialized_start=11494 - _globals['_DATASTORERESPONSE']._serialized_end=11624 - _globals['_DATASTOREUSAGEREQUEST']._serialized_start=11626 - _globals['_DATASTOREUSAGEREQUEST']._serialized_end=11649 - _globals['_DATASTOREUSAGERESPONSE']._serialized_start=11651 - _globals['_DATASTOREUSAGERESPONSE']._serialized_end=11758 - _globals['_DATASTOREUSAGEDATASTOREUSAGE']._serialized_start=11760 - _globals['_DATASTOREUSAGEDATASTOREUSAGE']._serialized_end=11858 - _globals['_CREATEONIONREQUEST']._serialized_start=11861 - _globals['_CREATEONIONREQUEST']._serialized_end=12018 - _globals['_CREATEONIONRESPONSE']._serialized_start=12020 - _globals['_CREATEONIONRESPONSE']._serialized_end=12080 - _globals['_CREATEONIONHOPS']._serialized_start=12082 - _globals['_CREATEONIONHOPS']._serialized_end=12132 - _globals['_DELDATASTOREREQUEST']._serialized_start=12134 - _globals['_DELDATASTOREREQUEST']._serialized_end=12208 - _globals['_DELDATASTORERESPONSE']._serialized_start=12211 - _globals['_DELDATASTORERESPONSE']._serialized_end=12344 - _globals['_DELEXPIREDINVOICEREQUEST']._serialized_start=12346 - _globals['_DELEXPIREDINVOICEREQUEST']._serialized_end=12418 - _globals['_DELEXPIREDINVOICERESPONSE']._serialized_start=12420 - _globals['_DELEXPIREDINVOICERESPONSE']._serialized_end=12447 - _globals['_DELINVOICEREQUEST']._serialized_start=12450 - _globals['_DELINVOICEREQUEST']._serialized_end=12632 - _globals['_DELINVOICEREQUEST_DELINVOICESTATUS']._serialized_start=12566 - _globals['_DELINVOICEREQUEST_DELINVOICESTATUS']._serialized_end=12619 - _globals['_DELINVOICERESPONSE']._serialized_start=12635 - _globals['_DELINVOICERESPONSE']._serialized_end=13180 - _globals['_DELINVOICERESPONSE_DELINVOICESTATUS']._serialized_start=12566 - _globals['_DELINVOICERESPONSE_DELINVOICESTATUS']._serialized_end=12619 - _globals['_INVOICEREQUEST']._serialized_start=13183 - _globals['_INVOICEREQUEST']._serialized_end=13433 - _globals['_INVOICERESPONSE']._serialized_start=13436 - _globals['_INVOICERESPONSE']._serialized_end=13841 - _globals['_LISTDATASTOREREQUEST']._serialized_start=13843 - _globals['_LISTDATASTOREREQUEST']._serialized_end=13878 - _globals['_LISTDATASTORERESPONSE']._serialized_start=13880 - _globals['_LISTDATASTORERESPONSE']._serialized_end=13951 - _globals['_LISTDATASTOREDATASTORE']._serialized_start=13954 - _globals['_LISTDATASTOREDATASTORE']._serialized_end=14089 - _globals['_LISTINVOICESREQUEST']._serialized_start=14092 - _globals['_LISTINVOICESREQUEST']._serialized_end=14442 - _globals['_LISTINVOICESREQUEST_LISTINVOICESINDEX']._serialized_start=14313 - _globals['_LISTINVOICESREQUEST_LISTINVOICESINDEX']._serialized_end=14358 - _globals['_LISTINVOICESRESPONSE']._serialized_start=14444 - _globals['_LISTINVOICESRESPONSE']._serialized_end=14511 - _globals['_LISTINVOICESINVOICES']._serialized_start=14514 - _globals['_LISTINVOICESINVOICES']._serialized_end=15366 - _globals['_LISTINVOICESINVOICES_LISTINVOICESINVOICESSTATUS']._serialized_start=15082 - _globals['_LISTINVOICESINVOICES_LISTINVOICESINVOICESSTATUS']._serialized_end=15145 - _globals['_LISTINVOICESINVOICESPAID_OUTPOINT']._serialized_start=15368 - _globals['_LISTINVOICESINVOICESPAID_OUTPOINT']._serialized_end=15463 - _globals['_SENDONIONREQUEST']._serialized_start=15466 - _globals['_SENDONIONREQUEST']._serialized_end=15860 - _globals['_SENDONIONRESPONSE']._serialized_start=15863 - _globals['_SENDONIONRESPONSE']._serialized_end=16478 - _globals['_SENDONIONRESPONSE_SENDONIONSTATUS']._serialized_start=16290 - _globals['_SENDONIONRESPONSE_SENDONIONSTATUS']._serialized_end=16334 - _globals['_SENDONIONFIRST_HOP']._serialized_start=16480 - _globals['_SENDONIONFIRST_HOP']._serialized_end=16561 - _globals['_LISTSENDPAYSREQUEST']._serialized_start=16564 - _globals['_LISTSENDPAYSREQUEST']._serialized_end=16980 - _globals['_LISTSENDPAYSREQUEST_LISTSENDPAYSSTATUS']._serialized_start=16805 - _globals['_LISTSENDPAYSREQUEST_LISTSENDPAYSSTATUS']._serialized_end=16864 - _globals['_LISTSENDPAYSREQUEST_LISTSENDPAYSINDEX']._serialized_start=16866 - _globals['_LISTSENDPAYSREQUEST_LISTSENDPAYSINDEX']._serialized_end=16911 - _globals['_LISTSENDPAYSRESPONSE']._serialized_start=16982 - _globals['_LISTSENDPAYSRESPONSE']._serialized_end=17049 - _globals['_LISTSENDPAYSPAYMENTS']._serialized_start=17052 - _globals['_LISTSENDPAYSPAYMENTS']._serialized_end=17772 - _globals['_LISTSENDPAYSPAYMENTS_LISTSENDPAYSPAYMENTSSTATUS']._serialized_start=17542 - _globals['_LISTSENDPAYSPAYMENTS_LISTSENDPAYSPAYMENTSSTATUS']._serialized_end=17609 - _globals['_LISTTRANSACTIONSREQUEST']._serialized_start=17774 - _globals['_LISTTRANSACTIONSREQUEST']._serialized_end=17799 - _globals['_LISTTRANSACTIONSRESPONSE']._serialized_start=17801 - _globals['_LISTTRANSACTIONSRESPONSE']._serialized_end=17884 - _globals['_LISTTRANSACTIONSTRANSACTIONS']._serialized_start=17887 - _globals['_LISTTRANSACTIONSTRANSACTIONS']._serialized_end=18135 - _globals['_LISTTRANSACTIONSTRANSACTIONSINPUTS']._serialized_start=18137 - _globals['_LISTTRANSACTIONSTRANSACTIONSINPUTS']._serialized_end=18220 - _globals['_LISTTRANSACTIONSTRANSACTIONSOUTPUTS']._serialized_start=18222 - _globals['_LISTTRANSACTIONSTRANSACTIONSOUTPUTS']._serialized_end=18330 - _globals['_PAYREQUEST']._serialized_start=18333 - _globals['_PAYREQUEST']._serialized_end=18807 - _globals['_PAYRESPONSE']._serialized_start=18810 - _globals['_PAYRESPONSE']._serialized_end=19189 - _globals['_PAYRESPONSE_PAYSTATUS']._serialized_start=19092 - _globals['_PAYRESPONSE_PAYSTATUS']._serialized_end=19142 - _globals['_LISTNODESREQUEST']._serialized_start=19191 - _globals['_LISTNODESREQUEST']._serialized_end=19233 - _globals['_LISTNODESRESPONSE']._serialized_start=19235 - _globals['_LISTNODESRESPONSE']._serialized_end=19290 - _globals['_LISTNODESNODES']._serialized_start=19293 - _globals['_LISTNODESNODES']._serialized_end=19518 - _globals['_LISTNODESNODESADDRESSES']._serialized_start=19521 - _globals['_LISTNODESNODESADDRESSES']._serialized_end=19753 - _globals['_LISTNODESNODESADDRESSES_LISTNODESNODESADDRESSESTYPE']._serialized_start=19661 - _globals['_LISTNODESNODESADDRESSES_LISTNODESNODESADDRESSESTYPE']._serialized_end=19741 - _globals['_WAITANYINVOICEREQUEST']._serialized_start=19755 - _globals['_WAITANYINVOICEREQUEST']._serialized_end=19858 - _globals['_WAITANYINVOICERESPONSE']._serialized_start=19861 - _globals['_WAITANYINVOICERESPONSE']._serialized_end=20564 - _globals['_WAITANYINVOICERESPONSE_WAITANYINVOICESTATUS']._serialized_start=20355 - _globals['_WAITANYINVOICERESPONSE_WAITANYINVOICESTATUS']._serialized_end=20400 - _globals['_WAITANYINVOICEPAID_OUTPOINT']._serialized_start=20566 - _globals['_WAITANYINVOICEPAID_OUTPOINT']._serialized_end=20655 - _globals['_WAITINVOICEREQUEST']._serialized_start=20657 - _globals['_WAITINVOICEREQUEST']._serialized_end=20692 - _globals['_WAITINVOICERESPONSE']._serialized_start=20695 - _globals['_WAITINVOICERESPONSE']._serialized_end=21383 - _globals['_WAITINVOICERESPONSE_WAITINVOICESTATUS']._serialized_start=21177 - _globals['_WAITINVOICERESPONSE_WAITINVOICESTATUS']._serialized_end=21219 - _globals['_WAITINVOICEPAID_OUTPOINT']._serialized_start=21385 - _globals['_WAITINVOICEPAID_OUTPOINT']._serialized_end=21471 - _globals['_WAITSENDPAYREQUEST']._serialized_start=21474 - _globals['_WAITSENDPAYREQUEST']._serialized_end=21616 - _globals['_WAITSENDPAYRESPONSE']._serialized_start=21619 - _globals['_WAITSENDPAYRESPONSE']._serialized_end=22273 - _globals['_WAITSENDPAYRESPONSE_WAITSENDPAYSTATUS']._serialized_start=22079 - _globals['_WAITSENDPAYRESPONSE_WAITSENDPAYSTATUS']._serialized_end=22112 - _globals['_NEWADDRREQUEST']._serialized_start=22276 - _globals['_NEWADDRREQUEST']._serialized_end=22427 - _globals['_NEWADDRREQUEST_NEWADDRADDRESSTYPE']._serialized_start=22360 - _globals['_NEWADDRREQUEST_NEWADDRADDRESSTYPE']._serialized_end=22411 - _globals['_NEWADDRRESPONSE']._serialized_start=22429 - _globals['_NEWADDRRESPONSE']._serialized_end=22506 - _globals['_WITHDRAWREQUEST']._serialized_start=22509 - _globals['_WITHDRAWREQUEST']._serialized_end=22711 - _globals['_WITHDRAWRESPONSE']._serialized_start=22713 - _globals['_WITHDRAWRESPONSE']._serialized_end=22771 - _globals['_KEYSENDREQUEST']._serialized_start=22774 - _globals['_KEYSENDREQUEST']._serialized_end=23160 - _globals['_KEYSENDRESPONSE']._serialized_start=23163 - _globals['_KEYSENDRESPONSE']._serialized_end=23533 - _globals['_KEYSENDRESPONSE_KEYSENDSTATUS']._serialized_start=23457 - _globals['_KEYSENDRESPONSE_KEYSENDSTATUS']._serialized_end=23486 - _globals['_FUNDPSBTREQUEST']._serialized_start=23536 - _globals['_FUNDPSBTREQUEST']._serialized_end=23956 - _globals['_FUNDPSBTRESPONSE']._serialized_start=23959 - _globals['_FUNDPSBTRESPONSE']._serialized_end=24176 - _globals['_FUNDPSBTRESERVATIONS']._serialized_start=24178 - _globals['_FUNDPSBTRESERVATIONS']._serialized_end=24295 - _globals['_SENDPSBTREQUEST']._serialized_start=24297 - _globals['_SENDPSBTREQUEST']._serialized_end=24362 - _globals['_SENDPSBTRESPONSE']._serialized_start=24364 - _globals['_SENDPSBTRESPONSE']._serialized_end=24408 - _globals['_SIGNPSBTREQUEST']._serialized_start=24410 - _globals['_SIGNPSBTREQUEST']._serialized_end=24459 - _globals['_SIGNPSBTRESPONSE']._serialized_start=24461 - _globals['_SIGNPSBTRESPONSE']._serialized_end=24500 - _globals['_UTXOPSBTREQUEST']._serialized_start=24503 - _globals['_UTXOPSBTREQUEST']._serialized_end=24914 - _globals['_UTXOPSBTRESPONSE']._serialized_start=24917 - _globals['_UTXOPSBTRESPONSE']._serialized_end=25134 - _globals['_UTXOPSBTRESERVATIONS']._serialized_start=25136 - _globals['_UTXOPSBTRESERVATIONS']._serialized_end=25253 - _globals['_TXDISCARDREQUEST']._serialized_start=25255 - _globals['_TXDISCARDREQUEST']._serialized_end=25287 - _globals['_TXDISCARDRESPONSE']._serialized_start=25289 - _globals['_TXDISCARDRESPONSE']._serialized_end=25343 - _globals['_TXPREPAREREQUEST']._serialized_start=25346 - _globals['_TXPREPAREREQUEST']._serialized_end=25510 - _globals['_TXPREPARERESPONSE']._serialized_start=25512 - _globals['_TXPREPARERESPONSE']._serialized_end=25580 - _globals['_TXSENDREQUEST']._serialized_start=25582 - _globals['_TXSENDREQUEST']._serialized_end=25611 - _globals['_TXSENDRESPONSE']._serialized_start=25613 - _globals['_TXSENDRESPONSE']._serialized_end=25669 - _globals['_LISTPEERCHANNELSREQUEST']._serialized_start=25671 - _globals['_LISTPEERCHANNELSREQUEST']._serialized_end=25720 - _globals['_LISTPEERCHANNELSRESPONSE']._serialized_start=25722 - _globals['_LISTPEERCHANNELSRESPONSE']._serialized_end=25797 - _globals['_LISTPEERCHANNELSCHANNELS']._serialized_start=25800 - _globals['_LISTPEERCHANNELSCHANNELS']._serialized_end=29266 - _globals['_LISTPEERCHANNELSCHANNELS_LISTPEERCHANNELSCHANNELSSTATE']._serialized_start=27913 - _globals['_LISTPEERCHANNELSCHANNELS_LISTPEERCHANNELSCHANNELSSTATE']._serialized_end=28297 - _globals['_LISTPEERCHANNELSCHANNELSUPDATES']._serialized_start=29269 - _globals['_LISTPEERCHANNELSCHANNELSUPDATES']._serialized_end=29451 - _globals['_LISTPEERCHANNELSCHANNELSUPDATESLOCAL']._serialized_start=29454 - _globals['_LISTPEERCHANNELSCHANNELSUPDATESLOCAL']._serialized_end=29813 - _globals['_LISTPEERCHANNELSCHANNELSUPDATESREMOTE']._serialized_start=29816 - _globals['_LISTPEERCHANNELSCHANNELSUPDATESREMOTE']._serialized_end=30176 - _globals['_LISTPEERCHANNELSCHANNELSFEERATE']._serialized_start=30178 - _globals['_LISTPEERCHANNELSCHANNELSFEERATE']._serialized_end=30271 - _globals['_LISTPEERCHANNELSCHANNELSINFLIGHT']._serialized_start=30274 - _globals['_LISTPEERCHANNELSCHANNELSINFLIGHT']._serialized_end=30658 - _globals['_LISTPEERCHANNELSCHANNELSFUNDING']._serialized_start=30661 - _globals['_LISTPEERCHANNELSCHANNELSFUNDING']._serialized_end=30999 - _globals['_LISTPEERCHANNELSCHANNELSALIAS']._serialized_start=31001 - _globals['_LISTPEERCHANNELSCHANNELSALIAS']._serialized_end=31094 - _globals['_LISTPEERCHANNELSCHANNELSHTLCS']._serialized_start=31097 - _globals['_LISTPEERCHANNELSCHANNELSHTLCS']._serialized_end=31579 - _globals['_LISTPEERCHANNELSCHANNELSHTLCS_LISTPEERCHANNELSCHANNELSHTLCSDIRECTION']._serialized_start=31418 - _globals['_LISTPEERCHANNELSCHANNELSHTLCS_LISTPEERCHANNELSCHANNELSHTLCSDIRECTION']._serialized_end=31475 - _globals['_LISTCLOSEDCHANNELSREQUEST']._serialized_start=31581 - _globals['_LISTCLOSEDCHANNELSREQUEST']._serialized_end=31632 - _globals['_LISTCLOSEDCHANNELSRESPONSE']._serialized_start=31634 - _globals['_LISTCLOSEDCHANNELSRESPONSE']._serialized_end=31725 - _globals['_LISTCLOSEDCHANNELSCLOSEDCHANNELS']._serialized_start=31728 - _globals['_LISTCLOSEDCHANNELSCLOSEDCHANNELS']._serialized_end=32994 - _globals['_LISTCLOSEDCHANNELSCLOSEDCHANNELS_LISTCLOSEDCHANNELSCLOSEDCHANNELSCLOSE_CAUSE']._serialized_start=32665 - _globals['_LISTCLOSEDCHANNELSCLOSEDCHANNELS_LISTCLOSEDCHANNELSCLOSEDCHANNELSCLOSE_CAUSE']._serialized_end=32783 - _globals['_LISTCLOSEDCHANNELSCLOSEDCHANNELSALIAS']._serialized_start=32996 - _globals['_LISTCLOSEDCHANNELSCLOSEDCHANNELSALIAS']._serialized_end=33097 - _globals['_DECODEPAYREQUEST']._serialized_start=33099 - _globals['_DECODEPAYREQUEST']._serialized_end=33175 - _globals['_DECODEPAYRESPONSE']._serialized_start=33178 - _globals['_DECODEPAYRESPONSE']._serialized_end=33703 - _globals['_DECODEPAYFALLBACKS']._serialized_start=33706 - _globals['_DECODEPAYFALLBACKS']._serialized_end=33914 - _globals['_DECODEPAYFALLBACKS_DECODEPAYFALLBACKSTYPE']._serialized_start=33827 - _globals['_DECODEPAYFALLBACKS_DECODEPAYFALLBACKSTYPE']._serialized_end=33905 - _globals['_DECODEPAYEXTRA']._serialized_start=33916 - _globals['_DECODEPAYEXTRA']._serialized_end=33959 - _globals['_DECODEREQUEST']._serialized_start=33961 - _globals['_DECODEREQUEST']._serialized_end=33992 - _globals['_DECODERESPONSE']._serialized_start=33995 - _globals['_DECODERESPONSE']._serialized_end=38323 - _globals['_DECODERESPONSE_DECODETYPE']._serialized_start=36588 - _globals['_DECODERESPONSE_DECODETYPE']._serialized_end=36719 - _globals['_DECODEOFFER_PATHS']._serialized_start=38325 - _globals['_DECODEOFFER_PATHS']._serialized_end=38385 - _globals['_DECODEOFFER_RECURRENCEPAYWINDOW']._serialized_start=38388 - _globals['_DECODEOFFER_RECURRENCEPAYWINDOW']._serialized_end=38526 - _globals['_DECODEINVOICE_PATHSPATH']._serialized_start=38528 - _globals['_DECODEINVOICE_PATHSPATH']._serialized_end=38612 - _globals['_DECODEINVOICE_FALLBACKS']._serialized_start=38614 - _globals['_DECODEINVOICE_FALLBACKS']._serialized_end=38703 - _globals['_DECODEFALLBACKS']._serialized_start=38705 - _globals['_DECODEFALLBACKS']._serialized_end=38824 - _globals['_DECODEEXTRA']._serialized_start=38826 - _globals['_DECODEEXTRA']._serialized_end=38866 - _globals['_DECODERESTRICTIONS']._serialized_start=38868 - _globals['_DECODERESTRICTIONS']._serialized_end=38927 - _globals['_DISCONNECTREQUEST']._serialized_start=38929 - _globals['_DISCONNECTREQUEST']._serialized_end=38990 - _globals['_DISCONNECTRESPONSE']._serialized_start=38992 - _globals['_DISCONNECTRESPONSE']._serialized_end=39012 - _globals['_FEERATESREQUEST']._serialized_start=39014 - _globals['_FEERATESREQUEST']._serialized_end=39121 - _globals['_FEERATESREQUEST_FEERATESSTYLE']._serialized_start=39084 - _globals['_FEERATESREQUEST_FEERATESSTYLE']._serialized_end=39121 - _globals['_FEERATESRESPONSE']._serialized_start=39124 - _globals['_FEERATESRESPONSE']._serialized_end=39408 - _globals['_FEERATESPERKB']._serialized_start=39411 - _globals['_FEERATESPERKB']._serialized_end=39878 - _globals['_FEERATESPERKBESTIMATES']._serialized_start=39881 - _globals['_FEERATESPERKBESTIMATES']._serialized_end=40031 - _globals['_FEERATESPERKW']._serialized_start=40034 - _globals['_FEERATESPERKW']._serialized_end=40501 - _globals['_FEERATESPERKWESTIMATES']._serialized_start=40504 - _globals['_FEERATESPERKWESTIMATES']._serialized_end=40654 - _globals['_FEERATESONCHAIN_FEE_ESTIMATES']._serialized_start=40657 - _globals['_FEERATESONCHAIN_FEE_ESTIMATES']._serialized_end=40940 - _globals['_FETCHINVOICEREQUEST']._serialized_start=40943 - _globals['_FETCHINVOICEREQUEST']._serialized_end=41304 - _globals['_FETCHINVOICERESPONSE']._serialized_start=41307 - _globals['_FETCHINVOICERESPONSE']._serialized_end=41461 - _globals['_FETCHINVOICECHANGES']._serialized_start=41464 - _globals['_FETCHINVOICECHANGES']._serialized_end=41722 - _globals['_FETCHINVOICENEXT_PERIOD']._serialized_start=41724 - _globals['_FETCHINVOICENEXT_PERIOD']._serialized_end=41850 - _globals['_FUNDCHANNELREQUEST']._serialized_start=41853 - _globals['_FUNDCHANNELREQUEST']._serialized_end=42360 - _globals['_FUNDCHANNELRESPONSE']._serialized_start=42363 - _globals['_FUNDCHANNELRESPONSE']._serialized_end=42592 - _globals['_FUNDCHANNELCHANNEL_TYPE']._serialized_start=42594 - _globals['_FUNDCHANNELCHANNEL_TYPE']._serialized_end=42670 - _globals['_GETROUTEREQUEST']._serialized_start=42673 - _globals['_GETROUTEREQUEST']._serialized_end=42909 - _globals['_GETROUTERESPONSE']._serialized_start=42911 - _globals['_GETROUTERESPONSE']._serialized_end=42964 - _globals['_GETROUTEROUTE']._serialized_start=42967 - _globals['_GETROUTEROUTE']._serialized_end=43164 - _globals['_GETROUTEROUTE_GETROUTEROUTESTYLE']._serialized_start=43135 - _globals['_GETROUTEROUTE_GETROUTEROUTESTYLE']._serialized_end=43164 - _globals['_LISTFORWARDSREQUEST']._serialized_start=43167 - _globals['_LISTFORWARDSREQUEST']._serialized_end=43606 - _globals['_LISTFORWARDSREQUEST_LISTFORWARDSSTATUS']._serialized_start=43411 - _globals['_LISTFORWARDSREQUEST_LISTFORWARDSSTATUS']._serialized_end=43487 - _globals['_LISTFORWARDSREQUEST_LISTFORWARDSINDEX']._serialized_start=43489 - _globals['_LISTFORWARDSREQUEST_LISTFORWARDSINDEX']._serialized_end=43534 - _globals['_LISTFORWARDSRESPONSE']._serialized_start=43608 - _globals['_LISTFORWARDSRESPONSE']._serialized_end=43675 - _globals['_LISTFORWARDSFORWARDS']._serialized_start=43678 - _globals['_LISTFORWARDSFORWARDS']._serialized_end=44376 - _globals['_LISTFORWARDSFORWARDS_LISTFORWARDSFORWARDSSTATUS']._serialized_start=44123 - _globals['_LISTFORWARDSFORWARDS_LISTFORWARDSFORWARDSSTATUS']._serialized_end=44207 - _globals['_LISTFORWARDSFORWARDS_LISTFORWARDSFORWARDSSTYLE']._serialized_start=44209 - _globals['_LISTFORWARDSFORWARDS_LISTFORWARDSFORWARDSSTYLE']._serialized_end=44257 - _globals['_LISTOFFERSREQUEST']._serialized_start=44378 - _globals['_LISTOFFERSREQUEST']._serialized_end=44475 - _globals['_LISTOFFERSRESPONSE']._serialized_start=44477 - _globals['_LISTOFFERSRESPONSE']._serialized_end=44536 - _globals['_LISTOFFERSOFFERS']._serialized_start=44539 - _globals['_LISTOFFERSOFFERS']._serialized_end=44671 - _globals['_LISTPAYSREQUEST']._serialized_start=44674 - _globals['_LISTPAYSREQUEST']._serialized_end=44893 - _globals['_LISTPAYSREQUEST_LISTPAYSSTATUS']._serialized_start=44799 - _globals['_LISTPAYSREQUEST_LISTPAYSSTATUS']._serialized_end=44854 - _globals['_LISTPAYSRESPONSE']._serialized_start=44895 - _globals['_LISTPAYSRESPONSE']._serialized_end=44946 - _globals['_LISTPAYSPAYS']._serialized_start=44949 - _globals['_LISTPAYSPAYS']._serialized_end=45588 - _globals['_LISTPAYSPAYS_LISTPAYSPAYSSTATUS']._serialized_start=45363 - _globals['_LISTPAYSPAYS_LISTPAYSPAYSSTATUS']._serialized_end=45422 - _globals['_LISTHTLCSREQUEST']._serialized_start=45590 - _globals['_LISTHTLCSREQUEST']._serialized_end=45632 - _globals['_LISTHTLCSRESPONSE']._serialized_start=45634 - _globals['_LISTHTLCSRESPONSE']._serialized_end=45689 - _globals['_LISTHTLCSHTLCS']._serialized_start=45692 - _globals['_LISTHTLCSHTLCS']._serialized_end=45957 - _globals['_LISTHTLCSHTLCS_LISTHTLCSHTLCSDIRECTION']._serialized_start=45915 - _globals['_LISTHTLCSHTLCS_LISTHTLCSHTLCSDIRECTION']._serialized_end=45957 - _globals['_OFFERREQUEST']._serialized_start=45960 - _globals['_OFFERREQUEST']._serialized_end=46409 - _globals['_OFFERRESPONSE']._serialized_start=46412 - _globals['_OFFERRESPONSE']._serialized_end=46558 - _globals['_PINGREQUEST']._serialized_start=46560 - _globals['_PINGREQUEST']._serialized_end=46649 - _globals['_PINGRESPONSE']._serialized_start=46651 - _globals['_PINGRESPONSE']._serialized_end=46681 - _globals['_SENDCUSTOMMSGREQUEST']._serialized_start=46683 - _globals['_SENDCUSTOMMSGREQUEST']._serialized_end=46735 - _globals['_SENDCUSTOMMSGRESPONSE']._serialized_start=46737 - _globals['_SENDCUSTOMMSGRESPONSE']._serialized_end=46776 - _globals['_SETCHANNELREQUEST']._serialized_start=46779 - _globals['_SETCHANNELREQUEST']._serialized_end=47077 - _globals['_SETCHANNELRESPONSE']._serialized_start=47079 - _globals['_SETCHANNELRESPONSE']._serialized_end=47142 - _globals['_SETCHANNELCHANNELS']._serialized_start=47145 - _globals['_SETCHANNELCHANNELS']._serialized_end=47603 - _globals['_SIGNINVOICEREQUEST']._serialized_start=47605 - _globals['_SIGNINVOICEREQUEST']._serialized_end=47644 - _globals['_SIGNINVOICERESPONSE']._serialized_start=47646 - _globals['_SIGNINVOICERESPONSE']._serialized_end=47683 - _globals['_SIGNMESSAGEREQUEST']._serialized_start=47685 - _globals['_SIGNMESSAGEREQUEST']._serialized_end=47722 - _globals['_SIGNMESSAGERESPONSE']._serialized_start=47724 - _globals['_SIGNMESSAGERESPONSE']._serialized_end=47794 - _globals['_WAITBLOCKHEIGHTREQUEST']._serialized_start=47796 - _globals['_WAITBLOCKHEIGHTREQUEST']._serialized_end=47875 - _globals['_WAITBLOCKHEIGHTRESPONSE']._serialized_start=47877 - _globals['_WAITBLOCKHEIGHTRESPONSE']._serialized_end=47923 - _globals['_WAITREQUEST']._serialized_start=47926 - _globals['_WAITREQUEST']._serialized_end=48175 - _globals['_WAITREQUEST_WAITSUBSYSTEM']._serialized_start=48062 - _globals['_WAITREQUEST_WAITSUBSYSTEM']._serialized_end=48119 - _globals['_WAITREQUEST_WAITINDEXNAME']._serialized_start=48121 - _globals['_WAITREQUEST_WAITINDEXNAME']._serialized_end=48175 - _globals['_WAITRESPONSE']._serialized_start=48178 - _globals['_WAITRESPONSE']._serialized_end=48405 - _globals['_WAITRESPONSE_WAITSUBSYSTEM']._serialized_start=48062 - _globals['_WAITRESPONSE_WAITSUBSYSTEM']._serialized_end=48119 - _globals['_STOPREQUEST']._serialized_start=48407 - _globals['_STOPREQUEST']._serialized_end=48420 - _globals['_STOPRESPONSE']._serialized_start=48422 - _globals['_STOPRESPONSE']._serialized_end=48535 - _globals['_STOPRESPONSE_STOPRESULT']._serialized_start=48489 - _globals['_STOPRESPONSE_STOPRESULT']._serialized_end=48524 - _globals['_PREAPPROVEKEYSENDREQUEST']._serialized_start=48538 - _globals['_PREAPPROVEKEYSENDREQUEST']._serialized_end=48705 - _globals['_PREAPPROVEKEYSENDRESPONSE']._serialized_start=48707 - _globals['_PREAPPROVEKEYSENDRESPONSE']._serialized_end=48734 - _globals['_PREAPPROVEINVOICEREQUEST']._serialized_start=48736 - _globals['_PREAPPROVEINVOICEREQUEST']._serialized_end=48794 - _globals['_PREAPPROVEINVOICERESPONSE']._serialized_start=48796 - _globals['_PREAPPROVEINVOICERESPONSE']._serialized_end=48823 - _globals['_STATICBACKUPREQUEST']._serialized_start=48825 - _globals['_STATICBACKUPREQUEST']._serialized_end=48846 - _globals['_STATICBACKUPRESPONSE']._serialized_start=48848 - _globals['_STATICBACKUPRESPONSE']._serialized_end=48883 - _globals['_BKPRLISTINCOMEREQUEST']._serialized_start=48886 - _globals['_BKPRLISTINCOMEREQUEST']._serialized_end=49037 - _globals['_BKPRLISTINCOMERESPONSE']._serialized_start=49039 - _globals['_BKPRLISTINCOMERESPONSE']._serialized_end=49120 - _globals['_BKPRLISTINCOMEINCOME_EVENTS']._serialized_start=49123 - _globals['_BKPRLISTINCOMEINCOME_EVENTS']._serialized_end=49432 - _globals['_NODE']._serialized_start=49435 - _globals['_NODE']._serialized_end=53629 + _globals['_LISTPEERSREQUEST']._serialized_start=1189 + _globals['_LISTPEERSREQUEST']._serialized_end=1359 + _globals['_LISTPEERSREQUEST_LISTPEERSLEVEL']._serialized_start=1284 + _globals['_LISTPEERSREQUEST_LISTPEERSLEVEL']._serialized_end=1342 + _globals['_LISTPEERSRESPONSE']._serialized_start=1361 + _globals['_LISTPEERSRESPONSE']._serialized_end=1416 + _globals['_LISTPEERSPEERS']._serialized_start=1419 + _globals['_LISTPEERSPEERS']._serialized_end=1689 + _globals['_LISTPEERSPEERSLOG']._serialized_start=1692 + _globals['_LISTPEERSPEERSLOG']._serialized_end=2073 + _globals['_LISTPEERSPEERSLOG_LISTPEERSPEERSLOGTYPE']._serialized_start=1903 + _globals['_LISTPEERSPEERSLOG_LISTPEERSPEERSLOGTYPE']._serialized_end=2008 + _globals['_LISTPEERSPEERSCHANNELS']._serialized_start=2076 + _globals['_LISTPEERSPEERSCHANNELS']._serialized_end=5169 + _globals['_LISTPEERSPEERSCHANNELS_LISTPEERSPEERSCHANNELSSTATE']._serialized_start=3976 + _globals['_LISTPEERSPEERSCHANNELS_LISTPEERSPEERSCHANNELSSTATE']._serialized_end=4328 + _globals['_LISTPEERSPEERSCHANNELSFEERATE']._serialized_start=5171 + _globals['_LISTPEERSPEERSCHANNELSFEERATE']._serialized_end=5232 + _globals['_LISTPEERSPEERSCHANNELSINFLIGHT']._serialized_start=5235 + _globals['_LISTPEERSPEERSCHANNELSINFLIGHT']._serialized_end=5478 + _globals['_LISTPEERSPEERSCHANNELSFUNDING']._serialized_start=5481 + _globals['_LISTPEERSPEERSCHANNELSFUNDING']._serialized_end=5764 + _globals['_LISTPEERSPEERSCHANNELSALIAS']._serialized_start=5766 + _globals['_LISTPEERSPEERSCHANNELSALIAS']._serialized_end=5857 + _globals['_LISTPEERSPEERSCHANNELSHTLCS']._serialized_start=5860 + _globals['_LISTPEERSPEERSCHANNELSHTLCS']._serialized_end=6229 + _globals['_LISTPEERSPEERSCHANNELSHTLCS_LISTPEERSPEERSCHANNELSHTLCSDIRECTION']._serialized_start=6145 + _globals['_LISTPEERSPEERSCHANNELSHTLCS_LISTPEERSPEERSCHANNELSHTLCSDIRECTION']._serialized_end=6200 + _globals['_LISTFUNDSREQUEST']._serialized_start=6231 + _globals['_LISTFUNDSREQUEST']._serialized_end=6279 + _globals['_LISTFUNDSRESPONSE']._serialized_start=6281 + _globals['_LISTFUNDSRESPONSE']._serialized_end=6382 + _globals['_LISTFUNDSOUTPUTS']._serialized_start=6385 + _globals['_LISTFUNDSOUTPUTS']._serialized_end=6772 + _globals['_LISTFUNDSOUTPUTS_LISTFUNDSOUTPUTSSTATUS']._serialized_start=6646 + _globals['_LISTFUNDSOUTPUTS_LISTFUNDSOUTPUTSSTATUS']._serialized_end=6727 + _globals['_LISTFUNDSCHANNELS']._serialized_start=6775 + _globals['_LISTFUNDSCHANNELS']._serialized_end=7074 + _globals['_SENDPAYREQUEST']._serialized_start=7077 + _globals['_SENDPAYREQUEST']._serialized_end=7520 + _globals['_SENDPAYRESPONSE']._serialized_start=7523 + _globals['_SENDPAYRESPONSE']._serialized_end=8208 + _globals['_SENDPAYRESPONSE_SENDPAYSTATUS']._serialized_start=7993 + _globals['_SENDPAYRESPONSE_SENDPAYSTATUS']._serialized_end=8035 + _globals['_SENDPAYROUTE']._serialized_start=8210 + _globals['_SENDPAYROUTE']._serialized_end=8302 + _globals['_LISTCHANNELSREQUEST']._serialized_start=8305 + _globals['_LISTCHANNELSREQUEST']._serialized_end=8452 + _globals['_LISTCHANNELSRESPONSE']._serialized_start=8454 + _globals['_LISTCHANNELSRESPONSE']._serialized_end=8521 + _globals['_LISTCHANNELSCHANNELS']._serialized_start=8524 + _globals['_LISTCHANNELSCHANNELS']._serialized_end=8959 + _globals['_ADDGOSSIPREQUEST']._serialized_start=8961 + _globals['_ADDGOSSIPREQUEST']._serialized_end=8996 + _globals['_ADDGOSSIPRESPONSE']._serialized_start=8998 + _globals['_ADDGOSSIPRESPONSE']._serialized_end=9017 + _globals['_AUTOCLEANINVOICEREQUEST']._serialized_start=9019 + _globals['_AUTOCLEANINVOICEREQUEST']._serialized_end=9130 + _globals['_AUTOCLEANINVOICERESPONSE']._serialized_start=9133 + _globals['_AUTOCLEANINVOICERESPONSE']._serialized_end=9262 + _globals['_CHECKMESSAGEREQUEST']._serialized_start=9264 + _globals['_CHECKMESSAGEREQUEST']._serialized_end=9349 + _globals['_CHECKMESSAGERESPONSE']._serialized_start=9351 + _globals['_CHECKMESSAGERESPONSE']._serialized_end=9407 + _globals['_CLOSEREQUEST']._serialized_start=9410 + _globals['_CLOSEREQUEST']._serialized_end=9741 + _globals['_CLOSERESPONSE']._serialized_start=9744 + _globals['_CLOSERESPONSE']._serialized_end=9915 + _globals['_CLOSERESPONSE_CLOSETYPE']._serialized_start=9846 + _globals['_CLOSERESPONSE_CLOSETYPE']._serialized_end=9899 + _globals['_CONNECTREQUEST']._serialized_start=9917 + _globals['_CONNECTREQUEST']._serialized_end=10001 + _globals['_CONNECTRESPONSE']._serialized_start=10004 + _globals['_CONNECTRESPONSE']._serialized_end=10184 + _globals['_CONNECTRESPONSE_CONNECTDIRECTION']._serialized_start=10149 + _globals['_CONNECTRESPONSE_CONNECTDIRECTION']._serialized_end=10184 + _globals['_CONNECTADDRESS']._serialized_start=10187 + _globals['_CONNECTADDRESS']._serialized_end=10438 + _globals['_CONNECTADDRESS_CONNECTADDRESSTYPE']._serialized_start=10326 + _globals['_CONNECTADDRESS_CONNECTADDRESSTYPE']._serialized_end=10406 + _globals['_CREATEINVOICEREQUEST']._serialized_start=10440 + _globals['_CREATEINVOICEREQUEST']._serialized_end=10499 + _globals['_CREATEINVOICERESPONSE']._serialized_start=10502 + _globals['_CREATEINVOICERESPONSE']._serialized_end=11268 + _globals['_CREATEINVOICERESPONSE_CREATEINVOICESTATUS']._serialized_start=11025 + _globals['_CREATEINVOICERESPONSE_CREATEINVOICESTATUS']._serialized_end=11081 + _globals['_CREATEINVOICEPAID_OUTPOINT']._serialized_start=11270 + _globals['_CREATEINVOICEPAID_OUTPOINT']._serialized_end=11358 + _globals['_DATASTOREREQUEST']._serialized_start=11361 + _globals['_DATASTOREREQUEST']._serialized_end=11669 + _globals['_DATASTOREREQUEST_DATASTOREMODE']._serialized_start=11514 + _globals['_DATASTOREREQUEST_DATASTOREMODE']._serialized_end=11626 + _globals['_DATASTORERESPONSE']._serialized_start=11672 + _globals['_DATASTORERESPONSE']._serialized_end=11802 + _globals['_DATASTOREUSAGEREQUEST']._serialized_start=11804 + _globals['_DATASTOREUSAGEREQUEST']._serialized_end=11827 + _globals['_DATASTOREUSAGERESPONSE']._serialized_start=11829 + _globals['_DATASTOREUSAGERESPONSE']._serialized_end=11936 + _globals['_DATASTOREUSAGEDATASTOREUSAGE']._serialized_start=11938 + _globals['_DATASTOREUSAGEDATASTOREUSAGE']._serialized_end=12036 + _globals['_CREATEONIONREQUEST']._serialized_start=12039 + _globals['_CREATEONIONREQUEST']._serialized_end=12196 + _globals['_CREATEONIONRESPONSE']._serialized_start=12198 + _globals['_CREATEONIONRESPONSE']._serialized_end=12258 + _globals['_CREATEONIONHOPS']._serialized_start=12260 + _globals['_CREATEONIONHOPS']._serialized_end=12310 + _globals['_DELDATASTOREREQUEST']._serialized_start=12312 + _globals['_DELDATASTOREREQUEST']._serialized_end=12386 + _globals['_DELDATASTORERESPONSE']._serialized_start=12389 + _globals['_DELDATASTORERESPONSE']._serialized_end=12522 + _globals['_DELEXPIREDINVOICEREQUEST']._serialized_start=12524 + _globals['_DELEXPIREDINVOICEREQUEST']._serialized_end=12596 + _globals['_DELEXPIREDINVOICERESPONSE']._serialized_start=12598 + _globals['_DELEXPIREDINVOICERESPONSE']._serialized_end=12625 + _globals['_DELINVOICEREQUEST']._serialized_start=12628 + _globals['_DELINVOICEREQUEST']._serialized_end=12810 + _globals['_DELINVOICEREQUEST_DELINVOICESTATUS']._serialized_start=12744 + _globals['_DELINVOICEREQUEST_DELINVOICESTATUS']._serialized_end=12797 + _globals['_DELINVOICERESPONSE']._serialized_start=12813 + _globals['_DELINVOICERESPONSE']._serialized_end=13358 + _globals['_DELINVOICERESPONSE_DELINVOICESTATUS']._serialized_start=12744 + _globals['_DELINVOICERESPONSE_DELINVOICESTATUS']._serialized_end=12797 + _globals['_INVOICEREQUEST']._serialized_start=13361 + _globals['_INVOICEREQUEST']._serialized_end=13611 + _globals['_INVOICERESPONSE']._serialized_start=13614 + _globals['_INVOICERESPONSE']._serialized_end=14019 + _globals['_LISTDATASTOREREQUEST']._serialized_start=14021 + _globals['_LISTDATASTOREREQUEST']._serialized_end=14056 + _globals['_LISTDATASTORERESPONSE']._serialized_start=14058 + _globals['_LISTDATASTORERESPONSE']._serialized_end=14129 + _globals['_LISTDATASTOREDATASTORE']._serialized_start=14132 + _globals['_LISTDATASTOREDATASTORE']._serialized_end=14267 + _globals['_LISTINVOICESREQUEST']._serialized_start=14270 + _globals['_LISTINVOICESREQUEST']._serialized_end=14620 + _globals['_LISTINVOICESREQUEST_LISTINVOICESINDEX']._serialized_start=14491 + _globals['_LISTINVOICESREQUEST_LISTINVOICESINDEX']._serialized_end=14536 + _globals['_LISTINVOICESRESPONSE']._serialized_start=14622 + _globals['_LISTINVOICESRESPONSE']._serialized_end=14689 + _globals['_LISTINVOICESINVOICES']._serialized_start=14692 + _globals['_LISTINVOICESINVOICES']._serialized_end=15544 + _globals['_LISTINVOICESINVOICES_LISTINVOICESINVOICESSTATUS']._serialized_start=15260 + _globals['_LISTINVOICESINVOICES_LISTINVOICESINVOICESSTATUS']._serialized_end=15323 + _globals['_LISTINVOICESINVOICESPAID_OUTPOINT']._serialized_start=15546 + _globals['_LISTINVOICESINVOICESPAID_OUTPOINT']._serialized_end=15641 + _globals['_SENDONIONREQUEST']._serialized_start=15644 + _globals['_SENDONIONREQUEST']._serialized_end=16080 + _globals['_SENDONIONRESPONSE']._serialized_start=16083 + _globals['_SENDONIONRESPONSE']._serialized_end=16698 + _globals['_SENDONIONRESPONSE_SENDONIONSTATUS']._serialized_start=16510 + _globals['_SENDONIONRESPONSE_SENDONIONSTATUS']._serialized_end=16554 + _globals['_SENDONIONFIRST_HOP']._serialized_start=16700 + _globals['_SENDONIONFIRST_HOP']._serialized_end=16781 + _globals['_LISTSENDPAYSREQUEST']._serialized_start=16784 + _globals['_LISTSENDPAYSREQUEST']._serialized_end=17200 + _globals['_LISTSENDPAYSREQUEST_LISTSENDPAYSSTATUS']._serialized_start=17025 + _globals['_LISTSENDPAYSREQUEST_LISTSENDPAYSSTATUS']._serialized_end=17084 + _globals['_LISTSENDPAYSREQUEST_LISTSENDPAYSINDEX']._serialized_start=17086 + _globals['_LISTSENDPAYSREQUEST_LISTSENDPAYSINDEX']._serialized_end=17131 + _globals['_LISTSENDPAYSRESPONSE']._serialized_start=17202 + _globals['_LISTSENDPAYSRESPONSE']._serialized_end=17269 + _globals['_LISTSENDPAYSPAYMENTS']._serialized_start=17272 + _globals['_LISTSENDPAYSPAYMENTS']._serialized_end=17992 + _globals['_LISTSENDPAYSPAYMENTS_LISTSENDPAYSPAYMENTSSTATUS']._serialized_start=17762 + _globals['_LISTSENDPAYSPAYMENTS_LISTSENDPAYSPAYMENTSSTATUS']._serialized_end=17829 + _globals['_LISTTRANSACTIONSREQUEST']._serialized_start=17994 + _globals['_LISTTRANSACTIONSREQUEST']._serialized_end=18019 + _globals['_LISTTRANSACTIONSRESPONSE']._serialized_start=18021 + _globals['_LISTTRANSACTIONSRESPONSE']._serialized_end=18104 + _globals['_LISTTRANSACTIONSTRANSACTIONS']._serialized_start=18107 + _globals['_LISTTRANSACTIONSTRANSACTIONS']._serialized_end=18355 + _globals['_LISTTRANSACTIONSTRANSACTIONSINPUTS']._serialized_start=18357 + _globals['_LISTTRANSACTIONSTRANSACTIONSINPUTS']._serialized_end=18440 + _globals['_LISTTRANSACTIONSTRANSACTIONSOUTPUTS']._serialized_start=18442 + _globals['_LISTTRANSACTIONSTRANSACTIONSOUTPUTS']._serialized_end=18550 + _globals['_PAYREQUEST']._serialized_start=18553 + _globals['_PAYREQUEST']._serialized_end=19027 + _globals['_PAYRESPONSE']._serialized_start=19030 + _globals['_PAYRESPONSE']._serialized_end=19409 + _globals['_PAYRESPONSE_PAYSTATUS']._serialized_start=19312 + _globals['_PAYRESPONSE_PAYSTATUS']._serialized_end=19362 + _globals['_LISTNODESREQUEST']._serialized_start=19411 + _globals['_LISTNODESREQUEST']._serialized_end=19453 + _globals['_LISTNODESRESPONSE']._serialized_start=19455 + _globals['_LISTNODESRESPONSE']._serialized_end=19510 + _globals['_LISTNODESNODES']._serialized_start=19513 + _globals['_LISTNODESNODES']._serialized_end=19738 + _globals['_LISTNODESNODESADDRESSES']._serialized_start=19741 + _globals['_LISTNODESNODESADDRESSES']._serialized_end=19973 + _globals['_LISTNODESNODESADDRESSES_LISTNODESNODESADDRESSESTYPE']._serialized_start=19881 + _globals['_LISTNODESNODESADDRESSES_LISTNODESNODESADDRESSESTYPE']._serialized_end=19961 + _globals['_WAITANYINVOICEREQUEST']._serialized_start=19975 + _globals['_WAITANYINVOICEREQUEST']._serialized_end=20078 + _globals['_WAITANYINVOICERESPONSE']._serialized_start=20081 + _globals['_WAITANYINVOICERESPONSE']._serialized_end=20784 + _globals['_WAITANYINVOICERESPONSE_WAITANYINVOICESTATUS']._serialized_start=20575 + _globals['_WAITANYINVOICERESPONSE_WAITANYINVOICESTATUS']._serialized_end=20620 + _globals['_WAITANYINVOICEPAID_OUTPOINT']._serialized_start=20786 + _globals['_WAITANYINVOICEPAID_OUTPOINT']._serialized_end=20875 + _globals['_WAITINVOICEREQUEST']._serialized_start=20877 + _globals['_WAITINVOICEREQUEST']._serialized_end=20897 + _globals['_WAITINVOICERESPONSE']._serialized_start=20900 + _globals['_WAITINVOICERESPONSE']._serialized_end=21588 + _globals['_WAITINVOICERESPONSE_WAITINVOICESTATUS']._serialized_start=21382 + _globals['_WAITINVOICERESPONSE_WAITINVOICESTATUS']._serialized_end=21424 + _globals['_WAITINVOICEPAID_OUTPOINT']._serialized_start=21590 + _globals['_WAITINVOICEPAID_OUTPOINT']._serialized_end=21676 + _globals['_WAITSENDPAYREQUEST']._serialized_start=21679 + _globals['_WAITSENDPAYREQUEST']._serialized_end=21821 + _globals['_WAITSENDPAYRESPONSE']._serialized_start=21824 + _globals['_WAITSENDPAYRESPONSE']._serialized_end=22478 + _globals['_WAITSENDPAYRESPONSE_WAITSENDPAYSTATUS']._serialized_start=22284 + _globals['_WAITSENDPAYRESPONSE_WAITSENDPAYSTATUS']._serialized_end=22317 + _globals['_NEWADDRREQUEST']._serialized_start=22481 + _globals['_NEWADDRREQUEST']._serialized_end=22632 + _globals['_NEWADDRREQUEST_NEWADDRADDRESSTYPE']._serialized_start=22565 + _globals['_NEWADDRREQUEST_NEWADDRADDRESSTYPE']._serialized_end=22616 + _globals['_NEWADDRRESPONSE']._serialized_start=22634 + _globals['_NEWADDRRESPONSE']._serialized_end=22711 + _globals['_WITHDRAWREQUEST']._serialized_start=22714 + _globals['_WITHDRAWREQUEST']._serialized_end=22899 + _globals['_WITHDRAWRESPONSE']._serialized_start=22901 + _globals['_WITHDRAWRESPONSE']._serialized_end=22959 + _globals['_KEYSENDREQUEST']._serialized_start=22962 + _globals['_KEYSENDREQUEST']._serialized_end=23348 + _globals['_KEYSENDRESPONSE']._serialized_start=23351 + _globals['_KEYSENDRESPONSE']._serialized_end=23721 + _globals['_KEYSENDRESPONSE_KEYSENDSTATUS']._serialized_start=23645 + _globals['_KEYSENDRESPONSE_KEYSENDSTATUS']._serialized_end=23674 + _globals['_FUNDPSBTREQUEST']._serialized_start=23724 + _globals['_FUNDPSBTREQUEST']._serialized_end=24144 + _globals['_FUNDPSBTRESPONSE']._serialized_start=24147 + _globals['_FUNDPSBTRESPONSE']._serialized_end=24364 + _globals['_FUNDPSBTRESERVATIONS']._serialized_start=24366 + _globals['_FUNDPSBTRESERVATIONS']._serialized_end=24483 + _globals['_SENDPSBTREQUEST']._serialized_start=24485 + _globals['_SENDPSBTREQUEST']._serialized_end=24550 + _globals['_SENDPSBTRESPONSE']._serialized_start=24552 + _globals['_SENDPSBTRESPONSE']._serialized_end=24596 + _globals['_SIGNPSBTREQUEST']._serialized_start=24598 + _globals['_SIGNPSBTREQUEST']._serialized_end=24647 + _globals['_SIGNPSBTRESPONSE']._serialized_start=24649 + _globals['_SIGNPSBTRESPONSE']._serialized_end=24688 + _globals['_UTXOPSBTREQUEST']._serialized_start=24691 + _globals['_UTXOPSBTREQUEST']._serialized_end=25107 + _globals['_UTXOPSBTRESPONSE']._serialized_start=25110 + _globals['_UTXOPSBTRESPONSE']._serialized_end=25327 + _globals['_UTXOPSBTRESERVATIONS']._serialized_start=25329 + _globals['_UTXOPSBTRESERVATIONS']._serialized_end=25446 + _globals['_TXDISCARDREQUEST']._serialized_start=25448 + _globals['_TXDISCARDREQUEST']._serialized_end=25480 + _globals['_TXDISCARDRESPONSE']._serialized_start=25482 + _globals['_TXDISCARDRESPONSE']._serialized_end=25536 + _globals['_TXPREPAREREQUEST']._serialized_start=25539 + _globals['_TXPREPAREREQUEST']._serialized_end=25703 + _globals['_TXPREPARERESPONSE']._serialized_start=25705 + _globals['_TXPREPARERESPONSE']._serialized_end=25773 + _globals['_TXSENDREQUEST']._serialized_start=25775 + _globals['_TXSENDREQUEST']._serialized_end=25804 + _globals['_TXSENDRESPONSE']._serialized_start=25806 + _globals['_TXSENDRESPONSE']._serialized_end=25862 + _globals['_LISTPEERCHANNELSREQUEST']._serialized_start=25864 + _globals['_LISTPEERCHANNELSREQUEST']._serialized_end=25913 + _globals['_LISTPEERCHANNELSRESPONSE']._serialized_start=25915 + _globals['_LISTPEERCHANNELSRESPONSE']._serialized_end=25990 + _globals['_LISTPEERCHANNELSCHANNELS']._serialized_start=25993 + _globals['_LISTPEERCHANNELSCHANNELS']._serialized_end=29459 + _globals['_LISTPEERCHANNELSCHANNELS_LISTPEERCHANNELSCHANNELSSTATE']._serialized_start=28106 + _globals['_LISTPEERCHANNELSCHANNELS_LISTPEERCHANNELSCHANNELSSTATE']._serialized_end=28490 + _globals['_LISTPEERCHANNELSCHANNELSUPDATES']._serialized_start=29462 + _globals['_LISTPEERCHANNELSCHANNELSUPDATES']._serialized_end=29644 + _globals['_LISTPEERCHANNELSCHANNELSUPDATESLOCAL']._serialized_start=29647 + _globals['_LISTPEERCHANNELSCHANNELSUPDATESLOCAL']._serialized_end=30006 + _globals['_LISTPEERCHANNELSCHANNELSUPDATESREMOTE']._serialized_start=30009 + _globals['_LISTPEERCHANNELSCHANNELSUPDATESREMOTE']._serialized_end=30369 + _globals['_LISTPEERCHANNELSCHANNELSFEERATE']._serialized_start=30371 + _globals['_LISTPEERCHANNELSCHANNELSFEERATE']._serialized_end=30464 + _globals['_LISTPEERCHANNELSCHANNELSINFLIGHT']._serialized_start=30467 + _globals['_LISTPEERCHANNELSCHANNELSINFLIGHT']._serialized_end=30851 + _globals['_LISTPEERCHANNELSCHANNELSFUNDING']._serialized_start=30854 + _globals['_LISTPEERCHANNELSCHANNELSFUNDING']._serialized_end=31192 + _globals['_LISTPEERCHANNELSCHANNELSALIAS']._serialized_start=31194 + _globals['_LISTPEERCHANNELSCHANNELSALIAS']._serialized_end=31287 + _globals['_LISTPEERCHANNELSCHANNELSHTLCS']._serialized_start=31290 + _globals['_LISTPEERCHANNELSCHANNELSHTLCS']._serialized_end=31772 + _globals['_LISTPEERCHANNELSCHANNELSHTLCS_LISTPEERCHANNELSCHANNELSHTLCSDIRECTION']._serialized_start=31611 + _globals['_LISTPEERCHANNELSCHANNELSHTLCS_LISTPEERCHANNELSCHANNELSHTLCSDIRECTION']._serialized_end=31668 + _globals['_LISTCLOSEDCHANNELSREQUEST']._serialized_start=31774 + _globals['_LISTCLOSEDCHANNELSREQUEST']._serialized_end=31825 + _globals['_LISTCLOSEDCHANNELSRESPONSE']._serialized_start=31827 + _globals['_LISTCLOSEDCHANNELSRESPONSE']._serialized_end=31918 + _globals['_LISTCLOSEDCHANNELSCLOSEDCHANNELS']._serialized_start=31921 + _globals['_LISTCLOSEDCHANNELSCLOSEDCHANNELS']._serialized_end=33187 + _globals['_LISTCLOSEDCHANNELSCLOSEDCHANNELS_LISTCLOSEDCHANNELSCLOSEDCHANNELSCLOSE_CAUSE']._serialized_start=32858 + _globals['_LISTCLOSEDCHANNELSCLOSEDCHANNELS_LISTCLOSEDCHANNELSCLOSEDCHANNELSCLOSE_CAUSE']._serialized_end=32976 + _globals['_LISTCLOSEDCHANNELSCLOSEDCHANNELSALIAS']._serialized_start=33189 + _globals['_LISTCLOSEDCHANNELSCLOSEDCHANNELSALIAS']._serialized_end=33290 + _globals['_DECODEPAYREQUEST']._serialized_start=33292 + _globals['_DECODEPAYREQUEST']._serialized_end=33368 + _globals['_DECODEPAYRESPONSE']._serialized_start=33371 + _globals['_DECODEPAYRESPONSE']._serialized_end=33896 + _globals['_DECODEPAYFALLBACKS']._serialized_start=33899 + _globals['_DECODEPAYFALLBACKS']._serialized_end=34107 + _globals['_DECODEPAYFALLBACKS_DECODEPAYFALLBACKSTYPE']._serialized_start=34020 + _globals['_DECODEPAYFALLBACKS_DECODEPAYFALLBACKSTYPE']._serialized_end=34098 + _globals['_DECODEPAYEXTRA']._serialized_start=34109 + _globals['_DECODEPAYEXTRA']._serialized_end=34152 + _globals['_DECODEREQUEST']._serialized_start=34154 + _globals['_DECODEREQUEST']._serialized_end=34185 + _globals['_DECODERESPONSE']._serialized_start=34188 + _globals['_DECODERESPONSE']._serialized_end=38516 + _globals['_DECODERESPONSE_DECODETYPE']._serialized_start=36781 + _globals['_DECODERESPONSE_DECODETYPE']._serialized_end=36912 + _globals['_DECODEOFFER_PATHS']._serialized_start=38518 + _globals['_DECODEOFFER_PATHS']._serialized_end=38578 + _globals['_DECODEOFFER_RECURRENCEPAYWINDOW']._serialized_start=38581 + _globals['_DECODEOFFER_RECURRENCEPAYWINDOW']._serialized_end=38719 + _globals['_DECODEINVOICE_PATHSPATH']._serialized_start=38721 + _globals['_DECODEINVOICE_PATHSPATH']._serialized_end=38805 + _globals['_DECODEINVOICE_FALLBACKS']._serialized_start=38807 + _globals['_DECODEINVOICE_FALLBACKS']._serialized_end=38896 + _globals['_DECODEFALLBACKS']._serialized_start=38898 + _globals['_DECODEFALLBACKS']._serialized_end=39017 + _globals['_DECODEEXTRA']._serialized_start=39019 + _globals['_DECODEEXTRA']._serialized_end=39059 + _globals['_DECODERESTRICTIONS']._serialized_start=39061 + _globals['_DECODERESTRICTIONS']._serialized_end=39120 + _globals['_DISCONNECTREQUEST']._serialized_start=39122 + _globals['_DISCONNECTREQUEST']._serialized_end=39183 + _globals['_DISCONNECTRESPONSE']._serialized_start=39185 + _globals['_DISCONNECTRESPONSE']._serialized_end=39205 + _globals['_FEERATESREQUEST']._serialized_start=39207 + _globals['_FEERATESREQUEST']._serialized_end=39314 + _globals['_FEERATESREQUEST_FEERATESSTYLE']._serialized_start=39277 + _globals['_FEERATESREQUEST_FEERATESSTYLE']._serialized_end=39314 + _globals['_FEERATESRESPONSE']._serialized_start=39317 + _globals['_FEERATESRESPONSE']._serialized_end=39601 + _globals['_FEERATESPERKB']._serialized_start=39604 + _globals['_FEERATESPERKB']._serialized_end=40071 + _globals['_FEERATESPERKBESTIMATES']._serialized_start=40074 + _globals['_FEERATESPERKBESTIMATES']._serialized_end=40224 + _globals['_FEERATESPERKW']._serialized_start=40227 + _globals['_FEERATESPERKW']._serialized_end=40694 + _globals['_FEERATESPERKWESTIMATES']._serialized_start=40697 + _globals['_FEERATESPERKWESTIMATES']._serialized_end=40847 + _globals['_FEERATESONCHAIN_FEE_ESTIMATES']._serialized_start=40850 + _globals['_FEERATESONCHAIN_FEE_ESTIMATES']._serialized_end=41133 + _globals['_FETCHINVOICEREQUEST']._serialized_start=41136 + _globals['_FETCHINVOICEREQUEST']._serialized_end=41497 + _globals['_FETCHINVOICERESPONSE']._serialized_start=41500 + _globals['_FETCHINVOICERESPONSE']._serialized_end=41654 + _globals['_FETCHINVOICECHANGES']._serialized_start=41657 + _globals['_FETCHINVOICECHANGES']._serialized_end=41915 + _globals['_FETCHINVOICENEXT_PERIOD']._serialized_start=41917 + _globals['_FETCHINVOICENEXT_PERIOD']._serialized_end=42043 + _globals['_FUNDCHANNELREQUEST']._serialized_start=42046 + _globals['_FUNDCHANNELREQUEST']._serialized_end=42553 + _globals['_FUNDCHANNELRESPONSE']._serialized_start=42556 + _globals['_FUNDCHANNELRESPONSE']._serialized_end=42785 + _globals['_FUNDCHANNELCHANNEL_TYPE']._serialized_start=42787 + _globals['_FUNDCHANNELCHANNEL_TYPE']._serialized_end=42863 + _globals['_GETROUTEREQUEST']._serialized_start=42866 + _globals['_GETROUTEREQUEST']._serialized_end=43102 + _globals['_GETROUTERESPONSE']._serialized_start=43104 + _globals['_GETROUTERESPONSE']._serialized_end=43157 + _globals['_GETROUTEROUTE']._serialized_start=43160 + _globals['_GETROUTEROUTE']._serialized_end=43357 + _globals['_GETROUTEROUTE_GETROUTEROUTESTYLE']._serialized_start=43328 + _globals['_GETROUTEROUTE_GETROUTEROUTESTYLE']._serialized_end=43357 + _globals['_LISTFORWARDSREQUEST']._serialized_start=43360 + _globals['_LISTFORWARDSREQUEST']._serialized_end=43799 + _globals['_LISTFORWARDSREQUEST_LISTFORWARDSSTATUS']._serialized_start=43604 + _globals['_LISTFORWARDSREQUEST_LISTFORWARDSSTATUS']._serialized_end=43680 + _globals['_LISTFORWARDSREQUEST_LISTFORWARDSINDEX']._serialized_start=43682 + _globals['_LISTFORWARDSREQUEST_LISTFORWARDSINDEX']._serialized_end=43727 + _globals['_LISTFORWARDSRESPONSE']._serialized_start=43801 + _globals['_LISTFORWARDSRESPONSE']._serialized_end=43868 + _globals['_LISTFORWARDSFORWARDS']._serialized_start=43871 + _globals['_LISTFORWARDSFORWARDS']._serialized_end=44569 + _globals['_LISTFORWARDSFORWARDS_LISTFORWARDSFORWARDSSTATUS']._serialized_start=44316 + _globals['_LISTFORWARDSFORWARDS_LISTFORWARDSFORWARDSSTATUS']._serialized_end=44400 + _globals['_LISTFORWARDSFORWARDS_LISTFORWARDSFORWARDSSTYLE']._serialized_start=44402 + _globals['_LISTFORWARDSFORWARDS_LISTFORWARDSFORWARDSSTYLE']._serialized_end=44450 + _globals['_LISTOFFERSREQUEST']._serialized_start=44571 + _globals['_LISTOFFERSREQUEST']._serialized_end=44668 + _globals['_LISTOFFERSRESPONSE']._serialized_start=44670 + _globals['_LISTOFFERSRESPONSE']._serialized_end=44729 + _globals['_LISTOFFERSOFFERS']._serialized_start=44732 + _globals['_LISTOFFERSOFFERS']._serialized_end=44864 + _globals['_LISTPAYSREQUEST']._serialized_start=44867 + _globals['_LISTPAYSREQUEST']._serialized_end=45086 + _globals['_LISTPAYSREQUEST_LISTPAYSSTATUS']._serialized_start=44992 + _globals['_LISTPAYSREQUEST_LISTPAYSSTATUS']._serialized_end=45047 + _globals['_LISTPAYSRESPONSE']._serialized_start=45088 + _globals['_LISTPAYSRESPONSE']._serialized_end=45139 + _globals['_LISTPAYSPAYS']._serialized_start=45142 + _globals['_LISTPAYSPAYS']._serialized_end=45781 + _globals['_LISTPAYSPAYS_LISTPAYSPAYSSTATUS']._serialized_start=45556 + _globals['_LISTPAYSPAYS_LISTPAYSPAYSSTATUS']._serialized_end=45615 + _globals['_LISTHTLCSREQUEST']._serialized_start=45783 + _globals['_LISTHTLCSREQUEST']._serialized_end=45825 + _globals['_LISTHTLCSRESPONSE']._serialized_start=45827 + _globals['_LISTHTLCSRESPONSE']._serialized_end=45882 + _globals['_LISTHTLCSHTLCS']._serialized_start=45885 + _globals['_LISTHTLCSHTLCS']._serialized_end=46150 + _globals['_LISTHTLCSHTLCS_LISTHTLCSHTLCSDIRECTION']._serialized_start=46108 + _globals['_LISTHTLCSHTLCS_LISTHTLCSHTLCSDIRECTION']._serialized_end=46150 + _globals['_OFFERREQUEST']._serialized_start=46153 + _globals['_OFFERREQUEST']._serialized_end=46602 + _globals['_OFFERRESPONSE']._serialized_start=46605 + _globals['_OFFERRESPONSE']._serialized_end=46751 + _globals['_PINGREQUEST']._serialized_start=46753 + _globals['_PINGREQUEST']._serialized_end=46842 + _globals['_PINGRESPONSE']._serialized_start=46844 + _globals['_PINGRESPONSE']._serialized_end=46874 + _globals['_SENDCUSTOMMSGREQUEST']._serialized_start=46876 + _globals['_SENDCUSTOMMSGREQUEST']._serialized_end=46928 + _globals['_SENDCUSTOMMSGRESPONSE']._serialized_start=46930 + _globals['_SENDCUSTOMMSGRESPONSE']._serialized_end=46969 + _globals['_SETCHANNELREQUEST']._serialized_start=46972 + _globals['_SETCHANNELREQUEST']._serialized_end=47270 + _globals['_SETCHANNELRESPONSE']._serialized_start=47272 + _globals['_SETCHANNELRESPONSE']._serialized_end=47335 + _globals['_SETCHANNELCHANNELS']._serialized_start=47338 + _globals['_SETCHANNELCHANNELS']._serialized_end=47796 + _globals['_SIGNINVOICEREQUEST']._serialized_start=47798 + _globals['_SIGNINVOICEREQUEST']._serialized_end=47837 + _globals['_SIGNINVOICERESPONSE']._serialized_start=47839 + _globals['_SIGNINVOICERESPONSE']._serialized_end=47876 + _globals['_SIGNMESSAGEREQUEST']._serialized_start=47878 + _globals['_SIGNMESSAGEREQUEST']._serialized_end=47915 + _globals['_SIGNMESSAGERESPONSE']._serialized_start=47917 + _globals['_SIGNMESSAGERESPONSE']._serialized_end=47987 + _globals['_WAITBLOCKHEIGHTREQUEST']._serialized_start=47989 + _globals['_WAITBLOCKHEIGHTREQUEST']._serialized_end=48068 + _globals['_WAITBLOCKHEIGHTRESPONSE']._serialized_start=48070 + _globals['_WAITBLOCKHEIGHTRESPONSE']._serialized_end=48116 + _globals['_WAITREQUEST']._serialized_start=48119 + _globals['_WAITREQUEST']._serialized_end=48368 + _globals['_WAITREQUEST_WAITSUBSYSTEM']._serialized_start=48255 + _globals['_WAITREQUEST_WAITSUBSYSTEM']._serialized_end=48312 + _globals['_WAITREQUEST_WAITINDEXNAME']._serialized_start=48314 + _globals['_WAITREQUEST_WAITINDEXNAME']._serialized_end=48368 + _globals['_WAITRESPONSE']._serialized_start=48371 + _globals['_WAITRESPONSE']._serialized_end=48598 + _globals['_WAITRESPONSE_WAITSUBSYSTEM']._serialized_start=48255 + _globals['_WAITRESPONSE_WAITSUBSYSTEM']._serialized_end=48312 + _globals['_STOPREQUEST']._serialized_start=48600 + _globals['_STOPREQUEST']._serialized_end=48613 + _globals['_STOPRESPONSE']._serialized_start=48615 + _globals['_STOPRESPONSE']._serialized_end=48728 + _globals['_STOPRESPONSE_STOPRESULT']._serialized_start=48682 + _globals['_STOPRESPONSE_STOPRESULT']._serialized_end=48717 + _globals['_PREAPPROVEKEYSENDREQUEST']._serialized_start=48731 + _globals['_PREAPPROVEKEYSENDREQUEST']._serialized_end=48898 + _globals['_PREAPPROVEKEYSENDRESPONSE']._serialized_start=48900 + _globals['_PREAPPROVEKEYSENDRESPONSE']._serialized_end=48927 + _globals['_PREAPPROVEINVOICEREQUEST']._serialized_start=48929 + _globals['_PREAPPROVEINVOICEREQUEST']._serialized_end=48987 + _globals['_PREAPPROVEINVOICERESPONSE']._serialized_start=48989 + _globals['_PREAPPROVEINVOICERESPONSE']._serialized_end=49016 + _globals['_STATICBACKUPREQUEST']._serialized_start=49018 + _globals['_STATICBACKUPREQUEST']._serialized_end=49039 + _globals['_STATICBACKUPRESPONSE']._serialized_start=49041 + _globals['_STATICBACKUPRESPONSE']._serialized_end=49076 + _globals['_BKPRLISTINCOMEREQUEST']._serialized_start=49079 + _globals['_BKPRLISTINCOMEREQUEST']._serialized_end=49230 + _globals['_BKPRLISTINCOMERESPONSE']._serialized_start=49232 + _globals['_BKPRLISTINCOMERESPONSE']._serialized_end=49313 + _globals['_BKPRLISTINCOMEINCOME_EVENTS']._serialized_start=49316 + _globals['_BKPRLISTINCOMEINCOME_EVENTS']._serialized_end=49625 + _globals['_NODE']._serialized_start=49628 + _globals['_NODE']._serialized_end=53822 # @@protoc_insertion_point(module_scope) diff --git a/doc/schemas/addgossip.request.json b/doc/schemas/addgossip.request.json index 5729e2fa2e96..31ce283c1f39 100644 --- a/doc/schemas/addgossip.request.json +++ b/doc/schemas/addgossip.request.json @@ -8,7 +8,7 @@ "properties": { "message": { "type": "hex", - "description": "The raw, hex-encoded, gossip message to add to the local gossip view." + "description": "The raw, hex-encoded, gossip message to add to the local gossip view" } } } diff --git a/doc/schemas/addpsbtoutput.request.json b/doc/schemas/addpsbtoutput.request.json index 5f63a7a5df54..7f12b858d583 100644 --- a/doc/schemas/addpsbtoutput.request.json +++ b/doc/schemas/addpsbtoutput.request.json @@ -8,17 +8,20 @@ "added": "v23.11", "properties": { "satoshi": { - "type": "msat" - }, - "locktime": { - "type": "u32" + "type": "msat", + "description": "the satoshi value of the output. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" }, "initialpsbt": { "type": "string", - "description": "the (optional) base 64 encoded PSBT to begin with. If not specified, one will be generated automatically" + "description": "base 64 encoded PSBT to add the output to. If not specified, one will be generated automatically" + }, + "locktime": { + "type": "u32", + "description": "if not set, it is set to a recent block height (if no initial psbt is specified)" }, "destination": { - "type": "string" + "type": "string", + "description": "if it is not set, an internal address is generated" } } } diff --git a/doc/schemas/autoclean-once.request.json b/doc/schemas/autoclean-once.request.json index 9cc41516273e..59cb3bcc5e42 100644 --- a/doc/schemas/autoclean-once.request.json +++ b/doc/schemas/autoclean-once.request.json @@ -17,11 +17,11 @@ "paidinvoices", "expiredinvoices" ], - "description": "What subsystem to clean" + "description": "What subsystem to clean. Currently supported subsystems are:\t* `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`).\t* `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`).\t* `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`).\t* `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`).\t* `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`).\t* `paidinvoices`: invoices which were paid (`paid` in listinvoices `status)" }, "age": { "type": "u64", - "description": "How many seconds old an entry must be to delete it" + "description": "non-zero number in seconds. How many seconds old an entry must be to delete it" } } } diff --git a/doc/schemas/autoclean-status.request.json b/doc/schemas/autoclean-status.request.json index b289de135241..75054685b8e1 100644 --- a/doc/schemas/autoclean-status.request.json +++ b/doc/schemas/autoclean-status.request.json @@ -14,7 +14,7 @@ "paidinvoices", "expiredinvoices" ], - "description": "What subsystem to ask about" + "description": "What subsystem to ask about. Currently supported subsystems are:\t* `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`).\t* `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`).\t* `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`).\t* `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`).\t* `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`).\t* `paidinvoices`: invoices which were paid (`paid` in listinvoices `status)" } } } diff --git a/doc/schemas/batching.request.json b/doc/schemas/batching.request.json index 03c794d4a92b..d4cd745ad1e7 100644 --- a/doc/schemas/batching.request.json +++ b/doc/schemas/batching.request.json @@ -8,7 +8,7 @@ "properties": { "enable": { "type": "boolean", - "description": "Whether to enable or disable transaction batching" + "description": "whether to enable or disable transaction batching. Defaults to *False*" } } } diff --git a/doc/schemas/bkpr-listincome.request.json b/doc/schemas/bkpr-listincome.request.json index 40bc91940951..5eb3146ffa15 100644 --- a/doc/schemas/bkpr-listincome.request.json +++ b/doc/schemas/bkpr-listincome.request.json @@ -7,15 +7,15 @@ "properties": { "consolidate_fees": { "type": "boolean", - "description": "A brief description about consolidate_fees" + "description": "if true, we emit a single, consolidated event for any onchain-fees for a txid and account. Otherwise, events for every update to the onchain fee calculation for this account and txid will be printed. Defaults to true. Note that this means that the events emitted are non-stable, i.e. calling **listincome** twice may result in different onchain fee events being emitted, depending on how much information we've logged for that transaction" }, "start_time": { "type": "u32", - "description": "Filters the events after the time" + "description": "UNIX timestamp (in seconds) that filters events after the provided timestamp. Defaults to zero" }, "end_time": { "type": "u32", - "description": "Filters the events up to the timestamp" + "description": "UNIX timestamp (in seconds) that filters events up to and at the provided timestamp. Defaults to max-int" } } } diff --git a/doc/schemas/checkmessage.request.json b/doc/schemas/checkmessage.request.json index df896bbf43ef..1648245f473d 100644 --- a/doc/schemas/checkmessage.request.json +++ b/doc/schemas/checkmessage.request.json @@ -9,15 +9,15 @@ "properties": { "message": { "type": "string", - "description": "Message to be checked against the signature." + "description": "Message to be checked against the signature" }, "zbase": { "type": "string", - "description": "The Zbase32 encoded signature to verify." + "description": "The Zbase32 encoded signature to verify" }, "pubkey": { "type": "pubkey", - "description": "The Zbase32 encoded signature to verify." + "description": "The Zbase32 encoded signature to verify" } } } diff --git a/doc/schemas/close.request.json b/doc/schemas/close.request.json index 1870b72f2528..5174f4e597cc 100644 --- a/doc/schemas/close.request.json +++ b/doc/schemas/close.request.json @@ -8,34 +8,34 @@ "properties": { "id": { "type": "string", - "description": "peer id, channel id or short_channel_id" + "description": "peer id, channel id or short_channel_id. If the given *id* is a peer ID (66 hex digits as a string), then it applies to the active channel of the direct peer corresponding to the given peer ID. If the given *id* is a channel ID (64 hex digits as a string, or the short channel ID *blockheight:txindex:outindex* form), then it applies to that channel" }, "unilateraltimeout": { "type": "u32", - "description": "" + "description": "if it is not zero, the command will unilaterally close the channel when that number of seconds is reached. If *unilateraltimeout* is zero, then the command will wait indefinitely until the peer is online and can negotiate a mutual close. The default is 2 days (172800 seconds)" }, "destination": { "type": "string", - "description": "" + "description": "any Bitcoin bech32 type. If it isn't specified, the default is a Core Lightning wallet address. If the peer hasn't offered the option_shutdown_anysegwit` feature, then taproot addresses (or other v1+ segwit) are not allowed. Tell your friends to upgrade!" }, "fee_negotiation_step": { "type": "string", - "description": "" + "description": "it controls how closing fee negotiation is performed assuming the peer proposes a fee that is different than our estimate. (Note that modern peers use the quick-close protocol which does not allow negotiation: see *feerange* instead)\tOn every negotiation step we must give up some amount from our proposal towards the peer's proposal. This parameter can be an integer in which case it is interpreted as number of satoshis to step at a time. Or it can be an integer followed by `%` to designate a percentage of the interval to give up. A few examples, assuming the peer proposes a closing fee of 3000 satoshi and our estimate shows it must be 4000:\t- `10`: our next proposal will be 4000-10=3990.\t- `10%`: our next proposal will be 4000-(10% of (4000-3000))=3900.\t- '1': our next proposal will be 3999. This is the most extreme case when we insist on our fee as much as possible.\t- `100%`: our next proposal will be 3000. This is the most relaxed case when we quickly accept the peer's proposal.\tThe default is `50%`" }, "wrong_funding": { "type": "outpoint", - "description": "" + "description": "it can only be specified if both sides have offered the `shutdown_wrong_funding` feature (enabled by the **experimental-shutdown-wrong-funding** option): it must be a transaction id followed by a colon then the output number. Instead of negotiating a shutdown to spend the expected funding transaction, the shutdown transaction will spend this output instead. This is only allowed if this peer opened the channel and the channel is unused: it can rescue openings which have been manually miscreated" }, "force_lease_closed": { "type": "boolean", - "description": "" + "description": "if the channel has funds leased to the peer (option_will_fund), we prevent initiation of a mutual close unless this flag is passed in. Defaults to false" }, "feerange": { "type": "array", "items": { "type": "feerate" }, - "description": "" + "description": "an optional array [ *min*, *max* ], indicating the minimum and maximum feerates to offer: the peer will obey these if it supports the quick-close protocol. *slow* and *unilateral_close* are the defaults.\tNote that the maximum fee will be capped at the final commitment transaction fee (unless the experimental anchor-outputs option is negotiated)" } } } diff --git a/doc/schemas/commando-rune.request.json b/doc/schemas/commando-rune.request.json index ed61d69fedda..0288cf9199ef 100644 --- a/doc/schemas/commando-rune.request.json +++ b/doc/schemas/commando-rune.request.json @@ -29,7 +29,7 @@ "enum": [ "readonly" ], - "description": "readonly string to indicate standard readonly restrictions." + "description": "readonly string to indicate standard readonly restrictions" } ] } diff --git a/doc/schemas/connect.request.json b/doc/schemas/connect.request.json index 48303300b487..aae9fc1f5ccb 100644 --- a/doc/schemas/connect.request.json +++ b/doc/schemas/connect.request.json @@ -8,15 +8,15 @@ "properties": { "id": { "type": "string", - "description": "" + "description": "the target node's public key. As a convenience, *id* may be of the form *id@host* or *id@host:port*. In this case, the *host* and *port* parameters must be omitted. This can fail if your C-lightning node is a fresh install that has not connected to any peers yet (your node has no gossip yet), or if the target *id* is a fresh install that has no channels yet (nobody will gossip about a node until it has one published channel)" }, "host": { "type": "string", - "description": "The hostname of the node." + "description": "the peer's hostname or IP address.\tIf *host* is not specified (or doesn't work), the connection will be attempted to an IP belonging to *id* obtained through gossip with other already connected peers.\tIf *host* begins with a `/` it is interpreted as a local path and the connection will be made to that local socket (see **bind-addr** in lightningd-config(5))" }, "port": { "type": "u16", - "description": "Port to try connecting to" + "description": "the peer's port number. If not specified, the *port* depends on the current network:\t- bitcoin **mainnet**: 9735.\t- bitcoin **testnet**: 19735.\t- bitcoin **signet**: 39735.\t- bitcoin **regtest**: 19846" } } } diff --git a/doc/schemas/createinvoice.request.json b/doc/schemas/createinvoice.request.json index 4a15268e7f0a..67cd5fe8e52f 100644 --- a/doc/schemas/createinvoice.request.json +++ b/doc/schemas/createinvoice.request.json @@ -13,8 +13,15 @@ "description": "" }, "label": { - "type": "string", - "description": "" + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "description": "a unique string or number (which is treated as a string, so `01` is different from `1`); it is never revealed to other nodes on the lightning network, but it can be used to query the status of this invoice" }, "preimage": { "type": "hex", diff --git a/doc/schemas/createonion.request.json b/doc/schemas/createonion.request.json index d027dbbd9493..1cf74cf0fa48 100644 --- a/doc/schemas/createonion.request.json +++ b/doc/schemas/createonion.request.json @@ -9,7 +9,7 @@ "properties": { "hops": { "type": "array", - "description": "", + "description": "a JSON list of dicts, each specifying a node and the payload destined for that node", "items": { "type": "object", "additionalProperties": false, @@ -19,23 +19,27 @@ ], "properties": { "pubkey": { - "type": "pubkey" + "type": "pubkey", + "description": "node pubkey" }, "payload": { - "type": "hex" + "type": "hex", + "description": "payload to be sent to the node" } } } }, "assocdata": { "type": "hex", - "description": "" + "description": "the associated data that the onion should commit to. If the onion is to be used to send a payment later it MUST match the `payment_hash` of the payment in order to be valid" }, "session_key": { - "type": "secret" + "type": "secret", + "description": "can be used to specify a secret that is used to generate the shared secrets used to encrypt the onion for each hop. It should only be used for testing or if a specific shared secret is important. If not specified it will be securely generated internally, and the shared secrets will be returned" }, "onion_size": { - "type": "u16" + "type": "u16", + "description": "a size different from the default payment onion (1300 bytes). May be used for custom protocols like trampoline routing" } } } diff --git a/doc/schemas/createrune.request.json b/doc/schemas/createrune.request.json index 00983287f449..22057e8b8ea7 100644 --- a/doc/schemas/createrune.request.json +++ b/doc/schemas/createrune.request.json @@ -26,7 +26,7 @@ "enum": [ "readonly" ], - "description": "readonly string to indicate standard readonly restrictions." + "description": "readonly string to indicate standard readonly restrictions" } ] } diff --git a/doc/schemas/datastore.request.json b/doc/schemas/datastore.request.json index d9c0a95e5925..a42c7ae2693a 100644 --- a/doc/schemas/datastore.request.json +++ b/doc/schemas/datastore.request.json @@ -7,10 +7,11 @@ ], "properties": { "key": { + "description": "a key can either have children or a value, never both: parents are created and removed automatically", "oneOf": [ { "type": "array", - "description": "key is an array of values (though a single value is treated as a one-element array), to form a heirarchy. Using the first element of the key as the plugin name (e.g. [ 'summary' ]) is recommended. A key can either have children or a value, never both: parents are created and removed automatically.", + "description": "an array of values to form a hierarchy (though a single value is treated as a one-element array). Using the first element of the key as the plugin name (e.g. `[ 'summary' ]`) is recommended", "items": { "type": "string" } @@ -22,26 +23,26 @@ }, "string": { "type": "string", - "description": "" + "description": "data to be saved in string format" }, "hex": { "type": "hex", - "description": "" + "description": "data to be saved in hex format" }, "mode": { "type": "string", + "description": "\t- `must-create`: fails if it already exists.\t- `must-replace`: fails if it doesn't already exist.\t- `create-or-replace`: never fails.\t- `must-append`: must already exist, append this to what's already there.\t- `create-or-append`: append if anything is there, otherwise create.\tDefault is `must-create`", "enum": [ "must-create", "must-replace", "create-or-replace", "must-append", "create-or-append" - ], - "description": "" + ] }, "generation": { "type": "u64", - "description": "If specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with mode “must-replace” or “must-append”." + "description": "if specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with *mode* `must-replace` or `must-append`" } } } diff --git a/doc/schemas/datastoreusage.request.json b/doc/schemas/datastoreusage.request.json index 6ff72bcb9a51..b634bbfadad8 100644 --- a/doc/schemas/datastoreusage.request.json +++ b/doc/schemas/datastoreusage.request.json @@ -9,7 +9,7 @@ "oneOf": [ { "type": "array", - "description": "key is an array of values (though a single value is treated as a one-element array). Used as the starting point to traverse the datastore.", + "description": "key is an array of values (though a single value is treated as a one-element array). Used as the starting point to traverse the datastore", "items": { "type": "string" } diff --git a/doc/schemas/decode.request.json b/doc/schemas/decode.request.json index 0dff816f24c3..d3d0a54c7a20 100644 --- a/doc/schemas/decode.request.json +++ b/doc/schemas/decode.request.json @@ -8,7 +8,8 @@ ], "properties": { "string": { - "type": "string" + "type": "string", + "description": "value to be decoded\t- a *bolt11* or *bolt12* string (optionally prefixed by `lightning:` or `LIGHTNING:`) as specified by the BOLT 11 and BOLT 12 specifications.\t- a *rune* as created by lightning-commando-rune(7).\t- an *emergency_recover* string generated by hsmtool like `lightning-hsmtool getemergencyrecover `. It holds `emergency.recover` contents and starts with `clnemerg1`" } } } diff --git a/doc/schemas/decodepay.request.json b/doc/schemas/decodepay.request.json index d4e5ae4d31d7..d89d88afe009 100644 --- a/doc/schemas/decodepay.request.json +++ b/doc/schemas/decodepay.request.json @@ -8,10 +8,12 @@ ], "properties": { "bolt11": { - "type": "string" + "type": "string", + "description": "bolt11 invoice to decode" }, "description": { - "type": "string" + "type": "string", + "description": "description of the invoice to decode" } } } diff --git a/doc/schemas/deldatastore.request.json b/doc/schemas/deldatastore.request.json index 22367461323a..cff49d001d2d 100644 --- a/doc/schemas/deldatastore.request.json +++ b/doc/schemas/deldatastore.request.json @@ -10,7 +10,7 @@ "oneOf": [ { "type": "array", - "description": "key is an array of values (though a single value is treated as a one-element array), to form a heirarchy. Using the first element of the key as the plugin name (e.g. [ 'summary' ]) is recommended. A key can either have children or a value, never both: parents are created and removed automatically.", + "description": "key is an array of values (though a single value is treated as a one-element array), to form a heirarchy. Using the first element of the key as the plugin name (e.g. [ 'summary' ]) is recommended. A key can either have children or a value, never both: parents are created and removed automatically", "items": { "type": "string" } @@ -22,7 +22,7 @@ }, "generation": { "type": "u64", - "description": "If specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with mode “must-replace” or “must-append”." + "description": "If specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with mode “must-replace” or “must-append”" } } } diff --git a/doc/schemas/delexpiredinvoice.request.json b/doc/schemas/delexpiredinvoice.request.json index 45ffc910e1ff..ba9e9ec16bb0 100644 --- a/doc/schemas/delexpiredinvoice.request.json +++ b/doc/schemas/delexpiredinvoice.request.json @@ -6,7 +6,7 @@ "properties": { "maxexpirytime": { "type": "u64", - "description": "" + "description": "invoice expiry time in seconds. If not specified then all expired invoices are deleted" } } } diff --git a/doc/schemas/delforward.request.json b/doc/schemas/delforward.request.json index 163c79909af6..037e90f94874 100644 --- a/doc/schemas/delforward.request.json +++ b/doc/schemas/delforward.request.json @@ -1,16 +1,23 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", - "required": [], + "required": [ + "in_channel", + "in_htlc_id", + "status" + ], "properties": { "in_channel": { - "type": "short_channel_id" + "type": "short_channel_id", + "description": "only the matching forwards on the given inbound channel are deleted.\tNote: for **listforwards** entries without an *in_htlc_id* entry (no longer created in v22.11, but can exist from older versions), a value of 18446744073709551615 can be used, but then it will delete *all* entries without *in_htlc_id* for this *in_channel* and *status*" }, "in_htlc_id": { - "type": "u64" + "type": "u64", + "description": "the unique HTLC id the sender gave this (not present if incoming channel was closed before ugprade to v22.11)" }, "status": { "type": "string", + "description": "the status of the forward to delete. You cannot delete forwards which have status *offered* (i.e. are currently active)", "enum": [ "settled", "local_failed", diff --git a/doc/schemas/delinvoice.request.json b/doc/schemas/delinvoice.request.json index 1e2493839159..0f2755a140af 100644 --- a/doc/schemas/delinvoice.request.json +++ b/doc/schemas/delinvoice.request.json @@ -10,17 +10,17 @@ "label": { "oneOf": [ { - "type": "string", - "description": "" + "type": "string" }, { - "type": "integer", - "description": "" + "type": "u64" } - ] + ], + "description": "label of the invoice to be deleted" }, "status": { "type": "string", + "description": "label of the invoice to be deleted. The caller should be particularly aware of the error case caused by the *status* changing just before this command is invoked!", "enum": [ "paid", "expired", @@ -28,7 +28,8 @@ ] }, "desconly": { - "type": "boolean" + "type": "boolean", + "description": "if set to True, the invoice is not deleted, but has its description removed (this can save space with very large descriptions, as would be used with lightning-invoice(7) *deschashonly*" } } } diff --git a/doc/schemas/delpay.request.json b/doc/schemas/delpay.request.json index d670094e6388..5cd3d2ebf29b 100644 --- a/doc/schemas/delpay.request.json +++ b/doc/schemas/delpay.request.json @@ -9,20 +9,23 @@ "properties": { "payment_hash": { "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" + "description": "the unique identifier of a payment" }, "status": { "type": "string", + "description": "expected status of the payment. Only deletes if the payment status matches. Deleting a `pending` payment will return an error", "enum": [ "complete", "failed" ] }, "partid": { - "type": "u64" + "type": "u64", + "description": "specific partid to delete (must be paired with *groupid*)" }, "groupid": { - "type": "u64" + "type": "u64", + "description": "specific groupid to delete (must be paired with *partid*)" } } } diff --git a/doc/schemas/disableinvoicerequest.request.json b/doc/schemas/disableinvoicerequest.request.json index 08bbe7f7b723..b7f80bb86ec1 100644 --- a/doc/schemas/disableinvoicerequest.request.json +++ b/doc/schemas/disableinvoicerequest.request.json @@ -2,13 +2,14 @@ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, + "added": "v22.11", "required": [ "invreq_id" ], "properties": { "invreq_id": { "type": "string", - "description": "" + "description": "a specific invoice can be disabled by providing the `invreq_id`, which is presented by lightning-invoicerequest(7)" } } } diff --git a/doc/schemas/disconnect.request.json b/doc/schemas/disconnect.request.json index 8714dbe089bd..257d50c12a2e 100644 --- a/doc/schemas/disconnect.request.json +++ b/doc/schemas/disconnect.request.json @@ -7,10 +7,12 @@ ], "properties": { "id": { - "type": "pubkey" + "type": "pubkey", + "description": "the public key of the peer to terminate the connection.\tIt can be discovered in the output of the listpeers command, which returns a set of peers:\t{\t\t'peers': [\t\t\t{\t\t\t'id': '0563aea81...',\t\t\t'connected': true,\t\t\t...\t\t}\t\t]\t}" }, "force": { - "type": "boolean" + "type": "boolean", + "description": "if set to True, it will disconnect even with an active channel" } } } diff --git a/doc/schemas/feerates.request.json b/doc/schemas/feerates.request.json index d4dbffe3b770..cd695a8b9cf1 100644 --- a/doc/schemas/feerates.request.json +++ b/doc/schemas/feerates.request.json @@ -8,6 +8,7 @@ "properties": { "style": { "type": "string", + "description": "\t*perkw* - provide feerate in units of satoshis per 1000 weight (e.g. the minimum fee is usually `253perkw`)\t*perkb* - provide feerate in units of satoshis per 1000 virtual bytes (eg. the minimum fee is usually `1000perkb`)", "enum": [ "perkb", "perkw" diff --git a/doc/schemas/fetchinvoice.request.json b/doc/schemas/fetchinvoice.request.json index d3f293d4ab61..dbbfb8342cad 100644 --- a/doc/schemas/fetchinvoice.request.json +++ b/doc/schemas/fetchinvoice.request.json @@ -8,35 +8,35 @@ "properties": { "offer": { "type": "string", - "description": "" + "description": "offer string to get an actual invoice that can be paid" }, "amount_msat": { "type": "msat", - "description": "amount_msat is required if the offer does not specify an amount at all, otherwise it is optional (but presumably if you set it to less than the offer, you will get an error from the issuer)." + "description": "required if the offer does not specify an amount at all, otherwise it is optional (but presumably if you set it to less than the offer, you will get an error from the issuer)" }, "quantity": { "type": "u64", - "description": "quantity is is required if the offer specifies quantity_max, otherwise it is not allowed." + "description": "required if the offer specifies quantity_max, otherwise it is not allowed" }, "recurrence_counter": { "type": "u64", - "description": "recurrence_counter is required if the offer specifies recurrence, otherwise it is not allowed. recurrence_counter should first be set to 0, and incremented for each successive invoice in a given series." + "description": "required if the offer specifies recurrence, otherwise it is not allowed. recurrence_counter should first be set to 0, and incremented for each successive invoice in a given series" }, "recurrence_start": { "type": "number", - "description": "recurrence_start is required if the offer specifies recurrence_base with start_any_period set, otherwise it is not allowed. It indicates what period number to start at." + "description": "required if the offer specifies recurrence_base with start_any_period set, otherwise it is not allowed. It indicates what period number to start at" }, "recurrence_label": { "type": "string", - "description": "recurrence_label is required if recurrence_counter is set, and otherwise is not allowed. It must be the same as prior fetchinvoice calls for the same recurrence, as it is used to link them together." + "description": "required if recurrence_counter is set, and otherwise is not allowed. It must be the same as prior fetchinvoice calls for the same recurrence, as it is used to link them together" }, "timeout": { "type": "number", - "description": "timeout is an optional timeout; if we don't get a reply before this we fail (default, 60 seconds)." + "description": "if we don't get a reply before this we fail (default, 60 seconds)" }, "payer_note": { "type": "string", - "description": "payer_note is an optional payer note to ask the issuer to include in the fetched invoice." + "description": "to ask the issuer to include in the fetched invoice" } } } diff --git a/doc/schemas/fundchannel.request.json b/doc/schemas/fundchannel.request.json index 2d8066febe37..2c8d913e1f3c 100644 --- a/doc/schemas/fundchannel.request.json +++ b/doc/schemas/fundchannel.request.json @@ -9,34 +9,43 @@ "properties": { "id": { "type": "pubkey", - "description": "id is the peer id obtained from connect." + "description": "id is the peer id obtained from connect" }, "amount": { - "type": "msat_or_all" + "type": "msat_or_all", + "description": "the amount in satoshis taken from the internal wallet to fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). The string *all* can be used to specify all available funds (or 16777215 satoshi if more is available and large channels were not negotiated with the peer). Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The value cannot be less than the dust limit, currently set to 546, nor more than 16777215 satoshi (unless large channels were negotiated with the peer)" }, "feerate": { - "type": "feerate" + "type": "feerate", + "description": "used for the opening transaction and (unless *option_anchors_zero_fee_htlc_tx* is negotiated), as initial feerate for commitment and HTLC transactions (see NOTES in lightning-feerates(7)). The default is *normal*" }, "announce": { - "type": "boolean" + "type": "boolean", + "description": "whether to announce this channel or not. An unannounced channel is considered private. Defaults to *True*" }, "minconf": { - "type": "u32" + "type": "u32", + "description": "the minimum number of confirmations that used outputs should have. Default is 1" }, "push_msat": { - "type": "msat" + "type": "msat", + "description": "the amount of millisatoshis to push to the channel peer at open. Note that this is a gift to the peer -- these satoshis are added to the initial balance of the peer at channel start and are largely unrecoverable once pushed" }, "close_to": { - "type": "string" + "type": "string", + "description": "a Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. Returns `close_to` set to closing script iff is negotiated" }, "request_amt": { - "type": "msat" + "type": "msat", + "description": "an amount of liquidity you'd like to lease from the peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*" }, "compact_lease": { - "type": "string" + "type": "string", + "description": "a compact represenation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel" }, "utxos": { "type": "array", + "description": "the utxos to be used to fund the channel, as an array of `txid:vout`", "items": { "type": "outpoint" } @@ -47,7 +56,7 @@ }, "reserve": { "type": "msat", - "description": "The amount we want the peer to maintain on its side" + "description": "the amount we want the peer to maintain on its side of the channel. Default is 1% of the funding amount. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" }, "channel_type": { "added": "v24.02", diff --git a/doc/schemas/fundchannel_cancel.request.json b/doc/schemas/fundchannel_cancel.request.json index 5f0c8f7345c2..a5f65fad3e94 100644 --- a/doc/schemas/fundchannel_cancel.request.json +++ b/doc/schemas/fundchannel_cancel.request.json @@ -8,7 +8,7 @@ "properties": { "id": { "type": "pubkey", - "description": "the node id of the remote peer with which to cancel" + "description": "node id of the remote peer with which to cancel" } } } diff --git a/doc/schemas/fundchannel_complete.request.json b/doc/schemas/fundchannel_complete.request.json index 2939acc10524..fd0bd96df51e 100644 --- a/doc/schemas/fundchannel_complete.request.json +++ b/doc/schemas/fundchannel_complete.request.json @@ -9,11 +9,11 @@ "properties": { "id": { "type": "pubkey", - "description": "id is the node id of the remote peer." + "description": "node id of the remote peer" }, "psbt": { "type": "string", - "description": "the transaction to use for funding (does not need to be signed but must be otherwise complete)" + "description": "transaction to use for funding (does not need to be signed but must be otherwise complete)" } } } diff --git a/doc/schemas/fundchannel_start.request.json b/doc/schemas/fundchannel_start.request.json index e71b8ea01dab..07cb74a0d266 100644 --- a/doc/schemas/fundchannel_start.request.json +++ b/doc/schemas/fundchannel_start.request.json @@ -9,27 +9,27 @@ "properties": { "id": { "type": "pubkey", - "description": "id is the peer id obtained from connect." + "description": "node id of the remote peer" }, "amount": { - "type": "msat_or_all", - "description": "The amount that the channel will be funded." + "type": "sat", + "description": "satoshi value that the channel will be funded at. This value MUST be accurate, otherwise the negotiated commitment transactions will not encompass the correct channel value" }, "feerate": { "type": "feerate", - "description": "Sets the feerate for the subsequent commitment transaction." + "description": "feerate for subsequent commitment transactions: see **fundchannel**. Note that this is ignored for channels with *option_anchors_zero_fee_htlc_tx* (we always use a low commitment fee for these)" }, "announce": { "type": "boolean", - "description": "Whether or not to announce the channel." + "description": "whether or not to announce this channel" }, "close_to": { "type": "string", - "description": "A bitcoin address to which the channel funds should be sent to on close." + "description": "bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. Returns `close_to` set to closing script iff is negotiated" }, "push_msat": { "type": "msat", - "description": "The amount of millisatoshis to push to the channel at open. This is a gift to the peer." + "description": "amount of millisatoshis to push to the channel peer at open. Note that this is a gift to the peer -- these satoshis are added to the initial balance of the peer at channel start and are largely unrecoverable once pushed" }, "mindepth": { "type": "u32", diff --git a/doc/schemas/fundpsbt.request.json b/doc/schemas/fundpsbt.request.json index 7752196ade17..d1baebd68d42 100644 --- a/doc/schemas/fundpsbt.request.json +++ b/doc/schemas/fundpsbt.request.json @@ -9,37 +9,46 @@ ], "properties": { "satoshi": { - "type": "msat_or_all" + "type": "msat_or_all", + "description": "the minimum satoshi value of the output(s) needed (or the string `all` meaning use all unreserved inputs). If a value, it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" }, "feerate": { - "type": "feerate" + "type": "feerate", + "description": "used for the transaction as initial feerate. The default is *normal*" }, "startweight": { - "type": "u32" + "type": "u32", + "description": "the weight of the transaction before *fundpsbt* has added any inputs" }, "minconf": { - "type": "u32" + "type": "u32", + "description": "the minimum number of confirmations that used outputs should have. Default is 1" }, "reserve": { "type": "u32", - "description": "reserve is a number: if non-zero number then reserveinputs is called (successfully, with exclusive true) on the returned PSBT for this number of blocks (default: 72)." + "description": "if not zero, then *reserveinputs* is called (successfully, with *exclusive* true) on the returned PSBT for this number of blocks. Defaults to 72 blocks if unspecified" }, "locktime": { - "type": "u32" + "type": "u32", + "description": "the locktime of the transaction. if not set, it is set to a recent block height" }, "min_witness_weight": { - "type": "u32" + "type": "u32", + "description": "minimum weight to use for a UTXO's witness. If the actual witness weight is greater than the provided minimum, the actual witness weight will be used" }, "excess_as_change": { - "type": "boolean" + "type": "boolean", + "description": "flag to add a change output for the excess sats" }, "nonwrapped": { "added": "v23.02", - "type": "boolean" + "type": "boolean", + "description": "to signal to filter out any p2sh-wrapped inputs from funding this PSBT" }, "opening_anchor_channel": { "added": "v23.08", - "type": "boolean" + "type": "boolean", + "description": "to signel that it needs emergency reserve for anchors so that we can lowball our commitment tx fees, and min-emergency-msat for reserving some sats for closing anchor channels" } } } diff --git a/doc/schemas/getroute.request.json b/doc/schemas/getroute.request.json index 1d0ee771f3eb..79f51e07bc6a 100644 --- a/doc/schemas/getroute.request.json +++ b/doc/schemas/getroute.request.json @@ -9,38 +9,38 @@ "properties": { "id": { "type": "pubkey", - "description": "" + "description": "node pubkey to find the best route for the payment" }, "amount_msat": { "type": "msat", - "description": "" + "description": "amount to send. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. The 0 value is special: it ignores any *htlc_minimum_msat* setting on channels, and simply returns a possible route (if any) which is useful for simple probing" }, "riskfactor": { "type": "u64", - "description": "" + "description": "a non-negative floating-point field controls this tradeoff; it is the annual cost of your funds being stuck (as a percentage).\tFor example, if you thought the convenience of keeping your funds liquid (not stuck) was worth 20% per annum interest, *riskfactor* would be 20.\tIf you didn't care about risk, *riskfactor* would be zero" }, "cltv": { "type": "u32", - "description": "" + "description": "cltv-blocks to spare. Default is 9" }, "fromid": { "type": "pubkey", - "description": "" + "description": "the node to start the route from. Default is this node" }, "fuzzpercent": { "type": "u32", - "description": "" + "description": "used to distort fees to provide some randomization to the route generated, but it was not properly implemented and is ignored" }, "exclude": { "type": "array", - "description": "", + "description": "a JSON array of short-channel-id/direction (e.g. ['564334x877x1/0', '564195x1292x0/1' ]) or node-id which should be excluded from consideration for routing. The default is not to exclude any channels or nodes. Note if the source or destination is excluded, the command result is undefined", "items": { "type": "string" } }, "maxhops": { "type": "u32", - "description": "" + "description": "the maximum number of channels to return. Default is 20" } } } diff --git a/doc/schemas/invoice.request.json b/doc/schemas/invoice.request.json index 62cceaeda81c..e7d5a948b46d 100644 --- a/doc/schemas/invoice.request.json +++ b/doc/schemas/invoice.request.json @@ -10,63 +10,65 @@ "properties": { "amount_msat": { "type": "msat_or_any", - "description": "" - }, - "description": { - "type": "string", - "description": "" + "description": "the string `any`, which creates an invoice that can be paid with any amount. Otherwise it is a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*" }, "label": { "oneOf": [ { - "type": "string", - "description": "" + "type": "string" }, { - "type": "integer", - "description": "" + "type": "integer" } - ] + ], + "description": "a unique string or number (which is treated as a string, so `01` is different from `1`); it is never revealed to other nodes on the lightning network, but it can be used to query the status of this invoice" + }, + "description": { + "type": "string", + "description": "a short description of purpose of payment, e.g. *1 cup of coffee*. This value is encoded into the BOLT11 invoice and is viewable by any node you send this invoice to (unless *deschashonly* is true as described below). It must be UTF-8, and cannot use *\\u* JSON escape codes" }, "expiry": { "type": "u64", - "description": "" + "description": "the time the invoice is valid for, in seconds. If no value is provided the default of 604800 (1 week) is used" }, "fallbacks": { "type": "array", - "description": "", + "description": "one or more fallback addresses to include in the invoice (in order from most-preferred to least): note that these arrays are not currently tracked to fulfill the invoice", "items": { "type": "string" } }, "preimage": { "type": "hex", - "description": "" + "description": "a 64-digit hex string to be used as payment preimage for the created invoice. By default, if unspecified, lightningd will generate a secure pseudorandom preimage seeded from an appropriate entropy source on your system. **IMPORTANT**: if you specify the *preimage*, you are responsible, to ensure appropriate care for generating using a secure pseudorandom generator seeded with sufficient entropy, and keeping the preimage secret. This parameter is an advanced feature intended for use with cutting-edge cryptographic protocols and should not be used unless explicitly needed" }, "exposeprivatechannels": { + "description": "if specified, it overrides the default route hint logic, which will use unpublished channels only if there are no published channels", "oneOf": [ { "type": "boolean", - "description": "" + "description": "if *True* unpublished channels are always considered as a route hint candidate; if *False*, never" }, { "type": "array", + "description": "array of short channel ids (or a remote alias), only those specific channels will be considered candidates, even if they are public or dead-ends", "items": { "type": "short_channel_id" } }, { - "type": "short_channel_id" + "type": "short_channel_id", + "description": "if it is a short channel id (e.g. *1x1x3*), only this specific channel will be considered candidate, even if it is public or dead-end" } ] }, "cltv": { "type": "u32", - "description": "" + "description": "if specified, sets the *min_final_cltv_expiry* for the invoice. Otherwise, it's set to the parameter **cltv-final**" }, "deschashonly": { "type": "boolean", - "description": "" + "description": "if True, then the bolt11 returned contains a hash of the *description*, rather than the *description* itself: this allows much longer descriptions, but they must be communicated via some other mechanism. Defaults to False" } } } diff --git a/doc/schemas/invoicerequest.request.json b/doc/schemas/invoicerequest.request.json index e94b190ba40a..fbade5e2a5f0 100644 --- a/doc/schemas/invoicerequest.request.json +++ b/doc/schemas/invoicerequest.request.json @@ -10,27 +10,27 @@ "properties": { "amount": { "type": "msat", - "description": "" + "description": "a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*" }, "description": { "type": "string", - "description": "" + "description": "a short description of purpose of the payment, e.g. *ATM withdrawl*. This value is encoded into the resulting `invoice_request` and is viewable by anyone you expose it to. It must be UTF-8, and cannot use *\\u* JSON escape codes" }, "issuer": { "type": "string", - "description": "" + "description": "who is issuing it (i.e. you) if appropriate" }, "label": { "type": "string", - "description": "" + "description": "an internal-use name for the offer, which can be any UTF-8 string" }, "absolute_expiry": { "type": "u64", - "description": "" + "description": "the time the offer is valid until, in seconds since the first day of 1970 UTC. If not set, the `invoice_request` remains valid (though it can be deactivated by the issuer of course). This is encoded in the `invoice_request`" }, "single_use": { "type": "boolean", - "description": "" + "description": "indicates that the `invoice_request` is only valid once; we may attempt multiple payments, but as soon as one is successful no more invoices are accepted (i.e. only one person can take the money). Defaults to True" } } } diff --git a/doc/schemas/keysend.request.json b/doc/schemas/keysend.request.json index 64e74e73c7b7..66f37cb4b42c 100644 --- a/doc/schemas/keysend.request.json +++ b/doc/schemas/keysend.request.json @@ -8,25 +8,32 @@ ], "properties": { "destination": { - "type": "pubkey" + "type": "pubkey", + "description": "the 33 byte, hex-encoded, node ID of the node that the payment should go to" }, "amount_msat": { - "type": "msat" + "type": "msat", + "description": "a whole number, or a whole number with suffix `msat` or `sat`, or a three decimal point number with suffix `sat`, or an 1 to 11 decimal point number suffixed by `btc`" }, "label": { - "type": "string" + "type": "string", + "description": "used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7)" }, "maxfeepercent": { - "type": "number" + "type": "number", + "description": "limits the money paid in fees as percentage of the total amount that is to be transferred, and defaults to *0.5*" }, "retry_for": { - "type": "u32" + "type": "u32", + "description": "until *retry_for* seconds passes, the command will keep finding routes and retrying the payment. However, a payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case. Defaults to 60 seconds" }, "maxdelay": { - "type": "u32" + "type": "u32", + "description": "number of blocks the payment may be delayed" }, "exemptfee": { - "type": "msat" + "type": "msat", + "description": "used for tiny payments which would be dominated by the fee leveraged by forwarding nodes. Setting `exemptfee` allows the `maxfeepercent` check to be skipped on fees that are smaller than *exemptfee*. Defaults to 5000 millisatoshi" }, "routehints": { "type": "array", @@ -65,7 +72,8 @@ "extratlvs": { "type": "object", "additionalProperties": true, - "required": [] + "required": [], + "description": "dictionary of additional fields to insert into the final tlv. The format is 'fieldnumber': 'hexstring'" } } } diff --git a/doc/schemas/listchannels.request.json b/doc/schemas/listchannels.request.json index 80c7344900ee..2779b0298de4 100644 --- a/doc/schemas/listchannels.request.json +++ b/doc/schemas/listchannels.request.json @@ -6,15 +6,15 @@ "properties": { "short_channel_id": { "type": "short_channel_id", - "description": "If short_channel_id is a short channel id, then only known channels with a matching short_channel_id are returned. Otherwise, it must be null." + "description": "if short_channel_id is a short channel id, then only known channels with a matching short_channel_id are returned. Otherwise, it must be null" }, "source": { "type": "pubkey", - "description": "If source is a node id, then only channels leading from that node id are returned." + "description": "if source is a node id, then only channels leading from that node id are returned" }, "destination": { "type": "pubkey", - "description": "If destination is a node id, then only channels leading to that node id are returned." + "description": "if destination is a node id, then only channels leading to that node id are returned" } } } diff --git a/doc/schemas/listclosedchannels.request.json b/doc/schemas/listclosedchannels.request.json index 2726913be3d1..eb11e66565ad 100644 --- a/doc/schemas/listclosedchannels.request.json +++ b/doc/schemas/listclosedchannels.request.json @@ -7,7 +7,7 @@ "properties": { "id": { "type": "pubkey", - "description": "If supplied, limits the channels to just the peer with the given ID, if it exists." + "description": "if no *id* is supplied, then channel data on all historical channels are given. Supplying *id* will filter the results to only match channels to that peer. Note that prior to v23.05, old peers were forgotten" } } } diff --git a/doc/schemas/listdatastore.request.json b/doc/schemas/listdatastore.request.json index fc817532724f..63ea73888b18 100644 --- a/doc/schemas/listdatastore.request.json +++ b/doc/schemas/listdatastore.request.json @@ -8,14 +8,13 @@ "oneOf": [ { "type": "array", - "description": "key is an array of values (though a single value is treated as a one-element array), to form a heirarchy. Using the first element of the key as the plugin name (e.g. [ 'summary' ]) is recommended. A key can either have children or a value, never both: parents are created and removed automatically.", + "description": "all immediate children of the *key* (or root children) are returned.\t\tUsing the first element of the key as the plugin name (e.g. `[ 'summary' ]`) is recommended.\t\tAn array of values to form a hierarchy (though a single value is treated as a one-element array)", "items": { "type": "string" } }, { - "type": "string", - "description": "" + "type": "string" } ] } diff --git a/doc/schemas/listforwards.request.json b/doc/schemas/listforwards.request.json index b5e9e6fa89d0..22c91902d2dc 100644 --- a/doc/schemas/listforwards.request.json +++ b/doc/schemas/listforwards.request.json @@ -5,6 +5,7 @@ "properties": { "status": { "type": "string", + "description": "if specified, then only the forwards with the given status are returned", "enum": [ "offered", "settled", @@ -13,10 +14,12 @@ ] }, "in_channel": { - "type": "short_channel_id" + "type": "short_channel_id", + "description": "only the matching forwards on the given inbound channel are returned" }, "out_channel": { - "type": "short_channel_id" + "type": "short_channel_id", + "description": "only the matching forwards on the given outbount channel are returned" }, "index": { "type": "string", @@ -25,17 +28,17 @@ "created", "updated" ], - "description": "" + "description": "if neither *in_channel* nor *out_channel* is specified, it controls ordering. Defaults to `created`" }, "start": { "type": "u64", "added": "v23.11", - "description": "" + "description": "if `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)" }, "limit": { "type": "u32", "added": "v23.11", - "description": "" + "description": "if `index` is specified, `limit` can be used to specify the maximum number of entries to return" } } } diff --git a/doc/schemas/listfunds.request.json b/doc/schemas/listfunds.request.json index 00faf6c658e8..cef1bb3128ee 100644 --- a/doc/schemas/listfunds.request.json +++ b/doc/schemas/listfunds.request.json @@ -6,7 +6,7 @@ "properties": { "spent": { "type": "boolean", - "description": "Should outputs that are already spent be included in the result?" + "description": "if True, then the *outputs* will include spent outputs in addition to the unspent ones. Default is False" } } } diff --git a/doc/schemas/listhtlcs.request.json b/doc/schemas/listhtlcs.request.json index df03123299a8..764e3dbc064e 100644 --- a/doc/schemas/listhtlcs.request.json +++ b/doc/schemas/listhtlcs.request.json @@ -5,7 +5,7 @@ "properties": { "id": { "type": "string", - "description": "channel id or short_channel_id" + "description": "a short channel id (e.g. 1x2x3) or full 64-byte hex channel id, it will only list htlcs for that channel (which must be known)" } } } diff --git a/doc/schemas/listinvoicerequests.request.json b/doc/schemas/listinvoicerequests.request.json index 01104b40a18f..2b22dace5708 100644 --- a/doc/schemas/listinvoicerequests.request.json +++ b/doc/schemas/listinvoicerequests.request.json @@ -7,11 +7,11 @@ "properties": { "invreq_id": { "type": "string", - "description": "" + "description": "a specific invoice can be queried by providing the `invreq_id`, which is presented by lightning-invoicerequest(7), or can be calculated from a bolt12 invoice" }, "active_only": { "type": "boolean", - "description": "" + "description": "if it is *True* then only active invoice requests are returned. Default is *False*" } } } diff --git a/doc/schemas/listinvoices.request.json b/doc/schemas/listinvoices.request.json index f40710fa7490..31afccebfa48 100644 --- a/doc/schemas/listinvoices.request.json +++ b/doc/schemas/listinvoices.request.json @@ -7,26 +7,25 @@ "label": { "oneOf": [ { - "type": "string", - "description": "" + "type": "string" }, { - "type": "integer", - "description": "" + "type": "integer" } - ] + ], + "description": "a label used a the creation of the invoice to get a specific invoice" }, "invstring": { "type": "string", - "description": "" + "description": "the string value to query a specific invoice" }, "payment_hash": { "type": "hex", - "description": "" + "description": "a payment_hash of the invoice to get the details of a specific invoice" }, "offer_id": { "type": "string", - "description": "" + "description": "a local `offer_id` the invoice was issued for a specific invoice details" }, "index": { "type": "string", @@ -35,17 +34,17 @@ "created", "updated" ], - "description": "" + "description": "if neither *in_channel* nor *out_channel* is specified, it controls ordering. Defaults to `created`" }, "start": { "type": "u64", "added": "v23.08", - "description": "" + "description": "if `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)" }, "limit": { "type": "u32", "added": "v23.08", - "description": "" + "description": "if `index` is specified, `limit` can be used to specify the maximum number of entries to return" } } } diff --git a/doc/schemas/listnodes.request.json b/doc/schemas/listnodes.request.json index c7f1eb55611f..4ea8c6322d77 100644 --- a/doc/schemas/listnodes.request.json +++ b/doc/schemas/listnodes.request.json @@ -5,7 +5,8 @@ "additionalProperties": false, "properties": { "id": { - "type": "pubkey" + "type": "pubkey", + "description": "The public key of the node to list" } } } diff --git a/doc/schemas/listpays.request.json b/doc/schemas/listpays.request.json index f313c861388b..50cdac247831 100644 --- a/doc/schemas/listpays.request.json +++ b/doc/schemas/listpays.request.json @@ -5,13 +5,16 @@ "additionalProperties": false, "properties": { "bolt11": { - "type": "string" + "type": "string", + "description": "bolt11 string to get the payment details" }, "payment_hash": { - "type": "hash" + "type": "hash", + "description": "payment hash to get the payment details" }, "status": { "type": "string", + "description": "to filter the payment by status", "enum": [ "pending", "complete", diff --git a/doc/schemas/listpeerchannels.request.json b/doc/schemas/listpeerchannels.request.json index 1027da569c80..ecd4b81063d9 100644 --- a/doc/schemas/listpeerchannels.request.json +++ b/doc/schemas/listpeerchannels.request.json @@ -7,7 +7,7 @@ "properties": { "id": { "type": "pubkey", - "description": "If supplied, limits the channels to just the peer with the given ID, if it exists." + "description": "If supplied, limits the channels to just the peer with the given ID, if it exists" } } } diff --git a/doc/schemas/listpeers.request.json b/doc/schemas/listpeers.request.json index f2b02304acd3..01f5bbe453cb 100644 --- a/doc/schemas/listpeers.request.json +++ b/doc/schemas/listpeers.request.json @@ -6,11 +6,17 @@ "properties": { "id": { "type": "pubkey", - "description": "If supplied, limits the result to just the peer with the given ID, if it exists." + "description": "if supplied, limits the result to just the peer with the given ID, if it exists" }, "level": { "type": "string", - "description": "Supplying level will show log entries related to that peer at the given log level. Valid log levels are “io”, “debug”, “info”, and “unusual”." + "description": "supplying level will show log entries related to that peer at the given log level", + "enum": [ + "io", + "debug", + "info", + "unusual" + ] } } } diff --git a/doc/schemas/listsendpays.request.json b/doc/schemas/listsendpays.request.json index a498bbc697ad..701f6a76efd9 100644 --- a/doc/schemas/listsendpays.request.json +++ b/doc/schemas/listsendpays.request.json @@ -5,10 +5,12 @@ "additionalProperties": false, "properties": { "bolt11": { - "type": "string" + "type": "string", + "description": "bolt11 invoice" }, "payment_hash": { - "type": "hash" + "type": "hash", + "description": "the hash of the payment_preimage" }, "status": { "type": "string", @@ -16,7 +18,8 @@ "pending", "complete", "failed" - ] + ], + "description": "Whether the invoice has been paid, pending, or failed" }, "index": { "type": "string", @@ -25,17 +28,17 @@ "created", "updated" ], - "description": "" + "description": "if neither bolt11 or payment_hash is specified, `index` controls ordering, by `created` (default) or `updated`" }, "start": { "type": "u64", "added": "v23.11", - "description": "" + "description": "if `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)" }, "limit": { "type": "u32", "added": "v23.11", - "description": "" + "description": "if `index` is specified, `limit` can be used to specify the maximum number of entries to return" } } } diff --git a/doc/schemas/makesecret.request.json b/doc/schemas/makesecret.request.json index 5059babd01d5..54d6fef91d11 100644 --- a/doc/schemas/makesecret.request.json +++ b/doc/schemas/makesecret.request.json @@ -6,11 +6,11 @@ "properties": { "hex": { "type": "hex", - "description": "This will be used for deriving the secret" + "description": "One of `hex` or `string` must be specified: `hex` can be any hex data" }, "string": { "type": "string", - "description": "This will be used for deriving the secret" + "description": "One of `hex` or `string` must be specified: `string` is a UTF-8 string interpreted literally" } } } diff --git a/doc/schemas/multifundchannel.request.json b/doc/schemas/multifundchannel.request.json index 7020c8a3432c..eda8445c4c4b 100644 --- a/doc/schemas/multifundchannel.request.json +++ b/doc/schemas/multifundchannel.request.json @@ -8,6 +8,7 @@ "properties": { "destinations": { "type": "array", + "description": "there must be at least one entry in *destinations*; it cannot be an empty array", "items": { "type": "object", "additionalProperties": false, @@ -17,60 +18,67 @@ ], "properties": { "id": { - "type": "string" + "type": "string", + "description": "node ID, with an optional *@host:port* appended to it in a manner understood by **connect**; see lightning-connect(7). Each entry in the *destinations* array must have a unique node *id*. If not already connected, **multifundchannel** will automatically attempt to connect to the node" }, "amount": { - "type": "msat_or_all" + "type": "msat", + "description": "amount in satoshis taken from the internal wallet to fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). The string *all* can be used to specify all available funds (or 16,777,215 satoshi if more is available and large channels were not negotiated with the peer). Otherwise it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The value cannot be less than the dust limit, currently 546 satoshi as of this writing, nor more than 16,777,215 satoshi (unless large channels were negotiated with the peer)" }, "announce": { - "type": "boolean" + "type": "boolean", + "description": "flag that indicates whether to announce the channel with this, default `true`. If set to `false`, the channel is unpublished" }, "push_msat": { - "type": "msat" + "type": "msat", + "description": "amount of millisatoshis to outright give to the node. This is a gift to the peer, and you do not get a proof-of-payment out of this" }, "close_to": { - "type": "string" + "type": "string", + "description": "bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script` Returns `close_to` set to closing script iff is negotiated" }, "request_amt": { - "type": "msat" + "type": "msat", + "description": "amount of liquidity you'd like to lease from peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*" }, "compact_lease": { - "type": "string" + "type": "string", + "description": "compact represenation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel to this destination" }, "mindepth": { - "description": "Number of confirmations required before we consider the channel active", - "type": "u32" + "type": "u32", + "description": "number of confirmations before we consider the channel active" }, "reserve": { "type": "msat", - "description": "The amount we want the peer to maintain on its side" - }, - "channel_type": { - "type": "array", - "items": { - "type": "u32" - } + "description": "amount we want the peer to maintain on its side of the channel. Default is 1% of the funding amount. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" } } } }, "feerate": { - "type": "feerate" + "type": "feerate", + "description": "feerate used for the opening transaction, and if *commitment_feerate* is not set, as initial feerate for commitment and HTLC transactions. See NOTES in lightning-feerates(7) for possible values. The default is *normal*" }, "minconf": { - "type": "u32" + "type": "integer", + "description": "minimum number of confirmations that used outputs should have. Default is 1", + "default": 1 }, "utxos": { "type": "array", "items": { - "type": "outpoint" + "type": "outpoint", + "description": "utxos to be used to fund the channel, as an array of `txid:vout`" } }, "minchannels": { - "type": "u32" + "type": "integer", + "description": "re-attempt funding as long as at least this many peers remain (must not be zero). The **multifundchannel** command will only fail if too many peers fail the funding process" }, "commitment_feerate": { - "type": "feerate" + "type": "feerate", + "description": "initial feerate for commitment and HTLC transactions. See *feerate* for valid values" } } } diff --git a/doc/schemas/newaddr.request.json b/doc/schemas/newaddr.request.json index b0eadf2c7d98..b5089932f144 100644 --- a/doc/schemas/newaddr.request.json +++ b/doc/schemas/newaddr.request.json @@ -6,6 +6,7 @@ "properties": { "addresstype": { "type": "string", + "description": "it specifies the type of address wanted; currently *bech32* (e.g. `tb1qu9j4lg5f9rgjyfhvfd905vw46eg39czmktxqgg` on bitcoin testnet or `bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej` on bitcoin mainnet), or *p2tr* taproot addresses. The special value *all* generates all known address types for the same underlying key. Defaults to *bech32* address", "enum": [ "bech32", "p2tr", diff --git a/doc/schemas/openchannel_init.request.json b/doc/schemas/openchannel_init.request.json index 8f893befa78b..56bc3916419e 100644 --- a/doc/schemas/openchannel_init.request.json +++ b/doc/schemas/openchannel_init.request.json @@ -9,31 +9,40 @@ ], "properties": { "id": { - "type": "pubkey" + "type": "pubkey", + "description": "node id of the remote peer" }, "amount": { - "type": "msat" + "type": "sat", + "description": "satoshi value that we will contribute to the channel. This value will be _added_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel" }, "initialpsbt": { - "type": "string" + "type": "string", + "description": "funded, incomplete PSBT that specifies the UTXOs and change output for our channel contribution. It can be updated, see `openchannel_update`; *initialpsbt* must have at least one input. Must have the Non-Witness UTXO (PSBT_IN_NON_WITNESS_UTXO) set for every input. An error (code 309) will be returned if this requirement is not met" }, "commitment_feerate": { - "type": "feerate" + "type": "feerate", + "description": "feerate for commitment transactions for non-anchor channels: see **fundchannel**. For anchor channels, it is ignored" }, "funding_feerate": { - "type": "feerate" + "type": "feerate", + "description": "feerate for the funding transaction. Defaults to 'opening' feerate" }, "announce": { - "type": "boolean" + "type": "boolean", + "description": "whether or not to announce this channel" }, "close_to": { - "type": "hex" + "type": "string", + "description": "bitcoin address to which the channel funds should be sent on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`" }, "request_amt": { - "type": "msat" + "type": "msat", + "description": "an amount of liquidity you'd like to lease from the peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*" }, "compact_lease": { - "type": "hex" + "type": "hex", + "description": "a compact represenation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel" }, "channel_type": { "type": "array", diff --git a/doc/schemas/pay.request.json b/doc/schemas/pay.request.json index 784035cfac3c..743d23ae5d7d 100644 --- a/doc/schemas/pay.request.json +++ b/doc/schemas/pay.request.json @@ -7,34 +7,44 @@ ], "properties": { "bolt11": { - "type": "string" + "type": "string", + "description": "bolt11 invoice, if **experimental-offers** is enabled, it can actually be a bolt12 invoice, such as one received from lightningd-fetchinvoice(7). If it does not contain an amount, *amount_msat* is required, otherwise if it is specified it must be *null*" }, "amount_msat": { - "type": "msat" + "type": "msat", + "description": "*amount_msat* is in millisatoshi precision; it can be a whole number, or a whole number with suffix *msat* or *sat*, or a three decimal point number with suffix *sat*, or an 1 to 11 decimal point number suffixed by *btc*" }, "label": { - "type": "string" + "type": "string", + "description": "it is used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7)" }, "riskfactor": { - "type": "number" + "type": "number", + "description": "the *riskfactor* is described in detail in lightning-getroute(7), and defaults to 10" }, "maxfeepercent": { - "type": "number" + "type": "number", + "description": "percentage of the amount that is to be paid. Defaults to 0.5" }, "retry_for": { - "type": "u16" + "type": "u16", + "description": "until *retry_for* seconds passes, the command will keep finding routes and retrying the payment. Defaults to 60 seconds" }, "maxdelay": { - "type": "u16" + "type": "u16", + "description": "a payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case" }, "exemptfee": { - "type": "msat" + "type": "msat", + "description": "this option can be used for tiny payments which would be dominated by the fee leveraged by forwarding nodes. Setting `exemptfee` allows the `maxfeepercent` check to be skipped on fees that are smaller than `exemptfee`. Defaults to 5000 millisatoshi" }, "localinvreqid": { - "type": "hex" + "type": "hex", + "description": "`localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7). This ensures that we only make a single payment for an offer, and that the offer is marked `used` once paid" }, "exclude": { "type": "array", + "description": "*exclude* is a JSON array of short-channel-id/direction (e.g. [ '564334x877x1/0', '564195x1292x0/1' ]) or pubkey which should be excluded from consideration for routing. The default is not to exclude any channels or nodes", "items": { "oneOf": [ { @@ -47,10 +57,12 @@ } }, "maxfee": { - "type": "msat" + "type": "msat", + "description": "*maxfee* overrides both *maxfeepercent* and *exemptfee* defaults (and if you specify *maxfee* you cannot specify either of those), and creates an absolute limit on what fee we will pay. This allows you to implement your own heuristics rather than the primitive ones used here" }, "description": { - "type": "string" + "type": "string", + "description": "it is only required for bolt11 invoices which do not contain a description themselves, but contain a description hash: in this case *description* is required. *description* is then checked against the hash inside the invoice before it will be paid" } } } diff --git a/doc/schemas/ping.request.json b/doc/schemas/ping.request.json index 31f2aefdbd7a..c5b2dae32470 100644 --- a/doc/schemas/ping.request.json +++ b/doc/schemas/ping.request.json @@ -7,13 +7,16 @@ "additionalProperties": false, "properties": { "id": { - "type": "pubkey" + "type": "pubkey", + "description": "The pubkey of the node to ping" }, "len": { - "type": "u16" + "type": "u16", + "description": "the length of the ping. Defaults to 128" }, "pongbytes": { - "type": "u16" + "type": "u16", + "description": "the length of the reply. A value of 65532 to 65535 means `don't reply`. Defaults to 128" } } } diff --git a/doc/schemas/preapproveinvoice.request.json b/doc/schemas/preapproveinvoice.request.json index 85437b9a21af..19625fc29eff 100644 --- a/doc/schemas/preapproveinvoice.request.json +++ b/doc/schemas/preapproveinvoice.request.json @@ -9,6 +9,7 @@ "properties": { "bolt11": { "type": "string", + "description": "bolt11 invoice to submit to the HSM to check", "added": "v23.02" } } diff --git a/doc/schemas/preapprovekeysend.request.json b/doc/schemas/preapprovekeysend.request.json index 53a1cb8d50f9..ee2fc3a1d034 100644 --- a/doc/schemas/preapprovekeysend.request.json +++ b/doc/schemas/preapprovekeysend.request.json @@ -11,17 +11,19 @@ "properties": { "destination": { "type": "pubkey", + "description": "it is a 33 byte, hex-encoded, node ID of the node that the payment should go to", "added": "v23.02" }, "payment_hash": { "type": "hex", "added": "v23.02", - "description": "the hash of the *payment_preimage* which will prove payment", + "description": "it is the unique identifier of a payment", "maxLength": 64, "minLength": 64 }, "amount_msat": { "type": "msat", + "description": "the amount to send in millisatoshi precision; it can be a whole number, or a whole number with suffix `msat` or `sat`, or a three decimal point number with suffix `sat`, or an 1 to 11 decimal point number suffixed by `btc`", "added": "v23.02" } } diff --git a/doc/schemas/recoverchannel.request.json b/doc/schemas/recoverchannel.request.json index ea6701bc2000..073828a5fc44 100644 --- a/doc/schemas/recoverchannel.request.json +++ b/doc/schemas/recoverchannel.request.json @@ -5,11 +5,13 @@ "required": [ "scb" ], - "scb": { - "type": "array", - "description": "SCB of the channels in an array", - "items": { - "type": "hexstr" + "properties": { + "scb": { + "type": "array", + "description": "SCB of the channels in an array", + "items": { + "type": "hexstr" + } } } } diff --git a/doc/schemas/sendcustommsg.request.json b/doc/schemas/sendcustommsg.request.json index 3a06534d4feb..6a3787debc0c 100644 --- a/doc/schemas/sendcustommsg.request.json +++ b/doc/schemas/sendcustommsg.request.json @@ -9,10 +9,12 @@ "additionalProperties": false, "properties": { "node_id": { - "type": "pubkey" + "type": "pubkey", + "description": "the node specified by `node_id` must be a peer, i.e., it must have a direct connection with the node receiving the RPC call, and the connection must be established. For a method to send arbitrary messages over multiple hops, including hops that do not understand the custom message, see the `createonion` and `sendonion` RPC methods. Messages can only be injected if the connection is handled by `openingd` or `channeld`. Messages cannot be injected when the peer is handled by `onchaind` or `closingd` since these do not have a connection, or are synchronous daemons that do not handle spontaneous messages" }, "msg": { - "type": "hex" + "type": "hex", + "description": "must be a hex encoded well-formed message, including the 2-byte type prefix, but excluding the length prefix which will be added by the RPC method. The message types may not be one of the internally handled types, since that may cause issues with the internal state tracking of Core Lightning. We do (as of *v23.11*) allow sending of even types, but note that peers (as per the spec) will disconnect on receiving unknown even types" } } } diff --git a/doc/schemas/sendonion.request.json b/doc/schemas/sendonion.request.json index 26cd99aa6ee7..35e1c4d48fdf 100644 --- a/doc/schemas/sendonion.request.json +++ b/doc/schemas/sendonion.request.json @@ -9,10 +9,12 @@ ], "properties": { "onion": { - "type": "hex" + "type": "hex", + "description": "hex-encoded 1366 bytes long blob that was returned by either of the tools that can generate onions. It contains the payloads destined for each hop and some metadata. Please refer to [BOLT 04][bolt04] for further details. If is specific to the route that is being used and the *payment_hash* used to construct, and therefore cannot be reused for other payments or to attempt a separate route. The custom onion can generally be created using the `devtools/onion` CLI tool, or the **createonion** RPC command" }, "first_hop": { "type": "object", + "description": "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*", "required": [ "id", "amount_msat", @@ -20,45 +22,62 @@ ], "properties": { "id": { - "type": "pubkey" + "type": "pubkey", + "description": "node id for the peer. Use any available channel available to this peer" }, "amount_msat": { - "type": "msat" + "type": "msat", + "description": "the amount to add an HTLC for millisatoshis" }, "delay": { - "type": "u16" + "type": "u16", + "description": "the number of blocks delay of blocks on top of the current blockheight" } } }, "payment_hash": { - "type": "hash" + "type": "hash", + "description": "specifies the 32 byte hex-encoded hash to use as a challenge to the HTLC that we are sending. It is specific to the onion and has to match the one the onion was created with" }, "label": { - "type": "string" + "type": "string", + "description": "can be used to provide a human readable reference to retrieve the payment at a later time" }, "shared_secrets": { "type": "array", + "description": "a JSON list of 32 byte hex-encoded secrets that were used when creating the onion. Core Lightning can send a payment with a custom onion without the knowledge of these secrets, however it will not be able to parse an eventual error message since that is encrypted with the shared secrets used in the onion. If *shared_secrets* is provided Core Lightning will decrypt the error, act accordingly, e.g., add a `channel_update` included in the error to its network view, and set the details in *listsendpays* correctly. If it is not provided Core Lightning will store the encrypted onion, and expose it in *listsendpays* allowing the caller to decrypt it externally. If it is not provided the Core Lightning node does not know how long the route is, which channels or nodes are involved, and what an eventual error could have been. It can therefore be used for oblivious payments", "items": { "type": "secret" } }, "partid": { - "type": "u16" + "type": "u16", + "description": "if provided and non-zero, allows for multiple parallel partial payments with the same *payment_hash*" }, "bolt11": { - "type": "string" + "type": "string", + "description": "if provided, it will be returned in *waitsendpay* and *listsendpays* results" }, "amount_msat": { - "type": "msat" + "type": "msat", + "description": "used to annotate the payment, and is returned by *waitsendpay* and *listsendpays*" }, "destination": { - "type": "pubkey" + "type": "pubkey", + "description": "if provided, it will be returned in **listpays** result" }, "localinvreqid": { - "type": "hash" + "type": "hash", + "description": "`localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7)" }, "groupid": { - "type": "u64" + "type": "u64", + "description": "grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash" + }, + "description": { + "added": "v0.11.0", + "type": "string", + "description": "if provided, it will be returned in *waitsendpay* and *listsendpays* results" } } } diff --git a/doc/schemas/sendonionmessage.request.json b/doc/schemas/sendonionmessage.request.json index 74bc5df6fec0..8498998c343d 100644 --- a/doc/schemas/sendonionmessage.request.json +++ b/doc/schemas/sendonionmessage.request.json @@ -33,7 +33,7 @@ }, "tlv": { "type": "u8", - "description": "contains a hexidecimal TLV to include" + "description": "contains a hexadecimal TLV to include" } } } diff --git a/doc/schemas/sendpay.request.json b/doc/schemas/sendpay.request.json index 67d645423ec9..b0a9ce216fe1 100644 --- a/doc/schemas/sendpay.request.json +++ b/doc/schemas/sendpay.request.json @@ -18,44 +18,66 @@ "channel" ], "properties": { - "amount_msat": { - "type": "msat" - }, "id": { - "type": "pubkey" + "type": "pubkey", + "description": "The node at the end of this hop" + }, + "channel": { + "type": "short_channel_id", + "description": "The channel joining these nodes" }, "delay": { - "type": "u16" + "type": "u32", + "description": "The total CLTV expected by the node at the end of this hop" }, - "channel": { - "type": "short_channel_id" + "amount_msat": { + "type": "msat", + "description": "The amount expected by the node at the end of this hop" } } } }, "payment_hash": { - "type": "hash" + "type": "hash", + "description": "the hash of the payment_preimage" }, "label": { - "type": "string" + "type": "string", + "description": "the label provided when creating the invoice_request" }, "amount_msat": { - "type": "msat" + "type": "msat", + "description": "amount must be provided if *partid* is non-zero, or the payment is to-self, otherwise it must be equal to the final amount to the destination. By default it is in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*" }, "bolt11": { - "type": "string" + "type": "string", + "description": "bolt11 invoice to pay. If provided, will be returned in *waitsendpay* and *listsendpays* results" }, "payment_secret": { - "type": "secret" + "type": "secret", + "description": "value that the final recipient requires to accept the payment, as defined by the `payment_data` field in BOLT 4 and the `s` field in the BOLT 11 invoice format. It is required if *partid* is non-zero" }, "partid": { - "type": "u16" + "type": "u64", + "description": "must not be provided for self-payments. If provided and non-zero, allows for multiple parallel partial payments with the same *payment_hash*. The *amount_msat* amount (which must be provided) for each **sendpay** with matching *payment_hash* must be equal, and **sendpay** will fail if there are differing values given" }, "localinvreqid": { - "type": "hex" + "type": "hex", + "description": "indicates that this payment is being made for a local invoice_request. This ensures that we only send a payment for a single-use invoice_request once" }, "groupid": { - "type": "u64" + "type": "u64", + "description": "allows you to attach a number which appears in **listsendpays** so payments can be identified as part of a logical group. The *pay* plugin uses this to identify one attempt at a MPP payment, for example" + }, + "payment_metadata": { + "added": "v0.11.0", + "type": "hex", + "description": "placed in the final onion hop TLV" + }, + "description": { + "added": "v0.11.0", + "type": "string", + "description": "description used in the invoice" } } } diff --git a/doc/schemas/sendpsbt.request.json b/doc/schemas/sendpsbt.request.json index bc55bb8308ba..e8e2f9e8d5a0 100644 --- a/doc/schemas/sendpsbt.request.json +++ b/doc/schemas/sendpsbt.request.json @@ -7,10 +7,12 @@ ], "properties": { "psbt": { - "type": "string" + "type": "string", + "description": "the fully signed psbt to be sent" }, "reserve": { - "type": "boolean" + "type": "u32", + "description": "number of blocks to increase reservation of any of our inputs by. Default is 72" } } } diff --git a/doc/schemas/setchannel.request.json b/doc/schemas/setchannel.request.json index dae031975705..c0eaad9dc50c 100644 --- a/doc/schemas/setchannel.request.json +++ b/doc/schemas/setchannel.request.json @@ -7,26 +7,33 @@ ], "properties": { "id": { - "type": "string" + "type": "string", + "description": "should contain a scid (short channel ID), channel id or peerid (pubkey) of the channel to be modified. If *id* is set to `all`, the updates are applied to all channels in states CHANNELD_NORMAL CHANNELD_AWAITING_LOCKIN or DUALOPEND_AWAITING_LOCKIN. If *id* is a peerid, all channels with the +peer in those states are changed" }, "feebase": { - "type": "msat" + "type": "msat", + "description": "value in millisatoshi that is added as base fee to any routed payment: if omitted, it is unchanged. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*" }, "feeppm": { - "type": "u32" + "type": "u32", + "description": "value that is added proportionally per-millionths to any routed payment volume in satoshi. For example, if ppm is 1,000 and 1,000,000 satoshi is being routed through the channel, an proportional fee of 1,000 satoshi is added, resulting in a 0.1% fee" }, "htlcmin": { - "type": "msat" + "type": "msat", + "description": "value that limits how small an HTLC we will forward: if omitted, it is unchanged (the default is no lower limit). It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. Note that the peer also enforces a minimum for the channel: setting it below that will simply set it to that value with a warning. Also note that *htlcmin* only applies to forwarded HTLCs: we can still send smaller payments ourselves" }, "htlcmax": { - "type": "msat" + "type": "msat", + "description": "value that limits how large an HTLC we will forward: if omitted, it is unchanged (the default is no effective limit). It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. Note that *htlcmax* only applies to forwarded HTLCs: we can still send larger payments ourselves" }, "enforcedelay": { - "type": "u32" + "type": "u32", + "description": "number of seconds to delay before enforcing the new fees/htlc max (default 600, which is ten minutes). This gives the network a chance to catch up with the new rates and avoids rejecting HTLCs before they do. This only has an effect if rates are increased (we always allow users to overpay fees) or *htlcmax* is decreased, and only applied to a single rate increase per channel (we don't remember an arbitrary number of prior feerates) and if the node is restarted the updated configuration is enforced immediately" }, "ignorefeelimits": { "added": "v23.08", - "type": "boolean" + "type": "boolean", + "description": "if set to True means to allow the peer to set the commitment transaction fees (or closing transaction fees) to any value they want. This is dangerous: they could set an exorbitant fee (so HTLCs are unenforcable), or a tiny fee (so that commitment transactions cannot be relayed), but avoids channel breakage in case of feerate disagreements. (Note: the global `ignore_fee_limits` setting overrides this)" } } } diff --git a/doc/schemas/setconfig.request.json b/doc/schemas/setconfig.request.json index 7dd24fc1b151..f01feeeabdc2 100644 --- a/doc/schemas/setconfig.request.json +++ b/doc/schemas/setconfig.request.json @@ -8,8 +8,22 @@ "added": "v23.08", "properties": { "config": { - "type": "string" + "type": "string", + "description": "name of the config variable which should be set to the value of the variable" }, - "val": {} + "val": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "boolean" + } + ], + "description": "value of the config variable to be set or updated" + } } } diff --git a/doc/schemas/showrunes.request.json b/doc/schemas/showrunes.request.json index 5bc5b8fc8322..da2831ff7379 100644 --- a/doc/schemas/showrunes.request.json +++ b/doc/schemas/showrunes.request.json @@ -7,7 +7,7 @@ "properties": { "rune": { "type": "string", - "description": "optional rune to list" + "description": "if specified, only details of that rune will be returned" } } } diff --git a/doc/schemas/signinvoice.request.json b/doc/schemas/signinvoice.request.json index 40b8e3f46a55..13b948a45889 100644 --- a/doc/schemas/signinvoice.request.json +++ b/doc/schemas/signinvoice.request.json @@ -9,7 +9,7 @@ "properties": { "invstring": { "type": "string", - "description": "" + "description": "bolt11 form, but the final signature is ignored. Minimal sanity checks are done" } } } diff --git a/doc/schemas/signmessage.request.json b/doc/schemas/signmessage.request.json index 163239e207bc..9ff224c7f339 100644 --- a/doc/schemas/signmessage.request.json +++ b/doc/schemas/signmessage.request.json @@ -7,7 +7,8 @@ "additionalProperties": false, "properties": { "message": { - "type": "string" + "type": "string", + "description": "less that 65536 characters long message to be signed by the node" } } } diff --git a/doc/schemas/signpsbt.request.json b/doc/schemas/signpsbt.request.json index c8a2bbf85555..11cbe05e1778 100644 --- a/doc/schemas/signpsbt.request.json +++ b/doc/schemas/signpsbt.request.json @@ -7,10 +7,12 @@ ], "properties": { "psbt": { - "type": "string" + "type": "string", + "description": "the psbt to be signed" }, "signonly": { "type": "array", + "description": "input numbers to sign", "items": { "type": "u32" } diff --git a/doc/schemas/splice_init.request.json b/doc/schemas/splice_init.request.json index ed01150df351..01573ac1090a 100644 --- a/doc/schemas/splice_init.request.json +++ b/doc/schemas/splice_init.request.json @@ -26,7 +26,7 @@ }, "force_feerate": { "type": "boolean", - "description": "By default splices will fail if the fee provided looks too high. This is to protect against accidentally setting your fee higher than intended. Set `force_feerate` to true to skip this saftey check" + "description": "by default splices will fail if the fee provided looks too high. This is to protect against accidentally setting your fee higher than intended. Set `force_feerate` to true to skip this saftey check" } } } diff --git a/doc/schemas/splice_update.request.json b/doc/schemas/splice_update.request.json index 08bf814a49a8..1cdac8e25e39 100644 --- a/doc/schemas/splice_update.request.json +++ b/doc/schemas/splice_update.request.json @@ -14,7 +14,7 @@ }, "psbt": { "type": "string", - "description": "the (optional) base 64 encoded PSBT to begin with. If not specified, one will be generated automatically" + "description": "the base 64 encoded PSBT returned from `splice_init` with any changes added by the user" } } } diff --git a/doc/schemas/txdiscard.request.json b/doc/schemas/txdiscard.request.json index 6488647acce7..7a9e87538208 100644 --- a/doc/schemas/txdiscard.request.json +++ b/doc/schemas/txdiscard.request.json @@ -7,7 +7,8 @@ ], "properties": { "txid": { - "type": "txid" + "type": "txid", + "description": "the transaction id, inputs should be unreseverd from" } } } diff --git a/doc/schemas/txprepare.request.json b/doc/schemas/txprepare.request.json index 936c4d9e5880..da224d383ee4 100644 --- a/doc/schemas/txprepare.request.json +++ b/doc/schemas/txprepare.request.json @@ -8,18 +8,22 @@ "properties": { "outputs": { "type": "array", + "description": "format is like: [{destination1: amount1}, {destination2: amount2}] or [{destination: *all*}]. It supports any number of **confirmed** outputs", "items": { "type": "outputdesc" } }, "feerate": { - "type": "feerate" + "type": "feerate", + "description": "used for the transaction as initial feerate. The default is *normal*" }, "minconf": { - "type": "u32" + "type": "u32", + "description": "the minimum number of confirmations that used outputs should have. Default is 1" }, "utxos": { "type": "array", + "description": "to be used to fund the transaction, as an array of `txid:vout`. These must be drawn from the node's available UTXO set", "items": { "type": "outpoint" } diff --git a/doc/schemas/txsend.request.json b/doc/schemas/txsend.request.json index 6488647acce7..18ef78478ffa 100644 --- a/doc/schemas/txsend.request.json +++ b/doc/schemas/txsend.request.json @@ -7,7 +7,8 @@ ], "properties": { "txid": { - "type": "txid" + "type": "txid", + "description": "The transaction id of the transaction created by **txprepare**" } } } diff --git a/doc/schemas/utxopsbt.request.json b/doc/schemas/utxopsbt.request.json index 6a58abdfacc6..db6f3d98c663 100644 --- a/doc/schemas/utxopsbt.request.json +++ b/doc/schemas/utxopsbt.request.json @@ -10,39 +10,48 @@ ], "properties": { "satoshi": { - "type": "msat" + "type": "msat_or_all", + "description": "the minimum satoshi value of the output(s) needed (or the string `all` meaning use all unreserved inputs). If a value, it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" }, "feerate": { - "type": "feerate" + "type": "feerate", + "description": "used for the transaction as initial feerate. The default is *normal*" }, "startweight": { - "type": "u32" + "type": "u32", + "description": "the weight of the transaction before *fundpsbt* has added any inputs" }, "utxos": { "type": "array", + "description": "an array of `txid:vout`, each of which must be reserved or available", "items": { "type": "outpoint" } }, "reserve": { "type": "u32", - "description": "reserve is a number: if non-zero number then reserveinputs is called (successfully, with exclusive true) on the returned PSBT for this number of blocks (default: 72)." + "description": "if not zero, then *reserveinputs* is called (successfully, with *exclusive* true) on the returned PSBT for this number of blocks. Defaults to 72 blocks if unspecified" }, "reservedok": { - "type": "boolean" + "type": "boolean", + "description": "if set to true, it will also fail if any of the *utxos* are already reserved. Default is false" }, "locktime": { - "type": "u32" + "type": "u32", + "description": "if not set, it is set to a recent block height" }, "min_witness_weight": { - "type": "u32" + "type": "u32", + "description": "minimum weight to use for a UTXO's witness. If the actual witness weight is greater than the provided minimum, the actual witness weight will be used" }, "excess_as_change": { - "type": "boolean" + "type": "boolean", + "description": "flag to add a change output for the excess sats" }, "opening_anchor_channel": { "added": "v23.08", - "type": "boolean" + "type": "boolean", + "description": "to signel that it needs emergency reserve for anchors so that we can lowball our commitment tx fees, and min-emergency-msat for reserving some sats for closing anchor channels" } } } diff --git a/doc/schemas/wait.request.json b/doc/schemas/wait.request.json index 2febefeb16dd..e21c13d6095a 100644 --- a/doc/schemas/wait.request.json +++ b/doc/schemas/wait.request.json @@ -11,6 +11,7 @@ "properties": { "subsystem": { "type": "string", + "description": "the subsystem to get the next index value from", "enum": [ "invoices", "forwards", @@ -19,6 +20,7 @@ }, "indexname": { "type": "string", + "description": "the name of the index to get the next value for", "enum": [ "created", "updated", @@ -26,7 +28,8 @@ ] }, "nextvalue": { - "type": "u64" + "type": "u64", + "description": "the next value of the index" } } } diff --git a/doc/schemas/waitanyinvoice.request.json b/doc/schemas/waitanyinvoice.request.json index 5c9ce9867bb0..f39c0b8f3077 100644 --- a/doc/schemas/waitanyinvoice.request.json +++ b/doc/schemas/waitanyinvoice.request.json @@ -5,10 +5,12 @@ "required": [], "properties": { "lastpay_index": { - "type": "u64" + "type": "u64", + "description": "ignores any invoices paid prior to or including this index. 0 is equivalent to not specifying and negative value is invalid" }, "timeout": { - "type": "u64" + "type": "u64", + "description": "if specified, wait at most that number of seconds, which must be an integer. If the specified *timeout* is reached, this command will return with an error. You can specify this to 0 so that **waitanyinvoice** will return immediately with an error if no pending invoice is available yet. If unspecified, this command will wait indefinitely" } } } diff --git a/doc/schemas/waitblockheight.request.json b/doc/schemas/waitblockheight.request.json index d564a5628afa..3e2a1b091643 100644 --- a/doc/schemas/waitblockheight.request.json +++ b/doc/schemas/waitblockheight.request.json @@ -8,11 +8,11 @@ "properties": { "blockheight": { "type": "u32", - "description": "The current block height (>= blockheight parameter)" + "description": "current blockheight of the blockchain if the value is greater than this number. If it is a present or past block height, then the command returns immediately" }, "timeout": { "type": "u32", - "description": "If timeout seconds is reached without the specified blockheight being reached, this command will fail with a code of 2000." + "description": "only wait up to specified seconds. Defaults to 60 seconds" } } } diff --git a/doc/schemas/waitinvoice.request.json b/doc/schemas/waitinvoice.request.json index 18cc4093d54b..84eb8084a7ef 100644 --- a/doc/schemas/waitinvoice.request.json +++ b/doc/schemas/waitinvoice.request.json @@ -7,7 +7,15 @@ ], "properties": { "label": { - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "description": "unique label of the invoice waiting to be paid" } } } diff --git a/doc/schemas/waitsendpay.request.json b/doc/schemas/waitsendpay.request.json index 9e6f3942b14a..8add51b93046 100644 --- a/doc/schemas/waitsendpay.request.json +++ b/doc/schemas/waitsendpay.request.json @@ -7,16 +7,20 @@ ], "properties": { "payment_hash": { - "type": "hash" + "type": "hash", + "description": "the hash of the *payment_preimage*" }, "timeout": { - "type": "u32" + "type": "u32", + "description": "a timeout in seconds, for this RPC command to return. If the *timeout* is provided and the given amount of time passes without the payment definitely succeeding or definitely failing, this command returns with a 200 error code (payment still in progress). If *timeout* is not provided this call will wait indefinitely. Indicating a *timeout* of 0 effectively makes this call a pollable query of the status of the payment" }, "partid": { - "type": "u64" + "type": "u64", + "description": "unique ID within this (multi-part) payment. It must match that of the **sendpay** command" }, "groupid": { - "type": "u64" + "type": "u64", + "description": "grouping key to disambiguate multiple attempts to pay the same payment_hash" } } } diff --git a/doc/schemas/withdraw.request.json b/doc/schemas/withdraw.request.json index 8a43b988fa94..41311d7517f8 100644 --- a/doc/schemas/withdraw.request.json +++ b/doc/schemas/withdraw.request.json @@ -3,23 +3,29 @@ "type": "object", "additionalProperties": false, "required": [ - "destination" + "destination", + "satoshi" ], "properties": { "destination": { - "type": "string" + "type": "string", + "description": "any Bitcoin accepted type, including bech32" }, "satoshi": { - "type": "msat_or_all" + "type": "msat_or_all", + "description": "the amount to be withdrawn from the internal wallet (expressed, as name suggests, in satoshi). The string *all* can be used to specify withdrawal of all available funds (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" }, "feerate": { - "type": "feerate" + "type": "feerate", + "description": "used for the withdrawal as initial feerate. The default is *normal*" }, "minconf": { - "type": "u16" + "type": "u16", + "description": "minimum number of confirmations that used outputs should have. Default is 1" }, "utxos": { "type": "array", + "description": "specifies the utxos to be used to be withdrawn from, as an array of `txid:vout`. These must be drawn from the node's available UTXO set", "items": { "type": "outpoint" } From 3c37bae1fb3d8308430b69a42341b57e1706f36e Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Fri, 2 Feb 2024 15:20:24 +1030 Subject: [PATCH 07/16] doc: Updated schemas *.schema.json - Makes emergency schema stricter - Fixes some formatting --- contrib/msggen/msggen/schema.json | 5 ++--- doc/lightning-stop.7.md | 2 +- doc/schemas/commando.schema.json | 3 +-- doc/schemas/emergencyrecover.schema.json | 2 +- doc/schemas/recover.schema.json | 10 +++++----- doc/schemas/setpsbtversion.schema.json | 4 +++- doc/schemas/stop.schema.json | 10 +++++----- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/contrib/msggen/msggen/schema.json b/contrib/msggen/msggen/schema.json index 38871ad24ddc..431fdae11ff3 100644 --- a/contrib/msggen/msggen/schema.json +++ b/contrib/msggen/msggen/schema.json @@ -1971,11 +1971,10 @@ "commando.schema.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", - "additionalProperties": false, + "additionalProperties": true, "required": [], "properties": { "any": { - "type": "object", "description": "the return depends on the *method* invoked" } } @@ -4874,7 +4873,7 @@ "stubs": { "type": "array", "items": { - "type": "string", + "type": "hash", "description": "Channel IDs of channels successfully inserted." } } diff --git a/doc/lightning-stop.7.md b/doc/lightning-stop.7.md index 00f4ffd15b93..84ebbb58b950 100644 --- a/doc/lightning-stop.7.md +++ b/doc/lightning-stop.7.md @@ -46,4 +46,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:879e99c76bb615e2c7f7356ff24b748ef42ff11cf692d1f199c60aacf9c09e0b) +[comment]: # ( SHA256STAMP:91bba4770ed15de26de26d1fa380817a0f323293aae7a95eda835b7d566aad85) diff --git a/doc/schemas/commando.schema.json b/doc/schemas/commando.schema.json index dd8cbd873345..7bcd21e0e70d 100644 --- a/doc/schemas/commando.schema.json +++ b/doc/schemas/commando.schema.json @@ -1,11 +1,10 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", - "additionalProperties": false, + "additionalProperties": true, "required": [], "properties": { "any": { - "type": "object", "description": "the return depends on the *method* invoked" } } diff --git a/doc/schemas/emergencyrecover.schema.json b/doc/schemas/emergencyrecover.schema.json index 127dfbc6bf43..440196651a97 100644 --- a/doc/schemas/emergencyrecover.schema.json +++ b/doc/schemas/emergencyrecover.schema.json @@ -9,7 +9,7 @@ "stubs": { "type": "array", "items": { - "type": "string", + "type": "hash", "description": "Channel IDs of channels successfully inserted." } } diff --git a/doc/schemas/recover.schema.json b/doc/schemas/recover.schema.json index ea6b907f2dfb..0fb76afd57f0 100644 --- a/doc/schemas/recover.schema.json +++ b/doc/schemas/recover.schema.json @@ -7,11 +7,11 @@ ], "properties": { "result": { - "type": "string", - "added": "v24.05", - "enum": [ - "Recovery restart in progress" - ] + "type": "string", + "added": "v24.05", + "enum": [ + "Recovery restart in progress" + ] } } } diff --git a/doc/schemas/setpsbtversion.schema.json b/doc/schemas/setpsbtversion.schema.json index ac11f52e773b..4b6d442990dc 100644 --- a/doc/schemas/setpsbtversion.schema.json +++ b/doc/schemas/setpsbtversion.schema.json @@ -2,7 +2,9 @@ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, - "required": ["psbt"], + "required": [ + "psbt" + ], "properties": { "psbt": { "type": "string", diff --git a/doc/schemas/stop.schema.json b/doc/schemas/stop.schema.json index cad72d8f63a4..1facf249798a 100644 --- a/doc/schemas/stop.schema.json +++ b/doc/schemas/stop.schema.json @@ -7,11 +7,11 @@ ], "properties": { "result": { - "type": "string", - "added": "v24.05", - "enum": [ - "Shutdown complete" - ] + "type": "string", + "added": "v24.05", + "enum": [ + "Shutdown complete" + ] } } } From 910184e05c68abba9ef84fbda9f21c3ee274df30 Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Fri, 2 Feb 2024 15:20:25 +1030 Subject: [PATCH 08/16] doc: Markdown cleanup This commit will remove parameter descriptions from RPC markdown but we will fix it in next commits by reading these descriptions directly from json. - Removing parameter description text - Adding/removing newlines for cleaner formatting - Adding ERRORS title wherever needed - Updating titles for consistency - Adding resources links --- doc/lightning-addpsbtoutput.7.md | 15 +--- doc/lightning-autoclean-once.7.md | 11 --- doc/lightning-autoclean-status.7.md | 9 --- doc/lightning-batching.7.md | 7 +- doc/lightning-bkpr-channelsapy.7.md | 5 -- doc/lightning-bkpr-dumpincomecsv.7.md | 17 ----- doc/lightning-bkpr-listaccountevents.7.md | 1 - doc/lightning-bkpr-listbalances.7.md | 6 +- doc/lightning-bkpr-listincome.7.md | 11 --- doc/lightning-check.7.md | 4 - doc/lightning-checkmessage.7.md | 15 ++-- doc/lightning-checkrune.7.md | 7 +- doc/lightning-cli.1.md | 4 +- doc/lightning-close.7.md | 63 +-------------- doc/lightning-commando-rune.7.md | 4 +- doc/lightning-commando.7.md | 3 + doc/lightning-connect.7.md | 25 ------ doc/lightning-createinvoice.7.md | 16 +--- doc/lightning-createonion.7.md | 30 +++----- doc/lightning-createrune.7.md | 4 +- doc/lightning-datastore.7.md | 20 +---- doc/lightning-datastoreusage.7.md | 1 + doc/lightning-decode.7.md | 19 +---- doc/lightning-decodepay.7.md | 5 +- doc/lightning-deldatastore.7.md | 3 + doc/lightning-delexpiredinvoice.7.md | 3 - doc/lightning-delforward.7.md | 8 -- doc/lightning-delinvoice.7.md | 7 -- doc/lightning-delpay.7.md | 15 ++-- doc/lightning-disableinvoicerequest.7.md | 2 +- doc/lightning-disableoffer.7.md | 4 +- doc/lightning-disconnect.7.md | 20 +---- doc/lightning-feerates.7.md | 5 -- doc/lightning-fetchinvoice.7.md | 29 +------ doc/lightning-fundchannel.7.md | 35 +++------ doc/lightning-fundchannel_cancel.7.md | 5 +- doc/lightning-fundchannel_complete.7.md | 8 +- doc/lightning-fundchannel_start.7.md | 49 +----------- doc/lightning-funderupdate.7.md | 93 ++--------------------- doc/lightning-fundpsbt.7.md | 35 +-------- doc/lightning-getinfo.7.md | 5 ++ doc/lightning-getlog.7.md | 6 +- doc/lightning-getroute.7.md | 31 +------- doc/lightning-help.7.md | 4 + doc/lightning-hsmtool.8.md | 2 + doc/lightning-invoice.7.md | 59 +------------- doc/lightning-invoicerequest.7.md | 30 +------- doc/lightning-keysend.7.md | 19 +---- doc/lightning-listchannels.7.md | 15 +--- doc/lightning-listclosedchannels.7.md | 7 +- doc/lightning-listconfigs.7.md | 4 +- doc/lightning-listdatastore.7.md | 6 +- doc/lightning-listforwards.7.md | 12 --- doc/lightning-listfunds.7.md | 3 - doc/lightning-listhtlcs.7.md | 4 +- doc/lightning-listinvoicerequests.7.md | 5 -- doc/lightning-listinvoices.7.md | 10 +-- doc/lightning-listnodes.7.md | 8 +- doc/lightning-listoffers.7.md | 6 +- doc/lightning-listpays.7.md | 1 - doc/lightning-listpeerchannels.7.md | 9 +-- doc/lightning-listpeers.7.md | 10 +-- doc/lightning-listsendpays.7.md | 8 +- doc/lightning-listsqlschemas.7.md | 2 + doc/lightning-listtransactions.7.md | 5 ++ doc/lightning-makesecret.7.md | 5 +- doc/lightning-multifundchannel.7.md | 88 ++------------------- doc/lightning-multiwithdraw.7.md | 25 ++---- doc/lightning-newaddr.7.md | 10 +-- doc/lightning-notifications.7.md | 10 ++- doc/lightning-offer.7.md | 3 + doc/lightning-openchannel_abort.7.md | 6 +- doc/lightning-openchannel_bump.7.md | 20 +---- doc/lightning-openchannel_init.7.md | 51 +------------ doc/lightning-openchannel_signed.7.md | 10 +-- doc/lightning-openchannel_update.7.md | 7 +- doc/lightning-pay.7.md | 50 +----------- doc/lightning-ping.7.md | 12 ++- doc/lightning-plugin.7.md | 16 ++-- doc/lightning-preapprovekeysend.7.md | 9 --- doc/lightning-renepay.7.md | 39 ++-------- doc/lightning-renepaystatus.7.md | 3 +- doc/lightning-reserveinputs.7.md | 9 +-- doc/lightning-sendcustommsg.7.md | 21 +---- doc/lightning-sendinvoice.7.md | 19 +---- doc/lightning-sendonion.7.md | 71 +++-------------- doc/lightning-sendonionmessage.7.md | 5 +- doc/lightning-sendpay.7.md | 34 +-------- doc/lightning-sendpsbt.7.md | 10 +-- doc/lightning-setchannel.7.md | 52 +------------ doc/lightning-setconfig.7.md | 5 +- doc/lightning-setpsbtversion.7.md | 11 ++- doc/lightning-signinvoice.7.md | 8 +- doc/lightning-signmessage.7.md | 7 +- doc/lightning-signpsbt.7.md | 8 +- doc/lightning-splice_init.7.md | 21 +---- doc/lightning-splice_signed.7.md | 14 +--- doc/lightning-splice_update.7.md | 10 +-- doc/lightning-sql.7.md | 32 ++++---- doc/lightning-stop.7.md | 1 + doc/lightning-txdiscard.7.md | 3 + doc/lightning-txprepare.7.md | 28 +------ doc/lightning-txsend.7.md | 3 + doc/lightning-unreserveinputs.7.md | 8 +- doc/lightning-upgradewallet.7.md | 2 +- doc/lightning-utxopsbt.7.md | 32 ++------ doc/lightning-wait.7.md | 16 ++-- doc/lightning-waitanyinvoice.7.md | 24 ++---- doc/lightning-waitblockheight.7.md | 6 +- doc/lightning-waitinvoice.7.md | 3 + doc/lightning-waitsendpay.7.md | 17 +---- doc/lightning-withdraw.7.md | 23 +----- doc/lightningd.8.md | 1 + 113 files changed, 357 insertions(+), 1405 deletions(-) diff --git a/doc/lightning-addpsbtoutput.7.md b/doc/lightning-addpsbtoutput.7.md index 780c4f5d718d..0720ca1e33cb 100644 --- a/doc/lightning-addpsbtoutput.7.md +++ b/doc/lightning-addpsbtoutput.7.md @@ -15,19 +15,6 @@ by adding a single output of amount *satoshi*. This is used to receive funds into the on-chain wallet interactively using PSBTs. -*satoshi* is the satoshi value of the output. It can -be a whole number, a whole number ending in *sat*, a whole number -ending in *000msat*, or a number with 1 to 8 decimal places ending in -*btc*. - -*initialpsbt* is a PSBT to add the output to. If not speciifed, a PSBT -will be created automatically. - -*locktime* is an optional locktime: if not set, it is set to a recent -block height (if no initial psbt is specified). - -If *destination* is not set, an internal address is generated. - EXAMPLE USAGE ------------- @@ -53,7 +40,7 @@ On success, an object is returned, containing: AUTHOR ------ -@dusty\_daemon +Dusty <<@dusty_daemon>> is mainly responsible. SEE ALSO -------- diff --git a/doc/lightning-autoclean-once.7.md b/doc/lightning-autoclean-once.7.md index cf790f872842..541ba024e01a 100644 --- a/doc/lightning-autoclean-once.7.md +++ b/doc/lightning-autoclean-once.7.md @@ -14,17 +14,6 @@ single sweep to delete old entries. This is a manual alternative (or addition) to the various `autoclean-...-age` parameters which cause autoclean to run once per hour: see lightningd-config(5). -The *subsystem*s currently supported are: - -* `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`). -* `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`). -* `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`). -* `succededpays`: payment attempts which succeeded (`complete` in listpays `status`). -* `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`). -* `paidinvoices`: invoices which were paid (`paid` in listinvoices `status). - -*age* is a non-zero number in seconds. - RETURN VALUE ------------ diff --git a/doc/lightning-autoclean-status.7.md b/doc/lightning-autoclean-status.7.md index 4d82bd95dc35..5302e835097d 100644 --- a/doc/lightning-autoclean-status.7.md +++ b/doc/lightning-autoclean-status.7.md @@ -12,15 +12,6 @@ DESCRIPTION The **autoclean-status** RPC command tells you about the status of the autclean plugin, optionally for only one subsystem. -The subsystems currently supported are: - -* `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`). -* `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`). -* `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`). -* `succededpays`: payment attempts which succeeded (`complete` in listpays `status`). -* `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`). -* `paidinvoices`: invoices which were paid (`paid` in listinvoices `status). - RETURN VALUE ------------ diff --git a/doc/lightning-batching.7.md b/doc/lightning-batching.7.md index 8228f47cbc16..5640db3b278f 100644 --- a/doc/lightning-batching.7.md +++ b/doc/lightning-batching.7.md @@ -16,11 +16,9 @@ which case it can offer a performance improvement (the cost being that if there is a crash, it's unclear how many of the commands will have been persisted). -*enable* is *true* to enable batching, *false* to disable it (the -default). - EXAMPLE JSON REQUEST -------------------- + ```json { "id": 82, @@ -39,6 +37,9 @@ On success, an empty object is returned. [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On failure, one of the following error codes may be returned: - -32602: Error in given parameters. diff --git a/doc/lightning-bkpr-channelsapy.7.md b/doc/lightning-bkpr-channelsapy.7.md index 0ad2a10a7674..234879eeb1a3 100644 --- a/doc/lightning-bkpr-channelsapy.7.md +++ b/doc/lightning-bkpr-channelsapy.7.md @@ -12,11 +12,6 @@ DESCRIPTION The **bkpr-channelsapy** RPC command lists stats on routing income, leasing income, and various calculated APYs for channel routed funds. -The **start\_time** is a UNIX timestamp (in seconds) that filters events after the provided timestamp. Defaults to zero. - -The **end\_time** is a UNIX timestamp (in seconds) that filters events up to and at the provided timestamp. Defaults to max-int. - - RETURN VALUE ------------ diff --git a/doc/lightning-bkpr-dumpincomecsv.7.md b/doc/lightning-bkpr-dumpincomecsv.7.md index 081c867d82cc..e6e416bde1cf 100644 --- a/doc/lightning-bkpr-dumpincomecsv.7.md +++ b/doc/lightning-bkpr-dumpincomecsv.7.md @@ -12,23 +12,6 @@ DESCRIPTION The **bkpr-dumpincomcsv** RPC command writes a CSV file to disk at *csv\_file* location. This is a formatted output of the **listincome** RPC command. -**csv\_format** is which CSV format to use. See RETURN VALUE for options. - -**csv\_file** is the on-disk destination of the generated CSV file. - -If **consolidate\_fees** is true, we emit a single, consolidated event for -any onchain-fees for a txid and account. Otherwise, events for every update to -the onchain fee calculation for this account and txid will be printed. -Defaults to true. Note that this means that the events emitted are -non-stable, i.e. calling **dumpincomecsv** twice may result in different -onchain fee events being emitted, depending on how much information we've -logged for that transaction. - -The **start\_time** is a UNIX timestamp (in seconds) that filters events after the provided timestamp. Defaults to zero. - -The **end\_time** is a UNIX timestamp (in seconds) that filters events up to and at the provided timestamp. Defaults to max-int. - - RETURN VALUE ------------ diff --git a/doc/lightning-bkpr-listaccountevents.7.md b/doc/lightning-bkpr-listaccountevents.7.md index fbfb6b7b33c0..73daeaf47189 100644 --- a/doc/lightning-bkpr-listaccountevents.7.md +++ b/doc/lightning-bkpr-listaccountevents.7.md @@ -18,7 +18,6 @@ Note that the type **onchain\_fees** that are emitted are of opposite credit/deb produce the same list of events -- no previously emitted event will be subsequently updated, rather we add a new event to the list. - RETURN VALUE ------------ diff --git a/doc/lightning-bkpr-listbalances.7.md b/doc/lightning-bkpr-listbalances.7.md index 3efc20d27cfd..d8931e6c22ac 100644 --- a/doc/lightning-bkpr-listbalances.7.md +++ b/doc/lightning-bkpr-listbalances.7.md @@ -9,11 +9,9 @@ SYNOPSIS DESCRIPTION ----------- -The **bkpr-listbalances** RPC command is a list of all current and historical account balances. An account is either the on-chain *wallet* or a channel balance. -Any funds sent to an *external* account will not be accounted for here. +The **bkpr-listbalances** RPC command is a list of all current and historical account balances. An account is either the on-chain *wallet* or a channel balance. Any funds sent to an *external* account will not be accounted for here. -Note that any channel that was recorded will be listed. Closed channel balances -will be 0msat. +Note that any channel that was recorded will be listed. Closed channel balances will be 0msat. RETURN VALUE ------------ diff --git a/doc/lightning-bkpr-listincome.7.md b/doc/lightning-bkpr-listincome.7.md index 887e541fbbc4..47de4abfb8b8 100644 --- a/doc/lightning-bkpr-listincome.7.md +++ b/doc/lightning-bkpr-listincome.7.md @@ -11,17 +11,6 @@ DESCRIPTION The **bkpr-listincome** RPC command is a list of all income impacting events that the bookkeeper plugin has recorded for this node. -If **consolidate\_fees** is true, we emit a single, consolidated event for -any onchain-fees for a txid and account. Otherwise, events for every update to -the onchain fee calculation for this account and txid will be printed. Defaults to true. Note that this means that the events emitted are non-stable, -i.e. calling **listincome** twice may result in different onchain fee events -being emitted, depending on how much information we've logged for that -transaction. - -The **start\_time** is a UNIX timestamp (in seconds) that filters events after the provided timestamp. Defaults to zero. - -The **end\_time** is a UNIX timestamp (in seconds) that filters events up to and at the provided timestamp. Defaults to max-int. - RETURN VALUE ------------ diff --git a/doc/lightning-check.7.md b/doc/lightning-check.7.md index 17f634b02be1..b42bbc04baaa 100644 --- a/doc/lightning-check.7.md +++ b/doc/lightning-check.7.md @@ -12,10 +12,6 @@ DESCRIPTION The **check** RPC command verifies another command without actually making any changes. -The *command\_to\_check* is the name of the relevant command. - -*parameters* is the command's parameters. - This is guaranteed to be safe, and will do all checks up to the point where something in the system would need to be altered (such as checking that channels are in the right state, peers connected, etc). diff --git a/doc/lightning-checkmessage.7.md b/doc/lightning-checkmessage.7.md index 010327477ca2..78664cc4d61b 100644 --- a/doc/lightning-checkmessage.7.md +++ b/doc/lightning-checkmessage.7.md @@ -17,14 +17,9 @@ secret). As a special case, if *pubkey* is not specified, we will try every known node key (as per *listnodes*), and verification succeeds if it -matches for any one of them. Note: this is implemented far more +matches for any one of them. Note: this is implemented far more efficiently than trying each one, so performance is not a concern. -On failure, an error is returned and core lightning exit with the following error code: - -- -32602: Parameter missed or malformed; -- 1301: *pubkey* not found in the graph. - RETURN VALUE ------------ @@ -36,6 +31,14 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + +On failure, an error is returned and core lightning exit with the following error code: + +- -32602: Parameter missed or malformed; +- 1301: *pubkey* not found in the graph. + AUTHOR ------ diff --git a/doc/lightning-checkrune.7.md b/doc/lightning-checkrune.7.md index e70df117b59b..761becbed9b4 100644 --- a/doc/lightning-checkrune.7.md +++ b/doc/lightning-checkrune.7.md @@ -25,6 +25,9 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + The following error codes may occur: - RUNE\_NOT\_AUTHORIZED (1501): rune is not for this node (or perhaps completely invalid) @@ -34,8 +37,7 @@ The following error codes may occur: AUTHOR ------ -Shahana Farooqui <> is mainly responsible -for consolidating logic from commando. +Shahana Farooqui <> is mainly responsible for consolidating logic from commando. SEE ALSO -------- @@ -46,4 +48,5 @@ RESOURCES --------- Main web site: + [comment]: # ( SHA256STAMP:72ed36d7c47cf43b39c149da7d251c8bd40531b59591a50c4745f5d7aef5854e) diff --git a/doc/lightning-cli.1.md b/doc/lightning-cli.1.md index edbb15ac5133..e121e1f0dc22 100644 --- a/doc/lightning-cli.1.md +++ b/doc/lightning-cli.1.md @@ -117,8 +117,8 @@ raw JSON and are passed through. Other arguments are treated as strings. Some commands have optional arguments. You may use *null* to skip optional arguments to provide later arguments, although this is not encouraged. -EXAMPLES --------- +EXAMPLE USAGE +------------- 1. List commands: diff --git a/doc/lightning-close.7.md b/doc/lightning-close.7.md index 95c34a56a21e..58dd9333e4e2 100644 --- a/doc/lightning-close.7.md +++ b/doc/lightning-close.7.md @@ -4,7 +4,7 @@ lightning-close -- Command for closing channels with direct peers SYNOPSIS -------- -**close** *id* [*unilateraltimeout*] [*destination*] [*fee\_negotiation\_step*] [*wrong\_funding*] [*force\_lease\_closed*] [\*feerange\*] +**close** *id* [*unilateraltimeout*] [*destination*] [*fee\_negotiation\_step*] [*wrong\_funding*] [*force\_lease\_closed*] [*feerange*] DESCRIPTION ----------- @@ -13,66 +13,6 @@ The **close** RPC command attempts to close the channel cooperatively with the peer, or unilaterally after *unilateraltimeout*, and the to-local output will be sent to the address specified in *destination*. -If the given *id* is a peer ID (66 hex digits as a string), then it -applies to the active channel of the direct peer corresponding to the -given peer ID. If the given *id* is a channel ID (64 hex digits as a -string, or the short channel ID *blockheight:txindex:outindex* form), -then it applies to that channel. - -If *unilateraltimeout* is not zero, the **close** command will -unilaterally close the channel when that number of seconds is reached. -If *unilateraltimeout* is zero, then the **close** command will wait -indefinitely until the peer is online and can negotiate a mutual close. -The default is 2 days (172800 seconds). - -The *destination* can be of any Bitcoin bech32 type. -If it isn't specified, the default is a Core Lightning wallet address. If -the peer hasn't offered the `option_shutdown_anysegwit` feature, then -taproot addresses (or other v1+ segwit) are not allowed. Tell your -friends to upgrade! - -The *fee\_negotiation\_step* parameter controls how closing fee -negotiation is performed assuming the peer proposes a fee that is -different than our estimate. (Note that modern peers use the quick-close protocol which does not allow negotiation: see *feerange* instead). - -On every negotiation step we must give up -some amount from our proposal towards the peer's proposal. This parameter -can be an integer in which case it is interpreted as number of satoshis -to step at a time. Or it can be an integer followed by "%" to designate -a percentage of the interval to give up. A few examples, assuming the peer -proposes a closing fee of 3000 satoshi and our estimate shows it must be 4000: - -- "10": our next proposal will be 4000-10=3990. -- "10%": our next proposal will be 4000-(10% of (4000-3000))=3900. -- "1": our next proposal will be 3999. This is the most extreme case when we -insist on our fee as much as possible. -- "100%": our next proposal will be 3000. This is the most relaxed case when -we quickly accept the peer's proposal. - -The default is "50%". - -*wrong\_funding* can only be specified if both sides have offered -the "shutdown\_wrong\_funding" feature (enabled by the -**experimental-shutdown-wrong-funding** option): it must be a -transaction id followed by a colon then the output number. Instead of -negotiating a shutdown to spend the expected funding transaction, the -shutdown transaction will spend this output instead. This is only -allowed if this peer opened the channel and the channel is unused: it -can rescue openings which have been manually miscreated. - -*force\_lease\_closed* if the channel has funds leased to the peer -(option\_will\_fund), we prevent initiation of a mutual close -unless this flag is passed in. Defaults to false. - -*feerange* is an optional array [ *min*, *max* ], indicating the -minimum and maximum feerates to offer: the peer will obey these if it -supports the quick-close protocol. *slow* and *unilateral\_close* are -the defaults. See NOTES in lightning-feerates(7) for possible values. - -Note that the maximum fee will be capped at the final commitment -transaction fee (unless the experimental anchor-outputs option is -negotiated). - The peer needs to be live and connected in order to negotiate a mutual close. The default of unilaterally closing after 48 hours is usually a reasonable indication that you can no longer contact the peer. @@ -88,6 +28,7 @@ closed if the peer reconnected. NOTIFICATIONS ------------- + Notifications may be returned indicating what is going on, especially if the peer is offline and we are waiting. diff --git a/doc/lightning-commando-rune.7.md b/doc/lightning-commando-rune.7.md index 08ac7a025e36..ce8e73d3dd23 100644 --- a/doc/lightning-commando-rune.7.md +++ b/doc/lightning-commando-rune.7.md @@ -58,8 +58,8 @@ to form valid JSON: * `!`: only passes if the *name* does *not* exist. e.g. `pnamedestination!`. Every other operator except `#` fails if *name* does not exist! -EXAMPLES --------- +EXAMPLE USAGE +------------- This creates a fresh rune which can do anything: diff --git a/doc/lightning-commando.7.md b/doc/lightning-commando.7.md index 52ab1f94936a..97a90990b69a 100644 --- a/doc/lightning-commando.7.md +++ b/doc/lightning-commando.7.md @@ -20,6 +20,9 @@ RETURN VALUE On success, the return depends on the *method* invoked. +ERRORS +------ + On failure, one of the following error codes may be returned: - -32600: Usually means peer is not connected diff --git a/doc/lightning-connect.7.md b/doc/lightning-connect.7.md index 5f784346795d..bc643305769a 100644 --- a/doc/lightning-connect.7.md +++ b/doc/lightning-connect.7.md @@ -12,31 +12,6 @@ DESCRIPTION The **connect** RPC command establishes a new connection with another node in the Lightning Network. -*id* represents the target node's public key. As a convenience, *id* may -be of the form *id@host* or *id@host:port*. In this case, the *host* and -*port* parameters must be omitted. - -*host* is the peer's hostname or IP address. - -If not specified, the *port* depends on the current network: - -- bitcoin **mainnet**: 9735. -- bitcoin **testnet**: 19735. -- bitcoin **signet**: 39735. -- bitcoin **regtest**: 19846. - -If *host* is not specified (or doesn't work), the connection will be attempted to an IP -belonging to *id* obtained through gossip with other already connected -peers. -This can fail if your C-lightning node is a fresh install that has not -connected to any peers yet (your node has no gossip yet), -or if the target *id* is a fresh install that has no channels yet -(nobody will gossip about a node until it has one published channel). - -If *host* begins with a */* it is interpreted as a local path, and the -connection will be made to that local socket (see **bind-addr** in -lightningd-config(5)). - Connecting to a node is just the first step in opening a channel with another node. Once the peer is connected a channel can be opened with lightning-fundchannel(7). diff --git a/doc/lightning-createinvoice.7.md b/doc/lightning-createinvoice.7.md index 003c0cb8add0..7b3f2bd37f53 100644 --- a/doc/lightning-createinvoice.7.md +++ b/doc/lightning-createinvoice.7.md @@ -12,19 +12,6 @@ DESCRIPTION The **createinvoice** RPC command signs and saves an invoice into the database. -The *invstring* parameter is of bolt11 form, but the final signature -is ignored. Minimal sanity checks are done. (Note: if -**experimental-offers** is enabled, *invstring* can actually be an -unsigned bolt12 invoice). - -The *label* must be a unique string or number (which is treated as a -string, so "01" is different from "1"); it is never revealed to other -nodes on the lightning network, but it can be used to query the status -of this invoice. - -The *preimage* is the preimage to supply upon successful payment of -the invoice. - RETURN VALUE ------------ @@ -54,6 +41,9 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On failure, an error is returned and no invoice is created. If the lightning process fails before responding, the caller should use lightning-listinvoices(7) to query whether this invoice was created or diff --git a/doc/lightning-createonion.7.md b/doc/lightning-createonion.7.md index 5cd3ba94c9a5..aab8692572e3 100644 --- a/doc/lightning-createonion.7.md +++ b/doc/lightning-createonion.7.md @@ -13,8 +13,11 @@ The **createonion** RPC command allows the caller to create a custom onion with custom payloads at each hop in the route. A custom onion can be used to implement protocol extensions that are not supported by Core Lightning directly. -The *hops* parameter is a JSON list of dicts, each specifying a node and the -payload destined for that node. The following is an example of a 3 hop onion: + +EXAMPLE USAGE +------------- + +The following is an example of a 3 hop onion: ```json [ @@ -68,22 +71,7 @@ which the above *hops* parameter was generated: payload in `createonion` corresponds to the 2nd set of values from `getroute`. - The final payload is a copy of the last payload sans `channel` -These rules are directly derived from the onion construction. Please refer -[BOLT 04](https://github.com/lightning/bolts/blob/master/04-onion-routing.md) for details and rationale. - -The *assocdata* parameter specifies the associated data that the onion should -commit to. If the onion is to be used to send a payment later it MUST match -the `payment_hash` of the payment in order to be valid. - -The optional *session\_key* parameter can be used to specify a secret that is -used to generate the shared secrets used to encrypt the onion for each hop. It -should only be used for testing or if a specific shared secret is -important. If not specified it will be securely generated internally, and the -shared secrets will be returned. - -The optional *onion\_size* parameter specifies a size different from the default -payment onion (1300 bytes). May be used for custom protocols like trampoline -routing. +These rules are directly derived from the onion construction. Please refer BOLT 04 for details and rationale. RETURN VALUE ------------ @@ -97,8 +85,8 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) -EXAMPLE -------- +EXAMPLE JSON RESPONSE +--------------------- The following example is the result of calling *createonion* with the above hops parameter: @@ -132,4 +120,6 @@ RESOURCES Main web site: +[BOLT 04](https://github.com/lightning/bolts/blob/master/04-onion-routing.md) + [comment]: # ( SHA256STAMP:faac7539bd94fe5e561350f36002895ad2f3d4539f8bb4688027b6a81ec6f70c) diff --git a/doc/lightning-createrune.7.md b/doc/lightning-createrune.7.md index dbc8ce2acaaa..e3ac6c3d8d62 100644 --- a/doc/lightning-createrune.7.md +++ b/doc/lightning-createrune.7.md @@ -62,8 +62,8 @@ to form valid JSON: * `!`: only passes if the *name* does *not* exist. e.g. `pnamedestination!`. Every other operator except `#` fails if *name* does not exist! -EXAMPLES --------- +EXAMPLE USAGE +------------- This creates a fresh rune which can do anything: diff --git a/doc/lightning-datastore.7.md b/doc/lightning-datastore.7.md index 80984849afd6..9e7131e1a816 100644 --- a/doc/lightning-datastore.7.md +++ b/doc/lightning-datastore.7.md @@ -12,23 +12,6 @@ DESCRIPTION The **datastore** RPC command allows plugins to store data in the Core Lightning database, for later retrieval. -*key* is an array of values (though a single value is treated as a -one-element array), to form a hierarchy. Using the first element of -the key as the plugin name (e.g. `[ "summary" ]`) is recommended. -A key can either have children or a value, never both: parents are -created and removed automatically. - -*mode* is one of "must-create" (default, fails if it already exists), -"must-replace" (fails if it doesn't already exist), -"create-or-replace" (never fails), "must-append" (must already exist, -append this to what's already there) or "create-or-append" (append if -anything is there, otherwise create). - -*generation*, if specified, means that the update will fail if the -previously-existing data is not exactly that generation. This allows -for simple atomicity. This is only legal with *mode* "must-replace" -or "must-append". - RETURN VALUE ------------ @@ -43,6 +26,9 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + The following error codes may occur: - 1202: The key already exists (and mode said it must not) diff --git a/doc/lightning-datastoreusage.7.md b/doc/lightning-datastoreusage.7.md index aa9758fe2407..02b16d8f4f80 100644 --- a/doc/lightning-datastoreusage.7.md +++ b/doc/lightning-datastoreusage.7.md @@ -14,6 +14,7 @@ total bytes that are stored under a certain *key* (or from the root), including the size of the *key*. All descendants of the *key* (or root) are taken into account. + RETURN VALUE ------------ diff --git a/doc/lightning-decode.7.md b/doc/lightning-decode.7.md index c850d60a9b92..bfd784dff2a1 100644 --- a/doc/lightning-decode.7.md +++ b/doc/lightning-decode.7.md @@ -9,17 +9,7 @@ SYNOPSIS DESCRIPTION ----------- -The **decode** RPC command checks and parses: - -- a *bolt11* or *bolt12* string (optionally prefixed by `lightning:` - or `LIGHTNING:`) as specified by the BOLT 11 and BOLT 12 - specifications. -- a *rune* as created by lightning-commando-rune(7). -- an *emergency\_recover* string generated by hsmtool like - `lightning-hsmtool getemergencyrecover `. - It holds `emergency.recover` contents and starts with `clnemerg1`. - -It may decode other formats in future. +The **decode** RPC command checks and parses `bolt11`, `bolt12`, `rune` or `emergency\_recover`. It may decode other formats in future. RETURN VALUE ------------ @@ -300,14 +290,13 @@ SEE ALSO lightning-pay(7), lightning-offer(7), lightning-fetchinvoice(7), lightning-sendinvoice(7), lightning-commando-rune(7) +RESOURCES +--------- + [BOLT #11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md) [BOLT #12](https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md) (experimental, [bolt](https://github.com/lightning/bolts) #798) - -RESOURCES ---------- - Main web site: [comment]: # ( SHA256STAMP:59bcc38bf3c4b2aa6f4258c1327d16171c4ba37276ac3a96528a2f12a2ef3ad5) diff --git a/doc/lightning-decodepay.7.md b/doc/lightning-decodepay.7.md index b93a4fe4c521..2a345eef0b77 100644 --- a/doc/lightning-decodepay.7.md +++ b/doc/lightning-decodepay.7.md @@ -63,12 +63,11 @@ SEE ALSO lightning-pay(7), lightning-getroute(7), lightning-sendpay(7). -[BOLT -\#11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md). - RESOURCES --------- +[BOLT #11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md) + Main web site: [comment]: # ( SHA256STAMP:a5939424a8e93fc4e79a702753b58fa3da4e4c5efa00571d46dd35c9a68ea38e) diff --git a/doc/lightning-deldatastore.7.md b/doc/lightning-deldatastore.7.md index 466190782648..2eb0ecfc06c3 100644 --- a/doc/lightning-deldatastore.7.md +++ b/doc/lightning-deldatastore.7.md @@ -29,6 +29,9 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + The following error codes may occur: - 1200: the key does not exist diff --git a/doc/lightning-delexpiredinvoice.7.md b/doc/lightning-delexpiredinvoice.7.md index 7a863d1a9ca1..53890a7798f0 100644 --- a/doc/lightning-delexpiredinvoice.7.md +++ b/doc/lightning-delexpiredinvoice.7.md @@ -12,9 +12,6 @@ DESCRIPTION The **delexpiredinvoice** RPC command removes all invoices that have expired on or before the given *maxexpirytime*. -If *maxexpirytime* is not specified then all expired invoices are -deleted. - RETURN VALUE ------------ diff --git a/doc/lightning-delforward.7.md b/doc/lightning-delforward.7.md index c8304843dc01..002132895b47 100644 --- a/doc/lightning-delforward.7.md +++ b/doc/lightning-delforward.7.md @@ -17,14 +17,6 @@ This command is mainly used by the *autoclean* plugin (see lightningd-config(7)) As these database entries are only kept for your own analysis, removing them has no effect on the running of your node. -You cannot delete forwards which have status *offered* (i.e. are -currently active). - -Note: for **listforwards** entries without an *in\_htlc\_id* entry (no -longer created in v22.11, but can exist from older versions), a value -of 18446744073709551615 can be used, but then it will delete *all* -entries without *in\_htlc\_id* for this *in\_channel* and *status*. - RETURN VALUE ------------ diff --git a/doc/lightning-delinvoice.7.md b/doc/lightning-delinvoice.7.md index f9f4a16d1774..048ed361472e 100644 --- a/doc/lightning-delinvoice.7.md +++ b/doc/lightning-delinvoice.7.md @@ -12,13 +12,6 @@ DESCRIPTION The **delinvoice** RPC command removes an invoice with *status* as given in **listinvoices**, or with *desconly* set, removes its description. -The caller should be particularly aware of the error case caused by the -*status* changing just before this command is invoked! - -If *desconly* is set, the invoice is not deleted, but has its -description removed (this can save space with very large descriptions, -as would be used with lightning-invoice(7) *deschashonly*. - RETURN VALUE ------------ diff --git a/doc/lightning-delpay.7.md b/doc/lightning-delpay.7.md index 33105400e542..c82a196dad8e 100644 --- a/doc/lightning-delpay.7.md +++ b/doc/lightning-delpay.7.md @@ -9,17 +9,11 @@ SYNOPSIS DESCRIPTION ----------- -The **delpay** RPC command deletes a payment with the given `payment_hash` if its status is either `complete` or `failed`. Deleting a `pending` payment is an error. If *partid* and *groupid* are not specified, all payment parts with matchin status are deleted. - -- *payment\_hash*: The unique identifier of a payment. -- *status*: Expected status of the payment. -- *partid*: Specific partid to delete (must be paired with *groupid*) -- *groupid*: Specific groupid to delete (must be paired with *partid*) - -Only deletes if the payment status matches. +The **delpay** RPC command deletes a payment with the given `payment_hash` if its status is either `complete` or `failed`. If *partid* and *groupid* are not specified, all payment parts with matchin status are deleted. EXAMPLE JSON REQUEST ------------ + ```json { "id": 82, @@ -31,6 +25,7 @@ EXAMPLE JSON REQUEST } ``` + RETURN VALUE ------------ @@ -61,6 +56,9 @@ On success, an object containing **payments** is returned. It is an array of ob [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On failure, an error is returned. If the lightning process fails before responding, the caller should use lightning-listsentpays(7) or lightning-listpays(7) to query whether this payment was deleted or not. @@ -72,6 +70,7 @@ The following error codes may occur: EXAMPLE JSON RESPONSE ----- + ```json { "payments": [ diff --git a/doc/lightning-disableinvoicerequest.7.md b/doc/lightning-disableinvoicerequest.7.md index 6bb652d70bd7..b6ccca7f5b70 100644 --- a/doc/lightning-disableinvoicerequest.7.md +++ b/doc/lightning-disableinvoicerequest.7.md @@ -3,6 +3,7 @@ lightning-disableinvoicerequest -- Command for removing an invoice request SYNOPSIS -------- + **(WARNING: experimental-offers only)** **disableinvoicerequest** *invreq\_id* @@ -18,7 +19,6 @@ We currently don't support deletion of invoice\_requests, so they are not forgotten entirely (there may be payments which refer to this invoice\_request). - RETURN VALUE ------------ diff --git a/doc/lightning-disableoffer.7.md b/doc/lightning-disableoffer.7.md index ef92868ff5ea..eae91ad3d951 100644 --- a/doc/lightning-disableoffer.7.md +++ b/doc/lightning-disableoffer.7.md @@ -3,6 +3,7 @@ lightning-disableoffer -- Command for removing an offer SYNOPSIS -------- + **(WARNING: experimental-offers only)** **disableoffer** *offer\_id* @@ -18,6 +19,7 @@ forgotten entirely (there may be invoices which refer to this offer). EXAMPLE JSON REQUEST ------------ + ```json { "id": 82, @@ -47,6 +49,7 @@ On success, an object is returned, containing: EXAMPLE JSON RESPONSE ----- + ```json { "offer_id": "053a5c566fbea2681a5ff9c05a913da23e45b95d09ef5bd25d7d408f23da7084", @@ -58,7 +61,6 @@ EXAMPLE JSON RESPONSE ``` - AUTHOR ------ diff --git a/doc/lightning-disconnect.7.md b/doc/lightning-disconnect.7.md index 960799c122d4..8671c60d9b11 100644 --- a/doc/lightning-disconnect.7.md +++ b/doc/lightning-disconnect.7.md @@ -11,25 +11,8 @@ DESCRIPTION The disconnect RPC command closes an existing connection to a peer, identified by *id*, in the Lightning Network, as long as it doesn't have -an active channel. If *force* is set then it will disconnect even with an active channel. -The *id* can be discovered in the output of the listpeers command, which -returns a set of peers: - - { - "peers": [ - { - "id": "0563aea81...", - "connected": true, - ... - } - ] - } - -Passing the *id* attribute of a peer to *disconnect* will terminate the -connection. - RETURN VALUE ------------ @@ -38,6 +21,9 @@ On success, an empty object is returned. [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On error the returned object will contain `code` and `message` properties, with `code` being one of the following: diff --git a/doc/lightning-feerates.7.md b/doc/lightning-feerates.7.md index 330f9e9021af..bd26aa1324e6 100644 --- a/doc/lightning-feerates.7.md +++ b/doc/lightning-feerates.7.md @@ -15,11 +15,6 @@ The backend may fail to provide estimates, but if it was able to provide estimates in the past, CLN will continue to use those for a while. CLN will also smoothen feerate estimations from the backend. -*style* is either of the two strings: - -* *perkw* - provide feerate in units of satoshis per 1000 weight (e.g. the minimum fee is usually `253perkw`) -* *perkb* - provide feerate in units of satoshis per 1000 virtual bytes (eg. the minimum fee is usually `1000perkb`) - Explorers often present fees in "sat/vB": 4 sat/vB is `4000perkb` or `1000perkw`. diff --git a/doc/lightning-fetchinvoice.7.md b/doc/lightning-fetchinvoice.7.md index 5d091834a055..0207cf66b0d6 100644 --- a/doc/lightning-fetchinvoice.7.md +++ b/doc/lightning-fetchinvoice.7.md @@ -19,32 +19,6 @@ If **fetchinvoice-noconnect** is not specified in the configuation, it will connect to the destination in the (currently common!) case where it cannot find a route which supports `option_onion_messages`. -*amount\_msat* is required if the *offer* does not specify an amount -at all, otherwise it is optional (but presumably if you set it to less -than the offer, you will get an error from the issuer). - -*quantity* is is required if the *offer* specifies -*quantity\_max*, otherwise it is not allowed. - -*recurrence\_counter* is required if the *offer* -specifies *recurrence*, otherwise it is not allowed. -*recurrence\_counter* should first be set to 0, and incremented for -each successive invoice in a given series. - -*recurrence\_start* is required if the *offer* -specifies *recurrence\_base* with *start\_any\_period* set, otherwise it -is not allowed. It indicates what period number to start at. - -*recurrence\_label* is required if *recurrence\_counter* is set, and -otherwise is not allowed. It must be the same as prior fetchinvoice -calls for the same recurrence, as it is used to link them together. - -*timeout* is an optional timeout; if we don't get a reply before this -we fail (default, 60 seconds). - -*payer\_note* is an optional payer note to ask the issuer to include -in the fetched invoice. - RETURN VALUE ------------ @@ -67,6 +41,9 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + The following error codes may occur: - -1: Catchall nonspecific error. diff --git a/doc/lightning-fundchannel.7.md b/doc/lightning-fundchannel.7.md index 4b9bbc36504f..236ba95b52ef 100644 --- a/doc/lightning-fundchannel.7.md +++ b/doc/lightning-fundchannel.7.md @@ -11,29 +11,15 @@ SYNOPSIS DESCRIPTION ----------- -The **fundchannel** RPC command opens a payment channel with a peer by -committing a funding transaction to the blockchain as defined in BOLT -\#2. -If not already connected, **fundchannel** will automatically attempt -to connect if C-lightning knows a way to contact the node (either from -normal gossip, or from a previous **connect** call). -This auto-connection can fail if C-lightning does not know how to contact -the target node; see lightning-connect(7). -Once the -transaction is confirmed, normal channel operations may begin. Readiness -is indicated by **listpeers** reporting a *state* of `CHANNELD_NORMAL` -for the channel. - -*id* is the peer id obtained from **connect**. - -*amount* is the amount in satoshis taken from the internal wallet to -fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). The string *all* can be used to specify all available -funds (or 16777215 satoshi if more is available and large channels were not negotiated with the peer). Otherwise, it is in -satoshi precision; it can be a whole number, a whole number ending in -*sat*, a whole number ending in *000msat*, or a number with 1 to 8 -decimal places ending in *btc*. The value cannot be less than the dust -limit, currently set to 546, nor more than 16777215 satoshi (unless large -channels were negotiated with the peer). +The **fundchannel** RPC command opens a payment channel with a peer by committing a +funding transaction to the blockchain as defined in BOLT #2. + +If not already connected, **fundchannel** will automatically attempt to connect if +Core Lightning knows a way to contact the node (either from normal gossip, or from +a previous **connect** call). + +This auto-connection can fail if Core Lightning does not know how to contact the +target node; see lightning-connect(7). *feerate* is an optional feerate used for the opening transaction and (unless *option\_anchors\_zero\_fee\_htlc\_tx* is negotiated), as initial feerate @@ -117,6 +103,9 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------- + The following error codes may occur: - -1: Catchall nonspecific error. diff --git a/doc/lightning-fundchannel_cancel.7.md b/doc/lightning-fundchannel_cancel.7.md index b95cc991f621..1bc2e177bf00 100644 --- a/doc/lightning-fundchannel_cancel.7.md +++ b/doc/lightning-fundchannel_cancel.7.md @@ -12,8 +12,6 @@ DESCRIPTION `fundchannel_cancel` is a lower level RPC command. It allows channel opener to cancel a channel before funding broadcast with a connected peer. -*id* is the node id of the remote peer with which to cancel. - Note that the funding transaction MUST NOT be broadcast before `fundchannel_cancel`. Broadcasting transaction before `fundchannel_cancel` WILL lead to unrecoverable loss of funds. @@ -32,6 +30,9 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On error the returned object will contain `code` and `message` properties, with `code` being one of the following: diff --git a/doc/lightning-fundchannel_complete.7.md b/doc/lightning-fundchannel_complete.7.md index fd10e2ffab55..52485149d8b1 100644 --- a/doc/lightning-fundchannel_complete.7.md +++ b/doc/lightning-fundchannel_complete.7.md @@ -12,11 +12,6 @@ DESCRIPTION `fundchannel_complete` is a lower level RPC command. It allows a user to complete an initiated channel establishment with a connected peer. -*id* is the node id of the remote peer. - -*psbt* is the transaction to use for funding (does not need to be -signed but must be otherwise complete). - Note that the funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed, as the commitment transactions for this channel are not secured until this command @@ -34,6 +29,9 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On error the returned object will contain `code` and `message` properties, with `code` being one of the following: diff --git a/doc/lightning-fundchannel_start.7.md b/doc/lightning-fundchannel_start.7.md index b8d5c62a475a..3bf385858785 100644 --- a/doc/lightning-fundchannel_start.7.md +++ b/doc/lightning-fundchannel_start.7.md @@ -12,52 +12,6 @@ DESCRIPTION `fundchannel_start` is a lower level RPC command. It allows a user to initiate channel establishment with a connected peer. -*id* is the node id of the remote peer. - -*amount* is the satoshi value that the channel will be funded at. This -value MUST be accurate, otherwise the negotiated commitment transactions -will not encompass the correct channel value. - -*feerate* is an optional field. Sets the feerate for subsequent -commitment transactions: see **fundchannel**. Note that this is ignored -for channels with *option\_anchors\_zero\_fee\_htlc\_tx* (we always use a low -commitment fee for these). - -*announce* whether or not to announce this channel. - -*close\_to* is a Bitcoin address to which the channel funds should be sent to -on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. -Returns `close_to` set to closing script iff is negotiated. - -*push\_msat* is the amount of millisatoshis to push to the channel peer at -open. Note that this is a gift to the peer -- these satoshis are -added to the initial balance of the peer at channel start and are largely -unrecoverable once pushed. - -*channel\_type* *(added v24.02)* is an array of bit numbers, representing the explicit -channel type to request. BOLT 2 defines the following value types: - -``` -The currently defined basic types are: - - no features (no bits set) `[]` - - `option_static_remotekey` (`[12]`) - - `option_anchor_outputs` and `option_static_remotekey` (`[20, 12]`) - - `option_anchors_zero_fee_htlc_tx` and `option_static_remotekey` ([22, 12]) - -Each basic type has the following variations allowed: - - `option_scid_alias` ([46]) - - `option_zeroconf` ([50]) -``` - -*mindepth* is the number of confirmations before we accept the channel as -active. - -*reserve* is the amount we want the peer to maintain on its side of the channel. -Default is 1% of the funding amount. It can be a whole number, a whole number -ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 -decimal places ending in *btc*. - - Note that the funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`, as the commitment transactions for this channel @@ -85,6 +39,9 @@ The following warnings may also be returned: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On error the returned object will contain `code` and `message` properties, with `code` being one of the following: diff --git a/doc/lightning-funderupdate.7.md b/doc/lightning-funderupdate.7.md index 300b69e2f20b..0a53ed9a27e6 100644 --- a/doc/lightning-funderupdate.7.md +++ b/doc/lightning-funderupdate.7.md @@ -6,100 +6,17 @@ SYNOPSIS **funderupdate** [*policy*] [*policy\_mod*] [*leases\_only*] [*min\_their\_funding\_msat*] [*max\_their\_funding\_msat*] [*per\_channel\_min\_msat*] [*per\_channel\_max\_msat*] [*reserve\_tank\_msat*] [*fuzz\_percent*] [*fund\_probability*] [*lease\_fee\_base\_msat*] [*lease\_fee\_basis*] [*funding\_weight*] [*channel\_fee\_max\_base\_msat*] [*channel\_fee\_max\_proportional\_thousandths*] [*compact\_lease*] -NOTE: Must have --experimental-dual-fund enabled for these settings to take effect. DESCRIPTION ----------- -For channel open requests using - - -*policy*, *policy\_mod* is the policy the funder plugin will use to decide -how much capital to commit to a v2 open channel request. There are three -policy options, detailed below: `match`, `available`, and `fixed`. -The *policy\_mod* is the number or 'modification' to apply to the policy. -Default is (fixed, 0sats). +NOTE: Must have --experimental-dual-fund enabled for these settings to take effect. -* `match` -- Contribute *policy\_mod* percent of their requested funds. - Valid *policy\_mod* values are 0 to 200. If this is a channel lease - request, we match based on their requested funds. If it is not a - channel lease request (and *lease\_only* is false), then we match - their funding amount. Note: any lease match less than 100 will - likely fail, as clients will not accept a lease less than their request. -* `available` -- Contribute *policy\_mod* percent of our available - node wallet funds. Valid *policy\_mod* values are 0 to 100. -* `fixed` -- Contributes a fixed *policy\_mod* sats to v2 channel open requests. +For channel open requests using dual funding. Note: to maximize channel leases, best policy setting is (match, 100). -*leases\_only* will only contribute funds to `option_will_fund` requests -which pay to lease funds. Defaults to false, will fund any v2 open request -using *policy* even if it's they're not seeking to lease funds. Note that -`option_will_fund` commits funds for 4032 blocks (~1mo). Must also set -*lease\_fee\_base\_msat*, *lease\_fee\_basis*, *funding\_weight*, -*channel\_fee\_max\_base\_msat*, and *channel\_fee\_max\_proportional\_thousandths* -to advertise available channel leases. - -*min\_their\_funding\_msat* is the minimum funding sats that we require in order -to activate our contribution policy to the v2 open. Defaults to 10k sats. - -*max\_their\_funding\_msat* is the maximum funding sats that we will consider -to activate our contribution policy to the v2 open. Any channel open above this -will not be funded. Defaults to no max (`UINT_MAX`). - -*per\_channel\_min\_msat* is the minimum amount that we will contribute to a -channel open. Defaults to 10k sats. - -*per\_channel\_max\_msat* is the maximum amount that we will contribute to a -channel open. Defaults to no max (`UINT_MAX`). - -*reserve\_tank\_msat* is the amount of sats to leave available in the node wallet. -Defaults to zero sats. - -*fuzz\_percent* is a percentage to fuzz the resulting contribution amount by. -Valid values are 0 to 100. Note that turning this on with (match, 100) policy -will randomly fail `option_will_fund` leases, as most clients -expect an exact or greater match of their `requested_funds`. -Defaults to 0% (no fuzz). - -*fund\_probability* is the percent of v2 channel open requests to apply our -policy to. Valid values are integers from 0 (fund 0% of all open requests) -to 100 (fund every request). Useful for randomizing opens that receive funds. -Defaults to 100. - -Setting any of the next 5 options will activate channel leases for this node, -and advertise these values via the lightning gossip network. If any one is set, -the other values will be the default. - -*lease\_fee\_base\_msat* is the flat fee for a channel lease. Node will -receive this much extra added to their channel balance, paid by the opening -node. Defaults to 2k sats. Note that the minimum is 1sat. - -*lease\_fee\_basis* is a basis fee that's calculated as 1/10k of the total -requested funds the peer is asking for. Node will receive the total of -*lease\_fee\_basis* times requested funds / 10k satoshis added to their channel -balance, paid by the opening node. Default is 0.65% (65 basis points) - -*funding\_weight* is used to calculate the fee the peer will compensate your -node for its contributing inputs to the funding transaction. The total fee -is calculated as the `open_channel2`.`funding_feerate_perkw` times this -*funding\_weight* divided by 1000. Node will have this funding fee added -to their channel balance, paid by the opening node. Default is -2 inputs + 1 P2WPKH output. - -*channel\_fee\_max\_base\_msat* is a commitment to a maximum -`channel_fee_base_msat` that your node will charge for routing payments -over this leased channel during the lease duration. Default is 5k sats. - -*channel\_fee\_max\_proportional\_thousandths* is a commitment to a maximum -`channel_fee_proportional_millionths` that your node will charge for -routing payments over this leased channel during the lease duration. -Note that it's denominated in 'thousandths'. A setting of `1` is equal -to 1k ppm; `5` is 5k ppm, etc. Default is 100 (100k ppm). - -*compact\_lease* is a compact description of the channel lease params. When -opening a channel, passed in to `fundchannel` to indicate the terms we -expect from the peer. +Setting any of the 5 options from *lease_fee_base_msat*, *lease_fee_basis*, *funding_weight*, *channel_fee_max_base_msat* and, *channel_fee_max_proportional_thousandths* will activate channel leases for this node, and advertise these values via the lightning gossip network. If any one is set, the other values will be the default. RETURN VALUE ------------ @@ -127,6 +44,9 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + The following error code may occur: - -32602: If the given parameters are invalid. @@ -141,7 +61,6 @@ SEE ALSO lightning-fundchannel(7), lightning-listfunds(7) - RESOURCES --------- diff --git a/doc/lightning-fundpsbt.7.md b/doc/lightning-fundpsbt.7.md index ec2697d25ff2..33d7b18e9fbe 100644 --- a/doc/lightning-fundpsbt.7.md +++ b/doc/lightning-fundpsbt.7.md @@ -12,38 +12,6 @@ DESCRIPTION `fundpsbt` is a low-level RPC command which creates a PSBT using unreserved inputs in the wallet, optionally reserving them as well. -*satoshi* is the minimum satoshi value of the output(s) needed (or the -string "all" meaning use all unreserved inputs). If a value, it can -be a whole number, a whole number ending in *sat*, a whole number -ending in *000msat*, or a number with 1 to 8 decimal places ending in -*btc*. - -*feerate* is an optional feerate: see NOTES in lightning-feerates(7) -for possible values. The default is *normal*. - -*startweight* is the weight of the transaction before *fundpsbt* has -added any inputs. - -*minconf* specifies the minimum number of confirmations that used -outputs should have. Default is 1. - -If *reserve* if not zero, then *reserveinputs* is called (successfully, with -*exclusive* true) on the returned PSBT for this number of blocks (default -72 blocks if unspecified). - -*locktime* is an optional locktime: if not set, it is set to a recent -block height. - -*min\_witness\_weight* is an optional minimum weight to use for a UTXO's -witness. If the actual witness weight is greater than the provided minimum, -the actual witness weight will be used. - -*excess\_as\_change* is an optional boolean to flag to add a change output -for the excess sats. - -*nonwrapped* is an optional boolean to signal to filter out any p2sh-wrapped -inputs from funding this PSBT. - EXAMPLE USAGE ------------- @@ -90,6 +58,9 @@ added to the PSBT for the excess amount. The *excess\_msat* will be zero. A *change\_outnum* will be returned with the index of the change output. +ERRORS +------ + On error the returned object will contain `code` and `message` properties, with `code` being one of the following: diff --git a/doc/lightning-getinfo.7.md b/doc/lightning-getinfo.7.md index f9488136ec47..f707a59de265 100644 --- a/doc/lightning-getinfo.7.md +++ b/doc/lightning-getinfo.7.md @@ -14,6 +14,7 @@ The **getinfo** gives a summary of the current running node. EXAMPLE JSON REQUEST ------------ + ```json { "id": 82, @@ -72,12 +73,16 @@ The following warnings may also be returned: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On failure, one of the following error codes may be returned: - -32602: Error in given parameters or some error happened during the command process. EXAMPLE JSON RESPONSE ----- + ```json { "id": "02bf811f7571754f0b51e6d41a8885f5561041a7b14fac093e4cffb95749de1a8d", diff --git a/doc/lightning-getlog.7.md b/doc/lightning-getlog.7.md index 9ab39594187b..b04bed0aa3e3 100644 --- a/doc/lightning-getlog.7.md +++ b/doc/lightning-getlog.7.md @@ -11,10 +11,9 @@ DESCRIPTION The **getlog** the RPC command to show logs, with optional log *level*. -- *level*: A string that represents the log level (*broken*, *unusual*, *info*, *debug*, or *io*). The default is *info*. - EXAMPLE JSON REQUEST -------------------- + ```json { "id": 82, @@ -58,6 +57,9 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On failure, one of the following error codes may be returned: - -32602: Error in given parameters. diff --git a/doc/lightning-getroute.7.md b/doc/lightning-getroute.7.md index d4739416128b..6ea413bcf80a 100644 --- a/doc/lightning-getroute.7.md +++ b/doc/lightning-getroute.7.md @@ -12,38 +12,11 @@ DESCRIPTION The **getroute** RPC command attempts to find the best route for the payment of *amount\_msat* to lightning node *id*, such that the payment will -arrive at *id* with *cltv*-blocks to spare (default 9). - -*amount\_msat* is in millisatoshi precision; it can be a whole number, or a -whole number ending in *msat* or *sat*, or a number with three decimal -places ending in *sat*, or a number with 1 to 11 decimal places ending -in *btc*. The 0 value is special: it ignores any *htlc\_minimum\_msat* -setting on channels, and simply returns a possible route (if any) which -is useful for simple probing. +arrive at *id* with *cltv*. There are two considerations for how good a route is: how low the fees are, and how long your payment will get stuck in a delayed output if a -node goes down during the process. The *riskfactor* non-negative -floating-point field controls this tradeoff; it is the annual cost of -your funds being stuck (as a percentage). - -For example, if you thought the convenience of keeping your funds liquid -(not stuck) was worth 20% per annum interest, *riskfactor* would be 20. - -If you didn't care about risk, *riskfactor* would be zero. - -*fromid* is the node to start the route from: default is this node. - -*fuzzpercent* was used to distort fees to provide some randomization to the -route generated, but it was not properly implemented and is ignored. - -*exclude* is a JSON array of short-channel-id/direction (e.g. [ -"564334x877x1/0", "564195x1292x0/1" ]) or node-id which should be excluded -from consideration for routing. The default is not to exclude any channels -or nodes. Note if the source or destination is excluded, the command result -is undefined. - -*maxhops* is the maximum number of channels to return; default is 20. +node goes down during the process. RISKFACTOR EFFECT ON ROUTING ---------------------------- diff --git a/doc/lightning-help.7.md b/doc/lightning-help.7.md index 5efe98337b88..fa24215632a7 100644 --- a/doc/lightning-help.7.md +++ b/doc/lightning-help.7.md @@ -17,6 +17,7 @@ page is not found. EXAMPLE JSON REQUEST -------------------- + ```json { "id": 82, @@ -39,6 +40,9 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On failure, one of the following error codes may be returned: - -32602: Error in given parameters. diff --git a/doc/lightning-hsmtool.8.md b/doc/lightning-hsmtool.8.md index 1f7ef09796bc..cabe5dc6bd9f 100644 --- a/doc/lightning-hsmtool.8.md +++ b/doc/lightning-hsmtool.8.md @@ -3,6 +3,7 @@ lightning-hsmtool -- Tool for working with software HSM secrets of lightningd SYNOPSIS -------- + ```bash lightning-hsmtool method [ARGUMENTS]... ``` @@ -92,6 +93,7 @@ to gain our eternal gratitude! AUTHOR ------ + ZmnSCPxj <> wrote the initial version of this man page, but many others did the hard work of actually implementing **lightning-hsmtool**. diff --git a/doc/lightning-invoice.7.md b/doc/lightning-invoice.7.md index 5c7dca5d5ef1..bfd7fb11d1a7 100644 --- a/doc/lightning-invoice.7.md +++ b/doc/lightning-invoice.7.md @@ -16,62 +16,6 @@ lightning daemon can use to pay this invoice. This token includes a *route hint* description of an incoming channel with capacity to pay the invoice, if any exists. -The *amount\_msat* parameter can be the string "any", which creates an -invoice that can be paid with any amount. Otherwise it is a positive value in -millisatoshi precision; it can be a whole number, or a whole number -ending in *msat* or *sat*, or a number with three decimal places ending -in *sat*, or a number with 1 to 11 decimal places ending in *btc*. - -The *label* must be a unique string or number (which is treated as a -string, so "01" is different from "1"); it is never revealed to other -nodes on the lightning network, but it can be used to query the status -of this invoice. - -The *description* is a short description of purpose of payment, e.g. *1 -cup of coffee*. This value is encoded into the BOLT11 invoice and is -viewable by any node you send this invoice to (unless *deschashonly* is -true as described below). It must be UTF-8, and cannot use *\\u* JSON -escape codes. - -The *expiry* is optionally the time the invoice is valid for, in seconds. -If no value is provided the default of 604800 (1 week) is used. - -The *fallbacks* array is one or more fallback addresses to include in -the invoice (in order from most-preferred to least): note that these -arrays are not currently tracked to fulfill the invoice. - -The *preimage* is a 64-digit hex string to be used as payment preimage -for the created invoice. By default, if unspecified, lightningd will -generate a secure pseudorandom preimage seeded from an appropriate -entropy source on your system. **IMPORTANT**: if you specify the -*preimage*, you are responsible, to ensure appropriate care for -generating using a secure pseudorandom generator seeded with sufficient -entropy, and keeping the preimage secret. This parameter is an advanced -feature intended for use with cutting-edge cryptographic protocols and -should not be used unless explicitly needed. - -If specified, *exposeprivatechannels* overrides the default route hint -logic, which will use unpublished channels only if there are no -published channels. If *true* unpublished channels are always considered -as a route hint candidate; if *false*, never. If it is a short channel id -(e.g. *1x1x3*) or array of short channel ids (or a remote alias), only those specific channels -will be considered candidates, even if they are public or dead-ends. - -The route hint is selected from the set of incoming channels of which: -peer's balance minus their reserves is at least *amount\_msat*, state is -normal, the peer is connected and not a dead end (i.e. has at least one -other public channel). The selection uses some randomness to prevent -probing, but favors channels that become more balanced after the -payment. - -If specified, *cltv* sets the *min\_final\_cltv\_expiry* for the invoice. -Otherwise, it's set to the parameter **cltv-final**. - -If *deschashonly* is true (default false), then the bolt11 returned -contains a hash of the *description*, rather than the *description* -itself: this allows much longer descriptions, but they must be -communicated via some other mechanism. - RETURN VALUE ------------ @@ -94,6 +38,9 @@ The following warnings may also be returned: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On failure, an error is returned and no invoice is created. If the lightning process fails before responding, the caller should use lightning-listinvoices(7) to query whether this invoice was created or diff --git a/doc/lightning-invoicerequest.7.md b/doc/lightning-invoicerequest.7.md index ede4998a7700..ce3c4f639688 100644 --- a/doc/lightning-invoicerequest.7.md +++ b/doc/lightning-invoicerequest.7.md @@ -17,33 +17,6 @@ invoice, and payment of it. The reader of the resulting `invoice_request` can use lightning-sendinvoice(7) to collect their payment. -The *amount* parameter can be a positive value in millisatoshi -precision; it can be a whole number, or a whole number ending in -*msat* or *sat*, or a number with three decimal places ending in -*sat*, or a number with 1 to 11 decimal places ending in *btc*. - -The *description* is a short description of purpose of the payment, -e.g. *ATM withdrawl*. This value is encoded into the resulting -`invoice_request` and is viewable by anyone you expose it to. It must -be UTF-8, and cannot use *\\u* JSON escape codes. - -The *issuer* is another (optional) field exposed in the -`invoice_request`, and reflects who is issuing it (i.e. you) if -appropriate. - -The *label* field is an internal-use name for the offer, which can -be any UTF-8 string. - -The *absolute\_expiry* is optionally the time the offer is valid -until, in seconds since the first day of 1970 UTC. If not set, the -`invoice_request` remains valid (though it can be deactivated by the -issuer of course). This is encoded in the `invoice_request`. - -*single\_use* (default true) indicates that the `invoice_request` is -only valid once; we may attempt multiple payments, but as soon as one -is successful no more invoices are accepted (i.e. only one person can -take the money). - RETURN VALUE ------------ @@ -59,6 +32,9 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On failure, an error is returned and no `invoice_request` is created. If the lightning process fails before responding, the caller should use lightning-listinvoicerequests(7) to query whether it was diff --git a/doc/lightning-keysend.7.md b/doc/lightning-keysend.7.md index 4b987c8cc15d..6ea58e9f9ecf 100644 --- a/doc/lightning-keysend.7.md +++ b/doc/lightning-keysend.7.md @@ -22,22 +22,6 @@ generated on the destination, and the only way sender could have it is by sending a payment. Please ensure that this matches your use-case when using `keysend`. -`destination` is the 33 byte, hex-encoded, node ID of the node that the payment should go to. -`amount\_msat` is in millisatoshi precision; it can be a whole number, or a whole number with suffix `msat` or `sat`, or a three decimal point number with suffix `sat`, or an 1 to 11 decimal point number suffixed by `btc`. - -The `label` field is used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7). -The `maxfeepercent` limits the money paid in fees as percentage of the total amount that is to be transferred, and defaults to *0.5*. -The `exemptfee` option can be used for tiny payments which would be dominated by the fee leveraged by forwarding nodes. -Setting `exemptfee` allows the `maxfeepercent` check to be skipped on fees that are smaller than *exemptfee* (default: 5000 millisatoshi). - -The response will occur when the payment fails or succeeds. -Unlike lightning-pay(7), issuing the same `keysend` commands multiple times will result in multiple payments being sent. - -Until *retry\_for* seconds passes (default: 60), the command will keep finding routes and retrying the payment. -However, a payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case. - -*extratlvs* is an optional dictionary of additional fields to insert into the final tlv. The format is 'fieldnumber': 'hexstring'. - When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name. @@ -87,6 +71,9 @@ The following warnings may also be returned: You can monitor the progress and retries of a payment using the lightning-paystatus(7) command. +ERRORS +------ + The following error codes may occur: - `-1`: Catchall nonspecific error. diff --git a/doc/lightning-listchannels.7.md b/doc/lightning-listchannels.7.md index dca5003065a3..581a0a679b25 100644 --- a/doc/lightning-listchannels.7.md +++ b/doc/lightning-listchannels.7.md @@ -13,18 +13,6 @@ The **listchannels** RPC command returns data on channels that are known to the node. Because channels may be bidirectional, up to 2 objects will be returned for each channel (one for each direction). -Note that for local channels, listpeerchannels(7) gives much more detailed -information: **listchannels** only shows public gossip information (previously it merged local information, but that was deprecated in *v24.02*). - -If *short\_channel\_id* is a short channel id, then only known channels with a -matching *short\_channel\_id* are returned. Otherwise, it must be null. - -If *source* is a node id, then only channels leading from that node id -are returned. - -If *destination* is a node id, then only channels leading to that node id -are returned. - Only one of *short\_channel\_id*, *source* or *destination* can be supplied. If nothing is supplied, data on all lightning channels known to this node, are returned. These can be local channels or public channels @@ -58,6 +46,9 @@ On success, an object containing **channels** is returned. It is an array of ob If one of *short\_channel\_id*, *source* or *destination* is supplied and no matching channels are found, a "channels" object with an empty list is returned. +ERRORS +------ + On error the returned object will contain `code` and `message` properties, with `code` being one of the following: diff --git a/doc/lightning-listclosedchannels.7.md b/doc/lightning-listclosedchannels.7.md index 7c74836bf3ed..e02a0023c661 100644 --- a/doc/lightning-listclosedchannels.7.md +++ b/doc/lightning-listclosedchannels.7.md @@ -13,10 +13,6 @@ The **listclosedchannels** RPC command returns data on channels which are otherwise forgotten (more than 100 blocks after they're completely resolved onchain). -If no *id* is supplied, then channel data on all historical channels are given. - -Supplying *id* will filter the results to only match channels to that peer. Note that prior to v23.05, old peers were forgotten. - RETURN VALUE ------------ @@ -55,7 +51,8 @@ On success, an object containing **closedchannels** is returned. It is an array - **last\_commitment\_fee\_msat** (msat, optional): The fee on `last_commitment_txid` - **last\_stable\_connection** (u64, optional): Last time we reestablished the open channel and stayed connected for 1 minute *(added v24.02)* -[comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ On error the returned object will contain `code` and `message` properties, with `code` being one of the following: diff --git a/doc/lightning-listconfigs.7.md b/doc/lightning-listconfigs.7.md index 93395d97d5af..2bd276e29363 100644 --- a/doc/lightning-listconfigs.7.md +++ b/doc/lightning-listconfigs.7.md @@ -9,8 +9,6 @@ SYNOPSIS DESCRIPTION ----------- -*config* (optional) is a configuration option name to restrict return. - The **listconfigs** RPC command to list all configuration options, or with *config* only one. The returned values reflect the current configuration, including @@ -365,6 +363,8 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ On failure, one of the following error codes may be returned: diff --git a/doc/lightning-listdatastore.7.md b/doc/lightning-listdatastore.7.md index 1e25879bfbaf..980b2e119e3b 100644 --- a/doc/lightning-listdatastore.7.md +++ b/doc/lightning-listdatastore.7.md @@ -12,9 +12,6 @@ DESCRIPTION The **listdatastore** RPC command allows plugins to fetch data which was stored in the Core Lightning database. -All immediate children of the *key* (or root children) are returned: -a *key* with children won't have a *hex* or *generation* entry. - RETURN VALUE ------------ @@ -29,6 +26,9 @@ On success, an object containing **datastore** is returned. It is an array of o [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + The following error codes may occur: - -32602: invalid parameters. diff --git a/doc/lightning-listforwards.7.md b/doc/lightning-listforwards.7.md index c47e0603f5a6..2c87519b077d 100644 --- a/doc/lightning-listforwards.7.md +++ b/doc/lightning-listforwards.7.md @@ -12,18 +12,6 @@ DESCRIPTION The **listforwards** RPC command displays all htlcs that have been attempted to be forwarded by the Core Lightning node. -If *status* is specified, then only the forwards with the given status are returned. -*status* can be either *offered* or *settled* or *failed* or *local\_failed* - -If *in\_channel* or *out\_channel* is specified, then only the matching forwards -on the given in/out channel are returned. - -If neither *in\_channel* or *out\_channel* is specified, -`index` controls ordering, by `created` (default) or `updated`. If -`index` is specified, `start` may be specified to start from that -value, which is generally returned from lightning-wait(7), and `limit` -can be used to specify the maximum number of entries to return. - RETURN VALUE ------------ diff --git a/doc/lightning-listfunds.7.md b/doc/lightning-listfunds.7.md index 8d1b68b7de52..5a50c5137681 100644 --- a/doc/lightning-listfunds.7.md +++ b/doc/lightning-listfunds.7.md @@ -13,9 +13,6 @@ The **listfunds** RPC command displays all funds available, either in unspent outputs (UTXOs) in the internal wallet or funds locked in currently open channels. -*spent* is a boolean: if true, then the *outputs* will include spent outputs -in addition to the unspent ones. Default is false. - RETURN VALUE ------------ diff --git a/doc/lightning-listhtlcs.7.md b/doc/lightning-listhtlcs.7.md index 2fe30c6e3744..6d6513f63025 100644 --- a/doc/lightning-listhtlcs.7.md +++ b/doc/lightning-listhtlcs.7.md @@ -11,9 +11,7 @@ DESCRIPTION The **listhtlcs** RPC command gets all HTLCs (which, generally, we remember for as long as a channel is open, even if they've completed -long ago). If given a short channel id (e.g. 1x2x3) or full 64-byte -hex channel id, it will only list htlcs for that channel (which -must be known). +long ago). RETURN VALUE ------------ diff --git a/doc/lightning-listinvoicerequests.7.md b/doc/lightning-listinvoicerequests.7.md index 8dd5f27e9333..3aa138b4e66f 100644 --- a/doc/lightning-listinvoicerequests.7.md +++ b/doc/lightning-listinvoicerequests.7.md @@ -12,11 +12,6 @@ DESCRIPTION The **listinvoicerequests** RPC command gets the status of a specific `invoice_request`, if it exists, or the status of all `invoice_requests` if given no argument. -A specific invoice can be queried by providing the `invreq_id`, which -is presented by lightning-invoicerequest(7), or can be calculated from -a bolt12 invoice. If `active_only` is `true` (default is `false`) then -only active invoice\_requests are returned. - RETURN VALUE ------------ diff --git a/doc/lightning-listinvoices.7.md b/doc/lightning-listinvoices.7.md index 32c45db1deb7..0cd4891f9842 100644 --- a/doc/lightning-listinvoices.7.md +++ b/doc/lightning-listinvoices.7.md @@ -12,15 +12,7 @@ DESCRIPTION The **listinvoices** RPC command gets the status of a specific invoice, if it exists, or the status of all invoices if given no argument. -A specific invoice can be queried by providing either the `label` -provided when creating the invoice, the `invstring` string representing -the invoice, the `payment_hash` of the invoice, or the local `offer_id` -this invoice was issued for. Only one of the query parameters can be used at once. - -`index` controls ordering, by `created` (default) or `updated`. If -`index` is specified, `start` may be specified to start from that -value, which is generally returned from lightning-wait(7), and `limit` -can be used to specify the maximum number of entries to return. +Only one of the query parameters can be used from *label*, *invstring*, *payment_hash*, or *offer_id* RETURN VALUE ------------ diff --git a/doc/lightning-listnodes.7.md b/doc/lightning-listnodes.7.md index ab83f066872b..19fa8719fc1a 100644 --- a/doc/lightning-listnodes.7.md +++ b/doc/lightning-listnodes.7.md @@ -13,6 +13,7 @@ The **listnodes** command returns nodes the node has learned about via gossip me EXAMPLE JSON REQUEST ------------ + ```json { "id": 82, @@ -57,12 +58,16 @@ If **option\_will\_fund** is present: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On failure, one of the following error codes may be returned: - -32602: Error in given parameters. EXAMPLE JSON RESPONSE ----- + ```json { "nodes": [ @@ -84,7 +89,6 @@ EXAMPLE JSON RESPONSE } ``` - AUTHOR ------ @@ -93,7 +97,7 @@ Vincenzo Palazzo <> wrote the initial version o SEE ALSO -------- -FIXME: +lightning-listchannels(7) RESOURCES --------- diff --git a/doc/lightning-listoffers.7.md b/doc/lightning-listoffers.7.md index a1a31577141a..e8ca36a8d924 100644 --- a/doc/lightning-listoffers.7.md +++ b/doc/lightning-listoffers.7.md @@ -3,6 +3,7 @@ lightning-listoffers -- Command for listing offers SYNOPSIS -------- + **(WARNING: experimental-offers only)** **listoffers** [*offer\_id*] [*active\_only*] @@ -11,11 +12,11 @@ DESCRIPTION ----------- The **listoffers** RPC command list all offers, or with `offer_id`, -only the offer with that offer\_id (if it exists). If `active_only` is -set and is true, only offers with `active` true are returned. +only the offer with that offer\_id (if it exists). EXAMPLE JSON REQUEST ------------ + ```json { "id": 82, @@ -43,6 +44,7 @@ On success, an object containing **offers** is returned. It is an array of obje EXAMPLE JSON RESPONSE ----- + ```json { "offers": [ diff --git a/doc/lightning-listpays.7.md b/doc/lightning-listpays.7.md index d82e413bcea2..60411c39c672 100644 --- a/doc/lightning-listpays.7.md +++ b/doc/lightning-listpays.7.md @@ -11,7 +11,6 @@ DESCRIPTION The **listpay** RPC command gets the status of all *pay* commands, or a single one if either *bolt11* or *payment\_hash* was specified. -It is possible filter the payments also by *status*. RETURN VALUE ------------ diff --git a/doc/lightning-listpeerchannels.7.md b/doc/lightning-listpeerchannels.7.md index 2aa51ac92284..13d3e36b43c8 100644 --- a/doc/lightning-listpeerchannels.7.md +++ b/doc/lightning-listpeerchannels.7.md @@ -15,9 +15,6 @@ If no *id* is supplied, then channel data on all lightning nodes that are connected, or not connected but have open channels with this node, are returned. -Supplying *id* will filter the results to only return channel data that match *id*, -if one exists. - RETURN VALUE ------------ @@ -198,6 +195,9 @@ The *state* field values (and *old\_state* / *new\_state*) are worth describing know what happened (i.e. if it was a proper unilateral close by the peer, or a theft attempt). +ERRORS +------ + On error the returned object will contain `code` and `message` properties, with `code` being one of the following: @@ -211,8 +211,7 @@ Michael Hawkins <>. SEE ALSO -------- -lightning-connect(7), lightning-fundchannel\_start(7), -lightning-setchannelfee(7) +lightning-connect(7), lightning-fundchannel\_start(7) RESOURCES --------- diff --git a/doc/lightning-listpeers.7.md b/doc/lightning-listpeers.7.md index fe3c12cd5ff8..2c1d0b4e7dcd 100644 --- a/doc/lightning-listpeers.7.md +++ b/doc/lightning-listpeers.7.md @@ -20,13 +20,6 @@ If no *id* is supplied, then data on all lightning nodes that are connected, or not connected but have open channels with this node, are returned. -Supplying *id* will filter the results to only return data on a node -with a matching *id*, if one exists. - -Supplying *level* will show log entries related to that peer at the -given log level. Valid log levels are "io", "debug", "info", and -"unusual". - If a channel is open with a node and the connection has been lost, then the node will still appear in the output of the command and the value of the *connected* attribute of the node will be "false". @@ -377,6 +370,9 @@ Objects in the *htlcs* array will contain these fields: Generally true if the HTLC is below the *dust\_limit\_msat* for the channel. +ERRORS +------ + On error the returned object will contain `code` and `message` properties, with `code` being one of the following: diff --git a/doc/lightning-listsendpays.7.md b/doc/lightning-listsendpays.7.md index 26b7d00d68fb..141b468550c2 100644 --- a/doc/lightning-listsendpays.7.md +++ b/doc/lightning-listsendpays.7.md @@ -12,17 +12,11 @@ DESCRIPTION The **listsendpays** RPC command gets the status of all *sendpay* commands (which is also used by the *pay* command), or with *bolt11* or *payment\_hash* limits results to that specific payment. You cannot -specify both. It is possible filter the payments also by *status*. +specify both. It is possible to filter the payments also by *status*. Note that there may be more than one concurrent *sendpay* command per *pay*, so this command should be used with caution. -If neither *bolt11* or *payment\_hash* is specified, -`index` controls ordering, by `created` (default) or `updated`. If -`index` is specified, `start` may be specified to start from that -value, which is generally returned from lightning-wait(7), and `limit` -can be used to specify the maximum number of entries to return. - RETURN VALUE ------------ diff --git a/doc/lightning-listsqlschemas.7.md b/doc/lightning-listsqlschemas.7.md index f399f6ed32e5..e0426ab2a6a1 100644 --- a/doc/lightning-listsqlschemas.7.md +++ b/doc/lightning-listsqlschemas.7.md @@ -19,6 +19,7 @@ all tables are listed. EXAMPLE JSON REQUEST ------------ + ```json { "id": 82, @@ -31,6 +32,7 @@ EXAMPLE JSON REQUEST EXAMPLE JSON RESPONSE ----- + ```json { "schemas": [ diff --git a/doc/lightning-listtransactions.7.md b/doc/lightning-listtransactions.7.md index 43a0c9881969..9b0850fbd0fe 100644 --- a/doc/lightning-listtransactions.7.md +++ b/doc/lightning-listtransactions.7.md @@ -13,6 +13,7 @@ The **listtransactions** command returns transactions tracked in the wallet. Thi EXAMPLE JSON REQUEST ------------ + ```json { "id": 82, @@ -44,12 +45,16 @@ On success, an object containing **transactions** is returned. It is an array o [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On failure, one of the following error codes may be returned: - -32602: Error in given parameters. EXAMPLE JSON RESPONSE ----- + ```json { "transactions": [ diff --git a/doc/lightning-makesecret.7.md b/doc/lightning-makesecret.7.md index d6d93db5c01b..abb078519839 100644 --- a/doc/lightning-makesecret.7.md +++ b/doc/lightning-makesecret.7.md @@ -11,9 +11,6 @@ DESCRIPTION The **makesecret** RPC command derives a secret key from the HSM\_secret. -One of *hex* or *string* must be specified: *hex* can be any hex data, -*string* is a UTF-8 string interpreted literally. - RETURN VALUE ------------ @@ -24,6 +21,8 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ The following error codes may occur: diff --git a/doc/lightning-multifundchannel.7.md b/doc/lightning-multifundchannel.7.md index 888c7bea1e87..25e5a3678282 100644 --- a/doc/lightning-multifundchannel.7.md +++ b/doc/lightning-multifundchannel.7.md @@ -22,87 +22,6 @@ Once the transaction is confirmed, normal channel operations may begin. Readiness is indicated by **listpeers** reporting a *state* of `CHANNELD_NORMAL` for the channel. -*destinations* is an array of objects, with the fields: - -* *id* is the node ID, with an optional *@host:port* appended to it - in a manner understood by **connect**; see lightning-connect(7). - Each entry in the *destinations* array must have a unique node *id*. -* *amount* is the amount in satoshis taken from the internal wallet - to fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). - The string *all* can be used to specify all available funds - (or 16,777,215 satoshi if more is available and large channels were - not negotiated with the peer). - Otherwise it is in satoshi precision; it can be - a whole number, - a whole number ending in *sat*, - a whole number ending in *000msat*, or - a number with 1 to 8 decimal places ending in *btc*. - The value cannot be less than the dust limit, currently 546 satoshi - as of this writing, nor more than 16,777,215 satoshi - (unless large channels were negotiated with the peer). -* *announce* is an optional flag that indicates whether to announce - the channel with this, default `true`. - If set to `false`, the channel is unpublished. -* *push\_msat* is the amount of millisatoshis to outright give to the - node. - This is a gift to the peer, and you do not get a proof-of-payment - out of this. -* *close\_to* is a Bitcoin address to which the channel funds should be sent to - on close. Only valid if both peers have negotiated - `option_upfront_shutdown_script`. Returns `close_to` set to - closing script iff is negotiated. -* *request\_amt* is the amount of liquidity you'd like to lease from peer. - If peer supports `option_will_fund`, indicates to them to include this - much liquidity into the channel. Must also pass in *compact\_lease*. -* *compact\_lease* is a compact represenation of the peer's expected - channel lease terms. If the peer's terms don't match this set, we will - fail to open the channel to this destination. -* *reserve* is the amount we want the peer to maintain on its side of the - channel. Default is 1% of the funding amount. It can be a whole number, a - whole number ending in *sat*, a whole number ending in *000msat*, or a number - with 1 to 8 decimal places ending in *btc*. - -There must be at least one entry in *destinations*; -it cannot be an empty array. - -*feerate* is an optional feerate used for the opening transaction, and -if *commitment\_feerate* is not set, as initial feerate for commitment -and HTLC transactions. See NOTES in lightning-feerates(7) for possible -values. The default is *normal*. - -*minconf* specifies the minimum number of confirmations that used -outputs should have. Default is 1. - -*utxos* specifies the utxos to be used to fund the channel, as an array -of "txid:vout". - -*minchannels*, if specified, will re-attempt funding as long as at least -this many peers remain (must not be zero). -The **multifundchannel** command will only fail if too many peers fail -the funding process. - -*commitment\_feerate* is the initial feerate for commitment and HTLC -transactions. See *feerate* for valid values. - -*channel\_type* *(added v24.02)* is an array of bit numbers, representing the explicit -channel type to request. BOLT 2 defines the following value types: - -``` -*channel\_type* *(added v24.02)* is an array of bit numbers, representing the explicit -channel type to request. BOLT 2 defines the following value types: - -``` -The currently defined basic types are: - - no features (no bits set) `[]` - - `option_static_remotekey` (`[12]`) - - `option_anchor_outputs` and `option_static_remotekey` (`[20, 12]`) - - `option_anchors_zero_fee_htlc_tx` and `option_static_remotekey` ([22, 12]) - -Each basic type has the following variations allowed: - - `option_scid_alias` ([46]) - - `option_zeroconf` ([50]) -``` - RETURN VALUE ------------ @@ -140,6 +59,9 @@ On success, an object is returned, containing: On failure, none of the channels are created. +ERRORS +------ + The following error codes may occur: * -1: Catchall nonspecific error. @@ -167,8 +89,8 @@ Doing a **connect** with the peers separately, and waiting for a few seconds, should help clear this hurdle; running **multifundchannel** a third time would also clear this. -EXAMPLE -------- +EXAMPLE USAGE +------------- This example opens three channels at once, with amounts 200,000 sats, 3,000,000 sats and the final channel using all remaining funds (actually, capped at 16,777,215 sats because large-channels is not enabled): diff --git a/doc/lightning-multiwithdraw.7.md b/doc/lightning-multiwithdraw.7.md index ca450b66d708..5bface5c4f26 100644 --- a/doc/lightning-multiwithdraw.7.md +++ b/doc/lightning-multiwithdraw.7.md @@ -4,31 +4,13 @@ lightning-multiwithdraw -- Command for withdrawing to multiple addresses SYNOPSIS -------- -**multiwithdraw** *outputs* [*feerate*] [*minconf*] [*utxos*] +**multiwithdraw** *outputs* [*feerate*] [*minconf*] [*utxos*] DESCRIPTION ----------- The **multiwithdraw** RPC command sends funds from Core Lightning's internal -wallet to the addresses specified in *outputs*, -which is an array containing objects of the form `{address: amount}`. -The `amount` may be the string *"all"*, indicating that all onchain funds -be sent to the specified address. -Otherwise, it is in satoshi precision; -it can be -a whole number, -a whole number ending in *sat*, -a whole number ending in *000msat*, -or a number with 1 to 8 decimal places ending in *btc*. - -*feerate* is an optional feerate: see NOTES in lightning-feerates(7) -for possible values. The default is *normal*. - -*minconf* specifies the minimum number of confirmations that used -outputs should have. Default is 1. - -*utxos* specifies the utxos to be used to be withdrawn from, as an array -of "txid:vout". These must be drawn from the node's available UTXO set. +wallet to the addresses specified in *outputs*. RETURN VALUE ------------ @@ -41,6 +23,9 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On failure, an error is reported and the withdrawal transaction is not created. diff --git a/doc/lightning-newaddr.7.md b/doc/lightning-newaddr.7.md index 3fcc67d9fa78..ea0dd95644d7 100644 --- a/doc/lightning-newaddr.7.md +++ b/doc/lightning-newaddr.7.md @@ -14,15 +14,7 @@ subsequently be used to fund channels managed by the Core Lightning node. The funding transaction needs to be confirmed before funds can be used. -*addresstype* specifies the type of address wanted; currently *bech32* -(e.g. `tb1qu9j4lg5f9rgjyfhvfd905vw46eg39czmktxqgg` on bitcoin testnet -or `bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej` on -bitcoin mainnet), or *p2tr* taproot addresses. The special value *all* -generates all known address types for the same underlying key. - -If no *addresstype* is specified the address generated is a *bech32* address. - -To send an on-chain payment _from_ the Core Lightning node wallet, use `withdraw`. +To send an on-chain payment from the Core Lightning node wallet, use `withdraw`. RETURN VALUE ------------ diff --git a/doc/lightning-notifications.7.md b/doc/lightning-notifications.7.md index 3f39affd36ec..8a6455195d37 100644 --- a/doc/lightning-notifications.7.md +++ b/doc/lightning-notifications.7.md @@ -16,10 +16,9 @@ disabled. Various commands, especially complex and slow ones, offer notifications which indicate their progress. -- *enable*: *true* to enable notifications, *false* to disable them. - EXAMPLE JSON REQUEST -------------------- + ```json { "id": 82, @@ -60,12 +59,15 @@ On success, an empty object is returned. On success, if *enable* was *true*, notifications will be forwarded from then on. +ERRORS +------ + On failure, one of the following error codes may be returned: - -32602: Error in given parameters. -EXAMPLE NOTIFICATIONS ---------------------- +EXAMPLE JSON NOTIFICATIONS +-------------------------- ```json { diff --git a/doc/lightning-offer.7.md b/doc/lightning-offer.7.md index df237c703fd3..e5b6ed07b13b 100644 --- a/doc/lightning-offer.7.md +++ b/doc/lightning-offer.7.md @@ -106,6 +106,9 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On failure, an error is returned and no offer is created. If the lightning process fails before responding, the caller should use lightning-listoffers(7) to query whether this offer was created or diff --git a/doc/lightning-openchannel_abort.7.md b/doc/lightning-openchannel_abort.7.md index d8ad16c1ba27..cedb79dbef87 100644 --- a/doc/lightning-openchannel_abort.7.md +++ b/doc/lightning-openchannel_abort.7.md @@ -13,9 +13,6 @@ DESCRIPTION open with a specified peer. It uses the openchannel protocol which allows for interactive transaction construction. -*channel\_id* is id of this channel. - - RETURN VALUE ------------ @@ -28,6 +25,9 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On error the returned object will contain `code` and `message` properties, with `code` being one of the following: diff --git a/doc/lightning-openchannel_bump.7.md b/doc/lightning-openchannel_bump.7.md index 388d6efb0d14..88a4eea73018 100644 --- a/doc/lightning-openchannel_bump.7.md +++ b/doc/lightning-openchannel_bump.7.md @@ -13,23 +13,6 @@ DESCRIPTION RBF (Replace-By-Fee) for the specified channel. It uses the openchannel protocol which allows for interactive transaction construction. -*id* is the id of the channel to RBF. - -*amount* is the satoshi value that we will contribute to the channel. -This value will be _added_ to the provided PSBT in the output which is -encumbered by the 2-of-2 script for this channel. - -*initialpsbt* is the funded, incomplete PSBT that specifies the UTXOs and -change output for our channel contribution. It can be updated, -see `openchannel_update`; *initialpsbt* must have at least one input. -Must have the Non-Witness UTXO (PSBT\_IN\_NON\_WITNESS\_UTXO) set for -every input. An error (code 309) will be returned if this requirement -is not met. - -*funding\_feerate* is an optional field. Sets the feerate for the -funding transaction. Defaults to 1/64th greater than the last -feerate used for this channel. - Warning: bumping a leased channel will lose the lease. RETURN VALUE @@ -57,6 +40,9 @@ will return an error. If the channel is not in a state that is eligible for RBF, this command will return an error. +ERRORS +------ + On error the returned object will contain `code` and `message` properties, with `code` being one of the following: diff --git a/doc/lightning-openchannel_init.7.md b/doc/lightning-openchannel_init.7.md index c82df91f55fd..1654dc0308e0 100644 --- a/doc/lightning-openchannel_init.7.md +++ b/doc/lightning-openchannel_init.7.md @@ -13,54 +13,6 @@ DESCRIPTION open with a specified peer. It uses the openchannel protocol which allows for interactive transaction construction. -*id* is the node id of the remote peer. - -*amount* is the satoshi value that we will contribute to the channel. -This value will be _added_ to the provided PSBT in the output which is -encumbered by the 2-of-2 script for this channel. - -*initialpsbt* is the funded, incomplete PSBT that specifies the UTXOs and -change output for our channel contribution. It can be updated, -see `openchannel_update`; *initialpsbt* must have at least one input. -Must have the Non-Witness UTXO (PSBT\_IN\_NON\_WITNESS\_UTXO) set for -every input. An error (code 309) will be returned if this requirement -is not met. - -*commitment\_feerate* is an optional field. Sets the feerate for -commitment transactions for non-anchor channels: see **fundchannel**. -For anchor channels, it is ignored. - -*funding\_feerate* is an optional field. Sets the feerate for the -funding transaction. Defaults to 'opening' feerate. - -*announce* is an optional field. Whether or not to announce this channel. - -*close\_to* is a Bitcoin address to which the channel funds should be -sent on close. Only valid if both peers have negotiated -`option_upfront_shutdown_script`. - -*request\_amt* is an amount of liquidity you'd like to lease from the peer. -If peer supports `option_will_fund`, indicates to them to include this -much liquidity into the channel. Must also pass in *compact\_lease*. - -*compact\_lease* is a compact represenation of the peer's expected -channel lease terms. If the peer's terms don't match this set, we will -fail to open the channel. - -*channel\_type* *(added v24.02)* is an array of bit numbers, representing the explicit -channel type to request. BOLT 2 defines the following value types: - -The currently defined basic types are: - - no features (no bits set) `[]` - - `option_static_remotekey` (`[12]`) - - `option_anchor_outputs` and `option_static_remotekey` (`[20, 12]`) - - `option_anchors_zero_fee_htlc_tx` and `option_static_remotekey` ([22, 12]) - -Each basic type has the following variations allowed: - - `option_scid_alias` ([46]) - - `option_zeroconf` ([50]) -``` - RETURN VALUE ------------ @@ -91,6 +43,9 @@ updated rate card for the lease fee (*lease\_fee\_proportional\_basis*, be added to the lease fee at a rate of *funding\_feerate* * *weight\_charge* / 1000. +ERRORS +------ + On error the returned object will contain `code` and `message` properties, with `code` being one of the following: diff --git a/doc/lightning-openchannel_signed.7.md b/doc/lightning-openchannel_signed.7.md index 08ac9c1299dd..dfc6e72258d3 100644 --- a/doc/lightning-openchannel_signed.7.md +++ b/doc/lightning-openchannel_signed.7.md @@ -19,13 +19,6 @@ This command should be called after `openchannel_update` returns This command will broadcast the finalized funding transaction, if we receive valid signatures from the peer. -*channel\_id* is the id of the channel. - -*signed\_psbt* is the PSBT returned from `openchannel_update` (where -*commitments\_secured* was true) with partial signatures or finalized -witness stacks included for every input that we contributed to the -PSBT. - RETURN VALUE ------------ @@ -38,6 +31,9 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On error, the returned object will contain `code` and `message` properties, with `code` being one of the following: diff --git a/doc/lightning-openchannel_update.7.md b/doc/lightning-openchannel_update.7.md index 1e2726b9e0c4..92af793972d9 100644 --- a/doc/lightning-openchannel_update.7.md +++ b/doc/lightning-openchannel_update.7.md @@ -20,10 +20,6 @@ Must be called until *commitments\_secured* is returned as true, at which point `openchannel_signed` should be called with a signed version of the PSBT returned by the last call to `openchannel_update`. -*channel\_id* is the id of the channel. - -*psbt* is the updated PSBT to be sent to the peer. May be identical to -the PSBT last returned by either `openchannel_init` or `openchannel_update`. RETURN VALUE ------------ @@ -53,6 +49,9 @@ If *commitments\_secured* is true, will also return: - The *funding\_outnum*, the index of the funding output for this channel in the funding transaction. +ERRORS +------ + On error, the returned object will contain `code` and `message` properties, with `code` being one of the following: diff --git a/doc/lightning-pay.7.md b/doc/lightning-pay.7.md index 99855f096c24..44d629d0c6a1 100644 --- a/doc/lightning-pay.7.md +++ b/doc/lightning-pay.7.md @@ -12,57 +12,12 @@ DESCRIPTION ----------- The **pay** RPC command attempts to find a route to the given -destination, and send the funds it asks for. If the *bolt11* does not -contain an amount, *amount\_msat* is required, otherwise if it is specified -it must be *null*. *amount\_msat* is in millisatoshi precision; it can be a -whole number, or a whole number with suffix *msat* or *sat*, or a three -decimal point number with suffix *sat*, or an 1 to 11 decimal point -number suffixed by *btc*. - -(Note: if **experimental-offers** is enabled, *bolt11* can actually be -a bolt12 invoice, such as one received from lightningd-fetchinvoice(7)). - -The *label* field is used to attach a label to payments, and is returned -in lightning-listpays(7) and lightning-listsendpays(7). The *riskfactor* -is described in detail in lightning-getroute(7), and defaults to 10. The -*maxfeepercent* limits the money paid in fees, and defaults to 0.5. The -`maxfeepercent` is a percentage of the amount that is to be paid. The `exemptfee` -option can be used for tiny payments which would be dominated by the fee -leveraged by forwarding nodes. Setting `exemptfee` allows the -`maxfeepercent` check to be skipped on fees that are smaller than -`exemptfee` (default: 5000 millisatoshi). - -`localinvreqid` is used by offers to link a payment attempt to a local -`invoice_request` offer created by lightningd-invoicerequest(7). This ensures -that we only make a single payment for an offer, and that the offer is -marked `used` once paid. - -*maxfee* overrides both *maxfeepercent* and *exemptfee* defaults (and -if you specify *maxfee* you cannot specify either of those), and -creates an absolute limit on what fee we will pay. This allows you to -implement your own heuristics rather than the primitive ones used -here. - -*description* is only required for bolt11 invoices which do not -contain a description themselves, but contain a description hash: -in this case *description* is required. -*description* is then checked against the hash inside the invoice -before it will be paid. +destination, and send the funds it asks for. The response will occur when the payment fails or succeeds. Once a payment has succeeded, calls to **pay** with the same *bolt11* will succeed immediately. -Until *retry\_for* seconds passes (default: 60), the command will keep -finding routes and retrying the payment. However, a payment may be -delayed for up to `maxdelay` blocks by another node; clients should be -prepared for this worst case. - -*exclude* is a JSON array of short-channel-id/direction (e.g. [ -"564334x877x1/0", "564195x1292x0/1" ]) or node-id which should be excluded -from consideration for routing. The default is not to exclude any channels -or nodes. - When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name. @@ -114,6 +69,9 @@ The following warnings may also be returned: You can monitor the progress and retries of a payment using the lightning-paystatus(7) command. +ERRORS +------ + The following error codes may occur: - -1: Catchall nonspecific error. diff --git a/doc/lightning-ping.7.md b/doc/lightning-ping.7.md index b57e277222e2..ee921f16cd02 100644 --- a/doc/lightning-ping.7.md +++ b/doc/lightning-ping.7.md @@ -12,15 +12,9 @@ DESCRIPTION The **ping** command checks if the node with *id* is ready to talk. It currently only works for peers we have a channel with. -It accepts the following parameters: - -- *id*: A string that represents the node id; -- *len*: A integer that represents the length of the ping (default 128); -- *pongbytes*: An integer that represents the length of the reply (default 128). - A value of 65532 to 65535 means "don't reply". - EXAMPLE JSON REQUEST ------------ + ```json { "id": 82, @@ -42,12 +36,16 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On failure, one of the following error codes may be returned: - -32602: Error in given parameters or we're already waiting for a ping response from peer. EXAMPLE JSON RESPONSE ----- + ```json { "totlen": 132 diff --git a/doc/lightning-plugin.7.md b/doc/lightning-plugin.7.md index 41e9fe67cf67..36a778993a89 100644 --- a/doc/lightning-plugin.7.md +++ b/doc/lightning-plugin.7.md @@ -10,18 +10,9 @@ SYNOPSIS DESCRIPTION ----------- -The **plugin** RPC command command can be used to control dynamic plugins, +The **plugin** RPC command can be used to control dynamic plugins, i.e. plugins that declared themself "dynamic" (in getmanifest). -*subcommand* can be **start**, **stop**, **startdir**, **rescan** or **list** and -determines what action is taken - -*plugin* is the *path* or *name* of a plugin executable to start or stop - -*directory* is the *path* of a directory containing plugins - -*options* are optional *keyword=value* options passed to plugin, can be repeated - *subcommand* **start** takes a *path* to an executable as argument and starts it as plugin. *path* may be an absolute path or a path relative to the plugins directory (default *~/.lightning/plugins*). If the plugin is already running and the executable (checksum) has changed, the plugin is @@ -71,11 +62,15 @@ If **command** is "stop": [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On error, the reason why the action could not be taken upon the plugin is returned. SEE ALSO -------- + lightning-cli(1), lightning-listconfigs(1), [writing plugins][writing plugins] AUTHOR @@ -89,4 +84,5 @@ RESOURCES Main web site: [writing plugins]: PLUGINS.md + [comment]: # ( SHA256STAMP:83b40cc97b040fc0d7d47ebfda887c7c7ab0f305330978cd8426b6eed01737d2) diff --git a/doc/lightning-preapprovekeysend.7.md b/doc/lightning-preapprovekeysend.7.md index e22c58de7ddd..c9a6940af90e 100644 --- a/doc/lightning-preapprovekeysend.7.md +++ b/doc/lightning-preapprovekeysend.7.md @@ -13,15 +13,6 @@ The **preapprovekeysend** RPC command submits the *destination*, *payment\_hash* and *amount\_msat* parameters to the HSM to check that they are approved as a keysend payment. -*destination* is a 33 byte, hex-encoded, node ID of the node that the payment should go to. - -*payment\_hash* is the unique identifier of a payment. - -*amount\_msat* is the amount to send in millisatoshi precision; it can -be a whole number, or a whole number with suffix `msat` or `sat`, or a -three decimal point number with suffix `sat`, or an 1 to 11 decimal -point number suffixed by `btc`. - Generally the **preapprovekeysend** request does not need to be made explicitly, it is automatically generated as part of a **keysend** request. diff --git a/doc/lightning-renepay.7.md b/doc/lightning-renepay.7.md index fc3bb73fbd51..10f89315726b 100644 --- a/doc/lightning-renepay.7.md +++ b/doc/lightning-renepay.7.md @@ -7,7 +7,6 @@ SYNOPSIS **renepay** *invstring* [*amount\_msat*] [*maxfee*] [*maxdelay*] [*retry\_for*] [*description*] [*label*] - DESCRIPTION ----------- @@ -15,43 +14,13 @@ DESCRIPTION method for Multi-Path-Payments. This implementation has not been thoroughly tested and it should be used with caution. -The **renepay** RPC command attempts to pay the invoice specified -as *invstring*. Currently, **renepay** supports bolt11 invoices only. - The response will occur when the payment fails or succeeds. Once a payment has succeeded, calls to **renepay** with the same *invstring* will not lead to a new payment attempt, but instead it will succeed immediately. -If the *invstring* does not contain an amount, -*amount\_msat* is required, otherwise if it is specified -it must be *null*. *amount\_msat* is in millisatoshi precision; it can be a -whole number, or a whole number with suffix *msat* or *sat*, or a three -decimal point number with suffix *sat*, or an 1 to 11 decimal point -number suffixed by *btc*. - -*maxfee* limits how much is paid fees and it is measured in millisatoshi -by default, but also in this case the unit can be specified with a suffix: *msat*, *sat* or *btc*. -The default value is 5 sats or 0.5% whichever is higher. - -*maxdelay* overrides the value of `max-locktime-blocks` for this payment. -It serves to limit the locktime of funds in the payment HTLC measured in blocks. - -*retry\_for* measured in seconds (default: 60) specifies how much time it is -allowed for the command to keep retrying the payment. - -*description* is only required for bolt11 invoices which do not -contain a description themselves, but contain a description hash: -in this case *description* is required. -*description* is then checked against the hash inside the invoice -before it will be paid. - -The *label* field is used to attach a label to payments, and is returned -in lightning-listpays(7) and lightning-listsendpays(7). - When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name. - OPTIMALITY ---------- @@ -114,6 +83,9 @@ On success, an object is returned, containing: You can monitor the progress and retries of a payment using the lightning-renepaystatus(7) command. +ERRORS +------ + The following error codes may occur: - -1: Catchall nonspecific error. @@ -140,6 +112,7 @@ RESOURCES --------- - Main web site: -- Pickhardt R. and Richter S., *Optimally Reliable & Cheap Payment Flows on the Lightning Network* - + +- Pickhardt R. and Richter S., *Optimally Reliable & Cheap Payment Flows on the Lightning Network* + [comment]: # ( SHA256STAMP:946ad2fc9ef6bb6dbab6613b9cb55d34ed5a15dd876efcaeaa41174f0bdc40b0) diff --git a/doc/lightning-renepaystatus.7.md b/doc/lightning-renepaystatus.7.md index 33a884cd1de6..e554e31deb68 100644 --- a/doc/lightning-renepaystatus.7.md +++ b/doc/lightning-renepaystatus.7.md @@ -12,8 +12,7 @@ DESCRIPTION The **renepaystatus** RPC command queries the payment plugin **renepay** for the status of previous payment attempts. -If *invstring* is specified, the command will return a list of payment attempts -whose invoice matches *invstring*, otherwise all payments with be listed. + This command always succeeds. RETURN VALUE diff --git a/doc/lightning-reserveinputs.7.md b/doc/lightning-reserveinputs.7.md index 6a44c4d7adb0..3c1b491b1ba5 100644 --- a/doc/lightning-reserveinputs.7.md +++ b/doc/lightning-reserveinputs.7.md @@ -15,11 +15,7 @@ with an error if any of the inputs are known to be spent, and ignore inputs which are unknown. Normally the command will fail (with no reservations made) if an input -is already reserved. If *exclusive* is set to *False*, then existing -reservations are simply extended, rather than causing failure. - -By default, reservations are for the next 72 blocks (approximately 6 -hours), but this can be changed by setting *reserve*. +is already reserved. RETURN VALUE ------------ @@ -44,6 +40,9 @@ which was reserved: - *reserved* indicates that the input is now reserved (i.e. true). - *reserved\_to\_block* indicates what blockheight the reservation will expire. +ERRORS +------ + On failure, an error is reported and no UTXOs are reserved. The following error codes may occur: diff --git a/doc/lightning-sendcustommsg.7.md b/doc/lightning-sendcustommsg.7.md index e5d1a46f3f4e..315aee820cd9 100644 --- a/doc/lightning-sendcustommsg.7.md +++ b/doc/lightning-sendcustommsg.7.md @@ -14,24 +14,9 @@ into the communication with the peer with the given `node_id`. This is intended as a low-level interface to implement custom protocol extensions on top, not for direct use by end-users. -The message must be a hex encoded well-formed message, including the 2-byte -type prefix, but excluding the length prefix which will be added by the RPC -method. The message types may not be one of the internally handled -types, since that may cause issues with the internal state tracking of -Core Lightning. We do (as of *v23.11*) allow sending of even types, but note that peers (as per the spec) will disconnect on receiving unknown even types. - -The node specified by `node_id` must be a peer, i.e., it must have a direct -connection with the node receiving the RPC call, and the connection must be -established. For a method to send arbitrary messages over multiple hops, -including hops that do not understand the custom message, see the -`createonion` and `sendonion` RPC methods. Messages can only be injected if -the connection is handled by `openingd` or `channeld`. Messages cannot be -injected when the peer is handled by `onchaind` or `closingd` since these do -not have a connection, or are synchronous daemons that do not handle -spontaneous messages. - -On the reveiving end a plugin may implement the `custommsg` plugin hook and -get notified about incoming messages, and allow additional unknown even types in their getmanifest response. +On the receiving end a plugin may implement the `custommsg` plugin hook and +get notified about incoming messages, and allow additional unknown even types +in their getmanifest response. RETURN VALUE ------------ diff --git a/doc/lightning-sendinvoice.7.md b/doc/lightning-sendinvoice.7.md index 82ed2f4a9e8b..ffa633a7d10f 100644 --- a/doc/lightning-sendinvoice.7.md +++ b/doc/lightning-sendinvoice.7.md @@ -18,22 +18,6 @@ If **fetchinvoice-noconnect** is not specified in the configuation, it will connect to the destination in the (currently common!) case where it cannot find a route which supports `option_onion_messages`. -*invreq* is the bolt12 invoice\_request string beginning with "lnr1". - -*label* is the unique label to use for this invoice. - -*amount\_msat* is optional: it is required if the *offer* does not specify -an amount at all, or specifies it in a different currency. Otherwise -you may set it (e.g. to provide a tip), and if not it defaults to the -amount contained in the offer (multiplied by *quantity* if any). - -*timeout* is how many seconds to wait for the offering node to pay the -invoice or return an error, default 90 seconds. This will also be the -timeout on the invoice that is sent. - -*quantity* is optional: it is required if the *offer* specifies -*quantity\_max*, otherwise it is not allowed. - RETURN VALUE ------------ @@ -59,6 +43,9 @@ If **status** is "paid": [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + The following error codes may occur: - -1: Catchall nonspecific error. diff --git a/doc/lightning-sendonion.7.md b/doc/lightning-sendonion.7.md index 69a2eab3d885..f2f4d14c827a 100644 --- a/doc/lightning-sendonion.7.md +++ b/doc/lightning-sendonion.7.md @@ -18,51 +18,9 @@ of the payment for the final hop. However, it is possible to add arbitrary information for hops in the custom onion, allowing for custom extensions that are not directly supported by Core Lightning. -The onion is specific to the route that is being used and the *payment\_hash* -used to construct, and therefore cannot be reused for other payments or to -attempt a separate route. The custom onion can generally be created using the -`devtools/onion` CLI tool, or the **createonion** RPC command. - -The *onion* parameter is a hex-encoded 1366 bytes long blob that was returned -by either of the tools that can generate onions. It contains the payloads -destined for each hop and some metadata. Please refer to [BOLT 04][bolt04] for -further details. - -The *first\_hop* parameter 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*. The following is a minimal example telling -Core Lightning to use any available channel to `022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59` -to add an HTLC for 1002 millisatoshis and a delay of 21 blocks on top of the current blockheight: - -```json -{ - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "amount_msat": "1002msat", - "delay": 21, -} -``` - If the first element of *route* does not have "channel" set, a suitable channel (if any) will be chosen, otherwise that specific -short-channel-id is used. - -The *payment\_hash* parameter specifies the 32 byte hex-encoded hash to use as -a challenge to the HTLC that we are sending. It is specific to the onion and -has to match the one the onion was created with. - -The *label* parameter can be used to provide a human readable reference to -retrieve the payment at a later time. - -The *shared\_secrets* parameter is a JSON list of 32 byte hex-encoded secrets -that were used when creating the onion. Core Lightning can send a payment with a -custom onion without the knowledge of these secrets, however it will not be -able to parse an eventual error message since that is encrypted with the -shared secrets used in the onion. If *shared\_secrets* is provided Core Lightning -will decrypt the error, act accordingly, e.g., add a `channel_update` included -in the error to its network view, and set the details in *listsendpays* -correctly. If it is not provided Core Lightning will store the encrypted onion, -and expose it in *listsendpays* allowing the caller to decrypt it -externally. The following is an example of a 3 hop onion: +short-channel-id is used. The following is an example of a 3 hop onion: ```json [ @@ -72,21 +30,6 @@ externally. The following is an example of a 3 hop onion: ] ``` -If *shared\_secrets* is not provided the Core Lightning node does not know how -long the route is, which channels or nodes are involved, and what an eventual -error could have been. It can therefore be used for oblivious payments. - -The *partid* value, if provided and non-zero, allows for multiple parallel -partial payments with the same *payment\_hash*. - -The *bolt11* parameter, if provided, will be returned in -*waitsendpay* and *listsendpays* results. - -The *destination* parameter, if provided, will be returned in **listpays** result. - -The *amount\_msat* parameter is used to annotate the payment, and is returned by -*waitsendpay* and *listsendpays*. - RETURN VALUE ------------ @@ -117,9 +60,14 @@ If **status** is "pending": [comment]: # (GENERATE-FROM-SCHEMA-END) -If *shared\_secrets* was provided and an error was returned by one of the -intermediate nodes the error details are decrypted and presented -here. Otherwise the error code is 202 for an unparseable onion. +ERRORS +------ + +The following error codes may occur: + +- 202: an parseable onion +- the error details are decrypted and presented here, if *shared\_secrets* was provided and an error was returned by one of the +intermediate nodes AUTHOR ------ @@ -137,4 +85,5 @@ RESOURCES Main web site: [bolt04]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md + [comment]: # ( SHA256STAMP:eb3725c7a47c32298ca9e13ad6ef3fc90a818354b21fc0b17abd16d8e9515a24) diff --git a/doc/lightning-sendonionmessage.7.md b/doc/lightning-sendonionmessage.7.md index fdd5ef5a4215..6b0e01999bee 100644 --- a/doc/lightning-sendonionmessage.7.md +++ b/doc/lightning-sendonionmessage.7.md @@ -12,12 +12,9 @@ DESCRIPTION ----------- The **sendonionmessage** RPC command can be used to send a message via -the lightning network. These are currently used by *offers* to request +the lightning network. These are currently used by *offers* to request and receive invoices. -*hops* is an array of json objects: *id* as a public key of the node, -and *tlv* contains a hexidecimal TLV to include. - RETURN VALUE ------------ diff --git a/doc/lightning-sendpay.7.md b/doc/lightning-sendpay.7.md index 1db7a99b0ad9..76ce0d6e0cf7 100644 --- a/doc/lightning-sendpay.7.md +++ b/doc/lightning-sendpay.7.md @@ -17,7 +17,7 @@ route. Generally, a client would call lightning-getroute(7) to resolve a route, then use **sendpay** to send it. If it fails, it would call -lightning-getroute(7) again to retry. If the route is empty, a payment-to-self is attempted. +lightning-getroute(7) again to retry. If the route is empty, a payment-to-self is attempted. The response will occur when the payment is on its way to the destination. The **sendpay** RPC command does not wait for definite @@ -26,35 +26,6 @@ payments, or to-self payments). Instead, use the **waitsendpay** RPC command to poll or wait for definite success or definite failure. -The *label* and *bolt11* parameters, if provided, will be returned in -*waitsendpay* and *listsendpays* results. - -The *amount\_msat* amount must be provided if *partid* is non-zero, or the payment is to-self, otherwise -it must be equal to the final -amount to the destination. By default it is in millisatoshi precision; it can be a whole number, or a whole number -ending in *msat* or *sat*, or a number with three decimal places ending -in *sat*, or a number with 1 to 11 decimal places ending in *btc*. - -The *payment\_secret* is the value that the final recipient requires to -accept the payment, as defined by the `payment_data` field in BOLT 4 -and the `s` field in the BOLT 11 invoice format. It is required if -*partid* is non-zero. - -The *partid* value must not be provided for self-payments. If provided and non-zero, allows for multiple parallel -partial payments with the same *payment\_hash*. The *amount\_msat* amount -(which must be provided) for each **sendpay** with matching -*payment\_hash* must be equal, and **sendpay** will fail if there are differing values given. - -The *localinvreqid* value indicates that this payment is being made for a local -invoice\_request: this ensures that we only send a payment for a single-use -invoice\_request once. - -*groupid* allows you to attach a number which appears in **listsendpays** so -payments can be identified as part of a logical group. The *pay* plugin uses -this to identify one attempt at a MPP payment, for example. - -*payment\_metadata* is placed in the final onion hop TLV. - Once a payment has succeeded, calls to **sendpay** with the same *payment\_hash* but a different *amount\_msat* or destination will fail; this prevents accidental multiple payments. Calls to **sendpay** with @@ -94,6 +65,9 @@ If **status** is "pending": [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On error, if the error occurred from a node other than the final destination, the route table will be updated so that lightning-getroute(7) should return an alternate route (if any). An diff --git a/doc/lightning-sendpsbt.7.md b/doc/lightning-sendpsbt.7.md index d9f448ebad77..d76bd544aa66 100644 --- a/doc/lightning-sendpsbt.7.md +++ b/doc/lightning-sendpsbt.7.md @@ -11,8 +11,8 @@ DESCRIPTION The **sendpsbt** is a low-level RPC command which sends a fully-signed PSBT. -- *psbt*: A string that represents psbt value. -- *reserve*: an optional number of blocks to increase reservation of any of our inputs by; default is 72. +- **psbt** (string): the fully signed psbt to be sent +- **reserve** (u32, optional): number of blocks to increase reservation of any of our inputs by. Default is 72 EXAMPLE JSON REQUEST -------------------- @@ -30,13 +30,13 @@ EXAMPLE JSON REQUEST RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: - **tx** (hex): The raw transaction which was sent - **txid** (txid): The txid of the **tx** -[comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ On failure, one of the following error codes may be returned: @@ -67,4 +67,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:ba123ea4052af7850655f99ee85ed42c0254d7c15ba3861df0574fd58e4d8355) +[comment]: # ( SHA256STAMP:e1ba1085f321e876c047232a3923fe3340481010c8c7dcf1d1dddaa723589134) diff --git a/doc/lightning-setchannel.7.md b/doc/lightning-setchannel.7.md index 3256e208525e..3ad12141627c 100644 --- a/doc/lightning-setchannel.7.md +++ b/doc/lightning-setchannel.7.md @@ -11,7 +11,7 @@ DESCRIPTION The **setchannel** RPC command sets channel specific routing fees, and `htlc_minimum_msat` or `htlc_maximum_msat` as defined in BOLT \#7. The channel has to be in -normal or awaiting state. This can be checked by **listpeers** +normal or awaiting state. This can be checked by **listpeers** reporting a *state* of CHANNELD\_NORMAL or CHANNELD\_AWAITING\_LOCKIN for the channel. @@ -19,56 +19,6 @@ These changes (for a public channel) will be broadcast to the rest of the network (though many nodes limit the rate of such changes they will accept: we allow 2 a day, with a few extra occasionally). -*id* is required and should contain a scid (short channel ID), channel -id or peerid (pubkey) of the channel to be modified. If *id* is set to -"all", the updates are applied to all channels in states -CHANNELD\_NORMAL CHANNELD\_AWAITING\_LOCKIN or DUALOPEND\_AWAITING\_LOCKIN. -If *id* is a peerid, all channels with the +peer in those states are -changed. - -*feebase* is an optional value in millisatoshi that is added as base fee to -any routed payment: if omitted, it is unchanged. It can be a whole number, or a whole -number ending in *msat* or *sat*, or a number with three decimal places -ending in *sat*, or a number with 1 to 11 decimal places ending in -*btc*. - -*feeppm* is an optional value that is added proportionally per-millionths -to any routed payment volume in satoshi. For example, if ppm is 1,000 -and 1,000,000 satoshi is being routed through the channel, an -proportional fee of 1,000 satoshi is added, resulting in a 0.1% fee. - -*htlcmin* is an optional value that limits how small an HTLC we will -forward: if omitted, it is unchanged (the default is no lower limit). It -can be a whole number, or a whole number ending in *msat* or *sat*, or -a number with three decimal places ending in *sat*, or a number with 1 -to 11 decimal places ending in *btc*. Note that the peer also enforces a -minimum for the channel: setting it below that will simply set it to -that value with a warning. Also note that *htlcmin* only applies to forwarded -HTLCs: we can still send smaller payments ourselves. - -*htlcmax* is an optional value that limits how large an HTLC we will -forward: if omitted, it is unchanged (the default is no effective -limit). It can be a whole number, or a whole number ending in *msat* -or *sat*, or a number with three decimal places ending in *sat*, or a -number with 1 to 11 decimal places ending in *btc*. Note that *htlcmax* -only applies to forwarded HTLCs: we can still send larger payments ourselves. - -*enforcedelay* is the number of seconds to delay before enforcing the -new fees/htlc max (default 600, which is ten minutes). This gives the -network a chance to catch up with the new rates and avoids rejecting -HTLCs before they do. This only has an effect if rates are increased -(we always allow users to overpay fees) or *htlcmax* is decreased, and -only applied to a single rate increase per channel (we don't remember -an arbitrary number of prior feerates) and if the node is restarted -the updated configuration is enforced immediately. - -*ignorefeelimits* set to True means to allow the peer to set the commitment -transaction fees (or closing transaction fees) to any value they want. This is dangerous: they could -set an exorbitant fee (so HTLCs are unenforcable), or a tiny fee (so that -commitment transactions cannot be relayed), but avoids channel breakage -in case of feerate disagreements. (Note: the global `ignore_fee_limits` -setting overrides this). - RETURN VALUE ------------ diff --git a/doc/lightning-setconfig.7.md b/doc/lightning-setconfig.7.md index 49ee652dfa46..1231579f3b9e 100644 --- a/doc/lightning-setconfig.7.md +++ b/doc/lightning-setconfig.7.md @@ -13,14 +13,13 @@ The **setconfig** RPC command allows you set the (dynamic) configuration option This new value will *also* be written at the end of the config file, for persistence across restarts (and any old value commented out). -You can see what options are dynamically adjustable using lightning-listconfigs(7). Note that you can also adjust existing options for stopped plugins; they will have an effect when the plugin is restarted. - +You can see what options are dynamically adjustable using lightning-listconfigs(7). Note that you can also adjust existing options for stopped plugins; they will have an effect when the plugin is restarted. RETURN VALUE ------------ [comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **config** is returned. It is an object containing: +On success, an object containing **config** is returned. It is an object containing: - **config** (string): name of the config variable which was set - **source** (string): source of configuration setting (`file`:`linenum`) diff --git a/doc/lightning-setpsbtversion.7.md b/doc/lightning-setpsbtversion.7.md index 753e1b77a323..c317992e6808 100644 --- a/doc/lightning-setpsbtversion.7.md +++ b/doc/lightning-setpsbtversion.7.md @@ -11,11 +11,9 @@ DESCRIPTION The **setpsbtversion** RPC command converts the provided PSBT to the given version, and returns the base64 result of the conversion. Returns an error if version is invalid. -- *psbt*: The PSBT to change versions. -- *version*: The version to set. - EXAMPLE JSON REQUEST ------------ + ```json { "id": 82, @@ -32,21 +30,22 @@ RETURN VALUE If successful the command returns a converted PSBT of the requested version. -On failure, an error is returned. +ERRORS +------ The following error codes may occur: -- -32602: Parameter missed or malformed; +- 32602: Parameter missed or malformed. EXAMPLE JSON RESPONSE ----- + ```json { "psbt": "cHNidP8BAgQCAAAAAQQBAAEFAQABBgEDAfsEAgAAAAA=" } ``` - AUTHOR ------ diff --git a/doc/lightning-signinvoice.7.md b/doc/lightning-signinvoice.7.md index de2efe6cd660..d9c6248afd00 100644 --- a/doc/lightning-signinvoice.7.md +++ b/doc/lightning-signinvoice.7.md @@ -9,13 +9,10 @@ SYNOPSIS DESCRIPTION ----------- -The **signinvoice** RPC command signs an invoice. Unlike +The **signinvoice** RPC command signs an invoice. Unlike **createinvoice** it does not save the invoice into the database and thus does not require the preimage. -The *invstring* parameter is of bolt11 form, but the final signature -is ignored. Minimal sanity checks are done. - RETURN VALUE ------------ @@ -26,6 +23,9 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On failure, an error is returned. The following error codes may occur: diff --git a/doc/lightning-signmessage.7.md b/doc/lightning-signmessage.7.md index fedb42c35abe..111282f01b41 100644 --- a/doc/lightning-signmessage.7.md +++ b/doc/lightning-signmessage.7.md @@ -10,14 +10,13 @@ DESCRIPTION ----------- The **signmessage** RPC command creates a digital signature of -*message* using this node's secret key. A receiver who knows your +*message* using this node's secret key. A receiver who knows your node's *id* and the *message* can be sure that the resulting signature could only be created by something with access to this node's secret key. -*message* must be less that 65536 characters. - RETURN VALUE ------------ + [comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: @@ -42,4 +41,6 @@ RESOURCES Main web site: +[SignMessageRequest](https://api.lightning.community/#grpc-request-signmessagerequest) + [comment]: # ( SHA256STAMP:485db85e3822babcb397b55f251e6797528c3b9e14743d2823e890e2b22432c0) diff --git a/doc/lightning-signpsbt.7.md b/doc/lightning-signpsbt.7.md index 24c612e2be5a..65f20d5e3a1a 100644 --- a/doc/lightning-signpsbt.7.md +++ b/doc/lightning-signpsbt.7.md @@ -12,9 +12,6 @@ DESCRIPTION **signpsbt** is a low-level RPC command which signs a PSBT as defined by BIP-174. -- *psbt*: A string that represents the PSBT value. -- *signonly*: An optional array of input numbers to sign. - By default, all known inputs are signed, and others ignored: with *signonly*, only those inputs are signed, and an error is returned if one of them cannot be signed. @@ -22,9 +19,9 @@ one of them cannot be signed. Note that the command will fail if there are no inputs to sign, or if the inputs to be signed were not previously reserved. - EXAMPLE JSON REQUEST -------------------- + ```json { "id": 82, @@ -45,6 +42,9 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On failure, one of the following error codes may be returned: - -32602: Error in given parameters, or there aren't wallet's inputs to sign, or we couldn't sign all of *signonly*, or inputs are not reserved. diff --git a/doc/lightning-splice_init.7.md b/doc/lightning-splice_init.7.md index 08cf0295f1ab..cd3803193f9b 100644 --- a/doc/lightning-splice_init.7.md +++ b/doc/lightning-splice_init.7.md @@ -3,6 +3,7 @@ lightning-splice\_init -- Command to initiate a channel to a peer SYNOPSIS -------- + **(WARNING: experimental-splicing only)** **splice\_init** *channel\_id* *relative\_amount* [*initalpsbt*] [*feerate\_per\_kw*] [*force\_feerate*] @@ -13,22 +14,6 @@ DESCRIPTION `splice_init` is a low level RPC command which initiates a channel splice for a given channel specified by `channel_id`. -*channel\_id* is the channel id of the channel to be spliced. - -*relative\_amount* is a positive or negative amount of satoshis to add or -subtract from the channel. - -*initalpsbt* is the (optional) base 64 encoded PSBT to begin with. If not -specified, one will be generated automatically. - -*feerate\_per\_kw* is the miner fee we promise our peer to pay for our side of -the splice transaction. It is calculated by `feerate_per_kw` * -our\_bytes\_in\_splice\_tx / 1000. - -*force\_feerate* is a boolean flag. By default splices will fail if the fee -provided looks too high. This is to protect against accidentally setting your -fee higher than intended. Set `force_feerate` to true to skip this saftey check. - Note you may need to add a double dash (\-\-) after splice\_init if using a negative *relative\_amount* so it is not interpretted as a command modifier. For example: ```shell @@ -100,10 +85,12 @@ On success, an object is returned, containing: SEE ALSO -------- +lightning-splice_signed(7), lightning-splice_update(7) + AUTHOR ------ -@dusty\_daemon +Dusty <<@dusty_daemon>> is mainly responsible. RESOURCES --------- diff --git a/doc/lightning-splice_signed.7.md b/doc/lightning-splice_signed.7.md index 9bcb0cc5174c..16d9112b657f 100644 --- a/doc/lightning-splice_signed.7.md +++ b/doc/lightning-splice_signed.7.md @@ -3,6 +3,7 @@ lightning-splice\_signed -- Command to initiate a channel to a peer SYNOPSIS -------- + **(WARNING: experimental-splicing only)** **splice\_signed** *channel\_id* *psbt* [*sign\_first*] @@ -13,15 +14,6 @@ DESCRIPTION `splice_signed` is a low level RPC command which finishes the active channel splice associated with `channel_id`. -*channel\_id* is the channel id of the channel being spliced. - -*psbt* is the final version of the psbt to complete the splice with. - -*sign\_first* is a flag that makes our node offer the final splice signature -first (defaults to false). When false, the node will calculate who should -sign first based off who is adding inputting the least sats to the splice as per -spec. - The *psbt* must have all signatures attached to all inputs that you have added to it or it will fail. @@ -82,10 +74,12 @@ On success, an object is returned, containing: SEE ALSO -------- +lightning-splice_init(7), lightning-splice_update(7) + AUTHOR ------ -@dusty\_daemon +Dusty <<@dusty_daemon>> is mainly responsible. RESOURCES --------- diff --git a/doc/lightning-splice_update.7.md b/doc/lightning-splice_update.7.md index a59933e72b08..c49318d5ba77 100644 --- a/doc/lightning-splice_update.7.md +++ b/doc/lightning-splice_update.7.md @@ -3,6 +3,7 @@ lightning-splice\_update -- Command to initiate a channel to a peer SYNOPSIS -------- + **(WARNING: experimental-splicing only)** **splice\_update** *channel\_id* *psbt* @@ -13,11 +14,6 @@ DESCRIPTION `splice_update` is a low level RPC command which updates the active channel splice associated with `channel_id`. -*channel\_id* is the channel id of the channel being spliced. - -*psbt* is the base 64 encoded PSBT returned from `splice_init` with any changes -added by the user. - `splice_update` must be called repeatidly until the result `commitments_secured` is `true`. Each time `splice_update` is called, it will return a new PSBT that may have changes. In the simplest case, you take the returned `psbt` and pass @@ -95,10 +91,12 @@ On success, an object is returned, containing: SEE ALSO -------- +lightning-splice_init(7), lightning-splice_signed(7) + AUTHOR ------ -@dusty\_daemon +Dusty <<@dusty_daemon>> is mainly responsible. RESOURCES --------- diff --git a/doc/lightning-sql.7.md b/doc/lightning-sql.7.md index 6615eae5ae3b..4932bee18486 100644 --- a/doc/lightning-sql.7.md +++ b/doc/lightning-sql.7.md @@ -26,38 +26,39 @@ TREATMENT OF TYPES ------------------ The following types are supported in schemas, and this shows how they -are presented in the database. This matters: a JSON boolean is +are presented in the database. This matters: a JSON boolean is represented as an integer in the database, so a query will return 0 or 1, not true or false. -* *hex*. A hex string. +* *hex*. A hex string. * JSON: a string * sqlite3: BLOB * *hash*/*secret*/*pubkey*/*txid*: just like *hex*. -* *msat*/*integer*/*u64*/*u32*/*u16*/*u8*. Normal numbers. +* *msat*/*integer*/*u64*/*u32*/*u16*/*u8*. Normal numbers. * JSON: an unsigned integer * sqlite3: INTEGER -* *boolean*. True or false. +* *boolean*. True or false. * JSON: literal **true** or **false** * sqlite3: INTEGER -* *number*. A floating point number (used for times in some places). +* *number*. A floating point number (used for times in some places). * JSON: number * sqlite3: REAL -* *string*. Text. +* *string*. Text. * JSON: string * sqlite3: TEXT -* *short\_channel\_id*. A short-channel-id of form 1x2x3. +* *short\_channel\_id*. A short-channel-id of form 1x2x3. * JSON: string * sqlite3: TEXT PERMITTED SQLITE3 FUNCTIONS --------------------------- + Writing to the database is not permitted, and limits are placed on various other query parameters. @@ -80,9 +81,10 @@ Additionally, only the following functions are allowed: TABLES ------ + Note that the first column of every table is a unique integer called `rowid`: this is used for related tables to refer to specific rows in -their parent. sqlite3 usually has this as an implicit column, but we +their parent. sqlite3 usually has this as an implicit column, but we make it explicit as the implicit version is not allowed to be used as a foreign key. @@ -416,15 +418,19 @@ RETURN VALUE ------------ [comment]: # (FIXME: we don't handle this schema in fromschema.py) -On success, an object containing **rows** is returned. It is an array. Each array entry contains an array of values, each an integer, real number, string or *null*, depending on the sqlite3 type. +On success, an object containing **rows** is returned. It is an array. Each array entry contains an array of values, each an integer, real number, string or *null*, depending on the sqlite3 type. The object may contain **warning\_db\_failure** if the database fails partway through its operation. +ERRORS +------ + On failure, an error is returned. -EXAMPLES --------- -Here are some example using lightning-cli. Note that you may need to +EXAMPLE USAGE +------------- + +Here are some example using lightning-cli. Note that you may need to use `-o` if you use queries which contain `=` (which make lightning-cli(1) default to keyword style): @@ -506,7 +512,7 @@ $ lightning-cli sql -o "SELECT nodeid, alias, nodes_addresses.type, nodes_addres } ``` -Simple function usage, in this case COUNT. Strings inside arrays need +Simple function usage, in this case COUNT. Strings inside arrays need ", and ' to protect them from the shell: ``` diff --git a/doc/lightning-stop.7.md b/doc/lightning-stop.7.md index 84ebbb58b950..245f2f2b31e8 100644 --- a/doc/lightning-stop.7.md +++ b/doc/lightning-stop.7.md @@ -13,6 +13,7 @@ The **stop** is a RPC command to shut off the Core Lightning node. EXAMPLE JSON REQUEST ------------ + ```json { "id": 82, diff --git a/doc/lightning-txdiscard.7.md b/doc/lightning-txdiscard.7.md index 4cb40826e6b1..04d3990257f2 100644 --- a/doc/lightning-txdiscard.7.md +++ b/doc/lightning-txdiscard.7.md @@ -27,6 +27,9 @@ If there is no matching *txid*, an error is reported. Note that this may happen due to incorrect usage, such as **txdiscard** or **txsend** already being called for *txid*. +ERRORS +------ + The following error codes may occur: - -1: An unknown *txid*. diff --git a/doc/lightning-txprepare.7.md b/doc/lightning-txprepare.7.md index d1a9bc11e8fd..7c00bd9f4e46 100644 --- a/doc/lightning-txprepare.7.md +++ b/doc/lightning-txprepare.7.md @@ -13,31 +13,6 @@ The **txprepare** RPC command creates an unsigned transaction which spends funds from Core Lightning's internal wallet to the outputs specified in *outputs*. -The *outputs* is the array of output that include *destination* -and *amount*(\{*destination*: *amount*\}). Its format is like: -[\{address1: amount1\}, \{address2: amount2\}] -or -[\{address: *all*\}]. -It supports any number of **confirmed** outputs. - -The *destination* of output is the address which can be of any Bitcoin accepted -type, including bech32. - -The *amount* of output is the amount to be sent from the internal wallet -(expressed, as name suggests, in amount). The string *all* can be used to specify -all available funds. Otherwise, it is in amount precision; it can be a whole -number, a whole number ending in *sat*, a whole number ending in *000msat*, -or a number with 1 to 8 decimal places ending in *btc*. - -*feerate* is an optional feerate to use: see NOTES in lightning-feerates(7) -for possible values. The default is *normal*. - -*minconf* specifies the minimum number of confirmations that used -outputs should have. Default is 1. - -*utxos* specifies the utxos to be used to fund the transaction, as an array -of "txid:vout". These must be drawn from the node's available UTXO set. - **txprepare** is similar to the first part of a **withdraw** command, but supports multiple outputs and uses *outputs* as parameter. The second part is provided by **txsend**. @@ -54,6 +29,9 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On failure, an error is reported and the transaction is not created. The following error codes may occur: diff --git a/doc/lightning-txsend.7.md b/doc/lightning-txsend.7.md index c9e16deeca4a..eff2f7365edd 100644 --- a/doc/lightning-txsend.7.md +++ b/doc/lightning-txsend.7.md @@ -24,6 +24,9 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On failure, an error is reported (from bitcoind), and the inputs from the transaction are unreserved. diff --git a/doc/lightning-unreserveinputs.7.md b/doc/lightning-unreserveinputs.7.md index 34bd4084250f..0083c6b05a1c 100644 --- a/doc/lightning-unreserveinputs.7.md +++ b/doc/lightning-unreserveinputs.7.md @@ -13,11 +13,6 @@ The **unreserveinputs** RPC command releases (or reduces reservation) on UTXOs which were previously marked as reserved, generally by lightning-reserveinputs(7). -The inputs to unreserve are the inputs specified in the passed-in *psbt*. - -If *reserve* is specified, it is the number of blocks to decrease -reservation by; default is 72. - RETURN VALUE ------------ @@ -35,6 +30,9 @@ If **reserved** is *true*: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On failure, an error is reported and no UTXOs are unreserved. The following error codes may occur: diff --git a/doc/lightning-upgradewallet.7.md b/doc/lightning-upgradewallet.7.md index a92cf7d04fe3..f2a8775c6222 100644 --- a/doc/lightning-upgradewallet.7.md +++ b/doc/lightning-upgradewallet.7.md @@ -13,7 +13,7 @@ DESCRIPTION Segwit deposits in a wallet into a single Native Segwit P2WPKH address. *feerate* is an optional feerate: see NOTES in lightning-feerates(7) -for possible values. The default is *opening*. +for possible values. The default is *opening*. *reservedok* tells the wallet to include all P2SH-wrapped inputs, including reserved ones. diff --git a/doc/lightning-utxopsbt.7.md b/doc/lightning-utxopsbt.7.md index 2120758ecd89..6ff19b921299 100644 --- a/doc/lightning-utxopsbt.7.md +++ b/doc/lightning-utxopsbt.7.md @@ -4,7 +4,7 @@ lightning-utxopsbt -- Command to populate PSBT inputs from given UTXOs SYNOPSIS -------- -**utxopsbt** *satoshi* *feerate* *startweight* *utxos* [*reserve*] [*reservedok*] [*locktime*] [*min\_witness\_weight*] [*excess\_as\_change*] +**utxopsbt** *satoshi* *feerate* *startweight* *utxos* [*reserve*] [*reservedok*] [*locktime*] [*min\_witness\_weight*] [*excess\_as\_change*] [*opening\_anchor\_channel*] DESCRIPTION ----------- @@ -17,29 +17,6 @@ lightning-fundpsbt(7) except instead of an optional *minconf* parameter to select unreserved outputs from the wallet, it takes a compulsory list of outputs to use. -*utxos* must be an array of "txid:vout", each of which must be -reserved or available: the total amount must be sufficient to pay for -the resulting transaction plus *startweight* at the given *feerate*, -with at least *satoshi* left over (unless *satoshi* is **all**, which -is equivalent to setting it to zero). - -If *reserve* if not zero, then *reserveinputs* is called (successfully, with -*exclusive* true) on the returned PSBT for this number of blocks (default -72 blocks if unspecified). - -Unless *reservedok* is set to true (default is false) it will also fail -if any of the *utxos* are already reserved. - -*locktime* is an optional locktime: if not set, it is set to a recent -block height. - -*min\_witness\_weight* is an optional minimum weight to use for a UTXO's -witness. If the actual witness weight is greater than the provided minimum, -the actual witness weight will be used. - -*excess\_as\_change* is an optional boolean to flag to add a change output -for the excess sats. - RETURN VALUE ------------ @@ -49,7 +26,7 @@ On success, an object is returned, containing: - **psbt** (string): Unsigned PSBT which fulfills the parameters given - **feerate\_per\_kw** (u32): The feerate used to create the PSBT, in satoshis-per-kiloweight - **estimated\_final\_weight** (u32): The estimated weight of the transaction once fully signed -- **excess\_msat** (msat): The amount above *satoshi* which is available. This could be zero, or dust; it will be zero if *change\_outnum* is also returned +- **excess\_msat** (msat): The amount above *satoshi* which is available. This could be zero, or dust; it will be zero if *change\_outnum* is also returned - **change\_outnum** (u32, optional): The 0-based output number where change was placed (only if parameter *excess\_as\_change* was true and there was sufficient funds) - **reservations** (array of objects, optional): If *reserve* was true or a non-zero number, just as per lightning-reserveinputs(7): - **txid** (txid): The txid of the transaction @@ -65,7 +42,7 @@ On success, returns the *psbt* it created, containing the inputs, *feerate\_per\_kw* showing the exact numeric feerate it used, *estimated\_final\_weight* for the estimated weight of the transaction once fully signed, and *excess\_msat* containing the amount above *satoshi* -which is available. This could be zero, or dust. If *satoshi* was "all", +which is available. This could be zero, or dust. If *satoshi* was "all", then *excess\_msat* is the entire amount once fees are subtracted for the weights of the inputs and *startweight*. @@ -78,6 +55,9 @@ added to the PSBT for the excess amount. The *excess\_msat* will be zero. A *change\_outnum* will be returned with the index of the change output. +ERRORS +------ + On error the returned object will contain `code` and `message` properties, with `code` being one of the following: diff --git a/doc/lightning-wait.7.md b/doc/lightning-wait.7.md index 47f6fc9c773b..0dd5aa274a98 100644 --- a/doc/lightning-wait.7.md +++ b/doc/lightning-wait.7.md @@ -10,7 +10,7 @@ DESCRIPTION ----------- The **wait** RPC command returns once the index given by *indexname* -in *subsystem* reaches or exceeds *nextvalue*. All indexes start at 0, when no +in *subsystem* reaches or exceeds *nextvalue*. All indexes start at 0, when no events have happened (**wait** with a *nextvalue* of 0 is a way of getting the current index, though naturally this is racy!). @@ -40,12 +40,12 @@ Indices only monotoncally increase. USAGE ----- -The **wait** RPC is used to track changes in the system. Consider -tracking invoices being paid or expiring. The simplest (and +The **wait** RPC is used to track changes in the system. Consider +tracking invoices being paid or expiring. The simplest (and inefficient method) would be: 1. Call `listinvoices` to get the current state of all invoices, and - remember the highest `updated_index`. Say it was 5. + remember the highest `updated_index`. Say it was 5. 2. Call `wait invoices updated 6`. 3. When it returns, call `listinvoices` again to see what changed. @@ -59,6 +59,7 @@ This is obviously inefficient, so there are two optimizations: RETURN VALUE ------------ + [comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: @@ -95,6 +96,9 @@ If **subsystem** is "sendpays": [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On error the returned object will contain `code` and `message` properties, with `code` being one of the following: @@ -103,8 +107,7 @@ with `code` being one of the following: AUTHOR ------ -Rusty Russell <> is mainly -responsible. +Rusty Russell <> is mainly responsible. SEE ALSO -------- @@ -115,4 +118,5 @@ RESOURCES --------- Main web site: + [comment]: # ( SHA256STAMP:a6686d2d46b49984c3848305dc15129a7436dd48d95f6afd9ba0e2902b52fc5d) diff --git a/doc/lightning-waitanyinvoice.7.md b/doc/lightning-waitanyinvoice.7.md index 98bfc4d8ff10..0920c381df37 100644 --- a/doc/lightning-waitanyinvoice.7.md +++ b/doc/lightning-waitanyinvoice.7.md @@ -15,20 +15,8 @@ any invoices paid prior to or including the *lastpay\_index*. This is usually called iteratively: once with no arguments, then repeatedly with the returned *pay\_index* entry. This ensures that no -paid invoice is missed. - -The *pay\_index* is a monotonically-increasing number assigned to an -invoice when it gets paid. The first valid *pay\_index* is 1; specifying -*lastpay\_index* of 0 equivalent to not specifying a *lastpay\_index*. -Negative *lastpay\_index* is invalid. - -If *timeout* is specified, wait at most that number of seconds, which -must be an integer. -If the specified *timeout* is reached, this command will return with an -error. -You can specify this to 0 so that **waitanyinvoice** will return -immediately with an error if no pending invoice is available yet. -If unspecified, this command will wait indefinitely. +paid invoice is missed. The *pay\_index* is a monotonically-increasing number +assigned to an invoice when it gets paid. The first valid *pay\_index* is 1. RETURN VALUE ------------ @@ -59,10 +47,12 @@ If **status** is "paid": [comment]: # (GENERATE-FROM-SCHEMA-END) -Possible errors are: +ERRORS +------ + +The following error codes may occur: -* 904. - The *timeout* was reached without an invoice being paid. +- 904: The *timeout* was reached without an invoice being paid. AUTHOR ------ diff --git a/doc/lightning-waitblockheight.7.md b/doc/lightning-waitblockheight.7.md index 48465720b712..2a1344c319f6 100644 --- a/doc/lightning-waitblockheight.7.md +++ b/doc/lightning-waitblockheight.7.md @@ -11,10 +11,6 @@ DESCRIPTION The **waitblockheight** RPC command waits until the blockchain has reached the specified *blockheight*. -It will only wait up to *timeout* seconds (default 60). - -If the *blockheight* is a present or past block height, then this -command returns immediately. RETURN VALUE ------------ @@ -22,7 +18,7 @@ RETURN VALUE [comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **blockheight** (u32): The current block height (>= *blockheight* parameter) +- **blockheight** (u32): The current block height (> *blockheight* parameter) [comment]: # (GENERATE-FROM-SCHEMA-END) diff --git a/doc/lightning-waitinvoice.7.md b/doc/lightning-waitinvoice.7.md index 7974e431b379..a64725cf1663 100644 --- a/doc/lightning-waitinvoice.7.md +++ b/doc/lightning-waitinvoice.7.md @@ -41,6 +41,9 @@ If **status** is "paid": [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On error the returned object will contain `code` and `message` properties, with `code` being one of the following: diff --git a/doc/lightning-waitsendpay.7.md b/doc/lightning-waitsendpay.7.md index 8e5dba779339..c2aa28943e6e 100644 --- a/doc/lightning-waitsendpay.7.md +++ b/doc/lightning-waitsendpay.7.md @@ -4,7 +4,7 @@ lightning-waitsendpay -- Command for sending a payment via a route SYNOPSIS -------- -**waitsendpay** *payment\_hash* [*timeout*] [*partid*] +**waitsendpay** *payment\_hash* [*timeout*] [*partid* *groupid*] DESCRIPTION ----------- @@ -13,18 +13,6 @@ The **waitsendpay** RPC command polls or waits for the status of an outgoing payment that was initiated by a previous **sendpay** invocation. -The *partid* argument must match that of the **sendpay** command. - -Optionally the client may provide a *timeout*, an integer in seconds, -for this RPC command to return. If the *timeout* is provided and the -given amount of time passes without the payment definitely succeeding or -definitely failing, this command returns with a 200 error code (payment -still in progress). If *timeout* is not provided this call will wait -indefinitely. - -Indicating a *timeout* of 0 effectively makes this call a pollable query -of the status of the payment. - If the payment completed with success, this command returns with success. Otherwise, if the payment completed with failure, this command returns an error. @@ -57,6 +45,9 @@ If **status** is "complete": [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On error, and even if the error occurred from a node other than the final destination, the route table will no longer be updated. Use the *exclude* parameter of the `getroute` command to ignore the failing diff --git a/doc/lightning-withdraw.7.md b/doc/lightning-withdraw.7.md index 9d7d770fc6a0..3d2870af8851 100644 --- a/doc/lightning-withdraw.7.md +++ b/doc/lightning-withdraw.7.md @@ -12,26 +12,6 @@ DESCRIPTION The **withdraw** RPC command sends funds from Core Lightning's internal wallet to the address specified in *destination*. -The address can be of any Bitcoin accepted type, including bech32. - -*satoshi* is the amount to be withdrawn from the internal wallet -(expressed, as name suggests, in satoshi). The string *all* can be used -to specify withdrawal of all available funds (but if we have -any anchor channels, this will always leave at least `min-emergency-msat` as change). -. Otherwise, it is in -satoshi precision; it can be a whole number, a whole number ending in -*sat*, a whole number ending in *000msat*, or a number with 1 to 8 -decimal places ending in *btc*. - -*feerate* is an optional feerate: see NOTES in lightning-feerates(7) -for possible values. The default is *normal*. - -*minconf* specifies the minimum number of confirmations that used -outputs should have. Default is 1. - -*utxos* specifies the utxos to be used to be withdrawn from, as an array -of "txid:vout". These must be drawn from the node's available UTXO set. - RETURN VALUE ------------ @@ -44,6 +24,9 @@ On success, an object is returned, containing: [comment]: # (GENERATE-FROM-SCHEMA-END) +ERRORS +------ + On failure, an error is reported and the withdrawal transaction is not created. diff --git a/doc/lightningd.8.md b/doc/lightningd.8.md index a978941da6ca..af4af6b7971a 100644 --- a/doc/lightningd.8.md +++ b/doc/lightningd.8.md @@ -3,6 +3,7 @@ lightningd -- Daemon for running a Lightning Network node SYNOPSIS -------- + ```bash lightningd [--conf=] [OPTIONS] ``` From d9fb619dd8f82956fb9dbc0e7dc3fa923522b6c3 Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Mon, 15 Jan 2024 13:35:14 -0800 Subject: [PATCH 09/16] doc: Merge request and schema jsons in a single file Merge information from `*.request.json` & `*.schema.json`. Also consolidate remaining details from `*.md` files and create a single file in schemas folder. --- contrib/msggen/msggen/schema.json | 31846 ++++++++++++++++ doc/rpc-schema-draft.json | 520 + doc/schemas/lightning-addgossip.json | 59 + doc/schemas/lightning-addpsbtoutput.json | 137 + doc/schemas/lightning-autoclean-once.json | 235 + doc/schemas/lightning-autoclean-status.json | 484 + doc/schemas/lightning-autocleaninvoice.json | 120 + doc/schemas/lightning-batching.json | 50 + doc/schemas/lightning-bkpr-channelsapy.json | 262 + doc/schemas/lightning-bkpr-dumpincomecsv.json | 105 + doc/schemas/lightning-bkpr-inspect.json | 238 + .../lightning-bkpr-listaccountevents.json | 481 + doc/schemas/lightning-bkpr-listbalances.json | 160 + doc/schemas/lightning-bkpr-listincome.json | 210 + doc/schemas/lightning-blacklistrune.json | 137 + doc/schemas/lightning-check.json | 100 + doc/schemas/lightning-checkmessage.json | 106 + doc/schemas/lightning-checkrune.json | 139 + doc/schemas/lightning-close.json | 209 + doc/schemas/lightning-commando-blacklist.json | 138 + doc/schemas/lightning-commando-listrunes.json | 294 + doc/schemas/lightning-commando-rune.json | 296 + doc/schemas/lightning-commando.json | 183 + doc/schemas/lightning-connect.json | 228 + doc/schemas/lightning-createinvoice.json | 207 + doc/schemas/lightning-createonion.json | 233 + doc/schemas/lightning-createrune.json | 280 + doc/schemas/lightning-datastore.json | 203 + doc/schemas/lightning-datastoreusage.json | 122 + doc/schemas/lightning-decode.json | 2096 + doc/schemas/lightning-decodepay.json | 290 + doc/schemas/lightning-deldatastore.json | 131 + doc/schemas/lightning-delexpiredinvoice.json | 47 + doc/schemas/lightning-delforward.json | 86 + doc/schemas/lightning-delinvoice.json | 338 + doc/schemas/lightning-delpay.json | 293 + doc/schemas/lightning-deprecations.json | 54 + .../lightning-disableinvoicerequest.json | 90 + doc/schemas/lightning-disableoffer.json | 107 + doc/schemas/lightning-disconnect.json | 80 + doc/schemas/lightning-emergencyrecover.json | 63 + doc/schemas/lightning-feerates.json | 488 + doc/schemas/lightning-fetchinvoice.json | 227 + doc/schemas/lightning-fundchannel.json | 310 + doc/schemas/lightning-fundchannel_cancel.json | 89 + .../lightning-fundchannel_complete.json | 98 + doc/schemas/lightning-fundchannel_start.json | 256 + doc/schemas/lightning-funderupdate.json | 335 + doc/schemas/lightning-fundpsbt.json | 293 + doc/schemas/lightning-getinfo.json | 431 + doc/schemas/lightning-getlog.json | 255 + doc/schemas/lightning-getroute.json | 440 + doc/schemas/lightning-help.json | 130 + doc/schemas/lightning-invoice.json | 254 + doc/schemas/lightning-invoicerequest.json | 145 + doc/schemas/lightning-keysend.json | 319 + doc/schemas/lightning-listchannels.json | 249 + doc/schemas/lightning-listclosedchannels.json | 285 + doc/schemas/lightning-listconfigs.json | 2938 ++ doc/schemas/lightning-listdatastore.json | 130 + doc/schemas/lightning-listforwards.json | 453 + doc/schemas/lightning-listfunds.json | 380 + doc/schemas/lightning-listhtlcs.json | 257 + .../lightning-listinvoicerequests.json | 120 + doc/schemas/lightning-listinvoices.json | 334 + doc/schemas/lightning-listnodes.json | 334 + doc/schemas/lightning-listoffers.json | 144 + doc/schemas/lightning-listpays.json | 272 + doc/schemas/lightning-listpeerchannels.json | 1605 + doc/schemas/lightning-listpeers.json | 1448 + doc/schemas/lightning-listsendpays.json | 411 + doc/schemas/lightning-listsqlschemas.json | 277 + doc/schemas/lightning-listtransactions.json | 202 + doc/schemas/lightning-makesecret.json | 76 + doc/schemas/lightning-multifundchannel.json | 465 + doc/schemas/lightning-multiwithdraw.json | 153 + doc/schemas/lightning-newaddr.json | 88 + doc/schemas/lightning-notifications.json | 93 + doc/schemas/lightning-offer.json | 216 + doc/schemas/lightning-openchannel_abort.json | 93 + doc/schemas/lightning-openchannel_bump.json | 172 + doc/schemas/lightning-openchannel_init.json | 285 + doc/schemas/lightning-openchannel_signed.json | 90 + doc/schemas/lightning-openchannel_update.json | 258 + doc/schemas/lightning-parsefeerate.json | 90 + doc/schemas/lightning-pay.json | 265 + doc/schemas/lightning-ping.json | 92 + doc/schemas/lightning-plugin.json | 291 + doc/schemas/lightning-preapproveinvoice.json | 45 + doc/schemas/lightning-preapprovekeysend.json | 63 + doc/schemas/lightning-recover.json | 72 + doc/schemas/lightning-recoverchannel.json | 71 + doc/schemas/lightning-renepay.json | 216 + doc/schemas/lightning-renepaystatus.json | 139 + doc/schemas/lightning-reserveinputs.json | 230 + doc/schemas/lightning-sendcustommsg.json | 76 + doc/schemas/lightning-sendinvoice.json | 237 + doc/schemas/lightning-sendonion.json | 364 + doc/schemas/lightning-sendonionmessage.json | 77 + doc/schemas/lightning-sendpay.json | 444 + doc/schemas/lightning-sendpsbt.json | 94 + doc/schemas/lightning-setchannel.json | 230 + doc/schemas/lightning-setconfig.json | 191 + doc/schemas/lightning-setpsbtversion.json | 85 + doc/schemas/lightning-showrunes.json | 239 + doc/schemas/lightning-signinvoice.json | 71 + doc/schemas/lightning-signmessage.json | 93 + doc/schemas/lightning-signpsbt.json | 93 + doc/schemas/lightning-splice_init.json | 152 + doc/schemas/lightning-splice_signed.json | 127 + doc/schemas/lightning-splice_update.json | 131 + doc/schemas/lightning-sql.json | 266 + doc/schemas/lightning-staticbackup.json | 53 + doc/schemas/lightning-stop.json | 47 + doc/schemas/lightning-txdiscard.json | 76 + doc/schemas/lightning-txprepare.json | 139 + doc/schemas/lightning-txsend.json | 81 + doc/schemas/lightning-unreserveinputs.json | 156 + doc/schemas/lightning-upgradewallet.json | 107 + doc/schemas/lightning-utxopsbt.json | 271 + doc/schemas/lightning-wait.json | 362 + doc/schemas/lightning-waitanyinvoice.json | 280 + doc/schemas/lightning-waitblockheight.json | 83 + doc/schemas/lightning-waitinvoice.json | 259 + doc/schemas/lightning-waitsendpay.json | 260 + doc/schemas/lightning-withdraw.json | 139 + 126 files changed, 64212 insertions(+) create mode 100644 doc/rpc-schema-draft.json create mode 100644 doc/schemas/lightning-addgossip.json create mode 100644 doc/schemas/lightning-addpsbtoutput.json create mode 100644 doc/schemas/lightning-autoclean-once.json create mode 100644 doc/schemas/lightning-autoclean-status.json create mode 100644 doc/schemas/lightning-autocleaninvoice.json create mode 100644 doc/schemas/lightning-batching.json create mode 100644 doc/schemas/lightning-bkpr-channelsapy.json create mode 100644 doc/schemas/lightning-bkpr-dumpincomecsv.json create mode 100644 doc/schemas/lightning-bkpr-inspect.json create mode 100644 doc/schemas/lightning-bkpr-listaccountevents.json create mode 100644 doc/schemas/lightning-bkpr-listbalances.json create mode 100644 doc/schemas/lightning-bkpr-listincome.json create mode 100644 doc/schemas/lightning-blacklistrune.json create mode 100644 doc/schemas/lightning-check.json create mode 100644 doc/schemas/lightning-checkmessage.json create mode 100644 doc/schemas/lightning-checkrune.json create mode 100644 doc/schemas/lightning-close.json create mode 100644 doc/schemas/lightning-commando-blacklist.json create mode 100644 doc/schemas/lightning-commando-listrunes.json create mode 100644 doc/schemas/lightning-commando-rune.json create mode 100644 doc/schemas/lightning-commando.json create mode 100644 doc/schemas/lightning-connect.json create mode 100644 doc/schemas/lightning-createinvoice.json create mode 100644 doc/schemas/lightning-createonion.json create mode 100644 doc/schemas/lightning-createrune.json create mode 100644 doc/schemas/lightning-datastore.json create mode 100644 doc/schemas/lightning-datastoreusage.json create mode 100644 doc/schemas/lightning-decode.json create mode 100644 doc/schemas/lightning-decodepay.json create mode 100644 doc/schemas/lightning-deldatastore.json create mode 100644 doc/schemas/lightning-delexpiredinvoice.json create mode 100644 doc/schemas/lightning-delforward.json create mode 100644 doc/schemas/lightning-delinvoice.json create mode 100644 doc/schemas/lightning-delpay.json create mode 100644 doc/schemas/lightning-deprecations.json create mode 100644 doc/schemas/lightning-disableinvoicerequest.json create mode 100644 doc/schemas/lightning-disableoffer.json create mode 100644 doc/schemas/lightning-disconnect.json create mode 100644 doc/schemas/lightning-emergencyrecover.json create mode 100644 doc/schemas/lightning-feerates.json create mode 100644 doc/schemas/lightning-fetchinvoice.json create mode 100644 doc/schemas/lightning-fundchannel.json create mode 100644 doc/schemas/lightning-fundchannel_cancel.json create mode 100644 doc/schemas/lightning-fundchannel_complete.json create mode 100644 doc/schemas/lightning-fundchannel_start.json create mode 100644 doc/schemas/lightning-funderupdate.json create mode 100644 doc/schemas/lightning-fundpsbt.json create mode 100644 doc/schemas/lightning-getinfo.json create mode 100644 doc/schemas/lightning-getlog.json create mode 100644 doc/schemas/lightning-getroute.json create mode 100644 doc/schemas/lightning-help.json create mode 100644 doc/schemas/lightning-invoice.json create mode 100644 doc/schemas/lightning-invoicerequest.json create mode 100644 doc/schemas/lightning-keysend.json create mode 100644 doc/schemas/lightning-listchannels.json create mode 100644 doc/schemas/lightning-listclosedchannels.json create mode 100644 doc/schemas/lightning-listconfigs.json create mode 100644 doc/schemas/lightning-listdatastore.json create mode 100644 doc/schemas/lightning-listforwards.json create mode 100644 doc/schemas/lightning-listfunds.json create mode 100644 doc/schemas/lightning-listhtlcs.json create mode 100644 doc/schemas/lightning-listinvoicerequests.json create mode 100644 doc/schemas/lightning-listinvoices.json create mode 100644 doc/schemas/lightning-listnodes.json create mode 100644 doc/schemas/lightning-listoffers.json create mode 100644 doc/schemas/lightning-listpays.json create mode 100644 doc/schemas/lightning-listpeerchannels.json create mode 100644 doc/schemas/lightning-listpeers.json create mode 100644 doc/schemas/lightning-listsendpays.json create mode 100644 doc/schemas/lightning-listsqlschemas.json create mode 100644 doc/schemas/lightning-listtransactions.json create mode 100644 doc/schemas/lightning-makesecret.json create mode 100644 doc/schemas/lightning-multifundchannel.json create mode 100644 doc/schemas/lightning-multiwithdraw.json create mode 100644 doc/schemas/lightning-newaddr.json create mode 100644 doc/schemas/lightning-notifications.json create mode 100644 doc/schemas/lightning-offer.json create mode 100644 doc/schemas/lightning-openchannel_abort.json create mode 100644 doc/schemas/lightning-openchannel_bump.json create mode 100644 doc/schemas/lightning-openchannel_init.json create mode 100644 doc/schemas/lightning-openchannel_signed.json create mode 100644 doc/schemas/lightning-openchannel_update.json create mode 100644 doc/schemas/lightning-parsefeerate.json create mode 100644 doc/schemas/lightning-pay.json create mode 100644 doc/schemas/lightning-ping.json create mode 100644 doc/schemas/lightning-plugin.json create mode 100644 doc/schemas/lightning-preapproveinvoice.json create mode 100644 doc/schemas/lightning-preapprovekeysend.json create mode 100644 doc/schemas/lightning-recover.json create mode 100644 doc/schemas/lightning-recoverchannel.json create mode 100644 doc/schemas/lightning-renepay.json create mode 100644 doc/schemas/lightning-renepaystatus.json create mode 100644 doc/schemas/lightning-reserveinputs.json create mode 100644 doc/schemas/lightning-sendcustommsg.json create mode 100644 doc/schemas/lightning-sendinvoice.json create mode 100644 doc/schemas/lightning-sendonion.json create mode 100644 doc/schemas/lightning-sendonionmessage.json create mode 100644 doc/schemas/lightning-sendpay.json create mode 100644 doc/schemas/lightning-sendpsbt.json create mode 100644 doc/schemas/lightning-setchannel.json create mode 100644 doc/schemas/lightning-setconfig.json create mode 100644 doc/schemas/lightning-setpsbtversion.json create mode 100644 doc/schemas/lightning-showrunes.json create mode 100644 doc/schemas/lightning-signinvoice.json create mode 100644 doc/schemas/lightning-signmessage.json create mode 100644 doc/schemas/lightning-signpsbt.json create mode 100644 doc/schemas/lightning-splice_init.json create mode 100644 doc/schemas/lightning-splice_signed.json create mode 100644 doc/schemas/lightning-splice_update.json create mode 100644 doc/schemas/lightning-sql.json create mode 100644 doc/schemas/lightning-staticbackup.json create mode 100644 doc/schemas/lightning-stop.json create mode 100644 doc/schemas/lightning-txdiscard.json create mode 100644 doc/schemas/lightning-txprepare.json create mode 100644 doc/schemas/lightning-txsend.json create mode 100644 doc/schemas/lightning-unreserveinputs.json create mode 100644 doc/schemas/lightning-upgradewallet.json create mode 100644 doc/schemas/lightning-utxopsbt.json create mode 100644 doc/schemas/lightning-wait.json create mode 100644 doc/schemas/lightning-waitanyinvoice.json create mode 100644 doc/schemas/lightning-waitblockheight.json create mode 100644 doc/schemas/lightning-waitinvoice.json create mode 100644 doc/schemas/lightning-waitsendpay.json create mode 100644 doc/schemas/lightning-withdraw.json diff --git a/contrib/msggen/msggen/schema.json b/contrib/msggen/msggen/schema.json index 431fdae11ff3..88b79159545e 100644 --- a/contrib/msggen/msggen/schema.json +++ b/contrib/msggen/msggen/schema.json @@ -6874,6 +6874,31852 @@ } } }, + "lightning-addgossip.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "addgossip", + "title": "Command for injecting a gossip message (low-level)", + "description": [ + "The **addgossip** RPC command injects a hex-encoded gossip message into the gossip daemon. It may return an error if it is malformed, or may update its internal state using the gossip message.", + "", + "Note that currently some paths will still silently reject the gossip: it is best effort.", + "", + "This is particularly used by plugins which may receive channel_update messages within error replies." + ], + "request": { + "required": [ + "message" + ], + "properties": { + "message": { + "type": "hex", + "description": [ + "The raw, hex-encoded, gossip message to add to the local gossip view." + ] + } + } + }, + "response": { + "properties": {} + }, + "example_json_request": [ + { + "id": "example:addgossip#1", + "method": "addgossip", + "params": { + "message": "010078c3314666731e339c0b8434f7824797a084ed7ca3655991a672da068e2c44cb53b57b53a296c133bc879109a8931dc31e6913a4bda3d58559b99b95663e6d52775579447ef5526300e1bb89bc6af8557aa1c3810a91814eafad6d103f43182e17b16644cb38c1d58a8edd094303959a9f1f9d42ff6c32a21f9c118531f512c8679cabaccc6e39dbd95a4dac90e75a258893c3aa3f733d1b8890174d5ddea8003cadffe557773c54d2c07ca1d535c4bf85885f879ae466c16a516e8ffcfec1740e3f5c98ca9ce13f452e867befef5517f306ed6aa5119b79059bcc6f68f329986b665d16de7bc7df64e3537504c91eeabe0e59d3a2b68e4216ead2b0f6e3ef7c000006226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f0000670000010000022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d590266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c0351802e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5702324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b" + } + }, + { + "id": "example:addgossip#2", + "method": "addgossip", + "params": { + "message": "0102420526c8eb62ec6999bbee5f1de4841cab734374ec642b7deeb0259e76220bf82e97a241c907d5ff52019655f7f9a614c285bb35690f3a1a2b928d7b2349a79e06226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f000067000001000065b32a0e010100060000000000000000000000010000000a000000003b023380" + } + } + ], + "example_json_response": [ + {}, + {} + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-pay(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-addpsbtoutput.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.11", + "rpc": "addpsbtoutput", + "title": "Command to populate PSBT outputs from the wallet", + "description": [ + "`addpsbtoutput` is a low-level RPC command which creates or modifies a PSBT by adding a single output of amount *satoshi*.", + "", + "This is used to receive funds into the on-chain wallet interactively using PSBTs." + ], + "request": { + "required": [ + "satoshi" + ], + "properties": { + "satoshi": { + "type": "sat", + "description": [ + "The satoshi value of the output. It can be a whole number, a whole number ending in *sat*, or a number with 1 to 8 decimal places ending in *btc*." + ] + }, + "initialpsbt": { + "type": "string", + "description": [ + "Base 64 encoded PSBT to add the output to. If not specified, one will be generated automatically." + ] + }, + "locktime": { + "type": "u32", + "description": [ + "If not set, it is set to a recent block height (if no initial psbt is specified)." + ] + }, + "destination": { + "type": "string", + "description": [ + "If it is not set, an internal address is generated." + ] + } + } + }, + "response": { + "required": [ + "psbt", + "estimated_added_weight", + "outnum" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "Unsigned PSBT which fulfills the parameters given." + ] + }, + "estimated_added_weight": { + "type": "u32", + "description": [ + "The estimated weight of the added output." + ] + }, + "outnum": { + "type": "u32", + "description": [ + "The 0-based number where the output was placed." + ] + } + } + }, + "example_usage": [ + "Here is a command to make a PSBT with a 100,000 sat output that leads to the on-chain wallet.", + "", + "```shell", + "lightning-cli addpsbtoutput 100000sat", + "```" + ], + "example_json_request": [ + { + "id": "example:addpsbtoutput#1", + "method": "addpsbtoutput", + "params": { + "satoshi": 100000, + "initialpsbt": null, + "locktime": null, + "destination": null + } + }, + { + "id": "example:addpsbtoutput#2", + "method": "addpsbtoutput", + "params": { + "satoshi": 1000000, + "initialpsbt": null, + "locktime": 111, + "destination": null + } + }, + { + "id": "example:addpsbtoutput#3", + "method": "addpsbtoutput", + "params": { + "satoshi": 974343, + "initialpsbt": "cHNidP8BAF4CAAAAAfwbEpvpi6D14YV4VLnuVB47Y0uF41kXEyJRL4IusySSAQAAAAD9////ASICAAAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5nAAAAAAEA9gIAAAAAAQFEkxvLatohY6mw5gr5qG1aiArSrziFPR2YoqD21Hv+RAAAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNrz8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIEu1nfVRt9i+rFM219mwhMqdwJsqygWSWTFUS+cemdh6AiBG3Qo8g9J/aAMO2RHDsIBScscj6pTTIwZp7Gw8G3EOKAEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPZgAAAAEBK68/DwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==", + "locktime": null, + "destination": "bcrt1q9tc6q49l6wrrtp8ul45rj92hsleehwwxty32zu" + } + } + ], + "example_json_response": [ + { + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIoIYBAAAAAAABBCJRIHg2NV/cioLcTLAKdyxVVBUdBjhKTdZejT9orAhWa4S+AA==", + "estimated_added_weight": 172, + "outnum": 0 + }, + { + "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIJd6ICNAQALFOMhoUHuSVSuzcaUdkDKlk4K+A+DR9+4uAA==", + "estimated_added_weight": 172, + "outnum": 0 + }, + { + "psbt": "cHNidP8BAH0CAAAAAfwbEpvpi6D14YV4VLnuVB47Y0uF41kXEyJRL4IusySSAQAAAAD9////AiICAAAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4H3g4AAAAAABYAFCrxoFS/04Y1hPz9aDkVV4fzm7nGZwAAAAABAPYCAAAAAAEBRJMby2raIWOpsOYK+ahtWogK0q84hT0dmKKg9tR7/kQAAAAAAP3///8CQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAza8/DwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oCRzBEAiBLtZ31UbfYvqxTNtfZsITKncCbKsoFklkxVEvnHpnYegIgRt0KPIPSf2gDDtkRw7CAUnLHI+qU0yMGaexsPBtxDigBIQPXRURck2JmXyLg2W6edm8nPzJg3qOcina/oF3SaE3cz2YAAAABASuvPw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAAAA", + "estimated_added_weight": 172, + "outnum": 1 + } + ], + "author": [ + "Dusty <<@dusty_daemon>> is mainly responsible." + ], + "see_also": [ + "lightning-fundpsbt(7)", + "lightning-utxopsbt(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-autoclean-once.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "autoclean-once", + "title": "A single deletion of old invoices/payments/forwards", + "description": [ + "The **autoclean-once** RPC command tell the `autoclean` plugin to do a single sweep to delete old entries. This is a manual alternative (or addition) to the various `autoclean-...-age` parameters which cause autoclean to run once per hour: see lightningd-config(5)." + ], + "request": { + "required": [ + "subsystem", + "age" + ], + "properties": { + "subsystem": { + "type": "string", + "enum": [ + "succeededforwards", + "failedforwards", + "succeededpays", + "failedpays", + "paidinvoices", + "expiredinvoices" + ], + "description": [ + "What subsystem to clean. Currently supported subsystems are:", + " * `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`).", + " * `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`).", + " * `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`).", + " * `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`).", + " * `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`).", + " * `paidinvoices`: invoices which were paid (`paid` in listinvoices `status)." + ] + }, + "age": { + "type": "u64", + "description": [ + "Non-zero number in seconds. How many seconds old an entry must be to delete it." + ] + } + } + }, + "response": { + "required": [ + "autoclean" + ], + "properties": { + "autoclean": { + "type": "object", + "additionalProperties": false, + "properties": { + "succeededforwards": { + "type": "object", + "additionalProperties": false, + "required": [ + "cleaned", + "uncleaned" + ], + "properties": { + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done this run." + ] + }, + "uncleaned": { + "type": "u64", + "description": [ + "The total number of entries *not* deleted this run." + ] + } + } + }, + "failedforwards": { + "type": "object", + "additionalProperties": false, + "required": [ + "cleaned", + "uncleaned" + ], + "properties": { + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done this run." + ] + }, + "uncleaned": { + "type": "u64", + "description": [ + "The total number of entries *not* deleted this run." + ] + } + } + }, + "succeededpays": { + "type": "object", + "additionalProperties": false, + "required": [ + "cleaned", + "uncleaned" + ], + "properties": { + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done this run." + ] + }, + "uncleaned": { + "type": "u64", + "description": [ + "The total number of entries *not* deleted this run." + ] + } + } + }, + "failedpays": { + "type": "object", + "additionalProperties": false, + "required": [ + "cleaned", + "uncleaned" + ], + "properties": { + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done this run." + ] + }, + "uncleaned": { + "type": "u64", + "description": [ + "The total number of entries *not* deleted this run." + ] + } + } + }, + "paidinvoices": { + "type": "object", + "additionalProperties": false, + "required": [ + "cleaned", + "uncleaned" + ], + "properties": { + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done this run." + ] + }, + "uncleaned": { + "type": "u64", + "description": [ + "The total number of entries *not* deleted this run." + ] + } + } + }, + "expiredinvoices": { + "type": "object", + "additionalProperties": false, + "required": [ + "cleaned", + "uncleaned" + ], + "properties": { + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done this run." + ] + }, + "uncleaned": { + "type": "u64", + "description": [ + "The total number of entries *not* deleted this run." + ] + } + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:autoclean-once#1", + "method": "autoclean-once", + "params": [ + "failedpays", + 1 + ] + }, + { + "id": "example:autoclean-once#2", + "method": "autoclean-once", + "params": [ + "succeededpays", + 1 + ] + } + ], + "example_json_response": [ + { + "autoclean": { + "failedpays": { + "cleaned": 1, + "uncleaned": 1 + } + } + }, + { + "autoclean": { + "succeededpays": { + "cleaned": 1, + "uncleaned": 0 + } + } + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightningd-config(5)", + "lightning-autoclean-status(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-autoclean-status.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "autoclean-status", + "title": "Examine auto-delete of old invoices/payments/forwards", + "description": [ + "The **autoclean-status** RPC command tells you about the status of the autclean plugin, optionally for only one subsystem." + ], + "request": { + "required": [], + "properties": { + "subsystem": { + "type": "string", + "enum": [ + "succeededforwards", + "failedforwards", + "succeededpays", + "failedpays", + "paidinvoices", + "expiredinvoices" + ], + "description": [ + "What subsystem to ask about. Currently supported subsystems are:", + " * `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`).", + " * `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`).", + " * `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`).", + " * `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`).", + " * `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`).", + " * `paidinvoices`: invoices which were paid (`paid` in listinvoices `status)." + ] + } + } + }, + "response": { + "required": [ + "autoclean" + ], + "properties": { + "autoclean": { + "type": "object", + "additionalProperties": false, + "properties": { + "succeededforwards": { + "type": "object", + "additionalProperties": true, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": { + "type": "boolean", + "description": [ + "Whether autocleaning is enabled for successful listforwards." + ] + }, + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done (ever)." + ] + } + }, + "if": { + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "enabled", + "age", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {}, + "age": { + "type": "u64", + "description": [ + "Age (in seconds) to delete successful listforwards." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {} + } + } + }, + "failedforwards": { + "type": "object", + "additionalProperties": true, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": { + "type": "boolean", + "description": [ + "Whether autocleaning is enabled for failed listforwards." + ] + }, + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done (ever)." + ] + } + }, + "if": { + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "enabled", + "age", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {}, + "age": { + "type": "u64", + "description": [ + "Age (in seconds) to delete failed listforwards." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {} + } + } + }, + "succeededpays": { + "type": "object", + "additionalProperties": true, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": { + "type": "boolean", + "description": [ + "Whether autocleaning is enabled for successful listpays/listsendpays." + ] + }, + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done (ever)." + ] + } + }, + "if": { + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "enabled", + "age", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {}, + "age": { + "type": "u64", + "description": [ + "Age (in seconds) to delete successful listpays/listsendpays." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {} + } + } + }, + "failedpays": { + "type": "object", + "additionalProperties": true, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": { + "type": "boolean", + "description": [ + "Whether autocleaning is enabled for failed listpays/listsendpays." + ] + }, + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done (ever)." + ] + } + }, + "if": { + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "enabled", + "age", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {}, + "age": { + "type": "u64", + "description": [ + "Age (in seconds) to delete failed listpays/listsendpays." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {} + } + } + }, + "paidinvoices": { + "type": "object", + "additionalProperties": true, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": { + "type": "boolean", + "description": [ + "Whether autocleaning is enabled for paid listinvoices." + ] + }, + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done (ever)." + ] + } + }, + "if": { + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "enabled", + "age", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {}, + "age": { + "type": "u64", + "description": [ + "Age (in seconds) to paid listinvoices." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {} + } + } + }, + "expiredinvoices": { + "type": "object", + "additionalProperties": true, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": { + "type": "boolean", + "description": [ + "Whether autocleaning is enabled for expired (unpaid) listinvoices." + ] + }, + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done (ever)." + ] + } + }, + "if": { + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "enabled", + "age", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {}, + "age": { + "type": "u64", + "description": [ + "Age (in seconds) to expired listinvoices." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {} + } + } + } + } + } + }, + "pre_return_value_notes": [ + "Note that the ages parameters are set by various `autoclean-...-age` parameters in your configuration: see lightningd-config(5)." + ] + }, + "example_json_request": [ + { + "id": "example:autoclean-status#1", + "method": "autoclean-status", + "params": { + "subsystem": "expiredinvoices" + } + }, + { + "id": "example:autoclean-status#2", + "method": "autoclean-status", + "params": { + "subsystem": null + } + } + ], + "example_json_response": [ + { + "autoclean": { + "expiredinvoices": { + "enabled": false, + "cleaned": 0 + } + } + }, + { + "autoclean": { + "succeededforwards": { + "enabled": false, + "cleaned": 0 + }, + "failedforwards": { + "enabled": false, + "cleaned": 0 + }, + "succeededpays": { + "enabled": false, + "cleaned": 0 + }, + "failedpays": { + "enabled": false, + "cleaned": 0 + }, + "paidinvoices": { + "enabled": false, + "cleaned": 0 + }, + "expiredinvoices": { + "enabled": true, + "age": 2, + "cleaned": 0 + } + } + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightningd-config(5)", + "lightning-listinvoices(7)", + "lightning-listpays(7)", + "lightning-listforwards(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-autocleaninvoice.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "setchannel", + "title": "Command for configuring fees / htlc range advertized for a channel", + "description": [], + "request": { + "required": [], + "properties": { + "expired_by": { + "type": "u64", + "description": [ + "How long an invoice must be expired (seconds) before we delete it." + ] + }, + "cycle_seconds": { + "type": "u64", + "description": [ + "The interval (in seconds) between cleaning expired invoices." + ] + } + } + }, + "response": { + "required": [ + "enabled" + ], + "properties": { + "enabled": { + "type": "boolean", + "description": [ + "Whether invoice autocleaning is active." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "expired_by", + "cycle_seconds" + ], + "properties": { + "enabled": {}, + "expired_by": { + "type": "u64", + "description": [ + "How long an invoice must be expired (seconds) before we delete it." + ] + }, + "cycle_seconds": { + "type": "u64", + "description": [ + "How long an invoice must be expired (seconds) before we delete it." + ] + } + } + }, + "else": { + "additionalProperties": false, + "properties": { + "enabled": {} + } + } + } + ] + }, + "example_json_request": [ + { + "id": "example:autocleaninvoice#1", + "method": "autocleaninvoice", + "params": { + "cycle_seconds": 8, + "expired_by": 2 + } + }, + { + "id": "example:autocleaninvoice#2", + "method": "autocleaninvoice", + "params": { + "cycle_seconds": 1, + "expired_by": 1 + } + } + ], + "example_json_response": [ + { + "enabled": true, + "cycle_seconds": 8, + "expired_by": 2 + }, + { + "enabled": true, + "cycle_seconds": 1, + "expired_by": 1 + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightningd-config(5)", + "lightning-listinvoices(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-batching.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "batching", + "title": "Command to allow database batching.", + "description": [ + "The **batching** RPC command allows (but does not guarantee!) database commitments to be deferred when multiple commands are issued on this RPC connection. This is only useful if many commands are being given at once, in which case it can offer a performance improvement (the cost being that if there is a crash, it's unclear how many of the commands will have been persisted)." + ], + "request": { + "required": [ + "enable" + ], + "properties": { + "enable": { + "type": "boolean", + "description": [ + "Whether to enable or disable transaction batching." + ], + "default": "False" + } + } + }, + "response": { + "properties": {} + }, + "example_json_request": [ + { + "id": "example:batching#1", + "method": "batching", + "params": { + "enable": true + } + } + ], + "example_json_response": [ + {} + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters." + ], + "author": [ + "Rusty Russell <> wrote the initial version of this man page." + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-bkpr-channelsapy.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "bkpr-channelsapy", + "title": "Command to list stats on channel earnings", + "description": [ + "The **bkpr-channelsapy** RPC command lists stats on routing income, leasing income, and various calculated APYs for channel routed funds." + ], + "request": { + "required": [], + "properties": { + "start_time": { + "type": "u64", + "description": [ + "UNIX timestamp (in seconds) to filter events after the provided timestamp." + ], + "default": "zero" + }, + "end_time": { + "type": "u64", + "description": [ + "UNIX timestamp (in seconds) to filter events up to and at the provided timestamp." + ], + "default": "max-int" + } + } + }, + "response": { + "required": [ + "channels_apy" + ], + "properties": { + "channels_apy": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "account", + "routed_out_msat", + "routed_in_msat", + "lease_fee_paid_msat", + "lease_fee_earned_msat", + "pushed_out_msat", + "pushed_in_msat", + "our_start_balance_msat", + "channel_start_balance_msat", + "fees_out_msat", + "utilization_out", + "utilization_in", + "apy_out", + "apy_in", + "apy_total" + ], + "properties": { + "account": { + "type": "string", + "description": [ + "The account name. If the account is a channel, the channel_id. The 'net' entry is the rollup of all channel accounts." + ] + }, + "routed_out_msat": { + "type": "msat", + "description": [ + "Sats routed (outbound)." + ] + }, + "routed_in_msat": { + "type": "msat", + "description": [ + "Sats routed (inbound)." + ] + }, + "lease_fee_paid_msat": { + "type": "msat", + "description": [ + "Sats paid for leasing inbound (liquidity ads)." + ] + }, + "lease_fee_earned_msat": { + "type": "msat", + "description": [ + "Sats earned for leasing outbound (liquidity ads)." + ] + }, + "pushed_out_msat": { + "type": "msat", + "description": [ + "Sats pushed to peer at open." + ] + }, + "pushed_in_msat": { + "type": "msat", + "description": [ + "Sats pushed in from peer at open." + ] + }, + "our_start_balance_msat": { + "type": "msat", + "description": [ + "Starting balance in channel at funding. Note that if our start balance is zero, any _initial field will be omitted (can't divide by zero)." + ] + }, + "channel_start_balance_msat": { + "type": "msat", + "description": [ + "Total starting balance at funding." + ] + }, + "fees_out_msat": { + "type": "msat", + "description": [ + "Fees earned on routed outbound." + ] + }, + "fees_in_msat": { + "type": "msat", + "description": [ + "Fees earned on routed inbound." + ] + }, + "utilization_out": { + "type": "string", + "description": [ + "Sats routed outbound / total start balance." + ] + }, + "utilization_out_initial": { + "type": "string", + "description": [ + "Sats routed outbound / our start balance." + ] + }, + "utilization_in": { + "type": "string", + "description": [ + "Sats routed inbound / total start balance." + ] + }, + "utilization_in_initial": { + "type": "string", + "description": [ + "Sats routed inbound / our start balance." + ] + }, + "apy_out": { + "type": "string", + "description": [ + "Fees earned on outbound routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)." + ] + }, + "apy_out_initial": { + "type": "string", + "description": [ + "Fees earned on outbound routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)." + ] + }, + "apy_in": { + "type": "string", + "description": [ + "Fees earned on inbound routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)." + ] + }, + "apy_in_initial": { + "type": "string", + "description": [ + "Fees earned on inbound routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)." + ] + }, + "apy_total": { + "type": "string", + "description": [ + "Total fees earned on routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)." + ] + }, + "apy_total_initial": { + "type": "string", + "description": [ + "Total fees earned on routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)." + ] + }, + "apy_lease": { + "type": "string", + "description": [ + "Lease fees earned over total amount leased for the lease term, amortized to a year (APY). Only appears if channel was leased out by us." + ] + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:bkpr-channelsapy#1", + "method": "bkpr-channelsapy", + "params": "{}" + } + ], + "example_json_response": [ + { + "channels_apy": [ + { + "account": "e41b2ec83e9139a9fd8f1d89b01e5d7df73099494e6b91504c39445e37485b0d", + "routed_out_msat": 1431440, + "routed_in_msat": 0, + "lease_fee_paid_msat": 0, + "lease_fee_earned_msat": 0, + "pushed_out_msat": 0, + "pushed_in_msat": 0, + "our_start_balance_msat": 1000000000, + "channel_start_balance_msat": 1000000000, + "fees_out_msat": 0, + "fees_in_msat": 0, + "utilization_out": "0.1431%", + "utilization_out_initial": "0.1431%", + "utilization_in": "0.0000%", + "apy_out": "0.0000%", + "apy_out_initial": "0.0000%", + "apy_in": "0.0000%", + "apy_total": "0.0000%", + "apy_total_initial": "0.0000%" + }, + { + "account": "net", + "routed_out_msat": 1431440, + "routed_in_msat": 0, + "lease_fee_paid_msat": 0, + "lease_fee_earned_msat": 0, + "pushed_out_msat": 0, + "pushed_in_msat": 0, + "our_start_balance_msat": 1000000000, + "channel_start_balance_msat": 1000000000, + "fees_out_msat": 0, + "fees_in_msat": 0, + "utilization_out": "0.1431%", + "utilization_out_initial": "0.1431%", + "utilization_in": "0.0000%", + "apy_out": "0.0000%", + "apy_out_initial": "0.0000%", + "apy_in": "0.0000%", + "apy_total": "0.0000%", + "apy_total_initial": "0.0000%" + } + ] + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-bkpr-listincome(7)", + "lightning-bkpr-listfunds(7)", + "lightning-bkpr-listaccountevents(7)", + "lightning-bkpr-dumpincomecsv(7)", + "lightning-listpeers(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-bkpr-dumpincomecsv.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "bkpr-dumpincomecsv", + "title": "Command to emit a CSV of income events", + "description": [ + "The **bkpr-dumpincomcsv** RPC command writes a CSV file to disk at *csv_file* location. This is a formatted output of the **listincome** RPC command." + ], + "request": { + "required": [ + "csv_format" + ], + "properties": { + "csv_format": { + "type": "string", + "description": [ + "CSV format to use. See RETURN VALUE for options." + ] + }, + "csv_file": { + "type": "string", + "description": [ + "On-disk destination of the generated CSV file." + ] + }, + "consolidate_fees": { + "type": "boolean", + "description": [ + "If true, we emit a single, consolidated event for any onchain-fees for a txid and account. Otherwise, events for every update to the onchain fee calculation for this account and txid will be printed. Note that this means that the events emitted are non-stable, i.e. calling **dumpincomecsv** twice may result in different onchain fee events being emitted, depending on how much information we've logged for that transaction." + ], + "default": "True" + }, + "start_time": { + "type": "u64", + "description": [ + "UNIX timestamp (in seconds) that filters events after the provided timestamp." + ], + "default": "zero" + }, + "end_time": { + "type": "u64", + "description": [ + "UNIX timestamp (in seconds) that filters events up to and at the provided timestamp." + ], + "default": "max-int" + } + } + }, + "response": { + "required": [ + "csv_file", + "csv_format" + ], + "properties": { + "csv_file": { + "type": "string", + "description": [ + "File that the csv was generated to." + ] + }, + "csv_format": { + "type": "string", + "enum": [ + "cointracker", + "koinly", + "harmony", + "quickbooks" + ], + "description": [ + "Format to print csv as." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:bkpr-dumpincomecsv#1", + "method": "bkpr-dumpincomecsv", + "params": [ + "koinly", + "koinly.csv" + ] + } + ], + "example_json_response": [ + { + "csv_file": "koinly.csv", + "csv_format": "koinly" + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-bkpr-listincome(7)", + "lightning-bkpr-listfunds(7)", + "lightning-bkpr-listaccountevents(7)", + "lightning-bkpr-channelsapy(7)", + "lightning-listpeers(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-bkpr-inspect.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "bkpr-inspect", + "title": "Command to show onchain footprint of a channel", + "description": [ + "The **bkpr-inspect** RPC command lists all known on-chain transactions and associated events for the provided account. Useful for inspecting unilateral closes for a given channel account. Only valid for channel accounts." + ], + "request": { + "required": [ + "account" + ], + "properties": { + "account": { + "type": "string", + "description": [ + "Channel account to inspect." + ] + } + } + }, + "response": { + "required": [ + "txs" + ], + "properties": { + "txs": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "txid", + "fees_paid_msat", + "outputs" + ], + "properties": { + "txid": { + "type": "txid", + "description": [ + "Transaction id." + ] + }, + "blockheight": { + "type": "u32", + "description": [ + "Blockheight of transaction." + ] + }, + "fees_paid_msat": { + "type": "msat", + "description": [ + "Amount paid in sats for this tx." + ] + }, + "outputs": { + "type": "array", + "items": { + "type": "object", + "required": [ + "account", + "outnum", + "output_value_msat", + "currency" + ], + "additionalProperties": false, + "properties": { + "account": { + "type": "string", + "description": [ + "Account this output affected." + ] + }, + "outnum": { + "type": "u32", + "description": [ + "Index of output." + ] + }, + "output_value_msat": { + "type": "msat", + "description": [ + "Value of the output." + ] + }, + "currency": { + "type": "string", + "description": [ + "Human-readable bech32 part for this coin type." + ] + }, + "credit_msat": { + "type": "msat", + "description": [ + "Amount credited to account." + ] + }, + "debit_msat": { + "type": "msat", + "description": [ + "Amount debited from account." + ] + }, + "originating_account": { + "type": "string", + "description": [ + "Account this output originated from." + ] + }, + "output_tag": { + "type": "string", + "description": [ + "Description of output creation event." + ] + }, + "spend_tag": { + "type": "string", + "description": [ + "Description of output spend event." + ] + }, + "spending_txid": { + "type": "txid", + "description": [ + "Transaction this output was spent in." + ] + }, + "payment_id": { + "type": "hex", + "description": [ + "Lightning payment identifier. For an htlc, this will be the preimage." + ] + } + }, + "allOf": [ + { + "if": { + "required": [ + "credit_msat" + ] + }, + "then": { + "required": [ + "output_tag" + ], + "additionalProperties": false, + "properties": { + "account": {}, + "outnum": {}, + "output_value_msat": {}, + "currency": {}, + "credit_msat": {}, + "originating_account": {}, + "debit_msat": {}, + "output_tag": {}, + "spend_tag": {}, + "spending_txid": {}, + "payment_id": {} + } + } + }, + { + "if": { + "required": [ + "spending_txid" + ] + }, + "then": { + "required": [ + "spend_tag", + "debit_msat" + ], + "additionalProperties": false, + "properties": { + "account": {}, + "outnum": {}, + "output_value_msat": {}, + "currency": {}, + "credit_msat": {}, + "originating_account": {}, + "debit_msat": {}, + "output_tag": {}, + "spend_tag": {}, + "spending_txid": {}, + "payment_id": {} + } + } + } + ] + } + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:bkpr-inspect#1", + "method": "bkpr-inspect", + "params": [ + "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab" + ] + } + ], + "example_json_response": [ + { + "txs": [ + { + "txid": "abb283035e569c190696d42a1208bb38ddc64b6377e88f2d6277c01eab7b0af3", + "fees_paid_msat": 0, + "outputs": [ + { + "account": "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab", + "outnum": 0, + "output_tag": "channel_proposed", + "output_value_msat": 996363000, + "credit_msat": 996363000, + "currency": "bcrt" + } + ] + } + ] + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-listbalances(7)", + "lightning-listfunds(7)", + "lightning-listpeers(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-bkpr-listaccountevents.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "bkpr-listaccountevents", + "title": "Command for listing recorded bookkeeping events", + "description": [ + "The **bkpr-listaccountevents** RPC command is a list of all bookkeeping events that have been recorded for this node.", + "", + "If the optional parameter **account** is set, we only emit events for the specified account, if exists.", + "", + "Note that the type **onchain_fees** that are emitted are of opposite credit/debit than as they appear in **listincome**, as **listincome** shows all events from the perspective of the node, whereas **listaccountevents** just dumps the event data as we've got it. Onchain fees are updated/recorded as we get more information about input and output spends -- the total onchain fees that were recorded for a transaction for an account can be found by summing all onchain fee events and taking the difference between the **credit_msat** and **debit_msat** for these events. We do this so that successive calls to **listaccountevents** always produce the same list of events -- no previously emitted event will be subsequently updated, rather we add a new event to the list." + ], + "request": { + "required": [], + "properties": { + "account": { + "type": "string", + "description": [ + "Receive events for the specified account." + ] + } + } + }, + "response": { + "required": [ + "events" + ], + "properties": { + "events": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "account", + "type", + "tag", + "credit_msat", + "debit_msat", + "currency", + "timestamp" + ], + "properties": { + "account": { + "type": "string", + "description": [ + "The account name. If the account is a channel, the channel_id." + ] + }, + "type": { + "type": "string", + "enum": [ + "onchain_fee", + "chain", + "channel" + ], + "description": [ + "Coin movement type." + ] + }, + "tag": { + "type": "string", + "description": [ + "Description of movement." + ] + }, + "credit_msat": { + "type": "msat", + "description": [ + "Amount credited." + ] + }, + "debit_msat": { + "type": "msat", + "description": [ + "Amount debited." + ] + }, + "currency": { + "type": "string", + "description": [ + "Human-readable bech32 part for this coin type." + ] + }, + "timestamp": { + "type": "u32", + "description": [ + "Timestamp this event was recorded by the node. For consolidated events such as onchain_fees, the most recent timestamp." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "chain" + ] + } + } + }, + "then": { + "properties": { + "account": {}, + "type": {}, + "tag": {}, + "credit_msat": {}, + "debit_msat": {}, + "currency": {}, + "timestamp": {}, + "outpoint": { + "type": "string", + "description": [ + "The txid:outnum for this event." + ] + }, + "blockheight": { + "type": "u32", + "description": [ + "For chain events, blockheight this occured at." + ] + }, + "origin": { + "type": "string", + "description": [ + "The account this movement originated from." + ] + }, + "payment_id": { + "type": "hex", + "description": [ + "Lightning payment identifier. For an htlc, this will be the preimage." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The txid of the transaction that created this event." + ] + }, + "description": { + "type": "string", + "description": [ + "The description of this event." + ] + } + }, + "required": [ + "outpoint", + "blockheight" + ], + "additionalProperties": false + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "onchain_fee" + ] + } + } + }, + "then": { + "properties": { + "account": {}, + "type": {}, + "tag": {}, + "credit_msat": {}, + "debit_msat": {}, + "currency": {}, + "timestamp": {}, + "description": {}, + "txid": { + "type": "txid", + "description": [ + "The txid of the transaction that created this event." + ] + } + }, + "required": [ + "txid" + ], + "additionalProperties": false + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "channel" + ] + } + } + }, + "then": { + "properties": { + "account": {}, + "type": {}, + "tag": {}, + "credit_msat": {}, + "debit_msat": {}, + "currency": {}, + "timestamp": {}, + "description": {}, + "fees_msat": { + "type": "msat", + "description": [ + "Amount paid in fees." + ] + }, + "is_rebalance": { + "type": "boolean", + "description": [ + "Is this payment part of a rebalance." + ] + }, + "payment_id": { + "type": "hex", + "description": [ + "Lightning payment identifier. For an htlc, this will be the preimage." + ] + }, + "part_id": { + "type": "u32", + "description": [ + "Counter for multi-part payments." + ] + } + }, + "additionalProperties": false + } + } + ] + } + } + } + }, + "example_json_request": [ + { + "id": "example:bkpr-listaccountevents#1", + "method": "bkpr-listaccountevents", + "params": "{}" + }, + { + "id": "example:bkpr-listaccountevents#2", + "method": "bkpr-listaccountevents", + "params": [ + "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab" + ] + } + ], + "example_json_response": [ + { + "events": [ + { + "account": "wallet", + "type": "channel", + "tag": "journal_entry", + "credit_msat": 0, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706152911, + "is_rebalance": false + }, + { + "account": "wallet", + "type": "chain", + "tag": "deposit", + "credit_msat": 2000000000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "7e202b3b1016e8eb6f4e936215ed6b5bdc63c17e6ebb5e6bce2f98e6757ba44c:0", + "timestamp": 1706152914, + "blockheight": 102 + }, + { + "account": "wallet", + "type": "chain", + "tag": "withdrawal", + "credit_msat": 0, + "debit_msat": 2000000000, + "currency": "bcrt", + "outpoint": "7e202b3b1016e8eb6f4e936215ed6b5bdc63c17e6ebb5e6bce2f98e6757ba44c:0", + "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b", + "timestamp": 1706152921, + "blockheight": 103 + }, + { + "account": "wallet", + "type": "chain", + "tag": "deposit", + "credit_msat": 995073000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b:1", + "timestamp": 1706152921, + "blockheight": 103 + }, + { + "account": "wallet", + "type": "onchain_fee", + "tag": "onchain_fee", + "credit_msat": 1004927000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706152921, + "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b" + }, + { + "account": "wallet", + "type": "onchain_fee", + "tag": "onchain_fee", + "credit_msat": 0, + "debit_msat": 1004927000, + "currency": "bcrt", + "timestamp": 1706152921, + "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b" + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "chain", + "tag": "channel_open", + "credit_msat": 1000000000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b:0", + "timestamp": 1706152922, + "blockheight": 103 + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "onchain_fee", + "tag": "onchain_fee", + "credit_msat": 4927000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706152922, + "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b" + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "channel", + "tag": "invoice", + "credit_msat": 0, + "debit_msat": 11000000, + "currency": "bcrt", + "payment_id": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "part_id": 0, + "timestamp": 1706152934, + "description": [ + "XEoCR94SIz6UIRUEkxum." + ], + "is_rebalance": false + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "chain", + "tag": "channel_close", + "credit_msat": 0, + "debit_msat": 989000000, + "currency": "bcrt", + "outpoint": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b:0", + "txid": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998", + "timestamp": 1706152938, + "blockheight": 104 + }, + { + "account": "external", + "origin": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "chain", + "tag": "to_them", + "credit_msat": 10899000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998:0", + "timestamp": 1706152938, + "blockheight": 104 + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "onchain_fee", + "tag": "onchain_fee", + "credit_msat": 7967000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706152938, + "txid": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998" + }, + { + "account": "wallet", + "type": "chain", + "tag": "deposit", + "credit_msat": 980912000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "85477738281c1afd652c350025f1d28658fe541c83adc9a7d5276c30cf715a11:0", + "timestamp": 1706152941, + "blockheight": 109 + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "chain", + "tag": "delayed_to_us", + "credit_msat": 981033000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998:1", + "timestamp": 1706152941, + "blockheight": 104 + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "chain", + "tag": "to_wallet", + "credit_msat": 0, + "debit_msat": 981033000, + "currency": "bcrt", + "outpoint": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998:1", + "txid": "85477738281c1afd652c350025f1d28658fe541c83adc9a7d5276c30cf715a11", + "timestamp": 1706152941, + "blockheight": 109 + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "onchain_fee", + "tag": "onchain_fee", + "credit_msat": 121000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706152941, + "txid": "85477738281c1afd652c350025f1d28658fe541c83adc9a7d5276c30cf715a11" + } + ] + }, + { + "events": [ + { + "account": "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab", + "type": "chain", + "tag": "channel_proposed", + "credit_msat": 996363000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "abb283035e569c190696d42a1208bb38ddc64b6377e88f2d6277c01eab7b0af3:0", + "timestamp": 1706246949, + "blockheight": 0 + }, + { + "account": "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab", + "type": "channel", + "tag": "pushed", + "credit_msat": 0, + "debit_msat": 20000000, + "currency": "bcrt", + "timestamp": 1706246949, + "is_rebalance": false + } + ] + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-bkpr-listincome(7)", + "lightning-listfunds(7)", + "lightning-bkpr-listbalances(7)", + "lightning-bkpr-channelsapy(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-bkpr-listbalances.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "bkpr-listbalances", + "title": "Command for listing current channel + wallet balances", + "description": [ + "The **bkpr-listbalances** RPC command is a list of all current and historical account balances. An account is either the on-chain *wallet* or a channel balance. Any funds sent to an *external* account will not be accounted for here.", + "", + "Note that any channel that was recorded will be listed. Closed channel balances will be 0msat." + ], + "request": { + "required": [], + "properties": {} + }, + "response": { + "required": [ + "accounts" + ], + "properties": { + "accounts": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "account", + "balances" + ], + "properties": { + "account": { + "type": "string", + "description": [ + "The account name. If the account is a channel, the channel_id." + ] + }, + "balances": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "balance_msat", + "coin_type" + ], + "properties": { + "balance_msat": { + "type": "msat", + "description": [ + "Current account balance." + ] + }, + "coin_type": { + "type": "string", + "description": [ + "Coin type, same as HRP for bech32." + ] + } + } + } + } + }, + "if": { + "required": [ + "peer_id" + ] + }, + "then": { + "required": [ + "account", + "balances", + "peer_id", + "we_opened", + "account_closed", + "account_resolved" + ], + "additionalProperties": false, + "properties": { + "account": {}, + "balances": {}, + "peer_id": { + "type": "pubkey", + "description": [ + "Node id for the peer this account is with." + ] + }, + "we_opened": { + "type": "boolean", + "description": [ + "Did we initiate this account open (open the channel)." + ] + }, + "account_closed": { + "type": "boolean", + "description": [ + "", + "" + ] + }, + "account_resolved": { + "type": "boolean", + "description": [ + "Has this channel been closed and all outputs resolved?" + ] + }, + "resolved_at_block": { + "type": "u32", + "description": [ + "Blockheight account resolved on chain." + ] + } + } + }, + "else": { + "properties": { + "account": {}, + "balances": {} + }, + "additionalProperties": false + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:bkpr-listbalances#1", + "method": "bkpr-listbalances", + "params": "{}" + } + ], + "example_json_response": [ + { + "accounts": [ + { + "account": "wallet", + "balances": [ + { + "balance_msat": 2222222000, + "coin_type": "bcrt" + } + ] + } + ] + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-bkpr-listincome(7)", + "lightning-listfunds(7)", + "lightning-bkpr-listaccountevents(7)", + "lightning-bkpr-channelsapy(7)", + "lightning-listpeers(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-bkpr-listincome.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "pre-v0.10.1", + "rpc": "bkpr-listincome", + "title": "Command for listing all income impacting events", + "description": [ + "The **bkpr-listincome** RPC command is a list of all income impacting events that the bookkeeper plugin has recorded for this node." + ], + "request": { + "required": [], + "properties": { + "consolidate_fees": { + "type": "boolean", + "description": [ + "If true, we emit a single, consolidated event for any onchain-fees for a txid and account. Otherwise, events for every update to the onchain fee calculation for this account and txid will be printed. Note that this means that the events emitted are non-stable, i.e. calling **listincome** twice may result in different onchain fee events being emitted, depending on how much information we've logged for that transaction." + ], + "default": "True" + }, + "start_time": { + "type": "u32", + "description": [ + "UNIX timestamp (in seconds) that filters events after the provided timestamp." + ], + "default": "zero" + }, + "end_time": { + "type": "u32", + "description": [ + "UNIX timestamp (in seconds) that filters events up to and at the provided timestamp." + ], + "default": "max-int" + } + } + }, + "response": { + "required": [ + "income_events" + ], + "properties": { + "income_events": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "account", + "tag", + "credit_msat", + "debit_msat", + "currency", + "timestamp" + ], + "properties": { + "account": { + "type": "string", + "description": [ + "The account name. If the account is a channel, the channel_id." + ] + }, + "tag": { + "type": "string", + "description": [ + "Type of income event." + ] + }, + "credit_msat": { + "type": "msat", + "description": [ + "Amount earned (income)." + ] + }, + "debit_msat": { + "type": "msat", + "description": [ + "Amount spent (expenses)." + ] + }, + "currency": { + "type": "string", + "description": [ + "Human-readable bech32 part for this coin type." + ] + }, + "timestamp": { + "type": "u32", + "description": [ + "Timestamp this event was recorded by the node. For consolidated events such as onchain_fees, the most recent timestamp." + ] + }, + "description": { + "type": "string", + "description": [ + "More information about this event. If a `invoice` type, typically the bolt11/bolt12 description." + ] + }, + "outpoint": { + "type": "string", + "description": [ + "The txid:outnum for this event, if applicable." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The txid of the transaction that created this event, if applicable." + ] + }, + "payment_id": { + "type": "hex", + "description": [ + "Lightning payment identifier. For an htlc, this will be the preimage." + ] + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:bkpr-listincome#1", + "method": "bkpr-listincome", + "params": "{}" + }, + { + "id": "example:bkpr-listincome#2", + "method": "bkpr-listincome", + "params": { + "consolidate_fees": false + } + } + ], + "example_json_response": [ + { + "income_events": [ + { + "account": "wallet", + "tag": "deposit", + "credit_msat": 1111111000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706153060, + "outpoint": "6d813d2e99ae7181b61e59ff224c43de698bd08b8ca5b8034ccc13aa7b6428ef:0" + }, + { + "account": "wallet", + "tag": "deposit", + "credit_msat": 1111111000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706153060, + "outpoint": "0bbbe965f76525af3876ae6f1520d91047d4be04cb4e46b7229120a60c5dc9c5:0" + } + ] + }, + { + "income_events": [ + { + "account": "wallet", + "tag": "deposit", + "credit_msat": 1111111000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1708624181, + "outpoint": "895b5eaad4544d24c99628883b4d84b2c6024d6a2da4c1de54098d985f280943:1" + }, + { + "account": "wallet", + "tag": "withdrawal", + "credit_msat": 0, + "debit_msat": 555555000, + "currency": "bcrt", + "timestamp": 1708624182, + "outpoint": "d28a2cba55da10700ddd7f1f23618160dafb3134650055654551d9b0382dcd71:0" + }, + { + "account": "wallet", + "tag": "onchain_fee", + "credit_msat": 0, + "debit_msat": 555556000, + "currency": "bcrt", + "timestamp": 1708624183, + "txid": "d28a2cba55da10700ddd7f1f23618160dafb3134650055654551d9b0382dcd71" + }, + { + "account": "wallet", + "tag": "onchain_fee", + "credit_msat": 554947000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1708624183, + "txid": "d28a2cba55da10700ddd7f1f23618160dafb3134650055654551d9b0382dcd71" + } + ] + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-bkpr-listaccountevents(7)", + "lightning-listfunds(7)", + "lightning-bkpr-listbalances(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-blacklistrune.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.08", + "rpc": "blacklistrune", + "title": "Command to prevent a rune from working", + "description": [ + "The **blacklistrune** RPC command allows you to effectively revoke the rune you have created (and any runes derived from that rune with additional restictions). Attempting to use these runes will be resulted in a `Blacklisted rune` error message.", + "", + "Destroy a rune like in olden times with the **destroyrune** command.", + "", + "All runes created by lightning have a unique sequential id within them and can be blacklisted in ranges for efficiency. The command always returns the blacklisted ranges on success. If no parameters are specified, no changes have been made. If start specified without end, that single rune is blacklisted. If end is also specified, every rune from start till end inclusive is blacklisted." + ], + "request": { + "required": [], + "properties": { + "start": { + "type": "u64", + "description": [ + "First rune unique id to blacklist." + ] + }, + "end": { + "type": "u64", + "description": [ + "Final rune unique id to blacklist (defaults to start)." + ] + } + }, + "dependentUpon": { + "start": [ + "end" + ] + } + }, + "response": { + "required": [ + "blacklist" + ], + "properties": { + "blacklist": { + "type": "array", + "description": [ + "The resulting blacklist ranges after the command." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "start", + "end" + ], + "properties": { + "start": { + "type": "u64", + "description": [ + "Unique id of first rune in this blacklist range." + ] + }, + "end": { + "type": "u64", + "description": [ + "Unique id of last rune in this blacklist range." + ] + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:blacklistrune#1", + "method": "blacklistrune", + "params": { + "start": 2 + } + }, + { + "id": "example:blacklistrune#2", + "method": "blacklistrune", + "params": { + "start": 5, + "end": 7 + } + }, + { + "id": "example:blacklistrune#3", + "method": "blacklistrune", + "params": { + "start": 3, + "end": 4 + } + } + ], + "example_json_response": [ + { + "blacklist": [ + { + "start": 2, + "end": 2 + } + ] + }, + { + "blacklist": [ + { + "start": 2, + "end": 2 + }, + { + "start": 5, + "end": 7 + } + ] + }, + { + "blacklist": [ + { + "start": 2, + "end": 7 + } + ] + } + ], + "author": [ + "Shahana Farooqui <> is mainly responsible." + ], + "see_also": [ + "lightning-commando-blacklist(7)", + "lightning-showrunes(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-check.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "check", + "title": "Command for verifying parameters", + "description": [ + "The **check** RPC command verifies another command without actually making any changes.", + "", + "This is guaranteed to be safe, and will do all checks up to the point where something in the system would need to be altered (such as checking that channels are in the right state, peers connected, etc).", + "", + "It does not guarantee successful execution of the command in all cases. For example, a call to lightning-getroute(7) may still fail to find a route even if checking the parameters succeeds." + ], + "request": { + "required": [ + "command_to_check" + ], + "properties": { + "command_to_check": { + "type": "string", + "description": [ + "Name of the relevant command." + ] + } + } + }, + "response": { + "properties": { + "command_to_check": { + "type": "string", + "description": [ + "The *command_to_check* argument." + ] + } + }, + "required": [ + "command_to_check" + ] + }, + "example_json_request": [ + { + "id": "example:check#1", + "method": "check", + "params": { + "command_to_check": "sendpay", + "route": [ + { + "amount_msat": 1011, + "msatoshi": 1011, + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "delay": 20, + "channel": "1x1x1" + }, + { + "amount_msat": 1000, + "msatoshi": 1000, + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "delay": 10, + "channel": "2x2x2" + } + ], + "payment_hash": "0000000000000000000000000000000000000000000000000000000000000000" + } + }, + { + "id": "example:check#2", + "method": "check", + "params": { + "command_to_check": "dev", + "subcommand": "slowcmd", + "msec": 1000 + } + }, + { + "id": "example:check#3", + "method": "check", + "params": { + "command_to_check": "recover", + "hsmsecret": "6c696768746e696e672d31000000000000000000000000000000000000000000" + } + } + ], + "example_json_response": [ + { + "command_to_check": "sendpay" + }, + { + "command_to_check": "dev" + }, + { + "command_to_check": "recover" + } + ], + "author": [ + "Mark Beckwith <> and Rusty Russell <> are mainly responsible." + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-checkmessage.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "checkmessage", + "title": "Command to check if a signature is from a node", + "description": [ + "The **checkmessage** RPC command is the counterpart to **signmessage**: given a node id (*pubkey*), signature (*zbase*) and a *message*, it verifies that the signature was generated by that node for that message (more technically: by someone who knows that node's secret).", + "", + "As a special case, if *pubkey* is not specified, we will try every known node key (as per *listnodes*), and verification succeeds if it matches for any one of them. Note: this is implemented far more efficiently than trying each one, so performance is not a concern." + ], + "request": { + "required": [ + "message", + "zbase" + ], + "properties": { + "message": { + "type": "string", + "description": [ + "Message to be checked against the signature." + ] + }, + "zbase": { + "type": "string", + "description": [ + "The Zbase32 encoded signature to verify." + ] + }, + "pubkey": { + "type": "pubkey", + "description": [ + "The Zbase32 encoded signature to verify." + ] + } + } + }, + "response": { + "required": [ + "verified", + "pubkey" + ], + "properties": { + "verified": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Whether the signature was valid." + ] + }, + "pubkey": { + "type": "pubkey", + "description": [ + "The *pubkey* parameter, or the pubkey found by looking for known nodes." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:checkmessage#1", + "method": "checkmessage", + "params": { + "message": "testcase to check new rpc error", + "zbase": "d66bqz3qsku5fxtqsi37j11pci47ydxa95iusphutggz9ezaxt56neh77kxe5hyr41kwgkncgiu94p9ecxiexgpgsz8daoq4tw8kj8yx", + "pubkey": "03be3b0e9992153b1d5a6e1623670b6c3663f72ce6cf2e0dd39c0a373a7de5a3b7" + } + }, + { + "id": "example:checkmessage#2", + "method": "checkmessage", + "params": { + "message": "this is a test!", + "zbase": "d6tqaeuonjhi98mmont9m4wag7gg4krg1f4txonug3h31e9h6p6k6nbwjondnj46dkyausobstnk7fhyy998bhgc1yr98dfmhb4k54d7", + "pubkey": null + } + } + ], + "example_json_response": [ + { + "pubkey": "03be3b0e9992153b1d5a6e1623670b6c3663f72ce6cf2e0dd39c0a373a7de5a3b7", + "verified": true + }, + { + "pubkey": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "verified": true + } + ], + "errors": [ + "On failure, an error is returned and core lightning exit with the following error code:", + "", + "- -32602: Parameter missed or malformed;", + "- 1301: *pubkey* not found in the graph." + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-signmessage(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-checkrune.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.08", + "rpc": "checkrune", + "title": "Command to Validate Rune", + "description": [ + "The **checkrune** RPC command checks the validity/authorization rights of specified rune for the given nodeid, method, and params.", + "", + "If successful, the rune \"usage\" counter (used for ratelimiting) is incremented.", + "", + "See lightning-createrune(7) for the fields in the rune which are checked." + ], + "request": { + "required": [ + "rune" + ], + "properties": { + "rune": { + "type": "string", + "description": [ + "Rune to check for authorization." + ] + }, + "nodeid": { + "type": "string", + "description": [ + "Node id of requesting node *(required until v23.11)*." + ] + }, + "method": { + "type": "string", + "description": [ + "Method for which rune needs to be validated *(required until v23.11)*." + ] + }, + "params": { + "oneOf": [ + { + "type": "array", + "description": [ + "Array of positional parameters." + ] + }, + { + "type": "object", + "description": [ + "Parameters for method." + ] + } + ] + } + } + }, + "response": { + "required": [ + "valid" + ], + "properties": { + "valid": { + "type": "boolean", + "description": [ + "True if the rune is valid." + ] + } + } + }, + "errors": [ + "The following error codes may occur:", + "", + "- 1501 (RUNE_NOT_AUTHORIZED): rune is not for this node (or perhaps completely invalid)", + "- 1502 (RUNE_NOT_PERMITTED): rune does not allow this usage (includes a detailed reason why)", + "- 1503 (RUNE_BLACKLISTED): rune has been explicitly blacklisted." + ], + "example_json_request": [ + { + "id": "example:checkrune#1", + "method": "checkrune", + "params": { + "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "rune": "617Obfct0oRBj_uqGFQxDk3XZ1sDFiC2Q5ltm5z1i_k9NSZtZXRob2Q9aW52b2ljZSZwbmFtZWRlc2NyaXB0aW9uPUB0aXBqYXJcfGpiNTVAc2VuZHNhdHMubG9s", + "method": "invoice", + "params": { + "amount_msat": "any", + "label": "lbl", + "description": [ + "@tipjar|jb55@sendsats.lol." + ] + } + } + }, + { + "id": "example:checkrune#2", + "method": "checkrune", + "params": { + "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==", + "method": "listpeers", + "params": {} + } + }, + { + "id": "example:checkrune#3", + "method": "checkrune", + "params": { + "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "rune": "617Obfct0oRBj_uqGFQxDk3XZ1sDFiC2Q5ltm5z1i_k9NSZtZXRob2Q9aW52b2ljZSZwbmFtZWRlc2NyaXB0aW9uPUB0aXBqYXJcfGpiNTVAc2VuZHNhdHMubG9s", + "method": "invoice", + "params": { + "amount_msat": "any", + "label": "lbl", + "description": "@tipjar|jb55@sendsats.lol" + } + } + } + ], + "example_json_response": [ + { + "valid": true + }, + { + "valid": true + }, + { + "valid": true + } + ], + "author": [ + "Shahana Farooqui <> is mainly responsible for consolidating logic from commando." + ], + "see_also": [ + "lightning-createrune(7)", + "lightning-blacklistrune(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-close.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "close", + "title": "Command for closing channels with direct peers", + "description": [ + "The **close** RPC command attempts to close the channel cooperatively with the peer, or unilaterally after *unilateraltimeout*, and the to-local output will be sent to the address specified in *destination*.", + "", + "The peer needs to be live and connected in order to negotiate a mutual close. The default of unilaterally closing after 48 hours is usually a reasonable indication that you can no longer contact the peer." + ], + "request": { + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string", + "description": [ + "Peer id, channel id or short_channel_id. If the given *id* is a peer ID (66 hex digits as a string), then it applies to the active channel of the direct peer corresponding to the given peer ID. If the given *id* is a channel ID (64 hex digits as a string, or the short channel ID *blockheight:txindex:outindex* form), then it applies to that channel." + ] + }, + "unilateraltimeout": { + "type": "u32", + "description": [ + "If it is not zero, the command will unilaterally close the channel when that number of seconds is reached. If *unilateraltimeout* is zero, then the command will wait indefinitely until the peer is online and can negotiate a mutual close." + ], + "default": "2 days (172800 seconds)" + }, + "destination": { + "type": "string", + "description": [ + "Any Bitcoin bech32 type. If the peer hasn't offered the option_shutdown_anysegwit feature, then taproot addresses (or other v1+ segwit) are not allowed. Tell your friends to upgrade!" + ], + "default": "a Core Lightning wallet address" + }, + "fee_negotiation_step": { + "type": "string", + "description": [ + "It controls how closing fee negotiation is performed assuming the peer proposes a fee that is different than our estimate. (Note that modern peers use the quick-close protocol which does not allow negotiation: see *feerange* instead).", + "", + "On every negotiation step we must give up some amount from our proposal towards the peer's proposal. This parameter can be an integer in which case it is interpreted as number of satoshis to step at a time. Or it can be an integer followed by `%` to designate a percentage of the interval to give up. A few examples, assuming the peer proposes a closing fee of 3000 satoshi and our estimate shows it must be 4000:", + " * `10`: our next proposal will be 4000-10=3990.", + " * `10%`: our next proposal will be 4000-(10% of (4000-3000))=3900.", + " * '1': our next proposal will be 3999. This is the most extreme case when we insist on our fee as much as possible.", + " * `100%`: our next proposal will be 3000. This is the most relaxed case when we quickly accept the peer's proposal." + ], + "default": "`50%`" + }, + "wrong_funding": { + "type": "outpoint", + "description": [ + "It can only be specified if both sides have offered the `shutdown_wrong_funding` feature (enabled by the **experimental-shutdown-wrong-funding** option). It must be a transaction id followed by a colon then the output number. Instead of negotiating a shutdown to spend the expected funding transaction, the shutdown transaction will spend this output instead. This is only allowed if this peer opened the channel and the channel is unused: it can rescue openings which have been manually miscreated." + ] + }, + "force_lease_closed": { + "type": "boolean", + "description": [ + "If the channel has funds leased to the peer (option_will_fund), we prevent initiation of a mutual close unless this flag is passed in." + ], + "default": "False" + }, + "feerange": { + "type": "array", + "items": { + "type": "feerate" + }, + "description": [ + "An optional array [ *min*, *max* ], indicating the minimum and maximum feerates to offer: the peer will obey these if it supports the quick-close protocol. *slow* and *unilateral_close* are the defaults. Note that the maximum fee will be capped at the final commitment transaction fee (unless the experimental anchor-outputs option is negotiated)." + ] + } + } + }, + "response": { + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "mutual", + "unilateral", + "unopened" + ], + "description": [ + "Whether we successfully negotiated a mutual close, closed without them, or discarded not-yet-opened channel." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "mutual", + "unilateral" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "tx", + "txid" + ], + "properties": { + "type": {}, + "tx": { + "type": "hex", + "description": [ + "The raw bitcoin transaction used to close the channel (if it was open)." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The transaction id of the *tx* field." + ] + } + } + }, + "else": { + "additionalProperties": false, + "properties": { + "type": {} + } + } + } + ], + "post_return_value_notes": [ + "A unilateral close may still occur at any time if the peer did not behave correctly during the close negotiation.", + "", + "Unilateral closes will return your funds after a delay. The delay will vary based on the peer *to_self_delay* setting, not your own setting." + ] + }, + "notes": [ + "Prior to 0.7.2, **close** took two parameters: *force* and *timeout*. *timeout* was the number of seconds before *force* took effect (default, 30), and *force* determined whether the result was a unilateral close or an RPC error (default). Even after the timeout, the channel would be closed if the peer reconnected." + ], + "notifications": [ + "Notifications may be returned indicating what is going on, especially if the peer is offline and we are waiting." + ], + "example_json_request": [ + { + "id": "example:close#1", + "method": "close", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "unilateraltimeout": 1, + "destination": null, + "fee_negotiation_step": null, + "force_lease_closed": null, + "feerange": null + } + }, + { + "id": "example:close#2", + "method": "close", + "params": { + "id": "103x1x0", + "unilateraltimeout": null, + "destination": "bcrt1qeyyk6sl5pr49ycpqyckvmttus5ttj25pd0zpvg", + "fee_negotiation_step": null, + "force_lease_closed": null, + "feerange": null + } + }, + { + "id": "example:close#3", + "method": "close", + "params": [ + "107x1x0", + null, + "bcrt1qeyyk6sl5pr49ycpqyckvmttus5ttj25pd0zpvg" + ] + } + ], + "example_json_response": [ + { + "tx": "020000000001018d388ffcd216c92d25163a62096ce47d5c9bbd6270ced51c5a1484f89df33e5700000000009db0e28002a00f00000000000016001445503fa4b65ade3ffdb1a92057688456c9ffae1380130f0000000000220020be82765fdb17fd5568f2dd31c6cf1aabc620ef338995ec5d9a2f3e42f43ae4870400473044022058dcde893655f40fc8162a79596440ef3e304273f8d530401fc17bc92c58159b0220428900ca6537538ba237d569a4a09003d663a991aeb331a9f18dfe807ee78806014730440220111270eeed8b4b1a231d3ce6e0e0daad718623ad159a0fd3781fb18118a8fec70220539826ee7c76cad4116d1d8852329f80314b3434cf21c765d8004186451a4cd50147522102324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b2102e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5752ae9c3ed620", + "txid": "5d8d917dd7d39fe5a12f121457fc6d712b5e393ed4f16bc8f5976fc08cbbfecd", + "type": "unilateral" + }, + { + "tx": "0200000000010132cbce7d5f96b4003c3b5c0eab2a29fef90bb6abb833ff312fa122f31e8301810000000000ffffffff02a0860100000000002251205779a060f200d40e8f871a40eb91614cc5bfa6d0a5f852e053400a7feff8615005b10d0000000000160014c9096d43f408ea526020262ccdad7c8516b92a81040047304402207e171d056e81cf8ad2d5a613ecbaa212d5dcbd0bf713145d18911d2cbe9d858802206222911660a26d7ffddc2563ae6d41d6ffad9fbd2fc26cf40eab501a31153b9e0147304402204ae7cdc68dc7966eab73f16a1978643336333d54ae0b6f87bc11a2c19174a9710220601e5276aee0825466cc272c4eb7d353b393ef0dd230d303f46772790dee19190147522102324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b2102e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5752ae00000000", + "txid": "4a08e0508e2e39ea033fab5f77b318337f345550421799f6e0eb1b15a892eda4", + "type": "mutual" + }, + { + "tx": "02000000000101233b513665836d240423f45ffcd1fe19aeb08d62303fa5382ad3285f770683a60000000000ffffffff02a086010000000000225120b47216ab60a0fad97de0ba9b8b370d281dfe55f552d82034e2a8d054c2246e4405b10d0000000000160014c9096d43f408ea526020262ccdad7c8516b92a81040047304402207a9e3ca258861b33827d91514690a757e76730ba8c15dd222340bb13d993a1a502204d0ae329273b69abe62df1ffccce808d5f1a29101a8ee95dae99888376dbaef801473044022033c03f406db9f1c9d924cfd8f6ea42d0962f0ab02e3217aef518aea517ca5ba40220076e2af9d40c676316a2765a86f9efd481de3fc4465ceba33b0782c505ae3452014752210212284c004a3d24146e54b2a24db48f650370a08e1fe9abe8ff41f92b09cd50542102a3032ef980cc735579aa5295d927b9a1bdbafc459f2da14163dc9bd530e0a21152ae00000000", + "txid": "d44a1374a30c1a936d2d4fdbe73c0ffff42fec8c27c6cbaec2758b3042f61d08", + "type": "mutual" + } + ], + "author": [ + "ZmnSCPxj <> is mainly responsible." + ], + "see_also": [ + "lightning-disconnect(7)", + "lightning-fundchannel(7)", + "lightningd-config(5)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-commando-blacklist.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.05", + "deprecated": [ + "v23.08", + "v24.08" + ], + "rpc": "commando-blacklist", + "title": "Command to prevent a rune from working", + "description": [ + "The **commando-blacklist** RPC command allows you to effectively revoke the rune you have created (and any runes derived from that rune with additional restictions). Attempting to use these runes will be resulted in a `Blacklisted rune` error message.", + "", + "All runes created by commando have a unique sequential id within them and can be blacklisted in ranges for efficiency. The command always returns the blacklisted ranges on success. If no parameters are specified, no changes have been made. If start specified without end, that single rune is blacklisted. If end is also specified, every rune from start till end inclusive is blacklisted." + ], + "request": { + "required": [], + "properties": { + "start": { + "type": "u64", + "description": [ + "First rune unique id to blacklist." + ] + }, + "end": { + "type": "u64", + "description": [ + "Final rune unique id to blacklist (defaults to start)." + ] + } + }, + "dependentUpon": { + "start": [ + "end" + ] + } + }, + "response": { + "required": [ + "blacklist" + ], + "properties": { + "blacklist": { + "type": "array", + "description": [ + "The resulting blacklist ranges after the command." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "start", + "end" + ], + "properties": { + "start": { + "type": "u64", + "description": [ + "Unique id of first rune in this blacklist range." + ] + }, + "end": { + "type": "u64", + "description": [ + "Unique id of last rune in this blacklist range." + ] + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:commando-blacklist#1", + "method": "commando-blacklist", + "params": { + "start": 2 + } + }, + { + "id": "example:commando-blacklist#2", + "method": "commando-blacklist", + "params": { + "start": 5, + "end": 7 + } + }, + { + "id": "example:commando-blacklist#3", + "method": "commando-blacklist", + "params": { + "start": 3, + "end": 4 + } + } + ], + "example_json_response": [ + { + "blacklist": [ + { + "start": 2, + "end": 2 + } + ] + }, + { + "blacklist": [ + { + "start": 2, + "end": 2 + }, + { + "start": 5, + "end": 7 + } + ] + }, + { + "blacklist": [ + { + "start": 2, + "end": 7 + } + ] + } + ], + "author": [ + "Shahana Farooqui <> is mainly responsible." + ], + "see_also": [ + "lightning-commando-listrunes(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-commando-listrunes.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.05", + "deprecated": [ + "v23.08", + "v24.05" + ], + "rpc": "commando-listrunes", + "title": "Command to list previously generated runes", + "description": [ + "The **commando-listrunes** RPC command either lists runes that we stored as we generate them (see lightning-commando-rune(7)) or decodes the rune given on the command line.", + "", + "NOTE: Runes generated prior to v23.05 were not stored, so will not appear in this list." + ], + "request": { + "required": [], + "properties": { + "rune": { + "type": "string", + "description": [ + "Optional rune to list." + ] + } + } + }, + "response": { + "required": [ + "runes" + ], + "properties": { + "runes": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "rune", + "unique_id", + "restrictions", + "restrictions_as_english" + ], + "properties": { + "rune": { + "type": "string", + "description": [ + "Base64 encoded rune." + ] + }, + "unique_id": { + "type": "string", + "description": [ + "Unique id assigned when the rune was generated; this is always a u64 for commando runes." + ] + }, + "restrictions": { + "type": "array", + "description": [ + "The restrictions on what commands this rune can authorize." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "alternatives", + "english" + ], + "properties": { + "alternatives": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "fieldname", + "value", + "condition", + "english" + ], + "properties": { + "fieldname": { + "type": "string", + "description": [ + "The field this restriction applies to; see commando-rune(7)." + ] + }, + "value": { + "type": "string", + "description": [ + "The value accepted for this field." + ] + }, + "condition": { + "type": "string", + "description": [ + "The way to compare fieldname and value." + ] + }, + "english": { + "type": "string", + "description": [ + "English readable description of this alternative." + ] + } + } + } + }, + "english": { + "type": "string", + "description": [ + "English readable summary of alternatives above." + ] + } + } + } + }, + "restrictions_as_english": { + "type": "string", + "description": [ + "English readable description of the restrictions array above." + ] + }, + "stored": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "This is false if the rune does not appear in our datastore (only possible when `rune` is specified)." + ] + }, + "blacklisted": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "The rune has been blacklisted; see commando-blacklist(7)." + ] + }, + "last_used": { + "type": "number", + "description": [ + "The last time this rune was successfully used." + ], + "added": "23.11" + }, + "our_rune": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "This is not a rune for this node (only possible when `rune` is specified)." + ] + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:commando-listrunes#1", + "method": "commando-listrunes", + "params": "{}" + }, + { + "id": "example:commando-listrunes#2", + "method": "commando-listrunes", + "params": { + "rune": "Am3W_wI0PRn4qVNEsJ2iInHyFPQK8wfdqEXztm8-icQ9MA==" + } + }, + { + "id": "example:commando-listrunes#3", + "method": "commando-listrunes", + "params": { + "rune": "m_tyR0qqHUuLEbFJW6AhmBg-9npxVX2yKocQBFi9cvY9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJzJnBuYW1lbGV2ZWwhfHBuYW1lbGV2ZWwvaW8mcGFycjEhfHBhcnIxL2lv" + } + } + ], + "example_json_response": [ + { + "runes": [ + { + "rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==", + "unique_id": "0", + "restrictions": [], + "restrictions_as_english": "" + }, + { + "rune": "Am3W_wI0PRn4qVNEsJ2iInHyFPQK8wfdqEXztm8-icQ9MA==", + "stored": false, + "our_rune": false, + "unique_id": "1", + "restrictions": [], + "restrictions_as_english": "" + } + ] + }, + { + "runes": [ + { + "rune": "Am3W_wI0PRn4qVNEsJ2iInHyFPQK8wfdqEXztm8-icQ9MA==", + "stored": false, + "our_rune": false, + "unique_id": "1", + "restrictions": [], + "restrictions_as_english": "" + } + ] + }, + { + "runes": [ + { + "rune": "m_tyR0qqHUuLEbFJW6AhmBg-9npxVX2yKocQBFi9cvY9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJzJnBuYW1lbGV2ZWwhfHBuYW1lbGV2ZWwvaW8mcGFycjEhfHBhcnIxL2lv", + "stored": false, + "unique_id": "3", + "restrictions": [ + { + "alternatives": [ + { + "fieldname": "id", + "value": "022d223620a359a47ff7", + "condition": "^", + "english": "id starts with 022d223620a359a47ff7" + } + ], + "english": "id starts with 022d223620a359a47ff7" + }, + { + "alternatives": [ + { + "fieldname": "method", + "value": "listpeers", + "condition": "=", + "english": "method equal to listpeers" + } + ], + "english": "method equal to listpeers" + }, + { + "alternatives": [ + { + "fieldname": "pnamelevel", + "value": "", + "condition": "!", + "english": "pnamelevel is missing" + }, + { + "fieldname": "pnamelevel", + "value": "io", + "condition": "/", + "english": "pnamelevel unequal to io" + } + ], + "english": "pnamelevel is missing OR pnamelevel unequal to io" + }, + { + "alternatives": [ + { + "fieldname": "parr1", + "value": "", + "condition": "!", + "english": "parr1 is missing" + }, + { + "fieldname": "parr1", + "value": "io", + "condition": "/", + "english": "parr1 unequal to io" + } + ], + "english": "parr1 is missing OR parr1 unequal to io" + } + ], + "restrictions_as_english": "id starts with 022d223620a359a47ff7 AND method equal to listpeers AND pnamelevel is missing OR pnamelevel unequal to io AND parr1 is missing OR parr1 unequal to io" + } + ] + } + ], + "author": [ + "Shahana Farooqui <> is mainly responsible." + ], + "see_also": [ + "lightning-commando-rune(7)", + "lightning-commando-blacklist(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-commando-rune.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "deprecated": [ + "v23.08", + "v23.05" + ], + "rpc": "commando-rune", + "title": "Command to Authorize Remote Peer Access", + "description": [ + "The **commando-rune** RPC command creates a base64 string called a *rune* which can be used to access commands on this node. Each *rune* contains a unique id (a number starting at 0), and can have restrictions inside it. Nobody can remove restrictions from a rune: if you try, the rune will be rejected. There is no limit on how many runes you can issue; the node simply decodes and checks them as they are received (we do store them for lightning-commando- listrunes(7) however)." + ], + "request": { + "required": [], + "properties": { + "rune": { + "type": "string", + "description": [ + "If supplied, the restrictions are simple appended to that *rune* (it doesn't need to be a rune belonging to this node). If not supplied, a new *rune* is constructed, with a new unique id." + ] + }, + "restrictions": { + "description": [ + "It can be the string `readonly`, or an array of restrictions.", + "Each restriction is an array of one or more alternatives, such as \"method is listpeers\", or \"method is listpeers OR time is before 2023\"." + ], + "oneOf": [ + { + "type": "array", + "description": [ + "Alternatives use a simple language to examine the command which is being run:", + " * time: the current UNIX time, e.g. \"time<1656759180\".", + " * id: the node_id of the peer, e.g. \"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\".", + " * method: the command being run, e.g. \"method=withdraw\".", + " * per: how often the rune can be used, with suffix \"sec\" (default), \"min\", \"hour\", \"day\" or \"msec\", \"usec\" or \"nsec\". e.g. \"per=5sec\".", + " * rate: the rate limit, per minute, e.g. \"rate=60\" is equivalent to \"per=1sec\".", + " * pnum: the number of parameters. e.g. \"pnum<2\".", + " * pnameX: the parameter named X (with any punctuation like `_` removed). e.g. \"pnamedestination=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T\".", + " * parrN: the N'th parameter. e.g. \"parr0=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T\"." + ], + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "type": "string", + "enum": [ + "readonly" + ], + "description": [ + "A rune which allows most *get* and *list* commands, and the *summary* command." + ] + } + ] + } + } + }, + "response": { + "required": [ + "rune", + "unique_id" + ], + "properties": { + "rune": { + "type": "string", + "description": [ + "The resulting rune." + ] + }, + "unique_id": { + "type": "string", + "description": [ + "The id of this rune: this is set at creation and cannot be changed (even as restrictions are added)." + ] + }, + "warning_unrestricted_rune": { + "type": "string", + "description": [ + "A warning shown when runes are created with powers that could drain your node." + ] + } + } + }, + "restriction_format": [ + "Restrictions are one or more alternatives. Each alternative is *name* *operator* *value*. The valid names are shown above.", + "", + "Note that if a value contains `\\`, it must be preceeded by another `\\` to form valid JSON:", + "* `=`: passes if equal ie. identical. e.g. `method=withdraw`", + "* `/`: not equals, e.g. `method/withdraw`", + "* `^`: starts with, e.g. `id^024b9a1fa8e006f1e3937f`", + "* `$`: ends with, e.g. `id$381df1cc449605`.", + "* `~`: contains, e.g. `id~006f1e3937f65f66c40`.", + "* `<`: is a decimal integer, and is less than. e.g. `time<1656759180`", + "* `>`: is a decimal integer, and is greater than. e.g. `time>1656759180`", + "* `{`: preceeds in alphabetical order (or matches but is shorter),", + " e.g. `id{02ff`.", + "* `}`: follows in alphabetical order (or matches but is longer),", + " e.g. `id}02ff`.", + "* `#`: a comment, ignored, e.g. `dumb example#`.", + "* `!`: only passes if the *name* does *not* exist. e.g. `pnamedestination!`.", + "Every other operator except `#` fails if *name* does not exist!" + ], + "example_usage": [ + "This creates a fresh rune which can do anything:", + "", + "```shell", + "$ lightning-cli commando-rune", + "{", + " \"rune\": \"KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA==\",", + " \"unique_id\": \"0\"", + "}", + "```", + "We can add restrictions to that rune, like so:", + "", + "```shell", + "$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions=readonly", + "{", + " \"rune\": \"NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl\",", + " \"unique_id\": \"0\"", + "}", + "```", + "The \"readonly\" restriction is a short-cut for two restrictions:", + "", + "1. `[\"method^list\", \"method^get\", \"method=summary\"]`: You may call list, get or summary.", + "2. `[\"method/listdatastore\"]`: But not listdatastore: that contains sensitive stuff!", + "", + "We can do the same manually, like so:", + "", + "```shell", + "$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions='[[\"method^list\", \"method^get\", \"method=summary\"],[\"method/listdatastore\"]]'", + "{", + " \"rune\": \"NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl\",", + " \"unique_id\": \"0\"", + "}", + "```", + "Let's create a rune which lets a specific peer (024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605) run \"listpeers\" on themselves:", + "", + "```shell", + "$ lightning-cli commando-rune restrictions='[[\"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"],[\"method=listpeers\"],[\"pnum=1\"],[\"pnameid=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\",\"parr0=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"]]'", + "{", + " \"rune\": \"FE8GHiGVvxcFqCQcClVRRiNE_XEeLYQzyG2jmqto4jM9MiZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDV8cGFycjA9MDI0YjlhMWZhOGUwMDZmMWUzOTM3ZjY1ZjY2YzQwOGU2ZGE4ZTFjYTcyOGVhNDMyMjJhNzM4MWRmMWNjNDQ5NjA1\",", + " \"unique_id\": \"2\"", + "}", + "```", + "This allows `listpeers` with 1 argument (`pnum=1`), which is either by name (`pnameid`), or position (`parr0`). We could shorten this in several ways: either allowing only positional or named parameters, or by testing the start of the parameters only. Here's an example which only checks the first 9 bytes of the `listpeers` parameter:", + "", + "```shell", + "$ lightning-cli commando-rune restrictions='[[\"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"],[\"method=listpeers\"],[\"pnum=1\"],[\"pnameid^024b9a1fa8e006f1e393\", \"parr0^024b9a1fa8e006f1e393\"]'", + " {", + " \"rune\": \"fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw==\",", + " \"unique_id\": \"3\"", + "}", + "```", + "Before we give this to our peer, let's add two more restrictions: that it only be usable for 24 hours from now (`time<`), and that it can only be used twice a minute (`rate=2`). `date +%s` can give us the current time in seconds:", + "", + "```shell", + "$ lightning-cli commando-rune rune=fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw== restrictions='[[\"time<'$(($(date +%s) + 24*60*60))'\",\"rate=2\"]]'", + "{", + " \"rune\": \"tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y\",", + " \"unique_id\": \"3\"", + "}", + "```", + "You can also use lightning-decode(7) to examine runes you have been given:", + "", + "```shell", + "$ lightning-cli decode tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y", + "{", + " \"type\": \"rune\",", + " \"unique_id\": \"3\",", + " \"string\": \"b54f912e33220e9636534a375b5a05a306abdfa4451a95a5a0f6d6f7e46e65da:=3&id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605&method=listpeers&pnum=1&pnameid^024b9a1fa8e006f1e393|parr0^024b9a1fa8e006f1e393&time<1656920538&rate=2\",", + " \"restrictions\": [", + " {", + " \"alternatives\": [", + " \"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"", + " ],", + " \"summary\": \"id (of commanding peer) equal to '024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605'\"", + " },", + " {", + " \"alternatives\": [", + " \"method=listpeers\"", + " ],", + " \"summary\": \"method (of command) equal to 'listpeers'\"", + " },", + " {", + " \"alternatives\": [", + " \"pnum=1\"", + " ],", + " \"summary\": \"pnum (number of command parameters) equal to 1\"", + " },", + " {", + " \"alternatives\": [", + " \"pnameid^024b9a1fa8e006f1e393\",", + " \"parr0^024b9a1fa8e006f1e393\"", + " ],", + " \"summary\": \"pnameid (object parameter 'id') starts with '024b9a1fa8e006f1e393' OR parr0 (array parameter #0) starts with '024b9a1fa8e006f1e393'\"", + " },", + " {", + " \"alternatives\": [", + " \"time<1656920538\"", + " ],", + " \"summary\": \"time (in seconds since 1970) less than 1656920538 (approximately 19 hours 18 minutes from now)\"", + " },", + " {", + " \"alternatives\": [", + " \"rate=2\"", + " ],", + " \"summary\": \"rate (max per minute) equal to 2\"", + " }", + " ],", + " \"valid\": true", + "}", + "```" + ], + "sharing_runes": [ + "Because anyone can add a restriction to a rune, you can always turn a normal rune into a read-only rune, or restrict access for 30 minutes from the time you give it to someone. Adding restrictions before sharing runes is best practice.", + "", + "If a rune has a ratelimit, any derived rune will have the same id, and thus will compete for that ratelimit. You might want to consider adding a tighter ratelimit to a rune before sharing it, so you will keep the remainder. For example, if you rune has a limit of 60 times per minute, adding a limit of 5 times per minute and handing that rune out means you can still use your original rune 55 times per minute." + ], + "example_json_request": [ + { + "id": "example:commando-rune#1", + "method": "commando-rune", + "params": "{}" + }, + { + "id": "example:commando-rune#2", + "method": "commando-rune", + "params": { + "restrictions": "readonly" + } + }, + { + "id": "example:commando-rune#3", + "method": "commando-rune", + "params": { + "restrictions": [ + [ + "id^022d223620a359a47ff7" + ], + [ + "method=listpeers" + ] + ] + } + }, + { + "id": "example:commando-rune#4", + "method": "commando-rune", + "params": { + "restrictions": [ + [ + "method=pay" + ], + [ + "pnameamountmsat<10000" + ] + ] + } + } + ], + "example_json_response": [ + { + "rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==", + "unique_id": "0", + "warning_unrestricted_rune": "WARNING: This rune has no restrictions! Anyone who has access to this rune could drain funds from your node. Be careful when giving this to apps that you don't trust. Consider using the restrictions parameter to only allow access to specific rpc methods." + }, + { + "rune": "zm0x_eLgHexaTvZn3Cz7gb_YlvrlYGDo_w4BYlR9SS09MSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", + "unique_id": "1" + }, + { + "rune": "YPojv9qgHPa3im0eiqRb-g8aRq76OasyfltGGqdFUOU9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJz", + "unique_id": "2" + }, + { + "rune": "b3hXuEM7Pqzk-C7HUw83xzvHOV7fmuGaWjdo-wHdfg89MCZtZXRob2Q9cGF5JnBuYW1lYW1vdW50bXNhdDwxMDAwMA==", + "unique_id": "3" + } + ], + "author": [ + "Rusty Russell <> wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page.", + "", + "Christian Decker came up with the name \"commando\", which almost excuses his previous adoption of the name \"Eltoo\"." + ], + "see_also": [ + "lightning-commando(7)", + "lightning-decode(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-commando.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "commando", + "title": "Command to Send a Command to a Remote Peer", + "description": [ + "The **commando** RPC command is a homage to bad 80s movies. It also sends a directly-connected *peer_id* a custom message, containing a request to run *method* (with an optional dictionary of *params*); generally the peer will only allow you to run a command if it has provided you with a *rune* which allows it." + ], + "request": { + "required": [ + "peer_id", + "method" + ], + "properties": { + "peer_id": { + "type": "pubkey", + "description": [ + "Peer to command." + ] + }, + "method": { + "type": "string", + "description": [ + "Method to invoke on peer." + ] + }, + "params": { + "oneOf": [ + { + "type": "array", + "description": [ + "Array of positional parameters." + ] + }, + { + "type": "object", + "description": [ + "Parameters for method." + ] + } + ] + }, + "rune": { + "type": "string", + "description": [ + "Rune to authorize the command." + ] + }, + "filter": { + "type": "object", + "description": [ + "Filter to peer to apply to any successful result." + ] + } + } + }, + "response": { + "required": [], + "properties": {}, + "pre_return_value_notes": [ + "On success, the return depends on the *method* invoked." + ] + }, + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32600: Usually means peer is not connected", + "- 19535: the local commando plugin discovered an error.", + "- 19536: the remote commando plugin discovered an error.", + "- 19537: the remote commando plugin said we weren't authorized.", + "", + "It can also fail if the peer does not respond, in which case it will simply hang awaiting a response." + ], + "example_json_request": [ + { + "id": "example:commando#1", + "method": "commando", + "params": { + "peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "rune": "zm0x_eLgHexaTvZn3Cz7gb_YlvrlYGDo_w4BYlR9SS09MSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", + "method": "getinfo", + "params": {} + } + }, + { + "id": "example:commando#2", + "method": "commando", + "params": { + "peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "rune": "m_tyR0qqHUuLEbFJW6AhmBg-9npxVX2yKocQBFi9cvY9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJzJnBuYW1lbGV2ZWwhfHBuYW1lbGV2ZWwvaW8mcGFycjEhfHBhcnIxL2lv", + "method": "listpeers", + "params": [ + "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "broken" + ] + } + }, + { + "id": "example:commando#3", + "method": "commando", + "params": { + "peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "rune": "b3hXuEM7Pqzk-C7HUw83xzvHOV7fmuGaWjdo-wHdfg89MCZtZXRob2Q9cGF5JnBuYW1lYW1vdW50bXNhdDwxMDAwMA==", + "method": "pay", + "params": { + "bolt11": "lnbcrt1pja05v6sp5n6gnm380ckkrnhzvytz0hvym0vcf0mlrk586nlp72cq7e2hhhffspp5cwhuvl4jhlqep3st2703z89jp7j6wucm8ytlj7rk9ckk0mv7whysdq5v3jhxcmjd9c8g6t0dceqxqyjw5qcqp99qxpqysgq40udwjtktkry0yyq9408q5vtmj534h88j5nn562lamam0rtfqfu3093t2dhhc63qnqe5maa5jc9ad5pm08q2k2udvp6skw9f6ez9c9qptatlau", + "amount_msat": 9999 + } + } + } + ], + "example_json_response": [ + { + "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "alias": "JUNIORBEAM-v23.11-415-gd120eba", + "color": "0266e4", + "num_peers": 1, + "num_pending_channels": 0, + "num_active_channels": 0, + "num_inactive_channels": 0, + "address": [], + "binding": [ + { + "type": "ipv4", + "address": "127.0.0.1", + "port": 42513 + } + ], + "version": "v23.11-415-gd120eba", + "blockheight": 101, + "network": "regtest", + "fees_collected_msat": 0, + "lightning-dir": "/tmp/ltests-7u_8_rtu/test_commando_rune_1/lightning-1/regtest", + "our_features": { + "init": "08a0000a8a5961", + "node": "88a0000a8a5961", + "channel": "", + "invoice": "02000002024100" + } + }, + { + "peers": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "connected": true, + "num_channels": 0, + "netaddr": [ + "127.0.0.1:40119" + ], + "features": "08a0000a8a5961", + "log": [ + { + "type": "SKIPPED", + "num_skipped": 30 + } + ] + } + ] + }, + { + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "payment_hash": "c3afc67eb2bfc190c60b579f111cb20fa5a7731b3917f978762e2d67ed9e75c9", + "created_at": 1708642714.8110592, + "parts": 1, + "amount_msat": 9999, + "amount_sent_msat": 9999, + "payment_preimage": "17632717785b1a833a296ba1831cb968602872e68881c2f324e06e87979296dc", + "status": "complete" + } + ], + "author": [ + "Rusty Russell <> wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page.", + "", + "Christian Decker came up with the name \"commando\", which almost excuses his previous adoption of the name \"Eltoo\"." + ], + "see_also": [ + "lightning-commando-rune(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-connect.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "connect", + "title": "Command for connecting to another lightning node", + "description": [ + "The **connect** RPC command establishes a new connection with another node in the Lightning Network.", + "", + "Connecting to a node is just the first step in opening a channel with another node. Once the peer is connected a channel can be opened with lightning-fundchannel(7).", + "", + "If there are active channels with the peer, **connect** returns once all the subdaemons are in place to handle the channels, not just once it's connected." + ], + "request": { + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string", + "description": [ + "The target node's public key. As a convenience, *id* may be of the form *id@host* or *id@host:port*. In this case, the *host* and *port* parameters must be omitted. This can fail if your C-lightning node is a fresh install that has not connected to any peers yet (your node has no gossip yet), or if the target *id* is a fresh install that has no channels yet (nobody will gossip about a node until it has one published channel)." + ] + }, + "host": { + "type": "string", + "description": [ + "The peer's hostname or IP address. If *host* is not specified (or doesn't work), the connection will be attempted to an IP belonging to *id* obtained through gossip with other already connected peers. If *host* begins with a `/` it is interpreted as a local path and the connection will be made to that local socket (see **bind-addr** in lightningd-config(5))." + ] + }, + "port": { + "type": "u16", + "description": [ + "The peer's port number. If not specified, the *port* depends on the current network:", + " * bitcoin **mainnet**: 9735.", + " * bitcoin **testnet**: 19735.", + " * bitcoin **signet**: 39735.", + " * bitcoin **regtest**: 19846." + ] + } + } + }, + "response": { + "required": [ + "id", + "features", + "direction", + "address" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The peer we connected to." + ] + }, + "features": { + "type": "hex", + "description": [ + "BOLT 9 features bitmap offered by peer." + ] + }, + "direction": { + "type": "string", + "enum": [ + "in", + "out" + ], + "description": [ + "Whether they initiated connection or we did." + ] + }, + "address": { + "type": "object", + "description": [ + "Address information (mainly useful if **direction** is *out*)." + ], + "additionalProperties": true, + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "local socket", + "ipv4", + "ipv6", + "torv2", + "torv3" + ], + "description": [ + "Type of connection (*torv2*/*torv3* only if **direction** is *out*)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "local socket" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "socket" + ], + "properties": { + "type": {}, + "socket": { + "type": "string", + "description": [ + "Socket filename." + ] + } + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "ipv4", + "ipv6", + "torv2", + "torv3" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "address", + "port" + ], + "properties": { + "type": {}, + "address": { + "type": "string", + "description": [ + "Address in expected format for **type**." + ] + }, + "port": { + "type": "u16", + "description": [ + "Port number." + ] + } + } + } + } + ] + } + } + }, + "errors": [ + "On failure, one of the following errors will be returned:", + "", + "- 400: Unable to connect, no address known for peer", + "- 401: If some addresses are known but connecting to all of them failed, the message will contain details about the failures", + "- 402: If the peer disconnected while we were connecting", + "- -32602: If the given parameters are wrong" + ], + "example_json_request": [ + { + "id": "example:connect#1", + "method": "connect", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "host": "localhost", + "port": 44619 + } + }, + { + "id": "example:connect#2", + "method": "connect", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "host": "127.0.0.1", + "port": 42839 + } + } + ], + "example_json_response": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "features": "08a0000a0a69a2", + "direction": "out", + "address": { + "type": "ipv4", + "address": "127.0.0.1", + "port": 44619 + } + }, + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "features": "08a0000a8a5961", + "direction": "out", + "address": { + "type": "ipv4", + "address": "127.0.0.1", + "port": 42839 + } + } + ], + "author": [ + "Rusty Russell <> is mainly responsible. Felix <> is the original author of this manpage." + ], + "see_also": [ + "lightning-fundchannel(7)", + "lightning-listpeers(7)", + "lightning-listchannels(7)", + "lightning-disconnect(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-createinvoice.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "createinvoice", + "title": "Low-level invoice creation", + "description": [ + "The **createinvoice** RPC command signs and saves an invoice into the database." + ], + "request": { + "required": [ + "invstring", + "label", + "preimage" + ], + "properties": { + "invstring": { + "type": "string", + "description": [ + "The bolt11 form, but the final signature is ignored. Minimal sanity checks are done. (Note: if **experimental-offers** is enabled, *invstring* can actually be an unsigned bolt12 invoice)." + ] + }, + "label": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "description": [ + "A unique string or number (which is treated as a string, so `01` is different from `1`); it is never revealed to other nodes on the lightning network, but it can be used to query the status of this invoice." + ] + }, + "preimage": { + "type": "hex", + "description": [ + "The preimage to supply upon successful payment of the invoice." + ] + } + } + }, + "response": { + "required": [ + "label", + "created_index", + "payment_hash", + "status", + "description", + "expires_at" + ], + "properties": { + "label": { + "type": "string", + "description": [ + "The label for the invoice." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string (always present unless **bolt12** is)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string instead of **bolt11** (**experimental-offers** only)." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount of the invoice (if it has one)." + ] + }, + "status": { + "type": "string", + "enum": [ + "paid", + "expired", + "unpaid" + ], + "description": [ + "Whether it has been paid, or can no longer be paid." + ] + }, + "description": { + "type": "string", + "description": [ + "Description extracted from **bolt11** or **bolt12**." + ] + }, + "expires_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when invoice expires (or expired)." + ] + }, + "created_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was created in." + ] + }, + "pay_index": { + "type": "u64", + "description": [ + "Incrementing id for when this was paid (**status** *paid* only)." + ] + }, + "amount_received_msat": { + "type": "msat", + "description": [ + "Amount actually received (**status** *paid* only)." + ] + }, + "paid_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when invoice was paid (**status** *paid* only)." + ] + }, + "paid_outpoint": { + "type": "object", + "description": [ + "Outpoint this invoice was paid with (**status** *paid* only)." + ], + "added": "v23.11", + "additionalProperties": false, + "required": [ + "txid", + "outnum" + ], + "properties": { + "txid": { + "added": "v23.11", + "type": "txid", + "description": [ + "ID of the transaction that paid the invoice (**status** *paid* only)." + ] + }, + "outnum": { + "added": "v23.11", + "type": "u32", + "description": [ + "The 0-based output number of the transaction that paid the invoice (**status** *paid* only)." + ] + } + } + }, + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash**." + ] + }, + "local_offer_id": { + "type": "hex", + "description": [ + "The *id* of our offer which created this invoice (**experimental-offers** only)." + ], + "maxLength": 64, + "minLength": 64 + }, + "invreq_payer_note": { + "type": "string", + "description": [ + "The optional *invreq_payer_note* from invoice_request which created this invoice (**experimental-offers** only)." + ] + } + }, + "pre_return_value_notes": [ + "(Note: the return format is the same as lightning-listinvoices(7))." + ] + }, + "errors": [ + "On failure, an error is returned and no invoice is created. If the lightning process fails before responding, the caller should use lightning-listinvoices(7) to query whether this invoice was created or not.", + "", + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error.", + "- 900: An invoice with the given *label* already exists." + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-invoice(7)", + "lightning-listinvoices(7)", + "lightning-delinvoice(7)", + "lightning-getroute(7)", + "lightning-sendpay(7)", + "lightning-offer(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-createonion.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "createonion", + "title": "Low-level command to create a custom onion", + "description": [ + "The **createonion** RPC command allows the caller to create a custom onion with custom payloads at each hop in the route. A custom onion can be used to implement protocol extensions that are not supported by Core Lightning directly." + ], + "request": { + "required": [ + "hops", + "assocdata" + ], + "properties": { + "hops": { + "type": "array", + "description": [ + "A JSON list of dicts, each specifying a node and the payload destined for that node." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "pubkey", + "payload" + ], + "properties": { + "pubkey": { + "type": "pubkey", + "description": [ + "Node pubkey." + ] + }, + "payload": { + "type": "hex", + "description": [ + "Payload to be sent to the node." + ] + } + } + } + }, + "assocdata": { + "type": "hex", + "description": [ + "The associated data that the onion should commit to. If the onion is to be used to send a payment later it MUST match the `payment_hash` of the payment in order to be valid." + ] + }, + "session_key": { + "type": "secret", + "description": [ + "Can be used to specify a secret that is used to generate the shared secrets used to encrypt the onion for each hop. It should only be used for testing or if a specific shared secret is important. If not specified it will be securely generated internally, and the shared secrets will be returned." + ] + }, + "onion_size": { + "type": "u16", + "description": [ + "A size different from the default payment onion (1300 bytes). May be used for custom protocols like trampoline routing." + ] + } + } + }, + "response": { + "required": [ + "onion", + "shared_secrets" + ], + "properties": { + "onion": { + "type": "hex", + "description": [ + "The onion packet (*onion_size* bytes)." + ] + }, + "shared_secrets": { + "type": "array", + "description": [ + "One shared secret for each node in the *hops* parameter." + ], + "items": { + "type": "secret", + "description": [ + "The shared secret with this hop." + ] + } + } + } + }, + "example_usage": [ + "The following is an example of a 3 hop onion:", + "", + "```json", + "[", + " {", + " \"pubkey\": \"022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59\",", + " \"payload\": \"11020203e904017b06080000670000010001\"", + " }, {", + " \"pubkey\": \"035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d\",", + " \"payload\": \"11020203e804017506080000670000030001\"", + " }, {", + " \"pubkey\": \"0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199\",", + " \"payload\": \"07020203e8040175\"", + " }", + "]", + "```", + "", + "The *hops* parameter is very similar to the result from `getroute` however it needs to be modified slightly. The following is the `getroute` response from which the above *hops* parameter was generated:", + "", + "```json", + "[", + " {", + " \"id\": \"022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59\",", + " \"channel\": \"103x2x1\",", + " \"direction\": 1,", + " \"msatoshi\": 1002,", + " \"amount_msat\": \"1002msat\",", + " \"delay\": 21,", + " }, {", + " \"id\": \"035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d\",", + " \"channel\": \"103x1x1\",", + " \"direction\": 0,", + " \"msatoshi\": 1001,", + " \"amount_msat\": \"1001msat\",", + " \"delay\": 15,", + " }, {", + " \"id\": \"0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199\",", + " \"channel\": \"103x3x1\",", + " \"direction\": 0,", + " \"msatoshi\": 1000,", + " \"amount_msat\": \"1000msat\",", + " \"delay\": 9,", + " }", + "]", + "```", + "", + " - Notice that the payload in the *hops* parameter is the hex-encoded TLV of the parameters in the `getroute` response, with length prepended as a `bigsize_t`.", + " - Except for the pubkey, the values are shifted left by one, i.e., the 1st payload in `createonion` corresponds to the 2nd set of values from `getroute`.", + " - The final payload is a copy of the last payload sans `channel`", + "", + "These rules are directly derived from the onion construction. Please refer BOLT 04 for details and rationale.", + "", + "The following example is the result of calling *createonion* with the above hops parameter:", + "", + " ```json", + " {", + " \"onion\": \"0003f3f80d2142b953319336d2fe4097[...]6af33fcf4fb113bce01f56dd62248a9e5fcbbfba35c\",", + " \"shared_secrets\": [", + " \"88ce98c73e4d9293ab1797b0a913fe9bca0213a566252047d01b8af6da871f3e\",", + " \"4474d296810e57bd460ef8b83d2e7d288321f8a99ff7686f87384699747bcfc4\",", + " \"2a862e4123e01799a732be487fbce297f7dc7cc1467e410f18369cfee476adc2\"", + " ]", + " }", + "```", + "", + "The `onion` corresponds to 1366 hex-encoded bytes. Each shared secret consists of 32 hex-encoded bytes. Both arguments can be passed on to **sendonion**." + ], + "example_json_request": [ + { + "id": "example:createonion#1", + "method": "createonion", + "params": { + "hops": [ + { + "pubkey": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "payload": "e4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "pubkey": "0324653eac434488002cc06bbfb7f10fe18991e35f9fe4302dbea6d2353dc0ab1c", + "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "pubkey": "027f31ebc5462c1fdce1b737ecff52d37d75dea43ce11c74d25aa297165faa2007", + "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "pubkey": "032c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991", + "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "pubkey": "02edabbd16b41c8371b92ef2f04c1185b4f03b6dcd52ba9b78d9d7c89c8f221145", + "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + ], + "assocdata": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", + "onion_size": 1301 + } + }, + { + "id": "example:createonion#2", + "method": "createonion", + "params": { + "hops": [ + { + "pubkey": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "payload": "0cfdb000084869207468657265" + } + ], + "assocdata": "36bf44cc8d80498b95eb05e36ae5811206d3a1d8b5c8d59bbcad035d386a4de8" + } + } + ], + "example_json_response": [ + { + "onion": "00034c3f9e11d92555260db3ee4ba0378a645d01c2556451f4289a1d9b43c7afa9a4f9ecc7010dafb26787bb583c514c3b3990d40c8168b1046659d7bc2512d2f1ee0afd2b87c42de2b70102b649634d211b38049593dbb6ed8ee8f93f0b9ff23cd9654c1341137711ce67751d40867cc90c290a9446be2b8a5a43641d4549505b13e807b4240b5b82ffaf22cb534cff01be46db3985ac83b7db465fbd86d4c8d472f60678946c71eca97dd5db732fe5a6d3765e5a5afad72f035207173e7eaaa0da4f0a4540472c7dd269a030428ae586a61b2a70a428055c3848427d2a2e8bd521aadbaf79d56ea39df63c059772e026d57f0b6844c1ab99e936beadf42aaa78193b05f7380e242258deeaa90db316a943d311ef4f2a08f422422c9da454f9666742ad61c6ae003bce83cf6243adf64a728ea50bdaf129ab2ac70e1988a117609cbefc01c884f86b2494349d1067f5cf17760cdab6ae076631693147e8712412d4f0b17cf288b394fd9e29419156ee629966553c2e7598631cbf7493820388eef1ae9f4d2f9da88872e8afbbedb3b46cd7c461cbe4c5491dc6f4a68bc244584bc79b1bb227c869fae16dab4b16412523c984d3ed2b872f63b95a62f66563d2b03c3d1b5fff0290411b293569ce8435b96b447be776b49395a8d94f48cb2f7699a38e8de58d6fff04075d226dcac07668512b6d2c20d4c49d03ad300a52769e4ebbacf97378633126958df1817effc12fd679723123df244fd9b5421f8a2aedb9a8b6fb4049e3a7cae3985059081239bea38351f0c90ed5a0ff45cc492e6ab353e4c13d22ff48912d6ecfda711edfb88dc0767ecfc5dddf8fb0e112a538aeee55c0f73b3b8afc4f40ef3588eabde5b95344a4525adf67841dd67b1db10da180fb346e0bd2958f095d011827063c42361964f8ac2c356d2ec1868a9498dcd6b5915a4df4601c58fcbeb688e14de61300f13183c154b3320cc8e80042a46f22d796f56ff1fdd7e28440c05f14b960c1d0a7c627b09295112bcb635b0e2447a9374fafc4a23ceaf9de4d10b29b2f6cabd7f0c7706cf0404452681d7372d559b644627b2695960deb3b4ae57028e0164b29d5ef9e701d3122b6a5715c502e1dca5252e8c215ed754b01a193041ad9751ed2fff1b55991e256edd6099a38004a367ad097c7caf953da302201263715517f6d32cff57969be994df42fd6cadb649e3c738be798f779aaf4c07cada6bf1e4115b74e2670baf4b1592c70b10a6c043b6606b428b3f79545dc8e9783c876e5402909858f9c604963c37fbc477137c8908e6cfa11ece18c8784a6f25428a5ee1e91d0095fe310d6a91139a7c5c6624bbfcaa15ee847a25b06f57332917f68526a6317f575792e9bcba8576a96bc5859b1f2a00fd8ab08a5ac4ab71833b0b711d1f120cbdb374bcedcdcbeba3806644f5082ec737a945221f5d99562fcbb02a43beeafb16ceecd4e35f06a04c9ff9f4f33725ab62cf22c36650280e4cfb9e150a2c4ebee7785108522e8ecb4682d2d751168e7597299346c3a5e885e36eda66b9a1112997111135767972d771b02c1a36c1d1fb1ce539ecfb98e9e1d8f8fdbf89aec28ad34ff5c00c1a4a8c59848dc8b64c0e65f6f10122e60b4adc1cfc602f49d6cfbdd54be6b0951d3f9cafe8cdd0428f9ce6994844e92d8b72d44edda623bad428b398f88643c3904bda16dd15e886ca4ef6ea7f1450744ac38ffce902569d2e9026bcedd6d0ee54aceabda22bf2de72cba89e6c274064619e32a1192cf2d78b56cf497f7785a6d599de9f8383d1f66f47fc385dc569ee1f08ddbbc7f1aeb0a0126fc4020d948dda10255f11e776db7a037059a40fde38a2ee0c0ce49c7f3df175881bf12371fa72fec3fba657107892a97efe41dcc18aeecd99f3e46c33cf42c2a0ba8b75cf000", + "shared_secrets": [ + "ccf2512684e2508cb4a842393757e6040b7d25e29d3a2031f29d00a000af6128", + "d4cec39fe6287d41165bf5c608b0c720a411208a83c64c805a012c86662a2e5a", + "91bc712ebd4a900e05830394ca8b1f1168777ecdd6996029d96ec8838b9903b9", + "93c373dcb14dc36ababa3e0c5c55869a667ca175e09913a98c3be67e6af97e16", + "b2642a5770a6b61ade071fdf69d3ea365cf48434fc2a2c399512778821a33e5c" + ] + }, + { + "onion": "0002cdce4bfaa9faa2c060afafe001b80bde07fc670e882c063a80b4738d5f78c9351825c6461cdfcd4fe4144d3b51f63da6351b28dd49c7bfdb0b4f7d8bda4ad0d99699eda39e551084c0a095746c358d1dc6d2eec8082f2aa2f69ae8f61b1f1437ae0ed673078fec6c0510a34058167ad1a34e819a3813d4cf27b2c4917a8c6ca3d70c3381a2a41b4c1b4540adf0e922e25f57d1cfc3064f29cfec4c17244160121975cab59b44c83b4a4905bf7ebfbd308de376334bf86d8aa92c674f7bcfec85680d73e9fee72642c98c603128e358c86e0bc88a60aaebc2637441a57261c61c6be145f00f2fc56164a6495f4b52d3172cb0ef52e91fa0d32a9ae2502d17433bda58d93fbc24a70ec6b5e740952a61404c7370eafe52599c7ee52e77b1cda87c46da98d2ff0d02fe09db5adcb2d2e9bcd083ef58392907b8a21681fa4ea1e4806b4676656457fea000fa504f9b4d159fe8b241266ac91dcc0351053c6dcc1493a6b02bed652cc8b92a8470c98924ebfde6ddc5cf7fd75f6e83a7350642053b70d4834179c30eb56d8c86656cda784daf3b6cd125779bec51099301e3f79f78d85d0454aef8bf5f9058491881b73e99b662b64080cd3eb16fd7f9d9640c18738736cfc15f391232b7df92f46ceb5abf08732ff833e9409ee541d7c926f7a0fe3e233d3eee4a63b65ab23b7c835b7cdd809ddfac8abb1df471fa66a54092815aa41e6fc1a026b86c5675d39c4e8c5c4b4acd48534165239f5634b9e828a7f9df94efcd2a39045efdee4d2f006a63ae828e6e90e3610c522085da6e0198141d6e501d83aba32057f4e59f9b7dfb0bf949c5ef91917cb54561d45a9e7ead049c57deb62d14ba6e18f5d7b0fb9f15e97bf5bd9f909f99c86c787357946654b87c489d34245d07fbb72119166e338b608a4178b452695235dd96bf7fd338e29a9f054ec1a63a442e12602d2329834297f6a197d8a377d608f402f0bcc936f45f33c8d2f9d40e5aef41816dd883add81ca20f1e0631457fe00aa2bd75c9165ffcd96c100c1db83a53aeee23d59f2a542ee3ba39ba62298ddfbd9ecfafd6b5d2121eb003ee23a2ebb8c6b6b687f42492c962510c5acf5231ff96635eba37354559ba39b042d9b6883cac662f418d7c62f9908b2a67964af5e5471804f7684e0d582b8bfec99816bb3442cca1d1fe4efd75d573ebf09fa9cad811063864fb14be4a7768ec2ddb118a77969e986c6584c4b20f8622941ca73d73562857d36e17a46a68d6e10147aaefff1ffb9809f0652a5f760148ed33550661b63c8176d5679e701c221d8a49d4062eb04010ea74cc1132fbeb8934c6e582ba2a16162b7e9171f95bce4ec3e339e70c781f95aaca406cd718b74397658fdefdd093486664be7ed13efa437012f1f57f9f1f4fb4eef7501ccf0e0ac4edc01fde138038c4dd65cb5c3291ad02a6728d6761b1afa35d49bd6ef117012bdd9bd6ee8a175620feb2249aa18d6175351b4bfc2b2b4fd57ff52f5969b109aa9b6cb2cde8f350917c0da2da1bc3d52eb0c7e6080b8f69c5783f2ed26feceb05ba4e7ed66676041d03d0acd3dd6343a85ac0b9c36f9640ddd0db884822f98dc42ea7911a6938dc14ba19d3d25a2b2f82794a2b5dd751dc856d7a9ccdb2d351a0b84e7030fa925ac949a37594f3aa2ba28ae5155b0aaac9c6820b8888d0b8a9db148513b9e3dbde68333ac30a0720289b6a0145d88629d49e76a6d3538330c5aececc9d54127b0a5a0e92d5a5a73beb71132c208b589cab61d53ed357c907929198c559426ae729b374a803dd3321a45ccca39efd39eddaba6e79a2f8911bdf74e18733dc7efc51132b5608d97fd2d0f22fa8961de04cdf6d0dbfbab21e362e7abaef3976f993088aa97ed3f1f4bcf3fffb012f583558bd2f15face9cba20b3e6754b70", + "shared_secrets": [ + "3f53c03f98eb83db88ff97c2c4004051ce23265ed2414a7aebf7a3e7078839ab" + ] + } + ], + "author": [ + "Christian Decker <> is mainly responsible." + ], + "see_also": [ + "lightning-sendonion(7)", + "lightning-getroute(7)" + ], + "resources": [ + "Main web site: ", + "", + "[BOLT 04](https://github.com/lightning/bolts/blob/master/04-onion-routing.md)" + ] + }, + "lightning-createrune.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.08", + "rpc": "createrune", + "title": "Command to Create/Update Rune for Authorizing Remote Peer Access", + "description": [ + "The **createrune** RPC command creates a base64 string called a *rune* which can be used to access commands on this node. Each *rune* contains a unique id (a number starting at 0), and can have restrictions inside it. Nobody can remove restrictions from a rune: if you try, the rune will be rejected. There is no limit on how many runes you can issue; the node simply decodes and checks them as they are received.", + "", + "Oh, I almost forgot. Runes can also be invoked like in ancient times with the **invokerune** command. Feel the magical powers of a rune by invoking it." + ], + "request": { + "required": [], + "properties": { + "rune": { + "type": "string", + "description": [ + "If supplied, the restrictions are simple appended to that *rune* (it doesn't need to be a rune belonging to this node). If not supplied, a new *rune* is constructed, with a new unique id." + ] + }, + "restrictions": { + "description": [ + "It can be the string `readonly`, or an array of restrictions.", + "Each restriction is an array of one or more alternatives, such as \"method is listpeers\", or \"method is listpeers OR time is before 2023\"." + ], + "oneOf": [ + { + "type": "array", + "description": [ + "Alternatives use a simple language to examine the command which is being run:", + " * time: the current UNIX time, e.g. \"time<1656759180\".", + " * id: the node_id of the peer, e.g. \"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\".", + " * method: the command being run, e.g. \"method=withdraw\".", + " * per: how often the rune can be used, with suffix \"sec\" (default), \"min\", \"hour\", \"day\" or \"msec\", \"usec\" or \"nsec\". e.g. \"per=5sec\".", + " * rate: the rate limit, per minute, e.g. \"rate=60\" is equivalent to \"per=1sec\".", + " * pnum: the number of parameters. e.g. \"pnum<2\".", + " * pnameX: the parameter named X (with any punctuation like `_` removed). e.g. \"pnamedestination=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T\".", + " * parrN: the N'th parameter. e.g. \"parr0=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T\"." + ], + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "type": "string", + "enum": [ + "readonly" + ], + "description": [ + "A rune which allows most *get* and *list* commands, and the *summary* command." + ] + } + ] + } + } + }, + "response": { + "required": [ + "rune", + "unique_id" + ], + "properties": { + "rune": { + "type": "string", + "description": [ + "The resulting rune." + ] + }, + "unique_id": { + "type": "string", + "description": [ + "The id of this rune: this is set at creation and cannot be changed (even as restrictions are added)." + ] + }, + "warning_unrestricted_rune": { + "type": "string", + "description": [ + "A warning shown when runes are created with powers that could drain your node." + ] + } + } + }, + "restriction_format": [ + "Restrictions are one or more alternatives. Each alternative is *name* *operator* *value*. The valid names are shown above.", + "", + "Note that if a value contains `\\`, it must be preceeded by another `\\` to form valid JSON:", + "* `=`: passes if equal ie. identical. e.g. `method=withdraw`", + "* `/`: not equals, e.g. `method/withdraw`", + "* `^`: starts with, e.g. `id^024b9a1fa8e006f1e3937f`", + "* `$`: ends with, e.g. `id$381df1cc449605`.", + "* `~`: contains, e.g. `id~006f1e3937f65f66c40`.", + "* `<`: is a decimal integer, and is less than. e.g. `time<1656759180`", + "* `>`: is a decimal integer, and is greater than. e.g. `time>1656759180`", + "* `{`: preceeds in alphabetical order (or matches but is shorter),", + " e.g. `id{02ff`.", + "* `}`: follows in alphabetical order (or matches but is longer),", + " e.g. `id}02ff`.", + "* `#`: a comment, ignored, e.g. `dumb example#`.", + "* `!`: only passes if the *name* does *not* exist. e.g. `pnamedestination!`.", + "Every other operator except `#` fails if *name* does not exist!" + ], + "example_usage": [ + "This creates a fresh rune which can do anything:", + "", + "```shell", + "$ lightning-cli commando-rune", + "{", + " \"rune\": \"KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA==\",", + " \"unique_id\": \"0\"", + "}", + "```", + "We can add restrictions to that rune, like so:", + "", + "```shell", + "$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions=readonly", + "{", + " \"rune\": \"NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl\",", + " \"unique_id\": \"0\"", + "}", + "```", + "The \"readonly\" restriction is a short-cut for two restrictions:", + "", + "1. `[\"method^list\", \"method^get\", \"method=summary\"]`: You may call list, get or summary.", + "2. `[\"method/listdatastore\"]`: But not listdatastore: that contains sensitive stuff!", + "", + "We can do the same manually, like so:", + "", + "```shell", + "$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions='[[\"method^list\", \"method^get\", \"method=summary\"],[\"method/listdatastore\"]]'", + "{", + " \"rune\": \"NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl\",", + " \"unique_id\": \"0\"", + "}", + "```", + "Let's create a rune which lets a specific peer (024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605) run \"listpeers\" on themselves:", + "", + "```shell", + "$ lightning-cli commando-rune restrictions='[[\"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"],[\"method=listpeers\"],[\"pnum=1\"],[\"pnameid=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\",\"parr0=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"]]'", + "{", + " \"rune\": \"FE8GHiGVvxcFqCQcClVRRiNE_XEeLYQzyG2jmqto4jM9MiZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDV8cGFycjA9MDI0YjlhMWZhOGUwMDZmMWUzOTM3ZjY1ZjY2YzQwOGU2ZGE4ZTFjYTcyOGVhNDMyMjJhNzM4MWRmMWNjNDQ5NjA1\",", + " \"unique_id\": \"2\"", + "}", + "```", + "This allows `listpeers` with 1 argument (`pnum=1`), which is either by name (`pnameid`), or position (`parr0`). We could shorten this in several ways: either allowing only positional or named parameters, or by testing the start of the parameters only. Here's an example which only checks the first 9 bytes of the `listpeers` parameter:", + "", + "```shell", + "$ lightning-cli commando-rune restrictions='[[\"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"],[\"method=listpeers\"],[\"pnum=1\"],[\"pnameid^024b9a1fa8e006f1e393\", \"parr0^024b9a1fa8e006f1e393\"]'", + " {", + " \"rune\": \"fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw==\",", + " \"unique_id\": \"3\"", + "}", + "```", + "Before we give this to our peer, let's add two more restrictions: that it only be usable for 24 hours from now (`time<`), and that it can only be used twice a minute (`rate=2`). `date +%s` can give us the current time in seconds:", + "", + "```shell", + "$ lightning-cli commando-rune rune=fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw== restrictions='[[\"time<'$(($(date +%s) + 24*60*60))'\",\"rate=2\"]]'", + "{", + " \"rune\": \"tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y\",", + " \"unique_id\": \"3\"", + "}", + "```", + "You can also use lightning-decode(7) to examine runes you have been given:", + "", + "```shell", + "$ lightning-cli decode tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y", + "{", + " \"type\": \"rune\",", + " \"unique_id\": \"3\",", + " \"string\": \"b54f912e33220e9636534a375b5a05a306abdfa4451a95a5a0f6d6f7e46e65da:=3&id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605&method=listpeers&pnum=1&pnameid^024b9a1fa8e006f1e393|parr0^024b9a1fa8e006f1e393&time<1656920538&rate=2\",", + " \"restrictions\": [", + " {", + " \"alternatives\": [", + " \"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"", + " ],", + " \"summary\": \"id (of commanding peer) equal to '024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605'\"", + " },", + " {", + " \"alternatives\": [", + " \"method=listpeers\"", + " ],", + " \"summary\": \"method (of command) equal to 'listpeers'\"", + " },", + " {", + " \"alternatives\": [", + " \"pnum=1\"", + " ],", + " \"summary\": \"pnum (number of command parameters) equal to 1\"", + " },", + " {", + " \"alternatives\": [", + " \"pnameid^024b9a1fa8e006f1e393\",", + " \"parr0^024b9a1fa8e006f1e393\"", + " ],", + " \"summary\": \"pnameid (object parameter 'id') starts with '024b9a1fa8e006f1e393' OR parr0 (array parameter #0) starts with '024b9a1fa8e006f1e393'\"", + " },", + " {", + " \"alternatives\": [", + " \"time<1656920538\"", + " ],", + " \"summary\": \"time (in seconds since 1970) less than 1656920538 (approximately 19 hours 18 minutes from now)\"", + " },", + " {", + " \"alternatives\": [", + " \"rate=2\"", + " ],", + " \"summary\": \"rate (max per minute) equal to 2\"", + " }", + " ],", + " \"valid\": true", + "}", + "```" + ], + "sharing_runes": [ + "Because anyone can add a restriction to a rune, you can always turn a normal rune into a read-only rune, or restrict access for 30 minutes from the time you give it to someone. Adding restrictions before sharing runes is best practice.", + "", + "If a rune has a ratelimit, any derived rune will have the same id, and thus will compete for that ratelimit. You might want to consider adding a tighter ratelimit to a rune before sharing it, so you will keep the remainder. For example, if you rune has a limit of 60 times per minute, adding a limit of 5 times per minute and handing that rune out means you can still use your original rune 55 times per minute." + ], + "example_json_request": [ + { + "id": "example:createrune#1", + "method": "createrune", + "params": { + "restrictions": [ + [ + "method/getinfo" + ] + ] + } + }, + { + "id": "example:createrune#2", + "method": "createrune", + "params": { + "restrictions": "readonly" + } + }, + { + "id": "example:createrune#3", + "method": "createrune", + "params": [ + "enX0sTpHB8y1ktyTAF80CnEvGetG340Ne3AGItudBS49NCZwbnVtPTA=", + [ + [ + "rate=3" + ] + ] + ] + } + ], + "example_json_response": [ + { + "rune": "S5f-BKt3rR-cvJmujdpDCUQm_XLahfB4iQuDlwqMJiQ9MCZtZXRob2QvZ2V0aW5mbw==", + "unique_id": "0" + }, + { + "rune": "oVkzoiQ67VCU1h_aRjPqCeWktGX54ARDsqqQgDL-uMs9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", + "unique_id": "1" + }, + { + "rune": "_h2eKjoK7ITAF-JQ1S5oum9oMQesrz-t1FR9kDChRB49NCZwbnVtPTAmcmF0ZT0z", + "unique_id": "2" + } + ], + "author": [ + "Rusty Russell <> wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page.", + "", + "Shahana Farooqui <> is mainly responsible for migrating commando-rune to createrune." + ], + "see_also": [ + "lightning-commando-rune(7)", + "lightning-checkrune(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-datastore.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "datastore", + "title": "Command for storing (plugin) data", + "description": [ + "The **datastore** RPC command allows plugins to store data in the Core Lightning database, for later retrieval." + ], + "request": { + "required": [ + "key" + ], + "properties": { + "key": { + "description": [ + "A key can either have children or a value, never both: parents are created and removed automatically." + ], + "oneOf": [ + { + "type": "array", + "description": [ + "An array of values to form a hierarchy (though a single value is treated as a one-element array). Using the first element of the key as the plugin name (e.g. `[ 'summary' ]`) is recommended." + ], + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] + }, + "string": { + "type": "string", + "description": [ + "Data to be saved in string format." + ] + }, + "hex": { + "type": "hex", + "description": [ + "Data to be saved in hex format." + ] + }, + "mode": { + "type": "string", + "description": [ + "Write mode to determine how the record is updated:", + " * `must-create`: fails if it already exists.", + " * `must-replace`: fails if it doesn't already exist.", + " * `create-or-replace`: never fails.", + " * `must-append`: must already exist, append this to what's already there.", + " * `create-or-append`: append if anything is there, otherwise create." + ], + "enum": [ + "must-create", + "must-replace", + "create-or-replace", + "must-append", + "create-or-append" + ], + "default": "`must-create`" + }, + "generation": { + "type": "u64", + "description": [ + "If specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with *mode* `must-replace` or `must-append`." + ] + } + } + }, + "response": { + "required": [ + "key" + ], + "properties": { + "key": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Part of the key added to the datastore." + ] + } + }, + "generation": { + "type": "u64", + "description": [ + "The number of times this has been updated." + ] + }, + "hex": { + "type": "hex", + "description": [ + "The hex data which has been added to the datastore." + ] + }, + "string": { + "type": "string", + "description": [ + "The data as a string, if it's valid utf-8." + ] + } + } + }, + "errors": [ + "The following error codes may occur:", + "", + "- 1202: The key already exists (and mode said it must not)", + "- 1203: The key does not exist (and mode said it must)", + "- 1204: The generation was wrong (and generation was specified)", + "- 1205: The key has children already.", + "- 1206: One of the parents already exists with a value.", + "- -32602: invalid parameters" + ], + "example_json_request": [ + { + "id": "example:datastore#1", + "method": "datastore", + "params": { + "key": [ + "test_libplugin", + "name" + ], + "string": "foobar", + "hex": null, + "mode": "must-replace", + "generation": null + } + }, + { + "id": "example:datastore#2", + "method": "datastore", + "params": { + "key": "somekey", + "string": null, + "hex": "61", + "mode": "create-or-append", + "generation": null + } + }, + { + "id": "example:datastore#3", + "method": "datastore", + "params": { + "key": [ + "a", + "d", + "e", + "f", + "g" + ], + "string": "somedatatostoreinthedatastore", + "hex": null, + "mode": null, + "generation": null + } + } + ], + "example_json_response": [ + { + "key": [ + "test_libplugin", + "name" + ], + "generation": 1, + "hex": "666f6f626172", + "string": "foobar" + }, + { + "key": [ + "somekey" + ], + "generation": 3, + "hex": "736f6d6564617461", + "string": "somedata" + }, + { + "key": [ + "a", + "d", + "e", + "f", + "g" + ], + "generation": 0, + "hex": "736f6d6564617461746f73746f7265696e7468656461746173746f7265", + "string": "somedatatostoreinthedatastore" + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listdatastore(7)", + "lightning-deldatastore(7)", + "lightning-datastoreusage(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-datastoreusage.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.11", + "rpc": "datastoreusage", + "title": "Command for listing datastore usage info", + "description": [ + "The **datastoreusage** RPC command allows the caller to fetch the total bytes that are stored under a certain *key* (or from the root), including the size of the *key*.", + "", + "All descendants of the *key* (or root) are taken into account." + ], + "request": { + "required": [], + "properties": { + "key": { + "oneOf": [ + { + "type": "array", + "description": [ + "Key is an array of values (though a single value is treated as a one-element array). Used as the starting point to traverse the datastore." + ], + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] + } + } + }, + "response": { + "required": [ + "datastoreusage" + ], + "properties": { + "datastoreusage": { + "type": "object", + "additionalProperties": false, + "required": [ + "key", + "total_bytes" + ], + "properties": { + "key": { + "type": "string", + "added": "v23.11", + "description": [ + "The key from which the database was traversed." + ] + }, + "total_bytes": { + "type": "u64", + "added": "v23.11", + "description": [ + "The total bytes that are stored under the *key*, including the all descendants data and the size of the keys themselves." + ] + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:datastoreusage#1", + "method": "datastoreusage", + "params": { + "key": null + } + }, + { + "id": "example:datastoreusage#2", + "method": "datastoreusage", + "params": { + "key": "a" + } + }, + { + "id": "example:datastoreusage#3", + "method": "datastoreusage", + "params": { + "key": [ + "a", + "thisissomelongkeythattriestostore46bytesofdata" + ] + } + } + ], + "example_json_response": [ + { + "datastoreusage": { + "key": "[]", + "total_bytes": 0 + } + }, + { + "datastoreusage": { + "key": "[a]", + "total_bytes": 32 + } + }, + { + "datastoreusage": { + "key": "[a,thisissomelongkeythattriestostore46bytesofdata]", + "total_bytes": 77 + } + } + ], + "author": [ + "Peter Neuroth <> is mainly responsible." + ], + "see_also": [ + "lightning-datastore(7)", + "lightning-deldatastore(7)", + "lightning-listdatastore(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-decode.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.05", + "rpc": "decode", + "title": "Command for decoding an invoice string (low-level)", + "description": [ + "The **decode** RPC command checks and parses `bolt11`, `bolt12`, `rune` or `emergency_recover`. It may decode other formats in future." + ], + "request": { + "required": [ + "string" + ], + "properties": { + "string": { + "type": "string", + "description": [ + "Value to be decoded:", + " * a *bolt11* or *bolt12* string (optionally prefixed by `lightning:` or `LIGHTNING:`) as specified by the BOLT 11 and BOLT 12 specifications.", + " * a *rune* as created by lightning-commando-rune(7).", + " * an *emergency_recover* string generated by hsmtool like `lightning-hsmtool getemergencyrecover `. It holds `emergency.recover` contents and starts with `clnemerg1`." + ] + } + } + }, + "response": { + "required": [ + "type", + "valid" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt12 offer", + "bolt12 invoice", + "bolt12 invoice_request", + "bolt11 invoice", + "rune", + "emergency recover" + ], + "description": [ + "What kind of object it decoded to." + ] + }, + "valid": { + "type": "boolean", + "description": [ + "If this is false, you *MUST* not use the result except for diagnostics!" + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt12 offer" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "required": [ + "offer_id", + "offer_node_id", + "offer_description" + ], + "additionalProperties": false, + "properties": { + "type": {}, + "valid": {}, + "offer_id": { + "type": "hex", + "description": [ + "The id we use to identify this offer." + ], + "maxLength": 64, + "minLength": 64 + }, + "offer_chains": { + "type": "array", + "description": [ + "Which blockchains this offer is for (missing implies bitcoin mainnet only)." + ], + "items": { + "type": "hash", + "description": [ + "The genesis blockhash." + ] + } + }, + "offer_metadata": { + "type": "hex", + "description": [ + "Any metadata the creator of the offer includes." + ] + }, + "offer_currency": { + "type": "string", + "description": [ + "ISO 4217 code of the currency (missing implies Bitcoin)." + ], + "maxLength": 3, + "minLength": 3 + }, + "warning_unknown_offer_currency": { + "type": "string", + "description": [ + "The currency code is unknown (so no `currency_minor_unit`)." + ] + }, + "currency_minor_unit": { + "type": "u32", + "description": [ + "The number of decimal places to apply to amount (if currency known)." + ] + }, + "offer_amount": { + "type": "u64", + "description": [ + "The amount in the `offer_currency` adjusted by `currency_minor_unit`, if any." + ] + }, + "offer_amount_msat": { + "type": "msat", + "description": [ + "The amount in bitcoin (if specified, and no `offer_currency`)." + ] + }, + "offer_description": { + "type": "string", + "description": [ + "The description of the purpose of the offer." + ] + }, + "offer_issuer": { + "type": "string", + "description": [ + "The description of the creator of the offer." + ] + }, + "offer_features": { + "type": "hex", + "description": [ + "The feature bits of the offer." + ] + }, + "offer_absolute_expiry": { + "type": "u64", + "description": [ + "UNIX timestamp of when this offer expires." + ] + }, + "offer_quantity_max": { + "type": "u64", + "description": [ + "The maximum quantity (or, if 0, means any quantity)." + ] + }, + "offer_paths": { + "type": "array", + "description": [ + "Paths to the destination." + ], + "items": { + "type": "object", + "required": [ + "first_node_id", + "blinding", + "path" + ], + "additionalProperties": false, + "properties": { + "first_node_id": { + "type": "pubkey", + "description": [ + "The (presumably well-known) public key of the start of the path." + ] + }, + "blinding": { + "type": "pubkey", + "description": [ + "Blinding factor for this path." + ] + }, + "path": { + "type": "array", + "description": [ + "An individual path." + ], + "items": { + "type": "object", + "required": [ + "blinded_node_id", + "encrypted_recipient_data" + ], + "additionalProperties": false, + "properties": { + "blinded_node_id": { + "type": "pubkey", + "description": [ + "Node_id of the hop." + ] + }, + "encrypted_recipient_data": { + "type": "hex", + "description": [ + "Encrypted TLV entry for this hop." + ] + } + } + } + } + } + } + }, + "offer_node_id": { + "type": "pubkey", + "description": [ + "Public key of the offering node." + ] + }, + "offer_recurrence": { + "type": "object", + "description": [ + "How often to this offer should be used." + ], + "required": [ + "period", + "time_unit" + ], + "additionalProperties": false, + "properties": { + "time_unit": { + "type": "u32", + "description": [ + "The BOLT12 time unit." + ] + }, + "time_unit_name": { + "type": "string", + "description": [ + "The name of `time_unit` (if valid)." + ] + }, + "period": { + "type": "u32", + "description": [ + "How many `time_unit` per payment period." + ] + }, + "basetime": { + "type": "u64", + "description": [ + "Period starts at this UNIX timestamp." + ] + }, + "start_any_period": { + "type": "u64", + "description": [ + "You can start at any period (only if `basetime` present)." + ] + }, + "limit": { + "type": "u32", + "description": [ + "Maximum period number for recurrence." + ] + }, + "paywindow": { + "type": "object", + "description": [ + "When within a period will payment be accepted." + ], + "default": "prior and during the period", + "required": [ + "seconds_before", + "seconds_after" + ], + "additionalProperties": false, + "properties": { + "seconds_before": { + "type": "u32", + "description": [ + "Seconds prior to period start." + ] + }, + "seconds_after": { + "type": "u32", + "description": [ + "Seconds after to period start." + ] + }, + "proportional_amount": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Amount should be scaled if paid after period start." + ] + } + } + } + } + }, + "unknown_offer_tlvs": { + "type": "array", + "description": [ + "Any extra fields we didn't know how to parse." + ], + "items": { + "type": "object", + "required": [ + "type", + "length", + "value" + ], + "additionalProperties": false, + "properties": { + "type": { + "type": "u64", + "description": [ + "The type." + ] + }, + "length": { + "type": "u64", + "description": [ + "The length." + ] + }, + "value": { + "type": "hex", + "description": [ + "The value." + ] + } + } + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt12 offer" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + false + ] + } + } + }, + "then": { + "required": [], + "additionalProperties": false, + "properties": { + "type": {}, + "valid": {}, + "offer_id": {}, + "node_id": {}, + "signature": {}, + "chains": {}, + "currency": {}, + "minor_unit": {}, + "warning_unknown_offer_currency": {}, + "amount": {}, + "amount_msat": {}, + "send_invoice": {}, + "description": {}, + "vendor": {}, + "features": {}, + "absolute_expiry": {}, + "paths": {}, + "quantity_max": {}, + "unknown_offer_tlvs": {}, + "recurrence": {}, + "warning_missing_offer_node_id": { + "type": "string", + "description": [ + "`offer_node_id` is not present." + ] + }, + "warning_invalid_offer_description": { + "type": "string", + "description": [ + "`offer_description` is not valid UTF8." + ] + }, + "warning_missing_offer_description": { + "type": "string", + "description": [ + "`offer_description` is not present." + ] + }, + "warning_invalid_offer_currency": { + "type": "string", + "description": [ + "`offer_currency_code` is not valid UTF8." + ] + }, + "warning_invalid_offer_issuer": { + "type": "string", + "description": [ + "`offer_issuer` is not valid UTF8." + ] + } + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt12 invoice_request" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "required": [ + "offer_node_id", + "offer_description", + "invreq_metadata", + "invreq_payer_id", + "signature" + ], + "additionalProperties": false, + "properties": { + "type": {}, + "valid": {}, + "offer_id": { + "type": "hex", + "description": [ + "The id we use to identify this offer." + ], + "maxLength": 64, + "minLength": 64 + }, + "offer_chains": { + "type": "array", + "description": [ + "Which blockchains this offer is for (missing implies bitcoin mainnet only)." + ], + "items": { + "type": "hex", + "description": [ + "The genesis blockhash." + ], + "maxLength": 64, + "minLength": 64 + } + }, + "offer_metadata": { + "type": "hex", + "description": [ + "Any metadata the creator of the offer includes." + ] + }, + "offer_currency": { + "type": "string", + "description": [ + "ISO 4217 code of the currency (missing implies Bitcoin)." + ], + "maxLength": 3, + "minLength": 3 + }, + "warning_unknown_offer_currency": { + "type": "string", + "description": [ + "The currency code is unknown (so no `currency_minor_unit`)." + ] + }, + "currency_minor_unit": { + "type": "u32", + "description": [ + "The number of decimal places to apply to amount (if currency known)." + ] + }, + "offer_amount": { + "type": "u64", + "description": [ + "The amount in the `offer_currency` adjusted by `currency_minor_unit`, if any." + ] + }, + "offer_amount_msat": { + "type": "msat", + "description": [ + "The amount in bitcoin (if specified, and no `offer_currency`)." + ] + }, + "offer_description": { + "type": "string", + "description": [ + "The description of the purpose of the offer." + ] + }, + "offer_issuer": { + "type": "string", + "description": [ + "The description of the creator of the offer." + ] + }, + "offer_features": { + "type": "hex", + "description": [ + "The feature bits of the offer." + ] + }, + "offer_absolute_expiry": { + "type": "u64", + "description": [ + "UNIX timestamp of when this offer expires." + ] + }, + "offer_quantity_max": { + "type": "u64", + "description": [ + "The maximum quantity (or, if 0, means any quantity)." + ] + }, + "offer_paths": { + "type": "array", + "description": [ + "Paths to the destination." + ], + "items": { + "type": "object", + "required": [ + "first_node_id", + "blinding", + "path" + ], + "additionalProperties": false, + "properties": { + "first_node_id": { + "type": "pubkey", + "description": [ + "The (presumably well-known) public key of the start of the path." + ] + }, + "blinding": { + "type": "pubkey", + "description": [ + "Blinding factor for this path." + ] + }, + "path": { + "type": "array", + "description": [ + "An individual path." + ], + "items": { + "type": "object", + "required": [ + "blinded_node_id", + "encrypted_recipient_data" + ], + "additionalProperties": false, + "properties": { + "blinded_node_id": { + "type": "pubkey", + "description": [ + "Node_id of the hop." + ] + }, + "encrypted_recipient_data": { + "type": "hex", + "description": [ + "Encrypted TLV entry for this hop." + ] + } + } + } + } + } + } + }, + "offer_node_id": { + "type": "pubkey", + "description": [ + "Public key of the offering node." + ] + }, + "offer_recurrence": { + "type": "object", + "description": [ + "How often to this offer should be used." + ], + "required": [ + "period", + "time_unit" + ], + "additionalProperties": false, + "properties": { + "time_unit": { + "type": "u32", + "description": [ + "The BOLT12 time unit." + ] + }, + "time_unit_name": { + "type": "string", + "description": [ + "The name of `time_unit` (if valid)." + ] + }, + "period": { + "type": "u32", + "description": [ + "How many `time_unit` per payment period." + ] + }, + "basetime": { + "type": "u64", + "description": [ + "Period starts at this UNIX timestamp." + ] + }, + "start_any_period": { + "type": "u64", + "description": [ + "You can start at any period (only if `basetime` present)." + ] + }, + "limit": { + "type": "u32", + "description": [ + "Maximum period number for recurrence." + ] + }, + "paywindow": { + "type": "object", + "description": [ + "When within a period will payment be accepted." + ], + "default": "prior and during the period", + "required": [ + "seconds_before", + "seconds_after" + ], + "additionalProperties": false, + "properties": { + "seconds_before": { + "type": "u32", + "description": [ + "Seconds prior to period start." + ] + }, + "seconds_after": { + "type": "u32", + "description": [ + "Seconds after to period start." + ] + }, + "proportional_amount": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Amount should be scaled if paid after period start." + ] + } + } + } + } + }, + "invreq_metadata": { + "type": "hex", + "description": [ + "The payer-provided blob to derive invreq_payer_id." + ] + }, + "invreq_payer_id": { + "type": "hex", + "description": [ + "The payer-provided key." + ] + }, + "invreq_chain": { + "type": "hex", + "description": [ + "Which blockchain this offer is for (missing implies bitcoin mainnet only)." + ], + "maxLength": 64, + "minLength": 64 + }, + "invreq_amount_msat": { + "type": "msat", + "description": [ + "The amount the invoice should be for." + ] + }, + "invreq_features": { + "type": "hex", + "description": [ + "The feature bits of the invoice_request." + ] + }, + "invreq_quantity": { + "type": "u64", + "description": [ + "The number of items to invoice for." + ] + }, + "invreq_payer_note": { + "type": "string", + "description": [ + "A note attached by the payer." + ] + }, + "invreq_recurrence_counter": { + "type": "u32", + "description": [ + "Which number request this is for the same invoice." + ] + }, + "invreq_recurrence_start": { + "type": "u32", + "description": [ + "When we're requesting to start an invoice at a non-zero period." + ] + }, + "signature": { + "type": "bip340sig", + "description": [ + "BIP-340 signature of the `invreq_payer_id` on this invoice_request." + ] + }, + "unknown_invoice_request_tlvs": { + "type": "array", + "description": [ + "Any extra fields we didn't know how to parse." + ], + "items": { + "type": "object", + "required": [ + "type", + "length", + "value" + ], + "additionalProperties": false, + "properties": { + "type": { + "type": "u64", + "description": [ + "The type." + ] + }, + "length": { + "type": "u64", + "description": [ + "The length." + ] + }, + "value": { + "type": "hex", + "description": [ + "The value." + ] + } + } + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt12 invoice_request" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + false + ] + } + } + }, + "then": { + "required": [], + "additionalProperties": false, + "properties": { + "type": {}, + "valid": {}, + "offer_id": {}, + "offer_chains": {}, + "offer_metadata": {}, + "offer_currency": {}, + "warning_unknown_offer_currency": {}, + "currency_minor_unit": {}, + "offer_amount": {}, + "offer_amount_msat": {}, + "offer_description": {}, + "offer_issuer": {}, + "offer_features": {}, + "offer_absolute_expiry": {}, + "offer_quantity_max": {}, + "offer_paths": {}, + "offer_node_id": {}, + "offer_recurrence": {}, + "invreq_metadata": {}, + "invreq_payer_id": {}, + "invreq_chain": {}, + "invreq_amount_msat": {}, + "invreq_features": {}, + "invreq_quantity": {}, + "invreq_payer_note": {}, + "invreq_recurrence_counter": {}, + "invreq_recurrence_start": {}, + "warning_invalid_offer_description": { + "type": "string", + "description": [ + "`offer_description` is not valid UTF8." + ] + }, + "warning_missing_offer_description": { + "type": "string", + "description": [ + "`offer_description` is not present." + ] + }, + "warning_invalid_offer_currency": { + "type": "string", + "description": [ + "`offer_currency_code` is not valid UTF8." + ] + }, + "warning_invalid_offer_issuer": { + "type": "string", + "description": [ + "`offer_issuer` is not valid UTF8." + ] + }, + "warning_missing_invreq_metadata": { + "type": "string", + "description": [ + "`invreq_metadata` is not present." + ] + }, + "warning_missing_invreq_payer_id": { + "type": "string", + "description": [ + "`invreq_payer_id` is not present." + ] + }, + "warning_invalid_invreq_payer_note": { + "type": "string", + "description": [ + "`invreq_payer_note` is not valid UTF8." + ] + }, + "warning_missing_invoice_request_signature": { + "type": "string", + "description": [ + "`signature` is not present." + ] + }, + "warning_invalid_invoice_request_signature": { + "type": "string", + "description": [ + "Incorrect `signature`." + ] + } + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt12 invoice" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "required": [ + "offer_node_id", + "offer_description", + "invreq_metadata", + "invreq_payer_id", + "invoice_paths", + "invoice_created_at", + "invoice_payment_hash", + "invoice_amount_msat", + "signature" + ], + "additionalProperties": false, + "properties": { + "type": {}, + "valid": {}, + "offer_id": { + "type": "hex", + "description": [ + "The id we use to identify this offer." + ], + "maxLength": 64, + "minLength": 64 + }, + "offer_chains": { + "type": "array", + "description": [ + "Which blockchains this offer is for (missing implies bitcoin mainnet only)." + ], + "items": { + "type": "hex", + "description": [ + "The genesis blockhash." + ], + "maxLength": 64, + "minLength": 64 + } + }, + "offer_metadata": { + "type": "hex", + "description": [ + "Any metadata the creator of the offer includes." + ] + }, + "offer_currency": { + "type": "string", + "description": [ + "ISO 4217 code of the currency (missing implies Bitcoin)." + ], + "maxLength": 3, + "minLength": 3 + }, + "warning_unknown_offer_currency": { + "type": "string", + "description": [ + "The currency code is unknown (so no `currency_minor_unit`)." + ] + }, + "currency_minor_unit": { + "type": "u32", + "description": [ + "The number of decimal places to apply to amount (if currency known)." + ] + }, + "offer_amount": { + "type": "u64", + "description": [ + "The amount in the `offer_currency` adjusted by `currency_minor_unit`, if any." + ] + }, + "offer_amount_msat": { + "type": "msat", + "description": [ + "The amount in bitcoin (if specified, and no `offer_currency`)." + ] + }, + "offer_description": { + "type": "string", + "description": [ + "The description of the purpose of the offer." + ] + }, + "offer_issuer": { + "type": "string", + "description": [ + "The description of the creator of the offer." + ] + }, + "offer_features": { + "type": "hex", + "description": [ + "The feature bits of the offer." + ] + }, + "offer_absolute_expiry": { + "type": "u64", + "description": [ + "UNIX timestamp of when this offer expires." + ] + }, + "offer_quantity_max": { + "type": "u64", + "description": [ + "The maximum quantity (or, if 0, means any quantity)." + ] + }, + "offer_paths": { + "type": "array", + "description": [ + "Paths to the destination." + ], + "items": { + "type": "object", + "required": [ + "first_node_id", + "blinding", + "path" + ], + "additionalProperties": false, + "properties": { + "first_node_id": { + "type": "pubkey", + "description": [ + "The (presumably well-known) public key of the start of the path." + ] + }, + "blinding": { + "type": "pubkey", + "description": [ + "Blinding factor for this path." + ] + }, + "path": { + "type": "array", + "description": [ + "An individual path." + ], + "items": { + "type": "object", + "required": [ + "blinded_node_id", + "encrypted_recipient_data" + ], + "additionalProperties": false, + "properties": { + "blinded_node_id": { + "type": "pubkey", + "description": [ + "Node_id of the hop." + ] + }, + "encrypted_recipient_data": { + "type": "hex", + "description": [ + "Encrypted TLV entry for this hop." + ] + } + } + } + } + } + } + }, + "offer_node_id": { + "type": "pubkey", + "description": [ + "Public key of the offering node." + ] + }, + "offer_recurrence": { + "type": "object", + "description": [ + "How often to this offer should be used." + ], + "required": [ + "period", + "time_unit" + ], + "additionalProperties": false, + "properties": { + "time_unit": { + "type": "u32", + "description": [ + "The BOLT12 time unit." + ] + }, + "time_unit_name": { + "type": "string", + "description": [ + "The name of `time_unit` (if valid)." + ] + }, + "period": { + "type": "u32", + "description": [ + "How many `time_unit` per payment period." + ] + }, + "basetime": { + "type": "u64", + "description": [ + "Period starts at this UNIX timestamp." + ] + }, + "start_any_period": { + "type": "u64", + "description": [ + "You can start at any period (only if `basetime` present)." + ] + }, + "limit": { + "type": "u32", + "description": [ + "Maximum period number for recurrence." + ] + }, + "paywindow": { + "type": "object", + "description": [ + "When within a period will payment be accepted." + ], + "default": "prior and during the period", + "required": [ + "seconds_before", + "seconds_after" + ], + "additionalProperties": false, + "properties": { + "seconds_before": { + "type": "u32", + "description": [ + "Seconds prior to period start." + ] + }, + "seconds_after": { + "type": "u32", + "description": [ + "Seconds after to period start." + ] + }, + "proportional_amount": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Amount should be scaled if paid after period start." + ] + } + } + } + } + }, + "invreq_metadata": { + "type": "hex", + "description": [ + "The payer-provided blob to derive invreq_payer_id." + ] + }, + "invreq_payer_id": { + "type": "hex", + "description": [ + "The payer-provided key." + ] + }, + "invreq_chain": { + "type": "hex", + "description": [ + "Which blockchain this offer is for (missing implies bitcoin mainnet only)." + ], + "maxLength": 64, + "minLength": 64 + }, + "invreq_amount_msat": { + "type": "msat", + "description": [ + "The amount the invoice should be for." + ] + }, + "invreq_features": { + "type": "hex", + "description": [ + "The feature bits of the invoice_request." + ] + }, + "invreq_quantity": { + "type": "u64", + "description": [ + "The number of items to invoice for." + ] + }, + "invreq_payer_note": { + "type": "string", + "description": [ + "A note attached by the payer." + ] + }, + "invreq_recurrence_counter": { + "type": "u32", + "description": [ + "Which number request this is for the same invoice." + ] + }, + "invreq_recurrence_start": { + "type": "u32", + "description": [ + "When we're requesting to start an invoice at a non-zero period." + ] + }, + "invoice_paths": { + "type": "array", + "description": [ + "Paths to pay the destination." + ], + "items": { + "type": "object", + "required": [ + "first_node_id", + "blinding", + "payinfo", + "path" + ], + "additionalProperties": false, + "properties": { + "first_node_id": { + "type": "pubkey", + "description": [ + "The (presumably well-known) public key of the start of the path." + ] + }, + "blinding": { + "type": "pubkey", + "description": [ + "Blinding factor for this path." + ] + }, + "payinfo": { + "type": "object", + "required": [ + "fee_base_msat", + "fee_proportional_millionths", + "cltv_expiry_delta", + "features" + ], + "additionalProperties": false, + "properties": { + "fee_base_msat": { + "type": "msat", + "description": [ + "Basefee for path." + ] + }, + "fee_proportional_millionths": { + "type": "u32", + "description": [ + "Proportional fee for path." + ] + }, + "cltv_expiry_delta": { + "type": "u32", + "description": [ + "CLTV delta for path." + ] + }, + "features": { + "type": "hex", + "description": [ + "Features allowed for path." + ] + } + } + }, + "path": { + "type": "array", + "description": [ + "An individual path." + ], + "items": { + "type": "object", + "required": [ + "blinded_node_id", + "encrypted_recipient_data" + ], + "additionalProperties": false, + "properties": { + "blinded_node_id": { + "type": "pubkey", + "description": [ + "Node_id of the hop." + ] + }, + "encrypted_recipient_data": { + "type": "hex", + "description": [ + "Encrypted TLV entry for this hop." + ] + } + } + } + } + } + } + }, + "invoice_created_at": { + "type": "u64", + "description": [ + "The UNIX timestamp of invoice creation." + ] + }, + "invoice_relative_expiry": { + "type": "u32", + "description": [ + "The number of seconds after *invoice_created_at* when this expires." + ] + }, + "invoice_payment_hash": { + "type": "hex", + "description": [ + "The hash of the *payment_preimage*." + ], + "maxLength": 64, + "minLength": 64 + }, + "invoice_amount_msat": { + "type": "msat", + "description": [ + "The amount required to fulfill invoice." + ] + }, + "invoice_fallbacks": { + "type": "array", + "description": [ + "Onchain addresses." + ], + "items": { + "type": "object", + "required": [ + "version", + "hex" + ], + "additionalProperties": false, + "properties": { + "version": { + "type": "u8", + "description": [ + "Segwit address version." + ] + }, + "hex": { + "type": "hex", + "description": [ + "Raw encoded segwit address." + ] + }, + "address": { + "type": "string", + "description": [ + "Bech32 segwit address." + ] + } + } + } + }, + "invoice_features": { + "type": "hex", + "description": [ + "The feature bits of the invoice." + ] + }, + "invoice_node_id": { + "type": "pubkey", + "description": [ + "The id to pay (usually the same as offer_node_id)." + ] + }, + "invoice_recurrence_basetime": { + "type": "u64", + "description": [ + "The UNIX timestamp to base the invoice periods on." + ] + }, + "signature": { + "type": "bip340sig", + "description": [ + "BIP-340 signature of the `offer_node_id` on this invoice." + ] + }, + "unknown_invoice_tlvs": { + "type": "array", + "description": [ + "Any extra fields we didn't know how to parse." + ], + "items": { + "type": "object", + "required": [ + "type", + "length", + "value" + ], + "additionalProperties": false, + "properties": { + "type": { + "type": "u64", + "description": [ + "The type." + ] + }, + "length": { + "type": "u64", + "description": [ + "The length." + ] + }, + "value": { + "type": "hex", + "description": [ + "The value." + ] + } + } + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt12 invoice" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + false + ] + } + } + }, + "then": { + "required": [], + "additionalProperties": false, + "properties": { + "type": {}, + "valid": {}, + "offer_id": {}, + "offer_chains": {}, + "offer_metadata": {}, + "offer_currency": {}, + "warning_unknown_offer_currency": {}, + "currency_minor_unit": {}, + "offer_amount": {}, + "offer_amount_msat": {}, + "offer_description": {}, + "offer_issuer": {}, + "offer_features": {}, + "offer_absolute_expiry": {}, + "offer_quantity_max": {}, + "offer_paths": {}, + "offer_node_id": {}, + "offer_recurrence": {}, + "invreq_metadata": {}, + "invreq_payer_id": {}, + "invreq_chain": {}, + "invreq_amount_msat": {}, + "invreq_features": {}, + "invreq_quantity": {}, + "invreq_payer_note": {}, + "invreq_node_id": {}, + "invreq_recurrence_counter": {}, + "invreq_recurrence_start": {}, + "warning_invalid_offer_description": { + "type": "string", + "description": [ + "`offer_description` is not valid UTF8." + ] + }, + "warning_missing_offer_description": { + "type": "string", + "description": [ + "`offer_description` is not present." + ] + }, + "warning_invalid_offer_currency": { + "type": "string", + "description": [ + "`offer_currency_code` is not valid UTF8." + ] + }, + "warning_invalid_offer_issuer": { + "type": "string", + "description": [ + "`offer_issuer` is not valid UTF8." + ] + }, + "warning_missing_invreq_metadata": { + "type": "string", + "description": [ + "`invreq_metadata` is not present." + ] + }, + "warning_invalid_invreq_payer_note": { + "type": "string", + "description": [ + "`invreq_payer_note` is not valid UTF8." + ] + }, + "warning_missing_invoice_paths": { + "type": "string", + "description": [ + "`invoice_paths` is not present." + ] + }, + "warning_missing_invoice_blindedpay": { + "type": "string", + "description": [ + "`invoice_blindedpay` is not present." + ] + }, + "warning_missing_invoice_created_at": { + "type": "string", + "description": [ + "`invoice_created_at` is not present." + ] + }, + "warning_missing_invoice_payment_hash": { + "type": "string", + "description": [ + "`invoice_payment_hash` is not present." + ] + }, + "warning_missing_invoice_amount": { + "type": "string", + "description": [ + "`invoice_amount` is not present." + ] + }, + "warning_missing_invoice_recurrence_basetime": { + "type": "string", + "description": [ + "`invoice_recurrence_basetime` is not present." + ] + }, + "warning_missing_invoice_node_id": { + "type": "string", + "description": [ + "`invoice_node_id` is not present." + ] + }, + "warning_missing_invoice_signature": { + "type": "string", + "description": [ + "`signature` is not present." + ] + }, + "warning_invalid_invoice_signature": { + "type": "string", + "description": [ + "Incorrect `signature`." + ] + }, + "fallbacks": { + "type": "array", + "items": { + "type": "object", + "required": [ + "version", + "hex" + ], + "properties": { + "version": {}, + "hex": {}, + "address": {}, + "warning_invoice_fallbacks_version_invalid": { + "type": "string", + "description": [ + "`version` is > 16." + ] + } + } + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt11 invoice" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "required": [ + "currency", + "created_at", + "expiry", + "payee", + "min_final_cltv_expiry", + "payment_hash", + "signature" + ], + "additionalProperties": false, + "properties": { + "type": {}, + "valid": {}, + "currency": { + "type": "string", + "description": [ + "The BIP173 name for the currency." + ] + }, + "created_at": { + "type": "u64", + "description": [ + "The UNIX-style timestamp of the invoice." + ] + }, + "expiry": { + "type": "u64", + "description": [ + "The number of seconds this is valid after `created_at`." + ] + }, + "payee": { + "type": "pubkey", + "description": [ + "The public key of the recipient." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount the invoice asked for." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage*." + ] + }, + "signature": { + "type": "signature", + "description": [ + "Signature of the *payee* on this invoice." + ] + }, + "description": { + "type": "string", + "description": [ + "The description of the purpose of the purchase." + ] + }, + "description_hash": { + "type": "hash", + "description": [ + "The hash of the description, in place of *description*." + ] + }, + "min_final_cltv_expiry": { + "type": "u32", + "description": [ + "The minimum CLTV delay for the final node." + ] + }, + "payment_secret": { + "type": "secret", + "description": [ + "The secret to hand to the payee node." + ] + }, + "features": { + "type": "hex", + "description": [ + "The features bitmap for this invoice." + ] + }, + "payment_metadata": { + "type": "hex", + "description": [ + "The payment_metadata to put in the payment." + ] + }, + "fallbacks": { + "type": "array", + "description": [ + "Onchain addresses." + ], + "items": { + "type": "object", + "required": [ + "type", + "hex" + ], + "additionalProperties": false, + "properties": { + "type": { + "type": "string", + "description": [ + "The address type (if known)." + ], + "enum": [ + "P2PKH", + "P2SH", + "P2WPKH", + "P2WSH", + "P2TR" + ] + }, + "addr": { + "type": "string", + "description": [ + "The address in appropriate format for *type*." + ] + }, + "hex": { + "type": "hex", + "description": [ + "Raw encoded address." + ] + } + } + } + }, + "routes": { + "type": "array", + "description": [ + "Route hints to the *payee*." + ], + "items": { + "type": "array", + "description": [ + "Hops in the route." + ], + "items": { + "type": "object", + "required": [ + "pubkey", + "short_channel_id", + "fee_base_msat", + "fee_proportional_millionths", + "cltv_expiry_delta" + ], + "additionalProperties": false, + "properties": { + "pubkey": { + "type": "pubkey", + "description": [ + "The public key of the node." + ] + }, + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "A channel to the next peer." + ] + }, + "fee_base_msat": { + "type": "msat", + "description": [ + "The base fee for payments." + ] + }, + "fee_proportional_millionths": { + "type": "u32", + "description": [ + "The parts-per-million fee for payments." + ] + }, + "cltv_expiry_delta": { + "type": "u32", + "description": [ + "The CLTV delta across this hop." + ] + } + } + } + } + }, + "extra": { + "type": "array", + "description": [ + "Any extra fields we didn't know how to parse." + ], + "items": { + "type": "object", + "required": [ + "tag", + "data" + ], + "additionalProperties": false, + "properties": { + "tag": { + "type": "string", + "description": [ + "The bech32 letter which identifies this field." + ], + "maxLength": 1, + "minLength": 1 + }, + "data": { + "type": "string", + "description": [ + "The bech32 data for this field." + ] + } + } + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "rune" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "required": [ + "string", + "restrictions", + "valid" + ], + "additionalProperties": false, + "properties": { + "unique_id": { + "type": "string", + "description": [ + "Unique id (always a numeric id on runes we create)." + ] + }, + "version": { + "type": "string", + "description": [ + "Rune version, not currently set on runes we create." + ] + }, + "valid": { + "type": "boolean", + "enum": [ + true + ] + }, + "type": {}, + "string": { + "type": "string", + "description": [ + "The string encoding of the rune." + ] + }, + "restrictions": { + "type": "array", + "description": [ + "Restrictions built into the rune: all must pass." + ], + "items": { + "type": "object", + "required": [ + "alternatives", + "summary" + ], + "additionalProperties": false, + "properties": { + "alternatives": { + "type": "array", + "description": [ + "Each way restriction can be met: any can pass." + ], + "items": { + "type": "string", + "description": [ + "The alternative of form fieldname condition fieldname." + ] + } + }, + "summary": { + "type": "string", + "description": [ + "Human-readable summary of this restriction." + ] + } + } + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "rune" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + false + ] + } + } + }, + "then": { + "required": [ + "valid" + ], + "additionalProperties": false, + "properties": { + "valid": { + "type": "boolean", + "enum": [ + false + ] + }, + "type": {}, + "warning_rune_invalid_utf8": { + "type": "string", + "description": [ + "The rune contains invalid UTF-8 strings." + ] + }, + "hex": { + "type": "hex", + "description": [ + "The raw rune in hex." + ] + } + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "emergency recover" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "required": [ + "decrypted" + ], + "additionalProperties": false, + "properties": { + "type": {}, + "valid": {}, + "decrypted": { + "type": "hex", + "description": [ + "The decrypted value of the provided bech32 of emergency.recover." + ], + "added": "v23.11" + } + } + } + } + ] + }, + "example_json_request": [ + { + "id": "example:decode#1", + "method": "decode", + "params": [ + "zm0x_eLgHexaTvZn3Cz7gb_YlvrlYGDo_w4BYlR9SS09MSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl" + ] + }, + { + "id": "example:decode#2", + "method": "decode", + "params": [ + "lnbcrt1m1pja0f2hsp5xyssdvdsu24dmmesrt6x84wfrm4mscsnzq7hl2suzeu90wy6g53qpp5zyyu3anwfsfl64pewe0tg7j28map2wwnhvaam5nt70rlwxa0cegqdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqgqqqqqqqlgqqqq86qqqc9qxpqysgq7u4f99u4kepagme27t5c3gdl7czlnjaw7kxryxgm87w2j02j3g94r2vrukhpgedhcdkcdec27m7jrl2lvcr6uh3rdv9lgpz0vc0zcfcqnugjdw" + ] + } + ], + "example_json_response": [ + { + "type": "rune", + "unique_id": "1", + "string": "ce6d31fde2e01dec5a4ef667dc2cfb81bfd896fae56060e8ff0e0162547d492d:=1&method^list|method^get|method=summary&method/listdatastore", + "restrictions": [ + { + "alternatives": [ + "method^list", + "method^get", + "method=summary" + ], + "summary": "method (of command) starts with 'list' OR method (of command) starts with 'get' OR method (of command) equal to 'summary'" + }, + { + "alternatives": [ + "method/listdatastore" + ], + "summary": "method (of command) unequal to 'listdatastore'" + } + ], + "valid": true + }, + { + "type": "bolt11 invoice", + "currency": "bcrt", + "created_at": 1708631383, + "expiry": 604800, + "payee": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount_msat": 100000000, + "description": "description", + "min_final_cltv_expiry": 5, + "payment_secret": "312106b1b0e2aaddef301af463d5c91eebb86213103d7faa1c167857b89a4522", + "features": "02024100", + "routes": [ + [ + { + "pubkey": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "short_channel_id": "103x1x0", + "fee_base_msat": 1000, + "fee_proportional_millionths": 1000, + "cltv_expiry_delta": 6 + } + ] + ], + "payment_hash": "1109c8f66e4c13fd5439765eb47a4a3efa1539d3bb3bddd26bf3c7f71bafc650", + "signature": "3045022100f72a929795b643d46f2af2e988a1bff605f9cbaef58c32191b3f9ca93d528a0b022051a983e5ae1465b7c36d86e70af6fd21fd5f6607ae5e236b0bf4044f661e2c27", + "valid": true + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-pay(7)", + "lightning-offer(7)", + "lightning-fetchinvoice(7)", + "lightning-sendinvoice(7)", + "lightning-commando-rune(7)" + ], + "resources": [ + "[BOLT #11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md)", + "", + "[BOLT #12](https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md)", + "(experimental, [bolt](https://github.com/lightning/bolts) #798)", + "", + "Main web site: " + ] + }, + "lightning-decodepay.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.05", + "rpc": "decodepay", + "title": "Command for decoding a bolt11 string (low-level)", + "description": [ + "The **decodepay** RPC command checks and parses a *bolt11* string as specified by the BOLT 11 specification." + ], + "request": { + "required": [ + "bolt11" + ], + "properties": { + "bolt11": { + "type": "string", + "description": [ + "Bolt11 invoice to decode." + ] + }, + "description": { + "type": "string", + "description": [ + "Description of the invoice to decode." + ] + } + } + }, + "response": { + "required": [ + "currency", + "created_at", + "expiry", + "payee", + "min_final_cltv_expiry", + "payment_hash", + "signature" + ], + "properties": { + "currency": { + "type": "string", + "description": [ + "The BIP173 name for the currency." + ] + }, + "created_at": { + "type": "u64", + "description": [ + "The UNIX-style timestamp of the invoice." + ] + }, + "expiry": { + "type": "u64", + "description": [ + "The number of seconds this is valid after *timestamp*." + ] + }, + "payee": { + "type": "pubkey", + "description": [ + "The public key of the recipient." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount the invoice asked for." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage*." + ] + }, + "signature": { + "type": "signature", + "description": [ + "Signature of the *payee* on this invoice." + ] + }, + "description": { + "type": "string", + "description": [ + "The description of the purpose of the purchase." + ] + }, + "description_hash": { + "type": "hash", + "description": [ + "The hash of the description, in place of *description*." + ] + }, + "min_final_cltv_expiry": { + "type": "u32", + "description": [ + "The minimum CLTV delay for the final node." + ] + }, + "payment_secret": { + "type": "hash", + "description": [ + "The secret to hand to the payee node." + ] + }, + "features": { + "type": "hex", + "description": [ + "The features bitmap for this invoice." + ] + }, + "payment_metadata": { + "type": "hex", + "description": [ + "The payment_metadata to put in the payment." + ] + }, + "fallbacks": { + "type": "array", + "description": [ + "Onchain addresses." + ], + "items": { + "type": "object", + "required": [ + "type", + "hex" + ], + "additionalProperties": false, + "properties": { + "type": { + "type": "string", + "description": [ + "The address type (if known)." + ], + "enum": [ + "P2PKH", + "P2SH", + "P2WPKH", + "P2WSH", + "P2TR" + ] + }, + "addr": { + "type": "string", + "description": [ + "The address in appropriate format for *type*." + ] + }, + "hex": { + "type": "hex", + "description": [ + "Raw encoded address." + ] + } + } + } + }, + "routes": { + "type": "array", + "description": [ + "Route hints to the *payee*." + ], + "items": { + "type": "array", + "description": [ + "Hops in the route." + ], + "items": { + "type": "object", + "required": [ + "pubkey", + "short_channel_id", + "fee_base_msat", + "fee_proportional_millionths", + "cltv_expiry_delta" + ], + "additionalProperties": false, + "properties": { + "pubkey": { + "type": "pubkey", + "description": [ + "The public key of the node." + ] + }, + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "A channel to the next peer." + ] + }, + "fee_base_msat": { + "type": "msat", + "description": [ + "The base fee for payments." + ] + }, + "fee_proportional_millionths": { + "type": "u32", + "description": [ + "The parts-per-million fee for payments." + ] + }, + "cltv_expiry_delta": { + "type": "u32", + "description": [ + "The CLTV delta across this hop." + ] + } + } + } + } + }, + "extra": { + "type": "array", + "description": [ + "Any extra fields we didn't know how to parse." + ], + "items": { + "type": "object", + "required": [ + "tag", + "data" + ], + "additionalProperties": false, + "properties": { + "tag": { + "type": "string", + "description": [ + "The bech32 letter which identifies this field." + ], + "maxLength": 1, + "minLength": 1 + }, + "data": { + "type": "string", + "description": [ + "The bech32 data for this field." + ] + } + } + } + } + }, + "post_return_value_notes": [ + "Technically, the *description* field is optional if a *description_hash* field is given, but in this case **decodepay** will only succeed if the optional *description* field is passed and matches the *description_hash*. In practice, these are currently unused." + ] + }, + "example_json_request": [ + { + "id": "example:decodepay#1", + "method": "decodepay", + "params": { + "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk", + "description": null + } + } + ], + "example_json_response": [ + { + "currency": "bcrt", + "created_at": 1706152930, + "expiry": 604800, + "payee": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount_msat": 11000000, + "description": [ + "XEoCR94SIz6UIRUEkxum." + ], + "min_final_cltv_expiry": 5, + "payment_secret": "82644944d3f70d42aad1d5f7b5d7a629e7afa30b529cc952a4c59fc0e3790ea2", + "features": "02024100", + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "signature": "3045022100e3b7d8886eae1a7c9e55e1797aa0dcb77b8c5a19d56c657cad030e360c90682802203a35713acb098245e53a37faeac98754a29a7078db5ed6f2166f917e55b94484" + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-pay(7)", + "lightning-getroute(7)", + "lightning-sendpay(7)" + ], + "resources": [ + "[BOLT #11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md)", + "", + "Main web site: " + ] + }, + "lightning-deldatastore.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "deldatastore", + "title": "Command for removing (plugin) data", + "description": [ + "The **deldatastore** RPC command allows plugins to delete data it has stored in the Core Lightning database.", + "", + "The command fails if the *key* isn't present, or if *generation* is specified and the generation of the data does not exactly match." + ], + "request": { + "required": [ + "key" + ], + "properties": { + "key": { + "oneOf": [ + { + "type": "array", + "description": [ + "Key is an array of values (though a single value is treated as a one-element array), to form a heirarchy. Using the first element of the key as the plugin name (e.g. [ 'summary' ]) is recommended. A key can either have children or a value, never both: parents are created and removed automatically." + ], + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] + }, + "generation": { + "type": "u64", + "description": [ + "If specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with mode `must-replace` or `must-append`." + ] + } + } + }, + "response": { + "required": [ + "key" + ], + "properties": { + "key": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Part of the key added to the datastore." + ] + } + }, + "generation": { + "type": "u64", + "description": [ + "The number of times this has been updated." + ] + }, + "hex": { + "type": "hex", + "description": [ + "The hex data which has removed from the datastore." + ] + }, + "string": { + "type": "string", + "description": [ + "The data as a string, if it's valid utf-8." + ] + } + } + }, + "errors": [ + "The following error codes may occur:", + "", + "- 1200: the key does not exist", + "- 1201: the key does exist, but the generation is wrong", + "- -32602: invalid parameters" + ], + "example_json_request": [ + { + "id": "example:deldatastore#1", + "method": "deldatastore", + "params": { + "key": "otherkey", + "generation": 1 + } + }, + { + "id": "example:deldatastore#2", + "method": "deldatastore", + "params": { + "key": [ + "a" + ], + "generation": null + } + } + ], + "example_json_response": [ + { + "key": [ + "otherkey" + ], + "generation": 1, + "hex": "6f746865726461746161", + "string": "otherdataa" + }, + { + "key": [ + "a" + ], + "generation": 0, + "hex": "6176616c", + "string": "aval" + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listdatastore(7)", + "lightning-datastore(7)", + "lightning-datastoreusage(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-delexpiredinvoice.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "delexpiredinvoice", + "title": "Command for removing expired invoices", + "description": [ + "The **delexpiredinvoice** RPC command removes all invoices that have expired on or before the given *maxexpirytime*." + ], + "request": { + "required": [], + "properties": { + "maxexpirytime": { + "type": "u64", + "description": [ + "Invoice expiry time in seconds. If not specified then all expired invoices are deleted." + ] + } + } + }, + "response": { + "required": [], + "properties": {} + }, + "example_json_request": [ + { + "id": "example:delexpiredinvoice#1", + "method": "delexpiredinvoice", + "params": { + "maxexpirytime": null + } + } + ], + "example_json_response": [ + {} + ], + "author": [ + "ZmnSCPxj <> is mainly responsible." + ], + "see_also": [ + "lightning-delinvoice(7)", + "lightning-autoclean-status(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-delforward.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "delforward", + "title": "Command for removing a forwarding entry", + "description": [ + "The **delforward** RPC command removes a single forward from **listforwards**, using the uniquely-identifying *in_channel* and *in_htlc_id* (and, as a sanity check, the *status*) given by that command.", + "", + "This command is mainly used by the *autoclean* plugin (see lightningd- config(7)), As these database entries are only kept for your own analysis, removing them has no effect on the running of your node." + ], + "request": { + "required": [ + "in_channel", + "in_htlc_id", + "status" + ], + "properties": { + "in_channel": { + "type": "short_channel_id", + "description": [ + "Only the matching forwards on the given inbound channel are deleted. Note: for **listforwards** entries without an *in_htlc_id* entry (no longer created in v22.11, but can exist from older versions), a value of 18446744073709551615 can be used, but then it will delete *all* entries without *in_htlc_id* for this *in_channel* and *status*." + ] + }, + "in_htlc_id": { + "type": "u64", + "description": [ + "The unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11)." + ] + }, + "status": { + "type": "string", + "description": [ + "The status of the forward to delete. You cannot delete forwards which have status *offered* (i.e. are currently active)." + ], + "enum": [ + "settled", + "local_failed", + "failed" + ] + } + } + }, + "response": { + "required": [], + "properties": {} + }, + "errors": [ + "The following errors may be reported:", + "", + "- 1401: The forward specified does not exist." + ], + "example_json_request": [ + { + "id": "example:delforward#1", + "method": "delforward", + "params": { + "in_channel": "103x1x0", + "in_htlc_id": 2, + "status": "local_failed" + } + }, + { + "id": "example:delforward#2", + "method": "delforward", + "params": [ + "103x1x0", + 1, + "failed" + ] + } + ], + "example_json_response": [ + {}, + {} + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-autoclean(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-delinvoice.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "delinvoice", + "title": "Command for removing an invoice (or just its description)", + "description": [ + "The **delinvoice** RPC command removes an invoice with *status* as given in **listinvoices**, or with *desconly* set, removes its description." + ], + "request": { + "required": [ + "label", + "status" + ], + "properties": { + "label": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "u64" + } + ], + "description": [ + "Label of the invoice to be deleted." + ] + }, + "status": { + "type": "string", + "description": [ + "Label of the invoice to be deleted. The caller should be particularly aware of the error case caused by the *status* changing just before this command is invoked!" + ], + "enum": [ + "paid", + "expired", + "unpaid" + ] + }, + "desconly": { + "type": "boolean", + "description": [ + "If set to True, the invoice is not deleted, but has its description removed (this can save space with very large descriptions, as would be used with lightning-invoice(7) *deschashonly*." + ] + } + } + }, + "response": { + "required": [ + "label", + "payment_hash", + "status", + "created_index", + "expires_at" + ], + "properties": { + "label": { + "type": "string", + "description": [ + "Unique label given at creation time." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "BOLT11 string." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "BOLT12 string." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount required to pay this invoice." + ] + }, + "description": { + "type": "string", + "description": [ + "Description used in the invoice." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "created_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was created in." + ] + }, + "updated_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was changed (only present if it has changed since creation)." + ] + }, + "status": { + "type": "string", + "description": [ + "State of invoice." + ], + "enum": [ + "paid", + "expired", + "unpaid" + ] + }, + "expires_at": { + "type": "u64", + "description": [ + "UNIX timestamp when invoice expires (or expired)." + ] + } + }, + "allOf": [ + { + "if": { + "required": [ + "bolt12" + ] + }, + "then": { + "required": [], + "additionalProperties": false, + "properties": { + "label": {}, + "bolt12": {}, + "status": {}, + "expires_at": {}, + "msatoshi": {}, + "amount_msat": {}, + "description": {}, + "payment_hash": {}, + "pay_index": {}, + "created_index": {}, + "updated_index": {}, + "amount_received_msat": {}, + "paid_at": {}, + "payment_preimage": {}, + "local_offer_id": { + "type": "hex", + "description": [ + "Offer for which this invoice was created." + ] + }, + "invreq_payer_note": { + "type": "string", + "description": [ + "The optional *invreq_payer_note* from invoice_request which created this invoice." + ] + } + } + }, + "else": { + "required": [ + "bolt11" + ], + "additionalProperties": false, + "properties": { + "label": {}, + "bolt11": {}, + "status": {}, + "expires_at": {}, + "msatoshi": {}, + "amount_msat": {}, + "description": {}, + "payment_hash": {}, + "pay_index": {}, + "created_index": {}, + "updated_index": {}, + "amount_received_msat": {}, + "msatoshi_received": {}, + "paid_at": {}, + "payment_preimage": {} + } + } + }, + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "paid" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "pay_index", + "amount_received_msat", + "paid_at", + "payment_preimage" + ], + "properties": { + "label": {}, + "bolt11": {}, + "bolt12": {}, + "status": {}, + "expires_at": {}, + "msatoshi": {}, + "amount_msat": {}, + "description": {}, + "payment_hash": {}, + "invreq_payer_note": {}, + "local_offer_id": {}, + "created_index": {}, + "updated_index": {}, + "pay_index": { + "type": "u64", + "description": [ + "Unique index for this invoice payment." + ] + }, + "amount_received_msat": { + "type": "msat", + "description": [ + "How much was actually received." + ] + }, + "paid_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when payment was received." + ] + }, + "payment_preimage": { + "type": "secret", + "description": [ + "SHA256 of this is the *payment_hash* offered in the invoice." + ] + } + } + }, + "else": { + "additionalProperties": false, + "properties": { + "label": {}, + "bolt11": {}, + "bolt12": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "description": {}, + "payment_hash": {}, + "expires_at": {}, + "created_index": {}, + "updated_index": {}, + "pay_index": {}, + "invreq_payer_note": {}, + "local_offer_id": {} + } + } + } + ], + "pre_return_value_notes": [ + "Note: The return is the same as an object from lightning-listinvoice(7)." + ] + }, + "errors": [ + "The following errors may be reported:", + "", + "- -1: Database error.", + "- 905: An invoice with that label does not exist.", + "- 906: The invoice *status* does not match the parameter. An error object will be returned as error *data*, containing *current_status* and *expected_status* fields. This is most likely due to the *status* of the invoice changing just before this command is invoked.", + "- 908: The invoice already has no description, and *desconly* was set." + ], + "example_json_request": [ + { + "id": "example:delinvoice#1", + "method": "delinvoice", + "params": { + "label": "invlabel2", + "status": "unpaid", + "desconly": true + } + }, + { + "id": "example:delinvoice#2", + "method": "delinvoice", + "params": { + "label": "keysend-1708640419.666098582", + "status": "paid", + "desconly": null + } + } + ], + "example_json_response": [ + { + "label": "invlabel2", + "bolt11": "lnbcrt420p1pja0tefsp5vvzg40t4g24l0eqk0jch7mc6jm3ec52ts8w8gwzpwtx9c8nv05rspp533e9csxurt7j9sn2cx7hsn6m00475qgrau8sux5r7djpdedwy2fshp5xqsmrtgfcwsnhxcxmf3tuc65kl6fxvqhvujfmxw2kpeh95yy2x8sxqyjw5qcqp99qxpqysgqgfjrz4q5zcq2lluxxg9h475mq2d3w0tpdstm5274zmhadjl8cqapylfskzk96apka5599a2flm90rmavsk7q8mhh87yle3sgh5vrlycq72fern", + "payment_hash": "8c725c40dc1afd22c26ac1bd784f5b7bebea0103ef0f0e1a83f36416e5ae2293", + "amount_msat": 42, + "status": "unpaid", + "expires_at": 1709238697, + "created_index": 3 + }, + { + "label": "keysend-1708640419.666098582", + "bolt11": "lnbcrt1pja0j9rsp5tg3zvj846gcdzw394njazq40s946sq2ur3hkl4xu4xudtjdtckxspp5fuunrfzsnyz2uxjmg2n95mqhghv4fpvv2kud3kvq4fkys3vmzu5sdqvddjhjum9dejqxqyjw5qcqp99qxpqysgqwt7r0gjlgt7zrfldc3um9myfc36acpqnsdn77c2m42facjtps30yufc5nsmwzhgexlj59f6xa5hess6e3tqrxynt9fejzj3rrshddtcqnappmj", + "payment_hash": "4f3931a4509904ae1a5b42a65a6c1745d954858c55b8d8d980aa6c48459b1729", + "status": "paid", + "pay_index": 1, + "amount_received_msat": 10000000, + "paid_at": 1708640419, + "payment_preimage": "b760af47f456a217e8dfda21a282f1f78c903487c1b21b3b318135f75aa3bf11", + "description": "keysend", + "expires_at": 1709245219, + "created_index": 1, + "updated_index": 1 + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listinvoice(7)", + "lightning-waitinvoice(7)", + "lightning-invoice(7)", + "lightning-delexpiredinvoice(7)", + "lightning-autoclean-status(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-delpay.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "delpay", + "title": "Command for removing a completed or failed payment", + "description": [ + "The **delpay** RPC command deletes a payment with the given `payment_hash` if its status is either `complete` or `failed`. If *partid* and *groupid* are not specified, all payment parts with matchin status are deleted." + ], + "request": { + "required": [ + "payment_hash", + "status" + ], + "properties": { + "payment_hash": { + "type": "hash", + "description": [ + "The unique identifier of a payment." + ] + }, + "status": { + "type": "string", + "description": [ + "Expected status of the payment. Only deletes if the payment status matches. Deleting a `pending` payment will return an error." + ], + "enum": [ + "complete", + "failed" + ] + }, + "partid": { + "type": "u64", + "description": [ + "Specific partid to delete (must be paired with *groupid*)." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Specific groupid to delete (must be paired with *partid*)." + ] + } + }, + "pairedWith": [ + [ + "partid", + "groupid" + ] + ] + }, + "response": { + "required": [ + "payments" + ], + "properties": { + "payments": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "created_index", + "id", + "payment_hash", + "status", + "amount_sent_msat", + "created_at" + ], + "properties": { + "created_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was created in." + ] + }, + "id": { + "type": "u64", + "description": [ + "Old synonym for created_index." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "pending", + "failed", + "complete" + ], + "description": [ + "Status of the payment." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "The amount we actually sent, including fees." + ] + }, + "partid": { + "type": "u64", + "description": [ + "Unique ID within this (multi-part) payment." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment if known." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount the destination received, if known." + ] + }, + "created_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "updated_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was changed (only present if it has changed since creation)." + ] + }, + "completed_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was completed." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." + ] + }, + "payment_preimage": { + "type": "secret", + "description": [ + "Proof of payment." + ] + }, + "label": { + "type": "string", + "description": [ + "The label, if given to sendpay." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string (if pay supplied one)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string (if supplied for pay: **experimental-offers** only)." + ] + }, + "erroronion": { + "type": "hex", + "description": [ + "The error onion returned on failure, if any." + ] + } + } + } + } + }, + "pre_return_value_notes": [ + "The returned format is the same as lightning-listsendpays(7). If the payment is a multi-part payment (MPP) the command return a list of payments will be returned -- one payment object for each partid." + ] + }, + "example_json_request": [ + { + "id": "example:delpay#1", + "method": "delpay", + "params": { + "payment_hash": "4fa2f1b001067ec06d7f95b8695b8acd9ef04c1b4d1110e3b94e1fa0687bb1e0", + "status": "complete" + } + }, + { + "id": "example:delpay#2", + "method": "delpay", + "params": [ + "c9d4547473d0d646f1fdd8ca7f01803e4d31ceab01df33c79456f9c24b04034e", + "failed" + ] + }, + { + "id": "example:delpay#3", + "method": "delpay", + "params": { + "payment_hash": "bbc35e0a46d1483292a4ff8d4daaceaab8c3c084dd835be4128785b52e469c64", + "status": "complete", + "groupid": 1, + "partid": 1 + } + } + ], + "example_json_response": [ + { + "payments": [ + { + "id": 1, + "payment_hash": "8dfd6538eeb33811c9114a75f792a143728d7f05643f38c3d574d3097e8910c0", + "destination": "0219f8900ee78a89f050c24d8b69492954f9fdbabed753710845eb75d3a75a5880", + "msatoshi": 1000, + "amount_msat": "1000msat", + "msatoshi_sent": 1000, + "amount_sent_msat": "1000msat", + "created_at": 1596224858, + "status": "complete", + "payment_preimage": "35bd4e2b481a1a84a22215b5372672cf81460a671816960ddb206464359e1822", + "bolt11": "lntb10n1p0jga20pp53h7k2w8wkvuprjg3ff6l0y4pgdeg6lc9vsln3s74wnfsjl5fzrqqdqdw3jhxazldahx2xqyjw5qcqp2sp5wut5jnhr6n7jd5747ky2g5flmw7hgx9yjnqzu60ps2jf6f7tc0us9qy9qsqu2a0k37nckl62005p69xavlkydkvhnypk4dphffy4x09zltwh9437ad7xkl83tefdarzhu5t30ju5s56wlrg97qkx404pq3srfc425cq3ke9af" + } + ] + }, + { + "payments": [ + { + "created_index": 2, + "id": 2, + "payment_hash": "c9d4547473d0d646f1fdd8ca7f01803e4d31ceab01df33c79456f9c24b04034e", + "groupid": 1, + "updated_index": 2, + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount_msat": 100000, + "amount_sent_msat": 100002, + "created_at": 1706316468, + "completed_at": 1706316471, + "status": "failed", + "bolt11": "lnbcrt1u1pjmg54nsp5ke626txv6wwwmqmpuy63t3jnu9hqxwj880zsfkkj7jjqagdaz2sqpp5e829garn6rtydu0amr987qvq8exnrn4tq80n83u52muuyjcyqd8qdq8v3jhxccxqyjw5qcqp99qxpqysgqalktfwy9svsamvvvrzzzzpdaa4rh7n6s5p7t9lx7qv0raz4vnm9knkh5ury3u5cmnhx2gms98nxkclm3833uhjrlnzmftc685vz2f0gpfnjy4y" + } + ] + }, + { + "payments": [ + { + "created_index": 3, + "id": 3, + "payment_hash": "bbc35e0a46d1483292a4ff8d4daaceaab8c3c084dd835be4128785b52e469c64", + "groupid": 1, + "updated_index": 3, + "partid": 1, + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount_msat": 100000, + "amount_sent_msat": 102100, + "created_at": 1708641193, + "completed_at": 1708641194, + "status": "complete", + "payment_preimage": "a6ebb1cfbf69e76200f196f1eafd28a3d850633499c223a7eb7a7dba3b995286" + } + ] + } + ], + "errors": [ + "On failure, an error is returned. If the lightning process fails before responding, the", + "caller should use lightning-listsentpays(7) or lightning-listpays(7) to query whether this payment was deleted or not.", + "", + "The following error codes may occur:", + "", + "- -32602: Parameter missed or malformed;", + "- 211: Payment status mismatch. Check the correct status via **paystatus**;", + "- 208: Payment with payment_hash not found." + ], + "author": [ + "Vincenzo Palazzo <> is mainly responsible." + ], + "see_also": [ + "lightning-listpays(7)", + "lightning-listsendpays(7)", + "lightning-paystatus(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-deprecations.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v24.02", + "rpc": "deprecations", + "title": "Command to enable/disable deprecated APIs", + "description": [ + "The **deprecations** RPC command is used to override global config option `allow-deprecated-apis` for further RPC commands on this same connection. This can be useful for developer testing to ensure you don't accidentally rely on deprecated features." + ], + "request": { + "required": [ + "enable" + ], + "properties": { + "enable": { + "type": "boolean", + "description": [ + "Flag to enable or disable deprecated APIs. Setting it to `false` will neither accept deprecated parameters or commands, nor output deprecated fields." + ] + } + } + }, + "response": { + "properties": {} + }, + "example_json_request": [ + { + "id": "example:deprecations#1", + "method": "deprecations", + "params": { + "enable": false + } + } + ], + "example_json_response": [ + {} + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters." + ], + "author": [ + "Rusty Russell <> wrote the initial version of this man page." + ], + "see_also": [ + "lightningd-config(5)", + "lightning-notifications(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-disableinvoicerequest.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v22.11", + "rpc": "disableinvoicerequest", + "title": "Command for removing an invoice request", + "warning": "experimental-offers only", + "description": [ + "The **disableinvoicerequest** RPC command disables an invoice_request, so that no further invoices will be accepted (and thus, no further payments made)..", + "", + "We currently don't support deletion of invoice_requests, so they are not forgotten entirely (there may be payments which refer to this invoice_request)." + ], + "request": { + "required": [ + "invreq_id" + ], + "properties": { + "invreq_id": { + "type": "string", + "description": [ + "A specific invoice can be disabled by providing the `invreq_id`, which is presented by lightning-invoicerequest(7)." + ] + } + } + }, + "response": { + "required": [ + "invreq_id", + "single_use", + "active", + "bolt12", + "used" + ], + "properties": { + "invreq_id": { + "type": "hash", + "description": [ + "The SHA256 hash of all invoice_request fields less than 160." + ] + }, + "active": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "Whether the invoice_request is currently active." + ] + }, + "single_use": { + "type": "boolean", + "description": [ + "Whether the invoice_request will become inactive after we pay an invoice for it." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string starting with lnr." + ] + }, + "used": { + "type": "boolean", + "description": [ + "Whether the invoice_request has already been used." + ] + }, + "label": { + "type": "string", + "description": [ + "The label provided when creating the invoice_request." + ] + } + }, + "pre_return_value_notes": [ + "Note: the returned object is the same format as **listinvoicerequest**." + ] + }, + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-invoicerequest(7)", + "lightning-listinvoicerequest(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-disableoffer.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "disableoffer", + "title": "Command for removing an offer", + "warning": "experimental-offers only", + "description": [ + "The **disableoffer** RPC command disables an offer, so that no further invoices will be given out.", + "", + "We currently don't support deletion of offers, so offers are not forgotten entirely (there may be invoices which refer to this offer)." + ], + "request": { + "required": [ + "offer_id" + ], + "properties": { + "offer_id": { + "type": "hash", + "description": [ + "The id we use to identify this offer." + ] + } + } + }, + "response": { + "required": [ + "offer_id", + "active", + "single_use", + "bolt12", + "used" + ], + "properties": { + "offer_id": { + "type": "hash", + "description": [ + "The merkle hash of the offer." + ] + }, + "active": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "Whether the offer can produce invoices/payments." + ] + }, + "single_use": { + "type": "boolean", + "description": [ + "Whether the offer is disabled after first successful use." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string representing this offer." + ] + }, + "used": { + "type": "boolean", + "description": [ + "Whether the offer has had an invoice paid / payment made." + ] + }, + "label": { + "type": "string", + "description": [ + "The label provided when offer was created." + ] + } + }, + "pre_return_value_notes": [ + "Note: the returned object is the same format as **listoffers**." + ] + }, + "example_json_request": [ + { + "id": "example:disableoffer#1", + "method": "disableoffer", + "params": { + "offer_id": "713a16ccd4eb10438bdcfbc2c8276be301020dd9d489c530773ba64f3b33307d" + } + } + ], + "example_json_response": [ + { + "offer_id": "053a5c566fbea2681a5ff9c05a913da23e45b95d09ef5bd25d7d408f23da7084", + "active": false, + "single_use": false, + "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqvqcdgq2z9pk7enxv4jjqen0wgs8yatnw3ujz83qkc6rvp4j28rt3dtrn32zkvdy7efhnlrpr5rp5geqxs783wtlj550qs8czzku4nk3pqp6m593qxgunzuqcwkmgqkmp6ty0wyvjcqdguv3pnpukedwn6cr87m89t74h3auyaeg89xkvgzpac70z3m9rn5xzu28c", + "used": false + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-offer(7)", + "lightning-listoffers(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-disconnect.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "disconnect", + "title": "Command for disconnecting from another lightning node", + "description": [ + "The disconnect RPC command closes an existing connection to a peer, identified by *id*, in the Lightning Network, as long as it doesn't have an active channel." + ], + "request": { + "required": [ + "id" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The public key of the peer to terminate the connection. It can be discovered in the output of the listpeers command, which returns a set of peers:", + "{", + " 'peers':", + " [", + " {", + " 'id': '0563aea81...',", + " 'connected': true,", + " ...", + " }", + " ]", + "}" + ] + }, + "force": { + "type": "boolean", + "description": [ + "If set to True, it will disconnect even with an active channel." + ] + } + } + }, + "response": { + "properties": {} + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error." + ], + "example_json_request": [ + { + "id": "example:disconnect#1", + "method": "disconnect", + "params": { + "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "force": false + } + }, + { + "id": "example:disconnect#2", + "method": "disconnect", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "force": true + } + } + ], + "example_json_response": [ + {}, + {} + ], + "author": [ + "Michael Hawkins <>." + ], + "see_also": [ + "lightning-connect(1)", + "lightning-listpeers(1)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-emergencyrecover.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "emergencyrecover", + "title": "Command for recovering channels from the emergency.recovery file in the lightning directory", + "description": [ + "The **emergencyrecover** RPC command fetches data from the emergency.recover file and tries to reconnect to the peer and force him to close the channel. The data in this file has enough information to reconnect and sweep the funds.", + "", + "This recovery method is not spontaneous and it depends on the peer, so it should be used as a last resort to recover the funds stored in a channel in case of severe data loss." + ], + "request": { + "required": [], + "properties": {} + }, + "response": { + "required": [ + "stubs" + ], + "properties": { + "stubs": { + "type": "array", + "items": { + "type": "hash", + "description": [ + "Channel IDs of channels successfully inserted." + ] + } + } + } + }, + "example_json_request": [ + { + "id": "example:emergencyrecover#1", + "method": "emergencyrecover", + "params": "{}" + }, + { + "id": "example:emergencyrecover#2", + "method": "emergencyrecover", + "params": "{}" + } + ], + "example_json_response": [ + { + "stubs": [] + }, + { + "stubs": [ + "c00734472f344fdadd0bf787de182e5cf144ccda5d731b0f7c75befd1f1eff52" + ] + } + ], + "author": [ + "Aditya <> is mainly responsible." + ], + "see_also": [ + "lightning-getsharedsecret(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-feerates.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "feerates", + "title": "Command for querying recommended onchain feerates", + "description": [ + "The **feerates** command returns the feerates that CLN will use. The feerates will be based on the recommended feerates from the backend. The backend may fail to provide estimates, but if it was able to provide estimates in the past, CLN will continue to use those for a while. CLN will also smoothen feerate estimations from the backend.", + "", + "Explorers often present fees in \"sat/vB\": 4 sat/vB is `4000perkb` or `1000perkw`.", + "", + "Bitcoin transactions have non-witness and witness bytes:", + "", + "* Non-witness bytes count as 4 weight, 1 virtual byte. All bytes other than SegWit witness count as non-witness bytes. * Witness bytes count as 1 weight, 0.25 virtual bytes.", + "", + "Thus, all *perkb* feerates will be exactly 4 times *perkw* feerates.", + "", + "To compute the fee for a transaction, multiply its weight or virtual bytes by the appropriate *perkw* or *perkw* feerate returned by this command, then divide by 1000.", + "", + "There is currently no way to change these feerates from the RPC. If you need custom control over onchain feerates, you will need to provide your own plugin that replaces the `bcli` plugin backend. For commands like lightning-withdraw(7) or lightning-fundchannel(7) you can provide a preferred feerate directly as a parameter, which will override the recommended feerates returned by **feerates**." + ], + "request": { + "required": [ + "style" + ], + "properties": { + "style": { + "type": "string", + "description": [ + "Fee rate style to use. This can be:", + " *perkw* - provide feerate in units of satoshis per 1000 weight (e.g. the minimum fee is usually `253perkw`).", + " *perkb* - provide feerate in units of satoshis per 1000 virtual bytes (eg. the minimum fee is usually `1000perkb`)." + ], + "enum": [ + "perkb", + "perkw" + ] + } + } + }, + "response": { + "required": [], + "properties": { + "warning_missing_feerates": { + "type": "string", + "description": [ + "Some fee estimates are missing." + ] + }, + "perkb": { + "type": "object", + "description": [ + "If *style* parameter was perkb." + ], + "additionalProperties": false, + "required": [ + "min_acceptable", + "max_acceptable", + "floor", + "estimates" + ], + "properties": { + "min_acceptable": { + "type": "u32", + "description": [ + "The smallest feerate that we allow peers to specify: half the 100-block estimate." + ] + }, + "max_acceptable": { + "type": "u32", + "description": [ + "The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet)." + ] + }, + "floor": { + "type": "u32", + "added": "v23.05", + "description": [ + "The smallest feerate that our backend tells us it will accept (i.e. minrelayfee or mempoolminfee)." + ] + }, + "estimates": { + "type": "array", + "added": "v23.05", + "description": [ + "Feerate estimates from plugin which we are using (usuallly bcli)." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "blockcount", + "feerate", + "smoothed_feerate" + ], + "properties": { + "blockcount": { + "type": "u32", + "added": "v23.05", + "description": [ + "The number of blocks the feerate is expected to get a transaction in." + ] + }, + "feerate": { + "type": "u32", + "added": "v23.05", + "description": [ + "The feerate for this estimate, in given *style*." + ] + }, + "smoothed_feerate": { + "type": "u32", + "added": "v23.05", + "description": [ + "The feerate, smoothed over time (useful for coordinating with other nodes)." + ] + } + } + } + }, + "opening": { + "type": "u32", + "description": [ + "Default feerate for lightning-fundchannel(7) and lightning-withdraw(7)." + ] + }, + "mutual_close": { + "type": "u32", + "description": [ + "Feerate to aim for in cooperative shutdown. Note that since mutual close is a **negotiation**, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer." + ] + }, + "unilateral_close": { + "type": "u32", + "description": [ + "Feerate for commitment_transaction in a live channel which we originally funded." + ] + }, + "unilateral_anchor_close": { + "type": "u32", + "added": "v23.08", + "description": [ + "Feerate for commitment_transaction in a live channel which we originally funded (if anchor_outputs was negotiated)." + ] + }, + "delayed_to_us": { + "type": "u32", + "deprecated": [ + "v23.05", + "v24.05" + ], + "description": [ + "Feerate for returning unilateral close funds to our wallet." + ] + }, + "htlc_resolution": { + "type": "u32", + "deprecated": [ + "v23.05", + "v24.05" + ], + "description": [ + "Feerate for returning unilateral close HTLC outputs to our wallet." + ] + }, + "penalty": { + "type": "u32", + "description": [ + "Feerate to use when creating penalty tx for watchtowers." + ] + } + } + }, + "perkw": { + "type": "object", + "description": [ + "If *style* parameter was perkw." + ], + "additionalProperties": false, + "required": [ + "min_acceptable", + "max_acceptable", + "floor", + "estimates" + ], + "properties": { + "min_acceptable": { + "type": "u32", + "description": [ + "The smallest feerate that you can use, usually the minimum relayed feerate of the backend." + ] + }, + "max_acceptable": { + "type": "u32", + "description": [ + "The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet)." + ] + }, + "floor": { + "type": "u32", + "added": "v23.05", + "description": [ + "The smallest feerate that our backend tells us it will accept (i.e. minrelayfee or mempoolminfee)." + ] + }, + "estimates": { + "type": "array", + "added": "v23.05", + "description": [ + "Feerate estimates from plugin which we are using (usuallly bcli)." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "blockcount", + "feerate", + "smoothed_feerate" + ], + "properties": { + "blockcount": { + "type": "u32", + "added": "v23.05", + "description": [ + "The number of blocks the feerate is expected to get a transaction in." + ] + }, + "feerate": { + "type": "u32", + "added": "v23.05", + "description": [ + "The feerate for this estimate, in given *style*." + ] + }, + "smoothed_feerate": { + "type": "u32", + "added": "v23.05", + "description": [ + "The feerate, smoothed over time (useful for coordinating with other nodes)." + ] + } + } + } + }, + "opening": { + "type": "u32", + "description": [ + "Default feerate for lightning-fundchannel(7) and lightning-withdraw(7)." + ] + }, + "mutual_close": { + "type": "u32", + "description": [ + "Feerate to aim for in cooperative shutdown. Note that since mutual close is a **negotiation**, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer." + ] + }, + "unilateral_close": { + "type": "u32", + "description": [ + "Feerate for commitment_transaction in a live channel which we originally funded (if anchor_outputs was not negotiated)." + ] + }, + "unilateral_anchor_close": { + "type": "u32", + "added": "v23.08", + "description": [ + "Feerate for commitment_transaction in a live channel which we originally funded (if anchor_outputs was negotiated)." + ] + }, + "delayed_to_us": { + "type": "u32", + "deprecated": [ + "v23.05", + "v24.05" + ], + "description": [ + "Feerate for returning unilateral close funds to our wallet." + ] + }, + "htlc_resolution": { + "type": "u32", + "deprecated": [ + "v23.05", + "v24.05" + ], + "description": [ + "Feerate for returning unilateral close HTLC outputs to our wallet." + ] + }, + "penalty": { + "type": "u32", + "description": [ + "Feerate to use when creating penalty tx for watchtowers." + ] + } + } + }, + "onchain_fee_estimates": { + "type": "object", + "additionalProperties": false, + "required": [ + "opening_channel_satoshis", + "mutual_close_satoshis", + "unilateral_close_satoshis", + "htlc_timeout_satoshis", + "htlc_success_satoshis" + ], + "properties": { + "opening_channel_satoshis": { + "type": "u64", + "description": [ + "Estimated cost of typical channel open." + ] + }, + "mutual_close_satoshis": { + "type": "u64", + "description": [ + "Estimated cost of typical channel close." + ] + }, + "unilateral_close_satoshis": { + "type": "u64", + "description": [ + "Estimated cost of typical unilateral close (without HTLCs). If anchors are supported, this assumes a channel with anchors." + ] + }, + "unilateral_close_nonanchor_satoshis": { + "added": "v23.08", + "type": "u64", + "description": [ + "Estimated cost of non-anchor typical unilateral close (without HTLCs)." + ] + }, + "htlc_timeout_satoshis": { + "type": "u64", + "description": [ + "Estimated cost of typical HTLC timeout transaction (non-anchors)." + ] + }, + "htlc_success_satoshis": { + "type": "u64", + "description": [ + "Estimated cost of typical HTLC fulfillment transaction (non-anchors)." + ] + } + } + } + } + }, + "errors": [ + "The **feerates** command will never error, however some fields may be missing in the result if feerate estimates for that kind of transaction are unavailable." + ], + "notes": [ + "Many other commands have a *feerate* parameter. This can be:", + "", + "* One of the strings to use lightningd's internal estimates:", + " * *urgent* (next 6 blocks or so)", + " * *normal* (next 12 blocks or so)", + " * *slow* (next 100 blocks or so)", + " * *minimum* for the lowest value bitcoind will currently accept (added in v23.05)", + "", + "* A number, with an optional suffix:", + " * *blocks* means aim for confirmation in that many blocks (added in v23.05)", + " * *perkw* means the number is interpreted as satoshi-per-kilosipa (weight)", + " * *perkb* means it is interpreted bitcoind-style as satoshi-per-kilobyte. ", + "", + "Omitting the suffix is equivalent to *perkb*." + ], + "trivia": [ + "In C-lightning we like to call the weight unit \"sipa\" in honor of Pieter Wuille, who uses the name \"sipa\" on IRC and elsewhere. Internally we call the *perkw* style as \"feerate per kilosipa\"." + ], + "example_json_request": [ + { + "id": "example:feerates#1", + "method": "feerates", + "params": { + "style": "perkw", + "urgent": null, + "normal": null, + "slow": null + } + }, + { + "id": "example:feerates#2", + "method": "feerates", + "params": { + "style": "perkb", + "urgent": null, + "normal": null, + "slow": null + } + } + ], + "example_json_response": [ + { + "perkw": { + "opening": 1000000, + "mutual_close": 26362, + "unilateral_close": 26362, + "unilateral_anchor_close": 1000000, + "penalty": 26362, + "min_acceptable": 3750, + "max_acceptable": 10000000, + "floor": 253, + "estimates": [ + { + "blockcount": 2, + "feerate": 1000000, + "smoothed_feerate": 26362 + }, + { + "blockcount": 6, + "feerate": 1000000, + "smoothed_feerate": 26362 + }, + { + "blockcount": 12, + "feerate": 1000000, + "smoothed_feerate": 26362 + }, + { + "blockcount": 100, + "feerate": 1000000, + "smoothed_feerate": 26362 + } + ] + }, + "onchain_fee_estimates": { + "opening_channel_satoshis": 702000, + "mutual_close_satoshis": 17741, + "unilateral_close_satoshis": 1112000, + "unilateral_close_nonanchor_satoshis": 15764, + "htlc_timeout_satoshis": 17478, + "htlc_success_satoshis": 18532 + } + }, + { + "perkb": { + "opening": 25000, + "mutual_close": 25000, + "unilateral_close": 44000, + "unilateral_anchor_close": 25000, + "penalty": 25000, + "min_acceptable": 12500, + "max_acceptable": 600000, + "floor": 1012, + "estimates": [ + { + "blockcount": 2, + "feerate": 60000, + "smoothed_feerate": 60000 + }, + { + "blockcount": 6, + "feerate": 44000, + "smoothed_feerate": 44000 + }, + { + "blockcount": 12, + "feerate": 25000, + "smoothed_feerate": 25000 + } + ] + }, + "onchain_fee_estimates": { + "opening_channel_satoshis": 4387, + "mutual_close_satoshis": 4206, + "unilateral_close_satoshis": 6578, + "unilateral_close_nonanchor_satoshis": 6578, + "htlc_timeout_satoshis": 7293, + "htlc_success_satoshis": 7733 + } + } + ], + "author": [ + "ZmnSCPxj <> wrote the initial version of this manpage." + ], + "see_also": [ + "lightning-parsefeerate(7)", + "lightning-fundchannel(7)", + "lightning-withdraw(7)", + "lightning-txprepare(7)", + "lightning-fundchannel_start(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-fetchinvoice.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "fetchinvoice", + "title": "Command for fetch an invoice for an offer", + "warning": "experimental-offers only", + "description": [ + "The **fetchinvoice** RPC command contacts the issuer of an *offer* to get an actual invoice that can be paid. It highlights any changes between the offer and the returned invoice.", + "", + "If **fetchinvoice-noconnect** is not specified in the configuation, it will connect to the destination in the (currently common!) case where it cannot find a route which supports `option_onion_messages`." + ], + "request": { + "required": [ + "offer" + ], + "properties": { + "offer": { + "type": "string", + "description": [ + "Offer string to get an actual invoice that can be paid." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Required if the offer does not specify an amount at all, otherwise it is optional (but presumably if you set it to less than the offer, you will get an error from the issuer)." + ] + }, + "quantity": { + "type": "u64", + "description": [ + "Required if the offer specifies quantity_max, otherwise it is not allowed." + ] + }, + "recurrence_counter": { + "type": "u64", + "description": [ + "Required if the offer specifies recurrence, otherwise it is not allowed. recurrence_counter should first be set to 0, and incremented for each successive invoice in a given series." + ] + }, + "recurrence_start": { + "type": "number", + "description": [ + "Required if the offer specifies recurrence_base with start_any_period set, otherwise it is not allowed. It indicates what period number to start at." + ] + }, + "recurrence_label": { + "type": "string", + "description": [ + "Required if recurrence_counter is set, and otherwise is not allowed. It must be the same as prior fetchinvoice calls for the same recurrence, as it is used to link them together." + ] + }, + "timeout": { + "type": "number", + "description": [ + "If we don't get a reply before this we fail (default, 60 seconds)." + ] + }, + "payer_note": { + "type": "string", + "description": [ + "To ask the issuer to include in the fetched invoice." + ] + } + } + }, + "response": { + "required": [ + "invoice", + "changes" + ], + "properties": { + "invoice": { + "type": "string", + "description": [ + "The BOLT12 invoice we fetched." + ] + }, + "changes": { + "type": "object", + "description": [ + "Summary of changes from offer." + ], + "additionalProperties": false, + "required": [], + "properties": { + "description_appended": { + "type": "string", + "description": [ + "Extra characters appended to the *description* field." + ] + }, + "description": { + "type": "string", + "description": [ + "A completely replaced *description* field." + ] + }, + "vendor_removed": { + "type": "string", + "description": [ + "The *vendor* from the offer, which is missing in the invoice." + ] + }, + "vendor": { + "type": "string", + "description": [ + "A completely replaced *vendor* field." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount, if different from the offer amount multiplied by any *quantity* (or the offer had no amount, or was not in BTC)." + ] + } + } + }, + "next_period": { + "type": "object", + "description": [ + "Only for recurring invoices if the next period is under the *recurrence_limit*." + ], + "additionalProperties": false, + "required": [ + "counter", + "starttime", + "endtime", + "paywindow_start", + "paywindow_end" + ], + "properties": { + "counter": { + "type": "u64", + "description": [ + "The index of the next period to fetchinvoice." + ] + }, + "starttime": { + "type": "u64", + "description": [ + "UNIX timestamp that the next period starts." + ] + }, + "endtime": { + "type": "u64", + "description": [ + "UNIX timestamp that the next period ends." + ] + }, + "paywindow_start": { + "type": "u64", + "description": [ + "UNIX timestamp of the earliest time that the next invoice can be fetched." + ] + }, + "paywindow_end": { + "type": "u64", + "description": [ + "UNIX timestamp of the latest time that the next invoice can be fetched." + ] + } + } + } + } + }, + "errors": [ + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error.", + "- 1002: Offer has expired.", + "- 1003: Cannot find a route to the node making the offer.", + "- 1004: The node making the offer returned an error message.", + "- 1005: We timed out trying to fetch an invoice." + ], + "example_json_request": [ + { + "id": "example:fetchinvoice#1", + "method": "fetchinvoice", + "params": { + "offer": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqypq5zmnd9khqmr9yp6x2um5zcssxhftzxfdlwsnfcgw2sy8t5mxa0ytcdfat2nkdwqvpy9nnsa9mzza", + "payer_note": "Thanks for the fish!" + } + }, + { + "id": "example:fetchinvoice#2", + "method": "fetchinvoice", + "params": { + "offer": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqypq5zmnd9khqmr9yp6x2um5zcssxhftzxfdlwsnfcgw2sy8t5mxa0ytcdfat2nkdwqvpy9nnsa9mzza", + "amount_msat": 3 + } + }, + { + "id": "example:fetchinvoice#3", + "method": "fetchinvoice", + "params": { + "offer": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqypq5zmnd9khqmr9yp6x2um5zsqs593pqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4j", + "quantity": 2 + } + } + ], + "example_json_response": [ + { + "invoice": "lni1qqgvcm9h7yakcmw4mzazspu8vfgpwq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqgzpg9hx6tdwpkx2gr5v4ehg93pqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky965pqqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy84sggren772kj8mau5jp86nc6fszx48rv7ep0quszyyls8rlld3sshjr94j9z5dpsku6mnypnx7u3qw35x2grxd9eksgdqnqp462c3jt0m5y6wzrj5pp6axehtez7r20265antsrqfpvuu8fwcshgr0tsv8e6829e8xmv7laz0kwhtlx6vtk8q3d6rtthdhtwvnn6j585szquc2t7us8kguxypzasg8ewkakgx2ny5ugks0f32x67sm9e5fms4asqrylajc2dqh8ag55mv5p5ghy3e2z8zwmllle8uu7jsxv5ke8d6rr5h7kthmz7ya0hxp4nt7elvw7vghcl6fgsuqqqqqqqqqqqqqqq9qqqqqqqqqqqqq8fykt06c5sqqqqqpfqyvhtunn4gyzy0lphn4wn6ctzlsajy46wscjcglf3hxcnvlaxqs3ydkhgaklsc42spq2czzq6a9vge9ha6zd8ppe2qsawnvm4u30p484d2we4cpsyskwwr5hvgthcyqyuen02ejwpa9cjjrttvp223yxsqkrwnlaszkhas84w0ape300ued4p75xu3cqtcg0cslsx9fvh7dhdqx565t6wa0alf6u2hug90j2hs", + "changes": {} + }, + { + "invoice": "lni1qqg0mfchkz0gkmn8zzu5zaxd0qvlzq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqgzpg9hx6tdwpkx2gr5v4ehg93pqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky965pqqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy84yqgrtqss8d4vgzd3286u9rk0zg9qr7a6z2xm6mjnz9pydztcn0j74tjvch0f5zvqxhftzxfdlwsnfcgw2sy8t5mxa0ytcdfat2nkdwqvpy9nnsa9mzzaqth4fzjqxxmsaxvc4v2urs6hsh6k0e564x00g68vuyp5w7yjedzxvqgr8ltzmj0n7ltxr0tz9rafn9zcy9jldjqfuf20w6gjmr7nj04d360sqvkdwprxn22dlp3xay9yq4nhrw2jm0c8t6r7japhdad6leawxyqzkg92tx8gqxp9f2d8j5k2axta0gr7yr9zrsqqqqqqqqqqqqqqq5qqqqqqqqqqqqqayjedltzjqqqqqq9yq3ja0jwj4qswt3kgs9mxq7gck66x60m5rndykpw3a7hf4ntlp9qe2vgwzzrvcwd2qypmqggrt543ryklhgf5uy89gzr46dnwhj9ux5744fmxhqxqjzeecwja3pwlqsxyjcdwur4hl4qf7nsjgg8euvy45lznufh5kydkwz6llsucuhvwp9ezeggaj3k057ge6ftvaffjkwn6j3y7faeuysrx3m2xccphu65sx", + "changes": {} + }, + { + "invoice": "lni1qqgd508mv9rpjg2ec8dr8qcslf2cjq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqgzpg9hx6tdwpkx2gr5v4ehg9qppgtzzq3dygmzpg6e53ll0aavg37gt3rvjg762vufygdqq4xprs0regcat9gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02cqsykppqfkyy6q8ry9pchxtuajh456hhcf7dxx733cx76etuv5ftfmfa2ymhgycqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jq6uhkeymz26zx7zgw4gdmw2vj9xqn4hu2sqxhp0pcgt87pf9chyfvqsywtejxjh603kx7am3zaf6d6xuumw30p8zmcdz7r95nn4lr92exk3qqe2x6xqwpdzh2zwq3vnyra8nfc6d7y6hegpkvc7p2nulj7hvhwl5hjfr23wn60mjftqspn7d4ejhrpsr5m2y8qqqqqqqqqqqqqqqpgqqqqqqqqqqqqp6f9jm7k9yqqqqqq2gpr96l9mt2pqxuyr0gqw92h0xz2y2uy5uxss4ujcac5jehj9ay2sxkapr80t5ha65qgykqssytfzxcs2xkdy0lml0tzy0jzugmyj8kjn8zfzrgq9fsgurc72x82e7pqxhl4u29cjluw5s8fwa9wtvh0qytr7vqk0vtndsz07mrrtmjw629m8mnqkjaf43kt889qeq2f7deu6t853lngpzclapt8nj0g528v9ay", + "changes": {} + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-sendinvoice(7)", + "lightning-pay(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-fundchannel.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "fundchannel", + "title": "Command for establishing a lightning channel", + "description": [ + "The **fundchannel** RPC command opens a payment channel with a peer by committing a funding transaction to the blockchain as defined in BOLT #2.", + "", + "If not already connected, **fundchannel** will automatically attempt to connect if Core Lightning knows a way to contact the node (either from normal gossip, or from a previous **connect** call).", + "", + "This auto-connection can fail if Core Lightning does not know how to contact the target node; see lightning-connect(7).", + "", + "Once the transaction is confirmed, normal channel operations may begin. Readiness is indicated by **listpeers** reporting a *state* of `CHANNELD_NORMAL` for the channel." + ], + "request": { + "required": [ + "id", + "amount" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "Id is the peer id obtained from connect." + ] + }, + "amount": { + "type": "msat_or_all", + "description": [ + "The amount in satoshis taken from the internal wallet to fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency- msat` as change). The string *all* can be used to specify all available funds (or 16777215 satoshi if more is available and large channels were not negotiated with the peer). Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The value cannot be less than the dust limit, currently set to 546, nor more than 16777215 satoshi (unless large channels were negotiated with the peer)." + ] + }, + "feerate": { + "type": "feerate", + "description": [ + "Used for the opening transaction and (unless *option_anchors_zero_fee_htlc_tx* is negotiated), as initial feerate for commitment and HTLC transactions (see NOTES in lightning-feerates(7))." + ], + "default": "*normal*" + }, + "announce": { + "type": "boolean", + "description": [ + "Whether to announce this channel or not. An unannounced channel is considered private." + ], + "default": "True" + }, + "minconf": { + "type": "u32", + "description": [ + "The minimum number of confirmations that used outputs should have." + ], + "default": "1" + }, + "push_msat": { + "type": "msat", + "description": [ + "The amount of millisatoshis to push to the channel peer at open. Note that this is a gift to the peer -- these satoshis are added to the initial balance of the peer at channel start and are largely unrecoverable once pushed." + ] + }, + "close_to": { + "type": "string", + "description": [ + "A Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. Returns `close_to` set to closing script iff is negotiated." + ] + }, + "request_amt": { + "type": "msat", + "description": [ + "An amount of liquidity you'd like to lease from the peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*." + ] + }, + "compact_lease": { + "type": "string", + "description": [ + "A compact representation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel." + ] + }, + "utxos": { + "type": "array", + "description": [ + "The utxos to be used to fund the channel, as an array of `txid:vout`." + ], + "items": { + "type": "outpoint" + } + }, + "mindepth": { + "description": [ + "Number of confirmations required before we consider the channel active." + ], + "type": "u32" + }, + "reserve": { + "type": "msat", + "description": [ + "The amount we want the peer to maintain on its side of the channel. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*." + ], + "default": "1% of the funding amount" + }, + "channel_type": { + "added": "v24.02", + "type": "array", + "items": { + "type": "u32", + "description": [ + "Represents the explicit channel type to request. There is currently no sanity checking on this value so if you use strange values and your channel breaks, you get to keep both pieces. BOLT 2 defines the following value types:", + "```", + "The currently defined basic types are:", + " - no features (no bits set).", + " - `option_static_remotekey` (bit 12).", + " - `option_anchor_outputs` and `option_static_remotekey` (bits 20 and 12).", + " - `option_anchors_zero_fee_htlc_tx` and `option_static_remotekey` (bits 22 and 12).", + "", + "Each basic type has the following variations allowed:", + " - `option_scid_alias` (bit 46).", + " - `option_zeroconf` (bit 50).", + "```" + ] + } + } + } + }, + "response": { + "required": [ + "tx", + "txid", + "outnum", + "channel_type", + "channel_id" + ], + "properties": { + "tx": { + "type": "hex", + "description": [ + "The raw transaction which funded the channel." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The txid of the transaction which funded the channel." + ] + }, + "outnum": { + "type": "u32", + "description": [ + "The 0-based output index showing which output funded the channel." + ] + }, + "channel_id": { + "type": "hash", + "description": [ + "The channel_id of the resulting channel." + ] + }, + "channel_type": { + "type": "object", + "description": [ + "Channel_type as negotiated with peer." + ], + "added": "v24.02", + "additionalProperties": false, + "required": [ + "bits", + "names" + ], + "properties": { + "bits": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + }, + "names": { + "type": "array", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" + ], + "description": [ + "Name of feature bit." + ] + } + } + } + }, + "close_to": { + "type": "hex", + "description": [ + "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`." + ] + }, + "mindepth": { + "type": "u32", + "description": [ + "Number of confirmations before we consider the channel active." + ] + } + } + }, + "example_usage": [ + "This example shows how to use lightning-cli to open new channel with peer 03f...fc1 from one whole utxo bcc1...39c:0 (you can use **listfunds** command to get txid and vout):", + "", + "```shell", + "lightning-cli -k fundchannel id=03f...fc1 amount=all feerate=normal utxos='[\"bcc1...39c:0\"]'", + "```" + ], + "example_json_request": [ + { + "id": "example:fundchannel#1", + "method": "fundchannel", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount": 1000000, + "feerate": null, + "announce": true, + "minconf": null, + "utxos": null, + "push_msat": null, + "close_to": null, + "request_amt": null, + "compact_lease": null, + "mindepth": null, + "reserve": null + } + }, + { + "id": "example:fundchannel#2", + "method": "fundchannel", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount": 10000000, + "feerate": null, + "announce": true, + "minconf": null, + "utxos": null, + "push_msat": 1000000000, + "close_to": null, + "request_amt": null, + "compact_lease": null, + "mindepth": null, + "reserve": null, + "channel_type": null + } + } + ], + "example_json_response": [ + { + "tx": "020000000001014ca47b75e6982fce6b5ebb6e7ec163dc5b6bed1562934e6febe816103b2b207e0000000000fdffffff0240420f00000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd012f0f000000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a02473044022058fc4d51c8254d37b266d3db3f8fda7420882b6ec9226d66b8c0139f2707c09602205798d8ce23d4c692a7384362a2e0afd9703f062239a786d7a1840a28d3a1152e012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000", + "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b", + "channel_id": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "outnum": 0 + }, + { + "tx": "0200000000010141cfa0e9957c7c6d0bb5069d92937f9545e6e6ee9b4650f47f509d5ea65df4690100000000fdffffff0280969800000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd4118530b0000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a0247304402206488c7dfbc4180781ed0d5ca7ff2c8ce134480c349d03978765053a393229d9a022066c75dee1f19b410ea1c7756d0cb2c097e52b13f4d9bbd033efa4ed95d817e14012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000", + "txid": "6aa1231b6356777468a55aea1f49dad6415592aef6c1e652f8a64357c7235301", + "channel_id": "015323c75743a6f852e6c1f6ae925541d6da491fea5aa568747756631b23a16a", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "outnum": 0 + } + ], + "errors": [ + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error.", + "- 300: The maximum allowed funding amount is exceeded.", + "- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.", + "- 302: The output amount is too small, and would be considered dust.", + "- 303: Broadcasting of the funding transaction failed, the internal call to bitcoin-cli returned with an error.", + "- 313: The `min-emergency-msat` reserve not be preserved (and we have or are opening anchor channels).", + "", + "Failure may also occur if **lightningd** and the peer cannot agree on channel parameters (funding limits, channel reserves, fees, etc.)." + ], + "see_also": [ + "lightning-connect(7)", + "lightning-listfunds()", + "lightning-listpeers(7)", + "lightning-feerates(7)", + "lightning-multifundchannel(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-fundchannel_cancel.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "fundchannel_cancel", + "title": "Command for completing channel establishment", + "description": [ + "`fundchannel_cancel` is a lower level RPC command. It allows channel opener to cancel a channel before funding broadcast with a connected peer.", + "", + "Note that the funding transaction MUST NOT be broadcast before `fundchannel_cancel`. Broadcasting transaction before `fundchannel_cancel` WILL lead to unrecoverable loss of funds.", + "", + "If `fundchannel_cancel` is called after `fundchannel_complete`, the remote peer may disconnect when command succeeds. In this case, user need to connect to remote peer again before opening channel." + ], + "request": { + "required": [ + "id" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "Node id of the remote peer with which to cancel." + ] + } + } + }, + "response": { + "required": [ + "cancelled" + ], + "properties": { + "cancelled": { + "type": "string", + "description": [ + "A message indicating it was cancelled by RPC." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:fundchannel_cancel#1", + "method": "fundchannel_cancel", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" + } + }, + { + "id": "example:fundchannel_cancel#2", + "method": "fundchannel_cancel", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" + } + } + ], + "example_json_response": [ + { + "cancelled": "Channel open canceled by RPC" + }, + { + "cancelled": "Channel open canceled by RPC(after fundchannel_complete)" + } + ], + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- 306: Unknown peer id.", + "- 307: No channel currently being funded that can be cancelled.", + "- 308: It is unsafe to cancel the channel: the funding transaction has been broadcast, or there are HTLCs already in the channel, or the peer was the initiator and not us." + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-connect(7)", + "lightning-fundchannel(7)", + "lightning-multifundchannel(7)", + "lightning-fundchannel_start(7)", + "lightning-fundchannel_complete(7)", + "lightning-openchannel_init(7)", + "lightning-openchannel_update(7)", + "lightning-openchannel_signed(7)", + "lightning-openchannel_abort(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-fundchannel_complete.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "fundchannel_complete", + "title": "Command for completing channel establishment", + "description": [ + "`fundchannel_complete` is a lower level RPC command. It allows a user to complete an initiated channel establishment with a connected peer.", + "", + "Note that the funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed, as the commitment transactions for this channel are not secured until this command successfully completes. Broadcasting transaction before can lead to unrecoverable loss of funds." + ], + "request": { + "required": [ + "id", + "psbt" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "Node id of the remote peer." + ] + }, + "psbt": { + "type": "string", + "description": [ + "Transaction to use for funding (does not need to be signed but must be otherwise complete)." + ] + } + } + }, + "response": { + "required": [ + "channel_id", + "commitments_secured" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "The channel_id of the resulting channel." + ] + }, + "commitments_secured": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Indication that channel is safe to use." + ] + } + } + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 305: Peer is not connected.", + "- 306: Unknown peer id.", + "- 309: PSBT does not have a unique, correct output to fund the channel." + ], + "example_json_request": [ + { + "id": "example:fundchannel_complete#1", + "method": "fundchannel_complete", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "psbt": "cHNidP8BAIkCAAAAASYd4TeOHEIzrUbbELM2DK0IX09WaXqWsJFlLD455MPPAAAAAAD9////Av///wAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM1c8QUpAQAAACJRIH8AZYBKMKON4/oVmJVsVt6zy/+PkBPzziE+LtkuFvWXAAAAAAABAIMCAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////wJRAP////8CAPIFKgEAAAAWABQ5FIjuMd8ar9WFRV9eGNLF+3RMcAAAAAAAAAAAJmokqiGp7eL2HD9x0d79P6mZ36NpU3VcaQaJeZlitIvr2DaXToz5AAAAAAEBHwDyBSoBAAAAFgAUORSI7jHfGq/VhUVfXhjSxft0THAiBgMegIxEPDa2OseVTaV6ANtSwQuoj/j2an7X/Is2EekvWBhhFDNgVAAAgAEAAIAAAACAAAAAAAAAAAAAAAEFIEm9AFgqUlJwbPFtyt3a9dzvb+nAGZiQ3CT1CImhjBFpIQdJvQBYKlJScGzxbcrd2vXc72/pwBmYkNwk9QiJoYwRaRkAYRQzYFYAAIABAACAAAAAgAEAAAAAAAAAAA==" + } + } + ], + "example_json_response": [ + { + "channel_id": "049217e5035a4a60449c6382c445b5c105bd63588d66137ad0511c57a16db6d9", + "commitments_secured": true + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-connect(7)", + "lightning-fundchannel(7)", + "lightning-multifundchannel(7)", + "lightning-fundchannel_start(7)", + "lightning-fundchannel_cancel(7)", + "lightning-openchannel_init(7)", + "lightning-openchannel_update(7)", + "lightning-openchannel_signed(7)", + "lightning-openchannel_bump(7)", + "lightning-openchannel_abort(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-fundchannel_start.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "fundchannel_start", + "title": "Command for initiating channel establishment for a lightning channel", + "description": [ + "`fundchannel_start` is a lower level RPC command. It allows a user to initiate channel establishment with a connected peer.", + "", + "Note that the funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`, as the commitment transactions for this channel are not secured until the complete command succeeds. Broadcasting transaction before that can lead to unrecoverable loss of funds." + ], + "request": { + "required": [ + "id", + "amount" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The peer id obtained from connect." + ] + }, + "amount": { + "type": "sat", + "description": [ + "Satoshi value that the channel will be funded at. This value MUST be accurate, otherwise the negotiated commitment transactions will not encompass the correct channel value." + ] + }, + "feerate": { + "type": "feerate", + "description": [ + "Feerate for subsequent commitment transactions: see **fundchannel**. Note that this is ignored for channels with *option_anchors_zero_fee_htlc_tx* (we always use a low commitment fee for these)." + ] + }, + "announce": { + "type": "boolean", + "description": [ + "Whether or not to announce this channel." + ] + }, + "close_to": { + "type": "string", + "description": [ + "Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. Returns `close_to` set to closing script iff is negotiated." + ] + }, + "push_msat": { + "type": "msat", + "description": [ + "Amount of millisatoshis to push to the channel peer at open. Note that this is a gift to the peer -- these satoshis are added to the initial balance of the peer at channel start and are largely unrecoverable once pushed." + ] + }, + "mindepth": { + "type": "u32", + "description": [ + "Number of confirmations required before we consider the channel active." + ] + }, + "reserve": { + "type": "msat", + "description": [ + "The amount we want the peer to maintain on its side." + ] + }, + "channel_type": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + } + }, + "pairedWith": [ + [ + "feerate", + "announce", + "close_to", + "push_msat", + "channel_type", + "mindepth", + "reserve" + ] + ] + }, + "response": { + "required": [ + "funding_address", + "scriptpubkey", + "warning_usage" + ], + "properties": { + "funding_address": { + "type": "string", + "description": [ + "The address to send funding to for the channel. DO NOT SEND COINS TO THIS ADDRESS YET." + ] + }, + "scriptpubkey": { + "type": "hex", + "description": [ + "The raw scriptPubkey for the address." + ] + }, + "channel_type": { + "type": "object", + "description": [ + "Channel_type as negotiated with peer." + ], + "added": "v24.02", + "additionalProperties": false, + "required": [ + "bits", + "names" + ], + "properties": { + "bits": { + "type": "array", + "added": "v24.02", + "description": [ + "Each bit set in this channel_type." + ], + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + }, + "names": { + "type": "array", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" + ], + "description": [ + "Name of feature bit." + ] + } + } + } + }, + "close_to": { + "type": "hex", + "description": [ + "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`." + ] + }, + "warning_usage": { + "type": "string", + "description": [ + "A warning not to prematurely broadcast the funding transaction (always present!)." + ] + }, + "mindepth": { + "type": "u32", + "description": [ + "Number of confirmations before we consider the channel active." + ] + } + } + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 300: The amount exceeded the maximum configured funding amount.", + "- 301: The provided `push_msat` is greater than the provided `amount`.", + "- 304: Still syncing with bitcoin network", + "- 305: Peer is not connected.", + "- 306: Unknown peer id.", + "- 312: Peer negotiated `option_dual_fund`, must use `openchannel_init` not `fundchannel_start`. (Only if ``experimental-dual-fund` is enabled)" + ], + "example_json_request": [ + { + "id": "example:fundchannel_start#1", + "method": "fundchannel_start", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount": 16777216, + "feerate": null, + "announce": true, + "close_to": null, + "mindepth": null + } + }, + { + "id": "example:fundchannel_start#2", + "method": "fundchannel_start", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount": "100000sat", + "feerate": null, + "announce": true, + "close_to": null, + "mindepth": null, + "channel_type": null + } + } + ], + "example_json_response": [ + { + "funding_address": "bcrt1qtwxd8wg5eanumk86vfeujvp48hfkgannf77evggzct048wggsrxsum2pmm", + "scriptpubkey": "00205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd", + "warning_usage": "The funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`" + }, + { + "funding_address": "bcrt1qtwxd8wg5eanumk86vfeujvp48hfkgannf77evggzct048wggsrxsum2pmm", + "scriptpubkey": "00205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "warning_usage": "The funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`" + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-connect(7)", + "lightning-fundchannel(7)", + "lightning-multifundchannel(7)", + "lightning-fundchannel_complete(7)", + "lightning-fundchannel_cancel(7)", + "lightning-openchannel_init(7)", + "lightning-openchannel_update(7)", + "lightning-openchannel_signed(7)", + "lightning-openchannel_bump(7)", + "lightning-openchannel_abort(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-funderupdate.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "funderupdate", + "title": "Command for adjusting node funding v2 channels", + "description": [ + "NOTE: Must have --experimental-dual-fund enabled for these settings to take effect.", + "", + "For channel open requests using dual funding.", + "", + "Note: to maximize channel leases, best policy setting is (match, 100).", + "", + "Setting any of the 5 options from *lease_fee_base_msat*, *lease_fee_basis*, *funding_weight*, *channel_fee_max_base_msat* and, *channel_fee_max_proportional_thousandths* will activate channel leases for this node, and advertise these values via the lightning gossip network. If any one is set, the other values will be the default." + ], + "request": { + "required": [], + "properties": { + "policy": { + "type": "string", + "enum": [ + "match", + "available", + "fixed" + ], + "description": [ + "Funder plugin will use to decide how much capital to commit to a v2 open channel request.", + "There are three policy options, detailed below:", + " * `match` -- Contribute *policy_mod* percent of their requested funds. Valid *policy_mod* values are 0 to 200. If this is a channel lease request, we match based on their requested funds. If it is not a channel lease request (and *lease_only* is false), then we match their funding amount. Note: any lease match less than 100 will likely fail, as clients will not accept a lease less than their request.", + " * `available` -- Contribute *policy_mod* percent of our available node wallet funds. Valid *policy_mod* values are 0 to 100.", + " * `fixed` -- Contributes a fixed *policy_mod* sats to v2 channel open requests." + ], + "default": "fixed" + }, + "policy_mod": { + "type": "sat", + "description": [ + "Number or 'modification' to apply to the policy." + ], + "default": "0sats" + }, + "leases_only": { + "type": "boolean", + "description": [ + "Only contribute funds to `option_will_fund` requests which pay to lease funds. It will fund any v2 open request using *policy* even if it's they're not seeking to lease funds. Note that `option_will_fund` commits funds for 4032 blocks (~1mo). Must also set *lease_fee_base_msat*, *lease_fee_basis*, *funding_weight*, *channel_fee_max_base_msat*, and *channel_fee_max_proportional_thousandths* to advertise available channel leases." + ], + "default": "False" + }, + "min_their_funding_msat": { + "type": "msat", + "description": [ + "Minimum funding sats that we require in order to activate our contribution policy to the v2 open." + ], + "default": "10k sats" + }, + "max_their_funding_msat": { + "type": "msat", + "description": [ + "Maximum funding sats that we will consider to activate our contribution policy to the v2 open. Any channel open above this will not be funded." + ], + "default": "no max (`UINT_MAX`)" + }, + "per_channel_min_msat": { + "type": "msat", + "description": [ + "Minimum amount that we will contribute to a channel open." + ], + "default": "10k sats" + }, + "per_channel_max_msat": { + "type": "msat", + "description": [ + "Maximum amount that we will contribute to a channel open." + ], + "default": "no max (`UINT_MAX`)" + }, + "reserve_tank_msat": { + "type": "msat", + "description": [ + "Amount of sats to leave available in the node wallet." + ], + "default": "zero sats" + }, + "fuzz_percent": { + "type": "u32", + "description": [ + "A percentage to fuzz the resulting contribution amount by. Valid values are 0 to 100. Note that turning this on with (match, 100) policy will randomly fail `option_will_fund` leases, as most clients expect an exact or greater match of their `requested_funds`." + ], + "default": "0% (no fuzz)" + }, + "fund_probability": { + "type": "u32", + "description": [ + "The percent of v2 channel open requests to apply our policy to. Valid values are integers from 0 (fund 0% of all open requests) to 100 (fund every request). Useful for randomizing opens that receive funds. Useful for randomizing opens that receive funds." + ], + "default": "100" + }, + "lease_fee_base_msat": { + "type": "msat", + "description": [ + "Flat fee for a channel lease. Node will receive this much extra added to their channel balance, paid by the opening node. Note that the minimum is 1sat." + ], + "default": "2k sats" + }, + "lease_fee_basis": { + "type": "u32", + "description": [ + "A basis fee that's calculated as 1/10k of the total requested funds the peer is asking for. Node will receive the total of *lease_fee_basis* times requested funds / 10k satoshis added to their channel balance, paid by the opening node." + ], + "default": "0.65% (65 basis points)" + }, + "funding_weight": { + "type": "u32", + "description": [ + "To calculate the fee the peer will compensate your node for its contributing inputs to the funding transaction. The total fee is calculated as the `open_channel2`.`funding_feerate_perkw` times this *funding_weight* divided by 1000. Node will have this funding fee added to their channel balance, paid by the opening node." + ], + "default": "2 inputs + 1 P2WPKH output" + }, + "channel_fee_max_base_msat": { + "type": "msat", + "description": [ + "A commitment to a maximum `channel_fee_base_msat` that your node will charge for routing payments over this leased channel during the lease duration." + ], + "default": "5k sats" + }, + "channel_fee_max_proportional_thousandths": { + "type": "u32", + "description": [ + "A commitment to a maximum `channel_fee_proportional_millionths` that your node will charge for routing payments over this leased channel during the lease duration. Note that it's denominated in 'thousandths'. A setting of `1` is equal to 1k ppm; `5` is 5k ppm, etc." + ], + "default": "100 (100k ppm)" + }, + "compact_lease": { + "type": "hex", + "description": [ + "A compact description of the channel lease params. When opening a channel, passed in to `fundchannel` to indicate the terms we expect from the peer." + ] + } + } + }, + "response": { + "required": [ + "summary", + "policy", + "policy_mod", + "leases_only", + "min_their_funding_msat", + "max_their_funding_msat", + "per_channel_min_msat", + "per_channel_max_msat", + "reserve_tank_msat", + "fuzz_percent", + "fund_probability" + ], + "properties": { + "summary": { + "type": "string", + "description": [ + "Summary of the current funding policy e.g. (match 100)." + ] + }, + "policy": { + "type": "string", + "enum": [ + "match", + "available", + "fixed" + ], + "description": [ + "Policy funder plugin will use to decide how much capital to commit to a v2 open channel request." + ] + }, + "policy_mod": { + "type": "u32", + "description": [ + "The *policy_mod* is the number or 'modification' to apply to the policy." + ] + }, + "leases_only": { + "type": "boolean", + "description": [ + "Only contribute funds to `option_will_fund` lease requests." + ] + }, + "min_their_funding_msat": { + "type": "msat", + "description": [ + "The minimum funding sats that we require from peer to activate our funding policy." + ] + }, + "max_their_funding_msat": { + "type": "msat", + "description": [ + "The maximum funding sats that we'll allow from peer to activate our funding policy." + ] + }, + "per_channel_min_msat": { + "type": "msat", + "description": [ + "The minimum amount that we will fund a channel open with." + ] + }, + "per_channel_max_msat": { + "type": "msat", + "description": [ + "The maximum amount that we will fund a channel open with." + ] + }, + "reserve_tank_msat": { + "type": "msat", + "description": [ + "Amount of sats to leave available in the node wallet." + ] + }, + "fuzz_percent": { + "type": "u32", + "description": [ + "Percentage to fuzz our funding amount by." + ] + }, + "fund_probability": { + "type": "u32", + "description": [ + "Percent of opens to consider funding. 100 means we'll consider funding every requested open channel request." + ] + }, + "lease_fee_base_msat": { + "type": "msat", + "description": [ + "Flat fee to charge for a channel lease." + ] + }, + "lease_fee_basis": { + "type": "u32", + "description": [ + "Proportional fee to charge for a channel lease, calculated as 1/10,000th of requested funds." + ] + }, + "funding_weight": { + "type": "u32", + "description": [ + "Transaction weight the channel opener will pay us for a leased funding transaction." + ] + }, + "channel_fee_max_base_msat": { + "type": "msat", + "description": [ + "Maximum channel_fee_base_msat we'll charge for routing funds leased on this channel." + ] + }, + "channel_fee_max_proportional_thousandths": { + "type": "u32", + "description": [ + "Maximum channel_fee_proportional_millitionths we'll charge for routing funds leased on this channel, in thousandths." + ] + }, + "compact_lease": { + "type": "hex", + "description": [ + "Compact description of the channel lease parameters." + ] + } + } + }, + "errors": [ + "The following error code may occur:", + "", + "- -32602: If the given parameters are invalid." + ], + "example_json_request": [ + { + "id": "example:funderupdate#1", + "method": "funderupdate", + "params": "{}" + }, + { + "id": "example:funderupdate#2", + "method": "funderupdate", + "params": { + "policy": "fixed", + "policy_mod": "50000sat", + "min_their_funding_msat": 1000, + "per_channel_min_msat": "1000sat", + "per_channel_max_msat": "500000sat", + "fund_probability": 100, + "fuzz_percent": 0, + "leases_only": false + } + } + ], + "example_json_response": [ + { + "summary": "match (100%)", + "policy": "match", + "policy_mod": 100, + "leases_only": true, + "min_their_funding_msat": 10000000, + "max_their_funding_msat": 4294967295000, + "per_channel_min_msat": 10000000, + "per_channel_max_msat": 4294967295000, + "reserve_tank_msat": 0, + "fuzz_percent": 0, + "fund_probability": 100, + "lease_fee_base_msat": 100000, + "lease_fee_basis": 100, + "funding_weight": 666, + "channel_fee_max_base_msat": 5000000, + "channel_fee_max_proportional_thousandths": 100, + "compact_lease": "029a00640064000000644c4b40" + }, + { + "summary": "fixed (50000sat)", + "policy": "fixed", + "policy_mod": 50000, + "leases_only": false, + "min_their_funding_msat": 1000, + "max_their_funding_msat": 4294967295000, + "per_channel_min_msat": 1000000, + "per_channel_max_msat": 500000000, + "reserve_tank_msat": 0, + "fuzz_percent": 0, + "fund_probability": 100 + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-fundchannel(7)", + "lightning-listfunds(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-fundpsbt.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "fundpsbt", + "title": "Command to populate PSBT inputs from the wallet", + "description": [ + "`fundpsbt` is a low-level RPC command which creates a PSBT using unreserved inputs in the wallet, optionally reserving them as well." + ], + "request": { + "required": [ + "satoshi", + "feerate", + "startweight" + ], + "properties": { + "satoshi": { + "type": "msat_or_all", + "description": [ + "The minimum satoshi value of the output(s) needed (or the string `all` meaning use all unreserved inputs). If a value, it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*." + ] + }, + "feerate": { + "type": "feerate", + "description": [ + "Used for the transaction as initial feerate." + ], + "default": "*normal*" + }, + "startweight": { + "type": "u32", + "description": [ + "The weight of the transaction before *fundpsbt* has added any inputs." + ] + }, + "minconf": { + "type": "u32", + "description": [ + "The minimum number of confirmations that used outputs should have." + ], + "default": "1" + }, + "reserve": { + "type": "u32", + "description": [ + "If not zero, then *reserveinputs* is called (successfully, with *exclusive* true) on the returned PSBT for this number of blocks." + ], + "default": "72 blocks" + }, + "locktime": { + "type": "u32", + "description": [ + "The locktime of the transaction. if not set, it is set to a recent block height." + ] + }, + "min_witness_weight": { + "type": "u32", + "description": [ + "Minimum weight to use for a UTXO's witness. If the actual witness weight is greater than the provided minimum, the actual witness weight will be used." + ] + }, + "excess_as_change": { + "type": "boolean", + "description": [ + "Flag to add a change output for the excess sats." + ] + }, + "nonwrapped": { + "added": "v23.02", + "type": "boolean", + "description": [ + "To signal to filter out any p2sh-wrapped inputs from funding this PSBT." + ] + }, + "opening_anchor_channel": { + "added": "v23.08", + "type": "boolean", + "description": [ + "To signel that it needs emergency reserve for anchors so that we can lowball our commitment tx fees, and min-emergency-msat for reserving some sats for closing anchor channels." + ] + } + } + }, + "response": { + "required": [ + "psbt", + "feerate_per_kw", + "estimated_final_weight", + "excess_msat" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "Unsigned PSBT which fulfills the parameters given." + ] + }, + "feerate_per_kw": { + "type": "u32", + "description": [ + "The feerate used to create the PSBT, in satoshis-per-kiloweight." + ] + }, + "estimated_final_weight": { + "type": "u32", + "description": [ + "The estimated weight of the transaction once fully signed." + ] + }, + "excess_msat": { + "type": "msat", + "description": [ + "The amount above *satoshi* which is available. This could be zero, or dust; it will be zero if *change_outnum* is also returned." + ] + }, + "change_outnum": { + "type": "u32", + "description": [ + "The 0-based output number where change was placed (only if parameter *excess_as_change* was true and there was sufficient funds)." + ] + }, + "reservations": { + "type": "array", + "description": [ + "If *reserve* was true or a non-zero number, just as per lightning- reserveinputs(7)." + ], + "items": { + "type": "object", + "required": [ + "txid", + "vout", + "was_reserved", + "reserved", + "reserved_to_block" + ], + "additionalProperties": false, + "properties": { + "txid": { + "type": "txid", + "description": [ + "The txid of the transaction." + ] + }, + "vout": { + "type": "u32", + "description": [ + "The 0-based output number." + ] + }, + "was_reserved": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "Whether this output was previously reserved." + ] + }, + "reserved": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Whether this output is now reserved." + ] + }, + "reserved_to_block": { + "type": "u32", + "description": [ + "The blockheight the reservation will expire." + ] + } + } + } + } + }, + "post_return_value_notes": [ + "If *excess_as_change* is true and the excess is enough to cover an additional output above the `dust_limit`, then an output is added to the PSBT for the excess amount. The *excess_msat* will be zero. A *change_outnum* will be returned with the index of the change output." + ] + }, + "example_usage": [ + "Let's assume the caller is trying to produce a 100,000 satoshi output.", + "", + "First, the caller estimates the weight of the core (typically 42) and known outputs of the transaction (typically (9 + scriptlen) * 4). For a simple P2WPKH it's a 22 byte scriptpubkey, so that's 124 weight.", + "", + "It calls \"*fundpsbt* 100000sat slow 166\", which succeeds, and returns the *psbt* and *feerate_per_kw* it used, the *estimated_final_weight* and any *excess_msat*.", + "", + "If *excess_msat* is greater than the cost of adding a change output, the caller adds a change output randomly to position 0 or 1 in the PSBT. Say *feerate_per_kw* is 253, and the change output is a P2WPKH (weight 124), the cost is around 31 sats. With the dust limit disallowing payments below 546 satoshis, we would only create a change output if *excess_msat* was greater or equal to 31 + 546." + ], + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 301: Insufficient UTXOs to meet *satoshi* value." + ], + "example_json_request": [ + { + "id": "example:fundpsbt#1", + "method": "fundpsbt", + "params": { + "satoshi": 16777216, + "feerate": "253perkw", + "startweight": 250, + "minconf": null, + "reserve": 0, + "locktime": null, + "min_witness_weight": null, + "excess_as_change": false + } + }, + { + "id": "example:fundpsbt#2", + "method": "fundpsbt", + "params": { + "satoshi": "all", + "feerate": "1000perkw", + "startweight": 1000, + "minconf": null, + "reserve": null, + "locktime": null, + "min_witness_weight": null, + "excess_as_change": false + } + }, + { + "id": "example:fundpsbt#3", + "method": "fundpsbt", + "params": { + "satoshi": "109000sat", + "feerate": "slow", + "startweight": 166, + "minconf": null, + "reserve": null, + "locktime": null, + "min_witness_weight": null, + "excess_as_change": true + } + } + ], + "example_json_response": [ + { + "psbt": "cHNidP8BADMCAAAAAWzmSFzhTtXBnQewytc32WaMwJSunScwsYndBNdU80JqAAAAAAD9////AGYAAAAAAQDeAgAAAAABAU1MpIJeOOzqAYVkZaytJCmzUadBVltKar8kWtzKSVeYAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFD8W5uBNZAxN6n1jqU62dxWQbyGAAkcwRAIgUK+vMOeWiDPiJM8fpgKCjjwXog4yfWPvtKES1ZZPaM8CIB3cgouGpV6Gc7nEvAu28Mg9tkAWt/Xl5FDOseEyeZqHASECTwjR0I3gLHdSW7jRmnVXdm0+MgJ1hihnqEfXYeFWA/NlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=", + "feerate_per_kw": 253, + "estimated_final_weight": 521, + "excess_msat": 9999869000 + }, + { + "psbt": "cHNidP8BAF4CAAAAAfwbEpvpi6D14YV4VLnuVB47Y0uF41kXEyJRL4IusySSAQAAAAD9////ASICAAAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5nAAAAAAEA9gIAAAAAAQFEkxvLatohY6mw5gr5qG1aiArSrziFPR2YoqD21Hv+RAAAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNrz8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIEu1nfVRt9i+rFM219mwhMqdwJsqygWSWTFUS+cemdh6AiBG3Qo8g9J/aAMO2RHDsIBScscj6pTTIwZp7Gw8G3EOKAEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPZgAAAAEBK68/DwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==", + "feerate_per_kw": 1000, + "estimated_final_weight": 1443, + "excess_msat": 997354000, + "change_outnum": 0, + "reservations": [ + { + "txid": "9224b32e822f5122131759e3854b633b1e54eeb9547885e1f5a08be99b121bfc", + "vout": 1, + "was_reserved": false, + "reserved": true, + "reserved_to_block": 175 + } + ] + }, + { + "psbt": "cHNidP8BAF4CAAAAAbEf44mT/BPDxLkUjKy1byWksyLyuM6hbe8shzEbbXhGAQAAAAD9////AU58DQAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5sAAAAAAEA9gIAAAAAAQEV9Sj1wfHqO/ECZeHp/u7cFL5eRaa1Vu4hXWbwH72pxgEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIGILT3DrcNn6/WKOhsxxKq7lDWq47dV0IjRhj0bYHs4yAiApzODtmrz7ifK32G81A2XbBxWboFk2vN4T3ng/hYmb1wEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPZgAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==", + "feerate_per_kw": 3750, + "estimated_final_weight": 609, + "excess_msat": 0, + "change_outnum": 0, + "reservations": [ + { + "txid": "46786d1b31872cef6da1ceb8f222b3a4256fb5ac8c14b9c4c313fc9389e31fb1", + "vout": 1, + "was_reserved": false, + "reserved": true, + "reserved_to_block": 180 + } + ] + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-utxopsbt(7)", + "lightning-reserveinputs(7)", + "lightning-unreserveinputs(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-getinfo.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "getinfo", + "title": "Command to receive all information about the Core Lightning node.", + "description": [ + "The **getinfo** gives a summary of the current running node." + ], + "request": { + "required": [], + "properties": {} + }, + "response": { + "required": [ + "id", + "alias", + "color", + "num_peers", + "num_pending_channels", + "num_active_channels", + "num_inactive_channels", + "version", + "blockheight", + "network", + "fees_collected_msat", + "lightning-dir", + "address" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The public key unique to this node." + ] + }, + "alias": { + "type": "string", + "description": [ + "The fun alias this node will advertize." + ], + "maxLength": 32 + }, + "color": { + "type": "hex", + "description": [ + "The favorite RGB color this node will advertize." + ], + "minLength": 6, + "maxLength": 6 + }, + "num_peers": { + "type": "u32", + "description": [ + "The total count of peers, connected or with channels." + ] + }, + "num_pending_channels": { + "type": "u32", + "description": [ + "The total count of channels being opened." + ] + }, + "num_active_channels": { + "type": "u32", + "description": [ + "The total count of channels in normal state." + ] + }, + "num_inactive_channels": { + "type": "u32", + "description": [ + "The total count of channels waiting for opening or closing transactions to be mined." + ] + }, + "version": { + "type": "string", + "description": [ + "Identifies what bugs you are running into." + ] + }, + "lightning-dir": { + "type": "string", + "description": [ + "Identifies where you can find the configuration and other related files." + ] + }, + "our_features": { + "type": "object", + "description": [ + "Our BOLT #9 feature bits (as hexstring) for various contexts." + ], + "additionalProperties": true, + "required": [ + "init", + "node", + "channel", + "invoice" + ], + "properties": { + "init": { + "type": "hex", + "description": [ + "Features (incl. globalfeatures) in our init message, these also restrict what we offer in open_channel or accept in accept_channel." + ] + }, + "node": { + "type": "hex", + "description": [ + "Features in our node_announcement message." + ] + }, + "channel": { + "type": "hex", + "description": [ + "Negotiated channel features we (as channel initiator) publish in the channel_announcement message." + ] + }, + "invoice": { + "type": "hex", + "description": [ + "Features in our BOLT11 invoices." + ] + } + } + }, + "blockheight": { + "type": "u32", + "description": [ + "The highest block height we've learned." + ] + }, + "network": { + "type": "string", + "description": [ + "Represents the type of network on the node are working (e.g: `bitcoin`, `testnet`, or `regtest`)." + ] + }, + "fees_collected_msat": { + "type": "msat", + "description": [ + "Total routing fees collected by this node." + ] + }, + "address": { + "type": "array", + "description": [ + "The addresses we announce to the world." + ], + "items": { + "type": "object", + "required": [ + "type", + "port" + ], + "additionalProperties": true, + "properties": { + "type": { + "type": "string", + "enum": [ + "dns", + "ipv4", + "ipv6", + "torv2", + "torv3" + ], + "description": [ + "Type of connection (until 23.08, `websocket` was also allowed)." + ] + }, + "port": { + "type": "u16", + "description": [ + "Port number." + ] + } + }, + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "dns", + "ipv4", + "ipv6", + "torv2", + "torv3" + ] + } + } + }, + "then": { + "required": [ + "type", + "address", + "port" + ], + "additionalProperties": false, + "properties": { + "type": {}, + "port": {}, + "address": { + "type": "string", + "description": [ + "Address in expected format for **type**." + ] + } + } + }, + "else": { + "required": [ + "type", + "port" + ], + "additionalProperties": false, + "properties": { + "type": {}, + "port": {} + } + } + } + }, + "binding": { + "type": "array", + "description": [ + "The addresses we are listening on." + ], + "items": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "local socket", + "websocket", + "ipv4", + "ipv6", + "torv2", + "torv3" + ], + "description": [ + "Type of connection." + ] + }, + "address": { + "type": "string", + "description": [ + "Address in expected format for **type**." + ] + }, + "port": { + "type": "u16", + "description": [ + "Port number." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "local socket" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "type", + "socket" + ], + "properties": { + "type": {}, + "socket": { + "type": "string", + "description": [ + "Socket filename." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [ + "type", + "address", + "port" + ], + "properties": { + "type": {}, + "address": {}, + "port": {}, + "subtype": {} + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "websocket" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "type", + "address", + "port", + "subtype" + ], + "properties": { + "type": {}, + "address": {}, + "port": {}, + "subtype": { + "type": "string", + "description": [ + "Type of address." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [ + "type" + ], + "properties": { + "type": {}, + "address": {}, + "port": {}, + "socket": {} + } + } + } + ] + } + }, + "warning_bitcoind_sync": { + "type": "string", + "description": [ + "Bitcoind is not up-to-date with network." + ] + }, + "warning_lightningd_sync": { + "type": "string", + "description": [ + "Lightningd is still loading latest blocks from bitcoind." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:getinfo#1", + "method": "getinfo", + "params": {} + } + ], + "example_json_response": [ + { + "id": "02bf811f7571754f0b51e6d41a8885f5561041a7b14fac093e4cffb95749de1a8d", + "alias": "SLICKERGOPHER", + "color": "02bf81", + "num_peers": 0, + "num_pending_channels": 0, + "num_active_channels": 0, + "num_inactive_channels": 0, + "address": [ + { + "type": "torv3", + "address": "fp463inc4w3lamhhduytrwdwq6q6uzugtaeapylqfc43agrdnnqsheyd.onion", + "port": 9736 + }, + { + "type": "torv3", + "address": "ifnntp5ak4homxrti2fp6ckyllaqcike447ilqfrgdw64ayrmkyashid.onion", + "port": 9736 + } + ], + "binding": [ + { + "type": "ipv4", + "address": "127.0.0.1", + "port": 9736 + } + ], + "version": "v0.10.2", + "blockheight": 724302, + "network": "bitcoin", + "msatoshi_fees_collected": 0, + "fees_collected_msat": "0msat", + "lightning-dir": "/media/vincent/Maxtor/C-lightning/node/bitcoin", + "our_features": { + "init": "8828226aa2", + "node": "80008828226aa2", + "channel": "", + "invoice": "20024200" + } + } + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters or some error happened during the command process." + ], + "author": [ + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." + ], + "see_also": [ + "lightning-connect(7)", + "lightning-fundchannel(7)", + "lightning-listconfigs(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-getlog.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "getlog", + "title": "Command to show logs.", + "description": [ + "The **getlog** the RPC command to show logs, with optional log *level*." + ], + "request": { + "required": [], + "properties": { + "level": { + "type": "string", + "enum": [ + "broken", + "unusual", + "info", + "debug", + "io" + ], + "description": [ + "A string that represents the log level." + ], + "default": "*info*" + } + } + }, + "response": { + "required": [ + "created_at", + "bytes_used", + "bytes_max", + "log" + ], + "properties": { + "created_at": { + "type": "string", + "description": [ + "UNIX timestamp with 9 decimal places, when logging was initialized." + ] + }, + "bytes_used": { + "type": "u32", + "description": [ + "The number of bytes used by logging records." + ] + }, + "bytes_max": { + "type": "u32", + "description": [ + "The bytes_used values at which records will be trimmed ." + ] + }, + "log": { + "type": "array", + "items": { + "type": "object", + "required": [ + "type" + ], + "additionalProperties": true, + "properties": { + "type": { + "type": "string", + "enum": [ + "SKIPPED", + "BROKEN", + "UNUSUAL", + "INFO", + "DEBUG", + "IO_IN", + "IO_OUT" + ] + } + }, + "allOf": [ + { + "if": { + "additionalProperties": true, + "properties": { + "type": { + "enum": [ + "SKIPPED" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "num_skipped" + ], + "properties": { + "type": {}, + "num_skipped": { + "type": "u32", + "description": [ + "Number of unprinted log entries (deleted or below *level* parameter)." + ] + } + } + } + }, + { + "if": { + "additionalProperties": true, + "properties": { + "type": { + "enum": [ + "BROKEN", + "UNUSUAL", + "INFO", + "DEBUG" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "time", + "source", + "log" + ], + "properties": { + "type": {}, + "time": { + "type": "string", + "description": [ + "UNIX timestamp with 9 decimal places after **created_at**." + ] + }, + "source": { + "type": "string", + "description": [ + "The particular logbook this was found in." + ] + }, + "log": { + "type": "string", + "description": [ + "The actual log message." + ] + }, + "node_id": { + "type": "pubkey", + "description": [ + "The peer this is associated with." + ] + } + } + } + }, + { + "if": { + "additionalProperties": true, + "properties": { + "type": { + "enum": [ + "IO_IN", + "IO_OUT" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "time", + "source", + "log", + "data" + ], + "properties": { + "type": {}, + "time": { + "type": "string", + "description": [ + "Seconds after **created_at**, with 9 decimal places." + ] + }, + "source": { + "type": "string", + "description": [ + "The particular logbook this was found in." + ] + }, + "log": { + "type": "string", + "description": [ + "The associated log message." + ] + }, + "node_id": { + "type": "pubkey", + "description": [ + "The peer this is associated with." + ] + }, + "data": { + "type": "hex", + "description": [ + "The IO which occurred." + ] + } + } + } + } + ] + } + } + } + }, + "example_json_request": [ + { + "id": "example:getlog#1", + "method": "getlog", + "params": { + "level": "debug" + } + } + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters." + ], + "example_json_response": [ + { + "created_at": "1598192543.820753463", + "bytes_used": 89285843, + "bytes_max": 104857600, + "log": [ + { + "type": "SKIPPED", + "num_skipped": 45 + }, + { + "type": "INFO", + "time": "0.453627568", + "source": "plugin-autopilot.py", + "log": "RPCmethod'autopilot-run-once'doesnothaveadocstring." + } + ] + } + ], + "author": [ + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-getroute.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "getroute", + "title": "Command for routing a payment (low-level)", + "description": [ + "The **getroute** RPC command attempts to find the best route for the payment of *amount_msat* to lightning node *id*, such that the payment will arrive at *id* with *cltv*.", + "", + "There are two considerations for how good a route is: how low the fees are, and how long your payment will get stuck in a delayed output if a node goes down during the process. ." + ], + "request": { + "required": [ + "id", + "amount_msat", + "riskfactor" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "Node pubkey to find the best route for the payment." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount to send. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. The 0 value is special: it ignores any *htlc_minimum_msat* setting on channels, and simply returns a possible route (if any) which is useful for simple probing." + ] + }, + "riskfactor": { + "type": "u64", + "description": [ + "A non-negative floating-point field controls this tradeoff; it is the annual cost of your funds being stuck (as a percentage). For example, if you thought the convenience of keeping your funds liquid (not stuck) was worth 20% per annum interest, *riskfactor* would be 20. If you didn't care about risk, *riskfactor* would be zero." + ] + }, + "cltv": { + "type": "u32", + "description": [ + "Cltv-blocks to spare." + ], + "default": "9" + }, + "fromid": { + "type": "pubkey", + "description": [ + "The node to start the route from." + ], + "default": "this node" + }, + "fuzzpercent": { + "type": "u32", + "description": [ + "Used to distort fees to provide some randomization to the route generated, but it was not properly implemented and is ignored." + ] + }, + "exclude": { + "type": "array", + "description": [ + "A JSON array of short-channel-id/direction (e.g. ['564334x877x1/0', '564195x1292x0/1' ]) or node-id which should be excluded from consideration for routing. Note if the source or destination is excluded, the command result is undefined." + ], + "default": "not to exclude any channels or nodes", + "items": { + "type": "string" + } + }, + "maxhops": { + "type": "u32", + "description": [ + "The maximum number of channels to return." + ], + "default": "20" + } + } + }, + "response": { + "required": [ + "route" + ], + "properties": { + "route": { + "type": "array", + "items": { + "type": "object", + "required": [ + "id", + "direction", + "channel", + "amount_msat", + "delay", + "style" + ], + "additionalProperties": false, + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The node at the end of this hop." + ] + }, + "channel": { + "type": "short_channel_id", + "description": [ + "The channel joining these nodes." + ] + }, + "direction": { + "type": "u32", + "description": [ + "0 if this channel is traversed from lesser to greater **id**, otherwise 1." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount expected by the node at the end of this hop." + ] + }, + "delay": { + "type": "u32", + "description": [ + "The total CLTV expected by the node at the end of this hop." + ] + }, + "style": { + "type": "string", + "description": [ + "The features understood by the destination node." + ], + "enum": [ + "tlv" + ] + } + } + } + } + }, + "post_return_value_notes": [ + "The final *id* will be the destination *id* given in the input. The difference between the first *amount_msat* minus the *amount_msat* given in the input is the fee (assuming the first hop is free). The first *delay* is the very worst case timeout for the payment failure, in blocks." + ] + }, + "riskfactor_effect_on_routing": [ + "The risk factor is treated as if it were an additional fee on the route, for the purposes of comparing routes.", + "", + "The formula used is the following approximation:", + "", + " risk-fee = amount x blocks-timeout x per-block-cost", + "", + "We are given a *riskfactor* expressed as a percentage. There are 52596 blocks per year, thus *per-block-cost* is *riskfactor* divided by 5,259,600.", + "", + "The final result is:", + "", + " risk-fee = amount x blocks-timeout x riskfactor / 5259600", + "", + "Here are the risk fees in millisatoshis, using various parameters. I assume a channel charges the default of 1000 millisatoshis plus 1 part-per-million. Common to_self_delay values on the network at 14 and 144 blocks.", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "
Amount (msat)RiskfactorDelayRisk FeeRoute fee

10,000

1

14

0

1001

10,000

10

14

0

1001

10,000

100

14

2

1001

10,000

1000

14

26

1001

1,000,000

1

14

2

1001

1,000,000

10

14

26

1001

1,000,000

100

14

266

1001

1,000,000

1000

14

2661

1001

100,000,000

1

14

266

1100

100,000,000

10

14

2661

1100

100,000,000

100

14

26617

1100

100,000,000

1000

14

266179

1100

10,000

1

144

0

1001

10,000

10

144

2

1001

10,000

100

144

27

1001

10,000

1000

144

273

1001

1,000,000

1

144

27

1001

1,000,000

10

144

273

1001

1,000,000

100

144

2737

1001

1,000,000

1000

144

27378

1001

100,000,000

1

144

2737

1100

100,000,000

10

144

27378

1100

100,000,000

100

144

273785

1100

100,000,000

1000

144

2737850

1100

" + ], + "recommended_riskfactor_values": [ + "The default *fuzz* factor is 5%, so as you can see from the table above, that tends to overwhelm the effect of *riskfactor* less than about 5.", + "", + "1 is a conservative value for a stable lightning network with very few failures.", + "", + "1000 is an aggressive value for trying to minimize timeouts at all costs.", + "", + "The default for lightning-pay(7) is 10, which starts to become a major factor for larger amounts, and is basically ignored for tiny ones." + ], + "example_json_request": [ + { + "id": "example:getroute#1", + "method": "getroute", + "params": { + "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "amount_msat": 50000000, + "riskfactor": 1, + "cltv": 9, + "fromid": null, + "fuzzpercent": null, + "exclude": null, + "maxhops": null + } + }, + { + "id": "example:getroute#2", + "method": "getroute", + "params": { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount_msat": "50000sat", + "riskfactor": 10 + } + } + ], + "example_json_response": [ + { + "route": [ + { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "channel": "103x3x0", + "direction": 1, + "amount_msat": 50001002, + "delay": 21, + "style": "tlv" + }, + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "channel": "103x1x0", + "direction": 1, + "amount_msat": 50000501, + "delay": 15, + "style": "tlv" + }, + { + "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "channel": "103x2x0", + "direction": 0, + "amount_msat": 50000000, + "delay": 9, + "style": "tlv" + } + ] + }, + { + "route": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "channel": "103x2x0", + "direction": 1, + "amount_msat": 50051000, + "delay": 15, + "style": "tlv" + }, + { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "channel": "103x1x0", + "direction": 0, + "amount_msat": 50000000, + "delay": 9, + "style": "tlv" + } + ] + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-pay(7)", + "lightning-sendpay(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-help.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "help", + "title": "Command to return all information about RPC commands.", + "description": [ + "The **help** is a RPC command which is possible consult all information about the RPC commands, or a specific command if *command* is given.", + "", + "Note that the lightning-cli(1) tool will prefer to list a man page when a specific *command* is specified, and will only return the JSON if the man page is not found." + ], + "request": { + "required": [], + "properties": { + "command": { + "type": "string", + "description": [ + "Command to get information about." + ] + } + } + }, + "response": { + "required": [ + "help" + ], + "properties": { + "help": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "command", + "category", + "description", + "verbose" + ], + "properties": { + "command": { + "type": "string", + "description": [ + "The command." + ] + }, + "category": { + "type": "string", + "description": [ + "The category for this command (useful for grouping)." + ] + }, + "description": { + "type": "string", + "description": [ + "A one-line description of the purpose of this command." + ] + }, + "verbose": { + "type": "string", + "description": [ + "A full description of this command (including whether it's deprecated)." + ] + } + } + } + }, + "format-hint": { + "type": "string", + "enum": [ + "simple" + ], + "description": [ + "Prints the help in human-readable flat form." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:help#1", + "method": "help", + "params": { + "command": "pay" + } + }, + { + "id": "example:help#2", + "method": "help", + "params": { + "command": "dev" + } + } + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters." + ], + "example_json_response": [ + { + "help": [ + { + "command": "pay bolt11 [amount_msat] [label] [riskfactor] [maxfeepercent] [retry_for] [maxdelay] [exemptfee] [localinvreqid] [exclude] [maxfee] [description] [dev_use_shadow]", + "category": "plugin", + "description": "Send payment specified by {bolt11}", + "verbose": "Attempt to pay the {bolt11} invoice." + } + ], + "format-hint": "simple" + }, + { + "help": [ + { + "command": "dev subcommand=crash|rhash|slowcmd", + "category": "developer", + "description": "Developer command test multiplexer", + "verbose": "dev rhash {secret}\n\tShow SHA256 of {secret}\ndev crash\n\tCrash lightningd by calling fatal()\ndev slowcmd {msec}\n\tTorture test for slow commands, optional {msec}\n" + } + ], + "format-hint": "simple" + } + ], + "author": [ + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-invoice.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "invoice", + "title": "Command for accepting payments", + "description": [ + "The **invoice** RPC command creates the expectation of a payment of a given amount of milli-satoshi: it returns a unique token which another lightning daemon can use to pay this invoice. This token includes a *route hint* description of an incoming channel with capacity to pay the invoice, if any exists." + ], + "request": { + "required": [ + "amount_msat", + "label", + "description" + ], + "properties": { + "amount_msat": { + "type": "msat_or_any", + "description": [ + "The string `any`, which creates an invoice that can be paid with any amount. Otherwise it is a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*." + ] + }, + "label": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "description": [ + "A unique string or number (which is treated as a string, so `01` is different from `1`); it is never revealed to other nodes on the lightning network, but it can be used to query the status of this invoice." + ] + }, + "description": { + "type": "string", + "description": [ + "A short description of purpose of payment, e.g. *1 cup of coffee*. This value is encoded into the BOLT11 invoice and is viewable by any node you send this invoice to (unless *deschashonly* is true as described below). It must be UTF-8, and cannot use *\\u* JSON escape codes." + ] + }, + "expiry": { + "type": "u64", + "description": [ + "The time the invoice is valid for, in seconds. If no value is provided the default of 604800 (1 week) is used." + ] + }, + "fallbacks": { + "type": "array", + "description": [ + "One or more fallback addresses to include in the invoice (in order from most- preferred to least): note that these arrays are not currently tracked to fulfill the invoice." + ], + "items": { + "type": "string" + } + }, + "preimage": { + "type": "hex", + "description": [ + "A 64-digit hex string to be used as payment preimage for the created invoice. By default, if unspecified, lightningd will generate a secure pseudorandom preimage seeded from an appropriate entropy source on your system. **IMPORTANT**: if you specify the *preimage*, you are responsible, to ensure appropriate care for generating using a secure pseudorandom generator seeded with sufficient entropy, and keeping the preimage secret. This parameter is an advanced feature intended for use with cutting-edge cryptographic protocols and should not be used unless explicitly needed." + ] + }, + "exposeprivatechannels": { + "description": [ + "If specified, it overrides the default route hint logic, which will use unpublished channels only if there are no published channels." + ], + "oneOf": [ + { + "type": "boolean", + "description": [ + "If *True* unpublished channels are always considered as a route hint candidate; if *False*, never." + ] + }, + { + "type": "array", + "description": [ + "Array of short channel ids (or a remote alias), only those specific channels will be considered candidates, even if they are public or dead-ends." + ], + "items": { + "type": "short_channel_id" + } + }, + { + "type": "short_channel_id", + "description": [ + "If it is a short channel id (e.g. *1x1x3*), only this specific channel will be considered candidate, even if it is public or dead-end." + ] + } + ] + }, + "cltv": { + "type": "u32", + "description": [ + "If specified, sets the *min_final_cltv_expiry* for the invoice. Otherwise, it's set to the parameter **cltv-final**." + ] + }, + "deschashonly": { + "type": "boolean", + "description": [ + "If True, then the bolt11 returned contains a hash of the *description*, rather than the *description* itself: this allows much longer descriptions, but they must be communicated via some other mechanism." + ], + "default": "False" + } + } + }, + "response": { + "required": [ + "payment_hash", + "expires_at", + "created_index", + "bolt11", + "payment_secret" + ], + "properties": { + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "payment_secret": { + "type": "secret", + "description": [ + "The *payment_secret* to place in the onion." + ] + }, + "expires_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when invoice expires." + ] + }, + "created_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was created in." + ] + }, + "warning_capacity": { + "type": "string", + "description": [ + "Even using all possible channels, there's not enough incoming capacity to pay this invoice." + ] + }, + "warning_offline": { + "type": "string", + "description": [ + "There would be enough incoming capacity, but some channels are offline, so there isn't." + ] + }, + "warning_deadends": { + "type": "string", + "description": [ + "There would be enough incoming capacity, but some channels are dead-ends (no other public channels from those peers), so there isn't." + ] + }, + "warning_private_unused": { + "type": "string", + "description": [ + "There would be enough incoming capacity, but some channels are unannounced and *exposeprivatechannels* is *false*, so there isn't." + ] + }, + "warning_mpp": { + "type": "string", + "description": [ + "There is sufficient capacity, but not in a single channel, so the payer will have to use multi-part payments." + ] + } + } + }, + "errors": [ + "On failure, an error is returned and no invoice is created. If the", + "lightning process fails before responding, the caller should use", + "lightning-listinvoices(7) to query whether this invoice was created or", + "not.", + "", + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error.", + "- 900: An invoice with the given *label* already exists.", + "- 901: An invoice with the given *preimage* already exists.", + "- 902: None of the specified *exposeprivatechannels* were usable." + ], + "example_json_request": [ + { + "id": "example:invoice#1", + "method": "invoice", + "params": { + "amount_msat": 11000000, + "label": "xEoCR94SIz6UIRUEkxum", + "description": [ + "XEoCR94SIz6UIRUEkxum." + ], + "expiry": null, + "fallbacks": null, + "preimage": null, + "exposeprivatechannels": null, + "cltv": null, + "deschashonly": null + } + }, + { + "id": "example:invoice#2", + "method": "invoice", + "params": { + "amount_msat": 100, + "label": "8", + "description": "inv", + "expiry": null, + "fallbacks": null, + "preimage": null, + "exposeprivatechannels": null, + "cltv": null, + "deschashonly": null + } + } + ], + "example_json_response": [ + { + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "expires_at": 1706757730, + "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk", + "payment_secret": "82644944d3f70d42aad1d5f7b5d7a629e7afa30b529cc952a4c59fc0e3790ea2", + "created_index": 1, + "warning_deadends": "Insufficient incoming capacity, once dead-end peers were excluded" + }, + { + "payment_hash": "f59ae0204dfe8e913207ea36646255b9d2c7c8229e8693d30547fc622eddb6b4", + "expires_at": 1709229182, + "bolt11": "lnbcrt1n1pja0z07sp5n8fk890nrq7zlcue0lgu7cduaaz765u5rg0kcud4amphuppu8wxspp57kdwqgzdl68fzvs8agmxgcj4h8fv0jpzn6rf85c9gl7xytkak66qdq9d9h8vxqyjw5qcqp99qxpqysgqrneaxh0plvjft457yv3q92rak57a6xw33m6phr0mrsy69sudzgez3adkzdsgwzy32z5usjpxm4rjgcg70h047wf0pgc4l9gyaj2h9ssqcrtv32", + "payment_secret": "99d36395f3183c2fe3997fd1cf61bcef45ed53941a1f6c71b5eec37e043c3b8d", + "created_index": 9, + "warning_capacity": "Insufficient incoming channel capacity to pay invoice" + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listinvoices(7)", + "lightning-delinvoice(7)", + "lightning-pay(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-invoicerequest.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v22.11", + "rpc": "invoicerequest", + "title": "Command for offering payments", + "warning": "experimental-offers only", + "description": [ + "The **invoicerequest** RPC command creates an `invoice_request` to send payments: it automatically enables the processing of an incoming invoice, and payment of it. The reader of the resulting `invoice_request` can use lightning-sendinvoice(7) to collect their payment." + ], + "request": { + "required": [ + "amount", + "description" + ], + "properties": { + "amount": { + "type": "msat", + "description": [ + "A positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*." + ] + }, + "description": { + "type": "string", + "description": [ + "A short description of purpose of the payment, e.g. *ATM withdrawl*. This value is encoded into the resulting `invoice_request` and is viewable by anyone you expose it to. It must be UTF-8, and cannot use *\\u* JSON escape codes." + ] + }, + "issuer": { + "type": "string", + "description": [ + "Who is issuing it (i.e. you) if appropriate." + ] + }, + "label": { + "type": "string", + "description": [ + "An internal-use name for the offer, which can be any UTF-8 string." + ] + }, + "absolute_expiry": { + "type": "u64", + "description": [ + "The time the offer is valid until, in seconds since the first day of 1970 UTC. If not set, the `invoice_request` remains valid (though it can be deactivated by the issuer of course). This is encoded in the `invoice_request`." + ] + }, + "single_use": { + "type": "boolean", + "description": [ + "Indicates that the `invoice_request` is only valid once; we may attempt multiple payments, but as soon as one is successful no more invoices are accepted (i.e. only one person can take the money)." + ], + "default": "True" + } + } + }, + "response": { + "required": [ + "invreq_id", + "single_use", + "active", + "bolt12", + "used" + ], + "properties": { + "invreq_id": { + "type": "hash", + "description": [ + "The SHA256 hash of all invoice_request fields less than 160." + ] + }, + "active": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Whether the invoice_request is currently active." + ] + }, + "single_use": { + "type": "boolean", + "description": [ + "Whether the invoice_request will become inactive after we pay an invoice for it." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string starting with lnr." + ] + }, + "used": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "Whether the invoice_request has already been used." + ] + }, + "label": { + "type": "string", + "description": [ + "The label provided when creating the invoice_request." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:invoicerequest#1", + "method": "invoicerequest", + "params": { + "amount": "10000sat", + "description": "simple test", + "issuer": "clightning test suite" + } + } + ], + "example_json_response": [ + { + "invreq_id": "715484ead84bcdae5b33e3015c686fa1bdd4ae9ade3c4729b58257a98cfcd9b5", + "active": true, + "single_use": true, + "bolt12": "lnr1qqgteyhfyp40c79a5y3gfe33nxfs6zstwd5k6urvv5s8getnwsfp2cmvd9nksarwd9hxwgr5v4ehggrnw45hge2syqrzymjxzydqkkw24ufxqslttwlj3s608f0rx2slc7etw0833zgs75srnztgqkppqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq633uzq99smfawuu6pz0zh9jl6dl8v25u3kzes975x2j9tr0qp0ux0tlzcxjrgehxh9luz5vwjpk92tys9f9zlm038krcz4uqfxgelwf43tgfc", + "used": false + } + ], + "errors": [ + "On failure, an error is returned and no `invoice_request` is created. If the lightning process fails before responding, the caller should use lightning-listinvoicerequests(7) to query whether it was created or not.", + "", + "- -1: Catchall nonspecific error." + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listinvoicerequests(7)", + "lightning-disableinvoicerequest(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-keysend.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "keysend", + "title": "Send funds to a node without an invoice", + "description": [ + "The **keysend** RPC command attempts to find a route to the given destination, and send the specified amount to it. Unlike the `pay` RPC command the `keysend` command does not require an invoice, instead it uses the `destination` node ID, and `amount` to find a route to the specified node.", + "", + "In order for the destination to be able to claim the payment, the `payment_key` is randomly generated by the sender and included in the encrypted payload for the destination. As a consequence there is not proof-of-payment, like there is with an invoice where the `payment_key` is generated on the destination, and the only way sender could have it is by sending a payment. Please ensure that this matches your use-case when using `keysend`.", + "", + "When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name." + ], + "request": { + "required": [ + "destination", + "amount_msat" + ], + "properties": { + "destination": { + "type": "pubkey", + "description": [ + "The 33 byte, hex-encoded, node ID of the node that the payment should go to." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "A whole number, or a whole number with suffix `msat` or `sat`, or a three decimal point number with suffix `sat`, or an 1 to 11 decimal point number suffixed by `btc`." + ] + }, + "label": { + "type": "string", + "description": [ + "Used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7)." + ] + }, + "maxfeepercent": { + "type": "number", + "description": [ + "Limits the money paid in fees as percentage of the total amount that is to be transferred." + ], + "default": "0.5" + }, + "retry_for": { + "type": "u32", + "description": [ + "Until *retry_for* seconds passes, the command will keep finding routes and retrying the payment. However, a payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case." + ], + "default": "60 seconds" + }, + "maxdelay": { + "type": "u32", + "description": [ + "Number of blocks the payment may be delayed." + ] + }, + "exemptfee": { + "type": "msat", + "description": [ + "Used for tiny payments which would be dominated by the fee leveraged by forwarding nodes. Setting `exemptfee` allows the `maxfeepercent` check to be skipped on fees that are smaller than *exemptfee*." + ], + "default": "5000 millisatoshi" + }, + "routehints": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "id", + "scid", + "feebase", + "feeprop", + "expirydelta" + ], + "properties": { + "id": { + "type": "pubkey" + }, + "scid": { + "type": "short_channel_id" + }, + "feebase": { + "type": "msat" + }, + "feeprop": { + "type": "u32" + }, + "expirydelta": { + "type": "u16" + } + } + } + } + }, + "extratlvs": { + "type": "object", + "additionalProperties": true, + "required": [], + "description": [ + "Dictionary of additional fields to insert into the final tlv. The format is 'fieldnumber': 'hexstring'." + ] + } + } + }, + "response": { + "required": [ + "payment_preimage", + "payment_hash", + "created_at", + "parts", + "amount_msat", + "amount_sent_msat", + "status" + ], + "properties": { + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash**." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "created_at": { + "type": "number", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "parts": { + "type": "u32", + "description": [ + "How many attempts this took." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount the recipient received." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "Total amount we sent (including fees)." + ] + }, + "warning_partial_completion": { + "type": "string", + "description": [ + "Not all parts of a multi-part payment have completed." + ] + }, + "status": { + "type": "string", + "enum": [ + "complete" + ], + "description": [ + "Status of payment." + ] + } + }, + "post_return_value_notes": [ + "You can monitor the progress and retries of a payment using the lightning-paystatus(7) command." + ] + }, + "randomization": [ + "To protect user privacy, the payment algorithm performs some randomization.", + "", + "1: Route Randomization", + "", + "Route randomization means the payment algorithm does not always use the lowest-fee or shortest route. This prevents some highly-connected node from learning all of the user payments by reducing their fees below the network average.", + "", + "2: Shadow Route", + "", + "Shadow route means the payment algorithm will virtually extend the route by adding delays and fees along it, making it appear to intermediate nodes that the route is longer than it actually is. This prevents intermediate nodes from reliably guessing their distance from the payee.", + "", + "Route randomization will never exceed *maxfeepercent* of the payment. Route randomization and shadow routing will not take routes that would exceed *maxdelay*." + ], + "errors": [ + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error.", + "- 203: Permanent failure at destination. The *data* field of the error will be routing failure object.", + "- 205: Unable to find a route.", + "- 206: Route too expensive. Either the fee or the needed total locktime for the route exceeds your *maxfeepercent* or *maxdelay* settings, respectively. The *data* field of the error will indicate the actual *fee* as well as the *feepercent* percentage that the fee has of the destination payment amount. It will also indicate the actual *delay* along the route.", + "- 210: Payment timed out without a payment in progress.", + "", + "A routing failure object has the fields below:", + "", + "*erring_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on.", + "*erring_node*: The hex string of the pubkey id of the node that reported the error.", + "*erring_channel*: The short channel ID of the channel that has the error, or *0:0:0* if the destination node raised the error.", + "*failcode*: The failure code, as per BOLT #4.", + "*channel_update*: The hex string of the *channel_update* message received from the remote node. Only present if error is from the remote node and the *failcode* has the `UPDATE` bit set, as per BOLT #4." + ], + "example_json_request": [ + { + "id": "example:keysend#1", + "method": "keysend", + "params": { + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount_msat": 10000, + "label": null, + "maxfeepercent": null, + "retry_for": null, + "maxdelay": null, + "exemptfee": null, + "extratlvs": null + } + }, + { + "id": "example:keysend#2", + "method": "keysend", + "params": { + "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "amount_msat": 10000000, + "label": null, + "maxfeepercent": null, + "retry_for": null, + "maxdelay": null, + "exemptfee": null, + "extratlvs": { + "133773310": "68656c6c6f776f726c64", + "133773312": "66696c7465726d65" + } + } + }, + { + "id": "example:keysend#3", + "method": "keysend", + "params": { + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount_msat": 10000, + "routehints": [ + [ + { + "scid": "4615051x2233541x57738", + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "feebase": 1, + "feeprop": 10, + "expirydelta": 9 + } + ], + [ + { + "scid": "1x2x3", + "id": "020202020202020202020202020202020202020202020202020202020202020202", + "feebase": 1, + "feeprop": 1, + "expirydelta": 9 + } + ] + ] + } + } + ], + "example_json_response": [ + { + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "payment_hash": "b6f88603008a9f7dd84b1b94c7b972c8efbaf0b86c8d3c04512955992da9028e", + "created_at": 1706315742.6861734, + "parts": 1, + "amount_msat": 10000, + "amount_sent_msat": 10001, + "payment_preimage": "7178cf708e34dce816fc35aa692a65e1f85b92ae03bbc8ae6543302511823174", + "status": "complete" + }, + { + "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "payment_hash": "e8474eea8d5673e8407ef5f4924e58479b51a68afd136384683d5d6a97c9520d", + "created_at": 1708640424.1810749, + "parts": 1, + "amount_msat": 10000000, + "amount_sent_msat": 10000000, + "payment_preimage": "40e47272ea7da20c57a2381d81a5513ec03bd8ead9d51fbd2a91ec76d3f4bcbf", + "status": "complete" + }, + { + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "payment_hash": "56e12e6f45120bef7385c9bf307319eaa6a1b9160cdb3e62a3f492abf5bfa4bc", + "created_at": 1708640437.2895157, + "parts": 1, + "amount_msat": 10000, + "amount_sent_msat": 10001, + "payment_preimage": "682870b8f96e2aed1c86694dbb2c3e64cd396b9bba9fafd824d90eb0bd371b85", + "status": "complete" + } + ], + "author": [ + "Christian Decker <> is mainly responsible." + ], + "see_also": [ + "lightning-listpays(7)", + "lightning-decodepay(7)", + "lightning-listinvoice(7)", + "lightning-delinvoice(7)", + "lightning-getroute(7)", + "lightning-invoice(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-listchannels.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listchannels", + "title": "Command to query active lightning channels in the entire network", + "description": [ + "The **listchannels** RPC command returns data on channels that are known to the node. Because channels may be bidirectional, up to 2 objects will be returned for each channel (one for each direction).", + "", + "Only one of *short_channel_id*, *source* or *destination* can be supplied. If nothing is supplied, data on all lightning channels known to this node, are returned. These can be local channels or public channels broadcast on the gossip network." + ], + "request": { + "required": [], + "properties": { + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "If short_channel_id is a short channel id, then only known channels with a matching short_channel_id are returned. Otherwise, it must be null." + ] + }, + "source": { + "type": "pubkey", + "description": [ + "If source is a node id, then only channels leading from that node id are returned." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "If destination is a node id, then only channels leading to that node id are returned." + ] + } + } + }, + "response": { + "required": [ + "channels" + ], + "properties": { + "channels": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "source", + "destination", + "short_channel_id", + "direction", + "public", + "amount_msat", + "message_flags", + "channel_flags", + "active", + "last_update", + "base_fee_millisatoshi", + "fee_per_millionth", + "delay", + "htlc_minimum_msat", + "features" + ], + "properties": { + "source": { + "type": "pubkey", + "description": [ + "The source node." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The destination node." + ] + }, + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "Short channel id of channel." + ] + }, + "direction": { + "type": "u32", + "description": [ + "Direction (0 if source < destination, 1 otherwise)." + ] + }, + "public": { + "type": "boolean", + "description": [ + "True if this is announced (from *v24.02*, being false is deprecated)." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The total capacity of this channel (always a whole number of satoshis)." + ] + }, + "message_flags": { + "type": "u8", + "description": [ + "As defined by BOLT #7." + ] + }, + "channel_flags": { + "type": "u8", + "description": [ + "As defined by BOLT #7." + ] + }, + "active": { + "type": "boolean", + "description": [ + "True unless source has disabled it (or (deprecated in *v24.02*) it's a local channel and the peer is disconnected or it's still opening or closing)." + ] + }, + "last_update": { + "type": "u32", + "description": [ + "UNIX timestamp on the last channel_update from *source*." + ] + }, + "base_fee_millisatoshi": { + "type": "u32", + "description": [ + "Base fee changed by *source* to use this channel." + ] + }, + "fee_per_millionth": { + "type": "u32", + "description": [ + "Proportional fee changed by *source* to use this channel, in parts-per-million." + ] + }, + "delay": { + "type": "u32", + "description": [ + "The number of blocks delay required by *source* to use this channel." + ] + }, + "htlc_minimum_msat": { + "type": "msat", + "description": [ + "The smallest payment *source* will allow via this channel." + ] + }, + "htlc_maximum_msat": { + "type": "msat", + "description": [ + "The largest payment *source* will allow via this channel." + ] + }, + "features": { + "type": "hex", + "description": [ + "BOLT #9 features bitmap for this channel." + ] + } + } + } + } + }, + "post_return_value_notes": [ + "If one of *short_channel_id*, *source* or *destination* is supplied and no matching channels are found, a 'channels' object with an empty list is returned." + ] + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong." + ], + "example_json_request": [ + { + "id": "example:listchannels#1", + "method": "listchannels", + "params": { + "short_channel_id": "103x1x0", + "source": null, + "destination": null + } + }, + { + "id": "example:listchannels#2", + "method": "listchannels", + "params": { + "short_channel_id": null, + "source": null, + "destination": null + } + } + ], + "example_json_response": [ + { + "channels": [] + }, + { + "channels": [ + { + "source": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "short_channel_id": "103x1x0", + "direction": 0, + "public": true, + "amount_msat": 1000000000, + "message_flags": 1, + "channel_flags": 0, + "active": true, + "last_update": 1706153393, + "base_fee_millisatoshi": 1, + "fee_per_millionth": 10, + "delay": 6, + "htlc_minimum_msat": 0, + "htlc_maximum_msat": 990000000, + "features": "" + }, + { + "source": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "short_channel_id": "103x1x0", + "direction": 1, + "public": true, + "amount_msat": 1000000000, + "message_flags": 1, + "channel_flags": 1, + "active": true, + "last_update": 1706153393, + "base_fee_millisatoshi": 1, + "fee_per_millionth": 10, + "delay": 6, + "htlc_minimum_msat": 0, + "htlc_maximum_msat": 990000000, + "features": "" + } + ] + } + ], + "author": [ + "Michael Hawkins <>." + ], + "see_also": [ + "lightning-fundchannel(7)", + "lightning-listnodes(7)" + ], + "resources": [ + "Main web site: ", + "", + "BOLT #7: " + ] + }, + "lightning-listclosedchannels.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.05", + "rpc": "listclosedchannels", + "title": "Get data on our closed historical channels", + "description": [ + "The **listclosedchannels** RPC command returns data on channels which are otherwise forgotten (more than 100 blocks after they're completely resolved onchain)." + ], + "request": { + "required": [], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "If no *id* is supplied, then channel data on all historical channels are given. Supplying *id* will filter the results to only match channels to that peer. Note that prior to v23.05, old peers were forgotten." + ] + } + } + }, + "response": { + "required": [ + "closedchannels" + ], + "properties": { + "closedchannels": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "channel_id", + "opener", + "private", + "total_msat", + "total_local_commitments", + "total_remote_commitments", + "total_htlcs_sent", + "funding_txid", + "funding_outnum", + "leased", + "final_to_us_msat", + "min_to_us_msat", + "max_to_us_msat", + "close_cause" + ], + "properties": { + "peer_id": { + "type": "pubkey", + "description": [ + "Peer public key (can be missing with pre-v23.05 closes!)." + ] + }, + "channel_id": { + "type": "hash", + "description": [ + "The full channel_id (funding txid Xored with output number)." + ] + }, + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "The short_channel_id." + ] + }, + "alias": { + "type": "object", + "required": [], + "properties": { + "local": { + "type": "short_channel_id", + "description": [ + "An alias assigned by this node to this channel, used for outgoing payments." + ] + }, + "remote": { + "type": "short_channel_id", + "description": [ + "An alias assigned by the remote node to this channel, usable in routehints and invoices." + ] + } + } + }, + "opener": { + "type": "string", + "enum": [ + "local", + "remote" + ], + "description": [ + "Who initiated the channel." + ] + }, + "closer": { + "type": "string", + "enum": [ + "local", + "remote" + ], + "description": [ + "Who initiated the channel close (only present if closing)." + ] + }, + "private": { + "type": "boolean", + "description": [ + "If True, we will not announce this channel." + ] + }, + "channel_type": { + "type": "object", + "description": [ + "Channel_type as negotiated with peer." + ], + "additionalProperties": false, + "required": [ + "bits", + "names" + ], + "properties": { + "bits": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + }, + "names": { + "type": "array", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "items": { + "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" + ], + "description": [ + "Name of feature bit." + ] + } + } + } + }, + "total_local_commitments": { + "type": "u64", + "description": [ + "Number of commitment transaction we made." + ] + }, + "total_remote_commitments": { + "type": "u64", + "description": [ + "Number of commitment transaction they made." + ] + }, + "total_htlcs_sent": { + "type": "u64", + "description": [ + "Number of HTLCs we ever sent." + ] + }, + "funding_txid": { + "type": "txid", + "description": [ + "ID of the funding transaction." + ] + }, + "funding_outnum": { + "type": "u32", + "description": [ + "The 0-based output number of the funding transaction which opens the channel." + ] + }, + "leased": { + "type": "boolean", + "description": [ + "Whether this channel was leased from `opener`." + ] + }, + "funding_fee_paid_msat": { + "type": "msat", + "description": [ + "How much we paid to lease the channel (iff `leased` is true and `opener` is local)." + ] + }, + "funding_fee_rcvd_msat": { + "type": "msat", + "description": [ + "How much they paid to lease the channel (iff `leased` is true and `opener` is remote)." + ] + }, + "funding_pushed_msat": { + "type": "msat", + "description": [ + "How much `opener` pushed immediate (if non-zero)." + ] + }, + "total_msat": { + "type": "msat", + "description": [ + "Total amount in the channel." + ] + }, + "final_to_us_msat": { + "type": "msat", + "description": [ + "Our balance in final commitment transaction." + ] + }, + "min_to_us_msat": { + "type": "msat", + "description": [ + "Least amount owed to us ever. If the peer were to successfully steal from us, this is the amount we would still retain." + ] + }, + "max_to_us_msat": { + "type": "msat", + "description": [ + "Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get." + ] + }, + "last_commitment_txid": { + "type": "hash", + "description": [ + "The final commitment tx's txid (or mutual close, if we accepted it). Not present for some very old, small channels pre-0.7.0." + ] + }, + "last_commitment_fee_msat": { + "type": "msat", + "description": [ + "The fee on `last_commitment_txid`." + ] + }, + "close_cause": { + "type": "string", + "enum": [ + "unknown", + "local", + "user", + "remote", + "protocol", + "onchain" + ], + "description": [ + "What caused the channel to close." + ] + }, + "last_stable_connection": { + "type": "u64", + "added": "v24.02", + "description": [ + "Last time we reestablished the open channel and stayed connected for 1 minute." + ] + } + } + } + } + } + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong." + ], + "author": [ + "Rusty Russell <>." + ], + "see_also": [ + "lightning-listpeerchannels(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-listconfigs.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listconfigs", + "title": "Command to list all configuration options.", + "description": [ + "The **listconfigs** RPC command to list all configuration options, or with *config* only one." + ], + "request": { + "required": [], + "properties": { + "config": { + "type": "string", + "description": [ + "Configuration option name to restrict return." + ] + } + } + }, + "response": { + "required": [], + "properties": { + "configs": { + "added": "v23.08", + "type": "object", + "comment": "Plugins can add fields to this, so we can't rule out additional properties :(", + "additionalProperties": true, + "required": [], + "properties": { + "conf": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from cmdline." + ] + }, + "source": { + "type": "string", + "enum": [ + "cmdline" + ], + "description": [ + "Source of configuration setting." + ] + } + } + }, + "developer": { + "type": "object", + "added": "v23.08", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "clear-plugins": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "disable-mpp": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + }, + "plugin": { + "type": "string", + "description": [ + "Plugin which registered this configuration setting." + ] + } + } + }, + "mainnet": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "regtest": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "signet": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "testnet": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "important-plugin": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] + } + }, + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + } + }, + "plugin": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] + } + }, + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + } + }, + "plugin-dir": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] + } + }, + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + } + }, + "lightning-dir": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "network": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default (can also be changed by `testnet`, `signet`, `regtest` options!)." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "allow-deprecated-apis": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_bool", + "source" + ], + "properties": { + "value_bool": { + "type": "boolean", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "rpc-file": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "disable-plugin": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] + } + }, + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + } + }, + "always-use-proxy": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_bool", + "source" + ], + "properties": { + "value_bool": { + "type": "boolean", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "daemon": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "wallet": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "large-channels": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "experimental-dual-fund": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "experimental-splicing": { + "added": "v23.08", + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "experimental-onion-messages": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "experimental-offers": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "experimental-shutdown-wrong-funding": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "experimental-websocket-port": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "experimental-peer-storage": { + "added": "v23.02", + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "experimental-anchors": { + "type": "object", + "added": "v23.08", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "database-upgrade": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_bool", + "source" + ], + "properties": { + "value_bool": { + "type": "boolean", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "rgb": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "hex", + "description": [ + "Field from config or cmdline, or default." + ], + "maxLength": 6, + "minLength": 6 + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "alias": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "pid-file": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "ignore-fee-limits": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_bool", + "source" + ], + "properties": { + "value_bool": { + "type": "boolean", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "watchtime-blocks": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "max-locktime-blocks": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "funding-confirms": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "cltv-delta": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "cltv-final": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "commit-time": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "fee-base": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "rescan": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "integer", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "fee-per-satoshi": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "max-concurrent-htlcs": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "htlc-minimum-msat": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_msat", + "source" + ], + "properties": { + "value_msat": { + "type": "msat", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "htlc-maximum-msat": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_msat", + "source" + ], + "properties": { + "value_msat": { + "type": "msat", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "max-dust-htlc-exposure-msat": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_msat", + "source" + ], + "properties": { + "value_msat": { + "type": "msat", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "min-capacity-sat": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u64", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + }, + "dynamic": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Can this be set by setconfig()." + ] + } + } + }, + "addr": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] + } + }, + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + } + }, + "announce-addr": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] + } + }, + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + } + }, + "bind-addr": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] + } + }, + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + } + }, + "offline": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "autolisten": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_bool", + "source" + ], + "properties": { + "value_bool": { + "type": "boolean", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "proxy": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "disable-dns": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "announce-addr-discovered": { + "added": "v23.02", + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "enum": [ + "true", + "false", + "auto" + ], + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "announce-addr-discovered-port": { + "added": "v23.02", + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "encrypted-hsm": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "rpc-file-mode": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "log-level": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "log-prefix": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "log-file": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] + } + }, + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + } + }, + "log-timestamps": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_bool", + "source" + ], + "properties": { + "value_bool": { + "type": "boolean", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "force-feerates": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "subdaemon": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] + } + }, + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + } + }, + "fetchinvoice-noconnect": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "accept-htlc-tlv-types": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "tor-service-password": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "announce-addr-dns": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_bool", + "source" + ], + "properties": { + "value_bool": { + "type": "boolean", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "require-confirmed-inputs": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_bool", + "source" + ], + "properties": { + "value_bool": { + "type": "boolean", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "commit-fee": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u64", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "commit-feerate-offset": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + } + } + }, + "# version": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "Special field indicating the current version." + ] + }, + "plugins": { + "type": "array", + "deprecated": [ + "v23.08", + "v24.02" + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "path", + "name" + ], + "description": [ + "`plugin` field from config or cmdline." + ], + "properties": { + "path": { + "type": "string", + "description": [ + "Full path of the plugin." + ] + }, + "name": { + "type": "string", + "description": [ + "Short name of the plugin." + ] + }, + "options": { + "type": "object", + "additionalProperties": true, + "required": [], + "description": [ + "Specific options set for this plugin." + ], + "properties": {} + } + } + } + }, + "important-plugins": { + "type": "array", + "deprecated": [ + "v23.08", + "v24.02" + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "path", + "name" + ], + "description": [ + "`important-plugin` field from config or cmdline, or built-in." + ], + "properties": { + "path": { + "type": "string", + "description": [ + "Full path of the plugin." + ] + }, + "name": { + "type": "string", + "description": [ + "Short name of the plugin." + ] + }, + "options": { + "type": "object", + "additionalProperties": true, + "required": [], + "description": [ + "Specific options set for this plugin." + ], + "properties": {} + } + } + } + }, + "conf": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`conf` field from cmdline, or default." + ] + }, + "lightning-dir": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`lightning-dir` field from config or cmdline, or default." + ] + }, + "network": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`network` field from config or cmdline, or default." + ] + }, + "allow-deprecated-apis": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`allow-deprecated-apis` field from config or cmdline, or default." + ] + }, + "rpc-file": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`rpc-file` field from config or cmdline, or default." + ] + }, + "disable-plugin": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "array", + "items": { + "type": "string", + "description": [ + "`disable-plugin` field from config or cmdline." + ] + } + }, + "bookkeeper-dir": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`bookkeeper-dir` field from config or cmdline, or default." + ] + }, + "bookkeeper-db": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`bookkeeper-db` field from config or cmdline, or default." + ] + }, + "always-use-proxy": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`always-use-proxy` field from config or cmdline, or default." + ] + }, + "daemon": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`daemon` field from config or cmdline, or default." + ] + }, + "wallet": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`wallet` field from config or cmdline default." + ] + }, + "large-channels": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`large-channels` field from config or cmdline, or default." + ] + }, + "experimental-dual-fund": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`experimental-dual-fund` field from config or cmdline, or default." + ] + }, + "experimental-splicing": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`experimental-splicing` field from config or cmdline, or default." + ] + }, + "experimental-onion-messages": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`experimental-onion-messages` field from config or cmdline, or default." + ] + }, + "experimental-offers": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`experimental-offers` field from config or cmdline, or default." + ] + }, + "experimental-shutdown-wrong-funding": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`experimental-shutdown-wrong-funding` field from config or cmdline, or default." + ] + }, + "experimental-websocket-port": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u16", + "description": [ + "`experimental-websocket-port` field from config or cmdline, or default." + ] + }, + "experimental-peer-storage": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "added": "v23.02", + "description": [ + "`experimental-peer-storage` field from config or cmdline, or default." + ] + }, + "experimental-quiesce": { + "type": "boolean", + "added": "v23.08", + "deprecated": [ + "v23.08", + "v24.02" + ], + "description": [ + "`experimental-quiesce` field from config or cmdline, or default." + ] + }, + "experimental-upgrade-protocol": { + "type": "boolean", + "added": "v23.08", + "deprecated": [ + "v23.08", + "v24.02" + ], + "description": [ + "`experimental-upgrade-protocol` field from config or cmdline, or default." + ] + }, + "invoices-onchain-fallback": { + "type": "boolean", + "added": "v23.11", + "description": [ + "`invoices-onchain-fallback` field from config or cmdline, or default." + ] + }, + "database-upgrade": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`database-upgrade` field from config or cmdline." + ] + }, + "rgb": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "hex", + "description": [ + "`rgb` field from config or cmdline, or default." + ], + "maxLength": 6, + "minLength": 6 + }, + "alias": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`alias` field from config or cmdline, or default." + ] + }, + "pid-file": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`pid-file` field from config or cmdline, or default." + ] + }, + "ignore-fee-limits": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`ignore-fee-limits` field from config or cmdline, or default." + ] + }, + "watchtime-blocks": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", + "description": [ + "`watchtime-blocks` field from config or cmdline, or default." + ] + }, + "max-locktime-blocks": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", + "description": [ + "`max-locktime-blocks` field from config or cmdline, or default." + ] + }, + "funding-confirms": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", + "description": [ + "`funding-confirms` field from config or cmdline, or default." + ] + }, + "cltv-delta": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", + "description": [ + "`cltv-delta` field from config or cmdline, or default." + ] + }, + "cltv-final": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", + "description": [ + "`cltv-final` field from config or cmdline, or default." + ] + }, + "commit-time": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", + "description": [ + "`commit-time` field from config or cmdline, or default." + ] + }, + "fee-base": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", + "description": [ + "`fee-base` field from config or cmdline, or default." + ] + }, + "rescan": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "integer", + "description": [ + "`rescan` field from config or cmdline, or default." + ] + }, + "fee-per-satoshi": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", + "description": [ + "`fee-per-satoshi` field from config or cmdline, or default." + ] + }, + "max-concurrent-htlcs": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", + "description": [ + "`max-concurrent-htlcs` field from config or cmdline, or default." + ] + }, + "htlc-minimum-msat": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "msat", + "description": [ + "`htlc-minimum-msat` field from config or cmdline, or default." + ] + }, + "htlc-maximum-msat": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "msat", + "description": [ + "`htlc-maximum-msat` field from config or cmdline, or default." + ] + }, + "max-dust-htlc-exposure-msat": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "msat", + "description": [ + "`max-dust-htlc-exposure-mast` field from config or cmdline, or default." + ] + }, + "min-capacity-sat": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u64", + "description": [ + "`min-capacity-sat` field from config or cmdline, or default." + ] + }, + "addr": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`addr` field from config or cmdline (can be more than one)." + ] + }, + "announce-addr": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`announce-addr` field from config or cmdline (can be more than one)." + ] + }, + "bind-addr": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`bind-addr` field from config or cmdline (can be more than one)." + ] + }, + "offline": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`true` if `offline` was set in config or cmdline." + ] + }, + "autolisten": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`autolisten` field from config or cmdline, or default." + ] + }, + "proxy": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`proxy` field from config or cmdline, or default." + ] + }, + "disable-dns": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`true` if `disable-dns` was set in config or cmdline." + ] + }, + "announce-addr-discovered": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`true`/`false`/`auto` depending on how `announce-addr-discovered` was set in config or cmdline." + ], + "added": "v23.02" + }, + "announce-addr-discovered-port": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "integer", + "description": [ + "Sets the announced TCP port for dynamically discovered IPs." + ], + "added": "v23.02" + }, + "encrypted-hsm": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`true` if `encrypted-hsm` was set in config or cmdline." + ] + }, + "rpc-file-mode": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`rpc-file-mode` field from config or cmdline, or default." + ] + }, + "log-level": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`log-level` field from config or cmdline, or default." + ] + }, + "log-prefix": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`log-prefix` field from config or cmdline, or default." + ] + }, + "log-file": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`log-file` field from config or cmdline, or default." + ] + }, + "log-timestamps": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`log-timestamps` field from config or cmdline, or default." + ] + }, + "force-feerates": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "Force-feerate configuration setting, if any." + ] + }, + "subdaemon": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`subdaemon` fields from config or cmdline if any (can be more than one)." + ] + }, + "fetchinvoice-noconnect": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`fetchinvoice-noconnect` fields from config or cmdline, or default." + ] + }, + "accept-htlc-tlv-types": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`accept-htlc-tlv-types` field from config or cmdline, or not present." + ] + }, + "tor-service-password": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`tor-service-password` field from config or cmdline, if any." + ] + }, + "dev-allowdustreserve": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "Whether we allow setting dust reserves." + ] + }, + "announce-addr-dns": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "added": "v22.11.1", + "description": [ + "Whether we put DNS entries into node_announcement." + ] + }, + "require-confirmed-inputs": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "Request peers to only send confirmed inputs (dual-fund only)." + ] + }, + "developer": { + "added": "v23.08", + "type": "boolean", + "description": [ + "Whether developer mode is enabled." + ] + }, + "commit-fee": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u64", + "added": "v23.05", + "description": [ + "The percentage of the 6-block fee estimate to use for commitment transactions." + ] + }, + "min-emergency-msat": { + "type": "msat", + "added": "v23.08", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "commit-feerate-offset": { + "type": "u32", + "added": "v23.11", + "description": [ + "Additional commitment feerate applied by channel owner." + ] + } + }, + "pre_return_value_notes": [ + "The returned values reflect the current configuration, including showing default values (`dev-` options are not shown unless specified as *config* explicitly).", + "", + "Note: as plugins can add options, not all configuration settings are listed here! The format of each entry is as follows:", + "", + "- **source** (string): source of configuration setting (`file`:`linenum`)", + "- **dynamic** (boolean, optional): true if this option is settable via setconfig", + "- **plugin** (string, optional): set if this is from a plugin", + "", + "Depending on the option type, exactly one of the following is present:", + "", + "- **set** (boolean, optional): for simple flag options", + "- **value_str** (string, optional): for string options", + "- **value_msat** (msat, optional): for msat options", + "- **value_int** (integer, optional): for integer options", + "- **value_bool** (boolean, optional): for boolean options" + ] + }, + "example_json_request": [ + { + "id": "example:listconfigs#1", + "method": "listconfigs", + "params": { + "config": "network" + } + }, + { + "id": "example:listconfigs#2", + "method": "listconfigs", + "params": { + "config": null + } + }, + { + "id": "example:listconfigs#3", + "method": "listconfigs", + "params": { + "config": "experimental-dual-fund" + } + } + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters or field with *config* name doesn't exist." + ], + "example_json_response": [ + { + "#version": "v0.9.0-1", + "lightning-dir": "/media/vincent/Maxtor/sanboxTestWrapperRPC/lightning_dir_dev", + "network": "testnet", + "allow-deprecated-apis": true, + "rpc-file": "lightning-rpc", + "plugins": [ + { + "path": "/home/vincent/Github/plugins/sauron/sauron.py", + "name": "sauron.py", + "options": { + "sauron-api-endpoint": "http://blockstream.info/testnet/api/", + "sauron-tor-proxy": "" + } + }, + { + "path": "/home/vincent/Github/reckless/reckless.py", + "name": "reckless.py" + } + ], + "important-plugins": [ + { + "path": "/home/vincent/Github/lightning/lightningd/../plugins/autoclean", + "name": "autoclean", + "options": { + "autocleaninvoice-cycle": null, + "autocleaninvoice-expired-by": null + } + }, + { + "path": "/home/vincent/Github/lightning/lightningd/../plugins/fundchannel", + "name": "fundchannel" + }, + { + "path": "/home/vincent/Github/lightning/lightningd/../plugins/keysend", + "name": "keysend" + }, + { + "path": "/home/vincent/Github/lightning/lightningd/../plugins/pay", + "name": "pay", + "options": { + "disable-mpp": false + } + } + ], + "important-plugin": "/home/vincent/Github/lightning/lightningd/../plugins/pay", + "plugin": "/home/vincent/Github/reckless/reckless.py", + "disable-plugin": [ + "bcli" + ], + "always-use-proxy": false, + "daemon": "false", + "wallet": "sqlite3:///media/vincent/Maxtor/sanboxTestWrapperRPC/lightning_dir_dev/testnet/lightningd.sqlite3", + "wumbo": true, + "rgb": "03ad98", + "alias": "BRUCEWAYN-TES-DEV", + "pid-file": "/media/vincent/Maxtor/sanboxTestWrapperRPC/lightning_dir_dev/lightningd-testne...", + "ignore-fee-limits": true, + "watchtime-blocks": 6, + "max-locktime-blocks": 2016, + "funding-confirms": 1, + "commit-fee-min": 0, + "commit-fee-max": 0, + "cltv-delta": 6, + "cltv-final": 10, + "commit-time": 10, + "fee-base": 1, + "rescan": 30, + "fee-per-satoshi": 10, + "max-concurrent-htlcs": 483, + "min-capacity-sat": 10000, + "addr": "autotor:127.0.0.1:9051", + "bind-addr": "127.0.0.1:9735", + "announce-addr": "fp463inc4w3lamhhduytrwdwq6q6uzugtaeapylqfc43agrdnnqsheyd.onion:9735", + "offline": "false", + "autolisten": true, + "proxy": "127.0.0.1:9050", + "disable-dns": "false", + "encrypted-hsm": false, + "rpc-file-mode": "0600", + "log-level": "DEBUG", + "log-prefix": "lightningd" + }, + { + "configs": { + "developer": { + "set": true, + "source": "cmdline" + }, + "lightning-dir": { + "value_str": "/tmp/ltests-giwf5tc7/test_plugin_start_1/lightning-1/", + "source": "cmdline" + }, + "network": { + "value_str": "regtest", + "source": "cmdline" + }, + "testnet": { + "set": false, + "source": "default" + }, + "signet": { + "set": false, + "source": "default" + }, + "mainnet": { + "set": false, + "source": "default" + }, + "regtest": { + "set": false, + "source": "default" + }, + "rpc-file": { + "value_str": "lightning-rpc", + "source": "default" + }, + "allow-deprecated-apis": { + "value_bool": false, + "source": "cmdline" + }, + "plugin": { + "values_str": [ + "~/lightning/target/debug/examples/cln-plugin-startup" + ], + "sources": [ + "cmdline" + ] + }, + "plugin-dir": { + "values_str": [], + "sources": [] + }, + "clear-plugins": { + "set": false, + "source": "default" + }, + "disable-plugin": { + "values_str": [], + "sources": [] + }, + "important-plugin": { + "values_str": [], + "sources": [] + }, + "always-use-proxy": { + "value_bool": false, + "source": "default" + }, + "daemon": { + "set": false, + "source": "default" + }, + "experimental-dual-fund": { + "set": false, + "source": "default" + }, + "experimental-splicing": { + "set": false, + "source": "default" + }, + "experimental-onion-messages": { + "set": false, + "source": "default" + }, + "experimental-offers": { + "set": false, + "source": "default" + }, + "experimental-shutdown-wrong-funding": { + "set": false, + "source": "default" + }, + "experimental-peer-storage": { + "set": false, + "source": "default" + }, + "experimental-quiesce": { + "set": false, + "source": "default" + }, + "experimental-anchors": { + "set": false, + "source": "default" + }, + "rgb": { + "value_str": "0266e4", + "source": "default" + }, + "alias": { + "value_str": "JUNIORBEAM-1-102-g7549e10-modded", + "source": "default" + }, + "pid-file": { + "value_str": "/tmp/ltests-giwf5tc7/test_plugin_start_1/lightning-1/lightningd-regtest.pid", + "source": "default" + }, + "ignore-fee-limits": { + "value_bool": false, + "source": "cmdline" + }, + "watchtime-blocks": { + "value_int": 5, + "source": "cmdline" + }, + "max-locktime-blocks": { + "value_int": 2016, + "source": "default" + }, + "funding-confirms": { + "value_int": 1, + "source": "default" + }, + "require-confirmed-inputs": { + "value_bool": false, + "source": "default" + }, + "cltv-delta": { + "value_int": 6, + "source": "cmdline" + }, + "cltv-final": { + "value_int": 5, + "source": "cmdline" + }, + "commit-time": { + "value_int": 10, + "source": "default" + }, + "fee-base": { + "value_int": 1, + "source": "default" + }, + "rescan": { + "value_int": 1, + "source": "cmdline" + }, + "fee-per-satoshi": { + "value_int": 10, + "source": "default" + }, + "htlc-minimum-msat": { + "value_msat": 0, + "source": "default" + }, + "htlc-maximum-msat": { + "value_msat": 18446744073709552000, + "source": "default" + }, + "max-concurrent-htlcs": { + "value_int": 483, + "source": "default" + }, + "max-dust-htlc-exposure-msat": { + "value_msat": 50000000, + "source": "default" + }, + "min-capacity-sat": { + "value_int": 10000, + "source": "default", + "dynamic": true + }, + "addr": { + "values_str": [ + "127.0.0.1:33157" + ], + "sources": [ + "cmdline" + ] + }, + "bind-addr": { + "values_str": [], + "sources": [] + }, + "announce-addr": { + "values_str": [], + "sources": [] + }, + "announce-addr-discovered": { + "value_str": "auto", + "source": "default" + }, + "announce-addr-discovered-port": { + "value_int": 19846, + "source": "default" + }, + "offline": { + "set": false, + "source": "default" + }, + "autolisten": { + "value_bool": false, + "source": "default" + }, + "accept-htlc-tlv-type": { + "values_int": [], + "sources": [] + }, + "disable-dns": { + "set": true, + "source": "cmdline" + }, + "encrypted-hsm": { + "set": false, + "source": "default" + }, + "rpc-file-mode": { + "value_str": "0600", + "source": "default" + }, + "commit-fee": { + "value_int": 100, + "source": "default" + }, + "commit-feerate-offset": { + "value_int": 5, + "source": "default" + }, + "min-emergency-msat": { + "value_msat": 25000000, + "source": "default" + }, + "subdaemon": { + "values_str": [], + "sources": [] + }, + "experimental-upgrade-protocol": { + "set": false, + "source": "default" + }, + "invoices-onchain-fallback": { + "set": false, + "source": "default" + }, + "log-level": { + "value_str": "debug", + "source": "cmdline" + }, + "log-timestamps": { + "value_bool": true, + "source": "default" + }, + "log-prefix": { + "value_str": "lightningd-1 ", + "source": "cmdline" + }, + "log-file": { + "values_str": [ + "-", + "/tmp/ltests-giwf5tc7/test_plugin_start_1/lightning-1/log" + ], + "sources": [ + "cmdline", + "cmdline" + ] + }, + "dev-no-plugin-checksum": { + "set": true, + "source": "cmdline" + }, + "dev-no-reconnect": { + "set": true, + "source": "cmdline" + }, + "dev-fail-on-subdaemon-fail": { + "set": true, + "source": "cmdline" + }, + "dev-bitcoind-poll": { + "value_int": 1, + "source": "cmdline" + }, + "dev-fast-gossip": { + "set": true, + "source": "cmdline" + }, + "renepay-debug-mcf": { + "set": false, + "source": "default", + "plugin": "~/lightning/plugins/cln-renepay" + }, + "renepay-debug-payflow": { + "set": false, + "source": "default", + "plugin": "~/lightning/plugins/cln-renepay" + }, + "test-option": { + "value_int": 31337, + "source": "cmdline", + "plugin": "~/lightning/target/debug/examples/cln-plugin-startup" + }, + "bitcoin-datadir": { + "value_str": "/tmp/ltests-giwf5tc7/test_plugin_start_1/lightning-1/", + "source": "cmdline", + "plugin": "~/lightning/plugins/bcli" + }, + "bitcoin-rpcuser": { + "value_str": "rpcuser", + "source": "cmdline", + "plugin": "~/lightning/plugins/bcli" + }, + "bitcoin-rpcpassword": { + "value_str": "rpcpass", + "source": "cmdline", + "plugin": "~/lightning/plugins/bcli" + }, + "bitcoin-rpcport": { + "value_int": 51309, + "source": "cmdline", + "plugin": "~/lightning/plugins/bcli" + }, + "disable-mpp": { + "set": false, + "source": "default", + "plugin": "~/lightning/plugins/pay" + } + } + }, + { + "configs": { + "experimental-dual-fund": { + "set": false, + "source": "default" + } + } + } + ], + "author": [ + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." + ], + "see_also": [ + "lightning-getinfo(7)", + "lightningd-config(5)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-listdatastore.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listdatastore", + "title": "Command for listing (plugin) data", + "description": [ + "The **listdatastore** RPC command allows plugins to fetch data which was stored in the Core Lightning database." + ], + "request": { + "required": [], + "properties": { + "key": { + "oneOf": [ + { + "type": "array", + "description": [ + "All immediate children of the *key* (or root children) are returned.", + " Using the first element of the key as the plugin name (e.g. `[ 'summary' ]`) is recommended.", + " An array of values to form a hierarchy (though a single value is treated as a one-element array)." + ], + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] + } + } + }, + "response": { + "required": [ + "datastore" + ], + "properties": { + "datastore": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "key" + ], + "properties": { + "key": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Part of the key added to the datastore." + ] + } + }, + "generation": { + "type": "u64", + "description": [ + "The number of times this has been updated." + ] + }, + "hex": { + "type": "hex", + "description": [ + "The hex data from the datastore." + ] + }, + "string": { + "type": "string", + "description": [ + "The data as a string, if it's valid utf-8." + ] + } + } + } + } + } + }, + "errors": [ + "The following error codes may occur:", + "", + "- -32602: invalid parameters." + ], + "example_json_request": [ + { + "id": "example:listdatastore#1", + "method": "listdatastore", + "params": { + "key": [ + "commando" + ] + } + }, + { + "id": "example:listdatastore#2", + "method": "listdatastore", + "params": { + "key": "otherkey" + } + } + ], + "example_json_response": [ + { + "datastore": [] + }, + { + "datastore": [ + { + "key": [ + "otherkey" + ], + "generation": 0, + "hex": "6f7468657264617461", + "string": "otherdata" + } + ] + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-datastore(7)", + "lightning-deldatastore(7)", + "lightning-datastoreusage(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-listforwards.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listforwards", + "title": "Command showing all htlcs and their information", + "description": [ + "The **listforwards** RPC command displays all htlcs that have been attempted to be forwarded by the Core Lightning node." + ], + "request": { + "required": [], + "properties": { + "status": { + "type": "string", + "description": [ + "If specified, then only the forwards with the given status are returned." + ], + "enum": [ + "offered", + "settled", + "local_failed", + "failed" + ] + }, + "in_channel": { + "type": "short_channel_id", + "description": [ + "Only the matching forwards on the given inbound channel are returned." + ] + }, + "out_channel": { + "type": "short_channel_id", + "description": [ + "Only the matching forwards on the given outbount channel are returned." + ] + }, + "index": { + "type": "string", + "added": "v23.11", + "enum": [ + "created", + "updated" + ], + "description": [ + "If neither *in_channel* nor *out_channel* is specified, it controls ordering." + ], + "default": "`created`" + }, + "start": { + "type": "u64", + "added": "v23.11", + "description": [ + "If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)." + ] + }, + "limit": { + "type": "u32", + "added": "v23.11", + "description": [ + "If `index` is specified, `limit` can be used to specify the maximum number of entries to return." + ] + } + }, + "dependentUpon": { + "index": [ + "start", + "limit" + ] + } + }, + "response": { + "required": [ + "forwards" + ], + "properties": { + "forwards": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "created_index", + "in_channel", + "in_msat", + "status", + "received_time" + ], + "properties": { + "created_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this forward was created in." + ] + }, + "in_channel": { + "type": "short_channel_id", + "description": [ + "The channel that received the HTLC." + ] + }, + "in_htlc_id": { + "type": "u64", + "description": [ + "The unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11)." + ] + }, + "in_msat": { + "type": "msat", + "description": [ + "The value of the incoming HTLC." + ] + }, + "status": { + "type": "string", + "enum": [ + "offered", + "settled", + "local_failed", + "failed" + ], + "description": [ + "Still ongoing, completed, failed locally, or failed after forwarding." + ] + }, + "received_time": { + "type": "number", + "description": [ + "The UNIX timestamp when this was received." + ] + }, + "out_channel": { + "type": "short_channel_id", + "description": [ + "The channel that the HTLC (trying to) forward to." + ] + }, + "out_htlc_id": { + "type": "u64", + "description": [ + "The unique HTLC id we gave this when sending (may be missing even if out_channel is present, for old forwards before v22.11)." + ] + }, + "updated_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this forward was changed (only present if it has changed since creation)." + ] + }, + "style": { + "type": "string", + "enum": [ + "legacy", + "tlv" + ], + "description": [ + "Either a legacy onion format or a modern tlv format." + ] + } + }, + "allOf": [ + { + "if": { + "required": [ + "out_msat" + ] + }, + "then": { + "additionalProperties": false, + "required": [ + "fee_msat", + "out_msat", + "out_channel" + ], + "properties": { + "created_index": {}, + "updated_index": {}, + "in_channel": {}, + "in_htlc_id": {}, + "in_msatoshi": {}, + "in_msat": {}, + "status": {}, + "style": {}, + "received_time": {}, + "resolved_time": {}, + "out_channel": {}, + "out_htlc_id": {}, + "failcode": {}, + "failreason": {}, + "fee_msat": { + "type": "msat", + "description": [ + "The amount this paid in fees." + ] + }, + "out_msat": { + "type": "msat", + "description": [ + "The amount we sent out the *out_channel*." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [], + "properties": { + "created_index": {}, + "updated_index": {}, + "in_channel": {}, + "in_htlc_id": {}, + "in_msatoshi": {}, + "in_msat": {}, + "status": {}, + "style": {}, + "received_time": {}, + "resolved_time": {}, + "failcode": {}, + "failreason": {}, + "out_channel": {} + } + } + }, + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "settled", + "failed" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "resolved_time" + ], + "properties": { + "created_index": {}, + "updated_index": {}, + "in_channel": {}, + "in_htlc_id": {}, + "in_msatoshi": {}, + "in_msat": {}, + "status": {}, + "style": {}, + "received_time": {}, + "out_channel": {}, + "out_htlc_id": {}, + "fee": {}, + "fee_msat": {}, + "out_msatoshi": {}, + "out_msat": {}, + "failcode": {}, + "failreason": {}, + "resolved_time": { + "type": "number", + "description": [ + "The UNIX timestamp when this was resolved." + ] + } + } + }, + "else": { + "additionalProperties": false, + "properties": { + "created_index": {}, + "updated_index": {}, + "in_channel": {}, + "in_htlc_id": {}, + "in_msatoshi": {}, + "in_msat": {}, + "status": {}, + "style": {}, + "received_time": {}, + "out_channel": {}, + "out_htlc_id": {}, + "fee": {}, + "fee_msat": {}, + "failcode": {}, + "failreason": {}, + "out_msatoshi": {}, + "out_msat": {} + } + } + }, + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "local_failed", + "failed" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [], + "properties": { + "created_index": {}, + "updated_index": {}, + "in_channel": {}, + "in_htlc_id": {}, + "in_msatoshi": {}, + "in_msat": {}, + "status": {}, + "style": {}, + "received_time": {}, + "out_channel": {}, + "out_htlc_id": {}, + "fee": {}, + "fee_msat": {}, + "out_msatoshi": {}, + "out_msat": {}, + "resolved_time": {}, + "failcode": { + "type": "u32", + "description": [ + "The numeric onion code returned." + ] + }, + "failreason": { + "type": "string", + "description": [ + "The name of the onion code returned." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [], + "properties": { + "created_index": {}, + "updated_index": {}, + "in_channel": {}, + "in_htlc_id": {}, + "in_msatoshi": {}, + "in_msat": {}, + "status": {}, + "style": {}, + "received_time": {}, + "out_channel": {}, + "out_htlc_id": {}, + "fee": {}, + "fee_msat": {}, + "out_msatoshi": {}, + "out_msat": {}, + "resolved_time": {} + } + } + } + ] + } + } + } + }, + "example_json_request": [ + { + "id": "example:listforwards#1", + "method": "listforwards", + "params": { + "status": null, + "in_channel": null, + "out_channel": null, + "index": null, + "start": null, + "limit": null + } + }, + { + "id": "example:listforwards#2", + "method": "listforwards", + "params": { + "in_channel": "0x1x2", + "out_channel": "0x2x3", + "status": "settled" + } + } + ], + "example_json_response": [ + { + "forwards": [ + { + "created_index": 1, + "updated_index": 1, + "in_channel": "103x1x0", + "in_htlc_id": 0, + "out_channel": "104x1x0", + "out_htlc_id": 0, + "in_msat": 100001001, + "out_msat": 100000000, + "fee_msat": 1001, + "status": "settled", + "style": "tlv", + "received_time": 1706229285.5934534, + "resolved_time": 1706229288.830004 + }, + { + "created_index": 2, + "updated_index": 2, + "in_channel": "103x1x0", + "in_htlc_id": 1, + "out_channel": "105x1x0", + "out_htlc_id": 0, + "in_msat": 100001001, + "out_msat": 100000000, + "fee_msat": 1001, + "status": "failed", + "style": "tlv", + "received_time": 1706229290.0289993, + "resolved_time": 1706229292.9487684 + }, + { + "created_index": 3, + "updated_index": 3, + "in_channel": "103x1x0", + "in_htlc_id": 2, + "out_channel": "106x1x0", + "out_htlc_id": 0, + "in_msat": 100001000, + "out_msat": 99999999, + "fee_msat": 1001, + "status": "local_failed", + "failcode": 16392, + "failreason": "WIRE_PERMANENT_CHANNEL_FAILURE", + "style": "tlv", + "received_time": 1706229295.3175724 + } + ] + }, + { + "forwards": [] + } + ], + "author": [ + "Rene Pickhardt <> is mainly responsible." + ], + "see_also": [ + "lightning-autoclean-status(7)", + "lightning-getinfo(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-listfunds.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listfunds", + "title": "Command showing all funds currently managed by the Core Lightning node", + "description": [ + "The **listfunds** RPC command displays all funds available, either in unspent outputs (UTXOs) in the internal wallet or funds locked in currently open channels." + ], + "request": { + "required": [], + "properties": { + "spent": { + "type": "boolean", + "description": [ + "If True, then the *outputs* will include spent outputs in addition to the unspent ones." + ], + "default": "False" + } + } + }, + "response": { + "required": [ + "outputs", + "channels" + ], + "properties": { + "outputs": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "txid", + "output", + "amount_msat", + "scriptpubkey", + "status", + "reserved" + ], + "properties": { + "txid": { + "type": "txid", + "description": [ + "The ID of the spendable transaction." + ] + }, + "output": { + "type": "u32", + "description": [ + "The index within *txid*." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount of the output." + ] + }, + "scriptpubkey": { + "type": "hex", + "description": [ + "The scriptPubkey of the output." + ] + }, + "address": { + "type": "string", + "description": [ + "The bitcoin address of the output." + ] + }, + "redeemscript": { + "type": "hex", + "description": [ + "The redeemscript, only if it's p2sh-wrapped." + ] + }, + "status": { + "type": "string", + "enum": [ + "unconfirmed", + "confirmed", + "spent", + "immature" + ] + }, + "reserved": { + "type": "boolean", + "description": [ + "Whether this UTXO is currently reserved for an in-flight tx." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "confirmed" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "blockheight" + ], + "properties": { + "txid": {}, + "output": {}, + "amount_msat": {}, + "scriptpubkey": {}, + "address": {}, + "value": {}, + "redeemscript": {}, + "status": {}, + "reserved": {}, + "reserved_to_block": {}, + "blockheight": { + "type": "u32", + "description": [ + "Block height where it was confirmed." + ] + } + } + } + }, + { + "if": { + "properties": { + "reserved": { + "type": "boolean", + "enum": [ + "true" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "reserved_to_block" + ], + "properties": { + "txid": {}, + "output": {}, + "amount_msat": {}, + "scriptpubkey": {}, + "address": {}, + "value": {}, + "redeemscript": {}, + "status": {}, + "blockheight": {}, + "reserved": {}, + "reserved_to_block": { + "type": "u32", + "description": [ + "Block height where reservation will expire." + ] + } + } + } + } + ] + } + }, + "channels": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "peer_id", + "our_amount_msat", + "amount_msat", + "funding_txid", + "funding_output", + "connected", + "state", + "channel_id" + ], + "properties": { + "peer_id": { + "type": "pubkey", + "description": [ + "The peer with which the channel is opened." + ] + }, + "our_amount_msat": { + "type": "msat", + "description": [ + "Available satoshis on our node's end of the channel." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Total channel value." + ] + }, + "funding_txid": { + "type": "txid", + "description": [ + "Funding transaction id." + ] + }, + "funding_output": { + "type": "u32", + "description": [ + "The 0-based index of the output in the funding transaction." + ] + }, + "connected": { + "type": "boolean", + "description": [ + "Whether the channel peer is connected." + ] + }, + "state": { + "type": "string", + "enum": [ + "OPENINGD", + "CHANNELD_AWAITING_LOCKIN", + "CHANNELD_NORMAL", + "CHANNELD_SHUTTING_DOWN", + "CLOSINGD_SIGEXCHANGE", + "CLOSINGD_COMPLETE", + "AWAITING_UNILATERAL", + "FUNDING_SPEND_SEEN", + "ONCHAIN", + "DUALOPEND_OPEN_INIT", + "DUALOPEND_AWAITING_LOCKIN", + "DUALOPEND_OPEN_COMMITTED", + "DUALOPEND_OPEN_COMMIT_READY" + ], + "description": [ + "The channel state, in particular `CHANNELD_NORMAL` means the channel can be used normally." + ] + }, + "channel_id": { + "type": "hash", + "description": [ + "The full channel_id (funding txid Xored with output number)." + ], + "added": "v23.05" + } + }, + "allOf": [ + { + "if": { + "properties": { + "state": { + "type": "string", + "enum": [ + "CHANNELD_NORMAL" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "short_channel_id" + ], + "properties": { + "peer_id": {}, + "our_amount_msat": {}, + "channel_sat": {}, + "amount_msat": {}, + "channel_total_sat": {}, + "funding_txid": {}, + "funding_output": {}, + "connected": {}, + "state": {}, + "channel_id": {}, + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "Short channel id of channel." + ] + } + } + } + }, + { + "if": { + "properties": { + "state": { + "type": "string", + "enum": [ + "CHANNELD_SHUTTING_DOWN", + "CLOSINGD_SIGEXCHANGE", + "CLOSINGD_COMPLETE", + "AWAITING_UNILATERAL", + "FUNDING_SPEND_SEEN", + "ONCHAIN" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [], + "properties": { + "peer_id": {}, + "our_amount_msat": {}, + "channel_sat": {}, + "amount_msat": {}, + "channel_total_sat": {}, + "funding_txid": {}, + "funding_output": {}, + "connected": {}, + "state": {}, + "channel_id": {}, + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "Short channel id of channel (only if funding reached lockin depth before closing)." + ] + } + } + } + } + ] + } + } + } + }, + "example_json_request": [ + { + "id": "example:listfunds#1", + "method": "listfunds", + "params": { + "spent": null + } + } + ], + "example_json_response": [ + { + "outputs": [ + { + "txid": "0f184b101569bf777af3449fa266948a9d55768f97867e48416a2c92858dd1bc", + "output": 1, + "amount_msat": 1111111000, + "scriptpubkey": "001401fad90abcd66697e2592164722de4a95ebee165", + "address": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf", + "status": "confirmed", + "blockheight": 102, + "reserved": false + }, + { + "txid": "4bee7dc3a28f2434e9bb3e9aaab418dd276485a8705b0f787bf741d3f979ec3b", + "output": 1, + "amount_msat": 1111111000, + "scriptpubkey": "001401fad90abcd66697e2592164722de4a95ebee165", + "address": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf", + "status": "confirmed", + "blockheight": 102, + "reserved": false + } + ], + "channels": [] + } + ], + "author": [ + "Felix <> is mainly responsible." + ], + "see_also": [ + "lightning-newaddr(7)", + "lightning-fundchannel(7)", + "lightning-withdraw(7)", + "lightning-listtransactions(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-listhtlcs.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listhtlcs", + "title": "Command for querying HTLCs", + "description": [ + "The **listhtlcs** RPC command gets all HTLCs (which, generally, we remember for as long as a channel is open, even if they've completed long ago)." + ], + "request": { + "required": [], + "properties": { + "id": { + "type": "string", + "description": [ + "A short channel id (e.g. 1x2x3) or full 64-byte hex channel id, it will only list htlcs for that channel (which must be known)." + ] + } + } + }, + "response": { + "required": [ + "htlcs" + ], + "properties": { + "htlcs": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "short_channel_id", + "id", + "expiry", + "direction", + "amount_msat", + "payment_hash", + "state" + ], + "properties": { + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "The channel that contains/contained the HTLC." + ] + }, + "id": { + "type": "u64", + "description": [ + "The unique, incrementing HTLC id the creator gave this." + ] + }, + "expiry": { + "type": "u32", + "description": [ + "The block number where this HTLC expires/expired." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The value of the HTLC." + ] + }, + "direction": { + "type": "string", + "enum": [ + "out", + "in" + ], + "description": [ + "Out if we offered this to the peer, in if they offered it." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "Payment hash sought by HTLC." + ] + }, + "state": { + "type": "string", + "enum": [ + "SENT_ADD_HTLC", + "SENT_ADD_COMMIT", + "RCVD_ADD_REVOCATION", + "RCVD_ADD_ACK_COMMIT", + "SENT_ADD_ACK_REVOCATION", + "RCVD_REMOVE_HTLC", + "RCVD_REMOVE_COMMIT", + "SENT_REMOVE_REVOCATION", + "SENT_REMOVE_ACK_COMMIT", + "RCVD_REMOVE_ACK_REVOCATION", + "RCVD_ADD_HTLC", + "RCVD_ADD_COMMIT", + "SENT_ADD_REVOCATION", + "SENT_ADD_ACK_COMMIT", + "RCVD_ADD_ACK_REVOCATION", + "SENT_REMOVE_HTLC", + "SENT_REMOVE_COMMIT", + "RCVD_REMOVE_REVOCATION", + "RCVD_REMOVE_ACK_COMMIT", + "SENT_REMOVE_ACK_REVOCATION" + ], + "description": [ + "The first 10 states are for `in`, the next 10 are for `out`." + ] + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:listhtlcs#1", + "method": "listhtlcs", + "params": "{}" + }, + { + "id": "example:listhtlcs#2", + "method": "listhtlcs", + "params": [ + "103x2x0" + ] + }, + { + "id": "example:listhtlcs#3", + "method": "listhtlcs", + "params": [ + "436c2658eb4f4689b42ff11b8b05f31ba09860d0df7168085e0796cdf40f85e0" + ] + } + ], + "example_json_response": [ + { + "htlcs": [ + { + "short_channel_id": "103x1x0", + "id": 0, + "expiry": 117, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "d2668e77c5a2220496e813de36f1fc09ba804b16af4c6bb38299d8a6eb8a5f10", + "state": "RCVD_REMOVE_ACK_REVOCATION" + }, + { + "short_channel_id": "103x1x0", + "id": 1, + "expiry": 117, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "286e08ac8f575f10508d751fcfc93871b4344271967c7b9e5eacb3f3573b8307", + "state": "RCVD_REMOVE_ACK_REVOCATION" + }, + { + "short_channel_id": "103x1x0", + "id": 2, + "expiry": 135, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "3e4baa750ee3dfb934578f041ccb40b87432bf37ec65c9d7bce5ff28fecbd95f", + "state": "RCVD_REMOVE_ACK_REVOCATION" + }, + { + "short_channel_id": "103x1x0", + "id": 3, + "expiry": 135, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "4c3ce32565dc10ef2bd230c32802ce2fe8b007208c0a90757aa289f75c994d49", + "state": "SENT_REMOVE_REVOCATION" + } + ] + }, + { + "htlcs": [ + { + "short_channel_id": "103x2x0", + "id": 0, + "expiry": 117, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "12bb14b1d119e1ae0759e5ff6f1f6653e3fd8f71ea59411500d2871404a47a98", + "state": "RCVD_REMOVE_ACK_REVOCATION" + }, + { + "short_channel_id": "103x2x0", + "id": 1, + "expiry": 117, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "57d950209cc0b4fcc5e3027569232f96cf83ef85314c6b139a5713848d811a66", + "state": "RCVD_REMOVE_ACK_REVOCATION" + }, + { + "short_channel_id": "103x2x0", + "id": 2, + "expiry": 135, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "45ad4654715411a07a0ad6ec3f4bfaa918c90e3d1934b10b1c1c5846523ddd7f", + "state": "RCVD_REMOVE_ACK_REVOCATION" + }, + { + "short_channel_id": "103x2x0", + "id": 3, + "expiry": 135, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "cc0dcd214aa71c62bfba711a0746da821f2cdba1770b11c225920bdde12c931e", + "state": "RCVD_REMOVE_ACK_REVOCATION" + } + ] + }, + { + "htlcs": [ + { + "short_channel_id": "103x1x0", + "id": 0, + "expiry": 124, + "direction": "out", + "amount_msat": 1001, + "payment_hash": "2ab653668c8017ff2f36ac36678a8da04e11380bd9580a2926b170523b0c6e3b", + "state": "RCVD_REMOVE_ACK_REVOCATION" + }, + { + "short_channel_id": "103x1x0", + "id": 1, + "expiry": 124, + "direction": "out", + "amount_msat": 2001, + "payment_hash": "92f889cb2e48aa28e1e577228b907cdbcc371a2c018e9c8f60fa7036e232cf1d", + "state": "RCVD_REMOVE_ACK_REVOCATION" + }, + { + "short_channel_id": "103x1x0", + "id": 2, + "expiry": 128, + "direction": "out", + "amount_msat": 4001, + "payment_hash": "14ef01c9fb12d7dcac288f48ce87b19a7d5c3d5779aaed1e4adcb5c5d0e9fa45", + "state": "RCVD_REMOVE_ACK_REVOCATION" + } + ] + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listforwards(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-listinvoicerequests.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v22.11", + "rpc": "listinvoicerequests", + "title": "Command for querying invoice_request status", + "description": [ + "The **listinvoicerequests** RPC command gets the status of a specific `invoice_request`, if it exists, or the status of all `invoice_requests` if given no argument." + ], + "request": { + "required": [], + "properties": { + "invreq_id": { + "type": "string", + "description": [ + "A specific invoice can be queried by providing the `invreq_id`, which is presented by lightning-invoicerequest(7), or can be calculated from a bolt12 invoice." + ] + }, + "active_only": { + "type": "boolean", + "description": [ + "If it is *True* then only active invoice requests are returned." + ], + "default": "*False*" + } + } + }, + "response": { + "required": [ + "invoicerequests" + ], + "properties": { + "invoicerequests": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "invreq_id", + "single_use", + "active", + "bolt12", + "used" + ], + "properties": { + "invreq_id": { + "type": "hash", + "description": [ + "The SHA256 hash of all invoice_request fields less than 160." + ] + }, + "active": { + "type": "boolean", + "description": [ + "Whether the invoice_request is currently active." + ] + }, + "single_use": { + "type": "boolean", + "description": [ + "Whether the invoice_request will become inactive after we pay an invoice for it." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string starting with lnr." + ] + }, + "used": { + "type": "boolean", + "description": [ + "Whether the invoice_request has already been used." + ] + }, + "label": { + "type": "string", + "description": [ + "The label provided when creating the invoice_request." + ] + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:listinvoicerequests#1", + "method": "listinvoicerequests", + "params": [ + "cf0b41d4eb248d975909deb9accf9722b1c86839de80ee8815ce907bbb700a1d" + ] + } + ], + "example_json_response": [ + { + "invoicerequests": [ + { + "invreq_id": "cf0b41d4eb248d975909deb9accf9722b1c86839de80ee8815ce907bbb700a1d", + "active": true, + "single_use": true, + "bolt12": "lnr1qqgx9ag7nmtns87htndlgcfndlq0wzstwd5k6urvv5s8getnw3gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02gzqta0pqpvzzqnxu3vc68fug904w25y3zpskc8huazwmy34av93h2fjswe3tsp4rrcyps5sf5jwnn2tr3ghn32mdta8jvax62pwzhna8sktmaezl3f4s3zy35gx6dfay7r8zn299uwr7ugpze74zft4m8q3fnk2sr0ljqpve3jq", + "used": false + } + ] + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-invoicerequests(7)", + "lightning-disableinvoicerequest(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-listinvoices.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listinvoices", + "title": "Command for querying invoice status", + "description": [ + "The **listinvoices** RPC command gets the status of a specific invoice, if it exists, or the status of all invoices if given no argument.", + "", + "Only one of the query parameters can be used from *label*, *invstring*, *payment_hash*, or *offer_id*." + ], + "request": { + "required": [], + "properties": { + "label": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "description": [ + "A label used a the creation of the invoice to get a specific invoice." + ] + }, + "invstring": { + "type": "string", + "description": [ + "The string value to query a specific invoice." + ] + }, + "payment_hash": { + "type": "hex", + "description": [ + "A payment_hash of the invoice to get the details of a specific invoice." + ] + }, + "offer_id": { + "type": "string", + "description": [ + "A local `offer_id` the invoice was issued for a specific invoice details." + ] + }, + "index": { + "type": "string", + "added": "v23.08", + "enum": [ + "created", + "updated" + ], + "description": [ + "If neither *in_channel* nor *out_channel* is specified, it controls ordering." + ], + "default": "`created`" + }, + "start": { + "type": "u64", + "added": "v23.08", + "description": [ + "If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)." + ] + }, + "limit": { + "type": "u32", + "added": "v23.08", + "description": [ + "If `index` is specified, `limit` can be used to specify the maximum number of entries to return." + ] + } + }, + "dependentUpon": { + "index": [ + "start", + "limit" + ] + } + }, + "response": { + "required": [ + "invoices" + ], + "properties": { + "invoices": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "label", + "created_index", + "payment_hash", + "status", + "expires_at" + ], + "properties": { + "label": { + "type": "string", + "description": [ + "Unique label supplied at invoice creation." + ] + }, + "description": { + "type": "string", + "description": [ + "Description used in the invoice." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "unpaid", + "paid", + "expired" + ], + "description": [ + "Whether it's paid, unpaid or unpayable." + ] + }, + "expires_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when it will become / became unpayable." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount required to pay this invoice." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The BOLT11 string (always present unless *bolt12* is)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The BOLT12 string (always present unless *bolt11* is)." + ] + }, + "local_offer_id": { + "type": "hash", + "description": [ + "The *id* of our offer which created this invoice (**experimental-offers** only)." + ] + }, + "invreq_payer_note": { + "type": "string", + "description": [ + "The optional *invreq_payer_note* from invoice_request which created this invoice (**experimental-offers** only)." + ] + }, + "created_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was created in." + ] + }, + "updated_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was changed (only present if it has changed since creation)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "paid" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "pay_index", + "amount_received_msat", + "paid_at", + "payment_preimage" + ], + "properties": { + "label": {}, + "description": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "bolt11": {}, + "bolt12": {}, + "local_offer_id": {}, + "invreq_payer_note": {}, + "expires_at": {}, + "created_index": {}, + "updated_index": {}, + "pay_index": { + "type": "u64", + "description": [ + "Unique incrementing index for this payment." + ] + }, + "amount_received_msat": { + "type": "msat", + "description": [ + "The amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)." + ] + }, + "paid_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when it was paid." + ] + }, + "paid_outpoint": { + "type": "object", + "description": [ + "Outpoint this invoice was paid with." + ], + "added": "v23.11", + "additionalProperties": false, + "required": [ + "txid", + "outnum" + ], + "properties": { + "txid": { + "added": "v23.11", + "type": "txid", + "description": [ + "ID of the transaction that paid the invoice." + ] + }, + "outnum": { + "added": "v23.11", + "type": "u32", + "description": [ + "The 0-based output number of the transaction that paid the invoice." + ] + } + } + }, + "payment_preimage": { + "type": "secret", + "description": [ + "Proof of payment." + ] + } + } + }, + "else": { + "additionalProperties": false, + "properties": { + "label": {}, + "description": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "bolt11": {}, + "bolt12": {}, + "local_offer_id": {}, + "invreq_payer_note": {}, + "created_index": {}, + "updated_index": {}, + "expires_at": {} + } + } + } + ] + } + } + } + }, + "example_json_request": [ + { + "id": "example:listinvoices#1", + "method": "listinvoices", + "params": { + "label": "xEoCR94SIz6UIRUEkxum", + "payment_hash": null, + "invstring": null, + "offer_id": null, + "index": null, + "start": null, + "limit": null + } + } + ], + "example_json_response": [ + { + "invoices": [ + { + "label": "xEoCR94SIz6UIRUEkxum", + "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk", + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "amount_msat": 11000000, + "status": "unpaid", + "description": [ + "XEoCR94SIz6UIRUEkxum." + ], + "expires_at": 1706757730, + "created_index": 1 + } + ] + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-waitinvoice(7)", + "lightning-delinvoice(7)", + "lightning-invoice(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-listnodes.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listnodes", + "title": "Command to get the list of nodes in the known network.", + "description": [ + "The **listnodes** command returns nodes the node has learned about via gossip messages, or a single one if the node *id* was specified." + ], + "request": { + "required": [], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The public key of the node to list." + ] + } + } + }, + "response": { + "required": [ + "nodes" + ], + "properties": { + "nodes": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "nodeid" + ], + "properties": { + "nodeid": { + "type": "pubkey", + "description": [ + "The public key of the node." + ] + }, + "last_timestamp": { + "type": "u32", + "description": [ + "A node_announcement has been received for this node (UNIX timestamp)." + ] + } + }, + "allOf": [ + { + "if": { + "required": [ + "last_timestamp" + ] + }, + "then": { + "additionalProperties": false, + "required": [ + "nodeid", + "last_timestamp", + "alias", + "color", + "features", + "addresses" + ], + "properties": { + "nodeid": {}, + "last_timestamp": {}, + "option_will_fund": {}, + "alias": { + "type": "string", + "description": [ + "The fun alias this node advertized." + ], + "maxLength": 32 + }, + "color": { + "type": "hex", + "description": [ + "The favorite RGB color this node advertized." + ], + "minLength": 6, + "maxLength": 6 + }, + "features": { + "type": "hex", + "description": [ + "BOLT #9 features bitmap this node advertized." + ] + }, + "addresses": { + "type": "array", + "description": [ + "The addresses this node advertized." + ], + "items": { + "type": "object", + "required": [ + "type", + "port" + ], + "additionalProperties": true, + "properties": { + "type": { + "type": "string", + "enum": [ + "dns", + "ipv4", + "ipv6", + "torv2", + "torv3" + ], + "description": [ + "Type of connection (until 23.08, `websocket` was also allowed)." + ] + }, + "port": { + "type": "u16", + "description": [ + "Port number." + ] + } + }, + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "dns", + "ipv4", + "ipv6", + "torv2", + "torv3" + ] + } + } + }, + "then": { + "required": [ + "type", + "address", + "port" + ], + "additionalProperties": false, + "properties": { + "type": {}, + "port": {}, + "address": { + "type": "string", + "description": [ + "Address in expected format for **type**." + ] + } + } + }, + "else": { + "required": [ + "type", + "port" + ], + "additionalProperties": false, + "properties": { + "type": {}, + "port": {} + } + } + } + } + } + }, + "else": { + "additionalProperties": false, + "properties": { + "nodeid": {} + } + } + }, + { + "if": { + "required": [ + "option_will_fund" + ] + }, + "then": { + "additionalProperties": true, + "required": [ + "option_will_fund" + ], + "properties": { + "option_will_fund": { + "type": "object", + "additionalProperties": false, + "required": [ + "lease_fee_base_msat", + "lease_fee_basis", + "funding_weight", + "channel_fee_max_base_msat", + "channel_fee_max_proportional_thousandths", + "compact_lease" + ], + "properties": { + "lease_fee_base_msat": { + "type": "msat", + "description": [ + "The fixed fee for a lease (whole number of satoshis)." + ] + }, + "lease_fee_basis": { + "type": "u32", + "description": [ + "The proportional fee in basis points (parts per 10,000) for a lease." + ] + }, + "funding_weight": { + "type": "u32", + "description": [ + "The onchain weight you'll have to pay for a lease." + ] + }, + "channel_fee_max_base_msat": { + "type": "msat", + "description": [ + "The maximum base routing fee this node will charge during the lease." + ] + }, + "channel_fee_max_proportional_thousandths": { + "type": "u32", + "description": [ + "The maximum proportional routing fee this node will charge during the lease (in thousandths, not millionths like channel_update)." + ] + }, + "compact_lease": { + "type": "hex", + "description": [ + "The lease as represented in the node_announcement." + ] + } + } + } + } + } + } + ] + } + } + } + }, + "example_json_request": [ + { + "id": "example:listnodes#1", + "method": "listnodes", + "params": { + "id": "02e29856dab8ddd9044c18486e4cab79ec717b490447af2d4831e290e48d57638a" + } + }, + { + "id": "example:listnodes#2", + "method": "listnodes", + "params": { + "id": null + } + } + ], + "example_json_response": [ + { + "nodes": [ + { + "nodeid": "02e29856dab8ddd9044c14586e4cab79ec717b490447af2d4831e290e48d58638a", + "alias": "some_alias", + "color": "68f442", + "last_timestamp": 1597213741, + "features": "02a2a1", + "addresses": [ + { + "type": "ipv4", + "address": "zzz.yy.xx.xx", + "port": 9735 + } + ] + } + ] + }, + { + "nodes": [ + { + "nodeid": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "alias": "SILENTARTIST-v23.11-415-gd120eba", + "color": "022d22", + "last_timestamp": 1708624765, + "features": "88a0000a8a5961", + "addresses": [] + }, + { + "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "alias": "JUNIORBEAM-v23.11-415-gd120eba", + "color": "0266e4", + "last_timestamp": 1708624765, + "features": "88a0000a8a5961", + "addresses": [] + }, + { + "nodeid": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "alias": "HOPPINGFIRE-v23.11-415-gd120eba", + "color": "035d2b", + "last_timestamp": 1708624765, + "features": "88a0000a8a5961", + "addresses": [] + }, + { + "nodeid": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", + "alias": "JUNIORFELONY-v23.11-415-gd120eba", + "color": "0382ce", + "last_timestamp": 1708624766, + "features": "88a0000a8a5961", + "addresses": [] + } + ] + } + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters." + ], + "author": [ + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." + ], + "see_also": [ + "lightning-listchannels(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-listoffers.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listoffers", + "title": "Command for listing offers", + "warning": "experimental-offers only", + "description": [ + "The **listoffers** RPC command list all offers, or with `offer_id`, only the offer with that offer_id (if it exists)." + ], + "request": { + "required": [], + "properties": { + "offer_id": { + "type": "hash", + "description": [ + "Offer_id to get details for (if it exists)." + ] + }, + "active_only": { + "type": "boolean", + "description": [ + "If set and is true, only offers with `active` true are returned." + ] + } + } + }, + "response": { + "required": [ + "offers" + ], + "properties": { + "offers": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "offer_id", + "active", + "single_use", + "bolt12", + "used" + ], + "properties": { + "offer_id": { + "type": "hash", + "description": [ + "The id of this offer (merkle hash of non-signature fields)." + ] + }, + "active": { + "type": "boolean", + "description": [ + "Whether this can still be used." + ] + }, + "single_use": { + "type": "boolean", + "description": [ + "Whether this expires as soon as it's paid." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 encoding of the offer." + ] + }, + "used": { + "type": "boolean", + "description": [ + "True if an associated invoice has been paid." + ] + }, + "label": { + "type": "string", + "description": [ + "The (optional) user-specified label." + ] + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:listoffers#1", + "method": "listoffers", + "params": { + "active_only": true + } + }, + { + "id": "example:listoffers#2", + "method": "listoffers", + "params": [ + "f61cca153d1948dade19349792d9bcdc9cef687fd27db0b553a67979f55aae48" + ] + } + ], + "example_json_response": [ + { + "offers": [ + { + "offer_id": "053a5c566fbea2681a5ff9c05a913da23e45b95d09ef5bd25d7d408f23da7084", + "active": true, + "single_use": false, + "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqvqcdgq2z9pk7enxv4jjqen0wgs8yatnw3ujz83qkc6rvp4j28rt3dtrn32zkvdy7efhnlrpr5rp5geqxs783wtlj550qs8czzku4nk3pqp6m593qxgunzuqcwkmgqkmp6ty0wyvjcqdguv3pnpukedwn6cr87m89t74h3auyaeg89xkvgzpac70z3m9rn5xzu28c", + "used": false + }, + { + "offer_id": "3247d3597fec19e362ca683416a48a0f76a44c1600725a7ee1936548feadacca", + "active": true, + "single_use": false, + "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcxqd24x3qgqgqlgzs3gdhkven9v5sxvmmjype82um50ys3ug9kxsmqdvj3c6ut2cuu2s4nrf8k2dulccgaqcdzxgp583utjlu49rcyqt8hc3s797umxn3r9367rdqc577rma7key58fywkajxnuzyapge86hj2pg80rjrma40xdqrxnsnva5l3ce7hz4ua8wf755dees4y9vnq", + "used": true + } + ] + }, + { + "offers": [ + { + "offer_id": "f61cca153d1948dade19349792d9bcdc9cef687fd27db0b553a67979f55aae48", + "active": true, + "single_use": false, + "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqyqs5rn5v4ehggrxdaezqvtdwdshg93pqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq63s", + "used": false + } + ] + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-offer(7)", + "lightning-listoffers(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-listpays.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listpays", + "title": "Command for querying payment status", + "description": [ + "The **listpay** RPC command gets the status of all *pay* commands, or a single one if either *bolt11* or *payment_hash* was specified." + ], + "request": { + "required": [], + "properties": { + "bolt11": { + "type": "string", + "description": [ + "Bolt11 string to get the payment details." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "Payment hash to get the payment details." + ] + }, + "status": { + "type": "string", + "description": [ + "To filter the payment by status." + ], + "enum": [ + "pending", + "complete", + "failed" + ] + } + } + }, + "response": { + "required": [ + "pays" + ], + "properties": { + "pays": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "payment_hash", + "status", + "created_at" + ], + "properties": { + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "pending", + "failed", + "complete" + ], + "description": [ + "Status of the payment." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment if known." + ] + }, + "created_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "completed_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was completed." + ] + }, + "label": { + "type": "string", + "description": [ + "The label, if given to sendpay." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string (if pay supplied one)." + ] + }, + "description": { + "type": "string", + "description": [ + "The description matching the bolt11 description hash (if pay supplied one)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string (if supplied for pay: **experimental-offers** only)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "complete" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "amount_sent_msat", + "preimage" + ], + "properties": { + "payment_hash": {}, + "status": {}, + "destination": {}, + "created_at": {}, + "completed_at": {}, + "label": {}, + "bolt11": {}, + "description": {}, + "bolt12": {}, + "amount_msat": { + "type": "msat", + "description": [ + "The amount of millisatoshi we intended to send to the destination." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "The amount of millisatoshi we sent in order to pay (may include fees and not match amount_msat)." + ] + }, + "preimage": { + "type": "secret", + "description": [ + "Proof of payment." + ] + }, + "number_of_parts": { + "type": "u64", + "description": [ + "The number of parts for a successful payment (only if more than one)." + ] + } + } + } + }, + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "failed" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "amount_sent_msat" + ], + "properties": { + "payment_hash": {}, + "status": {}, + "destination": {}, + "created_at": {}, + "label": {}, + "bolt11": {}, + "description": {}, + "bolt12": {}, + "amount_sent_msat": {}, + "erroronion": { + "type": "hex", + "description": [ + "The error onion returned on failure, if any." + ] + } + } + } + } + ] + } + } + }, + "post_return_value_notes": [ + "The returned array is ordered by increasing **created_at** fields." + ] + }, + "example_json_request": [ + { + "id": "example:listpays#1", + "method": "listpays", + "params": { + "bolt11": "lnbcrt123n1pjmxp7qsp5hxu7u28y0nx4v689u3hwzdzse2w9yaylhheavf9dxvwtdup7pvespp5ha66gxse68j4n6755v7299dnmq4w34gp0znxu0xzahdc43zrg40qdq5v3jhxcmjd9c8g6t0dc6sxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgqk74dvqlvr92ayy5s7x0r0u9xywez6wu4h8pfta386cw6x7cdrvn8pz87kyg5c930aent423gm9ylpaw5p35k72f02hg0s9dulg4d8fqpgj7gpm", + "payment_hash": null, + "status": null + } + }, + { + "id": "example:listpays#2", + "method": "listpays", + "params": { + "bolt11": "lnbcrt123n1pjmxp7qsp5u84368dz7yhzcqm955h96wdqch7uarasun45cr0vs5d8t0cv5avqpp5r9p0dp92guaatrmhf302m0dyj4n79gk93qu2l5tagfxq3dedgfqsdq5v3jhxcmjd9c8g6t0dc6qxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgq46wu0fznfx27rcnyzhcttf8yqx3lwqs482yxlead0fyt8mefrrrj5m379fa5qukgquf9tnwsuj3nnfmwkzkfg6pyhzq6w8gauuh6m5cqgur64n", + "payment_hash": null, + "status": null + } + } + ], + "example_json_response": [ + { + "pays": [ + { + "bolt11": "lnbcrt123n1pjmxp7qsp5hxu7u28y0nx4v689u3hwzdzse2w9yaylhheavf9dxvwtdup7pvespp5ha66gxse68j4n6755v7299dnmq4w34gp0znxu0xzahdc43zrg40qdq5v3jhxcmjd9c8g6t0dc6sxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgqk74dvqlvr92ayy5s7x0r0u9xywez6wu4h8pfta386cw6x7cdrvn8pz87kyg5c930aent423gm9ylpaw5p35k72f02hg0s9dulg4d8fqpgj7gpm", + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "payment_hash": "bf75a41a19d1e559ebd4a33ca295b3d82ae8d50178a66e3cc2eddb8ac443455e", + "status": "failed", + "created_at": 1706231854, + "amount_sent_msat": 0 + } + ] + }, + { + "pays": [ + { + "bolt11": "lnbcrt123n1pjmxp7qsp5u84368dz7yhzcqm955h96wdqch7uarasun45cr0vs5d8t0cv5avqpp5r9p0dp92guaatrmhf302m0dyj4n79gk93qu2l5tagfxq3dedgfqsdq5v3jhxcmjd9c8g6t0dc6qxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgq46wu0fznfx27rcnyzhcttf8yqx3lwqs482yxlead0fyt8mefrrrj5m379fa5qukgquf9tnwsuj3nnfmwkzkfg6pyhzq6w8gauuh6m5cqgur64n", + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "payment_hash": "1942f684aa473bd58f774c5eadbda49567e2a2c58838afd17d424c08b72d4241", + "status": "complete", + "created_at": 1706231849, + "completed_at": 1706231854, + "preimage": "89ce412a2089cbcb72a73ce755337cf693859ea58f21ef0d1caf286a9b0f2a7c", + "amount_msat": 12300, + "amount_sent_msat": 12301 + } + ] + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-pay(7)", + "lightning-paystatus(7)", + "lightning-listsendpays(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-listpeerchannels.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.02", + "rpc": "listpeerchannels", + "title": "Command returning data on channels of connected lightning nodes", + "description": [ + "The **listpeerchannels** RPC command returns data on channels of the network, with the possibility to filter the channels by node id.", + "", + "If no *id* is supplied, then channel data on all lightning nodes that are connected, or not connected but have open channels with this node, are returned." + ], + "request": { + "required": [], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "If supplied, limits the channels to just the peer with the given ID, if it exists." + ] + } + } + }, + "response": { + "required": [ + "channels" + ], + "properties": { + "channels": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "state", + "opener", + "features", + "peer_connected", + "peer_id" + ], + "properties": { + "peer_id": { + "type": "pubkey", + "description": [ + "Node Public key." + ] + }, + "peer_connected": { + "type": "boolean", + "description": [ + "A boolean flag that is set to true if the peer is online." + ] + }, + "reestablished": { + "type": "boolean", + "added": "v24.02", + "description": [ + "A boolean flag that is set to true if we have successfully exchanged reestablish messages with this connection." + ] + }, + "state": { + "type": "string", + "enum": [ + "OPENINGD", + "CHANNELD_AWAITING_LOCKIN", + "CHANNELD_NORMAL", + "CHANNELD_SHUTTING_DOWN", + "CLOSINGD_SIGEXCHANGE", + "CLOSINGD_COMPLETE", + "AWAITING_UNILATERAL", + "FUNDING_SPEND_SEEN", + "ONCHAIN", + "DUALOPEND_OPEN_INIT", + "DUALOPEND_AWAITING_LOCKIN", + "CHANNELD_AWAITING_SPLICE", + "DUALOPEND_OPEN_COMMITTED", + "DUALOPEND_OPEN_COMMIT_READY" + ], + "description": [ + "The channel state, in particular `CHANNELD_NORMAL` means the channel can be used normally." + ] + }, + "scratch_txid": { + "type": "txid", + "description": [ + "The txid we would use if we went onchain now." + ] + }, + "channel_type": { + "type": "object", + "description": [ + "Channel_type as negotiated with peer." + ], + "added": "v23.05", + "additionalProperties": false, + "required": [ + "bits", + "names" + ], + "properties": { + "bits": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + }, + "names": { + "type": "array", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "items": { + "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" + ], + "description": [ + "Name of feature bit." + ] + } + } + } + }, + "updates": { + "type": "object", + "added": "v24.02", + "description": [ + "Latest gossip updates sent/received." + ], + "additionalProperties": false, + "required": [ + "local" + ], + "properties": { + "local": { + "type": "object", + "description": [ + "Our gossip for channel." + ], + "additionalProperties": false, + "added": "v24.02", + "required": [ + "htlc_minimum_msat", + "htlc_maximum_msat", + "cltv_expiry_delta", + "fee_base_msat", + "fee_proportional_millionths" + ], + "properties": { + "htlc_minimum_msat": { + "type": "msat", + "added": "v24.02", + "description": [ + "Minimum msat amount we allow." + ] + }, + "htlc_maximum_msat": { + "type": "msat", + "added": "v24.02", + "description": [ + "Maximum msat amount we allow." + ] + }, + "cltv_expiry_delta": { + "type": "u32", + "added": "v24.02", + "description": [ + "Blocks delay required between incoming and outgoing HTLCs." + ] + }, + "fee_base_msat": { + "type": "msat", + "added": "v24.02", + "description": [ + "Amount we charge to use the channel." + ] + }, + "fee_proportional_millionths": { + "type": "u32", + "added": "v24.02", + "description": [ + "Amount we charge to use the channel in parts-per-million." + ] + } + } + }, + "remote": { + "type": "object", + "added": "v24.02", + "description": [ + "Peer's gossip for channel." + ], + "additionalProperties": false, + "required": [ + "htlc_minimum_msat", + "htlc_maximum_msat", + "cltv_expiry_delta", + "fee_base_msat", + "fee_proportional_millionths" + ], + "properties": { + "htlc_minimum_msat": { + "type": "msat", + "added": "v24.02", + "description": [ + "Minimum msat amount they allow." + ] + }, + "htlc_maximum_msat": { + "type": "msat", + "added": "v24.02", + "description": [ + "Maximum msat amount they allow." + ] + }, + "cltv_expiry_delta": { + "type": "u32", + "added": "v24.02", + "description": [ + "Blocks delay required between incoming and outgoing HTLCs." + ] + }, + "fee_base_msat": { + "type": "msat", + "added": "v24.02", + "description": [ + "Amount they charge to use the channel." + ] + }, + "fee_proportional_millionths": { + "type": "u32", + "added": "v24.02", + "description": [ + "Amount they charge to use the channel in parts-per-million." + ] + } + } + } + } + }, + "ignore_fee_limits": { + "type": "boolean", + "added": "v23.08", + "description": [ + "Set if we allow this peer to set fees to anything they want." + ] + }, + "lost_state": { + "type": "boolean", + "added": "v24.02", + "description": [ + "Set if we are fallen behind i.e. lost some channel state." + ] + }, + "feerate": { + "type": "object", + "description": [ + "Feerates for the current tx." + ], + "additionalProperties": false, + "required": [ + "perkw", + "perkb" + ], + "properties": { + "perkw": { + "type": "u32", + "description": [ + "Feerate per 1000 weight (i.e kSipa)." + ] + }, + "perkb": { + "type": "u32", + "description": [ + "Feerate per 1000 virtual bytes." + ] + } + } + }, + "owner": { + "type": "string", + "description": [ + "The current subdaemon controlling this connection." + ] + }, + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "The short_channel_id (once locked in)." + ] + }, + "channel_id": { + "type": "hash", + "description": [ + "The full channel_id (funding txid Xored with output number)." + ] + }, + "funding_txid": { + "type": "txid", + "description": [ + "ID of the funding transaction." + ] + }, + "funding_outnum": { + "type": "u32", + "description": [ + "The 0-based output number of the funding transaction which opens the channel." + ] + }, + "initial_feerate": { + "type": "string", + "description": [ + "For inflight opens, the first feerate used to initiate the channel open." + ] + }, + "last_feerate": { + "type": "string", + "description": [ + "For inflight opens, the most recent feerate used on the channel open." + ] + }, + "next_feerate": { + "type": "string", + "description": [ + "For inflight opens, the next feerate we'll use for the channel open." + ] + }, + "next_fee_step": { + "type": "u32", + "description": [ + "For inflight opens, the next feerate step we'll use for the channel open." + ] + }, + "inflight": { + "type": "array", + "description": [ + "Current candidate funding transactions." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "funding_txid", + "funding_outnum", + "feerate", + "total_funding_msat", + "splice_amount", + "our_funding_msat" + ], + "properties": { + "funding_txid": { + "type": "txid", + "description": [ + "ID of the funding transaction." + ] + }, + "funding_outnum": { + "type": "u32", + "description": [ + "The 0-based output number of the funding transaction which opens the channel." + ] + }, + "feerate": { + "type": "string", + "description": [ + "The feerate for this funding transaction in per-1000-weight, with `kpw` appended." + ] + }, + "total_funding_msat": { + "type": "msat", + "description": [ + "Total amount in the channel." + ] + }, + "splice_amount": { + "type": "integer", + "added": "v23.08", + "description": [ + "The amouont of sats we're splicing in or out." + ] + }, + "our_funding_msat": { + "type": "msat", + "description": [ + "Amount we have in the channel." + ] + }, + "scratch_txid": { + "type": "txid", + "description": [ + "The commitment transaction txid we would use if we went onchain now." + ] + } + } + } + }, + "close_to": { + "type": "hex", + "description": [ + "ScriptPubkey which we have to close to if we mutual close." + ] + }, + "private": { + "type": "boolean", + "description": [ + "If True, we will not announce this channel." + ] + }, + "opener": { + "type": "string", + "enum": [ + "local", + "remote" + ], + "description": [ + "Who initiated the channel." + ] + }, + "closer": { + "type": "string", + "enum": [ + "local", + "remote" + ], + "description": [ + "Who initiated the channel close (only present if closing)." + ] + }, + "features": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "option_static_remotekey", + "option_anchor_outputs", + "option_anchors_zero_fee_htlc_tx", + "option_scid_alias", + "option_zeroconf" + ], + "description": [ + "BOLT #9 features which apply to this channel." + ] + } + }, + "funding": { + "type": "object", + "additionalProperties": false, + "required": [ + "local_funds_msat", + "remote_funds_msat" + ], + "properties": { + "pushed_msat": { + "type": "msat", + "description": [ + "Amount pushed from opener to peer." + ] + }, + "local_funds_msat": { + "type": "msat", + "description": [ + "Amount of channel we funded." + ] + }, + "remote_funds_msat": { + "type": "msat", + "description": [ + "Amount of channel they funded." + ] + }, + "fee_paid_msat": { + "type": "msat", + "description": [ + "Amount we paid peer at open." + ] + }, + "fee_rcvd_msat": { + "type": "msat", + "description": [ + "Amount we were paid by peer at open." + ] + } + } + }, + "to_us_msat": { + "type": "msat", + "description": [ + "How much of channel is owed to us." + ] + }, + "min_to_us_msat": { + "type": "msat", + "description": [ + "Least amount owed to us ever. If the peer were to successfully steal from us, this is the amount we would still retain." + ] + }, + "max_to_us_msat": { + "type": "msat", + "description": [ + "Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get." + ] + }, + "total_msat": { + "type": "msat", + "description": [ + "Total amount in the channel." + ] + }, + "fee_base_msat": { + "type": "msat", + "description": [ + "Amount we charge to use the channel." + ] + }, + "fee_proportional_millionths": { + "type": "u32", + "description": [ + "Amount we charge to use the channel in parts-per-million." + ] + }, + "dust_limit_msat": { + "type": "msat", + "description": [ + "Minimum amount for an output on the channel transactions." + ] + }, + "max_total_htlc_in_msat": { + "type": "msat", + "description": [ + "Max amount accept in a single payment." + ] + }, + "their_reserve_msat": { + "type": "msat", + "description": [ + "Minimum we insist they keep in channel. If they have less than this in the channel, they cannot send to us on that channel." + ], + "default": "1% of the total channel capacity" + }, + "our_reserve_msat": { + "type": "msat", + "description": [ + "Minimum they insist we keep in channel. If you have less than this in the channel, you cannot send out via this channel." + ] + }, + "spendable_msat": { + "type": "msat", + "description": [ + "An estimate of the total we could send through channel (can be wrong because adding HTLCs requires an increase in fees paid to onchain miners, and onchain fees change dynamically according to onchain activity)." + ] + }, + "receivable_msat": { + "type": "msat", + "description": [ + "An estimate of the total peer could send through channel." + ] + }, + "minimum_htlc_in_msat": { + "type": "msat", + "description": [ + "The minimum amount HTLC we accept." + ] + }, + "minimum_htlc_out_msat": { + "type": "msat", + "description": [ + "The minimum amount HTLC we will send." + ] + }, + "maximum_htlc_out_msat": { + "type": "msat", + "description": [ + "The maximum amount HTLC we will send." + ] + }, + "their_to_self_delay": { + "type": "u32", + "description": [ + "The number of blocks before they can take their funds if they unilateral close." + ] + }, + "our_to_self_delay": { + "type": "u32", + "description": [ + "The number of blocks before we can take our funds if we unilateral close." + ] + }, + "max_accepted_htlcs": { + "type": "u32", + "description": [ + "Maximum number of incoming HTLC we will accept at once." + ] + }, + "alias": { + "type": "object", + "required": [], + "properties": { + "local": { + "type": "short_channel_id", + "description": [ + "An alias assigned by this node to this channel, used for outgoing payments." + ] + }, + "remote": { + "type": "short_channel_id", + "description": [ + "An alias assigned by the remote node to this channel, usable in routehints and invoices." + ] + } + } + }, + "state_changes": { + "type": "array", + "description": [ + "Prior state changes." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "timestamp", + "old_state", + "new_state", + "cause", + "message" + ], + "properties": { + "timestamp": { + "type": "string", + "description": [ + "UTC timestamp of form YYYY-mm-ddTHH:MM:SS.%03dZ." + ] + }, + "old_state": { + "type": "string", + "enum": [ + "OPENINGD", + "CHANNELD_AWAITING_LOCKIN", + "CHANNELD_NORMAL", + "CHANNELD_SHUTTING_DOWN", + "CLOSINGD_SIGEXCHANGE", + "CLOSINGD_COMPLETE", + "AWAITING_UNILATERAL", + "FUNDING_SPEND_SEEN", + "ONCHAIN", + "DUALOPEND_OPEN_INIT", + "DUALOPEND_AWAITING_LOCKIN", + "DUALOPEND_OPEN_COMMITTED", + "DUALOPEND_OPEN_COMMIT_READY", + "CHANNELD_AWAITING_SPLICE" + ], + "description": [ + "Previous state." + ] + }, + "new_state": { + "type": "string", + "enum": [ + "OPENINGD", + "CHANNELD_AWAITING_LOCKIN", + "CHANNELD_NORMAL", + "CHANNELD_SHUTTING_DOWN", + "CLOSINGD_SIGEXCHANGE", + "CLOSINGD_COMPLETE", + "AWAITING_UNILATERAL", + "FUNDING_SPEND_SEEN", + "ONCHAIN", + "DUALOPEND_OPEN_INIT", + "DUALOPEND_AWAITING_LOCKIN", + "DUALOPEND_OPEN_COMMITTED", + "DUALOPEND_OPEN_COMMIT_READY", + "CHANNELD_AWAITING_SPLICE" + ], + "description": [ + "New state." + ] + }, + "cause": { + "type": "string", + "enum": [ + "unknown", + "local", + "user", + "remote", + "protocol", + "onchain" + ], + "description": [ + "What caused the change." + ] + }, + "message": { + "type": "string", + "description": [ + "Human-readable explanation." + ] + } + } + } + }, + "status": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Billboard log of significant changes." + ] + } + }, + "in_payments_offered": { + "type": "u64", + "description": [ + "Number of incoming payment attempts." + ] + }, + "in_offered_msat": { + "type": "msat", + "description": [ + "Total amount of incoming payment attempts." + ] + }, + "in_payments_fulfilled": { + "type": "u64", + "description": [ + "Number of successful incoming payment attempts." + ] + }, + "in_fulfilled_msat": { + "type": "msat", + "description": [ + "Total amount of successful incoming payment attempts." + ] + }, + "out_payments_offered": { + "type": "u64", + "description": [ + "Number of outgoing payment attempts." + ] + }, + "out_offered_msat": { + "type": "msat", + "description": [ + "Total amount of outgoing payment attempts." + ] + }, + "out_payments_fulfilled": { + "type": "u64", + "description": [ + "Number of successful outgoing payment attempts." + ] + }, + "out_fulfilled_msat": { + "type": "msat", + "description": [ + "Total amount of successful outgoing payment attempts." + ] + }, + "last_stable_connection": { + "type": "u64", + "added": "v24.02", + "description": [ + "Last time we reestablished the open channel and stayed connected for 1 minute." + ] + }, + "htlcs": { + "type": "array", + "description": [ + "Current HTLCs in this channel." + ], + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "direction", + "id", + "amount_msat", + "expiry", + "payment_hash", + "state" + ], + "properties": { + "direction": { + "type": "string", + "added": "v23.02", + "enum": [ + "in", + "out" + ], + "description": [ + "Whether it came from peer, or is going to peer." + ] + }, + "id": { + "type": "u64", + "description": [ + "Unique ID for this htlc on this channel in this direction." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount send/received for this HTLC." + ] + }, + "expiry": { + "type": "u32", + "description": [ + "Block this HTLC expires at (after which an `in` direction HTLC will be returned to the peer, an `out` returned to us). If this expiry is too close, lightningd(8) will automatically unilaterally close the channel in order to enforce the timeout onchain." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the payment_preimage which will prove payment." + ] + }, + "local_trimmed": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "If this is too small to enforce onchain; it doesn't appear in the commitment transaction and will not be enforced in a unilateral close. Generally true if the HTLC (after subtracting onchain fees) is below the `dust_limit_msat` for the channel." + ] + }, + "status": { + "type": "string", + "description": [ + "Set if this HTLC is currently waiting on a hook (and shows what plugin)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "direction": { + "enum": [ + "out" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "state" + ], + "properties": { + "direction": {}, + "id": {}, + "amount_msat": {}, + "msatoshi": {}, + "expiry": {}, + "payment_hash": {}, + "local_trimmed": {}, + "status": {}, + "alias": {}, + "peer_id": {}, + "peer_connected": {}, + "reestablished": {}, + "state": { + "type": "string", + "enum": [ + "SENT_ADD_HTLC", + "SENT_ADD_COMMIT", + "RCVD_ADD_REVOCATION", + "RCVD_ADD_ACK_COMMIT", + "SENT_ADD_ACK_REVOCATION", + "RCVD_REMOVE_HTLC", + "RCVD_REMOVE_COMMIT", + "SENT_REMOVE_REVOCATION", + "SENT_REMOVE_ACK_COMMIT", + "RCVD_REMOVE_ACK_REVOCATION" + ], + "description": [ + "Status of the HTLC." + ] + } + } + } + }, + { + "if": { + "properties": { + "direction": { + "enum": [ + "in" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "state" + ], + "properties": { + "direction": {}, + "id": {}, + "amount_msat": {}, + "msatoshi": {}, + "expiry": {}, + "payment_hash": {}, + "local_trimmed": {}, + "status": {}, + "peer_id": {}, + "peer_connected": {}, + "reestablished": {}, + "state": { + "type": "string", + "enum": [ + "RCVD_ADD_HTLC", + "RCVD_ADD_COMMIT", + "SENT_ADD_REVOCATION", + "SENT_ADD_ACK_COMMIT", + "RCVD_ADD_ACK_REVOCATION", + "SENT_REMOVE_HTLC", + "SENT_REMOVE_COMMIT", + "RCVD_REMOVE_REVOCATION", + "RCVD_REMOVE_ACK_COMMIT", + "SENT_REMOVE_ACK_REVOCATION" + ], + "description": [ + "Status of the HTLC." + ] + } + } + } + } + ] + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "peer_connected": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "properties": { + "reestablished": { + "type": "boolean", + "description": [ + "True if we have successfully exchanged reestablish messages this connection." + ] + } + } + } + }, + { + "if": { + "required": [ + "close_to" + ] + }, + "then": { + "additionalProperties": false, + "required": [], + "properties": { + "state": {}, + "peer_id": {}, + "peer_connected": {}, + "reestablished": {}, + "scratch_txid": {}, + "channel_type": {}, + "feerate": {}, + "ignore_fee_limits": {}, + "lost_state": {}, + "owner": {}, + "short_channel_id": {}, + "channel_id": {}, + "updates": {}, + "funding_txid": {}, + "funding_outnum": {}, + "close_to": {}, + "private": {}, + "alias": {}, + "opener": {}, + "closer": {}, + "features": {}, + "funding": {}, + "to_us_msat": {}, + "min_to_us_msat": {}, + "max_to_us_msat": {}, + "total_msat": {}, + "fee_base_msat": {}, + "fee_proportional_millionths": {}, + "dust_limit_msat": {}, + "max_total_htlc_in_msat": {}, + "their_reserve_msat": {}, + "our_reserve_msat": {}, + "spendable_msat": {}, + "receivable_msat": {}, + "minimum_htlc_in_msat": {}, + "minimum_htlc_out_msat": {}, + "maximum_htlc_out_msat": {}, + "spendable_msatoshi": {}, + "receivable_msatoshi": {}, + "their_to_self_delay": {}, + "our_to_self_delay": {}, + "max_accepted_htlcs": {}, + "msatoshi_to_us": {}, + "msatoshi_to_us_min": {}, + "msatoshi_to_us_max": {}, + "msatoshi_total": {}, + "dust_limit_satoshis": {}, + "max_htlc_value_in_flight_msat": {}, + "our_channel_reserve_satoshis": {}, + "their_channel_reserve_satoshis": {}, + "spendable_satoshis": {}, + "receivable_satoshis": {}, + "htlc_minimum_msat": {}, + "state_changes": {}, + "status": {}, + "in_payments_offered": {}, + "in_offered_msat": {}, + "in_msatoshi_offered": {}, + "in_payments_fulfilled": {}, + "in_fulfilled_msat": {}, + "in_msatoshi_fulfilled": {}, + "out_payments_offered": {}, + "out_offered_msat": {}, + "out_msatoshi_offered": {}, + "out_payments_fulfilled": {}, + "out_fulfilled_msat": {}, + "out_msatoshi_fulfilled": {}, + "last_stable_connection": {}, + "htlcs": {}, + "initial_feerate": {}, + "last_feerate": {}, + "next_feerate": {}, + "inflight": {}, + "last_tx_fee_msat": {}, + "direction": {}, + "close_to_addr": { + "type": "string", + "description": [ + "The bitcoin address we will close to (present if close_to_addr is a standardized address)." + ] + } + } + } + }, + { + "if": { + "required": [ + "scratch_txid" + ] + }, + "then": { + "additionalProperties": false, + "required": [ + "last_tx_fee_msat" + ], + "properties": { + "state": {}, + "peer_id": {}, + "peer_connected": {}, + "reestablished": {}, + "alias": {}, + "scratch_txid": {}, + "channel_type": {}, + "feerate": {}, + "ignore_fee_limits": {}, + "lost_state": {}, + "owner": {}, + "short_channel_id": {}, + "channel_id": {}, + "updates": {}, + "funding_txid": {}, + "funding_outnum": {}, + "inflight": {}, + "close_to": {}, + "private": {}, + "opener": {}, + "closer": {}, + "features": {}, + "funding": {}, + "to_us_msat": {}, + "min_to_us_msat": {}, + "max_to_us_msat": {}, + "total_msat": {}, + "fee_base_msat": {}, + "fee_proportional_millionths": {}, + "dust_limit_msat": {}, + "max_total_htlc_in_msat": {}, + "their_reserve_msat": {}, + "our_reserve_msat": {}, + "spendable_msat": {}, + "receivable_msat": {}, + "minimum_htlc_in_msat": {}, + "minimum_htlc_out_msat": {}, + "maximum_htlc_out_msat": {}, + "spendable_msatoshi": {}, + "receivable_msatoshi": {}, + "their_to_self_delay": {}, + "our_to_self_delay": {}, + "max_accepted_htlcs": {}, + "msatoshi_to_us": {}, + "msatoshi_to_us_min": {}, + "msatoshi_to_us_max": {}, + "msatoshi_total": {}, + "dust_limit_satoshis": {}, + "max_htlc_value_in_flight_msat": {}, + "our_channel_reserve_satoshis": {}, + "their_channel_reserve_satoshis": {}, + "spendable_satoshis": {}, + "receivable_satoshis": {}, + "htlc_minimum_msat": {}, + "state_changes": {}, + "status": {}, + "in_payments_offered": {}, + "in_offered_msat": {}, + "in_msatoshi_offered": {}, + "in_payments_fulfilled": {}, + "in_fulfilled_msat": {}, + "in_msatoshi_fulfilled": {}, + "out_payments_offered": {}, + "out_offered_msat": {}, + "out_msatoshi_offered": {}, + "out_payments_fulfilled": {}, + "out_fulfilled_msat": {}, + "out_msatoshi_fulfilled": {}, + "last_stable_connection": {}, + "htlcs": {}, + "initial_feerate": {}, + "last_feerate": {}, + "next_feerate": {}, + "close_to_addr": {}, + "direction": {}, + "last_tx_fee_msat": { + "type": "msat", + "description": [ + "Fee attached to this the current tx." + ] + } + } + } + }, + { + "if": { + "required": [ + "short_channel_id" + ] + }, + "then": { + "additionalProperties": false, + "required": [ + "direction" + ], + "properties": { + "alias": {}, + "peer_id": {}, + "peer_connected": {}, + "reestablished": {}, + "state": {}, + "scratch_txid": {}, + "channel_type": {}, + "feerate": {}, + "ignore_fee_limits": {}, + "lost_state": {}, + "owner": {}, + "short_channel_id": {}, + "channel_id": {}, + "updates": {}, + "funding_txid": {}, + "funding_outnum": {}, + "inflight": {}, + "close_to": {}, + "private": {}, + "opener": {}, + "closer": {}, + "features": {}, + "funding": {}, + "to_us_msat": {}, + "min_to_us_msat": {}, + "max_to_us_msat": {}, + "total_msat": {}, + "fee_base_msat": {}, + "fee_proportional_millionths": {}, + "dust_limit_msat": {}, + "max_total_htlc_in_msat": {}, + "their_reserve_msat": {}, + "our_reserve_msat": {}, + "spendable_msat": {}, + "receivable_msat": {}, + "minimum_htlc_in_msat": {}, + "minimum_htlc_out_msat": {}, + "maximum_htlc_out_msat": {}, + "spendable_msatoshi": {}, + "receivable_msatoshi": {}, + "their_to_self_delay": {}, + "our_to_self_delay": {}, + "max_accepted_htlcs": {}, + "msatoshi_to_us": {}, + "msatoshi_to_us_min": {}, + "msatoshi_to_us_max": {}, + "msatoshi_total": {}, + "dust_limit_satoshis": {}, + "max_htlc_value_in_flight_msat": {}, + "our_channel_reserve_satoshis": {}, + "their_channel_reserve_satoshis": {}, + "spendable_satoshis": {}, + "receivable_satoshis": {}, + "htlc_minimum_msat": {}, + "state_changes": {}, + "status": {}, + "in_payments_offered": {}, + "in_offered_msat": {}, + "in_msatoshi_offered": {}, + "in_payments_fulfilled": {}, + "in_fulfilled_msat": {}, + "in_msatoshi_fulfilled": {}, + "out_payments_offered": {}, + "out_offered_msat": {}, + "out_msatoshi_offered": {}, + "out_payments_fulfilled": {}, + "out_fulfilled_msat": {}, + "out_msatoshi_fulfilled": {}, + "last_stable_connection": {}, + "htlcs": {}, + "initial_feerate": {}, + "last_feerate": {}, + "next_feerate": {}, + "close_to_addr": {}, + "last_tx_fee_msat": {}, + "direction": { + "type": "u32", + "added": "v23.02", + "description": [ + "0 if we're the lesser node_id, 1 if we're the greater (as used in BOLT #7 channel_update)." + ] + } + } + } + }, + { + "if": { + "required": [ + "inflight" + ] + }, + "then": { + "additionalProperties": false, + "required": [ + "initial_feerate", + "last_feerate", + "next_feerate" + ], + "properties": { + "state": {}, + "peer_id": {}, + "peer_connected": {}, + "reestablished": {}, + "scratch_txid": {}, + "channel_type": {}, + "feerate": {}, + "ignore_fee_limits": {}, + "lost_state": {}, + "owner": {}, + "alias": {}, + "short_channel_id": {}, + "channel_id": {}, + "updates": {}, + "funding_txid": {}, + "funding_outnum": {}, + "close_to": {}, + "private": {}, + "opener": {}, + "closer": {}, + "features": {}, + "funding": {}, + "to_us_msat": {}, + "min_to_us_msat": {}, + "max_to_us_msat": {}, + "total_msat": {}, + "fee_base_msat": {}, + "fee_proportional_millionths": {}, + "dust_limit_msat": {}, + "max_total_htlc_in_msat": {}, + "their_reserve_msat": {}, + "our_reserve_msat": {}, + "spendable_msat": {}, + "receivable_msat": {}, + "minimum_htlc_in_msat": {}, + "minimum_htlc_out_msat": {}, + "maximum_htlc_out_msat": {}, + "spendable_msatoshi": {}, + "receivable_msatoshi": {}, + "their_to_self_delay": {}, + "our_to_self_delay": {}, + "max_accepted_htlcs": {}, + "msatoshi_to_us": {}, + "msatoshi_to_us_min": {}, + "msatoshi_to_us_max": {}, + "msatoshi_total": {}, + "dust_limit_satoshis": {}, + "max_htlc_value_in_flight_msat": {}, + "our_channel_reserve_satoshis": {}, + "their_channel_reserve_satoshis": {}, + "spendable_satoshis": {}, + "receivable_satoshis": {}, + "htlc_minimum_msat": {}, + "state_changes": {}, + "status": {}, + "in_payments_offered": {}, + "in_offered_msat": {}, + "in_msatoshi_offered": {}, + "in_payments_fulfilled": {}, + "in_fulfilled_msat": {}, + "in_msatoshi_fulfilled": {}, + "out_payments_offered": {}, + "out_offered_msat": {}, + "out_msatoshi_offered": {}, + "out_payments_fulfilled": {}, + "out_fulfilled_msat": {}, + "out_msatoshi_fulfilled": {}, + "last_stable_connection": {}, + "htlcs": {}, + "inflight": {}, + "close_to_addr": {}, + "direction": {}, + "last_tx_fee_msat": {}, + "initial_feerate": { + "type": "string", + "description": [ + "The feerate for the initial funding transaction in per-1000-weight, with `kpw` appended." + ] + }, + "last_feerate": { + "type": "string", + "description": [ + "The feerate for the latest funding transaction in per-1000-weight, with `kpw` appended." + ] + }, + "next_feerate": { + "type": "string", + "description": [ + "The minimum feerate for the next funding transaction in per-1000-weight, with `kpw` appended." + ] + } + } + } + } + ] + } + } + }, + "post_return_value_notes": [ + "The *state* field values (and *old_state* / *new_state*) are worth describing further:", + "", + " * `OPENINGD`: The channel funding protocol with the peer is ongoing and both sides are negotiating parameters.", + " * `DUALOPEND_OPEN_INIT`: Like `OPENINGD`, but for v2 connections which are using collaborative opens.", + " * `DUALOPEND_OPEN_COMMIT_READY`: Like `OPENINGD`, but for v2 connections which are using collaborative opens. You're ready to send your commitment signed to your peer.", + " * `DUALOPEND_OPEN_COMMITTED`: Like `OPENINGD`, but for v2 connections which are using collaborative opens. You've gotten an initial signed commitment from your peer.", + " * `CHANNELD_AWAITING_LOCKIN` / `DUALOPEND_AWAITING_LOCKIN`: The peer and you have agreed on channel parameters and are just waiting for the channel funding transaction to be confirmed deeply (original and collaborative open protocols, respectively). Both you and the peer must acknowledge the channel funding transaction to be confirmed deeply before entering the next state. Also, you can increase the onchain fee for channels in `DUALOPEND_AWAITING_LOCKIN` using lightning-openchannel_bump(7).", + " * `CHANNELD_NORMAL`: The channel can be used for normal payments.", + " * `CHANNELD_SHUTTING_DOWN`: A mutual close was requested (by you or peer) and both of you are waiting for HTLCs in-flight to be either failed or succeeded. The channel can no longer be used for normal payments and forwarding. Mutual close will proceed only once all HTLCs in the channel have either been fulfilled or failed.", + " * `CLOSINGD_SIGEXCHANGE`: You and the peer are negotiating the mutual close onchain fee.", + " * `CLOSINGD_COMPLETE`: You and the peer have agreed on the mutual close onchain fee and are awaiting the mutual close getting confirmed deeply.", + " * `AWAITING_UNILATERAL`: You initiated a unilateral close, and are now waiting for the peer-selected unilateral close timeout to complete.", + " * `FUNDING_SPEND_SEEN`: You saw the funding transaction getting spent (usually the peer initiated a unilateral close) and will now determine what exactly happened (i.e. if it was a theft attempt).", + " * `ONCHAIN`: You saw the funding transaction getting spent and now know what happened (i.e. if it was a proper unilateral close by the peer, or a theft attempt)." + ] + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong." + ], + "example_json_request": [ + { + "id": "example:listpeerchannels#1", + "method": "listpeerchannels", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" + } + }, + { + "id": "example:listpeerchannels#2", + "method": "listpeerchannels", + "params": { + "id": null + } + } + ], + "example_json_response": [ + { + "channels": [ + { + "peer_id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "peer_connected": true, + "channel_type": { + "bits": [ + 12 + ], + "names": [ + "static_remotekey/even" + ] + }, + "updates": { + "local": { + "htlc_minimum_msat": 0, + "htlc_maximum_msat": 990000000, + "cltv_expiry_delta": 6, + "fee_base_msat": 1, + "fee_proportional_millionths": 10 + } + }, + "state": "CHANNELD_AWAITING_LOCKIN", + "scratch_txid": "4e9c2866b9ae1f765b89ea7ec37428c900ea97f717f85f00e3db852cb6aea3a8", + "last_tx_fee_msat": 5430000, + "feerate": { + "perkw": 7500, + "perkb": 30000 + }, + "owner": "channeld", + "direction": 1, + "channel_id": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "funding_txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b", + "funding_outnum": 0, + "close_to_addr": "bcrt1pamt5tqzd49uyessr7437l2vllf20muqmzdauje8x8scjgpc0l0nqhyqcyp", + "close_to": "5120eed745804da9784cc203f563efa99ffa54fdf01b137bc964e63c3124070ffbe6", + "private": false, + "opener": "local", + "alias": { + "local": "5589251x14022525x17398" + }, + "features": [ + "option_static_remotekey" + ], + "funding": { + "local_funds_msat": 1000000000, + "remote_funds_msat": 0, + "pushed_msat": 0 + }, + "to_us_msat": 1000000000, + "min_to_us_msat": 1000000000, + "max_to_us_msat": 1000000000, + "total_msat": 1000000000, + "fee_base_msat": 1, + "fee_proportional_millionths": 10, + "dust_limit_msat": 546000, + "max_total_htlc_in_msat": 18446744073709552000, + "their_reserve_msat": 10000000, + "our_reserve_msat": 10000000, + "spendable_msat": 973980000, + "receivable_msat": 0, + "minimum_htlc_in_msat": 0, + "minimum_htlc_out_msat": 0, + "maximum_htlc_out_msat": 990000000, + "their_to_self_delay": 5, + "our_to_self_delay": 5, + "max_accepted_htlcs": 483, + "state_changes": [], + "status": [], + "in_payments_offered": 0, + "in_offered_msat": 0, + "in_payments_fulfilled": 0, + "in_fulfilled_msat": 0, + "out_payments_offered": 0, + "out_offered_msat": 0, + "out_payments_fulfilled": 0, + "out_fulfilled_msat": 0, + "htlcs": [] + } + ] + }, + { + "channels": [ + { + "peer_id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "peer_connected": true, + "reestablished": true, + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "updates": { + "local": { + "htlc_minimum_msat": 0, + "htlc_maximum_msat": 990000000, + "cltv_expiry_delta": 6, + "fee_base_msat": 1, + "fee_proportional_millionths": 10 + }, + "remote": { + "htlc_minimum_msat": 0, + "htlc_maximum_msat": 990000000, + "cltv_expiry_delta": 6, + "fee_base_msat": 1, + "fee_proportional_millionths": 10 + } + }, + "state": "CHANNELD_NORMAL", + "scratch_txid": "ece66657d6203a4ea77807f566fd5b98a78b659f0cd59ce9200aa3bd6875ee25", + "last_tx_fee_msat": 4545000, + "lost_state": false, + "feerate": { + "perkw": 3750, + "perkb": 15000 + }, + "owner": "channeld", + "short_channel_id": "103x1x0", + "direction": 1, + "channel_id": "def5ef03e0d36ed65de814c0a8d6599a502fe1afb8e956529320bb350e876b5f", + "funding_txid": "5f6b870e35bb20935256e9b8afe12f509a59d6a8c014e85dd66ed3e003eff5de", + "funding_outnum": 0, + "close_to_addr": "bcrt1pamt5tqzd49uyessr7437l2vllf20muqmzdauje8x8scjgpc0l0nqhyqcyp", + "close_to": "5120eed745804da9784cc203f563efa99ffa54fdf01b137bc964e63c3124070ffbe6", + "private": false, + "opener": "local", + "alias": { + "local": "15447035x5589520x8959", + "remote": "6036590x13481428x5501" + }, + "features": [ + "option_static_remotekey", + "option_anchors_zero_fee_htlc_tx" + ], + "funding": { + "local_funds_msat": 1000000000, + "remote_funds_msat": 0, + "pushed_msat": 0 + }, + "to_us_msat": 1000000000, + "min_to_us_msat": 1000000000, + "max_to_us_msat": 1000000000, + "total_msat": 1000000000, + "fee_base_msat": 1, + "fee_proportional_millionths": 10, + "dust_limit_msat": 546000, + "max_total_htlc_in_msat": 18446744073709552000, + "their_reserve_msat": 10000000, + "our_reserve_msat": 10000000, + "spendable_msat": 978330000, + "receivable_msat": 0, + "minimum_htlc_in_msat": 0, + "minimum_htlc_out_msat": 0, + "maximum_htlc_out_msat": 990000000, + "their_to_self_delay": 5, + "our_to_self_delay": 5, + "max_accepted_htlcs": 483, + "state_changes": [ + { + "timestamp": "2024-02-22T17:48:57.127Z", + "old_state": "CHANNELD_AWAITING_LOCKIN", + "new_state": "CHANNELD_NORMAL", + "cause": "user", + "message": "Lockin complete" + } + ], + "status": [ + "CHANNELD_NORMAL:Channel ready for use." + ], + "in_payments_offered": 0, + "in_offered_msat": 0, + "in_payments_fulfilled": 0, + "in_fulfilled_msat": 0, + "out_payments_offered": 0, + "out_offered_msat": 0, + "out_payments_fulfilled": 0, + "out_fulfilled_msat": 0, + "htlcs": [] + } + ] + } + ], + "author": [ + "Michael Hawkins <>." + ], + "see_also": [ + "lightning-connect(7)", + "lightning-fundchannel_start(7)" + ], + "resources": [ + "Main web site: ", + "Lightning RFC site (BOLT #9): ", + "" + ] + }, + "lightning-listpeers.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listpeers", + "title": "Command returning data on connected lightning nodes", + "description": [ + "The **listpeers** RPC command returns data on nodes that are connected or are not connected but have open channels with this node.", + "", + "Once a connection to another lightning node has been established, using the **connect** command, data on the node can be returned using **listpeers** and the *id* that was used with the **connect** command.", + "", + "If no *id* is supplied, then data on all lightning nodes that are connected, or not connected but have open channels with this node, are returned.", + "", + "If a channel is open with a node and the connection has been lost, then the node will still appear in the output of the command and the value of the *connected* attribute of the node will be \"false\".", + "", + "The channel will remain open for a set blocktime, after which if the connection has not been re-established, the channel will close and the node will no longer appear in the command output." + ], + "request": { + "required": [], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "If supplied, limits the result to just the peer with the given ID, if it exists." + ] + }, + "level": { + "type": "string", + "description": [ + "Supplying level will show log entries related to that peer at the given log level." + ], + "enum": [ + "io", + "debug", + "info", + "unusual" + ] + } + } + }, + "response": { + "required": [ + "peers" + ], + "properties": { + "peers": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "id", + "connected", + "num_channels" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The unique id of the peer." + ] + }, + "connected": { + "type": "boolean", + "description": [ + "Value showing the connection status." + ] + }, + "num_channels": { + "type": "u32", + "description": [ + "The number of channels the peer has with this node." + ], + "added": "v23.02" + }, + "log": { + "type": "array", + "description": [ + "If *level* is specified, logs for this peer." + ], + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "SKIPPED", + "BROKEN", + "UNUSUAL", + "INFO", + "DEBUG", + "IO_IN", + "IO_OUT" + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "enum": [ + "SKIPPED" + ] + } + } + }, + "then": { + "type": "object", + "additionalProperties": false, + "required": [ + "num_skipped" + ], + "properties": { + "type": {}, + "num_skipped": { + "type": "u32", + "description": [ + "Number of deleted/omitted entries." + ] + } + } + } + }, + { + "if": { + "properties": { + "type": { + "enum": [ + "BROKEN", + "UNUSUAL", + "INFO", + "DEBUG" + ] + } + } + }, + "then": { + "type": "object", + "additionalProperties": false, + "required": [ + "time", + "source", + "log", + "node_id" + ], + "properties": { + "type": {}, + "time": { + "type": "string", + "description": [ + "UNIX timestamp with 9 decimal places." + ] + }, + "source": { + "type": "string", + "description": [ + "The particular logbook this was found in." + ] + }, + "log": { + "type": "string", + "description": [ + "The actual log message." + ] + }, + "node_id": { + "type": "pubkey", + "description": [ + "The peer this is associated with." + ] + } + } + } + }, + { + "if": { + "properties": { + "type": { + "enum": [ + "IO_IN", + "IO_OUT" + ] + } + } + }, + "then": { + "type": "object", + "additionalProperties": false, + "required": [ + "time", + "source", + "log", + "node_id", + "data" + ], + "properties": { + "type": {}, + "time": { + "type": "string", + "description": [ + "UNIX timestamp with 9 decimal places." + ] + }, + "source": { + "type": "string", + "description": [ + "The particular logbook this was found in." + ] + }, + "log": { + "type": "string", + "description": [ + "The actual log message." + ] + }, + "node_id": { + "type": "pubkey", + "description": [ + "The peer this is associated with." + ] + }, + "data": { + "type": "hex", + "description": [ + "The IO which occurred." + ] + } + } + } + } + ] + } + }, + "channels": { + "deprecated": [ + "v23.02", + "v24.02" + ], + "type": "array", + "description": [ + "Channels with this peer." + ], + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "state", + "opener", + "features" + ], + "properties": { + "state": { + "type": "string", + "enum": [ + "OPENINGD", + "CHANNELD_AWAITING_LOCKIN", + "CHANNELD_NORMAL", + "CHANNELD_SHUTTING_DOWN", + "CLOSINGD_SIGEXCHANGE", + "CLOSINGD_COMPLETE", + "AWAITING_UNILATERAL", + "FUNDING_SPEND_SEEN", + "ONCHAIN", + "DUALOPEND_OPEN_INIT", + "DUALOPEND_AWAITING_LOCKIN", + "DUALOPEND_OPEN_COMMITTED", + "DUALOPEND_OPEN_COMMIT_READY" + ], + "description": [ + "Current state of the channel:", + " * `OPENINGD`: The channel funding protocol with the peer is ongoing and both sides are negotiating parameters.", + " * `CHANNELD_AWAITING_LOCKIN`: The peer and you have agreed on channel parameters and are just waiting for the channel funding transaction to be confirmed deeply. Both you and the peer must acknowledge the channel funding transaction to be confirmed deeply before entering the next state.", + " * `CHANNELD_NORMAL`: The channel can be used for normal payments.", + " * `CHANNELD_SHUTTING_DOWN`: A mutual close was requested (by you or peer) and both of you are waiting for HTLCs in-flight to be either failed or succeeded. The channel can no longer be used for normal payments and forwarding. Mutual close will proceed only once all HTLCs in the channel have either been fulfilled or failed.", + " * `CLOSINGD_SIGEXCHANGE`: You and the peer are negotiating the mutual close onchain fee.", + " * `CLOSINGD_COMPLETE`: You and the peer have agreed on the mutual close onchain fee and are awaiting the mutual close getting confirmed deeply.", + " * `AWAITING_UNILATERAL`: You initiated a unilateral close, and are now waiting for the peer-selected unilateral close timeout to complete.", + " * `FUNDING_SPEND_SEEN`: You saw the funding transaction getting spent (usually the peer initiated a unilateral close) and will now determine what exactly happened (i.e. if it was a theft attempt).", + " * `ONCHAIN`: You saw the funding transaction getting spent and now know what happened (i.e. if it was a proper unilateral close by the peer, or a theft attempt).", + " * `CLOSED`: The channel closure has been confirmed deeply. The channel will eventually be removed from this array." + ] + }, + "scratch_txid": { + "type": "txid", + "description": [ + "The txid we would use if we went onchain now." + ] + }, + "feerate": { + "type": "object", + "description": [ + "Feerates for the current tx." + ], + "additionalProperties": false, + "required": [ + "perkw", + "perkb" + ], + "properties": { + "perkw": { + "type": "u32", + "description": [ + "Feerate per 1000 weight (i.e kSipa)." + ] + }, + "perkb": { + "type": "u32", + "description": [ + "Feerate per 1000 virtual bytes." + ] + } + } + }, + "owner": { + "type": "string", + "description": [ + "The current subdaemon controlling this connection." + ] + }, + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "The short_channel_id (once locked in)." + ] + }, + "channel_id": { + "type": "hash", + "description": [ + "The full channel_id (funding txid Xored with output number)." + ] + }, + "funding_txid": { + "type": "txid", + "description": [ + "ID of the funding transaction." + ] + }, + "funding_outnum": { + "type": "u32", + "description": [ + "The 0-based output number of the funding transaction which opens the channel." + ] + }, + "initial_feerate": { + "type": "string", + "description": [ + "For inflight opens, the first feerate used to initiate the channel open." + ] + }, + "last_feerate": { + "type": "string", + "description": [ + "For inflight opens, the most recent feerate used on the channel open." + ] + }, + "next_feerate": { + "type": "string", + "description": [ + "For inflight opens, the next feerate we'll use for the channel open." + ] + }, + "next_fee_step": { + "type": "u32", + "description": [ + "For inflight opens, the next feerate step we'll use for the channel open." + ] + }, + "inflight": { + "type": "array", + "description": [ + "Current candidate funding transactions." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "funding_txid", + "funding_outnum", + "feerate", + "total_funding_msat", + "our_funding_msat", + "splice_amount", + "scratch_txid" + ], + "properties": { + "funding_txid": { + "type": "txid", + "description": [ + "ID of the funding transaction." + ] + }, + "funding_outnum": { + "type": "u32", + "description": [ + "The 0-based output number of the funding transaction which opens the channel." + ] + }, + "feerate": { + "type": "string", + "description": [ + "The feerate for this funding transaction in per-1000-weight, with `kpw` appended." + ] + }, + "total_funding_msat": { + "type": "msat", + "description": [ + "Total amount in the channel." + ] + }, + "our_funding_msat": { + "type": "msat", + "description": [ + "Amount we have in the channel." + ] + }, + "splice_amount": { + "type": "integer", + "added": "v23.08", + "description": [ + "The amouont of sats we're splicing in or out." + ] + }, + "scratch_txid": { + "type": "txid", + "description": [ + "The commitment transaction txid we would use if we went onchain now." + ] + } + } + } + }, + "close_to": { + "type": "hex", + "description": [ + "ScriptPubkey which we have to close to if we mutual close." + ] + }, + "private": { + "type": "boolean", + "description": [ + "If True, we will not announce this channel." + ] + }, + "opener": { + "type": "string", + "enum": [ + "local", + "remote" + ], + "description": [ + "Who initiated the channel." + ] + }, + "closer": { + "type": "string", + "enum": [ + "local", + "remote" + ], + "description": [ + "Who initiated the channel close (only present if closing)." + ] + }, + "features": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "option_static_remotekey", + "option_anchor_outputs", + "option_scid_alias", + "option_zeroconf" + ], + "description": [ + "BOLT #9 features which apply to this channel." + ] + } + }, + "funding": { + "type": "object", + "additionalProperties": false, + "required": [ + "local_funds_msat", + "remote_funds_msat" + ], + "properties": { + "pushed_msat": { + "type": "msat", + "description": [ + "Amount pushed from opener to peer." + ] + }, + "local_funds_msat": { + "type": "msat", + "description": [ + "Amount of channel we funded." + ] + }, + "remote_funds_msat": { + "type": "msat", + "description": [ + "Amount of channel they funded." + ] + }, + "fee_paid_msat": { + "type": "msat", + "description": [ + "Amount we paid peer at open." + ] + }, + "fee_rcvd_msat": { + "type": "msat", + "description": [ + "Amount we were paid by peer at open." + ] + } + } + }, + "to_us_msat": { + "type": "msat", + "description": [ + "How much of channel is owed to us." + ] + }, + "min_to_us_msat": { + "type": "msat", + "description": [ + "Least amount owed to us ever. If the peer were to successfully steal from us, this is the amount we would still retain." + ] + }, + "max_to_us_msat": { + "type": "msat", + "description": [ + "Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get." + ] + }, + "total_msat": { + "type": "msat", + "description": [ + "Total amount in the channel." + ] + }, + "fee_base_msat": { + "type": "msat", + "description": [ + "Amount we charge to use the channel." + ] + }, + "fee_proportional_millionths": { + "type": "u32", + "description": [ + "Amount we charge to use the channel in parts-per-million." + ] + }, + "dust_limit_msat": { + "type": "msat", + "description": [ + "Minimum amount for an output on the channel transactions." + ] + }, + "max_total_htlc_in_msat": { + "type": "msat", + "description": [ + "Max amount accept in a single payment." + ] + }, + "their_reserve_msat": { + "type": "msat", + "description": [ + "Minimum we insist they keep in channel. If they have less than this in the channel, they cannot send to us on that channel." + ], + "default": "1% of the total channel capacity" + }, + "our_reserve_msat": { + "type": "msat", + "description": [ + "Minimum they insist we keep in channel. If you have less than this in the channel, you cannot send out via this channel." + ] + }, + "spendable_msat": { + "type": "msat", + "description": [ + "An estimate of the total we could send through channel (can be wrong because adding HTLCs requires an increase in fees paid to onchain miners, and onchain fees change dynamically according to onchain activity)." + ] + }, + "receivable_msat": { + "type": "msat", + "description": [ + "An estimate of the total peer could send through channel." + ] + }, + "minimum_htlc_in_msat": { + "type": "msat", + "description": [ + "The minimum amount HTLC we accept." + ] + }, + "minimum_htlc_out_msat": { + "type": "msat", + "description": [ + "The minimum amount HTLC we will send." + ] + }, + "maximum_htlc_out_msat": { + "type": "msat", + "description": [ + "The maximum amount HTLC we will send." + ] + }, + "their_to_self_delay": { + "type": "u32", + "description": [ + "The number of blocks before they can take their funds if they unilateral close." + ] + }, + "our_to_self_delay": { + "type": "u32", + "description": [ + "The number of blocks before we can take our funds if we unilateral close." + ] + }, + "max_accepted_htlcs": { + "type": "u32", + "description": [ + "Maximum number of incoming HTLC we will accept at once." + ] + }, + "alias": { + "type": "object", + "required": [], + "properties": { + "local": { + "type": "short_channel_id", + "description": [ + "An alias assigned by this node to this channel, used for outgoing payments." + ] + }, + "remote": { + "type": "short_channel_id", + "description": [ + "An alias assigned by the remote node to this channel, usable in routehints and invoices." + ] + } + } + }, + "state_changes": { + "type": "array", + "description": [ + "Prior state changes." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "timestamp", + "old_state", + "new_state", + "cause", + "message" + ], + "properties": { + "timestamp": { + "type": "string", + "description": [ + "UTC timestamp of form YYYY-mm-ddTHH:MM:SS.%03dZ." + ] + }, + "old_state": { + "type": "string", + "enum": [ + "OPENINGD", + "CHANNELD_AWAITING_LOCKIN", + "CHANNELD_NORMAL", + "CHANNELD_SHUTTING_DOWN", + "CLOSINGD_SIGEXCHANGE", + "CLOSINGD_COMPLETE", + "AWAITING_UNILATERAL", + "FUNDING_SPEND_SEEN", + "ONCHAIN", + "DUALOPEND_OPEN_INIT", + "DUALOPEND_AWAITING_LOCKIN", + "DUALOPEND_OPEN_COMMITTED", + "DUALOPEND_OPEN_COMMIT_READY" + ], + "description": [ + "Previous state." + ] + }, + "new_state": { + "type": "string", + "enum": [ + "OPENINGD", + "CHANNELD_AWAITING_LOCKIN", + "CHANNELD_NORMAL", + "CHANNELD_SHUTTING_DOWN", + "CLOSINGD_SIGEXCHANGE", + "CLOSINGD_COMPLETE", + "AWAITING_UNILATERAL", + "FUNDING_SPEND_SEEN", + "ONCHAIN", + "DUALOPEND_OPEN_INIT", + "DUALOPEND_AWAITING_LOCKIN", + "DUALOPEND_OPEN_COMMITTED", + "DUALOPEND_OPEN_COMMIT_READY" + ], + "description": [ + "New state." + ] + }, + "cause": { + "type": "string", + "enum": [ + "unknown", + "local", + "user", + "remote", + "protocol", + "onchain" + ], + "description": [ + "What caused the change." + ] + }, + "message": { + "type": "string", + "description": [ + "Human-readable explanation." + ] + } + } + } + }, + "status": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Billboard log of significant changes." + ] + } + }, + "in_payments_offered": { + "type": "u64", + "description": [ + "Number of incoming payment attempts." + ] + }, + "in_offered_msat": { + "type": "msat", + "description": [ + "Total amount of incoming payment attempts." + ] + }, + "in_payments_fulfilled": { + "type": "u64", + "description": [ + "Number of successful incoming payment attempts." + ] + }, + "in_fulfilled_msat": { + "type": "msat", + "description": [ + "Total amount of successful incoming payment attempts." + ] + }, + "out_payments_offered": { + "type": "u64", + "description": [ + "Number of outgoing payment attempts." + ] + }, + "out_offered_msat": { + "type": "msat", + "description": [ + "Total amount of outgoing payment attempts." + ] + }, + "out_payments_fulfilled": { + "type": "u64", + "description": [ + "Number of successful outgoing payment attempts." + ] + }, + "out_fulfilled_msat": { + "type": "msat", + "description": [ + "Total amount of successful outgoing payment attempts." + ] + }, + "htlcs": { + "type": "array", + "description": [ + "Current HTLCs in this channel." + ], + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "direction", + "id", + "amount_msat", + "expiry", + "payment_hash", + "state" + ], + "properties": { + "direction": { + "type": "string", + "enum": [ + "in", + "out" + ], + "description": [ + "Whether it came from peer, or is going to peer." + ] + }, + "id": { + "type": "u64", + "description": [ + "Unique ID for this htlc on this channel in this direction." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount send/received for this HTLC." + ] + }, + "expiry": { + "type": "u32", + "description": [ + "Block this HTLC expires at (after which an `in` direction HTLC will be returned to the peer, an `out` returned to us). If this expiry is too close, lightningd(8) will automatically unilaterally close the channel in order to enforce the timeout onchain." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the payment_preimage which will prove payment." + ] + }, + "local_trimmed": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "If this is too small to enforce onchain; it doesn't appear in the commitment transaction and will not be enforced in a unilateral close. Generally true if the HTLC (after subtracting onchain fees) is below the `dust_limit_msat` for the channel." + ] + }, + "status": { + "type": "string", + "description": [ + "Set if this HTLC is currently waiting on a hook (and shows what plugin)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "direction": { + "enum": [ + "out" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "state" + ], + "properties": { + "direction": {}, + "id": {}, + "amount_msat": {}, + "msatoshi": {}, + "expiry": {}, + "payment_hash": {}, + "local_trimmed": {}, + "status": {}, + "alias": {}, + "state": { + "type": "string", + "enum": [ + "SENT_ADD_HTLC", + "SENT_ADD_COMMIT", + "RCVD_ADD_REVOCATION", + "RCVD_ADD_ACK_COMMIT", + "SENT_ADD_ACK_REVOCATION", + "RCVD_REMOVE_HTLC", + "RCVD_REMOVE_COMMIT", + "SENT_REMOVE_REVOCATION", + "SENT_REMOVE_ACK_COMMIT", + "RCVD_REMOVE_ACK_REVOCATION" + ], + "description": [ + "Status of the HTLC." + ] + } + } + } + }, + { + "if": { + "properties": { + "direction": { + "enum": [ + "in" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "state" + ], + "properties": { + "direction": {}, + "id": {}, + "amount_msat": {}, + "msatoshi": {}, + "expiry": {}, + "payment_hash": {}, + "local_trimmed": {}, + "status": {}, + "state": { + "type": "string", + "enum": [ + "RCVD_ADD_HTLC", + "RCVD_ADD_COMMIT", + "SENT_ADD_REVOCATION", + "SENT_ADD_ACK_COMMIT", + "RCVD_ADD_ACK_REVOCATION", + "SENT_REMOVE_HTLC", + "SENT_REMOVE_COMMIT", + "RCVD_REMOVE_REVOCATION", + "RCVD_REMOVE_ACK_COMMIT", + "SENT_REMOVE_ACK_REVOCATION" + ], + "description": [ + "Status of the HTLC." + ] + } + } + } + } + ] + } + } + }, + "allOf": [ + { + "if": { + "required": [ + "close_to" + ] + }, + "then": { + "additionalProperties": false, + "required": [], + "properties": { + "state": {}, + "scratch_txid": {}, + "feerate": {}, + "owner": {}, + "short_channel_id": {}, + "channel_id": {}, + "funding_txid": {}, + "funding_outnum": {}, + "close_to": {}, + "private": {}, + "alias": {}, + "opener": {}, + "closer": {}, + "features": {}, + "funding": {}, + "to_us_msat": {}, + "min_to_us_msat": {}, + "max_to_us_msat": {}, + "total_msat": {}, + "fee_base_msat": {}, + "fee_proportional_millionths": {}, + "dust_limit_msat": {}, + "max_total_htlc_in_msat": {}, + "their_reserve_msat": {}, + "our_reserve_msat": {}, + "spendable_msat": {}, + "receivable_msat": {}, + "minimum_htlc_in_msat": {}, + "minimum_htlc_out_msat": {}, + "maximum_htlc_out_msat": {}, + "spendable_msatoshi": {}, + "receivable_msatoshi": {}, + "their_to_self_delay": {}, + "our_to_self_delay": {}, + "max_accepted_htlcs": {}, + "msatoshi_to_us": {}, + "msatoshi_to_us_min": {}, + "msatoshi_to_us_max": {}, + "msatoshi_total": {}, + "dust_limit_satoshis": {}, + "max_htlc_value_in_flight_msat": {}, + "our_channel_reserve_satoshis": {}, + "their_channel_reserve_satoshis": {}, + "spendable_satoshis": {}, + "receivable_satoshis": {}, + "htlc_minimum_msat": {}, + "state_changes": {}, + "status": {}, + "in_payments_offered": {}, + "in_offered_msat": {}, + "in_msatoshi_offered": {}, + "in_payments_fulfilled": {}, + "in_fulfilled_msat": {}, + "in_msatoshi_fulfilled": {}, + "out_payments_offered": {}, + "out_offered_msat": {}, + "out_msatoshi_offered": {}, + "out_payments_fulfilled": {}, + "out_fulfilled_msat": {}, + "out_msatoshi_fulfilled": {}, + "htlcs": {}, + "initial_feerate": {}, + "last_feerate": {}, + "next_feerate": {}, + "inflight": {}, + "last_tx_fee_msat": {}, + "direction": {}, + "close_to_addr": { + "type": "string", + "description": [ + "The bitcoin address we will close to (present if close_to_addr is a standardized address)." + ] + } + } + } + }, + { + "if": { + "required": [ + "scratch_txid" + ] + }, + "then": { + "additionalProperties": false, + "required": [ + "last_tx_fee_msat" + ], + "properties": { + "state": {}, + "alias": {}, + "scratch_txid": {}, + "feerate": {}, + "owner": {}, + "short_channel_id": {}, + "channel_id": {}, + "funding_txid": {}, + "funding_outnum": {}, + "inflight": {}, + "close_to": {}, + "private": {}, + "opener": {}, + "closer": {}, + "features": {}, + "funding": {}, + "to_us_msat": {}, + "min_to_us_msat": {}, + "max_to_us_msat": {}, + "total_msat": {}, + "fee_base_msat": {}, + "fee_proportional_millionths": {}, + "dust_limit_msat": {}, + "max_total_htlc_in_msat": {}, + "their_reserve_msat": {}, + "our_reserve_msat": {}, + "spendable_msat": {}, + "receivable_msat": {}, + "minimum_htlc_in_msat": {}, + "minimum_htlc_out_msat": {}, + "maximum_htlc_out_msat": {}, + "spendable_msatoshi": {}, + "receivable_msatoshi": {}, + "their_to_self_delay": {}, + "our_to_self_delay": {}, + "max_accepted_htlcs": {}, + "msatoshi_to_us": {}, + "msatoshi_to_us_min": {}, + "msatoshi_to_us_max": {}, + "msatoshi_total": {}, + "dust_limit_satoshis": {}, + "max_htlc_value_in_flight_msat": {}, + "our_channel_reserve_satoshis": {}, + "their_channel_reserve_satoshis": {}, + "spendable_satoshis": {}, + "receivable_satoshis": {}, + "htlc_minimum_msat": {}, + "state_changes": {}, + "status": {}, + "in_payments_offered": {}, + "in_offered_msat": {}, + "in_msatoshi_offered": {}, + "in_payments_fulfilled": {}, + "in_fulfilled_msat": {}, + "in_msatoshi_fulfilled": {}, + "out_payments_offered": {}, + "out_offered_msat": {}, + "out_msatoshi_offered": {}, + "out_payments_fulfilled": {}, + "out_fulfilled_msat": {}, + "out_msatoshi_fulfilled": {}, + "htlcs": {}, + "initial_feerate": {}, + "last_feerate": {}, + "next_feerate": {}, + "close_to_addr": {}, + "direction": {}, + "last_tx_fee_msat": { + "type": "msat", + "description": [ + "Fee attached to this the current tx." + ] + } + } + } + }, + { + "if": { + "required": [ + "short_channel_id" + ] + }, + "then": { + "additionalProperties": false, + "required": [ + "direction" + ], + "properties": { + "alias": {}, + "state": {}, + "scratch_txid": {}, + "feerate": {}, + "owner": {}, + "short_channel_id": {}, + "channel_id": {}, + "funding_txid": {}, + "funding_outnum": {}, + "inflight": {}, + "close_to": {}, + "private": {}, + "opener": {}, + "closer": {}, + "features": {}, + "funding": {}, + "to_us_msat": {}, + "min_to_us_msat": {}, + "max_to_us_msat": {}, + "total_msat": {}, + "fee_base_msat": {}, + "fee_proportional_millionths": {}, + "dust_limit_msat": {}, + "max_total_htlc_in_msat": {}, + "their_reserve_msat": {}, + "our_reserve_msat": {}, + "spendable_msat": {}, + "receivable_msat": {}, + "minimum_htlc_in_msat": {}, + "minimum_htlc_out_msat": {}, + "maximum_htlc_out_msat": {}, + "spendable_msatoshi": {}, + "receivable_msatoshi": {}, + "their_to_self_delay": {}, + "our_to_self_delay": {}, + "max_accepted_htlcs": {}, + "msatoshi_to_us": {}, + "msatoshi_to_us_min": {}, + "msatoshi_to_us_max": {}, + "msatoshi_total": {}, + "dust_limit_satoshis": {}, + "max_htlc_value_in_flight_msat": {}, + "our_channel_reserve_satoshis": {}, + "their_channel_reserve_satoshis": {}, + "spendable_satoshis": {}, + "receivable_satoshis": {}, + "htlc_minimum_msat": {}, + "state_changes": {}, + "status": {}, + "in_payments_offered": {}, + "in_offered_msat": {}, + "in_msatoshi_offered": {}, + "in_payments_fulfilled": {}, + "in_fulfilled_msat": {}, + "in_msatoshi_fulfilled": {}, + "out_payments_offered": {}, + "out_offered_msat": {}, + "out_msatoshi_offered": {}, + "out_payments_fulfilled": {}, + "out_fulfilled_msat": {}, + "out_msatoshi_fulfilled": {}, + "htlcs": {}, + "initial_feerate": {}, + "last_feerate": {}, + "next_feerate": {}, + "close_to_addr": {}, + "last_tx_fee_msat": {}, + "direction": { + "type": "u32", + "description": [ + "0 if we're the lesser node_id, 1 if we're the greater (as used in BOLT #7 channel_update)." + ] + } + } + } + }, + { + "if": { + "required": [ + "inflight" + ] + }, + "then": { + "additionalProperties": false, + "required": [ + "initial_feerate", + "last_feerate", + "next_feerate" + ], + "properties": { + "state": {}, + "scratch_txid": {}, + "feerate": {}, + "owner": {}, + "alias": {}, + "short_channel_id": {}, + "channel_id": {}, + "funding_txid": {}, + "funding_outnum": {}, + "close_to": {}, + "private": {}, + "opener": {}, + "closer": {}, + "features": {}, + "funding": {}, + "to_us_msat": {}, + "min_to_us_msat": {}, + "max_to_us_msat": {}, + "total_msat": {}, + "fee_base_msat": {}, + "fee_proportional_millionths": {}, + "dust_limit_msat": {}, + "max_total_htlc_in_msat": {}, + "their_reserve_msat": {}, + "our_reserve_msat": {}, + "spendable_msat": {}, + "receivable_msat": {}, + "minimum_htlc_in_msat": {}, + "minimum_htlc_out_msat": {}, + "maximum_htlc_out_msat": {}, + "spendable_msatoshi": {}, + "receivable_msatoshi": {}, + "their_to_self_delay": {}, + "our_to_self_delay": {}, + "max_accepted_htlcs": {}, + "msatoshi_to_us": {}, + "msatoshi_to_us_min": {}, + "msatoshi_to_us_max": {}, + "msatoshi_total": {}, + "dust_limit_satoshis": {}, + "max_htlc_value_in_flight_msat": {}, + "our_channel_reserve_satoshis": {}, + "their_channel_reserve_satoshis": {}, + "spendable_satoshis": {}, + "receivable_satoshis": {}, + "htlc_minimum_msat": {}, + "state_changes": {}, + "status": {}, + "in_payments_offered": {}, + "in_offered_msat": {}, + "in_msatoshi_offered": {}, + "in_payments_fulfilled": {}, + "in_fulfilled_msat": {}, + "in_msatoshi_fulfilled": {}, + "out_payments_offered": {}, + "out_offered_msat": {}, + "out_msatoshi_offered": {}, + "out_payments_fulfilled": {}, + "out_fulfilled_msat": {}, + "out_msatoshi_fulfilled": {}, + "htlcs": {}, + "inflight": {}, + "close_to_addr": {}, + "direction": {}, + "last_tx_fee_msat": {}, + "initial_feerate": { + "type": "string", + "description": [ + "The feerate for the initial funding transaction in per-1000-weight, with `kpw` appended." + ] + }, + "last_feerate": { + "type": "string", + "description": [ + "The feerate for the latest funding transaction in per-1000-weight, with `kpw` appended." + ] + }, + "next_feerate": { + "type": "string", + "description": [ + "The minimum feerate for the next funding transaction in per-1000-weight, with `kpw` appended." + ] + } + } + } + } + ] + } + } + }, + "allOf": [ + { + "if": { + "additionalProperties": true, + "properties": { + "connected": { + "enum": [ + true + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "netaddr", + "features" + ], + "properties": { + "id": {}, + "channels": {}, + "connected": {}, + "num_channels": {}, + "htlcs": {}, + "log": {}, + "netaddr": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "description": [ + "A single entry array." + ], + "items": { + "type": "string", + "description": [ + "Address, e.g. 1.2.3.4:1234." + ] + } + }, + "remote_addr": { + "type": "string", + "description": [ + "The public IPv4/6 address the peer sees us from, e.g. 1.2.3.4:1234." + ] + }, + "features": { + "type": "hex", + "description": [ + "Bitmap of BOLT #9 features from peer's INIT message." + ] + } + } + } + } + ] + } + } + } + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong." + ], + "example_json_request": [ + { + "id": "example:listpeers#1", + "method": "listpeers", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "level": null + } + }, + { + "id": "example:listpeers#2", + "method": "listpeers", + "params": { + "id": null, + "level": null + } + } + ], + "example_json_response": [ + { + "peers": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "connected": true, + "num_channels": 1, + "netaddr": [ + "127.0.0.1:44619" + ], + "features": "08a0000a0a69a2" + } + ] + }, + { + "peers": [ + { + "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "connected": true, + "num_channels": 1, + "netaddr": [ + "127.0.0.1:48862" + ], + "features": "08a0000a0a69a2" + } + ] + } + ], + "author": [ + "Michael Hawkins <>." + ], + "see_also": [ + "lightning-connect(7)", + "lightning-fundchannel_start(7)", + "lightning-setchannel(7)" + ], + "resources": [ + "Main web site: ", + "Lightning RFC site (BOLT #9):", + "" + ] + }, + "lightning-listsendpays.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listsendpays", + "title": "Low-level command for querying sendpay status", + "description": [ + "The **listsendpays** RPC command gets the status of all *sendpay* commands (which is also used by the *pay* command), or with *bolt11* or *payment_hash* limits results to that specific payment. You cannot specify both. It is possible to filter the payments also by *status*.", + "", + "Note that there may be more than one concurrent *sendpay* command per *pay*, so this command should be used with caution." + ], + "request": { + "required": [], + "properties": { + "bolt11": { + "type": "string", + "description": [ + "Bolt11 invoice." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the payment_preimage." + ] + }, + "status": { + "type": "string", + "enum": [ + "pending", + "complete", + "failed" + ], + "description": [ + "Whether the invoice has been paid, pending, or failed." + ] + }, + "index": { + "type": "string", + "added": "v23.11", + "enum": [ + "created", + "updated" + ], + "description": [ + "If neither bolt11 or payment_hash is specified, `index` controls ordering, by `created` (default) or `updated`." + ] + }, + "start": { + "type": "u64", + "added": "v23.11", + "description": [ + "If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)." + ] + }, + "limit": { + "type": "u32", + "added": "v23.11", + "description": [ + "If `index` is specified, `limit` can be used to specify the maximum number of entries to return." + ] + } + }, + "dependentUpon": { + "index": [ + "start", + "limit" + ] + } + }, + "response": { + "required": [ + "payments" + ], + "properties": { + "payments": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "id", + "created_index", + "payment_hash", + "status", + "groupid", + "created_at", + "amount_sent_msat" + ], + "properties": { + "created_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was created in." + ] + }, + "id": { + "type": "u64", + "description": [ + "Old synonym for created_index." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." + ] + }, + "partid": { + "type": "u64", + "description": [ + "Part number (for multiple parts to a single payment)." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "updated_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was changed (only present if it has changed since creation)." + ] + }, + "status": { + "type": "string", + "enum": [ + "pending", + "failed", + "complete" + ], + "description": [ + "Status of the payment." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount delivered to destination (if known)." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment if known." + ] + }, + "created_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "The amount sent." + ] + }, + "label": { + "type": "string", + "description": [ + "The label, if given to sendpay." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string (if pay supplied one)." + ] + }, + "description": { + "type": "string", + "description": [ + "The description matching the bolt11 description hash (if pay supplied one)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string (if supplied for pay: **experimental-offers** only)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "complete" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "payment_preimage" + ], + "properties": { + "id": {}, + "created_index": {}, + "updated_index": {}, + "partid": {}, + "groupid": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "destination": {}, + "created_at": {}, + "msatoshi_sent": {}, + "amount_sent_msat": {}, + "label": {}, + "bolt11": {}, + "description": {}, + "bolt12": {}, + "completed_at": { + "type": "u64", + "added": "pre-v0.10.1", + "description": [ + "The UNIX timestamp showing when this payment was completed." + ] + }, + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash**." + ] + } + } + } + }, + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "failed" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [], + "properties": { + "id": {}, + "created_index": {}, + "updated_index": {}, + "partid": {}, + "groupid": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "destination": {}, + "created_at": {}, + "completed_at": {}, + "msatoshi_sent": {}, + "amount_sent_msat": {}, + "label": {}, + "bolt11": {}, + "description": {}, + "bolt12": {}, + "erroronion": { + "type": "hex", + "description": [ + "The onion message returned." + ] + } + } + } + }, + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "pending" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [], + "properties": { + "id": {}, + "created_index": {}, + "updated_index": {}, + "partid": {}, + "groupid": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "destination": {}, + "created_at": {}, + "msatoshi_sent": {}, + "amount_sent_msat": {}, + "label": {}, + "bolt11": {}, + "description": {}, + "bolt12": {} + } + } + } + ] + } + } + }, + "pre_return_value_notes": [ + "Note that the returned array is ordered by increasing *id*." + ] + }, + "example_json_request": [ + { + "id": "example:listsendpays#1", + "method": "listsendpays", + "params": { + "bolt11": null, + "payment_hash": null, + "status": null, + "index": null, + "start": null, + "limit": null + } + }, + { + "id": "example:listsendpays#2", + "method": "listsendpays", + "params": { + "bolt11": "lnbcrt1230n1pja03q9sp5xu9aypccf3n6vld2waxcysy47ct2wl5x5adtm7k8u30knqes22lspp5duw2v8csh0zh4xg9ql3amem98avlkc2ecre99tgmr2340amf9kmsdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqwh78s8wqg0kepspw0epcxmxteh5wu8n6ddlwdnyj758fqxpqk8ejf597x8ju3r32xqgae3yzjjz9e5s6l2vs5zxvkayhmemmx74wvyqqyqf8c9", + "payment_hash": null, + "status": null, + "index": null, + "start": null, + "limit": null + } + } + ], + "example_json_response": [ + { + "payments": [ + { + "created_index": 1, + "id": 1, + "payment_hash": "e3b43574acd074b0c4ba1b13b5155ff5f9c76742e643ed003e17301c5a2db149", + "groupid": 1, + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount_msat": 20000, + "amount_sent_msat": 20000, + "created_at": 1706225269, + "status": "pending", + "bolt11": "lnbcrt200n1pjm9mn5sp5gq84lgga959m6gg4g0kj29ypwjaxxnm4cu5csymq8p6nqxv800mspp5uw6r2a9v6p6tp396rvfm292l7huuwe6zuep76qp7zucpck3dk9ysdpqf9grgmt62fmk5stswefh23n2tpykvcmzxqyjw5qcqp99qxpqysgqz8s496zmwed278jvp075zlhrnj0ncg45kcfw5s2lkhtxd3wc39f8wflp5gmd827dk470xpasfpx0azsfu0k8ttwae7620h8d050w28cqan776g" + }, + { + "created_index": 2, + "id": 2, + "payment_hash": "f55d92cfe019b5a015f5e5956e9255053cda14786171d5002feb12ae5254e5a5", + "groupid": 1, + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount_msat": 30000, + "amount_sent_msat": 30000, + "created_at": 1706225269, + "status": "pending", + "bolt11": "lnbcrt300n1pjm9mn5sp5zqfkr93rp92mdyj6m8lzpcu90rfefcaqff8fxdd2sc5mace23ujspp574we9nlqrx66q904uk2kayj4q57d59rcv9ca2qp0avf2u5j5ukjsdpq29j55nfcgfcnsvzw2er57knhwcmhzwt0xqyjw5qcqp99qxpqysgq76p2jpnegtzlxmn0aqt6d3f89q4p6y5v3v2qz7t2mm6xt90nt324cq400tl82k28562aux8jxs57d603g7s0q4g3dapu9a7vln94j7spsut799" + } + ] + }, + { + "payments": [ + { + "created_index": 1, + "id": 1, + "payment_hash": "6f1ca61f10bbc57a990507e3dde7653f59fb6159c0f252ad1b1aa357f7692db7", + "groupid": 1, + "updated_index": 1, + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount_msat": 123000, + "amount_sent_msat": 123000, + "created_at": 1708639237, + "completed_at": 1708639238, + "status": "complete", + "payment_preimage": "91f8366681fdfd309c048082fcde81a79116f85a7b2dd09aef1e34f5f7c3397b", + "bolt11": "lnbcrt1230n1pja03q9sp5xu9aypccf3n6vld2waxcysy47ct2wl5x5adtm7k8u30knqes22lspp5duw2v8csh0zh4xg9ql3amem98avlkc2ecre99tgmr2340amf9kmsdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqwh78s8wqg0kepspw0epcxmxteh5wu8n6ddlwdnyj758fqxpqk8ejf597x8ju3r32xqgae3yzjjz9e5s6l2vs5zxvkayhmemmx74wvyqqyqf8c9" + } + ] + } + ], + "author": [ + "Christian Decker <> is mainly responsible." + ], + "see_also": [ + "lightning-listpays(7)", + "lightning-sendpay(7)", + "lightning-listinvoice(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-listsqlschemas.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.02", + "rpc": "listsqlschemas", + "title": "Command to example lightning-sql schemas", + "description": [ + "This allows you to examine the schemas at runtime; while they are fully documented for the current release in lightning-sql(7), as fields are added or deprecated, you can use this command to determine what fields are present.", + "", + "If *table* is given, only that table is in the resulting list, otherwise all tables are listed." + ], + "request": { + "required": [], + "properties": { + "table": { + "type": "string" + } + } + }, + "response": { + "required": [ + "schemas" + ], + "properties": { + "schemas": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "tablename", + "columns" + ], + "properties": { + "tablename": { + "type": "string", + "description": [ + "The name of the table." + ] + }, + "columns": { + "type": "array", + "description": [ + "The columns, in database order." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "name", + "type" + ], + "properties": { + "name": { + "type": "string", + "description": [ + "The name of the column." + ] + }, + "type": { + "type": "string", + "enum": [ + "INTEGER", + "BLOB", + "TEXT", + "REAL" + ], + "description": [ + "The SQL type of the column." + ] + } + } + } + }, + "indices": { + "type": "array", + "description": [ + "Any index we created to speed lookups." + ], + "items": { + "type": "array", + "description": [ + "The columns for this index." + ], + "items": { + "type": "string", + "description": [ + "The column name." + ] + } + } + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:listsqlschemas#1", + "method": "listsqlschemas", + "params": { + "table": "offers" + } + }, + { + "id": "example:listsqlschemas#2", + "method": "listsqlschemas", + "params": [ + "closedchannels" + ] + } + ], + "example_json_response": [ + { + "schemas": [ + { + "tablename": "offers", + "columns": [ + { + "name": "offer_id", + "type": "BLOB" + }, + { + "name": "active", + "type": "INTEGER" + }, + { + "name": "single_use", + "type": "INTEGER" + }, + { + "name": "bolt12", + "type": "TEXT" + }, + { + "name": "bolt12_unsigned", + "type": "TEXT" + }, + { + "name": "used", + "type": "INTEGER" + }, + { + "name": "label", + "type": "TEXT" + } + ], + "indices": [ + [ + "offer_id" + ] + ] + } + ] + }, + { + "schemas": [ + { + "tablename": "closedchannels", + "columns": [ + { + "name": "rowid", + "type": "INTEGER" + }, + { + "name": "peer_id", + "type": "BLOB" + }, + { + "name": "channel_id", + "type": "BLOB" + }, + { + "name": "short_channel_id", + "type": "TEXT" + }, + { + "name": "alias_local", + "type": "TEXT" + }, + { + "name": "alias_remote", + "type": "TEXT" + }, + { + "name": "opener", + "type": "TEXT" + }, + { + "name": "closer", + "type": "TEXT" + }, + { + "name": "private", + "type": "INTEGER" + }, + { + "name": "total_local_commitments", + "type": "INTEGER" + }, + { + "name": "total_remote_commitments", + "type": "INTEGER" + }, + { + "name": "total_htlcs_sent", + "type": "INTEGER" + }, + { + "name": "funding_txid", + "type": "BLOB" + }, + { + "name": "funding_outnum", + "type": "INTEGER" + }, + { + "name": "leased", + "type": "INTEGER" + }, + { + "name": "funding_fee_paid_msat", + "type": "INTEGER" + }, + { + "name": "funding_fee_rcvd_msat", + "type": "INTEGER" + }, + { + "name": "funding_pushed_msat", + "type": "INTEGER" + }, + { + "name": "total_msat", + "type": "INTEGER" + }, + { + "name": "final_to_us_msat", + "type": "INTEGER" + }, + { + "name": "min_to_us_msat", + "type": "INTEGER" + }, + { + "name": "max_to_us_msat", + "type": "INTEGER" + }, + { + "name": "last_commitment_txid", + "type": "BLOB" + }, + { + "name": "last_commitment_fee_msat", + "type": "INTEGER" + }, + { + "name": "close_cause", + "type": "TEXT" + } + ] + } + ] + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-sql(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-listtransactions.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listtransactions", + "title": "Command to get the list of transactions that was stored in the wallet.", + "description": [ + "The **listtransactions** command returns transactions tracked in the wallet. This includes deposits, withdrawals and transactions related to channels. A transaction may have multiple types, e.g., a transaction may both be a close and a deposit if it closes the channel and returns funds to the wallet." + ], + "request": { + "required": [], + "properties": {} + }, + "response": { + "required": [ + "transactions" + ], + "properties": { + "transactions": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "hash", + "rawtx", + "blockheight", + "txindex", + "locktime", + "version", + "inputs", + "outputs" + ], + "properties": { + "hash": { + "type": "txid", + "description": [ + "The transaction id." + ] + }, + "rawtx": { + "type": "hex", + "description": [ + "The raw transaction." + ] + }, + "blockheight": { + "type": "u32", + "description": [ + "The block height of this tx." + ] + }, + "txindex": { + "type": "u32", + "description": [ + "The transaction number within the block." + ] + }, + "locktime": { + "type": "u32", + "description": [ + "The nLocktime for this tx." + ] + }, + "version": { + "type": "u32", + "description": [ + "The nVersion for this tx." + ] + }, + "inputs": { + "type": "array", + "description": [ + "Each input, in order." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "txid", + "index", + "sequence" + ], + "properties": { + "txid": { + "type": "txid", + "description": [ + "The transaction id spent." + ] + }, + "index": { + "type": "u32", + "description": [ + "The output spent." + ] + }, + "sequence": { + "type": "u32", + "description": [ + "The nSequence value." + ] + } + } + } + }, + "outputs": { + "type": "array", + "description": [ + "Each output, in order." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "index", + "amount_msat", + "scriptPubKey" + ], + "properties": { + "index": { + "type": "u32", + "description": [ + "The 0-based output number." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount of the output." + ] + }, + "scriptPubKey": { + "type": "hex", + "description": [ + "The scriptPubKey." + ] + } + } + } + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:listtransactions#1", + "method": "listtransactions", + "params": {} + } + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters." + ], + "example_json_response": [ + { + "transactions": [ + { + "hash": "05985072bbe20747325e69a159fe08176cc1bbc96d25e8848edad2dddc1165d0", + "rawtx": "02000000027032912651fc25a3e0893acd5f9640598707e2dfef92143bb5a4020e335442800100000017160014a5f48b9aa3cb8ca6cc1040c11e386745bb4dc932ffffffffd229a4b4f78638ebcac10a68b0561585a5d6e4d3b769ad0a909e9b9afaeae24e00000000171600145c83da9b685f9142016c6f5eb5f98a45cfa6f686ffffffff01915a01000000000017a9143a4dfd59e781f9c3018e7d0a9b7a26d58f8d22bf8700000000", + "blockheight": 0, + "txindex": 0, + "locktime": 0, + "version": 2, + "inputs": [ + { + "txid": "804254330e02a4b53b1492efdfe207875940965fcd3a89e0a325fc5126913270", + "index": 1, + "sequence": 4294967295 + }, + { + "txid": "4ee2eafa9a9b9e900aad69b7d3e4d6a5851556b0680ac1caeb3886f7b4a429d2", + "index": 0, + "sequence": 4294967295 + } + ], + "outputs": [ + { + "index": 0, + "satoshis": "88721000msat", + "scriptPubKey": "a9143a4dfd59e781f9c3018e7d0a9b7a26d58f8d22bf87" + } + ] + } + ] + } + ], + "author": [ + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." + ], + "see_also": [ + "lightning-newaddr(7)", + "lightning-listfunds(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-makesecret.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "makesecret", + "title": "Command for deriving pseudorandom key from HSM", + "description": [ + "The **makesecret** RPC command derives a secret key from the HSM_secret." + ], + "request": { + "required": [], + "properties": { + "hex": { + "type": "hex", + "description": [ + "One of `hex` or `string` must be specified: `hex` can be any hex data." + ] + }, + "string": { + "type": "string", + "description": [ + "One of `hex` or `string` must be specified: `string` is a UTF-8 string interpreted literally." + ] + } + } + }, + "response": { + "required": [ + "secret" + ], + "properties": { + "secret": { + "type": "secret", + "description": [ + "The pseudorandom key derived from HSM_secret." + ] + } + } + }, + "errors": [ + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error." + ], + "example_json_request": [ + { + "id": "example:makesecret#1", + "method": "makesecret", + "params": [ + "73636220736563726574" + ] + }, + { + "id": "example:makesecret#2", + "method": "makesecret", + "params": [ + null, + "scb secret" + ] + } + ], + "example_json_response": [ + { + "secret": "a9a2e742405c28f059349132923a99337ae7f71168b7485496e3365f5bc664ed" + }, + { + "secret": "a9a2e742405c28f059349132923a99337ae7f71168b7485496e3365f5bc664ed" + } + ], + "author": [ + "Aditya <> is mainly responsible." + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-multifundchannel.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "multifundchannel", + "title": "Command for establishing many lightning channels", + "description": [ + "The **multifundchannel** RPC command opens multiple payment channels with nodes by committing a single funding transaction to the blockchain that is shared by all channels.", + "", + "If not already connected, **multifundchannel** will automatically attempt to connect; you may provide a *@host:port* hint appended to the node ID so that Core Lightning can learn how to connect to the node; see lightning-connect(7).", + "", + "Once the transaction is confirmed, normal channel operations may begin. Readiness is indicated by **listpeers** reporting a *state* of `CHANNELD_NORMAL` for the channel." + ], + "request": { + "required": [ + "destinations" + ], + "properties": { + "destinations": { + "type": "array", + "description": [ + "There must be at least one entry in *destinations*; it cannot be an empty array." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "id", + "amount" + ], + "properties": { + "id": { + "type": "string", + "description": [ + "Node ID, with an optional *@host:port* appended to it in a manner understood by **connect**; see lightning-connect(7). Each entry in the *destinations* array must have a unique node *id*. If not already connected, **multifundchannel** will automatically attempt to connect to the node." + ] + }, + "amount": { + "type": "msat", + "description": [ + "Amount in satoshis taken from the internal wallet to fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). The string *all* can be used to specify all available funds (or 16,777,215 satoshi if more is available and large channels were not negotiated with the peer). Otherwise it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The value cannot be less than the dust limit, currently 546 satoshi as of this writing, nor more than 16,777,215 satoshi (unless large channels were negotiated with the peer)." + ] + }, + "announce": { + "type": "boolean", + "description": [ + "Flag that indicates whether to announce the channel with this. If set to `False`, the channel is unpublished." + ], + "default": "`True`" + }, + "push_msat": { + "type": "msat", + "description": [ + "Amount of millisatoshis to outright give to the node. This is a gift to the peer, and you do not get a proof-of-payment out of this." + ] + }, + "close_to": { + "type": "string", + "description": [ + "Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script` Returns `close_to` set to closing script iff is negotiated." + ] + }, + "request_amt": { + "type": "msat", + "description": [ + "Amount of liquidity you'd like to lease from peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*." + ] + }, + "compact_lease": { + "type": "string", + "description": [ + "Compact representation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel to this destination." + ] + }, + "mindepth": { + "type": "u32", + "description": [ + "Number of confirmations before we consider the channel active." + ] + }, + "reserve": { + "type": "msat", + "description": [ + "Amount we want the peer to maintain on its side of the channel. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*." + ], + "default": "1% of the funding amount" + } + } + } + }, + "feerate": { + "type": "feerate", + "description": [ + "Feerate used for the opening transaction, and if *commitment_feerate* is not set, as initial feerate for commitment and HTLC transactions. See NOTES in lightning-feerates(7) for possible values." + ], + "default": "*normal*" + }, + "minconf": { + "type": "integer", + "description": [ + "Minimum number of confirmations that used outputs should have." + ], + "default": 1 + }, + "utxos": { + "type": "array", + "items": { + "type": "outpoint", + "description": [ + "Utxos to be used to fund the channel, as an array of `txid:vout`." + ] + } + }, + "minchannels": { + "type": "integer", + "description": [ + "Re-attempt funding as long as at least this many peers remain (must not be zero). The **multifundchannel** command will only fail if too many peers fail the funding process." + ] + }, + "commitment_feerate": { + "type": "feerate", + "description": [ + "Initial feerate for commitment and HTLC transactions. See *feerate* for valid values." + ] + } + } + }, + "response": { + "required": [ + "tx", + "txid", + "channel_ids" + ], + "properties": { + "tx": { + "type": "hex", + "description": [ + "The raw transaction which funded the channel." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The txid of the transaction which funded the channel." + ] + }, + "channel_ids": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "id", + "channel_id", + "channel_type", + "outnum" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The peer we opened the channel with." + ] + }, + "outnum": { + "type": "u32", + "description": [ + "The 0-based output index showing which output funded the channel." + ] + }, + "channel_id": { + "type": "hash", + "description": [ + "The channel_id of the resulting channel." + ] + }, + "channel_type": { + "type": "object", + "description": [ + "Channel_type as negotiated with peer." + ], + "added": "v24.02", + "additionalProperties": false, + "required": [ + "bits", + "names" + ], + "properties": { + "bits": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + }, + "names": { + "type": "array", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" + ], + "description": [ + "Name of feature bit." + ] + } + } + } + }, + "close_to": { + "type": "hex", + "description": [ + "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`." + ] + } + } + } + }, + "failed": { + "type": "array", + "description": [ + "Any peers we failed to open with (if *minchannels* was specified less than the number of destinations)." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "id", + "method", + "error" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The peer we failed to open the channel with." + ] + }, + "method": { + "type": "string", + "enum": [ + "connect", + "openchannel_init", + "fundchannel_start", + "fundchannel_complete" + ], + "description": [ + "What stage we failed at." + ] + }, + "error": { + "type": "object", + "additionalProperties": false, + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "integer", + "description": [ + "JSON error code from failing stage." + ] + }, + "message": { + "type": "string", + "description": [ + "Message from stage." + ] + }, + "data": { + "untyped": true, + "description": [ + "Additional error data." + ] + } + } + } + } + } + } + }, + "pre_return_value_notes": [ + "This command opens multiple channels with a single large transaction, thus only one transaction is returned.", + "", + "If *minchannels* was specified and is less than the number of destinations, then it is possible that one or more of the destinations do not have a channel even if **multifundchannel** succeeded." + ], + "post_return_value_notes": [ + "On failure, none of the channels are created." + ] + }, + "errors": [ + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error.", + "- 300: The maximum allowed funding amount is exceeded.", + "- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.", + "- 302: The output amount is too small, and would be considered dust.", + "- 303: Broadcasting of the funding transaction failed, the internal call to bitcoin-cli returned with an error.", + "- 313: The `min-emergency-msat` reserve not be preserved (and we have or are opening anchor channels).", + "", + "Failure may also occur if **lightningd** and the peer cannot agree on channel parameters (funding limits, channel reserves, fees, etc.). See lightning-fundchannel_start(7) and lightning-fundchannel_complete(7).", + "", + "There may be rare edge cases where a communications failure later in the channel funding process will cancel the funding locally, but the peer thinks the channel is already waiting for funding lockin. In that case, the next time we connect to the peer, our node will tell the peer to forget the channel, but some nodes (in particular, Core Lightning nodes) will disconnect when our node tells them to forget the channel. If you immediately **multifundchannel** with that peer, it could trigger this connect-forget-disconnect behavior, causing the second **multifundchannel** to fail as well due to disconnection. Doing a **connect** with the peers separately, and waiting for a few seconds, should help clear this hurdle; running **multifundchannel** a third time would also clear this." + ], + "example_usage": [ + "This example opens three channels at once, with amounts 200,000 sats, 3,000,000 sats and the final channel using all remaining funds (actually, capped at 16,777,215 sats because large-channels is not enabled):", + "", + "```shell", + "$ lightning-cli multifundchannel '[{\"id\":\"0201f42e167959c74d396ac57652fcea63c63940f78e8239cce5720df4d85ef857@127.0.0.1:7272\", \"amount\":\"200000sat\"}, {\"id\":\"0304a2468065535f9459567686e0f02b40f06e341d3eb2a62ec6763bcf2ccfd207@127.0.0.1:7373\", \"amount\":\"0.03btc\"}, {\"id\":\"0391f4c475050bb15871da5a72b1f3a1798de3d2e5fb4ffa262899b8d8e1f0b764@127.0.0.1:7474\", \"amount\":\"all\"}]'", + "{", + " \"tx\": \"02000000000101fbe3c68db87b72f82c3f5447b0bc032469c78e71f229ac99c230807ff378a9d80000000000fdffffff04400d0300000000002200202e9897ed5f9b237aa27fd5d02d24157cd452b0d3f0a5bb03d38ff73f9f8f384bffffff0000000000220020439d797ada249e1e12f8d27cabb7330de3c8de0456fb54892deb7b9c72b0ff7c1dc9b50400000000225120046e3966a2d5e43c1f1e0676161905782e1e7c00811485c618f5144f328f4e2bc0c62d0000000000220020e36fd5c03c3586c3763d8b4c9d8650f396ff1c8a460137fb09b60ee82536a3b20140ea4d564e91c919b50a2d32886f1d414de773491119beb1364b92f15d6d03e1810e5ddea89c265e42f2e96bb028dfb3aa0b5b30072ddcc78daad727503c53e37fa9010000\",", + " \"txid\": \"90dc53922b70628fc9e7804ad0b8cd0fb41f050d94ffa2db3b16e918c96c022a\",", + " \"channel_ids\": [", + " {", + " \"id\": \"0201f42e167959c74d396ac57652fcea63c63940f78e8239cce5720df4d85ef857\",", + " \"channel_id\": \"25c8253e66a860d17916cc0c21386e310eba9900030a68ec6ff6f59a8401a872\",", + " \"outnum\": 0", + " },", + " {", + " \"id\": \"0304a2468065535f9459567686e0f02b40f06e341d3eb2a62ec6763bcf2ccfd207\",", + " \"channel_id\": \"51749d724892a406896f6bf2e2f8c0b03399d0436691f294839897fa167e6521\",", + " \"outnum\": 3", + " },", + " {", + " \"id\": \"0391f4c475050bb15871da5a72b1f3a1798de3d2e5fb4ffa262899b8d8e1f0b764\",", + " \"channel_id\": \"7e1414e72c081f0754fa18c1657cedabe696aa9ffeaf0b936bfbe3a28f2829d1\",", + " \"outnum\": 1", + " }", + " ],", + " \"failed\": []", + "}", + "```" + ], + "example_json_request": [ + { + "id": "example:multifundchannel#1", + "method": "multifundchannel", + "params": { + "destinations": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59@localhost:41939", + "amount": 50000 + } + ], + "feerate": "10000perkw", + "minconf": null, + "utxos": null, + "minchannels": null, + "commitment_feerate": "2000perkw" + } + }, + { + "id": "example:multifundchannel#2", + "method": "multifundchannel", + "params": { + "destinations": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59@localhost:44663", + "amount": 50000 + }, + { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d@localhost:34631", + "amount": 50000 + }, + { + "id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199@localhost:34617", + "amount": 50000 + } + ], + "feerate": null, + "minconf": null, + "utxos": null, + "minchannels": 1 + } + } + ], + "example_json_response": [ + { + "tx": "0200000000010100a8ceb6f76c49c8c0c809ca359461540708a9a5ac56e56e6a7aaafb35f4d3850000000000fdffffff0250c30000000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd0623ff030000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a02473044022064763837f2cc84507eb1fc28c9e95d51174e1da4b8755da8e67fe21e37d0a8b402206295d0f19625f014819361a20572b936d81f6c5ba419e56997e882f3a7be094a012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000", + "txid": "ecba36e93bcf40542d43a05ef550bb0e4be51d766aa2ec8c5640a0d431ab0d06", + "channel_ids": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "channel_id": "060dab31d4a040568ceca26a761de54b0ebb50f55ea0432d5440cf3be936baec", + "channel_type": { + "bits": [ + 12 + ], + "names": [ + "static_remotekey/even" + ] + }, + "outnum": 0 + } + ], + "failed": [] + }, + { + "tx": "020000000001023041611dac05004825ab64781b4a33bf622380bf90196fae689196b1850a1f8f0000000000fdffffff5646519c565466c9588a88400ec71a39a2c0b6988beadb32491a13d9b89f85360100000000fdffffff0250c3000000000000220020181492c29a989f099fd2cf412c74b192dd095e81f4e4f6bec45bd1fbfdd2cfd983720000000000002251203e8a03f678bb7ca048baecc39788530560ea049816d604f72925e425288446c80140caa3b93c6667e4fe0026417cc87ae9dfd16d80018e7c6dcd6dfcee4d6cab7c7e84181baeb95ba25934ad1aa6b57f83c8287bf1b727123350b35549a3abe15b060140b3c6626b9b57081cc7eb5e4f518669764d265fb84316d8fb610e19ede13c5a370c1072861b909ec923acec980adb4a3e488ee3c6f9c49164bd4596945b52f62678000000", + "txid": "1fcc6d46200443ad21e3a1a1628b862bafd0d75c0b4454f5494957097bc7930d", + "channel_ids": [ + { + "id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", + "channel_id": "0d93c77b09574949f554440b5cd7d0af2b868b62a1a1e321ad430420466dcc1f", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "outnum": 0 + } + ], + "failed": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "method": "connect", + "error": { + "code": 401, + "message": "All addresses failed: 127.0.0.1:44663: Connection establishment: Connection refused. " + } + }, + { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "method": "connect", + "error": { + "code": 401, + "message": "All addresses failed: 127.0.0.1:34631: Connection establishment: Connection refused. " + } + } + ] + } + ], + "author": [ + "ZmnSCPxj <> is mainly responsible." + ], + "see_also": [ + "lightning-connect(7)", + "lightning-listfunds()", + "lightning-listpeers(7)", + "lightning-fundchannel(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-multiwithdraw.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "multiwithdraw", + "title": "Command for withdrawing to multiple addresses", + "description": [ + "The **multiwithdraw** RPC command sends funds from Core Lightning's internal wallet to the addresses specified in *outputs*." + ], + "request": { + "required": [ + "outputs" + ], + "properties": { + "outputs": { + "type": "array", + "items": { + "type": "outputdesc" + }, + "description": [ + "An array containing objects of the form `{address: amount}`. The `amount` may be the string *all*, indicating that all onchain funds be sent to the specified address. Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*." + ] + }, + "feerate": { + "type": "feerate", + "description": [ + "Feerate used for the withdrawals. See NOTES in lightning-feerates(7) for possible values." + ], + "default": "*normal*" + }, + "minconf": { + "type": "u32", + "description": [ + "Minimum number of confirmations that used outputs should have." + ], + "default": 1 + }, + "utxos": { + "type": "array", + "items": { + "type": "outpoint", + "description": [ + "Utxos to be used to be withdrawn from, as an array of `txid:vout`. These must be drawn from the node's available UTXO set." + ] + } + } + } + }, + "response": { + "required": [ + "tx", + "txid" + ], + "properties": { + "tx": { + "type": "hex", + "description": [ + "The raw transaction which was sent." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The txid of the **tx**." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:multiwithdraw#1", + "method": "multiwithdraw", + "params": { + "outputs": [ + { + "bcrt1qyusnugshkn6kh5vmdjpe8hylvxlxjy3ns0hmrs": "2222000msat" + }, + { + "bcrt1q6r4vvt7uack33qf9n05umfxy8h5s2rdcmq7ra3": "3333000msat" + } + ], + "feerate": null, + "minconf": null, + "utxos": null + } + }, + { + "id": "example:multiwithdraw#2", + "method": "multiwithdraw", + "params": { + "outputs": [ + { + "BCRT1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KYGT080": 1000 + }, + { + "bcrt1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qzf4jry": 1000 + }, + { + "bcrt1pw508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7k0ylj56": 1000 + }, + { + "BCRT1SW50QT2UWHA": 1000 + }, + { + "bcrt1zw508d6qejxtdg4y5r3zarvaryv2wuatf": 1000 + }, + { + "bcrt1qqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvseswlauz7": 1000 + }, + { + "bcrt1pqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvsesyga46z": 1000 + }, + { + "bcrt1p0xlxvlhemja6c4dqv22uapctqupfhlxm9h8z3k2e72q4k9hcz7vqc8gma6": 1000 + } + ], + "feerate": null, + "minconf": null, + "utxos": null + } + } + ], + "example_json_response": [ + { + "tx": "02000000000101b75863b811587b4c15bb94d9285c31d6369b8ff609e44de399936f8acb268f600000000000fdffffff03050d000000000000160014d0eac62fdcee2d1881259be9cda4c43de9050db8ae0800000000000016001427213e2217b4f56bd19b6c8393dc9f61be691233d4b5f5050000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a0247304402203a001463da125de5615ff1c18f9cd4a1d2a138c91d40189d350821ac8fb3ae4f02207a507eec27e15fe43476233cd9fe8b690ebd265073a58ed18ff79a1416886f18012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000", + "txid": "94e803b98257855569d35b675d65fb4fa0061a8b5f828992e2104a2882bb18bf" + }, + { + "tx": "02000000000101dc5a50dfbafc30697b930b44e763ff7a255475d17d975fa0e2003431312098cf0100000000fdffffff09e803000000000000225120000000c4a5cad46221b2a187905e5266362b99d5e91c6ce24d165dab93e86433e803000000000000046002751ee8030000000000002a5128751e76e8199196d454941c45d1b3a323f1433bd6751e76e8199196d454941c45d1b3a323f1433bd6e80300000000000022512079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f817983b939700000000002251200518e92cd94e0f62c06f126dff98b9abe79b7ed845a156d5245678e26554475de803000000000000160014751e76e8199196d454941c45d1b3a323f1433bd6e8030000000000002200201863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262e803000000000000125210751e76e8199196d454941c45d1b3a323e803000000000000220020000000c4a5cad46221b2a187905e5266362b99d5e91c6ce24d165dab93e8643301407f0d9bc098c5439ff611507b6a7d403047ed4e0b883f293db19d4e109d350a24f790acb55547384ff2a23fcfde0eba9af7cebc321c19cfc4817ecd47d50c2cd854000000", + "txid": "062383a7c9a19a2768939087a5c89826a4ea3531080f20cc06aa1cbf431be505" + } + ], + "errors": [ + "On failure, an error is reported and the withdrawal transaction is not created.", + "", + "- -1: Catchall nonspecific error.", + "- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.", + "- 302: The dust limit is not met." + ], + "author": [ + "ZmnSCPxj <> is mainly responsible." + ], + "see_also": [ + "lightning-listfunds(7)", + "lightning-fundchannel(7)", + "lightning-newaddr(7)", + "lightning-txprepare(7)", + "lightning-withdraw(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-newaddr.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "newaddr", + "title": "Command for generating a new address to be used by Core Lightning", + "description": [ + "The **newaddr** RPC command generates a new address which can subsequently be used to fund channels managed by the Core Lightning node.", + "", + "The funding transaction needs to be confirmed before funds can be used.", + "", + "To send an on-chain payment from the Core Lightning node wallet, use `withdraw`." + ], + "request": { + "required": [], + "properties": { + "addresstype": { + "type": "string", + "description": [ + "It specifies the type of address wanted; currently *bech32* (e.g. `tb1qu9j4lg5f9rgjyfhvfd905vw46eg39czmktxqgg` on bitcoin testnet or `bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej` on bitcoin mainnet), or *p2tr* taproot addresses. The special value *all* generates all known address types for the same underlying key." + ], + "default": "*bech32* address", + "enum": [ + "bech32", + "p2tr", + "all" + ] + } + } + }, + "response": { + "required": [], + "properties": { + "p2tr": { + "added": "v23.08", + "type": "string", + "description": [ + "The taproot address." + ] + }, + "bech32": { + "type": "string", + "description": [ + "The bech32 (native segwit) address." + ] + } + } + }, + "errors": [ + "If an unrecognized address type is requested an error message will be returned." + ], + "example_json_request": [ + { + "id": "example:newaddr#1", + "method": "newaddr", + "params": { + "addresstype": null + } + }, + { + "id": "example:newaddr#2", + "method": "newaddr", + "params": { + "addresstype": "bech32" + } + } + ], + "example_json_response": [ + { + "bech32": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf" + }, + { + "bech32": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf" + } + ], + "author": [ + "Felix <> is mainly responsible." + ], + "see_also": [ + "lightning-listfunds(7)", + "lightning-fundchannel(7)", + "lightning-withdraw(7)", + "lightning-listtransactions(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-notifications.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "notifications", + "title": "Command to set up notifications.", + "description": [ + "The **notifications** the RPC command enabled notifications for this JSON-RPC connection. By default (and for backwards-compatibility) notifications are disabled.", + "", + "Various commands, especially complex and slow ones, offer notifications which indicate their progress." + ], + "request": { + "required": [ + "enable" + ], + "properties": { + "enable": { + "type": "boolean", + "description": [ + "Whether to enable or disable notifications." + ] + } + } + }, + "response": { + "properties": {}, + "post_return_value_notes": [ + "On success, if *enable* was *true*, notifications will be forwarded from then on." + ] + }, + "notifications": [ + "Notifications are JSON-RPC objects without an *id* field. *lightningd* sends notifications (once enabled with this *notifications* command) with a *params* *id* field indicating which command the notification refers to.", + "", + "Implementations should ignore notifications without an *id* parameter, or unknown *method*.", + "", + "Common *method*s include:", + " *message*: param *message*: a descriptional string indicating something which occurred relating to the command. Param *level* indicates the level, as per lightning-getlog(7): *info* and *debug* are typical.", + " *progress*: param *num* and *total*, where *num* starts at 0 and is always less than *total*. Optional param *stage* with fields *num* and *total*, indicating what stage we are progressing through." + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters." + ], + "example_json_notifications": [ + { + "method": "message", + "params": { + "id": 1, + "message": "This is a test message", + "level": "DEBUG" + } + }, + { + "method": "progress", + "params": { + "id": 2, + "num": 0, + "total": 30, + "stage": { + "num": 0, + "total": 2 + } + } + } + ], + "example_json_request": [ + { + "id": "example:notifications#1", + "method": "notifications", + "params": { + "enable": true + } + }, + { + "id": "example:notifications#2", + "method": "notifications", + "params": { + "enable": false + } + } + ], + "example_json_response": [ + {}, + {} + ], + "author": [ + "Rusty Russell <> wrote the initial version of this man page." + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-offer.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "offer", + "title": "Command for accepting payments", + "warning": "experimental-offers only", + "description": [ + "The **offer** RPC command creates an offer (or returns an existing one), which is a precursor to creating one or more invoices. It automatically enables the processing of an incoming invoice_request, and issuing of invoices.", + "", + "Note that for making an offer to *pay* someone else, see lightning- invoicerequest(7)." + ], + "request": { + "required": [ + "amount", + "description" + ], + "properties": { + "amount": { + "oneOf": [ + { + "type": "msat_or_any" + }, + { + "type": "currency" + } + ], + "description": [ + "Can be the string `any`, which creates an offer that can be paid with any amount (e.g. a donation). Otherwise it can be a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. It can also have an ISO 4217 postfix (e.g. USD), in which case currency conversion will need to be done for the invoice itself. A plugin is needed which provides the `currencyconvert` API for this currency, otherwise the offer creation will fail." + ] + }, + "description": { + "type": "string", + "description": [ + "A short description of purpose of the offer, e.g. *coffee*. This value is encoded into the resulting offer and is viewable by anyone you expose this offer to. It must be UTF-8, and cannot use *\\u* JSON escape codes." + ] + }, + "issuer": { + "type": "string", + "description": [ + "Who is issuing this offer (i.e. you) if appropriate." + ] + }, + "label": { + "type": "string", + "description": [ + "An internal-use name for the offer, which can be any UTF-8 string. This is *NOT* encoded in the offer not sent to the issuer." + ] + }, + "quantity_max": { + "type": "u64", + "description": [ + "Invoice can specify more than one of the items up (and including) this maximum: 0 is a special value meaning `no maximuim`. The *amount* for the invoice will need to be multiplied accordingly. This is encoded in the offer." + ] + }, + "absolute_expiry": { + "type": "u64", + "description": [ + "Time the offer is valid until,in seconds since the first day of 1970 UTC. If not set, the offer remains valid (though it can be deactivated by the issuer of course). This is encoded in the offer." + ] + }, + "recurrence": { + "type": "string", + "description": [ + "An invoice is expected at regular intervals. The argument is a positive number followed by one of `seconds`, `minutes`, `hours`, `days`, `weeks`, `months` or `years` (variants without the trailing `s` are also permitted). This is encoded in the offer. The semantics of recurrence is fairly predictable, but fully documented in BOLT 12. e.g. `4weeks`." + ] + }, + "recurrence_base": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "description": [ + "Time in seconds since the first day of 1970 UTC, optionally with a `@` prefix. This indicates when the first period begins; without this, the recurrence periods start from the first invoice. The `@` prefix means that the invoice must start by paying the first period; otherwise it is permitted to start at any period. This is encoded in the offer. e.g. `@1609459200` indicates you must start paying on the 1st January 2021." + ] + }, + "recurrence_paywindow": { + "type": "string", + "description": [ + "Argument of form `-time+time[%]`. The first time is the number of seconds before the start of a period in which an invoice and payment is valid, the second time is the number of seconds after the start of the period. For example *-604800+86400* means you can fetch an pay the invoice 4 weeks before the given period starts, and up to 1 day afterwards. The optional *%* indicates that the amount of the invoice will be scaled by the time remaining in the period. This is encoded in the offer." + ], + "default": "that payment is allowed during the current and previous periods" + }, + "recurrence_limit": { + "type": "u32", + "description": [ + "To indicate the maximum period which exists. eg. `12` means there are 13 periods, from 0 to 12 inclusive. This is encoded in the offer." + ] + }, + "single_use": { + "type": "boolean", + "description": [ + "Indicates that the offer is only valid once; we may issue multiple invoices, but as soon as one is paid all other invoices will be expired (i.e. only one person can pay this offer)." + ], + "default": "False" + } + } + }, + "response": { + "required": [ + "offer_id", + "active", + "single_use", + "bolt12", + "used", + "created" + ], + "properties": { + "offer_id": { + "type": "hash", + "description": [ + "The id of this offer (merkle hash of non-signature fields)." + ] + }, + "active": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Whether this can still be used." + ] + }, + "single_use": { + "type": "boolean", + "description": [ + "Whether this expires as soon as it's paid (reflects the *single_use* parameter)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 encoding of the offer." + ] + }, + "used": { + "type": "boolean", + "description": [ + "True if an associated invoice has been paid." + ] + }, + "created": { + "type": "boolean", + "description": [ + "False if the offer already existed." + ] + }, + "label": { + "type": "string", + "description": [ + "The (optional) user-specified label." + ] + } + } + }, + "errors": [ + "On failure, an error is returned and no offer is created. If the lightning process fails before responding, the caller should use lightning-listoffers(7) to query whether this offer was created or not.", + "", + "If the offer already existed, and is still active, that is returned; if it's not active then this call fails.", + "", + "- -1: Catchall nonspecific error.", + "- 1000: Offer with this offer_id already exists (but is not active)." + ], + "example_json_request": [ + { + "id": "example:offer#1", + "method": "offer", + "params": { + "amount": "1msat", + "description": "test for 1msat" + } + }, + { + "id": "example:offer#2", + "method": "offer", + "params": { + "amount": "100000sat", + "description": "quantity_max test", + "recurrence": "1week" + } + } + ], + "example_json_response": [ + { + "offer_id": "f61cca153d1948dade19349792d9bcdc9cef687fd27db0b553a67979f55aae48", + "active": true, + "single_use": false, + "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqyqs5rn5v4ehggrxdaezqvtdwdshg93pqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq63s", + "used": false, + "created": true + }, + { + "offer_id": "f7a501e51e2a90d032150b9100b1977c625f05cfda22469bdc81d8a20b1e303f", + "active": true, + "single_use": false, + "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqszltcgqpgghzatpde6xjaretakkz7pqw3jhxaqkyypxdeze35wncs2l2u4gfzyrpds00e6yakfrt6ctrw5n9qanzhqr2xq6qgqsw", + "used": false, + "created": true + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listoffers(7)", + "lightning-disableoffer(7)", + "lightning-invoicerequest(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-openchannel_abort.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "openchannel_abort", + "title": "Command to abort a channel to a peer", + "description": [ + "`openchannel_init` is a low level RPC command which initiates a channel open with a specified peer. It uses the openchannel protocol which allows for interactive transaction construction." + ], + "request": { + "required": [ + "channel_id" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "Channel id of the channel to be aborted." + ] + } + } + }, + "response": { + "required": [ + "channel_id", + "channel_canceled", + "reason" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "The channel id of the aborted channel." + ] + }, + "channel_canceled": { + "type": "boolean", + "description": [ + "Whether this is completely canceled (there may be remaining in-flight transactions)." + ] + }, + "reason": { + "type": "string", + "description": [ + "Usually \"Abort requested\", but if it happened to fail at the same time it could be different." + ] + } + } + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 305: Peer is not connected.", + "- 311: Unknown channel id.", + "- 312: Channel in an invalid state" + ], + "example_json_request": [ + { + "id": "example:openchannel_abort#1", + "method": "openchannel_abort", + "params": { + "channel_id": "aec3dfd0c7643a23b679cd2e493c053f8fdf621ff2624949f9582c4118b818c6" + } + } + ], + "example_json_response": [ + { + "channel_id": "aec3dfd0c7643a23b679cd2e493c053f8fdf621ff2624949f9582c4118b818c6", + "channel_canceled": true, + "reason": "Abort requested" + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-openchannel_init(7)", + "lightning-openchannel_update(7)", + "lightning-openchannel_signed(7)", + "lightning-openchannel_bump(7)", + "lightning-fundchannel_start(7)", + "lightning-fundchannel_complete(7)", + "lightning-fundchannel(7)", + "lightning-fundpsbt(7)", + "lightning-utxopsbt(7)", + "lightning-multifundchannel(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-openchannel_bump.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "openchannel_bump", + "title": "Command to initiate a channel RBF", + "description": [ + "`openchannel_bump` is a RPC command which initiates a channel RBF (Replace-By-Fee) for the specified channel. It uses the openchannel protocol which allows for interactive transaction construction.", + "", + "Warning: bumping a leased channel will lose the lease." + ], + "request": { + "required": [ + "channel_id", + "amount", + "initialpsbt" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "Id of the channel to RBF." + ] + }, + "amount": { + "type": "sat", + "description": [ + "Satoshi value that we will contribute to the channel. This value will be _added_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel." + ] + }, + "initialpsbt": { + "type": "string", + "description": [ + "The funded, incomplete PSBT that specifies the UTXOs and change output for our channel contribution. It can be updated, see `openchannel_update`; *initialpsbt* must have at least one input. Must have the Non-Witness UTXO (PSBT_IN_NON_WITNESS_UTXO) set for every input. An error (code 309) will be returned if this requirement is not met." + ] + }, + "funding_feerate": { + "type": "feerate", + "description": [ + "Feerate for the funding transaction." + ], + "default": "1/64th greater than the last feerate used for this channel" + } + } + }, + "response": { + "required": [ + "channel_id", + "channel_type", + "psbt", + "commitments_secured", + "funding_serial" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "The channel id of the channel." + ] + }, + "channel_type": { + "type": "object", + "description": [ + "Channel_type as negotiated with peer." + ], + "added": "v24.02", + "additionalProperties": false, + "required": [ + "bits", + "names" + ], + "properties": { + "bits": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + }, + "names": { + "type": "array", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" + ], + "description": [ + "Name of feature bit." + ] + } + } + } + }, + "psbt": { + "type": "string", + "description": [ + "The (incomplete) PSBT of the RBF transaction." + ] + }, + "commitments_secured": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "Whether the *psbt* is complete." + ] + }, + "funding_serial": { + "type": "u64", + "description": [ + "The serial_id of the funding output in the *psbt*." + ] + }, + "requires_confirmed_inputs": { + "type": "boolean", + "description": [ + "Does peer require confirmed inputs in psbt?" + ] + } + }, + "post_return_value_notes": [ + "If the peer does not support `option_dual_fund`, this command will return an error.", + "", + "If the channel is not in a state that is eligible for RBF, this command will return an error." + ] + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 300: The amount exceeded the maximum configured funding amount.", + "- 301: The provided PSBT cannot afford the funding amount.", + "- 305: Peer is not connected.", + "- 309: PSBT missing required fields", + "- 311: Unknown channel id.", + "- 312: Channel in an invalid state" + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-openchannel_init(7)", + "lightning-openchannel_update(7)", + "lightning-openchannel_signed(7)", + "lightning-openchannel_abort(7)", + "lightning-fundchannel_start(7)", + "lightning-fundchannel_complete(7)", + "lightning-fundchannel(7)", + "lightning-fundpsbt(7)", + "lightning-utxopsbt(7)", + "lightning-multifundchannel(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-openchannel_init.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "openchannel_init", + "title": "Command to initiate a channel to a peer", + "description": [ + "`openchannel_init` is a low level RPC command which initiates a channel open with a specified peer. It uses the openchannel protocol which allows for interactive transaction construction." + ], + "request": { + "required": [ + "id", + "amount", + "initialpsbt" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "Node id of the remote peer." + ] + }, + "amount": { + "type": "sat", + "description": [ + "Satoshi value that we will contribute to the channel. This value will be _added_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel." + ] + }, + "initialpsbt": { + "type": "string", + "description": [ + "Funded, incomplete PSBT that specifies the UTXOs and change output for our channel contribution. It can be updated, see `openchannel_update`; *initialpsbt* must have at least one input. Must have the Non-Witness UTXO (PSBT_IN_NON_WITNESS_UTXO) set for every input. An error (code 309) will be returned if this requirement is not met." + ] + }, + "commitment_feerate": { + "type": "feerate", + "description": [ + "Feerate for commitment transactions for non-anchor channels: see **fundchannel**. For anchor channels, it is ignored." + ] + }, + "funding_feerate": { + "type": "feerate", + "description": [ + "Feerate for the funding transaction." + ], + "default": "'opening' feerate" + }, + "announce": { + "type": "boolean", + "description": [ + "Whether or not to announce this channel." + ] + }, + "close_to": { + "type": "string", + "description": [ + "Bitcoin address to which the channel funds should be sent on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`." + ] + }, + "request_amt": { + "type": "msat", + "description": [ + "An amount of liquidity you'd like to lease from the peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*." + ] + }, + "compact_lease": { + "type": "hex", + "description": [ + "A compact representation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel." + ] + }, + "channel_type": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + } + } + }, + "response": { + "required": [ + "channel_id", + "psbt", + "channel_type", + "commitments_secured", + "funding_serial" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "The channel id of the channel." + ] + }, + "psbt": { + "type": "string", + "description": [ + "The (incomplete) PSBT of the funding transaction." + ] + }, + "channel_type": { + "type": "object", + "description": [ + "Channel_type as negotiated with peer." + ], + "added": "v24.02", + "additionalProperties": false, + "required": [ + "bits", + "names" + ], + "properties": { + "bits": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + }, + "names": { + "type": "array", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" + ], + "description": [ + "Name of feature bit." + ] + } + } + } + }, + "commitments_secured": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "Whether the *psbt* is complete." + ] + }, + "funding_serial": { + "type": "u64", + "description": [ + "The serial_id of the funding output in the *psbt*." + ] + }, + "requires_confirmed_inputs": { + "type": "boolean", + "description": [ + "Does peer require confirmed inputs in psbt?" + ] + } + }, + "post_return_value_notes": [ + "If the peer does not support `option_dual_fund`, this command will return an error.", + "", + "If you sent a *request_amt* and the peer supports `option_will_fund` and is interested in leasing you liquidity in this channel, returns their updated channel fee max (*channel_fee_proportional_basis*, *channel_fee_base_msat*), updated rate card for the lease fee (*lease_fee_proportional_basis*, *lease_fee_base_sat*) and their on-chain weight *weight_charge*, which will be added to the lease fee at a rate of *funding_feerate* * *weight_charge* / 1000." + ] + }, + "example_json_request": [ + { + "id": "example:openchannel_init#1", + "method": "openchannel_init", + "params": { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount": 999000, + "initialpsbt": "cHNidP8BADMCAAAAAYbThUhSzYr7ph6Z434bdcW7eoirYOFMmUt2GXZ79sF/AQAAAAD9////AGYAAAAAAQDeAgAAAAABARVD4QKlmwy8SNcNypf1o9TzbIFZjj4dqVzHAL0SLDoTAAAAAAD9////AjOv9ikBAAAAFgAUXJGglH7At5HOVY4ZHp0+19kv655AQg8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgVIxRXqIykOOxm/6YPaFFx2Qh1618qlXPUhDiliVQ2KUCIHQcHniUTcm1XT8SyRE8ev52jm0uiIYum15XcR/tPh+NASEC3Pby7xL4+Ig/Z8TchQ0QT1upLGet3da8qjSjgHO9LOJlAAAAAQEfQEIPAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=", + "commitment_feerate": null, + "funding_feerate": null, + "announce": true, + "close_to": null, + "request_amt": null, + "channel_type": [ + 12, + 22 + ] + } + }, + { + "id": "example:openchannel_init#2", + "method": "openchannel_init", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount": 16777216, + "initialpsbt": "cHNidP8BADMCAAAAAQVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAAAAAAD9////AGYAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=", + "commitment_feerate": null, + "funding_feerate": null, + "announce": true, + "close_to": null, + "request_amt": null, + "channel_type": null + } + } + ], + "example_json_response": [ + { + "channel_id": "53fa2b1ca0d8f21abeaaac0495ab9925cdfaf2ca8b04dbe4aeb061823e1ff2c8", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABARVD4QKlmwy8SNcNypf1o9TzbIFZjj4dqVzHAL0SLDoTAAAAAAD9////AjOv9ikBAAAAFgAUXJGglH7At5HOVY4ZHp0+19kv655AQg8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgVIxRXqIykOOxm/6YPaFFx2Qh1618qlXPUhDiliVQ2KUCIHQcHniUTcm1XT8SyRE8ev52jm0uiIYum15XcR/tPh+NASEC3Pby7xL4+Ig/Z8TchQ0QT1upLGet3da8qjSjgHO9LOJlAAAAAQEfQEIPAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIIbThUhSzYr7ph6Z434bdcW7eoirYOFMmUt2GXZ79sF/AQ8EAQAAAAEQBP3///8M/AlsaWdodG5pbmcBCMCDK/6LyRi8AAEDCFg+DwAAAAAAAQQiACDYM+8ZRsbTj0OCG/yzqLt2buFQn9LuMPDZqFFcgmCmfAz8CWxpZ2h0bmluZwEIchtFHfZ5FBgA", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "commitments_secured": false, + "funding_serial": 8222241539686471000, + "requires_confirmed_inputs": false + }, + { + "channel_id": "252d1b0a1e57895e84137f28cf19ab2c35847e284c112fefdecc7afeaa5c1de7", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCLR8RjOq9lmcAAEDCAAAAAEAAAAAAQQiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQz8CWxpZ2h0bmluZwEIZZtc7LD4y9YA", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "commitments_secured": false, + "funding_serial": 7321547790872006000, + "requires_confirmed_inputs": false + } + ], + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 300: The amount exceeded the maximum configured funding amount.", + "- 301: The provided PSBT cannot afford the funding amount.", + "- 304: Still syncing with bitcoin network", + "- 305: Peer is not connected.", + "- 306: Unknown peer id.", + "- 309: PSBT missing required fields", + "- 310: v2 channel open protocol not supported by peer", + "- 312: Channel in an invalid state" + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-openchannel_update(7)", + "lightning-openchannel_signed(7)", + "lightning-openchannel_abort(7)", + "lightning-openchannel_bump(7)", + "lightning-fundchannel_start(7)", + "lightning-fundchannel_complete(7)", + "lightning-fundchannel(7)", + "lightning-fundpsbt(7)", + "lightning-utxopsbt(7)", + "lightning-multifundchannel(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-openchannel_signed.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "openchannel_signed", + "title": "Command to conclude a channel open", + "description": [ + "`openchannel_signed` is a low level RPC command which concludes a channel open with the specified peer. It uses the v2 openchannel protocol, which allows for interactive transaction construction.", + "", + "This command should be called after `openchannel_update` returns *commitments_secured* `true`.", + "", + "This command will broadcast the finalized funding transaction, if we receive valid signatures from the peer." + ], + "request": { + "required": [ + "channel_id", + "signed_psbt" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "Id of the channel." + ] + }, + "signed_psbt": { + "type": "string", + "description": [ + "The PSBT returned from `openchannel_update` (where *commitments_secured* was true) with partial signatures or finalized witness stacks included for every input that we contributed to the PSBT." + ] + } + } + }, + "response": { + "required": [ + "channel_id", + "tx", + "txid" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "The channel id of the channel." + ] + }, + "tx": { + "type": "hex", + "description": [ + "The funding transaction." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The txid of the **tx**." + ] + } + } + }, + "errors": [ + "On error, the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 303: Funding transaction broadcast failed.", + "- 305: Peer is not connected.", + "- 309: PSBT missing required fields.", + "- 311: Unknown channel id.", + "- 312: Channel in an invalid state" + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-openchannel_init(7)", + "lightning-openchannel_update(7)", + "lightning-openchannel_abort(7)", + "lightning-openchannel_bump(7)", + "lightning-fundchannel_start(7)", + "lightning-fundchannel_complete(7)", + "lightning-fundchannel(7)", + "lightning-fundpsbt(7)", + "lightning-utxopsbt(7)", + "lightning-multifundchannel(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-openchannel_update.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "openchannel_update", + "title": "Command to update a collab channel open", + "description": [ + "`openchannel_update` is a low level RPC command which continues an open channel, as specified by *channel_id*. An updated *psbt* is passed in; any changes from the PSBT last returned (either from `openchannel_init` or a previous call to `openchannel_update`) will be communicated to the peer.", + "", + "Must be called after `openchannel_init` and before `openchannel_signed`.", + "", + "Must be called until *commitments_secured* is returned as true, at which point `openchannel_signed` should be called with a signed version of the PSBT returned by the last call to `openchannel_update`." + ], + "request": { + "required": [ + "channel_id", + "psbt" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "Id of the channel." + ] + }, + "psbt": { + "type": "string", + "description": [ + "Updated PSBT to be sent to the peer. May be identical to the PSBT last returned by either `openchannel_init` or `openchannel_update`." + ] + } + } + }, + "response": { + "required": [ + "channel_id", + "psbt", + "commitments_secured", + "channel_type", + "funding_outnum" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "The channel id of the channel." + ] + }, + "channel_type": { + "type": "object", + "description": [ + "Channel_type as negotiated with peer." + ], + "added": "v24.02", + "additionalProperties": false, + "required": [ + "bits", + "names" + ], + "properties": { + "bits": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + }, + "names": { + "type": "array", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" + ], + "description": [ + "Name of feature bit." + ] + } + } + } + }, + "psbt": { + "type": "string", + "description": [ + "The PSBT of the funding transaction." + ] + }, + "commitments_secured": { + "type": "boolean", + "description": [ + "Whether the *psbt* is complete (if true, sign *psbt* and call `openchannel_signed` to complete the channel open)." + ] + }, + "funding_outnum": { + "type": "u32", + "description": [ + "The index of the funding output in the psbt." + ] + }, + "close_to": { + "type": "hex", + "description": [ + "Scriptpubkey which we have to close to if we mutual close." + ] + }, + "requires_confirmed_inputs": { + "type": "boolean", + "description": [ + "Does peer require confirmed inputs in psbt?" + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "commitments_secured": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "additionalProperties": true, + "required": [ + "channel_id", + "funding_outnum" + ], + "properties": { + "commitments_secured": {}, + "channel_id": { + "type": "hash", + "description": [ + "The derived channel id." + ] + }, + "close_to": { + "type": "hex", + "description": [ + "If a `close_to` address was provided to `openchannel_init` and the peer supports `option_upfront_shutdownscript`." + ] + }, + "funding_outnum": { + "type": "u32", + "description": [ + "The index of the funding output for this channel in the funding transaction." + ] + } + } + }, + "else": { + "additionalProperties": false, + "properties": { + "commitments_secured": {} + } + } + } + ] + }, + "errors": [ + "On error, the returned object will contain `code` and `message` properties,", + "with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 305: Peer is not connected.", + "- 309: PSBT missing required fields", + "- 311: Unknown channel id.", + "- 312: Channel in an invalid state" + ], + "example_json_request": [ + { + "id": "example:openchannel_update#1", + "method": "openchannel_update", + "params": { + "channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA" + } + }, + { + "id": "example:openchannel_update#2", + "method": "openchannel_update", + "params": { + "channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA" + } + } + ], + "example_json_response": [ + { + "channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "commitments_secured": true, + "funding_outnum": 0 + }, + { + "channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "commitments_secured": true, + "funding_outnum": 0, + "close_to": "5120eed745804da9784cc203f563efa99ffa54fdf01b137bc964e63c3124070ffbe6" + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-openchannel_init(7)", + "lightning-openchannel_signed(7)", + "lightning-openchannel_bump(7)", + "lightning-openchannel_abort(7)", + "lightning-fundchannel_start(7)", + "lightning-fundchannel_complete(7)", + "lightning-fundchannel(7)", + "lightning-fundpsbt(7)", + "lightning-utxopsbt(7)", + "lightning-multifundchannel(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-parsefeerate.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "parsefeerate", + "title": "Command for parsing a feerate string to a feerate", + "description": [ + "The **parsefeerate** command returns the current feerate for any valid *feerate_str*. This is useful for finding the current feerate that a **fundpsbt** or **utxopsbt** command might use." + ], + "request": { + "required": [ + "feerate_str" + ], + "properties": { + "feerate_str": { + "type": "string", + "description": [ + "The feerate string to parse." + ] + } + } + }, + "response": { + "required": [], + "properties": { + "perkw": { + "type": "u32", + "description": [ + "Value of *feerate_str* in kilosipa." + ], + "additionalProperties": false + } + } + }, + "example_json_request": [ + { + "id": "example:parsefeerate#1", + "method": "parsefeerate", + "params": [ + "unilateral_close" + ] + }, + { + "id": "example:parsefeerate#2", + "method": "parsefeerate", + "params": [ + "9999perkw" + ] + }, + { + "id": "example:parsefeerate#3", + "method": "parsefeerate", + "params": [ + 10000 + ] + }, + { + "id": "example:parsefeerate#4", + "method": "parsefeerate", + "params": [ + "urgent" + ] + } + ], + "example_json_response": [ + { + "perkw": 11000 + }, + { + "perkw": 9999 + }, + { + "perkw": 2500 + }, + { + "perkw": 11000 + } + ], + "errors": [ + "The **parsefeerate** command will error if the *feerate_str* format is not recognized.", + "", + "- -32602: If the given parameters are wrong." + ], + "trivia": [ + "In CLN we like to call the weight unit \"sipa\" in honor of Pieter Wuille, who uses the name \"sipa\" on IRC and elsewhere. Internally we call the *perkw* style as \"feerate per kilosipa\"." + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-pay.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "pay", + "title": "Command for sending a payment to a BOLT11 invoice", + "description": [ + "The **pay** RPC command attempts to find a route to the given destination, and send the funds it asks for. .", + "", + "The response will occur when the payment fails or succeeds. Once a payment has succeeded, calls to **pay** with the same *bolt11* will succeed immediately.", + "", + "When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name." + ], + "request": { + "required": [ + "bolt11" + ], + "properties": { + "bolt11": { + "type": "string", + "description": [ + "Bolt11 invoice, if **experimental-offers** is enabled, it can actually be a bolt12 invoice, such as one received from lightningd-fetchinvoice(7). If it does not contain an amount, *amount_msat* is required, otherwise if it is specified it must be *null*." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "*amount_msat* is in millisatoshi precision; it can be a whole number, or a whole number with suffix *msat* or *sat*, or a three decimal point number with suffix *sat*, or an 1 to 11 decimal point number suffixed by *btc*." + ] + }, + "label": { + "type": "string", + "description": [ + "It is used to attach a label to payments, and is returned in lightning- listpays(7) and lightning-listsendpays(7)." + ] + }, + "riskfactor": { + "type": "number", + "description": [ + "The *riskfactor* is described in detail in lightning-getroute(7)." + ], + "default": "10" + }, + "maxfeepercent": { + "type": "number", + "description": [ + "Percentage of the amount that is to be paid." + ], + "default": "0.5" + }, + "retry_for": { + "type": "u16", + "description": [ + "Until *retry_for* seconds passes, the command will keep finding routes and retrying the payment." + ], + "default": "60 seconds" + }, + "maxdelay": { + "type": "u16", + "description": [ + "A payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case." + ] + }, + "exemptfee": { + "type": "msat", + "description": [ + "This option can be used for tiny payments which would be dominated by the fee leveraged by forwarding nodes. Setting `exemptfee` allows the `maxfeepercent` check to be skipped on fees that are smaller than `exemptfee`." + ], + "default": "5000 millisatoshi" + }, + "localinvreqid": { + "type": "hex", + "description": [ + "`localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7). This ensures that we only make a single payment for an offer, and that the offer is marked `used` once paid." + ] + }, + "exclude": { + "type": "array", + "description": [ + "*exclude* is a JSON array of short-channel-id/direction (e.g. [ '564334x877x1/0', '564195x1292x0/1' ]) or pubkey which should be excluded from consideration for routing." + ], + "default": "not to exclude any channels or nodes", + "items": { + "oneOf": [ + { + "type": "short_channel_id_dir" + }, + { + "type": "pubkey" + } + ] + } + }, + "maxfee": { + "type": "msat", + "description": [ + "*maxfee* overrides both *maxfeepercent* and *exemptfee* defaults (and if you specify *maxfee* you cannot specify either of those), and creates an absolute limit on what fee we will pay. This allows you to implement your own heuristics rather than the primitive ones used here." + ] + }, + "description": { + "type": "string", + "description": [ + "It is only required for bolt11 invoices which do not contain a description themselves, but contain a description hash: in this case *description* is required. *description* is then checked against the hash inside the invoice before it will be paid." + ] + } + } + }, + "response": { + "required": [ + "payment_preimage", + "payment_hash", + "created_at", + "parts", + "amount_msat", + "amount_sent_msat", + "status" + ], + "properties": { + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash**." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "created_at": { + "type": "number", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "parts": { + "type": "u32", + "description": [ + "How many attempts this took." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount the recipient received." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "Total amount we sent (including fees)." + ] + }, + "warning_partial_completion": { + "type": "string", + "description": [ + "Not all parts of a multi-part payment have completed." + ] + }, + "status": { + "type": "string", + "enum": [ + "complete", + "pending", + "failed" + ], + "description": [ + "Status of payment." + ] + } + }, + "post_return_value_notes": [ + "You can monitor the progress and retries of a payment using the lightning-paystatus(7) command." + ] + }, + "randomization": [ + "To protect user privacy, the payment algorithm performs some randomization.", + "", + "1: Route Randomization", + "", + "Route randomization means the payment algorithm does not always use the lowest-fee or shortest route. This prevents some highly-connected node from learning all of the user payments by reducing their fees below the network average.", + "", + "2: Shadow Route", + "", + "Shadow route means the payment algorithm will virtually extend the route by adding delays and fees along it, making it appear to intermediate nodes that the route is longer than it actually is. This prevents intermediate nodes from reliably guessing their distance from the payee.", + "", + "Route randomization will never exceed *maxfeepercent* of the payment. Route randomization and shadow routing will not take routes that would exceed *maxdelay*." + ], + "errors": [ + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error.", + "- 201: Already paid with this *hash* using different amount or destination.", + "- 203: Permanent failure at destination. The *data* field of the error will be routing failure object (except for self-payment, which currently returns the error directly from lightning-sendpay(7)).", + "- 205: Unable to find a route.", + "- 206: Route too expensive. Either the fee or the needed total locktime for the route exceeds your *maxfeepercent* or *maxdelay* settings, respectively. The *data* field of the error will indicate the actual *fee* as well as the *feepercent* percentage that the fee has of the destination payment amount. It will also indicate the actual *delay* along the route.", + "- 207: Invoice expired. Payment took too long before expiration, or already expired at the time you initiated payment. The *data* field of the error indicates *now* (the current time) and *expiry* (the invoice expiration) as UNIX epoch time in seconds.", + "- 210: Payment timed out without a payment in progress.", + "", + "Error codes 202 and 204 will only get reported at **sendpay**; in **pay** we will keep retrying if we would have gotten those errors.", + "", + "A routing failure object has the fields below:", + "", + "*erring_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on.", + "*erring_node*: The hex string of the pubkey id of the node that reported the error.", + "*erring_channel*: The short channel ID of the channel that has the error, or *0:0:0* if the destination node raised the error.", + "*failcode*: The failure code, as per BOLT #4.", + "*channel_update*: The hex string of the *channel_update* message received from the remote node. Only present if error is from the remote node and the *failcode* has the UPDATE bit set, as per BOLT #4.", + "", + "The *data* field of errors will include statistics *getroute_tries* and *sendpay_tries*. It will also contain a *failures* field with detailed data about routing errors." + ], + "example_json_request": [ + { + "id": "example:pay#1", + "method": "pay", + "params": { + "bolt11": "lni1qqgxr7gha7gusyg83lsr8qcqg4axgq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqtypg3hgetnwsszycn0d36rzv3zypjx2umrwf5hqarfdahzcg8sn7jmpuyl423pvggzvmj9nrga83q474e2sjygxzmq7ln5fmvjxh4skxafx2pmx9wqx5v9qgqxyfhyvyg6pdvu4tcjvpp7kkal9rp57wj7xv4pl3ajku70rzy3pavzzqjz06c8s2vvmrpjlkcse0txx0gmc6jalqqxmeyjm75qcnfnqxwyt2sfsqnxu3vc68fug904w25y3zpskc8huazwmy34av93h2fjswe3tsp4rqpe8qlx9xssexfc0aguke3q6u0jgw2qmn008mzu04mkmqmjmhes3gcpqdqdnzl270s48vsp635rd4jm04snvgkcp65qlkgp8qztu2mdp7c5uqpj2rll3pzu56st537rct3v62gfqeamzthjuwkr0pkvsdnnffpn4sq9sz0lryaufktx0nfxlffum3yesqev5gwqqqqqqqqqqqqqqqzsqqqqqqqqqqqqr5jt9hav2gqqqqqq5szxtvwkyz5zq2000hlwvadejz366lqjt9sd2j4rf5tfd9rgmmyegt4dqd34cf6v4gqkfvppqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq633uzqn3n74ccym4wcvq20vsx7lmk450kprpvlrh4cukk8xy9ptjcef4rnhytnkyn4vnxxtd57yeaksze2s30y26cs6u3rjd9322eg9puk24q", + "amount_msat": null, + "label": null, + "riskfactor": null, + "maxfeepercent": null, + "retry_for": null, + "maxdelay": null, + "exemptfee": null, + "localinvreqid": null, + "exclude": null, + "maxfee": null, + "description": null + } + } + ], + "example_json_response": [ + { + "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "payment_hash": "29ef7dfee675b990a3ad7c125960d54aa34d16969468dec9942ead03635c274c", + "created_at": 1706153504.76628, + "parts": 1, + "amount_msat": 100, + "amount_sent_msat": 100, + "payment_preimage": "6634c1b549c6615d234832f377e06d5a5ab088c40cebdc5cfb8c1262030abcad", + "status": "complete" + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listpays(7)", + "lightning-decodepay(7)", + "lightning-listinvoice(7)", + "lightning-delinvoice(7)", + "lightning-getroute(7)", + "lightning-invoice(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-ping.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "ping", + "title": "Command to check if a node is up.", + "description": [ + "The **ping** command checks if the node with *id* is ready to talk. It currently only works for peers we have a channel with." + ], + "request": { + "required": [ + "id" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The pubkey of the node to ping." + ] + }, + "len": { + "type": "u16", + "description": [ + "The length of the ping." + ], + "default": "128" + }, + "pongbytes": { + "type": "u16", + "description": [ + "The length of the reply. A value of 65532 to 65535 means `don't reply`." + ], + "default": "128" + } + } + }, + "response": { + "required": [ + "totlen" + ], + "properties": { + "totlen": { + "type": "u16", + "description": [ + "The answer length of the reply message (including header: 0 means no reply expected)." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:ping#1", + "method": "ping", + "params": { + "len": 128, + "pongbytes": 128 + } + }, + { + "id": "example:ping#2", + "method": "ping", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "len": 1000, + "pongbytes": 65535 + } + } + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters or we're already waiting for a ping response from peer." + ], + "example_json_response": [ + { + "totlen": 132 + }, + { + "totlen": 0 + } + ], + "author": [ + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." + ], + "see_also": [ + "lightning-connect(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-plugin.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": true, + "rpc": "plugin", + "title": "Manage plugins with RPC", + "description": [ + "The **plugin** RPC command can be used to control dynamic plugins, i.e. plugins that declared themself 'dynamic' (in getmanifest)." + ], + "request": { + "required": [ + "subcommand" + ], + "oneOfMany": [ + [ + "plugin", + "directory" + ] + ], + "properties": { + "subcommand": { + "type": "string", + "enum": [ + "start", + "stop", + "rescan", + "startdir", + "list" + ], + "description": [ + "Determines what action is taken:", + " - *subcommand* **start** takes a *path* to an executable as argument and starts it as plugin. *path* may be an absolute path or a path relative to the plugins directory (default *~/.lightning/plugins*). If the plugin is already running and the executable (checksum) has changed, the plugin is killed and restarted except if its an important (or builtin) plugin. If the plugin doesn't complete the 'getmanifest' and 'init' handshakes within 60 seconds, the command will timeout and kill the plugin. Additional *options* may be passed to the plugin, but requires all parameters to be passed as keyword=value pairs using the `-k|--keyword` option which is recommended. For example the following command starts the plugin helloworld.py (present in the plugin directory) with the option greeting set to 'A crazy':", + " ```shell.", + " lightning-cli -k plugin subcommand=start plugin=helloworld.py greeting='A crazy'.", + " ```.", + " - *subcommand* **stop** takes a plugin executable *path* or *name* as argument and stops the plugin. If the plugin subscribed to 'shutdown', it may take up to 30 seconds before this command returns. If the plugin is important and dynamic, this will shutdown `lightningd`.", + " - *subcommand* **startdir** starts all executables it can find in *directory* (excl. subdirectories) as plugins. Checksum and timeout behavior as in **start** applies.", + " - *subcommand* **rescan** starts all plugins in the default plugins directory (default *~/.lightning/plugins*) that are not already running. Checksum and timeout behavior as in **start** applies.", + " - *subcommand* **list** lists all running plugins (incl. non-dynamic)." + ] + }, + "plugin": { + "type": "string", + "description": [ + "*path* or *name* of a plugin executable to start or stop." + ] + }, + "directory": { + "type": "string", + "description": [ + "*path* of a directory containing plugins." + ] + }, + "options": { + "type": "array", + "items": { + "type": "string", + "description": [ + "*keyword=value* options passed to plugin, can be repeated." + ] + } + } + } + }, + "response": { + "required": [ + "command" + ], + "properties": { + "command": { + "type": "string", + "enum": [ + "start", + "stop", + "rescan", + "startdir", + "list" + ], + "description": [ + "The subcommand this is responding to." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "command": { + "type": "string", + "enum": [ + "start", + "startdir", + "rescan", + "list" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "command", + "plugins" + ], + "properties": { + "command": {}, + "plugins": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "name", + "active", + "dynamic" + ], + "properties": { + "name": { + "type": "string", + "description": [ + "Full pathname of the plugin." + ] + }, + "active": { + "type": "boolean", + "description": [ + "Status; plugin completed init and is operational, plugins are configured asynchronously." + ] + }, + "dynamic": { + "type": "boolean", + "description": [ + "Plugin can be stopped or started without restarting lightningd." + ] + } + } + } + } + } + } + }, + { + "if": { + "properties": { + "command": { + "type": "string", + "enum": [ + "stop" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "command", + "result" + ], + "properties": { + "command": {}, + "result": { + "type": "string", + "description": [ + "A message saying it successfully stopped." + ] + } + } + } + } + ] + }, + "errors": [ + "On error, the reason why the action could not be taken upon the plugin is returned." + ], + "example_json_request": [ + { + "id": "example:plugin#1", + "method": "plugin", + "params": [ + "list" + ] + }, + { + "id": "example:plugin#2", + "method": "plugin", + "params": { + "subcommand": "stop", + "plugin": "fail_htlcs.py" + } + } + ], + "example_json_response": [ + { + "command": "list", + "plugins": [ + { + "name": "~/lightning/plugins/autoclean", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/chanbackup", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/bcli", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/commando", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/funder", + "active": true, + "dynamic": true + }, + { + "name": "~/lightning/plugins/topology", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/keysend", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/offers", + "active": true, + "dynamic": true + }, + { + "name": "~/lightning/plugins/pay", + "active": true, + "dynamic": true + }, + { + "name": "~/lightning/plugins/txprepare", + "active": true, + "dynamic": true + }, + { + "name": "~/lightning/plugins/cln-renepay", + "active": true, + "dynamic": true + }, + { + "name": "~/lightning/plugins/spenderp", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/sql", + "active": true, + "dynamic": true + }, + { + "name": "~/lightning/plugins/bookkeeper", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/target/debug/examples/cln-plugin-startup", + "active": true, + "dynamic": false + } + ] + }, + { + "command": "stop", + "result": "Successfully stopped fail_htlcs.py." + } + ], + "author": [ + "Antoine Poinsot <> is mainly responsible." + ], + "see_also": [ + "lightning-cli(1)", + "lightning-listconfigs(1)", + "[writing plugins][writing plugins]" + ], + "resources": [ + "Main web site: ", + "", + "[writing plugins]: PLUGINS.md" + ] + }, + "lightning-preapproveinvoice.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.02", + "rpc": "preapproveinvoice", + "title": "Ask the HSM to preapprove an invoice (low-level)", + "description": [ + "The **preapproveinvoice** RPC command submits the *bolt11* invoice to the HSM to check that it is approved for payment.", + "", + "Generally the **preapproveinvoice** request does not need to be made explicitly, it is automatically generated as part of a **pay** request.", + "", + "By default, the HSM will approve all **preapproveinvoice** requests.", + "", + "If a remote signer is being used it might decline an **preapproveinvoice** request because it would exceed velocity controls, is not covered by allowlist controls, was declined manually, or other reasons.", + "", + "If a remote signer declines a **preapproveinvoice** request a subsequent attempt to pay the invoice anyway will fail; the signer will refuse to sign the commitment." + ], + "request": { + "required": [ + "bolt11" + ], + "properties": { + "bolt11": { + "type": "string", + "description": [ + "Bolt11 invoice to submit to the HSM to check." + ], + "added": "v23.02" + } + } + }, + "response": { + "properties": {} + }, + "author": [ + "Ken Sedgwick <> is mainly responsible." + ], + "see_also": [ + "lightning-pay(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-preapprovekeysend.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.02", + "rpc": "preapprovekeysend", + "title": "Ask the HSM to preapprove a keysend payment (low-level)", + "description": [ + "The **preapprovekeysend** RPC command submits the *destination*, *payment_hash*, and *amount_msat* parameters to the HSM to check that they are approved as a keysend payment.", + "", + "Generally the **preapprovekeysend** request does not need to be made explicitly, it is automatically generated as part of a **keysend** request.", + "", + "By default, the HSM will approve all **preapprovekeysend** requests.", + "", + "If a remote signer is being used it might decline an **preapprovekeysend** request because it would exceed velocity controls, is not covered by allowlist controls, was declined manually, or other reasons.", + "", + "If a remote signer declines a **preapprovekeysend** request a subsequent attempt to pay the keysend anyway will fail; the signer will refuse to sign the commitment." + ], + "request": { + "required": [ + "destination", + "payment_hash", + "amount_msat" + ], + "properties": { + "destination": { + "type": "pubkey", + "description": [ + "It is a 33 byte, hex-encoded, node ID of the node that the payment should go to." + ], + "added": "v23.02" + }, + "payment_hash": { + "type": "hex", + "added": "v23.02", + "description": [ + "It is the unique identifier of a payment." + ], + "maxLength": 64, + "minLength": 64 + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount to send in millisatoshi precision; it can be a whole number, or a whole number with suffix `msat` or `sat`, or a three decimal point number with suffix `sat`, or an 1 to 11 decimal point number suffixed by `btc`." + ], + "added": "v23.02" + } + } + }, + "response": { + "properties": {} + }, + "author": [ + "Ken Sedgwick <> is mainly responsible." + ], + "see_also": [ + "lightning-keysend(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-recover.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "recover", + "title": "Reinitialize Your Node for Recovery", + "description": [ + "The **recover** RPC command wipes your node and restarts it with the `--recover` option. This is only permitted if the node is unused: no channels, no bitcoin addresses issued (you can use `check` to see if recovery is possible).", + "", + "*hsmsecret* is either a codex32 secret starting with \"cl1\" as returned by `hsmtool getcodexsecret`, or a raw 64 character hex string.", + "", + "NOTE: this command only currently works with the `sqlite3` database backend." + ], + "request": { + "required": [ + "hsmsecret" + ], + "properties": { + "hsmsecret": { + "type": "string", + "description": [ + "Either a codex32 secret starting with `cl1` as returned by `hsmtool getcodexsecret`, or a raw 64 character hex string." + ] + } + } + }, + "response": { + "required": [ + "result" + ], + "properties": { + "result": { + "type": "string", + "added": "v24.05", + "enum": [ + "Recovery restart in progress" + ] + } + } + }, + "example_json_request": [ + { + "id": "example:recover#1", + "method": "recover", + "params": { + "hsmsecret": "cl10leetsd35kw6r5de5kueedxgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqdeuq7xuh94k9g" + } + }, + { + "id": "example:recover#2", + "method": "recover", + "params": { + "hsmsecret": "6c696768746e696e672d31000000000000000000000000000000000000000000" + } + } + ], + "example_json_response": [ + {}, + { + "result": "Recovery restart in progress" + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-hsmtool(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-recoverchannel.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "recoverchannel", + "title": "Command for recovering channels bundeled in an array in the form of *Static Backup*", + "description": [ + "The **recoverchannel** RPC command tries to force the peer (with whom you already had a channel) to close the channel and sweeps on-chain fund. This method is not spontaneous and depends on the peer, so use it in case of severe data loss.", + "", + "The *scb* parameter is an array containing minimum required info to reconnect and sweep funds. You can get the scb for already stored channels by using the RPC command 'staticbackup'." + ], + "request": { + "required": [ + "scb" + ], + "properties": { + "scb": { + "type": "array", + "description": [ + "SCB of the channels in an array." + ], + "items": { + "type": "hex" + } + } + } + }, + "response": { + "required": [ + "stubs" + ], + "properties": { + "stubs": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Channel IDs of channels successfully inserted." + ] + } + } + } + }, + "example_json_request": [ + { + "id": "example:recoverchannel#1", + "method": "recoverchannel", + "params": [ + [ + "0000000000000001c3a7b9d74a174497122bc52d74d6d69836acadc77e0429c6d8b68b48d5c9139a022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d5904017f0000019f0bc3a7b9d74a174497122bc52d74d6d69836acadc77e0429c6d8b68b48d5c9139a0000000000000000000186a000021000" + ] + ] + } + ], + "example_json_response": [ + { + "stubs": [ + "c3a7b9d74a174497122bc52d74d6d69836acadc77e0429c6d8b68b48d5c9139a" + ] + } + ], + "author": [ + "Aditya <> is mainly responsible." + ], + "see_also": [ + "lightning-getsharedsecret(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-renepay.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "renepay", + "title": "Command for sending a payment to a BOLT11 invoice", + "added": "v23.08", + "description": [ + "**renepay** is a new payment plugin based on Pickhardt-Richter optimization method for Multi-Path-Payments. This implementation has not been thoroughly tested and it should be used with caution.", + "", + "The response will occur when the payment fails or succeeds. Once a payment has succeeded, calls to **renepay** with the same *invstring* will not lead to a new payment attempt, but instead it will succeed immediately.", + "", + "When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name." + ], + "request": { + "required": [ + "invstring" + ], + "properties": { + "invstring": { + "type": "string", + "description": [ + "Bolt11 invoice which the RPC command attempts to pay. Currently, **renepay** supports bolt11 invoices only." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "If the *invstring* does not contain an amount, *amount_msat* is required, otherwise if it is specified it must be *null*. in millisatoshi precision; it can be a whole number, or a whole number with suffix *msat* or *sat*, or a three decimal point number with suffix *sat*, or an 1 to 11 decimal point number suffixed by *btc*." + ] + }, + "maxfee": { + "type": "msat", + "description": [ + "*maxfee* is a hard bound, in the sense that the command will never attempt a payment when the fees exceed that value." + ] + }, + "maxdelay": { + "type": "u32", + "description": [ + "Overrides the value of `max-locktime-blocks` for this payment. It serves to limit the locktime of funds in the payment HTLC measured in blocks." + ] + }, + "retry_for": { + "type": "u32", + "description": [ + "Measured in seconds specifies how much time it is allowed for the command to keep retrying the payment." + ], + "default": "60 seconds" + }, + "description": { + "type": "string", + "description": [ + "Only required for bolt11 invoices which do not contain a description themselves, but contain a description hash: in this case *description* is required. *description* is then checked against the hash inside the invoice before it will be paid." + ] + }, + "label": { + "type": "string", + "description": [ + "Used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7)." + ] + }, + "dev_use_shadow": { + "hidden": true, + "type": "boolean" + } + } + }, + "response": { + "required": [ + "payment_preimage", + "payment_hash", + "created_at", + "parts", + "amount_msat", + "amount_sent_msat", + "status" + ], + "properties": { + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash**." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "created_at": { + "type": "number", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "parts": { + "type": "u32", + "description": [ + "How many attempts this took." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount the recipient received." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "Total amount we sent (including fees)." + ] + }, + "status": { + "type": "string", + "enum": [ + "complete", + "pending", + "failed" + ], + "description": [ + "Status of payment." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment." + ] + } + }, + "post_return_value_notes": [ + "You can monitor the progress and retries of a payment using the lightning-renepaystatus(7) command." + ] + }, + "optimality": [ + "**renepay** is based on the work by Pickhardt-Richter's *Optimally Reliable & Cheap Payment Flows on the Lightning Network*. Which means the payment command will prefer routes that have a higher probability of success while keeping fees low.", + "", + "The algorithm records some partial knowledge of the state of the Network deduced from the responses obtained after evey payment attempt. This knowledge is kept through different payment requests, but decays with time to account for the dynamics of the Network (after 1 hour all previous knowledge will be erased). Knowledge from previous payment attempts increases the reliability for subsequent ones.", + "", + "Higher probabilities of success and lower fees cannot generally by optimized at once. Hence **renepay** combines the two in different amounts seeking solutions that satisfy *maxfee* bound and a target for 90% probability of success. *maxfee* is a hard bound, in the sense that the command will never attempt a payment when the fees exceed that value. While the probability target is not compulsory (but desirable), i.e. if the best route does not satisfy the 90% probability target it will be tried anyways.", + "", + "When *maxfee* and the 90% probability bounds are satified, the algorithm will optimize the fees to its lowest value." + ], + "randomization": [ + "To protect user privacy, the payment algorithm performs *shadow route* randomization. Which means the payment algorithm will virtually extend the route by adding delays and fees along it, making it appear to intermediate nodes that the route is longer than it actually is. This prevents intermediate nodes from reliably guessing their distance from the payee.", + "", + "Route randomization will never exceed *maxfee* of the payment. Route randomization and shadow routing will not take routes that would exceed *maxdelay*." + ], + "errors": [ + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error.", + "- 200: Other payment attempts are in progress.", + "- 203: Permanent failure at destination.", + "- 205: Unable to find a route.", + "- 206: Payment routes are too expensive.", + "- 207: Invoice expired. Payment took too long before expiration, or already expired at the time you initiated payment.", + "- 210: Payment timed out without a payment in progress.", + "- 212: Invoice is invalid." + ], + "example_json_request": [ + { + "id": "example:renepay#1", + "method": "renepay", + "params": { + "invstring": "lnbcrt1230n1pjmxj9jsp5suc4cag0lv3wemllkvms56e6ll0w867cczqfttuu8cpfl089f9kspp56wvxtdh8fxg5r5y3kg3klxceakqaydskwzatga25v95da8nzkmwqdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqkmyhymt0j7hy38vzqxx465s4ys0fg78flnjqfx4clvdq9mrmgglpcnjrrnhtk7maa87pfvjez88hke8w97zvuecwswaf9gzyqlsthegpza67eu" + } + }, + { + "id": "example:renepay#2", + "method": "renepay", + "params": { + "invstring": "lnbcrt1pja0f9asp50kzadmeyy78eymjvhnlk5dznl3g5k5x8agh52ewjtg0jclas4ylspp5crsutd9hg05lxyhzphdcuyng6z3knrsdae83mxwawa842gz3vj3sdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqr5yzhxmup4muyaz6x8u2dy4qyu9t5qzuf5k9xayvj5kg7tve60gjk4jrv2l76exnj2xkuzhtwky23pkkxedzy6p9yrsgyqdwj7dv5gsp4zcw6v", + "amount_msat": 548925 + } + } + ], + "example_json_response": [ + { + "payment_preimage": "0a3fd704b34f47d6e306dbac78141753be83848d3a19725c972abfc367dcc591", + "payment_hash": "d39865b6e7499141d091b2236f9b19ed81d2361670bab475546168de9e62b6dc", + "created_at": 1706248370.6267352, + "parts": 1, + "amount_msat": 123000, + "amount_sent_msat": 123000, + "status": "complete", + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" + }, + { + "payment_preimage": "a635e92d024beebfc58519e6544888aa560ba3bcaba7e74924e4b8432eaa56f5", + "payment_hash": "c0e1c5b4b743e9f312e20ddb8e1268d0a3698e0dee4f1d99dd774f55205164a3", + "created_at": 1708631229.7841823, + "parts": 1, + "amount_msat": 548925, + "amount_sent_msat": 548925, + "status": "complete", + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" + } + ], + "author": [ + "Eduardo Quintana-Miranda <> is mainly responsible." + ], + "see_also": [ + "lightning-renepaystatus(7)", + "lightning-listpays(7)", + "lightning-invoice(7)" + ], + "resources": [ + "Main web site: ", + "", + "Pickhardt R. and Richter S., *Optimally Reliable & Cheap Payment Flows on the Lightning Network* " + ] + }, + "lightning-renepaystatus.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "renepaystatus", + "title": "Command for quering the status of previous renepay attempts", + "added": "v23.08", + "description": [ + "The **renepaystatus** RPC command queries the payment plugin **renepay** for the status of previous payment attempts.", + "", + "This command always succeeds." + ], + "request": { + "required": [], + "properties": { + "invstring": { + "type": "string", + "description": [ + "If specified, the command will return a list of payment attempts whose invoice matches *invstring*, otherwise all payments with be listed." + ] + } + } + }, + "response": { + "required": [ + "paystatus" + ], + "properties": { + "paystatus": { + "type": "array", + "description": [ + "A list of payments attempted by renepay." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "bolt11", + "payment_hash", + "created_at", + "groupid", + "amount_msat", + "status", + "notes" + ], + "properties": { + "bolt11": { + "type": "string", + "description": [ + "Invoice string BOLT11." + ] + }, + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash** (for completed payments only)." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "created_at": { + "type": "number", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "groupid": { + "type": "u32", + "description": [ + "The id for this payment attempt." + ] + }, + "parts": { + "type": "u32", + "description": [ + "How many attempts this took." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount the recipient received." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "Total amount we sent including fees (for completed payments only)." + ] + }, + "status": { + "type": "string", + "enum": [ + "complete", + "pending", + "failed" + ], + "description": [ + "Status of payment." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment." + ] + }, + "notes": { + "type": "array", + "description": [ + "A list of messages for debugging purposes." + ], + "items": { + "type": "string", + "description": [ + "A message generated by renepay." + ] + } + } + } + } + } + } + }, + "author": [ + "Eduardo Quintana-Miranda <> is mainly responsible." + ], + "see_also": [ + "lightning-renepay(7)", + "lightning-listpays(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-reserveinputs.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "reserveinputs", + "title": "Construct a transaction and reserve the UTXOs it spends", + "description": [ + "The **reserveinputs** RPC command places (or increases) reservations on any inputs specified in *psbt* which are known to lightningd. It will fail with an error if any of the inputs are known to be spent, and ignore inputs which are unknown.", + "", + "Normally the command will fail (with no reservations made) if an input is already reserved." + ], + "request": { + "required": [ + "psbt" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "The PSBT to reserve inputs from." + ] + }, + "exclusive": { + "type": "boolean", + "description": [ + "If set to *False*, existing reservations are simply extended, rather than causing failure." + ] + }, + "reserve": { + "type": "u32", + "description": [ + "The number of blocks to reserve. By default, reservations are for the next 72 blocks (approximately 6 hours)." + ] + } + } + }, + "response": { + "required": [ + "reservations" + ], + "properties": { + "reservations": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "txid", + "vout", + "was_reserved", + "reserved", + "reserved_to_block" + ], + "properties": { + "txid": { + "type": "txid", + "description": [ + "The input transaction id." + ] + }, + "vout": { + "type": "u32", + "description": [ + "The input index output number which was reserved." + ] + }, + "was_reserved": { + "type": "boolean", + "description": [ + "Whether the input was already reserved." + ] + }, + "reserved": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Whether the input is now reserved." + ] + }, + "reserved_to_block": { + "type": "u32", + "description": [ + "What blockheight the reservation will expire." + ] + } + } + } + } + } + }, + "errors": [ + "On failure, an error is reported and no UTXOs are reserved.", + "", + "- -32602: Invalid parameter, such as specifying a spent/reserved input in *psbt*." + ], + "example_json_request": [ + { + "id": "example:reserveinputs#1", + "method": "reserveinputs", + "params": { + "psbt": "cHNidP8BAFwCAAAAAkwJVUqB0xXTO7JZ3PnPdGnxoYfQxhU+xqXGFYXsyX0RAAAAAAD9////TAlVSoHTFdM7slnc+c90afGhh9DGFT7GpcYVhezJfREBAAAAAP3///8AAAAAAAAAAA==", + "exclusive": true, + "reserve": null + } + }, + { + "id": "example:reserveinputs#2", + "method": "reserveinputs", + "params": { + "psbt": "cHNidP8BAP32AQIAAAAMgnW099dbh1uD153ih5eU5WhluynLxekXjAOjkEdNBg8BAAAAAP3///9FWKQt8C+1y4741+beFSqWAaj9DuvzHNpxvpxS+GB8lwEAAAAA/f///6E5TAGqktI29Oso6b9kZZoAFFGGvpJQUM8VO+3LMTlmAAAAAAD9////nSDT7hrkuoQtAV1yNnbpkJsB5ifKoM2zP+CcLPfis1gBAAAAAP3///+P1rW90UXfD0gIk58h3sXxxy3ZfJJLP0H1I4Jpzy/87QEAAAAA/f///w0UKZ/s9DnPpV+FJ8h2BEI7tl+qVxSGRFRv9FYw4girAQAAAAD9////EPNsUFrEOZyfjbqbh8rfHQ4C9RQECw12n3c1yhFqkzoAAAAAAP3///8QW9LEsSmuvSnvVzy+FDktM7ewQmZnIJI/TJMahLmSzwEAAAAA/f///+4edbWRHDdRJcMeHHElgSmb+nENPsz/g/0AmAEU6hXeAAAAAAD9////T15YLGmk7HBsrL+awdcxi3db3esp8AcCTS9XGrEnfoAAAAAAAP3///8q7xInvEk7J0Ir9cpKXqU2lArUskkYLrimIE0+Yb6a2QEAAAAA/f///8hBLKyMa2zRJqwNOk7DmsDIfG7IvJtQiJ+QnkkHl6atAAAAAAD9////AAAAAAAAAAAAAAAAAAAAAAAA", + "exclusive": false, + "reserve": null + } + } + ], + "example_json_response": [ + { + "reservations": [ + { + "txid": "117dc9ec8515c6a5c63e15c6d087a1f16974cff9dc59b23bd315d3814a55094c", + "vout": 1, + "was_reserved": false, + "reserved": true, + "reserved_to_block": 175 + } + ] + }, + { + "reservations": [ + { + "txid": "0f064d4790a3038c17e9c5cb29bb6568e5949787e29dd7835b875bd7f7b47582", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "977c60f8529cbe71da1cf3eb0efda801962a15dee6d7f88ecbb52ff02da45845", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "663931cbed3b15cf505092be865114009a6564bfe928ebf436d292aa014c39a1", + "vout": 0, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "58b3e2f72c9ce03fb3cda0ca27e6019b90e97636725d012d84bae41aeed3209d", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "edfc2fcf698223f5413f4b927cd92dc7f1c5de219f9308480fdf45d1bdb5d68f", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "ab08e23056f46f5444861457aa5fb63b420476c827855fa5cf39f4ec9f29140d", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "3a936a11ca35779f760d0b0414f5020e1ddfca879bba8d9f9c39c45a506cf310", + "vout": 0, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "cf92b9841a934c3f9220676642b0b7332d3914be3c57ef29bdae29b1c4d25b10", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "de15ea14019800fd83ffcc3e0d71fa9b298125711c1ec32551371c91b5751eee", + "vout": 0, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "807e27b11a572f4d0207f029ebdd5b778b31d7c19abfac6c70eca4692c585e4f", + "vout": 0, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "d99abe613e4d20a6b82e1849b2d40a9436a55e4acaf52b42273b49bc2712ef2a", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "ada69707499e909f88509bbcc86e7cc8c09ac34e3a0dac26d16c6b8cac2c41c8", + "vout": 0, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + } + ] + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-unreserveinputs(7)", + "lightning-signpsbt(7)", + "lightning-sendpsbt(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-sendcustommsg.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v0.10.1", + "rpc": "sendcustommsg", + "title": "Low-level interface to send protocol messages to peers", + "description": [ + "The `sendcustommsg` RPC method allows the user to inject a custom message into the communication with the peer with the given `node_id`. This is intended as a low-level interface to implement custom protocol extensions on top, not for direct use by end-users.", + "", + "On the receiving end a plugin may implement the `custommsg` plugin hook and get notified about incoming messages, and allow additional unknown even types in their getmanifest response." + ], + "request": { + "required": [ + "node_id", + "msg" + ], + "properties": { + "node_id": { + "type": "pubkey", + "description": [ + "The node specified by `node_id` must be a peer, i.e., it must have a direct connection with the node receiving the RPC call, and the connection must be established. For a method to send arbitrary messages over multiple hops, including hops that do not understand the custom message, see the `createonion` and `sendonion` RPC methods. Messages can only be injected if the connection is handled by `openingd` or `channeld`. Messages cannot be injected when the peer is handled by `onchaind` or `closingd` since these do not have a connection, or are synchronous daemons that do not handle spontaneous messages." + ] + }, + "msg": { + "type": "hex", + "description": [ + "Must be a hex encoded well-formed message, including the 2-byte type prefix, but excluding the length prefix which will be added by the RPC method. The message types may not be one of the internally handled types, since that may cause issues with the internal state tracking of Core Lightning. We do (as of *v23.11*) allow sending of even types, but note that peers (as per the spec) will disconnect on receiving unknown even types." + ] + } + } + }, + "response": { + "required": [ + "status" + ], + "properties": { + "status": { + "type": "string", + "description": [ + "Information about where message was queued." + ] + } + }, + "pre_return_value_notes": [ + "The method will validate the arguments and queue the message for delivery through the daemon that is currently handling the connection. Queuing provides best effort guarantees and the message may not be delivered if the connection is terminated while the message is queued. The RPC method will return as soon as the message is queued.", + "", + "If any of the above limitations is not respected the method returns an explicit error message stating the issue." + ] + }, + "example_json_request": [ + { + "id": "example:sendcustommsg#5", + "method": "sendcustommsg", + "params": { + "node_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "msg": "77770012" + } + } + ], + "example_json_response": [ + { + "status": "Message sent to connectd for delivery" + } + ], + "author": [ + "Christian Decker <> is mainly responsible." + ], + "see_also": [ + "lightning-createonion(7)", + "lightning-sendonion(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-sendinvoice.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "sendinvoice", + "title": "Command for send an invoice for an offer", + "warning": "experimental-offers only", + "description": [ + "The **sendinvoice** RPC command creates and sends an invoice to the issuer of an *invoice_request* for it to pay: lightning-invoicerequest(7).", + "", + "If **fetchinvoice-noconnect** is not specified in the configuation, it will connect to the destination in the (currently common!) case where it cannot find a route which supports `option_onion_messages`." + ], + "request": { + "required": [ + "invreq", + "label" + ], + "properties": { + "invreq": { + "type": "string", + "description": [ + "The bolt12 invoice_request string beginning with `lnr1`." + ] + }, + "label": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "description": [ + "The unique label to use for this invoice." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Required if the *offer* does not specify an amount at all, or specifies it in a different currency. Otherwise you may set it (e.g. to provide a tip)." + ], + "default": "the amount contained in the offer (multiplied by *quantity* if any)" + }, + "timeout": { + "type": "u32", + "description": [ + "Seconds to wait for the offering node to pay the invoice or return an error. This will also be the timeout on the invoice that is sent." + ], + "default": "90 seconds" + }, + "quantity": { + "type": "u64", + "description": [ + "Quantity is is required if the offer specifies quantity_max, otherwise it is not allowed." + ] + } + } + }, + "response": { + "required": [ + "label", + "description", + "payment_hash", + "status", + "created_index", + "expires_at" + ], + "properties": { + "label": { + "type": "string", + "description": [ + "Unique label supplied at invoice creation." + ] + }, + "description": { + "type": "string", + "description": [ + "Description used in the invoice." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "unpaid", + "paid", + "expired" + ], + "description": [ + "Whether it's paid, unpaid or unpayable." + ] + }, + "expires_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when it will become / became unpayable." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount required to pay this invoice." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The BOLT12 string." + ] + }, + "created_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was created in." + ] + }, + "updated_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was changed (only present if it has changed since creation)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "paid" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "pay_index", + "amount_received_msat", + "paid_at", + "payment_preimage" + ], + "properties": { + "label": {}, + "description": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "bolt12": {}, + "expires_at": {}, + "created_index": {}, + "updated_index": {}, + "pay_index": { + "type": "u64", + "description": [ + "Unique incrementing index for this payment." + ] + }, + "amount_received_msat": { + "type": "msat", + "description": [ + "The amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)." + ] + }, + "paid_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when it was paid." + ] + }, + "payment_preimage": { + "type": "secret", + "description": [ + "Proof of payment." + ] + } + } + } + } + ] + }, + "errors": [ + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error.", + "- 1002: Offer has expired.", + "- 1003: Cannot find a route to the node making the offer.", + "- 1004: The node making the offer returned an error message.", + "- 1005: We timed out waiting for the invoice to be paid" + ], + "example_json_request": [ + { + "id": "example:sendinvoice#1", + "method": "sendinvoice", + "params": { + "invreq": "lnr1qqg804wzdsyn8g4mf2yc22k8xvjpjzstwd5k6urvv5s8getnw3gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02gqsykppqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4nuzqw5w7y7xqm2rushk5a5n3mcuvqel954raykd5nqa830nq9hpd4s4fcnxw266vp9d5c8f3m3w40hmm6gm8akxx3rsnr7d4usunv0x3q8q", + "label": "payme for real!" + } + } + ], + "example_json_response": [ + { + "label": "payme for real!", + "bolt12": "lni1qqg804wzdsyn8g4mf2yc22k8xvjpjzstwd5k6urvv5s8getnw3gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02gqsykppqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4ngycqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky96qmcmtl30xtt7jdakfyhzm8f0gny6f4d2ukx5gurem04z8lfd2wza5qs9pz6wp9vu7cm6n4wmmrz77y4w6z5xv4q93yudkdtkl5zmzdzuawzqqex7gd5v0x0r83pqj82udd542fl4krh50s0dkx47d0hd5wh77g52xxl75ccpkt35mc8n282wslju9ufyys2y8qqqqqqqqqqqqqqqpgqqqqqqqqqqqqp6f9jm7k9yqqqqqq2gpr96l99lfspt25zqnyfgu7hznmt2tzkjdt92d2wc3dsq7keph7w8gudjs46spfzqrlu4gqs9vppqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky9muzqpze8kk43g0wh4h8qlac5lswwesrvsaxcza2f5j90c2h3ts8yzmn9g4mxqe89fngrqny8nf52xxuxep6548etda8lp876jr0nnxgdkdq", + "payment_hash": "4c89473d714f6b52c56935655354ec45b007ad90dfce3a38d942ba8052200ffc", + "amount_msat": 2, + "status": "paid", + "pay_index": 1, + "amount_received_msat": 2, + "paid_at": 1708640865, + "payment_preimage": "305951ab02cb2ea5eb884dbfd8fb110b4e088ecb8338b3e84e8f9c70919c19bf", + "description": "simple test", + "expires_at": 1708640953, + "created_index": 2, + "updated_index": 1 + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-fetchinvoice(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-sendonion.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "sendonion", + "title": "Send a payment with a custom onion packet", + "description": [ + "The **sendonion** RPC command can be used to initiate a payment attempt with a custom onion packet. The onion packet is used to deliver instructions for hops along the route on how to behave. Normally these instructions are indications on where to forward a payment and what parameters to use, or contain details of the payment for the final hop. However, it is possible to add arbitrary information for hops in the custom onion, allowing for custom extensions that are not directly supported by Core Lightning.", + "", + "If the first element of *route* does not have \"channel\" set, a suitable channel (if any) will be chosen, otherwise that specific short-channel-id is used. The following is an example of a 3 hop onion:", + "", + "```json", + "[", + " \"298606954e9de3e9d938d18a74fed794c440e8eda82e52dc08600953c8acf9c4\",", + " \"2dc094de72adb03b90894192edf9f67919cb2691b37b1f7d4a2f4f31c108b087\",", + " \"a7b82b240dbd77a4ac8ea07709b1395d8c510c73c17b4b392bb1f0605d989c85\"", + "]", + "```" + ], + "request": { + "required": [ + "onion", + "first_hop", + "payment_hash" + ], + "properties": { + "onion": { + "type": "hex", + "description": [ + "Hex-encoded 1366 bytes long blob that was returned by either of the tools that can generate onions. It contains the payloads destined for each hop and some metadata. Please refer to [BOLT 04][bolt04] for further details. If is specific to the route that is being used and the *payment_hash* used to construct, and therefore cannot be reused for other payments or to attempt a separate route. The custom onion can generally be created using the `devtools/onion` CLI tool, or the **createonion** RPC command." + ] + }, + "first_hop": { + "type": "object", + "description": [ + "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*." + ], + "required": [ + "id", + "amount_msat", + "delay" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "Node id for the peer. Use any available channel available to this peer." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount to add an HTLC for millisatoshis." + ] + }, + "delay": { + "type": "u16", + "description": [ + "The number of blocks delay of blocks on top of the current blockheight." + ] + } + } + }, + "payment_hash": { + "type": "hash", + "description": [ + "Specifies the 32 byte hex-encoded hash to use as a challenge to the HTLC that we are sending. It is specific to the onion and has to match the one the onion was created with." + ] + }, + "label": { + "type": "string", + "description": [ + "Can be used to provide a human readable reference to retrieve the payment at a later time." + ] + }, + "shared_secrets": { + "type": "array", + "description": [ + "A JSON list of 32 byte hex-encoded secrets that were used when creating the onion. Core Lightning can send a payment with a custom onion without the knowledge of these secrets, however it will not be able to parse an eventual error message since that is encrypted with the shared secrets used in the onion. If *shared_secrets* is provided Core Lightning will decrypt the error, act accordingly, e.g., add a `channel_update` included in the error to its network view, and set the details in *listsendpays* correctly. If it is not provided Core Lightning will store the encrypted onion, and expose it in *listsendpays* allowing the caller to decrypt it externally. If it is not provided the Core Lightning node does not know how long the route is, which channels or nodes are involved, and what an eventual error could have been. It can therefore be used for oblivious payments." + ], + "items": { + "type": "secret" + } + }, + "partid": { + "type": "u16", + "description": [ + "If provided and non-zero, allows for multiple parallel partial payments with the same *payment_hash*." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "If provided, it will be returned in *waitsendpay* and *listsendpays* results." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Used to annotate the payment, and is returned by *waitsendpay* and *listsendpays*." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "If provided, it will be returned in **listpays** result." + ] + }, + "localinvreqid": { + "type": "hash", + "description": [ + "`localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7)." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." + ] + }, + "description": { + "added": "v0.11.0", + "type": "string", + "description": [ + "If provided, it will be returned in *waitsendpay* and *listsendpays* results." + ] + } + } + }, + "response": { + "required": [ + "created_index", + "id", + "payment_hash", + "status", + "created_at", + "amount_sent_msat" + ], + "properties": { + "created_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was created in." + ] + }, + "id": { + "type": "u64", + "description": [ + "Old synonym for created_index." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "pending", + "complete" + ], + "description": [ + "Status of the payment (could be complete if already sent previously)." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount delivered to destination (if known)." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment if known." + ] + }, + "created_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "The amount sent." + ] + }, + "label": { + "type": "string", + "description": [ + "The label, if given to sendpay." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string (if supplied)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string (if supplied: **experimental-offers** only)." + ] + }, + "partid": { + "type": "u64", + "description": [ + "The partid (if supplied) to sendonion/sendpay." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "complete" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "payment_preimage" + ], + "properties": { + "created_index": {}, + "id": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "destination": {}, + "created_at": {}, + "groupid": {}, + "msatoshi_sent": {}, + "amount_sent_msat": {}, + "label": {}, + "bolt11": {}, + "bolt12": {}, + "partid": {}, + "updated_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was changed." + ] + }, + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash**." + ] + } + } + } + }, + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "pending" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [], + "properties": { + "created_index": {}, + "id": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "destination": {}, + "created_at": {}, + "groupid": {}, + "msatoshi_sent": {}, + "amount_sent_msat": {}, + "label": {}, + "bolt11": {}, + "bolt12": {}, + "partid": {}, + "message": { + "type": "string", + "description": [ + "Monitor status with listpays or waitsendpay." + ] + } + } + } + } + ] + }, + "errors": [ + "The following error codes may occur:", + "", + "- 202: an parseable onion", + "", + "the error details are decrypted and presented here, if *shared_secrets* was provided and an error was returned by one of the intermediate nodes" + ], + "example_json_request": [ + { + "id": "example:sendonion#1", + "method": "sendonion", + "params": { + "onion": "00034928294556b10308f9aeac7a240223d4d5f72097db1ef36a36b10cab937f2f205ed7218b47d4600eaf7fd390940bf9a6cdac99aafdb4783c468150eeeab9b57e56a06778d023ffb3bb84c7d8c2ad8868b61c28b566634af52c288ed6569583db66f5bd0edfb801c252f078020e1df6359af5969296b4698a71d17c5ca6e5ee4b64b7cce3ad0a1aa31e6be4d5fe3a31fa7a25259c640716020a9a248ca3ebb68eb823f8884b5df3710969f4c2ffb153779a923bab946ed43c1f6658d7f8e7e25303bb78ef4862fb550b8b1c79d522b035eedfda9ab70a61322522acf7233bb8ea2423958448fc8ac3d000835fda04bf661f1bf2ad2d091f506840bb2f10f82c0812149d99267a47824defe90877ed70db526b2200e18dccb92b17516de3778c055645728eadf4c74375aa0aae80a7773a536a908ca1e25c0fdca90e50ce0be05eeb973ec5e83ce3ab6b35818e021780428af81320a694483c1c15f64e685ba1fd3b1e1b926e6b4ec9eeeac8aca60c60e0f0f583e35e7f081dc6f4c64157e100c79c4c25101bed77cd9f93416f9a67d9f1916a782c498c38365af4a5fabb1b745fa840a054a06564c3f4b376aeb72cdd059d3794c82bbbf12a1f62234016a6912b384e7e4cebbd39ee4395aeff43c461e226d1e0151cce508a181a9c61275bf4b89e4556cf24df13b993dec96541555f8b9a699be9488568a11ac7f25849da62765472511ad74a6660c10e37f5fa13d4e4665ef7825ae1f2da4a86d5581912262de89b4b11a722fd127b31aa0d7fab8c679b07bf95e65cb80b2dacb5b90794399fb8f23823f68058431aa1c399b5baceccaf8521d004f45dba6ec1fddc54473343e9e67cd50cc3f2f3d8a5dab8a7ab9ae553dc3cd34e74b858da75975265f7c673a25e8d01a5130ab40eaba712b80c608cd0431b4b45ea0d81af595e21f24976608429127bf586f7507666500bc7245cf9266fa0bd0e58404c496e190c873cd143ace9048e9d5021c23967a24e09f2e54166e54b4ee8888dc1af535624e7ee8b426c1628175017a9e8a73eb1d0d49028a4f4d77897f3c08f1cd7bdee2b00f9bb9eadc49a69bf4f6c0cb2c95a16f03d7958f1b8f83cb40ae87ddf75f26050e2c2ed9f8f8523b3d389a50b217bda651dc21f095fe7d2d3851a0a6cf01051f3f3c6f1ad59ed46d44928d15a0e6e1bd4df4c99bdb82a05b0e781b69a73bc30fe579c8ac9fe8aeb6beb1c0f44def2775b7341af37e6ef58ceb34958b29d3e36112b78644612228761b8badc802f0b2b8fcaeb1db8f3a8db4afa2d7b4540a7c331db6f5141fa3909a513df875ff8a63f5b542d662781ca96a69e3b2925d6a63555b2c5825ffb2ad848d71122f54110e0d203000f3e9cc23b793c3540dfb8d881caedd25055a8f495e9e7a0391dbf9cbd9344f7df659ee8d3ce5ec16217ab83e1394ba991eb8ffd9a869f8ebb2e2428845e779979c57b5f8875f502728229a55ce87b3eba85c75264d30eaf7b373f6b09ba3086d9e98348d87b049468c2c30a6501cb2a3862f1703bbf29895e8b4262353eae720ed8ae678750011e2eb51f4800d3f4725fa873d7deec1c46f77a5f61c73dc938239e77f432bcc245c7b935413c51c0bc92bdaae144452aa95910909e46e500557961203f4e1483b9c09c124464907825e1ff74c87c58d6e2e91970baac9b89a554beca6df9acee16d77dd929d0caa7797e06f2c384c03fdedc89c697b9c34787a50cf399a8d7f195e79b347efc8267c474a477ce210f11049d432b280eaf3fccd451f6218d35c64cbd1006bcc54eeea8b856855c9aa92bc3adc6900a7c7a0eee09834c5a1f2da3d8ea9a478aea90c954952ad2a72d3856350ac3132d17e1e8116fa774066a22c857a827699c98285111a405e74685a3ae579ae78c545774f45491e4935bf4", + "first_hop": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "channel": "103x3x0", + "direction": 1, + "amount_msat": 1002, + "delay": 21, + "style": "tlv" + }, + "payment_hash": "f584c14bb23506acdd94cf3cea377f3cc5805f3cba5430bc3756ef83ede1a0dc", + "label": null, + "shared_secrets": null, + "partid": null, + "bolt11": null, + "amount_msat": null, + "destination": null + } + } + ], + "example_json_response": [ + { + "message": "Monitor status with listpays or waitsendpay", + "created_index": 1, + "id": 1, + "payment_hash": "f584c14bb23506acdd94cf3cea377f3cc5805f3cba5430bc3756ef83ede1a0dc", + "groupid": 1, + "amount_sent_msat": 1002, + "created_at": 1706315098, + "status": "pending" + } + ], + "author": [ + "Christian Decker <> is mainly responsible." + ], + "see_also": [ + "lightning-createonion(7)", + "lightning-sendpay(7)", + "lightning-listsendpays(7)" + ], + "resources": [ + "Main web site: ", + "", + "[bolt04]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md" + ] + }, + "lightning-sendonionmessage.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "sendonionmessage", + "title": "low-level command to send an onion message", + "warning": "experimental-onion-messages only", + "description": [ + "The **sendonionmessage** RPC command can be used to send a message via the lightning network. These are currently used by *offers* to request and receive invoices." + ], + "request": { + "required": [ + "first_id", + "blinding", + "hops" + ], + "properties": { + "first_id": { + "type": "pubkey", + "description": [ + "The (presumably well-known) public key of the start of the path." + ] + }, + "blinding": { + "type": "pubkey", + "description": [ + "Blinding factor for this path." + ] + }, + "hops": { + "type": "array", + "description": [ + "", + "" + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "node", + "tlv" + ], + "properties": { + "node": { + "type": "pubkey", + "description": [ + "Public key of the node." + ] + }, + "tlv": { + "type": "u8", + "description": [ + "Contains a hexadecimal TLV to include." + ] + } + } + } + } + } + }, + "response": { + "required": [], + "properties": {} + }, + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-fetchinvoice(7)", + "lightning-offer(7)" + ], + "resources": [ + "Main web site: ", + "", + "[bolt04]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md" + ] + }, + "lightning-sendpay.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "sendpay", + "title": "Low-level command for sending a payment via a route", + "description": [ + "The **sendpay** RPC command attempts to send funds associated with the given *payment_hash*, along a route to the final destination in the route.", + "", + "Generally, a client would call lightning-getroute(7) to resolve a route, then use **sendpay** to send it. If it fails, it would call lightning-getroute(7) again to retry. If the route is empty, a payment-to-self is attempted.", + "", + "The response will occur when the payment is on its way to the destination. The **sendpay** RPC command does not wait for definite success or definite failure of the payment (except for already-succeeded payments, or to-self payments). Instead, use the **waitsendpay** RPC command to poll or wait for definite success or definite failure.", + "", + "Once a payment has succeeded, calls to **sendpay** with the same *payment_hash* but a different *amount_msat* or destination will fail; this prevents accidental multiple payments. Calls to **sendpay** with the same *payment_hash*, *amount_msat*, and destination as a previous successful payment (even if a different route or *partid*) will return immediately with success." + ], + "request": { + "required": [ + "route", + "payment_hash" + ], + "properties": { + "route": { + "type": "array", + "items": { + "type": "object", + "required": [ + "amount_msat", + "id", + "delay", + "channel" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The node at the end of this hop." + ] + }, + "channel": { + "type": "short_channel_id", + "description": [ + "The channel joining these nodes." + ] + }, + "delay": { + "type": "u32", + "description": [ + "The total CLTV expected by the node at the end of this hop." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount expected by the node at the end of this hop." + ] + } + } + } + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the payment_preimage." + ] + }, + "label": { + "type": "string", + "description": [ + "The label provided when creating the invoice_request." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount must be provided if *partid* is non-zero, or the payment is to-self, otherwise it must be equal to the final amount to the destination. it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*." + ], + "default": "in millisatoshi precision" + }, + "bolt11": { + "type": "string", + "description": [ + "Bolt11 invoice to pay. If provided, will be returned in *waitsendpay* and *listsendpays* results." + ] + }, + "payment_secret": { + "type": "secret", + "description": [ + "Value that the final recipient requires to accept the payment, as defined by the `payment_data` field in BOLT 4 and the `s` field in the BOLT 11 invoice format. It is required if *partid* is non-zero." + ] + }, + "partid": { + "type": "u64", + "description": [ + "Must not be provided for self-payments. If provided and non-zero, allows for multiple parallel partial payments with the same *payment_hash*. The *amount_msat* amount (which must be provided) for each **sendpay** with matching *payment_hash* must be equal, and **sendpay** will fail if there are differing values given." + ] + }, + "localinvreqid": { + "type": "hex", + "description": [ + "Indicates that this payment is being made for a local invoice_request. This ensures that we only send a payment for a single-use invoice_request once." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Allows you to attach a number which appears in **listsendpays** so payments can be identified as part of a logical group. The *pay* plugin uses this to identify one attempt at a MPP payment, for example." + ] + }, + "payment_metadata": { + "added": "v0.11.0", + "type": "hex", + "description": [ + "Placed in the final onion hop TLV." + ] + }, + "description": { + "added": "v0.11.0", + "type": "string", + "description": [ + "Description used in the invoice." + ] + } + } + }, + "response": { + "required": [ + "id", + "created_index", + "payment_hash", + "status", + "created_at", + "amount_sent_msat" + ], + "properties": { + "created_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was created in." + ] + }, + "updated_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was changed (only present if it has changed since creation)." + ] + }, + "id": { + "type": "u64", + "description": [ + "Old synonym for created_index." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "pending", + "complete" + ], + "description": [ + "Status of the payment (could be complete if already sent previously)." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount delivered to destination (if known)." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment if known." + ] + }, + "created_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "completed_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was completed." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "The amount sent." + ] + }, + "label": { + "type": "string", + "description": [ + "The *label*, if given to sendpay." + ] + }, + "partid": { + "type": "u64", + "description": [ + "The *partid*, if given to sendpay." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string (if supplied)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string (if supplied: **experimental-offers** only)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "complete" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "payment_preimage" + ], + "properties": { + "id": {}, + "created_index": {}, + "updated_index": {}, + "groupid": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "destination": {}, + "created_at": {}, + "completed_at": {}, + "msatoshi_sent": {}, + "amount_sent_msat": {}, + "label": {}, + "partid": {}, + "bolt11": {}, + "bolt12": {}, + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash**." + ] + } + } + } + }, + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "pending" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "message" + ], + "properties": { + "id": {}, + "created_index": {}, + "updated_index": {}, + "groupid": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "destination": {}, + "created_at": {}, + "completed_at": {}, + "msatoshi_sent": {}, + "amount_sent_msat": {}, + "label": {}, + "partid": {}, + "bolt11": {}, + "bolt12": {}, + "message": { + "type": "string", + "description": [ + "Monitor status with listpays or waitsendpay." + ] + } + } + } + } + ] + }, + "errors": [ + "On error, if the error occurred from a node other than the final destination, the route table will be updated so that lightning-getroute(7) should return an alternate route (if any). An error from the final destination implies the payment should not be retried.", + "", + "- -1: Catchall nonspecific error.", + "- 201: Already paid with this *hash* using different amount or destination.", + "- 202: Unparseable onion reply. The *data* field of the error will have an *onionreply* field, a hex string representation of the raw onion reply.", + "- 203: Permanent failure at destination. The *data* field of the error will be routing failure object.", + "- 204: Failure along route; retry a different route. The *data* field of the error will be routing failure object.", + "- 212: *localinvreqid* refers to an invalid, or used, local invoice_request.", + "", + "A routing failure object has the fields below:", + "", + "*erring_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on.", + "*erring_node*: The hex string of the pubkey id of the node that reported the error.", + "*erring_channel*: The short channel ID of the channel that has the error, or *0:0:0* if the destination node raised the error. In addition *erring_direction* will indicate which direction of the channel caused the failure.", + "*failcode*: The failure code, as per BOLT #4.", + "*channel_update*: The hex string of the *channel_update* message received from the remote node. Only present if error is from the remote node and the *failcode* has the UPDATE bit set, as per BOLT #4." + ], + "example_json_request": [ + { + "id": "example:sendpay#1", + "method": "sendpay", + "params": { + "route": [ + { + "amount_msat": 11000000, + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "delay": 5, + "channel": "103x1x0" + } + ], + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "label": null, + "amount_msat": null, + "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk", + "payment_secret": "82644944d3f70d42aad1d5f7b5d7a629e7afa30b529cc952a4c59fc0e3790ea2", + "partid": null, + "groupid": null, + "payment_metadata": null + } + }, + { + "id": "example:sendpay#2", + "method": "sendpay", + "params": { + "route": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "channel": "103x1x0", + "direction": 1, + "amount_msat": 4211, + "style": "tlv", + "delay": 24 + }, + { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "channel": "105x1x0", + "direction": 0, + "amount_msat": 3710, + "style": "tlv", + "delay": 16 + }, + { + "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "channel": "107x1x0", + "direction": 1, + "amount_msat": 3210, + "style": "tlv", + "delay": 8 + } + ], + "payment_hash": "bc747053329402620a26bdc187cd134cdb699130d85be499ecd24160aff04c5c", + "label": null, + "amount_msat": null, + "bolt11": null, + "payment_secret": "c36a2fe9aced78c06960e2f21b369ed03f0492c97e53ba3b662163bcdaf1d7fa", + "partid": null, + "groupid": null, + "payment_metadata": null + } + } + ], + "example_json_response": [ + { + "message": "Monitor status with listpays or waitsendpay", + "created_index": 1, + "id": 1, + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "groupid": 1, + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount_msat": 11000000, + "amount_sent_msat": 11000000, + "created_at": 1706152930, + "status": "pending", + "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk" + }, + { + "message": "Monitor status with listpays or waitsendpay", + "created_index": 2, + "id": 2, + "payment_hash": "bc747053329402620a26bdc187cd134cdb699130d85be499ecd24160aff04c5c", + "groupid": 1, + "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "amount_msat": 3210, + "amount_sent_msat": 4211, + "created_at": 1708624260, + "status": "pending" + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listinvoice(7)", + "lightning-delinvoice(7)", + "lightning-getroute(7)", + "lightning-invoice(7)", + "lightning-pay(7)", + "lightning-waitsendpay(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-sendpsbt.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "sendpsbt", + "title": "Command to finalize, extract and send a partially signed bitcoin transaction (PSBT).", + "description": [ + "The **sendpsbt** is a low-level RPC command which sends a fully-signed PSBT." + ], + "request": { + "required": [ + "psbt" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "The fully signed psbt to be sent." + ] + }, + "reserve": { + "type": "u32", + "description": [ + "Number of blocks to increase reservation of any of our inputs by." + ], + "default": "72" + } + } + }, + "response": { + "required": [ + "tx", + "txid" + ], + "properties": { + "tx": { + "type": "hex", + "description": [ + "The raw transaction which was sent." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The txid of the **tx**." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:sendpsbt#1", + "method": "sendpsbt", + "params": { + "psbt": "some_psbt" + } + }, + { + "id": "example:sendpsbt#2", + "method": "sendpsbt", + "params": { + "psbt": "cHNidP8BAM0CAAAABEV+dnFRINmyeHxi4Id0OrcuzI5au5/BlPtTfu7E2m3EAAAAAAD9////cv8oioDx+0NCEnjBSYtnwF0H4VR13j+bkyb5gOOQLUUBAAAAAP3///8ehOrKm7JEq6zflkp9+zmSwE1iPe1yh3KTXvk+om/legEAAAAA/f///2s31wNrI1UavMgjC1GyrOHNbxOm68KYa13WX/mGfmjcAQAAAAD9////AcEAPQAAAAAAFgAUyQltQ/QI6lJgICYsza18hRa5KoEAAAAAAAEAcQIAAAABTzfqjIqV1wPpqc/3/Cb+tMX5EDrLmnhb5BMNx3aB/hYAAAAAAP3///8CQEIPAAAAAAAWABR9CNmX36nN45+GhjqvD4LjLMMMg/+juSkBAAAAFgAUJB0adsMdjkacZWrLwyteqfOaTrRlAAAAAQEfQEIPAAAAAAAWABR9CNmX36nN45+GhjqvD4LjLMMMgyICA1p5u7tAbUvCjfBfpqhzKM+wKn4TdDvs3NHfz+BxwuAQRzBEAiBwFb9rA0nUVlIPGd2aaiRbJ+KH4MLM3Bu+f0JuXB/hwAIgT2rrIUG9gXBZoH9fcPjCnbbM1SR4GiLYGLeALB8yENoBIgYDWnm7u0BtS8KN8F+mqHMoz7AqfhN0O+zc0d/P4HHC4BAIfQjZlwAAAAAAAQBxAgAAAAGANpEFI+CgfALTim/MWsAa62g+EmFWrFrzBDBCmCB3MgAAAAAA/f///wKZKdgpAQAAABYAFB+xhfU1pgl9WIvDKzAHZp8UeNkzQEIPAAAAAAAWABQHHEnK0vQg88gF+fa5ilcmnLFBUGUAAAABAR9AQg8AAAAAABYAFAccScrS9CDzyAX59rmKVyacsUFQIgICXTcoCCnxhsuZXNzL8jirRWQBOTlzUTljJKNldd803f9HMEQCIDtx/kEoc4PHDDm4eX5SEOmuRGu7ShpEG7xKBbuD/NjiAiBYkIKod39dcBarCT7Dbchkuwx70tJhOxQSJi2EMioGrwEiBgJdNygIKfGGy5lc3MvyOKtFZAE5OXNROWMko2V13zTd/wgHHEnKAAAAAAABAHECAAAAAVHU7RCZylzRMdlMBJ2ba4XKxv0l7LdWVnPYS6mhkf60AAAAAAD9////Av5VbSkBAAAAFgAU0BhRKzRbIC6H+s6j86d6cMpTNNhAQg8AAAAAABYAFD1D0ia8wnAZreUtej3FKnrBvii4ZQAAAAEBH0BCDwAAAAAAFgAUPUPSJrzCcBmt5S16PcUqesG+KLgiAgKKWZFo08l968cbxm5icOzwVPMA2Igwm6BUcaSCF13ZMEcwRAIgNAeIVGvUj9MWM18am0dx3JtEf79iQMX7Rqz1tttes3ICIAtNCglUlvpSidAxc/xoiy9cA13bgimJx25G+eZXfYJeASIGAopZkWjTyX3rxxvGbmJw7PBU8wDYiDCboFRxpIIXXdkwCD1D0iYAAAAAAAEAcQIAAAABRX52cVEg2bJ4fGLgh3Q6ty7Mjlq7n8GU+1N+7sTabcQBAAAAAP3///8CMmGqKQEAAAAWABSxLq0p9YAKl+hX7pFc0K/X+PIWmUBCDwAAAAAAFgAUZhwjt5DdNJE3OvCx2L7Qh31c3iJlAAAAAQEfQEIPAAAAAAAWABRmHCO3kN00kTc68LHYvtCHfVzeIiICA/qclQheQrHlADzR9BgXjDDJbkrneVTKD8SMWIJv9OsORzBEAiBKABqNV7cF5DKhtd+m+ZEmWF21vBt2uBKnzeDuUFqvDwIgJc6+/6GQqIfz869kJpUFTAMYTeL2qWR6d28EQEOJgkMBIgYD+pyVCF5CseUAPNH0GBeMMMluSud5VMoPxIxYgm/06w4IZhwjtwAAAAAAAA==", + "reserve": null + } + } + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters or some error happened during the command process." + ], + "example_json_response": [ + { + "txid": "05985072bbe20747325e69a159fe08176cc1bbc96d25e8848edad2dddc1165d0", + "tx": "02000000027032912651fc25a3e0893acd5f9640598707e2dfef92143bb5a4020e335442800100000017160014a5f48b9aa3cb8ca6cc1040c11e386745bb4dc932ffffffffd229a4b4f78638ebcac10a68b0561585a5d6e4d3b769ad0a909e9b9afaeae24e00000000171600145c83da9b685f9142016c6f5eb5f98a45cfa6f686ffffffff01915a01000000000017a9143a4dfd59e781f9c3018e7d0a9b7a26d58f8d22bf8700000000" + }, + { + "tx": "02000000000104457e76715120d9b2787c62e087743ab72ecc8e5abb9fc194fb537eeec4da6dc40000000000fdffffff72ff288a80f1fb43421278c1498b67c05d07e15475de3f9b9326f980e3902d450100000000fdffffff1e84eaca9bb244abacdf964a7dfb3992c04d623ded728772935ef93ea26fe57a0100000000fdffffff6b37d7036b23551abcc8230b51b2ace1cd6f13a6ebc2986b5dd65ff9867e68dc0100000000fdffffff01c1003d0000000000160014c9096d43f408ea526020262ccdad7c8516b92a810247304402207015bf6b0349d456520f19dd9a6a245b27e287e0c2ccdc1bbe7f426e5c1fe1c002204f6aeb2141bd817059a07f5f70f8c29db6ccd524781a22d818b7802c1f3210da0121035a79bbbb406d4bc28df05fa6a87328cfb02a7e13743becdcd1dfcfe071c2e0100247304402203b71fe41287383c70c39b8797e5210e9ae446bbb4a1a441bbc4a05bb83fcd8e20220589082a8777f5d7016ab093ec36dc864bb0c7bd2d2613b1412262d84322a06af0121025d37280829f186cb995cdccbf238ab45640139397351396324a36575df34ddff024730440220340788546bd48fd316335f1a9b4771dc9b447fbf6240c5fb46acf5b6db5eb37202200b4d0a095496fa5289d03173fc688b2f5c035ddb822989c76e46f9e6577d825e0121028a599168d3c97debc71bc66e6270ecf054f300d888309ba05471a482175dd9300247304402204a001a8d57b705e432a1b5dfa6f99126585db5bc1b76b812a7cde0ee505aaf0f022025cebeffa190a887f3f3af642695054c03184de2f6a9647a776f044043898243012103fa9c95085e42b1e5003cd1f418178c30c96e4ae77954ca0fc48c58826ff4eb0e00000000", + "txid": "43bb1c1bce6763ffe4d5df6b49f152f907f36f7849e55bb56075e2b256d17502" + } + ], + "author": [ + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." + ], + "see_also": [ + "lightning-fundpsbt(7)", + "lightning-signpsbt(7)", + "lightning-listtransactions(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-setchannel.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "setchannel", + "title": "Command for configuring fees / htlc range advertized for a channel", + "description": [ + "The **setchannel** RPC command sets channel specific routing fees, and `htlc_minimum_msat` or `htlc_maximum_msat` as defined in BOLT #7. The channel has to be in normal or awaiting state. This can be checked by **listpeers** reporting a *state* of CHANNELD_NORMAL or CHANNELD_AWAITING_LOCKIN for the channel.", + "", + "These changes (for a public channel) will be broadcast to the rest of the network (though many nodes limit the rate of such changes they will accept: we allow 2 a day, with a few extra occasionally)." + ], + "request": { + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string", + "description": [ + "Should contain a scid (short channel ID), channel id or peerid (pubkey) of the channel to be modified. If *id* is set to `all`, the updates are applied to all channels in states CHANNELD_NORMAL CHANNELD_AWAITING_LOCKIN or DUALOPEND_AWAITING_LOCKIN. If *id* is a peerid, all channels with the +peer in those states are changed." + ] + }, + "feebase": { + "type": "msat", + "description": [ + "Value in millisatoshi that is added as base fee to any routed payment: if omitted, it is unchanged. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*." + ] + }, + "feeppm": { + "type": "u32", + "description": [ + "Value that is added proportionally per-millionths to any routed payment volume in satoshi. For example, if ppm is 1,000 and 1,000,000 satoshi is being routed through the channel, an proportional fee of 1,000 satoshi is added, resulting in a 0.1% fee." + ] + }, + "htlcmin": { + "type": "msat", + "description": [ + "Value that limits how small an HTLC we will forward: if omitted, it is unchanged. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. Note that the peer also enforces a minimum for the channel: setting it below that will simply set it to that value with a warning. Also note that *htlcmin* only applies to forwarded HTLCs: we can still send smaller payments ourselves." + ], + "default": "no lower limit" + }, + "htlcmax": { + "type": "msat", + "description": [ + "Value that limits how large an HTLC we will forward: if omitted, it is unchanged. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. Note that *htlcmax* only applies to forwarded HTLCs: we can still send larger payments ourselves." + ], + "default": "no effective limit" + }, + "enforcedelay": { + "type": "u32", + "description": [ + "Number of seconds to delay before enforcing the new fees/htlc max. This gives the network a chance to catch up with the new rates and avoids rejecting HTLCs before they do. This only has an effect if rates are increased (we always allow users to overpay fees) or *htlcmax* is decreased, and only applied to a single rate increase per channel (we don't remember an arbitrary number of prior feerates) and if the node is restarted the updated configuration is enforced immediately." + ], + "default": "600, which is ten minutes" + }, + "ignorefeelimits": { + "added": "v23.08", + "type": "boolean", + "description": [ + "If set to True means to allow the peer to set the commitment transaction fees (or closing transaction fees) to any value they want. This is dangerous: they could set an exorbitant fee (so HTLCs are unenforcable), or a tiny fee (so that commitment transactions cannot be relayed), but avoids channel breakage in case of feerate disagreements. (Note: the global `ignore_fee_limits` setting overrides this)." + ] + } + } + }, + "response": { + "required": [ + "channels" + ], + "properties": { + "channels": { + "type": "array", + "description": [ + "Channel(s) set, and their resulting configuration." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "peer_id", + "channel_id", + "fee_base_msat", + "fee_proportional_millionths", + "minimum_htlc_out_msat", + "maximum_htlc_out_msat", + "ignore_fee_limits" + ], + "properties": { + "peer_id": { + "type": "pubkey", + "description": [ + "The node_id of the peer." + ] + }, + "channel_id": { + "type": "hash", + "description": [ + "The channel_id of the channel." + ] + }, + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "The short_channel_id (if locked in)." + ] + }, + "fee_base_msat": { + "type": "msat", + "description": [ + "The resulting feebase (this is the BOLT #7 name)." + ] + }, + "fee_proportional_millionths": { + "type": "u32", + "description": [ + "The resulting feeppm (this is the BOLT #7 name)." + ] + }, + "ignore_fee_limits": { + "type": "boolean", + "added": "v23.08", + "description": [ + "If we are now allowing peer to set feerate on commitment transaction without restriction." + ] + }, + "minimum_htlc_out_msat": { + "type": "msat", + "description": [ + "The resulting htlcmin we will advertize (the BOLT #7 name is htlc_minimum_msat)." + ] + }, + "warning_htlcmin_too_low": { + "type": "string", + "description": [ + "The requested htlcmin was too low for this peer, so we set it to the minimum they will allow." + ] + }, + "maximum_htlc_out_msat": { + "type": "msat", + "description": [ + "The resulting htlcmax we will advertize (the BOLT #7 name is htlc_maximum_msat)." + ] + }, + "warning_htlcmax_too_high": { + "type": "string", + "description": [ + "The requested htlcmax was greater than the channel capacity, so we set it to the channel capacity." + ] + } + } + } + } + } + }, + "errors": [ + "The following error codes may occur:", + "", + "- -1: Channel is in incorrect state, i.e. Catchall nonspecific error.", + "- -32602: JSONRPC2_INVALID_PARAMS, i.e. Given id is not a channel ID or short channel ID." + ], + "example_json_request": [ + { + "id": "example:setchannel#1", + "method": "setchannel", + "params": { + "id": "103x1x0", + "feebase": null, + "feeppm": null, + "htlcmin": null, + "htlcmax": null, + "enforcedelay": null, + "ignorefeelimits": true + } + }, + { + "id": "example:setchannel#2", + "method": "setchannel", + "params": { + "id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", + "feebase": 4000, + "feeppm": 300, + "htlcmin": null, + "htlcmax": null, + "enforcedelay": 0, + "ignorefeelimits": null + } + } + ], + "example_json_response": [ + { + "channels": [ + { + "peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "channel_id": "90210d39d12a65d239ece267c5f48e0a82e7cb95724e658f6d99f370064faad1", + "short_channel_id": "103x1x0", + "fee_base_msat": 1, + "fee_proportional_millionths": 10, + "minimum_htlc_out_msat": 0, + "maximum_htlc_out_msat": 990000000, + "ignore_fee_limits": true + } + ] + }, + { + "channels": [ + { + "peer_id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", + "channel_id": "9c54c71bbbe59591cc3162e14fc4ff58c146f085c07d0f206ea679a8231d03ab", + "short_channel_id": "103x3x0", + "fee_base_msat": 4000, + "fee_proportional_millionths": 300, + "minimum_htlc_out_msat": 0, + "maximum_htlc_out_msat": 990000000, + "ignore_fee_limits": false + } + ] + } + ], + "author": [ + "Michael Schmoock <> is the author of this feature." + ], + "see_also": [ + "lightningd-config(5)", + "lightning-fundchannel(7)", + "lightning-listchannels(7)", + "lightning-listpeers(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-setconfig.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.08", + "rpc": "setconfig", + "title": "Dynamically change some config options", + "description": [ + "The **setconfig** RPC command allows you set the (dynamic) configuration option named by `config`: options which take a value (as separate from simple flag options) also need a `val` parameter.", + "", + "This new value will *also* be written at the end of the config file, for persistence across restarts (and any old value commented out).", + "", + "You can see what options are dynamically adjustable using lightning- listconfigs(7). Note that you can also adjust existing options for stopped plugins; they will have an effect when the plugin is restarted." + ], + "request": { + "required": [ + "config" + ], + "properties": { + "config": { + "type": "string", + "description": [ + "Name of the config variable which should be set to the value of the variable." + ] + }, + "val": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "boolean" + } + ], + "description": [ + "Value of the config variable to be set or updated." + ] + } + } + }, + "response": { + "required": [ + "config" + ], + "properties": { + "config": { + "type": "object", + "description": [ + "Config settings after completion." + ], + "additionalProperties": false, + "required": [ + "config", + "source", + "dynamic" + ], + "properties": { + "config": { + "type": "string", + "description": [ + "Name of the config variable which was set." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting (`file`:`linenum`)." + ] + }, + "plugin": { + "type": "string", + "description": [ + "The plugin this configuration setting is for." + ] + }, + "dynamic": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Whether this option is settable via setconfig." + ] + }, + "set": { + "type": "boolean", + "description": [ + "For simple flag options." + ] + }, + "value_str": { + "type": "string", + "description": [ + "For string options." + ] + }, + "value_msat": { + "type": "msat", + "description": [ + "For msat options." + ] + }, + "value_int": { + "type": "integer", + "description": [ + "For integer options." + ] + }, + "value_bool": { + "type": "boolean", + "description": [ + "For boolean options." + ] + } + } + } + } + }, + "errors": [ + "The following error codes may occur:", + "", + "- -32602: JSONRPC2_INVALID_PARAMS, i.e. the parameter is not dynamic, or the val was invalid." + ], + "example_json_request": [ + { + "id": "example:setconfig#1", + "method": "setconfig", + "params": [ + "autoclean-paidinvoices-age", + 1 + ] + }, + { + "id": "example:setconfig#2", + "method": "setconfig", + "params": [ + "test-dynamic-config", + "changed" + ] + }, + { + "id": "example:setconfig#3", + "method": "setconfig", + "params": { + "config": "min-capacity-sat", + "val": 500000 + } + } + ], + "example_json_response": [ + { + "config": { + "config": "autoclean-paidinvoices-age", + "value_int": 1, + "source": "/tmp/ltests-7u_8_rtu/test_autoclean_1/lightning-3/regtest/config:6", + "plugin": "~/lightning/plugins/autoclean", + "dynamic": true + } + }, + { + "config": { + "config": "test-dynamic-config", + "value_str": "changed", + "source": "/tmp/ltests-7u_8_rtu/test_dynamic_option_python_plugin_1/lightning-1/regtest/config:2", + "plugin": "~/lightning/tests/plugins/dynamic_option.py", + "dynamic": true + } + }, + { + "config": { + "config": "min-capacity-sat", + "value_int": 500000, + "source": "/tmp/ltests-nvfdbou2/test_setconfig_1/lightning-2/regtest/config:2", + "dynamic": true + } + } + ], + "author": [ + "Rusty Russell <> is mainly responsible for this feature." + ], + "see_also": [ + "lightningd-config(5)", + "lightning-listconfigs(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-setpsbtversion.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "setpsbtversion", + "title": "Command for setting PSBT version", + "description": [ + "The **setpsbtversion** RPC command converts the provided PSBT to the given version, and returns the base64 result of the conversion. Returns an error if version is invalid." + ], + "request": { + "required": [ + "psbt", + "version" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "The PSBT to change versions." + ] + }, + "version": { + "type": "u32", + "description": [ + "The version to set." + ] + } + } + }, + "response": { + "required": [ + "psbt" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "A converted PSBT of the requested version." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:setpsbtversion#1", + "method": "setpsbtversion", + "params": { + "psbt": "cHNidP8BAAoCAAAAAAAAAAAAAA==", + "version": "2" + } + }, + { + "id": "example:setpsbtversion#2", + "method": "setpsbtversion", + "params": [ + "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIJd6ICNAQALFOMhoUHuSVSuzcaUdkDKlk4K+A+DR9+4uAA==", + 0 + ] + } + ], + "errors": [ + "The following error codes may occur:", + "", + "- -32602: Parameter missed or malformed." + ], + "example_json_response": [ + { + "psbt": "cHNidP8BAgQCAAAAAQQBAAEFAQABBgEDAfsEAgAAAAA=" + }, + { + "psbt": "cHNidP8BADUCAAAAAAFAQg8AAAAAACJRIJd6ICNAQALFOMhoUHuSVSuzcaUdkDKlk4K+A+DR9+4ubwAAAAAA" + } + ], + "author": [ + "Gregory Sanders <> is mainly responsible." + ], + "see_also": [ + "lightning-fundpsbt(7)", + "lightning-utxopsbt(7)", + "lightning-signpsbt(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-showrunes.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.08", + "rpc": "showrunes", + "title": "Command to list previously generated runes", + "description": [ + "The **showrunes** RPC command either lists runes that we stored as we generate them (see lightning-createrune(7)) or decodes the rune given on the command line." + ], + "request": { + "required": [], + "properties": { + "rune": { + "type": "string", + "description": [ + "If specified, only details of that rune will be returned." + ] + } + } + }, + "response": { + "required": [ + "runes" + ], + "properties": { + "runes": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "rune", + "unique_id", + "restrictions", + "restrictions_as_english" + ], + "properties": { + "rune": { + "type": "string", + "description": [ + "Base64 encoded rune." + ] + }, + "unique_id": { + "type": "string", + "description": [ + "Unique id assigned when the rune was generated; this is always a u64 for commando runes." + ] + }, + "restrictions": { + "type": "array", + "description": [ + "The restrictions on what commands this rune can authorize." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "alternatives", + "english" + ], + "properties": { + "alternatives": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "fieldname", + "value", + "condition", + "english" + ], + "properties": { + "fieldname": { + "type": "string", + "description": [ + "The field this restriction applies to; see commando-rune(7)." + ] + }, + "value": { + "type": "string", + "description": [ + "The value accepted for this field." + ] + }, + "condition": { + "type": "string", + "description": [ + "The way to compare fieldname and value." + ] + }, + "english": { + "type": "string", + "description": [ + "English readable description of this alternative." + ] + } + } + } + }, + "english": { + "type": "string", + "description": [ + "English readable summary of alternatives above." + ] + } + } + } + }, + "restrictions_as_english": { + "type": "string", + "description": [ + "English readable description of the restrictions array above." + ] + }, + "stored": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "This is false if the rune does not appear in our datastore (only possible when `rune` is specified)." + ] + }, + "blacklisted": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "The rune has been blacklisted; see commando-blacklist(7)." + ] + }, + "last_used": { + "type": "number", + "description": [ + "The last time this rune was successfully used." + ], + "added": "23.11" + }, + "our_rune": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "This is not a rune for this node (only possible when `rune` is specified)." + ] + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:showrunes#1", + "method": "showrunes", + "params": "{}" + }, + { + "id": "example:showrunes#2", + "method": "showrunes", + "params": { + "rune": "Bl0V_vkVkGr4h356JbCMCcoDyyKE8djkoQ2156iPB509MCZwZXI9MTAwMDAwMDAwMG5zZWM=" + } + } + ], + "example_json_response": [ + { + "runes": [ + { + "rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==", + "unique_id": "0", + "restrictions": [], + "restrictions_as_english": "" + }, + { + "rune": "geZmO6U7yqpHn-moaX93FVMVWrDRfSNY4AXx9ypLcqg9MQ==", + "unique_id": "1", + "restrictions": [], + "restrictions_as_english": "" + }, + { + "rune": "Bl0V_vkVkGr4h356JbCMCcoDyyKE8djkoQ2156iPB509MCZwZXI9MTAwMDAwMDAwMG5zZWM=", + "unique_id": "2", + "restrictions": [ + { + "alternatives": [ + { + "fieldname": "per", + "value": "1000000000nsec", + "condition": "=", + "english": "per equal to 1000000000nsec" + } + ], + "english": "per equal to 1000000000nsec" + } + ], + "restrictions_as_english": "per equal to 1000000000nsec" + } + ] + }, + { + "runes": [ + { + "rune": "Bl0V_vkVkGr4h356JbCMCcoDyyKE8djkoQ2156iPB509MCZwZXI9MTAwMDAwMDAwMG5zZWM=", + "unique_id": "2", + "restrictions": [ + { + "alternatives": [ + { + "fieldname": "per", + "value": "1000000000nsec", + "condition": "=", + "english": "per equal to 1000000000nsec" + } + ], + "english": "per equal to 1000000000nsec" + } + ], + "restrictions_as_english": "per equal to 1000000000nsec" + } + ] + } + ], + "author": [ + "Shahana Farooqui <> is mainly responsible." + ], + "see_also": [ + "lightning-commando-showrunes(7)", + "lightning-blacklistrune(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-signinvoice.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.02", + "rpc": "signinvoice", + "title": "Low-level invoice signing", + "description": [ + "The **signinvoice** RPC command signs an invoice. Unlike **createinvoice** it does not save the invoice into the database and thus does not require the preimage." + ], + "request": { + "required": [ + "invstring" + ], + "properties": { + "invstring": { + "type": "string", + "description": [ + "Bolt11 form, but the final signature is ignored. Minimal sanity checks are done." + ] + } + } + }, + "response": { + "required": [ + "bolt11" + ], + "properties": { + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string." + ] + } + } + }, + "errors": [ + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error." + ], + "example_json_request": [ + { + "id": "example:signinvoice#1", + "method": "signinvoice", + "params": [ + "lnbcrt10n1pjmxt3lsp5jumuz2sv3ca68kzd92hp3wdtpx8ghnxur65fs6maw6dyxsleqd0spp5nadvvh7uzk2qzh8d9d7tsxr08l9uaz2vjeuuahqtufjv52d0eassdq8d9h8vvgxqyjw5qcqp99qxpqysgq4rrn702eum6c9ld9khlz39vdyd8zcwrav5ygqvu6w54aep6yarkyfrnk990yf5prpasgzmj52stektf6mzwdl5hc6qlsglt2a0pwp0spwww44w" + ] + } + ], + "example_json_response": [ + { + "bolt11": "lnbcrt10n1pjmxt3lsp5jumuz2sv3ca68kzd92hp3wdtpx8ghnxur65fs6maw6dyxsleqd0spp5nadvvh7uzk2qzh8d9d7tsxr08l9uaz2vjeuuahqtufjv52d0eassdq8d9h8vvgxqyjw5qcqp99qxpqysgq3nhrd72qe7wmc2hvwhaqnx05y6dzxh2tal02kw055er7uutkkrcreccm37ce6wv7ee8q70ktlr9fy3fd635hc2k98a4svd9c8v4cpjsppm2eee" + } + ], + "author": [ + "Carl Dong <> is mainly responsible." + ], + "see_also": [ + "lightning-createinvoice(7)", + "lightning-invoice(7)", + "lightning-listinvoices(7)", + "lightning-delinvoice(7)", + "lightning-getroute(7)", + "lightning-sendpay(7)", + "lightning-offer(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-signmessage.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "signmessage", + "title": "Command to create a signature from this node", + "description": [ + "The **signmessage** RPC command creates a digital signature of *message* using this node's secret key. A receiver who knows your node's *id* and the *message* can be sure that the resulting signature could only be created by something with access to this node's secret key." + ], + "request": { + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string", + "description": [ + "Less than 65536 characters long message to be signed by the node." + ] + } + } + }, + "response": { + "required": [ + "signature", + "recid", + "zbase" + ], + "properties": { + "signature": { + "type": "hex", + "description": [ + "The signature." + ], + "minLength": 128, + "maxLength": 128 + }, + "recid": { + "type": "hex", + "description": [ + "The recovery id (0, 1, 2 or 3)." + ], + "minLength": 2, + "maxLength": 2 + }, + "zbase": { + "type": "string", + "description": [ + "*signature* and *recid* encoded in a style compatible with **lnd**'s [SignMessageRequest](https://api.lightning.community/#grpc-request- signmessagerequest)." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:signmessage#1", + "method": "signmessage", + "params": { + "message": "this is a test!" + } + }, + { + "id": "example:signmessage#2", + "method": "signmessage", + "params": { + "message": "message for you" + } + } + ], + "example_json_response": [ + { + "signature": "a2ec227012795f9d6b80a3f5ea98374c6d2886917517c05336799923fcf37caf08344c0431275e1a8189da01b444ae978007fe70f0cc9009f38cabe074ade87d", + "recid": "00", + "zbase": "d6tqaeuonjhi98mmont9m4wag7gg4krg1f4txonug3h31e9h6p6k6nbwjondnj46dkyausobstnk7fhyy998bhgc1yr98dfmhb4k54d7" + }, + { + "signature": "85843b010bc517b32eaafe70232e2c44bb5a354c74d2202390af1b272e4c6ac23ac3f97ea663d8b49116ad6c2d080515b43bcdf1ea4f38cdb18af0edf8209cd8", + "recid": "00", + "zbase": "d6naeqabbxntxc3qim98ye3qftnmsstijt4prebd1nztsj3qjticrqsd9f9kca6as1etpmmcfwrykfpw8xg9d41x8dg5dnzo7zhnb8ga" + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-checkmessage(7)" + ], + "resources": [ + "Main web site: ", + "", + "[SignMessageRequest](https://api.lightning.community/#grpc-request-signmessagerequest)" + ] + }, + "lightning-signpsbt.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "signpsbt", + "title": "Command to sign a wallet's inputs on a provided bitcoin transaction (PSBT).", + "description": [ + "**signpsbt** is a low-level RPC command which signs a PSBT as defined by BIP-174.", + "", + "By default, all known inputs are signed, and others ignored: with *signonly*, only those inputs are signed, and an error is returned if one of them cannot be signed.", + "", + "Note that the command will fail if there are no inputs to sign, or if the inputs to be signed were not previously reserved." + ], + "request": { + "required": [ + "psbt" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "The psbt to be signed." + ] + }, + "signonly": { + "type": "array", + "description": [ + "Input numbers to sign." + ], + "items": { + "type": "u32" + } + } + } + }, + "response": { + "required": [ + "signed_psbt" + ], + "properties": { + "signed_psbt": { + "type": "string", + "description": [ + "The fully signed PSBT." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:signpsbt#1", + "method": "signpsbt", + "params": { + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAAAAAAEQBAAAAAAM/AlsaWdodG5pbmcBCCvyYqqdIt0mAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oBDiBWd3IcNaQkoj1tzHyQkDblBa5oZQ4J1ZcztLfnMAOk3AEPBAEAAAABEAT9////DPwJbGlnaHRuaW5nAQg5j4QWOQoUFAABAwhOfA0AAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4M/AlsaWdodG5pbmcBCMbeD+3qn9/kAAEDCODIEAAAAAAAAQQiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQz8CWxpZ2h0bmluZwEI4upB+mjl6AIA", + "signonly": null + } + }, + { + "id": "example:signpsbt#2", + "method": "signpsbt", + "params": { + "psbt": "cHNidP8BAP1xAQIAAAAIFTef27H2GAJBzP4UZMeDePsDVkglO47/q4jqK18ibCYAAAAAAP3///+axwap6WKnEHvLjIJZX0ZeJ87cs7PKkXBfwvbGVmjpTQEAAAAA/f///wQ1cVzb9NR7nXadyRuhQBv+2iqhZkhvUA+sPo5z/SsSAQAAAAD9////lXQ788meUtSxhBX13mx2XhyM3Ddo30QtmNW0YuE2TDABAAAAAP3///8Kr4BwElAScx3bA5ZdavrHwh4Zh+rFNvkE/+7gu1WbngEAAAAA/f///3Uei7j3k/b5tnjFGvNZhe2iWz8O6FQjTEpM5XIoduNsAQAAAAD9////fm5Om4MojcnfZiTmrwb4b5Byw9emrjITi/nkEqTK9MsBAAAAAP3///8lwdpZqt3ILPRwhINY4PGvkg2CSw7agcMPSuFoHDDkIQAAAAAA/f///wGCAXoAAAAAABYAFMkJbUP0COpSYCAmLM2tfIUWuSqBAAAAAAABAHECAAAAAZVxzFxyEg7tiQTgRHwGleR8Srxw6taAGOoEpJK/Xj5sAAAAAAD9////AkBCDwAAAAAAFgAUKvGgVL/ThjWE/P1oORVXh/ObucYzr/YpAQAAABYAFKmkod5S53U4m5tKFApyeC35UbnbZwAAAAEBH0BCDwAAAAAAFgAUKvGgVL/ThjWE/P1oORVXh/ObucYAAQBxAgAAAAEVN5/bsfYYAkHM/hRkx4N4+wNWSCU7jv+riOorXyJsJgEAAAAA/f///wJmbOcpAQAAABYAFCCSJBD9wY/VwxnBcnFiu1tA6CGTQEIPAAAAAAAWABSjI8KCqaGX/BGOwJza8hyiuxuIcmcAAAABAR9AQg8AAAAAABYAFKMjwoKpoZf8EY7AnNryHKK7G4hyAAEAcQIAAAAB98EwKZMOHiyRYWyToae6Kce3gCwqUvnVXXHlB/ps9ocBAAAAAP3///8CmNuLKQEAAAAWABQ4roxw+phYHelaRr71DYB3FEy/30BCDwAAAAAAFgAUwSDtQiY7PVvBc7ww56Y72YIQdjllAAAAAQEfQEIPAAAAAAAWABTBIO1CJjs9W8FzvDDnpjvZghB2OQABAHECAAAAAZH/SvCXvDW7b8qb55CDC4M+jgZ61H/e8rZnAGaXp+Z+AAAAAAD9////Apkp2CkBAAAAFgAUc/Y+sIq3oYyEe40GkKJsXawkzwFAQg8AAAAAABYAFLdt1h5Bte8FKvIc2jJgiIwHC7mvZwAAAAEBH0BCDwAAAAAAFgAUt23WHkG17wUq8hzaMmCIjAcLua8AAQBxAgAAAAETC3wMCv9qK3lvVkVJu9b/v2VgMepZtnfngMp2xMXRnwAAAAAA/f///wJk0E4pAQAAABYAFEIsc4cBl+BTN33Kn80+YYfkMt+cQEIPAAAAAAAWABT2/7RIxKohhGbacpBz0BZNYcnfsGUAAAABAR9AQg8AAAAAABYAFPb/tEjEqiGEZtpykHPQFk1hyd+wAAEAcQIAAAABA8J/OnC+cuH79Z6wZmzwdAjhBDaPHavh3yvhr4odDXQBAAAAAP3///8CykowKQEAAAAWABTVHuO8cKOOX/JlmMU66on6Uc54mkBCDwAAAAAAFgAUunZMZryWMqCTiMuVWNF/cleg6dVnAAAAAQEfQEIPAAAAAAAWABS6dkxmvJYyoJOIy5VY0X9yV6Dp1QABAHECAAAAAfRxBaZZ3FfDGwxhZQLYCurN+7kJj0x6nzChg434dnjRAAAAAAD9////AszmyCkBAAAAFgAULSqRp54barF/7R9XOmsLDCVWdAFAQg8AAAAAABYAFNa5adNt/9rZhpGT9mPuSA39xzSIZQAAAAEBH0BCDwAAAAAAFgAU1rlp023/2tmGkZP2Y+5IDf3HNIgAAQBxAgAAAAEgk1JYyP4oIoPoYYcTPPDvZynVfXWINJnBEFBsLv0MtAAAAAAA/f///wJAQg8AAAAAABYAFGYcI7eQ3TSRNzrwsdi+0Id9XN4iMmGqKQEAAAAWABT5XKNwVIFsUKh26sqHFSlOLq5TFGUAAAABAR9AQg8AAAAAABYAFGYcI7eQ3TSRNzrwsdi+0Id9XN4iAAA=", + "signonly": [ + 7 + ] + } + } + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters, or there aren't wallet's inputs to sign, or we couldn't sign all of *signonly*, or inputs are not reserved." + ], + "example_json_response": [ + { + "signed_psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAAAAAAEQBAAAAAAM/AlsaWdodG5pbmcBCCvyYqqdIt0mAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oBDiBWd3IcNaQkoj1tzHyQkDblBa5oZQ4J1ZcztLfnMAOk3AEPBAEAAAABEAT9////ARNACI9TcWG+6uC9ElBFN3qhND7amsor/dtBhJ5ujEQAT/80548avrt7d7IJiOAaCNzzYLSXITdL2xjx6mhbBi9hTiEWkUUygSpECk12bHHNORk2lKNArhHgEuW6Gtnvum52ylMJAMLMqxcAAAAADPwJbGlnaHRuaW5nAQg5j4QWOQoUFAABAwhOfA0AAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4hB7nAxoROEqUxyWjlXFUHjsFtm/dr6SkP2H0cynK0g5oXCQDWuWnTBAAAAAz8CWxpZ2h0bmluZwEIxt4P7eqf3+QAAQMI4MgQAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQji6kH6aOXoAgA=" + }, + { + "signed_psbt": "cHNidP8BAP1xAQIAAAAIFTef27H2GAJBzP4UZMeDePsDVkglO47/q4jqK18ibCYAAAAAAP3///+axwap6WKnEHvLjIJZX0ZeJ87cs7PKkXBfwvbGVmjpTQEAAAAA/f///wQ1cVzb9NR7nXadyRuhQBv+2iqhZkhvUA+sPo5z/SsSAQAAAAD9////lXQ788meUtSxhBX13mx2XhyM3Ddo30QtmNW0YuE2TDABAAAAAP3///8Kr4BwElAScx3bA5ZdavrHwh4Zh+rFNvkE/+7gu1WbngEAAAAA/f///3Uei7j3k/b5tnjFGvNZhe2iWz8O6FQjTEpM5XIoduNsAQAAAAD9////fm5Om4MojcnfZiTmrwb4b5Byw9emrjITi/nkEqTK9MsBAAAAAP3///8lwdpZqt3ILPRwhINY4PGvkg2CSw7agcMPSuFoHDDkIQAAAAAA/f///wGCAXoAAAAAABYAFMkJbUP0COpSYCAmLM2tfIUWuSqBAAAAAAABAHECAAAAAZVxzFxyEg7tiQTgRHwGleR8Srxw6taAGOoEpJK/Xj5sAAAAAAD9////AkBCDwAAAAAAFgAUKvGgVL/ThjWE/P1oORVXh/ObucYzr/YpAQAAABYAFKmkod5S53U4m5tKFApyeC35UbnbZwAAAAEBH0BCDwAAAAAAFgAUKvGgVL/ThjWE/P1oORVXh/ObucYAAQBxAgAAAAEVN5/bsfYYAkHM/hRkx4N4+wNWSCU7jv+riOorXyJsJgEAAAAA/f///wJmbOcpAQAAABYAFCCSJBD9wY/VwxnBcnFiu1tA6CGTQEIPAAAAAAAWABSjI8KCqaGX/BGOwJza8hyiuxuIcmcAAAABAR9AQg8AAAAAABYAFKMjwoKpoZf8EY7AnNryHKK7G4hyAAEAcQIAAAAB98EwKZMOHiyRYWyToae6Kce3gCwqUvnVXXHlB/ps9ocBAAAAAP3///8CmNuLKQEAAAAWABQ4roxw+phYHelaRr71DYB3FEy/30BCDwAAAAAAFgAUwSDtQiY7PVvBc7ww56Y72YIQdjllAAAAAQEfQEIPAAAAAAAWABTBIO1CJjs9W8FzvDDnpjvZghB2OQABAHECAAAAAZH/SvCXvDW7b8qb55CDC4M+jgZ61H/e8rZnAGaXp+Z+AAAAAAD9////Apkp2CkBAAAAFgAUc/Y+sIq3oYyEe40GkKJsXawkzwFAQg8AAAAAABYAFLdt1h5Bte8FKvIc2jJgiIwHC7mvZwAAAAEBH0BCDwAAAAAAFgAUt23WHkG17wUq8hzaMmCIjAcLua8AAQBxAgAAAAETC3wMCv9qK3lvVkVJu9b/v2VgMepZtnfngMp2xMXRnwAAAAAA/f///wJk0E4pAQAAABYAFEIsc4cBl+BTN33Kn80+YYfkMt+cQEIPAAAAAAAWABT2/7RIxKohhGbacpBz0BZNYcnfsGUAAAABAR9AQg8AAAAAABYAFPb/tEjEqiGEZtpykHPQFk1hyd+wAAEAcQIAAAABA8J/OnC+cuH79Z6wZmzwdAjhBDaPHavh3yvhr4odDXQBAAAAAP3///8CykowKQEAAAAWABTVHuO8cKOOX/JlmMU66on6Uc54mkBCDwAAAAAAFgAUunZMZryWMqCTiMuVWNF/cleg6dVnAAAAAQEfQEIPAAAAAAAWABS6dkxmvJYyoJOIy5VY0X9yV6Dp1QABAHECAAAAAfRxBaZZ3FfDGwxhZQLYCurN+7kJj0x6nzChg434dnjRAAAAAAD9////AszmyCkBAAAAFgAULSqRp54barF/7R9XOmsLDCVWdAFAQg8AAAAAABYAFNa5adNt/9rZhpGT9mPuSA39xzSIZQAAAAEBH0BCDwAAAAAAFgAU1rlp023/2tmGkZP2Y+5IDf3HNIgAAQBxAgAAAAEgk1JYyP4oIoPoYYcTPPDvZynVfXWINJnBEFBsLv0MtAAAAAAA/f///wJAQg8AAAAAABYAFGYcI7eQ3TSRNzrwsdi+0Id9XN4iMmGqKQEAAAAWABT5XKNwVIFsUKh26sqHFSlOLq5TFGUAAAABAR9AQg8AAAAAABYAFGYcI7eQ3TSRNzrwsdi+0Id9XN4iIgID+pyVCF5CseUAPNH0GBeMMMluSud5VMoPxIxYgm/06w5HMEQCIG90DSr+fGNoWhCrgLbJG3Wt8PJNMWYqaa5MLWRwA0oTAiA9rsLEqqVhjV6wENfzzpudaE949uLlVqWgDjE/FSgKNAEiBgP6nJUIXkKx5QA80fQYF4wwyW5K53lUyg/EjFiCb/TrDghmHCO3AAAAAAAA" + } + ], + "author": [ + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." + ], + "see_also": [ + "lightning-fundpsbt(7)", + "lightning-sendpsbt(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-splice_init.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.08", + "rpc": "splice_init", + "title": "Command to initiate a channel to a peer", + "warning": "experimental-splicing only", + "description": [ + "`splice_init` is a low level RPC command which initiates a channel splice for a given channel specified by `channel_id`." + ], + "request": { + "required": [ + "channel_id", + "relative_amount" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "The channel id of the channel to be spliced." + ] + }, + "relative_amount": { + "type": "integer", + "description": [ + "A positive or negative amount of satoshis to add or subtract from the channel. Note you may need to add a double dash (--) after splice_init if using a negative *relative_amount* so it is not interpretted as a command modifier. For example: ```shell lightning-cli splice_init -- $CHANNEL_ID -100000 ```." + ] + }, + "initialpsbt": { + "type": "string", + "description": [ + "The (optional) base 64 encoded PSBT to begin with. If not specified, one will be generated automatically." + ] + }, + "feerate_per_kw": { + "type": "u32", + "description": [ + "The miner fee we promise our peer to pay for our side of the splice transaction. It is calculated by `feerate_per_kw` * our_bytes_in_splice_tx / 1000." + ] + }, + "force_feerate": { + "type": "boolean", + "description": [ + "By default splices will fail if the fee provided looks too high. This is to protect against accidentally setting your fee higher than intended. Set `force_feerate` to true to skip this saftey check." + ] + } + } + }, + "response": { + "required": [ + "psbt" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "The (incomplete) PSBT of the splice transaction." + ] + } + } + }, + "example_usage": [ + "Here is an example set of splice commands that will splice in 100,000 sats to the first channel that comes out of `listpeerchannels`. The example assumes you already have at least one confirmed channel.", + "", + "```shell", + "RESULT=$(lightning-cli listpeerchannels)", + "CHANNEL_ID=$(echo $RESULT| jq -r \".channels[0].channel_id\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli fundpsbt -k satoshi=100000sat feerate=urgent startweight=800 excess_as_change=true)", + "INITIALPSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli splice_init $CHANNEL_ID 100000 $INITIALPSBT)", + "PSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT)", + "PSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli signpsbt -k psbt=\"$PSBT\")", + "PSBT=$(echo $RESULT | jq -r \".signed_psbt\")", + "echo $RESULT", + "", + "lightning-cli splice_signed $CHANNEL_ID $PSBT", + "```", + "", + "Here is an example set of splice commands that will splice out 100,000 sats from first channel that comes out of `listpeerchannels`. The example assumes you already have at least one confirmed channel.", + "", + "```shell", + "RESULT=$(lightning-cli listpeerchannels)", + "CHANNEL_ID=$(echo $RESULT| jq -r \".channels[0].channel_id\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli addpsbtoutput 100000)", + "INITIALPSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli splice_init -- $CHANNEL_ID -100500 $INITIALPSBT)", + "PSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT)", + "PSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "lightning-cli splice_signed $CHANNEL_ID $PSBT", + "```" + ], + "example_json_request": [ + { + "id": "example:splice_init#1", + "method": "splice_init", + "params": { + "channel_id": "5677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc", + "relative_amount": 100000, + "initialpsbt": "cHNidP8BAF4CAAAAAVZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQAAAAD9////AU58DQAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5sAAAAAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==", + "feerate_per_kw": null + } + }, + { + "id": "example:splice_init#2", + "method": "splice_init", + "params": { + "channel_id": "a40bb442dab0231b51d8f842d95aad548aa35e1d13c4cfcf2997344f805453a1", + "relative_amount": -105000, + "initialpsbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIoIYBAAAAAAABBCJRIHg2NV/cioLcTLAKdyxVVBUdBjhKTdZejT9orAhWa4S+AA==", + "feerate_per_kw": null + } + } + ], + "example_json_response": [ + { + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEFR1IhAjJCZt6EA7OrFXoJ8feE1YevYYMcmYwVG8whu3TCsjFLIQLjvTgAmGbJ2o7EqpnMTqnGwN1G3xXGHvDOHycSkXFOV1KuAQ4gVndyHDWkJKI9bcx8kJA25QWuaGUOCdWXM7S35zADpNwBDwQAAAAAARAEAAAAAAz8CWxpZ2h0bmluZwEIK/Jiqp0i3SYAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAQAAAAEQBP3///8M/AlsaWdodG5pbmcBCDmPhBY5ChQUAAEDCE58DQAAAAAAAQQiUSB4NjVf3IqC3EywCncsVVQVHQY4Sk3WXo0/aKwIVmuEvgz8CWxpZ2h0bmluZwEIxt4P7eqf3+QAAQMIAAAAAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQji6kH6aOXoAgA=" + }, + { + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABARzi7RBt64yrfqRL2p+KiUw8cYtiKICRFHmp/4eCSemSAQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgTCjR9L+TfzP7pLJVVto5egTRbRNj/RaBhyrA3UW0aEcCIAJO5FZjXvdpRcGR949C4DnfHs3soklTjn/1upkia+TgASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M9mAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEFR1IhAjJCZt6EA7OrFXoJ8feE1YevYYMcmYwVG8whu3TCsjFLIQLjvTgAmGbJ2o7EqpnMTqnGwN1G3xXGHvDOHycSkXFOV1KuAQ4gpAu0QtqwIxtR2PhC2VqtVIqjXh0TxM/PKZc0T4BUU6EBDwQAAAAAARAEAAAAAAz8CWxpZ2h0bmluZwEIn2Ac8fyFEJwAAQMIAAAAAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQgu7JK9IpBWOAABAwighgEAAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4M/AlsaWdodG5pbmcBCOZ1GpRwbKfuAA==" + } + ], + "author": [ + "Dusty <<@dusty_daemon>> is mainly responsible." + ], + "see_also": [ + "lightning-splice_signed(7)", + "lightning-splice_update(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-splice_signed.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.08", + "rpc": "splice_signed", + "title": "Command to initiate a channel to a peer", + "warning": "experimental-splicing only", + "description": [ + "`splice_signed` is a low level RPC command which finishes the active channel splice associated with `channel_id`.", + "", + "The *psbt* must have all signatures attached to all inputs that you have added to it or it will fail." + ], + "request": { + "required": [ + "channel_id", + "psbt" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "The channel id of the channel to be spliced." + ] + }, + "psbt": { + "type": "string", + "description": [ + "The final version of the psbt to complete the splice with." + ] + }, + "sign_first": { + "type": "boolean", + "description": [ + "A flag that makes our node offer the final splice signature first (defaults to false). When false, the node will calculate who should sign first based off who is adding inputting the least sats to the splice as per spec." + ] + } + } + }, + "response": { + "required": [ + "tx", + "txid" + ], + "properties": { + "tx": { + "type": "hex", + "description": [ + "The hex representation of the final transaction that is published." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The txid is of the final transaction." + ] + } + } + }, + "example_usage": [ + "In this example we funded the psbt from our lightning node, so we can use the lightning node to sign for its funds.", + "", + "```shell", + "RESULT=$(lightning-cli signpsbt $PSBT)", + "PSBT=$(echo $RESULT | jq -r \".signed_psbt\")", + "echo $RESULT", + "", + "lightning-cli splice_signed $CHANNEL_ID $PSBT", + "```", + "", + "Here is a full example set of splice commands that will splice in 100,000 sats to the first channel that comes out of `listpeerchannels`. The example assumes you already have at least one confirmed channel.", + "", + "```shell", + "RESULT=$(lightning-cli listpeerchannels)", + "CHANNEL_ID=$(echo $RESULT| jq -r \".channels[0].channel_id\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli fundpsbt -k satoshi=100000sat feerate=urgent startweight=800 excess_as_change=true)", + "INITIALPSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli splice_init $CHANNEL_ID 100000 $INITIALPSBT)", + "PSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT={\"commitments_secured\":false}", + "while [[ $(echo $RESULT | jq -r \".commitments_secured\") == \"false\" ]]", + "do", + " RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT)", + " PSBT=$(echo $RESULT | jq -r \".psbt\")", + " echo $RESULT", + "done", + "", + "RESULT=$(lightning-cli signpsbt -k psbt=\"$PSBT\")", + "PSBT=$(echo $RESULT | jq -r \".signed_psbt\")", + "echo $RESULT", + "", + "lightning-cli splice_signed $CHANNEL_ID $PSBT", + "```" + ], + "example_json_request": [ + { + "id": "example:splice_signed#1", + "method": "splice_signed", + "params": { + "channel_id": "5677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc", + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAAAAAAEQBAAAAAAM/AlsaWdodG5pbmcBCCvyYqqdIt0mAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oBDiBWd3IcNaQkoj1tzHyQkDblBa5oZQ4J1ZcztLfnMAOk3AEPBAEAAAABEAT9////ARNACI9TcWG+6uC9ElBFN3qhND7amsor/dtBhJ5ujEQAT/80548avrt7d7IJiOAaCNzzYLSXITdL2xjx6mhbBi9hTiEWkUUygSpECk12bHHNORk2lKNArhHgEuW6Gtnvum52ylMJAMLMqxcAAAAADPwJbGlnaHRuaW5nAQg5j4QWOQoUFAABAwhOfA0AAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4hB7nAxoROEqUxyWjlXFUHjsFtm/dr6SkP2H0cynK0g5oXCQDWuWnTBAAAAAz8CWxpZ2h0bmluZwEIxt4P7eqf3+QAAQMI4MgQAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQji6kH6aOXoAgA=" + } + } + ], + "example_json_response": [ + { + "tx": "020000000001025677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc0000000000000000005677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc0100000000fdffffff024e7c0d00000000002251207836355fdc8a82dc4cb00a772c5554151d06384a4dd65e8d3f68ac08566b84bee0c81000000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd0400473044022053269f3951a1fc942174ac0dde8462405a86c89b31b444890664ee9735872cff02204cd822c4456c15e90ad342b23e9bb252d383d4e17a8a04818c4919e4fd61efd80147304402205ac0787c79e74ebfa0eaf18964625c53eb672cc4bed2c65303bd9cc192dad6f902206c6c0cded47201dae0020f50a8998555e654d3420c64e801fc668238e3c1cdfa0147522102324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b2102e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5752ae0140088f537161beeae0bd125045377aa1343eda9aca2bfddb41849e6e8c44004fff34e78f1abebb7b77b20988e01a08dcf360b49721374bdb18f1ea685b062f614e6c000000", + "txid": "f00d5e230b401274c88d3e6205e2c6117028cb9878b7d2bc52b1441f0b589427" + } + ], + "author": [ + "Dusty <<@dusty_daemon>> is mainly responsible." + ], + "see_also": [ + "lightning-splice_init(7)", + "lightning-splice_update(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-splice_update.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.08", + "rpc": "splice_update", + "title": "Command to initiate a channel to a peer", + "warning": "experimental-splicing only", + "description": [ + "`splice_update` is a low level RPC command which updates the active channel splice associated with `channel_id`.", + "", + "`splice_update` must be called repeatidly until the result `commitments_secured` is `true`. Each time `splice_update` is called, it will return a new PSBT that may have changes. In the simplest case, you take the returned `psbt` and pass it back into `splice_update` for the incoming `psbt` field.", + "", + "For more complex use cases, you may modify the `psbt` both before calling `splice_update` and inbetween subsequent calls until `commitments_secured` is `true`. After which point you can no long make modifications to the PSBT (beyond signing, which comes later with `splice_signed`).", + "", + "Each `splice_update` result may include changes to the PSBT specified by your channel peer. You can review these changes between calls to `splice_update` to perform additional validation or strategy adjustment.", + "", + "Typically, `splice_update` will return `commitments_secured` true after one call but you should assume it will need multiple calls." + ], + "request": { + "required": [ + "channel_id", + "psbt" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "The channel id of the channel to be spliced." + ] + }, + "psbt": { + "type": "string", + "description": [ + "The base 64 encoded PSBT returned from `splice_init` with any changes added by the user." + ] + } + } + }, + "response": { + "required": [ + "psbt", + "commitments_secured" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "The (incomplete) PSBT of the splice transaction." + ] + }, + "commitments_secured": { + "type": "boolean", + "description": [ + "Whether or not the commitments were secured." + ] + } + } + }, + "example_usage": [ + "Here is an example way to call `splice_update`", + "", + "```shell", + "RESULT={\"commitments_secured\":false}", + "while [[ $(echo $RESULT | jq -r \".commitments_secured\") == \"false\" ]]", + "do", + " RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT)", + " PSBT=$(echo $RESULT | jq -r \".psbt\")", + " echo $RESULT", + "done", + "```", + "", + "Before each call to `splice_update` you have the opportunity to make additional changes.", + "", + "Here is a full example set of splice commands that will splice in 100,000 sats to the first channel that comes out of `listpeerchannels`. The example assumes you already have at least one confirmed channel.", + "", + "```shell", + "RESULT=$(lightning-cli listpeerchannels)", + "CHANNEL_ID=$(echo $RESULT| jq -r \".channels[0].channel_id\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli fundpsbt -k satoshi=100000sat feerate=urgent startweight=800 excess_as_change=true)", + "INITIALPSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli splice_init $CHANNEL_ID 100000 $INITIALPSBT)", + "PSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT={\"commitments_secured\":false}", + "while [[ $(echo $RESULT | jq -r \".commitments_secured\") == \"false\" ]]", + "do", + " RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT)", + " PSBT=$(echo $RESULT | jq -r \".psbt\")", + " echo $RESULT", + "done", + "", + "RESULT=$(lightning-cli signpsbt -k psbt=\"$PSBT\")", + "PSBT=$(echo $RESULT | jq -r \".signed_psbt\")", + "echo $RESULT", + "", + "lightning-cli splice_signed $CHANNEL_ID $PSBT", + "```" + ], + "example_json_request": [ + { + "id": "example:splice_update#1", + "method": "splice_update", + "params": { + "channel_id": "5677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc", + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEFR1IhAjJCZt6EA7OrFXoJ8feE1YevYYMcmYwVG8whu3TCsjFLIQLjvTgAmGbJ2o7EqpnMTqnGwN1G3xXGHvDOHycSkXFOV1KuAQ4gVndyHDWkJKI9bcx8kJA25QWuaGUOCdWXM7S35zADpNwBDwQAAAAAARAEAAAAAAz8CWxpZ2h0bmluZwEIK/Jiqp0i3SYAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAQAAAAEQBP3///8M/AlsaWdodG5pbmcBCDmPhBY5ChQUAAEDCE58DQAAAAAAAQQiUSB4NjVf3IqC3EywCncsVVQVHQY4Sk3WXo0/aKwIVmuEvgz8CWxpZ2h0bmluZwEIxt4P7eqf3+QAAQMIAAAAAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQji6kH6aOXoAgA=" + } + } + ], + "example_json_response": [ + { + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAAAAAAEQBAAAAAAM/AlsaWdodG5pbmcBCCvyYqqdIt0mAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oBDiBWd3IcNaQkoj1tzHyQkDblBa5oZQ4J1ZcztLfnMAOk3AEPBAEAAAABEAT9////DPwJbGlnaHRuaW5nAQg5j4QWOQoUFAABAwhOfA0AAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4M/AlsaWdodG5pbmcBCMbeD+3qn9/kAAEDCODIEAAAAAAAAQQiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQz8CWxpZ2h0bmluZwEI4upB+mjl6AIA", + "commitments_secured": true + } + ], + "author": [ + "Dusty <<@dusty_daemon>> is mainly responsible." + ], + "see_also": [ + "lightning-splice_init(7)", + "lightning-splice_signed(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-sql.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.02", + "rpc": "sql", + "title": "Command to do complex queries on list commands", + "description": [ + "The **sql** RPC command runs the given query across a sqlite3 database created from various list commands.", + "", + "When tables are accessed, it calls the below commands, so it's no faster than any other local access (though it goes to great length to cache `listnodes` and `listchannels`) which then processes the results.", + "", + "It is, however faster for remote access if the result of the query is much smaller than the list commands would be." + ], + "request": { + "required": [ + "query" + ], + "properties": { + "query": { + "type": "string", + "description": [ + "The standard sqlite3 query to run.", + "Note that queries like \"SELECT *\" are fragile, as columns will change across releases; see lightning-listsqlschemas(7)." + ] + } + } + }, + "response": { + "required": [ + "rows" + ], + "properties": { + "rows": { + "type": "array", + "items": { + "type": "array" + } + }, + "warning_db_failure": { + "type": "string", + "description": [ + "A message if the database encounters an error partway through." + ] + } + }, + "pre_return_value_notes": [ + "On success, an object containing **rows** is returned. It is an array. Each array entry contains an array of values, each an integer, real number, string or *null*, depending on the sqlite3 type.", + "", + "The object may contain **warning_db_failure** if the database fails partway through its operation." + ] + }, + "treatment_of_types": [ + "The following types are supported in schemas, and this shows how they are presented in the database. This matters: a JSON boolean is represented as an integer in the database, so a query will return 0 or 1, not true or false.", + "", + "* *hex*. A hex string.", + " * JSON: a string", + " * sqlite3: BLOB", + "", + "* *hash*/*secret*/*pubkey*/*txid*: just like *hex*.", + "", + "* *msat*/*integer*/*u64*/*u32*/*u16*/*u8*. Normal numbers.", + " * JSON: an unsigned integer", + " * sqlite3: INTEGER", + "", + "* *boolean*. True or false.", + " * JSON: literal **true** or **false**", + " * sqlite3: INTEGER", + "", + "* *number*. A floating point number (used for times in some places).", + " * JSON: number", + " * sqlite3: REAL", + "", + "* *string*. Text.", + " * JSON: string", + " * sqlite3: TEXT", + "", + "* *short_channel_id*. A short-channel-id of form 1x2x3.", + " * JSON: string", + " * sqlite3: TEXT" + ], + "permitted_sqlite3_functions": [ + "Writing to the database is not permitted, and limits are placed on various other query parameters.", + "", + "Additionally, only the following functions are allowed:", + "", + "* abs", + "* avg", + "* coalesce", + "* count", + "* hex", + "* quote", + "* length", + "* like", + "* lower", + "* upper", + "* min", + "* max", + "* sum", + "* total" + ], + "tables": [ + "Note that the first column of every table is a unique integer called `rowid`: this is used for related tables to refer to specific rows in their parent. sqlite3 usually has this as an implicit column, but we make it explicit as the implicit version is not allowed to be used as a foreign key.", + "", + "The following tables are currently supported:\n- `bkpr_accountevents` (see lightning-bkpr-listaccountevents(7))\n - `account` (type `string`, sqltype `TEXT`)\n - `type` (type `string`, sqltype `TEXT`)\n - `tag` (type `string`, sqltype `TEXT`)\n - `credit_msat` (type `msat`, sqltype `INTEGER`)\n - `debit_msat` (type `msat`, sqltype `INTEGER`)\n - `currency` (type `string`, sqltype `TEXT`)\n - `timestamp` (type `u32`, sqltype `INTEGER`)\n - `outpoint` (type `string`, sqltype `TEXT`)\n - `blockheight` (type `u32`, sqltype `INTEGER`)\n - `origin` (type `string`, sqltype `TEXT`)\n - `payment_id` (type `hex`, sqltype `BLOB`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `description` (type `string`, sqltype `TEXT`)\n - `fees_msat` (type `msat`, sqltype `INTEGER`)\n - `is_rebalance` (type `boolean`, sqltype `INTEGER`)\n - `part_id` (type `u32`, sqltype `INTEGER`)\n\n- `bkpr_income` (see lightning-bkpr-listincome(7))\n - `account` (type `string`, sqltype `TEXT`)\n - `tag` (type `string`, sqltype `TEXT`)\n - `credit_msat` (type `msat`, sqltype `INTEGER`)\n - `debit_msat` (type `msat`, sqltype `INTEGER`)\n - `currency` (type `string`, sqltype `TEXT`)\n - `timestamp` (type `u32`, sqltype `INTEGER`)\n - `description` (type `string`, sqltype `TEXT`)\n - `outpoint` (type `string`, sqltype `TEXT`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `payment_id` (type `hex`, sqltype `BLOB`)\n\n- `channels` indexed by `short_channel_id` (see lightning-listchannels(7))\n - `source` (type `pubkey`, sqltype `BLOB`)\n - `destination` (type `pubkey`, sqltype `BLOB`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `direction` (type `u32`, sqltype `INTEGER`)\n - `public` (type `boolean`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `message_flags` (type `u8`, sqltype `INTEGER`)\n - `channel_flags` (type `u8`, sqltype `INTEGER`)\n - `active` (type `boolean`, sqltype `INTEGER`)\n - `last_update` (type `u32`, sqltype `INTEGER`)\n - `base_fee_millisatoshi` (type `u32`, sqltype `INTEGER`)\n - `fee_per_millionth` (type `u32`, sqltype `INTEGER`)\n - `delay` (type `u32`, sqltype `INTEGER`)\n - `htlc_minimum_msat` (type `msat`, sqltype `INTEGER`)\n - `htlc_maximum_msat` (type `msat`, sqltype `INTEGER`)\n - `features` (type `hex`, sqltype `BLOB`)\n\n- `closedchannels` (see lightning-listclosedchannels(7))\n - `peer_id` (type `pubkey`, sqltype `BLOB`)\n - `channel_id` (type `hash`, sqltype `BLOB`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `opener` (type `string`, sqltype `TEXT`)\n - `closer` (type `string`, sqltype `TEXT`)\n - `private` (type `boolean`, sqltype `INTEGER`)\n - related table `closedchannels_channel_type_bits`, from JSON object `channel_type`\n - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `bits` (type `u32`, sqltype `INTEGER`)\n - related table `closedchannels_channel_type_names`, from JSON object `channel_type`\n - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `names` (type `string`, sqltype `TEXT`)\n - `total_local_commitments` (type `u64`, sqltype `INTEGER`)\n - `total_remote_commitments` (type `u64`, sqltype `INTEGER`)\n - `total_htlcs_sent` (type `u64`, sqltype `INTEGER`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `leased` (type `boolean`, sqltype `INTEGER`)\n - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`)\n - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`)\n - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`)\n - `total_msat` (type `msat`, sqltype `INTEGER`)\n - `final_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `min_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `max_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `last_commitment_txid` (type `hash`, sqltype `BLOB`)\n - `last_commitment_fee_msat` (type `msat`, sqltype `INTEGER`)\n - `close_cause` (type `string`, sqltype `TEXT`)\n - `last_stable_connection` (type `u64`, sqltype `INTEGER`)\n\n- `forwards` indexed by `in_channel and in_htlc_id` (see lightning-listforwards(7))\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `in_channel` (type `short_channel_id`, sqltype `TEXT`)\n - `in_htlc_id` (type `u64`, sqltype `INTEGER`)\n - `in_msat` (type `msat`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `received_time` (type `number`, sqltype `REAL`)\n - `out_channel` (type `short_channel_id`, sqltype `TEXT`)\n - `out_htlc_id` (type `u64`, sqltype `INTEGER`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `style` (type `string`, sqltype `TEXT`)\n - `fee_msat` (type `msat`, sqltype `INTEGER`)\n - `out_msat` (type `msat`, sqltype `INTEGER`)\n - `resolved_time` (type `number`, sqltype `REAL`)\n - `failcode` (type `u32`, sqltype `INTEGER`)\n - `failreason` (type `string`, sqltype `TEXT`)\n\n- `htlcs` indexed by `short_channel_id and id` (see lightning-listhtlcs(7))\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `expiry` (type `u32`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `direction` (type `string`, sqltype `TEXT`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `state` (type `string`, sqltype `TEXT`)\n\n- `invoices` indexed by `payment_hash` (see lightning-listinvoices(7))\n - `label` (type `string`, sqltype `TEXT`)\n - `description` (type `string`, sqltype `TEXT`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `status` (type `string`, sqltype `TEXT`)\n - `expires_at` (type `u64`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `bolt11` (type `string`, sqltype `TEXT`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `local_offer_id` (type `hash`, sqltype `BLOB`)\n - `invreq_payer_note` (type `string`, sqltype `TEXT`)\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `pay_index` (type `u64`, sqltype `INTEGER`)\n - `amount_received_msat` (type `msat`, sqltype `INTEGER`)\n - `paid_at` (type `u64`, sqltype `INTEGER`)\n - `paid_outpoint_txid` (type `txid`, sqltype `BLOB`, from JSON object `paid_outpoint`)\n - `paid_outpoint_outnum` (type `u32`, sqltype `INTEGER`, from JSON object `paid_outpoint`)\n - `payment_preimage` (type `secret`, sqltype `BLOB`)\n\n- `nodes` indexed by `nodeid` (see lightning-listnodes(7))\n - `nodeid` (type `pubkey`, sqltype `BLOB`)\n - `last_timestamp` (type `u32`, sqltype `INTEGER`)\n - `alias` (type `string`, sqltype `TEXT`)\n - `color` (type `hex`, sqltype `BLOB`)\n - `features` (type `hex`, sqltype `BLOB`)\n - related table `nodes_addresses`\n - `row` (reference to `nodes.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `type` (type `string`, sqltype `TEXT`)\n - `port` (type `u16`, sqltype `INTEGER`)\n - `address` (type `string`, sqltype `TEXT`)\n - `option_will_fund_lease_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_lease_fee_basis` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_funding_weight` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_channel_fee_max_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_channel_fee_max_proportional_thousandths` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_compact_lease` (type `hex`, sqltype `BLOB`, from JSON object `option_will_fund`)\n\n- `offers` indexed by `offer_id` (see lightning-listoffers(7))\n - `offer_id` (type `hash`, sqltype `BLOB`)\n - `active` (type `boolean`, sqltype `INTEGER`)\n - `single_use` (type `boolean`, sqltype `INTEGER`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `used` (type `boolean`, sqltype `INTEGER`)\n - `label` (type `string`, sqltype `TEXT`)\n\n- `peerchannels` indexed by `peer_id` (see lightning-listpeerchannels(7))\n - `peer_id` (type `pubkey`, sqltype `BLOB`)\n - `peer_connected` (type `boolean`, sqltype `INTEGER`)\n - `reestablished` (type `boolean`, sqltype `INTEGER`)\n - `state` (type `string`, sqltype `TEXT`)\n - `scratch_txid` (type `txid`, sqltype `BLOB`)\n - related table `peerchannels_channel_type_bits`, from JSON object `channel_type`\n - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `bits` (type `u32`, sqltype `INTEGER`)\n - related table `peerchannels_channel_type_names`, from JSON object `channel_type`\n - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `names` (type `string`, sqltype `TEXT`)\n - `local_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `local`)\n - `local_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `local`)\n - `remote_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `remote`)\n - `ignore_fee_limits` (type `boolean`, sqltype `INTEGER`)\n - `lost_state` (type `boolean`, sqltype `INTEGER`)\n - `feerate_perkw` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`)\n - `feerate_perkb` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`)\n - `owner` (type `string`, sqltype `TEXT`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `channel_id` (type `hash`, sqltype `BLOB`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `initial_feerate` (type `string`, sqltype `TEXT`)\n - `last_feerate` (type `string`, sqltype `TEXT`)\n - `next_feerate` (type `string`, sqltype `TEXT`)\n - `next_fee_step` (type `u32`, sqltype `INTEGER`)\n - related table `peerchannels_inflight`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `feerate` (type `string`, sqltype `TEXT`)\n - `total_funding_msat` (type `msat`, sqltype `INTEGER`)\n - `splice_amount` (type `integer`, sqltype `INTEGER`)\n - `our_funding_msat` (type `msat`, sqltype `INTEGER`)\n - `scratch_txid` (type `txid`, sqltype `BLOB`)\n - `close_to` (type `hex`, sqltype `BLOB`)\n - `private` (type `boolean`, sqltype `INTEGER`)\n - `opener` (type `string`, sqltype `TEXT`)\n - `closer` (type `string`, sqltype `TEXT`)\n - related table `peerchannels_features`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `features` (type `string`, sqltype `TEXT`)\n - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_local_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_remote_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `min_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `max_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `total_msat` (type `msat`, sqltype `INTEGER`)\n - `fee_base_msat` (type `msat`, sqltype `INTEGER`)\n - `fee_proportional_millionths` (type `u32`, sqltype `INTEGER`)\n - `dust_limit_msat` (type `msat`, sqltype `INTEGER`)\n - `max_total_htlc_in_msat` (type `msat`, sqltype `INTEGER`)\n - `their_reserve_msat` (type `msat`, sqltype `INTEGER`)\n - `our_reserve_msat` (type `msat`, sqltype `INTEGER`)\n - `spendable_msat` (type `msat`, sqltype `INTEGER`)\n - `receivable_msat` (type `msat`, sqltype `INTEGER`)\n - `minimum_htlc_in_msat` (type `msat`, sqltype `INTEGER`)\n - `minimum_htlc_out_msat` (type `msat`, sqltype `INTEGER`)\n - `maximum_htlc_out_msat` (type `msat`, sqltype `INTEGER`)\n - `their_to_self_delay` (type `u32`, sqltype `INTEGER`)\n - `our_to_self_delay` (type `u32`, sqltype `INTEGER`)\n - `max_accepted_htlcs` (type `u32`, sqltype `INTEGER`)\n - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - related table `peerchannels_state_changes`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `timestamp` (type `string`, sqltype `TEXT`)\n - `old_state` (type `string`, sqltype `TEXT`)\n - `new_state` (type `string`, sqltype `TEXT`)\n - `cause` (type `string`, sqltype `TEXT`)\n - `message` (type `string`, sqltype `TEXT`)\n - related table `peerchannels_status`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `in_payments_offered` (type `u64`, sqltype `INTEGER`)\n - `in_offered_msat` (type `msat`, sqltype `INTEGER`)\n - `in_payments_fulfilled` (type `u64`, sqltype `INTEGER`)\n - `in_fulfilled_msat` (type `msat`, sqltype `INTEGER`)\n - `out_payments_offered` (type `u64`, sqltype `INTEGER`)\n - `out_offered_msat` (type `msat`, sqltype `INTEGER`)\n - `out_payments_fulfilled` (type `u64`, sqltype `INTEGER`)\n - `out_fulfilled_msat` (type `msat`, sqltype `INTEGER`)\n - `last_stable_connection` (type `u64`, sqltype `INTEGER`)\n - related table `peerchannels_htlcs`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `direction` (type `string`, sqltype `TEXT`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `expiry` (type `u32`, sqltype `INTEGER`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `local_trimmed` (type `boolean`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `state` (type `string`, sqltype `TEXT`)\n - `close_to_addr` (type `string`, sqltype `TEXT`)\n - `last_tx_fee_msat` (type `msat`, sqltype `INTEGER`)\n - `direction` (type `u32`, sqltype `INTEGER`)\n\n- `peers` indexed by `id` (see lightning-listpeers(7))\n - `id` (type `pubkey`, sqltype `BLOB`)\n - `connected` (type `boolean`, sqltype `INTEGER`)\n - `num_channels` (type `u32`, sqltype `INTEGER`)\n - related table `peers_netaddr`\n - `row` (reference to `peers.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `netaddr` (type `string`, sqltype `TEXT`)\n - `remote_addr` (type `string`, sqltype `TEXT`)\n - `features` (type `hex`, sqltype `BLOB`)\n\n- `sendpays` indexed by `payment_hash` (see lightning-listsendpays(7))\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `groupid` (type `u64`, sqltype `INTEGER`)\n - `partid` (type `u64`, sqltype `INTEGER`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `destination` (type `pubkey`, sqltype `BLOB`)\n - `created_at` (type `u64`, sqltype `INTEGER`)\n - `amount_sent_msat` (type `msat`, sqltype `INTEGER`)\n - `label` (type `string`, sqltype `TEXT`)\n - `bolt11` (type `string`, sqltype `TEXT`)\n - `description` (type `string`, sqltype `TEXT`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `payment_preimage` (type `secret`, sqltype `BLOB`)\n - `erroronion` (type `hex`, sqltype `BLOB`)\n\n- `transactions` indexed by `hash` (see lightning-listtransactions(7))\n - `hash` (type `txid`, sqltype `BLOB`)\n - `rawtx` (type `hex`, sqltype `BLOB`)\n - `blockheight` (type `u32`, sqltype `INTEGER`)\n - `txindex` (type `u32`, sqltype `INTEGER`)\n - `locktime` (type `u32`, sqltype `INTEGER`)\n - `version` (type `u32`, sqltype `INTEGER`)\n - related table `transactions_inputs`\n - `row` (reference to `transactions.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`)\n - `sequence` (type `u32`, sqltype `INTEGER`)\n - related table `transactions_outputs`\n - `row` (reference to `transactions.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `scriptPubKey` (type `hex`, sqltype `BLOB`)" + ], + "errors": [ + "On failure, an error is returned." + ], + "example_usage": [ + "Here are some example using lightning-cli. Note that you may need to use `-o` if you use queries which contain `=` (which make lightning-cli(1) default to keyword style):", + "", + "A simple peer selection query:", + "", + "```shell", + "$ lightning-cli sql \"SELECT id FROM peers\"", + "{", + " \"rows\": [", + " [", + " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\"", + " ]", + " ]", + "}", + "```", + "", + "A statement containing using `=` needs `-o`:", + "", + "```shell", + "$ lightning-cli sql -o \"SELECT node_id,last_timestamp FROM nodes WHERE last_timestamp>=1669578892\"", + "{", + " \"rows\": [", + " [", + " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\",", + " 1669601603", + " ]", + " ]", + "}", + "```", + "", + "If you want to compare a BLOB column, `x'hex'` or `X'hex'` are needed:", + "", + "```shell", + "$ lightning-cli sql -o \"SELECT nodeid FROM nodes WHERE nodeid != x'03c9d25b6c0ce4bde5ad97d7ab83f00ae8bd3800a98ccbee36f3c3205315147de1';\"", + "{", + " \"rows\": [", + " [", + " \"0214739d625944f8fdc0da9d2ef44dbd7af58443685e494117b51410c5c3ff973a\"", + " ],", + " [", + " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\"", + " ]", + " ]", + "}", + "$ lightning-cli sql -o \"SELECT nodeid FROM nodes WHERE nodeid IN (x'03c9d25b6c0ce4bde5ad97d7ab83f00ae8bd3800a98ccbee36f3c3205315147de1', x'02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00')\"", + "{", + " \"rows\": [", + " [", + " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\"", + " ],", + " [", + " \"03c9d25b6c0ce4bde5ad97d7ab83f00ae8bd3800a98ccbee36f3c3205315147de1\"", + " ]", + " ]", + "}", + "```", + "", + "Related tables are usually referenced by JOIN:", + "", + "```shell", + "$ lightning-cli sql -o \"SELECT nodeid, alias, nodes_addresses.type, nodes_addresses.port, nodes_addresses.address FROM nodes INNER JOIN nodes_addresses ON nodes_addresses.row = nodes.rowid\"", + "{", + " \"rows\": [", + " [", + " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\",", + " \"YELLOWWATCH-22.11rc2-31-gcd7593b\",", + " \"dns\",", + " 7272,", + " \"localhost\"", + " ],", + " [", + " \"0214739d625944f8fdc0da9d2ef44dbd7af58443685e494117b51410c5c3ff973a\",", + " \"HOPPINGSQUIRREL-1rc2-31-gcd7593b\",", + " \"dns\",", + " 7171,", + " \"localhost\"", + " ]", + " ]", + "}", + "```", + "", + "Simple function usage, in this case COUNT. Strings inside arrays need \", and ' to protect them from the shell:", + "", + "```shell", + "$ lightning-cli sql 'SELECT COUNT(*) FROM nodes\"", + "{", + " \"rows\": [", + " [", + " 3", + " ]", + " ]", + "}", + "```" + ], + "example_json_request": [ + { + "id": "example:sql#1", + "method": "sql", + "params": [ + "SELECT * FROM forwards;" + ] + }, + { + "id": "example:sql#2", + "method": "sql", + "params": [ + "SELECT * from peerchannels_features" + ] + } + ], + "example_json_response": [ + { + "rows": [] + }, + { + "rows": [ + [ + 6, + 1, + 0, + "option_static_remotekey" + ], + [ + 7, + 1, + 1, + "option_anchors_zero_fee_htlc_tx" + ], + [ + 16, + 11, + 0, + "option_static_remotekey" + ], + [ + 17, + 11, + 1, + "option_anchors_zero_fee_htlc_tx" + ] + ] + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listtransactions(7)", + "lightning-listchannels(7)", + "lightning-listpeers(7)", + "lightning-listnodes(7)", + "lightning-listforwards(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-staticbackup.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "staticbackup", + "title": "Command for deriving getting SCB of all the existing channels", + "description": [ + "The **staticbackup** RPC command returns an object with SCB of all the channels in an array." + ], + "request": { + "required": [], + "properties": {} + }, + "response": { + "required": [ + "scb" + ], + "properties": { + "scb": { + "type": "array", + "items": { + "type": "hex", + "description": [ + "SCB of a channel in TLV format." + ] + } + } + } + }, + "example_json_request": [ + { + "id": "example:staticbackup#1", + "method": "staticbackup", + "params": "{}" + } + ], + "example_json_response": [ + { + "scb": [ + "0000000000000001c707da9b230e1655b0a6c082b8daf4fa44d9d1f68163ed4d531d45cf453dc651022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d5900017f000001b2e3c707da9b230e1655b0a6c082b8daf4fa44d9d1f68163ed4d531d45cf453dc6510000000000000000000186a000021000" + ] + } + ], + "author": [ + "Aditya <> is mainly responsible." + ], + "see_also": [ + "lightning-getsharedsecret(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-stop.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "stop", + "title": "Command to shutdown the Core Lightning node.", + "description": [ + "The **stop** is a RPC command to shut off the Core Lightning node." + ], + "request": { + "required": [], + "properties": {} + }, + "response": { + "required": [ + "result" + ], + "properties": { + "result": { + "type": "string", + "added": "v24.05", + "enum": [ + "Shutdown complete" + ] + } + } + }, + "example_json_request": [ + { + "id": "example:stop#1", + "method": "stop", + "params": {} + } + ], + "example_json_response": [ + { + "result": "Shutdown complete" + } + ], + "author": [ + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-txdiscard.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "txdiscard", + "title": "Abandon a transaction from txprepare, release inputs", + "description": [ + "The **txdiscard** RPC command releases inputs which were reserved for use of the *txid* from lightning-txprepare(7)." + ], + "request": { + "required": [ + "txid" + ], + "properties": { + "txid": { + "type": "txid", + "description": [ + "The transaction id, inputs should be unreseverd from." + ] + } + } + }, + "response": { + "required": [ + "unsigned_tx", + "txid" + ], + "properties": { + "unsigned_tx": { + "type": "hex", + "description": [ + "The unsigned transaction." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The transaction id of *unsigned_tx*." + ] + } + }, + "post_return_value_notes": [ + "If there is no matching *txid*, an error is reported. Note that this may happen due to incorrect usage, such as **txdiscard** or **txsend** already being called for *txid*." + ] + }, + "errors": [ + "The following error codes may occur:", + "", + "- -1: An unknown *txid*." + ], + "example_json_request": [ + { + "id": "example:txdiscard#1", + "method": "txdiscard", + "params": { + "txid": "6e680cb76077f11c838cc7aee0c0aa360f9857f00856bb1614025a1af53739fc" + } + } + ], + "example_json_response": [ + { + "unsigned_tx": "020000000142dc00d81359c3a551e170e3bf5262fa9cacc2eb2e283a10e579491cd86dce4b0000000000fdffffff02ffffff00000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd42839800000000002251207836355fdc8a82dc4cb00a772c5554151d06384a4dd65e8d3f68ac08566b84be66000000", + "txid": "6e680cb76077f11c838cc7aee0c0aa360f9857f00856bb1614025a1af53739fc" + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-txprepare(7)", + "lightning-txsend(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-txprepare.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "txprepare", + "title": "Command to prepare to withdraw funds from the internal wallet", + "description": [ + "The **txprepare** RPC command creates an unsigned transaction which spends funds from Core Lightning's internal wallet to the outputs specified in *outputs*.", + "", + "**txprepare** is similar to the first part of a **withdraw** command, but supports multiple outputs and uses *outputs* as parameter. The second part is provided by **txsend**." + ], + "request": { + "required": [ + "outputs" + ], + "properties": { + "outputs": { + "type": "array", + "description": [ + "Format is like: [{destination1: amount1}, {destination2: amount2}] or [{destination: *all*}]. It supports any number of **confirmed** outputs." + ], + "items": { + "type": "outputdesc" + } + }, + "feerate": { + "type": "feerate", + "description": [ + "Used for the transaction as initial feerate." + ], + "default": "*normal*" + }, + "minconf": { + "type": "u32", + "description": [ + "The minimum number of confirmations that used outputs should have." + ], + "default": 1 + }, + "utxos": { + "type": "array", + "description": [ + "To be used to fund the transaction, as an array of `txid:vout`. These must be drawn from the node's available UTXO set." + ], + "items": { + "type": "outpoint" + } + } + } + }, + "response": { + "required": [ + "psbt", + "unsigned_tx", + "txid" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "The PSBT representing the unsigned transaction." + ] + }, + "unsigned_tx": { + "type": "hex", + "description": [ + "The unsigned transaction." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The transaction id of *unsigned_tx*; you hand this to lightning-txsend(7) or lightning-txdiscard(7), as the inputs of this transaction are reserved." + ] + } + } + }, + "errors": [ + "On failure, an error is reported and the transaction is not created.", + "", + "- -1: Catchall nonspecific error.", + "- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.", + "- 302: The dust limit is not met." + ], + "example_json_request": [ + { + "id": "example:txprepare#1", + "method": "txprepare", + "params": { + "outputs": [ + { + "bcrt1qtwxd8wg5eanumk86vfeujvp48hfkgannf77evggzct048wggsrxsum2pmm": 16777215 + } + ], + "feerate": null, + "minconf": null, + "utxos": null + } + }, + { + "id": "example:txprepare#2", + "method": "txprepare", + "params": { + "outputs": [ + { + "bcrt1qyhu7rxj3rrlcj84jtzp2mk9d89xm9v2rx4d4h8au830axugx6mmqsuplng": "100000sat" + } + ], + "feerate": null, + "minconf": null, + "utxos": null + } + } + ], + "example_json_response": [ + { + "unsigned_tx": "020000000142dc00d81359c3a551e170e3bf5262fa9cacc2eb2e283a10e579491cd86dce4b0000000000fdffffff02ffffff00000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd42839800000000002251207836355fdc8a82dc4cb00a772c5554151d06384a4dd65e8d3f68ac08566b84be66000000", + "txid": "6e680cb76077f11c838cc7aee0c0aa360f9857f00856bb1614025a1af53739fc", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABATRHoQ9tEMHRHpf06v5uTEdjdMk1rccIaA6MNGMipNQWAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFLnqitWTi465LGxeucwoSAj16NGbAkcwRAIgVtOsUaQaPgH86aW6e6qmJa1xVb8KWvc+HALGosqVVmQCIFi4JU8Gy+vl2a2/frY+71hitYIBB/tjsRP7fpgb8b9TASECHUIV5q1r2ownjOlAFPQASTlZxxNgBvi5O3hCRvajwdJlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIELcANgTWcOlUeFw479SYvqcrMLrLig6EOV5SRzYbc5LAQ8EAAAAAAEQBP3///8AAQMI////AAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAAEDCEKDmAAAAAAAAQQiUSB4NjVf3IqC3EywCncsVVQVHQY4Sk3WXo0/aKwIVmuEvgA=" + }, + { + "unsigned_tx": "0200000001a91077a134fb9fe4a8d13a482b718368bfd9ce3eff61ff7d96549480a1f97dca0100000000fdffffff02a08601000000000022002025f9e19a5118ff891eb25882add8ad394db2b143355b5b9fbc3c5fd37106d6f66173010000000000225120a2a01c7965289eee56b5cfcddb9856c70fa476c264d21f711c6a69af776ae40366000000", + "txid": "f11d436054607603e903fc69c4bd9b39ce97421341c7cf814ad025cb5bf59c1c", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABAYZ4QwAgPq6Os8kk073f5Yx4T9LXYfbOjAdkzMXfuBQdAAAAAAD9////AjPkAioBAAAAFgAUeOeqzyifepeJAMCl4vnnJ/TRptRADQMAAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgYBFwmqWCrVkxxZ0/tte3z4lIem0L7MkhXzGAOvBWa6YCIFx7H4zOzxjixlZMi0DYYbIEflDjYHJXLfN1wVcXYuekASEDgztw/3Rks6vKGYMXJ83VEvQcNIjg3rJW6KdxEh26uwplAAAAAQEfQA0DAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIKkQd6E0+5/kqNE6SCtxg2i/2c4+/2H/fZZUlICh+X3KAQ8EAQAAAAEQBP3///8AAQMIoIYBAAAAAAABBCIAICX54ZpRGP+JHrJYgq3YrTlNsrFDNVtbn7w8X9NxBtb2AAEDCGFzAQAAAAAAAQQiUSCioBx5ZSie7la1z83bmFbHD6R2wmTSH3Ecammvd2rkAwA=" + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-withdraw(7)", + "lightning-txsend(7)", + "lightning-txdiscard(7)", + "lightning-feerates(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-txsend.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "txsend", + "title": "Command to sign and send transaction from txprepare", + "description": [ + "The **txsend** RPC command signs and broadcasts a transaction created by *txprepare* RPC command." + ], + "request": { + "required": [ + "txid" + ], + "properties": { + "txid": { + "type": "txid", + "description": [ + "The transaction id of the transaction created by `txprepare` rpc command." + ] + } + } + }, + "response": { + "required": [ + "psbt", + "tx", + "txid" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "The completed PSBT representing the signed transaction." + ] + }, + "tx": { + "type": "hex", + "description": [ + "The fully signed transaction." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The transaction id of *tx*." + ] + } + } + }, + "errors": [ + "On failure, an error is reported (from bitcoind), and the inputs from the transaction are unreserved.", + "", + "- -1: Catchall nonspecific error." + ], + "example_json_request": [ + { + "id": "example:txsend#1", + "method": "txsend", + "params": { + "txid": "c9f59ba6bda8e095bb43ecabfa37de8d5194e5c839b6b63be4e29bceaae483ce" + } + } + ], + "example_json_response": [ + { + "tx": "020000000142dc00d81359c3a551e170e3bf5262fa9cacc2eb2e283a10e579491cd86dce4b0000000000fdffffff020000000100000000220020b636f07026ea64952ece5b7620a9337d9ac2321c796a499260994d1b373667504183980000000000225120754a77b503fcba0fd80f0a1a8226ed6764ff9a9d9bb61b485d40d4c9f4be245966000000", + "txid": "c9f59ba6bda8e095bb43ecabfa37de8d5194e5c839b6b63be4e29bceaae483ce", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABATRHoQ9tEMHRHpf06v5uTEdjdMk1rccIaA6MNGMipNQWAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFLnqitWTi465LGxeucwoSAj16NGbAkcwRAIgVtOsUaQaPgH86aW6e6qmJa1xVb8KWvc+HALGosqVVmQCIFi4JU8Gy+vl2a2/frY+71hitYIBB/tjsRP7fpgb8b9TASECHUIV5q1r2ownjOlAFPQASTlZxxNgBvi5O3hCRvajwdJlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZSICA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPRzBEAiBp/HPhg1ObOXqTr5rIjUYLMspGLz+sk1pjD9pjRFzf3wIgWycOB/dQPzwZAK3OXYs269h8o85ucDpdVhH4AyX69a0BIgYD10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8IAfrZCgAAAAABDiBC3ADYE1nDpVHhcOO/UmL6nKzC6y4oOhDleUkc2G3OSwEPBAAAAAABEAT9////AAEDCAAAAAEAAAAAAQQiACC2NvBwJupklS7OW3YgqTN9msIyHHlqSZJgmU0bNzZnUAABAwhBg5gAAAAAAAEEIlEgdUp3tQP8ug/YDwoagibtZ2T/mp2bthtIXUDUyfS+JFkhBycqmiXx/+1S+rBKLMiK6rE1tTcjhWqPFIHCZBf4ipIuCQDVXEk5CwAAAAA=" + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-txprepare(7)", + "lightning-txdiscard(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-unreserveinputs.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "unreserveinputs", + "title": "Release reserved UTXOs", + "description": [ + "The **unreserveinputs** RPC command releases (or reduces reservation) on UTXOs which were previously marked as reserved, generally by lightning-reserveinputs(7)." + ], + "request": { + "required": [ + "psbt" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "Inputs to unreserve are the inputs specified in the passed-in *psbt*." + ] + }, + "reserve": { + "type": "u32", + "description": [ + "The number of blocks to decrease reservation by." + ], + "default": 72 + } + } + }, + "response": { + "required": [ + "reservations" + ], + "properties": { + "reservations": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "txid", + "vout", + "was_reserved", + "reserved" + ], + "properties": { + "txid": { + "type": "txid", + "description": [ + "The transaction id." + ] + }, + "vout": { + "type": "u32", + "description": [ + "The output number which was reserved." + ] + }, + "was_reserved": { + "type": "boolean", + "description": [ + "Whether the input was already reserved (usually `true`)." + ] + }, + "reserved": { + "type": "boolean", + "description": [ + "Whether the input is now reserved (may still be `true` if it was reserved for a long time)." + ] + } + }, + "allOf": [ + { + "if": { + "additionalProperties": true, + "properties": { + "reserved": { + "enum": [ + true + ] + } + } + }, + "then": { + "required": [ + "reserved_to_block" + ], + "properties": { + "txid": {}, + "vout": {}, + "was_reserved": {}, + "reserved": {}, + "reserved_to_block": { + "type": "u32", + "description": [ + "What blockheight the reservation will expire." + ] + } + } + } + } + ] + } + } + } + }, + "errors": [ + "On failure, an error is reported and no UTXOs are unreserved.", + "", + "- -32602: Invalid parameter, i.e. an unparseable PSBT." + ], + "example_json_request": [ + { + "id": "example:unreserveinputs#1", + "method": "unreserveinputs", + "params": { + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABAXyy20ynmOFyRbegGyApk50yNIAb4C+RKV5c2n5VKL3lAAAAAAD9////Akf0EAAAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WUs/fQpAQAAABYAFN9HebR4q6498ytdeRKjC64CkCOMAkcwRAIgSTJCpWVH1FLZYPdwFe7gZckxCtk+AxPp20KUVKqPIdUCIA3hkoUco68vffiwt6TrE3KgX09JE9m7PDUUgrHQANMRASEDBOBlCza/8qXE5q8uJ+OWsKscDERWfdA+LLCa/lwMH0BlAAAAAQEfR/QQAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZSICA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPRzBEAiBKjSasyN29ODqXSemEQCZfRIvbJP8thKRBrd4e+NLEMQIgMGNz3+DWDnLmjnIDCaVcC7BKxuycwvtJq1qlKFtTaXcBIgYD10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8IAfrZCgAAAAABDiAoXS6QUlCcOApG/j+hr4OhNt0tT4GvCzI6z16Hepi7OwEPBAAAAAABEAT9////AAEDCCN6CAAAAAAAAQQWABQfJ4Qjje0sa2yGBz++6jkM2hGRmAz8CWxpZ2h0bmluZwQCAAEAAQMIinkIAAAAAAABBCJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aIQeRRTKBKkQKTXZscc05GTaUo0CuEeAS5boa2e+6bnbKUwkAwsyrFwIAAAAA", + "reserve": 200 + } + }, + { + "id": "example:unreserveinputs#2", + "method": "unreserveinputs", + "params": { + "psbt": "cHNidP8BAF4CAAAAAVa79WPJoiYrzo/RgzIAn5HanoBFZo0vZvEjxPAVwLv4AAAAAAD9////AXzpHAAAAAAAIlEgBRjpLNlOD2LAbxJt/5i5q+ebfthFoVbVJFZ44mVUR11mAAAAAAEA3gIAAAAAAQENwcSElLyC0jcwUHiODBhtapHyzIdiwytOGiu/Raf4BwAAAAAA/f///wKAhB4AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFl82znKQEAAAAWABQyIWyAI6LDf6dJ58BDPdkh+PWUZwJHMEQCIGiJFhVi/d/Hz19Cz48uHTjhgBJ6WAlgl/bLVS7A6VtxAiAwlb7xYzIM4uopFvMnpOmGIOp3+upOPPF2F8VaB8U/HQEhA6BAjey7RADP4ifoh2VXhX7QXkh+sZqozv1EPuU5TxZmZQAAAAEBH4CEHgAAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WUAAA==", + "reserve": null + } + } + ], + "example_json_response": [ + { + "reservations": [ + { + "txid": "3bbb987a875ecf3a320baf814f2ddd36a183afa13ffe460a389c5052902e5d28", + "vout": 0, + "was_reserved": true, + "reserved": false + } + ] + }, + { + "reservations": [] + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-unreserveinputs(7)", + "lightning-signpsbt(7)", + "lightning-sendpsbt(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-upgradewallet.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "upgradewallet", + "title": "Command to spend all P2SH-wrapped inputs into a Native Segwit output", + "description": [ + "`upgradewallet` is a convenience RPC which will spend all p2sh-wrapped Segwit deposits in a wallet into a single Native Segwit P2WPKH address." + ], + "request": { + "required": [], + "properties": { + "feerate": { + "type": "feerate", + "description": [ + "Feerate for the upgrade transaction." + ], + "added": "v23.02", + "default": "*opening*" + }, + "reservedok": { + "type": "boolean", + "description": [ + "Tells the wallet to include all P2SH-wrapped inputs, including reserved ones." + ], + "added": "v23.02" + } + } + }, + "response": { + "required": [ + "upgraded_outs" + ], + "properties": { + "upgraded_outs": { + "type": "u64", + "description": [ + "Count of spent/upgraded UTXOs." + ], + "added": "v23.02" + }, + "psbt": { + "type": "string", + "description": [ + "The PSBT that was finalized and sent." + ], + "added": "v23.02" + }, + "tx": { + "type": "hex", + "description": [ + "The raw transaction which was sent." + ], + "added": "v23.02" + }, + "txid": { + "type": "txid", + "description": [ + "The txid of the **tx**." + ], + "added": "v23.02" + } + } + }, + "example_usage": [ + "The caller is trying to buy a liquidity ad but the command keeps failing. They have funds in their wallet, but they're all P2SH-wrapped outputs.", + "", + "The caller can call `upgradewallet` to convert their funds to native segwit outputs, which are valid for liquidity ad buys." + ], + "example_json_request": [ + { + "id": "example:upgradewallet#1", + "method": "upgradewallet", + "params": "{}" + }, + { + "id": "example:upgradewallet#2", + "method": "upgradewallet", + "params": { + "feerate": "urgent", + "reservedok": true + } + } + ], + "example_json_response": [ + { + "upgraded_outs": 0 + }, + { + "tx": "0200000001c08ce0a9ea1e00179ea603cb8619ec2a2df990ef931e1ccd87fa7a0e271ed8370100000000fdffffff013514310100000000225120888ab14b6e1655d1d00039b836d70b66e3351543ab6cd2f94166255f3d5e6cb5cf000000", + "txid": "de5f1d6f0b2f95cfe5cfbf8cc33bd3f279a8f800ee0efc27bbfafb2b6ead9560", + "psbt": "cHNidP8BAgQCAAAAAQMEzwAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDgAgAAAAABAZRZ0m0kaJA+ubJw1eYurGROu1BYc0i7l9xbyG06R6uZAQAAAAD9////AmQtPCgBAAAAF6kUnoGu9IUv0FGnzol3Lb/BNBNkOViHAC0xAQAAAAAXqRRlVyjzbP420BqlDTI2cERp+EpVQIcCRzBEAiBliJpjBsipwFgsLZMlzbESZ6hMTh+pgKQlXUIL0nLb3wIga/xwr/IJgEc7Ie6ApS4aVDr9xr1TZ3wj+8bRvI6WqScBIQPgYuc48PzUufScX6A6YOsdmJwn+bAQjLZ/g9jhQYduHM4AAAABASAALTEBAAAAABepFGVXKPNs/jbQGqUNMjZwRGn4SlVAhyICArnAxoROEqUxyWjlXFUHjsFtm/dr6SkP2H0cynK0g5oXRzBEAiBlTUNYfS5n5rGRVmoNb0z3AMGJjHijwpXROGIVxfoBnQIgeTx32KY3CcfYTYzXUIRQAMUQB7rlPWRptWMDD3UttkcBAQQWABTWuWnTbf/a2YaRk/Zj7kgN/cc0iCIGArnAxoROEqUxyWjlXFUHjsFtm/dr6SkP2H0cynK0g5oXCNa5adMAAAAAAQ4gwIzgqeoeABeepgPLhhnsKi35kO+THhzNh/p6Dice2DcBDwQBAAAAARAE/f///wABAwg1FDEBAAAAAAEEIlEgiIqxS24WVdHQADm4NtcLZuM1FUOrbNL5QWYlXz1ebLUhByjMj8l44gnxaV+ltWVQYdsaqyMRtSQXaUW/EBXvLUuJCQCftnv8BwAAAAA=", + "upgraded_outs": 1 + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-utxopsbt(7)", + "lightning-reserveinputs(7)", + "lightning-unreserveinputs(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-utxopsbt.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "utxopsbt", + "title": "Command to populate PSBT inputs from given UTXOs", + "description": [ + "*utxopsbt* is a low-level RPC command which creates a PSBT using unreserved inputs in the wallet, optionally reserving them as well.", + "", + "It deliberately mirrors the parameters and output of lightning-fundpsbt(7) except instead of an optional *minconf* parameter to select unreserved outputs from the wallet, it takes a compulsory list of outputs to use." + ], + "request": { + "required": [ + "satoshi", + "feerate", + "startweight", + "utxos" + ], + "properties": { + "satoshi": { + "type": "msat_or_all", + "description": [ + "The minimum satoshi value of the output(s) needed (or the string `all` meaning use all unreserved inputs). If a value, it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*." + ] + }, + "feerate": { + "type": "feerate", + "description": [ + "Used for the transaction as initial feerate." + ], + "default": "*normal*" + }, + "startweight": { + "type": "u32", + "description": [ + "The weight of the transaction before *fundpsbt* has added any inputs." + ] + }, + "utxos": { + "type": "array", + "description": [ + "An array of `txid:vout`, each of which must be reserved or available." + ], + "items": { + "type": "outpoint" + } + }, + "reserve": { + "type": "u32", + "description": [ + "If not zero, then *reserveinputs* is called (successfully, with *exclusive* true) on the returned PSBT for this number of blocks." + ], + "default": "72 blocks" + }, + "reservedok": { + "type": "boolean", + "description": [ + "If set to true, it will also fail if any of the *utxos* are already reserved." + ], + "default": "false" + }, + "locktime": { + "type": "u32", + "description": [ + "If not set, it is set to a recent block height." + ] + }, + "min_witness_weight": { + "type": "u32", + "description": [ + "Minimum weight to use for a UTXO's witness. If the actual witness weight is greater than the provided minimum, the actual witness weight will be used." + ] + }, + "excess_as_change": { + "type": "boolean", + "description": [ + "Flag to add a change output for the excess sats." + ] + }, + "opening_anchor_channel": { + "added": "v23.08", + "type": "boolean", + "description": [ + "To signel that it needs emergency reserve for anchors so that we can lowball our commitment tx fees, and min-emergency-msat for reserving some sats for closing anchor channels." + ] + } + } + }, + "response": { + "required": [ + "psbt", + "feerate_per_kw", + "estimated_final_weight", + "excess_msat" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "Unsigned PSBT which fulfills the parameters given." + ] + }, + "feerate_per_kw": { + "type": "u32", + "description": [ + "The feerate used to create the PSBT, in satoshis-per-kiloweight." + ] + }, + "estimated_final_weight": { + "type": "u32", + "description": [ + "The estimated weight of the transaction once fully signed." + ] + }, + "excess_msat": { + "type": "msat", + "description": [ + "The amount above *satoshi* which is available. This could be zero, or dust; it will be zero if *change_outnum* is also returned." + ] + }, + "change_outnum": { + "type": "u32", + "description": [ + "The 0-based output number where change was placed (only if parameter *excess_as_change* was true and there was sufficient funds)." + ] + }, + "reservations": { + "type": "array", + "description": [ + "If *reserve* was true or a non-zero number, just as per lightning- reserveinputs(7)." + ], + "items": { + "type": "object", + "required": [ + "txid", + "vout", + "was_reserved", + "reserved", + "reserved_to_block" + ], + "additionalProperties": false, + "properties": { + "txid": { + "type": "txid", + "description": [ + "The txid of the transaction." + ] + }, + "vout": { + "type": "u32", + "description": [ + "The 0-based output number." + ] + }, + "was_reserved": { + "type": "boolean", + "description": [ + "Whether this output was previously reserved." + ] + }, + "reserved": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Whether this output is now reserved." + ] + }, + "reserved_to_block": { + "type": "u32", + "description": [ + "The blockheight the reservation will expire." + ] + } + } + } + } + }, + "post_return_value_notes": [ + "On success, returns the *psbt* it created, containing the inputs, *feerate_per_kw* showing the exact numeric feerate it used, *estimated_final_weight* for the estimated weight of the transaction once fully signed, and *excess_msat* containing the amount above *satoshi* which is available. This could be zero, or dust. If *satoshi* was `all`, then *excess_msat* is the entire amount once fees are subtracted for the weights of the inputs and *startweight*.", + "", + "If *reserve* was *true* or a non-zero number, then a *reservations* array is returned, exactly like *reserveinputs*.", + "", + "If *excess_as_change* is true and the excess is enough to cover an additional output above the `dust_limit`, then an output is added to the PSBT for the excess amount. The *excess_msat* will be zero. A *change_outnum* will be returned with the index of the change output." + ] + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 301: Insufficient UTXOs to meet *satoshi* value." + ], + "example_json_request": [ + { + "id": "example:utxopsbt#1", + "method": "utxopsbt", + "params": { + "satoshi": 0, + "feerate": "253perkw", + "startweight": 0, + "utxos": [ + "d82a99192fb333106ea8d08f5231ed45f2ed5b1ef9eb81b0fef8f9ea354d2637:1" + ], + "reserve": 0, + "reservedok": true, + "locktime": null, + "min_witness_weight": null, + "excess_as_change": false + } + }, + { + "id": "example:utxopsbt#2", + "method": "utxopsbt", + "params": { + "satoshi": 1000000, + "feerate": "7500perkw", + "startweight": 0, + "utxos": [ + "2fc3b9f8d4aed120f6d9a6f206f07c35ef4d518ec0305d1d974873d256e38ca7:1", + "2f669f6a605ee5c7ddd2abb753bc64b1a90bd1b7448264f5d78a7ca823c00a1b:1" + ], + "reserve": null, + "reservedok": true, + "locktime": null, + "min_witness_weight": null, + "excess_as_change": false + } + } + ], + "example_json_response": [ + { + "psbt": "cHNidP8BADMCAAAAATcmTTXq+fj+sIHr+R5b7fJF7TFSj9CobhAzsy8ZmSrYAQAAAAD9////AGYAAAAAAQDeAgAAAAABAWQACJva49ga8OCYXvPRWQRhoXndrJykwjgXbwT251dEAAAAAAD9////AiOI9ikBAAAAFgAU3gClv/YpAKRpfDuiFu6mIL2E4+5QaQ8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgUXIQFs7oRkorVThUn3sLj7WI7g8c8RHai4ChoCvIkWsCICp1CqHl4BlMJCKFHRWHXhhekaj0r1EFSNrh8UnvysQPASEDqHIAEdaH3H6pb3VJzbJNDG4lL8PTfsheL+h2p6baK3JlAAAAAQEfUGkPAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=", + "feerate_per_kw": 253, + "estimated_final_weight": 271, + "excess_msat": 1009932000 + }, + { + "psbt": "cHNidP8BAFwCAAAAAqeM41bSc0iXHV0wwI5RTe81fPAG8qbZ9iDRrtT4ucMvAQAAAAD9////GwrAI6h8itf1ZIJEt9ELqbFkvFO3q9Ldx+VeYGqfZi8BAAAAAP3///8AZgAAAAABAN4CAAAAAAEBEaK0TQ97IsrzuO1gLt+vYbvLBG90NrCOZp7SCgrRknYAAAAAAP3///8CM6/2KQEAAAAWABQ1B/KkIVbg7yFRcCEN/VOptfOX/EBCDwAAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WUCRzBEAiA1oI1us81XEa/DRlvcP2qnbWLsV5pZcRfvj9MLyT202gIgb7noMqHYWMmm7H7VNEfWa29jjtuV9yrrSc9ui11ECQ0BIQKhZOHR4gFKMu2EKKgZ/7qnhzq9PvhtnAW2sxPZ4c9RIWUAAAABAR9AQg8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAAEA3gIAAAAAAQGnjONW0nNIlx1dMMCOUU3vNXzwBvKm2fYg0a7U+LnDLwAAAAAA/f///wJmbOcpAQAAABYAFOwPo5eUrDF7UgZBFQLRHOeX6PiGQEIPAAAAAAAWABTCzKsXHCpb6dq1LsQbglhjAkxUZgJHMEQCICgjGlauGj2eiMS4MWUK6zAWqMe1OuidQR+Hy9ZgSTuzAiA8JTb9OrLqS3hiWtT+TQ/NBsKJ2hhHLDaKUUNdgi4OkAEhA9g3oH5ejmGIqUY2ZWxc8YWF2+T+XpE/6oC40Cx3+e97ZQAAAAEBH0BCDwAAAAAAFgAUwsyrFxwqW+natS7EG4JYYwJMVGYA", + "feerate_per_kw": 7500, + "estimated_final_weight": 542, + "excess_msat": 995935000, + "reservations": [ + { + "txid": "2fc3b9f8d4aed120f6d9a6f206f07c35ef4d518ec0305d1d974873d256e38ca7", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "2f669f6a605ee5c7ddd2abb753bc64b1a90bd1b7448264f5d78a7ca823c00a1b", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + } + ] + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-fundpsbt(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-wait.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.08", + "rpc": "wait", + "title": "Command to wait for creations, changes and deletions", + "description": [ + "The **wait** RPC command returns once the index given by *indexname* in *subsystem* reaches or exceeds *nextvalue*. All indexes start at 0, when no events have happened (**wait** with a *nextvalue* of 0 is a way of getting the current index, though naturally this is racy!)." + ], + "request": { + "required": [ + "subsystem", + "indexname", + "nextvalue" + ], + "properties": { + "subsystem": { + "type": "string", + "description": [ + "The subsystem to get the next index value from.", + " `invoices`: corresponding to `listinvoices` (added in *v23.08*).", + " `sendpays`: corresponding to `listsendpays` (added in *v23.11*).", + " `forwards`: corresponding to `listforwards` (added in *v23.11*)." + ], + "enum": [ + "invoices", + "forwards", + "sendpays" + ] + }, + "indexname": { + "type": "string", + "description": [ + "The name of the index to get the next value for.", + " `created` is incremented by one for every new object.", + " `updated` is incremented by one every time an object is changed.", + " `deleted` is incremented by one every time an object is deleted." + ], + "enum": [ + "created", + "updated", + "deleted" + ] + }, + "nextvalue": { + "type": "u64", + "description": [ + "The next value of the index." + ] + } + } + }, + "response": { + "required": [ + "subsystem" + ], + "properties": { + "subsystem": { + "type": "string", + "enum": [ + "invoices", + "forwards", + "sendpays" + ] + }, + "created": { + "type": "u64", + "description": [ + "1-based index indicating order entry was created." + ] + }, + "updated": { + "type": "u64", + "description": [ + "1-based index indicating order entry was updated." + ] + }, + "deleted": { + "type": "u64", + "description": [ + "1-based index indicating order entry was deleted." + ] + }, + "details": {} + }, + "allOf": [ + { + "if": { + "additionalProperties": true, + "properties": { + "subsystem": { + "type": "string", + "enum": [ + "invoices" + ] + } + } + }, + "then": { + "additionalProperties": false, + "properties": { + "subsystem": {}, + "created": {}, + "updated": {}, + "deleted": {}, + "details": { + "type": "object", + "additionalProperties": false, + "properties": { + "status": { + "type": "string", + "enum": [ + "unpaid", + "paid", + "expired" + ], + "description": [ + "Whether it's paid, unpaid or unpayable." + ] + }, + "label": { + "type": "string", + "description": [ + "Unique label supplied at invoice creation." + ] + }, + "description": { + "type": "string", + "description": [ + "Description used in the invoice." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The BOLT11 string." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The BOLT12 string." + ] + } + } + } + } + } + }, + { + "if": { + "additionalProperties": true, + "properties": { + "subsystem": { + "type": "string", + "enum": [ + "forwards" + ] + } + } + }, + "then": { + "additionalProperties": false, + "properties": { + "subsystem": {}, + "created": {}, + "updated": {}, + "deleted": {}, + "details": { + "type": "object", + "additionalProperties": false, + "properties": { + "status": { + "type": "string", + "enum": [ + "offered", + "settled", + "failed", + "local_failed" + ], + "description": [ + "Still ongoing, completed, failed locally, or failed after forwarding." + ] + }, + "in_channel": { + "type": "short_channel_id", + "description": [ + "Unique label supplied at invoice creation." + ] + }, + "in_htlc_id": { + "type": "u64", + "description": [ + "The unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11)." + ] + }, + "in_msat": { + "type": "msat", + "description": [ + "The value of the incoming HTLC." + ] + }, + "out_channel": { + "type": "short_channel_id", + "description": [ + "The channel that the HTLC (trying to) forward to." + ] + } + } + } + } + } + }, + { + "if": { + "additionalProperties": true, + "properties": { + "subsystem": { + "type": "string", + "enum": [ + "sendpays" + ] + } + } + }, + "then": { + "additionalProperties": false, + "properties": { + "subsystem": {}, + "created": {}, + "updated": {}, + "deleted": {}, + "details": { + "type": "object", + "additionalProperties": false, + "properties": { + "status": { + "type": "string", + "enum": [ + "pending", + "failed", + "complete" + ], + "description": [ + "Status of the payment." + ] + }, + "partid": { + "type": "u64", + "description": [ + "Part number (for multiple parts to a single payment)." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + } + } + } + } + } + } + ] + }, + "reliability": [ + "Indices can go forward by more than one; in particlar, if multiple objects were created and the one deleted, you could see this effect. Similarly, there are some places (e.g. invoice expiration) where we can update multiple entries at once.", + "", + "Indices only monotoncally increase." + ], + "usage": [ + "The **wait** RPC is used to track changes in the system. Consider tracking invoices being paid or expiring. The simplest (and inefficient method) would be:", + "1. Call `listinvoices` to get the current state of all invoices, and remember the highest `updated_index`. Say it was 5.", + "2. Call `wait invoices updated 6`.", + "3. When it returns, call `listinvoices` again to see what changed.", + "", + "This is obviously inefficient, so there are two optimizations:", + "1. Call `listinvoices` with `index=updated` and `start=6` to only see invoices with `updated_index` greater than or equal to 6.", + "2. `wait` itself may also return some limited subset of fields from the list command (it can't do this in all cases); for `invoices` this is `label` and `status`, allowing many callers to avoid the `listinvoices` call." + ], + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong." + ], + "example_json_request": [ + { + "id": "example:wait#1", + "method": "wait", + "params": { + "subsystem": "invoices", + "indexname": "created", + "nextvalue": 1 + } + }, + { + "id": "example:wait#2", + "method": "wait", + "params": { + "subsystem": "invoices", + "indexname": "updated", + "nextvalue": 2 + } + }, + { + "id": "example:wait#3", + "method": "wait", + "params": { + "subsystem": "sendpays", + "indexname": "updated", + "nextvalue": 2 + } + } + ], + "example_json_response": [ + { + "subsystem": "invoices", + "created": 1, + "details": { + "status": "unpaid", + "label": "invlabel", + "bolt11": "lnbcrt420p1pjmxtevsp5d8c6gnaj8lyjy2qly783vklda9dfaqeyzyc37agxxp8h3uguv8pqpp5w6lhwxhqnuew4hle5h7qwjm27zz784mvsrzhmayhscy5t2hy5c4qdqvd9h8ver9wd3sxqyjw5qcqp99qxpqysgq09gxhjhwu9u3z6dlt5ln5f4g8zl78wz4pgh0am3kz54m9lllhqckf4gmhmt2ftrclq5x62zkqmggc7y0ju0ghdfwjz8hyd8l5cqvemgpyyhm6w" + } + }, + { + "subsystem": "invoices", + "updated": 2, + "details": { + "status": "expired" + } + }, + { + "subsystem": "sendpays", + "updated": 2, + "details": { + "status": "complete", + "partid": 0, + "groupid": 1, + "payment_hash": "220dcfcf43e1fab3ce30f70eb943c3ce962393f5a65ced52d749e324b443d19e" + } + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listinvoice(7)", + "lightning-listforwards(7)", + "lightning-listsendpays(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-waitanyinvoice.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "waitanyinvoice", + "title": "Command for waiting for payments", + "description": [ + "The **waitanyinvoice** RPC command waits until an invoice is paid, then returns a single entry as per **listinvoice**. It will not return for any invoices paid prior to or including the *lastpay_index*.", + "", + "This is usually called iteratively: once with no arguments, then repeatedly with the returned *pay_index* entry. This ensures that no paid invoice is missed. The *pay_index* is a monotonically-increasing number assigned to an invoice when it gets paid. The first valid *pay_index* is 1." + ], + "request": { + "required": [], + "properties": { + "lastpay_index": { + "type": "u64", + "description": [ + "Ignores any invoices paid prior to or including this index. 0 is equivalent to not specifying and negative value is invalid." + ] + }, + "timeout": { + "type": "u64", + "description": [ + "If specified, wait at most that number of seconds, which must be an integer. If the specified *timeout* is reached, this command will return with an error. You can specify this to 0 so that **waitanyinvoice** will return immediately with an error if no pending invoice is available yet. If unspecified, this command will wait indefinitely." + ] + } + } + }, + "response": { + "required": [ + "label", + "description", + "payment_hash", + "status", + "created_index", + "expires_at" + ], + "properties": { + "label": { + "type": "string", + "description": [ + "Unique label supplied at invoice creation." + ] + }, + "description": { + "type": "string", + "description": [ + "Description used in the invoice." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "paid", + "expired" + ], + "description": [ + "Whether it's paid or expired." + ] + }, + "expires_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when it will become / became unpayable." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount required to pay this invoice." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The BOLT11 string (always present unless *bolt12* is)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The BOLT12 string (always present unless *bolt11* is)." + ] + }, + "created_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was created in." + ] + }, + "updated_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was changed (only present if it has changed since creation)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "paid" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "pay_index", + "amount_received_msat", + "paid_at", + "payment_preimage" + ], + "properties": { + "label": {}, + "description": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "bolt11": {}, + "bolt12": {}, + "expires_at": {}, + "created_index": {}, + "updated_index": {}, + "pay_index": { + "type": "u64", + "description": [ + "Unique incrementing index for this payment." + ] + }, + "amount_received_msat": { + "type": "msat", + "description": [ + "The amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)." + ] + }, + "paid_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when it was paid." + ] + }, + "paid_outpoint": { + "type": "object", + "description": [ + "Outpoint this invoice was paid with." + ], + "added": "v23.11", + "additionalProperties": false, + "required": [ + "txid", + "outnum" + ], + "properties": { + "txid": { + "added": "v23.11", + "type": "txid", + "description": [ + "ID of the transaction that paid the invoice." + ] + }, + "outnum": { + "added": "v23.11", + "type": "u32", + "description": [ + "The 0-based output number of the transaction that paid the invoice." + ] + } + } + }, + "payment_preimage": { + "type": "secret", + "description": [ + "Proof of payment." + ] + } + } + }, + "else": { + "additionalProperties": false, + "properties": { + "label": {}, + "description": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "bolt11": {}, + "bolt12": {}, + "created_index": {}, + "updated_index": {}, + "expires_at": {} + } + } + } + ] + }, + "errors": [ + "The following error codes may occur:", + "", + "- 904: The *timeout* was reached without an invoice being paid." + ], + "example_json_request": [ + { + "id": "example:waitanyinvoice#1", + "method": "waitanyinvoice", + "params": { + "lastpay_index": null, + "timeout": null + } + }, + { + "id": "example:waitanyinvoice#2", + "method": "waitanyinvoice", + "params": { + "lastpay_index": 3, + "timeout": 0 + } + } + ], + "example_json_response": [ + { + "label": "inv1", + "bolt11": "lnbcrt10n1pjmxtsxsp56sn02x8lccjfsvunnhz5858zuyxztug9luy226w4qsmfm4r8pkcspp5gw5r0dw99yf3zqxrg24l8g9m9hun9cu06ldg4rga8s9t9kv8z45sdq8d9h8vvgxqyjw5qcqp99qxpqysgqv537uh2sx8ch640mf4t43t8qjtpg3z7gukgm07tlyq986m7nvsnxkapg37z4vsxtl4thfqzc64anqr83geygkc2xaftxgr97dltqfjqpe3mhja", + "payment_hash": "43a837b5c529131100c342abf3a0bb2df932e38fd7da8a8d1d3c0ab2d9871569", + "amount_msat": 1000, + "status": "paid", + "pay_index": 1, + "amount_received_msat": 1000, + "paid_at": 1706241546, + "payment_preimage": "a0c668998de14b975f33e1060b3efd7efc0bde784ac266ab667a1b2fddab3cd1", + "description": [ + "Inv1." + ], + "expires_at": 1706846342, + "created_index": 1, + "updated_index": 1 + }, + { + "label": "inv4", + "bolt11": "lnbcrt10n1pja0tkmsp57j4z9zwvdsyh57unh3da7aac5z20clfnrwy5nqm6wujaelduw23qpp580mdrwakz9xewc2vhvpucset9gjkgdvyhw7h9frcy2d6p2lwdw2qdq8d9h8vdqxqyjw5qcqp99qxpqysgqtgyzhtxs3p2dyk8wk9q028033303702d2hml4frmu38qe79mrkgzgxvyjmq2q4nhjgcuz3uhmlda3jnhf9w6mj8mj97pkgnda9l5kdcqsdgewf", + "payment_hash": "3bf6d1bbb6114d97614cbb03cc432b2a25643584bbbd72a478229ba0abee6b94", + "amount_msat": 1000, + "status": "paid", + "pay_index": 4, + "amount_received_msat": 1000, + "paid_at": 1708633825, + "payment_preimage": "77336a342dde76050c7ee7fc18599e407dfc1edad3c784ba68e9603004365b94", + "description": "inv4", + "expires_at": 1709238619, + "created_index": 4, + "updated_index": 4 + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-waitinvoice(7)", + "lightning-listinvoice(7)", + "lightning-delinvoice(7)", + "lightning-invoice(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-waitblockheight.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "waitblockheight", + "title": "Command for waiting for blocks on the blockchain", + "description": [ + "The **waitblockheight** RPC command waits until the blockchain has reached the specified *blockheight*." + ], + "request": { + "required": [ + "blockheight" + ], + "properties": { + "blockheight": { + "type": "u32", + "description": [ + "Current blockheight of the blockchain if the value is greater than this number. If it is a present or past block height, then the command returns immediately." + ] + }, + "timeout": { + "type": "u32", + "description": [ + "Only wait up to specified seconds." + ], + "default": "60 seconds" + } + } + }, + "response": { + "required": [ + "blockheight" + ], + "properties": { + "blockheight": { + "type": "u32", + "description": [ + "The current block height (>= *blockheight* parameter)." + ] + } + }, + "post_return_value_notes": [ + "If *timeout* seconds is reached without the specified blockheight being reached, this command will fail with a code of `2000`." + ] + }, + "errors": [ + "The following error codes may occur:", + "", + "- 2000: Timed out." + ], + "example_json_request": [ + { + "id": "example:waitblockheight#1", + "method": "waitblockheight", + "params": { + "blockheight": 99, + "timeout": null + } + }, + { + "id": "example:waitblockheight#2", + "method": "waitblockheight", + "params": { + "blockheight": 103, + "timeout": 600 + } + } + ], + "example_json_response": [ + { + "blockheight": 99 + }, + { + "blockheight": 103 + } + ], + "author": [ + "ZmnSCPxj <> is mainly responsible." + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-waitinvoice.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "waitinvoice", + "title": "Command for waiting for specific payment", + "description": [ + "The **waitinvoice** RPC command waits until a specific invoice is paid, then returns that single entry as per **listinvoice**." + ], + "request": { + "required": [ + "label" + ], + "properties": { + "label": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "description": [ + "Unique label of the invoice waiting to be paid." + ] + } + } + }, + "response": { + "required": [ + "label", + "description", + "payment_hash", + "status", + "created_index", + "expires_at" + ], + "properties": { + "label": { + "type": "string", + "description": [ + "Unique label supplied at invoice creation." + ] + }, + "description": { + "type": "string", + "description": [ + "Description used in the invoice." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "paid", + "expired" + ], + "description": [ + "Whether it's paid or expired." + ] + }, + "expires_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when it will become / became unpayable." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount required to pay this invoice." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The BOLT11 string (always present unless *bolt12* is)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The BOLT12 string (always present unless *bolt11* is)." + ] + }, + "created_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was created in." + ] + }, + "updated_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was changed (only present if it has changed since creation)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "paid" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "pay_index", + "amount_received_msat", + "paid_at", + "payment_preimage" + ], + "properties": { + "label": {}, + "description": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "bolt11": {}, + "bolt12": {}, + "expires_at": {}, + "created_index": {}, + "updated_index": {}, + "pay_index": { + "type": "u64", + "description": [ + "Unique incrementing index for this payment." + ] + }, + "amount_received_msat": { + "type": "msat", + "description": [ + "The amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)." + ] + }, + "paid_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when it was paid." + ] + }, + "paid_outpoint": { + "type": "object", + "description": [ + "Outpoint this invoice was paid with." + ], + "added": "v23.11", + "additionalProperties": false, + "required": [ + "txid", + "outnum" + ], + "properties": { + "txid": { + "added": "v23.11", + "type": "txid", + "description": [ + "ID of the transaction that paid the invoice." + ] + }, + "outnum": { + "added": "v23.11", + "type": "u32", + "description": [ + "The 0-based output number of the transaction that paid the invoice." + ] + } + } + }, + "payment_preimage": { + "type": "secret", + "description": [ + "Proof of payment." + ] + } + } + }, + "else": { + "additionalProperties": false, + "properties": { + "label": {}, + "description": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "bolt11": {}, + "bolt12": {}, + "created_index": {}, + "updated_index": {}, + "expires_at": {} + } + } + } + ] + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: If the invoice is deleted while unpaid, or the invoice does not exist.", + "- 903: If the invoice expires before being paid, or is already expired." + ], + "example_json_request": [ + { + "id": "example:waitinvoice#1", + "method": "waitinvoice", + "params": { + "label": "inv2" + } + } + ], + "example_json_response": [ + { + "label": "inv2", + "bolt11": "lnbcrt10n1pjmxtwjsp5mzvdu6v8hqsf2tlj0nlyks23afqp7ejs444syjxf74p60ztmld8qpp5q4ayz5pys3t0yj0dmkmh7ctarkv9z434paz4u9rdwnj4f43thhaqdq8d9h8vvsxqyjw5qcqp99qxpqysgqn0055ttns6pafsxh6xuqce6e4vz8gtxlzqx0l9d9f5crmqx4jymh4zy9jdaszm0dj89sq39fvhpwcs626dt0n3gw8kassfdehp5sy3sq7fzy3w", + "payment_hash": "057a4150248456f249edddb77f617d1d985156350f455e146d74e554d62bbdfa", + "amount_msat": 1000, + "status": "paid", + "pay_index": 1, + "amount_received_msat": 1000, + "paid_at": 1706241494, + "payment_preimage": "34ccd37cc85e067cb376f9ea8c70d70469f58bf296f2566ed9ad4dfb70971a26", + "description": [ + "Inv2." + ], + "expires_at": 1706846290, + "created_index": 2, + "updated_index": 1 + } + ], + "author": [ + "Christian Decker <> is mainly responsible." + ], + "see_also": [ + "lightning-waitanyinvoice(7)", + "lightning-listinvoice(7)", + "lightning-delinvoice(7)", + "lightning-invoice(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-waitsendpay.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "waitsendpay", + "title": "Command for sending a payment via a route", + "description": [ + "The **waitsendpay** RPC command polls or waits for the status of an outgoing payment that was initiated by a previous **sendpay** invocation.", + "", + "If the payment completed with success, this command returns with success. Otherwise, if the payment completed with failure, this command returns an error." + ], + "request": { + "required": [ + "payment_hash" + ], + "properties": { + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage*." + ] + }, + "timeout": { + "type": "u32", + "description": [ + "A timeout in seconds, for this RPC command to return. If the *timeout* is provided and the given amount of time passes without the payment definitely succeeding or definitely failing, this command returns with a 200 error code (payment still in progress). If *timeout* is not provided this call will wait indefinitely. Indicating a *timeout* of 0 effectively makes this call a pollable query of the status of the payment." + ] + }, + "partid": { + "type": "u64", + "description": [ + "Unique ID within this (multi-part) payment. It must match that of the **sendpay** command." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Grouping key to disambiguate multiple attempts to pay the same payment_hash." + ] + } + }, + "pairedWith": [ + [ + "partid", + "groupid" + ] + ] + }, + "response": { + "required": [ + "id", + "created_index", + "payment_hash", + "status", + "created_at", + "amount_sent_msat" + ], + "properties": { + "created_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was created in." + ] + }, + "id": { + "type": "u64", + "description": [ + "Old synonym for created_index." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "complete" + ], + "description": [ + "Status of the payment." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount delivered to destination (if known)." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment if known." + ] + }, + "created_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "updated_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was changed (only present if it has changed since creation)." + ] + }, + "completed_at": { + "type": "number", + "description": [ + "The UNIX timestamp showing when this payment was completed." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "The amount sent." + ] + }, + "label": { + "type": "string", + "description": [ + "The label, if given to sendpay." + ] + }, + "partid": { + "type": "u64", + "description": [ + "The *partid*, if given to sendpay." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string (if pay supplied one)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string (if supplied for pay: **experimental-offers** only)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "complete" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "payment_preimage" + ], + "properties": { + "id": {}, + "created_index": {}, + "updated_index": {}, + "groupid": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "destination": {}, + "created_at": {}, + "completed_at": {}, + "msatoshi_sent": {}, + "amount_sent_msat": {}, + "label": {}, + "partid": {}, + "bolt11": {}, + "bolt12": {}, + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash**." + ] + } + } + } + } + ] + }, + "errors": [ + "On error, and even if the error occurred from a node other than the final destination, the route table will no longer be updated. Use the *exclude* parameter of the `getroute` command to ignore the failing route.", + "", + "- -1: Catchall nonspecific error.", + "- 200: Timed out before the payment could complete.", + "- 202: Unparseable onion reply. The *data* field of the error will have an *onionreply* field, a hex string representation of the raw onion reply.", + "- 203: Permanent failure at destination. The *data* field of the error will be routing failure object.", + "- 204: Failure along route; retry a different route. The *data* field of the error will be routing failure object.", + "- 208: A payment for *payment_hash* was never made and there is nothing to wait for.", + "- 209: The payment already failed, but the reason for failure was not stored. This should only occur when querying failed payments on very old databases.", + "", + "A routing failure object has the fields below:", + "", + "*erring_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on.", + "*erring_node*: The hex string of the pubkey id of the node that reported the error.", + "*erring_channel*: The short channel ID of the channel that has the error (or the final channel if the destination raised the error).", + "*erring_direction*: The direction of traversing the *erring_channel*:", + "*failcode*: The failure code, as per BOLT #4.", + "*failcodename*: The human-readable name corresponding to *failcode*, if known." + ], + "example_json_request": [ + { + "id": "example:waitsendpay#1", + "method": "waitsendpay", + "params": { + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "timeout": null, + "partid": null, + "groupid": null + } + } + ], + "example_json_response": [ + { + "created_index": 1, + "id": 1, + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "groupid": 1, + "updated_index": 1, + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount_msat": 11000000, + "amount_sent_msat": 11000000, + "created_at": 1706152930, + "completed_at": 1706152933, + "status": "complete", + "payment_preimage": "af7ba559629f719c04c43a82767fe3622790a539164d6270db07f765203e574b", + "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk" + } + ], + "author": [ + "ZmnSCPxj <> is mainly responsible." + ], + "see_also": [ + "lightning-sendpay(7)", + "lightning-pay(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-withdraw.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "withdraw", + "title": "Command for withdrawing funds from the internal wallet", + "description": [ + "The **withdraw** RPC command sends funds from Core Lightning's internal wallet to the address specified in *destination*." + ], + "request": { + "required": [ + "destination", + "satoshi" + ], + "properties": { + "destination": { + "type": "string", + "description": [ + "Any Bitcoin accepted type, including bech32." + ] + }, + "satoshi": { + "type": "msat_or_all", + "description": [ + "The amount to be withdrawn from the internal wallet (expressed, as name suggests, in satoshi). The string *all* can be used to specify withdrawal of all available funds (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*." + ] + }, + "feerate": { + "type": "feerate", + "description": [ + "Used for the withdrawal as initial feerate." + ], + "default": "*normal*" + }, + "minconf": { + "type": "u16", + "description": [ + "Minimum number of confirmations that used outputs should have." + ], + "default": 1 + }, + "utxos": { + "type": "array", + "description": [ + "Specifies the utxos to be used to be withdrawn from, as an array of `txid:vout`. These must be drawn from the node's available UTXO set." + ], + "items": { + "type": "outpoint" + } + } + } + }, + "response": { + "required": [ + "psbt", + "tx", + "txid" + ], + "properties": { + "tx": { + "type": "hex", + "description": [ + "The fully signed bitcoin transaction." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The transaction id of *tx*." + ] + }, + "psbt": { + "type": "string", + "description": [ + "The PSBT representing the unsigned transaction." + ] + } + } + }, + "errors": [ + "On failure, an error is reported and the withdrawal transaction is not created.", + "", + "- -1: Catchall nonspecific error.", + "- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.", + "- 302: The dust limit is not met.", + "- 313: The `min-emergency-msat` reserve not be preserved (and we have anchor channels)." + ], + "example_json_request": [ + { + "id": "example:withdraw#1", + "method": "withdraw", + "params": { + "destination": "bcrt1qjc7j2l5es4haw35c9jzm8dfm763ng5djp8f0s0", + "satoshi": 555555, + "feerate": null, + "minconf": null, + "utxos": null + } + }, + { + "id": "example:withdraw#2", + "method": "withdraw", + "params": { + "destination": "bcrt1q66ukn5mdllddnp53j0mx8mjgph7uwdygn0uy45", + "satoshi": "all", + "feerate": "20000perkb", + "minconf": 0, + "utxos": [ + "218390859cf94d869e33f69161f4187a98f691afe868c20811528f589e90a61f:1" + ] + } + } + ], + "example_json_response": [ + { + "tx": "0200000001ef28647baa13cc4c03b8a58c8bd08b69de434c22ff591eb68171ae992e3d816d0000000000fdffffff02237a080000000000160014963d257e99856fd746982c85b3b53bf6a33451b24d6808000000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a66000000", + "txid": "ccb97d7dc695cabb78b217c0b27d7d00d2941966199480e6443e0680d24d69eb", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABAWPCRda9hy4QKqUEmtb7gK7SAqzh1xBP8nZ7PCj+7+JDAAAAAAD9////Akf0EAAAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WUs/fQpAQAAABYAFOIj6yaI/g85utJBtkPPdK1X59cfAkcwRAIgH7J57HuUTpnCbDrDqE8W7ryuCXk+i/TszQ/NF55lWncCIDeN4y+EzIDP3l2XO5/wjk98krYqnzvEhrStk+0+fTowASEC6Ng5r5KTNIXBRRvjivsd8SKnHF59r/ViDj2+CLJVb75lAAAAAQEfR/QQAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZSICA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPRzBEAiBY0urYSHLnnXaAJH7yaGfvGmm+VuNCNIBhQaJU6iDNEgIgA7EASW+V00Su+lRQAE3Qbe4wavLq7l6Jn2vR+6Snyd0BIgYD10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8IAfrZCgAAAAABDiDvKGR7qhPMTAO4pYyL0Itp3kNMIv9ZHraBca6ZLj2BbQEPBAAAAAABEAT9////AAEDCCN6CAAAAAAAAQQWABSWPSV+mYVv10aYLIWztTv2ozRRsgz8CWxpZ2h0bmluZwQCAAEAAQMITWgIAAAAAAABBCJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aIQeRRTKBKkQKTXZscc05GTaUo0CuEeAS5boa2e+6bnbKUwkAwsyrFwIAAAAA" + }, + { + "tx": "02000000011fa6909e588f521108c268e8af91f6987a18f46191f6339e864df99c859083210100000000fdffffff0158070f0000000000160014d6b969d36dffdad9869193f663ee480dfdc7348867000000", + "txid": "ad9a712a201214c68c39ca5be68c9d153d1cac91e540d88aa3207b241e23acf8", + "psbt": "cHNidP8BAgQCAAAAAQMEZwAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQD9ZQECAAAAAAEBVa+m1d1amChv4Dwq1rVoS4KSm0BUUnVa3fUYcB3dH9oAAAAAAP////8CECcAAAAAAAAiUSBXeaBg8gDUDo+HGkDrkWFMxb+m0KX4UuBTQAp/7/hhUOEPDwAAAAAAIlEg7tdFgE2peEzCA/Vj76mf+lT98BsTe8lk5jwxJAcP++YEAEcwRAIgPsWO/4IxeW6OclDdXVnwL99X7B18sRlxgFqyvUAzN7gCIGOQOq0wZ6bV+wdYQP+9sH8IkfmqWZbQRRDkZEgfcprMAUcwRAIgb5/dI4+uVhluQjSA2q/3oAGxZd4vYzQWexfmcRQML7ECIFfgRwCaHYdyu5/H5moOPlfQlLc2gPgB6bgtfNSfRA6jAUdSIQIyQmbehAOzqxV6CfH3hNWHr2GDHJmMFRvMIbt0wrIxSyEC4704AJhmydqOxKqZzE6pxsDdRt8Vxh7wzh8nEpFxTldSrgAAAAABASvhDw8AAAAAACJRIO7XRYBNqXhMwgP1Y++pn/pU/fAbE3vJZOY8MSQHD/vmAQ4gH6aQnliPUhEIwmjor5H2mHoY9GGR9jOehk35nIWQgyEBDwQBAAAAARAE/f///wETQL0MqyYsx9Z9q14BhByMgWLW4oJHOqED5qcZ3wyJ4eDuLYfNGq6Ck30dAqFzJL4VhZLSuv87zN/1AEDNMl2DmTohFl03KAgp8YbLmVzcy/I4q0VkATk5c1E5YySjZXXfNN3/CQAHHEnKAAAAAAAiAgK5wMaEThKlMclo5VxVB47BbZv3a+kpD9h9HMpytIOaFwjWuWnTBAAAAAEDCFgHDwAAAAAAAQQWABTWuWnTbf/a2YaRk/Zj7kgN/cc0iAz8CWxpZ2h0bmluZwQCAAEA" + } + ], + "author": [ + "Felix <> is mainly responsible." + ], + "see_also": [ + "lightning-listfunds(7)", + "lightning-fundchannel(7)", + "lightning-newaddr(7)", + "lightning-txprepare(7)", + "lightning-feerates(7)" + ], + "resources": [ + "Main web site: " + ] + }, "listchannels.request.json": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", diff --git a/doc/rpc-schema-draft.json b/doc/rpc-schema-draft.json new file mode 100644 index 000000000000..5365d1beed09 --- /dev/null +++ b/doc/rpc-schema-draft.json @@ -0,0 +1,520 @@ +{ + "$schema": "https://json-schema.org/draft-07/schema#", + "title": "Core lightning rpc meta-schema", + "definitions": { + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { + "$ref": "#/definitions/nonNegativeInteger" + }, + { + "default": 0 + } + ] + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string", + "hex", + "hash", + "secret", + "u64", + "u32", + "u16", + "u8", + "pubkey", + "sat", + "msat", + "msat_or_all", + "msat_or_any", + "currency", + "txid", + "signature", + "bip340sig", + "short_channel_id", + "short_channel_id_dir", + "outpoint", + "feerate", + "outputdesc" + ] + }, + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { + "properties": { + "type": { + "$ref": "#/definitions/simpleTypes" + }, + "description": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "schemaIfThenElse": { + "type": "object", + "properties": { + "properties": { + "patternProperties": { + "^[a-zA-Z_][a-zA-Z0-9_]*$": { + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/simpleTypes" + }, + "description": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "required": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "schemaItems": { + "additionalProperties": false, + "properties": { + "type": { + "$ref": "#/definitions/simpleTypes" + }, + "additionalProperties": { + "type": "boolean", + "default": false + }, + "description": { + "type": "array", + "items": { + "type": "string" + } + }, + "required": { + "type": "array", + "items": { + "type": "string" + } + }, + "items": { + "$ref": "#/definitions/schemaItems" + }, + "properties": { + "$ref": "#/definitions/schemaObject" + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "if": { + "$ref": "#/definitions/schemaIfThenElse" + }, + "then": { + "$ref": "#/definitions/schemaIfThenElse" + }, + "else": { + "$ref": "#/definitions/schemaIfThenElse" + }, + "allOf": { + "$ref": "#/definitions/schemaArray" + }, + "anyOf": { + "$ref": "#/definitions/schemaArray" + }, + "oneOf": { + "$ref": "#/definitions/schemaArray" + } + } + }, + "schemaObject": { + "type": "object", + "patternProperties": { + "^[a-zA-Z_][a-zA-Z0-9_]*$": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "$ref": "#/definitions/simpleTypes" + }, + "additionalProperties": { + "type": "boolean", + "default": false + }, + "hidden": { + "type": "boolean", + "default": false + }, + "untyped": { + "type": "boolean" + }, + "comment": { + "type": "string" + }, + "description": { + "type": "array", + "items": { + "type": "string" + } + }, + "properties": { + "$ref": "#/definitions/schemaObject" + }, + "items": { + "$ref": "#/definitions/schemaItems" + }, + "default": { + "type": [ + "string", + "number", + "boolean", + "array", + "object", + "null" + ] + }, + "added": { + "type": "string" + }, + "deprecated": { + "type": "array", + "items": { + "type": "string" + } + }, + "required": { + "type": "array", + "items": { + "type": "string" + } + }, + "maximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "maxLength": { + "$ref": "#/definitions/nonNegativeInteger" + }, + "minLength": { + "$ref": "#/definitions/nonNegativeIntegerDefault0" + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "format": { + "type": "string" + }, + "if": { + "$ref": "#/definitions/schemaIfThenElse" + }, + "then": { + "$ref": "#/definitions/schemaIfThenElse" + }, + "else": { + "$ref": "#/definitions/schemaIfThenElse" + }, + "allOf": { + "$ref": "#/definitions/schemaArray" + }, + "anyOf": { + "$ref": "#/definitions/schemaArray" + }, + "oneOf": { + "$ref": "#/definitions/schemaArray" + } + } + } + } + }, + "schemaRequest": { + "type": "object", + "additionalProperties": false, + "properties": { + "required": { + "type": "array", + "items": { + "type": "string" + } + }, + "properties": { + "$ref": "#/definitions/schemaObject" + }, + "oneOfMany": { + "$ref": "#/definitions/schemaArray" + }, + "pairedWith": { + "$ref": "#/definitions/schemaArray" + }, + "dependentUpon": { + "type": "object", + "patternProperties": { + "^[a-zA-Z_][a-zA-Z0-9_]*$": { + "$ref": "#/definitions/schemaArray" + } + } + } + } + }, + "schemaResponse": { + "type": "object", + "additionalProperties": false, + "properties": { + "required": { + "type": "array", + "items": { + "type": "string" + } + }, + "pre_return_value_notes": { + "type": "array", + "items": { + "type": "string" + } + }, + "post_return_value_notes": { + "type": "array", + "items": { + "type": "string" + } + }, + "properties": { + "$ref": "#/definitions/schemaObject" + }, + "allOf": { + "$ref": "#/definitions/schemaArray" + }, + "anyOf": { + "$ref": "#/definitions/schemaArray" + }, + "oneOf": { + "$ref": "#/definitions/schemaArray" + } + } + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "$schema": { + "type": "string", + "format": "uri" + }, + "additionalProperties": { + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "object" + ] + }, + "added": { + "type": "string" + }, + "deprecated": { + "type": "array", + "items": { + "type": "string" + } + }, + "warning": { + "type": "string" + }, + "rpc": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "array", + "items": { + "type": "string" + } + }, + "request": { + "$ref": "#/definitions/schemaRequest" + }, + "reliability": { + "type": "array", + "items": { + "type": "string" + } + }, + "usage": { + "type": "array", + "items": { + "type": "string" + } + }, + "restriction_format": { + "type": "array", + "items": { + "type": "string" + } + }, + "example_usage": { + "type": "array", + "items": { + "type": "string" + } + }, + "example_json_request": { + "type": "array", + "items": { + "id": { + "type": "integer" + }, + "method": { + "type": "string" + }, + "params": {} + } + }, + "notes": { + "type": "array", + "items": { + "type": "string" + } + }, + "notifications": { + "type": "array", + "items": { + "type": "string" + } + }, + "sharing_runes": { + "type": "array", + "items": { + "type": "string" + } + }, + "riskfactor_effect_on_routing": { + "type": "array", + "items": { + "type": "string" + } + }, + "recommended_riskfactor_values": { + "type": "array", + "items": { + "type": "string" + } + }, + "optimality": { + "type": "array", + "items": { + "type": "string" + } + }, + "randomization": { + "type": "array", + "items": { + "type": "string" + } + }, + "response": { + "$ref": "#/definitions/schemaResponse" + }, + "treatment_of_types": { + "type": "array", + "items": { + "type": "string" + } + }, + "permitted_sqlite3_functions": { + "type": "array", + "items": { + "type": "string" + } + }, + "tables": { + "type": "array", + "items": { + "type": "string" + } + }, + "example_json_response": { + "type": "array", + "items": {} + }, + "example_json_notifications": { + "type": "array", + "items": { + "method": { + "type": "string" + }, + "params": {} + } + }, + "trivia": { + "type": "array", + "items": { + "type": "string" + } + }, + "errors": { + "type": "array", + "items": { + "type": "string" + } + }, + "author": { + "type": "array", + "items": { + "type": "string" + } + }, + "see_also": { + "type": "array", + "items": { + "type": "string" + } + }, + "resources": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "$schema", + "type", + "rpc", + "title", + "description", + "request", + "response" + ] +} diff --git a/doc/schemas/lightning-addgossip.json b/doc/schemas/lightning-addgossip.json new file mode 100644 index 000000000000..49fa79684482 --- /dev/null +++ b/doc/schemas/lightning-addgossip.json @@ -0,0 +1,59 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "addgossip", + "title": "Command for injecting a gossip message (low-level)", + "description": [ + "The **addgossip** RPC command injects a hex-encoded gossip message into the gossip daemon. It may return an error if it is malformed, or may update its internal state using the gossip message.", + "", + "Note that currently some paths will still silently reject the gossip: it is best effort.", + "", + "This is particularly used by plugins which may receive channel_update messages within error replies." + ], + "request": { + "required": [ + "message" + ], + "properties": { + "message": { + "type": "hex", + "description": [ + "The raw, hex-encoded, gossip message to add to the local gossip view." + ] + } + } + }, + "response": { + "properties": {} + }, + "example_json_request": [ + { + "id": "example:addgossip#1", + "method": "addgossip", + "params": { + "message": "010078c3314666731e339c0b8434f7824797a084ed7ca3655991a672da068e2c44cb53b57b53a296c133bc879109a8931dc31e6913a4bda3d58559b99b95663e6d52775579447ef5526300e1bb89bc6af8557aa1c3810a91814eafad6d103f43182e17b16644cb38c1d58a8edd094303959a9f1f9d42ff6c32a21f9c118531f512c8679cabaccc6e39dbd95a4dac90e75a258893c3aa3f733d1b8890174d5ddea8003cadffe557773c54d2c07ca1d535c4bf85885f879ae466c16a516e8ffcfec1740e3f5c98ca9ce13f452e867befef5517f306ed6aa5119b79059bcc6f68f329986b665d16de7bc7df64e3537504c91eeabe0e59d3a2b68e4216ead2b0f6e3ef7c000006226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f0000670000010000022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d590266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c0351802e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5702324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b" + } + }, + { + "id": "example:addgossip#2", + "method": "addgossip", + "params": { + "message": "0102420526c8eb62ec6999bbee5f1de4841cab734374ec642b7deeb0259e76220bf82e97a241c907d5ff52019655f7f9a614c285bb35690f3a1a2b928d7b2349a79e06226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f000067000001000065b32a0e010100060000000000000000000000010000000a000000003b023380" + } + } + ], + "example_json_response": [ + {}, + {} + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-pay(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-addpsbtoutput.json b/doc/schemas/lightning-addpsbtoutput.json new file mode 100644 index 000000000000..2d40e4f1130c --- /dev/null +++ b/doc/schemas/lightning-addpsbtoutput.json @@ -0,0 +1,137 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.11", + "rpc": "addpsbtoutput", + "title": "Command to populate PSBT outputs from the wallet", + "description": [ + "`addpsbtoutput` is a low-level RPC command which creates or modifies a PSBT by adding a single output of amount *satoshi*.", + "", + "This is used to receive funds into the on-chain wallet interactively using PSBTs." + ], + "request": { + "required": [ + "satoshi" + ], + "properties": { + "satoshi": { + "type": "sat", + "description": [ + "The satoshi value of the output. It can be a whole number, a whole number ending in *sat*, or a number with 1 to 8 decimal places ending in *btc*." + ] + }, + "initialpsbt": { + "type": "string", + "description": [ + "Base 64 encoded PSBT to add the output to. If not specified, one will be generated automatically." + ] + }, + "locktime": { + "type": "u32", + "description": [ + "If not set, it is set to a recent block height (if no initial psbt is specified)." + ] + }, + "destination": { + "type": "string", + "description": [ + "If it is not set, an internal address is generated." + ] + } + } + }, + "response": { + "required": [ + "psbt", + "estimated_added_weight", + "outnum" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "Unsigned PSBT which fulfills the parameters given." + ] + }, + "estimated_added_weight": { + "type": "u32", + "description": [ + "The estimated weight of the added output." + ] + }, + "outnum": { + "type": "u32", + "description": [ + "The 0-based number where the output was placed." + ] + } + } + }, + "example_usage": [ + "Here is a command to make a PSBT with a 100,000 sat output that leads to the on-chain wallet.", + "", + "```shell", + "lightning-cli addpsbtoutput 100000sat", + "```" + ], + "example_json_request": [ + { + "id": "example:addpsbtoutput#1", + "method": "addpsbtoutput", + "params": { + "satoshi": 100000, + "initialpsbt": null, + "locktime": null, + "destination": null + } + }, + { + "id": "example:addpsbtoutput#2", + "method": "addpsbtoutput", + "params": { + "satoshi": 1000000, + "initialpsbt": null, + "locktime": 111, + "destination": null + } + }, + { + "id": "example:addpsbtoutput#3", + "method": "addpsbtoutput", + "params": { + "satoshi": 974343, + "initialpsbt": "cHNidP8BAF4CAAAAAfwbEpvpi6D14YV4VLnuVB47Y0uF41kXEyJRL4IusySSAQAAAAD9////ASICAAAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5nAAAAAAEA9gIAAAAAAQFEkxvLatohY6mw5gr5qG1aiArSrziFPR2YoqD21Hv+RAAAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNrz8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIEu1nfVRt9i+rFM219mwhMqdwJsqygWSWTFUS+cemdh6AiBG3Qo8g9J/aAMO2RHDsIBScscj6pTTIwZp7Gw8G3EOKAEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPZgAAAAEBK68/DwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==", + "locktime": null, + "destination": "bcrt1q9tc6q49l6wrrtp8ul45rj92hsleehwwxty32zu" + } + } + ], + "example_json_response": [ + { + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIoIYBAAAAAAABBCJRIHg2NV/cioLcTLAKdyxVVBUdBjhKTdZejT9orAhWa4S+AA==", + "estimated_added_weight": 172, + "outnum": 0 + }, + { + "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIJd6ICNAQALFOMhoUHuSVSuzcaUdkDKlk4K+A+DR9+4uAA==", + "estimated_added_weight": 172, + "outnum": 0 + }, + { + "psbt": "cHNidP8BAH0CAAAAAfwbEpvpi6D14YV4VLnuVB47Y0uF41kXEyJRL4IusySSAQAAAAD9////AiICAAAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4H3g4AAAAAABYAFCrxoFS/04Y1hPz9aDkVV4fzm7nGZwAAAAABAPYCAAAAAAEBRJMby2raIWOpsOYK+ahtWogK0q84hT0dmKKg9tR7/kQAAAAAAP3///8CQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAza8/DwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oCRzBEAiBLtZ31UbfYvqxTNtfZsITKncCbKsoFklkxVEvnHpnYegIgRt0KPIPSf2gDDtkRw7CAUnLHI+qU0yMGaexsPBtxDigBIQPXRURck2JmXyLg2W6edm8nPzJg3qOcina/oF3SaE3cz2YAAAABASuvPw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAAAA", + "estimated_added_weight": 172, + "outnum": 1 + } + ], + "author": [ + "Dusty <<@dusty_daemon>> is mainly responsible." + ], + "see_also": [ + "lightning-fundpsbt(7)", + "lightning-utxopsbt(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-autoclean-once.json b/doc/schemas/lightning-autoclean-once.json new file mode 100644 index 000000000000..d6b656ec35d1 --- /dev/null +++ b/doc/schemas/lightning-autoclean-once.json @@ -0,0 +1,235 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "autoclean-once", + "title": "A single deletion of old invoices/payments/forwards", + "description": [ + "The **autoclean-once** RPC command tell the `autoclean` plugin to do a single sweep to delete old entries. This is a manual alternative (or addition) to the various `autoclean-...-age` parameters which cause autoclean to run once per hour: see lightningd-config(5)." + ], + "request": { + "required": [ + "subsystem", + "age" + ], + "properties": { + "subsystem": { + "type": "string", + "enum": [ + "succeededforwards", + "failedforwards", + "succeededpays", + "failedpays", + "paidinvoices", + "expiredinvoices" + ], + "description": [ + "What subsystem to clean. Currently supported subsystems are:", + " * `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`).", + " * `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`).", + " * `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`).", + " * `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`).", + " * `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`).", + " * `paidinvoices`: invoices which were paid (`paid` in listinvoices `status)." + ] + }, + "age": { + "type": "u64", + "description": [ + "Non-zero number in seconds. How many seconds old an entry must be to delete it." + ] + } + } + }, + "response": { + "required": [ + "autoclean" + ], + "properties": { + "autoclean": { + "type": "object", + "additionalProperties": false, + "properties": { + "succeededforwards": { + "type": "object", + "additionalProperties": false, + "required": [ + "cleaned", + "uncleaned" + ], + "properties": { + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done this run." + ] + }, + "uncleaned": { + "type": "u64", + "description": [ + "The total number of entries *not* deleted this run." + ] + } + } + }, + "failedforwards": { + "type": "object", + "additionalProperties": false, + "required": [ + "cleaned", + "uncleaned" + ], + "properties": { + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done this run." + ] + }, + "uncleaned": { + "type": "u64", + "description": [ + "The total number of entries *not* deleted this run." + ] + } + } + }, + "succeededpays": { + "type": "object", + "additionalProperties": false, + "required": [ + "cleaned", + "uncleaned" + ], + "properties": { + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done this run." + ] + }, + "uncleaned": { + "type": "u64", + "description": [ + "The total number of entries *not* deleted this run." + ] + } + } + }, + "failedpays": { + "type": "object", + "additionalProperties": false, + "required": [ + "cleaned", + "uncleaned" + ], + "properties": { + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done this run." + ] + }, + "uncleaned": { + "type": "u64", + "description": [ + "The total number of entries *not* deleted this run." + ] + } + } + }, + "paidinvoices": { + "type": "object", + "additionalProperties": false, + "required": [ + "cleaned", + "uncleaned" + ], + "properties": { + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done this run." + ] + }, + "uncleaned": { + "type": "u64", + "description": [ + "The total number of entries *not* deleted this run." + ] + } + } + }, + "expiredinvoices": { + "type": "object", + "additionalProperties": false, + "required": [ + "cleaned", + "uncleaned" + ], + "properties": { + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done this run." + ] + }, + "uncleaned": { + "type": "u64", + "description": [ + "The total number of entries *not* deleted this run." + ] + } + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:autoclean-once#1", + "method": "autoclean-once", + "params": [ + "failedpays", + 1 + ] + }, + { + "id": "example:autoclean-once#2", + "method": "autoclean-once", + "params": [ + "succeededpays", + 1 + ] + } + ], + "example_json_response": [ + { + "autoclean": { + "failedpays": { + "cleaned": 1, + "uncleaned": 1 + } + } + }, + { + "autoclean": { + "succeededpays": { + "cleaned": 1, + "uncleaned": 0 + } + } + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightningd-config(5)", + "lightning-autoclean-status(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-autoclean-status.json b/doc/schemas/lightning-autoclean-status.json new file mode 100644 index 000000000000..2841fc54a113 --- /dev/null +++ b/doc/schemas/lightning-autoclean-status.json @@ -0,0 +1,484 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "autoclean-status", + "title": "Examine auto-delete of old invoices/payments/forwards", + "description": [ + "The **autoclean-status** RPC command tells you about the status of the autclean plugin, optionally for only one subsystem." + ], + "request": { + "required": [], + "properties": { + "subsystem": { + "type": "string", + "enum": [ + "succeededforwards", + "failedforwards", + "succeededpays", + "failedpays", + "paidinvoices", + "expiredinvoices" + ], + "description": [ + "What subsystem to ask about. Currently supported subsystems are:", + " * `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`).", + " * `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`).", + " * `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`).", + " * `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`).", + " * `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`).", + " * `paidinvoices`: invoices which were paid (`paid` in listinvoices `status)." + ] + } + } + }, + "response": { + "required": [ + "autoclean" + ], + "properties": { + "autoclean": { + "type": "object", + "additionalProperties": false, + "properties": { + "succeededforwards": { + "type": "object", + "additionalProperties": true, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": { + "type": "boolean", + "description": [ + "Whether autocleaning is enabled for successful listforwards." + ] + }, + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done (ever)." + ] + } + }, + "if": { + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "enabled", + "age", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {}, + "age": { + "type": "u64", + "description": [ + "Age (in seconds) to delete successful listforwards." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {} + } + } + }, + "failedforwards": { + "type": "object", + "additionalProperties": true, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": { + "type": "boolean", + "description": [ + "Whether autocleaning is enabled for failed listforwards." + ] + }, + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done (ever)." + ] + } + }, + "if": { + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "enabled", + "age", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {}, + "age": { + "type": "u64", + "description": [ + "Age (in seconds) to delete failed listforwards." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {} + } + } + }, + "succeededpays": { + "type": "object", + "additionalProperties": true, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": { + "type": "boolean", + "description": [ + "Whether autocleaning is enabled for successful listpays/listsendpays." + ] + }, + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done (ever)." + ] + } + }, + "if": { + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "enabled", + "age", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {}, + "age": { + "type": "u64", + "description": [ + "Age (in seconds) to delete successful listpays/listsendpays." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {} + } + } + }, + "failedpays": { + "type": "object", + "additionalProperties": true, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": { + "type": "boolean", + "description": [ + "Whether autocleaning is enabled for failed listpays/listsendpays." + ] + }, + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done (ever)." + ] + } + }, + "if": { + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "enabled", + "age", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {}, + "age": { + "type": "u64", + "description": [ + "Age (in seconds) to delete failed listpays/listsendpays." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {} + } + } + }, + "paidinvoices": { + "type": "object", + "additionalProperties": true, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": { + "type": "boolean", + "description": [ + "Whether autocleaning is enabled for paid listinvoices." + ] + }, + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done (ever)." + ] + } + }, + "if": { + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "enabled", + "age", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {}, + "age": { + "type": "u64", + "description": [ + "Age (in seconds) to paid listinvoices." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {} + } + } + }, + "expiredinvoices": { + "type": "object", + "additionalProperties": true, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": { + "type": "boolean", + "description": [ + "Whether autocleaning is enabled for expired (unpaid) listinvoices." + ] + }, + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done (ever)." + ] + } + }, + "if": { + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "enabled", + "age", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {}, + "age": { + "type": "u64", + "description": [ + "Age (in seconds) to expired listinvoices." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {} + } + } + } + } + } + }, + "pre_return_value_notes": [ + "Note that the ages parameters are set by various `autoclean-...-age` parameters in your configuration: see lightningd-config(5)." + ] + }, + "example_json_request": [ + { + "id": "example:autoclean-status#1", + "method": "autoclean-status", + "params": { + "subsystem": "expiredinvoices" + } + }, + { + "id": "example:autoclean-status#2", + "method": "autoclean-status", + "params": { + "subsystem": null + } + } + ], + "example_json_response": [ + { + "autoclean": { + "expiredinvoices": { + "enabled": false, + "cleaned": 0 + } + } + }, + { + "autoclean": { + "succeededforwards": { + "enabled": false, + "cleaned": 0 + }, + "failedforwards": { + "enabled": false, + "cleaned": 0 + }, + "succeededpays": { + "enabled": false, + "cleaned": 0 + }, + "failedpays": { + "enabled": false, + "cleaned": 0 + }, + "paidinvoices": { + "enabled": false, + "cleaned": 0 + }, + "expiredinvoices": { + "enabled": true, + "age": 2, + "cleaned": 0 + } + } + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightningd-config(5)", + "lightning-listinvoices(7)", + "lightning-listpays(7)", + "lightning-listforwards(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-autocleaninvoice.json b/doc/schemas/lightning-autocleaninvoice.json new file mode 100644 index 000000000000..3b6a86acadf5 --- /dev/null +++ b/doc/schemas/lightning-autocleaninvoice.json @@ -0,0 +1,120 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "setchannel", + "title": "Command for configuring fees / htlc range advertized for a channel", + "description": [], + "request": { + "required": [], + "properties": { + "expired_by": { + "type": "u64", + "description": [ + "How long an invoice must be expired (seconds) before we delete it." + ] + }, + "cycle_seconds": { + "type": "u64", + "description": [ + "The interval (in seconds) between cleaning expired invoices." + ] + } + } + }, + "response": { + "required": [ + "enabled" + ], + "properties": { + "enabled": { + "type": "boolean", + "description": [ + "Whether invoice autocleaning is active." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "expired_by", + "cycle_seconds" + ], + "properties": { + "enabled": {}, + "expired_by": { + "type": "u64", + "description": [ + "How long an invoice must be expired (seconds) before we delete it." + ] + }, + "cycle_seconds": { + "type": "u64", + "description": [ + "How long an invoice must be expired (seconds) before we delete it." + ] + } + } + }, + "else": { + "additionalProperties": false, + "properties": { + "enabled": {} + } + } + } + ] + }, + "example_json_request": [ + { + "id": "example:autocleaninvoice#1", + "method": "autocleaninvoice", + "params": { + "cycle_seconds": 8, + "expired_by": 2 + } + }, + { + "id": "example:autocleaninvoice#2", + "method": "autocleaninvoice", + "params": { + "cycle_seconds": 1, + "expired_by": 1 + } + } + ], + "example_json_response": [ + { + "enabled": true, + "cycle_seconds": 8, + "expired_by": 2 + }, + { + "enabled": true, + "cycle_seconds": 1, + "expired_by": 1 + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightningd-config(5)", + "lightning-listinvoices(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-batching.json b/doc/schemas/lightning-batching.json new file mode 100644 index 000000000000..fc0b1804bdd8 --- /dev/null +++ b/doc/schemas/lightning-batching.json @@ -0,0 +1,50 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "batching", + "title": "Command to allow database batching.", + "description": [ + "The **batching** RPC command allows (but does not guarantee!) database commitments to be deferred when multiple commands are issued on this RPC connection. This is only useful if many commands are being given at once, in which case it can offer a performance improvement (the cost being that if there is a crash, it's unclear how many of the commands will have been persisted)." + ], + "request": { + "required": [ + "enable" + ], + "properties": { + "enable": { + "type": "boolean", + "description": [ + "Whether to enable or disable transaction batching." + ], + "default": "False" + } + } + }, + "response": { + "properties": {} + }, + "example_json_request": [ + { + "id": "example:batching#1", + "method": "batching", + "params": { + "enable": true + } + } + ], + "example_json_response": [ + {} + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters." + ], + "author": [ + "Rusty Russell <> wrote the initial version of this man page." + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-bkpr-channelsapy.json b/doc/schemas/lightning-bkpr-channelsapy.json new file mode 100644 index 000000000000..72208f781005 --- /dev/null +++ b/doc/schemas/lightning-bkpr-channelsapy.json @@ -0,0 +1,262 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "bkpr-channelsapy", + "title": "Command to list stats on channel earnings", + "description": [ + "The **bkpr-channelsapy** RPC command lists stats on routing income, leasing income, and various calculated APYs for channel routed funds." + ], + "request": { + "required": [], + "properties": { + "start_time": { + "type": "u64", + "description": [ + "UNIX timestamp (in seconds) to filter events after the provided timestamp." + ], + "default": "zero" + }, + "end_time": { + "type": "u64", + "description": [ + "UNIX timestamp (in seconds) to filter events up to and at the provided timestamp." + ], + "default": "max-int" + } + } + }, + "response": { + "required": [ + "channels_apy" + ], + "properties": { + "channels_apy": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "account", + "routed_out_msat", + "routed_in_msat", + "lease_fee_paid_msat", + "lease_fee_earned_msat", + "pushed_out_msat", + "pushed_in_msat", + "our_start_balance_msat", + "channel_start_balance_msat", + "fees_out_msat", + "utilization_out", + "utilization_in", + "apy_out", + "apy_in", + "apy_total" + ], + "properties": { + "account": { + "type": "string", + "description": [ + "The account name. If the account is a channel, the channel_id. The 'net' entry is the rollup of all channel accounts." + ] + }, + "routed_out_msat": { + "type": "msat", + "description": [ + "Sats routed (outbound)." + ] + }, + "routed_in_msat": { + "type": "msat", + "description": [ + "Sats routed (inbound)." + ] + }, + "lease_fee_paid_msat": { + "type": "msat", + "description": [ + "Sats paid for leasing inbound (liquidity ads)." + ] + }, + "lease_fee_earned_msat": { + "type": "msat", + "description": [ + "Sats earned for leasing outbound (liquidity ads)." + ] + }, + "pushed_out_msat": { + "type": "msat", + "description": [ + "Sats pushed to peer at open." + ] + }, + "pushed_in_msat": { + "type": "msat", + "description": [ + "Sats pushed in from peer at open." + ] + }, + "our_start_balance_msat": { + "type": "msat", + "description": [ + "Starting balance in channel at funding. Note that if our start balance is zero, any _initial field will be omitted (can't divide by zero)." + ] + }, + "channel_start_balance_msat": { + "type": "msat", + "description": [ + "Total starting balance at funding." + ] + }, + "fees_out_msat": { + "type": "msat", + "description": [ + "Fees earned on routed outbound." + ] + }, + "fees_in_msat": { + "type": "msat", + "description": [ + "Fees earned on routed inbound." + ] + }, + "utilization_out": { + "type": "string", + "description": [ + "Sats routed outbound / total start balance." + ] + }, + "utilization_out_initial": { + "type": "string", + "description": [ + "Sats routed outbound / our start balance." + ] + }, + "utilization_in": { + "type": "string", + "description": [ + "Sats routed inbound / total start balance." + ] + }, + "utilization_in_initial": { + "type": "string", + "description": [ + "Sats routed inbound / our start balance." + ] + }, + "apy_out": { + "type": "string", + "description": [ + "Fees earned on outbound routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)." + ] + }, + "apy_out_initial": { + "type": "string", + "description": [ + "Fees earned on outbound routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)." + ] + }, + "apy_in": { + "type": "string", + "description": [ + "Fees earned on inbound routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)." + ] + }, + "apy_in_initial": { + "type": "string", + "description": [ + "Fees earned on inbound routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)." + ] + }, + "apy_total": { + "type": "string", + "description": [ + "Total fees earned on routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)." + ] + }, + "apy_total_initial": { + "type": "string", + "description": [ + "Total fees earned on routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)." + ] + }, + "apy_lease": { + "type": "string", + "description": [ + "Lease fees earned over total amount leased for the lease term, amortized to a year (APY). Only appears if channel was leased out by us." + ] + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:bkpr-channelsapy#1", + "method": "bkpr-channelsapy", + "params": "{}" + } + ], + "example_json_response": [ + { + "channels_apy": [ + { + "account": "e41b2ec83e9139a9fd8f1d89b01e5d7df73099494e6b91504c39445e37485b0d", + "routed_out_msat": 1431440, + "routed_in_msat": 0, + "lease_fee_paid_msat": 0, + "lease_fee_earned_msat": 0, + "pushed_out_msat": 0, + "pushed_in_msat": 0, + "our_start_balance_msat": 1000000000, + "channel_start_balance_msat": 1000000000, + "fees_out_msat": 0, + "fees_in_msat": 0, + "utilization_out": "0.1431%", + "utilization_out_initial": "0.1431%", + "utilization_in": "0.0000%", + "apy_out": "0.0000%", + "apy_out_initial": "0.0000%", + "apy_in": "0.0000%", + "apy_total": "0.0000%", + "apy_total_initial": "0.0000%" + }, + { + "account": "net", + "routed_out_msat": 1431440, + "routed_in_msat": 0, + "lease_fee_paid_msat": 0, + "lease_fee_earned_msat": 0, + "pushed_out_msat": 0, + "pushed_in_msat": 0, + "our_start_balance_msat": 1000000000, + "channel_start_balance_msat": 1000000000, + "fees_out_msat": 0, + "fees_in_msat": 0, + "utilization_out": "0.1431%", + "utilization_out_initial": "0.1431%", + "utilization_in": "0.0000%", + "apy_out": "0.0000%", + "apy_out_initial": "0.0000%", + "apy_in": "0.0000%", + "apy_total": "0.0000%", + "apy_total_initial": "0.0000%" + } + ] + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-bkpr-listincome(7)", + "lightning-bkpr-listfunds(7)", + "lightning-bkpr-listaccountevents(7)", + "lightning-bkpr-dumpincomecsv(7)", + "lightning-listpeers(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-bkpr-dumpincomecsv.json b/doc/schemas/lightning-bkpr-dumpincomecsv.json new file mode 100644 index 000000000000..a5064aaf5f83 --- /dev/null +++ b/doc/schemas/lightning-bkpr-dumpincomecsv.json @@ -0,0 +1,105 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "bkpr-dumpincomecsv", + "title": "Command to emit a CSV of income events", + "description": [ + "The **bkpr-dumpincomcsv** RPC command writes a CSV file to disk at *csv_file* location. This is a formatted output of the **listincome** RPC command." + ], + "request": { + "required": [ + "csv_format" + ], + "properties": { + "csv_format": { + "type": "string", + "description": [ + "CSV format to use. See RETURN VALUE for options." + ] + }, + "csv_file": { + "type": "string", + "description": [ + "On-disk destination of the generated CSV file." + ] + }, + "consolidate_fees": { + "type": "boolean", + "description": [ + "If true, we emit a single, consolidated event for any onchain-fees for a txid and account. Otherwise, events for every update to the onchain fee calculation for this account and txid will be printed. Note that this means that the events emitted are non-stable, i.e. calling **dumpincomecsv** twice may result in different onchain fee events being emitted, depending on how much information we've logged for that transaction." + ], + "default": "True" + }, + "start_time": { + "type": "u64", + "description": [ + "UNIX timestamp (in seconds) that filters events after the provided timestamp." + ], + "default": "zero" + }, + "end_time": { + "type": "u64", + "description": [ + "UNIX timestamp (in seconds) that filters events up to and at the provided timestamp." + ], + "default": "max-int" + } + } + }, + "response": { + "required": [ + "csv_file", + "csv_format" + ], + "properties": { + "csv_file": { + "type": "string", + "description": [ + "File that the csv was generated to." + ] + }, + "csv_format": { + "type": "string", + "enum": [ + "cointracker", + "koinly", + "harmony", + "quickbooks" + ], + "description": [ + "Format to print csv as." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:bkpr-dumpincomecsv#1", + "method": "bkpr-dumpincomecsv", + "params": [ + "koinly", + "koinly.csv" + ] + } + ], + "example_json_response": [ + { + "csv_file": "koinly.csv", + "csv_format": "koinly" + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-bkpr-listincome(7)", + "lightning-bkpr-listfunds(7)", + "lightning-bkpr-listaccountevents(7)", + "lightning-bkpr-channelsapy(7)", + "lightning-listpeers(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-bkpr-inspect.json b/doc/schemas/lightning-bkpr-inspect.json new file mode 100644 index 000000000000..ffd615a4b6de --- /dev/null +++ b/doc/schemas/lightning-bkpr-inspect.json @@ -0,0 +1,238 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "bkpr-inspect", + "title": "Command to show onchain footprint of a channel", + "description": [ + "The **bkpr-inspect** RPC command lists all known on-chain transactions and associated events for the provided account. Useful for inspecting unilateral closes for a given channel account. Only valid for channel accounts." + ], + "request": { + "required": [ + "account" + ], + "properties": { + "account": { + "type": "string", + "description": [ + "Channel account to inspect." + ] + } + } + }, + "response": { + "required": [ + "txs" + ], + "properties": { + "txs": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "txid", + "fees_paid_msat", + "outputs" + ], + "properties": { + "txid": { + "type": "txid", + "description": [ + "Transaction id." + ] + }, + "blockheight": { + "type": "u32", + "description": [ + "Blockheight of transaction." + ] + }, + "fees_paid_msat": { + "type": "msat", + "description": [ + "Amount paid in sats for this tx." + ] + }, + "outputs": { + "type": "array", + "items": { + "type": "object", + "required": [ + "account", + "outnum", + "output_value_msat", + "currency" + ], + "additionalProperties": false, + "properties": { + "account": { + "type": "string", + "description": [ + "Account this output affected." + ] + }, + "outnum": { + "type": "u32", + "description": [ + "Index of output." + ] + }, + "output_value_msat": { + "type": "msat", + "description": [ + "Value of the output." + ] + }, + "currency": { + "type": "string", + "description": [ + "Human-readable bech32 part for this coin type." + ] + }, + "credit_msat": { + "type": "msat", + "description": [ + "Amount credited to account." + ] + }, + "debit_msat": { + "type": "msat", + "description": [ + "Amount debited from account." + ] + }, + "originating_account": { + "type": "string", + "description": [ + "Account this output originated from." + ] + }, + "output_tag": { + "type": "string", + "description": [ + "Description of output creation event." + ] + }, + "spend_tag": { + "type": "string", + "description": [ + "Description of output spend event." + ] + }, + "spending_txid": { + "type": "txid", + "description": [ + "Transaction this output was spent in." + ] + }, + "payment_id": { + "type": "hex", + "description": [ + "Lightning payment identifier. For an htlc, this will be the preimage." + ] + } + }, + "allOf": [ + { + "if": { + "required": [ + "credit_msat" + ] + }, + "then": { + "required": [ + "output_tag" + ], + "additionalProperties": false, + "properties": { + "account": {}, + "outnum": {}, + "output_value_msat": {}, + "currency": {}, + "credit_msat": {}, + "originating_account": {}, + "debit_msat": {}, + "output_tag": {}, + "spend_tag": {}, + "spending_txid": {}, + "payment_id": {} + } + } + }, + { + "if": { + "required": [ + "spending_txid" + ] + }, + "then": { + "required": [ + "spend_tag", + "debit_msat" + ], + "additionalProperties": false, + "properties": { + "account": {}, + "outnum": {}, + "output_value_msat": {}, + "currency": {}, + "credit_msat": {}, + "originating_account": {}, + "debit_msat": {}, + "output_tag": {}, + "spend_tag": {}, + "spending_txid": {}, + "payment_id": {} + } + } + } + ] + } + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:bkpr-inspect#1", + "method": "bkpr-inspect", + "params": [ + "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab" + ] + } + ], + "example_json_response": [ + { + "txs": [ + { + "txid": "abb283035e569c190696d42a1208bb38ddc64b6377e88f2d6277c01eab7b0af3", + "fees_paid_msat": 0, + "outputs": [ + { + "account": "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab", + "outnum": 0, + "output_tag": "channel_proposed", + "output_value_msat": 996363000, + "credit_msat": 996363000, + "currency": "bcrt" + } + ] + } + ] + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-listbalances(7)", + "lightning-listfunds(7)", + "lightning-listpeers(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-bkpr-listaccountevents.json b/doc/schemas/lightning-bkpr-listaccountevents.json new file mode 100644 index 000000000000..7a55c7f89c6e --- /dev/null +++ b/doc/schemas/lightning-bkpr-listaccountevents.json @@ -0,0 +1,481 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "bkpr-listaccountevents", + "title": "Command for listing recorded bookkeeping events", + "description": [ + "The **bkpr-listaccountevents** RPC command is a list of all bookkeeping events that have been recorded for this node.", + "", + "If the optional parameter **account** is set, we only emit events for the specified account, if exists.", + "", + "Note that the type **onchain_fees** that are emitted are of opposite credit/debit than as they appear in **listincome**, as **listincome** shows all events from the perspective of the node, whereas **listaccountevents** just dumps the event data as we've got it. Onchain fees are updated/recorded as we get more information about input and output spends -- the total onchain fees that were recorded for a transaction for an account can be found by summing all onchain fee events and taking the difference between the **credit_msat** and **debit_msat** for these events. We do this so that successive calls to **listaccountevents** always produce the same list of events -- no previously emitted event will be subsequently updated, rather we add a new event to the list." + ], + "request": { + "required": [], + "properties": { + "account": { + "type": "string", + "description": [ + "Receive events for the specified account." + ] + } + } + }, + "response": { + "required": [ + "events" + ], + "properties": { + "events": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "account", + "type", + "tag", + "credit_msat", + "debit_msat", + "currency", + "timestamp" + ], + "properties": { + "account": { + "type": "string", + "description": [ + "The account name. If the account is a channel, the channel_id." + ] + }, + "type": { + "type": "string", + "enum": [ + "onchain_fee", + "chain", + "channel" + ], + "description": [ + "Coin movement type." + ] + }, + "tag": { + "type": "string", + "description": [ + "Description of movement." + ] + }, + "credit_msat": { + "type": "msat", + "description": [ + "Amount credited." + ] + }, + "debit_msat": { + "type": "msat", + "description": [ + "Amount debited." + ] + }, + "currency": { + "type": "string", + "description": [ + "Human-readable bech32 part for this coin type." + ] + }, + "timestamp": { + "type": "u32", + "description": [ + "Timestamp this event was recorded by the node. For consolidated events such as onchain_fees, the most recent timestamp." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "chain" + ] + } + } + }, + "then": { + "properties": { + "account": {}, + "type": {}, + "tag": {}, + "credit_msat": {}, + "debit_msat": {}, + "currency": {}, + "timestamp": {}, + "outpoint": { + "type": "string", + "description": [ + "The txid:outnum for this event." + ] + }, + "blockheight": { + "type": "u32", + "description": [ + "For chain events, blockheight this occured at." + ] + }, + "origin": { + "type": "string", + "description": [ + "The account this movement originated from." + ] + }, + "payment_id": { + "type": "hex", + "description": [ + "Lightning payment identifier. For an htlc, this will be the preimage." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The txid of the transaction that created this event." + ] + }, + "description": { + "type": "string", + "description": [ + "The description of this event." + ] + } + }, + "required": [ + "outpoint", + "blockheight" + ], + "additionalProperties": false + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "onchain_fee" + ] + } + } + }, + "then": { + "properties": { + "account": {}, + "type": {}, + "tag": {}, + "credit_msat": {}, + "debit_msat": {}, + "currency": {}, + "timestamp": {}, + "description": {}, + "txid": { + "type": "txid", + "description": [ + "The txid of the transaction that created this event." + ] + } + }, + "required": [ + "txid" + ], + "additionalProperties": false + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "channel" + ] + } + } + }, + "then": { + "properties": { + "account": {}, + "type": {}, + "tag": {}, + "credit_msat": {}, + "debit_msat": {}, + "currency": {}, + "timestamp": {}, + "description": {}, + "fees_msat": { + "type": "msat", + "description": [ + "Amount paid in fees." + ] + }, + "is_rebalance": { + "type": "boolean", + "description": [ + "Is this payment part of a rebalance." + ] + }, + "payment_id": { + "type": "hex", + "description": [ + "Lightning payment identifier. For an htlc, this will be the preimage." + ] + }, + "part_id": { + "type": "u32", + "description": [ + "Counter for multi-part payments." + ] + } + }, + "additionalProperties": false + } + } + ] + } + } + } + }, + "example_json_request": [ + { + "id": "example:bkpr-listaccountevents#1", + "method": "bkpr-listaccountevents", + "params": "{}" + }, + { + "id": "example:bkpr-listaccountevents#2", + "method": "bkpr-listaccountevents", + "params": [ + "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab" + ] + } + ], + "example_json_response": [ + { + "events": [ + { + "account": "wallet", + "type": "channel", + "tag": "journal_entry", + "credit_msat": 0, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706152911, + "is_rebalance": false + }, + { + "account": "wallet", + "type": "chain", + "tag": "deposit", + "credit_msat": 2000000000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "7e202b3b1016e8eb6f4e936215ed6b5bdc63c17e6ebb5e6bce2f98e6757ba44c:0", + "timestamp": 1706152914, + "blockheight": 102 + }, + { + "account": "wallet", + "type": "chain", + "tag": "withdrawal", + "credit_msat": 0, + "debit_msat": 2000000000, + "currency": "bcrt", + "outpoint": "7e202b3b1016e8eb6f4e936215ed6b5bdc63c17e6ebb5e6bce2f98e6757ba44c:0", + "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b", + "timestamp": 1706152921, + "blockheight": 103 + }, + { + "account": "wallet", + "type": "chain", + "tag": "deposit", + "credit_msat": 995073000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b:1", + "timestamp": 1706152921, + "blockheight": 103 + }, + { + "account": "wallet", + "type": "onchain_fee", + "tag": "onchain_fee", + "credit_msat": 1004927000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706152921, + "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b" + }, + { + "account": "wallet", + "type": "onchain_fee", + "tag": "onchain_fee", + "credit_msat": 0, + "debit_msat": 1004927000, + "currency": "bcrt", + "timestamp": 1706152921, + "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b" + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "chain", + "tag": "channel_open", + "credit_msat": 1000000000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b:0", + "timestamp": 1706152922, + "blockheight": 103 + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "onchain_fee", + "tag": "onchain_fee", + "credit_msat": 4927000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706152922, + "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b" + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "channel", + "tag": "invoice", + "credit_msat": 0, + "debit_msat": 11000000, + "currency": "bcrt", + "payment_id": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "part_id": 0, + "timestamp": 1706152934, + "description": [ + "XEoCR94SIz6UIRUEkxum." + ], + "is_rebalance": false + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "chain", + "tag": "channel_close", + "credit_msat": 0, + "debit_msat": 989000000, + "currency": "bcrt", + "outpoint": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b:0", + "txid": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998", + "timestamp": 1706152938, + "blockheight": 104 + }, + { + "account": "external", + "origin": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "chain", + "tag": "to_them", + "credit_msat": 10899000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998:0", + "timestamp": 1706152938, + "blockheight": 104 + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "onchain_fee", + "tag": "onchain_fee", + "credit_msat": 7967000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706152938, + "txid": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998" + }, + { + "account": "wallet", + "type": "chain", + "tag": "deposit", + "credit_msat": 980912000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "85477738281c1afd652c350025f1d28658fe541c83adc9a7d5276c30cf715a11:0", + "timestamp": 1706152941, + "blockheight": 109 + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "chain", + "tag": "delayed_to_us", + "credit_msat": 981033000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998:1", + "timestamp": 1706152941, + "blockheight": 104 + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "chain", + "tag": "to_wallet", + "credit_msat": 0, + "debit_msat": 981033000, + "currency": "bcrt", + "outpoint": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998:1", + "txid": "85477738281c1afd652c350025f1d28658fe541c83adc9a7d5276c30cf715a11", + "timestamp": 1706152941, + "blockheight": 109 + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "onchain_fee", + "tag": "onchain_fee", + "credit_msat": 121000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706152941, + "txid": "85477738281c1afd652c350025f1d28658fe541c83adc9a7d5276c30cf715a11" + } + ] + }, + { + "events": [ + { + "account": "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab", + "type": "chain", + "tag": "channel_proposed", + "credit_msat": 996363000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "abb283035e569c190696d42a1208bb38ddc64b6377e88f2d6277c01eab7b0af3:0", + "timestamp": 1706246949, + "blockheight": 0 + }, + { + "account": "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab", + "type": "channel", + "tag": "pushed", + "credit_msat": 0, + "debit_msat": 20000000, + "currency": "bcrt", + "timestamp": 1706246949, + "is_rebalance": false + } + ] + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-bkpr-listincome(7)", + "lightning-listfunds(7)", + "lightning-bkpr-listbalances(7)", + "lightning-bkpr-channelsapy(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-bkpr-listbalances.json b/doc/schemas/lightning-bkpr-listbalances.json new file mode 100644 index 000000000000..6da79d8ce76b --- /dev/null +++ b/doc/schemas/lightning-bkpr-listbalances.json @@ -0,0 +1,160 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "bkpr-listbalances", + "title": "Command for listing current channel + wallet balances", + "description": [ + "The **bkpr-listbalances** RPC command is a list of all current and historical account balances. An account is either the on-chain *wallet* or a channel balance. Any funds sent to an *external* account will not be accounted for here.", + "", + "Note that any channel that was recorded will be listed. Closed channel balances will be 0msat." + ], + "request": { + "required": [], + "properties": {} + }, + "response": { + "required": [ + "accounts" + ], + "properties": { + "accounts": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "account", + "balances" + ], + "properties": { + "account": { + "type": "string", + "description": [ + "The account name. If the account is a channel, the channel_id." + ] + }, + "balances": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "balance_msat", + "coin_type" + ], + "properties": { + "balance_msat": { + "type": "msat", + "description": [ + "Current account balance." + ] + }, + "coin_type": { + "type": "string", + "description": [ + "Coin type, same as HRP for bech32." + ] + } + } + } + } + }, + "if": { + "required": [ + "peer_id" + ] + }, + "then": { + "required": [ + "account", + "balances", + "peer_id", + "we_opened", + "account_closed", + "account_resolved" + ], + "additionalProperties": false, + "properties": { + "account": {}, + "balances": {}, + "peer_id": { + "type": "pubkey", + "description": [ + "Node id for the peer this account is with." + ] + }, + "we_opened": { + "type": "boolean", + "description": [ + "Did we initiate this account open (open the channel)." + ] + }, + "account_closed": { + "type": "boolean", + "description": [ + "", + "" + ] + }, + "account_resolved": { + "type": "boolean", + "description": [ + "Has this channel been closed and all outputs resolved?" + ] + }, + "resolved_at_block": { + "type": "u32", + "description": [ + "Blockheight account resolved on chain." + ] + } + } + }, + "else": { + "properties": { + "account": {}, + "balances": {} + }, + "additionalProperties": false + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:bkpr-listbalances#1", + "method": "bkpr-listbalances", + "params": "{}" + } + ], + "example_json_response": [ + { + "accounts": [ + { + "account": "wallet", + "balances": [ + { + "balance_msat": 2222222000, + "coin_type": "bcrt" + } + ] + } + ] + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-bkpr-listincome(7)", + "lightning-listfunds(7)", + "lightning-bkpr-listaccountevents(7)", + "lightning-bkpr-channelsapy(7)", + "lightning-listpeers(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-bkpr-listincome.json b/doc/schemas/lightning-bkpr-listincome.json new file mode 100644 index 000000000000..94cd6ec133cc --- /dev/null +++ b/doc/schemas/lightning-bkpr-listincome.json @@ -0,0 +1,210 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "pre-v0.10.1", + "rpc": "bkpr-listincome", + "title": "Command for listing all income impacting events", + "description": [ + "The **bkpr-listincome** RPC command is a list of all income impacting events that the bookkeeper plugin has recorded for this node." + ], + "request": { + "required": [], + "properties": { + "consolidate_fees": { + "type": "boolean", + "description": [ + "If true, we emit a single, consolidated event for any onchain-fees for a txid and account. Otherwise, events for every update to the onchain fee calculation for this account and txid will be printed. Note that this means that the events emitted are non-stable, i.e. calling **listincome** twice may result in different onchain fee events being emitted, depending on how much information we've logged for that transaction." + ], + "default": "True" + }, + "start_time": { + "type": "u32", + "description": [ + "UNIX timestamp (in seconds) that filters events after the provided timestamp." + ], + "default": "zero" + }, + "end_time": { + "type": "u32", + "description": [ + "UNIX timestamp (in seconds) that filters events up to and at the provided timestamp." + ], + "default": "max-int" + } + } + }, + "response": { + "required": [ + "income_events" + ], + "properties": { + "income_events": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "account", + "tag", + "credit_msat", + "debit_msat", + "currency", + "timestamp" + ], + "properties": { + "account": { + "type": "string", + "description": [ + "The account name. If the account is a channel, the channel_id." + ] + }, + "tag": { + "type": "string", + "description": [ + "Type of income event." + ] + }, + "credit_msat": { + "type": "msat", + "description": [ + "Amount earned (income)." + ] + }, + "debit_msat": { + "type": "msat", + "description": [ + "Amount spent (expenses)." + ] + }, + "currency": { + "type": "string", + "description": [ + "Human-readable bech32 part for this coin type." + ] + }, + "timestamp": { + "type": "u32", + "description": [ + "Timestamp this event was recorded by the node. For consolidated events such as onchain_fees, the most recent timestamp." + ] + }, + "description": { + "type": "string", + "description": [ + "More information about this event. If a `invoice` type, typically the bolt11/bolt12 description." + ] + }, + "outpoint": { + "type": "string", + "description": [ + "The txid:outnum for this event, if applicable." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The txid of the transaction that created this event, if applicable." + ] + }, + "payment_id": { + "type": "hex", + "description": [ + "Lightning payment identifier. For an htlc, this will be the preimage." + ] + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:bkpr-listincome#1", + "method": "bkpr-listincome", + "params": "{}" + }, + { + "id": "example:bkpr-listincome#2", + "method": "bkpr-listincome", + "params": { + "consolidate_fees": false + } + } + ], + "example_json_response": [ + { + "income_events": [ + { + "account": "wallet", + "tag": "deposit", + "credit_msat": 1111111000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706153060, + "outpoint": "6d813d2e99ae7181b61e59ff224c43de698bd08b8ca5b8034ccc13aa7b6428ef:0" + }, + { + "account": "wallet", + "tag": "deposit", + "credit_msat": 1111111000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706153060, + "outpoint": "0bbbe965f76525af3876ae6f1520d91047d4be04cb4e46b7229120a60c5dc9c5:0" + } + ] + }, + { + "income_events": [ + { + "account": "wallet", + "tag": "deposit", + "credit_msat": 1111111000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1708624181, + "outpoint": "895b5eaad4544d24c99628883b4d84b2c6024d6a2da4c1de54098d985f280943:1" + }, + { + "account": "wallet", + "tag": "withdrawal", + "credit_msat": 0, + "debit_msat": 555555000, + "currency": "bcrt", + "timestamp": 1708624182, + "outpoint": "d28a2cba55da10700ddd7f1f23618160dafb3134650055654551d9b0382dcd71:0" + }, + { + "account": "wallet", + "tag": "onchain_fee", + "credit_msat": 0, + "debit_msat": 555556000, + "currency": "bcrt", + "timestamp": 1708624183, + "txid": "d28a2cba55da10700ddd7f1f23618160dafb3134650055654551d9b0382dcd71" + }, + { + "account": "wallet", + "tag": "onchain_fee", + "credit_msat": 554947000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1708624183, + "txid": "d28a2cba55da10700ddd7f1f23618160dafb3134650055654551d9b0382dcd71" + } + ] + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-bkpr-listaccountevents(7)", + "lightning-listfunds(7)", + "lightning-bkpr-listbalances(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-blacklistrune.json b/doc/schemas/lightning-blacklistrune.json new file mode 100644 index 000000000000..5b8fe5bee61a --- /dev/null +++ b/doc/schemas/lightning-blacklistrune.json @@ -0,0 +1,137 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.08", + "rpc": "blacklistrune", + "title": "Command to prevent a rune from working", + "description": [ + "The **blacklistrune** RPC command allows you to effectively revoke the rune you have created (and any runes derived from that rune with additional restictions). Attempting to use these runes will be resulted in a `Blacklisted rune` error message.", + "", + "Destroy a rune like in olden times with the **destroyrune** command.", + "", + "All runes created by lightning have a unique sequential id within them and can be blacklisted in ranges for efficiency. The command always returns the blacklisted ranges on success. If no parameters are specified, no changes have been made. If start specified without end, that single rune is blacklisted. If end is also specified, every rune from start till end inclusive is blacklisted." + ], + "request": { + "required": [], + "properties": { + "start": { + "type": "u64", + "description": [ + "First rune unique id to blacklist." + ] + }, + "end": { + "type": "u64", + "description": [ + "Final rune unique id to blacklist (defaults to start)." + ] + } + }, + "dependentUpon": { + "start": [ + "end" + ] + } + }, + "response": { + "required": [ + "blacklist" + ], + "properties": { + "blacklist": { + "type": "array", + "description": [ + "The resulting blacklist ranges after the command." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "start", + "end" + ], + "properties": { + "start": { + "type": "u64", + "description": [ + "Unique id of first rune in this blacklist range." + ] + }, + "end": { + "type": "u64", + "description": [ + "Unique id of last rune in this blacklist range." + ] + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:blacklistrune#1", + "method": "blacklistrune", + "params": { + "start": 2 + } + }, + { + "id": "example:blacklistrune#2", + "method": "blacklistrune", + "params": { + "start": 5, + "end": 7 + } + }, + { + "id": "example:blacklistrune#3", + "method": "blacklistrune", + "params": { + "start": 3, + "end": 4 + } + } + ], + "example_json_response": [ + { + "blacklist": [ + { + "start": 2, + "end": 2 + } + ] + }, + { + "blacklist": [ + { + "start": 2, + "end": 2 + }, + { + "start": 5, + "end": 7 + } + ] + }, + { + "blacklist": [ + { + "start": 2, + "end": 7 + } + ] + } + ], + "author": [ + "Shahana Farooqui <> is mainly responsible." + ], + "see_also": [ + "lightning-commando-blacklist(7)", + "lightning-showrunes(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-check.json b/doc/schemas/lightning-check.json new file mode 100644 index 000000000000..e8458d91b352 --- /dev/null +++ b/doc/schemas/lightning-check.json @@ -0,0 +1,100 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "check", + "title": "Command for verifying parameters", + "description": [ + "The **check** RPC command verifies another command without actually making any changes.", + "", + "This is guaranteed to be safe, and will do all checks up to the point where something in the system would need to be altered (such as checking that channels are in the right state, peers connected, etc).", + "", + "It does not guarantee successful execution of the command in all cases. For example, a call to lightning-getroute(7) may still fail to find a route even if checking the parameters succeeds." + ], + "request": { + "required": [ + "command_to_check" + ], + "properties": { + "command_to_check": { + "type": "string", + "description": [ + "Name of the relevant command." + ] + } + } + }, + "response": { + "properties": { + "command_to_check": { + "type": "string", + "description": [ + "The *command_to_check* argument." + ] + } + }, + "required": [ + "command_to_check" + ] + }, + "example_json_request": [ + { + "id": "example:check#1", + "method": "check", + "params": { + "command_to_check": "sendpay", + "route": [ + { + "amount_msat": 1011, + "msatoshi": 1011, + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "delay": 20, + "channel": "1x1x1" + }, + { + "amount_msat": 1000, + "msatoshi": 1000, + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "delay": 10, + "channel": "2x2x2" + } + ], + "payment_hash": "0000000000000000000000000000000000000000000000000000000000000000" + } + }, + { + "id": "example:check#2", + "method": "check", + "params": { + "command_to_check": "dev", + "subcommand": "slowcmd", + "msec": 1000 + } + }, + { + "id": "example:check#3", + "method": "check", + "params": { + "command_to_check": "recover", + "hsmsecret": "6c696768746e696e672d31000000000000000000000000000000000000000000" + } + } + ], + "example_json_response": [ + { + "command_to_check": "sendpay" + }, + { + "command_to_check": "dev" + }, + { + "command_to_check": "recover" + } + ], + "author": [ + "Mark Beckwith <> and Rusty Russell <> are mainly responsible." + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-checkmessage.json b/doc/schemas/lightning-checkmessage.json new file mode 100644 index 000000000000..275c22acd4e7 --- /dev/null +++ b/doc/schemas/lightning-checkmessage.json @@ -0,0 +1,106 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "checkmessage", + "title": "Command to check if a signature is from a node", + "description": [ + "The **checkmessage** RPC command is the counterpart to **signmessage**: given a node id (*pubkey*), signature (*zbase*) and a *message*, it verifies that the signature was generated by that node for that message (more technically: by someone who knows that node's secret).", + "", + "As a special case, if *pubkey* is not specified, we will try every known node key (as per *listnodes*), and verification succeeds if it matches for any one of them. Note: this is implemented far more efficiently than trying each one, so performance is not a concern." + ], + "request": { + "required": [ + "message", + "zbase" + ], + "properties": { + "message": { + "type": "string", + "description": [ + "Message to be checked against the signature." + ] + }, + "zbase": { + "type": "string", + "description": [ + "The Zbase32 encoded signature to verify." + ] + }, + "pubkey": { + "type": "pubkey", + "description": [ + "The Zbase32 encoded signature to verify." + ] + } + } + }, + "response": { + "required": [ + "verified", + "pubkey" + ], + "properties": { + "verified": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Whether the signature was valid." + ] + }, + "pubkey": { + "type": "pubkey", + "description": [ + "The *pubkey* parameter, or the pubkey found by looking for known nodes." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:checkmessage#1", + "method": "checkmessage", + "params": { + "message": "testcase to check new rpc error", + "zbase": "d66bqz3qsku5fxtqsi37j11pci47ydxa95iusphutggz9ezaxt56neh77kxe5hyr41kwgkncgiu94p9ecxiexgpgsz8daoq4tw8kj8yx", + "pubkey": "03be3b0e9992153b1d5a6e1623670b6c3663f72ce6cf2e0dd39c0a373a7de5a3b7" + } + }, + { + "id": "example:checkmessage#2", + "method": "checkmessage", + "params": { + "message": "this is a test!", + "zbase": "d6tqaeuonjhi98mmont9m4wag7gg4krg1f4txonug3h31e9h6p6k6nbwjondnj46dkyausobstnk7fhyy998bhgc1yr98dfmhb4k54d7", + "pubkey": null + } + } + ], + "example_json_response": [ + { + "pubkey": "03be3b0e9992153b1d5a6e1623670b6c3663f72ce6cf2e0dd39c0a373a7de5a3b7", + "verified": true + }, + { + "pubkey": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "verified": true + } + ], + "errors": [ + "On failure, an error is returned and core lightning exit with the following error code:", + "", + "- -32602: Parameter missed or malformed;", + "- 1301: *pubkey* not found in the graph." + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-signmessage(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-checkrune.json b/doc/schemas/lightning-checkrune.json new file mode 100644 index 000000000000..b9dd44d91d95 --- /dev/null +++ b/doc/schemas/lightning-checkrune.json @@ -0,0 +1,139 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.08", + "rpc": "checkrune", + "title": "Command to Validate Rune", + "description": [ + "The **checkrune** RPC command checks the validity/authorization rights of specified rune for the given nodeid, method, and params.", + "", + "If successful, the rune \"usage\" counter (used for ratelimiting) is incremented.", + "", + "See lightning-createrune(7) for the fields in the rune which are checked." + ], + "request": { + "required": [ + "rune" + ], + "properties": { + "rune": { + "type": "string", + "description": [ + "Rune to check for authorization." + ] + }, + "nodeid": { + "type": "string", + "description": [ + "Node id of requesting node *(required until v23.11)*." + ] + }, + "method": { + "type": "string", + "description": [ + "Method for which rune needs to be validated *(required until v23.11)*." + ] + }, + "params": { + "oneOf": [ + { + "type": "array", + "description": [ + "Array of positional parameters." + ] + }, + { + "type": "object", + "description": [ + "Parameters for method." + ] + } + ] + } + } + }, + "response": { + "required": [ + "valid" + ], + "properties": { + "valid": { + "type": "boolean", + "description": [ + "True if the rune is valid." + ] + } + } + }, + "errors": [ + "The following error codes may occur:", + "", + "- 1501 (RUNE_NOT_AUTHORIZED): rune is not for this node (or perhaps completely invalid)", + "- 1502 (RUNE_NOT_PERMITTED): rune does not allow this usage (includes a detailed reason why)", + "- 1503 (RUNE_BLACKLISTED): rune has been explicitly blacklisted." + ], + "example_json_request": [ + { + "id": "example:checkrune#1", + "method": "checkrune", + "params": { + "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "rune": "617Obfct0oRBj_uqGFQxDk3XZ1sDFiC2Q5ltm5z1i_k9NSZtZXRob2Q9aW52b2ljZSZwbmFtZWRlc2NyaXB0aW9uPUB0aXBqYXJcfGpiNTVAc2VuZHNhdHMubG9s", + "method": "invoice", + "params": { + "amount_msat": "any", + "label": "lbl", + "description": [ + "@tipjar|jb55@sendsats.lol." + ] + } + } + }, + { + "id": "example:checkrune#2", + "method": "checkrune", + "params": { + "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==", + "method": "listpeers", + "params": {} + } + }, + { + "id": "example:checkrune#3", + "method": "checkrune", + "params": { + "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "rune": "617Obfct0oRBj_uqGFQxDk3XZ1sDFiC2Q5ltm5z1i_k9NSZtZXRob2Q9aW52b2ljZSZwbmFtZWRlc2NyaXB0aW9uPUB0aXBqYXJcfGpiNTVAc2VuZHNhdHMubG9s", + "method": "invoice", + "params": { + "amount_msat": "any", + "label": "lbl", + "description": "@tipjar|jb55@sendsats.lol" + } + } + } + ], + "example_json_response": [ + { + "valid": true + }, + { + "valid": true + }, + { + "valid": true + } + ], + "author": [ + "Shahana Farooqui <> is mainly responsible for consolidating logic from commando." + ], + "see_also": [ + "lightning-createrune(7)", + "lightning-blacklistrune(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-close.json b/doc/schemas/lightning-close.json new file mode 100644 index 000000000000..37ec85f60100 --- /dev/null +++ b/doc/schemas/lightning-close.json @@ -0,0 +1,209 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "close", + "title": "Command for closing channels with direct peers", + "description": [ + "The **close** RPC command attempts to close the channel cooperatively with the peer, or unilaterally after *unilateraltimeout*, and the to-local output will be sent to the address specified in *destination*.", + "", + "The peer needs to be live and connected in order to negotiate a mutual close. The default of unilaterally closing after 48 hours is usually a reasonable indication that you can no longer contact the peer." + ], + "request": { + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string", + "description": [ + "Peer id, channel id or short_channel_id. If the given *id* is a peer ID (66 hex digits as a string), then it applies to the active channel of the direct peer corresponding to the given peer ID. If the given *id* is a channel ID (64 hex digits as a string, or the short channel ID *blockheight:txindex:outindex* form), then it applies to that channel." + ] + }, + "unilateraltimeout": { + "type": "u32", + "description": [ + "If it is not zero, the command will unilaterally close the channel when that number of seconds is reached. If *unilateraltimeout* is zero, then the command will wait indefinitely until the peer is online and can negotiate a mutual close." + ], + "default": "2 days (172800 seconds)" + }, + "destination": { + "type": "string", + "description": [ + "Any Bitcoin bech32 type. If the peer hasn't offered the option_shutdown_anysegwit feature, then taproot addresses (or other v1+ segwit) are not allowed. Tell your friends to upgrade!" + ], + "default": "a Core Lightning wallet address" + }, + "fee_negotiation_step": { + "type": "string", + "description": [ + "It controls how closing fee negotiation is performed assuming the peer proposes a fee that is different than our estimate. (Note that modern peers use the quick-close protocol which does not allow negotiation: see *feerange* instead).", + "", + "On every negotiation step we must give up some amount from our proposal towards the peer's proposal. This parameter can be an integer in which case it is interpreted as number of satoshis to step at a time. Or it can be an integer followed by `%` to designate a percentage of the interval to give up. A few examples, assuming the peer proposes a closing fee of 3000 satoshi and our estimate shows it must be 4000:", + " * `10`: our next proposal will be 4000-10=3990.", + " * `10%`: our next proposal will be 4000-(10% of (4000-3000))=3900.", + " * '1': our next proposal will be 3999. This is the most extreme case when we insist on our fee as much as possible.", + " * `100%`: our next proposal will be 3000. This is the most relaxed case when we quickly accept the peer's proposal." + ], + "default": "`50%`" + }, + "wrong_funding": { + "type": "outpoint", + "description": [ + "It can only be specified if both sides have offered the `shutdown_wrong_funding` feature (enabled by the **experimental-shutdown-wrong-funding** option). It must be a transaction id followed by a colon then the output number. Instead of negotiating a shutdown to spend the expected funding transaction, the shutdown transaction will spend this output instead. This is only allowed if this peer opened the channel and the channel is unused: it can rescue openings which have been manually miscreated." + ] + }, + "force_lease_closed": { + "type": "boolean", + "description": [ + "If the channel has funds leased to the peer (option_will_fund), we prevent initiation of a mutual close unless this flag is passed in." + ], + "default": "False" + }, + "feerange": { + "type": "array", + "items": { + "type": "feerate" + }, + "description": [ + "An optional array [ *min*, *max* ], indicating the minimum and maximum feerates to offer: the peer will obey these if it supports the quick-close protocol. *slow* and *unilateral_close* are the defaults. Note that the maximum fee will be capped at the final commitment transaction fee (unless the experimental anchor-outputs option is negotiated)." + ] + } + } + }, + "response": { + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "mutual", + "unilateral", + "unopened" + ], + "description": [ + "Whether we successfully negotiated a mutual close, closed without them, or discarded not-yet-opened channel." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "mutual", + "unilateral" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "tx", + "txid" + ], + "properties": { + "type": {}, + "tx": { + "type": "hex", + "description": [ + "The raw bitcoin transaction used to close the channel (if it was open)." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The transaction id of the *tx* field." + ] + } + } + }, + "else": { + "additionalProperties": false, + "properties": { + "type": {} + } + } + } + ], + "post_return_value_notes": [ + "A unilateral close may still occur at any time if the peer did not behave correctly during the close negotiation.", + "", + "Unilateral closes will return your funds after a delay. The delay will vary based on the peer *to_self_delay* setting, not your own setting." + ] + }, + "notes": [ + "Prior to 0.7.2, **close** took two parameters: *force* and *timeout*. *timeout* was the number of seconds before *force* took effect (default, 30), and *force* determined whether the result was a unilateral close or an RPC error (default). Even after the timeout, the channel would be closed if the peer reconnected." + ], + "notifications": [ + "Notifications may be returned indicating what is going on, especially if the peer is offline and we are waiting." + ], + "example_json_request": [ + { + "id": "example:close#1", + "method": "close", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "unilateraltimeout": 1, + "destination": null, + "fee_negotiation_step": null, + "force_lease_closed": null, + "feerange": null + } + }, + { + "id": "example:close#2", + "method": "close", + "params": { + "id": "103x1x0", + "unilateraltimeout": null, + "destination": "bcrt1qeyyk6sl5pr49ycpqyckvmttus5ttj25pd0zpvg", + "fee_negotiation_step": null, + "force_lease_closed": null, + "feerange": null + } + }, + { + "id": "example:close#3", + "method": "close", + "params": [ + "107x1x0", + null, + "bcrt1qeyyk6sl5pr49ycpqyckvmttus5ttj25pd0zpvg" + ] + } + ], + "example_json_response": [ + { + "tx": "020000000001018d388ffcd216c92d25163a62096ce47d5c9bbd6270ced51c5a1484f89df33e5700000000009db0e28002a00f00000000000016001445503fa4b65ade3ffdb1a92057688456c9ffae1380130f0000000000220020be82765fdb17fd5568f2dd31c6cf1aabc620ef338995ec5d9a2f3e42f43ae4870400473044022058dcde893655f40fc8162a79596440ef3e304273f8d530401fc17bc92c58159b0220428900ca6537538ba237d569a4a09003d663a991aeb331a9f18dfe807ee78806014730440220111270eeed8b4b1a231d3ce6e0e0daad718623ad159a0fd3781fb18118a8fec70220539826ee7c76cad4116d1d8852329f80314b3434cf21c765d8004186451a4cd50147522102324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b2102e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5752ae9c3ed620", + "txid": "5d8d917dd7d39fe5a12f121457fc6d712b5e393ed4f16bc8f5976fc08cbbfecd", + "type": "unilateral" + }, + { + "tx": "0200000000010132cbce7d5f96b4003c3b5c0eab2a29fef90bb6abb833ff312fa122f31e8301810000000000ffffffff02a0860100000000002251205779a060f200d40e8f871a40eb91614cc5bfa6d0a5f852e053400a7feff8615005b10d0000000000160014c9096d43f408ea526020262ccdad7c8516b92a81040047304402207e171d056e81cf8ad2d5a613ecbaa212d5dcbd0bf713145d18911d2cbe9d858802206222911660a26d7ffddc2563ae6d41d6ffad9fbd2fc26cf40eab501a31153b9e0147304402204ae7cdc68dc7966eab73f16a1978643336333d54ae0b6f87bc11a2c19174a9710220601e5276aee0825466cc272c4eb7d353b393ef0dd230d303f46772790dee19190147522102324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b2102e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5752ae00000000", + "txid": "4a08e0508e2e39ea033fab5f77b318337f345550421799f6e0eb1b15a892eda4", + "type": "mutual" + }, + { + "tx": "02000000000101233b513665836d240423f45ffcd1fe19aeb08d62303fa5382ad3285f770683a60000000000ffffffff02a086010000000000225120b47216ab60a0fad97de0ba9b8b370d281dfe55f552d82034e2a8d054c2246e4405b10d0000000000160014c9096d43f408ea526020262ccdad7c8516b92a81040047304402207a9e3ca258861b33827d91514690a757e76730ba8c15dd222340bb13d993a1a502204d0ae329273b69abe62df1ffccce808d5f1a29101a8ee95dae99888376dbaef801473044022033c03f406db9f1c9d924cfd8f6ea42d0962f0ab02e3217aef518aea517ca5ba40220076e2af9d40c676316a2765a86f9efd481de3fc4465ceba33b0782c505ae3452014752210212284c004a3d24146e54b2a24db48f650370a08e1fe9abe8ff41f92b09cd50542102a3032ef980cc735579aa5295d927b9a1bdbafc459f2da14163dc9bd530e0a21152ae00000000", + "txid": "d44a1374a30c1a936d2d4fdbe73c0ffff42fec8c27c6cbaec2758b3042f61d08", + "type": "mutual" + } + ], + "author": [ + "ZmnSCPxj <> is mainly responsible." + ], + "see_also": [ + "lightning-disconnect(7)", + "lightning-fundchannel(7)", + "lightningd-config(5)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-commando-blacklist.json b/doc/schemas/lightning-commando-blacklist.json new file mode 100644 index 000000000000..cc06fb7786c1 --- /dev/null +++ b/doc/schemas/lightning-commando-blacklist.json @@ -0,0 +1,138 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.05", + "deprecated": [ + "v23.08", + "v24.08" + ], + "rpc": "commando-blacklist", + "title": "Command to prevent a rune from working", + "description": [ + "The **commando-blacklist** RPC command allows you to effectively revoke the rune you have created (and any runes derived from that rune with additional restictions). Attempting to use these runes will be resulted in a `Blacklisted rune` error message.", + "", + "All runes created by commando have a unique sequential id within them and can be blacklisted in ranges for efficiency. The command always returns the blacklisted ranges on success. If no parameters are specified, no changes have been made. If start specified without end, that single rune is blacklisted. If end is also specified, every rune from start till end inclusive is blacklisted." + ], + "request": { + "required": [], + "properties": { + "start": { + "type": "u64", + "description": [ + "First rune unique id to blacklist." + ] + }, + "end": { + "type": "u64", + "description": [ + "Final rune unique id to blacklist (defaults to start)." + ] + } + }, + "dependentUpon": { + "start": [ + "end" + ] + } + }, + "response": { + "required": [ + "blacklist" + ], + "properties": { + "blacklist": { + "type": "array", + "description": [ + "The resulting blacklist ranges after the command." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "start", + "end" + ], + "properties": { + "start": { + "type": "u64", + "description": [ + "Unique id of first rune in this blacklist range." + ] + }, + "end": { + "type": "u64", + "description": [ + "Unique id of last rune in this blacklist range." + ] + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:commando-blacklist#1", + "method": "commando-blacklist", + "params": { + "start": 2 + } + }, + { + "id": "example:commando-blacklist#2", + "method": "commando-blacklist", + "params": { + "start": 5, + "end": 7 + } + }, + { + "id": "example:commando-blacklist#3", + "method": "commando-blacklist", + "params": { + "start": 3, + "end": 4 + } + } + ], + "example_json_response": [ + { + "blacklist": [ + { + "start": 2, + "end": 2 + } + ] + }, + { + "blacklist": [ + { + "start": 2, + "end": 2 + }, + { + "start": 5, + "end": 7 + } + ] + }, + { + "blacklist": [ + { + "start": 2, + "end": 7 + } + ] + } + ], + "author": [ + "Shahana Farooqui <> is mainly responsible." + ], + "see_also": [ + "lightning-commando-listrunes(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-commando-listrunes.json b/doc/schemas/lightning-commando-listrunes.json new file mode 100644 index 000000000000..254436850d2c --- /dev/null +++ b/doc/schemas/lightning-commando-listrunes.json @@ -0,0 +1,294 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.05", + "deprecated": [ + "v23.08", + "v24.05" + ], + "rpc": "commando-listrunes", + "title": "Command to list previously generated runes", + "description": [ + "The **commando-listrunes** RPC command either lists runes that we stored as we generate them (see lightning-commando-rune(7)) or decodes the rune given on the command line.", + "", + "NOTE: Runes generated prior to v23.05 were not stored, so will not appear in this list." + ], + "request": { + "required": [], + "properties": { + "rune": { + "type": "string", + "description": [ + "Optional rune to list." + ] + } + } + }, + "response": { + "required": [ + "runes" + ], + "properties": { + "runes": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "rune", + "unique_id", + "restrictions", + "restrictions_as_english" + ], + "properties": { + "rune": { + "type": "string", + "description": [ + "Base64 encoded rune." + ] + }, + "unique_id": { + "type": "string", + "description": [ + "Unique id assigned when the rune was generated; this is always a u64 for commando runes." + ] + }, + "restrictions": { + "type": "array", + "description": [ + "The restrictions on what commands this rune can authorize." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "alternatives", + "english" + ], + "properties": { + "alternatives": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "fieldname", + "value", + "condition", + "english" + ], + "properties": { + "fieldname": { + "type": "string", + "description": [ + "The field this restriction applies to; see commando-rune(7)." + ] + }, + "value": { + "type": "string", + "description": [ + "The value accepted for this field." + ] + }, + "condition": { + "type": "string", + "description": [ + "The way to compare fieldname and value." + ] + }, + "english": { + "type": "string", + "description": [ + "English readable description of this alternative." + ] + } + } + } + }, + "english": { + "type": "string", + "description": [ + "English readable summary of alternatives above." + ] + } + } + } + }, + "restrictions_as_english": { + "type": "string", + "description": [ + "English readable description of the restrictions array above." + ] + }, + "stored": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "This is false if the rune does not appear in our datastore (only possible when `rune` is specified)." + ] + }, + "blacklisted": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "The rune has been blacklisted; see commando-blacklist(7)." + ] + }, + "last_used": { + "type": "number", + "description": [ + "The last time this rune was successfully used." + ], + "added": "23.11" + }, + "our_rune": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "This is not a rune for this node (only possible when `rune` is specified)." + ] + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:commando-listrunes#1", + "method": "commando-listrunes", + "params": "{}" + }, + { + "id": "example:commando-listrunes#2", + "method": "commando-listrunes", + "params": { + "rune": "Am3W_wI0PRn4qVNEsJ2iInHyFPQK8wfdqEXztm8-icQ9MA==" + } + }, + { + "id": "example:commando-listrunes#3", + "method": "commando-listrunes", + "params": { + "rune": "m_tyR0qqHUuLEbFJW6AhmBg-9npxVX2yKocQBFi9cvY9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJzJnBuYW1lbGV2ZWwhfHBuYW1lbGV2ZWwvaW8mcGFycjEhfHBhcnIxL2lv" + } + } + ], + "example_json_response": [ + { + "runes": [ + { + "rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==", + "unique_id": "0", + "restrictions": [], + "restrictions_as_english": "" + }, + { + "rune": "Am3W_wI0PRn4qVNEsJ2iInHyFPQK8wfdqEXztm8-icQ9MA==", + "stored": false, + "our_rune": false, + "unique_id": "1", + "restrictions": [], + "restrictions_as_english": "" + } + ] + }, + { + "runes": [ + { + "rune": "Am3W_wI0PRn4qVNEsJ2iInHyFPQK8wfdqEXztm8-icQ9MA==", + "stored": false, + "our_rune": false, + "unique_id": "1", + "restrictions": [], + "restrictions_as_english": "" + } + ] + }, + { + "runes": [ + { + "rune": "m_tyR0qqHUuLEbFJW6AhmBg-9npxVX2yKocQBFi9cvY9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJzJnBuYW1lbGV2ZWwhfHBuYW1lbGV2ZWwvaW8mcGFycjEhfHBhcnIxL2lv", + "stored": false, + "unique_id": "3", + "restrictions": [ + { + "alternatives": [ + { + "fieldname": "id", + "value": "022d223620a359a47ff7", + "condition": "^", + "english": "id starts with 022d223620a359a47ff7" + } + ], + "english": "id starts with 022d223620a359a47ff7" + }, + { + "alternatives": [ + { + "fieldname": "method", + "value": "listpeers", + "condition": "=", + "english": "method equal to listpeers" + } + ], + "english": "method equal to listpeers" + }, + { + "alternatives": [ + { + "fieldname": "pnamelevel", + "value": "", + "condition": "!", + "english": "pnamelevel is missing" + }, + { + "fieldname": "pnamelevel", + "value": "io", + "condition": "/", + "english": "pnamelevel unequal to io" + } + ], + "english": "pnamelevel is missing OR pnamelevel unequal to io" + }, + { + "alternatives": [ + { + "fieldname": "parr1", + "value": "", + "condition": "!", + "english": "parr1 is missing" + }, + { + "fieldname": "parr1", + "value": "io", + "condition": "/", + "english": "parr1 unequal to io" + } + ], + "english": "parr1 is missing OR parr1 unequal to io" + } + ], + "restrictions_as_english": "id starts with 022d223620a359a47ff7 AND method equal to listpeers AND pnamelevel is missing OR pnamelevel unequal to io AND parr1 is missing OR parr1 unequal to io" + } + ] + } + ], + "author": [ + "Shahana Farooqui <> is mainly responsible." + ], + "see_also": [ + "lightning-commando-rune(7)", + "lightning-commando-blacklist(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-commando-rune.json b/doc/schemas/lightning-commando-rune.json new file mode 100644 index 000000000000..10da1ee92edb --- /dev/null +++ b/doc/schemas/lightning-commando-rune.json @@ -0,0 +1,296 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "deprecated": [ + "v23.08", + "v23.05" + ], + "rpc": "commando-rune", + "title": "Command to Authorize Remote Peer Access", + "description": [ + "The **commando-rune** RPC command creates a base64 string called a *rune* which can be used to access commands on this node. Each *rune* contains a unique id (a number starting at 0), and can have restrictions inside it. Nobody can remove restrictions from a rune: if you try, the rune will be rejected. There is no limit on how many runes you can issue; the node simply decodes and checks them as they are received (we do store them for lightning-commando- listrunes(7) however)." + ], + "request": { + "required": [], + "properties": { + "rune": { + "type": "string", + "description": [ + "If supplied, the restrictions are simple appended to that *rune* (it doesn't need to be a rune belonging to this node). If not supplied, a new *rune* is constructed, with a new unique id." + ] + }, + "restrictions": { + "description": [ + "It can be the string `readonly`, or an array of restrictions.", + "Each restriction is an array of one or more alternatives, such as \"method is listpeers\", or \"method is listpeers OR time is before 2023\"." + ], + "oneOf": [ + { + "type": "array", + "description": [ + "Alternatives use a simple language to examine the command which is being run:", + " * time: the current UNIX time, e.g. \"time<1656759180\".", + " * id: the node_id of the peer, e.g. \"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\".", + " * method: the command being run, e.g. \"method=withdraw\".", + " * per: how often the rune can be used, with suffix \"sec\" (default), \"min\", \"hour\", \"day\" or \"msec\", \"usec\" or \"nsec\". e.g. \"per=5sec\".", + " * rate: the rate limit, per minute, e.g. \"rate=60\" is equivalent to \"per=1sec\".", + " * pnum: the number of parameters. e.g. \"pnum<2\".", + " * pnameX: the parameter named X (with any punctuation like `_` removed). e.g. \"pnamedestination=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T\".", + " * parrN: the N'th parameter. e.g. \"parr0=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T\"." + ], + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "type": "string", + "enum": [ + "readonly" + ], + "description": [ + "A rune which allows most *get* and *list* commands, and the *summary* command." + ] + } + ] + } + } + }, + "response": { + "required": [ + "rune", + "unique_id" + ], + "properties": { + "rune": { + "type": "string", + "description": [ + "The resulting rune." + ] + }, + "unique_id": { + "type": "string", + "description": [ + "The id of this rune: this is set at creation and cannot be changed (even as restrictions are added)." + ] + }, + "warning_unrestricted_rune": { + "type": "string", + "description": [ + "A warning shown when runes are created with powers that could drain your node." + ] + } + } + }, + "restriction_format": [ + "Restrictions are one or more alternatives. Each alternative is *name* *operator* *value*. The valid names are shown above.", + "", + "Note that if a value contains `\\`, it must be preceeded by another `\\` to form valid JSON:", + "* `=`: passes if equal ie. identical. e.g. `method=withdraw`", + "* `/`: not equals, e.g. `method/withdraw`", + "* `^`: starts with, e.g. `id^024b9a1fa8e006f1e3937f`", + "* `$`: ends with, e.g. `id$381df1cc449605`.", + "* `~`: contains, e.g. `id~006f1e3937f65f66c40`.", + "* `<`: is a decimal integer, and is less than. e.g. `time<1656759180`", + "* `>`: is a decimal integer, and is greater than. e.g. `time>1656759180`", + "* `{`: preceeds in alphabetical order (or matches but is shorter),", + " e.g. `id{02ff`.", + "* `}`: follows in alphabetical order (or matches but is longer),", + " e.g. `id}02ff`.", + "* `#`: a comment, ignored, e.g. `dumb example#`.", + "* `!`: only passes if the *name* does *not* exist. e.g. `pnamedestination!`.", + "Every other operator except `#` fails if *name* does not exist!" + ], + "example_usage": [ + "This creates a fresh rune which can do anything:", + "", + "```shell", + "$ lightning-cli commando-rune", + "{", + " \"rune\": \"KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA==\",", + " \"unique_id\": \"0\"", + "}", + "```", + "We can add restrictions to that rune, like so:", + "", + "```shell", + "$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions=readonly", + "{", + " \"rune\": \"NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl\",", + " \"unique_id\": \"0\"", + "}", + "```", + "The \"readonly\" restriction is a short-cut for two restrictions:", + "", + "1. `[\"method^list\", \"method^get\", \"method=summary\"]`: You may call list, get or summary.", + "2. `[\"method/listdatastore\"]`: But not listdatastore: that contains sensitive stuff!", + "", + "We can do the same manually, like so:", + "", + "```shell", + "$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions='[[\"method^list\", \"method^get\", \"method=summary\"],[\"method/listdatastore\"]]'", + "{", + " \"rune\": \"NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl\",", + " \"unique_id\": \"0\"", + "}", + "```", + "Let's create a rune which lets a specific peer (024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605) run \"listpeers\" on themselves:", + "", + "```shell", + "$ lightning-cli commando-rune restrictions='[[\"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"],[\"method=listpeers\"],[\"pnum=1\"],[\"pnameid=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\",\"parr0=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"]]'", + "{", + " \"rune\": \"FE8GHiGVvxcFqCQcClVRRiNE_XEeLYQzyG2jmqto4jM9MiZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDV8cGFycjA9MDI0YjlhMWZhOGUwMDZmMWUzOTM3ZjY1ZjY2YzQwOGU2ZGE4ZTFjYTcyOGVhNDMyMjJhNzM4MWRmMWNjNDQ5NjA1\",", + " \"unique_id\": \"2\"", + "}", + "```", + "This allows `listpeers` with 1 argument (`pnum=1`), which is either by name (`pnameid`), or position (`parr0`). We could shorten this in several ways: either allowing only positional or named parameters, or by testing the start of the parameters only. Here's an example which only checks the first 9 bytes of the `listpeers` parameter:", + "", + "```shell", + "$ lightning-cli commando-rune restrictions='[[\"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"],[\"method=listpeers\"],[\"pnum=1\"],[\"pnameid^024b9a1fa8e006f1e393\", \"parr0^024b9a1fa8e006f1e393\"]'", + " {", + " \"rune\": \"fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw==\",", + " \"unique_id\": \"3\"", + "}", + "```", + "Before we give this to our peer, let's add two more restrictions: that it only be usable for 24 hours from now (`time<`), and that it can only be used twice a minute (`rate=2`). `date +%s` can give us the current time in seconds:", + "", + "```shell", + "$ lightning-cli commando-rune rune=fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw== restrictions='[[\"time<'$(($(date +%s) + 24*60*60))'\",\"rate=2\"]]'", + "{", + " \"rune\": \"tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y\",", + " \"unique_id\": \"3\"", + "}", + "```", + "You can also use lightning-decode(7) to examine runes you have been given:", + "", + "```shell", + "$ lightning-cli decode tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y", + "{", + " \"type\": \"rune\",", + " \"unique_id\": \"3\",", + " \"string\": \"b54f912e33220e9636534a375b5a05a306abdfa4451a95a5a0f6d6f7e46e65da:=3&id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605&method=listpeers&pnum=1&pnameid^024b9a1fa8e006f1e393|parr0^024b9a1fa8e006f1e393&time<1656920538&rate=2\",", + " \"restrictions\": [", + " {", + " \"alternatives\": [", + " \"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"", + " ],", + " \"summary\": \"id (of commanding peer) equal to '024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605'\"", + " },", + " {", + " \"alternatives\": [", + " \"method=listpeers\"", + " ],", + " \"summary\": \"method (of command) equal to 'listpeers'\"", + " },", + " {", + " \"alternatives\": [", + " \"pnum=1\"", + " ],", + " \"summary\": \"pnum (number of command parameters) equal to 1\"", + " },", + " {", + " \"alternatives\": [", + " \"pnameid^024b9a1fa8e006f1e393\",", + " \"parr0^024b9a1fa8e006f1e393\"", + " ],", + " \"summary\": \"pnameid (object parameter 'id') starts with '024b9a1fa8e006f1e393' OR parr0 (array parameter #0) starts with '024b9a1fa8e006f1e393'\"", + " },", + " {", + " \"alternatives\": [", + " \"time<1656920538\"", + " ],", + " \"summary\": \"time (in seconds since 1970) less than 1656920538 (approximately 19 hours 18 minutes from now)\"", + " },", + " {", + " \"alternatives\": [", + " \"rate=2\"", + " ],", + " \"summary\": \"rate (max per minute) equal to 2\"", + " }", + " ],", + " \"valid\": true", + "}", + "```" + ], + "sharing_runes": [ + "Because anyone can add a restriction to a rune, you can always turn a normal rune into a read-only rune, or restrict access for 30 minutes from the time you give it to someone. Adding restrictions before sharing runes is best practice.", + "", + "If a rune has a ratelimit, any derived rune will have the same id, and thus will compete for that ratelimit. You might want to consider adding a tighter ratelimit to a rune before sharing it, so you will keep the remainder. For example, if you rune has a limit of 60 times per minute, adding a limit of 5 times per minute and handing that rune out means you can still use your original rune 55 times per minute." + ], + "example_json_request": [ + { + "id": "example:commando-rune#1", + "method": "commando-rune", + "params": "{}" + }, + { + "id": "example:commando-rune#2", + "method": "commando-rune", + "params": { + "restrictions": "readonly" + } + }, + { + "id": "example:commando-rune#3", + "method": "commando-rune", + "params": { + "restrictions": [ + [ + "id^022d223620a359a47ff7" + ], + [ + "method=listpeers" + ] + ] + } + }, + { + "id": "example:commando-rune#4", + "method": "commando-rune", + "params": { + "restrictions": [ + [ + "method=pay" + ], + [ + "pnameamountmsat<10000" + ] + ] + } + } + ], + "example_json_response": [ + { + "rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==", + "unique_id": "0", + "warning_unrestricted_rune": "WARNING: This rune has no restrictions! Anyone who has access to this rune could drain funds from your node. Be careful when giving this to apps that you don't trust. Consider using the restrictions parameter to only allow access to specific rpc methods." + }, + { + "rune": "zm0x_eLgHexaTvZn3Cz7gb_YlvrlYGDo_w4BYlR9SS09MSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", + "unique_id": "1" + }, + { + "rune": "YPojv9qgHPa3im0eiqRb-g8aRq76OasyfltGGqdFUOU9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJz", + "unique_id": "2" + }, + { + "rune": "b3hXuEM7Pqzk-C7HUw83xzvHOV7fmuGaWjdo-wHdfg89MCZtZXRob2Q9cGF5JnBuYW1lYW1vdW50bXNhdDwxMDAwMA==", + "unique_id": "3" + } + ], + "author": [ + "Rusty Russell <> wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page.", + "", + "Christian Decker came up with the name \"commando\", which almost excuses his previous adoption of the name \"Eltoo\"." + ], + "see_also": [ + "lightning-commando(7)", + "lightning-decode(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-commando.json b/doc/schemas/lightning-commando.json new file mode 100644 index 000000000000..ed6a29174178 --- /dev/null +++ b/doc/schemas/lightning-commando.json @@ -0,0 +1,183 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "commando", + "title": "Command to Send a Command to a Remote Peer", + "description": [ + "The **commando** RPC command is a homage to bad 80s movies. It also sends a directly-connected *peer_id* a custom message, containing a request to run *method* (with an optional dictionary of *params*); generally the peer will only allow you to run a command if it has provided you with a *rune* which allows it." + ], + "request": { + "required": [ + "peer_id", + "method" + ], + "properties": { + "peer_id": { + "type": "pubkey", + "description": [ + "Peer to command." + ] + }, + "method": { + "type": "string", + "description": [ + "Method to invoke on peer." + ] + }, + "params": { + "oneOf": [ + { + "type": "array", + "description": [ + "Array of positional parameters." + ] + }, + { + "type": "object", + "description": [ + "Parameters for method." + ] + } + ] + }, + "rune": { + "type": "string", + "description": [ + "Rune to authorize the command." + ] + }, + "filter": { + "type": "object", + "description": [ + "Filter to peer to apply to any successful result." + ] + } + } + }, + "response": { + "required": [], + "properties": {}, + "pre_return_value_notes": [ + "On success, the return depends on the *method* invoked." + ] + }, + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32600: Usually means peer is not connected", + "- 19535: the local commando plugin discovered an error.", + "- 19536: the remote commando plugin discovered an error.", + "- 19537: the remote commando plugin said we weren't authorized.", + "", + "It can also fail if the peer does not respond, in which case it will simply hang awaiting a response." + ], + "example_json_request": [ + { + "id": "example:commando#1", + "method": "commando", + "params": { + "peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "rune": "zm0x_eLgHexaTvZn3Cz7gb_YlvrlYGDo_w4BYlR9SS09MSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", + "method": "getinfo", + "params": {} + } + }, + { + "id": "example:commando#2", + "method": "commando", + "params": { + "peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "rune": "m_tyR0qqHUuLEbFJW6AhmBg-9npxVX2yKocQBFi9cvY9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJzJnBuYW1lbGV2ZWwhfHBuYW1lbGV2ZWwvaW8mcGFycjEhfHBhcnIxL2lv", + "method": "listpeers", + "params": [ + "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "broken" + ] + } + }, + { + "id": "example:commando#3", + "method": "commando", + "params": { + "peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "rune": "b3hXuEM7Pqzk-C7HUw83xzvHOV7fmuGaWjdo-wHdfg89MCZtZXRob2Q9cGF5JnBuYW1lYW1vdW50bXNhdDwxMDAwMA==", + "method": "pay", + "params": { + "bolt11": "lnbcrt1pja05v6sp5n6gnm380ckkrnhzvytz0hvym0vcf0mlrk586nlp72cq7e2hhhffspp5cwhuvl4jhlqep3st2703z89jp7j6wucm8ytlj7rk9ckk0mv7whysdq5v3jhxcmjd9c8g6t0dceqxqyjw5qcqp99qxpqysgq40udwjtktkry0yyq9408q5vtmj534h88j5nn562lamam0rtfqfu3093t2dhhc63qnqe5maa5jc9ad5pm08q2k2udvp6skw9f6ez9c9qptatlau", + "amount_msat": 9999 + } + } + } + ], + "example_json_response": [ + { + "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "alias": "JUNIORBEAM-v23.11-415-gd120eba", + "color": "0266e4", + "num_peers": 1, + "num_pending_channels": 0, + "num_active_channels": 0, + "num_inactive_channels": 0, + "address": [], + "binding": [ + { + "type": "ipv4", + "address": "127.0.0.1", + "port": 42513 + } + ], + "version": "v23.11-415-gd120eba", + "blockheight": 101, + "network": "regtest", + "fees_collected_msat": 0, + "lightning-dir": "/tmp/ltests-7u_8_rtu/test_commando_rune_1/lightning-1/regtest", + "our_features": { + "init": "08a0000a8a5961", + "node": "88a0000a8a5961", + "channel": "", + "invoice": "02000002024100" + } + }, + { + "peers": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "connected": true, + "num_channels": 0, + "netaddr": [ + "127.0.0.1:40119" + ], + "features": "08a0000a8a5961", + "log": [ + { + "type": "SKIPPED", + "num_skipped": 30 + } + ] + } + ] + }, + { + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "payment_hash": "c3afc67eb2bfc190c60b579f111cb20fa5a7731b3917f978762e2d67ed9e75c9", + "created_at": 1708642714.8110592, + "parts": 1, + "amount_msat": 9999, + "amount_sent_msat": 9999, + "payment_preimage": "17632717785b1a833a296ba1831cb968602872e68881c2f324e06e87979296dc", + "status": "complete" + } + ], + "author": [ + "Rusty Russell <> wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page.", + "", + "Christian Decker came up with the name \"commando\", which almost excuses his previous adoption of the name \"Eltoo\"." + ], + "see_also": [ + "lightning-commando-rune(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-connect.json b/doc/schemas/lightning-connect.json new file mode 100644 index 000000000000..a830bc4c30b6 --- /dev/null +++ b/doc/schemas/lightning-connect.json @@ -0,0 +1,228 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "connect", + "title": "Command for connecting to another lightning node", + "description": [ + "The **connect** RPC command establishes a new connection with another node in the Lightning Network.", + "", + "Connecting to a node is just the first step in opening a channel with another node. Once the peer is connected a channel can be opened with lightning-fundchannel(7).", + "", + "If there are active channels with the peer, **connect** returns once all the subdaemons are in place to handle the channels, not just once it's connected." + ], + "request": { + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string", + "description": [ + "The target node's public key. As a convenience, *id* may be of the form *id@host* or *id@host:port*. In this case, the *host* and *port* parameters must be omitted. This can fail if your C-lightning node is a fresh install that has not connected to any peers yet (your node has no gossip yet), or if the target *id* is a fresh install that has no channels yet (nobody will gossip about a node until it has one published channel)." + ] + }, + "host": { + "type": "string", + "description": [ + "The peer's hostname or IP address. If *host* is not specified (or doesn't work), the connection will be attempted to an IP belonging to *id* obtained through gossip with other already connected peers. If *host* begins with a `/` it is interpreted as a local path and the connection will be made to that local socket (see **bind-addr** in lightningd-config(5))." + ] + }, + "port": { + "type": "u16", + "description": [ + "The peer's port number. If not specified, the *port* depends on the current network:", + " * bitcoin **mainnet**: 9735.", + " * bitcoin **testnet**: 19735.", + " * bitcoin **signet**: 39735.", + " * bitcoin **regtest**: 19846." + ] + } + } + }, + "response": { + "required": [ + "id", + "features", + "direction", + "address" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The peer we connected to." + ] + }, + "features": { + "type": "hex", + "description": [ + "BOLT 9 features bitmap offered by peer." + ] + }, + "direction": { + "type": "string", + "enum": [ + "in", + "out" + ], + "description": [ + "Whether they initiated connection or we did." + ] + }, + "address": { + "type": "object", + "description": [ + "Address information (mainly useful if **direction** is *out*)." + ], + "additionalProperties": true, + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "local socket", + "ipv4", + "ipv6", + "torv2", + "torv3" + ], + "description": [ + "Type of connection (*torv2*/*torv3* only if **direction** is *out*)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "local socket" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "socket" + ], + "properties": { + "type": {}, + "socket": { + "type": "string", + "description": [ + "Socket filename." + ] + } + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "ipv4", + "ipv6", + "torv2", + "torv3" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "address", + "port" + ], + "properties": { + "type": {}, + "address": { + "type": "string", + "description": [ + "Address in expected format for **type**." + ] + }, + "port": { + "type": "u16", + "description": [ + "Port number." + ] + } + } + } + } + ] + } + } + }, + "errors": [ + "On failure, one of the following errors will be returned:", + "", + "- 400: Unable to connect, no address known for peer", + "- 401: If some addresses are known but connecting to all of them failed, the message will contain details about the failures", + "- 402: If the peer disconnected while we were connecting", + "- -32602: If the given parameters are wrong" + ], + "example_json_request": [ + { + "id": "example:connect#1", + "method": "connect", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "host": "localhost", + "port": 44619 + } + }, + { + "id": "example:connect#2", + "method": "connect", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "host": "127.0.0.1", + "port": 42839 + } + } + ], + "example_json_response": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "features": "08a0000a0a69a2", + "direction": "out", + "address": { + "type": "ipv4", + "address": "127.0.0.1", + "port": 44619 + } + }, + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "features": "08a0000a8a5961", + "direction": "out", + "address": { + "type": "ipv4", + "address": "127.0.0.1", + "port": 42839 + } + } + ], + "author": [ + "Rusty Russell <> is mainly responsible. Felix <> is the original author of this manpage." + ], + "see_also": [ + "lightning-fundchannel(7)", + "lightning-listpeers(7)", + "lightning-listchannels(7)", + "lightning-disconnect(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-createinvoice.json b/doc/schemas/lightning-createinvoice.json new file mode 100644 index 000000000000..7d0086013f08 --- /dev/null +++ b/doc/schemas/lightning-createinvoice.json @@ -0,0 +1,207 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "createinvoice", + "title": "Low-level invoice creation", + "description": [ + "The **createinvoice** RPC command signs and saves an invoice into the database." + ], + "request": { + "required": [ + "invstring", + "label", + "preimage" + ], + "properties": { + "invstring": { + "type": "string", + "description": [ + "The bolt11 form, but the final signature is ignored. Minimal sanity checks are done. (Note: if **experimental-offers** is enabled, *invstring* can actually be an unsigned bolt12 invoice)." + ] + }, + "label": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "description": [ + "A unique string or number (which is treated as a string, so `01` is different from `1`); it is never revealed to other nodes on the lightning network, but it can be used to query the status of this invoice." + ] + }, + "preimage": { + "type": "hex", + "description": [ + "The preimage to supply upon successful payment of the invoice." + ] + } + } + }, + "response": { + "required": [ + "label", + "created_index", + "payment_hash", + "status", + "description", + "expires_at" + ], + "properties": { + "label": { + "type": "string", + "description": [ + "The label for the invoice." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string (always present unless **bolt12** is)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string instead of **bolt11** (**experimental-offers** only)." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount of the invoice (if it has one)." + ] + }, + "status": { + "type": "string", + "enum": [ + "paid", + "expired", + "unpaid" + ], + "description": [ + "Whether it has been paid, or can no longer be paid." + ] + }, + "description": { + "type": "string", + "description": [ + "Description extracted from **bolt11** or **bolt12**." + ] + }, + "expires_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when invoice expires (or expired)." + ] + }, + "created_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was created in." + ] + }, + "pay_index": { + "type": "u64", + "description": [ + "Incrementing id for when this was paid (**status** *paid* only)." + ] + }, + "amount_received_msat": { + "type": "msat", + "description": [ + "Amount actually received (**status** *paid* only)." + ] + }, + "paid_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when invoice was paid (**status** *paid* only)." + ] + }, + "paid_outpoint": { + "type": "object", + "description": [ + "Outpoint this invoice was paid with (**status** *paid* only)." + ], + "added": "v23.11", + "additionalProperties": false, + "required": [ + "txid", + "outnum" + ], + "properties": { + "txid": { + "added": "v23.11", + "type": "txid", + "description": [ + "ID of the transaction that paid the invoice (**status** *paid* only)." + ] + }, + "outnum": { + "added": "v23.11", + "type": "u32", + "description": [ + "The 0-based output number of the transaction that paid the invoice (**status** *paid* only)." + ] + } + } + }, + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash**." + ] + }, + "local_offer_id": { + "type": "hex", + "description": [ + "The *id* of our offer which created this invoice (**experimental-offers** only)." + ], + "maxLength": 64, + "minLength": 64 + }, + "invreq_payer_note": { + "type": "string", + "description": [ + "The optional *invreq_payer_note* from invoice_request which created this invoice (**experimental-offers** only)." + ] + } + }, + "pre_return_value_notes": [ + "(Note: the return format is the same as lightning-listinvoices(7))." + ] + }, + "errors": [ + "On failure, an error is returned and no invoice is created. If the lightning process fails before responding, the caller should use lightning-listinvoices(7) to query whether this invoice was created or not.", + "", + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error.", + "- 900: An invoice with the given *label* already exists." + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-invoice(7)", + "lightning-listinvoices(7)", + "lightning-delinvoice(7)", + "lightning-getroute(7)", + "lightning-sendpay(7)", + "lightning-offer(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-createonion.json b/doc/schemas/lightning-createonion.json new file mode 100644 index 000000000000..277aa8578f2f --- /dev/null +++ b/doc/schemas/lightning-createonion.json @@ -0,0 +1,233 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "createonion", + "title": "Low-level command to create a custom onion", + "description": [ + "The **createonion** RPC command allows the caller to create a custom onion with custom payloads at each hop in the route. A custom onion can be used to implement protocol extensions that are not supported by Core Lightning directly." + ], + "request": { + "required": [ + "hops", + "assocdata" + ], + "properties": { + "hops": { + "type": "array", + "description": [ + "A JSON list of dicts, each specifying a node and the payload destined for that node." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "pubkey", + "payload" + ], + "properties": { + "pubkey": { + "type": "pubkey", + "description": [ + "Node pubkey." + ] + }, + "payload": { + "type": "hex", + "description": [ + "Payload to be sent to the node." + ] + } + } + } + }, + "assocdata": { + "type": "hex", + "description": [ + "The associated data that the onion should commit to. If the onion is to be used to send a payment later it MUST match the `payment_hash` of the payment in order to be valid." + ] + }, + "session_key": { + "type": "secret", + "description": [ + "Can be used to specify a secret that is used to generate the shared secrets used to encrypt the onion for each hop. It should only be used for testing or if a specific shared secret is important. If not specified it will be securely generated internally, and the shared secrets will be returned." + ] + }, + "onion_size": { + "type": "u16", + "description": [ + "A size different from the default payment onion (1300 bytes). May be used for custom protocols like trampoline routing." + ] + } + } + }, + "response": { + "required": [ + "onion", + "shared_secrets" + ], + "properties": { + "onion": { + "type": "hex", + "description": [ + "The onion packet (*onion_size* bytes)." + ] + }, + "shared_secrets": { + "type": "array", + "description": [ + "One shared secret for each node in the *hops* parameter." + ], + "items": { + "type": "secret", + "description": [ + "The shared secret with this hop." + ] + } + } + } + }, + "example_usage": [ + "The following is an example of a 3 hop onion:", + "", + "```json", + "[", + " {", + " \"pubkey\": \"022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59\",", + " \"payload\": \"11020203e904017b06080000670000010001\"", + " }, {", + " \"pubkey\": \"035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d\",", + " \"payload\": \"11020203e804017506080000670000030001\"", + " }, {", + " \"pubkey\": \"0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199\",", + " \"payload\": \"07020203e8040175\"", + " }", + "]", + "```", + "", + "The *hops* parameter is very similar to the result from `getroute` however it needs to be modified slightly. The following is the `getroute` response from which the above *hops* parameter was generated:", + "", + "```json", + "[", + " {", + " \"id\": \"022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59\",", + " \"channel\": \"103x2x1\",", + " \"direction\": 1,", + " \"msatoshi\": 1002,", + " \"amount_msat\": \"1002msat\",", + " \"delay\": 21,", + " }, {", + " \"id\": \"035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d\",", + " \"channel\": \"103x1x1\",", + " \"direction\": 0,", + " \"msatoshi\": 1001,", + " \"amount_msat\": \"1001msat\",", + " \"delay\": 15,", + " }, {", + " \"id\": \"0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199\",", + " \"channel\": \"103x3x1\",", + " \"direction\": 0,", + " \"msatoshi\": 1000,", + " \"amount_msat\": \"1000msat\",", + " \"delay\": 9,", + " }", + "]", + "```", + "", + " - Notice that the payload in the *hops* parameter is the hex-encoded TLV of the parameters in the `getroute` response, with length prepended as a `bigsize_t`.", + " - Except for the pubkey, the values are shifted left by one, i.e., the 1st payload in `createonion` corresponds to the 2nd set of values from `getroute`.", + " - The final payload is a copy of the last payload sans `channel`", + "", + "These rules are directly derived from the onion construction. Please refer BOLT 04 for details and rationale.", + "", + "The following example is the result of calling *createonion* with the above hops parameter:", + "", + " ```json", + " {", + " \"onion\": \"0003f3f80d2142b953319336d2fe4097[...]6af33fcf4fb113bce01f56dd62248a9e5fcbbfba35c\",", + " \"shared_secrets\": [", + " \"88ce98c73e4d9293ab1797b0a913fe9bca0213a566252047d01b8af6da871f3e\",", + " \"4474d296810e57bd460ef8b83d2e7d288321f8a99ff7686f87384699747bcfc4\",", + " \"2a862e4123e01799a732be487fbce297f7dc7cc1467e410f18369cfee476adc2\"", + " ]", + " }", + "```", + "", + "The `onion` corresponds to 1366 hex-encoded bytes. Each shared secret consists of 32 hex-encoded bytes. Both arguments can be passed on to **sendonion**." + ], + "example_json_request": [ + { + "id": "example:createonion#1", + "method": "createonion", + "params": { + "hops": [ + { + "pubkey": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "payload": "e4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "pubkey": "0324653eac434488002cc06bbfb7f10fe18991e35f9fe4302dbea6d2353dc0ab1c", + "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "pubkey": "027f31ebc5462c1fdce1b737ecff52d37d75dea43ce11c74d25aa297165faa2007", + "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "pubkey": "032c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991", + "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "pubkey": "02edabbd16b41c8371b92ef2f04c1185b4f03b6dcd52ba9b78d9d7c89c8f221145", + "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + ], + "assocdata": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", + "onion_size": 1301 + } + }, + { + "id": "example:createonion#2", + "method": "createonion", + "params": { + "hops": [ + { + "pubkey": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "payload": "0cfdb000084869207468657265" + } + ], + "assocdata": "36bf44cc8d80498b95eb05e36ae5811206d3a1d8b5c8d59bbcad035d386a4de8" + } + } + ], + "example_json_response": [ + { + "onion": "00034c3f9e11d92555260db3ee4ba0378a645d01c2556451f4289a1d9b43c7afa9a4f9ecc7010dafb26787bb583c514c3b3990d40c8168b1046659d7bc2512d2f1ee0afd2b87c42de2b70102b649634d211b38049593dbb6ed8ee8f93f0b9ff23cd9654c1341137711ce67751d40867cc90c290a9446be2b8a5a43641d4549505b13e807b4240b5b82ffaf22cb534cff01be46db3985ac83b7db465fbd86d4c8d472f60678946c71eca97dd5db732fe5a6d3765e5a5afad72f035207173e7eaaa0da4f0a4540472c7dd269a030428ae586a61b2a70a428055c3848427d2a2e8bd521aadbaf79d56ea39df63c059772e026d57f0b6844c1ab99e936beadf42aaa78193b05f7380e242258deeaa90db316a943d311ef4f2a08f422422c9da454f9666742ad61c6ae003bce83cf6243adf64a728ea50bdaf129ab2ac70e1988a117609cbefc01c884f86b2494349d1067f5cf17760cdab6ae076631693147e8712412d4f0b17cf288b394fd9e29419156ee629966553c2e7598631cbf7493820388eef1ae9f4d2f9da88872e8afbbedb3b46cd7c461cbe4c5491dc6f4a68bc244584bc79b1bb227c869fae16dab4b16412523c984d3ed2b872f63b95a62f66563d2b03c3d1b5fff0290411b293569ce8435b96b447be776b49395a8d94f48cb2f7699a38e8de58d6fff04075d226dcac07668512b6d2c20d4c49d03ad300a52769e4ebbacf97378633126958df1817effc12fd679723123df244fd9b5421f8a2aedb9a8b6fb4049e3a7cae3985059081239bea38351f0c90ed5a0ff45cc492e6ab353e4c13d22ff48912d6ecfda711edfb88dc0767ecfc5dddf8fb0e112a538aeee55c0f73b3b8afc4f40ef3588eabde5b95344a4525adf67841dd67b1db10da180fb346e0bd2958f095d011827063c42361964f8ac2c356d2ec1868a9498dcd6b5915a4df4601c58fcbeb688e14de61300f13183c154b3320cc8e80042a46f22d796f56ff1fdd7e28440c05f14b960c1d0a7c627b09295112bcb635b0e2447a9374fafc4a23ceaf9de4d10b29b2f6cabd7f0c7706cf0404452681d7372d559b644627b2695960deb3b4ae57028e0164b29d5ef9e701d3122b6a5715c502e1dca5252e8c215ed754b01a193041ad9751ed2fff1b55991e256edd6099a38004a367ad097c7caf953da302201263715517f6d32cff57969be994df42fd6cadb649e3c738be798f779aaf4c07cada6bf1e4115b74e2670baf4b1592c70b10a6c043b6606b428b3f79545dc8e9783c876e5402909858f9c604963c37fbc477137c8908e6cfa11ece18c8784a6f25428a5ee1e91d0095fe310d6a91139a7c5c6624bbfcaa15ee847a25b06f57332917f68526a6317f575792e9bcba8576a96bc5859b1f2a00fd8ab08a5ac4ab71833b0b711d1f120cbdb374bcedcdcbeba3806644f5082ec737a945221f5d99562fcbb02a43beeafb16ceecd4e35f06a04c9ff9f4f33725ab62cf22c36650280e4cfb9e150a2c4ebee7785108522e8ecb4682d2d751168e7597299346c3a5e885e36eda66b9a1112997111135767972d771b02c1a36c1d1fb1ce539ecfb98e9e1d8f8fdbf89aec28ad34ff5c00c1a4a8c59848dc8b64c0e65f6f10122e60b4adc1cfc602f49d6cfbdd54be6b0951d3f9cafe8cdd0428f9ce6994844e92d8b72d44edda623bad428b398f88643c3904bda16dd15e886ca4ef6ea7f1450744ac38ffce902569d2e9026bcedd6d0ee54aceabda22bf2de72cba89e6c274064619e32a1192cf2d78b56cf497f7785a6d599de9f8383d1f66f47fc385dc569ee1f08ddbbc7f1aeb0a0126fc4020d948dda10255f11e776db7a037059a40fde38a2ee0c0ce49c7f3df175881bf12371fa72fec3fba657107892a97efe41dcc18aeecd99f3e46c33cf42c2a0ba8b75cf000", + "shared_secrets": [ + "ccf2512684e2508cb4a842393757e6040b7d25e29d3a2031f29d00a000af6128", + "d4cec39fe6287d41165bf5c608b0c720a411208a83c64c805a012c86662a2e5a", + "91bc712ebd4a900e05830394ca8b1f1168777ecdd6996029d96ec8838b9903b9", + "93c373dcb14dc36ababa3e0c5c55869a667ca175e09913a98c3be67e6af97e16", + "b2642a5770a6b61ade071fdf69d3ea365cf48434fc2a2c399512778821a33e5c" + ] + }, + { + "onion": "0002cdce4bfaa9faa2c060afafe001b80bde07fc670e882c063a80b4738d5f78c9351825c6461cdfcd4fe4144d3b51f63da6351b28dd49c7bfdb0b4f7d8bda4ad0d99699eda39e551084c0a095746c358d1dc6d2eec8082f2aa2f69ae8f61b1f1437ae0ed673078fec6c0510a34058167ad1a34e819a3813d4cf27b2c4917a8c6ca3d70c3381a2a41b4c1b4540adf0e922e25f57d1cfc3064f29cfec4c17244160121975cab59b44c83b4a4905bf7ebfbd308de376334bf86d8aa92c674f7bcfec85680d73e9fee72642c98c603128e358c86e0bc88a60aaebc2637441a57261c61c6be145f00f2fc56164a6495f4b52d3172cb0ef52e91fa0d32a9ae2502d17433bda58d93fbc24a70ec6b5e740952a61404c7370eafe52599c7ee52e77b1cda87c46da98d2ff0d02fe09db5adcb2d2e9bcd083ef58392907b8a21681fa4ea1e4806b4676656457fea000fa504f9b4d159fe8b241266ac91dcc0351053c6dcc1493a6b02bed652cc8b92a8470c98924ebfde6ddc5cf7fd75f6e83a7350642053b70d4834179c30eb56d8c86656cda784daf3b6cd125779bec51099301e3f79f78d85d0454aef8bf5f9058491881b73e99b662b64080cd3eb16fd7f9d9640c18738736cfc15f391232b7df92f46ceb5abf08732ff833e9409ee541d7c926f7a0fe3e233d3eee4a63b65ab23b7c835b7cdd809ddfac8abb1df471fa66a54092815aa41e6fc1a026b86c5675d39c4e8c5c4b4acd48534165239f5634b9e828a7f9df94efcd2a39045efdee4d2f006a63ae828e6e90e3610c522085da6e0198141d6e501d83aba32057f4e59f9b7dfb0bf949c5ef91917cb54561d45a9e7ead049c57deb62d14ba6e18f5d7b0fb9f15e97bf5bd9f909f99c86c787357946654b87c489d34245d07fbb72119166e338b608a4178b452695235dd96bf7fd338e29a9f054ec1a63a442e12602d2329834297f6a197d8a377d608f402f0bcc936f45f33c8d2f9d40e5aef41816dd883add81ca20f1e0631457fe00aa2bd75c9165ffcd96c100c1db83a53aeee23d59f2a542ee3ba39ba62298ddfbd9ecfafd6b5d2121eb003ee23a2ebb8c6b6b687f42492c962510c5acf5231ff96635eba37354559ba39b042d9b6883cac662f418d7c62f9908b2a67964af5e5471804f7684e0d582b8bfec99816bb3442cca1d1fe4efd75d573ebf09fa9cad811063864fb14be4a7768ec2ddb118a77969e986c6584c4b20f8622941ca73d73562857d36e17a46a68d6e10147aaefff1ffb9809f0652a5f760148ed33550661b63c8176d5679e701c221d8a49d4062eb04010ea74cc1132fbeb8934c6e582ba2a16162b7e9171f95bce4ec3e339e70c781f95aaca406cd718b74397658fdefdd093486664be7ed13efa437012f1f57f9f1f4fb4eef7501ccf0e0ac4edc01fde138038c4dd65cb5c3291ad02a6728d6761b1afa35d49bd6ef117012bdd9bd6ee8a175620feb2249aa18d6175351b4bfc2b2b4fd57ff52f5969b109aa9b6cb2cde8f350917c0da2da1bc3d52eb0c7e6080b8f69c5783f2ed26feceb05ba4e7ed66676041d03d0acd3dd6343a85ac0b9c36f9640ddd0db884822f98dc42ea7911a6938dc14ba19d3d25a2b2f82794a2b5dd751dc856d7a9ccdb2d351a0b84e7030fa925ac949a37594f3aa2ba28ae5155b0aaac9c6820b8888d0b8a9db148513b9e3dbde68333ac30a0720289b6a0145d88629d49e76a6d3538330c5aececc9d54127b0a5a0e92d5a5a73beb71132c208b589cab61d53ed357c907929198c559426ae729b374a803dd3321a45ccca39efd39eddaba6e79a2f8911bdf74e18733dc7efc51132b5608d97fd2d0f22fa8961de04cdf6d0dbfbab21e362e7abaef3976f993088aa97ed3f1f4bcf3fffb012f583558bd2f15face9cba20b3e6754b70", + "shared_secrets": [ + "3f53c03f98eb83db88ff97c2c4004051ce23265ed2414a7aebf7a3e7078839ab" + ] + } + ], + "author": [ + "Christian Decker <> is mainly responsible." + ], + "see_also": [ + "lightning-sendonion(7)", + "lightning-getroute(7)" + ], + "resources": [ + "Main web site: ", + "", + "[BOLT 04](https://github.com/lightning/bolts/blob/master/04-onion-routing.md)" + ] +} diff --git a/doc/schemas/lightning-createrune.json b/doc/schemas/lightning-createrune.json new file mode 100644 index 000000000000..6bdde78f78d3 --- /dev/null +++ b/doc/schemas/lightning-createrune.json @@ -0,0 +1,280 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.08", + "rpc": "createrune", + "title": "Command to Create/Update Rune for Authorizing Remote Peer Access", + "description": [ + "The **createrune** RPC command creates a base64 string called a *rune* which can be used to access commands on this node. Each *rune* contains a unique id (a number starting at 0), and can have restrictions inside it. Nobody can remove restrictions from a rune: if you try, the rune will be rejected. There is no limit on how many runes you can issue; the node simply decodes and checks them as they are received.", + "", + "Oh, I almost forgot. Runes can also be invoked like in ancient times with the **invokerune** command. Feel the magical powers of a rune by invoking it." + ], + "request": { + "required": [], + "properties": { + "rune": { + "type": "string", + "description": [ + "If supplied, the restrictions are simple appended to that *rune* (it doesn't need to be a rune belonging to this node). If not supplied, a new *rune* is constructed, with a new unique id." + ] + }, + "restrictions": { + "description": [ + "It can be the string `readonly`, or an array of restrictions.", + "Each restriction is an array of one or more alternatives, such as \"method is listpeers\", or \"method is listpeers OR time is before 2023\"." + ], + "oneOf": [ + { + "type": "array", + "description": [ + "Alternatives use a simple language to examine the command which is being run:", + " * time: the current UNIX time, e.g. \"time<1656759180\".", + " * id: the node_id of the peer, e.g. \"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\".", + " * method: the command being run, e.g. \"method=withdraw\".", + " * per: how often the rune can be used, with suffix \"sec\" (default), \"min\", \"hour\", \"day\" or \"msec\", \"usec\" or \"nsec\". e.g. \"per=5sec\".", + " * rate: the rate limit, per minute, e.g. \"rate=60\" is equivalent to \"per=1sec\".", + " * pnum: the number of parameters. e.g. \"pnum<2\".", + " * pnameX: the parameter named X (with any punctuation like `_` removed). e.g. \"pnamedestination=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T\".", + " * parrN: the N'th parameter. e.g. \"parr0=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T\"." + ], + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "type": "string", + "enum": [ + "readonly" + ], + "description": [ + "A rune which allows most *get* and *list* commands, and the *summary* command." + ] + } + ] + } + } + }, + "response": { + "required": [ + "rune", + "unique_id" + ], + "properties": { + "rune": { + "type": "string", + "description": [ + "The resulting rune." + ] + }, + "unique_id": { + "type": "string", + "description": [ + "The id of this rune: this is set at creation and cannot be changed (even as restrictions are added)." + ] + }, + "warning_unrestricted_rune": { + "type": "string", + "description": [ + "A warning shown when runes are created with powers that could drain your node." + ] + } + } + }, + "restriction_format": [ + "Restrictions are one or more alternatives. Each alternative is *name* *operator* *value*. The valid names are shown above.", + "", + "Note that if a value contains `\\`, it must be preceeded by another `\\` to form valid JSON:", + "* `=`: passes if equal ie. identical. e.g. `method=withdraw`", + "* `/`: not equals, e.g. `method/withdraw`", + "* `^`: starts with, e.g. `id^024b9a1fa8e006f1e3937f`", + "* `$`: ends with, e.g. `id$381df1cc449605`.", + "* `~`: contains, e.g. `id~006f1e3937f65f66c40`.", + "* `<`: is a decimal integer, and is less than. e.g. `time<1656759180`", + "* `>`: is a decimal integer, and is greater than. e.g. `time>1656759180`", + "* `{`: preceeds in alphabetical order (or matches but is shorter),", + " e.g. `id{02ff`.", + "* `}`: follows in alphabetical order (or matches but is longer),", + " e.g. `id}02ff`.", + "* `#`: a comment, ignored, e.g. `dumb example#`.", + "* `!`: only passes if the *name* does *not* exist. e.g. `pnamedestination!`.", + "Every other operator except `#` fails if *name* does not exist!" + ], + "example_usage": [ + "This creates a fresh rune which can do anything:", + "", + "```shell", + "$ lightning-cli commando-rune", + "{", + " \"rune\": \"KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA==\",", + " \"unique_id\": \"0\"", + "}", + "```", + "We can add restrictions to that rune, like so:", + "", + "```shell", + "$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions=readonly", + "{", + " \"rune\": \"NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl\",", + " \"unique_id\": \"0\"", + "}", + "```", + "The \"readonly\" restriction is a short-cut for two restrictions:", + "", + "1. `[\"method^list\", \"method^get\", \"method=summary\"]`: You may call list, get or summary.", + "2. `[\"method/listdatastore\"]`: But not listdatastore: that contains sensitive stuff!", + "", + "We can do the same manually, like so:", + "", + "```shell", + "$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions='[[\"method^list\", \"method^get\", \"method=summary\"],[\"method/listdatastore\"]]'", + "{", + " \"rune\": \"NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl\",", + " \"unique_id\": \"0\"", + "}", + "```", + "Let's create a rune which lets a specific peer (024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605) run \"listpeers\" on themselves:", + "", + "```shell", + "$ lightning-cli commando-rune restrictions='[[\"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"],[\"method=listpeers\"],[\"pnum=1\"],[\"pnameid=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\",\"parr0=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"]]'", + "{", + " \"rune\": \"FE8GHiGVvxcFqCQcClVRRiNE_XEeLYQzyG2jmqto4jM9MiZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDV8cGFycjA9MDI0YjlhMWZhOGUwMDZmMWUzOTM3ZjY1ZjY2YzQwOGU2ZGE4ZTFjYTcyOGVhNDMyMjJhNzM4MWRmMWNjNDQ5NjA1\",", + " \"unique_id\": \"2\"", + "}", + "```", + "This allows `listpeers` with 1 argument (`pnum=1`), which is either by name (`pnameid`), or position (`parr0`). We could shorten this in several ways: either allowing only positional or named parameters, or by testing the start of the parameters only. Here's an example which only checks the first 9 bytes of the `listpeers` parameter:", + "", + "```shell", + "$ lightning-cli commando-rune restrictions='[[\"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"],[\"method=listpeers\"],[\"pnum=1\"],[\"pnameid^024b9a1fa8e006f1e393\", \"parr0^024b9a1fa8e006f1e393\"]'", + " {", + " \"rune\": \"fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw==\",", + " \"unique_id\": \"3\"", + "}", + "```", + "Before we give this to our peer, let's add two more restrictions: that it only be usable for 24 hours from now (`time<`), and that it can only be used twice a minute (`rate=2`). `date +%s` can give us the current time in seconds:", + "", + "```shell", + "$ lightning-cli commando-rune rune=fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw== restrictions='[[\"time<'$(($(date +%s) + 24*60*60))'\",\"rate=2\"]]'", + "{", + " \"rune\": \"tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y\",", + " \"unique_id\": \"3\"", + "}", + "```", + "You can also use lightning-decode(7) to examine runes you have been given:", + "", + "```shell", + "$ lightning-cli decode tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y", + "{", + " \"type\": \"rune\",", + " \"unique_id\": \"3\",", + " \"string\": \"b54f912e33220e9636534a375b5a05a306abdfa4451a95a5a0f6d6f7e46e65da:=3&id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605&method=listpeers&pnum=1&pnameid^024b9a1fa8e006f1e393|parr0^024b9a1fa8e006f1e393&time<1656920538&rate=2\",", + " \"restrictions\": [", + " {", + " \"alternatives\": [", + " \"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"", + " ],", + " \"summary\": \"id (of commanding peer) equal to '024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605'\"", + " },", + " {", + " \"alternatives\": [", + " \"method=listpeers\"", + " ],", + " \"summary\": \"method (of command) equal to 'listpeers'\"", + " },", + " {", + " \"alternatives\": [", + " \"pnum=1\"", + " ],", + " \"summary\": \"pnum (number of command parameters) equal to 1\"", + " },", + " {", + " \"alternatives\": [", + " \"pnameid^024b9a1fa8e006f1e393\",", + " \"parr0^024b9a1fa8e006f1e393\"", + " ],", + " \"summary\": \"pnameid (object parameter 'id') starts with '024b9a1fa8e006f1e393' OR parr0 (array parameter #0) starts with '024b9a1fa8e006f1e393'\"", + " },", + " {", + " \"alternatives\": [", + " \"time<1656920538\"", + " ],", + " \"summary\": \"time (in seconds since 1970) less than 1656920538 (approximately 19 hours 18 minutes from now)\"", + " },", + " {", + " \"alternatives\": [", + " \"rate=2\"", + " ],", + " \"summary\": \"rate (max per minute) equal to 2\"", + " }", + " ],", + " \"valid\": true", + "}", + "```" + ], + "sharing_runes": [ + "Because anyone can add a restriction to a rune, you can always turn a normal rune into a read-only rune, or restrict access for 30 minutes from the time you give it to someone. Adding restrictions before sharing runes is best practice.", + "", + "If a rune has a ratelimit, any derived rune will have the same id, and thus will compete for that ratelimit. You might want to consider adding a tighter ratelimit to a rune before sharing it, so you will keep the remainder. For example, if you rune has a limit of 60 times per minute, adding a limit of 5 times per minute and handing that rune out means you can still use your original rune 55 times per minute." + ], + "example_json_request": [ + { + "id": "example:createrune#1", + "method": "createrune", + "params": { + "restrictions": [ + [ + "method/getinfo" + ] + ] + } + }, + { + "id": "example:createrune#2", + "method": "createrune", + "params": { + "restrictions": "readonly" + } + }, + { + "id": "example:createrune#3", + "method": "createrune", + "params": [ + "enX0sTpHB8y1ktyTAF80CnEvGetG340Ne3AGItudBS49NCZwbnVtPTA=", + [ + [ + "rate=3" + ] + ] + ] + } + ], + "example_json_response": [ + { + "rune": "S5f-BKt3rR-cvJmujdpDCUQm_XLahfB4iQuDlwqMJiQ9MCZtZXRob2QvZ2V0aW5mbw==", + "unique_id": "0" + }, + { + "rune": "oVkzoiQ67VCU1h_aRjPqCeWktGX54ARDsqqQgDL-uMs9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", + "unique_id": "1" + }, + { + "rune": "_h2eKjoK7ITAF-JQ1S5oum9oMQesrz-t1FR9kDChRB49NCZwbnVtPTAmcmF0ZT0z", + "unique_id": "2" + } + ], + "author": [ + "Rusty Russell <> wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page.", + "", + "Shahana Farooqui <> is mainly responsible for migrating commando-rune to createrune." + ], + "see_also": [ + "lightning-commando-rune(7)", + "lightning-checkrune(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-datastore.json b/doc/schemas/lightning-datastore.json new file mode 100644 index 000000000000..87d70d3ac1b5 --- /dev/null +++ b/doc/schemas/lightning-datastore.json @@ -0,0 +1,203 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "datastore", + "title": "Command for storing (plugin) data", + "description": [ + "The **datastore** RPC command allows plugins to store data in the Core Lightning database, for later retrieval." + ], + "request": { + "required": [ + "key" + ], + "properties": { + "key": { + "description": [ + "A key can either have children or a value, never both: parents are created and removed automatically." + ], + "oneOf": [ + { + "type": "array", + "description": [ + "An array of values to form a hierarchy (though a single value is treated as a one-element array). Using the first element of the key as the plugin name (e.g. `[ 'summary' ]`) is recommended." + ], + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] + }, + "string": { + "type": "string", + "description": [ + "Data to be saved in string format." + ] + }, + "hex": { + "type": "hex", + "description": [ + "Data to be saved in hex format." + ] + }, + "mode": { + "type": "string", + "description": [ + "Write mode to determine how the record is updated:", + " * `must-create`: fails if it already exists.", + " * `must-replace`: fails if it doesn't already exist.", + " * `create-or-replace`: never fails.", + " * `must-append`: must already exist, append this to what's already there.", + " * `create-or-append`: append if anything is there, otherwise create." + ], + "enum": [ + "must-create", + "must-replace", + "create-or-replace", + "must-append", + "create-or-append" + ], + "default": "`must-create`" + }, + "generation": { + "type": "u64", + "description": [ + "If specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with *mode* `must-replace` or `must-append`." + ] + } + } + }, + "response": { + "required": [ + "key" + ], + "properties": { + "key": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Part of the key added to the datastore." + ] + } + }, + "generation": { + "type": "u64", + "description": [ + "The number of times this has been updated." + ] + }, + "hex": { + "type": "hex", + "description": [ + "The hex data which has been added to the datastore." + ] + }, + "string": { + "type": "string", + "description": [ + "The data as a string, if it's valid utf-8." + ] + } + } + }, + "errors": [ + "The following error codes may occur:", + "", + "- 1202: The key already exists (and mode said it must not)", + "- 1203: The key does not exist (and mode said it must)", + "- 1204: The generation was wrong (and generation was specified)", + "- 1205: The key has children already.", + "- 1206: One of the parents already exists with a value.", + "- -32602: invalid parameters" + ], + "example_json_request": [ + { + "id": "example:datastore#1", + "method": "datastore", + "params": { + "key": [ + "test_libplugin", + "name" + ], + "string": "foobar", + "hex": null, + "mode": "must-replace", + "generation": null + } + }, + { + "id": "example:datastore#2", + "method": "datastore", + "params": { + "key": "somekey", + "string": null, + "hex": "61", + "mode": "create-or-append", + "generation": null + } + }, + { + "id": "example:datastore#3", + "method": "datastore", + "params": { + "key": [ + "a", + "d", + "e", + "f", + "g" + ], + "string": "somedatatostoreinthedatastore", + "hex": null, + "mode": null, + "generation": null + } + } + ], + "example_json_response": [ + { + "key": [ + "test_libplugin", + "name" + ], + "generation": 1, + "hex": "666f6f626172", + "string": "foobar" + }, + { + "key": [ + "somekey" + ], + "generation": 3, + "hex": "736f6d6564617461", + "string": "somedata" + }, + { + "key": [ + "a", + "d", + "e", + "f", + "g" + ], + "generation": 0, + "hex": "736f6d6564617461746f73746f7265696e7468656461746173746f7265", + "string": "somedatatostoreinthedatastore" + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listdatastore(7)", + "lightning-deldatastore(7)", + "lightning-datastoreusage(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-datastoreusage.json b/doc/schemas/lightning-datastoreusage.json new file mode 100644 index 000000000000..92ef6e9c09d4 --- /dev/null +++ b/doc/schemas/lightning-datastoreusage.json @@ -0,0 +1,122 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.11", + "rpc": "datastoreusage", + "title": "Command for listing datastore usage info", + "description": [ + "The **datastoreusage** RPC command allows the caller to fetch the total bytes that are stored under a certain *key* (or from the root), including the size of the *key*.", + "", + "All descendants of the *key* (or root) are taken into account." + ], + "request": { + "required": [], + "properties": { + "key": { + "oneOf": [ + { + "type": "array", + "description": [ + "Key is an array of values (though a single value is treated as a one-element array). Used as the starting point to traverse the datastore." + ], + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] + } + } + }, + "response": { + "required": [ + "datastoreusage" + ], + "properties": { + "datastoreusage": { + "type": "object", + "additionalProperties": false, + "required": [ + "key", + "total_bytes" + ], + "properties": { + "key": { + "type": "string", + "added": "v23.11", + "description": [ + "The key from which the database was traversed." + ] + }, + "total_bytes": { + "type": "u64", + "added": "v23.11", + "description": [ + "The total bytes that are stored under the *key*, including the all descendants data and the size of the keys themselves." + ] + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:datastoreusage#1", + "method": "datastoreusage", + "params": { + "key": null + } + }, + { + "id": "example:datastoreusage#2", + "method": "datastoreusage", + "params": { + "key": "a" + } + }, + { + "id": "example:datastoreusage#3", + "method": "datastoreusage", + "params": { + "key": [ + "a", + "thisissomelongkeythattriestostore46bytesofdata" + ] + } + } + ], + "example_json_response": [ + { + "datastoreusage": { + "key": "[]", + "total_bytes": 0 + } + }, + { + "datastoreusage": { + "key": "[a]", + "total_bytes": 32 + } + }, + { + "datastoreusage": { + "key": "[a,thisissomelongkeythattriestostore46bytesofdata]", + "total_bytes": 77 + } + } + ], + "author": [ + "Peter Neuroth <> is mainly responsible." + ], + "see_also": [ + "lightning-datastore(7)", + "lightning-deldatastore(7)", + "lightning-listdatastore(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-decode.json b/doc/schemas/lightning-decode.json new file mode 100644 index 000000000000..2cdef3ad1007 --- /dev/null +++ b/doc/schemas/lightning-decode.json @@ -0,0 +1,2096 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.05", + "rpc": "decode", + "title": "Command for decoding an invoice string (low-level)", + "description": [ + "The **decode** RPC command checks and parses `bolt11`, `bolt12`, `rune` or `emergency_recover`. It may decode other formats in future." + ], + "request": { + "required": [ + "string" + ], + "properties": { + "string": { + "type": "string", + "description": [ + "Value to be decoded:", + " * a *bolt11* or *bolt12* string (optionally prefixed by `lightning:` or `LIGHTNING:`) as specified by the BOLT 11 and BOLT 12 specifications.", + " * a *rune* as created by lightning-commando-rune(7).", + " * an *emergency_recover* string generated by hsmtool like `lightning-hsmtool getemergencyrecover `. It holds `emergency.recover` contents and starts with `clnemerg1`." + ] + } + } + }, + "response": { + "required": [ + "type", + "valid" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt12 offer", + "bolt12 invoice", + "bolt12 invoice_request", + "bolt11 invoice", + "rune", + "emergency recover" + ], + "description": [ + "What kind of object it decoded to." + ] + }, + "valid": { + "type": "boolean", + "description": [ + "If this is false, you *MUST* not use the result except for diagnostics!" + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt12 offer" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "required": [ + "offer_id", + "offer_node_id", + "offer_description" + ], + "additionalProperties": false, + "properties": { + "type": {}, + "valid": {}, + "offer_id": { + "type": "hex", + "description": [ + "The id we use to identify this offer." + ], + "maxLength": 64, + "minLength": 64 + }, + "offer_chains": { + "type": "array", + "description": [ + "Which blockchains this offer is for (missing implies bitcoin mainnet only)." + ], + "items": { + "type": "hash", + "description": [ + "The genesis blockhash." + ] + } + }, + "offer_metadata": { + "type": "hex", + "description": [ + "Any metadata the creator of the offer includes." + ] + }, + "offer_currency": { + "type": "string", + "description": [ + "ISO 4217 code of the currency (missing implies Bitcoin)." + ], + "maxLength": 3, + "minLength": 3 + }, + "warning_unknown_offer_currency": { + "type": "string", + "description": [ + "The currency code is unknown (so no `currency_minor_unit`)." + ] + }, + "currency_minor_unit": { + "type": "u32", + "description": [ + "The number of decimal places to apply to amount (if currency known)." + ] + }, + "offer_amount": { + "type": "u64", + "description": [ + "The amount in the `offer_currency` adjusted by `currency_minor_unit`, if any." + ] + }, + "offer_amount_msat": { + "type": "msat", + "description": [ + "The amount in bitcoin (if specified, and no `offer_currency`)." + ] + }, + "offer_description": { + "type": "string", + "description": [ + "The description of the purpose of the offer." + ] + }, + "offer_issuer": { + "type": "string", + "description": [ + "The description of the creator of the offer." + ] + }, + "offer_features": { + "type": "hex", + "description": [ + "The feature bits of the offer." + ] + }, + "offer_absolute_expiry": { + "type": "u64", + "description": [ + "UNIX timestamp of when this offer expires." + ] + }, + "offer_quantity_max": { + "type": "u64", + "description": [ + "The maximum quantity (or, if 0, means any quantity)." + ] + }, + "offer_paths": { + "type": "array", + "description": [ + "Paths to the destination." + ], + "items": { + "type": "object", + "required": [ + "first_node_id", + "blinding", + "path" + ], + "additionalProperties": false, + "properties": { + "first_node_id": { + "type": "pubkey", + "description": [ + "The (presumably well-known) public key of the start of the path." + ] + }, + "blinding": { + "type": "pubkey", + "description": [ + "Blinding factor for this path." + ] + }, + "path": { + "type": "array", + "description": [ + "An individual path." + ], + "items": { + "type": "object", + "required": [ + "blinded_node_id", + "encrypted_recipient_data" + ], + "additionalProperties": false, + "properties": { + "blinded_node_id": { + "type": "pubkey", + "description": [ + "Node_id of the hop." + ] + }, + "encrypted_recipient_data": { + "type": "hex", + "description": [ + "Encrypted TLV entry for this hop." + ] + } + } + } + } + } + } + }, + "offer_node_id": { + "type": "pubkey", + "description": [ + "Public key of the offering node." + ] + }, + "offer_recurrence": { + "type": "object", + "description": [ + "How often to this offer should be used." + ], + "required": [ + "period", + "time_unit" + ], + "additionalProperties": false, + "properties": { + "time_unit": { + "type": "u32", + "description": [ + "The BOLT12 time unit." + ] + }, + "time_unit_name": { + "type": "string", + "description": [ + "The name of `time_unit` (if valid)." + ] + }, + "period": { + "type": "u32", + "description": [ + "How many `time_unit` per payment period." + ] + }, + "basetime": { + "type": "u64", + "description": [ + "Period starts at this UNIX timestamp." + ] + }, + "start_any_period": { + "type": "u64", + "description": [ + "You can start at any period (only if `basetime` present)." + ] + }, + "limit": { + "type": "u32", + "description": [ + "Maximum period number for recurrence." + ] + }, + "paywindow": { + "type": "object", + "description": [ + "When within a period will payment be accepted." + ], + "default": "prior and during the period", + "required": [ + "seconds_before", + "seconds_after" + ], + "additionalProperties": false, + "properties": { + "seconds_before": { + "type": "u32", + "description": [ + "Seconds prior to period start." + ] + }, + "seconds_after": { + "type": "u32", + "description": [ + "Seconds after to period start." + ] + }, + "proportional_amount": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Amount should be scaled if paid after period start." + ] + } + } + } + } + }, + "unknown_offer_tlvs": { + "type": "array", + "description": [ + "Any extra fields we didn't know how to parse." + ], + "items": { + "type": "object", + "required": [ + "type", + "length", + "value" + ], + "additionalProperties": false, + "properties": { + "type": { + "type": "u64", + "description": [ + "The type." + ] + }, + "length": { + "type": "u64", + "description": [ + "The length." + ] + }, + "value": { + "type": "hex", + "description": [ + "The value." + ] + } + } + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt12 offer" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + false + ] + } + } + }, + "then": { + "required": [], + "additionalProperties": false, + "properties": { + "type": {}, + "valid": {}, + "offer_id": {}, + "node_id": {}, + "signature": {}, + "chains": {}, + "currency": {}, + "minor_unit": {}, + "warning_unknown_offer_currency": {}, + "amount": {}, + "amount_msat": {}, + "send_invoice": {}, + "description": {}, + "vendor": {}, + "features": {}, + "absolute_expiry": {}, + "paths": {}, + "quantity_max": {}, + "unknown_offer_tlvs": {}, + "recurrence": {}, + "warning_missing_offer_node_id": { + "type": "string", + "description": [ + "`offer_node_id` is not present." + ] + }, + "warning_invalid_offer_description": { + "type": "string", + "description": [ + "`offer_description` is not valid UTF8." + ] + }, + "warning_missing_offer_description": { + "type": "string", + "description": [ + "`offer_description` is not present." + ] + }, + "warning_invalid_offer_currency": { + "type": "string", + "description": [ + "`offer_currency_code` is not valid UTF8." + ] + }, + "warning_invalid_offer_issuer": { + "type": "string", + "description": [ + "`offer_issuer` is not valid UTF8." + ] + } + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt12 invoice_request" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "required": [ + "offer_node_id", + "offer_description", + "invreq_metadata", + "invreq_payer_id", + "signature" + ], + "additionalProperties": false, + "properties": { + "type": {}, + "valid": {}, + "offer_id": { + "type": "hex", + "description": [ + "The id we use to identify this offer." + ], + "maxLength": 64, + "minLength": 64 + }, + "offer_chains": { + "type": "array", + "description": [ + "Which blockchains this offer is for (missing implies bitcoin mainnet only)." + ], + "items": { + "type": "hex", + "description": [ + "The genesis blockhash." + ], + "maxLength": 64, + "minLength": 64 + } + }, + "offer_metadata": { + "type": "hex", + "description": [ + "Any metadata the creator of the offer includes." + ] + }, + "offer_currency": { + "type": "string", + "description": [ + "ISO 4217 code of the currency (missing implies Bitcoin)." + ], + "maxLength": 3, + "minLength": 3 + }, + "warning_unknown_offer_currency": { + "type": "string", + "description": [ + "The currency code is unknown (so no `currency_minor_unit`)." + ] + }, + "currency_minor_unit": { + "type": "u32", + "description": [ + "The number of decimal places to apply to amount (if currency known)." + ] + }, + "offer_amount": { + "type": "u64", + "description": [ + "The amount in the `offer_currency` adjusted by `currency_minor_unit`, if any." + ] + }, + "offer_amount_msat": { + "type": "msat", + "description": [ + "The amount in bitcoin (if specified, and no `offer_currency`)." + ] + }, + "offer_description": { + "type": "string", + "description": [ + "The description of the purpose of the offer." + ] + }, + "offer_issuer": { + "type": "string", + "description": [ + "The description of the creator of the offer." + ] + }, + "offer_features": { + "type": "hex", + "description": [ + "The feature bits of the offer." + ] + }, + "offer_absolute_expiry": { + "type": "u64", + "description": [ + "UNIX timestamp of when this offer expires." + ] + }, + "offer_quantity_max": { + "type": "u64", + "description": [ + "The maximum quantity (or, if 0, means any quantity)." + ] + }, + "offer_paths": { + "type": "array", + "description": [ + "Paths to the destination." + ], + "items": { + "type": "object", + "required": [ + "first_node_id", + "blinding", + "path" + ], + "additionalProperties": false, + "properties": { + "first_node_id": { + "type": "pubkey", + "description": [ + "The (presumably well-known) public key of the start of the path." + ] + }, + "blinding": { + "type": "pubkey", + "description": [ + "Blinding factor for this path." + ] + }, + "path": { + "type": "array", + "description": [ + "An individual path." + ], + "items": { + "type": "object", + "required": [ + "blinded_node_id", + "encrypted_recipient_data" + ], + "additionalProperties": false, + "properties": { + "blinded_node_id": { + "type": "pubkey", + "description": [ + "Node_id of the hop." + ] + }, + "encrypted_recipient_data": { + "type": "hex", + "description": [ + "Encrypted TLV entry for this hop." + ] + } + } + } + } + } + } + }, + "offer_node_id": { + "type": "pubkey", + "description": [ + "Public key of the offering node." + ] + }, + "offer_recurrence": { + "type": "object", + "description": [ + "How often to this offer should be used." + ], + "required": [ + "period", + "time_unit" + ], + "additionalProperties": false, + "properties": { + "time_unit": { + "type": "u32", + "description": [ + "The BOLT12 time unit." + ] + }, + "time_unit_name": { + "type": "string", + "description": [ + "The name of `time_unit` (if valid)." + ] + }, + "period": { + "type": "u32", + "description": [ + "How many `time_unit` per payment period." + ] + }, + "basetime": { + "type": "u64", + "description": [ + "Period starts at this UNIX timestamp." + ] + }, + "start_any_period": { + "type": "u64", + "description": [ + "You can start at any period (only if `basetime` present)." + ] + }, + "limit": { + "type": "u32", + "description": [ + "Maximum period number for recurrence." + ] + }, + "paywindow": { + "type": "object", + "description": [ + "When within a period will payment be accepted." + ], + "default": "prior and during the period", + "required": [ + "seconds_before", + "seconds_after" + ], + "additionalProperties": false, + "properties": { + "seconds_before": { + "type": "u32", + "description": [ + "Seconds prior to period start." + ] + }, + "seconds_after": { + "type": "u32", + "description": [ + "Seconds after to period start." + ] + }, + "proportional_amount": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Amount should be scaled if paid after period start." + ] + } + } + } + } + }, + "invreq_metadata": { + "type": "hex", + "description": [ + "The payer-provided blob to derive invreq_payer_id." + ] + }, + "invreq_payer_id": { + "type": "hex", + "description": [ + "The payer-provided key." + ] + }, + "invreq_chain": { + "type": "hex", + "description": [ + "Which blockchain this offer is for (missing implies bitcoin mainnet only)." + ], + "maxLength": 64, + "minLength": 64 + }, + "invreq_amount_msat": { + "type": "msat", + "description": [ + "The amount the invoice should be for." + ] + }, + "invreq_features": { + "type": "hex", + "description": [ + "The feature bits of the invoice_request." + ] + }, + "invreq_quantity": { + "type": "u64", + "description": [ + "The number of items to invoice for." + ] + }, + "invreq_payer_note": { + "type": "string", + "description": [ + "A note attached by the payer." + ] + }, + "invreq_recurrence_counter": { + "type": "u32", + "description": [ + "Which number request this is for the same invoice." + ] + }, + "invreq_recurrence_start": { + "type": "u32", + "description": [ + "When we're requesting to start an invoice at a non-zero period." + ] + }, + "signature": { + "type": "bip340sig", + "description": [ + "BIP-340 signature of the `invreq_payer_id` on this invoice_request." + ] + }, + "unknown_invoice_request_tlvs": { + "type": "array", + "description": [ + "Any extra fields we didn't know how to parse." + ], + "items": { + "type": "object", + "required": [ + "type", + "length", + "value" + ], + "additionalProperties": false, + "properties": { + "type": { + "type": "u64", + "description": [ + "The type." + ] + }, + "length": { + "type": "u64", + "description": [ + "The length." + ] + }, + "value": { + "type": "hex", + "description": [ + "The value." + ] + } + } + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt12 invoice_request" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + false + ] + } + } + }, + "then": { + "required": [], + "additionalProperties": false, + "properties": { + "type": {}, + "valid": {}, + "offer_id": {}, + "offer_chains": {}, + "offer_metadata": {}, + "offer_currency": {}, + "warning_unknown_offer_currency": {}, + "currency_minor_unit": {}, + "offer_amount": {}, + "offer_amount_msat": {}, + "offer_description": {}, + "offer_issuer": {}, + "offer_features": {}, + "offer_absolute_expiry": {}, + "offer_quantity_max": {}, + "offer_paths": {}, + "offer_node_id": {}, + "offer_recurrence": {}, + "invreq_metadata": {}, + "invreq_payer_id": {}, + "invreq_chain": {}, + "invreq_amount_msat": {}, + "invreq_features": {}, + "invreq_quantity": {}, + "invreq_payer_note": {}, + "invreq_recurrence_counter": {}, + "invreq_recurrence_start": {}, + "warning_invalid_offer_description": { + "type": "string", + "description": [ + "`offer_description` is not valid UTF8." + ] + }, + "warning_missing_offer_description": { + "type": "string", + "description": [ + "`offer_description` is not present." + ] + }, + "warning_invalid_offer_currency": { + "type": "string", + "description": [ + "`offer_currency_code` is not valid UTF8." + ] + }, + "warning_invalid_offer_issuer": { + "type": "string", + "description": [ + "`offer_issuer` is not valid UTF8." + ] + }, + "warning_missing_invreq_metadata": { + "type": "string", + "description": [ + "`invreq_metadata` is not present." + ] + }, + "warning_missing_invreq_payer_id": { + "type": "string", + "description": [ + "`invreq_payer_id` is not present." + ] + }, + "warning_invalid_invreq_payer_note": { + "type": "string", + "description": [ + "`invreq_payer_note` is not valid UTF8." + ] + }, + "warning_missing_invoice_request_signature": { + "type": "string", + "description": [ + "`signature` is not present." + ] + }, + "warning_invalid_invoice_request_signature": { + "type": "string", + "description": [ + "Incorrect `signature`." + ] + } + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt12 invoice" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "required": [ + "offer_node_id", + "offer_description", + "invreq_metadata", + "invreq_payer_id", + "invoice_paths", + "invoice_created_at", + "invoice_payment_hash", + "invoice_amount_msat", + "signature" + ], + "additionalProperties": false, + "properties": { + "type": {}, + "valid": {}, + "offer_id": { + "type": "hex", + "description": [ + "The id we use to identify this offer." + ], + "maxLength": 64, + "minLength": 64 + }, + "offer_chains": { + "type": "array", + "description": [ + "Which blockchains this offer is for (missing implies bitcoin mainnet only)." + ], + "items": { + "type": "hex", + "description": [ + "The genesis blockhash." + ], + "maxLength": 64, + "minLength": 64 + } + }, + "offer_metadata": { + "type": "hex", + "description": [ + "Any metadata the creator of the offer includes." + ] + }, + "offer_currency": { + "type": "string", + "description": [ + "ISO 4217 code of the currency (missing implies Bitcoin)." + ], + "maxLength": 3, + "minLength": 3 + }, + "warning_unknown_offer_currency": { + "type": "string", + "description": [ + "The currency code is unknown (so no `currency_minor_unit`)." + ] + }, + "currency_minor_unit": { + "type": "u32", + "description": [ + "The number of decimal places to apply to amount (if currency known)." + ] + }, + "offer_amount": { + "type": "u64", + "description": [ + "The amount in the `offer_currency` adjusted by `currency_minor_unit`, if any." + ] + }, + "offer_amount_msat": { + "type": "msat", + "description": [ + "The amount in bitcoin (if specified, and no `offer_currency`)." + ] + }, + "offer_description": { + "type": "string", + "description": [ + "The description of the purpose of the offer." + ] + }, + "offer_issuer": { + "type": "string", + "description": [ + "The description of the creator of the offer." + ] + }, + "offer_features": { + "type": "hex", + "description": [ + "The feature bits of the offer." + ] + }, + "offer_absolute_expiry": { + "type": "u64", + "description": [ + "UNIX timestamp of when this offer expires." + ] + }, + "offer_quantity_max": { + "type": "u64", + "description": [ + "The maximum quantity (or, if 0, means any quantity)." + ] + }, + "offer_paths": { + "type": "array", + "description": [ + "Paths to the destination." + ], + "items": { + "type": "object", + "required": [ + "first_node_id", + "blinding", + "path" + ], + "additionalProperties": false, + "properties": { + "first_node_id": { + "type": "pubkey", + "description": [ + "The (presumably well-known) public key of the start of the path." + ] + }, + "blinding": { + "type": "pubkey", + "description": [ + "Blinding factor for this path." + ] + }, + "path": { + "type": "array", + "description": [ + "An individual path." + ], + "items": { + "type": "object", + "required": [ + "blinded_node_id", + "encrypted_recipient_data" + ], + "additionalProperties": false, + "properties": { + "blinded_node_id": { + "type": "pubkey", + "description": [ + "Node_id of the hop." + ] + }, + "encrypted_recipient_data": { + "type": "hex", + "description": [ + "Encrypted TLV entry for this hop." + ] + } + } + } + } + } + } + }, + "offer_node_id": { + "type": "pubkey", + "description": [ + "Public key of the offering node." + ] + }, + "offer_recurrence": { + "type": "object", + "description": [ + "How often to this offer should be used." + ], + "required": [ + "period", + "time_unit" + ], + "additionalProperties": false, + "properties": { + "time_unit": { + "type": "u32", + "description": [ + "The BOLT12 time unit." + ] + }, + "time_unit_name": { + "type": "string", + "description": [ + "The name of `time_unit` (if valid)." + ] + }, + "period": { + "type": "u32", + "description": [ + "How many `time_unit` per payment period." + ] + }, + "basetime": { + "type": "u64", + "description": [ + "Period starts at this UNIX timestamp." + ] + }, + "start_any_period": { + "type": "u64", + "description": [ + "You can start at any period (only if `basetime` present)." + ] + }, + "limit": { + "type": "u32", + "description": [ + "Maximum period number for recurrence." + ] + }, + "paywindow": { + "type": "object", + "description": [ + "When within a period will payment be accepted." + ], + "default": "prior and during the period", + "required": [ + "seconds_before", + "seconds_after" + ], + "additionalProperties": false, + "properties": { + "seconds_before": { + "type": "u32", + "description": [ + "Seconds prior to period start." + ] + }, + "seconds_after": { + "type": "u32", + "description": [ + "Seconds after to period start." + ] + }, + "proportional_amount": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Amount should be scaled if paid after period start." + ] + } + } + } + } + }, + "invreq_metadata": { + "type": "hex", + "description": [ + "The payer-provided blob to derive invreq_payer_id." + ] + }, + "invreq_payer_id": { + "type": "hex", + "description": [ + "The payer-provided key." + ] + }, + "invreq_chain": { + "type": "hex", + "description": [ + "Which blockchain this offer is for (missing implies bitcoin mainnet only)." + ], + "maxLength": 64, + "minLength": 64 + }, + "invreq_amount_msat": { + "type": "msat", + "description": [ + "The amount the invoice should be for." + ] + }, + "invreq_features": { + "type": "hex", + "description": [ + "The feature bits of the invoice_request." + ] + }, + "invreq_quantity": { + "type": "u64", + "description": [ + "The number of items to invoice for." + ] + }, + "invreq_payer_note": { + "type": "string", + "description": [ + "A note attached by the payer." + ] + }, + "invreq_recurrence_counter": { + "type": "u32", + "description": [ + "Which number request this is for the same invoice." + ] + }, + "invreq_recurrence_start": { + "type": "u32", + "description": [ + "When we're requesting to start an invoice at a non-zero period." + ] + }, + "invoice_paths": { + "type": "array", + "description": [ + "Paths to pay the destination." + ], + "items": { + "type": "object", + "required": [ + "first_node_id", + "blinding", + "payinfo", + "path" + ], + "additionalProperties": false, + "properties": { + "first_node_id": { + "type": "pubkey", + "description": [ + "The (presumably well-known) public key of the start of the path." + ] + }, + "blinding": { + "type": "pubkey", + "description": [ + "Blinding factor for this path." + ] + }, + "payinfo": { + "type": "object", + "required": [ + "fee_base_msat", + "fee_proportional_millionths", + "cltv_expiry_delta", + "features" + ], + "additionalProperties": false, + "properties": { + "fee_base_msat": { + "type": "msat", + "description": [ + "Basefee for path." + ] + }, + "fee_proportional_millionths": { + "type": "u32", + "description": [ + "Proportional fee for path." + ] + }, + "cltv_expiry_delta": { + "type": "u32", + "description": [ + "CLTV delta for path." + ] + }, + "features": { + "type": "hex", + "description": [ + "Features allowed for path." + ] + } + } + }, + "path": { + "type": "array", + "description": [ + "An individual path." + ], + "items": { + "type": "object", + "required": [ + "blinded_node_id", + "encrypted_recipient_data" + ], + "additionalProperties": false, + "properties": { + "blinded_node_id": { + "type": "pubkey", + "description": [ + "Node_id of the hop." + ] + }, + "encrypted_recipient_data": { + "type": "hex", + "description": [ + "Encrypted TLV entry for this hop." + ] + } + } + } + } + } + } + }, + "invoice_created_at": { + "type": "u64", + "description": [ + "The UNIX timestamp of invoice creation." + ] + }, + "invoice_relative_expiry": { + "type": "u32", + "description": [ + "The number of seconds after *invoice_created_at* when this expires." + ] + }, + "invoice_payment_hash": { + "type": "hex", + "description": [ + "The hash of the *payment_preimage*." + ], + "maxLength": 64, + "minLength": 64 + }, + "invoice_amount_msat": { + "type": "msat", + "description": [ + "The amount required to fulfill invoice." + ] + }, + "invoice_fallbacks": { + "type": "array", + "description": [ + "Onchain addresses." + ], + "items": { + "type": "object", + "required": [ + "version", + "hex" + ], + "additionalProperties": false, + "properties": { + "version": { + "type": "u8", + "description": [ + "Segwit address version." + ] + }, + "hex": { + "type": "hex", + "description": [ + "Raw encoded segwit address." + ] + }, + "address": { + "type": "string", + "description": [ + "Bech32 segwit address." + ] + } + } + } + }, + "invoice_features": { + "type": "hex", + "description": [ + "The feature bits of the invoice." + ] + }, + "invoice_node_id": { + "type": "pubkey", + "description": [ + "The id to pay (usually the same as offer_node_id)." + ] + }, + "invoice_recurrence_basetime": { + "type": "u64", + "description": [ + "The UNIX timestamp to base the invoice periods on." + ] + }, + "signature": { + "type": "bip340sig", + "description": [ + "BIP-340 signature of the `offer_node_id` on this invoice." + ] + }, + "unknown_invoice_tlvs": { + "type": "array", + "description": [ + "Any extra fields we didn't know how to parse." + ], + "items": { + "type": "object", + "required": [ + "type", + "length", + "value" + ], + "additionalProperties": false, + "properties": { + "type": { + "type": "u64", + "description": [ + "The type." + ] + }, + "length": { + "type": "u64", + "description": [ + "The length." + ] + }, + "value": { + "type": "hex", + "description": [ + "The value." + ] + } + } + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt12 invoice" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + false + ] + } + } + }, + "then": { + "required": [], + "additionalProperties": false, + "properties": { + "type": {}, + "valid": {}, + "offer_id": {}, + "offer_chains": {}, + "offer_metadata": {}, + "offer_currency": {}, + "warning_unknown_offer_currency": {}, + "currency_minor_unit": {}, + "offer_amount": {}, + "offer_amount_msat": {}, + "offer_description": {}, + "offer_issuer": {}, + "offer_features": {}, + "offer_absolute_expiry": {}, + "offer_quantity_max": {}, + "offer_paths": {}, + "offer_node_id": {}, + "offer_recurrence": {}, + "invreq_metadata": {}, + "invreq_payer_id": {}, + "invreq_chain": {}, + "invreq_amount_msat": {}, + "invreq_features": {}, + "invreq_quantity": {}, + "invreq_payer_note": {}, + "invreq_node_id": {}, + "invreq_recurrence_counter": {}, + "invreq_recurrence_start": {}, + "warning_invalid_offer_description": { + "type": "string", + "description": [ + "`offer_description` is not valid UTF8." + ] + }, + "warning_missing_offer_description": { + "type": "string", + "description": [ + "`offer_description` is not present." + ] + }, + "warning_invalid_offer_currency": { + "type": "string", + "description": [ + "`offer_currency_code` is not valid UTF8." + ] + }, + "warning_invalid_offer_issuer": { + "type": "string", + "description": [ + "`offer_issuer` is not valid UTF8." + ] + }, + "warning_missing_invreq_metadata": { + "type": "string", + "description": [ + "`invreq_metadata` is not present." + ] + }, + "warning_invalid_invreq_payer_note": { + "type": "string", + "description": [ + "`invreq_payer_note` is not valid UTF8." + ] + }, + "warning_missing_invoice_paths": { + "type": "string", + "description": [ + "`invoice_paths` is not present." + ] + }, + "warning_missing_invoice_blindedpay": { + "type": "string", + "description": [ + "`invoice_blindedpay` is not present." + ] + }, + "warning_missing_invoice_created_at": { + "type": "string", + "description": [ + "`invoice_created_at` is not present." + ] + }, + "warning_missing_invoice_payment_hash": { + "type": "string", + "description": [ + "`invoice_payment_hash` is not present." + ] + }, + "warning_missing_invoice_amount": { + "type": "string", + "description": [ + "`invoice_amount` is not present." + ] + }, + "warning_missing_invoice_recurrence_basetime": { + "type": "string", + "description": [ + "`invoice_recurrence_basetime` is not present." + ] + }, + "warning_missing_invoice_node_id": { + "type": "string", + "description": [ + "`invoice_node_id` is not present." + ] + }, + "warning_missing_invoice_signature": { + "type": "string", + "description": [ + "`signature` is not present." + ] + }, + "warning_invalid_invoice_signature": { + "type": "string", + "description": [ + "Incorrect `signature`." + ] + }, + "fallbacks": { + "type": "array", + "items": { + "type": "object", + "required": [ + "version", + "hex" + ], + "properties": { + "version": {}, + "hex": {}, + "address": {}, + "warning_invoice_fallbacks_version_invalid": { + "type": "string", + "description": [ + "`version` is > 16." + ] + } + } + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt11 invoice" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "required": [ + "currency", + "created_at", + "expiry", + "payee", + "min_final_cltv_expiry", + "payment_hash", + "signature" + ], + "additionalProperties": false, + "properties": { + "type": {}, + "valid": {}, + "currency": { + "type": "string", + "description": [ + "The BIP173 name for the currency." + ] + }, + "created_at": { + "type": "u64", + "description": [ + "The UNIX-style timestamp of the invoice." + ] + }, + "expiry": { + "type": "u64", + "description": [ + "The number of seconds this is valid after `created_at`." + ] + }, + "payee": { + "type": "pubkey", + "description": [ + "The public key of the recipient." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount the invoice asked for." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage*." + ] + }, + "signature": { + "type": "signature", + "description": [ + "Signature of the *payee* on this invoice." + ] + }, + "description": { + "type": "string", + "description": [ + "The description of the purpose of the purchase." + ] + }, + "description_hash": { + "type": "hash", + "description": [ + "The hash of the description, in place of *description*." + ] + }, + "min_final_cltv_expiry": { + "type": "u32", + "description": [ + "The minimum CLTV delay for the final node." + ] + }, + "payment_secret": { + "type": "secret", + "description": [ + "The secret to hand to the payee node." + ] + }, + "features": { + "type": "hex", + "description": [ + "The features bitmap for this invoice." + ] + }, + "payment_metadata": { + "type": "hex", + "description": [ + "The payment_metadata to put in the payment." + ] + }, + "fallbacks": { + "type": "array", + "description": [ + "Onchain addresses." + ], + "items": { + "type": "object", + "required": [ + "type", + "hex" + ], + "additionalProperties": false, + "properties": { + "type": { + "type": "string", + "description": [ + "The address type (if known)." + ], + "enum": [ + "P2PKH", + "P2SH", + "P2WPKH", + "P2WSH", + "P2TR" + ] + }, + "addr": { + "type": "string", + "description": [ + "The address in appropriate format for *type*." + ] + }, + "hex": { + "type": "hex", + "description": [ + "Raw encoded address." + ] + } + } + } + }, + "routes": { + "type": "array", + "description": [ + "Route hints to the *payee*." + ], + "items": { + "type": "array", + "description": [ + "Hops in the route." + ], + "items": { + "type": "object", + "required": [ + "pubkey", + "short_channel_id", + "fee_base_msat", + "fee_proportional_millionths", + "cltv_expiry_delta" + ], + "additionalProperties": false, + "properties": { + "pubkey": { + "type": "pubkey", + "description": [ + "The public key of the node." + ] + }, + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "A channel to the next peer." + ] + }, + "fee_base_msat": { + "type": "msat", + "description": [ + "The base fee for payments." + ] + }, + "fee_proportional_millionths": { + "type": "u32", + "description": [ + "The parts-per-million fee for payments." + ] + }, + "cltv_expiry_delta": { + "type": "u32", + "description": [ + "The CLTV delta across this hop." + ] + } + } + } + } + }, + "extra": { + "type": "array", + "description": [ + "Any extra fields we didn't know how to parse." + ], + "items": { + "type": "object", + "required": [ + "tag", + "data" + ], + "additionalProperties": false, + "properties": { + "tag": { + "type": "string", + "description": [ + "The bech32 letter which identifies this field." + ], + "maxLength": 1, + "minLength": 1 + }, + "data": { + "type": "string", + "description": [ + "The bech32 data for this field." + ] + } + } + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "rune" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "required": [ + "string", + "restrictions", + "valid" + ], + "additionalProperties": false, + "properties": { + "unique_id": { + "type": "string", + "description": [ + "Unique id (always a numeric id on runes we create)." + ] + }, + "version": { + "type": "string", + "description": [ + "Rune version, not currently set on runes we create." + ] + }, + "valid": { + "type": "boolean", + "enum": [ + true + ] + }, + "type": {}, + "string": { + "type": "string", + "description": [ + "The string encoding of the rune." + ] + }, + "restrictions": { + "type": "array", + "description": [ + "Restrictions built into the rune: all must pass." + ], + "items": { + "type": "object", + "required": [ + "alternatives", + "summary" + ], + "additionalProperties": false, + "properties": { + "alternatives": { + "type": "array", + "description": [ + "Each way restriction can be met: any can pass." + ], + "items": { + "type": "string", + "description": [ + "The alternative of form fieldname condition fieldname." + ] + } + }, + "summary": { + "type": "string", + "description": [ + "Human-readable summary of this restriction." + ] + } + } + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "rune" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + false + ] + } + } + }, + "then": { + "required": [ + "valid" + ], + "additionalProperties": false, + "properties": { + "valid": { + "type": "boolean", + "enum": [ + false + ] + }, + "type": {}, + "warning_rune_invalid_utf8": { + "type": "string", + "description": [ + "The rune contains invalid UTF-8 strings." + ] + }, + "hex": { + "type": "hex", + "description": [ + "The raw rune in hex." + ] + } + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "emergency recover" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "required": [ + "decrypted" + ], + "additionalProperties": false, + "properties": { + "type": {}, + "valid": {}, + "decrypted": { + "type": "hex", + "description": [ + "The decrypted value of the provided bech32 of emergency.recover." + ], + "added": "v23.11" + } + } + } + } + ] + }, + "example_json_request": [ + { + "id": "example:decode#1", + "method": "decode", + "params": [ + "zm0x_eLgHexaTvZn3Cz7gb_YlvrlYGDo_w4BYlR9SS09MSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl" + ] + }, + { + "id": "example:decode#2", + "method": "decode", + "params": [ + "lnbcrt1m1pja0f2hsp5xyssdvdsu24dmmesrt6x84wfrm4mscsnzq7hl2suzeu90wy6g53qpp5zyyu3anwfsfl64pewe0tg7j28map2wwnhvaam5nt70rlwxa0cegqdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqgqqqqqqqlgqqqq86qqqc9qxpqysgq7u4f99u4kepagme27t5c3gdl7czlnjaw7kxryxgm87w2j02j3g94r2vrukhpgedhcdkcdec27m7jrl2lvcr6uh3rdv9lgpz0vc0zcfcqnugjdw" + ] + } + ], + "example_json_response": [ + { + "type": "rune", + "unique_id": "1", + "string": "ce6d31fde2e01dec5a4ef667dc2cfb81bfd896fae56060e8ff0e0162547d492d:=1&method^list|method^get|method=summary&method/listdatastore", + "restrictions": [ + { + "alternatives": [ + "method^list", + "method^get", + "method=summary" + ], + "summary": "method (of command) starts with 'list' OR method (of command) starts with 'get' OR method (of command) equal to 'summary'" + }, + { + "alternatives": [ + "method/listdatastore" + ], + "summary": "method (of command) unequal to 'listdatastore'" + } + ], + "valid": true + }, + { + "type": "bolt11 invoice", + "currency": "bcrt", + "created_at": 1708631383, + "expiry": 604800, + "payee": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount_msat": 100000000, + "description": "description", + "min_final_cltv_expiry": 5, + "payment_secret": "312106b1b0e2aaddef301af463d5c91eebb86213103d7faa1c167857b89a4522", + "features": "02024100", + "routes": [ + [ + { + "pubkey": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "short_channel_id": "103x1x0", + "fee_base_msat": 1000, + "fee_proportional_millionths": 1000, + "cltv_expiry_delta": 6 + } + ] + ], + "payment_hash": "1109c8f66e4c13fd5439765eb47a4a3efa1539d3bb3bddd26bf3c7f71bafc650", + "signature": "3045022100f72a929795b643d46f2af2e988a1bff605f9cbaef58c32191b3f9ca93d528a0b022051a983e5ae1465b7c36d86e70af6fd21fd5f6607ae5e236b0bf4044f661e2c27", + "valid": true + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-pay(7)", + "lightning-offer(7)", + "lightning-fetchinvoice(7)", + "lightning-sendinvoice(7)", + "lightning-commando-rune(7)" + ], + "resources": [ + "[BOLT #11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md)", + "", + "[BOLT #12](https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md)", + "(experimental, [bolt](https://github.com/lightning/bolts) #798)", + "", + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-decodepay.json b/doc/schemas/lightning-decodepay.json new file mode 100644 index 000000000000..f2792eb1a9f5 --- /dev/null +++ b/doc/schemas/lightning-decodepay.json @@ -0,0 +1,290 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.05", + "rpc": "decodepay", + "title": "Command for decoding a bolt11 string (low-level)", + "description": [ + "The **decodepay** RPC command checks and parses a *bolt11* string as specified by the BOLT 11 specification." + ], + "request": { + "required": [ + "bolt11" + ], + "properties": { + "bolt11": { + "type": "string", + "description": [ + "Bolt11 invoice to decode." + ] + }, + "description": { + "type": "string", + "description": [ + "Description of the invoice to decode." + ] + } + } + }, + "response": { + "required": [ + "currency", + "created_at", + "expiry", + "payee", + "min_final_cltv_expiry", + "payment_hash", + "signature" + ], + "properties": { + "currency": { + "type": "string", + "description": [ + "The BIP173 name for the currency." + ] + }, + "created_at": { + "type": "u64", + "description": [ + "The UNIX-style timestamp of the invoice." + ] + }, + "expiry": { + "type": "u64", + "description": [ + "The number of seconds this is valid after *timestamp*." + ] + }, + "payee": { + "type": "pubkey", + "description": [ + "The public key of the recipient." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount the invoice asked for." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage*." + ] + }, + "signature": { + "type": "signature", + "description": [ + "Signature of the *payee* on this invoice." + ] + }, + "description": { + "type": "string", + "description": [ + "The description of the purpose of the purchase." + ] + }, + "description_hash": { + "type": "hash", + "description": [ + "The hash of the description, in place of *description*." + ] + }, + "min_final_cltv_expiry": { + "type": "u32", + "description": [ + "The minimum CLTV delay for the final node." + ] + }, + "payment_secret": { + "type": "hash", + "description": [ + "The secret to hand to the payee node." + ] + }, + "features": { + "type": "hex", + "description": [ + "The features bitmap for this invoice." + ] + }, + "payment_metadata": { + "type": "hex", + "description": [ + "The payment_metadata to put in the payment." + ] + }, + "fallbacks": { + "type": "array", + "description": [ + "Onchain addresses." + ], + "items": { + "type": "object", + "required": [ + "type", + "hex" + ], + "additionalProperties": false, + "properties": { + "type": { + "type": "string", + "description": [ + "The address type (if known)." + ], + "enum": [ + "P2PKH", + "P2SH", + "P2WPKH", + "P2WSH", + "P2TR" + ] + }, + "addr": { + "type": "string", + "description": [ + "The address in appropriate format for *type*." + ] + }, + "hex": { + "type": "hex", + "description": [ + "Raw encoded address." + ] + } + } + } + }, + "routes": { + "type": "array", + "description": [ + "Route hints to the *payee*." + ], + "items": { + "type": "array", + "description": [ + "Hops in the route." + ], + "items": { + "type": "object", + "required": [ + "pubkey", + "short_channel_id", + "fee_base_msat", + "fee_proportional_millionths", + "cltv_expiry_delta" + ], + "additionalProperties": false, + "properties": { + "pubkey": { + "type": "pubkey", + "description": [ + "The public key of the node." + ] + }, + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "A channel to the next peer." + ] + }, + "fee_base_msat": { + "type": "msat", + "description": [ + "The base fee for payments." + ] + }, + "fee_proportional_millionths": { + "type": "u32", + "description": [ + "The parts-per-million fee for payments." + ] + }, + "cltv_expiry_delta": { + "type": "u32", + "description": [ + "The CLTV delta across this hop." + ] + } + } + } + } + }, + "extra": { + "type": "array", + "description": [ + "Any extra fields we didn't know how to parse." + ], + "items": { + "type": "object", + "required": [ + "tag", + "data" + ], + "additionalProperties": false, + "properties": { + "tag": { + "type": "string", + "description": [ + "The bech32 letter which identifies this field." + ], + "maxLength": 1, + "minLength": 1 + }, + "data": { + "type": "string", + "description": [ + "The bech32 data for this field." + ] + } + } + } + } + }, + "post_return_value_notes": [ + "Technically, the *description* field is optional if a *description_hash* field is given, but in this case **decodepay** will only succeed if the optional *description* field is passed and matches the *description_hash*. In practice, these are currently unused." + ] + }, + "example_json_request": [ + { + "id": "example:decodepay#1", + "method": "decodepay", + "params": { + "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk", + "description": null + } + } + ], + "example_json_response": [ + { + "currency": "bcrt", + "created_at": 1706152930, + "expiry": 604800, + "payee": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount_msat": 11000000, + "description": [ + "XEoCR94SIz6UIRUEkxum." + ], + "min_final_cltv_expiry": 5, + "payment_secret": "82644944d3f70d42aad1d5f7b5d7a629e7afa30b529cc952a4c59fc0e3790ea2", + "features": "02024100", + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "signature": "3045022100e3b7d8886eae1a7c9e55e1797aa0dcb77b8c5a19d56c657cad030e360c90682802203a35713acb098245e53a37faeac98754a29a7078db5ed6f2166f917e55b94484" + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-pay(7)", + "lightning-getroute(7)", + "lightning-sendpay(7)" + ], + "resources": [ + "[BOLT #11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md)", + "", + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-deldatastore.json b/doc/schemas/lightning-deldatastore.json new file mode 100644 index 000000000000..d5055cb615c0 --- /dev/null +++ b/doc/schemas/lightning-deldatastore.json @@ -0,0 +1,131 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "deldatastore", + "title": "Command for removing (plugin) data", + "description": [ + "The **deldatastore** RPC command allows plugins to delete data it has stored in the Core Lightning database.", + "", + "The command fails if the *key* isn't present, or if *generation* is specified and the generation of the data does not exactly match." + ], + "request": { + "required": [ + "key" + ], + "properties": { + "key": { + "oneOf": [ + { + "type": "array", + "description": [ + "Key is an array of values (though a single value is treated as a one-element array), to form a heirarchy. Using the first element of the key as the plugin name (e.g. [ 'summary' ]) is recommended. A key can either have children or a value, never both: parents are created and removed automatically." + ], + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] + }, + "generation": { + "type": "u64", + "description": [ + "If specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with mode `must-replace` or `must-append`." + ] + } + } + }, + "response": { + "required": [ + "key" + ], + "properties": { + "key": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Part of the key added to the datastore." + ] + } + }, + "generation": { + "type": "u64", + "description": [ + "The number of times this has been updated." + ] + }, + "hex": { + "type": "hex", + "description": [ + "The hex data which has removed from the datastore." + ] + }, + "string": { + "type": "string", + "description": [ + "The data as a string, if it's valid utf-8." + ] + } + } + }, + "errors": [ + "The following error codes may occur:", + "", + "- 1200: the key does not exist", + "- 1201: the key does exist, but the generation is wrong", + "- -32602: invalid parameters" + ], + "example_json_request": [ + { + "id": "example:deldatastore#1", + "method": "deldatastore", + "params": { + "key": "otherkey", + "generation": 1 + } + }, + { + "id": "example:deldatastore#2", + "method": "deldatastore", + "params": { + "key": [ + "a" + ], + "generation": null + } + } + ], + "example_json_response": [ + { + "key": [ + "otherkey" + ], + "generation": 1, + "hex": "6f746865726461746161", + "string": "otherdataa" + }, + { + "key": [ + "a" + ], + "generation": 0, + "hex": "6176616c", + "string": "aval" + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listdatastore(7)", + "lightning-datastore(7)", + "lightning-datastoreusage(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-delexpiredinvoice.json b/doc/schemas/lightning-delexpiredinvoice.json new file mode 100644 index 000000000000..354c1cbbcf0f --- /dev/null +++ b/doc/schemas/lightning-delexpiredinvoice.json @@ -0,0 +1,47 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "delexpiredinvoice", + "title": "Command for removing expired invoices", + "description": [ + "The **delexpiredinvoice** RPC command removes all invoices that have expired on or before the given *maxexpirytime*." + ], + "request": { + "required": [], + "properties": { + "maxexpirytime": { + "type": "u64", + "description": [ + "Invoice expiry time in seconds. If not specified then all expired invoices are deleted." + ] + } + } + }, + "response": { + "required": [], + "properties": {} + }, + "example_json_request": [ + { + "id": "example:delexpiredinvoice#1", + "method": "delexpiredinvoice", + "params": { + "maxexpirytime": null + } + } + ], + "example_json_response": [ + {} + ], + "author": [ + "ZmnSCPxj <> is mainly responsible." + ], + "see_also": [ + "lightning-delinvoice(7)", + "lightning-autoclean-status(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-delforward.json b/doc/schemas/lightning-delforward.json new file mode 100644 index 000000000000..268496ba8366 --- /dev/null +++ b/doc/schemas/lightning-delforward.json @@ -0,0 +1,86 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "delforward", + "title": "Command for removing a forwarding entry", + "description": [ + "The **delforward** RPC command removes a single forward from **listforwards**, using the uniquely-identifying *in_channel* and *in_htlc_id* (and, as a sanity check, the *status*) given by that command.", + "", + "This command is mainly used by the *autoclean* plugin (see lightningd- config(7)), As these database entries are only kept for your own analysis, removing them has no effect on the running of your node." + ], + "request": { + "required": [ + "in_channel", + "in_htlc_id", + "status" + ], + "properties": { + "in_channel": { + "type": "short_channel_id", + "description": [ + "Only the matching forwards on the given inbound channel are deleted. Note: for **listforwards** entries without an *in_htlc_id* entry (no longer created in v22.11, but can exist from older versions), a value of 18446744073709551615 can be used, but then it will delete *all* entries without *in_htlc_id* for this *in_channel* and *status*." + ] + }, + "in_htlc_id": { + "type": "u64", + "description": [ + "The unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11)." + ] + }, + "status": { + "type": "string", + "description": [ + "The status of the forward to delete. You cannot delete forwards which have status *offered* (i.e. are currently active)." + ], + "enum": [ + "settled", + "local_failed", + "failed" + ] + } + } + }, + "response": { + "required": [], + "properties": {} + }, + "errors": [ + "The following errors may be reported:", + "", + "- 1401: The forward specified does not exist." + ], + "example_json_request": [ + { + "id": "example:delforward#1", + "method": "delforward", + "params": { + "in_channel": "103x1x0", + "in_htlc_id": 2, + "status": "local_failed" + } + }, + { + "id": "example:delforward#2", + "method": "delforward", + "params": [ + "103x1x0", + 1, + "failed" + ] + } + ], + "example_json_response": [ + {}, + {} + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-autoclean(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-delinvoice.json b/doc/schemas/lightning-delinvoice.json new file mode 100644 index 000000000000..586bce2a34ef --- /dev/null +++ b/doc/schemas/lightning-delinvoice.json @@ -0,0 +1,338 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "delinvoice", + "title": "Command for removing an invoice (or just its description)", + "description": [ + "The **delinvoice** RPC command removes an invoice with *status* as given in **listinvoices**, or with *desconly* set, removes its description." + ], + "request": { + "required": [ + "label", + "status" + ], + "properties": { + "label": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "u64" + } + ], + "description": [ + "Label of the invoice to be deleted." + ] + }, + "status": { + "type": "string", + "description": [ + "Label of the invoice to be deleted. The caller should be particularly aware of the error case caused by the *status* changing just before this command is invoked!" + ], + "enum": [ + "paid", + "expired", + "unpaid" + ] + }, + "desconly": { + "type": "boolean", + "description": [ + "If set to True, the invoice is not deleted, but has its description removed (this can save space with very large descriptions, as would be used with lightning-invoice(7) *deschashonly*." + ] + } + } + }, + "response": { + "required": [ + "label", + "payment_hash", + "status", + "created_index", + "expires_at" + ], + "properties": { + "label": { + "type": "string", + "description": [ + "Unique label given at creation time." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "BOLT11 string." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "BOLT12 string." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount required to pay this invoice." + ] + }, + "description": { + "type": "string", + "description": [ + "Description used in the invoice." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "created_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was created in." + ] + }, + "updated_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was changed (only present if it has changed since creation)." + ] + }, + "status": { + "type": "string", + "description": [ + "State of invoice." + ], + "enum": [ + "paid", + "expired", + "unpaid" + ] + }, + "expires_at": { + "type": "u64", + "description": [ + "UNIX timestamp when invoice expires (or expired)." + ] + } + }, + "allOf": [ + { + "if": { + "required": [ + "bolt12" + ] + }, + "then": { + "required": [], + "additionalProperties": false, + "properties": { + "label": {}, + "bolt12": {}, + "status": {}, + "expires_at": {}, + "msatoshi": {}, + "amount_msat": {}, + "description": {}, + "payment_hash": {}, + "pay_index": {}, + "created_index": {}, + "updated_index": {}, + "amount_received_msat": {}, + "paid_at": {}, + "payment_preimage": {}, + "local_offer_id": { + "type": "hex", + "description": [ + "Offer for which this invoice was created." + ] + }, + "invreq_payer_note": { + "type": "string", + "description": [ + "The optional *invreq_payer_note* from invoice_request which created this invoice." + ] + } + } + }, + "else": { + "required": [ + "bolt11" + ], + "additionalProperties": false, + "properties": { + "label": {}, + "bolt11": {}, + "status": {}, + "expires_at": {}, + "msatoshi": {}, + "amount_msat": {}, + "description": {}, + "payment_hash": {}, + "pay_index": {}, + "created_index": {}, + "updated_index": {}, + "amount_received_msat": {}, + "msatoshi_received": {}, + "paid_at": {}, + "payment_preimage": {} + } + } + }, + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "paid" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "pay_index", + "amount_received_msat", + "paid_at", + "payment_preimage" + ], + "properties": { + "label": {}, + "bolt11": {}, + "bolt12": {}, + "status": {}, + "expires_at": {}, + "msatoshi": {}, + "amount_msat": {}, + "description": {}, + "payment_hash": {}, + "invreq_payer_note": {}, + "local_offer_id": {}, + "created_index": {}, + "updated_index": {}, + "pay_index": { + "type": "u64", + "description": [ + "Unique index for this invoice payment." + ] + }, + "amount_received_msat": { + "type": "msat", + "description": [ + "How much was actually received." + ] + }, + "paid_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when payment was received." + ] + }, + "payment_preimage": { + "type": "secret", + "description": [ + "SHA256 of this is the *payment_hash* offered in the invoice." + ] + } + } + }, + "else": { + "additionalProperties": false, + "properties": { + "label": {}, + "bolt11": {}, + "bolt12": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "description": {}, + "payment_hash": {}, + "expires_at": {}, + "created_index": {}, + "updated_index": {}, + "pay_index": {}, + "invreq_payer_note": {}, + "local_offer_id": {} + } + } + } + ], + "pre_return_value_notes": [ + "Note: The return is the same as an object from lightning-listinvoice(7)." + ] + }, + "errors": [ + "The following errors may be reported:", + "", + "- -1: Database error.", + "- 905: An invoice with that label does not exist.", + "- 906: The invoice *status* does not match the parameter. An error object will be returned as error *data*, containing *current_status* and *expected_status* fields. This is most likely due to the *status* of the invoice changing just before this command is invoked.", + "- 908: The invoice already has no description, and *desconly* was set." + ], + "example_json_request": [ + { + "id": "example:delinvoice#1", + "method": "delinvoice", + "params": { + "label": "invlabel2", + "status": "unpaid", + "desconly": true + } + }, + { + "id": "example:delinvoice#2", + "method": "delinvoice", + "params": { + "label": "keysend-1708640419.666098582", + "status": "paid", + "desconly": null + } + } + ], + "example_json_response": [ + { + "label": "invlabel2", + "bolt11": "lnbcrt420p1pja0tefsp5vvzg40t4g24l0eqk0jch7mc6jm3ec52ts8w8gwzpwtx9c8nv05rspp533e9csxurt7j9sn2cx7hsn6m00475qgrau8sux5r7djpdedwy2fshp5xqsmrtgfcwsnhxcxmf3tuc65kl6fxvqhvujfmxw2kpeh95yy2x8sxqyjw5qcqp99qxpqysgqgfjrz4q5zcq2lluxxg9h475mq2d3w0tpdstm5274zmhadjl8cqapylfskzk96apka5599a2flm90rmavsk7q8mhh87yle3sgh5vrlycq72fern", + "payment_hash": "8c725c40dc1afd22c26ac1bd784f5b7bebea0103ef0f0e1a83f36416e5ae2293", + "amount_msat": 42, + "status": "unpaid", + "expires_at": 1709238697, + "created_index": 3 + }, + { + "label": "keysend-1708640419.666098582", + "bolt11": "lnbcrt1pja0j9rsp5tg3zvj846gcdzw394njazq40s946sq2ur3hkl4xu4xudtjdtckxspp5fuunrfzsnyz2uxjmg2n95mqhghv4fpvv2kud3kvq4fkys3vmzu5sdqvddjhjum9dejqxqyjw5qcqp99qxpqysgqwt7r0gjlgt7zrfldc3um9myfc36acpqnsdn77c2m42facjtps30yufc5nsmwzhgexlj59f6xa5hess6e3tqrxynt9fejzj3rrshddtcqnappmj", + "payment_hash": "4f3931a4509904ae1a5b42a65a6c1745d954858c55b8d8d980aa6c48459b1729", + "status": "paid", + "pay_index": 1, + "amount_received_msat": 10000000, + "paid_at": 1708640419, + "payment_preimage": "b760af47f456a217e8dfda21a282f1f78c903487c1b21b3b318135f75aa3bf11", + "description": "keysend", + "expires_at": 1709245219, + "created_index": 1, + "updated_index": 1 + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listinvoice(7)", + "lightning-waitinvoice(7)", + "lightning-invoice(7)", + "lightning-delexpiredinvoice(7)", + "lightning-autoclean-status(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-delpay.json b/doc/schemas/lightning-delpay.json new file mode 100644 index 000000000000..7978b1d7ab16 --- /dev/null +++ b/doc/schemas/lightning-delpay.json @@ -0,0 +1,293 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "delpay", + "title": "Command for removing a completed or failed payment", + "description": [ + "The **delpay** RPC command deletes a payment with the given `payment_hash` if its status is either `complete` or `failed`. If *partid* and *groupid* are not specified, all payment parts with matchin status are deleted." + ], + "request": { + "required": [ + "payment_hash", + "status" + ], + "properties": { + "payment_hash": { + "type": "hash", + "description": [ + "The unique identifier of a payment." + ] + }, + "status": { + "type": "string", + "description": [ + "Expected status of the payment. Only deletes if the payment status matches. Deleting a `pending` payment will return an error." + ], + "enum": [ + "complete", + "failed" + ] + }, + "partid": { + "type": "u64", + "description": [ + "Specific partid to delete (must be paired with *groupid*)." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Specific groupid to delete (must be paired with *partid*)." + ] + } + }, + "pairedWith": [ + [ + "partid", + "groupid" + ] + ] + }, + "response": { + "required": [ + "payments" + ], + "properties": { + "payments": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "created_index", + "id", + "payment_hash", + "status", + "amount_sent_msat", + "created_at" + ], + "properties": { + "created_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was created in." + ] + }, + "id": { + "type": "u64", + "description": [ + "Old synonym for created_index." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "pending", + "failed", + "complete" + ], + "description": [ + "Status of the payment." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "The amount we actually sent, including fees." + ] + }, + "partid": { + "type": "u64", + "description": [ + "Unique ID within this (multi-part) payment." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment if known." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount the destination received, if known." + ] + }, + "created_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "updated_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was changed (only present if it has changed since creation)." + ] + }, + "completed_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was completed." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." + ] + }, + "payment_preimage": { + "type": "secret", + "description": [ + "Proof of payment." + ] + }, + "label": { + "type": "string", + "description": [ + "The label, if given to sendpay." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string (if pay supplied one)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string (if supplied for pay: **experimental-offers** only)." + ] + }, + "erroronion": { + "type": "hex", + "description": [ + "The error onion returned on failure, if any." + ] + } + } + } + } + }, + "pre_return_value_notes": [ + "The returned format is the same as lightning-listsendpays(7). If the payment is a multi-part payment (MPP) the command return a list of payments will be returned -- one payment object for each partid." + ] + }, + "example_json_request": [ + { + "id": "example:delpay#1", + "method": "delpay", + "params": { + "payment_hash": "4fa2f1b001067ec06d7f95b8695b8acd9ef04c1b4d1110e3b94e1fa0687bb1e0", + "status": "complete" + } + }, + { + "id": "example:delpay#2", + "method": "delpay", + "params": [ + "c9d4547473d0d646f1fdd8ca7f01803e4d31ceab01df33c79456f9c24b04034e", + "failed" + ] + }, + { + "id": "example:delpay#3", + "method": "delpay", + "params": { + "payment_hash": "bbc35e0a46d1483292a4ff8d4daaceaab8c3c084dd835be4128785b52e469c64", + "status": "complete", + "groupid": 1, + "partid": 1 + } + } + ], + "example_json_response": [ + { + "payments": [ + { + "id": 1, + "payment_hash": "8dfd6538eeb33811c9114a75f792a143728d7f05643f38c3d574d3097e8910c0", + "destination": "0219f8900ee78a89f050c24d8b69492954f9fdbabed753710845eb75d3a75a5880", + "msatoshi": 1000, + "amount_msat": "1000msat", + "msatoshi_sent": 1000, + "amount_sent_msat": "1000msat", + "created_at": 1596224858, + "status": "complete", + "payment_preimage": "35bd4e2b481a1a84a22215b5372672cf81460a671816960ddb206464359e1822", + "bolt11": "lntb10n1p0jga20pp53h7k2w8wkvuprjg3ff6l0y4pgdeg6lc9vsln3s74wnfsjl5fzrqqdqdw3jhxazldahx2xqyjw5qcqp2sp5wut5jnhr6n7jd5747ky2g5flmw7hgx9yjnqzu60ps2jf6f7tc0us9qy9qsqu2a0k37nckl62005p69xavlkydkvhnypk4dphffy4x09zltwh9437ad7xkl83tefdarzhu5t30ju5s56wlrg97qkx404pq3srfc425cq3ke9af" + } + ] + }, + { + "payments": [ + { + "created_index": 2, + "id": 2, + "payment_hash": "c9d4547473d0d646f1fdd8ca7f01803e4d31ceab01df33c79456f9c24b04034e", + "groupid": 1, + "updated_index": 2, + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount_msat": 100000, + "amount_sent_msat": 100002, + "created_at": 1706316468, + "completed_at": 1706316471, + "status": "failed", + "bolt11": "lnbcrt1u1pjmg54nsp5ke626txv6wwwmqmpuy63t3jnu9hqxwj880zsfkkj7jjqagdaz2sqpp5e829garn6rtydu0amr987qvq8exnrn4tq80n83u52muuyjcyqd8qdq8v3jhxccxqyjw5qcqp99qxpqysgqalktfwy9svsamvvvrzzzzpdaa4rh7n6s5p7t9lx7qv0raz4vnm9knkh5ury3u5cmnhx2gms98nxkclm3833uhjrlnzmftc685vz2f0gpfnjy4y" + } + ] + }, + { + "payments": [ + { + "created_index": 3, + "id": 3, + "payment_hash": "bbc35e0a46d1483292a4ff8d4daaceaab8c3c084dd835be4128785b52e469c64", + "groupid": 1, + "updated_index": 3, + "partid": 1, + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount_msat": 100000, + "amount_sent_msat": 102100, + "created_at": 1708641193, + "completed_at": 1708641194, + "status": "complete", + "payment_preimage": "a6ebb1cfbf69e76200f196f1eafd28a3d850633499c223a7eb7a7dba3b995286" + } + ] + } + ], + "errors": [ + "On failure, an error is returned. If the lightning process fails before responding, the", + "caller should use lightning-listsentpays(7) or lightning-listpays(7) to query whether this payment was deleted or not.", + "", + "The following error codes may occur:", + "", + "- -32602: Parameter missed or malformed;", + "- 211: Payment status mismatch. Check the correct status via **paystatus**;", + "- 208: Payment with payment_hash not found." + ], + "author": [ + "Vincenzo Palazzo <> is mainly responsible." + ], + "see_also": [ + "lightning-listpays(7)", + "lightning-listsendpays(7)", + "lightning-paystatus(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-deprecations.json b/doc/schemas/lightning-deprecations.json new file mode 100644 index 000000000000..919b047f1701 --- /dev/null +++ b/doc/schemas/lightning-deprecations.json @@ -0,0 +1,54 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v24.02", + "rpc": "deprecations", + "title": "Command to enable/disable deprecated APIs", + "description": [ + "The **deprecations** RPC command is used to override global config option `allow-deprecated-apis` for further RPC commands on this same connection. This can be useful for developer testing to ensure you don't accidentally rely on deprecated features." + ], + "request": { + "required": [ + "enable" + ], + "properties": { + "enable": { + "type": "boolean", + "description": [ + "Flag to enable or disable deprecated APIs. Setting it to `false` will neither accept deprecated parameters or commands, nor output deprecated fields." + ] + } + } + }, + "response": { + "properties": {} + }, + "example_json_request": [ + { + "id": "example:deprecations#1", + "method": "deprecations", + "params": { + "enable": false + } + } + ], + "example_json_response": [ + {} + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters." + ], + "author": [ + "Rusty Russell <> wrote the initial version of this man page." + ], + "see_also": [ + "lightningd-config(5)", + "lightning-notifications(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-disableinvoicerequest.json b/doc/schemas/lightning-disableinvoicerequest.json new file mode 100644 index 000000000000..175b03b4dcf2 --- /dev/null +++ b/doc/schemas/lightning-disableinvoicerequest.json @@ -0,0 +1,90 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v22.11", + "rpc": "disableinvoicerequest", + "title": "Command for removing an invoice request", + "warning": "experimental-offers only", + "description": [ + "The **disableinvoicerequest** RPC command disables an invoice_request, so that no further invoices will be accepted (and thus, no further payments made)..", + "", + "We currently don't support deletion of invoice_requests, so they are not forgotten entirely (there may be payments which refer to this invoice_request)." + ], + "request": { + "required": [ + "invreq_id" + ], + "properties": { + "invreq_id": { + "type": "string", + "description": [ + "A specific invoice can be disabled by providing the `invreq_id`, which is presented by lightning-invoicerequest(7)." + ] + } + } + }, + "response": { + "required": [ + "invreq_id", + "single_use", + "active", + "bolt12", + "used" + ], + "properties": { + "invreq_id": { + "type": "hash", + "description": [ + "The SHA256 hash of all invoice_request fields less than 160." + ] + }, + "active": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "Whether the invoice_request is currently active." + ] + }, + "single_use": { + "type": "boolean", + "description": [ + "Whether the invoice_request will become inactive after we pay an invoice for it." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string starting with lnr." + ] + }, + "used": { + "type": "boolean", + "description": [ + "Whether the invoice_request has already been used." + ] + }, + "label": { + "type": "string", + "description": [ + "The label provided when creating the invoice_request." + ] + } + }, + "pre_return_value_notes": [ + "Note: the returned object is the same format as **listinvoicerequest**." + ] + }, + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-invoicerequest(7)", + "lightning-listinvoicerequest(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-disableoffer.json b/doc/schemas/lightning-disableoffer.json new file mode 100644 index 000000000000..600aaa21dda4 --- /dev/null +++ b/doc/schemas/lightning-disableoffer.json @@ -0,0 +1,107 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "disableoffer", + "title": "Command for removing an offer", + "warning": "experimental-offers only", + "description": [ + "The **disableoffer** RPC command disables an offer, so that no further invoices will be given out.", + "", + "We currently don't support deletion of offers, so offers are not forgotten entirely (there may be invoices which refer to this offer)." + ], + "request": { + "required": [ + "offer_id" + ], + "properties": { + "offer_id": { + "type": "hash", + "description": [ + "The id we use to identify this offer." + ] + } + } + }, + "response": { + "required": [ + "offer_id", + "active", + "single_use", + "bolt12", + "used" + ], + "properties": { + "offer_id": { + "type": "hash", + "description": [ + "The merkle hash of the offer." + ] + }, + "active": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "Whether the offer can produce invoices/payments." + ] + }, + "single_use": { + "type": "boolean", + "description": [ + "Whether the offer is disabled after first successful use." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string representing this offer." + ] + }, + "used": { + "type": "boolean", + "description": [ + "Whether the offer has had an invoice paid / payment made." + ] + }, + "label": { + "type": "string", + "description": [ + "The label provided when offer was created." + ] + } + }, + "pre_return_value_notes": [ + "Note: the returned object is the same format as **listoffers**." + ] + }, + "example_json_request": [ + { + "id": "example:disableoffer#1", + "method": "disableoffer", + "params": { + "offer_id": "713a16ccd4eb10438bdcfbc2c8276be301020dd9d489c530773ba64f3b33307d" + } + } + ], + "example_json_response": [ + { + "offer_id": "053a5c566fbea2681a5ff9c05a913da23e45b95d09ef5bd25d7d408f23da7084", + "active": false, + "single_use": false, + "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqvqcdgq2z9pk7enxv4jjqen0wgs8yatnw3ujz83qkc6rvp4j28rt3dtrn32zkvdy7efhnlrpr5rp5geqxs783wtlj550qs8czzku4nk3pqp6m593qxgunzuqcwkmgqkmp6ty0wyvjcqdguv3pnpukedwn6cr87m89t74h3auyaeg89xkvgzpac70z3m9rn5xzu28c", + "used": false + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-offer(7)", + "lightning-listoffers(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-disconnect.json b/doc/schemas/lightning-disconnect.json new file mode 100644 index 000000000000..ea39855dc58a --- /dev/null +++ b/doc/schemas/lightning-disconnect.json @@ -0,0 +1,80 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "disconnect", + "title": "Command for disconnecting from another lightning node", + "description": [ + "The disconnect RPC command closes an existing connection to a peer, identified by *id*, in the Lightning Network, as long as it doesn't have an active channel." + ], + "request": { + "required": [ + "id" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The public key of the peer to terminate the connection. It can be discovered in the output of the listpeers command, which returns a set of peers:", + "{", + " 'peers':", + " [", + " {", + " 'id': '0563aea81...',", + " 'connected': true,", + " ...", + " }", + " ]", + "}" + ] + }, + "force": { + "type": "boolean", + "description": [ + "If set to True, it will disconnect even with an active channel." + ] + } + } + }, + "response": { + "properties": {} + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error." + ], + "example_json_request": [ + { + "id": "example:disconnect#1", + "method": "disconnect", + "params": { + "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "force": false + } + }, + { + "id": "example:disconnect#2", + "method": "disconnect", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "force": true + } + } + ], + "example_json_response": [ + {}, + {} + ], + "author": [ + "Michael Hawkins <>." + ], + "see_also": [ + "lightning-connect(1)", + "lightning-listpeers(1)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-emergencyrecover.json b/doc/schemas/lightning-emergencyrecover.json new file mode 100644 index 000000000000..77295cbac911 --- /dev/null +++ b/doc/schemas/lightning-emergencyrecover.json @@ -0,0 +1,63 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "emergencyrecover", + "title": "Command for recovering channels from the emergency.recovery file in the lightning directory", + "description": [ + "The **emergencyrecover** RPC command fetches data from the emergency.recover file and tries to reconnect to the peer and force him to close the channel. The data in this file has enough information to reconnect and sweep the funds.", + "", + "This recovery method is not spontaneous and it depends on the peer, so it should be used as a last resort to recover the funds stored in a channel in case of severe data loss." + ], + "request": { + "required": [], + "properties": {} + }, + "response": { + "required": [ + "stubs" + ], + "properties": { + "stubs": { + "type": "array", + "items": { + "type": "hash", + "description": [ + "Channel IDs of channels successfully inserted." + ] + } + } + } + }, + "example_json_request": [ + { + "id": "example:emergencyrecover#1", + "method": "emergencyrecover", + "params": "{}" + }, + { + "id": "example:emergencyrecover#2", + "method": "emergencyrecover", + "params": "{}" + } + ], + "example_json_response": [ + { + "stubs": [] + }, + { + "stubs": [ + "c00734472f344fdadd0bf787de182e5cf144ccda5d731b0f7c75befd1f1eff52" + ] + } + ], + "author": [ + "Aditya <> is mainly responsible." + ], + "see_also": [ + "lightning-getsharedsecret(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-feerates.json b/doc/schemas/lightning-feerates.json new file mode 100644 index 000000000000..70bdc6c84fac --- /dev/null +++ b/doc/schemas/lightning-feerates.json @@ -0,0 +1,488 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "feerates", + "title": "Command for querying recommended onchain feerates", + "description": [ + "The **feerates** command returns the feerates that CLN will use. The feerates will be based on the recommended feerates from the backend. The backend may fail to provide estimates, but if it was able to provide estimates in the past, CLN will continue to use those for a while. CLN will also smoothen feerate estimations from the backend.", + "", + "Explorers often present fees in \"sat/vB\": 4 sat/vB is `4000perkb` or `1000perkw`.", + "", + "Bitcoin transactions have non-witness and witness bytes:", + "", + "* Non-witness bytes count as 4 weight, 1 virtual byte. All bytes other than SegWit witness count as non-witness bytes. * Witness bytes count as 1 weight, 0.25 virtual bytes.", + "", + "Thus, all *perkb* feerates will be exactly 4 times *perkw* feerates.", + "", + "To compute the fee for a transaction, multiply its weight or virtual bytes by the appropriate *perkw* or *perkw* feerate returned by this command, then divide by 1000.", + "", + "There is currently no way to change these feerates from the RPC. If you need custom control over onchain feerates, you will need to provide your own plugin that replaces the `bcli` plugin backend. For commands like lightning-withdraw(7) or lightning-fundchannel(7) you can provide a preferred feerate directly as a parameter, which will override the recommended feerates returned by **feerates**." + ], + "request": { + "required": [ + "style" + ], + "properties": { + "style": { + "type": "string", + "description": [ + "Fee rate style to use. This can be:", + " *perkw* - provide feerate in units of satoshis per 1000 weight (e.g. the minimum fee is usually `253perkw`).", + " *perkb* - provide feerate in units of satoshis per 1000 virtual bytes (eg. the minimum fee is usually `1000perkb`)." + ], + "enum": [ + "perkb", + "perkw" + ] + } + } + }, + "response": { + "required": [], + "properties": { + "warning_missing_feerates": { + "type": "string", + "description": [ + "Some fee estimates are missing." + ] + }, + "perkb": { + "type": "object", + "description": [ + "If *style* parameter was perkb." + ], + "additionalProperties": false, + "required": [ + "min_acceptable", + "max_acceptable", + "floor", + "estimates" + ], + "properties": { + "min_acceptable": { + "type": "u32", + "description": [ + "The smallest feerate that we allow peers to specify: half the 100-block estimate." + ] + }, + "max_acceptable": { + "type": "u32", + "description": [ + "The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet)." + ] + }, + "floor": { + "type": "u32", + "added": "v23.05", + "description": [ + "The smallest feerate that our backend tells us it will accept (i.e. minrelayfee or mempoolminfee)." + ] + }, + "estimates": { + "type": "array", + "added": "v23.05", + "description": [ + "Feerate estimates from plugin which we are using (usuallly bcli)." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "blockcount", + "feerate", + "smoothed_feerate" + ], + "properties": { + "blockcount": { + "type": "u32", + "added": "v23.05", + "description": [ + "The number of blocks the feerate is expected to get a transaction in." + ] + }, + "feerate": { + "type": "u32", + "added": "v23.05", + "description": [ + "The feerate for this estimate, in given *style*." + ] + }, + "smoothed_feerate": { + "type": "u32", + "added": "v23.05", + "description": [ + "The feerate, smoothed over time (useful for coordinating with other nodes)." + ] + } + } + } + }, + "opening": { + "type": "u32", + "description": [ + "Default feerate for lightning-fundchannel(7) and lightning-withdraw(7)." + ] + }, + "mutual_close": { + "type": "u32", + "description": [ + "Feerate to aim for in cooperative shutdown. Note that since mutual close is a **negotiation**, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer." + ] + }, + "unilateral_close": { + "type": "u32", + "description": [ + "Feerate for commitment_transaction in a live channel which we originally funded." + ] + }, + "unilateral_anchor_close": { + "type": "u32", + "added": "v23.08", + "description": [ + "Feerate for commitment_transaction in a live channel which we originally funded (if anchor_outputs was negotiated)." + ] + }, + "delayed_to_us": { + "type": "u32", + "deprecated": [ + "v23.05", + "v24.05" + ], + "description": [ + "Feerate for returning unilateral close funds to our wallet." + ] + }, + "htlc_resolution": { + "type": "u32", + "deprecated": [ + "v23.05", + "v24.05" + ], + "description": [ + "Feerate for returning unilateral close HTLC outputs to our wallet." + ] + }, + "penalty": { + "type": "u32", + "description": [ + "Feerate to use when creating penalty tx for watchtowers." + ] + } + } + }, + "perkw": { + "type": "object", + "description": [ + "If *style* parameter was perkw." + ], + "additionalProperties": false, + "required": [ + "min_acceptable", + "max_acceptable", + "floor", + "estimates" + ], + "properties": { + "min_acceptable": { + "type": "u32", + "description": [ + "The smallest feerate that you can use, usually the minimum relayed feerate of the backend." + ] + }, + "max_acceptable": { + "type": "u32", + "description": [ + "The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet)." + ] + }, + "floor": { + "type": "u32", + "added": "v23.05", + "description": [ + "The smallest feerate that our backend tells us it will accept (i.e. minrelayfee or mempoolminfee)." + ] + }, + "estimates": { + "type": "array", + "added": "v23.05", + "description": [ + "Feerate estimates from plugin which we are using (usuallly bcli)." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "blockcount", + "feerate", + "smoothed_feerate" + ], + "properties": { + "blockcount": { + "type": "u32", + "added": "v23.05", + "description": [ + "The number of blocks the feerate is expected to get a transaction in." + ] + }, + "feerate": { + "type": "u32", + "added": "v23.05", + "description": [ + "The feerate for this estimate, in given *style*." + ] + }, + "smoothed_feerate": { + "type": "u32", + "added": "v23.05", + "description": [ + "The feerate, smoothed over time (useful for coordinating with other nodes)." + ] + } + } + } + }, + "opening": { + "type": "u32", + "description": [ + "Default feerate for lightning-fundchannel(7) and lightning-withdraw(7)." + ] + }, + "mutual_close": { + "type": "u32", + "description": [ + "Feerate to aim for in cooperative shutdown. Note that since mutual close is a **negotiation**, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer." + ] + }, + "unilateral_close": { + "type": "u32", + "description": [ + "Feerate for commitment_transaction in a live channel which we originally funded (if anchor_outputs was not negotiated)." + ] + }, + "unilateral_anchor_close": { + "type": "u32", + "added": "v23.08", + "description": [ + "Feerate for commitment_transaction in a live channel which we originally funded (if anchor_outputs was negotiated)." + ] + }, + "delayed_to_us": { + "type": "u32", + "deprecated": [ + "v23.05", + "v24.05" + ], + "description": [ + "Feerate for returning unilateral close funds to our wallet." + ] + }, + "htlc_resolution": { + "type": "u32", + "deprecated": [ + "v23.05", + "v24.05" + ], + "description": [ + "Feerate for returning unilateral close HTLC outputs to our wallet." + ] + }, + "penalty": { + "type": "u32", + "description": [ + "Feerate to use when creating penalty tx for watchtowers." + ] + } + } + }, + "onchain_fee_estimates": { + "type": "object", + "additionalProperties": false, + "required": [ + "opening_channel_satoshis", + "mutual_close_satoshis", + "unilateral_close_satoshis", + "htlc_timeout_satoshis", + "htlc_success_satoshis" + ], + "properties": { + "opening_channel_satoshis": { + "type": "u64", + "description": [ + "Estimated cost of typical channel open." + ] + }, + "mutual_close_satoshis": { + "type": "u64", + "description": [ + "Estimated cost of typical channel close." + ] + }, + "unilateral_close_satoshis": { + "type": "u64", + "description": [ + "Estimated cost of typical unilateral close (without HTLCs). If anchors are supported, this assumes a channel with anchors." + ] + }, + "unilateral_close_nonanchor_satoshis": { + "added": "v23.08", + "type": "u64", + "description": [ + "Estimated cost of non-anchor typical unilateral close (without HTLCs)." + ] + }, + "htlc_timeout_satoshis": { + "type": "u64", + "description": [ + "Estimated cost of typical HTLC timeout transaction (non-anchors)." + ] + }, + "htlc_success_satoshis": { + "type": "u64", + "description": [ + "Estimated cost of typical HTLC fulfillment transaction (non-anchors)." + ] + } + } + } + } + }, + "errors": [ + "The **feerates** command will never error, however some fields may be missing in the result if feerate estimates for that kind of transaction are unavailable." + ], + "notes": [ + "Many other commands have a *feerate* parameter. This can be:", + "", + "* One of the strings to use lightningd's internal estimates:", + " * *urgent* (next 6 blocks or so)", + " * *normal* (next 12 blocks or so)", + " * *slow* (next 100 blocks or so)", + " * *minimum* for the lowest value bitcoind will currently accept (added in v23.05)", + "", + "* A number, with an optional suffix:", + " * *blocks* means aim for confirmation in that many blocks (added in v23.05)", + " * *perkw* means the number is interpreted as satoshi-per-kilosipa (weight)", + " * *perkb* means it is interpreted bitcoind-style as satoshi-per-kilobyte. ", + "", + "Omitting the suffix is equivalent to *perkb*." + ], + "trivia": [ + "In C-lightning we like to call the weight unit \"sipa\" in honor of Pieter Wuille, who uses the name \"sipa\" on IRC and elsewhere. Internally we call the *perkw* style as \"feerate per kilosipa\"." + ], + "example_json_request": [ + { + "id": "example:feerates#1", + "method": "feerates", + "params": { + "style": "perkw", + "urgent": null, + "normal": null, + "slow": null + } + }, + { + "id": "example:feerates#2", + "method": "feerates", + "params": { + "style": "perkb", + "urgent": null, + "normal": null, + "slow": null + } + } + ], + "example_json_response": [ + { + "perkw": { + "opening": 1000000, + "mutual_close": 26362, + "unilateral_close": 26362, + "unilateral_anchor_close": 1000000, + "penalty": 26362, + "min_acceptable": 3750, + "max_acceptable": 10000000, + "floor": 253, + "estimates": [ + { + "blockcount": 2, + "feerate": 1000000, + "smoothed_feerate": 26362 + }, + { + "blockcount": 6, + "feerate": 1000000, + "smoothed_feerate": 26362 + }, + { + "blockcount": 12, + "feerate": 1000000, + "smoothed_feerate": 26362 + }, + { + "blockcount": 100, + "feerate": 1000000, + "smoothed_feerate": 26362 + } + ] + }, + "onchain_fee_estimates": { + "opening_channel_satoshis": 702000, + "mutual_close_satoshis": 17741, + "unilateral_close_satoshis": 1112000, + "unilateral_close_nonanchor_satoshis": 15764, + "htlc_timeout_satoshis": 17478, + "htlc_success_satoshis": 18532 + } + }, + { + "perkb": { + "opening": 25000, + "mutual_close": 25000, + "unilateral_close": 44000, + "unilateral_anchor_close": 25000, + "penalty": 25000, + "min_acceptable": 12500, + "max_acceptable": 600000, + "floor": 1012, + "estimates": [ + { + "blockcount": 2, + "feerate": 60000, + "smoothed_feerate": 60000 + }, + { + "blockcount": 6, + "feerate": 44000, + "smoothed_feerate": 44000 + }, + { + "blockcount": 12, + "feerate": 25000, + "smoothed_feerate": 25000 + } + ] + }, + "onchain_fee_estimates": { + "opening_channel_satoshis": 4387, + "mutual_close_satoshis": 4206, + "unilateral_close_satoshis": 6578, + "unilateral_close_nonanchor_satoshis": 6578, + "htlc_timeout_satoshis": 7293, + "htlc_success_satoshis": 7733 + } + } + ], + "author": [ + "ZmnSCPxj <> wrote the initial version of this manpage." + ], + "see_also": [ + "lightning-parsefeerate(7)", + "lightning-fundchannel(7)", + "lightning-withdraw(7)", + "lightning-txprepare(7)", + "lightning-fundchannel_start(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-fetchinvoice.json b/doc/schemas/lightning-fetchinvoice.json new file mode 100644 index 000000000000..487d2ae98e88 --- /dev/null +++ b/doc/schemas/lightning-fetchinvoice.json @@ -0,0 +1,227 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "fetchinvoice", + "title": "Command for fetch an invoice for an offer", + "warning": "experimental-offers only", + "description": [ + "The **fetchinvoice** RPC command contacts the issuer of an *offer* to get an actual invoice that can be paid. It highlights any changes between the offer and the returned invoice.", + "", + "If **fetchinvoice-noconnect** is not specified in the configuation, it will connect to the destination in the (currently common!) case where it cannot find a route which supports `option_onion_messages`." + ], + "request": { + "required": [ + "offer" + ], + "properties": { + "offer": { + "type": "string", + "description": [ + "Offer string to get an actual invoice that can be paid." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Required if the offer does not specify an amount at all, otherwise it is optional (but presumably if you set it to less than the offer, you will get an error from the issuer)." + ] + }, + "quantity": { + "type": "u64", + "description": [ + "Required if the offer specifies quantity_max, otherwise it is not allowed." + ] + }, + "recurrence_counter": { + "type": "u64", + "description": [ + "Required if the offer specifies recurrence, otherwise it is not allowed. recurrence_counter should first be set to 0, and incremented for each successive invoice in a given series." + ] + }, + "recurrence_start": { + "type": "number", + "description": [ + "Required if the offer specifies recurrence_base with start_any_period set, otherwise it is not allowed. It indicates what period number to start at." + ] + }, + "recurrence_label": { + "type": "string", + "description": [ + "Required if recurrence_counter is set, and otherwise is not allowed. It must be the same as prior fetchinvoice calls for the same recurrence, as it is used to link them together." + ] + }, + "timeout": { + "type": "number", + "description": [ + "If we don't get a reply before this we fail (default, 60 seconds)." + ] + }, + "payer_note": { + "type": "string", + "description": [ + "To ask the issuer to include in the fetched invoice." + ] + } + } + }, + "response": { + "required": [ + "invoice", + "changes" + ], + "properties": { + "invoice": { + "type": "string", + "description": [ + "The BOLT12 invoice we fetched." + ] + }, + "changes": { + "type": "object", + "description": [ + "Summary of changes from offer." + ], + "additionalProperties": false, + "required": [], + "properties": { + "description_appended": { + "type": "string", + "description": [ + "Extra characters appended to the *description* field." + ] + }, + "description": { + "type": "string", + "description": [ + "A completely replaced *description* field." + ] + }, + "vendor_removed": { + "type": "string", + "description": [ + "The *vendor* from the offer, which is missing in the invoice." + ] + }, + "vendor": { + "type": "string", + "description": [ + "A completely replaced *vendor* field." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount, if different from the offer amount multiplied by any *quantity* (or the offer had no amount, or was not in BTC)." + ] + } + } + }, + "next_period": { + "type": "object", + "description": [ + "Only for recurring invoices if the next period is under the *recurrence_limit*." + ], + "additionalProperties": false, + "required": [ + "counter", + "starttime", + "endtime", + "paywindow_start", + "paywindow_end" + ], + "properties": { + "counter": { + "type": "u64", + "description": [ + "The index of the next period to fetchinvoice." + ] + }, + "starttime": { + "type": "u64", + "description": [ + "UNIX timestamp that the next period starts." + ] + }, + "endtime": { + "type": "u64", + "description": [ + "UNIX timestamp that the next period ends." + ] + }, + "paywindow_start": { + "type": "u64", + "description": [ + "UNIX timestamp of the earliest time that the next invoice can be fetched." + ] + }, + "paywindow_end": { + "type": "u64", + "description": [ + "UNIX timestamp of the latest time that the next invoice can be fetched." + ] + } + } + } + } + }, + "errors": [ + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error.", + "- 1002: Offer has expired.", + "- 1003: Cannot find a route to the node making the offer.", + "- 1004: The node making the offer returned an error message.", + "- 1005: We timed out trying to fetch an invoice." + ], + "example_json_request": [ + { + "id": "example:fetchinvoice#1", + "method": "fetchinvoice", + "params": { + "offer": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqypq5zmnd9khqmr9yp6x2um5zcssxhftzxfdlwsnfcgw2sy8t5mxa0ytcdfat2nkdwqvpy9nnsa9mzza", + "payer_note": "Thanks for the fish!" + } + }, + { + "id": "example:fetchinvoice#2", + "method": "fetchinvoice", + "params": { + "offer": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqypq5zmnd9khqmr9yp6x2um5zcssxhftzxfdlwsnfcgw2sy8t5mxa0ytcdfat2nkdwqvpy9nnsa9mzza", + "amount_msat": 3 + } + }, + { + "id": "example:fetchinvoice#3", + "method": "fetchinvoice", + "params": { + "offer": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqypq5zmnd9khqmr9yp6x2um5zsqs593pqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4j", + "quantity": 2 + } + } + ], + "example_json_response": [ + { + "invoice": "lni1qqgvcm9h7yakcmw4mzazspu8vfgpwq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqgzpg9hx6tdwpkx2gr5v4ehg93pqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky965pqqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy84sggren772kj8mau5jp86nc6fszx48rv7ep0quszyyls8rlld3sshjr94j9z5dpsku6mnypnx7u3qw35x2grxd9eksgdqnqp462c3jt0m5y6wzrj5pp6axehtez7r20265antsrqfpvuu8fwcshgr0tsv8e6829e8xmv7laz0kwhtlx6vtk8q3d6rtthdhtwvnn6j585szquc2t7us8kguxypzasg8ewkakgx2ny5ugks0f32x67sm9e5fms4asqrylajc2dqh8ag55mv5p5ghy3e2z8zwmllle8uu7jsxv5ke8d6rr5h7kthmz7ya0hxp4nt7elvw7vghcl6fgsuqqqqqqqqqqqqqqq9qqqqqqqqqqqqq8fykt06c5sqqqqqpfqyvhtunn4gyzy0lphn4wn6ctzlsajy46wscjcglf3hxcnvlaxqs3ydkhgaklsc42spq2czzq6a9vge9ha6zd8ppe2qsawnvm4u30p484d2we4cpsyskwwr5hvgthcyqyuen02ejwpa9cjjrttvp223yxsqkrwnlaszkhas84w0ape300ued4p75xu3cqtcg0cslsx9fvh7dhdqx565t6wa0alf6u2hug90j2hs", + "changes": {} + }, + { + "invoice": "lni1qqg0mfchkz0gkmn8zzu5zaxd0qvlzq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqgzpg9hx6tdwpkx2gr5v4ehg93pqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky965pqqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy84yqgrtqss8d4vgzd3286u9rk0zg9qr7a6z2xm6mjnz9pydztcn0j74tjvch0f5zvqxhftzxfdlwsnfcgw2sy8t5mxa0ytcdfat2nkdwqvpy9nnsa9mzzaqth4fzjqxxmsaxvc4v2urs6hsh6k0e564x00g68vuyp5w7yjedzxvqgr8ltzmj0n7ltxr0tz9rafn9zcy9jldjqfuf20w6gjmr7nj04d360sqvkdwprxn22dlp3xay9yq4nhrw2jm0c8t6r7japhdad6leawxyqzkg92tx8gqxp9f2d8j5k2axta0gr7yr9zrsqqqqqqqqqqqqqqq5qqqqqqqqqqqqqayjedltzjqqqqqq9yq3ja0jwj4qswt3kgs9mxq7gck66x60m5rndykpw3a7hf4ntlp9qe2vgwzzrvcwd2qypmqggrt543ryklhgf5uy89gzr46dnwhj9ux5744fmxhqxqjzeecwja3pwlqsxyjcdwur4hl4qf7nsjgg8euvy45lznufh5kydkwz6llsucuhvwp9ezeggaj3k057ge6ftvaffjkwn6j3y7faeuysrx3m2xccphu65sx", + "changes": {} + }, + { + "invoice": "lni1qqgd508mv9rpjg2ec8dr8qcslf2cjq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqgzpg9hx6tdwpkx2gr5v4ehg9qppgtzzq3dygmzpg6e53ll0aavg37gt3rvjg762vufygdqq4xprs0regcat9gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02cqsykppqfkyy6q8ry9pchxtuajh456hhcf7dxx733cx76etuv5ftfmfa2ymhgycqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jq6uhkeymz26zx7zgw4gdmw2vj9xqn4hu2sqxhp0pcgt87pf9chyfvqsywtejxjh603kx7am3zaf6d6xuumw30p8zmcdz7r95nn4lr92exk3qqe2x6xqwpdzh2zwq3vnyra8nfc6d7y6hegpkvc7p2nulj7hvhwl5hjfr23wn60mjftqspn7d4ejhrpsr5m2y8qqqqqqqqqqqqqqqpgqqqqqqqqqqqqp6f9jm7k9yqqqqqq2gpr96l9mt2pqxuyr0gqw92h0xz2y2uy5uxss4ujcac5jehj9ay2sxkapr80t5ha65qgykqssytfzxcs2xkdy0lml0tzy0jzugmyj8kjn8zfzrgq9fsgurc72x82e7pqxhl4u29cjluw5s8fwa9wtvh0qytr7vqk0vtndsz07mrrtmjw629m8mnqkjaf43kt889qeq2f7deu6t853lngpzclapt8nj0g528v9ay", + "changes": {} + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-sendinvoice(7)", + "lightning-pay(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-fundchannel.json b/doc/schemas/lightning-fundchannel.json new file mode 100644 index 000000000000..6e6003d1f58a --- /dev/null +++ b/doc/schemas/lightning-fundchannel.json @@ -0,0 +1,310 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "fundchannel", + "title": "Command for establishing a lightning channel", + "description": [ + "The **fundchannel** RPC command opens a payment channel with a peer by committing a funding transaction to the blockchain as defined in BOLT #2.", + "", + "If not already connected, **fundchannel** will automatically attempt to connect if Core Lightning knows a way to contact the node (either from normal gossip, or from a previous **connect** call).", + "", + "This auto-connection can fail if Core Lightning does not know how to contact the target node; see lightning-connect(7).", + "", + "Once the transaction is confirmed, normal channel operations may begin. Readiness is indicated by **listpeers** reporting a *state* of `CHANNELD_NORMAL` for the channel." + ], + "request": { + "required": [ + "id", + "amount" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "Id is the peer id obtained from connect." + ] + }, + "amount": { + "type": "msat_or_all", + "description": [ + "The amount in satoshis taken from the internal wallet to fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency- msat` as change). The string *all* can be used to specify all available funds (or 16777215 satoshi if more is available and large channels were not negotiated with the peer). Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The value cannot be less than the dust limit, currently set to 546, nor more than 16777215 satoshi (unless large channels were negotiated with the peer)." + ] + }, + "feerate": { + "type": "feerate", + "description": [ + "Used for the opening transaction and (unless *option_anchors_zero_fee_htlc_tx* is negotiated), as initial feerate for commitment and HTLC transactions (see NOTES in lightning-feerates(7))." + ], + "default": "*normal*" + }, + "announce": { + "type": "boolean", + "description": [ + "Whether to announce this channel or not. An unannounced channel is considered private." + ], + "default": "True" + }, + "minconf": { + "type": "u32", + "description": [ + "The minimum number of confirmations that used outputs should have." + ], + "default": "1" + }, + "push_msat": { + "type": "msat", + "description": [ + "The amount of millisatoshis to push to the channel peer at open. Note that this is a gift to the peer -- these satoshis are added to the initial balance of the peer at channel start and are largely unrecoverable once pushed." + ] + }, + "close_to": { + "type": "string", + "description": [ + "A Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. Returns `close_to` set to closing script iff is negotiated." + ] + }, + "request_amt": { + "type": "msat", + "description": [ + "An amount of liquidity you'd like to lease from the peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*." + ] + }, + "compact_lease": { + "type": "string", + "description": [ + "A compact representation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel." + ] + }, + "utxos": { + "type": "array", + "description": [ + "The utxos to be used to fund the channel, as an array of `txid:vout`." + ], + "items": { + "type": "outpoint" + } + }, + "mindepth": { + "description": [ + "Number of confirmations required before we consider the channel active." + ], + "type": "u32" + }, + "reserve": { + "type": "msat", + "description": [ + "The amount we want the peer to maintain on its side of the channel. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*." + ], + "default": "1% of the funding amount" + }, + "channel_type": { + "added": "v24.02", + "type": "array", + "items": { + "type": "u32", + "description": [ + "Represents the explicit channel type to request. There is currently no sanity checking on this value so if you use strange values and your channel breaks, you get to keep both pieces. BOLT 2 defines the following value types:", + "```", + "The currently defined basic types are:", + " - no features (no bits set).", + " - `option_static_remotekey` (bit 12).", + " - `option_anchor_outputs` and `option_static_remotekey` (bits 20 and 12).", + " - `option_anchors_zero_fee_htlc_tx` and `option_static_remotekey` (bits 22 and 12).", + "", + "Each basic type has the following variations allowed:", + " - `option_scid_alias` (bit 46).", + " - `option_zeroconf` (bit 50).", + "```" + ] + } + } + } + }, + "response": { + "required": [ + "tx", + "txid", + "outnum", + "channel_type", + "channel_id" + ], + "properties": { + "tx": { + "type": "hex", + "description": [ + "The raw transaction which funded the channel." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The txid of the transaction which funded the channel." + ] + }, + "outnum": { + "type": "u32", + "description": [ + "The 0-based output index showing which output funded the channel." + ] + }, + "channel_id": { + "type": "hash", + "description": [ + "The channel_id of the resulting channel." + ] + }, + "channel_type": { + "type": "object", + "description": [ + "Channel_type as negotiated with peer." + ], + "added": "v24.02", + "additionalProperties": false, + "required": [ + "bits", + "names" + ], + "properties": { + "bits": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + }, + "names": { + "type": "array", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" + ], + "description": [ + "Name of feature bit." + ] + } + } + } + }, + "close_to": { + "type": "hex", + "description": [ + "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`." + ] + }, + "mindepth": { + "type": "u32", + "description": [ + "Number of confirmations before we consider the channel active." + ] + } + } + }, + "example_usage": [ + "This example shows how to use lightning-cli to open new channel with peer 03f...fc1 from one whole utxo bcc1...39c:0 (you can use **listfunds** command to get txid and vout):", + "", + "```shell", + "lightning-cli -k fundchannel id=03f...fc1 amount=all feerate=normal utxos='[\"bcc1...39c:0\"]'", + "```" + ], + "example_json_request": [ + { + "id": "example:fundchannel#1", + "method": "fundchannel", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount": 1000000, + "feerate": null, + "announce": true, + "minconf": null, + "utxos": null, + "push_msat": null, + "close_to": null, + "request_amt": null, + "compact_lease": null, + "mindepth": null, + "reserve": null + } + }, + { + "id": "example:fundchannel#2", + "method": "fundchannel", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount": 10000000, + "feerate": null, + "announce": true, + "minconf": null, + "utxos": null, + "push_msat": 1000000000, + "close_to": null, + "request_amt": null, + "compact_lease": null, + "mindepth": null, + "reserve": null, + "channel_type": null + } + } + ], + "example_json_response": [ + { + "tx": "020000000001014ca47b75e6982fce6b5ebb6e7ec163dc5b6bed1562934e6febe816103b2b207e0000000000fdffffff0240420f00000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd012f0f000000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a02473044022058fc4d51c8254d37b266d3db3f8fda7420882b6ec9226d66b8c0139f2707c09602205798d8ce23d4c692a7384362a2e0afd9703f062239a786d7a1840a28d3a1152e012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000", + "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b", + "channel_id": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "outnum": 0 + }, + { + "tx": "0200000000010141cfa0e9957c7c6d0bb5069d92937f9545e6e6ee9b4650f47f509d5ea65df4690100000000fdffffff0280969800000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd4118530b0000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a0247304402206488c7dfbc4180781ed0d5ca7ff2c8ce134480c349d03978765053a393229d9a022066c75dee1f19b410ea1c7756d0cb2c097e52b13f4d9bbd033efa4ed95d817e14012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000", + "txid": "6aa1231b6356777468a55aea1f49dad6415592aef6c1e652f8a64357c7235301", + "channel_id": "015323c75743a6f852e6c1f6ae925541d6da491fea5aa568747756631b23a16a", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "outnum": 0 + } + ], + "errors": [ + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error.", + "- 300: The maximum allowed funding amount is exceeded.", + "- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.", + "- 302: The output amount is too small, and would be considered dust.", + "- 303: Broadcasting of the funding transaction failed, the internal call to bitcoin-cli returned with an error.", + "- 313: The `min-emergency-msat` reserve not be preserved (and we have or are opening anchor channels).", + "", + "Failure may also occur if **lightningd** and the peer cannot agree on channel parameters (funding limits, channel reserves, fees, etc.)." + ], + "see_also": [ + "lightning-connect(7)", + "lightning-listfunds()", + "lightning-listpeers(7)", + "lightning-feerates(7)", + "lightning-multifundchannel(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-fundchannel_cancel.json b/doc/schemas/lightning-fundchannel_cancel.json new file mode 100644 index 000000000000..a42ef609e690 --- /dev/null +++ b/doc/schemas/lightning-fundchannel_cancel.json @@ -0,0 +1,89 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "fundchannel_cancel", + "title": "Command for completing channel establishment", + "description": [ + "`fundchannel_cancel` is a lower level RPC command. It allows channel opener to cancel a channel before funding broadcast with a connected peer.", + "", + "Note that the funding transaction MUST NOT be broadcast before `fundchannel_cancel`. Broadcasting transaction before `fundchannel_cancel` WILL lead to unrecoverable loss of funds.", + "", + "If `fundchannel_cancel` is called after `fundchannel_complete`, the remote peer may disconnect when command succeeds. In this case, user need to connect to remote peer again before opening channel." + ], + "request": { + "required": [ + "id" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "Node id of the remote peer with which to cancel." + ] + } + } + }, + "response": { + "required": [ + "cancelled" + ], + "properties": { + "cancelled": { + "type": "string", + "description": [ + "A message indicating it was cancelled by RPC." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:fundchannel_cancel#1", + "method": "fundchannel_cancel", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" + } + }, + { + "id": "example:fundchannel_cancel#2", + "method": "fundchannel_cancel", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" + } + } + ], + "example_json_response": [ + { + "cancelled": "Channel open canceled by RPC" + }, + { + "cancelled": "Channel open canceled by RPC(after fundchannel_complete)" + } + ], + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- 306: Unknown peer id.", + "- 307: No channel currently being funded that can be cancelled.", + "- 308: It is unsafe to cancel the channel: the funding transaction has been broadcast, or there are HTLCs already in the channel, or the peer was the initiator and not us." + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-connect(7)", + "lightning-fundchannel(7)", + "lightning-multifundchannel(7)", + "lightning-fundchannel_start(7)", + "lightning-fundchannel_complete(7)", + "lightning-openchannel_init(7)", + "lightning-openchannel_update(7)", + "lightning-openchannel_signed(7)", + "lightning-openchannel_abort(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-fundchannel_complete.json b/doc/schemas/lightning-fundchannel_complete.json new file mode 100644 index 000000000000..89b74575e5ab --- /dev/null +++ b/doc/schemas/lightning-fundchannel_complete.json @@ -0,0 +1,98 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "fundchannel_complete", + "title": "Command for completing channel establishment", + "description": [ + "`fundchannel_complete` is a lower level RPC command. It allows a user to complete an initiated channel establishment with a connected peer.", + "", + "Note that the funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed, as the commitment transactions for this channel are not secured until this command successfully completes. Broadcasting transaction before can lead to unrecoverable loss of funds." + ], + "request": { + "required": [ + "id", + "psbt" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "Node id of the remote peer." + ] + }, + "psbt": { + "type": "string", + "description": [ + "Transaction to use for funding (does not need to be signed but must be otherwise complete)." + ] + } + } + }, + "response": { + "required": [ + "channel_id", + "commitments_secured" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "The channel_id of the resulting channel." + ] + }, + "commitments_secured": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Indication that channel is safe to use." + ] + } + } + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 305: Peer is not connected.", + "- 306: Unknown peer id.", + "- 309: PSBT does not have a unique, correct output to fund the channel." + ], + "example_json_request": [ + { + "id": "example:fundchannel_complete#1", + "method": "fundchannel_complete", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "psbt": "cHNidP8BAIkCAAAAASYd4TeOHEIzrUbbELM2DK0IX09WaXqWsJFlLD455MPPAAAAAAD9////Av///wAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM1c8QUpAQAAACJRIH8AZYBKMKON4/oVmJVsVt6zy/+PkBPzziE+LtkuFvWXAAAAAAABAIMCAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////wJRAP////8CAPIFKgEAAAAWABQ5FIjuMd8ar9WFRV9eGNLF+3RMcAAAAAAAAAAAJmokqiGp7eL2HD9x0d79P6mZ36NpU3VcaQaJeZlitIvr2DaXToz5AAAAAAEBHwDyBSoBAAAAFgAUORSI7jHfGq/VhUVfXhjSxft0THAiBgMegIxEPDa2OseVTaV6ANtSwQuoj/j2an7X/Is2EekvWBhhFDNgVAAAgAEAAIAAAACAAAAAAAAAAAAAAAEFIEm9AFgqUlJwbPFtyt3a9dzvb+nAGZiQ3CT1CImhjBFpIQdJvQBYKlJScGzxbcrd2vXc72/pwBmYkNwk9QiJoYwRaRkAYRQzYFYAAIABAACAAAAAgAEAAAAAAAAAAA==" + } + } + ], + "example_json_response": [ + { + "channel_id": "049217e5035a4a60449c6382c445b5c105bd63588d66137ad0511c57a16db6d9", + "commitments_secured": true + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-connect(7)", + "lightning-fundchannel(7)", + "lightning-multifundchannel(7)", + "lightning-fundchannel_start(7)", + "lightning-fundchannel_cancel(7)", + "lightning-openchannel_init(7)", + "lightning-openchannel_update(7)", + "lightning-openchannel_signed(7)", + "lightning-openchannel_bump(7)", + "lightning-openchannel_abort(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-fundchannel_start.json b/doc/schemas/lightning-fundchannel_start.json new file mode 100644 index 000000000000..a4fbee579ebb --- /dev/null +++ b/doc/schemas/lightning-fundchannel_start.json @@ -0,0 +1,256 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "fundchannel_start", + "title": "Command for initiating channel establishment for a lightning channel", + "description": [ + "`fundchannel_start` is a lower level RPC command. It allows a user to initiate channel establishment with a connected peer.", + "", + "Note that the funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`, as the commitment transactions for this channel are not secured until the complete command succeeds. Broadcasting transaction before that can lead to unrecoverable loss of funds." + ], + "request": { + "required": [ + "id", + "amount" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The peer id obtained from connect." + ] + }, + "amount": { + "type": "sat", + "description": [ + "Satoshi value that the channel will be funded at. This value MUST be accurate, otherwise the negotiated commitment transactions will not encompass the correct channel value." + ] + }, + "feerate": { + "type": "feerate", + "description": [ + "Feerate for subsequent commitment transactions: see **fundchannel**. Note that this is ignored for channels with *option_anchors_zero_fee_htlc_tx* (we always use a low commitment fee for these)." + ] + }, + "announce": { + "type": "boolean", + "description": [ + "Whether or not to announce this channel." + ] + }, + "close_to": { + "type": "string", + "description": [ + "Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. Returns `close_to` set to closing script iff is negotiated." + ] + }, + "push_msat": { + "type": "msat", + "description": [ + "Amount of millisatoshis to push to the channel peer at open. Note that this is a gift to the peer -- these satoshis are added to the initial balance of the peer at channel start and are largely unrecoverable once pushed." + ] + }, + "mindepth": { + "type": "u32", + "description": [ + "Number of confirmations required before we consider the channel active." + ] + }, + "reserve": { + "type": "msat", + "description": [ + "The amount we want the peer to maintain on its side." + ] + }, + "channel_type": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + } + }, + "pairedWith": [ + [ + "feerate", + "announce", + "close_to", + "push_msat", + "channel_type", + "mindepth", + "reserve" + ] + ] + }, + "response": { + "required": [ + "funding_address", + "scriptpubkey", + "warning_usage" + ], + "properties": { + "funding_address": { + "type": "string", + "description": [ + "The address to send funding to for the channel. DO NOT SEND COINS TO THIS ADDRESS YET." + ] + }, + "scriptpubkey": { + "type": "hex", + "description": [ + "The raw scriptPubkey for the address." + ] + }, + "channel_type": { + "type": "object", + "description": [ + "Channel_type as negotiated with peer." + ], + "added": "v24.02", + "additionalProperties": false, + "required": [ + "bits", + "names" + ], + "properties": { + "bits": { + "type": "array", + "added": "v24.02", + "description": [ + "Each bit set in this channel_type." + ], + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + }, + "names": { + "type": "array", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" + ], + "description": [ + "Name of feature bit." + ] + } + } + } + }, + "close_to": { + "type": "hex", + "description": [ + "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`." + ] + }, + "warning_usage": { + "type": "string", + "description": [ + "A warning not to prematurely broadcast the funding transaction (always present!)." + ] + }, + "mindepth": { + "type": "u32", + "description": [ + "Number of confirmations before we consider the channel active." + ] + } + } + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 300: The amount exceeded the maximum configured funding amount.", + "- 301: The provided `push_msat` is greater than the provided `amount`.", + "- 304: Still syncing with bitcoin network", + "- 305: Peer is not connected.", + "- 306: Unknown peer id.", + "- 312: Peer negotiated `option_dual_fund`, must use `openchannel_init` not `fundchannel_start`. (Only if ``experimental-dual-fund` is enabled)" + ], + "example_json_request": [ + { + "id": "example:fundchannel_start#1", + "method": "fundchannel_start", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount": 16777216, + "feerate": null, + "announce": true, + "close_to": null, + "mindepth": null + } + }, + { + "id": "example:fundchannel_start#2", + "method": "fundchannel_start", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount": "100000sat", + "feerate": null, + "announce": true, + "close_to": null, + "mindepth": null, + "channel_type": null + } + } + ], + "example_json_response": [ + { + "funding_address": "bcrt1qtwxd8wg5eanumk86vfeujvp48hfkgannf77evggzct048wggsrxsum2pmm", + "scriptpubkey": "00205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd", + "warning_usage": "The funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`" + }, + { + "funding_address": "bcrt1qtwxd8wg5eanumk86vfeujvp48hfkgannf77evggzct048wggsrxsum2pmm", + "scriptpubkey": "00205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "warning_usage": "The funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`" + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-connect(7)", + "lightning-fundchannel(7)", + "lightning-multifundchannel(7)", + "lightning-fundchannel_complete(7)", + "lightning-fundchannel_cancel(7)", + "lightning-openchannel_init(7)", + "lightning-openchannel_update(7)", + "lightning-openchannel_signed(7)", + "lightning-openchannel_bump(7)", + "lightning-openchannel_abort(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-funderupdate.json b/doc/schemas/lightning-funderupdate.json new file mode 100644 index 000000000000..0475eb2834ae --- /dev/null +++ b/doc/schemas/lightning-funderupdate.json @@ -0,0 +1,335 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "funderupdate", + "title": "Command for adjusting node funding v2 channels", + "description": [ + "NOTE: Must have --experimental-dual-fund enabled for these settings to take effect.", + "", + "For channel open requests using dual funding.", + "", + "Note: to maximize channel leases, best policy setting is (match, 100).", + "", + "Setting any of the 5 options from *lease_fee_base_msat*, *lease_fee_basis*, *funding_weight*, *channel_fee_max_base_msat* and, *channel_fee_max_proportional_thousandths* will activate channel leases for this node, and advertise these values via the lightning gossip network. If any one is set, the other values will be the default." + ], + "request": { + "required": [], + "properties": { + "policy": { + "type": "string", + "enum": [ + "match", + "available", + "fixed" + ], + "description": [ + "Funder plugin will use to decide how much capital to commit to a v2 open channel request.", + "There are three policy options, detailed below:", + " * `match` -- Contribute *policy_mod* percent of their requested funds. Valid *policy_mod* values are 0 to 200. If this is a channel lease request, we match based on their requested funds. If it is not a channel lease request (and *lease_only* is false), then we match their funding amount. Note: any lease match less than 100 will likely fail, as clients will not accept a lease less than their request.", + " * `available` -- Contribute *policy_mod* percent of our available node wallet funds. Valid *policy_mod* values are 0 to 100.", + " * `fixed` -- Contributes a fixed *policy_mod* sats to v2 channel open requests." + ], + "default": "fixed" + }, + "policy_mod": { + "type": "sat", + "description": [ + "Number or 'modification' to apply to the policy." + ], + "default": "0sats" + }, + "leases_only": { + "type": "boolean", + "description": [ + "Only contribute funds to `option_will_fund` requests which pay to lease funds. It will fund any v2 open request using *policy* even if it's they're not seeking to lease funds. Note that `option_will_fund` commits funds for 4032 blocks (~1mo). Must also set *lease_fee_base_msat*, *lease_fee_basis*, *funding_weight*, *channel_fee_max_base_msat*, and *channel_fee_max_proportional_thousandths* to advertise available channel leases." + ], + "default": "False" + }, + "min_their_funding_msat": { + "type": "msat", + "description": [ + "Minimum funding sats that we require in order to activate our contribution policy to the v2 open." + ], + "default": "10k sats" + }, + "max_their_funding_msat": { + "type": "msat", + "description": [ + "Maximum funding sats that we will consider to activate our contribution policy to the v2 open. Any channel open above this will not be funded." + ], + "default": "no max (`UINT_MAX`)" + }, + "per_channel_min_msat": { + "type": "msat", + "description": [ + "Minimum amount that we will contribute to a channel open." + ], + "default": "10k sats" + }, + "per_channel_max_msat": { + "type": "msat", + "description": [ + "Maximum amount that we will contribute to a channel open." + ], + "default": "no max (`UINT_MAX`)" + }, + "reserve_tank_msat": { + "type": "msat", + "description": [ + "Amount of sats to leave available in the node wallet." + ], + "default": "zero sats" + }, + "fuzz_percent": { + "type": "u32", + "description": [ + "A percentage to fuzz the resulting contribution amount by. Valid values are 0 to 100. Note that turning this on with (match, 100) policy will randomly fail `option_will_fund` leases, as most clients expect an exact or greater match of their `requested_funds`." + ], + "default": "0% (no fuzz)" + }, + "fund_probability": { + "type": "u32", + "description": [ + "The percent of v2 channel open requests to apply our policy to. Valid values are integers from 0 (fund 0% of all open requests) to 100 (fund every request). Useful for randomizing opens that receive funds. Useful for randomizing opens that receive funds." + ], + "default": "100" + }, + "lease_fee_base_msat": { + "type": "msat", + "description": [ + "Flat fee for a channel lease. Node will receive this much extra added to their channel balance, paid by the opening node. Note that the minimum is 1sat." + ], + "default": "2k sats" + }, + "lease_fee_basis": { + "type": "u32", + "description": [ + "A basis fee that's calculated as 1/10k of the total requested funds the peer is asking for. Node will receive the total of *lease_fee_basis* times requested funds / 10k satoshis added to their channel balance, paid by the opening node." + ], + "default": "0.65% (65 basis points)" + }, + "funding_weight": { + "type": "u32", + "description": [ + "To calculate the fee the peer will compensate your node for its contributing inputs to the funding transaction. The total fee is calculated as the `open_channel2`.`funding_feerate_perkw` times this *funding_weight* divided by 1000. Node will have this funding fee added to their channel balance, paid by the opening node." + ], + "default": "2 inputs + 1 P2WPKH output" + }, + "channel_fee_max_base_msat": { + "type": "msat", + "description": [ + "A commitment to a maximum `channel_fee_base_msat` that your node will charge for routing payments over this leased channel during the lease duration." + ], + "default": "5k sats" + }, + "channel_fee_max_proportional_thousandths": { + "type": "u32", + "description": [ + "A commitment to a maximum `channel_fee_proportional_millionths` that your node will charge for routing payments over this leased channel during the lease duration. Note that it's denominated in 'thousandths'. A setting of `1` is equal to 1k ppm; `5` is 5k ppm, etc." + ], + "default": "100 (100k ppm)" + }, + "compact_lease": { + "type": "hex", + "description": [ + "A compact description of the channel lease params. When opening a channel, passed in to `fundchannel` to indicate the terms we expect from the peer." + ] + } + } + }, + "response": { + "required": [ + "summary", + "policy", + "policy_mod", + "leases_only", + "min_their_funding_msat", + "max_their_funding_msat", + "per_channel_min_msat", + "per_channel_max_msat", + "reserve_tank_msat", + "fuzz_percent", + "fund_probability" + ], + "properties": { + "summary": { + "type": "string", + "description": [ + "Summary of the current funding policy e.g. (match 100)." + ] + }, + "policy": { + "type": "string", + "enum": [ + "match", + "available", + "fixed" + ], + "description": [ + "Policy funder plugin will use to decide how much capital to commit to a v2 open channel request." + ] + }, + "policy_mod": { + "type": "u32", + "description": [ + "The *policy_mod* is the number or 'modification' to apply to the policy." + ] + }, + "leases_only": { + "type": "boolean", + "description": [ + "Only contribute funds to `option_will_fund` lease requests." + ] + }, + "min_their_funding_msat": { + "type": "msat", + "description": [ + "The minimum funding sats that we require from peer to activate our funding policy." + ] + }, + "max_their_funding_msat": { + "type": "msat", + "description": [ + "The maximum funding sats that we'll allow from peer to activate our funding policy." + ] + }, + "per_channel_min_msat": { + "type": "msat", + "description": [ + "The minimum amount that we will fund a channel open with." + ] + }, + "per_channel_max_msat": { + "type": "msat", + "description": [ + "The maximum amount that we will fund a channel open with." + ] + }, + "reserve_tank_msat": { + "type": "msat", + "description": [ + "Amount of sats to leave available in the node wallet." + ] + }, + "fuzz_percent": { + "type": "u32", + "description": [ + "Percentage to fuzz our funding amount by." + ] + }, + "fund_probability": { + "type": "u32", + "description": [ + "Percent of opens to consider funding. 100 means we'll consider funding every requested open channel request." + ] + }, + "lease_fee_base_msat": { + "type": "msat", + "description": [ + "Flat fee to charge for a channel lease." + ] + }, + "lease_fee_basis": { + "type": "u32", + "description": [ + "Proportional fee to charge for a channel lease, calculated as 1/10,000th of requested funds." + ] + }, + "funding_weight": { + "type": "u32", + "description": [ + "Transaction weight the channel opener will pay us for a leased funding transaction." + ] + }, + "channel_fee_max_base_msat": { + "type": "msat", + "description": [ + "Maximum channel_fee_base_msat we'll charge for routing funds leased on this channel." + ] + }, + "channel_fee_max_proportional_thousandths": { + "type": "u32", + "description": [ + "Maximum channel_fee_proportional_millitionths we'll charge for routing funds leased on this channel, in thousandths." + ] + }, + "compact_lease": { + "type": "hex", + "description": [ + "Compact description of the channel lease parameters." + ] + } + } + }, + "errors": [ + "The following error code may occur:", + "", + "- -32602: If the given parameters are invalid." + ], + "example_json_request": [ + { + "id": "example:funderupdate#1", + "method": "funderupdate", + "params": "{}" + }, + { + "id": "example:funderupdate#2", + "method": "funderupdate", + "params": { + "policy": "fixed", + "policy_mod": "50000sat", + "min_their_funding_msat": 1000, + "per_channel_min_msat": "1000sat", + "per_channel_max_msat": "500000sat", + "fund_probability": 100, + "fuzz_percent": 0, + "leases_only": false + } + } + ], + "example_json_response": [ + { + "summary": "match (100%)", + "policy": "match", + "policy_mod": 100, + "leases_only": true, + "min_their_funding_msat": 10000000, + "max_their_funding_msat": 4294967295000, + "per_channel_min_msat": 10000000, + "per_channel_max_msat": 4294967295000, + "reserve_tank_msat": 0, + "fuzz_percent": 0, + "fund_probability": 100, + "lease_fee_base_msat": 100000, + "lease_fee_basis": 100, + "funding_weight": 666, + "channel_fee_max_base_msat": 5000000, + "channel_fee_max_proportional_thousandths": 100, + "compact_lease": "029a00640064000000644c4b40" + }, + { + "summary": "fixed (50000sat)", + "policy": "fixed", + "policy_mod": 50000, + "leases_only": false, + "min_their_funding_msat": 1000, + "max_their_funding_msat": 4294967295000, + "per_channel_min_msat": 1000000, + "per_channel_max_msat": 500000000, + "reserve_tank_msat": 0, + "fuzz_percent": 0, + "fund_probability": 100 + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-fundchannel(7)", + "lightning-listfunds(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-fundpsbt.json b/doc/schemas/lightning-fundpsbt.json new file mode 100644 index 000000000000..97955ee6410b --- /dev/null +++ b/doc/schemas/lightning-fundpsbt.json @@ -0,0 +1,293 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "fundpsbt", + "title": "Command to populate PSBT inputs from the wallet", + "description": [ + "`fundpsbt` is a low-level RPC command which creates a PSBT using unreserved inputs in the wallet, optionally reserving them as well." + ], + "request": { + "required": [ + "satoshi", + "feerate", + "startweight" + ], + "properties": { + "satoshi": { + "type": "msat_or_all", + "description": [ + "The minimum satoshi value of the output(s) needed (or the string `all` meaning use all unreserved inputs). If a value, it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*." + ] + }, + "feerate": { + "type": "feerate", + "description": [ + "Used for the transaction as initial feerate." + ], + "default": "*normal*" + }, + "startweight": { + "type": "u32", + "description": [ + "The weight of the transaction before *fundpsbt* has added any inputs." + ] + }, + "minconf": { + "type": "u32", + "description": [ + "The minimum number of confirmations that used outputs should have." + ], + "default": "1" + }, + "reserve": { + "type": "u32", + "description": [ + "If not zero, then *reserveinputs* is called (successfully, with *exclusive* true) on the returned PSBT for this number of blocks." + ], + "default": "72 blocks" + }, + "locktime": { + "type": "u32", + "description": [ + "The locktime of the transaction. if not set, it is set to a recent block height." + ] + }, + "min_witness_weight": { + "type": "u32", + "description": [ + "Minimum weight to use for a UTXO's witness. If the actual witness weight is greater than the provided minimum, the actual witness weight will be used." + ] + }, + "excess_as_change": { + "type": "boolean", + "description": [ + "Flag to add a change output for the excess sats." + ] + }, + "nonwrapped": { + "added": "v23.02", + "type": "boolean", + "description": [ + "To signal to filter out any p2sh-wrapped inputs from funding this PSBT." + ] + }, + "opening_anchor_channel": { + "added": "v23.08", + "type": "boolean", + "description": [ + "To signel that it needs emergency reserve for anchors so that we can lowball our commitment tx fees, and min-emergency-msat for reserving some sats for closing anchor channels." + ] + } + } + }, + "response": { + "required": [ + "psbt", + "feerate_per_kw", + "estimated_final_weight", + "excess_msat" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "Unsigned PSBT which fulfills the parameters given." + ] + }, + "feerate_per_kw": { + "type": "u32", + "description": [ + "The feerate used to create the PSBT, in satoshis-per-kiloweight." + ] + }, + "estimated_final_weight": { + "type": "u32", + "description": [ + "The estimated weight of the transaction once fully signed." + ] + }, + "excess_msat": { + "type": "msat", + "description": [ + "The amount above *satoshi* which is available. This could be zero, or dust; it will be zero if *change_outnum* is also returned." + ] + }, + "change_outnum": { + "type": "u32", + "description": [ + "The 0-based output number where change was placed (only if parameter *excess_as_change* was true and there was sufficient funds)." + ] + }, + "reservations": { + "type": "array", + "description": [ + "If *reserve* was true or a non-zero number, just as per lightning- reserveinputs(7)." + ], + "items": { + "type": "object", + "required": [ + "txid", + "vout", + "was_reserved", + "reserved", + "reserved_to_block" + ], + "additionalProperties": false, + "properties": { + "txid": { + "type": "txid", + "description": [ + "The txid of the transaction." + ] + }, + "vout": { + "type": "u32", + "description": [ + "The 0-based output number." + ] + }, + "was_reserved": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "Whether this output was previously reserved." + ] + }, + "reserved": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Whether this output is now reserved." + ] + }, + "reserved_to_block": { + "type": "u32", + "description": [ + "The blockheight the reservation will expire." + ] + } + } + } + } + }, + "post_return_value_notes": [ + "If *excess_as_change* is true and the excess is enough to cover an additional output above the `dust_limit`, then an output is added to the PSBT for the excess amount. The *excess_msat* will be zero. A *change_outnum* will be returned with the index of the change output." + ] + }, + "example_usage": [ + "Let's assume the caller is trying to produce a 100,000 satoshi output.", + "", + "First, the caller estimates the weight of the core (typically 42) and known outputs of the transaction (typically (9 + scriptlen) * 4). For a simple P2WPKH it's a 22 byte scriptpubkey, so that's 124 weight.", + "", + "It calls \"*fundpsbt* 100000sat slow 166\", which succeeds, and returns the *psbt* and *feerate_per_kw* it used, the *estimated_final_weight* and any *excess_msat*.", + "", + "If *excess_msat* is greater than the cost of adding a change output, the caller adds a change output randomly to position 0 or 1 in the PSBT. Say *feerate_per_kw* is 253, and the change output is a P2WPKH (weight 124), the cost is around 31 sats. With the dust limit disallowing payments below 546 satoshis, we would only create a change output if *excess_msat* was greater or equal to 31 + 546." + ], + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 301: Insufficient UTXOs to meet *satoshi* value." + ], + "example_json_request": [ + { + "id": "example:fundpsbt#1", + "method": "fundpsbt", + "params": { + "satoshi": 16777216, + "feerate": "253perkw", + "startweight": 250, + "minconf": null, + "reserve": 0, + "locktime": null, + "min_witness_weight": null, + "excess_as_change": false + } + }, + { + "id": "example:fundpsbt#2", + "method": "fundpsbt", + "params": { + "satoshi": "all", + "feerate": "1000perkw", + "startweight": 1000, + "minconf": null, + "reserve": null, + "locktime": null, + "min_witness_weight": null, + "excess_as_change": false + } + }, + { + "id": "example:fundpsbt#3", + "method": "fundpsbt", + "params": { + "satoshi": "109000sat", + "feerate": "slow", + "startweight": 166, + "minconf": null, + "reserve": null, + "locktime": null, + "min_witness_weight": null, + "excess_as_change": true + } + } + ], + "example_json_response": [ + { + "psbt": "cHNidP8BADMCAAAAAWzmSFzhTtXBnQewytc32WaMwJSunScwsYndBNdU80JqAAAAAAD9////AGYAAAAAAQDeAgAAAAABAU1MpIJeOOzqAYVkZaytJCmzUadBVltKar8kWtzKSVeYAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFD8W5uBNZAxN6n1jqU62dxWQbyGAAkcwRAIgUK+vMOeWiDPiJM8fpgKCjjwXog4yfWPvtKES1ZZPaM8CIB3cgouGpV6Gc7nEvAu28Mg9tkAWt/Xl5FDOseEyeZqHASECTwjR0I3gLHdSW7jRmnVXdm0+MgJ1hihnqEfXYeFWA/NlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=", + "feerate_per_kw": 253, + "estimated_final_weight": 521, + "excess_msat": 9999869000 + }, + { + "psbt": "cHNidP8BAF4CAAAAAfwbEpvpi6D14YV4VLnuVB47Y0uF41kXEyJRL4IusySSAQAAAAD9////ASICAAAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5nAAAAAAEA9gIAAAAAAQFEkxvLatohY6mw5gr5qG1aiArSrziFPR2YoqD21Hv+RAAAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNrz8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIEu1nfVRt9i+rFM219mwhMqdwJsqygWSWTFUS+cemdh6AiBG3Qo8g9J/aAMO2RHDsIBScscj6pTTIwZp7Gw8G3EOKAEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPZgAAAAEBK68/DwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==", + "feerate_per_kw": 1000, + "estimated_final_weight": 1443, + "excess_msat": 997354000, + "change_outnum": 0, + "reservations": [ + { + "txid": "9224b32e822f5122131759e3854b633b1e54eeb9547885e1f5a08be99b121bfc", + "vout": 1, + "was_reserved": false, + "reserved": true, + "reserved_to_block": 175 + } + ] + }, + { + "psbt": "cHNidP8BAF4CAAAAAbEf44mT/BPDxLkUjKy1byWksyLyuM6hbe8shzEbbXhGAQAAAAD9////AU58DQAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5sAAAAAAEA9gIAAAAAAQEV9Sj1wfHqO/ECZeHp/u7cFL5eRaa1Vu4hXWbwH72pxgEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIGILT3DrcNn6/WKOhsxxKq7lDWq47dV0IjRhj0bYHs4yAiApzODtmrz7ifK32G81A2XbBxWboFk2vN4T3ng/hYmb1wEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPZgAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==", + "feerate_per_kw": 3750, + "estimated_final_weight": 609, + "excess_msat": 0, + "change_outnum": 0, + "reservations": [ + { + "txid": "46786d1b31872cef6da1ceb8f222b3a4256fb5ac8c14b9c4c313fc9389e31fb1", + "vout": 1, + "was_reserved": false, + "reserved": true, + "reserved_to_block": 180 + } + ] + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-utxopsbt(7)", + "lightning-reserveinputs(7)", + "lightning-unreserveinputs(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-getinfo.json b/doc/schemas/lightning-getinfo.json new file mode 100644 index 000000000000..60c74a06ccc0 --- /dev/null +++ b/doc/schemas/lightning-getinfo.json @@ -0,0 +1,431 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "getinfo", + "title": "Command to receive all information about the Core Lightning node.", + "description": [ + "The **getinfo** gives a summary of the current running node." + ], + "request": { + "required": [], + "properties": {} + }, + "response": { + "required": [ + "id", + "alias", + "color", + "num_peers", + "num_pending_channels", + "num_active_channels", + "num_inactive_channels", + "version", + "blockheight", + "network", + "fees_collected_msat", + "lightning-dir", + "address" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The public key unique to this node." + ] + }, + "alias": { + "type": "string", + "description": [ + "The fun alias this node will advertize." + ], + "maxLength": 32 + }, + "color": { + "type": "hex", + "description": [ + "The favorite RGB color this node will advertize." + ], + "minLength": 6, + "maxLength": 6 + }, + "num_peers": { + "type": "u32", + "description": [ + "The total count of peers, connected or with channels." + ] + }, + "num_pending_channels": { + "type": "u32", + "description": [ + "The total count of channels being opened." + ] + }, + "num_active_channels": { + "type": "u32", + "description": [ + "The total count of channels in normal state." + ] + }, + "num_inactive_channels": { + "type": "u32", + "description": [ + "The total count of channels waiting for opening or closing transactions to be mined." + ] + }, + "version": { + "type": "string", + "description": [ + "Identifies what bugs you are running into." + ] + }, + "lightning-dir": { + "type": "string", + "description": [ + "Identifies where you can find the configuration and other related files." + ] + }, + "our_features": { + "type": "object", + "description": [ + "Our BOLT #9 feature bits (as hexstring) for various contexts." + ], + "additionalProperties": true, + "required": [ + "init", + "node", + "channel", + "invoice" + ], + "properties": { + "init": { + "type": "hex", + "description": [ + "Features (incl. globalfeatures) in our init message, these also restrict what we offer in open_channel or accept in accept_channel." + ] + }, + "node": { + "type": "hex", + "description": [ + "Features in our node_announcement message." + ] + }, + "channel": { + "type": "hex", + "description": [ + "Negotiated channel features we (as channel initiator) publish in the channel_announcement message." + ] + }, + "invoice": { + "type": "hex", + "description": [ + "Features in our BOLT11 invoices." + ] + } + } + }, + "blockheight": { + "type": "u32", + "description": [ + "The highest block height we've learned." + ] + }, + "network": { + "type": "string", + "description": [ + "Represents the type of network on the node are working (e.g: `bitcoin`, `testnet`, or `regtest`)." + ] + }, + "fees_collected_msat": { + "type": "msat", + "description": [ + "Total routing fees collected by this node." + ] + }, + "address": { + "type": "array", + "description": [ + "The addresses we announce to the world." + ], + "items": { + "type": "object", + "required": [ + "type", + "port" + ], + "additionalProperties": true, + "properties": { + "type": { + "type": "string", + "enum": [ + "dns", + "ipv4", + "ipv6", + "torv2", + "torv3" + ], + "description": [ + "Type of connection (until 23.08, `websocket` was also allowed)." + ] + }, + "port": { + "type": "u16", + "description": [ + "Port number." + ] + } + }, + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "dns", + "ipv4", + "ipv6", + "torv2", + "torv3" + ] + } + } + }, + "then": { + "required": [ + "type", + "address", + "port" + ], + "additionalProperties": false, + "properties": { + "type": {}, + "port": {}, + "address": { + "type": "string", + "description": [ + "Address in expected format for **type**." + ] + } + } + }, + "else": { + "required": [ + "type", + "port" + ], + "additionalProperties": false, + "properties": { + "type": {}, + "port": {} + } + } + } + }, + "binding": { + "type": "array", + "description": [ + "The addresses we are listening on." + ], + "items": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "local socket", + "websocket", + "ipv4", + "ipv6", + "torv2", + "torv3" + ], + "description": [ + "Type of connection." + ] + }, + "address": { + "type": "string", + "description": [ + "Address in expected format for **type**." + ] + }, + "port": { + "type": "u16", + "description": [ + "Port number." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "local socket" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "type", + "socket" + ], + "properties": { + "type": {}, + "socket": { + "type": "string", + "description": [ + "Socket filename." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [ + "type", + "address", + "port" + ], + "properties": { + "type": {}, + "address": {}, + "port": {}, + "subtype": {} + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "websocket" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "type", + "address", + "port", + "subtype" + ], + "properties": { + "type": {}, + "address": {}, + "port": {}, + "subtype": { + "type": "string", + "description": [ + "Type of address." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [ + "type" + ], + "properties": { + "type": {}, + "address": {}, + "port": {}, + "socket": {} + } + } + } + ] + } + }, + "warning_bitcoind_sync": { + "type": "string", + "description": [ + "Bitcoind is not up-to-date with network." + ] + }, + "warning_lightningd_sync": { + "type": "string", + "description": [ + "Lightningd is still loading latest blocks from bitcoind." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:getinfo#1", + "method": "getinfo", + "params": {} + } + ], + "example_json_response": [ + { + "id": "02bf811f7571754f0b51e6d41a8885f5561041a7b14fac093e4cffb95749de1a8d", + "alias": "SLICKERGOPHER", + "color": "02bf81", + "num_peers": 0, + "num_pending_channels": 0, + "num_active_channels": 0, + "num_inactive_channels": 0, + "address": [ + { + "type": "torv3", + "address": "fp463inc4w3lamhhduytrwdwq6q6uzugtaeapylqfc43agrdnnqsheyd.onion", + "port": 9736 + }, + { + "type": "torv3", + "address": "ifnntp5ak4homxrti2fp6ckyllaqcike447ilqfrgdw64ayrmkyashid.onion", + "port": 9736 + } + ], + "binding": [ + { + "type": "ipv4", + "address": "127.0.0.1", + "port": 9736 + } + ], + "version": "v0.10.2", + "blockheight": 724302, + "network": "bitcoin", + "msatoshi_fees_collected": 0, + "fees_collected_msat": "0msat", + "lightning-dir": "/media/vincent/Maxtor/C-lightning/node/bitcoin", + "our_features": { + "init": "8828226aa2", + "node": "80008828226aa2", + "channel": "", + "invoice": "20024200" + } + } + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters or some error happened during the command process." + ], + "author": [ + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." + ], + "see_also": [ + "lightning-connect(7)", + "lightning-fundchannel(7)", + "lightning-listconfigs(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-getlog.json b/doc/schemas/lightning-getlog.json new file mode 100644 index 000000000000..9d8d02166c83 --- /dev/null +++ b/doc/schemas/lightning-getlog.json @@ -0,0 +1,255 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "getlog", + "title": "Command to show logs.", + "description": [ + "The **getlog** the RPC command to show logs, with optional log *level*." + ], + "request": { + "required": [], + "properties": { + "level": { + "type": "string", + "enum": [ + "broken", + "unusual", + "info", + "debug", + "io" + ], + "description": [ + "A string that represents the log level." + ], + "default": "*info*" + } + } + }, + "response": { + "required": [ + "created_at", + "bytes_used", + "bytes_max", + "log" + ], + "properties": { + "created_at": { + "type": "string", + "description": [ + "UNIX timestamp with 9 decimal places, when logging was initialized." + ] + }, + "bytes_used": { + "type": "u32", + "description": [ + "The number of bytes used by logging records." + ] + }, + "bytes_max": { + "type": "u32", + "description": [ + "The bytes_used values at which records will be trimmed ." + ] + }, + "log": { + "type": "array", + "items": { + "type": "object", + "required": [ + "type" + ], + "additionalProperties": true, + "properties": { + "type": { + "type": "string", + "enum": [ + "SKIPPED", + "BROKEN", + "UNUSUAL", + "INFO", + "DEBUG", + "IO_IN", + "IO_OUT" + ] + } + }, + "allOf": [ + { + "if": { + "additionalProperties": true, + "properties": { + "type": { + "enum": [ + "SKIPPED" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "num_skipped" + ], + "properties": { + "type": {}, + "num_skipped": { + "type": "u32", + "description": [ + "Number of unprinted log entries (deleted or below *level* parameter)." + ] + } + } + } + }, + { + "if": { + "additionalProperties": true, + "properties": { + "type": { + "enum": [ + "BROKEN", + "UNUSUAL", + "INFO", + "DEBUG" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "time", + "source", + "log" + ], + "properties": { + "type": {}, + "time": { + "type": "string", + "description": [ + "UNIX timestamp with 9 decimal places after **created_at**." + ] + }, + "source": { + "type": "string", + "description": [ + "The particular logbook this was found in." + ] + }, + "log": { + "type": "string", + "description": [ + "The actual log message." + ] + }, + "node_id": { + "type": "pubkey", + "description": [ + "The peer this is associated with." + ] + } + } + } + }, + { + "if": { + "additionalProperties": true, + "properties": { + "type": { + "enum": [ + "IO_IN", + "IO_OUT" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "time", + "source", + "log", + "data" + ], + "properties": { + "type": {}, + "time": { + "type": "string", + "description": [ + "Seconds after **created_at**, with 9 decimal places." + ] + }, + "source": { + "type": "string", + "description": [ + "The particular logbook this was found in." + ] + }, + "log": { + "type": "string", + "description": [ + "The associated log message." + ] + }, + "node_id": { + "type": "pubkey", + "description": [ + "The peer this is associated with." + ] + }, + "data": { + "type": "hex", + "description": [ + "The IO which occurred." + ] + } + } + } + } + ] + } + } + } + }, + "example_json_request": [ + { + "id": "example:getlog#1", + "method": "getlog", + "params": { + "level": "debug" + } + } + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters." + ], + "example_json_response": [ + { + "created_at": "1598192543.820753463", + "bytes_used": 89285843, + "bytes_max": 104857600, + "log": [ + { + "type": "SKIPPED", + "num_skipped": 45 + }, + { + "type": "INFO", + "time": "0.453627568", + "source": "plugin-autopilot.py", + "log": "RPCmethod'autopilot-run-once'doesnothaveadocstring." + } + ] + } + ], + "author": [ + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-getroute.json b/doc/schemas/lightning-getroute.json new file mode 100644 index 000000000000..ea8d43907d67 --- /dev/null +++ b/doc/schemas/lightning-getroute.json @@ -0,0 +1,440 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "getroute", + "title": "Command for routing a payment (low-level)", + "description": [ + "The **getroute** RPC command attempts to find the best route for the payment of *amount_msat* to lightning node *id*, such that the payment will arrive at *id* with *cltv*.", + "", + "There are two considerations for how good a route is: how low the fees are, and how long your payment will get stuck in a delayed output if a node goes down during the process. ." + ], + "request": { + "required": [ + "id", + "amount_msat", + "riskfactor" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "Node pubkey to find the best route for the payment." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount to send. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. The 0 value is special: it ignores any *htlc_minimum_msat* setting on channels, and simply returns a possible route (if any) which is useful for simple probing." + ] + }, + "riskfactor": { + "type": "u64", + "description": [ + "A non-negative floating-point field controls this tradeoff; it is the annual cost of your funds being stuck (as a percentage). For example, if you thought the convenience of keeping your funds liquid (not stuck) was worth 20% per annum interest, *riskfactor* would be 20. If you didn't care about risk, *riskfactor* would be zero." + ] + }, + "cltv": { + "type": "u32", + "description": [ + "Cltv-blocks to spare." + ], + "default": "9" + }, + "fromid": { + "type": "pubkey", + "description": [ + "The node to start the route from." + ], + "default": "this node" + }, + "fuzzpercent": { + "type": "u32", + "description": [ + "Used to distort fees to provide some randomization to the route generated, but it was not properly implemented and is ignored." + ] + }, + "exclude": { + "type": "array", + "description": [ + "A JSON array of short-channel-id/direction (e.g. ['564334x877x1/0', '564195x1292x0/1' ]) or node-id which should be excluded from consideration for routing. Note if the source or destination is excluded, the command result is undefined." + ], + "default": "not to exclude any channels or nodes", + "items": { + "type": "string" + } + }, + "maxhops": { + "type": "u32", + "description": [ + "The maximum number of channels to return." + ], + "default": "20" + } + } + }, + "response": { + "required": [ + "route" + ], + "properties": { + "route": { + "type": "array", + "items": { + "type": "object", + "required": [ + "id", + "direction", + "channel", + "amount_msat", + "delay", + "style" + ], + "additionalProperties": false, + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The node at the end of this hop." + ] + }, + "channel": { + "type": "short_channel_id", + "description": [ + "The channel joining these nodes." + ] + }, + "direction": { + "type": "u32", + "description": [ + "0 if this channel is traversed from lesser to greater **id**, otherwise 1." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount expected by the node at the end of this hop." + ] + }, + "delay": { + "type": "u32", + "description": [ + "The total CLTV expected by the node at the end of this hop." + ] + }, + "style": { + "type": "string", + "description": [ + "The features understood by the destination node." + ], + "enum": [ + "tlv" + ] + } + } + } + } + }, + "post_return_value_notes": [ + "The final *id* will be the destination *id* given in the input. The difference between the first *amount_msat* minus the *amount_msat* given in the input is the fee (assuming the first hop is free). The first *delay* is the very worst case timeout for the payment failure, in blocks." + ] + }, + "riskfactor_effect_on_routing": [ + "The risk factor is treated as if it were an additional fee on the route, for the purposes of comparing routes.", + "", + "The formula used is the following approximation:", + "", + " risk-fee = amount x blocks-timeout x per-block-cost", + "", + "We are given a *riskfactor* expressed as a percentage. There are 52596 blocks per year, thus *per-block-cost* is *riskfactor* divided by 5,259,600.", + "", + "The final result is:", + "", + " risk-fee = amount x blocks-timeout x riskfactor / 5259600", + "", + "Here are the risk fees in millisatoshis, using various parameters. I assume a channel charges the default of 1000 millisatoshis plus 1 part-per-million. Common to_self_delay values on the network at 14 and 144 blocks.", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "
Amount (msat)RiskfactorDelayRisk FeeRoute fee

10,000

1

14

0

1001

10,000

10

14

0

1001

10,000

100

14

2

1001

10,000

1000

14

26

1001

1,000,000

1

14

2

1001

1,000,000

10

14

26

1001

1,000,000

100

14

266

1001

1,000,000

1000

14

2661

1001

100,000,000

1

14

266

1100

100,000,000

10

14

2661

1100

100,000,000

100

14

26617

1100

100,000,000

1000

14

266179

1100

10,000

1

144

0

1001

10,000

10

144

2

1001

10,000

100

144

27

1001

10,000

1000

144

273

1001

1,000,000

1

144

27

1001

1,000,000

10

144

273

1001

1,000,000

100

144

2737

1001

1,000,000

1000

144

27378

1001

100,000,000

1

144

2737

1100

100,000,000

10

144

27378

1100

100,000,000

100

144

273785

1100

100,000,000

1000

144

2737850

1100

" + ], + "recommended_riskfactor_values": [ + "The default *fuzz* factor is 5%, so as you can see from the table above, that tends to overwhelm the effect of *riskfactor* less than about 5.", + "", + "1 is a conservative value for a stable lightning network with very few failures.", + "", + "1000 is an aggressive value for trying to minimize timeouts at all costs.", + "", + "The default for lightning-pay(7) is 10, which starts to become a major factor for larger amounts, and is basically ignored for tiny ones." + ], + "example_json_request": [ + { + "id": "example:getroute#1", + "method": "getroute", + "params": { + "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "amount_msat": 50000000, + "riskfactor": 1, + "cltv": 9, + "fromid": null, + "fuzzpercent": null, + "exclude": null, + "maxhops": null + } + }, + { + "id": "example:getroute#2", + "method": "getroute", + "params": { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount_msat": "50000sat", + "riskfactor": 10 + } + } + ], + "example_json_response": [ + { + "route": [ + { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "channel": "103x3x0", + "direction": 1, + "amount_msat": 50001002, + "delay": 21, + "style": "tlv" + }, + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "channel": "103x1x0", + "direction": 1, + "amount_msat": 50000501, + "delay": 15, + "style": "tlv" + }, + { + "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "channel": "103x2x0", + "direction": 0, + "amount_msat": 50000000, + "delay": 9, + "style": "tlv" + } + ] + }, + { + "route": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "channel": "103x2x0", + "direction": 1, + "amount_msat": 50051000, + "delay": 15, + "style": "tlv" + }, + { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "channel": "103x1x0", + "direction": 0, + "amount_msat": 50000000, + "delay": 9, + "style": "tlv" + } + ] + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-pay(7)", + "lightning-sendpay(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-help.json b/doc/schemas/lightning-help.json new file mode 100644 index 000000000000..c33480de923b --- /dev/null +++ b/doc/schemas/lightning-help.json @@ -0,0 +1,130 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "help", + "title": "Command to return all information about RPC commands.", + "description": [ + "The **help** is a RPC command which is possible consult all information about the RPC commands, or a specific command if *command* is given.", + "", + "Note that the lightning-cli(1) tool will prefer to list a man page when a specific *command* is specified, and will only return the JSON if the man page is not found." + ], + "request": { + "required": [], + "properties": { + "command": { + "type": "string", + "description": [ + "Command to get information about." + ] + } + } + }, + "response": { + "required": [ + "help" + ], + "properties": { + "help": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "command", + "category", + "description", + "verbose" + ], + "properties": { + "command": { + "type": "string", + "description": [ + "The command." + ] + }, + "category": { + "type": "string", + "description": [ + "The category for this command (useful for grouping)." + ] + }, + "description": { + "type": "string", + "description": [ + "A one-line description of the purpose of this command." + ] + }, + "verbose": { + "type": "string", + "description": [ + "A full description of this command (including whether it's deprecated)." + ] + } + } + } + }, + "format-hint": { + "type": "string", + "enum": [ + "simple" + ], + "description": [ + "Prints the help in human-readable flat form." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:help#1", + "method": "help", + "params": { + "command": "pay" + } + }, + { + "id": "example:help#2", + "method": "help", + "params": { + "command": "dev" + } + } + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters." + ], + "example_json_response": [ + { + "help": [ + { + "command": "pay bolt11 [amount_msat] [label] [riskfactor] [maxfeepercent] [retry_for] [maxdelay] [exemptfee] [localinvreqid] [exclude] [maxfee] [description] [dev_use_shadow]", + "category": "plugin", + "description": "Send payment specified by {bolt11}", + "verbose": "Attempt to pay the {bolt11} invoice." + } + ], + "format-hint": "simple" + }, + { + "help": [ + { + "command": "dev subcommand=crash|rhash|slowcmd", + "category": "developer", + "description": "Developer command test multiplexer", + "verbose": "dev rhash {secret}\n\tShow SHA256 of {secret}\ndev crash\n\tCrash lightningd by calling fatal()\ndev slowcmd {msec}\n\tTorture test for slow commands, optional {msec}\n" + } + ], + "format-hint": "simple" + } + ], + "author": [ + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-invoice.json b/doc/schemas/lightning-invoice.json new file mode 100644 index 000000000000..d32b93e5d49f --- /dev/null +++ b/doc/schemas/lightning-invoice.json @@ -0,0 +1,254 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "invoice", + "title": "Command for accepting payments", + "description": [ + "The **invoice** RPC command creates the expectation of a payment of a given amount of milli-satoshi: it returns a unique token which another lightning daemon can use to pay this invoice. This token includes a *route hint* description of an incoming channel with capacity to pay the invoice, if any exists." + ], + "request": { + "required": [ + "amount_msat", + "label", + "description" + ], + "properties": { + "amount_msat": { + "type": "msat_or_any", + "description": [ + "The string `any`, which creates an invoice that can be paid with any amount. Otherwise it is a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*." + ] + }, + "label": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "description": [ + "A unique string or number (which is treated as a string, so `01` is different from `1`); it is never revealed to other nodes on the lightning network, but it can be used to query the status of this invoice." + ] + }, + "description": { + "type": "string", + "description": [ + "A short description of purpose of payment, e.g. *1 cup of coffee*. This value is encoded into the BOLT11 invoice and is viewable by any node you send this invoice to (unless *deschashonly* is true as described below). It must be UTF-8, and cannot use *\\u* JSON escape codes." + ] + }, + "expiry": { + "type": "u64", + "description": [ + "The time the invoice is valid for, in seconds. If no value is provided the default of 604800 (1 week) is used." + ] + }, + "fallbacks": { + "type": "array", + "description": [ + "One or more fallback addresses to include in the invoice (in order from most- preferred to least): note that these arrays are not currently tracked to fulfill the invoice." + ], + "items": { + "type": "string" + } + }, + "preimage": { + "type": "hex", + "description": [ + "A 64-digit hex string to be used as payment preimage for the created invoice. By default, if unspecified, lightningd will generate a secure pseudorandom preimage seeded from an appropriate entropy source on your system. **IMPORTANT**: if you specify the *preimage*, you are responsible, to ensure appropriate care for generating using a secure pseudorandom generator seeded with sufficient entropy, and keeping the preimage secret. This parameter is an advanced feature intended for use with cutting-edge cryptographic protocols and should not be used unless explicitly needed." + ] + }, + "exposeprivatechannels": { + "description": [ + "If specified, it overrides the default route hint logic, which will use unpublished channels only if there are no published channels." + ], + "oneOf": [ + { + "type": "boolean", + "description": [ + "If *True* unpublished channels are always considered as a route hint candidate; if *False*, never." + ] + }, + { + "type": "array", + "description": [ + "Array of short channel ids (or a remote alias), only those specific channels will be considered candidates, even if they are public or dead-ends." + ], + "items": { + "type": "short_channel_id" + } + }, + { + "type": "short_channel_id", + "description": [ + "If it is a short channel id (e.g. *1x1x3*), only this specific channel will be considered candidate, even if it is public or dead-end." + ] + } + ] + }, + "cltv": { + "type": "u32", + "description": [ + "If specified, sets the *min_final_cltv_expiry* for the invoice. Otherwise, it's set to the parameter **cltv-final**." + ] + }, + "deschashonly": { + "type": "boolean", + "description": [ + "If True, then the bolt11 returned contains a hash of the *description*, rather than the *description* itself: this allows much longer descriptions, but they must be communicated via some other mechanism." + ], + "default": "False" + } + } + }, + "response": { + "required": [ + "payment_hash", + "expires_at", + "created_index", + "bolt11", + "payment_secret" + ], + "properties": { + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "payment_secret": { + "type": "secret", + "description": [ + "The *payment_secret* to place in the onion." + ] + }, + "expires_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when invoice expires." + ] + }, + "created_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was created in." + ] + }, + "warning_capacity": { + "type": "string", + "description": [ + "Even using all possible channels, there's not enough incoming capacity to pay this invoice." + ] + }, + "warning_offline": { + "type": "string", + "description": [ + "There would be enough incoming capacity, but some channels are offline, so there isn't." + ] + }, + "warning_deadends": { + "type": "string", + "description": [ + "There would be enough incoming capacity, but some channels are dead-ends (no other public channels from those peers), so there isn't." + ] + }, + "warning_private_unused": { + "type": "string", + "description": [ + "There would be enough incoming capacity, but some channels are unannounced and *exposeprivatechannels* is *false*, so there isn't." + ] + }, + "warning_mpp": { + "type": "string", + "description": [ + "There is sufficient capacity, but not in a single channel, so the payer will have to use multi-part payments." + ] + } + } + }, + "errors": [ + "On failure, an error is returned and no invoice is created. If the", + "lightning process fails before responding, the caller should use", + "lightning-listinvoices(7) to query whether this invoice was created or", + "not.", + "", + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error.", + "- 900: An invoice with the given *label* already exists.", + "- 901: An invoice with the given *preimage* already exists.", + "- 902: None of the specified *exposeprivatechannels* were usable." + ], + "example_json_request": [ + { + "id": "example:invoice#1", + "method": "invoice", + "params": { + "amount_msat": 11000000, + "label": "xEoCR94SIz6UIRUEkxum", + "description": [ + "XEoCR94SIz6UIRUEkxum." + ], + "expiry": null, + "fallbacks": null, + "preimage": null, + "exposeprivatechannels": null, + "cltv": null, + "deschashonly": null + } + }, + { + "id": "example:invoice#2", + "method": "invoice", + "params": { + "amount_msat": 100, + "label": "8", + "description": "inv", + "expiry": null, + "fallbacks": null, + "preimage": null, + "exposeprivatechannels": null, + "cltv": null, + "deschashonly": null + } + } + ], + "example_json_response": [ + { + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "expires_at": 1706757730, + "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk", + "payment_secret": "82644944d3f70d42aad1d5f7b5d7a629e7afa30b529cc952a4c59fc0e3790ea2", + "created_index": 1, + "warning_deadends": "Insufficient incoming capacity, once dead-end peers were excluded" + }, + { + "payment_hash": "f59ae0204dfe8e913207ea36646255b9d2c7c8229e8693d30547fc622eddb6b4", + "expires_at": 1709229182, + "bolt11": "lnbcrt1n1pja0z07sp5n8fk890nrq7zlcue0lgu7cduaaz765u5rg0kcud4amphuppu8wxspp57kdwqgzdl68fzvs8agmxgcj4h8fv0jpzn6rf85c9gl7xytkak66qdq9d9h8vxqyjw5qcqp99qxpqysgqrneaxh0plvjft457yv3q92rak57a6xw33m6phr0mrsy69sudzgez3adkzdsgwzy32z5usjpxm4rjgcg70h047wf0pgc4l9gyaj2h9ssqcrtv32", + "payment_secret": "99d36395f3183c2fe3997fd1cf61bcef45ed53941a1f6c71b5eec37e043c3b8d", + "created_index": 9, + "warning_capacity": "Insufficient incoming channel capacity to pay invoice" + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listinvoices(7)", + "lightning-delinvoice(7)", + "lightning-pay(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-invoicerequest.json b/doc/schemas/lightning-invoicerequest.json new file mode 100644 index 000000000000..6c56511c5baf --- /dev/null +++ b/doc/schemas/lightning-invoicerequest.json @@ -0,0 +1,145 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v22.11", + "rpc": "invoicerequest", + "title": "Command for offering payments", + "warning": "experimental-offers only", + "description": [ + "The **invoicerequest** RPC command creates an `invoice_request` to send payments: it automatically enables the processing of an incoming invoice, and payment of it. The reader of the resulting `invoice_request` can use lightning-sendinvoice(7) to collect their payment." + ], + "request": { + "required": [ + "amount", + "description" + ], + "properties": { + "amount": { + "type": "msat", + "description": [ + "A positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*." + ] + }, + "description": { + "type": "string", + "description": [ + "A short description of purpose of the payment, e.g. *ATM withdrawl*. This value is encoded into the resulting `invoice_request` and is viewable by anyone you expose it to. It must be UTF-8, and cannot use *\\u* JSON escape codes." + ] + }, + "issuer": { + "type": "string", + "description": [ + "Who is issuing it (i.e. you) if appropriate." + ] + }, + "label": { + "type": "string", + "description": [ + "An internal-use name for the offer, which can be any UTF-8 string." + ] + }, + "absolute_expiry": { + "type": "u64", + "description": [ + "The time the offer is valid until, in seconds since the first day of 1970 UTC. If not set, the `invoice_request` remains valid (though it can be deactivated by the issuer of course). This is encoded in the `invoice_request`." + ] + }, + "single_use": { + "type": "boolean", + "description": [ + "Indicates that the `invoice_request` is only valid once; we may attempt multiple payments, but as soon as one is successful no more invoices are accepted (i.e. only one person can take the money)." + ], + "default": "True" + } + } + }, + "response": { + "required": [ + "invreq_id", + "single_use", + "active", + "bolt12", + "used" + ], + "properties": { + "invreq_id": { + "type": "hash", + "description": [ + "The SHA256 hash of all invoice_request fields less than 160." + ] + }, + "active": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Whether the invoice_request is currently active." + ] + }, + "single_use": { + "type": "boolean", + "description": [ + "Whether the invoice_request will become inactive after we pay an invoice for it." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string starting with lnr." + ] + }, + "used": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "Whether the invoice_request has already been used." + ] + }, + "label": { + "type": "string", + "description": [ + "The label provided when creating the invoice_request." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:invoicerequest#1", + "method": "invoicerequest", + "params": { + "amount": "10000sat", + "description": "simple test", + "issuer": "clightning test suite" + } + } + ], + "example_json_response": [ + { + "invreq_id": "715484ead84bcdae5b33e3015c686fa1bdd4ae9ade3c4729b58257a98cfcd9b5", + "active": true, + "single_use": true, + "bolt12": "lnr1qqgteyhfyp40c79a5y3gfe33nxfs6zstwd5k6urvv5s8getnwsfp2cmvd9nksarwd9hxwgr5v4ehggrnw45hge2syqrzymjxzydqkkw24ufxqslttwlj3s608f0rx2slc7etw0833zgs75srnztgqkppqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq633uzq99smfawuu6pz0zh9jl6dl8v25u3kzes975x2j9tr0qp0ux0tlzcxjrgehxh9luz5vwjpk92tys9f9zlm038krcz4uqfxgelwf43tgfc", + "used": false + } + ], + "errors": [ + "On failure, an error is returned and no `invoice_request` is created. If the lightning process fails before responding, the caller should use lightning-listinvoicerequests(7) to query whether it was created or not.", + "", + "- -1: Catchall nonspecific error." + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listinvoicerequests(7)", + "lightning-disableinvoicerequest(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-keysend.json b/doc/schemas/lightning-keysend.json new file mode 100644 index 000000000000..06f7f1ef4274 --- /dev/null +++ b/doc/schemas/lightning-keysend.json @@ -0,0 +1,319 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "keysend", + "title": "Send funds to a node without an invoice", + "description": [ + "The **keysend** RPC command attempts to find a route to the given destination, and send the specified amount to it. Unlike the `pay` RPC command the `keysend` command does not require an invoice, instead it uses the `destination` node ID, and `amount` to find a route to the specified node.", + "", + "In order for the destination to be able to claim the payment, the `payment_key` is randomly generated by the sender and included in the encrypted payload for the destination. As a consequence there is not proof-of-payment, like there is with an invoice where the `payment_key` is generated on the destination, and the only way sender could have it is by sending a payment. Please ensure that this matches your use-case when using `keysend`.", + "", + "When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name." + ], + "request": { + "required": [ + "destination", + "amount_msat" + ], + "properties": { + "destination": { + "type": "pubkey", + "description": [ + "The 33 byte, hex-encoded, node ID of the node that the payment should go to." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "A whole number, or a whole number with suffix `msat` or `sat`, or a three decimal point number with suffix `sat`, or an 1 to 11 decimal point number suffixed by `btc`." + ] + }, + "label": { + "type": "string", + "description": [ + "Used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7)." + ] + }, + "maxfeepercent": { + "type": "number", + "description": [ + "Limits the money paid in fees as percentage of the total amount that is to be transferred." + ], + "default": "0.5" + }, + "retry_for": { + "type": "u32", + "description": [ + "Until *retry_for* seconds passes, the command will keep finding routes and retrying the payment. However, a payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case." + ], + "default": "60 seconds" + }, + "maxdelay": { + "type": "u32", + "description": [ + "Number of blocks the payment may be delayed." + ] + }, + "exemptfee": { + "type": "msat", + "description": [ + "Used for tiny payments which would be dominated by the fee leveraged by forwarding nodes. Setting `exemptfee` allows the `maxfeepercent` check to be skipped on fees that are smaller than *exemptfee*." + ], + "default": "5000 millisatoshi" + }, + "routehints": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "id", + "scid", + "feebase", + "feeprop", + "expirydelta" + ], + "properties": { + "id": { + "type": "pubkey" + }, + "scid": { + "type": "short_channel_id" + }, + "feebase": { + "type": "msat" + }, + "feeprop": { + "type": "u32" + }, + "expirydelta": { + "type": "u16" + } + } + } + } + }, + "extratlvs": { + "type": "object", + "additionalProperties": true, + "required": [], + "description": [ + "Dictionary of additional fields to insert into the final tlv. The format is 'fieldnumber': 'hexstring'." + ] + } + } + }, + "response": { + "required": [ + "payment_preimage", + "payment_hash", + "created_at", + "parts", + "amount_msat", + "amount_sent_msat", + "status" + ], + "properties": { + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash**." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "created_at": { + "type": "number", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "parts": { + "type": "u32", + "description": [ + "How many attempts this took." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount the recipient received." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "Total amount we sent (including fees)." + ] + }, + "warning_partial_completion": { + "type": "string", + "description": [ + "Not all parts of a multi-part payment have completed." + ] + }, + "status": { + "type": "string", + "enum": [ + "complete" + ], + "description": [ + "Status of payment." + ] + } + }, + "post_return_value_notes": [ + "You can monitor the progress and retries of a payment using the lightning-paystatus(7) command." + ] + }, + "randomization": [ + "To protect user privacy, the payment algorithm performs some randomization.", + "", + "1: Route Randomization", + "", + "Route randomization means the payment algorithm does not always use the lowest-fee or shortest route. This prevents some highly-connected node from learning all of the user payments by reducing their fees below the network average.", + "", + "2: Shadow Route", + "", + "Shadow route means the payment algorithm will virtually extend the route by adding delays and fees along it, making it appear to intermediate nodes that the route is longer than it actually is. This prevents intermediate nodes from reliably guessing their distance from the payee.", + "", + "Route randomization will never exceed *maxfeepercent* of the payment. Route randomization and shadow routing will not take routes that would exceed *maxdelay*." + ], + "errors": [ + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error.", + "- 203: Permanent failure at destination. The *data* field of the error will be routing failure object.", + "- 205: Unable to find a route.", + "- 206: Route too expensive. Either the fee or the needed total locktime for the route exceeds your *maxfeepercent* or *maxdelay* settings, respectively. The *data* field of the error will indicate the actual *fee* as well as the *feepercent* percentage that the fee has of the destination payment amount. It will also indicate the actual *delay* along the route.", + "- 210: Payment timed out without a payment in progress.", + "", + "A routing failure object has the fields below:", + "", + "*erring_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on.", + "*erring_node*: The hex string of the pubkey id of the node that reported the error.", + "*erring_channel*: The short channel ID of the channel that has the error, or *0:0:0* if the destination node raised the error.", + "*failcode*: The failure code, as per BOLT #4.", + "*channel_update*: The hex string of the *channel_update* message received from the remote node. Only present if error is from the remote node and the *failcode* has the `UPDATE` bit set, as per BOLT #4." + ], + "example_json_request": [ + { + "id": "example:keysend#1", + "method": "keysend", + "params": { + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount_msat": 10000, + "label": null, + "maxfeepercent": null, + "retry_for": null, + "maxdelay": null, + "exemptfee": null, + "extratlvs": null + } + }, + { + "id": "example:keysend#2", + "method": "keysend", + "params": { + "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "amount_msat": 10000000, + "label": null, + "maxfeepercent": null, + "retry_for": null, + "maxdelay": null, + "exemptfee": null, + "extratlvs": { + "133773310": "68656c6c6f776f726c64", + "133773312": "66696c7465726d65" + } + } + }, + { + "id": "example:keysend#3", + "method": "keysend", + "params": { + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount_msat": 10000, + "routehints": [ + [ + { + "scid": "4615051x2233541x57738", + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "feebase": 1, + "feeprop": 10, + "expirydelta": 9 + } + ], + [ + { + "scid": "1x2x3", + "id": "020202020202020202020202020202020202020202020202020202020202020202", + "feebase": 1, + "feeprop": 1, + "expirydelta": 9 + } + ] + ] + } + } + ], + "example_json_response": [ + { + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "payment_hash": "b6f88603008a9f7dd84b1b94c7b972c8efbaf0b86c8d3c04512955992da9028e", + "created_at": 1706315742.6861734, + "parts": 1, + "amount_msat": 10000, + "amount_sent_msat": 10001, + "payment_preimage": "7178cf708e34dce816fc35aa692a65e1f85b92ae03bbc8ae6543302511823174", + "status": "complete" + }, + { + "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "payment_hash": "e8474eea8d5673e8407ef5f4924e58479b51a68afd136384683d5d6a97c9520d", + "created_at": 1708640424.1810749, + "parts": 1, + "amount_msat": 10000000, + "amount_sent_msat": 10000000, + "payment_preimage": "40e47272ea7da20c57a2381d81a5513ec03bd8ead9d51fbd2a91ec76d3f4bcbf", + "status": "complete" + }, + { + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "payment_hash": "56e12e6f45120bef7385c9bf307319eaa6a1b9160cdb3e62a3f492abf5bfa4bc", + "created_at": 1708640437.2895157, + "parts": 1, + "amount_msat": 10000, + "amount_sent_msat": 10001, + "payment_preimage": "682870b8f96e2aed1c86694dbb2c3e64cd396b9bba9fafd824d90eb0bd371b85", + "status": "complete" + } + ], + "author": [ + "Christian Decker <> is mainly responsible." + ], + "see_also": [ + "lightning-listpays(7)", + "lightning-decodepay(7)", + "lightning-listinvoice(7)", + "lightning-delinvoice(7)", + "lightning-getroute(7)", + "lightning-invoice(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-listchannels.json b/doc/schemas/lightning-listchannels.json new file mode 100644 index 000000000000..cce3488ec0ab --- /dev/null +++ b/doc/schemas/lightning-listchannels.json @@ -0,0 +1,249 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listchannels", + "title": "Command to query active lightning channels in the entire network", + "description": [ + "The **listchannels** RPC command returns data on channels that are known to the node. Because channels may be bidirectional, up to 2 objects will be returned for each channel (one for each direction).", + "", + "Only one of *short_channel_id*, *source* or *destination* can be supplied. If nothing is supplied, data on all lightning channels known to this node, are returned. These can be local channels or public channels broadcast on the gossip network." + ], + "request": { + "required": [], + "properties": { + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "If short_channel_id is a short channel id, then only known channels with a matching short_channel_id are returned. Otherwise, it must be null." + ] + }, + "source": { + "type": "pubkey", + "description": [ + "If source is a node id, then only channels leading from that node id are returned." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "If destination is a node id, then only channels leading to that node id are returned." + ] + } + } + }, + "response": { + "required": [ + "channels" + ], + "properties": { + "channels": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "source", + "destination", + "short_channel_id", + "direction", + "public", + "amount_msat", + "message_flags", + "channel_flags", + "active", + "last_update", + "base_fee_millisatoshi", + "fee_per_millionth", + "delay", + "htlc_minimum_msat", + "features" + ], + "properties": { + "source": { + "type": "pubkey", + "description": [ + "The source node." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The destination node." + ] + }, + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "Short channel id of channel." + ] + }, + "direction": { + "type": "u32", + "description": [ + "Direction (0 if source < destination, 1 otherwise)." + ] + }, + "public": { + "type": "boolean", + "description": [ + "True if this is announced (from *v24.02*, being false is deprecated)." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The total capacity of this channel (always a whole number of satoshis)." + ] + }, + "message_flags": { + "type": "u8", + "description": [ + "As defined by BOLT #7." + ] + }, + "channel_flags": { + "type": "u8", + "description": [ + "As defined by BOLT #7." + ] + }, + "active": { + "type": "boolean", + "description": [ + "True unless source has disabled it (or (deprecated in *v24.02*) it's a local channel and the peer is disconnected or it's still opening or closing)." + ] + }, + "last_update": { + "type": "u32", + "description": [ + "UNIX timestamp on the last channel_update from *source*." + ] + }, + "base_fee_millisatoshi": { + "type": "u32", + "description": [ + "Base fee changed by *source* to use this channel." + ] + }, + "fee_per_millionth": { + "type": "u32", + "description": [ + "Proportional fee changed by *source* to use this channel, in parts-per-million." + ] + }, + "delay": { + "type": "u32", + "description": [ + "The number of blocks delay required by *source* to use this channel." + ] + }, + "htlc_minimum_msat": { + "type": "msat", + "description": [ + "The smallest payment *source* will allow via this channel." + ] + }, + "htlc_maximum_msat": { + "type": "msat", + "description": [ + "The largest payment *source* will allow via this channel." + ] + }, + "features": { + "type": "hex", + "description": [ + "BOLT #9 features bitmap for this channel." + ] + } + } + } + } + }, + "post_return_value_notes": [ + "If one of *short_channel_id*, *source* or *destination* is supplied and no matching channels are found, a 'channels' object with an empty list is returned." + ] + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong." + ], + "example_json_request": [ + { + "id": "example:listchannels#1", + "method": "listchannels", + "params": { + "short_channel_id": "103x1x0", + "source": null, + "destination": null + } + }, + { + "id": "example:listchannels#2", + "method": "listchannels", + "params": { + "short_channel_id": null, + "source": null, + "destination": null + } + } + ], + "example_json_response": [ + { + "channels": [] + }, + { + "channels": [ + { + "source": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "short_channel_id": "103x1x0", + "direction": 0, + "public": true, + "amount_msat": 1000000000, + "message_flags": 1, + "channel_flags": 0, + "active": true, + "last_update": 1706153393, + "base_fee_millisatoshi": 1, + "fee_per_millionth": 10, + "delay": 6, + "htlc_minimum_msat": 0, + "htlc_maximum_msat": 990000000, + "features": "" + }, + { + "source": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "short_channel_id": "103x1x0", + "direction": 1, + "public": true, + "amount_msat": 1000000000, + "message_flags": 1, + "channel_flags": 1, + "active": true, + "last_update": 1706153393, + "base_fee_millisatoshi": 1, + "fee_per_millionth": 10, + "delay": 6, + "htlc_minimum_msat": 0, + "htlc_maximum_msat": 990000000, + "features": "" + } + ] + } + ], + "author": [ + "Michael Hawkins <>." + ], + "see_also": [ + "lightning-fundchannel(7)", + "lightning-listnodes(7)" + ], + "resources": [ + "Main web site: ", + "", + "BOLT #7: " + ] +} diff --git a/doc/schemas/lightning-listclosedchannels.json b/doc/schemas/lightning-listclosedchannels.json new file mode 100644 index 000000000000..71d8e16920bd --- /dev/null +++ b/doc/schemas/lightning-listclosedchannels.json @@ -0,0 +1,285 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.05", + "rpc": "listclosedchannels", + "title": "Get data on our closed historical channels", + "description": [ + "The **listclosedchannels** RPC command returns data on channels which are otherwise forgotten (more than 100 blocks after they're completely resolved onchain)." + ], + "request": { + "required": [], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "If no *id* is supplied, then channel data on all historical channels are given. Supplying *id* will filter the results to only match channels to that peer. Note that prior to v23.05, old peers were forgotten." + ] + } + } + }, + "response": { + "required": [ + "closedchannels" + ], + "properties": { + "closedchannels": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "channel_id", + "opener", + "private", + "total_msat", + "total_local_commitments", + "total_remote_commitments", + "total_htlcs_sent", + "funding_txid", + "funding_outnum", + "leased", + "final_to_us_msat", + "min_to_us_msat", + "max_to_us_msat", + "close_cause" + ], + "properties": { + "peer_id": { + "type": "pubkey", + "description": [ + "Peer public key (can be missing with pre-v23.05 closes!)." + ] + }, + "channel_id": { + "type": "hash", + "description": [ + "The full channel_id (funding txid Xored with output number)." + ] + }, + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "The short_channel_id." + ] + }, + "alias": { + "type": "object", + "required": [], + "properties": { + "local": { + "type": "short_channel_id", + "description": [ + "An alias assigned by this node to this channel, used for outgoing payments." + ] + }, + "remote": { + "type": "short_channel_id", + "description": [ + "An alias assigned by the remote node to this channel, usable in routehints and invoices." + ] + } + } + }, + "opener": { + "type": "string", + "enum": [ + "local", + "remote" + ], + "description": [ + "Who initiated the channel." + ] + }, + "closer": { + "type": "string", + "enum": [ + "local", + "remote" + ], + "description": [ + "Who initiated the channel close (only present if closing)." + ] + }, + "private": { + "type": "boolean", + "description": [ + "If True, we will not announce this channel." + ] + }, + "channel_type": { + "type": "object", + "description": [ + "Channel_type as negotiated with peer." + ], + "additionalProperties": false, + "required": [ + "bits", + "names" + ], + "properties": { + "bits": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + }, + "names": { + "type": "array", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "items": { + "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" + ], + "description": [ + "Name of feature bit." + ] + } + } + } + }, + "total_local_commitments": { + "type": "u64", + "description": [ + "Number of commitment transaction we made." + ] + }, + "total_remote_commitments": { + "type": "u64", + "description": [ + "Number of commitment transaction they made." + ] + }, + "total_htlcs_sent": { + "type": "u64", + "description": [ + "Number of HTLCs we ever sent." + ] + }, + "funding_txid": { + "type": "txid", + "description": [ + "ID of the funding transaction." + ] + }, + "funding_outnum": { + "type": "u32", + "description": [ + "The 0-based output number of the funding transaction which opens the channel." + ] + }, + "leased": { + "type": "boolean", + "description": [ + "Whether this channel was leased from `opener`." + ] + }, + "funding_fee_paid_msat": { + "type": "msat", + "description": [ + "How much we paid to lease the channel (iff `leased` is true and `opener` is local)." + ] + }, + "funding_fee_rcvd_msat": { + "type": "msat", + "description": [ + "How much they paid to lease the channel (iff `leased` is true and `opener` is remote)." + ] + }, + "funding_pushed_msat": { + "type": "msat", + "description": [ + "How much `opener` pushed immediate (if non-zero)." + ] + }, + "total_msat": { + "type": "msat", + "description": [ + "Total amount in the channel." + ] + }, + "final_to_us_msat": { + "type": "msat", + "description": [ + "Our balance in final commitment transaction." + ] + }, + "min_to_us_msat": { + "type": "msat", + "description": [ + "Least amount owed to us ever. If the peer were to successfully steal from us, this is the amount we would still retain." + ] + }, + "max_to_us_msat": { + "type": "msat", + "description": [ + "Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get." + ] + }, + "last_commitment_txid": { + "type": "hash", + "description": [ + "The final commitment tx's txid (or mutual close, if we accepted it). Not present for some very old, small channels pre-0.7.0." + ] + }, + "last_commitment_fee_msat": { + "type": "msat", + "description": [ + "The fee on `last_commitment_txid`." + ] + }, + "close_cause": { + "type": "string", + "enum": [ + "unknown", + "local", + "user", + "remote", + "protocol", + "onchain" + ], + "description": [ + "What caused the channel to close." + ] + }, + "last_stable_connection": { + "type": "u64", + "added": "v24.02", + "description": [ + "Last time we reestablished the open channel and stayed connected for 1 minute." + ] + } + } + } + } + } + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong." + ], + "author": [ + "Rusty Russell <>." + ], + "see_also": [ + "lightning-listpeerchannels(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-listconfigs.json b/doc/schemas/lightning-listconfigs.json new file mode 100644 index 000000000000..c541788bb9cb --- /dev/null +++ b/doc/schemas/lightning-listconfigs.json @@ -0,0 +1,2938 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listconfigs", + "title": "Command to list all configuration options.", + "description": [ + "The **listconfigs** RPC command to list all configuration options, or with *config* only one." + ], + "request": { + "required": [], + "properties": { + "config": { + "type": "string", + "description": [ + "Configuration option name to restrict return." + ] + } + } + }, + "response": { + "required": [], + "properties": { + "configs": { + "added": "v23.08", + "type": "object", + "comment": "Plugins can add fields to this, so we can't rule out additional properties :(", + "additionalProperties": true, + "required": [], + "properties": { + "conf": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from cmdline." + ] + }, + "source": { + "type": "string", + "enum": [ + "cmdline" + ], + "description": [ + "Source of configuration setting." + ] + } + } + }, + "developer": { + "type": "object", + "added": "v23.08", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "clear-plugins": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "disable-mpp": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + }, + "plugin": { + "type": "string", + "description": [ + "Plugin which registered this configuration setting." + ] + } + } + }, + "mainnet": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "regtest": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "signet": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "testnet": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "important-plugin": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] + } + }, + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + } + }, + "plugin": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] + } + }, + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + } + }, + "plugin-dir": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] + } + }, + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + } + }, + "lightning-dir": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "network": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default (can also be changed by `testnet`, `signet`, `regtest` options!)." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "allow-deprecated-apis": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_bool", + "source" + ], + "properties": { + "value_bool": { + "type": "boolean", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "rpc-file": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "disable-plugin": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] + } + }, + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + } + }, + "always-use-proxy": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_bool", + "source" + ], + "properties": { + "value_bool": { + "type": "boolean", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "daemon": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "wallet": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "large-channels": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "experimental-dual-fund": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "experimental-splicing": { + "added": "v23.08", + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "experimental-onion-messages": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "experimental-offers": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "experimental-shutdown-wrong-funding": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "experimental-websocket-port": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "experimental-peer-storage": { + "added": "v23.02", + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "experimental-anchors": { + "type": "object", + "added": "v23.08", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "database-upgrade": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_bool", + "source" + ], + "properties": { + "value_bool": { + "type": "boolean", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "rgb": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "hex", + "description": [ + "Field from config or cmdline, or default." + ], + "maxLength": 6, + "minLength": 6 + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "alias": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "pid-file": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "ignore-fee-limits": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_bool", + "source" + ], + "properties": { + "value_bool": { + "type": "boolean", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "watchtime-blocks": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "max-locktime-blocks": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "funding-confirms": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "cltv-delta": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "cltv-final": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "commit-time": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "fee-base": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "rescan": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "integer", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "fee-per-satoshi": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "max-concurrent-htlcs": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "htlc-minimum-msat": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_msat", + "source" + ], + "properties": { + "value_msat": { + "type": "msat", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "htlc-maximum-msat": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_msat", + "source" + ], + "properties": { + "value_msat": { + "type": "msat", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "max-dust-htlc-exposure-msat": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_msat", + "source" + ], + "properties": { + "value_msat": { + "type": "msat", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "min-capacity-sat": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u64", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + }, + "dynamic": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Can this be set by setconfig()." + ] + } + } + }, + "addr": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] + } + }, + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + } + }, + "announce-addr": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] + } + }, + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + } + }, + "bind-addr": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] + } + }, + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + } + }, + "offline": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "autolisten": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_bool", + "source" + ], + "properties": { + "value_bool": { + "type": "boolean", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "proxy": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "disable-dns": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "announce-addr-discovered": { + "added": "v23.02", + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "enum": [ + "true", + "false", + "auto" + ], + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "announce-addr-discovered-port": { + "added": "v23.02", + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "encrypted-hsm": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "rpc-file-mode": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "log-level": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "log-prefix": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "log-file": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] + } + }, + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + } + }, + "log-timestamps": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_bool", + "source" + ], + "properties": { + "value_bool": { + "type": "boolean", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "force-feerates": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "subdaemon": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] + } + }, + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + } + }, + "fetchinvoice-noconnect": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "accept-htlc-tlv-types": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "tor-service-password": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "announce-addr-dns": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_bool", + "source" + ], + "properties": { + "value_bool": { + "type": "boolean", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "require-confirmed-inputs": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_bool", + "source" + ], + "properties": { + "value_bool": { + "type": "boolean", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "commit-fee": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u64", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "commit-feerate-offset": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + } + } + }, + "# version": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "Special field indicating the current version." + ] + }, + "plugins": { + "type": "array", + "deprecated": [ + "v23.08", + "v24.02" + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "path", + "name" + ], + "description": [ + "`plugin` field from config or cmdline." + ], + "properties": { + "path": { + "type": "string", + "description": [ + "Full path of the plugin." + ] + }, + "name": { + "type": "string", + "description": [ + "Short name of the plugin." + ] + }, + "options": { + "type": "object", + "additionalProperties": true, + "required": [], + "description": [ + "Specific options set for this plugin." + ], + "properties": {} + } + } + } + }, + "important-plugins": { + "type": "array", + "deprecated": [ + "v23.08", + "v24.02" + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "path", + "name" + ], + "description": [ + "`important-plugin` field from config or cmdline, or built-in." + ], + "properties": { + "path": { + "type": "string", + "description": [ + "Full path of the plugin." + ] + }, + "name": { + "type": "string", + "description": [ + "Short name of the plugin." + ] + }, + "options": { + "type": "object", + "additionalProperties": true, + "required": [], + "description": [ + "Specific options set for this plugin." + ], + "properties": {} + } + } + } + }, + "conf": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`conf` field from cmdline, or default." + ] + }, + "lightning-dir": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`lightning-dir` field from config or cmdline, or default." + ] + }, + "network": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`network` field from config or cmdline, or default." + ] + }, + "allow-deprecated-apis": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`allow-deprecated-apis` field from config or cmdline, or default." + ] + }, + "rpc-file": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`rpc-file` field from config or cmdline, or default." + ] + }, + "disable-plugin": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "array", + "items": { + "type": "string", + "description": [ + "`disable-plugin` field from config or cmdline." + ] + } + }, + "bookkeeper-dir": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`bookkeeper-dir` field from config or cmdline, or default." + ] + }, + "bookkeeper-db": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`bookkeeper-db` field from config or cmdline, or default." + ] + }, + "always-use-proxy": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`always-use-proxy` field from config or cmdline, or default." + ] + }, + "daemon": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`daemon` field from config or cmdline, or default." + ] + }, + "wallet": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`wallet` field from config or cmdline default." + ] + }, + "large-channels": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`large-channels` field from config or cmdline, or default." + ] + }, + "experimental-dual-fund": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`experimental-dual-fund` field from config or cmdline, or default." + ] + }, + "experimental-splicing": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`experimental-splicing` field from config or cmdline, or default." + ] + }, + "experimental-onion-messages": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`experimental-onion-messages` field from config or cmdline, or default." + ] + }, + "experimental-offers": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`experimental-offers` field from config or cmdline, or default." + ] + }, + "experimental-shutdown-wrong-funding": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`experimental-shutdown-wrong-funding` field from config or cmdline, or default." + ] + }, + "experimental-websocket-port": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u16", + "description": [ + "`experimental-websocket-port` field from config or cmdline, or default." + ] + }, + "experimental-peer-storage": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "added": "v23.02", + "description": [ + "`experimental-peer-storage` field from config or cmdline, or default." + ] + }, + "experimental-quiesce": { + "type": "boolean", + "added": "v23.08", + "deprecated": [ + "v23.08", + "v24.02" + ], + "description": [ + "`experimental-quiesce` field from config or cmdline, or default." + ] + }, + "experimental-upgrade-protocol": { + "type": "boolean", + "added": "v23.08", + "deprecated": [ + "v23.08", + "v24.02" + ], + "description": [ + "`experimental-upgrade-protocol` field from config or cmdline, or default." + ] + }, + "invoices-onchain-fallback": { + "type": "boolean", + "added": "v23.11", + "description": [ + "`invoices-onchain-fallback` field from config or cmdline, or default." + ] + }, + "database-upgrade": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`database-upgrade` field from config or cmdline." + ] + }, + "rgb": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "hex", + "description": [ + "`rgb` field from config or cmdline, or default." + ], + "maxLength": 6, + "minLength": 6 + }, + "alias": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`alias` field from config or cmdline, or default." + ] + }, + "pid-file": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`pid-file` field from config or cmdline, or default." + ] + }, + "ignore-fee-limits": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`ignore-fee-limits` field from config or cmdline, or default." + ] + }, + "watchtime-blocks": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", + "description": [ + "`watchtime-blocks` field from config or cmdline, or default." + ] + }, + "max-locktime-blocks": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", + "description": [ + "`max-locktime-blocks` field from config or cmdline, or default." + ] + }, + "funding-confirms": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", + "description": [ + "`funding-confirms` field from config or cmdline, or default." + ] + }, + "cltv-delta": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", + "description": [ + "`cltv-delta` field from config or cmdline, or default." + ] + }, + "cltv-final": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", + "description": [ + "`cltv-final` field from config or cmdline, or default." + ] + }, + "commit-time": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", + "description": [ + "`commit-time` field from config or cmdline, or default." + ] + }, + "fee-base": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", + "description": [ + "`fee-base` field from config or cmdline, or default." + ] + }, + "rescan": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "integer", + "description": [ + "`rescan` field from config or cmdline, or default." + ] + }, + "fee-per-satoshi": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", + "description": [ + "`fee-per-satoshi` field from config or cmdline, or default." + ] + }, + "max-concurrent-htlcs": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", + "description": [ + "`max-concurrent-htlcs` field from config or cmdline, or default." + ] + }, + "htlc-minimum-msat": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "msat", + "description": [ + "`htlc-minimum-msat` field from config or cmdline, or default." + ] + }, + "htlc-maximum-msat": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "msat", + "description": [ + "`htlc-maximum-msat` field from config or cmdline, or default." + ] + }, + "max-dust-htlc-exposure-msat": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "msat", + "description": [ + "`max-dust-htlc-exposure-mast` field from config or cmdline, or default." + ] + }, + "min-capacity-sat": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u64", + "description": [ + "`min-capacity-sat` field from config or cmdline, or default." + ] + }, + "addr": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`addr` field from config or cmdline (can be more than one)." + ] + }, + "announce-addr": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`announce-addr` field from config or cmdline (can be more than one)." + ] + }, + "bind-addr": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`bind-addr` field from config or cmdline (can be more than one)." + ] + }, + "offline": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`true` if `offline` was set in config or cmdline." + ] + }, + "autolisten": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`autolisten` field from config or cmdline, or default." + ] + }, + "proxy": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`proxy` field from config or cmdline, or default." + ] + }, + "disable-dns": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`true` if `disable-dns` was set in config or cmdline." + ] + }, + "announce-addr-discovered": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`true`/`false`/`auto` depending on how `announce-addr-discovered` was set in config or cmdline." + ], + "added": "v23.02" + }, + "announce-addr-discovered-port": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "integer", + "description": [ + "Sets the announced TCP port for dynamically discovered IPs." + ], + "added": "v23.02" + }, + "encrypted-hsm": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`true` if `encrypted-hsm` was set in config or cmdline." + ] + }, + "rpc-file-mode": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`rpc-file-mode` field from config or cmdline, or default." + ] + }, + "log-level": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`log-level` field from config or cmdline, or default." + ] + }, + "log-prefix": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`log-prefix` field from config or cmdline, or default." + ] + }, + "log-file": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`log-file` field from config or cmdline, or default." + ] + }, + "log-timestamps": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`log-timestamps` field from config or cmdline, or default." + ] + }, + "force-feerates": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "Force-feerate configuration setting, if any." + ] + }, + "subdaemon": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`subdaemon` fields from config or cmdline if any (can be more than one)." + ] + }, + "fetchinvoice-noconnect": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`fetchinvoice-noconnect` fields from config or cmdline, or default." + ] + }, + "accept-htlc-tlv-types": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`accept-htlc-tlv-types` field from config or cmdline, or not present." + ] + }, + "tor-service-password": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`tor-service-password` field from config or cmdline, if any." + ] + }, + "dev-allowdustreserve": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "Whether we allow setting dust reserves." + ] + }, + "announce-addr-dns": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "added": "v22.11.1", + "description": [ + "Whether we put DNS entries into node_announcement." + ] + }, + "require-confirmed-inputs": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "Request peers to only send confirmed inputs (dual-fund only)." + ] + }, + "developer": { + "added": "v23.08", + "type": "boolean", + "description": [ + "Whether developer mode is enabled." + ] + }, + "commit-fee": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u64", + "added": "v23.05", + "description": [ + "The percentage of the 6-block fee estimate to use for commitment transactions." + ] + }, + "min-emergency-msat": { + "type": "msat", + "added": "v23.08", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "commit-feerate-offset": { + "type": "u32", + "added": "v23.11", + "description": [ + "Additional commitment feerate applied by channel owner." + ] + } + }, + "pre_return_value_notes": [ + "The returned values reflect the current configuration, including showing default values (`dev-` options are not shown unless specified as *config* explicitly).", + "", + "Note: as plugins can add options, not all configuration settings are listed here! The format of each entry is as follows:", + "", + "- **source** (string): source of configuration setting (`file`:`linenum`)", + "- **dynamic** (boolean, optional): true if this option is settable via setconfig", + "- **plugin** (string, optional): set if this is from a plugin", + "", + "Depending on the option type, exactly one of the following is present:", + "", + "- **set** (boolean, optional): for simple flag options", + "- **value_str** (string, optional): for string options", + "- **value_msat** (msat, optional): for msat options", + "- **value_int** (integer, optional): for integer options", + "- **value_bool** (boolean, optional): for boolean options" + ] + }, + "example_json_request": [ + { + "id": "example:listconfigs#1", + "method": "listconfigs", + "params": { + "config": "network" + } + }, + { + "id": "example:listconfigs#2", + "method": "listconfigs", + "params": { + "config": null + } + }, + { + "id": "example:listconfigs#3", + "method": "listconfigs", + "params": { + "config": "experimental-dual-fund" + } + } + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters or field with *config* name doesn't exist." + ], + "example_json_response": [ + { + "#version": "v0.9.0-1", + "lightning-dir": "/media/vincent/Maxtor/sanboxTestWrapperRPC/lightning_dir_dev", + "network": "testnet", + "allow-deprecated-apis": true, + "rpc-file": "lightning-rpc", + "plugins": [ + { + "path": "/home/vincent/Github/plugins/sauron/sauron.py", + "name": "sauron.py", + "options": { + "sauron-api-endpoint": "http://blockstream.info/testnet/api/", + "sauron-tor-proxy": "" + } + }, + { + "path": "/home/vincent/Github/reckless/reckless.py", + "name": "reckless.py" + } + ], + "important-plugins": [ + { + "path": "/home/vincent/Github/lightning/lightningd/../plugins/autoclean", + "name": "autoclean", + "options": { + "autocleaninvoice-cycle": null, + "autocleaninvoice-expired-by": null + } + }, + { + "path": "/home/vincent/Github/lightning/lightningd/../plugins/fundchannel", + "name": "fundchannel" + }, + { + "path": "/home/vincent/Github/lightning/lightningd/../plugins/keysend", + "name": "keysend" + }, + { + "path": "/home/vincent/Github/lightning/lightningd/../plugins/pay", + "name": "pay", + "options": { + "disable-mpp": false + } + } + ], + "important-plugin": "/home/vincent/Github/lightning/lightningd/../plugins/pay", + "plugin": "/home/vincent/Github/reckless/reckless.py", + "disable-plugin": [ + "bcli" + ], + "always-use-proxy": false, + "daemon": "false", + "wallet": "sqlite3:///media/vincent/Maxtor/sanboxTestWrapperRPC/lightning_dir_dev/testnet/lightningd.sqlite3", + "wumbo": true, + "rgb": "03ad98", + "alias": "BRUCEWAYN-TES-DEV", + "pid-file": "/media/vincent/Maxtor/sanboxTestWrapperRPC/lightning_dir_dev/lightningd-testne...", + "ignore-fee-limits": true, + "watchtime-blocks": 6, + "max-locktime-blocks": 2016, + "funding-confirms": 1, + "commit-fee-min": 0, + "commit-fee-max": 0, + "cltv-delta": 6, + "cltv-final": 10, + "commit-time": 10, + "fee-base": 1, + "rescan": 30, + "fee-per-satoshi": 10, + "max-concurrent-htlcs": 483, + "min-capacity-sat": 10000, + "addr": "autotor:127.0.0.1:9051", + "bind-addr": "127.0.0.1:9735", + "announce-addr": "fp463inc4w3lamhhduytrwdwq6q6uzugtaeapylqfc43agrdnnqsheyd.onion:9735", + "offline": "false", + "autolisten": true, + "proxy": "127.0.0.1:9050", + "disable-dns": "false", + "encrypted-hsm": false, + "rpc-file-mode": "0600", + "log-level": "DEBUG", + "log-prefix": "lightningd" + }, + { + "configs": { + "developer": { + "set": true, + "source": "cmdline" + }, + "lightning-dir": { + "value_str": "/tmp/ltests-giwf5tc7/test_plugin_start_1/lightning-1/", + "source": "cmdline" + }, + "network": { + "value_str": "regtest", + "source": "cmdline" + }, + "testnet": { + "set": false, + "source": "default" + }, + "signet": { + "set": false, + "source": "default" + }, + "mainnet": { + "set": false, + "source": "default" + }, + "regtest": { + "set": false, + "source": "default" + }, + "rpc-file": { + "value_str": "lightning-rpc", + "source": "default" + }, + "allow-deprecated-apis": { + "value_bool": false, + "source": "cmdline" + }, + "plugin": { + "values_str": [ + "~/lightning/target/debug/examples/cln-plugin-startup" + ], + "sources": [ + "cmdline" + ] + }, + "plugin-dir": { + "values_str": [], + "sources": [] + }, + "clear-plugins": { + "set": false, + "source": "default" + }, + "disable-plugin": { + "values_str": [], + "sources": [] + }, + "important-plugin": { + "values_str": [], + "sources": [] + }, + "always-use-proxy": { + "value_bool": false, + "source": "default" + }, + "daemon": { + "set": false, + "source": "default" + }, + "experimental-dual-fund": { + "set": false, + "source": "default" + }, + "experimental-splicing": { + "set": false, + "source": "default" + }, + "experimental-onion-messages": { + "set": false, + "source": "default" + }, + "experimental-offers": { + "set": false, + "source": "default" + }, + "experimental-shutdown-wrong-funding": { + "set": false, + "source": "default" + }, + "experimental-peer-storage": { + "set": false, + "source": "default" + }, + "experimental-quiesce": { + "set": false, + "source": "default" + }, + "experimental-anchors": { + "set": false, + "source": "default" + }, + "rgb": { + "value_str": "0266e4", + "source": "default" + }, + "alias": { + "value_str": "JUNIORBEAM-1-102-g7549e10-modded", + "source": "default" + }, + "pid-file": { + "value_str": "/tmp/ltests-giwf5tc7/test_plugin_start_1/lightning-1/lightningd-regtest.pid", + "source": "default" + }, + "ignore-fee-limits": { + "value_bool": false, + "source": "cmdline" + }, + "watchtime-blocks": { + "value_int": 5, + "source": "cmdline" + }, + "max-locktime-blocks": { + "value_int": 2016, + "source": "default" + }, + "funding-confirms": { + "value_int": 1, + "source": "default" + }, + "require-confirmed-inputs": { + "value_bool": false, + "source": "default" + }, + "cltv-delta": { + "value_int": 6, + "source": "cmdline" + }, + "cltv-final": { + "value_int": 5, + "source": "cmdline" + }, + "commit-time": { + "value_int": 10, + "source": "default" + }, + "fee-base": { + "value_int": 1, + "source": "default" + }, + "rescan": { + "value_int": 1, + "source": "cmdline" + }, + "fee-per-satoshi": { + "value_int": 10, + "source": "default" + }, + "htlc-minimum-msat": { + "value_msat": 0, + "source": "default" + }, + "htlc-maximum-msat": { + "value_msat": 18446744073709552000, + "source": "default" + }, + "max-concurrent-htlcs": { + "value_int": 483, + "source": "default" + }, + "max-dust-htlc-exposure-msat": { + "value_msat": 50000000, + "source": "default" + }, + "min-capacity-sat": { + "value_int": 10000, + "source": "default", + "dynamic": true + }, + "addr": { + "values_str": [ + "127.0.0.1:33157" + ], + "sources": [ + "cmdline" + ] + }, + "bind-addr": { + "values_str": [], + "sources": [] + }, + "announce-addr": { + "values_str": [], + "sources": [] + }, + "announce-addr-discovered": { + "value_str": "auto", + "source": "default" + }, + "announce-addr-discovered-port": { + "value_int": 19846, + "source": "default" + }, + "offline": { + "set": false, + "source": "default" + }, + "autolisten": { + "value_bool": false, + "source": "default" + }, + "accept-htlc-tlv-type": { + "values_int": [], + "sources": [] + }, + "disable-dns": { + "set": true, + "source": "cmdline" + }, + "encrypted-hsm": { + "set": false, + "source": "default" + }, + "rpc-file-mode": { + "value_str": "0600", + "source": "default" + }, + "commit-fee": { + "value_int": 100, + "source": "default" + }, + "commit-feerate-offset": { + "value_int": 5, + "source": "default" + }, + "min-emergency-msat": { + "value_msat": 25000000, + "source": "default" + }, + "subdaemon": { + "values_str": [], + "sources": [] + }, + "experimental-upgrade-protocol": { + "set": false, + "source": "default" + }, + "invoices-onchain-fallback": { + "set": false, + "source": "default" + }, + "log-level": { + "value_str": "debug", + "source": "cmdline" + }, + "log-timestamps": { + "value_bool": true, + "source": "default" + }, + "log-prefix": { + "value_str": "lightningd-1 ", + "source": "cmdline" + }, + "log-file": { + "values_str": [ + "-", + "/tmp/ltests-giwf5tc7/test_plugin_start_1/lightning-1/log" + ], + "sources": [ + "cmdline", + "cmdline" + ] + }, + "dev-no-plugin-checksum": { + "set": true, + "source": "cmdline" + }, + "dev-no-reconnect": { + "set": true, + "source": "cmdline" + }, + "dev-fail-on-subdaemon-fail": { + "set": true, + "source": "cmdline" + }, + "dev-bitcoind-poll": { + "value_int": 1, + "source": "cmdline" + }, + "dev-fast-gossip": { + "set": true, + "source": "cmdline" + }, + "renepay-debug-mcf": { + "set": false, + "source": "default", + "plugin": "~/lightning/plugins/cln-renepay" + }, + "renepay-debug-payflow": { + "set": false, + "source": "default", + "plugin": "~/lightning/plugins/cln-renepay" + }, + "test-option": { + "value_int": 31337, + "source": "cmdline", + "plugin": "~/lightning/target/debug/examples/cln-plugin-startup" + }, + "bitcoin-datadir": { + "value_str": "/tmp/ltests-giwf5tc7/test_plugin_start_1/lightning-1/", + "source": "cmdline", + "plugin": "~/lightning/plugins/bcli" + }, + "bitcoin-rpcuser": { + "value_str": "rpcuser", + "source": "cmdline", + "plugin": "~/lightning/plugins/bcli" + }, + "bitcoin-rpcpassword": { + "value_str": "rpcpass", + "source": "cmdline", + "plugin": "~/lightning/plugins/bcli" + }, + "bitcoin-rpcport": { + "value_int": 51309, + "source": "cmdline", + "plugin": "~/lightning/plugins/bcli" + }, + "disable-mpp": { + "set": false, + "source": "default", + "plugin": "~/lightning/plugins/pay" + } + } + }, + { + "configs": { + "experimental-dual-fund": { + "set": false, + "source": "default" + } + } + } + ], + "author": [ + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." + ], + "see_also": [ + "lightning-getinfo(7)", + "lightningd-config(5)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-listdatastore.json b/doc/schemas/lightning-listdatastore.json new file mode 100644 index 000000000000..6517ddef8dcc --- /dev/null +++ b/doc/schemas/lightning-listdatastore.json @@ -0,0 +1,130 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listdatastore", + "title": "Command for listing (plugin) data", + "description": [ + "The **listdatastore** RPC command allows plugins to fetch data which was stored in the Core Lightning database." + ], + "request": { + "required": [], + "properties": { + "key": { + "oneOf": [ + { + "type": "array", + "description": [ + "All immediate children of the *key* (or root children) are returned.", + " Using the first element of the key as the plugin name (e.g. `[ 'summary' ]`) is recommended.", + " An array of values to form a hierarchy (though a single value is treated as a one-element array)." + ], + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] + } + } + }, + "response": { + "required": [ + "datastore" + ], + "properties": { + "datastore": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "key" + ], + "properties": { + "key": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Part of the key added to the datastore." + ] + } + }, + "generation": { + "type": "u64", + "description": [ + "The number of times this has been updated." + ] + }, + "hex": { + "type": "hex", + "description": [ + "The hex data from the datastore." + ] + }, + "string": { + "type": "string", + "description": [ + "The data as a string, if it's valid utf-8." + ] + } + } + } + } + } + }, + "errors": [ + "The following error codes may occur:", + "", + "- -32602: invalid parameters." + ], + "example_json_request": [ + { + "id": "example:listdatastore#1", + "method": "listdatastore", + "params": { + "key": [ + "commando" + ] + } + }, + { + "id": "example:listdatastore#2", + "method": "listdatastore", + "params": { + "key": "otherkey" + } + } + ], + "example_json_response": [ + { + "datastore": [] + }, + { + "datastore": [ + { + "key": [ + "otherkey" + ], + "generation": 0, + "hex": "6f7468657264617461", + "string": "otherdata" + } + ] + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-datastore(7)", + "lightning-deldatastore(7)", + "lightning-datastoreusage(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-listforwards.json b/doc/schemas/lightning-listforwards.json new file mode 100644 index 000000000000..5a1d3aa6fb89 --- /dev/null +++ b/doc/schemas/lightning-listforwards.json @@ -0,0 +1,453 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listforwards", + "title": "Command showing all htlcs and their information", + "description": [ + "The **listforwards** RPC command displays all htlcs that have been attempted to be forwarded by the Core Lightning node." + ], + "request": { + "required": [], + "properties": { + "status": { + "type": "string", + "description": [ + "If specified, then only the forwards with the given status are returned." + ], + "enum": [ + "offered", + "settled", + "local_failed", + "failed" + ] + }, + "in_channel": { + "type": "short_channel_id", + "description": [ + "Only the matching forwards on the given inbound channel are returned." + ] + }, + "out_channel": { + "type": "short_channel_id", + "description": [ + "Only the matching forwards on the given outbount channel are returned." + ] + }, + "index": { + "type": "string", + "added": "v23.11", + "enum": [ + "created", + "updated" + ], + "description": [ + "If neither *in_channel* nor *out_channel* is specified, it controls ordering." + ], + "default": "`created`" + }, + "start": { + "type": "u64", + "added": "v23.11", + "description": [ + "If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)." + ] + }, + "limit": { + "type": "u32", + "added": "v23.11", + "description": [ + "If `index` is specified, `limit` can be used to specify the maximum number of entries to return." + ] + } + }, + "dependentUpon": { + "index": [ + "start", + "limit" + ] + } + }, + "response": { + "required": [ + "forwards" + ], + "properties": { + "forwards": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "created_index", + "in_channel", + "in_msat", + "status", + "received_time" + ], + "properties": { + "created_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this forward was created in." + ] + }, + "in_channel": { + "type": "short_channel_id", + "description": [ + "The channel that received the HTLC." + ] + }, + "in_htlc_id": { + "type": "u64", + "description": [ + "The unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11)." + ] + }, + "in_msat": { + "type": "msat", + "description": [ + "The value of the incoming HTLC." + ] + }, + "status": { + "type": "string", + "enum": [ + "offered", + "settled", + "local_failed", + "failed" + ], + "description": [ + "Still ongoing, completed, failed locally, or failed after forwarding." + ] + }, + "received_time": { + "type": "number", + "description": [ + "The UNIX timestamp when this was received." + ] + }, + "out_channel": { + "type": "short_channel_id", + "description": [ + "The channel that the HTLC (trying to) forward to." + ] + }, + "out_htlc_id": { + "type": "u64", + "description": [ + "The unique HTLC id we gave this when sending (may be missing even if out_channel is present, for old forwards before v22.11)." + ] + }, + "updated_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this forward was changed (only present if it has changed since creation)." + ] + }, + "style": { + "type": "string", + "enum": [ + "legacy", + "tlv" + ], + "description": [ + "Either a legacy onion format or a modern tlv format." + ] + } + }, + "allOf": [ + { + "if": { + "required": [ + "out_msat" + ] + }, + "then": { + "additionalProperties": false, + "required": [ + "fee_msat", + "out_msat", + "out_channel" + ], + "properties": { + "created_index": {}, + "updated_index": {}, + "in_channel": {}, + "in_htlc_id": {}, + "in_msatoshi": {}, + "in_msat": {}, + "status": {}, + "style": {}, + "received_time": {}, + "resolved_time": {}, + "out_channel": {}, + "out_htlc_id": {}, + "failcode": {}, + "failreason": {}, + "fee_msat": { + "type": "msat", + "description": [ + "The amount this paid in fees." + ] + }, + "out_msat": { + "type": "msat", + "description": [ + "The amount we sent out the *out_channel*." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [], + "properties": { + "created_index": {}, + "updated_index": {}, + "in_channel": {}, + "in_htlc_id": {}, + "in_msatoshi": {}, + "in_msat": {}, + "status": {}, + "style": {}, + "received_time": {}, + "resolved_time": {}, + "failcode": {}, + "failreason": {}, + "out_channel": {} + } + } + }, + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "settled", + "failed" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "resolved_time" + ], + "properties": { + "created_index": {}, + "updated_index": {}, + "in_channel": {}, + "in_htlc_id": {}, + "in_msatoshi": {}, + "in_msat": {}, + "status": {}, + "style": {}, + "received_time": {}, + "out_channel": {}, + "out_htlc_id": {}, + "fee": {}, + "fee_msat": {}, + "out_msatoshi": {}, + "out_msat": {}, + "failcode": {}, + "failreason": {}, + "resolved_time": { + "type": "number", + "description": [ + "The UNIX timestamp when this was resolved." + ] + } + } + }, + "else": { + "additionalProperties": false, + "properties": { + "created_index": {}, + "updated_index": {}, + "in_channel": {}, + "in_htlc_id": {}, + "in_msatoshi": {}, + "in_msat": {}, + "status": {}, + "style": {}, + "received_time": {}, + "out_channel": {}, + "out_htlc_id": {}, + "fee": {}, + "fee_msat": {}, + "failcode": {}, + "failreason": {}, + "out_msatoshi": {}, + "out_msat": {} + } + } + }, + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "local_failed", + "failed" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [], + "properties": { + "created_index": {}, + "updated_index": {}, + "in_channel": {}, + "in_htlc_id": {}, + "in_msatoshi": {}, + "in_msat": {}, + "status": {}, + "style": {}, + "received_time": {}, + "out_channel": {}, + "out_htlc_id": {}, + "fee": {}, + "fee_msat": {}, + "out_msatoshi": {}, + "out_msat": {}, + "resolved_time": {}, + "failcode": { + "type": "u32", + "description": [ + "The numeric onion code returned." + ] + }, + "failreason": { + "type": "string", + "description": [ + "The name of the onion code returned." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [], + "properties": { + "created_index": {}, + "updated_index": {}, + "in_channel": {}, + "in_htlc_id": {}, + "in_msatoshi": {}, + "in_msat": {}, + "status": {}, + "style": {}, + "received_time": {}, + "out_channel": {}, + "out_htlc_id": {}, + "fee": {}, + "fee_msat": {}, + "out_msatoshi": {}, + "out_msat": {}, + "resolved_time": {} + } + } + } + ] + } + } + } + }, + "example_json_request": [ + { + "id": "example:listforwards#1", + "method": "listforwards", + "params": { + "status": null, + "in_channel": null, + "out_channel": null, + "index": null, + "start": null, + "limit": null + } + }, + { + "id": "example:listforwards#2", + "method": "listforwards", + "params": { + "in_channel": "0x1x2", + "out_channel": "0x2x3", + "status": "settled" + } + } + ], + "example_json_response": [ + { + "forwards": [ + { + "created_index": 1, + "updated_index": 1, + "in_channel": "103x1x0", + "in_htlc_id": 0, + "out_channel": "104x1x0", + "out_htlc_id": 0, + "in_msat": 100001001, + "out_msat": 100000000, + "fee_msat": 1001, + "status": "settled", + "style": "tlv", + "received_time": 1706229285.5934534, + "resolved_time": 1706229288.830004 + }, + { + "created_index": 2, + "updated_index": 2, + "in_channel": "103x1x0", + "in_htlc_id": 1, + "out_channel": "105x1x0", + "out_htlc_id": 0, + "in_msat": 100001001, + "out_msat": 100000000, + "fee_msat": 1001, + "status": "failed", + "style": "tlv", + "received_time": 1706229290.0289993, + "resolved_time": 1706229292.9487684 + }, + { + "created_index": 3, + "updated_index": 3, + "in_channel": "103x1x0", + "in_htlc_id": 2, + "out_channel": "106x1x0", + "out_htlc_id": 0, + "in_msat": 100001000, + "out_msat": 99999999, + "fee_msat": 1001, + "status": "local_failed", + "failcode": 16392, + "failreason": "WIRE_PERMANENT_CHANNEL_FAILURE", + "style": "tlv", + "received_time": 1706229295.3175724 + } + ] + }, + { + "forwards": [] + } + ], + "author": [ + "Rene Pickhardt <> is mainly responsible." + ], + "see_also": [ + "lightning-autoclean-status(7)", + "lightning-getinfo(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-listfunds.json b/doc/schemas/lightning-listfunds.json new file mode 100644 index 000000000000..1d4d2e56aeb4 --- /dev/null +++ b/doc/schemas/lightning-listfunds.json @@ -0,0 +1,380 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listfunds", + "title": "Command showing all funds currently managed by the Core Lightning node", + "description": [ + "The **listfunds** RPC command displays all funds available, either in unspent outputs (UTXOs) in the internal wallet or funds locked in currently open channels." + ], + "request": { + "required": [], + "properties": { + "spent": { + "type": "boolean", + "description": [ + "If True, then the *outputs* will include spent outputs in addition to the unspent ones." + ], + "default": "False" + } + } + }, + "response": { + "required": [ + "outputs", + "channels" + ], + "properties": { + "outputs": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "txid", + "output", + "amount_msat", + "scriptpubkey", + "status", + "reserved" + ], + "properties": { + "txid": { + "type": "txid", + "description": [ + "The ID of the spendable transaction." + ] + }, + "output": { + "type": "u32", + "description": [ + "The index within *txid*." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount of the output." + ] + }, + "scriptpubkey": { + "type": "hex", + "description": [ + "The scriptPubkey of the output." + ] + }, + "address": { + "type": "string", + "description": [ + "The bitcoin address of the output." + ] + }, + "redeemscript": { + "type": "hex", + "description": [ + "The redeemscript, only if it's p2sh-wrapped." + ] + }, + "status": { + "type": "string", + "enum": [ + "unconfirmed", + "confirmed", + "spent", + "immature" + ] + }, + "reserved": { + "type": "boolean", + "description": [ + "Whether this UTXO is currently reserved for an in-flight tx." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "confirmed" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "blockheight" + ], + "properties": { + "txid": {}, + "output": {}, + "amount_msat": {}, + "scriptpubkey": {}, + "address": {}, + "value": {}, + "redeemscript": {}, + "status": {}, + "reserved": {}, + "reserved_to_block": {}, + "blockheight": { + "type": "u32", + "description": [ + "Block height where it was confirmed." + ] + } + } + } + }, + { + "if": { + "properties": { + "reserved": { + "type": "boolean", + "enum": [ + "true" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "reserved_to_block" + ], + "properties": { + "txid": {}, + "output": {}, + "amount_msat": {}, + "scriptpubkey": {}, + "address": {}, + "value": {}, + "redeemscript": {}, + "status": {}, + "blockheight": {}, + "reserved": {}, + "reserved_to_block": { + "type": "u32", + "description": [ + "Block height where reservation will expire." + ] + } + } + } + } + ] + } + }, + "channels": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "peer_id", + "our_amount_msat", + "amount_msat", + "funding_txid", + "funding_output", + "connected", + "state", + "channel_id" + ], + "properties": { + "peer_id": { + "type": "pubkey", + "description": [ + "The peer with which the channel is opened." + ] + }, + "our_amount_msat": { + "type": "msat", + "description": [ + "Available satoshis on our node's end of the channel." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Total channel value." + ] + }, + "funding_txid": { + "type": "txid", + "description": [ + "Funding transaction id." + ] + }, + "funding_output": { + "type": "u32", + "description": [ + "The 0-based index of the output in the funding transaction." + ] + }, + "connected": { + "type": "boolean", + "description": [ + "Whether the channel peer is connected." + ] + }, + "state": { + "type": "string", + "enum": [ + "OPENINGD", + "CHANNELD_AWAITING_LOCKIN", + "CHANNELD_NORMAL", + "CHANNELD_SHUTTING_DOWN", + "CLOSINGD_SIGEXCHANGE", + "CLOSINGD_COMPLETE", + "AWAITING_UNILATERAL", + "FUNDING_SPEND_SEEN", + "ONCHAIN", + "DUALOPEND_OPEN_INIT", + "DUALOPEND_AWAITING_LOCKIN", + "DUALOPEND_OPEN_COMMITTED", + "DUALOPEND_OPEN_COMMIT_READY" + ], + "description": [ + "The channel state, in particular `CHANNELD_NORMAL` means the channel can be used normally." + ] + }, + "channel_id": { + "type": "hash", + "description": [ + "The full channel_id (funding txid Xored with output number)." + ], + "added": "v23.05" + } + }, + "allOf": [ + { + "if": { + "properties": { + "state": { + "type": "string", + "enum": [ + "CHANNELD_NORMAL" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "short_channel_id" + ], + "properties": { + "peer_id": {}, + "our_amount_msat": {}, + "channel_sat": {}, + "amount_msat": {}, + "channel_total_sat": {}, + "funding_txid": {}, + "funding_output": {}, + "connected": {}, + "state": {}, + "channel_id": {}, + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "Short channel id of channel." + ] + } + } + } + }, + { + "if": { + "properties": { + "state": { + "type": "string", + "enum": [ + "CHANNELD_SHUTTING_DOWN", + "CLOSINGD_SIGEXCHANGE", + "CLOSINGD_COMPLETE", + "AWAITING_UNILATERAL", + "FUNDING_SPEND_SEEN", + "ONCHAIN" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [], + "properties": { + "peer_id": {}, + "our_amount_msat": {}, + "channel_sat": {}, + "amount_msat": {}, + "channel_total_sat": {}, + "funding_txid": {}, + "funding_output": {}, + "connected": {}, + "state": {}, + "channel_id": {}, + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "Short channel id of channel (only if funding reached lockin depth before closing)." + ] + } + } + } + } + ] + } + } + } + }, + "example_json_request": [ + { + "id": "example:listfunds#1", + "method": "listfunds", + "params": { + "spent": null + } + } + ], + "example_json_response": [ + { + "outputs": [ + { + "txid": "0f184b101569bf777af3449fa266948a9d55768f97867e48416a2c92858dd1bc", + "output": 1, + "amount_msat": 1111111000, + "scriptpubkey": "001401fad90abcd66697e2592164722de4a95ebee165", + "address": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf", + "status": "confirmed", + "blockheight": 102, + "reserved": false + }, + { + "txid": "4bee7dc3a28f2434e9bb3e9aaab418dd276485a8705b0f787bf741d3f979ec3b", + "output": 1, + "amount_msat": 1111111000, + "scriptpubkey": "001401fad90abcd66697e2592164722de4a95ebee165", + "address": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf", + "status": "confirmed", + "blockheight": 102, + "reserved": false + } + ], + "channels": [] + } + ], + "author": [ + "Felix <> is mainly responsible." + ], + "see_also": [ + "lightning-newaddr(7)", + "lightning-fundchannel(7)", + "lightning-withdraw(7)", + "lightning-listtransactions(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-listhtlcs.json b/doc/schemas/lightning-listhtlcs.json new file mode 100644 index 000000000000..6d47c1cfc2db --- /dev/null +++ b/doc/schemas/lightning-listhtlcs.json @@ -0,0 +1,257 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listhtlcs", + "title": "Command for querying HTLCs", + "description": [ + "The **listhtlcs** RPC command gets all HTLCs (which, generally, we remember for as long as a channel is open, even if they've completed long ago)." + ], + "request": { + "required": [], + "properties": { + "id": { + "type": "string", + "description": [ + "A short channel id (e.g. 1x2x3) or full 64-byte hex channel id, it will only list htlcs for that channel (which must be known)." + ] + } + } + }, + "response": { + "required": [ + "htlcs" + ], + "properties": { + "htlcs": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "short_channel_id", + "id", + "expiry", + "direction", + "amount_msat", + "payment_hash", + "state" + ], + "properties": { + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "The channel that contains/contained the HTLC." + ] + }, + "id": { + "type": "u64", + "description": [ + "The unique, incrementing HTLC id the creator gave this." + ] + }, + "expiry": { + "type": "u32", + "description": [ + "The block number where this HTLC expires/expired." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The value of the HTLC." + ] + }, + "direction": { + "type": "string", + "enum": [ + "out", + "in" + ], + "description": [ + "Out if we offered this to the peer, in if they offered it." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "Payment hash sought by HTLC." + ] + }, + "state": { + "type": "string", + "enum": [ + "SENT_ADD_HTLC", + "SENT_ADD_COMMIT", + "RCVD_ADD_REVOCATION", + "RCVD_ADD_ACK_COMMIT", + "SENT_ADD_ACK_REVOCATION", + "RCVD_REMOVE_HTLC", + "RCVD_REMOVE_COMMIT", + "SENT_REMOVE_REVOCATION", + "SENT_REMOVE_ACK_COMMIT", + "RCVD_REMOVE_ACK_REVOCATION", + "RCVD_ADD_HTLC", + "RCVD_ADD_COMMIT", + "SENT_ADD_REVOCATION", + "SENT_ADD_ACK_COMMIT", + "RCVD_ADD_ACK_REVOCATION", + "SENT_REMOVE_HTLC", + "SENT_REMOVE_COMMIT", + "RCVD_REMOVE_REVOCATION", + "RCVD_REMOVE_ACK_COMMIT", + "SENT_REMOVE_ACK_REVOCATION" + ], + "description": [ + "The first 10 states are for `in`, the next 10 are for `out`." + ] + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:listhtlcs#1", + "method": "listhtlcs", + "params": "{}" + }, + { + "id": "example:listhtlcs#2", + "method": "listhtlcs", + "params": [ + "103x2x0" + ] + }, + { + "id": "example:listhtlcs#3", + "method": "listhtlcs", + "params": [ + "436c2658eb4f4689b42ff11b8b05f31ba09860d0df7168085e0796cdf40f85e0" + ] + } + ], + "example_json_response": [ + { + "htlcs": [ + { + "short_channel_id": "103x1x0", + "id": 0, + "expiry": 117, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "d2668e77c5a2220496e813de36f1fc09ba804b16af4c6bb38299d8a6eb8a5f10", + "state": "RCVD_REMOVE_ACK_REVOCATION" + }, + { + "short_channel_id": "103x1x0", + "id": 1, + "expiry": 117, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "286e08ac8f575f10508d751fcfc93871b4344271967c7b9e5eacb3f3573b8307", + "state": "RCVD_REMOVE_ACK_REVOCATION" + }, + { + "short_channel_id": "103x1x0", + "id": 2, + "expiry": 135, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "3e4baa750ee3dfb934578f041ccb40b87432bf37ec65c9d7bce5ff28fecbd95f", + "state": "RCVD_REMOVE_ACK_REVOCATION" + }, + { + "short_channel_id": "103x1x0", + "id": 3, + "expiry": 135, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "4c3ce32565dc10ef2bd230c32802ce2fe8b007208c0a90757aa289f75c994d49", + "state": "SENT_REMOVE_REVOCATION" + } + ] + }, + { + "htlcs": [ + { + "short_channel_id": "103x2x0", + "id": 0, + "expiry": 117, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "12bb14b1d119e1ae0759e5ff6f1f6653e3fd8f71ea59411500d2871404a47a98", + "state": "RCVD_REMOVE_ACK_REVOCATION" + }, + { + "short_channel_id": "103x2x0", + "id": 1, + "expiry": 117, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "57d950209cc0b4fcc5e3027569232f96cf83ef85314c6b139a5713848d811a66", + "state": "RCVD_REMOVE_ACK_REVOCATION" + }, + { + "short_channel_id": "103x2x0", + "id": 2, + "expiry": 135, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "45ad4654715411a07a0ad6ec3f4bfaa918c90e3d1934b10b1c1c5846523ddd7f", + "state": "RCVD_REMOVE_ACK_REVOCATION" + }, + { + "short_channel_id": "103x2x0", + "id": 3, + "expiry": 135, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "cc0dcd214aa71c62bfba711a0746da821f2cdba1770b11c225920bdde12c931e", + "state": "RCVD_REMOVE_ACK_REVOCATION" + } + ] + }, + { + "htlcs": [ + { + "short_channel_id": "103x1x0", + "id": 0, + "expiry": 124, + "direction": "out", + "amount_msat": 1001, + "payment_hash": "2ab653668c8017ff2f36ac36678a8da04e11380bd9580a2926b170523b0c6e3b", + "state": "RCVD_REMOVE_ACK_REVOCATION" + }, + { + "short_channel_id": "103x1x0", + "id": 1, + "expiry": 124, + "direction": "out", + "amount_msat": 2001, + "payment_hash": "92f889cb2e48aa28e1e577228b907cdbcc371a2c018e9c8f60fa7036e232cf1d", + "state": "RCVD_REMOVE_ACK_REVOCATION" + }, + { + "short_channel_id": "103x1x0", + "id": 2, + "expiry": 128, + "direction": "out", + "amount_msat": 4001, + "payment_hash": "14ef01c9fb12d7dcac288f48ce87b19a7d5c3d5779aaed1e4adcb5c5d0e9fa45", + "state": "RCVD_REMOVE_ACK_REVOCATION" + } + ] + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listforwards(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-listinvoicerequests.json b/doc/schemas/lightning-listinvoicerequests.json new file mode 100644 index 000000000000..64b0228adc37 --- /dev/null +++ b/doc/schemas/lightning-listinvoicerequests.json @@ -0,0 +1,120 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v22.11", + "rpc": "listinvoicerequests", + "title": "Command for querying invoice_request status", + "description": [ + "The **listinvoicerequests** RPC command gets the status of a specific `invoice_request`, if it exists, or the status of all `invoice_requests` if given no argument." + ], + "request": { + "required": [], + "properties": { + "invreq_id": { + "type": "string", + "description": [ + "A specific invoice can be queried by providing the `invreq_id`, which is presented by lightning-invoicerequest(7), or can be calculated from a bolt12 invoice." + ] + }, + "active_only": { + "type": "boolean", + "description": [ + "If it is *True* then only active invoice requests are returned." + ], + "default": "*False*" + } + } + }, + "response": { + "required": [ + "invoicerequests" + ], + "properties": { + "invoicerequests": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "invreq_id", + "single_use", + "active", + "bolt12", + "used" + ], + "properties": { + "invreq_id": { + "type": "hash", + "description": [ + "The SHA256 hash of all invoice_request fields less than 160." + ] + }, + "active": { + "type": "boolean", + "description": [ + "Whether the invoice_request is currently active." + ] + }, + "single_use": { + "type": "boolean", + "description": [ + "Whether the invoice_request will become inactive after we pay an invoice for it." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string starting with lnr." + ] + }, + "used": { + "type": "boolean", + "description": [ + "Whether the invoice_request has already been used." + ] + }, + "label": { + "type": "string", + "description": [ + "The label provided when creating the invoice_request." + ] + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:listinvoicerequests#1", + "method": "listinvoicerequests", + "params": [ + "cf0b41d4eb248d975909deb9accf9722b1c86839de80ee8815ce907bbb700a1d" + ] + } + ], + "example_json_response": [ + { + "invoicerequests": [ + { + "invreq_id": "cf0b41d4eb248d975909deb9accf9722b1c86839de80ee8815ce907bbb700a1d", + "active": true, + "single_use": true, + "bolt12": "lnr1qqgx9ag7nmtns87htndlgcfndlq0wzstwd5k6urvv5s8getnw3gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02gzqta0pqpvzzqnxu3vc68fug904w25y3zpskc8huazwmy34av93h2fjswe3tsp4rrcyps5sf5jwnn2tr3ghn32mdta8jvax62pwzhna8sktmaezl3f4s3zy35gx6dfay7r8zn299uwr7ugpze74zft4m8q3fnk2sr0ljqpve3jq", + "used": false + } + ] + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-invoicerequests(7)", + "lightning-disableinvoicerequest(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-listinvoices.json b/doc/schemas/lightning-listinvoices.json new file mode 100644 index 000000000000..77fb3c2f5978 --- /dev/null +++ b/doc/schemas/lightning-listinvoices.json @@ -0,0 +1,334 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listinvoices", + "title": "Command for querying invoice status", + "description": [ + "The **listinvoices** RPC command gets the status of a specific invoice, if it exists, or the status of all invoices if given no argument.", + "", + "Only one of the query parameters can be used from *label*, *invstring*, *payment_hash*, or *offer_id*." + ], + "request": { + "required": [], + "properties": { + "label": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "description": [ + "A label used a the creation of the invoice to get a specific invoice." + ] + }, + "invstring": { + "type": "string", + "description": [ + "The string value to query a specific invoice." + ] + }, + "payment_hash": { + "type": "hex", + "description": [ + "A payment_hash of the invoice to get the details of a specific invoice." + ] + }, + "offer_id": { + "type": "string", + "description": [ + "A local `offer_id` the invoice was issued for a specific invoice details." + ] + }, + "index": { + "type": "string", + "added": "v23.08", + "enum": [ + "created", + "updated" + ], + "description": [ + "If neither *in_channel* nor *out_channel* is specified, it controls ordering." + ], + "default": "`created`" + }, + "start": { + "type": "u64", + "added": "v23.08", + "description": [ + "If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)." + ] + }, + "limit": { + "type": "u32", + "added": "v23.08", + "description": [ + "If `index` is specified, `limit` can be used to specify the maximum number of entries to return." + ] + } + }, + "dependentUpon": { + "index": [ + "start", + "limit" + ] + } + }, + "response": { + "required": [ + "invoices" + ], + "properties": { + "invoices": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "label", + "created_index", + "payment_hash", + "status", + "expires_at" + ], + "properties": { + "label": { + "type": "string", + "description": [ + "Unique label supplied at invoice creation." + ] + }, + "description": { + "type": "string", + "description": [ + "Description used in the invoice." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "unpaid", + "paid", + "expired" + ], + "description": [ + "Whether it's paid, unpaid or unpayable." + ] + }, + "expires_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when it will become / became unpayable." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount required to pay this invoice." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The BOLT11 string (always present unless *bolt12* is)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The BOLT12 string (always present unless *bolt11* is)." + ] + }, + "local_offer_id": { + "type": "hash", + "description": [ + "The *id* of our offer which created this invoice (**experimental-offers** only)." + ] + }, + "invreq_payer_note": { + "type": "string", + "description": [ + "The optional *invreq_payer_note* from invoice_request which created this invoice (**experimental-offers** only)." + ] + }, + "created_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was created in." + ] + }, + "updated_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was changed (only present if it has changed since creation)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "paid" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "pay_index", + "amount_received_msat", + "paid_at", + "payment_preimage" + ], + "properties": { + "label": {}, + "description": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "bolt11": {}, + "bolt12": {}, + "local_offer_id": {}, + "invreq_payer_note": {}, + "expires_at": {}, + "created_index": {}, + "updated_index": {}, + "pay_index": { + "type": "u64", + "description": [ + "Unique incrementing index for this payment." + ] + }, + "amount_received_msat": { + "type": "msat", + "description": [ + "The amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)." + ] + }, + "paid_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when it was paid." + ] + }, + "paid_outpoint": { + "type": "object", + "description": [ + "Outpoint this invoice was paid with." + ], + "added": "v23.11", + "additionalProperties": false, + "required": [ + "txid", + "outnum" + ], + "properties": { + "txid": { + "added": "v23.11", + "type": "txid", + "description": [ + "ID of the transaction that paid the invoice." + ] + }, + "outnum": { + "added": "v23.11", + "type": "u32", + "description": [ + "The 0-based output number of the transaction that paid the invoice." + ] + } + } + }, + "payment_preimage": { + "type": "secret", + "description": [ + "Proof of payment." + ] + } + } + }, + "else": { + "additionalProperties": false, + "properties": { + "label": {}, + "description": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "bolt11": {}, + "bolt12": {}, + "local_offer_id": {}, + "invreq_payer_note": {}, + "created_index": {}, + "updated_index": {}, + "expires_at": {} + } + } + } + ] + } + } + } + }, + "example_json_request": [ + { + "id": "example:listinvoices#1", + "method": "listinvoices", + "params": { + "label": "xEoCR94SIz6UIRUEkxum", + "payment_hash": null, + "invstring": null, + "offer_id": null, + "index": null, + "start": null, + "limit": null + } + } + ], + "example_json_response": [ + { + "invoices": [ + { + "label": "xEoCR94SIz6UIRUEkxum", + "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk", + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "amount_msat": 11000000, + "status": "unpaid", + "description": [ + "XEoCR94SIz6UIRUEkxum." + ], + "expires_at": 1706757730, + "created_index": 1 + } + ] + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-waitinvoice(7)", + "lightning-delinvoice(7)", + "lightning-invoice(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-listnodes.json b/doc/schemas/lightning-listnodes.json new file mode 100644 index 000000000000..9829a649d1bd --- /dev/null +++ b/doc/schemas/lightning-listnodes.json @@ -0,0 +1,334 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listnodes", + "title": "Command to get the list of nodes in the known network.", + "description": [ + "The **listnodes** command returns nodes the node has learned about via gossip messages, or a single one if the node *id* was specified." + ], + "request": { + "required": [], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The public key of the node to list." + ] + } + } + }, + "response": { + "required": [ + "nodes" + ], + "properties": { + "nodes": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "nodeid" + ], + "properties": { + "nodeid": { + "type": "pubkey", + "description": [ + "The public key of the node." + ] + }, + "last_timestamp": { + "type": "u32", + "description": [ + "A node_announcement has been received for this node (UNIX timestamp)." + ] + } + }, + "allOf": [ + { + "if": { + "required": [ + "last_timestamp" + ] + }, + "then": { + "additionalProperties": false, + "required": [ + "nodeid", + "last_timestamp", + "alias", + "color", + "features", + "addresses" + ], + "properties": { + "nodeid": {}, + "last_timestamp": {}, + "option_will_fund": {}, + "alias": { + "type": "string", + "description": [ + "The fun alias this node advertized." + ], + "maxLength": 32 + }, + "color": { + "type": "hex", + "description": [ + "The favorite RGB color this node advertized." + ], + "minLength": 6, + "maxLength": 6 + }, + "features": { + "type": "hex", + "description": [ + "BOLT #9 features bitmap this node advertized." + ] + }, + "addresses": { + "type": "array", + "description": [ + "The addresses this node advertized." + ], + "items": { + "type": "object", + "required": [ + "type", + "port" + ], + "additionalProperties": true, + "properties": { + "type": { + "type": "string", + "enum": [ + "dns", + "ipv4", + "ipv6", + "torv2", + "torv3" + ], + "description": [ + "Type of connection (until 23.08, `websocket` was also allowed)." + ] + }, + "port": { + "type": "u16", + "description": [ + "Port number." + ] + } + }, + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "dns", + "ipv4", + "ipv6", + "torv2", + "torv3" + ] + } + } + }, + "then": { + "required": [ + "type", + "address", + "port" + ], + "additionalProperties": false, + "properties": { + "type": {}, + "port": {}, + "address": { + "type": "string", + "description": [ + "Address in expected format for **type**." + ] + } + } + }, + "else": { + "required": [ + "type", + "port" + ], + "additionalProperties": false, + "properties": { + "type": {}, + "port": {} + } + } + } + } + } + }, + "else": { + "additionalProperties": false, + "properties": { + "nodeid": {} + } + } + }, + { + "if": { + "required": [ + "option_will_fund" + ] + }, + "then": { + "additionalProperties": true, + "required": [ + "option_will_fund" + ], + "properties": { + "option_will_fund": { + "type": "object", + "additionalProperties": false, + "required": [ + "lease_fee_base_msat", + "lease_fee_basis", + "funding_weight", + "channel_fee_max_base_msat", + "channel_fee_max_proportional_thousandths", + "compact_lease" + ], + "properties": { + "lease_fee_base_msat": { + "type": "msat", + "description": [ + "The fixed fee for a lease (whole number of satoshis)." + ] + }, + "lease_fee_basis": { + "type": "u32", + "description": [ + "The proportional fee in basis points (parts per 10,000) for a lease." + ] + }, + "funding_weight": { + "type": "u32", + "description": [ + "The onchain weight you'll have to pay for a lease." + ] + }, + "channel_fee_max_base_msat": { + "type": "msat", + "description": [ + "The maximum base routing fee this node will charge during the lease." + ] + }, + "channel_fee_max_proportional_thousandths": { + "type": "u32", + "description": [ + "The maximum proportional routing fee this node will charge during the lease (in thousandths, not millionths like channel_update)." + ] + }, + "compact_lease": { + "type": "hex", + "description": [ + "The lease as represented in the node_announcement." + ] + } + } + } + } + } + } + ] + } + } + } + }, + "example_json_request": [ + { + "id": "example:listnodes#1", + "method": "listnodes", + "params": { + "id": "02e29856dab8ddd9044c18486e4cab79ec717b490447af2d4831e290e48d57638a" + } + }, + { + "id": "example:listnodes#2", + "method": "listnodes", + "params": { + "id": null + } + } + ], + "example_json_response": [ + { + "nodes": [ + { + "nodeid": "02e29856dab8ddd9044c14586e4cab79ec717b490447af2d4831e290e48d58638a", + "alias": "some_alias", + "color": "68f442", + "last_timestamp": 1597213741, + "features": "02a2a1", + "addresses": [ + { + "type": "ipv4", + "address": "zzz.yy.xx.xx", + "port": 9735 + } + ] + } + ] + }, + { + "nodes": [ + { + "nodeid": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "alias": "SILENTARTIST-v23.11-415-gd120eba", + "color": "022d22", + "last_timestamp": 1708624765, + "features": "88a0000a8a5961", + "addresses": [] + }, + { + "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "alias": "JUNIORBEAM-v23.11-415-gd120eba", + "color": "0266e4", + "last_timestamp": 1708624765, + "features": "88a0000a8a5961", + "addresses": [] + }, + { + "nodeid": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "alias": "HOPPINGFIRE-v23.11-415-gd120eba", + "color": "035d2b", + "last_timestamp": 1708624765, + "features": "88a0000a8a5961", + "addresses": [] + }, + { + "nodeid": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", + "alias": "JUNIORFELONY-v23.11-415-gd120eba", + "color": "0382ce", + "last_timestamp": 1708624766, + "features": "88a0000a8a5961", + "addresses": [] + } + ] + } + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters." + ], + "author": [ + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." + ], + "see_also": [ + "lightning-listchannels(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-listoffers.json b/doc/schemas/lightning-listoffers.json new file mode 100644 index 000000000000..a508f5626080 --- /dev/null +++ b/doc/schemas/lightning-listoffers.json @@ -0,0 +1,144 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listoffers", + "title": "Command for listing offers", + "warning": "experimental-offers only", + "description": [ + "The **listoffers** RPC command list all offers, or with `offer_id`, only the offer with that offer_id (if it exists)." + ], + "request": { + "required": [], + "properties": { + "offer_id": { + "type": "hash", + "description": [ + "Offer_id to get details for (if it exists)." + ] + }, + "active_only": { + "type": "boolean", + "description": [ + "If set and is true, only offers with `active` true are returned." + ] + } + } + }, + "response": { + "required": [ + "offers" + ], + "properties": { + "offers": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "offer_id", + "active", + "single_use", + "bolt12", + "used" + ], + "properties": { + "offer_id": { + "type": "hash", + "description": [ + "The id of this offer (merkle hash of non-signature fields)." + ] + }, + "active": { + "type": "boolean", + "description": [ + "Whether this can still be used." + ] + }, + "single_use": { + "type": "boolean", + "description": [ + "Whether this expires as soon as it's paid." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 encoding of the offer." + ] + }, + "used": { + "type": "boolean", + "description": [ + "True if an associated invoice has been paid." + ] + }, + "label": { + "type": "string", + "description": [ + "The (optional) user-specified label." + ] + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:listoffers#1", + "method": "listoffers", + "params": { + "active_only": true + } + }, + { + "id": "example:listoffers#2", + "method": "listoffers", + "params": [ + "f61cca153d1948dade19349792d9bcdc9cef687fd27db0b553a67979f55aae48" + ] + } + ], + "example_json_response": [ + { + "offers": [ + { + "offer_id": "053a5c566fbea2681a5ff9c05a913da23e45b95d09ef5bd25d7d408f23da7084", + "active": true, + "single_use": false, + "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqvqcdgq2z9pk7enxv4jjqen0wgs8yatnw3ujz83qkc6rvp4j28rt3dtrn32zkvdy7efhnlrpr5rp5geqxs783wtlj550qs8czzku4nk3pqp6m593qxgunzuqcwkmgqkmp6ty0wyvjcqdguv3pnpukedwn6cr87m89t74h3auyaeg89xkvgzpac70z3m9rn5xzu28c", + "used": false + }, + { + "offer_id": "3247d3597fec19e362ca683416a48a0f76a44c1600725a7ee1936548feadacca", + "active": true, + "single_use": false, + "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcxqd24x3qgqgqlgzs3gdhkven9v5sxvmmjype82um50ys3ug9kxsmqdvj3c6ut2cuu2s4nrf8k2dulccgaqcdzxgp583utjlu49rcyqt8hc3s797umxn3r9367rdqc577rma7key58fywkajxnuzyapge86hj2pg80rjrma40xdqrxnsnva5l3ce7hz4ua8wf755dees4y9vnq", + "used": true + } + ] + }, + { + "offers": [ + { + "offer_id": "f61cca153d1948dade19349792d9bcdc9cef687fd27db0b553a67979f55aae48", + "active": true, + "single_use": false, + "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqyqs5rn5v4ehggrxdaezqvtdwdshg93pqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq63s", + "used": false + } + ] + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-offer(7)", + "lightning-listoffers(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-listpays.json b/doc/schemas/lightning-listpays.json new file mode 100644 index 000000000000..3aa707e97a33 --- /dev/null +++ b/doc/schemas/lightning-listpays.json @@ -0,0 +1,272 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listpays", + "title": "Command for querying payment status", + "description": [ + "The **listpay** RPC command gets the status of all *pay* commands, or a single one if either *bolt11* or *payment_hash* was specified." + ], + "request": { + "required": [], + "properties": { + "bolt11": { + "type": "string", + "description": [ + "Bolt11 string to get the payment details." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "Payment hash to get the payment details." + ] + }, + "status": { + "type": "string", + "description": [ + "To filter the payment by status." + ], + "enum": [ + "pending", + "complete", + "failed" + ] + } + } + }, + "response": { + "required": [ + "pays" + ], + "properties": { + "pays": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "payment_hash", + "status", + "created_at" + ], + "properties": { + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "pending", + "failed", + "complete" + ], + "description": [ + "Status of the payment." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment if known." + ] + }, + "created_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "completed_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was completed." + ] + }, + "label": { + "type": "string", + "description": [ + "The label, if given to sendpay." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string (if pay supplied one)." + ] + }, + "description": { + "type": "string", + "description": [ + "The description matching the bolt11 description hash (if pay supplied one)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string (if supplied for pay: **experimental-offers** only)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "complete" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "amount_sent_msat", + "preimage" + ], + "properties": { + "payment_hash": {}, + "status": {}, + "destination": {}, + "created_at": {}, + "completed_at": {}, + "label": {}, + "bolt11": {}, + "description": {}, + "bolt12": {}, + "amount_msat": { + "type": "msat", + "description": [ + "The amount of millisatoshi we intended to send to the destination." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "The amount of millisatoshi we sent in order to pay (may include fees and not match amount_msat)." + ] + }, + "preimage": { + "type": "secret", + "description": [ + "Proof of payment." + ] + }, + "number_of_parts": { + "type": "u64", + "description": [ + "The number of parts for a successful payment (only if more than one)." + ] + } + } + } + }, + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "failed" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "amount_sent_msat" + ], + "properties": { + "payment_hash": {}, + "status": {}, + "destination": {}, + "created_at": {}, + "label": {}, + "bolt11": {}, + "description": {}, + "bolt12": {}, + "amount_sent_msat": {}, + "erroronion": { + "type": "hex", + "description": [ + "The error onion returned on failure, if any." + ] + } + } + } + } + ] + } + } + }, + "post_return_value_notes": [ + "The returned array is ordered by increasing **created_at** fields." + ] + }, + "example_json_request": [ + { + "id": "example:listpays#1", + "method": "listpays", + "params": { + "bolt11": "lnbcrt123n1pjmxp7qsp5hxu7u28y0nx4v689u3hwzdzse2w9yaylhheavf9dxvwtdup7pvespp5ha66gxse68j4n6755v7299dnmq4w34gp0znxu0xzahdc43zrg40qdq5v3jhxcmjd9c8g6t0dc6sxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgqk74dvqlvr92ayy5s7x0r0u9xywez6wu4h8pfta386cw6x7cdrvn8pz87kyg5c930aent423gm9ylpaw5p35k72f02hg0s9dulg4d8fqpgj7gpm", + "payment_hash": null, + "status": null + } + }, + { + "id": "example:listpays#2", + "method": "listpays", + "params": { + "bolt11": "lnbcrt123n1pjmxp7qsp5u84368dz7yhzcqm955h96wdqch7uarasun45cr0vs5d8t0cv5avqpp5r9p0dp92guaatrmhf302m0dyj4n79gk93qu2l5tagfxq3dedgfqsdq5v3jhxcmjd9c8g6t0dc6qxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgq46wu0fznfx27rcnyzhcttf8yqx3lwqs482yxlead0fyt8mefrrrj5m379fa5qukgquf9tnwsuj3nnfmwkzkfg6pyhzq6w8gauuh6m5cqgur64n", + "payment_hash": null, + "status": null + } + } + ], + "example_json_response": [ + { + "pays": [ + { + "bolt11": "lnbcrt123n1pjmxp7qsp5hxu7u28y0nx4v689u3hwzdzse2w9yaylhheavf9dxvwtdup7pvespp5ha66gxse68j4n6755v7299dnmq4w34gp0znxu0xzahdc43zrg40qdq5v3jhxcmjd9c8g6t0dc6sxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgqk74dvqlvr92ayy5s7x0r0u9xywez6wu4h8pfta386cw6x7cdrvn8pz87kyg5c930aent423gm9ylpaw5p35k72f02hg0s9dulg4d8fqpgj7gpm", + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "payment_hash": "bf75a41a19d1e559ebd4a33ca295b3d82ae8d50178a66e3cc2eddb8ac443455e", + "status": "failed", + "created_at": 1706231854, + "amount_sent_msat": 0 + } + ] + }, + { + "pays": [ + { + "bolt11": "lnbcrt123n1pjmxp7qsp5u84368dz7yhzcqm955h96wdqch7uarasun45cr0vs5d8t0cv5avqpp5r9p0dp92guaatrmhf302m0dyj4n79gk93qu2l5tagfxq3dedgfqsdq5v3jhxcmjd9c8g6t0dc6qxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgq46wu0fznfx27rcnyzhcttf8yqx3lwqs482yxlead0fyt8mefrrrj5m379fa5qukgquf9tnwsuj3nnfmwkzkfg6pyhzq6w8gauuh6m5cqgur64n", + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "payment_hash": "1942f684aa473bd58f774c5eadbda49567e2a2c58838afd17d424c08b72d4241", + "status": "complete", + "created_at": 1706231849, + "completed_at": 1706231854, + "preimage": "89ce412a2089cbcb72a73ce755337cf693859ea58f21ef0d1caf286a9b0f2a7c", + "amount_msat": 12300, + "amount_sent_msat": 12301 + } + ] + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-pay(7)", + "lightning-paystatus(7)", + "lightning-listsendpays(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-listpeerchannels.json b/doc/schemas/lightning-listpeerchannels.json new file mode 100644 index 000000000000..b8968539b123 --- /dev/null +++ b/doc/schemas/lightning-listpeerchannels.json @@ -0,0 +1,1605 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.02", + "rpc": "listpeerchannels", + "title": "Command returning data on channels of connected lightning nodes", + "description": [ + "The **listpeerchannels** RPC command returns data on channels of the network, with the possibility to filter the channels by node id.", + "", + "If no *id* is supplied, then channel data on all lightning nodes that are connected, or not connected but have open channels with this node, are returned." + ], + "request": { + "required": [], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "If supplied, limits the channels to just the peer with the given ID, if it exists." + ] + } + } + }, + "response": { + "required": [ + "channels" + ], + "properties": { + "channels": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "state", + "opener", + "features", + "peer_connected", + "peer_id" + ], + "properties": { + "peer_id": { + "type": "pubkey", + "description": [ + "Node Public key." + ] + }, + "peer_connected": { + "type": "boolean", + "description": [ + "A boolean flag that is set to true if the peer is online." + ] + }, + "reestablished": { + "type": "boolean", + "added": "v24.02", + "description": [ + "A boolean flag that is set to true if we have successfully exchanged reestablish messages with this connection." + ] + }, + "state": { + "type": "string", + "enum": [ + "OPENINGD", + "CHANNELD_AWAITING_LOCKIN", + "CHANNELD_NORMAL", + "CHANNELD_SHUTTING_DOWN", + "CLOSINGD_SIGEXCHANGE", + "CLOSINGD_COMPLETE", + "AWAITING_UNILATERAL", + "FUNDING_SPEND_SEEN", + "ONCHAIN", + "DUALOPEND_OPEN_INIT", + "DUALOPEND_AWAITING_LOCKIN", + "CHANNELD_AWAITING_SPLICE", + "DUALOPEND_OPEN_COMMITTED", + "DUALOPEND_OPEN_COMMIT_READY" + ], + "description": [ + "The channel state, in particular `CHANNELD_NORMAL` means the channel can be used normally." + ] + }, + "scratch_txid": { + "type": "txid", + "description": [ + "The txid we would use if we went onchain now." + ] + }, + "channel_type": { + "type": "object", + "description": [ + "Channel_type as negotiated with peer." + ], + "added": "v23.05", + "additionalProperties": false, + "required": [ + "bits", + "names" + ], + "properties": { + "bits": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + }, + "names": { + "type": "array", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "items": { + "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" + ], + "description": [ + "Name of feature bit." + ] + } + } + } + }, + "updates": { + "type": "object", + "added": "v24.02", + "description": [ + "Latest gossip updates sent/received." + ], + "additionalProperties": false, + "required": [ + "local" + ], + "properties": { + "local": { + "type": "object", + "description": [ + "Our gossip for channel." + ], + "additionalProperties": false, + "added": "v24.02", + "required": [ + "htlc_minimum_msat", + "htlc_maximum_msat", + "cltv_expiry_delta", + "fee_base_msat", + "fee_proportional_millionths" + ], + "properties": { + "htlc_minimum_msat": { + "type": "msat", + "added": "v24.02", + "description": [ + "Minimum msat amount we allow." + ] + }, + "htlc_maximum_msat": { + "type": "msat", + "added": "v24.02", + "description": [ + "Maximum msat amount we allow." + ] + }, + "cltv_expiry_delta": { + "type": "u32", + "added": "v24.02", + "description": [ + "Blocks delay required between incoming and outgoing HTLCs." + ] + }, + "fee_base_msat": { + "type": "msat", + "added": "v24.02", + "description": [ + "Amount we charge to use the channel." + ] + }, + "fee_proportional_millionths": { + "type": "u32", + "added": "v24.02", + "description": [ + "Amount we charge to use the channel in parts-per-million." + ] + } + } + }, + "remote": { + "type": "object", + "added": "v24.02", + "description": [ + "Peer's gossip for channel." + ], + "additionalProperties": false, + "required": [ + "htlc_minimum_msat", + "htlc_maximum_msat", + "cltv_expiry_delta", + "fee_base_msat", + "fee_proportional_millionths" + ], + "properties": { + "htlc_minimum_msat": { + "type": "msat", + "added": "v24.02", + "description": [ + "Minimum msat amount they allow." + ] + }, + "htlc_maximum_msat": { + "type": "msat", + "added": "v24.02", + "description": [ + "Maximum msat amount they allow." + ] + }, + "cltv_expiry_delta": { + "type": "u32", + "added": "v24.02", + "description": [ + "Blocks delay required between incoming and outgoing HTLCs." + ] + }, + "fee_base_msat": { + "type": "msat", + "added": "v24.02", + "description": [ + "Amount they charge to use the channel." + ] + }, + "fee_proportional_millionths": { + "type": "u32", + "added": "v24.02", + "description": [ + "Amount they charge to use the channel in parts-per-million." + ] + } + } + } + } + }, + "ignore_fee_limits": { + "type": "boolean", + "added": "v23.08", + "description": [ + "Set if we allow this peer to set fees to anything they want." + ] + }, + "lost_state": { + "type": "boolean", + "added": "v24.02", + "description": [ + "Set if we are fallen behind i.e. lost some channel state." + ] + }, + "feerate": { + "type": "object", + "description": [ + "Feerates for the current tx." + ], + "additionalProperties": false, + "required": [ + "perkw", + "perkb" + ], + "properties": { + "perkw": { + "type": "u32", + "description": [ + "Feerate per 1000 weight (i.e kSipa)." + ] + }, + "perkb": { + "type": "u32", + "description": [ + "Feerate per 1000 virtual bytes." + ] + } + } + }, + "owner": { + "type": "string", + "description": [ + "The current subdaemon controlling this connection." + ] + }, + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "The short_channel_id (once locked in)." + ] + }, + "channel_id": { + "type": "hash", + "description": [ + "The full channel_id (funding txid Xored with output number)." + ] + }, + "funding_txid": { + "type": "txid", + "description": [ + "ID of the funding transaction." + ] + }, + "funding_outnum": { + "type": "u32", + "description": [ + "The 0-based output number of the funding transaction which opens the channel." + ] + }, + "initial_feerate": { + "type": "string", + "description": [ + "For inflight opens, the first feerate used to initiate the channel open." + ] + }, + "last_feerate": { + "type": "string", + "description": [ + "For inflight opens, the most recent feerate used on the channel open." + ] + }, + "next_feerate": { + "type": "string", + "description": [ + "For inflight opens, the next feerate we'll use for the channel open." + ] + }, + "next_fee_step": { + "type": "u32", + "description": [ + "For inflight opens, the next feerate step we'll use for the channel open." + ] + }, + "inflight": { + "type": "array", + "description": [ + "Current candidate funding transactions." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "funding_txid", + "funding_outnum", + "feerate", + "total_funding_msat", + "splice_amount", + "our_funding_msat" + ], + "properties": { + "funding_txid": { + "type": "txid", + "description": [ + "ID of the funding transaction." + ] + }, + "funding_outnum": { + "type": "u32", + "description": [ + "The 0-based output number of the funding transaction which opens the channel." + ] + }, + "feerate": { + "type": "string", + "description": [ + "The feerate for this funding transaction in per-1000-weight, with `kpw` appended." + ] + }, + "total_funding_msat": { + "type": "msat", + "description": [ + "Total amount in the channel." + ] + }, + "splice_amount": { + "type": "integer", + "added": "v23.08", + "description": [ + "The amouont of sats we're splicing in or out." + ] + }, + "our_funding_msat": { + "type": "msat", + "description": [ + "Amount we have in the channel." + ] + }, + "scratch_txid": { + "type": "txid", + "description": [ + "The commitment transaction txid we would use if we went onchain now." + ] + } + } + } + }, + "close_to": { + "type": "hex", + "description": [ + "ScriptPubkey which we have to close to if we mutual close." + ] + }, + "private": { + "type": "boolean", + "description": [ + "If True, we will not announce this channel." + ] + }, + "opener": { + "type": "string", + "enum": [ + "local", + "remote" + ], + "description": [ + "Who initiated the channel." + ] + }, + "closer": { + "type": "string", + "enum": [ + "local", + "remote" + ], + "description": [ + "Who initiated the channel close (only present if closing)." + ] + }, + "features": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "option_static_remotekey", + "option_anchor_outputs", + "option_anchors_zero_fee_htlc_tx", + "option_scid_alias", + "option_zeroconf" + ], + "description": [ + "BOLT #9 features which apply to this channel." + ] + } + }, + "funding": { + "type": "object", + "additionalProperties": false, + "required": [ + "local_funds_msat", + "remote_funds_msat" + ], + "properties": { + "pushed_msat": { + "type": "msat", + "description": [ + "Amount pushed from opener to peer." + ] + }, + "local_funds_msat": { + "type": "msat", + "description": [ + "Amount of channel we funded." + ] + }, + "remote_funds_msat": { + "type": "msat", + "description": [ + "Amount of channel they funded." + ] + }, + "fee_paid_msat": { + "type": "msat", + "description": [ + "Amount we paid peer at open." + ] + }, + "fee_rcvd_msat": { + "type": "msat", + "description": [ + "Amount we were paid by peer at open." + ] + } + } + }, + "to_us_msat": { + "type": "msat", + "description": [ + "How much of channel is owed to us." + ] + }, + "min_to_us_msat": { + "type": "msat", + "description": [ + "Least amount owed to us ever. If the peer were to successfully steal from us, this is the amount we would still retain." + ] + }, + "max_to_us_msat": { + "type": "msat", + "description": [ + "Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get." + ] + }, + "total_msat": { + "type": "msat", + "description": [ + "Total amount in the channel." + ] + }, + "fee_base_msat": { + "type": "msat", + "description": [ + "Amount we charge to use the channel." + ] + }, + "fee_proportional_millionths": { + "type": "u32", + "description": [ + "Amount we charge to use the channel in parts-per-million." + ] + }, + "dust_limit_msat": { + "type": "msat", + "description": [ + "Minimum amount for an output on the channel transactions." + ] + }, + "max_total_htlc_in_msat": { + "type": "msat", + "description": [ + "Max amount accept in a single payment." + ] + }, + "their_reserve_msat": { + "type": "msat", + "description": [ + "Minimum we insist they keep in channel. If they have less than this in the channel, they cannot send to us on that channel." + ], + "default": "1% of the total channel capacity" + }, + "our_reserve_msat": { + "type": "msat", + "description": [ + "Minimum they insist we keep in channel. If you have less than this in the channel, you cannot send out via this channel." + ] + }, + "spendable_msat": { + "type": "msat", + "description": [ + "An estimate of the total we could send through channel (can be wrong because adding HTLCs requires an increase in fees paid to onchain miners, and onchain fees change dynamically according to onchain activity)." + ] + }, + "receivable_msat": { + "type": "msat", + "description": [ + "An estimate of the total peer could send through channel." + ] + }, + "minimum_htlc_in_msat": { + "type": "msat", + "description": [ + "The minimum amount HTLC we accept." + ] + }, + "minimum_htlc_out_msat": { + "type": "msat", + "description": [ + "The minimum amount HTLC we will send." + ] + }, + "maximum_htlc_out_msat": { + "type": "msat", + "description": [ + "The maximum amount HTLC we will send." + ] + }, + "their_to_self_delay": { + "type": "u32", + "description": [ + "The number of blocks before they can take their funds if they unilateral close." + ] + }, + "our_to_self_delay": { + "type": "u32", + "description": [ + "The number of blocks before we can take our funds if we unilateral close." + ] + }, + "max_accepted_htlcs": { + "type": "u32", + "description": [ + "Maximum number of incoming HTLC we will accept at once." + ] + }, + "alias": { + "type": "object", + "required": [], + "properties": { + "local": { + "type": "short_channel_id", + "description": [ + "An alias assigned by this node to this channel, used for outgoing payments." + ] + }, + "remote": { + "type": "short_channel_id", + "description": [ + "An alias assigned by the remote node to this channel, usable in routehints and invoices." + ] + } + } + }, + "state_changes": { + "type": "array", + "description": [ + "Prior state changes." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "timestamp", + "old_state", + "new_state", + "cause", + "message" + ], + "properties": { + "timestamp": { + "type": "string", + "description": [ + "UTC timestamp of form YYYY-mm-ddTHH:MM:SS.%03dZ." + ] + }, + "old_state": { + "type": "string", + "enum": [ + "OPENINGD", + "CHANNELD_AWAITING_LOCKIN", + "CHANNELD_NORMAL", + "CHANNELD_SHUTTING_DOWN", + "CLOSINGD_SIGEXCHANGE", + "CLOSINGD_COMPLETE", + "AWAITING_UNILATERAL", + "FUNDING_SPEND_SEEN", + "ONCHAIN", + "DUALOPEND_OPEN_INIT", + "DUALOPEND_AWAITING_LOCKIN", + "DUALOPEND_OPEN_COMMITTED", + "DUALOPEND_OPEN_COMMIT_READY", + "CHANNELD_AWAITING_SPLICE" + ], + "description": [ + "Previous state." + ] + }, + "new_state": { + "type": "string", + "enum": [ + "OPENINGD", + "CHANNELD_AWAITING_LOCKIN", + "CHANNELD_NORMAL", + "CHANNELD_SHUTTING_DOWN", + "CLOSINGD_SIGEXCHANGE", + "CLOSINGD_COMPLETE", + "AWAITING_UNILATERAL", + "FUNDING_SPEND_SEEN", + "ONCHAIN", + "DUALOPEND_OPEN_INIT", + "DUALOPEND_AWAITING_LOCKIN", + "DUALOPEND_OPEN_COMMITTED", + "DUALOPEND_OPEN_COMMIT_READY", + "CHANNELD_AWAITING_SPLICE" + ], + "description": [ + "New state." + ] + }, + "cause": { + "type": "string", + "enum": [ + "unknown", + "local", + "user", + "remote", + "protocol", + "onchain" + ], + "description": [ + "What caused the change." + ] + }, + "message": { + "type": "string", + "description": [ + "Human-readable explanation." + ] + } + } + } + }, + "status": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Billboard log of significant changes." + ] + } + }, + "in_payments_offered": { + "type": "u64", + "description": [ + "Number of incoming payment attempts." + ] + }, + "in_offered_msat": { + "type": "msat", + "description": [ + "Total amount of incoming payment attempts." + ] + }, + "in_payments_fulfilled": { + "type": "u64", + "description": [ + "Number of successful incoming payment attempts." + ] + }, + "in_fulfilled_msat": { + "type": "msat", + "description": [ + "Total amount of successful incoming payment attempts." + ] + }, + "out_payments_offered": { + "type": "u64", + "description": [ + "Number of outgoing payment attempts." + ] + }, + "out_offered_msat": { + "type": "msat", + "description": [ + "Total amount of outgoing payment attempts." + ] + }, + "out_payments_fulfilled": { + "type": "u64", + "description": [ + "Number of successful outgoing payment attempts." + ] + }, + "out_fulfilled_msat": { + "type": "msat", + "description": [ + "Total amount of successful outgoing payment attempts." + ] + }, + "last_stable_connection": { + "type": "u64", + "added": "v24.02", + "description": [ + "Last time we reestablished the open channel and stayed connected for 1 minute." + ] + }, + "htlcs": { + "type": "array", + "description": [ + "Current HTLCs in this channel." + ], + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "direction", + "id", + "amount_msat", + "expiry", + "payment_hash", + "state" + ], + "properties": { + "direction": { + "type": "string", + "added": "v23.02", + "enum": [ + "in", + "out" + ], + "description": [ + "Whether it came from peer, or is going to peer." + ] + }, + "id": { + "type": "u64", + "description": [ + "Unique ID for this htlc on this channel in this direction." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount send/received for this HTLC." + ] + }, + "expiry": { + "type": "u32", + "description": [ + "Block this HTLC expires at (after which an `in` direction HTLC will be returned to the peer, an `out` returned to us). If this expiry is too close, lightningd(8) will automatically unilaterally close the channel in order to enforce the timeout onchain." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the payment_preimage which will prove payment." + ] + }, + "local_trimmed": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "If this is too small to enforce onchain; it doesn't appear in the commitment transaction and will not be enforced in a unilateral close. Generally true if the HTLC (after subtracting onchain fees) is below the `dust_limit_msat` for the channel." + ] + }, + "status": { + "type": "string", + "description": [ + "Set if this HTLC is currently waiting on a hook (and shows what plugin)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "direction": { + "enum": [ + "out" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "state" + ], + "properties": { + "direction": {}, + "id": {}, + "amount_msat": {}, + "msatoshi": {}, + "expiry": {}, + "payment_hash": {}, + "local_trimmed": {}, + "status": {}, + "alias": {}, + "peer_id": {}, + "peer_connected": {}, + "reestablished": {}, + "state": { + "type": "string", + "enum": [ + "SENT_ADD_HTLC", + "SENT_ADD_COMMIT", + "RCVD_ADD_REVOCATION", + "RCVD_ADD_ACK_COMMIT", + "SENT_ADD_ACK_REVOCATION", + "RCVD_REMOVE_HTLC", + "RCVD_REMOVE_COMMIT", + "SENT_REMOVE_REVOCATION", + "SENT_REMOVE_ACK_COMMIT", + "RCVD_REMOVE_ACK_REVOCATION" + ], + "description": [ + "Status of the HTLC." + ] + } + } + } + }, + { + "if": { + "properties": { + "direction": { + "enum": [ + "in" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "state" + ], + "properties": { + "direction": {}, + "id": {}, + "amount_msat": {}, + "msatoshi": {}, + "expiry": {}, + "payment_hash": {}, + "local_trimmed": {}, + "status": {}, + "peer_id": {}, + "peer_connected": {}, + "reestablished": {}, + "state": { + "type": "string", + "enum": [ + "RCVD_ADD_HTLC", + "RCVD_ADD_COMMIT", + "SENT_ADD_REVOCATION", + "SENT_ADD_ACK_COMMIT", + "RCVD_ADD_ACK_REVOCATION", + "SENT_REMOVE_HTLC", + "SENT_REMOVE_COMMIT", + "RCVD_REMOVE_REVOCATION", + "RCVD_REMOVE_ACK_COMMIT", + "SENT_REMOVE_ACK_REVOCATION" + ], + "description": [ + "Status of the HTLC." + ] + } + } + } + } + ] + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "peer_connected": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "properties": { + "reestablished": { + "type": "boolean", + "description": [ + "True if we have successfully exchanged reestablish messages this connection." + ] + } + } + } + }, + { + "if": { + "required": [ + "close_to" + ] + }, + "then": { + "additionalProperties": false, + "required": [], + "properties": { + "state": {}, + "peer_id": {}, + "peer_connected": {}, + "reestablished": {}, + "scratch_txid": {}, + "channel_type": {}, + "feerate": {}, + "ignore_fee_limits": {}, + "lost_state": {}, + "owner": {}, + "short_channel_id": {}, + "channel_id": {}, + "updates": {}, + "funding_txid": {}, + "funding_outnum": {}, + "close_to": {}, + "private": {}, + "alias": {}, + "opener": {}, + "closer": {}, + "features": {}, + "funding": {}, + "to_us_msat": {}, + "min_to_us_msat": {}, + "max_to_us_msat": {}, + "total_msat": {}, + "fee_base_msat": {}, + "fee_proportional_millionths": {}, + "dust_limit_msat": {}, + "max_total_htlc_in_msat": {}, + "their_reserve_msat": {}, + "our_reserve_msat": {}, + "spendable_msat": {}, + "receivable_msat": {}, + "minimum_htlc_in_msat": {}, + "minimum_htlc_out_msat": {}, + "maximum_htlc_out_msat": {}, + "spendable_msatoshi": {}, + "receivable_msatoshi": {}, + "their_to_self_delay": {}, + "our_to_self_delay": {}, + "max_accepted_htlcs": {}, + "msatoshi_to_us": {}, + "msatoshi_to_us_min": {}, + "msatoshi_to_us_max": {}, + "msatoshi_total": {}, + "dust_limit_satoshis": {}, + "max_htlc_value_in_flight_msat": {}, + "our_channel_reserve_satoshis": {}, + "their_channel_reserve_satoshis": {}, + "spendable_satoshis": {}, + "receivable_satoshis": {}, + "htlc_minimum_msat": {}, + "state_changes": {}, + "status": {}, + "in_payments_offered": {}, + "in_offered_msat": {}, + "in_msatoshi_offered": {}, + "in_payments_fulfilled": {}, + "in_fulfilled_msat": {}, + "in_msatoshi_fulfilled": {}, + "out_payments_offered": {}, + "out_offered_msat": {}, + "out_msatoshi_offered": {}, + "out_payments_fulfilled": {}, + "out_fulfilled_msat": {}, + "out_msatoshi_fulfilled": {}, + "last_stable_connection": {}, + "htlcs": {}, + "initial_feerate": {}, + "last_feerate": {}, + "next_feerate": {}, + "inflight": {}, + "last_tx_fee_msat": {}, + "direction": {}, + "close_to_addr": { + "type": "string", + "description": [ + "The bitcoin address we will close to (present if close_to_addr is a standardized address)." + ] + } + } + } + }, + { + "if": { + "required": [ + "scratch_txid" + ] + }, + "then": { + "additionalProperties": false, + "required": [ + "last_tx_fee_msat" + ], + "properties": { + "state": {}, + "peer_id": {}, + "peer_connected": {}, + "reestablished": {}, + "alias": {}, + "scratch_txid": {}, + "channel_type": {}, + "feerate": {}, + "ignore_fee_limits": {}, + "lost_state": {}, + "owner": {}, + "short_channel_id": {}, + "channel_id": {}, + "updates": {}, + "funding_txid": {}, + "funding_outnum": {}, + "inflight": {}, + "close_to": {}, + "private": {}, + "opener": {}, + "closer": {}, + "features": {}, + "funding": {}, + "to_us_msat": {}, + "min_to_us_msat": {}, + "max_to_us_msat": {}, + "total_msat": {}, + "fee_base_msat": {}, + "fee_proportional_millionths": {}, + "dust_limit_msat": {}, + "max_total_htlc_in_msat": {}, + "their_reserve_msat": {}, + "our_reserve_msat": {}, + "spendable_msat": {}, + "receivable_msat": {}, + "minimum_htlc_in_msat": {}, + "minimum_htlc_out_msat": {}, + "maximum_htlc_out_msat": {}, + "spendable_msatoshi": {}, + "receivable_msatoshi": {}, + "their_to_self_delay": {}, + "our_to_self_delay": {}, + "max_accepted_htlcs": {}, + "msatoshi_to_us": {}, + "msatoshi_to_us_min": {}, + "msatoshi_to_us_max": {}, + "msatoshi_total": {}, + "dust_limit_satoshis": {}, + "max_htlc_value_in_flight_msat": {}, + "our_channel_reserve_satoshis": {}, + "their_channel_reserve_satoshis": {}, + "spendable_satoshis": {}, + "receivable_satoshis": {}, + "htlc_minimum_msat": {}, + "state_changes": {}, + "status": {}, + "in_payments_offered": {}, + "in_offered_msat": {}, + "in_msatoshi_offered": {}, + "in_payments_fulfilled": {}, + "in_fulfilled_msat": {}, + "in_msatoshi_fulfilled": {}, + "out_payments_offered": {}, + "out_offered_msat": {}, + "out_msatoshi_offered": {}, + "out_payments_fulfilled": {}, + "out_fulfilled_msat": {}, + "out_msatoshi_fulfilled": {}, + "last_stable_connection": {}, + "htlcs": {}, + "initial_feerate": {}, + "last_feerate": {}, + "next_feerate": {}, + "close_to_addr": {}, + "direction": {}, + "last_tx_fee_msat": { + "type": "msat", + "description": [ + "Fee attached to this the current tx." + ] + } + } + } + }, + { + "if": { + "required": [ + "short_channel_id" + ] + }, + "then": { + "additionalProperties": false, + "required": [ + "direction" + ], + "properties": { + "alias": {}, + "peer_id": {}, + "peer_connected": {}, + "reestablished": {}, + "state": {}, + "scratch_txid": {}, + "channel_type": {}, + "feerate": {}, + "ignore_fee_limits": {}, + "lost_state": {}, + "owner": {}, + "short_channel_id": {}, + "channel_id": {}, + "updates": {}, + "funding_txid": {}, + "funding_outnum": {}, + "inflight": {}, + "close_to": {}, + "private": {}, + "opener": {}, + "closer": {}, + "features": {}, + "funding": {}, + "to_us_msat": {}, + "min_to_us_msat": {}, + "max_to_us_msat": {}, + "total_msat": {}, + "fee_base_msat": {}, + "fee_proportional_millionths": {}, + "dust_limit_msat": {}, + "max_total_htlc_in_msat": {}, + "their_reserve_msat": {}, + "our_reserve_msat": {}, + "spendable_msat": {}, + "receivable_msat": {}, + "minimum_htlc_in_msat": {}, + "minimum_htlc_out_msat": {}, + "maximum_htlc_out_msat": {}, + "spendable_msatoshi": {}, + "receivable_msatoshi": {}, + "their_to_self_delay": {}, + "our_to_self_delay": {}, + "max_accepted_htlcs": {}, + "msatoshi_to_us": {}, + "msatoshi_to_us_min": {}, + "msatoshi_to_us_max": {}, + "msatoshi_total": {}, + "dust_limit_satoshis": {}, + "max_htlc_value_in_flight_msat": {}, + "our_channel_reserve_satoshis": {}, + "their_channel_reserve_satoshis": {}, + "spendable_satoshis": {}, + "receivable_satoshis": {}, + "htlc_minimum_msat": {}, + "state_changes": {}, + "status": {}, + "in_payments_offered": {}, + "in_offered_msat": {}, + "in_msatoshi_offered": {}, + "in_payments_fulfilled": {}, + "in_fulfilled_msat": {}, + "in_msatoshi_fulfilled": {}, + "out_payments_offered": {}, + "out_offered_msat": {}, + "out_msatoshi_offered": {}, + "out_payments_fulfilled": {}, + "out_fulfilled_msat": {}, + "out_msatoshi_fulfilled": {}, + "last_stable_connection": {}, + "htlcs": {}, + "initial_feerate": {}, + "last_feerate": {}, + "next_feerate": {}, + "close_to_addr": {}, + "last_tx_fee_msat": {}, + "direction": { + "type": "u32", + "added": "v23.02", + "description": [ + "0 if we're the lesser node_id, 1 if we're the greater (as used in BOLT #7 channel_update)." + ] + } + } + } + }, + { + "if": { + "required": [ + "inflight" + ] + }, + "then": { + "additionalProperties": false, + "required": [ + "initial_feerate", + "last_feerate", + "next_feerate" + ], + "properties": { + "state": {}, + "peer_id": {}, + "peer_connected": {}, + "reestablished": {}, + "scratch_txid": {}, + "channel_type": {}, + "feerate": {}, + "ignore_fee_limits": {}, + "lost_state": {}, + "owner": {}, + "alias": {}, + "short_channel_id": {}, + "channel_id": {}, + "updates": {}, + "funding_txid": {}, + "funding_outnum": {}, + "close_to": {}, + "private": {}, + "opener": {}, + "closer": {}, + "features": {}, + "funding": {}, + "to_us_msat": {}, + "min_to_us_msat": {}, + "max_to_us_msat": {}, + "total_msat": {}, + "fee_base_msat": {}, + "fee_proportional_millionths": {}, + "dust_limit_msat": {}, + "max_total_htlc_in_msat": {}, + "their_reserve_msat": {}, + "our_reserve_msat": {}, + "spendable_msat": {}, + "receivable_msat": {}, + "minimum_htlc_in_msat": {}, + "minimum_htlc_out_msat": {}, + "maximum_htlc_out_msat": {}, + "spendable_msatoshi": {}, + "receivable_msatoshi": {}, + "their_to_self_delay": {}, + "our_to_self_delay": {}, + "max_accepted_htlcs": {}, + "msatoshi_to_us": {}, + "msatoshi_to_us_min": {}, + "msatoshi_to_us_max": {}, + "msatoshi_total": {}, + "dust_limit_satoshis": {}, + "max_htlc_value_in_flight_msat": {}, + "our_channel_reserve_satoshis": {}, + "their_channel_reserve_satoshis": {}, + "spendable_satoshis": {}, + "receivable_satoshis": {}, + "htlc_minimum_msat": {}, + "state_changes": {}, + "status": {}, + "in_payments_offered": {}, + "in_offered_msat": {}, + "in_msatoshi_offered": {}, + "in_payments_fulfilled": {}, + "in_fulfilled_msat": {}, + "in_msatoshi_fulfilled": {}, + "out_payments_offered": {}, + "out_offered_msat": {}, + "out_msatoshi_offered": {}, + "out_payments_fulfilled": {}, + "out_fulfilled_msat": {}, + "out_msatoshi_fulfilled": {}, + "last_stable_connection": {}, + "htlcs": {}, + "inflight": {}, + "close_to_addr": {}, + "direction": {}, + "last_tx_fee_msat": {}, + "initial_feerate": { + "type": "string", + "description": [ + "The feerate for the initial funding transaction in per-1000-weight, with `kpw` appended." + ] + }, + "last_feerate": { + "type": "string", + "description": [ + "The feerate for the latest funding transaction in per-1000-weight, with `kpw` appended." + ] + }, + "next_feerate": { + "type": "string", + "description": [ + "The minimum feerate for the next funding transaction in per-1000-weight, with `kpw` appended." + ] + } + } + } + } + ] + } + } + }, + "post_return_value_notes": [ + "The *state* field values (and *old_state* / *new_state*) are worth describing further:", + "", + " * `OPENINGD`: The channel funding protocol with the peer is ongoing and both sides are negotiating parameters.", + " * `DUALOPEND_OPEN_INIT`: Like `OPENINGD`, but for v2 connections which are using collaborative opens.", + " * `DUALOPEND_OPEN_COMMIT_READY`: Like `OPENINGD`, but for v2 connections which are using collaborative opens. You're ready to send your commitment signed to your peer.", + " * `DUALOPEND_OPEN_COMMITTED`: Like `OPENINGD`, but for v2 connections which are using collaborative opens. You've gotten an initial signed commitment from your peer.", + " * `CHANNELD_AWAITING_LOCKIN` / `DUALOPEND_AWAITING_LOCKIN`: The peer and you have agreed on channel parameters and are just waiting for the channel funding transaction to be confirmed deeply (original and collaborative open protocols, respectively). Both you and the peer must acknowledge the channel funding transaction to be confirmed deeply before entering the next state. Also, you can increase the onchain fee for channels in `DUALOPEND_AWAITING_LOCKIN` using lightning-openchannel_bump(7).", + " * `CHANNELD_NORMAL`: The channel can be used for normal payments.", + " * `CHANNELD_SHUTTING_DOWN`: A mutual close was requested (by you or peer) and both of you are waiting for HTLCs in-flight to be either failed or succeeded. The channel can no longer be used for normal payments and forwarding. Mutual close will proceed only once all HTLCs in the channel have either been fulfilled or failed.", + " * `CLOSINGD_SIGEXCHANGE`: You and the peer are negotiating the mutual close onchain fee.", + " * `CLOSINGD_COMPLETE`: You and the peer have agreed on the mutual close onchain fee and are awaiting the mutual close getting confirmed deeply.", + " * `AWAITING_UNILATERAL`: You initiated a unilateral close, and are now waiting for the peer-selected unilateral close timeout to complete.", + " * `FUNDING_SPEND_SEEN`: You saw the funding transaction getting spent (usually the peer initiated a unilateral close) and will now determine what exactly happened (i.e. if it was a theft attempt).", + " * `ONCHAIN`: You saw the funding transaction getting spent and now know what happened (i.e. if it was a proper unilateral close by the peer, or a theft attempt)." + ] + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong." + ], + "example_json_request": [ + { + "id": "example:listpeerchannels#1", + "method": "listpeerchannels", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" + } + }, + { + "id": "example:listpeerchannels#2", + "method": "listpeerchannels", + "params": { + "id": null + } + } + ], + "example_json_response": [ + { + "channels": [ + { + "peer_id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "peer_connected": true, + "channel_type": { + "bits": [ + 12 + ], + "names": [ + "static_remotekey/even" + ] + }, + "updates": { + "local": { + "htlc_minimum_msat": 0, + "htlc_maximum_msat": 990000000, + "cltv_expiry_delta": 6, + "fee_base_msat": 1, + "fee_proportional_millionths": 10 + } + }, + "state": "CHANNELD_AWAITING_LOCKIN", + "scratch_txid": "4e9c2866b9ae1f765b89ea7ec37428c900ea97f717f85f00e3db852cb6aea3a8", + "last_tx_fee_msat": 5430000, + "feerate": { + "perkw": 7500, + "perkb": 30000 + }, + "owner": "channeld", + "direction": 1, + "channel_id": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "funding_txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b", + "funding_outnum": 0, + "close_to_addr": "bcrt1pamt5tqzd49uyessr7437l2vllf20muqmzdauje8x8scjgpc0l0nqhyqcyp", + "close_to": "5120eed745804da9784cc203f563efa99ffa54fdf01b137bc964e63c3124070ffbe6", + "private": false, + "opener": "local", + "alias": { + "local": "5589251x14022525x17398" + }, + "features": [ + "option_static_remotekey" + ], + "funding": { + "local_funds_msat": 1000000000, + "remote_funds_msat": 0, + "pushed_msat": 0 + }, + "to_us_msat": 1000000000, + "min_to_us_msat": 1000000000, + "max_to_us_msat": 1000000000, + "total_msat": 1000000000, + "fee_base_msat": 1, + "fee_proportional_millionths": 10, + "dust_limit_msat": 546000, + "max_total_htlc_in_msat": 18446744073709552000, + "their_reserve_msat": 10000000, + "our_reserve_msat": 10000000, + "spendable_msat": 973980000, + "receivable_msat": 0, + "minimum_htlc_in_msat": 0, + "minimum_htlc_out_msat": 0, + "maximum_htlc_out_msat": 990000000, + "their_to_self_delay": 5, + "our_to_self_delay": 5, + "max_accepted_htlcs": 483, + "state_changes": [], + "status": [], + "in_payments_offered": 0, + "in_offered_msat": 0, + "in_payments_fulfilled": 0, + "in_fulfilled_msat": 0, + "out_payments_offered": 0, + "out_offered_msat": 0, + "out_payments_fulfilled": 0, + "out_fulfilled_msat": 0, + "htlcs": [] + } + ] + }, + { + "channels": [ + { + "peer_id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "peer_connected": true, + "reestablished": true, + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "updates": { + "local": { + "htlc_minimum_msat": 0, + "htlc_maximum_msat": 990000000, + "cltv_expiry_delta": 6, + "fee_base_msat": 1, + "fee_proportional_millionths": 10 + }, + "remote": { + "htlc_minimum_msat": 0, + "htlc_maximum_msat": 990000000, + "cltv_expiry_delta": 6, + "fee_base_msat": 1, + "fee_proportional_millionths": 10 + } + }, + "state": "CHANNELD_NORMAL", + "scratch_txid": "ece66657d6203a4ea77807f566fd5b98a78b659f0cd59ce9200aa3bd6875ee25", + "last_tx_fee_msat": 4545000, + "lost_state": false, + "feerate": { + "perkw": 3750, + "perkb": 15000 + }, + "owner": "channeld", + "short_channel_id": "103x1x0", + "direction": 1, + "channel_id": "def5ef03e0d36ed65de814c0a8d6599a502fe1afb8e956529320bb350e876b5f", + "funding_txid": "5f6b870e35bb20935256e9b8afe12f509a59d6a8c014e85dd66ed3e003eff5de", + "funding_outnum": 0, + "close_to_addr": "bcrt1pamt5tqzd49uyessr7437l2vllf20muqmzdauje8x8scjgpc0l0nqhyqcyp", + "close_to": "5120eed745804da9784cc203f563efa99ffa54fdf01b137bc964e63c3124070ffbe6", + "private": false, + "opener": "local", + "alias": { + "local": "15447035x5589520x8959", + "remote": "6036590x13481428x5501" + }, + "features": [ + "option_static_remotekey", + "option_anchors_zero_fee_htlc_tx" + ], + "funding": { + "local_funds_msat": 1000000000, + "remote_funds_msat": 0, + "pushed_msat": 0 + }, + "to_us_msat": 1000000000, + "min_to_us_msat": 1000000000, + "max_to_us_msat": 1000000000, + "total_msat": 1000000000, + "fee_base_msat": 1, + "fee_proportional_millionths": 10, + "dust_limit_msat": 546000, + "max_total_htlc_in_msat": 18446744073709552000, + "their_reserve_msat": 10000000, + "our_reserve_msat": 10000000, + "spendable_msat": 978330000, + "receivable_msat": 0, + "minimum_htlc_in_msat": 0, + "minimum_htlc_out_msat": 0, + "maximum_htlc_out_msat": 990000000, + "their_to_self_delay": 5, + "our_to_self_delay": 5, + "max_accepted_htlcs": 483, + "state_changes": [ + { + "timestamp": "2024-02-22T17:48:57.127Z", + "old_state": "CHANNELD_AWAITING_LOCKIN", + "new_state": "CHANNELD_NORMAL", + "cause": "user", + "message": "Lockin complete" + } + ], + "status": [ + "CHANNELD_NORMAL:Channel ready for use." + ], + "in_payments_offered": 0, + "in_offered_msat": 0, + "in_payments_fulfilled": 0, + "in_fulfilled_msat": 0, + "out_payments_offered": 0, + "out_offered_msat": 0, + "out_payments_fulfilled": 0, + "out_fulfilled_msat": 0, + "htlcs": [] + } + ] + } + ], + "author": [ + "Michael Hawkins <>." + ], + "see_also": [ + "lightning-connect(7)", + "lightning-fundchannel_start(7)" + ], + "resources": [ + "Main web site: ", + "Lightning RFC site (BOLT #9): ", + "" + ] +} diff --git a/doc/schemas/lightning-listpeers.json b/doc/schemas/lightning-listpeers.json new file mode 100644 index 000000000000..d55232a91a51 --- /dev/null +++ b/doc/schemas/lightning-listpeers.json @@ -0,0 +1,1448 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listpeers", + "title": "Command returning data on connected lightning nodes", + "description": [ + "The **listpeers** RPC command returns data on nodes that are connected or are not connected but have open channels with this node.", + "", + "Once a connection to another lightning node has been established, using the **connect** command, data on the node can be returned using **listpeers** and the *id* that was used with the **connect** command.", + "", + "If no *id* is supplied, then data on all lightning nodes that are connected, or not connected but have open channels with this node, are returned.", + "", + "If a channel is open with a node and the connection has been lost, then the node will still appear in the output of the command and the value of the *connected* attribute of the node will be \"false\".", + "", + "The channel will remain open for a set blocktime, after which if the connection has not been re-established, the channel will close and the node will no longer appear in the command output." + ], + "request": { + "required": [], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "If supplied, limits the result to just the peer with the given ID, if it exists." + ] + }, + "level": { + "type": "string", + "description": [ + "Supplying level will show log entries related to that peer at the given log level." + ], + "enum": [ + "io", + "debug", + "info", + "unusual" + ] + } + } + }, + "response": { + "required": [ + "peers" + ], + "properties": { + "peers": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "id", + "connected", + "num_channels" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The unique id of the peer." + ] + }, + "connected": { + "type": "boolean", + "description": [ + "Value showing the connection status." + ] + }, + "num_channels": { + "type": "u32", + "description": [ + "The number of channels the peer has with this node." + ], + "added": "v23.02" + }, + "log": { + "type": "array", + "description": [ + "If *level* is specified, logs for this peer." + ], + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "SKIPPED", + "BROKEN", + "UNUSUAL", + "INFO", + "DEBUG", + "IO_IN", + "IO_OUT" + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "enum": [ + "SKIPPED" + ] + } + } + }, + "then": { + "type": "object", + "additionalProperties": false, + "required": [ + "num_skipped" + ], + "properties": { + "type": {}, + "num_skipped": { + "type": "u32", + "description": [ + "Number of deleted/omitted entries." + ] + } + } + } + }, + { + "if": { + "properties": { + "type": { + "enum": [ + "BROKEN", + "UNUSUAL", + "INFO", + "DEBUG" + ] + } + } + }, + "then": { + "type": "object", + "additionalProperties": false, + "required": [ + "time", + "source", + "log", + "node_id" + ], + "properties": { + "type": {}, + "time": { + "type": "string", + "description": [ + "UNIX timestamp with 9 decimal places." + ] + }, + "source": { + "type": "string", + "description": [ + "The particular logbook this was found in." + ] + }, + "log": { + "type": "string", + "description": [ + "The actual log message." + ] + }, + "node_id": { + "type": "pubkey", + "description": [ + "The peer this is associated with." + ] + } + } + } + }, + { + "if": { + "properties": { + "type": { + "enum": [ + "IO_IN", + "IO_OUT" + ] + } + } + }, + "then": { + "type": "object", + "additionalProperties": false, + "required": [ + "time", + "source", + "log", + "node_id", + "data" + ], + "properties": { + "type": {}, + "time": { + "type": "string", + "description": [ + "UNIX timestamp with 9 decimal places." + ] + }, + "source": { + "type": "string", + "description": [ + "The particular logbook this was found in." + ] + }, + "log": { + "type": "string", + "description": [ + "The actual log message." + ] + }, + "node_id": { + "type": "pubkey", + "description": [ + "The peer this is associated with." + ] + }, + "data": { + "type": "hex", + "description": [ + "The IO which occurred." + ] + } + } + } + } + ] + } + }, + "channels": { + "deprecated": [ + "v23.02", + "v24.02" + ], + "type": "array", + "description": [ + "Channels with this peer." + ], + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "state", + "opener", + "features" + ], + "properties": { + "state": { + "type": "string", + "enum": [ + "OPENINGD", + "CHANNELD_AWAITING_LOCKIN", + "CHANNELD_NORMAL", + "CHANNELD_SHUTTING_DOWN", + "CLOSINGD_SIGEXCHANGE", + "CLOSINGD_COMPLETE", + "AWAITING_UNILATERAL", + "FUNDING_SPEND_SEEN", + "ONCHAIN", + "DUALOPEND_OPEN_INIT", + "DUALOPEND_AWAITING_LOCKIN", + "DUALOPEND_OPEN_COMMITTED", + "DUALOPEND_OPEN_COMMIT_READY" + ], + "description": [ + "Current state of the channel:", + " * `OPENINGD`: The channel funding protocol with the peer is ongoing and both sides are negotiating parameters.", + " * `CHANNELD_AWAITING_LOCKIN`: The peer and you have agreed on channel parameters and are just waiting for the channel funding transaction to be confirmed deeply. Both you and the peer must acknowledge the channel funding transaction to be confirmed deeply before entering the next state.", + " * `CHANNELD_NORMAL`: The channel can be used for normal payments.", + " * `CHANNELD_SHUTTING_DOWN`: A mutual close was requested (by you or peer) and both of you are waiting for HTLCs in-flight to be either failed or succeeded. The channel can no longer be used for normal payments and forwarding. Mutual close will proceed only once all HTLCs in the channel have either been fulfilled or failed.", + " * `CLOSINGD_SIGEXCHANGE`: You and the peer are negotiating the mutual close onchain fee.", + " * `CLOSINGD_COMPLETE`: You and the peer have agreed on the mutual close onchain fee and are awaiting the mutual close getting confirmed deeply.", + " * `AWAITING_UNILATERAL`: You initiated a unilateral close, and are now waiting for the peer-selected unilateral close timeout to complete.", + " * `FUNDING_SPEND_SEEN`: You saw the funding transaction getting spent (usually the peer initiated a unilateral close) and will now determine what exactly happened (i.e. if it was a theft attempt).", + " * `ONCHAIN`: You saw the funding transaction getting spent and now know what happened (i.e. if it was a proper unilateral close by the peer, or a theft attempt).", + " * `CLOSED`: The channel closure has been confirmed deeply. The channel will eventually be removed from this array." + ] + }, + "scratch_txid": { + "type": "txid", + "description": [ + "The txid we would use if we went onchain now." + ] + }, + "feerate": { + "type": "object", + "description": [ + "Feerates for the current tx." + ], + "additionalProperties": false, + "required": [ + "perkw", + "perkb" + ], + "properties": { + "perkw": { + "type": "u32", + "description": [ + "Feerate per 1000 weight (i.e kSipa)." + ] + }, + "perkb": { + "type": "u32", + "description": [ + "Feerate per 1000 virtual bytes." + ] + } + } + }, + "owner": { + "type": "string", + "description": [ + "The current subdaemon controlling this connection." + ] + }, + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "The short_channel_id (once locked in)." + ] + }, + "channel_id": { + "type": "hash", + "description": [ + "The full channel_id (funding txid Xored with output number)." + ] + }, + "funding_txid": { + "type": "txid", + "description": [ + "ID of the funding transaction." + ] + }, + "funding_outnum": { + "type": "u32", + "description": [ + "The 0-based output number of the funding transaction which opens the channel." + ] + }, + "initial_feerate": { + "type": "string", + "description": [ + "For inflight opens, the first feerate used to initiate the channel open." + ] + }, + "last_feerate": { + "type": "string", + "description": [ + "For inflight opens, the most recent feerate used on the channel open." + ] + }, + "next_feerate": { + "type": "string", + "description": [ + "For inflight opens, the next feerate we'll use for the channel open." + ] + }, + "next_fee_step": { + "type": "u32", + "description": [ + "For inflight opens, the next feerate step we'll use for the channel open." + ] + }, + "inflight": { + "type": "array", + "description": [ + "Current candidate funding transactions." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "funding_txid", + "funding_outnum", + "feerate", + "total_funding_msat", + "our_funding_msat", + "splice_amount", + "scratch_txid" + ], + "properties": { + "funding_txid": { + "type": "txid", + "description": [ + "ID of the funding transaction." + ] + }, + "funding_outnum": { + "type": "u32", + "description": [ + "The 0-based output number of the funding transaction which opens the channel." + ] + }, + "feerate": { + "type": "string", + "description": [ + "The feerate for this funding transaction in per-1000-weight, with `kpw` appended." + ] + }, + "total_funding_msat": { + "type": "msat", + "description": [ + "Total amount in the channel." + ] + }, + "our_funding_msat": { + "type": "msat", + "description": [ + "Amount we have in the channel." + ] + }, + "splice_amount": { + "type": "integer", + "added": "v23.08", + "description": [ + "The amouont of sats we're splicing in or out." + ] + }, + "scratch_txid": { + "type": "txid", + "description": [ + "The commitment transaction txid we would use if we went onchain now." + ] + } + } + } + }, + "close_to": { + "type": "hex", + "description": [ + "ScriptPubkey which we have to close to if we mutual close." + ] + }, + "private": { + "type": "boolean", + "description": [ + "If True, we will not announce this channel." + ] + }, + "opener": { + "type": "string", + "enum": [ + "local", + "remote" + ], + "description": [ + "Who initiated the channel." + ] + }, + "closer": { + "type": "string", + "enum": [ + "local", + "remote" + ], + "description": [ + "Who initiated the channel close (only present if closing)." + ] + }, + "features": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "option_static_remotekey", + "option_anchor_outputs", + "option_scid_alias", + "option_zeroconf" + ], + "description": [ + "BOLT #9 features which apply to this channel." + ] + } + }, + "funding": { + "type": "object", + "additionalProperties": false, + "required": [ + "local_funds_msat", + "remote_funds_msat" + ], + "properties": { + "pushed_msat": { + "type": "msat", + "description": [ + "Amount pushed from opener to peer." + ] + }, + "local_funds_msat": { + "type": "msat", + "description": [ + "Amount of channel we funded." + ] + }, + "remote_funds_msat": { + "type": "msat", + "description": [ + "Amount of channel they funded." + ] + }, + "fee_paid_msat": { + "type": "msat", + "description": [ + "Amount we paid peer at open." + ] + }, + "fee_rcvd_msat": { + "type": "msat", + "description": [ + "Amount we were paid by peer at open." + ] + } + } + }, + "to_us_msat": { + "type": "msat", + "description": [ + "How much of channel is owed to us." + ] + }, + "min_to_us_msat": { + "type": "msat", + "description": [ + "Least amount owed to us ever. If the peer were to successfully steal from us, this is the amount we would still retain." + ] + }, + "max_to_us_msat": { + "type": "msat", + "description": [ + "Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get." + ] + }, + "total_msat": { + "type": "msat", + "description": [ + "Total amount in the channel." + ] + }, + "fee_base_msat": { + "type": "msat", + "description": [ + "Amount we charge to use the channel." + ] + }, + "fee_proportional_millionths": { + "type": "u32", + "description": [ + "Amount we charge to use the channel in parts-per-million." + ] + }, + "dust_limit_msat": { + "type": "msat", + "description": [ + "Minimum amount for an output on the channel transactions." + ] + }, + "max_total_htlc_in_msat": { + "type": "msat", + "description": [ + "Max amount accept in a single payment." + ] + }, + "their_reserve_msat": { + "type": "msat", + "description": [ + "Minimum we insist they keep in channel. If they have less than this in the channel, they cannot send to us on that channel." + ], + "default": "1% of the total channel capacity" + }, + "our_reserve_msat": { + "type": "msat", + "description": [ + "Minimum they insist we keep in channel. If you have less than this in the channel, you cannot send out via this channel." + ] + }, + "spendable_msat": { + "type": "msat", + "description": [ + "An estimate of the total we could send through channel (can be wrong because adding HTLCs requires an increase in fees paid to onchain miners, and onchain fees change dynamically according to onchain activity)." + ] + }, + "receivable_msat": { + "type": "msat", + "description": [ + "An estimate of the total peer could send through channel." + ] + }, + "minimum_htlc_in_msat": { + "type": "msat", + "description": [ + "The minimum amount HTLC we accept." + ] + }, + "minimum_htlc_out_msat": { + "type": "msat", + "description": [ + "The minimum amount HTLC we will send." + ] + }, + "maximum_htlc_out_msat": { + "type": "msat", + "description": [ + "The maximum amount HTLC we will send." + ] + }, + "their_to_self_delay": { + "type": "u32", + "description": [ + "The number of blocks before they can take their funds if they unilateral close." + ] + }, + "our_to_self_delay": { + "type": "u32", + "description": [ + "The number of blocks before we can take our funds if we unilateral close." + ] + }, + "max_accepted_htlcs": { + "type": "u32", + "description": [ + "Maximum number of incoming HTLC we will accept at once." + ] + }, + "alias": { + "type": "object", + "required": [], + "properties": { + "local": { + "type": "short_channel_id", + "description": [ + "An alias assigned by this node to this channel, used for outgoing payments." + ] + }, + "remote": { + "type": "short_channel_id", + "description": [ + "An alias assigned by the remote node to this channel, usable in routehints and invoices." + ] + } + } + }, + "state_changes": { + "type": "array", + "description": [ + "Prior state changes." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "timestamp", + "old_state", + "new_state", + "cause", + "message" + ], + "properties": { + "timestamp": { + "type": "string", + "description": [ + "UTC timestamp of form YYYY-mm-ddTHH:MM:SS.%03dZ." + ] + }, + "old_state": { + "type": "string", + "enum": [ + "OPENINGD", + "CHANNELD_AWAITING_LOCKIN", + "CHANNELD_NORMAL", + "CHANNELD_SHUTTING_DOWN", + "CLOSINGD_SIGEXCHANGE", + "CLOSINGD_COMPLETE", + "AWAITING_UNILATERAL", + "FUNDING_SPEND_SEEN", + "ONCHAIN", + "DUALOPEND_OPEN_INIT", + "DUALOPEND_AWAITING_LOCKIN", + "DUALOPEND_OPEN_COMMITTED", + "DUALOPEND_OPEN_COMMIT_READY" + ], + "description": [ + "Previous state." + ] + }, + "new_state": { + "type": "string", + "enum": [ + "OPENINGD", + "CHANNELD_AWAITING_LOCKIN", + "CHANNELD_NORMAL", + "CHANNELD_SHUTTING_DOWN", + "CLOSINGD_SIGEXCHANGE", + "CLOSINGD_COMPLETE", + "AWAITING_UNILATERAL", + "FUNDING_SPEND_SEEN", + "ONCHAIN", + "DUALOPEND_OPEN_INIT", + "DUALOPEND_AWAITING_LOCKIN", + "DUALOPEND_OPEN_COMMITTED", + "DUALOPEND_OPEN_COMMIT_READY" + ], + "description": [ + "New state." + ] + }, + "cause": { + "type": "string", + "enum": [ + "unknown", + "local", + "user", + "remote", + "protocol", + "onchain" + ], + "description": [ + "What caused the change." + ] + }, + "message": { + "type": "string", + "description": [ + "Human-readable explanation." + ] + } + } + } + }, + "status": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Billboard log of significant changes." + ] + } + }, + "in_payments_offered": { + "type": "u64", + "description": [ + "Number of incoming payment attempts." + ] + }, + "in_offered_msat": { + "type": "msat", + "description": [ + "Total amount of incoming payment attempts." + ] + }, + "in_payments_fulfilled": { + "type": "u64", + "description": [ + "Number of successful incoming payment attempts." + ] + }, + "in_fulfilled_msat": { + "type": "msat", + "description": [ + "Total amount of successful incoming payment attempts." + ] + }, + "out_payments_offered": { + "type": "u64", + "description": [ + "Number of outgoing payment attempts." + ] + }, + "out_offered_msat": { + "type": "msat", + "description": [ + "Total amount of outgoing payment attempts." + ] + }, + "out_payments_fulfilled": { + "type": "u64", + "description": [ + "Number of successful outgoing payment attempts." + ] + }, + "out_fulfilled_msat": { + "type": "msat", + "description": [ + "Total amount of successful outgoing payment attempts." + ] + }, + "htlcs": { + "type": "array", + "description": [ + "Current HTLCs in this channel." + ], + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "direction", + "id", + "amount_msat", + "expiry", + "payment_hash", + "state" + ], + "properties": { + "direction": { + "type": "string", + "enum": [ + "in", + "out" + ], + "description": [ + "Whether it came from peer, or is going to peer." + ] + }, + "id": { + "type": "u64", + "description": [ + "Unique ID for this htlc on this channel in this direction." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount send/received for this HTLC." + ] + }, + "expiry": { + "type": "u32", + "description": [ + "Block this HTLC expires at (after which an `in` direction HTLC will be returned to the peer, an `out` returned to us). If this expiry is too close, lightningd(8) will automatically unilaterally close the channel in order to enforce the timeout onchain." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the payment_preimage which will prove payment." + ] + }, + "local_trimmed": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "If this is too small to enforce onchain; it doesn't appear in the commitment transaction and will not be enforced in a unilateral close. Generally true if the HTLC (after subtracting onchain fees) is below the `dust_limit_msat` for the channel." + ] + }, + "status": { + "type": "string", + "description": [ + "Set if this HTLC is currently waiting on a hook (and shows what plugin)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "direction": { + "enum": [ + "out" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "state" + ], + "properties": { + "direction": {}, + "id": {}, + "amount_msat": {}, + "msatoshi": {}, + "expiry": {}, + "payment_hash": {}, + "local_trimmed": {}, + "status": {}, + "alias": {}, + "state": { + "type": "string", + "enum": [ + "SENT_ADD_HTLC", + "SENT_ADD_COMMIT", + "RCVD_ADD_REVOCATION", + "RCVD_ADD_ACK_COMMIT", + "SENT_ADD_ACK_REVOCATION", + "RCVD_REMOVE_HTLC", + "RCVD_REMOVE_COMMIT", + "SENT_REMOVE_REVOCATION", + "SENT_REMOVE_ACK_COMMIT", + "RCVD_REMOVE_ACK_REVOCATION" + ], + "description": [ + "Status of the HTLC." + ] + } + } + } + }, + { + "if": { + "properties": { + "direction": { + "enum": [ + "in" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "state" + ], + "properties": { + "direction": {}, + "id": {}, + "amount_msat": {}, + "msatoshi": {}, + "expiry": {}, + "payment_hash": {}, + "local_trimmed": {}, + "status": {}, + "state": { + "type": "string", + "enum": [ + "RCVD_ADD_HTLC", + "RCVD_ADD_COMMIT", + "SENT_ADD_REVOCATION", + "SENT_ADD_ACK_COMMIT", + "RCVD_ADD_ACK_REVOCATION", + "SENT_REMOVE_HTLC", + "SENT_REMOVE_COMMIT", + "RCVD_REMOVE_REVOCATION", + "RCVD_REMOVE_ACK_COMMIT", + "SENT_REMOVE_ACK_REVOCATION" + ], + "description": [ + "Status of the HTLC." + ] + } + } + } + } + ] + } + } + }, + "allOf": [ + { + "if": { + "required": [ + "close_to" + ] + }, + "then": { + "additionalProperties": false, + "required": [], + "properties": { + "state": {}, + "scratch_txid": {}, + "feerate": {}, + "owner": {}, + "short_channel_id": {}, + "channel_id": {}, + "funding_txid": {}, + "funding_outnum": {}, + "close_to": {}, + "private": {}, + "alias": {}, + "opener": {}, + "closer": {}, + "features": {}, + "funding": {}, + "to_us_msat": {}, + "min_to_us_msat": {}, + "max_to_us_msat": {}, + "total_msat": {}, + "fee_base_msat": {}, + "fee_proportional_millionths": {}, + "dust_limit_msat": {}, + "max_total_htlc_in_msat": {}, + "their_reserve_msat": {}, + "our_reserve_msat": {}, + "spendable_msat": {}, + "receivable_msat": {}, + "minimum_htlc_in_msat": {}, + "minimum_htlc_out_msat": {}, + "maximum_htlc_out_msat": {}, + "spendable_msatoshi": {}, + "receivable_msatoshi": {}, + "their_to_self_delay": {}, + "our_to_self_delay": {}, + "max_accepted_htlcs": {}, + "msatoshi_to_us": {}, + "msatoshi_to_us_min": {}, + "msatoshi_to_us_max": {}, + "msatoshi_total": {}, + "dust_limit_satoshis": {}, + "max_htlc_value_in_flight_msat": {}, + "our_channel_reserve_satoshis": {}, + "their_channel_reserve_satoshis": {}, + "spendable_satoshis": {}, + "receivable_satoshis": {}, + "htlc_minimum_msat": {}, + "state_changes": {}, + "status": {}, + "in_payments_offered": {}, + "in_offered_msat": {}, + "in_msatoshi_offered": {}, + "in_payments_fulfilled": {}, + "in_fulfilled_msat": {}, + "in_msatoshi_fulfilled": {}, + "out_payments_offered": {}, + "out_offered_msat": {}, + "out_msatoshi_offered": {}, + "out_payments_fulfilled": {}, + "out_fulfilled_msat": {}, + "out_msatoshi_fulfilled": {}, + "htlcs": {}, + "initial_feerate": {}, + "last_feerate": {}, + "next_feerate": {}, + "inflight": {}, + "last_tx_fee_msat": {}, + "direction": {}, + "close_to_addr": { + "type": "string", + "description": [ + "The bitcoin address we will close to (present if close_to_addr is a standardized address)." + ] + } + } + } + }, + { + "if": { + "required": [ + "scratch_txid" + ] + }, + "then": { + "additionalProperties": false, + "required": [ + "last_tx_fee_msat" + ], + "properties": { + "state": {}, + "alias": {}, + "scratch_txid": {}, + "feerate": {}, + "owner": {}, + "short_channel_id": {}, + "channel_id": {}, + "funding_txid": {}, + "funding_outnum": {}, + "inflight": {}, + "close_to": {}, + "private": {}, + "opener": {}, + "closer": {}, + "features": {}, + "funding": {}, + "to_us_msat": {}, + "min_to_us_msat": {}, + "max_to_us_msat": {}, + "total_msat": {}, + "fee_base_msat": {}, + "fee_proportional_millionths": {}, + "dust_limit_msat": {}, + "max_total_htlc_in_msat": {}, + "their_reserve_msat": {}, + "our_reserve_msat": {}, + "spendable_msat": {}, + "receivable_msat": {}, + "minimum_htlc_in_msat": {}, + "minimum_htlc_out_msat": {}, + "maximum_htlc_out_msat": {}, + "spendable_msatoshi": {}, + "receivable_msatoshi": {}, + "their_to_self_delay": {}, + "our_to_self_delay": {}, + "max_accepted_htlcs": {}, + "msatoshi_to_us": {}, + "msatoshi_to_us_min": {}, + "msatoshi_to_us_max": {}, + "msatoshi_total": {}, + "dust_limit_satoshis": {}, + "max_htlc_value_in_flight_msat": {}, + "our_channel_reserve_satoshis": {}, + "their_channel_reserve_satoshis": {}, + "spendable_satoshis": {}, + "receivable_satoshis": {}, + "htlc_minimum_msat": {}, + "state_changes": {}, + "status": {}, + "in_payments_offered": {}, + "in_offered_msat": {}, + "in_msatoshi_offered": {}, + "in_payments_fulfilled": {}, + "in_fulfilled_msat": {}, + "in_msatoshi_fulfilled": {}, + "out_payments_offered": {}, + "out_offered_msat": {}, + "out_msatoshi_offered": {}, + "out_payments_fulfilled": {}, + "out_fulfilled_msat": {}, + "out_msatoshi_fulfilled": {}, + "htlcs": {}, + "initial_feerate": {}, + "last_feerate": {}, + "next_feerate": {}, + "close_to_addr": {}, + "direction": {}, + "last_tx_fee_msat": { + "type": "msat", + "description": [ + "Fee attached to this the current tx." + ] + } + } + } + }, + { + "if": { + "required": [ + "short_channel_id" + ] + }, + "then": { + "additionalProperties": false, + "required": [ + "direction" + ], + "properties": { + "alias": {}, + "state": {}, + "scratch_txid": {}, + "feerate": {}, + "owner": {}, + "short_channel_id": {}, + "channel_id": {}, + "funding_txid": {}, + "funding_outnum": {}, + "inflight": {}, + "close_to": {}, + "private": {}, + "opener": {}, + "closer": {}, + "features": {}, + "funding": {}, + "to_us_msat": {}, + "min_to_us_msat": {}, + "max_to_us_msat": {}, + "total_msat": {}, + "fee_base_msat": {}, + "fee_proportional_millionths": {}, + "dust_limit_msat": {}, + "max_total_htlc_in_msat": {}, + "their_reserve_msat": {}, + "our_reserve_msat": {}, + "spendable_msat": {}, + "receivable_msat": {}, + "minimum_htlc_in_msat": {}, + "minimum_htlc_out_msat": {}, + "maximum_htlc_out_msat": {}, + "spendable_msatoshi": {}, + "receivable_msatoshi": {}, + "their_to_self_delay": {}, + "our_to_self_delay": {}, + "max_accepted_htlcs": {}, + "msatoshi_to_us": {}, + "msatoshi_to_us_min": {}, + "msatoshi_to_us_max": {}, + "msatoshi_total": {}, + "dust_limit_satoshis": {}, + "max_htlc_value_in_flight_msat": {}, + "our_channel_reserve_satoshis": {}, + "their_channel_reserve_satoshis": {}, + "spendable_satoshis": {}, + "receivable_satoshis": {}, + "htlc_minimum_msat": {}, + "state_changes": {}, + "status": {}, + "in_payments_offered": {}, + "in_offered_msat": {}, + "in_msatoshi_offered": {}, + "in_payments_fulfilled": {}, + "in_fulfilled_msat": {}, + "in_msatoshi_fulfilled": {}, + "out_payments_offered": {}, + "out_offered_msat": {}, + "out_msatoshi_offered": {}, + "out_payments_fulfilled": {}, + "out_fulfilled_msat": {}, + "out_msatoshi_fulfilled": {}, + "htlcs": {}, + "initial_feerate": {}, + "last_feerate": {}, + "next_feerate": {}, + "close_to_addr": {}, + "last_tx_fee_msat": {}, + "direction": { + "type": "u32", + "description": [ + "0 if we're the lesser node_id, 1 if we're the greater (as used in BOLT #7 channel_update)." + ] + } + } + } + }, + { + "if": { + "required": [ + "inflight" + ] + }, + "then": { + "additionalProperties": false, + "required": [ + "initial_feerate", + "last_feerate", + "next_feerate" + ], + "properties": { + "state": {}, + "scratch_txid": {}, + "feerate": {}, + "owner": {}, + "alias": {}, + "short_channel_id": {}, + "channel_id": {}, + "funding_txid": {}, + "funding_outnum": {}, + "close_to": {}, + "private": {}, + "opener": {}, + "closer": {}, + "features": {}, + "funding": {}, + "to_us_msat": {}, + "min_to_us_msat": {}, + "max_to_us_msat": {}, + "total_msat": {}, + "fee_base_msat": {}, + "fee_proportional_millionths": {}, + "dust_limit_msat": {}, + "max_total_htlc_in_msat": {}, + "their_reserve_msat": {}, + "our_reserve_msat": {}, + "spendable_msat": {}, + "receivable_msat": {}, + "minimum_htlc_in_msat": {}, + "minimum_htlc_out_msat": {}, + "maximum_htlc_out_msat": {}, + "spendable_msatoshi": {}, + "receivable_msatoshi": {}, + "their_to_self_delay": {}, + "our_to_self_delay": {}, + "max_accepted_htlcs": {}, + "msatoshi_to_us": {}, + "msatoshi_to_us_min": {}, + "msatoshi_to_us_max": {}, + "msatoshi_total": {}, + "dust_limit_satoshis": {}, + "max_htlc_value_in_flight_msat": {}, + "our_channel_reserve_satoshis": {}, + "their_channel_reserve_satoshis": {}, + "spendable_satoshis": {}, + "receivable_satoshis": {}, + "htlc_minimum_msat": {}, + "state_changes": {}, + "status": {}, + "in_payments_offered": {}, + "in_offered_msat": {}, + "in_msatoshi_offered": {}, + "in_payments_fulfilled": {}, + "in_fulfilled_msat": {}, + "in_msatoshi_fulfilled": {}, + "out_payments_offered": {}, + "out_offered_msat": {}, + "out_msatoshi_offered": {}, + "out_payments_fulfilled": {}, + "out_fulfilled_msat": {}, + "out_msatoshi_fulfilled": {}, + "htlcs": {}, + "inflight": {}, + "close_to_addr": {}, + "direction": {}, + "last_tx_fee_msat": {}, + "initial_feerate": { + "type": "string", + "description": [ + "The feerate for the initial funding transaction in per-1000-weight, with `kpw` appended." + ] + }, + "last_feerate": { + "type": "string", + "description": [ + "The feerate for the latest funding transaction in per-1000-weight, with `kpw` appended." + ] + }, + "next_feerate": { + "type": "string", + "description": [ + "The minimum feerate for the next funding transaction in per-1000-weight, with `kpw` appended." + ] + } + } + } + } + ] + } + } + }, + "allOf": [ + { + "if": { + "additionalProperties": true, + "properties": { + "connected": { + "enum": [ + true + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "netaddr", + "features" + ], + "properties": { + "id": {}, + "channels": {}, + "connected": {}, + "num_channels": {}, + "htlcs": {}, + "log": {}, + "netaddr": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "description": [ + "A single entry array." + ], + "items": { + "type": "string", + "description": [ + "Address, e.g. 1.2.3.4:1234." + ] + } + }, + "remote_addr": { + "type": "string", + "description": [ + "The public IPv4/6 address the peer sees us from, e.g. 1.2.3.4:1234." + ] + }, + "features": { + "type": "hex", + "description": [ + "Bitmap of BOLT #9 features from peer's INIT message." + ] + } + } + } + } + ] + } + } + } + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong." + ], + "example_json_request": [ + { + "id": "example:listpeers#1", + "method": "listpeers", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "level": null + } + }, + { + "id": "example:listpeers#2", + "method": "listpeers", + "params": { + "id": null, + "level": null + } + } + ], + "example_json_response": [ + { + "peers": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "connected": true, + "num_channels": 1, + "netaddr": [ + "127.0.0.1:44619" + ], + "features": "08a0000a0a69a2" + } + ] + }, + { + "peers": [ + { + "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "connected": true, + "num_channels": 1, + "netaddr": [ + "127.0.0.1:48862" + ], + "features": "08a0000a0a69a2" + } + ] + } + ], + "author": [ + "Michael Hawkins <>." + ], + "see_also": [ + "lightning-connect(7)", + "lightning-fundchannel_start(7)", + "lightning-setchannel(7)" + ], + "resources": [ + "Main web site: ", + "Lightning RFC site (BOLT #9):", + "" + ] +} diff --git a/doc/schemas/lightning-listsendpays.json b/doc/schemas/lightning-listsendpays.json new file mode 100644 index 000000000000..f100a2e86117 --- /dev/null +++ b/doc/schemas/lightning-listsendpays.json @@ -0,0 +1,411 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listsendpays", + "title": "Low-level command for querying sendpay status", + "description": [ + "The **listsendpays** RPC command gets the status of all *sendpay* commands (which is also used by the *pay* command), or with *bolt11* or *payment_hash* limits results to that specific payment. You cannot specify both. It is possible to filter the payments also by *status*.", + "", + "Note that there may be more than one concurrent *sendpay* command per *pay*, so this command should be used with caution." + ], + "request": { + "required": [], + "properties": { + "bolt11": { + "type": "string", + "description": [ + "Bolt11 invoice." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the payment_preimage." + ] + }, + "status": { + "type": "string", + "enum": [ + "pending", + "complete", + "failed" + ], + "description": [ + "Whether the invoice has been paid, pending, or failed." + ] + }, + "index": { + "type": "string", + "added": "v23.11", + "enum": [ + "created", + "updated" + ], + "description": [ + "If neither bolt11 or payment_hash is specified, `index` controls ordering, by `created` (default) or `updated`." + ] + }, + "start": { + "type": "u64", + "added": "v23.11", + "description": [ + "If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)." + ] + }, + "limit": { + "type": "u32", + "added": "v23.11", + "description": [ + "If `index` is specified, `limit` can be used to specify the maximum number of entries to return." + ] + } + }, + "dependentUpon": { + "index": [ + "start", + "limit" + ] + } + }, + "response": { + "required": [ + "payments" + ], + "properties": { + "payments": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "id", + "created_index", + "payment_hash", + "status", + "groupid", + "created_at", + "amount_sent_msat" + ], + "properties": { + "created_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was created in." + ] + }, + "id": { + "type": "u64", + "description": [ + "Old synonym for created_index." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." + ] + }, + "partid": { + "type": "u64", + "description": [ + "Part number (for multiple parts to a single payment)." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "updated_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was changed (only present if it has changed since creation)." + ] + }, + "status": { + "type": "string", + "enum": [ + "pending", + "failed", + "complete" + ], + "description": [ + "Status of the payment." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount delivered to destination (if known)." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment if known." + ] + }, + "created_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "The amount sent." + ] + }, + "label": { + "type": "string", + "description": [ + "The label, if given to sendpay." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string (if pay supplied one)." + ] + }, + "description": { + "type": "string", + "description": [ + "The description matching the bolt11 description hash (if pay supplied one)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string (if supplied for pay: **experimental-offers** only)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "complete" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "payment_preimage" + ], + "properties": { + "id": {}, + "created_index": {}, + "updated_index": {}, + "partid": {}, + "groupid": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "destination": {}, + "created_at": {}, + "msatoshi_sent": {}, + "amount_sent_msat": {}, + "label": {}, + "bolt11": {}, + "description": {}, + "bolt12": {}, + "completed_at": { + "type": "u64", + "added": "pre-v0.10.1", + "description": [ + "The UNIX timestamp showing when this payment was completed." + ] + }, + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash**." + ] + } + } + } + }, + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "failed" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [], + "properties": { + "id": {}, + "created_index": {}, + "updated_index": {}, + "partid": {}, + "groupid": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "destination": {}, + "created_at": {}, + "completed_at": {}, + "msatoshi_sent": {}, + "amount_sent_msat": {}, + "label": {}, + "bolt11": {}, + "description": {}, + "bolt12": {}, + "erroronion": { + "type": "hex", + "description": [ + "The onion message returned." + ] + } + } + } + }, + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "pending" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [], + "properties": { + "id": {}, + "created_index": {}, + "updated_index": {}, + "partid": {}, + "groupid": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "destination": {}, + "created_at": {}, + "msatoshi_sent": {}, + "amount_sent_msat": {}, + "label": {}, + "bolt11": {}, + "description": {}, + "bolt12": {} + } + } + } + ] + } + } + }, + "pre_return_value_notes": [ + "Note that the returned array is ordered by increasing *id*." + ] + }, + "example_json_request": [ + { + "id": "example:listsendpays#1", + "method": "listsendpays", + "params": { + "bolt11": null, + "payment_hash": null, + "status": null, + "index": null, + "start": null, + "limit": null + } + }, + { + "id": "example:listsendpays#2", + "method": "listsendpays", + "params": { + "bolt11": "lnbcrt1230n1pja03q9sp5xu9aypccf3n6vld2waxcysy47ct2wl5x5adtm7k8u30knqes22lspp5duw2v8csh0zh4xg9ql3amem98avlkc2ecre99tgmr2340amf9kmsdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqwh78s8wqg0kepspw0epcxmxteh5wu8n6ddlwdnyj758fqxpqk8ejf597x8ju3r32xqgae3yzjjz9e5s6l2vs5zxvkayhmemmx74wvyqqyqf8c9", + "payment_hash": null, + "status": null, + "index": null, + "start": null, + "limit": null + } + } + ], + "example_json_response": [ + { + "payments": [ + { + "created_index": 1, + "id": 1, + "payment_hash": "e3b43574acd074b0c4ba1b13b5155ff5f9c76742e643ed003e17301c5a2db149", + "groupid": 1, + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount_msat": 20000, + "amount_sent_msat": 20000, + "created_at": 1706225269, + "status": "pending", + "bolt11": "lnbcrt200n1pjm9mn5sp5gq84lgga959m6gg4g0kj29ypwjaxxnm4cu5csymq8p6nqxv800mspp5uw6r2a9v6p6tp396rvfm292l7huuwe6zuep76qp7zucpck3dk9ysdpqf9grgmt62fmk5stswefh23n2tpykvcmzxqyjw5qcqp99qxpqysgqz8s496zmwed278jvp075zlhrnj0ncg45kcfw5s2lkhtxd3wc39f8wflp5gmd827dk470xpasfpx0azsfu0k8ttwae7620h8d050w28cqan776g" + }, + { + "created_index": 2, + "id": 2, + "payment_hash": "f55d92cfe019b5a015f5e5956e9255053cda14786171d5002feb12ae5254e5a5", + "groupid": 1, + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount_msat": 30000, + "amount_sent_msat": 30000, + "created_at": 1706225269, + "status": "pending", + "bolt11": "lnbcrt300n1pjm9mn5sp5zqfkr93rp92mdyj6m8lzpcu90rfefcaqff8fxdd2sc5mace23ujspp574we9nlqrx66q904uk2kayj4q57d59rcv9ca2qp0avf2u5j5ukjsdpq29j55nfcgfcnsvzw2er57knhwcmhzwt0xqyjw5qcqp99qxpqysgq76p2jpnegtzlxmn0aqt6d3f89q4p6y5v3v2qz7t2mm6xt90nt324cq400tl82k28562aux8jxs57d603g7s0q4g3dapu9a7vln94j7spsut799" + } + ] + }, + { + "payments": [ + { + "created_index": 1, + "id": 1, + "payment_hash": "6f1ca61f10bbc57a990507e3dde7653f59fb6159c0f252ad1b1aa357f7692db7", + "groupid": 1, + "updated_index": 1, + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount_msat": 123000, + "amount_sent_msat": 123000, + "created_at": 1708639237, + "completed_at": 1708639238, + "status": "complete", + "payment_preimage": "91f8366681fdfd309c048082fcde81a79116f85a7b2dd09aef1e34f5f7c3397b", + "bolt11": "lnbcrt1230n1pja03q9sp5xu9aypccf3n6vld2waxcysy47ct2wl5x5adtm7k8u30knqes22lspp5duw2v8csh0zh4xg9ql3amem98avlkc2ecre99tgmr2340amf9kmsdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqwh78s8wqg0kepspw0epcxmxteh5wu8n6ddlwdnyj758fqxpqk8ejf597x8ju3r32xqgae3yzjjz9e5s6l2vs5zxvkayhmemmx74wvyqqyqf8c9" + } + ] + } + ], + "author": [ + "Christian Decker <> is mainly responsible." + ], + "see_also": [ + "lightning-listpays(7)", + "lightning-sendpay(7)", + "lightning-listinvoice(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-listsqlschemas.json b/doc/schemas/lightning-listsqlschemas.json new file mode 100644 index 000000000000..dd298487c490 --- /dev/null +++ b/doc/schemas/lightning-listsqlschemas.json @@ -0,0 +1,277 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.02", + "rpc": "listsqlschemas", + "title": "Command to example lightning-sql schemas", + "description": [ + "This allows you to examine the schemas at runtime; while they are fully documented for the current release in lightning-sql(7), as fields are added or deprecated, you can use this command to determine what fields are present.", + "", + "If *table* is given, only that table is in the resulting list, otherwise all tables are listed." + ], + "request": { + "required": [], + "properties": { + "table": { + "type": "string" + } + } + }, + "response": { + "required": [ + "schemas" + ], + "properties": { + "schemas": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "tablename", + "columns" + ], + "properties": { + "tablename": { + "type": "string", + "description": [ + "The name of the table." + ] + }, + "columns": { + "type": "array", + "description": [ + "The columns, in database order." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "name", + "type" + ], + "properties": { + "name": { + "type": "string", + "description": [ + "The name of the column." + ] + }, + "type": { + "type": "string", + "enum": [ + "INTEGER", + "BLOB", + "TEXT", + "REAL" + ], + "description": [ + "The SQL type of the column." + ] + } + } + } + }, + "indices": { + "type": "array", + "description": [ + "Any index we created to speed lookups." + ], + "items": { + "type": "array", + "description": [ + "The columns for this index." + ], + "items": { + "type": "string", + "description": [ + "The column name." + ] + } + } + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:listsqlschemas#1", + "method": "listsqlschemas", + "params": { + "table": "offers" + } + }, + { + "id": "example:listsqlschemas#2", + "method": "listsqlschemas", + "params": [ + "closedchannels" + ] + } + ], + "example_json_response": [ + { + "schemas": [ + { + "tablename": "offers", + "columns": [ + { + "name": "offer_id", + "type": "BLOB" + }, + { + "name": "active", + "type": "INTEGER" + }, + { + "name": "single_use", + "type": "INTEGER" + }, + { + "name": "bolt12", + "type": "TEXT" + }, + { + "name": "bolt12_unsigned", + "type": "TEXT" + }, + { + "name": "used", + "type": "INTEGER" + }, + { + "name": "label", + "type": "TEXT" + } + ], + "indices": [ + [ + "offer_id" + ] + ] + } + ] + }, + { + "schemas": [ + { + "tablename": "closedchannels", + "columns": [ + { + "name": "rowid", + "type": "INTEGER" + }, + { + "name": "peer_id", + "type": "BLOB" + }, + { + "name": "channel_id", + "type": "BLOB" + }, + { + "name": "short_channel_id", + "type": "TEXT" + }, + { + "name": "alias_local", + "type": "TEXT" + }, + { + "name": "alias_remote", + "type": "TEXT" + }, + { + "name": "opener", + "type": "TEXT" + }, + { + "name": "closer", + "type": "TEXT" + }, + { + "name": "private", + "type": "INTEGER" + }, + { + "name": "total_local_commitments", + "type": "INTEGER" + }, + { + "name": "total_remote_commitments", + "type": "INTEGER" + }, + { + "name": "total_htlcs_sent", + "type": "INTEGER" + }, + { + "name": "funding_txid", + "type": "BLOB" + }, + { + "name": "funding_outnum", + "type": "INTEGER" + }, + { + "name": "leased", + "type": "INTEGER" + }, + { + "name": "funding_fee_paid_msat", + "type": "INTEGER" + }, + { + "name": "funding_fee_rcvd_msat", + "type": "INTEGER" + }, + { + "name": "funding_pushed_msat", + "type": "INTEGER" + }, + { + "name": "total_msat", + "type": "INTEGER" + }, + { + "name": "final_to_us_msat", + "type": "INTEGER" + }, + { + "name": "min_to_us_msat", + "type": "INTEGER" + }, + { + "name": "max_to_us_msat", + "type": "INTEGER" + }, + { + "name": "last_commitment_txid", + "type": "BLOB" + }, + { + "name": "last_commitment_fee_msat", + "type": "INTEGER" + }, + { + "name": "close_cause", + "type": "TEXT" + } + ] + } + ] + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-sql(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-listtransactions.json b/doc/schemas/lightning-listtransactions.json new file mode 100644 index 000000000000..ed54c8c35c6a --- /dev/null +++ b/doc/schemas/lightning-listtransactions.json @@ -0,0 +1,202 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listtransactions", + "title": "Command to get the list of transactions that was stored in the wallet.", + "description": [ + "The **listtransactions** command returns transactions tracked in the wallet. This includes deposits, withdrawals and transactions related to channels. A transaction may have multiple types, e.g., a transaction may both be a close and a deposit if it closes the channel and returns funds to the wallet." + ], + "request": { + "required": [], + "properties": {} + }, + "response": { + "required": [ + "transactions" + ], + "properties": { + "transactions": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "hash", + "rawtx", + "blockheight", + "txindex", + "locktime", + "version", + "inputs", + "outputs" + ], + "properties": { + "hash": { + "type": "txid", + "description": [ + "The transaction id." + ] + }, + "rawtx": { + "type": "hex", + "description": [ + "The raw transaction." + ] + }, + "blockheight": { + "type": "u32", + "description": [ + "The block height of this tx." + ] + }, + "txindex": { + "type": "u32", + "description": [ + "The transaction number within the block." + ] + }, + "locktime": { + "type": "u32", + "description": [ + "The nLocktime for this tx." + ] + }, + "version": { + "type": "u32", + "description": [ + "The nVersion for this tx." + ] + }, + "inputs": { + "type": "array", + "description": [ + "Each input, in order." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "txid", + "index", + "sequence" + ], + "properties": { + "txid": { + "type": "txid", + "description": [ + "The transaction id spent." + ] + }, + "index": { + "type": "u32", + "description": [ + "The output spent." + ] + }, + "sequence": { + "type": "u32", + "description": [ + "The nSequence value." + ] + } + } + } + }, + "outputs": { + "type": "array", + "description": [ + "Each output, in order." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "index", + "amount_msat", + "scriptPubKey" + ], + "properties": { + "index": { + "type": "u32", + "description": [ + "The 0-based output number." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount of the output." + ] + }, + "scriptPubKey": { + "type": "hex", + "description": [ + "The scriptPubKey." + ] + } + } + } + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:listtransactions#1", + "method": "listtransactions", + "params": {} + } + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters." + ], + "example_json_response": [ + { + "transactions": [ + { + "hash": "05985072bbe20747325e69a159fe08176cc1bbc96d25e8848edad2dddc1165d0", + "rawtx": "02000000027032912651fc25a3e0893acd5f9640598707e2dfef92143bb5a4020e335442800100000017160014a5f48b9aa3cb8ca6cc1040c11e386745bb4dc932ffffffffd229a4b4f78638ebcac10a68b0561585a5d6e4d3b769ad0a909e9b9afaeae24e00000000171600145c83da9b685f9142016c6f5eb5f98a45cfa6f686ffffffff01915a01000000000017a9143a4dfd59e781f9c3018e7d0a9b7a26d58f8d22bf8700000000", + "blockheight": 0, + "txindex": 0, + "locktime": 0, + "version": 2, + "inputs": [ + { + "txid": "804254330e02a4b53b1492efdfe207875940965fcd3a89e0a325fc5126913270", + "index": 1, + "sequence": 4294967295 + }, + { + "txid": "4ee2eafa9a9b9e900aad69b7d3e4d6a5851556b0680ac1caeb3886f7b4a429d2", + "index": 0, + "sequence": 4294967295 + } + ], + "outputs": [ + { + "index": 0, + "satoshis": "88721000msat", + "scriptPubKey": "a9143a4dfd59e781f9c3018e7d0a9b7a26d58f8d22bf87" + } + ] + } + ] + } + ], + "author": [ + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." + ], + "see_also": [ + "lightning-newaddr(7)", + "lightning-listfunds(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-makesecret.json b/doc/schemas/lightning-makesecret.json new file mode 100644 index 000000000000..181499faf675 --- /dev/null +++ b/doc/schemas/lightning-makesecret.json @@ -0,0 +1,76 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "makesecret", + "title": "Command for deriving pseudorandom key from HSM", + "description": [ + "The **makesecret** RPC command derives a secret key from the HSM_secret." + ], + "request": { + "required": [], + "properties": { + "hex": { + "type": "hex", + "description": [ + "One of `hex` or `string` must be specified: `hex` can be any hex data." + ] + }, + "string": { + "type": "string", + "description": [ + "One of `hex` or `string` must be specified: `string` is a UTF-8 string interpreted literally." + ] + } + } + }, + "response": { + "required": [ + "secret" + ], + "properties": { + "secret": { + "type": "secret", + "description": [ + "The pseudorandom key derived from HSM_secret." + ] + } + } + }, + "errors": [ + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error." + ], + "example_json_request": [ + { + "id": "example:makesecret#1", + "method": "makesecret", + "params": [ + "73636220736563726574" + ] + }, + { + "id": "example:makesecret#2", + "method": "makesecret", + "params": [ + null, + "scb secret" + ] + } + ], + "example_json_response": [ + { + "secret": "a9a2e742405c28f059349132923a99337ae7f71168b7485496e3365f5bc664ed" + }, + { + "secret": "a9a2e742405c28f059349132923a99337ae7f71168b7485496e3365f5bc664ed" + } + ], + "author": [ + "Aditya <> is mainly responsible." + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-multifundchannel.json b/doc/schemas/lightning-multifundchannel.json new file mode 100644 index 000000000000..c958a4009113 --- /dev/null +++ b/doc/schemas/lightning-multifundchannel.json @@ -0,0 +1,465 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "multifundchannel", + "title": "Command for establishing many lightning channels", + "description": [ + "The **multifundchannel** RPC command opens multiple payment channels with nodes by committing a single funding transaction to the blockchain that is shared by all channels.", + "", + "If not already connected, **multifundchannel** will automatically attempt to connect; you may provide a *@host:port* hint appended to the node ID so that Core Lightning can learn how to connect to the node; see lightning-connect(7).", + "", + "Once the transaction is confirmed, normal channel operations may begin. Readiness is indicated by **listpeers** reporting a *state* of `CHANNELD_NORMAL` for the channel." + ], + "request": { + "required": [ + "destinations" + ], + "properties": { + "destinations": { + "type": "array", + "description": [ + "There must be at least one entry in *destinations*; it cannot be an empty array." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "id", + "amount" + ], + "properties": { + "id": { + "type": "string", + "description": [ + "Node ID, with an optional *@host:port* appended to it in a manner understood by **connect**; see lightning-connect(7). Each entry in the *destinations* array must have a unique node *id*. If not already connected, **multifundchannel** will automatically attempt to connect to the node." + ] + }, + "amount": { + "type": "msat", + "description": [ + "Amount in satoshis taken from the internal wallet to fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). The string *all* can be used to specify all available funds (or 16,777,215 satoshi if more is available and large channels were not negotiated with the peer). Otherwise it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The value cannot be less than the dust limit, currently 546 satoshi as of this writing, nor more than 16,777,215 satoshi (unless large channels were negotiated with the peer)." + ] + }, + "announce": { + "type": "boolean", + "description": [ + "Flag that indicates whether to announce the channel with this. If set to `False`, the channel is unpublished." + ], + "default": "`True`" + }, + "push_msat": { + "type": "msat", + "description": [ + "Amount of millisatoshis to outright give to the node. This is a gift to the peer, and you do not get a proof-of-payment out of this." + ] + }, + "close_to": { + "type": "string", + "description": [ + "Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script` Returns `close_to` set to closing script iff is negotiated." + ] + }, + "request_amt": { + "type": "msat", + "description": [ + "Amount of liquidity you'd like to lease from peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*." + ] + }, + "compact_lease": { + "type": "string", + "description": [ + "Compact representation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel to this destination." + ] + }, + "mindepth": { + "type": "u32", + "description": [ + "Number of confirmations before we consider the channel active." + ] + }, + "reserve": { + "type": "msat", + "description": [ + "Amount we want the peer to maintain on its side of the channel. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*." + ], + "default": "1% of the funding amount" + } + } + } + }, + "feerate": { + "type": "feerate", + "description": [ + "Feerate used for the opening transaction, and if *commitment_feerate* is not set, as initial feerate for commitment and HTLC transactions. See NOTES in lightning-feerates(7) for possible values." + ], + "default": "*normal*" + }, + "minconf": { + "type": "integer", + "description": [ + "Minimum number of confirmations that used outputs should have." + ], + "default": 1 + }, + "utxos": { + "type": "array", + "items": { + "type": "outpoint", + "description": [ + "Utxos to be used to fund the channel, as an array of `txid:vout`." + ] + } + }, + "minchannels": { + "type": "integer", + "description": [ + "Re-attempt funding as long as at least this many peers remain (must not be zero). The **multifundchannel** command will only fail if too many peers fail the funding process." + ] + }, + "commitment_feerate": { + "type": "feerate", + "description": [ + "Initial feerate for commitment and HTLC transactions. See *feerate* for valid values." + ] + } + } + }, + "response": { + "required": [ + "tx", + "txid", + "channel_ids" + ], + "properties": { + "tx": { + "type": "hex", + "description": [ + "The raw transaction which funded the channel." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The txid of the transaction which funded the channel." + ] + }, + "channel_ids": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "id", + "channel_id", + "channel_type", + "outnum" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The peer we opened the channel with." + ] + }, + "outnum": { + "type": "u32", + "description": [ + "The 0-based output index showing which output funded the channel." + ] + }, + "channel_id": { + "type": "hash", + "description": [ + "The channel_id of the resulting channel." + ] + }, + "channel_type": { + "type": "object", + "description": [ + "Channel_type as negotiated with peer." + ], + "added": "v24.02", + "additionalProperties": false, + "required": [ + "bits", + "names" + ], + "properties": { + "bits": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + }, + "names": { + "type": "array", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" + ], + "description": [ + "Name of feature bit." + ] + } + } + } + }, + "close_to": { + "type": "hex", + "description": [ + "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`." + ] + } + } + } + }, + "failed": { + "type": "array", + "description": [ + "Any peers we failed to open with (if *minchannels* was specified less than the number of destinations)." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "id", + "method", + "error" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The peer we failed to open the channel with." + ] + }, + "method": { + "type": "string", + "enum": [ + "connect", + "openchannel_init", + "fundchannel_start", + "fundchannel_complete" + ], + "description": [ + "What stage we failed at." + ] + }, + "error": { + "type": "object", + "additionalProperties": false, + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "integer", + "description": [ + "JSON error code from failing stage." + ] + }, + "message": { + "type": "string", + "description": [ + "Message from stage." + ] + }, + "data": { + "untyped": true, + "description": [ + "Additional error data." + ] + } + } + } + } + } + } + }, + "pre_return_value_notes": [ + "This command opens multiple channels with a single large transaction, thus only one transaction is returned.", + "", + "If *minchannels* was specified and is less than the number of destinations, then it is possible that one or more of the destinations do not have a channel even if **multifundchannel** succeeded." + ], + "post_return_value_notes": [ + "On failure, none of the channels are created." + ] + }, + "errors": [ + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error.", + "- 300: The maximum allowed funding amount is exceeded.", + "- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.", + "- 302: The output amount is too small, and would be considered dust.", + "- 303: Broadcasting of the funding transaction failed, the internal call to bitcoin-cli returned with an error.", + "- 313: The `min-emergency-msat` reserve not be preserved (and we have or are opening anchor channels).", + "", + "Failure may also occur if **lightningd** and the peer cannot agree on channel parameters (funding limits, channel reserves, fees, etc.). See lightning-fundchannel_start(7) and lightning-fundchannel_complete(7).", + "", + "There may be rare edge cases where a communications failure later in the channel funding process will cancel the funding locally, but the peer thinks the channel is already waiting for funding lockin. In that case, the next time we connect to the peer, our node will tell the peer to forget the channel, but some nodes (in particular, Core Lightning nodes) will disconnect when our node tells them to forget the channel. If you immediately **multifundchannel** with that peer, it could trigger this connect-forget-disconnect behavior, causing the second **multifundchannel** to fail as well due to disconnection. Doing a **connect** with the peers separately, and waiting for a few seconds, should help clear this hurdle; running **multifundchannel** a third time would also clear this." + ], + "example_usage": [ + "This example opens three channels at once, with amounts 200,000 sats, 3,000,000 sats and the final channel using all remaining funds (actually, capped at 16,777,215 sats because large-channels is not enabled):", + "", + "```shell", + "$ lightning-cli multifundchannel '[{\"id\":\"0201f42e167959c74d396ac57652fcea63c63940f78e8239cce5720df4d85ef857@127.0.0.1:7272\", \"amount\":\"200000sat\"}, {\"id\":\"0304a2468065535f9459567686e0f02b40f06e341d3eb2a62ec6763bcf2ccfd207@127.0.0.1:7373\", \"amount\":\"0.03btc\"}, {\"id\":\"0391f4c475050bb15871da5a72b1f3a1798de3d2e5fb4ffa262899b8d8e1f0b764@127.0.0.1:7474\", \"amount\":\"all\"}]'", + "{", + " \"tx\": \"02000000000101fbe3c68db87b72f82c3f5447b0bc032469c78e71f229ac99c230807ff378a9d80000000000fdffffff04400d0300000000002200202e9897ed5f9b237aa27fd5d02d24157cd452b0d3f0a5bb03d38ff73f9f8f384bffffff0000000000220020439d797ada249e1e12f8d27cabb7330de3c8de0456fb54892deb7b9c72b0ff7c1dc9b50400000000225120046e3966a2d5e43c1f1e0676161905782e1e7c00811485c618f5144f328f4e2bc0c62d0000000000220020e36fd5c03c3586c3763d8b4c9d8650f396ff1c8a460137fb09b60ee82536a3b20140ea4d564e91c919b50a2d32886f1d414de773491119beb1364b92f15d6d03e1810e5ddea89c265e42f2e96bb028dfb3aa0b5b30072ddcc78daad727503c53e37fa9010000\",", + " \"txid\": \"90dc53922b70628fc9e7804ad0b8cd0fb41f050d94ffa2db3b16e918c96c022a\",", + " \"channel_ids\": [", + " {", + " \"id\": \"0201f42e167959c74d396ac57652fcea63c63940f78e8239cce5720df4d85ef857\",", + " \"channel_id\": \"25c8253e66a860d17916cc0c21386e310eba9900030a68ec6ff6f59a8401a872\",", + " \"outnum\": 0", + " },", + " {", + " \"id\": \"0304a2468065535f9459567686e0f02b40f06e341d3eb2a62ec6763bcf2ccfd207\",", + " \"channel_id\": \"51749d724892a406896f6bf2e2f8c0b03399d0436691f294839897fa167e6521\",", + " \"outnum\": 3", + " },", + " {", + " \"id\": \"0391f4c475050bb15871da5a72b1f3a1798de3d2e5fb4ffa262899b8d8e1f0b764\",", + " \"channel_id\": \"7e1414e72c081f0754fa18c1657cedabe696aa9ffeaf0b936bfbe3a28f2829d1\",", + " \"outnum\": 1", + " }", + " ],", + " \"failed\": []", + "}", + "```" + ], + "example_json_request": [ + { + "id": "example:multifundchannel#1", + "method": "multifundchannel", + "params": { + "destinations": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59@localhost:41939", + "amount": 50000 + } + ], + "feerate": "10000perkw", + "minconf": null, + "utxos": null, + "minchannels": null, + "commitment_feerate": "2000perkw" + } + }, + { + "id": "example:multifundchannel#2", + "method": "multifundchannel", + "params": { + "destinations": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59@localhost:44663", + "amount": 50000 + }, + { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d@localhost:34631", + "amount": 50000 + }, + { + "id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199@localhost:34617", + "amount": 50000 + } + ], + "feerate": null, + "minconf": null, + "utxos": null, + "minchannels": 1 + } + } + ], + "example_json_response": [ + { + "tx": "0200000000010100a8ceb6f76c49c8c0c809ca359461540708a9a5ac56e56e6a7aaafb35f4d3850000000000fdffffff0250c30000000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd0623ff030000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a02473044022064763837f2cc84507eb1fc28c9e95d51174e1da4b8755da8e67fe21e37d0a8b402206295d0f19625f014819361a20572b936d81f6c5ba419e56997e882f3a7be094a012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000", + "txid": "ecba36e93bcf40542d43a05ef550bb0e4be51d766aa2ec8c5640a0d431ab0d06", + "channel_ids": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "channel_id": "060dab31d4a040568ceca26a761de54b0ebb50f55ea0432d5440cf3be936baec", + "channel_type": { + "bits": [ + 12 + ], + "names": [ + "static_remotekey/even" + ] + }, + "outnum": 0 + } + ], + "failed": [] + }, + { + "tx": "020000000001023041611dac05004825ab64781b4a33bf622380bf90196fae689196b1850a1f8f0000000000fdffffff5646519c565466c9588a88400ec71a39a2c0b6988beadb32491a13d9b89f85360100000000fdffffff0250c3000000000000220020181492c29a989f099fd2cf412c74b192dd095e81f4e4f6bec45bd1fbfdd2cfd983720000000000002251203e8a03f678bb7ca048baecc39788530560ea049816d604f72925e425288446c80140caa3b93c6667e4fe0026417cc87ae9dfd16d80018e7c6dcd6dfcee4d6cab7c7e84181baeb95ba25934ad1aa6b57f83c8287bf1b727123350b35549a3abe15b060140b3c6626b9b57081cc7eb5e4f518669764d265fb84316d8fb610e19ede13c5a370c1072861b909ec923acec980adb4a3e488ee3c6f9c49164bd4596945b52f62678000000", + "txid": "1fcc6d46200443ad21e3a1a1628b862bafd0d75c0b4454f5494957097bc7930d", + "channel_ids": [ + { + "id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", + "channel_id": "0d93c77b09574949f554440b5cd7d0af2b868b62a1a1e321ad430420466dcc1f", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "outnum": 0 + } + ], + "failed": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "method": "connect", + "error": { + "code": 401, + "message": "All addresses failed: 127.0.0.1:44663: Connection establishment: Connection refused. " + } + }, + { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "method": "connect", + "error": { + "code": 401, + "message": "All addresses failed: 127.0.0.1:34631: Connection establishment: Connection refused. " + } + } + ] + } + ], + "author": [ + "ZmnSCPxj <> is mainly responsible." + ], + "see_also": [ + "lightning-connect(7)", + "lightning-listfunds()", + "lightning-listpeers(7)", + "lightning-fundchannel(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-multiwithdraw.json b/doc/schemas/lightning-multiwithdraw.json new file mode 100644 index 000000000000..f9dd6a1329ce --- /dev/null +++ b/doc/schemas/lightning-multiwithdraw.json @@ -0,0 +1,153 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "multiwithdraw", + "title": "Command for withdrawing to multiple addresses", + "description": [ + "The **multiwithdraw** RPC command sends funds from Core Lightning's internal wallet to the addresses specified in *outputs*." + ], + "request": { + "required": [ + "outputs" + ], + "properties": { + "outputs": { + "type": "array", + "items": { + "type": "outputdesc" + }, + "description": [ + "An array containing objects of the form `{address: amount}`. The `amount` may be the string *all*, indicating that all onchain funds be sent to the specified address. Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*." + ] + }, + "feerate": { + "type": "feerate", + "description": [ + "Feerate used for the withdrawals. See NOTES in lightning-feerates(7) for possible values." + ], + "default": "*normal*" + }, + "minconf": { + "type": "u32", + "description": [ + "Minimum number of confirmations that used outputs should have." + ], + "default": 1 + }, + "utxos": { + "type": "array", + "items": { + "type": "outpoint", + "description": [ + "Utxos to be used to be withdrawn from, as an array of `txid:vout`. These must be drawn from the node's available UTXO set." + ] + } + } + } + }, + "response": { + "required": [ + "tx", + "txid" + ], + "properties": { + "tx": { + "type": "hex", + "description": [ + "The raw transaction which was sent." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The txid of the **tx**." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:multiwithdraw#1", + "method": "multiwithdraw", + "params": { + "outputs": [ + { + "bcrt1qyusnugshkn6kh5vmdjpe8hylvxlxjy3ns0hmrs": "2222000msat" + }, + { + "bcrt1q6r4vvt7uack33qf9n05umfxy8h5s2rdcmq7ra3": "3333000msat" + } + ], + "feerate": null, + "minconf": null, + "utxos": null + } + }, + { + "id": "example:multiwithdraw#2", + "method": "multiwithdraw", + "params": { + "outputs": [ + { + "BCRT1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KYGT080": 1000 + }, + { + "bcrt1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qzf4jry": 1000 + }, + { + "bcrt1pw508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7k0ylj56": 1000 + }, + { + "BCRT1SW50QT2UWHA": 1000 + }, + { + "bcrt1zw508d6qejxtdg4y5r3zarvaryv2wuatf": 1000 + }, + { + "bcrt1qqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvseswlauz7": 1000 + }, + { + "bcrt1pqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvsesyga46z": 1000 + }, + { + "bcrt1p0xlxvlhemja6c4dqv22uapctqupfhlxm9h8z3k2e72q4k9hcz7vqc8gma6": 1000 + } + ], + "feerate": null, + "minconf": null, + "utxos": null + } + } + ], + "example_json_response": [ + { + "tx": "02000000000101b75863b811587b4c15bb94d9285c31d6369b8ff609e44de399936f8acb268f600000000000fdffffff03050d000000000000160014d0eac62fdcee2d1881259be9cda4c43de9050db8ae0800000000000016001427213e2217b4f56bd19b6c8393dc9f61be691233d4b5f5050000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a0247304402203a001463da125de5615ff1c18f9cd4a1d2a138c91d40189d350821ac8fb3ae4f02207a507eec27e15fe43476233cd9fe8b690ebd265073a58ed18ff79a1416886f18012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000", + "txid": "94e803b98257855569d35b675d65fb4fa0061a8b5f828992e2104a2882bb18bf" + }, + { + "tx": "02000000000101dc5a50dfbafc30697b930b44e763ff7a255475d17d975fa0e2003431312098cf0100000000fdffffff09e803000000000000225120000000c4a5cad46221b2a187905e5266362b99d5e91c6ce24d165dab93e86433e803000000000000046002751ee8030000000000002a5128751e76e8199196d454941c45d1b3a323f1433bd6751e76e8199196d454941c45d1b3a323f1433bd6e80300000000000022512079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f817983b939700000000002251200518e92cd94e0f62c06f126dff98b9abe79b7ed845a156d5245678e26554475de803000000000000160014751e76e8199196d454941c45d1b3a323f1433bd6e8030000000000002200201863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262e803000000000000125210751e76e8199196d454941c45d1b3a323e803000000000000220020000000c4a5cad46221b2a187905e5266362b99d5e91c6ce24d165dab93e8643301407f0d9bc098c5439ff611507b6a7d403047ed4e0b883f293db19d4e109d350a24f790acb55547384ff2a23fcfde0eba9af7cebc321c19cfc4817ecd47d50c2cd854000000", + "txid": "062383a7c9a19a2768939087a5c89826a4ea3531080f20cc06aa1cbf431be505" + } + ], + "errors": [ + "On failure, an error is reported and the withdrawal transaction is not created.", + "", + "- -1: Catchall nonspecific error.", + "- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.", + "- 302: The dust limit is not met." + ], + "author": [ + "ZmnSCPxj <> is mainly responsible." + ], + "see_also": [ + "lightning-listfunds(7)", + "lightning-fundchannel(7)", + "lightning-newaddr(7)", + "lightning-txprepare(7)", + "lightning-withdraw(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-newaddr.json b/doc/schemas/lightning-newaddr.json new file mode 100644 index 000000000000..8da2e56f4168 --- /dev/null +++ b/doc/schemas/lightning-newaddr.json @@ -0,0 +1,88 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "newaddr", + "title": "Command for generating a new address to be used by Core Lightning", + "description": [ + "The **newaddr** RPC command generates a new address which can subsequently be used to fund channels managed by the Core Lightning node.", + "", + "The funding transaction needs to be confirmed before funds can be used.", + "", + "To send an on-chain payment from the Core Lightning node wallet, use `withdraw`." + ], + "request": { + "required": [], + "properties": { + "addresstype": { + "type": "string", + "description": [ + "It specifies the type of address wanted; currently *bech32* (e.g. `tb1qu9j4lg5f9rgjyfhvfd905vw46eg39czmktxqgg` on bitcoin testnet or `bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej` on bitcoin mainnet), or *p2tr* taproot addresses. The special value *all* generates all known address types for the same underlying key." + ], + "default": "*bech32* address", + "enum": [ + "bech32", + "p2tr", + "all" + ] + } + } + }, + "response": { + "required": [], + "properties": { + "p2tr": { + "added": "v23.08", + "type": "string", + "description": [ + "The taproot address." + ] + }, + "bech32": { + "type": "string", + "description": [ + "The bech32 (native segwit) address." + ] + } + } + }, + "errors": [ + "If an unrecognized address type is requested an error message will be returned." + ], + "example_json_request": [ + { + "id": "example:newaddr#1", + "method": "newaddr", + "params": { + "addresstype": null + } + }, + { + "id": "example:newaddr#2", + "method": "newaddr", + "params": { + "addresstype": "bech32" + } + } + ], + "example_json_response": [ + { + "bech32": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf" + }, + { + "bech32": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf" + } + ], + "author": [ + "Felix <> is mainly responsible." + ], + "see_also": [ + "lightning-listfunds(7)", + "lightning-fundchannel(7)", + "lightning-withdraw(7)", + "lightning-listtransactions(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-notifications.json b/doc/schemas/lightning-notifications.json new file mode 100644 index 000000000000..273260d00a22 --- /dev/null +++ b/doc/schemas/lightning-notifications.json @@ -0,0 +1,93 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "notifications", + "title": "Command to set up notifications.", + "description": [ + "The **notifications** the RPC command enabled notifications for this JSON-RPC connection. By default (and for backwards-compatibility) notifications are disabled.", + "", + "Various commands, especially complex and slow ones, offer notifications which indicate their progress." + ], + "request": { + "required": [ + "enable" + ], + "properties": { + "enable": { + "type": "boolean", + "description": [ + "Whether to enable or disable notifications." + ] + } + } + }, + "response": { + "properties": {}, + "post_return_value_notes": [ + "On success, if *enable* was *true*, notifications will be forwarded from then on." + ] + }, + "notifications": [ + "Notifications are JSON-RPC objects without an *id* field. *lightningd* sends notifications (once enabled with this *notifications* command) with a *params* *id* field indicating which command the notification refers to.", + "", + "Implementations should ignore notifications without an *id* parameter, or unknown *method*.", + "", + "Common *method*s include:", + " *message*: param *message*: a descriptional string indicating something which occurred relating to the command. Param *level* indicates the level, as per lightning-getlog(7): *info* and *debug* are typical.", + " *progress*: param *num* and *total*, where *num* starts at 0 and is always less than *total*. Optional param *stage* with fields *num* and *total*, indicating what stage we are progressing through." + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters." + ], + "example_json_notifications": [ + { + "method": "message", + "params": { + "id": 1, + "message": "This is a test message", + "level": "DEBUG" + } + }, + { + "method": "progress", + "params": { + "id": 2, + "num": 0, + "total": 30, + "stage": { + "num": 0, + "total": 2 + } + } + } + ], + "example_json_request": [ + { + "id": "example:notifications#1", + "method": "notifications", + "params": { + "enable": true + } + }, + { + "id": "example:notifications#2", + "method": "notifications", + "params": { + "enable": false + } + } + ], + "example_json_response": [ + {}, + {} + ], + "author": [ + "Rusty Russell <> wrote the initial version of this man page." + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-offer.json b/doc/schemas/lightning-offer.json new file mode 100644 index 000000000000..12f9490c5814 --- /dev/null +++ b/doc/schemas/lightning-offer.json @@ -0,0 +1,216 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "offer", + "title": "Command for accepting payments", + "warning": "experimental-offers only", + "description": [ + "The **offer** RPC command creates an offer (or returns an existing one), which is a precursor to creating one or more invoices. It automatically enables the processing of an incoming invoice_request, and issuing of invoices.", + "", + "Note that for making an offer to *pay* someone else, see lightning- invoicerequest(7)." + ], + "request": { + "required": [ + "amount", + "description" + ], + "properties": { + "amount": { + "oneOf": [ + { + "type": "msat_or_any" + }, + { + "type": "currency" + } + ], + "description": [ + "Can be the string `any`, which creates an offer that can be paid with any amount (e.g. a donation). Otherwise it can be a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. It can also have an ISO 4217 postfix (e.g. USD), in which case currency conversion will need to be done for the invoice itself. A plugin is needed which provides the `currencyconvert` API for this currency, otherwise the offer creation will fail." + ] + }, + "description": { + "type": "string", + "description": [ + "A short description of purpose of the offer, e.g. *coffee*. This value is encoded into the resulting offer and is viewable by anyone you expose this offer to. It must be UTF-8, and cannot use *\\u* JSON escape codes." + ] + }, + "issuer": { + "type": "string", + "description": [ + "Who is issuing this offer (i.e. you) if appropriate." + ] + }, + "label": { + "type": "string", + "description": [ + "An internal-use name for the offer, which can be any UTF-8 string. This is *NOT* encoded in the offer not sent to the issuer." + ] + }, + "quantity_max": { + "type": "u64", + "description": [ + "Invoice can specify more than one of the items up (and including) this maximum: 0 is a special value meaning `no maximuim`. The *amount* for the invoice will need to be multiplied accordingly. This is encoded in the offer." + ] + }, + "absolute_expiry": { + "type": "u64", + "description": [ + "Time the offer is valid until,in seconds since the first day of 1970 UTC. If not set, the offer remains valid (though it can be deactivated by the issuer of course). This is encoded in the offer." + ] + }, + "recurrence": { + "type": "string", + "description": [ + "An invoice is expected at regular intervals. The argument is a positive number followed by one of `seconds`, `minutes`, `hours`, `days`, `weeks`, `months` or `years` (variants without the trailing `s` are also permitted). This is encoded in the offer. The semantics of recurrence is fairly predictable, but fully documented in BOLT 12. e.g. `4weeks`." + ] + }, + "recurrence_base": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "description": [ + "Time in seconds since the first day of 1970 UTC, optionally with a `@` prefix. This indicates when the first period begins; without this, the recurrence periods start from the first invoice. The `@` prefix means that the invoice must start by paying the first period; otherwise it is permitted to start at any period. This is encoded in the offer. e.g. `@1609459200` indicates you must start paying on the 1st January 2021." + ] + }, + "recurrence_paywindow": { + "type": "string", + "description": [ + "Argument of form `-time+time[%]`. The first time is the number of seconds before the start of a period in which an invoice and payment is valid, the second time is the number of seconds after the start of the period. For example *-604800+86400* means you can fetch an pay the invoice 4 weeks before the given period starts, and up to 1 day afterwards. The optional *%* indicates that the amount of the invoice will be scaled by the time remaining in the period. This is encoded in the offer." + ], + "default": "that payment is allowed during the current and previous periods" + }, + "recurrence_limit": { + "type": "u32", + "description": [ + "To indicate the maximum period which exists. eg. `12` means there are 13 periods, from 0 to 12 inclusive. This is encoded in the offer." + ] + }, + "single_use": { + "type": "boolean", + "description": [ + "Indicates that the offer is only valid once; we may issue multiple invoices, but as soon as one is paid all other invoices will be expired (i.e. only one person can pay this offer)." + ], + "default": "False" + } + } + }, + "response": { + "required": [ + "offer_id", + "active", + "single_use", + "bolt12", + "used", + "created" + ], + "properties": { + "offer_id": { + "type": "hash", + "description": [ + "The id of this offer (merkle hash of non-signature fields)." + ] + }, + "active": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Whether this can still be used." + ] + }, + "single_use": { + "type": "boolean", + "description": [ + "Whether this expires as soon as it's paid (reflects the *single_use* parameter)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 encoding of the offer." + ] + }, + "used": { + "type": "boolean", + "description": [ + "True if an associated invoice has been paid." + ] + }, + "created": { + "type": "boolean", + "description": [ + "False if the offer already existed." + ] + }, + "label": { + "type": "string", + "description": [ + "The (optional) user-specified label." + ] + } + } + }, + "errors": [ + "On failure, an error is returned and no offer is created. If the lightning process fails before responding, the caller should use lightning-listoffers(7) to query whether this offer was created or not.", + "", + "If the offer already existed, and is still active, that is returned; if it's not active then this call fails.", + "", + "- -1: Catchall nonspecific error.", + "- 1000: Offer with this offer_id already exists (but is not active)." + ], + "example_json_request": [ + { + "id": "example:offer#1", + "method": "offer", + "params": { + "amount": "1msat", + "description": "test for 1msat" + } + }, + { + "id": "example:offer#2", + "method": "offer", + "params": { + "amount": "100000sat", + "description": "quantity_max test", + "recurrence": "1week" + } + } + ], + "example_json_response": [ + { + "offer_id": "f61cca153d1948dade19349792d9bcdc9cef687fd27db0b553a67979f55aae48", + "active": true, + "single_use": false, + "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqyqs5rn5v4ehggrxdaezqvtdwdshg93pqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq63s", + "used": false, + "created": true + }, + { + "offer_id": "f7a501e51e2a90d032150b9100b1977c625f05cfda22469bdc81d8a20b1e303f", + "active": true, + "single_use": false, + "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqszltcgqpgghzatpde6xjaretakkz7pqw3jhxaqkyypxdeze35wncs2l2u4gfzyrpds00e6yakfrt6ctrw5n9qanzhqr2xq6qgqsw", + "used": false, + "created": true + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listoffers(7)", + "lightning-disableoffer(7)", + "lightning-invoicerequest(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-openchannel_abort.json b/doc/schemas/lightning-openchannel_abort.json new file mode 100644 index 000000000000..1aac1f9b69f8 --- /dev/null +++ b/doc/schemas/lightning-openchannel_abort.json @@ -0,0 +1,93 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "openchannel_abort", + "title": "Command to abort a channel to a peer", + "description": [ + "`openchannel_init` is a low level RPC command which initiates a channel open with a specified peer. It uses the openchannel protocol which allows for interactive transaction construction." + ], + "request": { + "required": [ + "channel_id" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "Channel id of the channel to be aborted." + ] + } + } + }, + "response": { + "required": [ + "channel_id", + "channel_canceled", + "reason" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "The channel id of the aborted channel." + ] + }, + "channel_canceled": { + "type": "boolean", + "description": [ + "Whether this is completely canceled (there may be remaining in-flight transactions)." + ] + }, + "reason": { + "type": "string", + "description": [ + "Usually \"Abort requested\", but if it happened to fail at the same time it could be different." + ] + } + } + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 305: Peer is not connected.", + "- 311: Unknown channel id.", + "- 312: Channel in an invalid state" + ], + "example_json_request": [ + { + "id": "example:openchannel_abort#1", + "method": "openchannel_abort", + "params": { + "channel_id": "aec3dfd0c7643a23b679cd2e493c053f8fdf621ff2624949f9582c4118b818c6" + } + } + ], + "example_json_response": [ + { + "channel_id": "aec3dfd0c7643a23b679cd2e493c053f8fdf621ff2624949f9582c4118b818c6", + "channel_canceled": true, + "reason": "Abort requested" + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-openchannel_init(7)", + "lightning-openchannel_update(7)", + "lightning-openchannel_signed(7)", + "lightning-openchannel_bump(7)", + "lightning-fundchannel_start(7)", + "lightning-fundchannel_complete(7)", + "lightning-fundchannel(7)", + "lightning-fundpsbt(7)", + "lightning-utxopsbt(7)", + "lightning-multifundchannel(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-openchannel_bump.json b/doc/schemas/lightning-openchannel_bump.json new file mode 100644 index 000000000000..7e712e68c248 --- /dev/null +++ b/doc/schemas/lightning-openchannel_bump.json @@ -0,0 +1,172 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "openchannel_bump", + "title": "Command to initiate a channel RBF", + "description": [ + "`openchannel_bump` is a RPC command which initiates a channel RBF (Replace-By-Fee) for the specified channel. It uses the openchannel protocol which allows for interactive transaction construction.", + "", + "Warning: bumping a leased channel will lose the lease." + ], + "request": { + "required": [ + "channel_id", + "amount", + "initialpsbt" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "Id of the channel to RBF." + ] + }, + "amount": { + "type": "sat", + "description": [ + "Satoshi value that we will contribute to the channel. This value will be _added_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel." + ] + }, + "initialpsbt": { + "type": "string", + "description": [ + "The funded, incomplete PSBT that specifies the UTXOs and change output for our channel contribution. It can be updated, see `openchannel_update`; *initialpsbt* must have at least one input. Must have the Non-Witness UTXO (PSBT_IN_NON_WITNESS_UTXO) set for every input. An error (code 309) will be returned if this requirement is not met." + ] + }, + "funding_feerate": { + "type": "feerate", + "description": [ + "Feerate for the funding transaction." + ], + "default": "1/64th greater than the last feerate used for this channel" + } + } + }, + "response": { + "required": [ + "channel_id", + "channel_type", + "psbt", + "commitments_secured", + "funding_serial" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "The channel id of the channel." + ] + }, + "channel_type": { + "type": "object", + "description": [ + "Channel_type as negotiated with peer." + ], + "added": "v24.02", + "additionalProperties": false, + "required": [ + "bits", + "names" + ], + "properties": { + "bits": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + }, + "names": { + "type": "array", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" + ], + "description": [ + "Name of feature bit." + ] + } + } + } + }, + "psbt": { + "type": "string", + "description": [ + "The (incomplete) PSBT of the RBF transaction." + ] + }, + "commitments_secured": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "Whether the *psbt* is complete." + ] + }, + "funding_serial": { + "type": "u64", + "description": [ + "The serial_id of the funding output in the *psbt*." + ] + }, + "requires_confirmed_inputs": { + "type": "boolean", + "description": [ + "Does peer require confirmed inputs in psbt?" + ] + } + }, + "post_return_value_notes": [ + "If the peer does not support `option_dual_fund`, this command will return an error.", + "", + "If the channel is not in a state that is eligible for RBF, this command will return an error." + ] + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 300: The amount exceeded the maximum configured funding amount.", + "- 301: The provided PSBT cannot afford the funding amount.", + "- 305: Peer is not connected.", + "- 309: PSBT missing required fields", + "- 311: Unknown channel id.", + "- 312: Channel in an invalid state" + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-openchannel_init(7)", + "lightning-openchannel_update(7)", + "lightning-openchannel_signed(7)", + "lightning-openchannel_abort(7)", + "lightning-fundchannel_start(7)", + "lightning-fundchannel_complete(7)", + "lightning-fundchannel(7)", + "lightning-fundpsbt(7)", + "lightning-utxopsbt(7)", + "lightning-multifundchannel(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-openchannel_init.json b/doc/schemas/lightning-openchannel_init.json new file mode 100644 index 000000000000..17cc87cadbc1 --- /dev/null +++ b/doc/schemas/lightning-openchannel_init.json @@ -0,0 +1,285 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "openchannel_init", + "title": "Command to initiate a channel to a peer", + "description": [ + "`openchannel_init` is a low level RPC command which initiates a channel open with a specified peer. It uses the openchannel protocol which allows for interactive transaction construction." + ], + "request": { + "required": [ + "id", + "amount", + "initialpsbt" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "Node id of the remote peer." + ] + }, + "amount": { + "type": "sat", + "description": [ + "Satoshi value that we will contribute to the channel. This value will be _added_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel." + ] + }, + "initialpsbt": { + "type": "string", + "description": [ + "Funded, incomplete PSBT that specifies the UTXOs and change output for our channel contribution. It can be updated, see `openchannel_update`; *initialpsbt* must have at least one input. Must have the Non-Witness UTXO (PSBT_IN_NON_WITNESS_UTXO) set for every input. An error (code 309) will be returned if this requirement is not met." + ] + }, + "commitment_feerate": { + "type": "feerate", + "description": [ + "Feerate for commitment transactions for non-anchor channels: see **fundchannel**. For anchor channels, it is ignored." + ] + }, + "funding_feerate": { + "type": "feerate", + "description": [ + "Feerate for the funding transaction." + ], + "default": "'opening' feerate" + }, + "announce": { + "type": "boolean", + "description": [ + "Whether or not to announce this channel." + ] + }, + "close_to": { + "type": "string", + "description": [ + "Bitcoin address to which the channel funds should be sent on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`." + ] + }, + "request_amt": { + "type": "msat", + "description": [ + "An amount of liquidity you'd like to lease from the peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*." + ] + }, + "compact_lease": { + "type": "hex", + "description": [ + "A compact representation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel." + ] + }, + "channel_type": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + } + } + }, + "response": { + "required": [ + "channel_id", + "psbt", + "channel_type", + "commitments_secured", + "funding_serial" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "The channel id of the channel." + ] + }, + "psbt": { + "type": "string", + "description": [ + "The (incomplete) PSBT of the funding transaction." + ] + }, + "channel_type": { + "type": "object", + "description": [ + "Channel_type as negotiated with peer." + ], + "added": "v24.02", + "additionalProperties": false, + "required": [ + "bits", + "names" + ], + "properties": { + "bits": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + }, + "names": { + "type": "array", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" + ], + "description": [ + "Name of feature bit." + ] + } + } + } + }, + "commitments_secured": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "Whether the *psbt* is complete." + ] + }, + "funding_serial": { + "type": "u64", + "description": [ + "The serial_id of the funding output in the *psbt*." + ] + }, + "requires_confirmed_inputs": { + "type": "boolean", + "description": [ + "Does peer require confirmed inputs in psbt?" + ] + } + }, + "post_return_value_notes": [ + "If the peer does not support `option_dual_fund`, this command will return an error.", + "", + "If you sent a *request_amt* and the peer supports `option_will_fund` and is interested in leasing you liquidity in this channel, returns their updated channel fee max (*channel_fee_proportional_basis*, *channel_fee_base_msat*), updated rate card for the lease fee (*lease_fee_proportional_basis*, *lease_fee_base_sat*) and their on-chain weight *weight_charge*, which will be added to the lease fee at a rate of *funding_feerate* * *weight_charge* / 1000." + ] + }, + "example_json_request": [ + { + "id": "example:openchannel_init#1", + "method": "openchannel_init", + "params": { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount": 999000, + "initialpsbt": "cHNidP8BADMCAAAAAYbThUhSzYr7ph6Z434bdcW7eoirYOFMmUt2GXZ79sF/AQAAAAD9////AGYAAAAAAQDeAgAAAAABARVD4QKlmwy8SNcNypf1o9TzbIFZjj4dqVzHAL0SLDoTAAAAAAD9////AjOv9ikBAAAAFgAUXJGglH7At5HOVY4ZHp0+19kv655AQg8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgVIxRXqIykOOxm/6YPaFFx2Qh1618qlXPUhDiliVQ2KUCIHQcHniUTcm1XT8SyRE8ev52jm0uiIYum15XcR/tPh+NASEC3Pby7xL4+Ig/Z8TchQ0QT1upLGet3da8qjSjgHO9LOJlAAAAAQEfQEIPAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=", + "commitment_feerate": null, + "funding_feerate": null, + "announce": true, + "close_to": null, + "request_amt": null, + "channel_type": [ + 12, + 22 + ] + } + }, + { + "id": "example:openchannel_init#2", + "method": "openchannel_init", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount": 16777216, + "initialpsbt": "cHNidP8BADMCAAAAAQVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAAAAAAD9////AGYAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=", + "commitment_feerate": null, + "funding_feerate": null, + "announce": true, + "close_to": null, + "request_amt": null, + "channel_type": null + } + } + ], + "example_json_response": [ + { + "channel_id": "53fa2b1ca0d8f21abeaaac0495ab9925cdfaf2ca8b04dbe4aeb061823e1ff2c8", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABARVD4QKlmwy8SNcNypf1o9TzbIFZjj4dqVzHAL0SLDoTAAAAAAD9////AjOv9ikBAAAAFgAUXJGglH7At5HOVY4ZHp0+19kv655AQg8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgVIxRXqIykOOxm/6YPaFFx2Qh1618qlXPUhDiliVQ2KUCIHQcHniUTcm1XT8SyRE8ev52jm0uiIYum15XcR/tPh+NASEC3Pby7xL4+Ig/Z8TchQ0QT1upLGet3da8qjSjgHO9LOJlAAAAAQEfQEIPAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIIbThUhSzYr7ph6Z434bdcW7eoirYOFMmUt2GXZ79sF/AQ8EAQAAAAEQBP3///8M/AlsaWdodG5pbmcBCMCDK/6LyRi8AAEDCFg+DwAAAAAAAQQiACDYM+8ZRsbTj0OCG/yzqLt2buFQn9LuMPDZqFFcgmCmfAz8CWxpZ2h0bmluZwEIchtFHfZ5FBgA", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "commitments_secured": false, + "funding_serial": 8222241539686471000, + "requires_confirmed_inputs": false + }, + { + "channel_id": "252d1b0a1e57895e84137f28cf19ab2c35847e284c112fefdecc7afeaa5c1de7", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCLR8RjOq9lmcAAEDCAAAAAEAAAAAAQQiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQz8CWxpZ2h0bmluZwEIZZtc7LD4y9YA", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "commitments_secured": false, + "funding_serial": 7321547790872006000, + "requires_confirmed_inputs": false + } + ], + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 300: The amount exceeded the maximum configured funding amount.", + "- 301: The provided PSBT cannot afford the funding amount.", + "- 304: Still syncing with bitcoin network", + "- 305: Peer is not connected.", + "- 306: Unknown peer id.", + "- 309: PSBT missing required fields", + "- 310: v2 channel open protocol not supported by peer", + "- 312: Channel in an invalid state" + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-openchannel_update(7)", + "lightning-openchannel_signed(7)", + "lightning-openchannel_abort(7)", + "lightning-openchannel_bump(7)", + "lightning-fundchannel_start(7)", + "lightning-fundchannel_complete(7)", + "lightning-fundchannel(7)", + "lightning-fundpsbt(7)", + "lightning-utxopsbt(7)", + "lightning-multifundchannel(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-openchannel_signed.json b/doc/schemas/lightning-openchannel_signed.json new file mode 100644 index 000000000000..86666340ce3b --- /dev/null +++ b/doc/schemas/lightning-openchannel_signed.json @@ -0,0 +1,90 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "openchannel_signed", + "title": "Command to conclude a channel open", + "description": [ + "`openchannel_signed` is a low level RPC command which concludes a channel open with the specified peer. It uses the v2 openchannel protocol, which allows for interactive transaction construction.", + "", + "This command should be called after `openchannel_update` returns *commitments_secured* `true`.", + "", + "This command will broadcast the finalized funding transaction, if we receive valid signatures from the peer." + ], + "request": { + "required": [ + "channel_id", + "signed_psbt" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "Id of the channel." + ] + }, + "signed_psbt": { + "type": "string", + "description": [ + "The PSBT returned from `openchannel_update` (where *commitments_secured* was true) with partial signatures or finalized witness stacks included for every input that we contributed to the PSBT." + ] + } + } + }, + "response": { + "required": [ + "channel_id", + "tx", + "txid" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "The channel id of the channel." + ] + }, + "tx": { + "type": "hex", + "description": [ + "The funding transaction." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The txid of the **tx**." + ] + } + } + }, + "errors": [ + "On error, the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 303: Funding transaction broadcast failed.", + "- 305: Peer is not connected.", + "- 309: PSBT missing required fields.", + "- 311: Unknown channel id.", + "- 312: Channel in an invalid state" + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-openchannel_init(7)", + "lightning-openchannel_update(7)", + "lightning-openchannel_abort(7)", + "lightning-openchannel_bump(7)", + "lightning-fundchannel_start(7)", + "lightning-fundchannel_complete(7)", + "lightning-fundchannel(7)", + "lightning-fundpsbt(7)", + "lightning-utxopsbt(7)", + "lightning-multifundchannel(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-openchannel_update.json b/doc/schemas/lightning-openchannel_update.json new file mode 100644 index 000000000000..0c430268fbbf --- /dev/null +++ b/doc/schemas/lightning-openchannel_update.json @@ -0,0 +1,258 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "openchannel_update", + "title": "Command to update a collab channel open", + "description": [ + "`openchannel_update` is a low level RPC command which continues an open channel, as specified by *channel_id*. An updated *psbt* is passed in; any changes from the PSBT last returned (either from `openchannel_init` or a previous call to `openchannel_update`) will be communicated to the peer.", + "", + "Must be called after `openchannel_init` and before `openchannel_signed`.", + "", + "Must be called until *commitments_secured* is returned as true, at which point `openchannel_signed` should be called with a signed version of the PSBT returned by the last call to `openchannel_update`." + ], + "request": { + "required": [ + "channel_id", + "psbt" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "Id of the channel." + ] + }, + "psbt": { + "type": "string", + "description": [ + "Updated PSBT to be sent to the peer. May be identical to the PSBT last returned by either `openchannel_init` or `openchannel_update`." + ] + } + } + }, + "response": { + "required": [ + "channel_id", + "psbt", + "commitments_secured", + "channel_type", + "funding_outnum" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "The channel id of the channel." + ] + }, + "channel_type": { + "type": "object", + "description": [ + "Channel_type as negotiated with peer." + ], + "added": "v24.02", + "additionalProperties": false, + "required": [ + "bits", + "names" + ], + "properties": { + "bits": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + }, + "names": { + "type": "array", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" + ], + "description": [ + "Name of feature bit." + ] + } + } + } + }, + "psbt": { + "type": "string", + "description": [ + "The PSBT of the funding transaction." + ] + }, + "commitments_secured": { + "type": "boolean", + "description": [ + "Whether the *psbt* is complete (if true, sign *psbt* and call `openchannel_signed` to complete the channel open)." + ] + }, + "funding_outnum": { + "type": "u32", + "description": [ + "The index of the funding output in the psbt." + ] + }, + "close_to": { + "type": "hex", + "description": [ + "Scriptpubkey which we have to close to if we mutual close." + ] + }, + "requires_confirmed_inputs": { + "type": "boolean", + "description": [ + "Does peer require confirmed inputs in psbt?" + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "commitments_secured": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "additionalProperties": true, + "required": [ + "channel_id", + "funding_outnum" + ], + "properties": { + "commitments_secured": {}, + "channel_id": { + "type": "hash", + "description": [ + "The derived channel id." + ] + }, + "close_to": { + "type": "hex", + "description": [ + "If a `close_to` address was provided to `openchannel_init` and the peer supports `option_upfront_shutdownscript`." + ] + }, + "funding_outnum": { + "type": "u32", + "description": [ + "The index of the funding output for this channel in the funding transaction." + ] + } + } + }, + "else": { + "additionalProperties": false, + "properties": { + "commitments_secured": {} + } + } + } + ] + }, + "errors": [ + "On error, the returned object will contain `code` and `message` properties,", + "with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 305: Peer is not connected.", + "- 309: PSBT missing required fields", + "- 311: Unknown channel id.", + "- 312: Channel in an invalid state" + ], + "example_json_request": [ + { + "id": "example:openchannel_update#1", + "method": "openchannel_update", + "params": { + "channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA" + } + }, + { + "id": "example:openchannel_update#2", + "method": "openchannel_update", + "params": { + "channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA" + } + } + ], + "example_json_response": [ + { + "channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "commitments_secured": true, + "funding_outnum": 0 + }, + { + "channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "commitments_secured": true, + "funding_outnum": 0, + "close_to": "5120eed745804da9784cc203f563efa99ffa54fdf01b137bc964e63c3124070ffbe6" + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-openchannel_init(7)", + "lightning-openchannel_signed(7)", + "lightning-openchannel_bump(7)", + "lightning-openchannel_abort(7)", + "lightning-fundchannel_start(7)", + "lightning-fundchannel_complete(7)", + "lightning-fundchannel(7)", + "lightning-fundpsbt(7)", + "lightning-utxopsbt(7)", + "lightning-multifundchannel(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-parsefeerate.json b/doc/schemas/lightning-parsefeerate.json new file mode 100644 index 000000000000..378c835dbb28 --- /dev/null +++ b/doc/schemas/lightning-parsefeerate.json @@ -0,0 +1,90 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "parsefeerate", + "title": "Command for parsing a feerate string to a feerate", + "description": [ + "The **parsefeerate** command returns the current feerate for any valid *feerate_str*. This is useful for finding the current feerate that a **fundpsbt** or **utxopsbt** command might use." + ], + "request": { + "required": [ + "feerate_str" + ], + "properties": { + "feerate_str": { + "type": "string", + "description": [ + "The feerate string to parse." + ] + } + } + }, + "response": { + "required": [], + "properties": { + "perkw": { + "type": "u32", + "description": [ + "Value of *feerate_str* in kilosipa." + ], + "additionalProperties": false + } + } + }, + "example_json_request": [ + { + "id": "example:parsefeerate#1", + "method": "parsefeerate", + "params": [ + "unilateral_close" + ] + }, + { + "id": "example:parsefeerate#2", + "method": "parsefeerate", + "params": [ + "9999perkw" + ] + }, + { + "id": "example:parsefeerate#3", + "method": "parsefeerate", + "params": [ + 10000 + ] + }, + { + "id": "example:parsefeerate#4", + "method": "parsefeerate", + "params": [ + "urgent" + ] + } + ], + "example_json_response": [ + { + "perkw": 11000 + }, + { + "perkw": 9999 + }, + { + "perkw": 2500 + }, + { + "perkw": 11000 + } + ], + "errors": [ + "The **parsefeerate** command will error if the *feerate_str* format is not recognized.", + "", + "- -32602: If the given parameters are wrong." + ], + "trivia": [ + "In CLN we like to call the weight unit \"sipa\" in honor of Pieter Wuille, who uses the name \"sipa\" on IRC and elsewhere. Internally we call the *perkw* style as \"feerate per kilosipa\"." + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-pay.json b/doc/schemas/lightning-pay.json new file mode 100644 index 000000000000..6e92e874656a --- /dev/null +++ b/doc/schemas/lightning-pay.json @@ -0,0 +1,265 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "pay", + "title": "Command for sending a payment to a BOLT11 invoice", + "description": [ + "The **pay** RPC command attempts to find a route to the given destination, and send the funds it asks for. .", + "", + "The response will occur when the payment fails or succeeds. Once a payment has succeeded, calls to **pay** with the same *bolt11* will succeed immediately.", + "", + "When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name." + ], + "request": { + "required": [ + "bolt11" + ], + "properties": { + "bolt11": { + "type": "string", + "description": [ + "Bolt11 invoice, if **experimental-offers** is enabled, it can actually be a bolt12 invoice, such as one received from lightningd-fetchinvoice(7). If it does not contain an amount, *amount_msat* is required, otherwise if it is specified it must be *null*." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "*amount_msat* is in millisatoshi precision; it can be a whole number, or a whole number with suffix *msat* or *sat*, or a three decimal point number with suffix *sat*, or an 1 to 11 decimal point number suffixed by *btc*." + ] + }, + "label": { + "type": "string", + "description": [ + "It is used to attach a label to payments, and is returned in lightning- listpays(7) and lightning-listsendpays(7)." + ] + }, + "riskfactor": { + "type": "number", + "description": [ + "The *riskfactor* is described in detail in lightning-getroute(7)." + ], + "default": "10" + }, + "maxfeepercent": { + "type": "number", + "description": [ + "Percentage of the amount that is to be paid." + ], + "default": "0.5" + }, + "retry_for": { + "type": "u16", + "description": [ + "Until *retry_for* seconds passes, the command will keep finding routes and retrying the payment." + ], + "default": "60 seconds" + }, + "maxdelay": { + "type": "u16", + "description": [ + "A payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case." + ] + }, + "exemptfee": { + "type": "msat", + "description": [ + "This option can be used for tiny payments which would be dominated by the fee leveraged by forwarding nodes. Setting `exemptfee` allows the `maxfeepercent` check to be skipped on fees that are smaller than `exemptfee`." + ], + "default": "5000 millisatoshi" + }, + "localinvreqid": { + "type": "hex", + "description": [ + "`localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7). This ensures that we only make a single payment for an offer, and that the offer is marked `used` once paid." + ] + }, + "exclude": { + "type": "array", + "description": [ + "*exclude* is a JSON array of short-channel-id/direction (e.g. [ '564334x877x1/0', '564195x1292x0/1' ]) or pubkey which should be excluded from consideration for routing." + ], + "default": "not to exclude any channels or nodes", + "items": { + "oneOf": [ + { + "type": "short_channel_id_dir" + }, + { + "type": "pubkey" + } + ] + } + }, + "maxfee": { + "type": "msat", + "description": [ + "*maxfee* overrides both *maxfeepercent* and *exemptfee* defaults (and if you specify *maxfee* you cannot specify either of those), and creates an absolute limit on what fee we will pay. This allows you to implement your own heuristics rather than the primitive ones used here." + ] + }, + "description": { + "type": "string", + "description": [ + "It is only required for bolt11 invoices which do not contain a description themselves, but contain a description hash: in this case *description* is required. *description* is then checked against the hash inside the invoice before it will be paid." + ] + } + } + }, + "response": { + "required": [ + "payment_preimage", + "payment_hash", + "created_at", + "parts", + "amount_msat", + "amount_sent_msat", + "status" + ], + "properties": { + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash**." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "created_at": { + "type": "number", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "parts": { + "type": "u32", + "description": [ + "How many attempts this took." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount the recipient received." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "Total amount we sent (including fees)." + ] + }, + "warning_partial_completion": { + "type": "string", + "description": [ + "Not all parts of a multi-part payment have completed." + ] + }, + "status": { + "type": "string", + "enum": [ + "complete", + "pending", + "failed" + ], + "description": [ + "Status of payment." + ] + } + }, + "post_return_value_notes": [ + "You can monitor the progress and retries of a payment using the lightning-paystatus(7) command." + ] + }, + "randomization": [ + "To protect user privacy, the payment algorithm performs some randomization.", + "", + "1: Route Randomization", + "", + "Route randomization means the payment algorithm does not always use the lowest-fee or shortest route. This prevents some highly-connected node from learning all of the user payments by reducing their fees below the network average.", + "", + "2: Shadow Route", + "", + "Shadow route means the payment algorithm will virtually extend the route by adding delays and fees along it, making it appear to intermediate nodes that the route is longer than it actually is. This prevents intermediate nodes from reliably guessing their distance from the payee.", + "", + "Route randomization will never exceed *maxfeepercent* of the payment. Route randomization and shadow routing will not take routes that would exceed *maxdelay*." + ], + "errors": [ + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error.", + "- 201: Already paid with this *hash* using different amount or destination.", + "- 203: Permanent failure at destination. The *data* field of the error will be routing failure object (except for self-payment, which currently returns the error directly from lightning-sendpay(7)).", + "- 205: Unable to find a route.", + "- 206: Route too expensive. Either the fee or the needed total locktime for the route exceeds your *maxfeepercent* or *maxdelay* settings, respectively. The *data* field of the error will indicate the actual *fee* as well as the *feepercent* percentage that the fee has of the destination payment amount. It will also indicate the actual *delay* along the route.", + "- 207: Invoice expired. Payment took too long before expiration, or already expired at the time you initiated payment. The *data* field of the error indicates *now* (the current time) and *expiry* (the invoice expiration) as UNIX epoch time in seconds.", + "- 210: Payment timed out without a payment in progress.", + "", + "Error codes 202 and 204 will only get reported at **sendpay**; in **pay** we will keep retrying if we would have gotten those errors.", + "", + "A routing failure object has the fields below:", + "", + "*erring_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on.", + "*erring_node*: The hex string of the pubkey id of the node that reported the error.", + "*erring_channel*: The short channel ID of the channel that has the error, or *0:0:0* if the destination node raised the error.", + "*failcode*: The failure code, as per BOLT #4.", + "*channel_update*: The hex string of the *channel_update* message received from the remote node. Only present if error is from the remote node and the *failcode* has the UPDATE bit set, as per BOLT #4.", + "", + "The *data* field of errors will include statistics *getroute_tries* and *sendpay_tries*. It will also contain a *failures* field with detailed data about routing errors." + ], + "example_json_request": [ + { + "id": "example:pay#1", + "method": "pay", + "params": { + "bolt11": "lni1qqgxr7gha7gusyg83lsr8qcqg4axgq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqtypg3hgetnwsszycn0d36rzv3zypjx2umrwf5hqarfdahzcg8sn7jmpuyl423pvggzvmj9nrga83q474e2sjygxzmq7ln5fmvjxh4skxafx2pmx9wqx5v9qgqxyfhyvyg6pdvu4tcjvpp7kkal9rp57wj7xv4pl3ajku70rzy3pavzzqjz06c8s2vvmrpjlkcse0txx0gmc6jalqqxmeyjm75qcnfnqxwyt2sfsqnxu3vc68fug904w25y3zpskc8huazwmy34av93h2fjswe3tsp4rqpe8qlx9xssexfc0aguke3q6u0jgw2qmn008mzu04mkmqmjmhes3gcpqdqdnzl270s48vsp635rd4jm04snvgkcp65qlkgp8qztu2mdp7c5uqpj2rll3pzu56st537rct3v62gfqeamzthjuwkr0pkvsdnnffpn4sq9sz0lryaufktx0nfxlffum3yesqev5gwqqqqqqqqqqqqqqqzsqqqqqqqqqqqqr5jt9hav2gqqqqqq5szxtvwkyz5zq2000hlwvadejz366lqjt9sd2j4rf5tfd9rgmmyegt4dqd34cf6v4gqkfvppqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq633uzqn3n74ccym4wcvq20vsx7lmk450kprpvlrh4cukk8xy9ptjcef4rnhytnkyn4vnxxtd57yeaksze2s30y26cs6u3rjd9322eg9puk24q", + "amount_msat": null, + "label": null, + "riskfactor": null, + "maxfeepercent": null, + "retry_for": null, + "maxdelay": null, + "exemptfee": null, + "localinvreqid": null, + "exclude": null, + "maxfee": null, + "description": null + } + } + ], + "example_json_response": [ + { + "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "payment_hash": "29ef7dfee675b990a3ad7c125960d54aa34d16969468dec9942ead03635c274c", + "created_at": 1706153504.76628, + "parts": 1, + "amount_msat": 100, + "amount_sent_msat": 100, + "payment_preimage": "6634c1b549c6615d234832f377e06d5a5ab088c40cebdc5cfb8c1262030abcad", + "status": "complete" + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listpays(7)", + "lightning-decodepay(7)", + "lightning-listinvoice(7)", + "lightning-delinvoice(7)", + "lightning-getroute(7)", + "lightning-invoice(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-ping.json b/doc/schemas/lightning-ping.json new file mode 100644 index 000000000000..7d2fef724cc7 --- /dev/null +++ b/doc/schemas/lightning-ping.json @@ -0,0 +1,92 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "ping", + "title": "Command to check if a node is up.", + "description": [ + "The **ping** command checks if the node with *id* is ready to talk. It currently only works for peers we have a channel with." + ], + "request": { + "required": [ + "id" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The pubkey of the node to ping." + ] + }, + "len": { + "type": "u16", + "description": [ + "The length of the ping." + ], + "default": "128" + }, + "pongbytes": { + "type": "u16", + "description": [ + "The length of the reply. A value of 65532 to 65535 means `don't reply`." + ], + "default": "128" + } + } + }, + "response": { + "required": [ + "totlen" + ], + "properties": { + "totlen": { + "type": "u16", + "description": [ + "The answer length of the reply message (including header: 0 means no reply expected)." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:ping#1", + "method": "ping", + "params": { + "len": 128, + "pongbytes": 128 + } + }, + { + "id": "example:ping#2", + "method": "ping", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "len": 1000, + "pongbytes": 65535 + } + } + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters or we're already waiting for a ping response from peer." + ], + "example_json_response": [ + { + "totlen": 132 + }, + { + "totlen": 0 + } + ], + "author": [ + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." + ], + "see_also": [ + "lightning-connect(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-plugin.json b/doc/schemas/lightning-plugin.json new file mode 100644 index 000000000000..e294c1fda836 --- /dev/null +++ b/doc/schemas/lightning-plugin.json @@ -0,0 +1,291 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": true, + "rpc": "plugin", + "title": "Manage plugins with RPC", + "description": [ + "The **plugin** RPC command can be used to control dynamic plugins, i.e. plugins that declared themself 'dynamic' (in getmanifest)." + ], + "request": { + "required": [ + "subcommand" + ], + "oneOfMany": [ + [ + "plugin", + "directory" + ] + ], + "properties": { + "subcommand": { + "type": "string", + "enum": [ + "start", + "stop", + "rescan", + "startdir", + "list" + ], + "description": [ + "Determines what action is taken:", + " - *subcommand* **start** takes a *path* to an executable as argument and starts it as plugin. *path* may be an absolute path or a path relative to the plugins directory (default *~/.lightning/plugins*). If the plugin is already running and the executable (checksum) has changed, the plugin is killed and restarted except if its an important (or builtin) plugin. If the plugin doesn't complete the 'getmanifest' and 'init' handshakes within 60 seconds, the command will timeout and kill the plugin. Additional *options* may be passed to the plugin, but requires all parameters to be passed as keyword=value pairs using the `-k|--keyword` option which is recommended. For example the following command starts the plugin helloworld.py (present in the plugin directory) with the option greeting set to 'A crazy':", + " ```shell.", + " lightning-cli -k plugin subcommand=start plugin=helloworld.py greeting='A crazy'.", + " ```.", + " - *subcommand* **stop** takes a plugin executable *path* or *name* as argument and stops the plugin. If the plugin subscribed to 'shutdown', it may take up to 30 seconds before this command returns. If the plugin is important and dynamic, this will shutdown `lightningd`.", + " - *subcommand* **startdir** starts all executables it can find in *directory* (excl. subdirectories) as plugins. Checksum and timeout behavior as in **start** applies.", + " - *subcommand* **rescan** starts all plugins in the default plugins directory (default *~/.lightning/plugins*) that are not already running. Checksum and timeout behavior as in **start** applies.", + " - *subcommand* **list** lists all running plugins (incl. non-dynamic)." + ] + }, + "plugin": { + "type": "string", + "description": [ + "*path* or *name* of a plugin executable to start or stop." + ] + }, + "directory": { + "type": "string", + "description": [ + "*path* of a directory containing plugins." + ] + }, + "options": { + "type": "array", + "items": { + "type": "string", + "description": [ + "*keyword=value* options passed to plugin, can be repeated." + ] + } + } + } + }, + "response": { + "required": [ + "command" + ], + "properties": { + "command": { + "type": "string", + "enum": [ + "start", + "stop", + "rescan", + "startdir", + "list" + ], + "description": [ + "The subcommand this is responding to." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "command": { + "type": "string", + "enum": [ + "start", + "startdir", + "rescan", + "list" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "command", + "plugins" + ], + "properties": { + "command": {}, + "plugins": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "name", + "active", + "dynamic" + ], + "properties": { + "name": { + "type": "string", + "description": [ + "Full pathname of the plugin." + ] + }, + "active": { + "type": "boolean", + "description": [ + "Status; plugin completed init and is operational, plugins are configured asynchronously." + ] + }, + "dynamic": { + "type": "boolean", + "description": [ + "Plugin can be stopped or started without restarting lightningd." + ] + } + } + } + } + } + } + }, + { + "if": { + "properties": { + "command": { + "type": "string", + "enum": [ + "stop" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "command", + "result" + ], + "properties": { + "command": {}, + "result": { + "type": "string", + "description": [ + "A message saying it successfully stopped." + ] + } + } + } + } + ] + }, + "errors": [ + "On error, the reason why the action could not be taken upon the plugin is returned." + ], + "example_json_request": [ + { + "id": "example:plugin#1", + "method": "plugin", + "params": [ + "list" + ] + }, + { + "id": "example:plugin#2", + "method": "plugin", + "params": { + "subcommand": "stop", + "plugin": "fail_htlcs.py" + } + } + ], + "example_json_response": [ + { + "command": "list", + "plugins": [ + { + "name": "~/lightning/plugins/autoclean", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/chanbackup", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/bcli", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/commando", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/funder", + "active": true, + "dynamic": true + }, + { + "name": "~/lightning/plugins/topology", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/keysend", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/offers", + "active": true, + "dynamic": true + }, + { + "name": "~/lightning/plugins/pay", + "active": true, + "dynamic": true + }, + { + "name": "~/lightning/plugins/txprepare", + "active": true, + "dynamic": true + }, + { + "name": "~/lightning/plugins/cln-renepay", + "active": true, + "dynamic": true + }, + { + "name": "~/lightning/plugins/spenderp", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/sql", + "active": true, + "dynamic": true + }, + { + "name": "~/lightning/plugins/bookkeeper", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/target/debug/examples/cln-plugin-startup", + "active": true, + "dynamic": false + } + ] + }, + { + "command": "stop", + "result": "Successfully stopped fail_htlcs.py." + } + ], + "author": [ + "Antoine Poinsot <> is mainly responsible." + ], + "see_also": [ + "lightning-cli(1)", + "lightning-listconfigs(1)", + "[writing plugins][writing plugins]" + ], + "resources": [ + "Main web site: ", + "", + "[writing plugins]: PLUGINS.md" + ] +} diff --git a/doc/schemas/lightning-preapproveinvoice.json b/doc/schemas/lightning-preapproveinvoice.json new file mode 100644 index 000000000000..f5d410981a2e --- /dev/null +++ b/doc/schemas/lightning-preapproveinvoice.json @@ -0,0 +1,45 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.02", + "rpc": "preapproveinvoice", + "title": "Ask the HSM to preapprove an invoice (low-level)", + "description": [ + "The **preapproveinvoice** RPC command submits the *bolt11* invoice to the HSM to check that it is approved for payment.", + "", + "Generally the **preapproveinvoice** request does not need to be made explicitly, it is automatically generated as part of a **pay** request.", + "", + "By default, the HSM will approve all **preapproveinvoice** requests.", + "", + "If a remote signer is being used it might decline an **preapproveinvoice** request because it would exceed velocity controls, is not covered by allowlist controls, was declined manually, or other reasons.", + "", + "If a remote signer declines a **preapproveinvoice** request a subsequent attempt to pay the invoice anyway will fail; the signer will refuse to sign the commitment." + ], + "request": { + "required": [ + "bolt11" + ], + "properties": { + "bolt11": { + "type": "string", + "description": [ + "Bolt11 invoice to submit to the HSM to check." + ], + "added": "v23.02" + } + } + }, + "response": { + "properties": {} + }, + "author": [ + "Ken Sedgwick <> is mainly responsible." + ], + "see_also": [ + "lightning-pay(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-preapprovekeysend.json b/doc/schemas/lightning-preapprovekeysend.json new file mode 100644 index 000000000000..611a10d4d5d3 --- /dev/null +++ b/doc/schemas/lightning-preapprovekeysend.json @@ -0,0 +1,63 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.02", + "rpc": "preapprovekeysend", + "title": "Ask the HSM to preapprove a keysend payment (low-level)", + "description": [ + "The **preapprovekeysend** RPC command submits the *destination*, *payment_hash*, and *amount_msat* parameters to the HSM to check that they are approved as a keysend payment.", + "", + "Generally the **preapprovekeysend** request does not need to be made explicitly, it is automatically generated as part of a **keysend** request.", + "", + "By default, the HSM will approve all **preapprovekeysend** requests.", + "", + "If a remote signer is being used it might decline an **preapprovekeysend** request because it would exceed velocity controls, is not covered by allowlist controls, was declined manually, or other reasons.", + "", + "If a remote signer declines a **preapprovekeysend** request a subsequent attempt to pay the keysend anyway will fail; the signer will refuse to sign the commitment." + ], + "request": { + "required": [ + "destination", + "payment_hash", + "amount_msat" + ], + "properties": { + "destination": { + "type": "pubkey", + "description": [ + "It is a 33 byte, hex-encoded, node ID of the node that the payment should go to." + ], + "added": "v23.02" + }, + "payment_hash": { + "type": "hex", + "added": "v23.02", + "description": [ + "It is the unique identifier of a payment." + ], + "maxLength": 64, + "minLength": 64 + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount to send in millisatoshi precision; it can be a whole number, or a whole number with suffix `msat` or `sat`, or a three decimal point number with suffix `sat`, or an 1 to 11 decimal point number suffixed by `btc`." + ], + "added": "v23.02" + } + } + }, + "response": { + "properties": {} + }, + "author": [ + "Ken Sedgwick <> is mainly responsible." + ], + "see_also": [ + "lightning-keysend(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-recover.json b/doc/schemas/lightning-recover.json new file mode 100644 index 000000000000..d83631939f75 --- /dev/null +++ b/doc/schemas/lightning-recover.json @@ -0,0 +1,72 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "recover", + "title": "Reinitialize Your Node for Recovery", + "description": [ + "The **recover** RPC command wipes your node and restarts it with the `--recover` option. This is only permitted if the node is unused: no channels, no bitcoin addresses issued (you can use `check` to see if recovery is possible).", + "", + "*hsmsecret* is either a codex32 secret starting with \"cl1\" as returned by `hsmtool getcodexsecret`, or a raw 64 character hex string.", + "", + "NOTE: this command only currently works with the `sqlite3` database backend." + ], + "request": { + "required": [ + "hsmsecret" + ], + "properties": { + "hsmsecret": { + "type": "string", + "description": [ + "Either a codex32 secret starting with `cl1` as returned by `hsmtool getcodexsecret`, or a raw 64 character hex string." + ] + } + } + }, + "response": { + "required": [ + "result" + ], + "properties": { + "result": { + "type": "string", + "added": "v24.05", + "enum": [ + "Recovery restart in progress" + ] + } + } + }, + "example_json_request": [ + { + "id": "example:recover#1", + "method": "recover", + "params": { + "hsmsecret": "cl10leetsd35kw6r5de5kueedxgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqdeuq7xuh94k9g" + } + }, + { + "id": "example:recover#2", + "method": "recover", + "params": { + "hsmsecret": "6c696768746e696e672d31000000000000000000000000000000000000000000" + } + } + ], + "example_json_response": [ + {}, + { + "result": "Recovery restart in progress" + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-hsmtool(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-recoverchannel.json b/doc/schemas/lightning-recoverchannel.json new file mode 100644 index 000000000000..168731ccc9de --- /dev/null +++ b/doc/schemas/lightning-recoverchannel.json @@ -0,0 +1,71 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "recoverchannel", + "title": "Command for recovering channels bundeled in an array in the form of *Static Backup*", + "description": [ + "The **recoverchannel** RPC command tries to force the peer (with whom you already had a channel) to close the channel and sweeps on-chain fund. This method is not spontaneous and depends on the peer, so use it in case of severe data loss.", + "", + "The *scb* parameter is an array containing minimum required info to reconnect and sweep funds. You can get the scb for already stored channels by using the RPC command 'staticbackup'." + ], + "request": { + "required": [ + "scb" + ], + "properties": { + "scb": { + "type": "array", + "description": [ + "SCB of the channels in an array." + ], + "items": { + "type": "hex" + } + } + } + }, + "response": { + "required": [ + "stubs" + ], + "properties": { + "stubs": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Channel IDs of channels successfully inserted." + ] + } + } + } + }, + "example_json_request": [ + { + "id": "example:recoverchannel#1", + "method": "recoverchannel", + "params": [ + [ + "0000000000000001c3a7b9d74a174497122bc52d74d6d69836acadc77e0429c6d8b68b48d5c9139a022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d5904017f0000019f0bc3a7b9d74a174497122bc52d74d6d69836acadc77e0429c6d8b68b48d5c9139a0000000000000000000186a000021000" + ] + ] + } + ], + "example_json_response": [ + { + "stubs": [ + "c3a7b9d74a174497122bc52d74d6d69836acadc77e0429c6d8b68b48d5c9139a" + ] + } + ], + "author": [ + "Aditya <> is mainly responsible." + ], + "see_also": [ + "lightning-getsharedsecret(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-renepay.json b/doc/schemas/lightning-renepay.json new file mode 100644 index 000000000000..23453afb87e9 --- /dev/null +++ b/doc/schemas/lightning-renepay.json @@ -0,0 +1,216 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "renepay", + "title": "Command for sending a payment to a BOLT11 invoice", + "added": "v23.08", + "description": [ + "**renepay** is a new payment plugin based on Pickhardt-Richter optimization method for Multi-Path-Payments. This implementation has not been thoroughly tested and it should be used with caution.", + "", + "The response will occur when the payment fails or succeeds. Once a payment has succeeded, calls to **renepay** with the same *invstring* will not lead to a new payment attempt, but instead it will succeed immediately.", + "", + "When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name." + ], + "request": { + "required": [ + "invstring" + ], + "properties": { + "invstring": { + "type": "string", + "description": [ + "Bolt11 invoice which the RPC command attempts to pay. Currently, **renepay** supports bolt11 invoices only." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "If the *invstring* does not contain an amount, *amount_msat* is required, otherwise if it is specified it must be *null*. in millisatoshi precision; it can be a whole number, or a whole number with suffix *msat* or *sat*, or a three decimal point number with suffix *sat*, or an 1 to 11 decimal point number suffixed by *btc*." + ] + }, + "maxfee": { + "type": "msat", + "description": [ + "*maxfee* is a hard bound, in the sense that the command will never attempt a payment when the fees exceed that value." + ] + }, + "maxdelay": { + "type": "u32", + "description": [ + "Overrides the value of `max-locktime-blocks` for this payment. It serves to limit the locktime of funds in the payment HTLC measured in blocks." + ] + }, + "retry_for": { + "type": "u32", + "description": [ + "Measured in seconds specifies how much time it is allowed for the command to keep retrying the payment." + ], + "default": "60 seconds" + }, + "description": { + "type": "string", + "description": [ + "Only required for bolt11 invoices which do not contain a description themselves, but contain a description hash: in this case *description* is required. *description* is then checked against the hash inside the invoice before it will be paid." + ] + }, + "label": { + "type": "string", + "description": [ + "Used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7)." + ] + }, + "dev_use_shadow": { + "hidden": true, + "type": "boolean" + } + } + }, + "response": { + "required": [ + "payment_preimage", + "payment_hash", + "created_at", + "parts", + "amount_msat", + "amount_sent_msat", + "status" + ], + "properties": { + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash**." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "created_at": { + "type": "number", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "parts": { + "type": "u32", + "description": [ + "How many attempts this took." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount the recipient received." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "Total amount we sent (including fees)." + ] + }, + "status": { + "type": "string", + "enum": [ + "complete", + "pending", + "failed" + ], + "description": [ + "Status of payment." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment." + ] + } + }, + "post_return_value_notes": [ + "You can monitor the progress and retries of a payment using the lightning-renepaystatus(7) command." + ] + }, + "optimality": [ + "**renepay** is based on the work by Pickhardt-Richter's *Optimally Reliable & Cheap Payment Flows on the Lightning Network*. Which means the payment command will prefer routes that have a higher probability of success while keeping fees low.", + "", + "The algorithm records some partial knowledge of the state of the Network deduced from the responses obtained after evey payment attempt. This knowledge is kept through different payment requests, but decays with time to account for the dynamics of the Network (after 1 hour all previous knowledge will be erased). Knowledge from previous payment attempts increases the reliability for subsequent ones.", + "", + "Higher probabilities of success and lower fees cannot generally by optimized at once. Hence **renepay** combines the two in different amounts seeking solutions that satisfy *maxfee* bound and a target for 90% probability of success. *maxfee* is a hard bound, in the sense that the command will never attempt a payment when the fees exceed that value. While the probability target is not compulsory (but desirable), i.e. if the best route does not satisfy the 90% probability target it will be tried anyways.", + "", + "When *maxfee* and the 90% probability bounds are satified, the algorithm will optimize the fees to its lowest value." + ], + "randomization": [ + "To protect user privacy, the payment algorithm performs *shadow route* randomization. Which means the payment algorithm will virtually extend the route by adding delays and fees along it, making it appear to intermediate nodes that the route is longer than it actually is. This prevents intermediate nodes from reliably guessing their distance from the payee.", + "", + "Route randomization will never exceed *maxfee* of the payment. Route randomization and shadow routing will not take routes that would exceed *maxdelay*." + ], + "errors": [ + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error.", + "- 200: Other payment attempts are in progress.", + "- 203: Permanent failure at destination.", + "- 205: Unable to find a route.", + "- 206: Payment routes are too expensive.", + "- 207: Invoice expired. Payment took too long before expiration, or already expired at the time you initiated payment.", + "- 210: Payment timed out without a payment in progress.", + "- 212: Invoice is invalid." + ], + "example_json_request": [ + { + "id": "example:renepay#1", + "method": "renepay", + "params": { + "invstring": "lnbcrt1230n1pjmxj9jsp5suc4cag0lv3wemllkvms56e6ll0w867cczqfttuu8cpfl089f9kspp56wvxtdh8fxg5r5y3kg3klxceakqaydskwzatga25v95da8nzkmwqdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqkmyhymt0j7hy38vzqxx465s4ys0fg78flnjqfx4clvdq9mrmgglpcnjrrnhtk7maa87pfvjez88hke8w97zvuecwswaf9gzyqlsthegpza67eu" + } + }, + { + "id": "example:renepay#2", + "method": "renepay", + "params": { + "invstring": "lnbcrt1pja0f9asp50kzadmeyy78eymjvhnlk5dznl3g5k5x8agh52ewjtg0jclas4ylspp5crsutd9hg05lxyhzphdcuyng6z3knrsdae83mxwawa842gz3vj3sdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqr5yzhxmup4muyaz6x8u2dy4qyu9t5qzuf5k9xayvj5kg7tve60gjk4jrv2l76exnj2xkuzhtwky23pkkxedzy6p9yrsgyqdwj7dv5gsp4zcw6v", + "amount_msat": 548925 + } + } + ], + "example_json_response": [ + { + "payment_preimage": "0a3fd704b34f47d6e306dbac78141753be83848d3a19725c972abfc367dcc591", + "payment_hash": "d39865b6e7499141d091b2236f9b19ed81d2361670bab475546168de9e62b6dc", + "created_at": 1706248370.6267352, + "parts": 1, + "amount_msat": 123000, + "amount_sent_msat": 123000, + "status": "complete", + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" + }, + { + "payment_preimage": "a635e92d024beebfc58519e6544888aa560ba3bcaba7e74924e4b8432eaa56f5", + "payment_hash": "c0e1c5b4b743e9f312e20ddb8e1268d0a3698e0dee4f1d99dd774f55205164a3", + "created_at": 1708631229.7841823, + "parts": 1, + "amount_msat": 548925, + "amount_sent_msat": 548925, + "status": "complete", + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" + } + ], + "author": [ + "Eduardo Quintana-Miranda <> is mainly responsible." + ], + "see_also": [ + "lightning-renepaystatus(7)", + "lightning-listpays(7)", + "lightning-invoice(7)" + ], + "resources": [ + "Main web site: ", + "", + "Pickhardt R. and Richter S., *Optimally Reliable & Cheap Payment Flows on the Lightning Network* " + ] +} diff --git a/doc/schemas/lightning-renepaystatus.json b/doc/schemas/lightning-renepaystatus.json new file mode 100644 index 000000000000..8f3de493fd86 --- /dev/null +++ b/doc/schemas/lightning-renepaystatus.json @@ -0,0 +1,139 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "renepaystatus", + "title": "Command for quering the status of previous renepay attempts", + "added": "v23.08", + "description": [ + "The **renepaystatus** RPC command queries the payment plugin **renepay** for the status of previous payment attempts.", + "", + "This command always succeeds." + ], + "request": { + "required": [], + "properties": { + "invstring": { + "type": "string", + "description": [ + "If specified, the command will return a list of payment attempts whose invoice matches *invstring*, otherwise all payments with be listed." + ] + } + } + }, + "response": { + "required": [ + "paystatus" + ], + "properties": { + "paystatus": { + "type": "array", + "description": [ + "A list of payments attempted by renepay." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "bolt11", + "payment_hash", + "created_at", + "groupid", + "amount_msat", + "status", + "notes" + ], + "properties": { + "bolt11": { + "type": "string", + "description": [ + "Invoice string BOLT11." + ] + }, + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash** (for completed payments only)." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "created_at": { + "type": "number", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "groupid": { + "type": "u32", + "description": [ + "The id for this payment attempt." + ] + }, + "parts": { + "type": "u32", + "description": [ + "How many attempts this took." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount the recipient received." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "Total amount we sent including fees (for completed payments only)." + ] + }, + "status": { + "type": "string", + "enum": [ + "complete", + "pending", + "failed" + ], + "description": [ + "Status of payment." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment." + ] + }, + "notes": { + "type": "array", + "description": [ + "A list of messages for debugging purposes." + ], + "items": { + "type": "string", + "description": [ + "A message generated by renepay." + ] + } + } + } + } + } + } + }, + "author": [ + "Eduardo Quintana-Miranda <> is mainly responsible." + ], + "see_also": [ + "lightning-renepay(7)", + "lightning-listpays(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-reserveinputs.json b/doc/schemas/lightning-reserveinputs.json new file mode 100644 index 000000000000..6a603bf11efb --- /dev/null +++ b/doc/schemas/lightning-reserveinputs.json @@ -0,0 +1,230 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "reserveinputs", + "title": "Construct a transaction and reserve the UTXOs it spends", + "description": [ + "The **reserveinputs** RPC command places (or increases) reservations on any inputs specified in *psbt* which are known to lightningd. It will fail with an error if any of the inputs are known to be spent, and ignore inputs which are unknown.", + "", + "Normally the command will fail (with no reservations made) if an input is already reserved." + ], + "request": { + "required": [ + "psbt" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "The PSBT to reserve inputs from." + ] + }, + "exclusive": { + "type": "boolean", + "description": [ + "If set to *False*, existing reservations are simply extended, rather than causing failure." + ] + }, + "reserve": { + "type": "u32", + "description": [ + "The number of blocks to reserve. By default, reservations are for the next 72 blocks (approximately 6 hours)." + ] + } + } + }, + "response": { + "required": [ + "reservations" + ], + "properties": { + "reservations": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "txid", + "vout", + "was_reserved", + "reserved", + "reserved_to_block" + ], + "properties": { + "txid": { + "type": "txid", + "description": [ + "The input transaction id." + ] + }, + "vout": { + "type": "u32", + "description": [ + "The input index output number which was reserved." + ] + }, + "was_reserved": { + "type": "boolean", + "description": [ + "Whether the input was already reserved." + ] + }, + "reserved": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Whether the input is now reserved." + ] + }, + "reserved_to_block": { + "type": "u32", + "description": [ + "What blockheight the reservation will expire." + ] + } + } + } + } + } + }, + "errors": [ + "On failure, an error is reported and no UTXOs are reserved.", + "", + "- -32602: Invalid parameter, such as specifying a spent/reserved input in *psbt*." + ], + "example_json_request": [ + { + "id": "example:reserveinputs#1", + "method": "reserveinputs", + "params": { + "psbt": "cHNidP8BAFwCAAAAAkwJVUqB0xXTO7JZ3PnPdGnxoYfQxhU+xqXGFYXsyX0RAAAAAAD9////TAlVSoHTFdM7slnc+c90afGhh9DGFT7GpcYVhezJfREBAAAAAP3///8AAAAAAAAAAA==", + "exclusive": true, + "reserve": null + } + }, + { + "id": "example:reserveinputs#2", + "method": "reserveinputs", + "params": { + "psbt": "cHNidP8BAP32AQIAAAAMgnW099dbh1uD153ih5eU5WhluynLxekXjAOjkEdNBg8BAAAAAP3///9FWKQt8C+1y4741+beFSqWAaj9DuvzHNpxvpxS+GB8lwEAAAAA/f///6E5TAGqktI29Oso6b9kZZoAFFGGvpJQUM8VO+3LMTlmAAAAAAD9////nSDT7hrkuoQtAV1yNnbpkJsB5ifKoM2zP+CcLPfis1gBAAAAAP3///+P1rW90UXfD0gIk58h3sXxxy3ZfJJLP0H1I4Jpzy/87QEAAAAA/f///w0UKZ/s9DnPpV+FJ8h2BEI7tl+qVxSGRFRv9FYw4girAQAAAAD9////EPNsUFrEOZyfjbqbh8rfHQ4C9RQECw12n3c1yhFqkzoAAAAAAP3///8QW9LEsSmuvSnvVzy+FDktM7ewQmZnIJI/TJMahLmSzwEAAAAA/f///+4edbWRHDdRJcMeHHElgSmb+nENPsz/g/0AmAEU6hXeAAAAAAD9////T15YLGmk7HBsrL+awdcxi3db3esp8AcCTS9XGrEnfoAAAAAAAP3///8q7xInvEk7J0Ir9cpKXqU2lArUskkYLrimIE0+Yb6a2QEAAAAA/f///8hBLKyMa2zRJqwNOk7DmsDIfG7IvJtQiJ+QnkkHl6atAAAAAAD9////AAAAAAAAAAAAAAAAAAAAAAAA", + "exclusive": false, + "reserve": null + } + } + ], + "example_json_response": [ + { + "reservations": [ + { + "txid": "117dc9ec8515c6a5c63e15c6d087a1f16974cff9dc59b23bd315d3814a55094c", + "vout": 1, + "was_reserved": false, + "reserved": true, + "reserved_to_block": 175 + } + ] + }, + { + "reservations": [ + { + "txid": "0f064d4790a3038c17e9c5cb29bb6568e5949787e29dd7835b875bd7f7b47582", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "977c60f8529cbe71da1cf3eb0efda801962a15dee6d7f88ecbb52ff02da45845", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "663931cbed3b15cf505092be865114009a6564bfe928ebf436d292aa014c39a1", + "vout": 0, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "58b3e2f72c9ce03fb3cda0ca27e6019b90e97636725d012d84bae41aeed3209d", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "edfc2fcf698223f5413f4b927cd92dc7f1c5de219f9308480fdf45d1bdb5d68f", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "ab08e23056f46f5444861457aa5fb63b420476c827855fa5cf39f4ec9f29140d", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "3a936a11ca35779f760d0b0414f5020e1ddfca879bba8d9f9c39c45a506cf310", + "vout": 0, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "cf92b9841a934c3f9220676642b0b7332d3914be3c57ef29bdae29b1c4d25b10", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "de15ea14019800fd83ffcc3e0d71fa9b298125711c1ec32551371c91b5751eee", + "vout": 0, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "807e27b11a572f4d0207f029ebdd5b778b31d7c19abfac6c70eca4692c585e4f", + "vout": 0, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "d99abe613e4d20a6b82e1849b2d40a9436a55e4acaf52b42273b49bc2712ef2a", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "ada69707499e909f88509bbcc86e7cc8c09ac34e3a0dac26d16c6b8cac2c41c8", + "vout": 0, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + } + ] + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-unreserveinputs(7)", + "lightning-signpsbt(7)", + "lightning-sendpsbt(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-sendcustommsg.json b/doc/schemas/lightning-sendcustommsg.json new file mode 100644 index 000000000000..906c207773a7 --- /dev/null +++ b/doc/schemas/lightning-sendcustommsg.json @@ -0,0 +1,76 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v0.10.1", + "rpc": "sendcustommsg", + "title": "Low-level interface to send protocol messages to peers", + "description": [ + "The `sendcustommsg` RPC method allows the user to inject a custom message into the communication with the peer with the given `node_id`. This is intended as a low-level interface to implement custom protocol extensions on top, not for direct use by end-users.", + "", + "On the receiving end a plugin may implement the `custommsg` plugin hook and get notified about incoming messages, and allow additional unknown even types in their getmanifest response." + ], + "request": { + "required": [ + "node_id", + "msg" + ], + "properties": { + "node_id": { + "type": "pubkey", + "description": [ + "The node specified by `node_id` must be a peer, i.e., it must have a direct connection with the node receiving the RPC call, and the connection must be established. For a method to send arbitrary messages over multiple hops, including hops that do not understand the custom message, see the `createonion` and `sendonion` RPC methods. Messages can only be injected if the connection is handled by `openingd` or `channeld`. Messages cannot be injected when the peer is handled by `onchaind` or `closingd` since these do not have a connection, or are synchronous daemons that do not handle spontaneous messages." + ] + }, + "msg": { + "type": "hex", + "description": [ + "Must be a hex encoded well-formed message, including the 2-byte type prefix, but excluding the length prefix which will be added by the RPC method. The message types may not be one of the internally handled types, since that may cause issues with the internal state tracking of Core Lightning. We do (as of *v23.11*) allow sending of even types, but note that peers (as per the spec) will disconnect on receiving unknown even types." + ] + } + } + }, + "response": { + "required": [ + "status" + ], + "properties": { + "status": { + "type": "string", + "description": [ + "Information about where message was queued." + ] + } + }, + "pre_return_value_notes": [ + "The method will validate the arguments and queue the message for delivery through the daemon that is currently handling the connection. Queuing provides best effort guarantees and the message may not be delivered if the connection is terminated while the message is queued. The RPC method will return as soon as the message is queued.", + "", + "If any of the above limitations is not respected the method returns an explicit error message stating the issue." + ] + }, + "example_json_request": [ + { + "id": "example:sendcustommsg#5", + "method": "sendcustommsg", + "params": { + "node_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "msg": "77770012" + } + } + ], + "example_json_response": [ + { + "status": "Message sent to connectd for delivery" + } + ], + "author": [ + "Christian Decker <> is mainly responsible." + ], + "see_also": [ + "lightning-createonion(7)", + "lightning-sendonion(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-sendinvoice.json b/doc/schemas/lightning-sendinvoice.json new file mode 100644 index 000000000000..a2c7cc569574 --- /dev/null +++ b/doc/schemas/lightning-sendinvoice.json @@ -0,0 +1,237 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "sendinvoice", + "title": "Command for send an invoice for an offer", + "warning": "experimental-offers only", + "description": [ + "The **sendinvoice** RPC command creates and sends an invoice to the issuer of an *invoice_request* for it to pay: lightning-invoicerequest(7).", + "", + "If **fetchinvoice-noconnect** is not specified in the configuation, it will connect to the destination in the (currently common!) case where it cannot find a route which supports `option_onion_messages`." + ], + "request": { + "required": [ + "invreq", + "label" + ], + "properties": { + "invreq": { + "type": "string", + "description": [ + "The bolt12 invoice_request string beginning with `lnr1`." + ] + }, + "label": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "description": [ + "The unique label to use for this invoice." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Required if the *offer* does not specify an amount at all, or specifies it in a different currency. Otherwise you may set it (e.g. to provide a tip)." + ], + "default": "the amount contained in the offer (multiplied by *quantity* if any)" + }, + "timeout": { + "type": "u32", + "description": [ + "Seconds to wait for the offering node to pay the invoice or return an error. This will also be the timeout on the invoice that is sent." + ], + "default": "90 seconds" + }, + "quantity": { + "type": "u64", + "description": [ + "Quantity is is required if the offer specifies quantity_max, otherwise it is not allowed." + ] + } + } + }, + "response": { + "required": [ + "label", + "description", + "payment_hash", + "status", + "created_index", + "expires_at" + ], + "properties": { + "label": { + "type": "string", + "description": [ + "Unique label supplied at invoice creation." + ] + }, + "description": { + "type": "string", + "description": [ + "Description used in the invoice." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "unpaid", + "paid", + "expired" + ], + "description": [ + "Whether it's paid, unpaid or unpayable." + ] + }, + "expires_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when it will become / became unpayable." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount required to pay this invoice." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The BOLT12 string." + ] + }, + "created_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was created in." + ] + }, + "updated_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was changed (only present if it has changed since creation)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "paid" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "pay_index", + "amount_received_msat", + "paid_at", + "payment_preimage" + ], + "properties": { + "label": {}, + "description": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "bolt12": {}, + "expires_at": {}, + "created_index": {}, + "updated_index": {}, + "pay_index": { + "type": "u64", + "description": [ + "Unique incrementing index for this payment." + ] + }, + "amount_received_msat": { + "type": "msat", + "description": [ + "The amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)." + ] + }, + "paid_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when it was paid." + ] + }, + "payment_preimage": { + "type": "secret", + "description": [ + "Proof of payment." + ] + } + } + } + } + ] + }, + "errors": [ + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error.", + "- 1002: Offer has expired.", + "- 1003: Cannot find a route to the node making the offer.", + "- 1004: The node making the offer returned an error message.", + "- 1005: We timed out waiting for the invoice to be paid" + ], + "example_json_request": [ + { + "id": "example:sendinvoice#1", + "method": "sendinvoice", + "params": { + "invreq": "lnr1qqg804wzdsyn8g4mf2yc22k8xvjpjzstwd5k6urvv5s8getnw3gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02gqsykppqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4nuzqw5w7y7xqm2rushk5a5n3mcuvqel954raykd5nqa830nq9hpd4s4fcnxw266vp9d5c8f3m3w40hmm6gm8akxx3rsnr7d4usunv0x3q8q", + "label": "payme for real!" + } + } + ], + "example_json_response": [ + { + "label": "payme for real!", + "bolt12": "lni1qqg804wzdsyn8g4mf2yc22k8xvjpjzstwd5k6urvv5s8getnw3gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02gqsykppqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4ngycqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky96qmcmtl30xtt7jdakfyhzm8f0gny6f4d2ukx5gurem04z8lfd2wza5qs9pz6wp9vu7cm6n4wmmrz77y4w6z5xv4q93yudkdtkl5zmzdzuawzqqex7gd5v0x0r83pqj82udd542fl4krh50s0dkx47d0hd5wh77g52xxl75ccpkt35mc8n282wslju9ufyys2y8qqqqqqqqqqqqqqqpgqqqqqqqqqqqqp6f9jm7k9yqqqqqq2gpr96l99lfspt25zqnyfgu7hznmt2tzkjdt92d2wc3dsq7keph7w8gudjs46spfzqrlu4gqs9vppqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky9muzqpze8kk43g0wh4h8qlac5lswwesrvsaxcza2f5j90c2h3ts8yzmn9g4mxqe89fngrqny8nf52xxuxep6548etda8lp876jr0nnxgdkdq", + "payment_hash": "4c89473d714f6b52c56935655354ec45b007ad90dfce3a38d942ba8052200ffc", + "amount_msat": 2, + "status": "paid", + "pay_index": 1, + "amount_received_msat": 2, + "paid_at": 1708640865, + "payment_preimage": "305951ab02cb2ea5eb884dbfd8fb110b4e088ecb8338b3e84e8f9c70919c19bf", + "description": "simple test", + "expires_at": 1708640953, + "created_index": 2, + "updated_index": 1 + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-fetchinvoice(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-sendonion.json b/doc/schemas/lightning-sendonion.json new file mode 100644 index 000000000000..bcd7656e13fd --- /dev/null +++ b/doc/schemas/lightning-sendonion.json @@ -0,0 +1,364 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "sendonion", + "title": "Send a payment with a custom onion packet", + "description": [ + "The **sendonion** RPC command can be used to initiate a payment attempt with a custom onion packet. The onion packet is used to deliver instructions for hops along the route on how to behave. Normally these instructions are indications on where to forward a payment and what parameters to use, or contain details of the payment for the final hop. However, it is possible to add arbitrary information for hops in the custom onion, allowing for custom extensions that are not directly supported by Core Lightning.", + "", + "If the first element of *route* does not have \"channel\" set, a suitable channel (if any) will be chosen, otherwise that specific short-channel-id is used. The following is an example of a 3 hop onion:", + "", + "```json", + "[", + " \"298606954e9de3e9d938d18a74fed794c440e8eda82e52dc08600953c8acf9c4\",", + " \"2dc094de72adb03b90894192edf9f67919cb2691b37b1f7d4a2f4f31c108b087\",", + " \"a7b82b240dbd77a4ac8ea07709b1395d8c510c73c17b4b392bb1f0605d989c85\"", + "]", + "```" + ], + "request": { + "required": [ + "onion", + "first_hop", + "payment_hash" + ], + "properties": { + "onion": { + "type": "hex", + "description": [ + "Hex-encoded 1366 bytes long blob that was returned by either of the tools that can generate onions. It contains the payloads destined for each hop and some metadata. Please refer to [BOLT 04][bolt04] for further details. If is specific to the route that is being used and the *payment_hash* used to construct, and therefore cannot be reused for other payments or to attempt a separate route. The custom onion can generally be created using the `devtools/onion` CLI tool, or the **createonion** RPC command." + ] + }, + "first_hop": { + "type": "object", + "description": [ + "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*." + ], + "required": [ + "id", + "amount_msat", + "delay" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "Node id for the peer. Use any available channel available to this peer." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount to add an HTLC for millisatoshis." + ] + }, + "delay": { + "type": "u16", + "description": [ + "The number of blocks delay of blocks on top of the current blockheight." + ] + } + } + }, + "payment_hash": { + "type": "hash", + "description": [ + "Specifies the 32 byte hex-encoded hash to use as a challenge to the HTLC that we are sending. It is specific to the onion and has to match the one the onion was created with." + ] + }, + "label": { + "type": "string", + "description": [ + "Can be used to provide a human readable reference to retrieve the payment at a later time." + ] + }, + "shared_secrets": { + "type": "array", + "description": [ + "A JSON list of 32 byte hex-encoded secrets that were used when creating the onion. Core Lightning can send a payment with a custom onion without the knowledge of these secrets, however it will not be able to parse an eventual error message since that is encrypted with the shared secrets used in the onion. If *shared_secrets* is provided Core Lightning will decrypt the error, act accordingly, e.g., add a `channel_update` included in the error to its network view, and set the details in *listsendpays* correctly. If it is not provided Core Lightning will store the encrypted onion, and expose it in *listsendpays* allowing the caller to decrypt it externally. If it is not provided the Core Lightning node does not know how long the route is, which channels or nodes are involved, and what an eventual error could have been. It can therefore be used for oblivious payments." + ], + "items": { + "type": "secret" + } + }, + "partid": { + "type": "u16", + "description": [ + "If provided and non-zero, allows for multiple parallel partial payments with the same *payment_hash*." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "If provided, it will be returned in *waitsendpay* and *listsendpays* results." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Used to annotate the payment, and is returned by *waitsendpay* and *listsendpays*." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "If provided, it will be returned in **listpays** result." + ] + }, + "localinvreqid": { + "type": "hash", + "description": [ + "`localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7)." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." + ] + }, + "description": { + "added": "v0.11.0", + "type": "string", + "description": [ + "If provided, it will be returned in *waitsendpay* and *listsendpays* results." + ] + } + } + }, + "response": { + "required": [ + "created_index", + "id", + "payment_hash", + "status", + "created_at", + "amount_sent_msat" + ], + "properties": { + "created_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was created in." + ] + }, + "id": { + "type": "u64", + "description": [ + "Old synonym for created_index." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "pending", + "complete" + ], + "description": [ + "Status of the payment (could be complete if already sent previously)." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount delivered to destination (if known)." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment if known." + ] + }, + "created_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "The amount sent." + ] + }, + "label": { + "type": "string", + "description": [ + "The label, if given to sendpay." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string (if supplied)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string (if supplied: **experimental-offers** only)." + ] + }, + "partid": { + "type": "u64", + "description": [ + "The partid (if supplied) to sendonion/sendpay." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "complete" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "payment_preimage" + ], + "properties": { + "created_index": {}, + "id": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "destination": {}, + "created_at": {}, + "groupid": {}, + "msatoshi_sent": {}, + "amount_sent_msat": {}, + "label": {}, + "bolt11": {}, + "bolt12": {}, + "partid": {}, + "updated_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was changed." + ] + }, + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash**." + ] + } + } + } + }, + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "pending" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [], + "properties": { + "created_index": {}, + "id": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "destination": {}, + "created_at": {}, + "groupid": {}, + "msatoshi_sent": {}, + "amount_sent_msat": {}, + "label": {}, + "bolt11": {}, + "bolt12": {}, + "partid": {}, + "message": { + "type": "string", + "description": [ + "Monitor status with listpays or waitsendpay." + ] + } + } + } + } + ] + }, + "errors": [ + "The following error codes may occur:", + "", + "- 202: an parseable onion", + "", + "the error details are decrypted and presented here, if *shared_secrets* was provided and an error was returned by one of the intermediate nodes" + ], + "example_json_request": [ + { + "id": "example:sendonion#1", + "method": "sendonion", + "params": { + "onion": "00034928294556b10308f9aeac7a240223d4d5f72097db1ef36a36b10cab937f2f205ed7218b47d4600eaf7fd390940bf9a6cdac99aafdb4783c468150eeeab9b57e56a06778d023ffb3bb84c7d8c2ad8868b61c28b566634af52c288ed6569583db66f5bd0edfb801c252f078020e1df6359af5969296b4698a71d17c5ca6e5ee4b64b7cce3ad0a1aa31e6be4d5fe3a31fa7a25259c640716020a9a248ca3ebb68eb823f8884b5df3710969f4c2ffb153779a923bab946ed43c1f6658d7f8e7e25303bb78ef4862fb550b8b1c79d522b035eedfda9ab70a61322522acf7233bb8ea2423958448fc8ac3d000835fda04bf661f1bf2ad2d091f506840bb2f10f82c0812149d99267a47824defe90877ed70db526b2200e18dccb92b17516de3778c055645728eadf4c74375aa0aae80a7773a536a908ca1e25c0fdca90e50ce0be05eeb973ec5e83ce3ab6b35818e021780428af81320a694483c1c15f64e685ba1fd3b1e1b926e6b4ec9eeeac8aca60c60e0f0f583e35e7f081dc6f4c64157e100c79c4c25101bed77cd9f93416f9a67d9f1916a782c498c38365af4a5fabb1b745fa840a054a06564c3f4b376aeb72cdd059d3794c82bbbf12a1f62234016a6912b384e7e4cebbd39ee4395aeff43c461e226d1e0151cce508a181a9c61275bf4b89e4556cf24df13b993dec96541555f8b9a699be9488568a11ac7f25849da62765472511ad74a6660c10e37f5fa13d4e4665ef7825ae1f2da4a86d5581912262de89b4b11a722fd127b31aa0d7fab8c679b07bf95e65cb80b2dacb5b90794399fb8f23823f68058431aa1c399b5baceccaf8521d004f45dba6ec1fddc54473343e9e67cd50cc3f2f3d8a5dab8a7ab9ae553dc3cd34e74b858da75975265f7c673a25e8d01a5130ab40eaba712b80c608cd0431b4b45ea0d81af595e21f24976608429127bf586f7507666500bc7245cf9266fa0bd0e58404c496e190c873cd143ace9048e9d5021c23967a24e09f2e54166e54b4ee8888dc1af535624e7ee8b426c1628175017a9e8a73eb1d0d49028a4f4d77897f3c08f1cd7bdee2b00f9bb9eadc49a69bf4f6c0cb2c95a16f03d7958f1b8f83cb40ae87ddf75f26050e2c2ed9f8f8523b3d389a50b217bda651dc21f095fe7d2d3851a0a6cf01051f3f3c6f1ad59ed46d44928d15a0e6e1bd4df4c99bdb82a05b0e781b69a73bc30fe579c8ac9fe8aeb6beb1c0f44def2775b7341af37e6ef58ceb34958b29d3e36112b78644612228761b8badc802f0b2b8fcaeb1db8f3a8db4afa2d7b4540a7c331db6f5141fa3909a513df875ff8a63f5b542d662781ca96a69e3b2925d6a63555b2c5825ffb2ad848d71122f54110e0d203000f3e9cc23b793c3540dfb8d881caedd25055a8f495e9e7a0391dbf9cbd9344f7df659ee8d3ce5ec16217ab83e1394ba991eb8ffd9a869f8ebb2e2428845e779979c57b5f8875f502728229a55ce87b3eba85c75264d30eaf7b373f6b09ba3086d9e98348d87b049468c2c30a6501cb2a3862f1703bbf29895e8b4262353eae720ed8ae678750011e2eb51f4800d3f4725fa873d7deec1c46f77a5f61c73dc938239e77f432bcc245c7b935413c51c0bc92bdaae144452aa95910909e46e500557961203f4e1483b9c09c124464907825e1ff74c87c58d6e2e91970baac9b89a554beca6df9acee16d77dd929d0caa7797e06f2c384c03fdedc89c697b9c34787a50cf399a8d7f195e79b347efc8267c474a477ce210f11049d432b280eaf3fccd451f6218d35c64cbd1006bcc54eeea8b856855c9aa92bc3adc6900a7c7a0eee09834c5a1f2da3d8ea9a478aea90c954952ad2a72d3856350ac3132d17e1e8116fa774066a22c857a827699c98285111a405e74685a3ae579ae78c545774f45491e4935bf4", + "first_hop": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "channel": "103x3x0", + "direction": 1, + "amount_msat": 1002, + "delay": 21, + "style": "tlv" + }, + "payment_hash": "f584c14bb23506acdd94cf3cea377f3cc5805f3cba5430bc3756ef83ede1a0dc", + "label": null, + "shared_secrets": null, + "partid": null, + "bolt11": null, + "amount_msat": null, + "destination": null + } + } + ], + "example_json_response": [ + { + "message": "Monitor status with listpays or waitsendpay", + "created_index": 1, + "id": 1, + "payment_hash": "f584c14bb23506acdd94cf3cea377f3cc5805f3cba5430bc3756ef83ede1a0dc", + "groupid": 1, + "amount_sent_msat": 1002, + "created_at": 1706315098, + "status": "pending" + } + ], + "author": [ + "Christian Decker <> is mainly responsible." + ], + "see_also": [ + "lightning-createonion(7)", + "lightning-sendpay(7)", + "lightning-listsendpays(7)" + ], + "resources": [ + "Main web site: ", + "", + "[bolt04]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md" + ] +} diff --git a/doc/schemas/lightning-sendonionmessage.json b/doc/schemas/lightning-sendonionmessage.json new file mode 100644 index 000000000000..e4a7f4be1ded --- /dev/null +++ b/doc/schemas/lightning-sendonionmessage.json @@ -0,0 +1,77 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "sendonionmessage", + "title": "low-level command to send an onion message", + "warning": "experimental-onion-messages only", + "description": [ + "The **sendonionmessage** RPC command can be used to send a message via the lightning network. These are currently used by *offers* to request and receive invoices." + ], + "request": { + "required": [ + "first_id", + "blinding", + "hops" + ], + "properties": { + "first_id": { + "type": "pubkey", + "description": [ + "The (presumably well-known) public key of the start of the path." + ] + }, + "blinding": { + "type": "pubkey", + "description": [ + "Blinding factor for this path." + ] + }, + "hops": { + "type": "array", + "description": [ + "", + "" + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "node", + "tlv" + ], + "properties": { + "node": { + "type": "pubkey", + "description": [ + "Public key of the node." + ] + }, + "tlv": { + "type": "u8", + "description": [ + "Contains a hexadecimal TLV to include." + ] + } + } + } + } + } + }, + "response": { + "required": [], + "properties": {} + }, + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-fetchinvoice(7)", + "lightning-offer(7)" + ], + "resources": [ + "Main web site: ", + "", + "[bolt04]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md" + ] +} diff --git a/doc/schemas/lightning-sendpay.json b/doc/schemas/lightning-sendpay.json new file mode 100644 index 000000000000..d156113f7537 --- /dev/null +++ b/doc/schemas/lightning-sendpay.json @@ -0,0 +1,444 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "sendpay", + "title": "Low-level command for sending a payment via a route", + "description": [ + "The **sendpay** RPC command attempts to send funds associated with the given *payment_hash*, along a route to the final destination in the route.", + "", + "Generally, a client would call lightning-getroute(7) to resolve a route, then use **sendpay** to send it. If it fails, it would call lightning-getroute(7) again to retry. If the route is empty, a payment-to-self is attempted.", + "", + "The response will occur when the payment is on its way to the destination. The **sendpay** RPC command does not wait for definite success or definite failure of the payment (except for already-succeeded payments, or to-self payments). Instead, use the **waitsendpay** RPC command to poll or wait for definite success or definite failure.", + "", + "Once a payment has succeeded, calls to **sendpay** with the same *payment_hash* but a different *amount_msat* or destination will fail; this prevents accidental multiple payments. Calls to **sendpay** with the same *payment_hash*, *amount_msat*, and destination as a previous successful payment (even if a different route or *partid*) will return immediately with success." + ], + "request": { + "required": [ + "route", + "payment_hash" + ], + "properties": { + "route": { + "type": "array", + "items": { + "type": "object", + "required": [ + "amount_msat", + "id", + "delay", + "channel" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The node at the end of this hop." + ] + }, + "channel": { + "type": "short_channel_id", + "description": [ + "The channel joining these nodes." + ] + }, + "delay": { + "type": "u32", + "description": [ + "The total CLTV expected by the node at the end of this hop." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount expected by the node at the end of this hop." + ] + } + } + } + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the payment_preimage." + ] + }, + "label": { + "type": "string", + "description": [ + "The label provided when creating the invoice_request." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount must be provided if *partid* is non-zero, or the payment is to-self, otherwise it must be equal to the final amount to the destination. it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*." + ], + "default": "in millisatoshi precision" + }, + "bolt11": { + "type": "string", + "description": [ + "Bolt11 invoice to pay. If provided, will be returned in *waitsendpay* and *listsendpays* results." + ] + }, + "payment_secret": { + "type": "secret", + "description": [ + "Value that the final recipient requires to accept the payment, as defined by the `payment_data` field in BOLT 4 and the `s` field in the BOLT 11 invoice format. It is required if *partid* is non-zero." + ] + }, + "partid": { + "type": "u64", + "description": [ + "Must not be provided for self-payments. If provided and non-zero, allows for multiple parallel partial payments with the same *payment_hash*. The *amount_msat* amount (which must be provided) for each **sendpay** with matching *payment_hash* must be equal, and **sendpay** will fail if there are differing values given." + ] + }, + "localinvreqid": { + "type": "hex", + "description": [ + "Indicates that this payment is being made for a local invoice_request. This ensures that we only send a payment for a single-use invoice_request once." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Allows you to attach a number which appears in **listsendpays** so payments can be identified as part of a logical group. The *pay* plugin uses this to identify one attempt at a MPP payment, for example." + ] + }, + "payment_metadata": { + "added": "v0.11.0", + "type": "hex", + "description": [ + "Placed in the final onion hop TLV." + ] + }, + "description": { + "added": "v0.11.0", + "type": "string", + "description": [ + "Description used in the invoice." + ] + } + } + }, + "response": { + "required": [ + "id", + "created_index", + "payment_hash", + "status", + "created_at", + "amount_sent_msat" + ], + "properties": { + "created_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was created in." + ] + }, + "updated_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was changed (only present if it has changed since creation)." + ] + }, + "id": { + "type": "u64", + "description": [ + "Old synonym for created_index." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "pending", + "complete" + ], + "description": [ + "Status of the payment (could be complete if already sent previously)." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount delivered to destination (if known)." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment if known." + ] + }, + "created_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "completed_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was completed." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "The amount sent." + ] + }, + "label": { + "type": "string", + "description": [ + "The *label*, if given to sendpay." + ] + }, + "partid": { + "type": "u64", + "description": [ + "The *partid*, if given to sendpay." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string (if supplied)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string (if supplied: **experimental-offers** only)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "complete" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "payment_preimage" + ], + "properties": { + "id": {}, + "created_index": {}, + "updated_index": {}, + "groupid": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "destination": {}, + "created_at": {}, + "completed_at": {}, + "msatoshi_sent": {}, + "amount_sent_msat": {}, + "label": {}, + "partid": {}, + "bolt11": {}, + "bolt12": {}, + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash**." + ] + } + } + } + }, + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "pending" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "message" + ], + "properties": { + "id": {}, + "created_index": {}, + "updated_index": {}, + "groupid": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "destination": {}, + "created_at": {}, + "completed_at": {}, + "msatoshi_sent": {}, + "amount_sent_msat": {}, + "label": {}, + "partid": {}, + "bolt11": {}, + "bolt12": {}, + "message": { + "type": "string", + "description": [ + "Monitor status with listpays or waitsendpay." + ] + } + } + } + } + ] + }, + "errors": [ + "On error, if the error occurred from a node other than the final destination, the route table will be updated so that lightning-getroute(7) should return an alternate route (if any). An error from the final destination implies the payment should not be retried.", + "", + "- -1: Catchall nonspecific error.", + "- 201: Already paid with this *hash* using different amount or destination.", + "- 202: Unparseable onion reply. The *data* field of the error will have an *onionreply* field, a hex string representation of the raw onion reply.", + "- 203: Permanent failure at destination. The *data* field of the error will be routing failure object.", + "- 204: Failure along route; retry a different route. The *data* field of the error will be routing failure object.", + "- 212: *localinvreqid* refers to an invalid, or used, local invoice_request.", + "", + "A routing failure object has the fields below:", + "", + "*erring_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on.", + "*erring_node*: The hex string of the pubkey id of the node that reported the error.", + "*erring_channel*: The short channel ID of the channel that has the error, or *0:0:0* if the destination node raised the error. In addition *erring_direction* will indicate which direction of the channel caused the failure.", + "*failcode*: The failure code, as per BOLT #4.", + "*channel_update*: The hex string of the *channel_update* message received from the remote node. Only present if error is from the remote node and the *failcode* has the UPDATE bit set, as per BOLT #4." + ], + "example_json_request": [ + { + "id": "example:sendpay#1", + "method": "sendpay", + "params": { + "route": [ + { + "amount_msat": 11000000, + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "delay": 5, + "channel": "103x1x0" + } + ], + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "label": null, + "amount_msat": null, + "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk", + "payment_secret": "82644944d3f70d42aad1d5f7b5d7a629e7afa30b529cc952a4c59fc0e3790ea2", + "partid": null, + "groupid": null, + "payment_metadata": null + } + }, + { + "id": "example:sendpay#2", + "method": "sendpay", + "params": { + "route": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "channel": "103x1x0", + "direction": 1, + "amount_msat": 4211, + "style": "tlv", + "delay": 24 + }, + { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "channel": "105x1x0", + "direction": 0, + "amount_msat": 3710, + "style": "tlv", + "delay": 16 + }, + { + "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "channel": "107x1x0", + "direction": 1, + "amount_msat": 3210, + "style": "tlv", + "delay": 8 + } + ], + "payment_hash": "bc747053329402620a26bdc187cd134cdb699130d85be499ecd24160aff04c5c", + "label": null, + "amount_msat": null, + "bolt11": null, + "payment_secret": "c36a2fe9aced78c06960e2f21b369ed03f0492c97e53ba3b662163bcdaf1d7fa", + "partid": null, + "groupid": null, + "payment_metadata": null + } + } + ], + "example_json_response": [ + { + "message": "Monitor status with listpays or waitsendpay", + "created_index": 1, + "id": 1, + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "groupid": 1, + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount_msat": 11000000, + "amount_sent_msat": 11000000, + "created_at": 1706152930, + "status": "pending", + "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk" + }, + { + "message": "Monitor status with listpays or waitsendpay", + "created_index": 2, + "id": 2, + "payment_hash": "bc747053329402620a26bdc187cd134cdb699130d85be499ecd24160aff04c5c", + "groupid": 1, + "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "amount_msat": 3210, + "amount_sent_msat": 4211, + "created_at": 1708624260, + "status": "pending" + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listinvoice(7)", + "lightning-delinvoice(7)", + "lightning-getroute(7)", + "lightning-invoice(7)", + "lightning-pay(7)", + "lightning-waitsendpay(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-sendpsbt.json b/doc/schemas/lightning-sendpsbt.json new file mode 100644 index 000000000000..7f67685daeec --- /dev/null +++ b/doc/schemas/lightning-sendpsbt.json @@ -0,0 +1,94 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "sendpsbt", + "title": "Command to finalize, extract and send a partially signed bitcoin transaction (PSBT).", + "description": [ + "The **sendpsbt** is a low-level RPC command which sends a fully-signed PSBT." + ], + "request": { + "required": [ + "psbt" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "The fully signed psbt to be sent." + ] + }, + "reserve": { + "type": "u32", + "description": [ + "Number of blocks to increase reservation of any of our inputs by." + ], + "default": "72" + } + } + }, + "response": { + "required": [ + "tx", + "txid" + ], + "properties": { + "tx": { + "type": "hex", + "description": [ + "The raw transaction which was sent." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The txid of the **tx**." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:sendpsbt#1", + "method": "sendpsbt", + "params": { + "psbt": "some_psbt" + } + }, + { + "id": "example:sendpsbt#2", + "method": "sendpsbt", + "params": { + "psbt": "cHNidP8BAM0CAAAABEV+dnFRINmyeHxi4Id0OrcuzI5au5/BlPtTfu7E2m3EAAAAAAD9////cv8oioDx+0NCEnjBSYtnwF0H4VR13j+bkyb5gOOQLUUBAAAAAP3///8ehOrKm7JEq6zflkp9+zmSwE1iPe1yh3KTXvk+om/legEAAAAA/f///2s31wNrI1UavMgjC1GyrOHNbxOm68KYa13WX/mGfmjcAQAAAAD9////AcEAPQAAAAAAFgAUyQltQ/QI6lJgICYsza18hRa5KoEAAAAAAAEAcQIAAAABTzfqjIqV1wPpqc/3/Cb+tMX5EDrLmnhb5BMNx3aB/hYAAAAAAP3///8CQEIPAAAAAAAWABR9CNmX36nN45+GhjqvD4LjLMMMg/+juSkBAAAAFgAUJB0adsMdjkacZWrLwyteqfOaTrRlAAAAAQEfQEIPAAAAAAAWABR9CNmX36nN45+GhjqvD4LjLMMMgyICA1p5u7tAbUvCjfBfpqhzKM+wKn4TdDvs3NHfz+BxwuAQRzBEAiBwFb9rA0nUVlIPGd2aaiRbJ+KH4MLM3Bu+f0JuXB/hwAIgT2rrIUG9gXBZoH9fcPjCnbbM1SR4GiLYGLeALB8yENoBIgYDWnm7u0BtS8KN8F+mqHMoz7AqfhN0O+zc0d/P4HHC4BAIfQjZlwAAAAAAAQBxAgAAAAGANpEFI+CgfALTim/MWsAa62g+EmFWrFrzBDBCmCB3MgAAAAAA/f///wKZKdgpAQAAABYAFB+xhfU1pgl9WIvDKzAHZp8UeNkzQEIPAAAAAAAWABQHHEnK0vQg88gF+fa5ilcmnLFBUGUAAAABAR9AQg8AAAAAABYAFAccScrS9CDzyAX59rmKVyacsUFQIgICXTcoCCnxhsuZXNzL8jirRWQBOTlzUTljJKNldd803f9HMEQCIDtx/kEoc4PHDDm4eX5SEOmuRGu7ShpEG7xKBbuD/NjiAiBYkIKod39dcBarCT7Dbchkuwx70tJhOxQSJi2EMioGrwEiBgJdNygIKfGGy5lc3MvyOKtFZAE5OXNROWMko2V13zTd/wgHHEnKAAAAAAABAHECAAAAAVHU7RCZylzRMdlMBJ2ba4XKxv0l7LdWVnPYS6mhkf60AAAAAAD9////Av5VbSkBAAAAFgAU0BhRKzRbIC6H+s6j86d6cMpTNNhAQg8AAAAAABYAFD1D0ia8wnAZreUtej3FKnrBvii4ZQAAAAEBH0BCDwAAAAAAFgAUPUPSJrzCcBmt5S16PcUqesG+KLgiAgKKWZFo08l968cbxm5icOzwVPMA2Igwm6BUcaSCF13ZMEcwRAIgNAeIVGvUj9MWM18am0dx3JtEf79iQMX7Rqz1tttes3ICIAtNCglUlvpSidAxc/xoiy9cA13bgimJx25G+eZXfYJeASIGAopZkWjTyX3rxxvGbmJw7PBU8wDYiDCboFRxpIIXXdkwCD1D0iYAAAAAAAEAcQIAAAABRX52cVEg2bJ4fGLgh3Q6ty7Mjlq7n8GU+1N+7sTabcQBAAAAAP3///8CMmGqKQEAAAAWABSxLq0p9YAKl+hX7pFc0K/X+PIWmUBCDwAAAAAAFgAUZhwjt5DdNJE3OvCx2L7Qh31c3iJlAAAAAQEfQEIPAAAAAAAWABRmHCO3kN00kTc68LHYvtCHfVzeIiICA/qclQheQrHlADzR9BgXjDDJbkrneVTKD8SMWIJv9OsORzBEAiBKABqNV7cF5DKhtd+m+ZEmWF21vBt2uBKnzeDuUFqvDwIgJc6+/6GQqIfz869kJpUFTAMYTeL2qWR6d28EQEOJgkMBIgYD+pyVCF5CseUAPNH0GBeMMMluSud5VMoPxIxYgm/06w4IZhwjtwAAAAAAAA==", + "reserve": null + } + } + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters or some error happened during the command process." + ], + "example_json_response": [ + { + "txid": "05985072bbe20747325e69a159fe08176cc1bbc96d25e8848edad2dddc1165d0", + "tx": "02000000027032912651fc25a3e0893acd5f9640598707e2dfef92143bb5a4020e335442800100000017160014a5f48b9aa3cb8ca6cc1040c11e386745bb4dc932ffffffffd229a4b4f78638ebcac10a68b0561585a5d6e4d3b769ad0a909e9b9afaeae24e00000000171600145c83da9b685f9142016c6f5eb5f98a45cfa6f686ffffffff01915a01000000000017a9143a4dfd59e781f9c3018e7d0a9b7a26d58f8d22bf8700000000" + }, + { + "tx": "02000000000104457e76715120d9b2787c62e087743ab72ecc8e5abb9fc194fb537eeec4da6dc40000000000fdffffff72ff288a80f1fb43421278c1498b67c05d07e15475de3f9b9326f980e3902d450100000000fdffffff1e84eaca9bb244abacdf964a7dfb3992c04d623ded728772935ef93ea26fe57a0100000000fdffffff6b37d7036b23551abcc8230b51b2ace1cd6f13a6ebc2986b5dd65ff9867e68dc0100000000fdffffff01c1003d0000000000160014c9096d43f408ea526020262ccdad7c8516b92a810247304402207015bf6b0349d456520f19dd9a6a245b27e287e0c2ccdc1bbe7f426e5c1fe1c002204f6aeb2141bd817059a07f5f70f8c29db6ccd524781a22d818b7802c1f3210da0121035a79bbbb406d4bc28df05fa6a87328cfb02a7e13743becdcd1dfcfe071c2e0100247304402203b71fe41287383c70c39b8797e5210e9ae446bbb4a1a441bbc4a05bb83fcd8e20220589082a8777f5d7016ab093ec36dc864bb0c7bd2d2613b1412262d84322a06af0121025d37280829f186cb995cdccbf238ab45640139397351396324a36575df34ddff024730440220340788546bd48fd316335f1a9b4771dc9b447fbf6240c5fb46acf5b6db5eb37202200b4d0a095496fa5289d03173fc688b2f5c035ddb822989c76e46f9e6577d825e0121028a599168d3c97debc71bc66e6270ecf054f300d888309ba05471a482175dd9300247304402204a001a8d57b705e432a1b5dfa6f99126585db5bc1b76b812a7cde0ee505aaf0f022025cebeffa190a887f3f3af642695054c03184de2f6a9647a776f044043898243012103fa9c95085e42b1e5003cd1f418178c30c96e4ae77954ca0fc48c58826ff4eb0e00000000", + "txid": "43bb1c1bce6763ffe4d5df6b49f152f907f36f7849e55bb56075e2b256d17502" + } + ], + "author": [ + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." + ], + "see_also": [ + "lightning-fundpsbt(7)", + "lightning-signpsbt(7)", + "lightning-listtransactions(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-setchannel.json b/doc/schemas/lightning-setchannel.json new file mode 100644 index 000000000000..94cc68c4099a --- /dev/null +++ b/doc/schemas/lightning-setchannel.json @@ -0,0 +1,230 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "setchannel", + "title": "Command for configuring fees / htlc range advertized for a channel", + "description": [ + "The **setchannel** RPC command sets channel specific routing fees, and `htlc_minimum_msat` or `htlc_maximum_msat` as defined in BOLT #7. The channel has to be in normal or awaiting state. This can be checked by **listpeers** reporting a *state* of CHANNELD_NORMAL or CHANNELD_AWAITING_LOCKIN for the channel.", + "", + "These changes (for a public channel) will be broadcast to the rest of the network (though many nodes limit the rate of such changes they will accept: we allow 2 a day, with a few extra occasionally)." + ], + "request": { + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string", + "description": [ + "Should contain a scid (short channel ID), channel id or peerid (pubkey) of the channel to be modified. If *id* is set to `all`, the updates are applied to all channels in states CHANNELD_NORMAL CHANNELD_AWAITING_LOCKIN or DUALOPEND_AWAITING_LOCKIN. If *id* is a peerid, all channels with the +peer in those states are changed." + ] + }, + "feebase": { + "type": "msat", + "description": [ + "Value in millisatoshi that is added as base fee to any routed payment: if omitted, it is unchanged. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*." + ] + }, + "feeppm": { + "type": "u32", + "description": [ + "Value that is added proportionally per-millionths to any routed payment volume in satoshi. For example, if ppm is 1,000 and 1,000,000 satoshi is being routed through the channel, an proportional fee of 1,000 satoshi is added, resulting in a 0.1% fee." + ] + }, + "htlcmin": { + "type": "msat", + "description": [ + "Value that limits how small an HTLC we will forward: if omitted, it is unchanged. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. Note that the peer also enforces a minimum for the channel: setting it below that will simply set it to that value with a warning. Also note that *htlcmin* only applies to forwarded HTLCs: we can still send smaller payments ourselves." + ], + "default": "no lower limit" + }, + "htlcmax": { + "type": "msat", + "description": [ + "Value that limits how large an HTLC we will forward: if omitted, it is unchanged. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. Note that *htlcmax* only applies to forwarded HTLCs: we can still send larger payments ourselves." + ], + "default": "no effective limit" + }, + "enforcedelay": { + "type": "u32", + "description": [ + "Number of seconds to delay before enforcing the new fees/htlc max. This gives the network a chance to catch up with the new rates and avoids rejecting HTLCs before they do. This only has an effect if rates are increased (we always allow users to overpay fees) or *htlcmax* is decreased, and only applied to a single rate increase per channel (we don't remember an arbitrary number of prior feerates) and if the node is restarted the updated configuration is enforced immediately." + ], + "default": "600, which is ten minutes" + }, + "ignorefeelimits": { + "added": "v23.08", + "type": "boolean", + "description": [ + "If set to True means to allow the peer to set the commitment transaction fees (or closing transaction fees) to any value they want. This is dangerous: they could set an exorbitant fee (so HTLCs are unenforcable), or a tiny fee (so that commitment transactions cannot be relayed), but avoids channel breakage in case of feerate disagreements. (Note: the global `ignore_fee_limits` setting overrides this)." + ] + } + } + }, + "response": { + "required": [ + "channels" + ], + "properties": { + "channels": { + "type": "array", + "description": [ + "Channel(s) set, and their resulting configuration." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "peer_id", + "channel_id", + "fee_base_msat", + "fee_proportional_millionths", + "minimum_htlc_out_msat", + "maximum_htlc_out_msat", + "ignore_fee_limits" + ], + "properties": { + "peer_id": { + "type": "pubkey", + "description": [ + "The node_id of the peer." + ] + }, + "channel_id": { + "type": "hash", + "description": [ + "The channel_id of the channel." + ] + }, + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "The short_channel_id (if locked in)." + ] + }, + "fee_base_msat": { + "type": "msat", + "description": [ + "The resulting feebase (this is the BOLT #7 name)." + ] + }, + "fee_proportional_millionths": { + "type": "u32", + "description": [ + "The resulting feeppm (this is the BOLT #7 name)." + ] + }, + "ignore_fee_limits": { + "type": "boolean", + "added": "v23.08", + "description": [ + "If we are now allowing peer to set feerate on commitment transaction without restriction." + ] + }, + "minimum_htlc_out_msat": { + "type": "msat", + "description": [ + "The resulting htlcmin we will advertize (the BOLT #7 name is htlc_minimum_msat)." + ] + }, + "warning_htlcmin_too_low": { + "type": "string", + "description": [ + "The requested htlcmin was too low for this peer, so we set it to the minimum they will allow." + ] + }, + "maximum_htlc_out_msat": { + "type": "msat", + "description": [ + "The resulting htlcmax we will advertize (the BOLT #7 name is htlc_maximum_msat)." + ] + }, + "warning_htlcmax_too_high": { + "type": "string", + "description": [ + "The requested htlcmax was greater than the channel capacity, so we set it to the channel capacity." + ] + } + } + } + } + } + }, + "errors": [ + "The following error codes may occur:", + "", + "- -1: Channel is in incorrect state, i.e. Catchall nonspecific error.", + "- -32602: JSONRPC2_INVALID_PARAMS, i.e. Given id is not a channel ID or short channel ID." + ], + "example_json_request": [ + { + "id": "example:setchannel#1", + "method": "setchannel", + "params": { + "id": "103x1x0", + "feebase": null, + "feeppm": null, + "htlcmin": null, + "htlcmax": null, + "enforcedelay": null, + "ignorefeelimits": true + } + }, + { + "id": "example:setchannel#2", + "method": "setchannel", + "params": { + "id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", + "feebase": 4000, + "feeppm": 300, + "htlcmin": null, + "htlcmax": null, + "enforcedelay": 0, + "ignorefeelimits": null + } + } + ], + "example_json_response": [ + { + "channels": [ + { + "peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "channel_id": "90210d39d12a65d239ece267c5f48e0a82e7cb95724e658f6d99f370064faad1", + "short_channel_id": "103x1x0", + "fee_base_msat": 1, + "fee_proportional_millionths": 10, + "minimum_htlc_out_msat": 0, + "maximum_htlc_out_msat": 990000000, + "ignore_fee_limits": true + } + ] + }, + { + "channels": [ + { + "peer_id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", + "channel_id": "9c54c71bbbe59591cc3162e14fc4ff58c146f085c07d0f206ea679a8231d03ab", + "short_channel_id": "103x3x0", + "fee_base_msat": 4000, + "fee_proportional_millionths": 300, + "minimum_htlc_out_msat": 0, + "maximum_htlc_out_msat": 990000000, + "ignore_fee_limits": false + } + ] + } + ], + "author": [ + "Michael Schmoock <> is the author of this feature." + ], + "see_also": [ + "lightningd-config(5)", + "lightning-fundchannel(7)", + "lightning-listchannels(7)", + "lightning-listpeers(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-setconfig.json b/doc/schemas/lightning-setconfig.json new file mode 100644 index 000000000000..f8dc6f66a4ea --- /dev/null +++ b/doc/schemas/lightning-setconfig.json @@ -0,0 +1,191 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.08", + "rpc": "setconfig", + "title": "Dynamically change some config options", + "description": [ + "The **setconfig** RPC command allows you set the (dynamic) configuration option named by `config`: options which take a value (as separate from simple flag options) also need a `val` parameter.", + "", + "This new value will *also* be written at the end of the config file, for persistence across restarts (and any old value commented out).", + "", + "You can see what options are dynamically adjustable using lightning- listconfigs(7). Note that you can also adjust existing options for stopped plugins; they will have an effect when the plugin is restarted." + ], + "request": { + "required": [ + "config" + ], + "properties": { + "config": { + "type": "string", + "description": [ + "Name of the config variable which should be set to the value of the variable." + ] + }, + "val": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "boolean" + } + ], + "description": [ + "Value of the config variable to be set or updated." + ] + } + } + }, + "response": { + "required": [ + "config" + ], + "properties": { + "config": { + "type": "object", + "description": [ + "Config settings after completion." + ], + "additionalProperties": false, + "required": [ + "config", + "source", + "dynamic" + ], + "properties": { + "config": { + "type": "string", + "description": [ + "Name of the config variable which was set." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting (`file`:`linenum`)." + ] + }, + "plugin": { + "type": "string", + "description": [ + "The plugin this configuration setting is for." + ] + }, + "dynamic": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Whether this option is settable via setconfig." + ] + }, + "set": { + "type": "boolean", + "description": [ + "For simple flag options." + ] + }, + "value_str": { + "type": "string", + "description": [ + "For string options." + ] + }, + "value_msat": { + "type": "msat", + "description": [ + "For msat options." + ] + }, + "value_int": { + "type": "integer", + "description": [ + "For integer options." + ] + }, + "value_bool": { + "type": "boolean", + "description": [ + "For boolean options." + ] + } + } + } + } + }, + "errors": [ + "The following error codes may occur:", + "", + "- -32602: JSONRPC2_INVALID_PARAMS, i.e. the parameter is not dynamic, or the val was invalid." + ], + "example_json_request": [ + { + "id": "example:setconfig#1", + "method": "setconfig", + "params": [ + "autoclean-paidinvoices-age", + 1 + ] + }, + { + "id": "example:setconfig#2", + "method": "setconfig", + "params": [ + "test-dynamic-config", + "changed" + ] + }, + { + "id": "example:setconfig#3", + "method": "setconfig", + "params": { + "config": "min-capacity-sat", + "val": 500000 + } + } + ], + "example_json_response": [ + { + "config": { + "config": "autoclean-paidinvoices-age", + "value_int": 1, + "source": "/tmp/ltests-7u_8_rtu/test_autoclean_1/lightning-3/regtest/config:6", + "plugin": "~/lightning/plugins/autoclean", + "dynamic": true + } + }, + { + "config": { + "config": "test-dynamic-config", + "value_str": "changed", + "source": "/tmp/ltests-7u_8_rtu/test_dynamic_option_python_plugin_1/lightning-1/regtest/config:2", + "plugin": "~/lightning/tests/plugins/dynamic_option.py", + "dynamic": true + } + }, + { + "config": { + "config": "min-capacity-sat", + "value_int": 500000, + "source": "/tmp/ltests-nvfdbou2/test_setconfig_1/lightning-2/regtest/config:2", + "dynamic": true + } + } + ], + "author": [ + "Rusty Russell <> is mainly responsible for this feature." + ], + "see_also": [ + "lightningd-config(5)", + "lightning-listconfigs(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-setpsbtversion.json b/doc/schemas/lightning-setpsbtversion.json new file mode 100644 index 000000000000..f4f26ebd6fa1 --- /dev/null +++ b/doc/schemas/lightning-setpsbtversion.json @@ -0,0 +1,85 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "setpsbtversion", + "title": "Command for setting PSBT version", + "description": [ + "The **setpsbtversion** RPC command converts the provided PSBT to the given version, and returns the base64 result of the conversion. Returns an error if version is invalid." + ], + "request": { + "required": [ + "psbt", + "version" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "The PSBT to change versions." + ] + }, + "version": { + "type": "u32", + "description": [ + "The version to set." + ] + } + } + }, + "response": { + "required": [ + "psbt" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "A converted PSBT of the requested version." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:setpsbtversion#1", + "method": "setpsbtversion", + "params": { + "psbt": "cHNidP8BAAoCAAAAAAAAAAAAAA==", + "version": "2" + } + }, + { + "id": "example:setpsbtversion#2", + "method": "setpsbtversion", + "params": [ + "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIJd6ICNAQALFOMhoUHuSVSuzcaUdkDKlk4K+A+DR9+4uAA==", + 0 + ] + } + ], + "errors": [ + "The following error codes may occur:", + "", + "- -32602: Parameter missed or malformed." + ], + "example_json_response": [ + { + "psbt": "cHNidP8BAgQCAAAAAQQBAAEFAQABBgEDAfsEAgAAAAA=" + }, + { + "psbt": "cHNidP8BADUCAAAAAAFAQg8AAAAAACJRIJd6ICNAQALFOMhoUHuSVSuzcaUdkDKlk4K+A+DR9+4ubwAAAAAA" + } + ], + "author": [ + "Gregory Sanders <> is mainly responsible." + ], + "see_also": [ + "lightning-fundpsbt(7)", + "lightning-utxopsbt(7)", + "lightning-signpsbt(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-showrunes.json b/doc/schemas/lightning-showrunes.json new file mode 100644 index 000000000000..fca78dcc8fc6 --- /dev/null +++ b/doc/schemas/lightning-showrunes.json @@ -0,0 +1,239 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.08", + "rpc": "showrunes", + "title": "Command to list previously generated runes", + "description": [ + "The **showrunes** RPC command either lists runes that we stored as we generate them (see lightning-createrune(7)) or decodes the rune given on the command line." + ], + "request": { + "required": [], + "properties": { + "rune": { + "type": "string", + "description": [ + "If specified, only details of that rune will be returned." + ] + } + } + }, + "response": { + "required": [ + "runes" + ], + "properties": { + "runes": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "rune", + "unique_id", + "restrictions", + "restrictions_as_english" + ], + "properties": { + "rune": { + "type": "string", + "description": [ + "Base64 encoded rune." + ] + }, + "unique_id": { + "type": "string", + "description": [ + "Unique id assigned when the rune was generated; this is always a u64 for commando runes." + ] + }, + "restrictions": { + "type": "array", + "description": [ + "The restrictions on what commands this rune can authorize." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "alternatives", + "english" + ], + "properties": { + "alternatives": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "fieldname", + "value", + "condition", + "english" + ], + "properties": { + "fieldname": { + "type": "string", + "description": [ + "The field this restriction applies to; see commando-rune(7)." + ] + }, + "value": { + "type": "string", + "description": [ + "The value accepted for this field." + ] + }, + "condition": { + "type": "string", + "description": [ + "The way to compare fieldname and value." + ] + }, + "english": { + "type": "string", + "description": [ + "English readable description of this alternative." + ] + } + } + } + }, + "english": { + "type": "string", + "description": [ + "English readable summary of alternatives above." + ] + } + } + } + }, + "restrictions_as_english": { + "type": "string", + "description": [ + "English readable description of the restrictions array above." + ] + }, + "stored": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "This is false if the rune does not appear in our datastore (only possible when `rune` is specified)." + ] + }, + "blacklisted": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "The rune has been blacklisted; see commando-blacklist(7)." + ] + }, + "last_used": { + "type": "number", + "description": [ + "The last time this rune was successfully used." + ], + "added": "23.11" + }, + "our_rune": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "This is not a rune for this node (only possible when `rune` is specified)." + ] + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:showrunes#1", + "method": "showrunes", + "params": "{}" + }, + { + "id": "example:showrunes#2", + "method": "showrunes", + "params": { + "rune": "Bl0V_vkVkGr4h356JbCMCcoDyyKE8djkoQ2156iPB509MCZwZXI9MTAwMDAwMDAwMG5zZWM=" + } + } + ], + "example_json_response": [ + { + "runes": [ + { + "rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==", + "unique_id": "0", + "restrictions": [], + "restrictions_as_english": "" + }, + { + "rune": "geZmO6U7yqpHn-moaX93FVMVWrDRfSNY4AXx9ypLcqg9MQ==", + "unique_id": "1", + "restrictions": [], + "restrictions_as_english": "" + }, + { + "rune": "Bl0V_vkVkGr4h356JbCMCcoDyyKE8djkoQ2156iPB509MCZwZXI9MTAwMDAwMDAwMG5zZWM=", + "unique_id": "2", + "restrictions": [ + { + "alternatives": [ + { + "fieldname": "per", + "value": "1000000000nsec", + "condition": "=", + "english": "per equal to 1000000000nsec" + } + ], + "english": "per equal to 1000000000nsec" + } + ], + "restrictions_as_english": "per equal to 1000000000nsec" + } + ] + }, + { + "runes": [ + { + "rune": "Bl0V_vkVkGr4h356JbCMCcoDyyKE8djkoQ2156iPB509MCZwZXI9MTAwMDAwMDAwMG5zZWM=", + "unique_id": "2", + "restrictions": [ + { + "alternatives": [ + { + "fieldname": "per", + "value": "1000000000nsec", + "condition": "=", + "english": "per equal to 1000000000nsec" + } + ], + "english": "per equal to 1000000000nsec" + } + ], + "restrictions_as_english": "per equal to 1000000000nsec" + } + ] + } + ], + "author": [ + "Shahana Farooqui <> is mainly responsible." + ], + "see_also": [ + "lightning-commando-showrunes(7)", + "lightning-blacklistrune(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-signinvoice.json b/doc/schemas/lightning-signinvoice.json new file mode 100644 index 000000000000..33b85c4109b4 --- /dev/null +++ b/doc/schemas/lightning-signinvoice.json @@ -0,0 +1,71 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.02", + "rpc": "signinvoice", + "title": "Low-level invoice signing", + "description": [ + "The **signinvoice** RPC command signs an invoice. Unlike **createinvoice** it does not save the invoice into the database and thus does not require the preimage." + ], + "request": { + "required": [ + "invstring" + ], + "properties": { + "invstring": { + "type": "string", + "description": [ + "Bolt11 form, but the final signature is ignored. Minimal sanity checks are done." + ] + } + } + }, + "response": { + "required": [ + "bolt11" + ], + "properties": { + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string." + ] + } + } + }, + "errors": [ + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error." + ], + "example_json_request": [ + { + "id": "example:signinvoice#1", + "method": "signinvoice", + "params": [ + "lnbcrt10n1pjmxt3lsp5jumuz2sv3ca68kzd92hp3wdtpx8ghnxur65fs6maw6dyxsleqd0spp5nadvvh7uzk2qzh8d9d7tsxr08l9uaz2vjeuuahqtufjv52d0eassdq8d9h8vvgxqyjw5qcqp99qxpqysgq4rrn702eum6c9ld9khlz39vdyd8zcwrav5ygqvu6w54aep6yarkyfrnk990yf5prpasgzmj52stektf6mzwdl5hc6qlsglt2a0pwp0spwww44w" + ] + } + ], + "example_json_response": [ + { + "bolt11": "lnbcrt10n1pjmxt3lsp5jumuz2sv3ca68kzd92hp3wdtpx8ghnxur65fs6maw6dyxsleqd0spp5nadvvh7uzk2qzh8d9d7tsxr08l9uaz2vjeuuahqtufjv52d0eassdq8d9h8vvgxqyjw5qcqp99qxpqysgq3nhrd72qe7wmc2hvwhaqnx05y6dzxh2tal02kw055er7uutkkrcreccm37ce6wv7ee8q70ktlr9fy3fd635hc2k98a4svd9c8v4cpjsppm2eee" + } + ], + "author": [ + "Carl Dong <> is mainly responsible." + ], + "see_also": [ + "lightning-createinvoice(7)", + "lightning-invoice(7)", + "lightning-listinvoices(7)", + "lightning-delinvoice(7)", + "lightning-getroute(7)", + "lightning-sendpay(7)", + "lightning-offer(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-signmessage.json b/doc/schemas/lightning-signmessage.json new file mode 100644 index 000000000000..6e1d709bc693 --- /dev/null +++ b/doc/schemas/lightning-signmessage.json @@ -0,0 +1,93 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "signmessage", + "title": "Command to create a signature from this node", + "description": [ + "The **signmessage** RPC command creates a digital signature of *message* using this node's secret key. A receiver who knows your node's *id* and the *message* can be sure that the resulting signature could only be created by something with access to this node's secret key." + ], + "request": { + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string", + "description": [ + "Less than 65536 characters long message to be signed by the node." + ] + } + } + }, + "response": { + "required": [ + "signature", + "recid", + "zbase" + ], + "properties": { + "signature": { + "type": "hex", + "description": [ + "The signature." + ], + "minLength": 128, + "maxLength": 128 + }, + "recid": { + "type": "hex", + "description": [ + "The recovery id (0, 1, 2 or 3)." + ], + "minLength": 2, + "maxLength": 2 + }, + "zbase": { + "type": "string", + "description": [ + "*signature* and *recid* encoded in a style compatible with **lnd**'s [SignMessageRequest](https://api.lightning.community/#grpc-request- signmessagerequest)." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:signmessage#1", + "method": "signmessage", + "params": { + "message": "this is a test!" + } + }, + { + "id": "example:signmessage#2", + "method": "signmessage", + "params": { + "message": "message for you" + } + } + ], + "example_json_response": [ + { + "signature": "a2ec227012795f9d6b80a3f5ea98374c6d2886917517c05336799923fcf37caf08344c0431275e1a8189da01b444ae978007fe70f0cc9009f38cabe074ade87d", + "recid": "00", + "zbase": "d6tqaeuonjhi98mmont9m4wag7gg4krg1f4txonug3h31e9h6p6k6nbwjondnj46dkyausobstnk7fhyy998bhgc1yr98dfmhb4k54d7" + }, + { + "signature": "85843b010bc517b32eaafe70232e2c44bb5a354c74d2202390af1b272e4c6ac23ac3f97ea663d8b49116ad6c2d080515b43bcdf1ea4f38cdb18af0edf8209cd8", + "recid": "00", + "zbase": "d6naeqabbxntxc3qim98ye3qftnmsstijt4prebd1nztsj3qjticrqsd9f9kca6as1etpmmcfwrykfpw8xg9d41x8dg5dnzo7zhnb8ga" + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-checkmessage(7)" + ], + "resources": [ + "Main web site: ", + "", + "[SignMessageRequest](https://api.lightning.community/#grpc-request-signmessagerequest)" + ] +} diff --git a/doc/schemas/lightning-signpsbt.json b/doc/schemas/lightning-signpsbt.json new file mode 100644 index 000000000000..4eac54b74f4a --- /dev/null +++ b/doc/schemas/lightning-signpsbt.json @@ -0,0 +1,93 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "signpsbt", + "title": "Command to sign a wallet's inputs on a provided bitcoin transaction (PSBT).", + "description": [ + "**signpsbt** is a low-level RPC command which signs a PSBT as defined by BIP-174.", + "", + "By default, all known inputs are signed, and others ignored: with *signonly*, only those inputs are signed, and an error is returned if one of them cannot be signed.", + "", + "Note that the command will fail if there are no inputs to sign, or if the inputs to be signed were not previously reserved." + ], + "request": { + "required": [ + "psbt" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "The psbt to be signed." + ] + }, + "signonly": { + "type": "array", + "description": [ + "Input numbers to sign." + ], + "items": { + "type": "u32" + } + } + } + }, + "response": { + "required": [ + "signed_psbt" + ], + "properties": { + "signed_psbt": { + "type": "string", + "description": [ + "The fully signed PSBT." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:signpsbt#1", + "method": "signpsbt", + "params": { + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAAAAAAEQBAAAAAAM/AlsaWdodG5pbmcBCCvyYqqdIt0mAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oBDiBWd3IcNaQkoj1tzHyQkDblBa5oZQ4J1ZcztLfnMAOk3AEPBAEAAAABEAT9////DPwJbGlnaHRuaW5nAQg5j4QWOQoUFAABAwhOfA0AAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4M/AlsaWdodG5pbmcBCMbeD+3qn9/kAAEDCODIEAAAAAAAAQQiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQz8CWxpZ2h0bmluZwEI4upB+mjl6AIA", + "signonly": null + } + }, + { + "id": "example:signpsbt#2", + "method": "signpsbt", + "params": { + "psbt": "cHNidP8BAP1xAQIAAAAIFTef27H2GAJBzP4UZMeDePsDVkglO47/q4jqK18ibCYAAAAAAP3///+axwap6WKnEHvLjIJZX0ZeJ87cs7PKkXBfwvbGVmjpTQEAAAAA/f///wQ1cVzb9NR7nXadyRuhQBv+2iqhZkhvUA+sPo5z/SsSAQAAAAD9////lXQ788meUtSxhBX13mx2XhyM3Ddo30QtmNW0YuE2TDABAAAAAP3///8Kr4BwElAScx3bA5ZdavrHwh4Zh+rFNvkE/+7gu1WbngEAAAAA/f///3Uei7j3k/b5tnjFGvNZhe2iWz8O6FQjTEpM5XIoduNsAQAAAAD9////fm5Om4MojcnfZiTmrwb4b5Byw9emrjITi/nkEqTK9MsBAAAAAP3///8lwdpZqt3ILPRwhINY4PGvkg2CSw7agcMPSuFoHDDkIQAAAAAA/f///wGCAXoAAAAAABYAFMkJbUP0COpSYCAmLM2tfIUWuSqBAAAAAAABAHECAAAAAZVxzFxyEg7tiQTgRHwGleR8Srxw6taAGOoEpJK/Xj5sAAAAAAD9////AkBCDwAAAAAAFgAUKvGgVL/ThjWE/P1oORVXh/ObucYzr/YpAQAAABYAFKmkod5S53U4m5tKFApyeC35UbnbZwAAAAEBH0BCDwAAAAAAFgAUKvGgVL/ThjWE/P1oORVXh/ObucYAAQBxAgAAAAEVN5/bsfYYAkHM/hRkx4N4+wNWSCU7jv+riOorXyJsJgEAAAAA/f///wJmbOcpAQAAABYAFCCSJBD9wY/VwxnBcnFiu1tA6CGTQEIPAAAAAAAWABSjI8KCqaGX/BGOwJza8hyiuxuIcmcAAAABAR9AQg8AAAAAABYAFKMjwoKpoZf8EY7AnNryHKK7G4hyAAEAcQIAAAAB98EwKZMOHiyRYWyToae6Kce3gCwqUvnVXXHlB/ps9ocBAAAAAP3///8CmNuLKQEAAAAWABQ4roxw+phYHelaRr71DYB3FEy/30BCDwAAAAAAFgAUwSDtQiY7PVvBc7ww56Y72YIQdjllAAAAAQEfQEIPAAAAAAAWABTBIO1CJjs9W8FzvDDnpjvZghB2OQABAHECAAAAAZH/SvCXvDW7b8qb55CDC4M+jgZ61H/e8rZnAGaXp+Z+AAAAAAD9////Apkp2CkBAAAAFgAUc/Y+sIq3oYyEe40GkKJsXawkzwFAQg8AAAAAABYAFLdt1h5Bte8FKvIc2jJgiIwHC7mvZwAAAAEBH0BCDwAAAAAAFgAUt23WHkG17wUq8hzaMmCIjAcLua8AAQBxAgAAAAETC3wMCv9qK3lvVkVJu9b/v2VgMepZtnfngMp2xMXRnwAAAAAA/f///wJk0E4pAQAAABYAFEIsc4cBl+BTN33Kn80+YYfkMt+cQEIPAAAAAAAWABT2/7RIxKohhGbacpBz0BZNYcnfsGUAAAABAR9AQg8AAAAAABYAFPb/tEjEqiGEZtpykHPQFk1hyd+wAAEAcQIAAAABA8J/OnC+cuH79Z6wZmzwdAjhBDaPHavh3yvhr4odDXQBAAAAAP3///8CykowKQEAAAAWABTVHuO8cKOOX/JlmMU66on6Uc54mkBCDwAAAAAAFgAUunZMZryWMqCTiMuVWNF/cleg6dVnAAAAAQEfQEIPAAAAAAAWABS6dkxmvJYyoJOIy5VY0X9yV6Dp1QABAHECAAAAAfRxBaZZ3FfDGwxhZQLYCurN+7kJj0x6nzChg434dnjRAAAAAAD9////AszmyCkBAAAAFgAULSqRp54barF/7R9XOmsLDCVWdAFAQg8AAAAAABYAFNa5adNt/9rZhpGT9mPuSA39xzSIZQAAAAEBH0BCDwAAAAAAFgAU1rlp023/2tmGkZP2Y+5IDf3HNIgAAQBxAgAAAAEgk1JYyP4oIoPoYYcTPPDvZynVfXWINJnBEFBsLv0MtAAAAAAA/f///wJAQg8AAAAAABYAFGYcI7eQ3TSRNzrwsdi+0Id9XN4iMmGqKQEAAAAWABT5XKNwVIFsUKh26sqHFSlOLq5TFGUAAAABAR9AQg8AAAAAABYAFGYcI7eQ3TSRNzrwsdi+0Id9XN4iAAA=", + "signonly": [ + 7 + ] + } + } + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters, or there aren't wallet's inputs to sign, or we couldn't sign all of *signonly*, or inputs are not reserved." + ], + "example_json_response": [ + { + "signed_psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAAAAAAEQBAAAAAAM/AlsaWdodG5pbmcBCCvyYqqdIt0mAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oBDiBWd3IcNaQkoj1tzHyQkDblBa5oZQ4J1ZcztLfnMAOk3AEPBAEAAAABEAT9////ARNACI9TcWG+6uC9ElBFN3qhND7amsor/dtBhJ5ujEQAT/80548avrt7d7IJiOAaCNzzYLSXITdL2xjx6mhbBi9hTiEWkUUygSpECk12bHHNORk2lKNArhHgEuW6Gtnvum52ylMJAMLMqxcAAAAADPwJbGlnaHRuaW5nAQg5j4QWOQoUFAABAwhOfA0AAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4hB7nAxoROEqUxyWjlXFUHjsFtm/dr6SkP2H0cynK0g5oXCQDWuWnTBAAAAAz8CWxpZ2h0bmluZwEIxt4P7eqf3+QAAQMI4MgQAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQji6kH6aOXoAgA=" + }, + { + "signed_psbt": "cHNidP8BAP1xAQIAAAAIFTef27H2GAJBzP4UZMeDePsDVkglO47/q4jqK18ibCYAAAAAAP3///+axwap6WKnEHvLjIJZX0ZeJ87cs7PKkXBfwvbGVmjpTQEAAAAA/f///wQ1cVzb9NR7nXadyRuhQBv+2iqhZkhvUA+sPo5z/SsSAQAAAAD9////lXQ788meUtSxhBX13mx2XhyM3Ddo30QtmNW0YuE2TDABAAAAAP3///8Kr4BwElAScx3bA5ZdavrHwh4Zh+rFNvkE/+7gu1WbngEAAAAA/f///3Uei7j3k/b5tnjFGvNZhe2iWz8O6FQjTEpM5XIoduNsAQAAAAD9////fm5Om4MojcnfZiTmrwb4b5Byw9emrjITi/nkEqTK9MsBAAAAAP3///8lwdpZqt3ILPRwhINY4PGvkg2CSw7agcMPSuFoHDDkIQAAAAAA/f///wGCAXoAAAAAABYAFMkJbUP0COpSYCAmLM2tfIUWuSqBAAAAAAABAHECAAAAAZVxzFxyEg7tiQTgRHwGleR8Srxw6taAGOoEpJK/Xj5sAAAAAAD9////AkBCDwAAAAAAFgAUKvGgVL/ThjWE/P1oORVXh/ObucYzr/YpAQAAABYAFKmkod5S53U4m5tKFApyeC35UbnbZwAAAAEBH0BCDwAAAAAAFgAUKvGgVL/ThjWE/P1oORVXh/ObucYAAQBxAgAAAAEVN5/bsfYYAkHM/hRkx4N4+wNWSCU7jv+riOorXyJsJgEAAAAA/f///wJmbOcpAQAAABYAFCCSJBD9wY/VwxnBcnFiu1tA6CGTQEIPAAAAAAAWABSjI8KCqaGX/BGOwJza8hyiuxuIcmcAAAABAR9AQg8AAAAAABYAFKMjwoKpoZf8EY7AnNryHKK7G4hyAAEAcQIAAAAB98EwKZMOHiyRYWyToae6Kce3gCwqUvnVXXHlB/ps9ocBAAAAAP3///8CmNuLKQEAAAAWABQ4roxw+phYHelaRr71DYB3FEy/30BCDwAAAAAAFgAUwSDtQiY7PVvBc7ww56Y72YIQdjllAAAAAQEfQEIPAAAAAAAWABTBIO1CJjs9W8FzvDDnpjvZghB2OQABAHECAAAAAZH/SvCXvDW7b8qb55CDC4M+jgZ61H/e8rZnAGaXp+Z+AAAAAAD9////Apkp2CkBAAAAFgAUc/Y+sIq3oYyEe40GkKJsXawkzwFAQg8AAAAAABYAFLdt1h5Bte8FKvIc2jJgiIwHC7mvZwAAAAEBH0BCDwAAAAAAFgAUt23WHkG17wUq8hzaMmCIjAcLua8AAQBxAgAAAAETC3wMCv9qK3lvVkVJu9b/v2VgMepZtnfngMp2xMXRnwAAAAAA/f///wJk0E4pAQAAABYAFEIsc4cBl+BTN33Kn80+YYfkMt+cQEIPAAAAAAAWABT2/7RIxKohhGbacpBz0BZNYcnfsGUAAAABAR9AQg8AAAAAABYAFPb/tEjEqiGEZtpykHPQFk1hyd+wAAEAcQIAAAABA8J/OnC+cuH79Z6wZmzwdAjhBDaPHavh3yvhr4odDXQBAAAAAP3///8CykowKQEAAAAWABTVHuO8cKOOX/JlmMU66on6Uc54mkBCDwAAAAAAFgAUunZMZryWMqCTiMuVWNF/cleg6dVnAAAAAQEfQEIPAAAAAAAWABS6dkxmvJYyoJOIy5VY0X9yV6Dp1QABAHECAAAAAfRxBaZZ3FfDGwxhZQLYCurN+7kJj0x6nzChg434dnjRAAAAAAD9////AszmyCkBAAAAFgAULSqRp54barF/7R9XOmsLDCVWdAFAQg8AAAAAABYAFNa5adNt/9rZhpGT9mPuSA39xzSIZQAAAAEBH0BCDwAAAAAAFgAU1rlp023/2tmGkZP2Y+5IDf3HNIgAAQBxAgAAAAEgk1JYyP4oIoPoYYcTPPDvZynVfXWINJnBEFBsLv0MtAAAAAAA/f///wJAQg8AAAAAABYAFGYcI7eQ3TSRNzrwsdi+0Id9XN4iMmGqKQEAAAAWABT5XKNwVIFsUKh26sqHFSlOLq5TFGUAAAABAR9AQg8AAAAAABYAFGYcI7eQ3TSRNzrwsdi+0Id9XN4iIgID+pyVCF5CseUAPNH0GBeMMMluSud5VMoPxIxYgm/06w5HMEQCIG90DSr+fGNoWhCrgLbJG3Wt8PJNMWYqaa5MLWRwA0oTAiA9rsLEqqVhjV6wENfzzpudaE949uLlVqWgDjE/FSgKNAEiBgP6nJUIXkKx5QA80fQYF4wwyW5K53lUyg/EjFiCb/TrDghmHCO3AAAAAAAA" + } + ], + "author": [ + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." + ], + "see_also": [ + "lightning-fundpsbt(7)", + "lightning-sendpsbt(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-splice_init.json b/doc/schemas/lightning-splice_init.json new file mode 100644 index 000000000000..6e8d01b90820 --- /dev/null +++ b/doc/schemas/lightning-splice_init.json @@ -0,0 +1,152 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.08", + "rpc": "splice_init", + "title": "Command to initiate a channel to a peer", + "warning": "experimental-splicing only", + "description": [ + "`splice_init` is a low level RPC command which initiates a channel splice for a given channel specified by `channel_id`." + ], + "request": { + "required": [ + "channel_id", + "relative_amount" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "The channel id of the channel to be spliced." + ] + }, + "relative_amount": { + "type": "integer", + "description": [ + "A positive or negative amount of satoshis to add or subtract from the channel. Note you may need to add a double dash (--) after splice_init if using a negative *relative_amount* so it is not interpretted as a command modifier. For example: ```shell lightning-cli splice_init -- $CHANNEL_ID -100000 ```." + ] + }, + "initialpsbt": { + "type": "string", + "description": [ + "The (optional) base 64 encoded PSBT to begin with. If not specified, one will be generated automatically." + ] + }, + "feerate_per_kw": { + "type": "u32", + "description": [ + "The miner fee we promise our peer to pay for our side of the splice transaction. It is calculated by `feerate_per_kw` * our_bytes_in_splice_tx / 1000." + ] + }, + "force_feerate": { + "type": "boolean", + "description": [ + "By default splices will fail if the fee provided looks too high. This is to protect against accidentally setting your fee higher than intended. Set `force_feerate` to true to skip this saftey check." + ] + } + } + }, + "response": { + "required": [ + "psbt" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "The (incomplete) PSBT of the splice transaction." + ] + } + } + }, + "example_usage": [ + "Here is an example set of splice commands that will splice in 100,000 sats to the first channel that comes out of `listpeerchannels`. The example assumes you already have at least one confirmed channel.", + "", + "```shell", + "RESULT=$(lightning-cli listpeerchannels)", + "CHANNEL_ID=$(echo $RESULT| jq -r \".channels[0].channel_id\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli fundpsbt -k satoshi=100000sat feerate=urgent startweight=800 excess_as_change=true)", + "INITIALPSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli splice_init $CHANNEL_ID 100000 $INITIALPSBT)", + "PSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT)", + "PSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli signpsbt -k psbt=\"$PSBT\")", + "PSBT=$(echo $RESULT | jq -r \".signed_psbt\")", + "echo $RESULT", + "", + "lightning-cli splice_signed $CHANNEL_ID $PSBT", + "```", + "", + "Here is an example set of splice commands that will splice out 100,000 sats from first channel that comes out of `listpeerchannels`. The example assumes you already have at least one confirmed channel.", + "", + "```shell", + "RESULT=$(lightning-cli listpeerchannels)", + "CHANNEL_ID=$(echo $RESULT| jq -r \".channels[0].channel_id\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli addpsbtoutput 100000)", + "INITIALPSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli splice_init -- $CHANNEL_ID -100500 $INITIALPSBT)", + "PSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT)", + "PSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "lightning-cli splice_signed $CHANNEL_ID $PSBT", + "```" + ], + "example_json_request": [ + { + "id": "example:splice_init#1", + "method": "splice_init", + "params": { + "channel_id": "5677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc", + "relative_amount": 100000, + "initialpsbt": "cHNidP8BAF4CAAAAAVZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQAAAAD9////AU58DQAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5sAAAAAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==", + "feerate_per_kw": null + } + }, + { + "id": "example:splice_init#2", + "method": "splice_init", + "params": { + "channel_id": "a40bb442dab0231b51d8f842d95aad548aa35e1d13c4cfcf2997344f805453a1", + "relative_amount": -105000, + "initialpsbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIoIYBAAAAAAABBCJRIHg2NV/cioLcTLAKdyxVVBUdBjhKTdZejT9orAhWa4S+AA==", + "feerate_per_kw": null + } + } + ], + "example_json_response": [ + { + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEFR1IhAjJCZt6EA7OrFXoJ8feE1YevYYMcmYwVG8whu3TCsjFLIQLjvTgAmGbJ2o7EqpnMTqnGwN1G3xXGHvDOHycSkXFOV1KuAQ4gVndyHDWkJKI9bcx8kJA25QWuaGUOCdWXM7S35zADpNwBDwQAAAAAARAEAAAAAAz8CWxpZ2h0bmluZwEIK/Jiqp0i3SYAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAQAAAAEQBP3///8M/AlsaWdodG5pbmcBCDmPhBY5ChQUAAEDCE58DQAAAAAAAQQiUSB4NjVf3IqC3EywCncsVVQVHQY4Sk3WXo0/aKwIVmuEvgz8CWxpZ2h0bmluZwEIxt4P7eqf3+QAAQMIAAAAAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQji6kH6aOXoAgA=" + }, + { + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABARzi7RBt64yrfqRL2p+KiUw8cYtiKICRFHmp/4eCSemSAQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgTCjR9L+TfzP7pLJVVto5egTRbRNj/RaBhyrA3UW0aEcCIAJO5FZjXvdpRcGR949C4DnfHs3soklTjn/1upkia+TgASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M9mAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEFR1IhAjJCZt6EA7OrFXoJ8feE1YevYYMcmYwVG8whu3TCsjFLIQLjvTgAmGbJ2o7EqpnMTqnGwN1G3xXGHvDOHycSkXFOV1KuAQ4gpAu0QtqwIxtR2PhC2VqtVIqjXh0TxM/PKZc0T4BUU6EBDwQAAAAAARAEAAAAAAz8CWxpZ2h0bmluZwEIn2Ac8fyFEJwAAQMIAAAAAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQgu7JK9IpBWOAABAwighgEAAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4M/AlsaWdodG5pbmcBCOZ1GpRwbKfuAA==" + } + ], + "author": [ + "Dusty <<@dusty_daemon>> is mainly responsible." + ], + "see_also": [ + "lightning-splice_signed(7)", + "lightning-splice_update(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-splice_signed.json b/doc/schemas/lightning-splice_signed.json new file mode 100644 index 000000000000..08c5756dafac --- /dev/null +++ b/doc/schemas/lightning-splice_signed.json @@ -0,0 +1,127 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.08", + "rpc": "splice_signed", + "title": "Command to initiate a channel to a peer", + "warning": "experimental-splicing only", + "description": [ + "`splice_signed` is a low level RPC command which finishes the active channel splice associated with `channel_id`.", + "", + "The *psbt* must have all signatures attached to all inputs that you have added to it or it will fail." + ], + "request": { + "required": [ + "channel_id", + "psbt" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "The channel id of the channel to be spliced." + ] + }, + "psbt": { + "type": "string", + "description": [ + "The final version of the psbt to complete the splice with." + ] + }, + "sign_first": { + "type": "boolean", + "description": [ + "A flag that makes our node offer the final splice signature first (defaults to false). When false, the node will calculate who should sign first based off who is adding inputting the least sats to the splice as per spec." + ] + } + } + }, + "response": { + "required": [ + "tx", + "txid" + ], + "properties": { + "tx": { + "type": "hex", + "description": [ + "The hex representation of the final transaction that is published." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The txid is of the final transaction." + ] + } + } + }, + "example_usage": [ + "In this example we funded the psbt from our lightning node, so we can use the lightning node to sign for its funds.", + "", + "```shell", + "RESULT=$(lightning-cli signpsbt $PSBT)", + "PSBT=$(echo $RESULT | jq -r \".signed_psbt\")", + "echo $RESULT", + "", + "lightning-cli splice_signed $CHANNEL_ID $PSBT", + "```", + "", + "Here is a full example set of splice commands that will splice in 100,000 sats to the first channel that comes out of `listpeerchannels`. The example assumes you already have at least one confirmed channel.", + "", + "```shell", + "RESULT=$(lightning-cli listpeerchannels)", + "CHANNEL_ID=$(echo $RESULT| jq -r \".channels[0].channel_id\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli fundpsbt -k satoshi=100000sat feerate=urgent startweight=800 excess_as_change=true)", + "INITIALPSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli splice_init $CHANNEL_ID 100000 $INITIALPSBT)", + "PSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT={\"commitments_secured\":false}", + "while [[ $(echo $RESULT | jq -r \".commitments_secured\") == \"false\" ]]", + "do", + " RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT)", + " PSBT=$(echo $RESULT | jq -r \".psbt\")", + " echo $RESULT", + "done", + "", + "RESULT=$(lightning-cli signpsbt -k psbt=\"$PSBT\")", + "PSBT=$(echo $RESULT | jq -r \".signed_psbt\")", + "echo $RESULT", + "", + "lightning-cli splice_signed $CHANNEL_ID $PSBT", + "```" + ], + "example_json_request": [ + { + "id": "example:splice_signed#1", + "method": "splice_signed", + "params": { + "channel_id": "5677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc", + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAAAAAAEQBAAAAAAM/AlsaWdodG5pbmcBCCvyYqqdIt0mAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oBDiBWd3IcNaQkoj1tzHyQkDblBa5oZQ4J1ZcztLfnMAOk3AEPBAEAAAABEAT9////ARNACI9TcWG+6uC9ElBFN3qhND7amsor/dtBhJ5ujEQAT/80548avrt7d7IJiOAaCNzzYLSXITdL2xjx6mhbBi9hTiEWkUUygSpECk12bHHNORk2lKNArhHgEuW6Gtnvum52ylMJAMLMqxcAAAAADPwJbGlnaHRuaW5nAQg5j4QWOQoUFAABAwhOfA0AAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4hB7nAxoROEqUxyWjlXFUHjsFtm/dr6SkP2H0cynK0g5oXCQDWuWnTBAAAAAz8CWxpZ2h0bmluZwEIxt4P7eqf3+QAAQMI4MgQAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQji6kH6aOXoAgA=" + } + } + ], + "example_json_response": [ + { + "tx": "020000000001025677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc0000000000000000005677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc0100000000fdffffff024e7c0d00000000002251207836355fdc8a82dc4cb00a772c5554151d06384a4dd65e8d3f68ac08566b84bee0c81000000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd0400473044022053269f3951a1fc942174ac0dde8462405a86c89b31b444890664ee9735872cff02204cd822c4456c15e90ad342b23e9bb252d383d4e17a8a04818c4919e4fd61efd80147304402205ac0787c79e74ebfa0eaf18964625c53eb672cc4bed2c65303bd9cc192dad6f902206c6c0cded47201dae0020f50a8998555e654d3420c64e801fc668238e3c1cdfa0147522102324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b2102e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5752ae0140088f537161beeae0bd125045377aa1343eda9aca2bfddb41849e6e8c44004fff34e78f1abebb7b77b20988e01a08dcf360b49721374bdb18f1ea685b062f614e6c000000", + "txid": "f00d5e230b401274c88d3e6205e2c6117028cb9878b7d2bc52b1441f0b589427" + } + ], + "author": [ + "Dusty <<@dusty_daemon>> is mainly responsible." + ], + "see_also": [ + "lightning-splice_init(7)", + "lightning-splice_update(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-splice_update.json b/doc/schemas/lightning-splice_update.json new file mode 100644 index 000000000000..02e58de6eaae --- /dev/null +++ b/doc/schemas/lightning-splice_update.json @@ -0,0 +1,131 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.08", + "rpc": "splice_update", + "title": "Command to initiate a channel to a peer", + "warning": "experimental-splicing only", + "description": [ + "`splice_update` is a low level RPC command which updates the active channel splice associated with `channel_id`.", + "", + "`splice_update` must be called repeatidly until the result `commitments_secured` is `true`. Each time `splice_update` is called, it will return a new PSBT that may have changes. In the simplest case, you take the returned `psbt` and pass it back into `splice_update` for the incoming `psbt` field.", + "", + "For more complex use cases, you may modify the `psbt` both before calling `splice_update` and inbetween subsequent calls until `commitments_secured` is `true`. After which point you can no long make modifications to the PSBT (beyond signing, which comes later with `splice_signed`).", + "", + "Each `splice_update` result may include changes to the PSBT specified by your channel peer. You can review these changes between calls to `splice_update` to perform additional validation or strategy adjustment.", + "", + "Typically, `splice_update` will return `commitments_secured` true after one call but you should assume it will need multiple calls." + ], + "request": { + "required": [ + "channel_id", + "psbt" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "The channel id of the channel to be spliced." + ] + }, + "psbt": { + "type": "string", + "description": [ + "The base 64 encoded PSBT returned from `splice_init` with any changes added by the user." + ] + } + } + }, + "response": { + "required": [ + "psbt", + "commitments_secured" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "The (incomplete) PSBT of the splice transaction." + ] + }, + "commitments_secured": { + "type": "boolean", + "description": [ + "Whether or not the commitments were secured." + ] + } + } + }, + "example_usage": [ + "Here is an example way to call `splice_update`", + "", + "```shell", + "RESULT={\"commitments_secured\":false}", + "while [[ $(echo $RESULT | jq -r \".commitments_secured\") == \"false\" ]]", + "do", + " RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT)", + " PSBT=$(echo $RESULT | jq -r \".psbt\")", + " echo $RESULT", + "done", + "```", + "", + "Before each call to `splice_update` you have the opportunity to make additional changes.", + "", + "Here is a full example set of splice commands that will splice in 100,000 sats to the first channel that comes out of `listpeerchannels`. The example assumes you already have at least one confirmed channel.", + "", + "```shell", + "RESULT=$(lightning-cli listpeerchannels)", + "CHANNEL_ID=$(echo $RESULT| jq -r \".channels[0].channel_id\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli fundpsbt -k satoshi=100000sat feerate=urgent startweight=800 excess_as_change=true)", + "INITIALPSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli splice_init $CHANNEL_ID 100000 $INITIALPSBT)", + "PSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT={\"commitments_secured\":false}", + "while [[ $(echo $RESULT | jq -r \".commitments_secured\") == \"false\" ]]", + "do", + " RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT)", + " PSBT=$(echo $RESULT | jq -r \".psbt\")", + " echo $RESULT", + "done", + "", + "RESULT=$(lightning-cli signpsbt -k psbt=\"$PSBT\")", + "PSBT=$(echo $RESULT | jq -r \".signed_psbt\")", + "echo $RESULT", + "", + "lightning-cli splice_signed $CHANNEL_ID $PSBT", + "```" + ], + "example_json_request": [ + { + "id": "example:splice_update#1", + "method": "splice_update", + "params": { + "channel_id": "5677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc", + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEFR1IhAjJCZt6EA7OrFXoJ8feE1YevYYMcmYwVG8whu3TCsjFLIQLjvTgAmGbJ2o7EqpnMTqnGwN1G3xXGHvDOHycSkXFOV1KuAQ4gVndyHDWkJKI9bcx8kJA25QWuaGUOCdWXM7S35zADpNwBDwQAAAAAARAEAAAAAAz8CWxpZ2h0bmluZwEIK/Jiqp0i3SYAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAQAAAAEQBP3///8M/AlsaWdodG5pbmcBCDmPhBY5ChQUAAEDCE58DQAAAAAAAQQiUSB4NjVf3IqC3EywCncsVVQVHQY4Sk3WXo0/aKwIVmuEvgz8CWxpZ2h0bmluZwEIxt4P7eqf3+QAAQMIAAAAAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQji6kH6aOXoAgA=" + } + } + ], + "example_json_response": [ + { + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAAAAAAEQBAAAAAAM/AlsaWdodG5pbmcBCCvyYqqdIt0mAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oBDiBWd3IcNaQkoj1tzHyQkDblBa5oZQ4J1ZcztLfnMAOk3AEPBAEAAAABEAT9////DPwJbGlnaHRuaW5nAQg5j4QWOQoUFAABAwhOfA0AAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4M/AlsaWdodG5pbmcBCMbeD+3qn9/kAAEDCODIEAAAAAAAAQQiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQz8CWxpZ2h0bmluZwEI4upB+mjl6AIA", + "commitments_secured": true + } + ], + "author": [ + "Dusty <<@dusty_daemon>> is mainly responsible." + ], + "see_also": [ + "lightning-splice_init(7)", + "lightning-splice_signed(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-sql.json b/doc/schemas/lightning-sql.json new file mode 100644 index 000000000000..455310941260 --- /dev/null +++ b/doc/schemas/lightning-sql.json @@ -0,0 +1,266 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.02", + "rpc": "sql", + "title": "Command to do complex queries on list commands", + "description": [ + "The **sql** RPC command runs the given query across a sqlite3 database created from various list commands.", + "", + "When tables are accessed, it calls the below commands, so it's no faster than any other local access (though it goes to great length to cache `listnodes` and `listchannels`) which then processes the results.", + "", + "It is, however faster for remote access if the result of the query is much smaller than the list commands would be." + ], + "request": { + "required": [ + "query" + ], + "properties": { + "query": { + "type": "string", + "description": [ + "The standard sqlite3 query to run.", + "Note that queries like \"SELECT *\" are fragile, as columns will change across releases; see lightning-listsqlschemas(7)." + ] + } + } + }, + "response": { + "required": [ + "rows" + ], + "properties": { + "rows": { + "type": "array", + "items": { + "type": "array" + } + }, + "warning_db_failure": { + "type": "string", + "description": [ + "A message if the database encounters an error partway through." + ] + } + }, + "pre_return_value_notes": [ + "On success, an object containing **rows** is returned. It is an array. Each array entry contains an array of values, each an integer, real number, string or *null*, depending on the sqlite3 type.", + "", + "The object may contain **warning_db_failure** if the database fails partway through its operation." + ] + }, + "treatment_of_types": [ + "The following types are supported in schemas, and this shows how they are presented in the database. This matters: a JSON boolean is represented as an integer in the database, so a query will return 0 or 1, not true or false.", + "", + "* *hex*. A hex string.", + " * JSON: a string", + " * sqlite3: BLOB", + "", + "* *hash*/*secret*/*pubkey*/*txid*: just like *hex*.", + "", + "* *msat*/*integer*/*u64*/*u32*/*u16*/*u8*. Normal numbers.", + " * JSON: an unsigned integer", + " * sqlite3: INTEGER", + "", + "* *boolean*. True or false.", + " * JSON: literal **true** or **false**", + " * sqlite3: INTEGER", + "", + "* *number*. A floating point number (used for times in some places).", + " * JSON: number", + " * sqlite3: REAL", + "", + "* *string*. Text.", + " * JSON: string", + " * sqlite3: TEXT", + "", + "* *short_channel_id*. A short-channel-id of form 1x2x3.", + " * JSON: string", + " * sqlite3: TEXT" + ], + "permitted_sqlite3_functions": [ + "Writing to the database is not permitted, and limits are placed on various other query parameters.", + "", + "Additionally, only the following functions are allowed:", + "", + "* abs", + "* avg", + "* coalesce", + "* count", + "* hex", + "* quote", + "* length", + "* like", + "* lower", + "* upper", + "* min", + "* max", + "* sum", + "* total" + ], + "tables": [ + "Note that the first column of every table is a unique integer called `rowid`: this is used for related tables to refer to specific rows in their parent. sqlite3 usually has this as an implicit column, but we make it explicit as the implicit version is not allowed to be used as a foreign key.", + "", + "The following tables are currently supported:\n- `bkpr_accountevents` (see lightning-bkpr-listaccountevents(7))\n - `account` (type `string`, sqltype `TEXT`)\n - `type` (type `string`, sqltype `TEXT`)\n - `tag` (type `string`, sqltype `TEXT`)\n - `credit_msat` (type `msat`, sqltype `INTEGER`)\n - `debit_msat` (type `msat`, sqltype `INTEGER`)\n - `currency` (type `string`, sqltype `TEXT`)\n - `timestamp` (type `u32`, sqltype `INTEGER`)\n - `outpoint` (type `string`, sqltype `TEXT`)\n - `blockheight` (type `u32`, sqltype `INTEGER`)\n - `origin` (type `string`, sqltype `TEXT`)\n - `payment_id` (type `hex`, sqltype `BLOB`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `description` (type `string`, sqltype `TEXT`)\n - `fees_msat` (type `msat`, sqltype `INTEGER`)\n - `is_rebalance` (type `boolean`, sqltype `INTEGER`)\n - `part_id` (type `u32`, sqltype `INTEGER`)\n\n- `bkpr_income` (see lightning-bkpr-listincome(7))\n - `account` (type `string`, sqltype `TEXT`)\n - `tag` (type `string`, sqltype `TEXT`)\n - `credit_msat` (type `msat`, sqltype `INTEGER`)\n - `debit_msat` (type `msat`, sqltype `INTEGER`)\n - `currency` (type `string`, sqltype `TEXT`)\n - `timestamp` (type `u32`, sqltype `INTEGER`)\n - `description` (type `string`, sqltype `TEXT`)\n - `outpoint` (type `string`, sqltype `TEXT`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `payment_id` (type `hex`, sqltype `BLOB`)\n\n- `channels` indexed by `short_channel_id` (see lightning-listchannels(7))\n - `source` (type `pubkey`, sqltype `BLOB`)\n - `destination` (type `pubkey`, sqltype `BLOB`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `direction` (type `u32`, sqltype `INTEGER`)\n - `public` (type `boolean`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `message_flags` (type `u8`, sqltype `INTEGER`)\n - `channel_flags` (type `u8`, sqltype `INTEGER`)\n - `active` (type `boolean`, sqltype `INTEGER`)\n - `last_update` (type `u32`, sqltype `INTEGER`)\n - `base_fee_millisatoshi` (type `u32`, sqltype `INTEGER`)\n - `fee_per_millionth` (type `u32`, sqltype `INTEGER`)\n - `delay` (type `u32`, sqltype `INTEGER`)\n - `htlc_minimum_msat` (type `msat`, sqltype `INTEGER`)\n - `htlc_maximum_msat` (type `msat`, sqltype `INTEGER`)\n - `features` (type `hex`, sqltype `BLOB`)\n\n- `closedchannels` (see lightning-listclosedchannels(7))\n - `peer_id` (type `pubkey`, sqltype `BLOB`)\n - `channel_id` (type `hash`, sqltype `BLOB`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `opener` (type `string`, sqltype `TEXT`)\n - `closer` (type `string`, sqltype `TEXT`)\n - `private` (type `boolean`, sqltype `INTEGER`)\n - related table `closedchannels_channel_type_bits`, from JSON object `channel_type`\n - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `bits` (type `u32`, sqltype `INTEGER`)\n - related table `closedchannels_channel_type_names`, from JSON object `channel_type`\n - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `names` (type `string`, sqltype `TEXT`)\n - `total_local_commitments` (type `u64`, sqltype `INTEGER`)\n - `total_remote_commitments` (type `u64`, sqltype `INTEGER`)\n - `total_htlcs_sent` (type `u64`, sqltype `INTEGER`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `leased` (type `boolean`, sqltype `INTEGER`)\n - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`)\n - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`)\n - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`)\n - `total_msat` (type `msat`, sqltype `INTEGER`)\n - `final_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `min_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `max_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `last_commitment_txid` (type `hash`, sqltype `BLOB`)\n - `last_commitment_fee_msat` (type `msat`, sqltype `INTEGER`)\n - `close_cause` (type `string`, sqltype `TEXT`)\n - `last_stable_connection` (type `u64`, sqltype `INTEGER`)\n\n- `forwards` indexed by `in_channel and in_htlc_id` (see lightning-listforwards(7))\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `in_channel` (type `short_channel_id`, sqltype `TEXT`)\n - `in_htlc_id` (type `u64`, sqltype `INTEGER`)\n - `in_msat` (type `msat`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `received_time` (type `number`, sqltype `REAL`)\n - `out_channel` (type `short_channel_id`, sqltype `TEXT`)\n - `out_htlc_id` (type `u64`, sqltype `INTEGER`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `style` (type `string`, sqltype `TEXT`)\n - `fee_msat` (type `msat`, sqltype `INTEGER`)\n - `out_msat` (type `msat`, sqltype `INTEGER`)\n - `resolved_time` (type `number`, sqltype `REAL`)\n - `failcode` (type `u32`, sqltype `INTEGER`)\n - `failreason` (type `string`, sqltype `TEXT`)\n\n- `htlcs` indexed by `short_channel_id and id` (see lightning-listhtlcs(7))\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `expiry` (type `u32`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `direction` (type `string`, sqltype `TEXT`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `state` (type `string`, sqltype `TEXT`)\n\n- `invoices` indexed by `payment_hash` (see lightning-listinvoices(7))\n - `label` (type `string`, sqltype `TEXT`)\n - `description` (type `string`, sqltype `TEXT`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `status` (type `string`, sqltype `TEXT`)\n - `expires_at` (type `u64`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `bolt11` (type `string`, sqltype `TEXT`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `local_offer_id` (type `hash`, sqltype `BLOB`)\n - `invreq_payer_note` (type `string`, sqltype `TEXT`)\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `pay_index` (type `u64`, sqltype `INTEGER`)\n - `amount_received_msat` (type `msat`, sqltype `INTEGER`)\n - `paid_at` (type `u64`, sqltype `INTEGER`)\n - `paid_outpoint_txid` (type `txid`, sqltype `BLOB`, from JSON object `paid_outpoint`)\n - `paid_outpoint_outnum` (type `u32`, sqltype `INTEGER`, from JSON object `paid_outpoint`)\n - `payment_preimage` (type `secret`, sqltype `BLOB`)\n\n- `nodes` indexed by `nodeid` (see lightning-listnodes(7))\n - `nodeid` (type `pubkey`, sqltype `BLOB`)\n - `last_timestamp` (type `u32`, sqltype `INTEGER`)\n - `alias` (type `string`, sqltype `TEXT`)\n - `color` (type `hex`, sqltype `BLOB`)\n - `features` (type `hex`, sqltype `BLOB`)\n - related table `nodes_addresses`\n - `row` (reference to `nodes.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `type` (type `string`, sqltype `TEXT`)\n - `port` (type `u16`, sqltype `INTEGER`)\n - `address` (type `string`, sqltype `TEXT`)\n - `option_will_fund_lease_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_lease_fee_basis` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_funding_weight` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_channel_fee_max_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_channel_fee_max_proportional_thousandths` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_compact_lease` (type `hex`, sqltype `BLOB`, from JSON object `option_will_fund`)\n\n- `offers` indexed by `offer_id` (see lightning-listoffers(7))\n - `offer_id` (type `hash`, sqltype `BLOB`)\n - `active` (type `boolean`, sqltype `INTEGER`)\n - `single_use` (type `boolean`, sqltype `INTEGER`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `used` (type `boolean`, sqltype `INTEGER`)\n - `label` (type `string`, sqltype `TEXT`)\n\n- `peerchannels` indexed by `peer_id` (see lightning-listpeerchannels(7))\n - `peer_id` (type `pubkey`, sqltype `BLOB`)\n - `peer_connected` (type `boolean`, sqltype `INTEGER`)\n - `reestablished` (type `boolean`, sqltype `INTEGER`)\n - `state` (type `string`, sqltype `TEXT`)\n - `scratch_txid` (type `txid`, sqltype `BLOB`)\n - related table `peerchannels_channel_type_bits`, from JSON object `channel_type`\n - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `bits` (type `u32`, sqltype `INTEGER`)\n - related table `peerchannels_channel_type_names`, from JSON object `channel_type`\n - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `names` (type `string`, sqltype `TEXT`)\n - `local_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `local`)\n - `local_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `local`)\n - `remote_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `remote`)\n - `ignore_fee_limits` (type `boolean`, sqltype `INTEGER`)\n - `lost_state` (type `boolean`, sqltype `INTEGER`)\n - `feerate_perkw` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`)\n - `feerate_perkb` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`)\n - `owner` (type `string`, sqltype `TEXT`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `channel_id` (type `hash`, sqltype `BLOB`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `initial_feerate` (type `string`, sqltype `TEXT`)\n - `last_feerate` (type `string`, sqltype `TEXT`)\n - `next_feerate` (type `string`, sqltype `TEXT`)\n - `next_fee_step` (type `u32`, sqltype `INTEGER`)\n - related table `peerchannels_inflight`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `feerate` (type `string`, sqltype `TEXT`)\n - `total_funding_msat` (type `msat`, sqltype `INTEGER`)\n - `splice_amount` (type `integer`, sqltype `INTEGER`)\n - `our_funding_msat` (type `msat`, sqltype `INTEGER`)\n - `scratch_txid` (type `txid`, sqltype `BLOB`)\n - `close_to` (type `hex`, sqltype `BLOB`)\n - `private` (type `boolean`, sqltype `INTEGER`)\n - `opener` (type `string`, sqltype `TEXT`)\n - `closer` (type `string`, sqltype `TEXT`)\n - related table `peerchannels_features`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `features` (type `string`, sqltype `TEXT`)\n - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_local_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_remote_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `min_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `max_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `total_msat` (type `msat`, sqltype `INTEGER`)\n - `fee_base_msat` (type `msat`, sqltype `INTEGER`)\n - `fee_proportional_millionths` (type `u32`, sqltype `INTEGER`)\n - `dust_limit_msat` (type `msat`, sqltype `INTEGER`)\n - `max_total_htlc_in_msat` (type `msat`, sqltype `INTEGER`)\n - `their_reserve_msat` (type `msat`, sqltype `INTEGER`)\n - `our_reserve_msat` (type `msat`, sqltype `INTEGER`)\n - `spendable_msat` (type `msat`, sqltype `INTEGER`)\n - `receivable_msat` (type `msat`, sqltype `INTEGER`)\n - `minimum_htlc_in_msat` (type `msat`, sqltype `INTEGER`)\n - `minimum_htlc_out_msat` (type `msat`, sqltype `INTEGER`)\n - `maximum_htlc_out_msat` (type `msat`, sqltype `INTEGER`)\n - `their_to_self_delay` (type `u32`, sqltype `INTEGER`)\n - `our_to_self_delay` (type `u32`, sqltype `INTEGER`)\n - `max_accepted_htlcs` (type `u32`, sqltype `INTEGER`)\n - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - related table `peerchannels_state_changes`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `timestamp` (type `string`, sqltype `TEXT`)\n - `old_state` (type `string`, sqltype `TEXT`)\n - `new_state` (type `string`, sqltype `TEXT`)\n - `cause` (type `string`, sqltype `TEXT`)\n - `message` (type `string`, sqltype `TEXT`)\n - related table `peerchannels_status`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `in_payments_offered` (type `u64`, sqltype `INTEGER`)\n - `in_offered_msat` (type `msat`, sqltype `INTEGER`)\n - `in_payments_fulfilled` (type `u64`, sqltype `INTEGER`)\n - `in_fulfilled_msat` (type `msat`, sqltype `INTEGER`)\n - `out_payments_offered` (type `u64`, sqltype `INTEGER`)\n - `out_offered_msat` (type `msat`, sqltype `INTEGER`)\n - `out_payments_fulfilled` (type `u64`, sqltype `INTEGER`)\n - `out_fulfilled_msat` (type `msat`, sqltype `INTEGER`)\n - `last_stable_connection` (type `u64`, sqltype `INTEGER`)\n - related table `peerchannels_htlcs`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `direction` (type `string`, sqltype `TEXT`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `expiry` (type `u32`, sqltype `INTEGER`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `local_trimmed` (type `boolean`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `state` (type `string`, sqltype `TEXT`)\n - `close_to_addr` (type `string`, sqltype `TEXT`)\n - `last_tx_fee_msat` (type `msat`, sqltype `INTEGER`)\n - `direction` (type `u32`, sqltype `INTEGER`)\n\n- `peers` indexed by `id` (see lightning-listpeers(7))\n - `id` (type `pubkey`, sqltype `BLOB`)\n - `connected` (type `boolean`, sqltype `INTEGER`)\n - `num_channels` (type `u32`, sqltype `INTEGER`)\n - related table `peers_netaddr`\n - `row` (reference to `peers.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `netaddr` (type `string`, sqltype `TEXT`)\n - `remote_addr` (type `string`, sqltype `TEXT`)\n - `features` (type `hex`, sqltype `BLOB`)\n\n- `sendpays` indexed by `payment_hash` (see lightning-listsendpays(7))\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `groupid` (type `u64`, sqltype `INTEGER`)\n - `partid` (type `u64`, sqltype `INTEGER`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `destination` (type `pubkey`, sqltype `BLOB`)\n - `created_at` (type `u64`, sqltype `INTEGER`)\n - `amount_sent_msat` (type `msat`, sqltype `INTEGER`)\n - `label` (type `string`, sqltype `TEXT`)\n - `bolt11` (type `string`, sqltype `TEXT`)\n - `description` (type `string`, sqltype `TEXT`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `payment_preimage` (type `secret`, sqltype `BLOB`)\n - `erroronion` (type `hex`, sqltype `BLOB`)\n\n- `transactions` indexed by `hash` (see lightning-listtransactions(7))\n - `hash` (type `txid`, sqltype `BLOB`)\n - `rawtx` (type `hex`, sqltype `BLOB`)\n - `blockheight` (type `u32`, sqltype `INTEGER`)\n - `txindex` (type `u32`, sqltype `INTEGER`)\n - `locktime` (type `u32`, sqltype `INTEGER`)\n - `version` (type `u32`, sqltype `INTEGER`)\n - related table `transactions_inputs`\n - `row` (reference to `transactions.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`)\n - `sequence` (type `u32`, sqltype `INTEGER`)\n - related table `transactions_outputs`\n - `row` (reference to `transactions.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `scriptPubKey` (type `hex`, sqltype `BLOB`)" + ], + "errors": [ + "On failure, an error is returned." + ], + "example_usage": [ + "Here are some example using lightning-cli. Note that you may need to use `-o` if you use queries which contain `=` (which make lightning-cli(1) default to keyword style):", + "", + "A simple peer selection query:", + "", + "```shell", + "$ lightning-cli sql \"SELECT id FROM peers\"", + "{", + " \"rows\": [", + " [", + " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\"", + " ]", + " ]", + "}", + "```", + "", + "A statement containing using `=` needs `-o`:", + "", + "```shell", + "$ lightning-cli sql -o \"SELECT node_id,last_timestamp FROM nodes WHERE last_timestamp>=1669578892\"", + "{", + " \"rows\": [", + " [", + " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\",", + " 1669601603", + " ]", + " ]", + "}", + "```", + "", + "If you want to compare a BLOB column, `x'hex'` or `X'hex'` are needed:", + "", + "```shell", + "$ lightning-cli sql -o \"SELECT nodeid FROM nodes WHERE nodeid != x'03c9d25b6c0ce4bde5ad97d7ab83f00ae8bd3800a98ccbee36f3c3205315147de1';\"", + "{", + " \"rows\": [", + " [", + " \"0214739d625944f8fdc0da9d2ef44dbd7af58443685e494117b51410c5c3ff973a\"", + " ],", + " [", + " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\"", + " ]", + " ]", + "}", + "$ lightning-cli sql -o \"SELECT nodeid FROM nodes WHERE nodeid IN (x'03c9d25b6c0ce4bde5ad97d7ab83f00ae8bd3800a98ccbee36f3c3205315147de1', x'02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00')\"", + "{", + " \"rows\": [", + " [", + " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\"", + " ],", + " [", + " \"03c9d25b6c0ce4bde5ad97d7ab83f00ae8bd3800a98ccbee36f3c3205315147de1\"", + " ]", + " ]", + "}", + "```", + "", + "Related tables are usually referenced by JOIN:", + "", + "```shell", + "$ lightning-cli sql -o \"SELECT nodeid, alias, nodes_addresses.type, nodes_addresses.port, nodes_addresses.address FROM nodes INNER JOIN nodes_addresses ON nodes_addresses.row = nodes.rowid\"", + "{", + " \"rows\": [", + " [", + " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\",", + " \"YELLOWWATCH-22.11rc2-31-gcd7593b\",", + " \"dns\",", + " 7272,", + " \"localhost\"", + " ],", + " [", + " \"0214739d625944f8fdc0da9d2ef44dbd7af58443685e494117b51410c5c3ff973a\",", + " \"HOPPINGSQUIRREL-1rc2-31-gcd7593b\",", + " \"dns\",", + " 7171,", + " \"localhost\"", + " ]", + " ]", + "}", + "```", + "", + "Simple function usage, in this case COUNT. Strings inside arrays need \", and ' to protect them from the shell:", + "", + "```shell", + "$ lightning-cli sql 'SELECT COUNT(*) FROM nodes\"", + "{", + " \"rows\": [", + " [", + " 3", + " ]", + " ]", + "}", + "```" + ], + "example_json_request": [ + { + "id": "example:sql#1", + "method": "sql", + "params": [ + "SELECT * FROM forwards;" + ] + }, + { + "id": "example:sql#2", + "method": "sql", + "params": [ + "SELECT * from peerchannels_features" + ] + } + ], + "example_json_response": [ + { + "rows": [] + }, + { + "rows": [ + [ + 6, + 1, + 0, + "option_static_remotekey" + ], + [ + 7, + 1, + 1, + "option_anchors_zero_fee_htlc_tx" + ], + [ + 16, + 11, + 0, + "option_static_remotekey" + ], + [ + 17, + 11, + 1, + "option_anchors_zero_fee_htlc_tx" + ] + ] + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listtransactions(7)", + "lightning-listchannels(7)", + "lightning-listpeers(7)", + "lightning-listnodes(7)", + "lightning-listforwards(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-staticbackup.json b/doc/schemas/lightning-staticbackup.json new file mode 100644 index 000000000000..170b13522acc --- /dev/null +++ b/doc/schemas/lightning-staticbackup.json @@ -0,0 +1,53 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "staticbackup", + "title": "Command for deriving getting SCB of all the existing channels", + "description": [ + "The **staticbackup** RPC command returns an object with SCB of all the channels in an array." + ], + "request": { + "required": [], + "properties": {} + }, + "response": { + "required": [ + "scb" + ], + "properties": { + "scb": { + "type": "array", + "items": { + "type": "hex", + "description": [ + "SCB of a channel in TLV format." + ] + } + } + } + }, + "example_json_request": [ + { + "id": "example:staticbackup#1", + "method": "staticbackup", + "params": "{}" + } + ], + "example_json_response": [ + { + "scb": [ + "0000000000000001c707da9b230e1655b0a6c082b8daf4fa44d9d1f68163ed4d531d45cf453dc651022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d5900017f000001b2e3c707da9b230e1655b0a6c082b8daf4fa44d9d1f68163ed4d531d45cf453dc6510000000000000000000186a000021000" + ] + } + ], + "author": [ + "Aditya <> is mainly responsible." + ], + "see_also": [ + "lightning-getsharedsecret(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-stop.json b/doc/schemas/lightning-stop.json new file mode 100644 index 000000000000..3a982d1bac97 --- /dev/null +++ b/doc/schemas/lightning-stop.json @@ -0,0 +1,47 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "stop", + "title": "Command to shutdown the Core Lightning node.", + "description": [ + "The **stop** is a RPC command to shut off the Core Lightning node." + ], + "request": { + "required": [], + "properties": {} + }, + "response": { + "required": [ + "result" + ], + "properties": { + "result": { + "type": "string", + "added": "v24.05", + "enum": [ + "Shutdown complete" + ] + } + } + }, + "example_json_request": [ + { + "id": "example:stop#1", + "method": "stop", + "params": {} + } + ], + "example_json_response": [ + { + "result": "Shutdown complete" + } + ], + "author": [ + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-txdiscard.json b/doc/schemas/lightning-txdiscard.json new file mode 100644 index 000000000000..eb3996e64f8c --- /dev/null +++ b/doc/schemas/lightning-txdiscard.json @@ -0,0 +1,76 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "txdiscard", + "title": "Abandon a transaction from txprepare, release inputs", + "description": [ + "The **txdiscard** RPC command releases inputs which were reserved for use of the *txid* from lightning-txprepare(7)." + ], + "request": { + "required": [ + "txid" + ], + "properties": { + "txid": { + "type": "txid", + "description": [ + "The transaction id, inputs should be unreseverd from." + ] + } + } + }, + "response": { + "required": [ + "unsigned_tx", + "txid" + ], + "properties": { + "unsigned_tx": { + "type": "hex", + "description": [ + "The unsigned transaction." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The transaction id of *unsigned_tx*." + ] + } + }, + "post_return_value_notes": [ + "If there is no matching *txid*, an error is reported. Note that this may happen due to incorrect usage, such as **txdiscard** or **txsend** already being called for *txid*." + ] + }, + "errors": [ + "The following error codes may occur:", + "", + "- -1: An unknown *txid*." + ], + "example_json_request": [ + { + "id": "example:txdiscard#1", + "method": "txdiscard", + "params": { + "txid": "6e680cb76077f11c838cc7aee0c0aa360f9857f00856bb1614025a1af53739fc" + } + } + ], + "example_json_response": [ + { + "unsigned_tx": "020000000142dc00d81359c3a551e170e3bf5262fa9cacc2eb2e283a10e579491cd86dce4b0000000000fdffffff02ffffff00000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd42839800000000002251207836355fdc8a82dc4cb00a772c5554151d06384a4dd65e8d3f68ac08566b84be66000000", + "txid": "6e680cb76077f11c838cc7aee0c0aa360f9857f00856bb1614025a1af53739fc" + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-txprepare(7)", + "lightning-txsend(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-txprepare.json b/doc/schemas/lightning-txprepare.json new file mode 100644 index 000000000000..256cbb5f21bd --- /dev/null +++ b/doc/schemas/lightning-txprepare.json @@ -0,0 +1,139 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "txprepare", + "title": "Command to prepare to withdraw funds from the internal wallet", + "description": [ + "The **txprepare** RPC command creates an unsigned transaction which spends funds from Core Lightning's internal wallet to the outputs specified in *outputs*.", + "", + "**txprepare** is similar to the first part of a **withdraw** command, but supports multiple outputs and uses *outputs* as parameter. The second part is provided by **txsend**." + ], + "request": { + "required": [ + "outputs" + ], + "properties": { + "outputs": { + "type": "array", + "description": [ + "Format is like: [{destination1: amount1}, {destination2: amount2}] or [{destination: *all*}]. It supports any number of **confirmed** outputs." + ], + "items": { + "type": "outputdesc" + } + }, + "feerate": { + "type": "feerate", + "description": [ + "Used for the transaction as initial feerate." + ], + "default": "*normal*" + }, + "minconf": { + "type": "u32", + "description": [ + "The minimum number of confirmations that used outputs should have." + ], + "default": 1 + }, + "utxos": { + "type": "array", + "description": [ + "To be used to fund the transaction, as an array of `txid:vout`. These must be drawn from the node's available UTXO set." + ], + "items": { + "type": "outpoint" + } + } + } + }, + "response": { + "required": [ + "psbt", + "unsigned_tx", + "txid" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "The PSBT representing the unsigned transaction." + ] + }, + "unsigned_tx": { + "type": "hex", + "description": [ + "The unsigned transaction." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The transaction id of *unsigned_tx*; you hand this to lightning-txsend(7) or lightning-txdiscard(7), as the inputs of this transaction are reserved." + ] + } + } + }, + "errors": [ + "On failure, an error is reported and the transaction is not created.", + "", + "- -1: Catchall nonspecific error.", + "- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.", + "- 302: The dust limit is not met." + ], + "example_json_request": [ + { + "id": "example:txprepare#1", + "method": "txprepare", + "params": { + "outputs": [ + { + "bcrt1qtwxd8wg5eanumk86vfeujvp48hfkgannf77evggzct048wggsrxsum2pmm": 16777215 + } + ], + "feerate": null, + "minconf": null, + "utxos": null + } + }, + { + "id": "example:txprepare#2", + "method": "txprepare", + "params": { + "outputs": [ + { + "bcrt1qyhu7rxj3rrlcj84jtzp2mk9d89xm9v2rx4d4h8au830axugx6mmqsuplng": "100000sat" + } + ], + "feerate": null, + "minconf": null, + "utxos": null + } + } + ], + "example_json_response": [ + { + "unsigned_tx": "020000000142dc00d81359c3a551e170e3bf5262fa9cacc2eb2e283a10e579491cd86dce4b0000000000fdffffff02ffffff00000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd42839800000000002251207836355fdc8a82dc4cb00a772c5554151d06384a4dd65e8d3f68ac08566b84be66000000", + "txid": "6e680cb76077f11c838cc7aee0c0aa360f9857f00856bb1614025a1af53739fc", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABATRHoQ9tEMHRHpf06v5uTEdjdMk1rccIaA6MNGMipNQWAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFLnqitWTi465LGxeucwoSAj16NGbAkcwRAIgVtOsUaQaPgH86aW6e6qmJa1xVb8KWvc+HALGosqVVmQCIFi4JU8Gy+vl2a2/frY+71hitYIBB/tjsRP7fpgb8b9TASECHUIV5q1r2ownjOlAFPQASTlZxxNgBvi5O3hCRvajwdJlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIELcANgTWcOlUeFw479SYvqcrMLrLig6EOV5SRzYbc5LAQ8EAAAAAAEQBP3///8AAQMI////AAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAAEDCEKDmAAAAAAAAQQiUSB4NjVf3IqC3EywCncsVVQVHQY4Sk3WXo0/aKwIVmuEvgA=" + }, + { + "unsigned_tx": "0200000001a91077a134fb9fe4a8d13a482b718368bfd9ce3eff61ff7d96549480a1f97dca0100000000fdffffff02a08601000000000022002025f9e19a5118ff891eb25882add8ad394db2b143355b5b9fbc3c5fd37106d6f66173010000000000225120a2a01c7965289eee56b5cfcddb9856c70fa476c264d21f711c6a69af776ae40366000000", + "txid": "f11d436054607603e903fc69c4bd9b39ce97421341c7cf814ad025cb5bf59c1c", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABAYZ4QwAgPq6Os8kk073f5Yx4T9LXYfbOjAdkzMXfuBQdAAAAAAD9////AjPkAioBAAAAFgAUeOeqzyifepeJAMCl4vnnJ/TRptRADQMAAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgYBFwmqWCrVkxxZ0/tte3z4lIem0L7MkhXzGAOvBWa6YCIFx7H4zOzxjixlZMi0DYYbIEflDjYHJXLfN1wVcXYuekASEDgztw/3Rks6vKGYMXJ83VEvQcNIjg3rJW6KdxEh26uwplAAAAAQEfQA0DAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIKkQd6E0+5/kqNE6SCtxg2i/2c4+/2H/fZZUlICh+X3KAQ8EAQAAAAEQBP3///8AAQMIoIYBAAAAAAABBCIAICX54ZpRGP+JHrJYgq3YrTlNsrFDNVtbn7w8X9NxBtb2AAEDCGFzAQAAAAAAAQQiUSCioBx5ZSie7la1z83bmFbHD6R2wmTSH3Ecammvd2rkAwA=" + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-withdraw(7)", + "lightning-txsend(7)", + "lightning-txdiscard(7)", + "lightning-feerates(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-txsend.json b/doc/schemas/lightning-txsend.json new file mode 100644 index 000000000000..ecfa07da3c33 --- /dev/null +++ b/doc/schemas/lightning-txsend.json @@ -0,0 +1,81 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "txsend", + "title": "Command to sign and send transaction from txprepare", + "description": [ + "The **txsend** RPC command signs and broadcasts a transaction created by *txprepare* RPC command." + ], + "request": { + "required": [ + "txid" + ], + "properties": { + "txid": { + "type": "txid", + "description": [ + "The transaction id of the transaction created by `txprepare` rpc command." + ] + } + } + }, + "response": { + "required": [ + "psbt", + "tx", + "txid" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "The completed PSBT representing the signed transaction." + ] + }, + "tx": { + "type": "hex", + "description": [ + "The fully signed transaction." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The transaction id of *tx*." + ] + } + } + }, + "errors": [ + "On failure, an error is reported (from bitcoind), and the inputs from the transaction are unreserved.", + "", + "- -1: Catchall nonspecific error." + ], + "example_json_request": [ + { + "id": "example:txsend#1", + "method": "txsend", + "params": { + "txid": "c9f59ba6bda8e095bb43ecabfa37de8d5194e5c839b6b63be4e29bceaae483ce" + } + } + ], + "example_json_response": [ + { + "tx": "020000000142dc00d81359c3a551e170e3bf5262fa9cacc2eb2e283a10e579491cd86dce4b0000000000fdffffff020000000100000000220020b636f07026ea64952ece5b7620a9337d9ac2321c796a499260994d1b373667504183980000000000225120754a77b503fcba0fd80f0a1a8226ed6764ff9a9d9bb61b485d40d4c9f4be245966000000", + "txid": "c9f59ba6bda8e095bb43ecabfa37de8d5194e5c839b6b63be4e29bceaae483ce", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABATRHoQ9tEMHRHpf06v5uTEdjdMk1rccIaA6MNGMipNQWAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFLnqitWTi465LGxeucwoSAj16NGbAkcwRAIgVtOsUaQaPgH86aW6e6qmJa1xVb8KWvc+HALGosqVVmQCIFi4JU8Gy+vl2a2/frY+71hitYIBB/tjsRP7fpgb8b9TASECHUIV5q1r2ownjOlAFPQASTlZxxNgBvi5O3hCRvajwdJlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZSICA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPRzBEAiBp/HPhg1ObOXqTr5rIjUYLMspGLz+sk1pjD9pjRFzf3wIgWycOB/dQPzwZAK3OXYs269h8o85ucDpdVhH4AyX69a0BIgYD10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8IAfrZCgAAAAABDiBC3ADYE1nDpVHhcOO/UmL6nKzC6y4oOhDleUkc2G3OSwEPBAAAAAABEAT9////AAEDCAAAAAEAAAAAAQQiACC2NvBwJupklS7OW3YgqTN9msIyHHlqSZJgmU0bNzZnUAABAwhBg5gAAAAAAAEEIlEgdUp3tQP8ug/YDwoagibtZ2T/mp2bthtIXUDUyfS+JFkhBycqmiXx/+1S+rBKLMiK6rE1tTcjhWqPFIHCZBf4ipIuCQDVXEk5CwAAAAA=" + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-txprepare(7)", + "lightning-txdiscard(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-unreserveinputs.json b/doc/schemas/lightning-unreserveinputs.json new file mode 100644 index 000000000000..2552b677ef36 --- /dev/null +++ b/doc/schemas/lightning-unreserveinputs.json @@ -0,0 +1,156 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "unreserveinputs", + "title": "Release reserved UTXOs", + "description": [ + "The **unreserveinputs** RPC command releases (or reduces reservation) on UTXOs which were previously marked as reserved, generally by lightning-reserveinputs(7)." + ], + "request": { + "required": [ + "psbt" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "Inputs to unreserve are the inputs specified in the passed-in *psbt*." + ] + }, + "reserve": { + "type": "u32", + "description": [ + "The number of blocks to decrease reservation by." + ], + "default": 72 + } + } + }, + "response": { + "required": [ + "reservations" + ], + "properties": { + "reservations": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "txid", + "vout", + "was_reserved", + "reserved" + ], + "properties": { + "txid": { + "type": "txid", + "description": [ + "The transaction id." + ] + }, + "vout": { + "type": "u32", + "description": [ + "The output number which was reserved." + ] + }, + "was_reserved": { + "type": "boolean", + "description": [ + "Whether the input was already reserved (usually `true`)." + ] + }, + "reserved": { + "type": "boolean", + "description": [ + "Whether the input is now reserved (may still be `true` if it was reserved for a long time)." + ] + } + }, + "allOf": [ + { + "if": { + "additionalProperties": true, + "properties": { + "reserved": { + "enum": [ + true + ] + } + } + }, + "then": { + "required": [ + "reserved_to_block" + ], + "properties": { + "txid": {}, + "vout": {}, + "was_reserved": {}, + "reserved": {}, + "reserved_to_block": { + "type": "u32", + "description": [ + "What blockheight the reservation will expire." + ] + } + } + } + } + ] + } + } + } + }, + "errors": [ + "On failure, an error is reported and no UTXOs are unreserved.", + "", + "- -32602: Invalid parameter, i.e. an unparseable PSBT." + ], + "example_json_request": [ + { + "id": "example:unreserveinputs#1", + "method": "unreserveinputs", + "params": { + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABAXyy20ynmOFyRbegGyApk50yNIAb4C+RKV5c2n5VKL3lAAAAAAD9////Akf0EAAAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WUs/fQpAQAAABYAFN9HebR4q6498ytdeRKjC64CkCOMAkcwRAIgSTJCpWVH1FLZYPdwFe7gZckxCtk+AxPp20KUVKqPIdUCIA3hkoUco68vffiwt6TrE3KgX09JE9m7PDUUgrHQANMRASEDBOBlCza/8qXE5q8uJ+OWsKscDERWfdA+LLCa/lwMH0BlAAAAAQEfR/QQAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZSICA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPRzBEAiBKjSasyN29ODqXSemEQCZfRIvbJP8thKRBrd4e+NLEMQIgMGNz3+DWDnLmjnIDCaVcC7BKxuycwvtJq1qlKFtTaXcBIgYD10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8IAfrZCgAAAAABDiAoXS6QUlCcOApG/j+hr4OhNt0tT4GvCzI6z16Hepi7OwEPBAAAAAABEAT9////AAEDCCN6CAAAAAAAAQQWABQfJ4Qjje0sa2yGBz++6jkM2hGRmAz8CWxpZ2h0bmluZwQCAAEAAQMIinkIAAAAAAABBCJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aIQeRRTKBKkQKTXZscc05GTaUo0CuEeAS5boa2e+6bnbKUwkAwsyrFwIAAAAA", + "reserve": 200 + } + }, + { + "id": "example:unreserveinputs#2", + "method": "unreserveinputs", + "params": { + "psbt": "cHNidP8BAF4CAAAAAVa79WPJoiYrzo/RgzIAn5HanoBFZo0vZvEjxPAVwLv4AAAAAAD9////AXzpHAAAAAAAIlEgBRjpLNlOD2LAbxJt/5i5q+ebfthFoVbVJFZ44mVUR11mAAAAAAEA3gIAAAAAAQENwcSElLyC0jcwUHiODBhtapHyzIdiwytOGiu/Raf4BwAAAAAA/f///wKAhB4AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFl82znKQEAAAAWABQyIWyAI6LDf6dJ58BDPdkh+PWUZwJHMEQCIGiJFhVi/d/Hz19Cz48uHTjhgBJ6WAlgl/bLVS7A6VtxAiAwlb7xYzIM4uopFvMnpOmGIOp3+upOPPF2F8VaB8U/HQEhA6BAjey7RADP4ifoh2VXhX7QXkh+sZqozv1EPuU5TxZmZQAAAAEBH4CEHgAAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WUAAA==", + "reserve": null + } + } + ], + "example_json_response": [ + { + "reservations": [ + { + "txid": "3bbb987a875ecf3a320baf814f2ddd36a183afa13ffe460a389c5052902e5d28", + "vout": 0, + "was_reserved": true, + "reserved": false + } + ] + }, + { + "reservations": [] + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-unreserveinputs(7)", + "lightning-signpsbt(7)", + "lightning-sendpsbt(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-upgradewallet.json b/doc/schemas/lightning-upgradewallet.json new file mode 100644 index 000000000000..ff70c9fe82de --- /dev/null +++ b/doc/schemas/lightning-upgradewallet.json @@ -0,0 +1,107 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "upgradewallet", + "title": "Command to spend all P2SH-wrapped inputs into a Native Segwit output", + "description": [ + "`upgradewallet` is a convenience RPC which will spend all p2sh-wrapped Segwit deposits in a wallet into a single Native Segwit P2WPKH address." + ], + "request": { + "required": [], + "properties": { + "feerate": { + "type": "feerate", + "description": [ + "Feerate for the upgrade transaction." + ], + "added": "v23.02", + "default": "*opening*" + }, + "reservedok": { + "type": "boolean", + "description": [ + "Tells the wallet to include all P2SH-wrapped inputs, including reserved ones." + ], + "added": "v23.02" + } + } + }, + "response": { + "required": [ + "upgraded_outs" + ], + "properties": { + "upgraded_outs": { + "type": "u64", + "description": [ + "Count of spent/upgraded UTXOs." + ], + "added": "v23.02" + }, + "psbt": { + "type": "string", + "description": [ + "The PSBT that was finalized and sent." + ], + "added": "v23.02" + }, + "tx": { + "type": "hex", + "description": [ + "The raw transaction which was sent." + ], + "added": "v23.02" + }, + "txid": { + "type": "txid", + "description": [ + "The txid of the **tx**." + ], + "added": "v23.02" + } + } + }, + "example_usage": [ + "The caller is trying to buy a liquidity ad but the command keeps failing. They have funds in their wallet, but they're all P2SH-wrapped outputs.", + "", + "The caller can call `upgradewallet` to convert their funds to native segwit outputs, which are valid for liquidity ad buys." + ], + "example_json_request": [ + { + "id": "example:upgradewallet#1", + "method": "upgradewallet", + "params": "{}" + }, + { + "id": "example:upgradewallet#2", + "method": "upgradewallet", + "params": { + "feerate": "urgent", + "reservedok": true + } + } + ], + "example_json_response": [ + { + "upgraded_outs": 0 + }, + { + "tx": "0200000001c08ce0a9ea1e00179ea603cb8619ec2a2df990ef931e1ccd87fa7a0e271ed8370100000000fdffffff013514310100000000225120888ab14b6e1655d1d00039b836d70b66e3351543ab6cd2f94166255f3d5e6cb5cf000000", + "txid": "de5f1d6f0b2f95cfe5cfbf8cc33bd3f279a8f800ee0efc27bbfafb2b6ead9560", + "psbt": "cHNidP8BAgQCAAAAAQMEzwAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDgAgAAAAABAZRZ0m0kaJA+ubJw1eYurGROu1BYc0i7l9xbyG06R6uZAQAAAAD9////AmQtPCgBAAAAF6kUnoGu9IUv0FGnzol3Lb/BNBNkOViHAC0xAQAAAAAXqRRlVyjzbP420BqlDTI2cERp+EpVQIcCRzBEAiBliJpjBsipwFgsLZMlzbESZ6hMTh+pgKQlXUIL0nLb3wIga/xwr/IJgEc7Ie6ApS4aVDr9xr1TZ3wj+8bRvI6WqScBIQPgYuc48PzUufScX6A6YOsdmJwn+bAQjLZ/g9jhQYduHM4AAAABASAALTEBAAAAABepFGVXKPNs/jbQGqUNMjZwRGn4SlVAhyICArnAxoROEqUxyWjlXFUHjsFtm/dr6SkP2H0cynK0g5oXRzBEAiBlTUNYfS5n5rGRVmoNb0z3AMGJjHijwpXROGIVxfoBnQIgeTx32KY3CcfYTYzXUIRQAMUQB7rlPWRptWMDD3UttkcBAQQWABTWuWnTbf/a2YaRk/Zj7kgN/cc0iCIGArnAxoROEqUxyWjlXFUHjsFtm/dr6SkP2H0cynK0g5oXCNa5adMAAAAAAQ4gwIzgqeoeABeepgPLhhnsKi35kO+THhzNh/p6Dice2DcBDwQBAAAAARAE/f///wABAwg1FDEBAAAAAAEEIlEgiIqxS24WVdHQADm4NtcLZuM1FUOrbNL5QWYlXz1ebLUhByjMj8l44gnxaV+ltWVQYdsaqyMRtSQXaUW/EBXvLUuJCQCftnv8BwAAAAA=", + "upgraded_outs": 1 + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-utxopsbt(7)", + "lightning-reserveinputs(7)", + "lightning-unreserveinputs(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-utxopsbt.json b/doc/schemas/lightning-utxopsbt.json new file mode 100644 index 000000000000..36d8f7015ab3 --- /dev/null +++ b/doc/schemas/lightning-utxopsbt.json @@ -0,0 +1,271 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "utxopsbt", + "title": "Command to populate PSBT inputs from given UTXOs", + "description": [ + "*utxopsbt* is a low-level RPC command which creates a PSBT using unreserved inputs in the wallet, optionally reserving them as well.", + "", + "It deliberately mirrors the parameters and output of lightning-fundpsbt(7) except instead of an optional *minconf* parameter to select unreserved outputs from the wallet, it takes a compulsory list of outputs to use." + ], + "request": { + "required": [ + "satoshi", + "feerate", + "startweight", + "utxos" + ], + "properties": { + "satoshi": { + "type": "msat_or_all", + "description": [ + "The minimum satoshi value of the output(s) needed (or the string `all` meaning use all unreserved inputs). If a value, it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*." + ] + }, + "feerate": { + "type": "feerate", + "description": [ + "Used for the transaction as initial feerate." + ], + "default": "*normal*" + }, + "startweight": { + "type": "u32", + "description": [ + "The weight of the transaction before *fundpsbt* has added any inputs." + ] + }, + "utxos": { + "type": "array", + "description": [ + "An array of `txid:vout`, each of which must be reserved or available." + ], + "items": { + "type": "outpoint" + } + }, + "reserve": { + "type": "u32", + "description": [ + "If not zero, then *reserveinputs* is called (successfully, with *exclusive* true) on the returned PSBT for this number of blocks." + ], + "default": "72 blocks" + }, + "reservedok": { + "type": "boolean", + "description": [ + "If set to true, it will also fail if any of the *utxos* are already reserved." + ], + "default": "false" + }, + "locktime": { + "type": "u32", + "description": [ + "If not set, it is set to a recent block height." + ] + }, + "min_witness_weight": { + "type": "u32", + "description": [ + "Minimum weight to use for a UTXO's witness. If the actual witness weight is greater than the provided minimum, the actual witness weight will be used." + ] + }, + "excess_as_change": { + "type": "boolean", + "description": [ + "Flag to add a change output for the excess sats." + ] + }, + "opening_anchor_channel": { + "added": "v23.08", + "type": "boolean", + "description": [ + "To signel that it needs emergency reserve for anchors so that we can lowball our commitment tx fees, and min-emergency-msat for reserving some sats for closing anchor channels." + ] + } + } + }, + "response": { + "required": [ + "psbt", + "feerate_per_kw", + "estimated_final_weight", + "excess_msat" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "Unsigned PSBT which fulfills the parameters given." + ] + }, + "feerate_per_kw": { + "type": "u32", + "description": [ + "The feerate used to create the PSBT, in satoshis-per-kiloweight." + ] + }, + "estimated_final_weight": { + "type": "u32", + "description": [ + "The estimated weight of the transaction once fully signed." + ] + }, + "excess_msat": { + "type": "msat", + "description": [ + "The amount above *satoshi* which is available. This could be zero, or dust; it will be zero if *change_outnum* is also returned." + ] + }, + "change_outnum": { + "type": "u32", + "description": [ + "The 0-based output number where change was placed (only if parameter *excess_as_change* was true and there was sufficient funds)." + ] + }, + "reservations": { + "type": "array", + "description": [ + "If *reserve* was true or a non-zero number, just as per lightning- reserveinputs(7)." + ], + "items": { + "type": "object", + "required": [ + "txid", + "vout", + "was_reserved", + "reserved", + "reserved_to_block" + ], + "additionalProperties": false, + "properties": { + "txid": { + "type": "txid", + "description": [ + "The txid of the transaction." + ] + }, + "vout": { + "type": "u32", + "description": [ + "The 0-based output number." + ] + }, + "was_reserved": { + "type": "boolean", + "description": [ + "Whether this output was previously reserved." + ] + }, + "reserved": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Whether this output is now reserved." + ] + }, + "reserved_to_block": { + "type": "u32", + "description": [ + "The blockheight the reservation will expire." + ] + } + } + } + } + }, + "post_return_value_notes": [ + "On success, returns the *psbt* it created, containing the inputs, *feerate_per_kw* showing the exact numeric feerate it used, *estimated_final_weight* for the estimated weight of the transaction once fully signed, and *excess_msat* containing the amount above *satoshi* which is available. This could be zero, or dust. If *satoshi* was `all`, then *excess_msat* is the entire amount once fees are subtracted for the weights of the inputs and *startweight*.", + "", + "If *reserve* was *true* or a non-zero number, then a *reservations* array is returned, exactly like *reserveinputs*.", + "", + "If *excess_as_change* is true and the excess is enough to cover an additional output above the `dust_limit`, then an output is added to the PSBT for the excess amount. The *excess_msat* will be zero. A *change_outnum* will be returned with the index of the change output." + ] + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 301: Insufficient UTXOs to meet *satoshi* value." + ], + "example_json_request": [ + { + "id": "example:utxopsbt#1", + "method": "utxopsbt", + "params": { + "satoshi": 0, + "feerate": "253perkw", + "startweight": 0, + "utxos": [ + "d82a99192fb333106ea8d08f5231ed45f2ed5b1ef9eb81b0fef8f9ea354d2637:1" + ], + "reserve": 0, + "reservedok": true, + "locktime": null, + "min_witness_weight": null, + "excess_as_change": false + } + }, + { + "id": "example:utxopsbt#2", + "method": "utxopsbt", + "params": { + "satoshi": 1000000, + "feerate": "7500perkw", + "startweight": 0, + "utxos": [ + "2fc3b9f8d4aed120f6d9a6f206f07c35ef4d518ec0305d1d974873d256e38ca7:1", + "2f669f6a605ee5c7ddd2abb753bc64b1a90bd1b7448264f5d78a7ca823c00a1b:1" + ], + "reserve": null, + "reservedok": true, + "locktime": null, + "min_witness_weight": null, + "excess_as_change": false + } + } + ], + "example_json_response": [ + { + "psbt": "cHNidP8BADMCAAAAATcmTTXq+fj+sIHr+R5b7fJF7TFSj9CobhAzsy8ZmSrYAQAAAAD9////AGYAAAAAAQDeAgAAAAABAWQACJva49ga8OCYXvPRWQRhoXndrJykwjgXbwT251dEAAAAAAD9////AiOI9ikBAAAAFgAU3gClv/YpAKRpfDuiFu6mIL2E4+5QaQ8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgUXIQFs7oRkorVThUn3sLj7WI7g8c8RHai4ChoCvIkWsCICp1CqHl4BlMJCKFHRWHXhhekaj0r1EFSNrh8UnvysQPASEDqHIAEdaH3H6pb3VJzbJNDG4lL8PTfsheL+h2p6baK3JlAAAAAQEfUGkPAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=", + "feerate_per_kw": 253, + "estimated_final_weight": 271, + "excess_msat": 1009932000 + }, + { + "psbt": "cHNidP8BAFwCAAAAAqeM41bSc0iXHV0wwI5RTe81fPAG8qbZ9iDRrtT4ucMvAQAAAAD9////GwrAI6h8itf1ZIJEt9ELqbFkvFO3q9Ldx+VeYGqfZi8BAAAAAP3///8AZgAAAAABAN4CAAAAAAEBEaK0TQ97IsrzuO1gLt+vYbvLBG90NrCOZp7SCgrRknYAAAAAAP3///8CM6/2KQEAAAAWABQ1B/KkIVbg7yFRcCEN/VOptfOX/EBCDwAAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WUCRzBEAiA1oI1us81XEa/DRlvcP2qnbWLsV5pZcRfvj9MLyT202gIgb7noMqHYWMmm7H7VNEfWa29jjtuV9yrrSc9ui11ECQ0BIQKhZOHR4gFKMu2EKKgZ/7qnhzq9PvhtnAW2sxPZ4c9RIWUAAAABAR9AQg8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAAEA3gIAAAAAAQGnjONW0nNIlx1dMMCOUU3vNXzwBvKm2fYg0a7U+LnDLwAAAAAA/f///wJmbOcpAQAAABYAFOwPo5eUrDF7UgZBFQLRHOeX6PiGQEIPAAAAAAAWABTCzKsXHCpb6dq1LsQbglhjAkxUZgJHMEQCICgjGlauGj2eiMS4MWUK6zAWqMe1OuidQR+Hy9ZgSTuzAiA8JTb9OrLqS3hiWtT+TQ/NBsKJ2hhHLDaKUUNdgi4OkAEhA9g3oH5ejmGIqUY2ZWxc8YWF2+T+XpE/6oC40Cx3+e97ZQAAAAEBH0BCDwAAAAAAFgAUwsyrFxwqW+natS7EG4JYYwJMVGYA", + "feerate_per_kw": 7500, + "estimated_final_weight": 542, + "excess_msat": 995935000, + "reservations": [ + { + "txid": "2fc3b9f8d4aed120f6d9a6f206f07c35ef4d518ec0305d1d974873d256e38ca7", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "2f669f6a605ee5c7ddd2abb753bc64b1a90bd1b7448264f5d78a7ca823c00a1b", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + } + ] + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-fundpsbt(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-wait.json b/doc/schemas/lightning-wait.json new file mode 100644 index 000000000000..32f5d3dbcfa2 --- /dev/null +++ b/doc/schemas/lightning-wait.json @@ -0,0 +1,362 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.08", + "rpc": "wait", + "title": "Command to wait for creations, changes and deletions", + "description": [ + "The **wait** RPC command returns once the index given by *indexname* in *subsystem* reaches or exceeds *nextvalue*. All indexes start at 0, when no events have happened (**wait** with a *nextvalue* of 0 is a way of getting the current index, though naturally this is racy!)." + ], + "request": { + "required": [ + "subsystem", + "indexname", + "nextvalue" + ], + "properties": { + "subsystem": { + "type": "string", + "description": [ + "The subsystem to get the next index value from.", + " `invoices`: corresponding to `listinvoices` (added in *v23.08*).", + " `sendpays`: corresponding to `listsendpays` (added in *v23.11*).", + " `forwards`: corresponding to `listforwards` (added in *v23.11*)." + ], + "enum": [ + "invoices", + "forwards", + "sendpays" + ] + }, + "indexname": { + "type": "string", + "description": [ + "The name of the index to get the next value for.", + " `created` is incremented by one for every new object.", + " `updated` is incremented by one every time an object is changed.", + " `deleted` is incremented by one every time an object is deleted." + ], + "enum": [ + "created", + "updated", + "deleted" + ] + }, + "nextvalue": { + "type": "u64", + "description": [ + "The next value of the index." + ] + } + } + }, + "response": { + "required": [ + "subsystem" + ], + "properties": { + "subsystem": { + "type": "string", + "enum": [ + "invoices", + "forwards", + "sendpays" + ] + }, + "created": { + "type": "u64", + "description": [ + "1-based index indicating order entry was created." + ] + }, + "updated": { + "type": "u64", + "description": [ + "1-based index indicating order entry was updated." + ] + }, + "deleted": { + "type": "u64", + "description": [ + "1-based index indicating order entry was deleted." + ] + }, + "details": {} + }, + "allOf": [ + { + "if": { + "additionalProperties": true, + "properties": { + "subsystem": { + "type": "string", + "enum": [ + "invoices" + ] + } + } + }, + "then": { + "additionalProperties": false, + "properties": { + "subsystem": {}, + "created": {}, + "updated": {}, + "deleted": {}, + "details": { + "type": "object", + "additionalProperties": false, + "properties": { + "status": { + "type": "string", + "enum": [ + "unpaid", + "paid", + "expired" + ], + "description": [ + "Whether it's paid, unpaid or unpayable." + ] + }, + "label": { + "type": "string", + "description": [ + "Unique label supplied at invoice creation." + ] + }, + "description": { + "type": "string", + "description": [ + "Description used in the invoice." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The BOLT11 string." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The BOLT12 string." + ] + } + } + } + } + } + }, + { + "if": { + "additionalProperties": true, + "properties": { + "subsystem": { + "type": "string", + "enum": [ + "forwards" + ] + } + } + }, + "then": { + "additionalProperties": false, + "properties": { + "subsystem": {}, + "created": {}, + "updated": {}, + "deleted": {}, + "details": { + "type": "object", + "additionalProperties": false, + "properties": { + "status": { + "type": "string", + "enum": [ + "offered", + "settled", + "failed", + "local_failed" + ], + "description": [ + "Still ongoing, completed, failed locally, or failed after forwarding." + ] + }, + "in_channel": { + "type": "short_channel_id", + "description": [ + "Unique label supplied at invoice creation." + ] + }, + "in_htlc_id": { + "type": "u64", + "description": [ + "The unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11)." + ] + }, + "in_msat": { + "type": "msat", + "description": [ + "The value of the incoming HTLC." + ] + }, + "out_channel": { + "type": "short_channel_id", + "description": [ + "The channel that the HTLC (trying to) forward to." + ] + } + } + } + } + } + }, + { + "if": { + "additionalProperties": true, + "properties": { + "subsystem": { + "type": "string", + "enum": [ + "sendpays" + ] + } + } + }, + "then": { + "additionalProperties": false, + "properties": { + "subsystem": {}, + "created": {}, + "updated": {}, + "deleted": {}, + "details": { + "type": "object", + "additionalProperties": false, + "properties": { + "status": { + "type": "string", + "enum": [ + "pending", + "failed", + "complete" + ], + "description": [ + "Status of the payment." + ] + }, + "partid": { + "type": "u64", + "description": [ + "Part number (for multiple parts to a single payment)." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + } + } + } + } + } + } + ] + }, + "reliability": [ + "Indices can go forward by more than one; in particlar, if multiple objects were created and the one deleted, you could see this effect. Similarly, there are some places (e.g. invoice expiration) where we can update multiple entries at once.", + "", + "Indices only monotoncally increase." + ], + "usage": [ + "The **wait** RPC is used to track changes in the system. Consider tracking invoices being paid or expiring. The simplest (and inefficient method) would be:", + "1. Call `listinvoices` to get the current state of all invoices, and remember the highest `updated_index`. Say it was 5.", + "2. Call `wait invoices updated 6`.", + "3. When it returns, call `listinvoices` again to see what changed.", + "", + "This is obviously inefficient, so there are two optimizations:", + "1. Call `listinvoices` with `index=updated` and `start=6` to only see invoices with `updated_index` greater than or equal to 6.", + "2. `wait` itself may also return some limited subset of fields from the list command (it can't do this in all cases); for `invoices` this is `label` and `status`, allowing many callers to avoid the `listinvoices` call." + ], + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong." + ], + "example_json_request": [ + { + "id": "example:wait#1", + "method": "wait", + "params": { + "subsystem": "invoices", + "indexname": "created", + "nextvalue": 1 + } + }, + { + "id": "example:wait#2", + "method": "wait", + "params": { + "subsystem": "invoices", + "indexname": "updated", + "nextvalue": 2 + } + }, + { + "id": "example:wait#3", + "method": "wait", + "params": { + "subsystem": "sendpays", + "indexname": "updated", + "nextvalue": 2 + } + } + ], + "example_json_response": [ + { + "subsystem": "invoices", + "created": 1, + "details": { + "status": "unpaid", + "label": "invlabel", + "bolt11": "lnbcrt420p1pjmxtevsp5d8c6gnaj8lyjy2qly783vklda9dfaqeyzyc37agxxp8h3uguv8pqpp5w6lhwxhqnuew4hle5h7qwjm27zz784mvsrzhmayhscy5t2hy5c4qdqvd9h8ver9wd3sxqyjw5qcqp99qxpqysgq09gxhjhwu9u3z6dlt5ln5f4g8zl78wz4pgh0am3kz54m9lllhqckf4gmhmt2ftrclq5x62zkqmggc7y0ju0ghdfwjz8hyd8l5cqvemgpyyhm6w" + } + }, + { + "subsystem": "invoices", + "updated": 2, + "details": { + "status": "expired" + } + }, + { + "subsystem": "sendpays", + "updated": 2, + "details": { + "status": "complete", + "partid": 0, + "groupid": 1, + "payment_hash": "220dcfcf43e1fab3ce30f70eb943c3ce962393f5a65ced52d749e324b443d19e" + } + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listinvoice(7)", + "lightning-listforwards(7)", + "lightning-listsendpays(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-waitanyinvoice.json b/doc/schemas/lightning-waitanyinvoice.json new file mode 100644 index 000000000000..a6d580ff6626 --- /dev/null +++ b/doc/schemas/lightning-waitanyinvoice.json @@ -0,0 +1,280 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "waitanyinvoice", + "title": "Command for waiting for payments", + "description": [ + "The **waitanyinvoice** RPC command waits until an invoice is paid, then returns a single entry as per **listinvoice**. It will not return for any invoices paid prior to or including the *lastpay_index*.", + "", + "This is usually called iteratively: once with no arguments, then repeatedly with the returned *pay_index* entry. This ensures that no paid invoice is missed. The *pay_index* is a monotonically-increasing number assigned to an invoice when it gets paid. The first valid *pay_index* is 1." + ], + "request": { + "required": [], + "properties": { + "lastpay_index": { + "type": "u64", + "description": [ + "Ignores any invoices paid prior to or including this index. 0 is equivalent to not specifying and negative value is invalid." + ] + }, + "timeout": { + "type": "u64", + "description": [ + "If specified, wait at most that number of seconds, which must be an integer. If the specified *timeout* is reached, this command will return with an error. You can specify this to 0 so that **waitanyinvoice** will return immediately with an error if no pending invoice is available yet. If unspecified, this command will wait indefinitely." + ] + } + } + }, + "response": { + "required": [ + "label", + "description", + "payment_hash", + "status", + "created_index", + "expires_at" + ], + "properties": { + "label": { + "type": "string", + "description": [ + "Unique label supplied at invoice creation." + ] + }, + "description": { + "type": "string", + "description": [ + "Description used in the invoice." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "paid", + "expired" + ], + "description": [ + "Whether it's paid or expired." + ] + }, + "expires_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when it will become / became unpayable." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount required to pay this invoice." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The BOLT11 string (always present unless *bolt12* is)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The BOLT12 string (always present unless *bolt11* is)." + ] + }, + "created_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was created in." + ] + }, + "updated_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was changed (only present if it has changed since creation)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "paid" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "pay_index", + "amount_received_msat", + "paid_at", + "payment_preimage" + ], + "properties": { + "label": {}, + "description": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "bolt11": {}, + "bolt12": {}, + "expires_at": {}, + "created_index": {}, + "updated_index": {}, + "pay_index": { + "type": "u64", + "description": [ + "Unique incrementing index for this payment." + ] + }, + "amount_received_msat": { + "type": "msat", + "description": [ + "The amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)." + ] + }, + "paid_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when it was paid." + ] + }, + "paid_outpoint": { + "type": "object", + "description": [ + "Outpoint this invoice was paid with." + ], + "added": "v23.11", + "additionalProperties": false, + "required": [ + "txid", + "outnum" + ], + "properties": { + "txid": { + "added": "v23.11", + "type": "txid", + "description": [ + "ID of the transaction that paid the invoice." + ] + }, + "outnum": { + "added": "v23.11", + "type": "u32", + "description": [ + "The 0-based output number of the transaction that paid the invoice." + ] + } + } + }, + "payment_preimage": { + "type": "secret", + "description": [ + "Proof of payment." + ] + } + } + }, + "else": { + "additionalProperties": false, + "properties": { + "label": {}, + "description": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "bolt11": {}, + "bolt12": {}, + "created_index": {}, + "updated_index": {}, + "expires_at": {} + } + } + } + ] + }, + "errors": [ + "The following error codes may occur:", + "", + "- 904: The *timeout* was reached without an invoice being paid." + ], + "example_json_request": [ + { + "id": "example:waitanyinvoice#1", + "method": "waitanyinvoice", + "params": { + "lastpay_index": null, + "timeout": null + } + }, + { + "id": "example:waitanyinvoice#2", + "method": "waitanyinvoice", + "params": { + "lastpay_index": 3, + "timeout": 0 + } + } + ], + "example_json_response": [ + { + "label": "inv1", + "bolt11": "lnbcrt10n1pjmxtsxsp56sn02x8lccjfsvunnhz5858zuyxztug9luy226w4qsmfm4r8pkcspp5gw5r0dw99yf3zqxrg24l8g9m9hun9cu06ldg4rga8s9t9kv8z45sdq8d9h8vvgxqyjw5qcqp99qxpqysgqv537uh2sx8ch640mf4t43t8qjtpg3z7gukgm07tlyq986m7nvsnxkapg37z4vsxtl4thfqzc64anqr83geygkc2xaftxgr97dltqfjqpe3mhja", + "payment_hash": "43a837b5c529131100c342abf3a0bb2df932e38fd7da8a8d1d3c0ab2d9871569", + "amount_msat": 1000, + "status": "paid", + "pay_index": 1, + "amount_received_msat": 1000, + "paid_at": 1706241546, + "payment_preimage": "a0c668998de14b975f33e1060b3efd7efc0bde784ac266ab667a1b2fddab3cd1", + "description": [ + "Inv1." + ], + "expires_at": 1706846342, + "created_index": 1, + "updated_index": 1 + }, + { + "label": "inv4", + "bolt11": "lnbcrt10n1pja0tkmsp57j4z9zwvdsyh57unh3da7aac5z20clfnrwy5nqm6wujaelduw23qpp580mdrwakz9xewc2vhvpucset9gjkgdvyhw7h9frcy2d6p2lwdw2qdq8d9h8vdqxqyjw5qcqp99qxpqysgqtgyzhtxs3p2dyk8wk9q028033303702d2hml4frmu38qe79mrkgzgxvyjmq2q4nhjgcuz3uhmlda3jnhf9w6mj8mj97pkgnda9l5kdcqsdgewf", + "payment_hash": "3bf6d1bbb6114d97614cbb03cc432b2a25643584bbbd72a478229ba0abee6b94", + "amount_msat": 1000, + "status": "paid", + "pay_index": 4, + "amount_received_msat": 1000, + "paid_at": 1708633825, + "payment_preimage": "77336a342dde76050c7ee7fc18599e407dfc1edad3c784ba68e9603004365b94", + "description": "inv4", + "expires_at": 1709238619, + "created_index": 4, + "updated_index": 4 + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-waitinvoice(7)", + "lightning-listinvoice(7)", + "lightning-delinvoice(7)", + "lightning-invoice(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-waitblockheight.json b/doc/schemas/lightning-waitblockheight.json new file mode 100644 index 000000000000..ecc80b9bb19b --- /dev/null +++ b/doc/schemas/lightning-waitblockheight.json @@ -0,0 +1,83 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "waitblockheight", + "title": "Command for waiting for blocks on the blockchain", + "description": [ + "The **waitblockheight** RPC command waits until the blockchain has reached the specified *blockheight*." + ], + "request": { + "required": [ + "blockheight" + ], + "properties": { + "blockheight": { + "type": "u32", + "description": [ + "Current blockheight of the blockchain if the value is greater than this number. If it is a present or past block height, then the command returns immediately." + ] + }, + "timeout": { + "type": "u32", + "description": [ + "Only wait up to specified seconds." + ], + "default": "60 seconds" + } + } + }, + "response": { + "required": [ + "blockheight" + ], + "properties": { + "blockheight": { + "type": "u32", + "description": [ + "The current block height (>= *blockheight* parameter)." + ] + } + }, + "post_return_value_notes": [ + "If *timeout* seconds is reached without the specified blockheight being reached, this command will fail with a code of `2000`." + ] + }, + "errors": [ + "The following error codes may occur:", + "", + "- 2000: Timed out." + ], + "example_json_request": [ + { + "id": "example:waitblockheight#1", + "method": "waitblockheight", + "params": { + "blockheight": 99, + "timeout": null + } + }, + { + "id": "example:waitblockheight#2", + "method": "waitblockheight", + "params": { + "blockheight": 103, + "timeout": 600 + } + } + ], + "example_json_response": [ + { + "blockheight": 99 + }, + { + "blockheight": 103 + } + ], + "author": [ + "ZmnSCPxj <> is mainly responsible." + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-waitinvoice.json b/doc/schemas/lightning-waitinvoice.json new file mode 100644 index 000000000000..fa2987f30357 --- /dev/null +++ b/doc/schemas/lightning-waitinvoice.json @@ -0,0 +1,259 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "waitinvoice", + "title": "Command for waiting for specific payment", + "description": [ + "The **waitinvoice** RPC command waits until a specific invoice is paid, then returns that single entry as per **listinvoice**." + ], + "request": { + "required": [ + "label" + ], + "properties": { + "label": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "description": [ + "Unique label of the invoice waiting to be paid." + ] + } + } + }, + "response": { + "required": [ + "label", + "description", + "payment_hash", + "status", + "created_index", + "expires_at" + ], + "properties": { + "label": { + "type": "string", + "description": [ + "Unique label supplied at invoice creation." + ] + }, + "description": { + "type": "string", + "description": [ + "Description used in the invoice." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "paid", + "expired" + ], + "description": [ + "Whether it's paid or expired." + ] + }, + "expires_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when it will become / became unpayable." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount required to pay this invoice." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The BOLT11 string (always present unless *bolt12* is)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The BOLT12 string (always present unless *bolt11* is)." + ] + }, + "created_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was created in." + ] + }, + "updated_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was changed (only present if it has changed since creation)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "paid" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "pay_index", + "amount_received_msat", + "paid_at", + "payment_preimage" + ], + "properties": { + "label": {}, + "description": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "bolt11": {}, + "bolt12": {}, + "expires_at": {}, + "created_index": {}, + "updated_index": {}, + "pay_index": { + "type": "u64", + "description": [ + "Unique incrementing index for this payment." + ] + }, + "amount_received_msat": { + "type": "msat", + "description": [ + "The amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)." + ] + }, + "paid_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when it was paid." + ] + }, + "paid_outpoint": { + "type": "object", + "description": [ + "Outpoint this invoice was paid with." + ], + "added": "v23.11", + "additionalProperties": false, + "required": [ + "txid", + "outnum" + ], + "properties": { + "txid": { + "added": "v23.11", + "type": "txid", + "description": [ + "ID of the transaction that paid the invoice." + ] + }, + "outnum": { + "added": "v23.11", + "type": "u32", + "description": [ + "The 0-based output number of the transaction that paid the invoice." + ] + } + } + }, + "payment_preimage": { + "type": "secret", + "description": [ + "Proof of payment." + ] + } + } + }, + "else": { + "additionalProperties": false, + "properties": { + "label": {}, + "description": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "bolt11": {}, + "bolt12": {}, + "created_index": {}, + "updated_index": {}, + "expires_at": {} + } + } + } + ] + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: If the invoice is deleted while unpaid, or the invoice does not exist.", + "- 903: If the invoice expires before being paid, or is already expired." + ], + "example_json_request": [ + { + "id": "example:waitinvoice#1", + "method": "waitinvoice", + "params": { + "label": "inv2" + } + } + ], + "example_json_response": [ + { + "label": "inv2", + "bolt11": "lnbcrt10n1pjmxtwjsp5mzvdu6v8hqsf2tlj0nlyks23afqp7ejs444syjxf74p60ztmld8qpp5q4ayz5pys3t0yj0dmkmh7ctarkv9z434paz4u9rdwnj4f43thhaqdq8d9h8vvsxqyjw5qcqp99qxpqysgqn0055ttns6pafsxh6xuqce6e4vz8gtxlzqx0l9d9f5crmqx4jymh4zy9jdaszm0dj89sq39fvhpwcs626dt0n3gw8kassfdehp5sy3sq7fzy3w", + "payment_hash": "057a4150248456f249edddb77f617d1d985156350f455e146d74e554d62bbdfa", + "amount_msat": 1000, + "status": "paid", + "pay_index": 1, + "amount_received_msat": 1000, + "paid_at": 1706241494, + "payment_preimage": "34ccd37cc85e067cb376f9ea8c70d70469f58bf296f2566ed9ad4dfb70971a26", + "description": [ + "Inv2." + ], + "expires_at": 1706846290, + "created_index": 2, + "updated_index": 1 + } + ], + "author": [ + "Christian Decker <> is mainly responsible." + ], + "see_also": [ + "lightning-waitanyinvoice(7)", + "lightning-listinvoice(7)", + "lightning-delinvoice(7)", + "lightning-invoice(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-waitsendpay.json b/doc/schemas/lightning-waitsendpay.json new file mode 100644 index 000000000000..9da2c0db179e --- /dev/null +++ b/doc/schemas/lightning-waitsendpay.json @@ -0,0 +1,260 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "waitsendpay", + "title": "Command for sending a payment via a route", + "description": [ + "The **waitsendpay** RPC command polls or waits for the status of an outgoing payment that was initiated by a previous **sendpay** invocation.", + "", + "If the payment completed with success, this command returns with success. Otherwise, if the payment completed with failure, this command returns an error." + ], + "request": { + "required": [ + "payment_hash" + ], + "properties": { + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage*." + ] + }, + "timeout": { + "type": "u32", + "description": [ + "A timeout in seconds, for this RPC command to return. If the *timeout* is provided and the given amount of time passes without the payment definitely succeeding or definitely failing, this command returns with a 200 error code (payment still in progress). If *timeout* is not provided this call will wait indefinitely. Indicating a *timeout* of 0 effectively makes this call a pollable query of the status of the payment." + ] + }, + "partid": { + "type": "u64", + "description": [ + "Unique ID within this (multi-part) payment. It must match that of the **sendpay** command." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Grouping key to disambiguate multiple attempts to pay the same payment_hash." + ] + } + }, + "pairedWith": [ + [ + "partid", + "groupid" + ] + ] + }, + "response": { + "required": [ + "id", + "created_index", + "payment_hash", + "status", + "created_at", + "amount_sent_msat" + ], + "properties": { + "created_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was created in." + ] + }, + "id": { + "type": "u64", + "description": [ + "Old synonym for created_index." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "complete" + ], + "description": [ + "Status of the payment." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount delivered to destination (if known)." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment if known." + ] + }, + "created_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "updated_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was changed (only present if it has changed since creation)." + ] + }, + "completed_at": { + "type": "number", + "description": [ + "The UNIX timestamp showing when this payment was completed." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "The amount sent." + ] + }, + "label": { + "type": "string", + "description": [ + "The label, if given to sendpay." + ] + }, + "partid": { + "type": "u64", + "description": [ + "The *partid*, if given to sendpay." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string (if pay supplied one)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string (if supplied for pay: **experimental-offers** only)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "complete" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "payment_preimage" + ], + "properties": { + "id": {}, + "created_index": {}, + "updated_index": {}, + "groupid": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "destination": {}, + "created_at": {}, + "completed_at": {}, + "msatoshi_sent": {}, + "amount_sent_msat": {}, + "label": {}, + "partid": {}, + "bolt11": {}, + "bolt12": {}, + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash**." + ] + } + } + } + } + ] + }, + "errors": [ + "On error, and even if the error occurred from a node other than the final destination, the route table will no longer be updated. Use the *exclude* parameter of the `getroute` command to ignore the failing route.", + "", + "- -1: Catchall nonspecific error.", + "- 200: Timed out before the payment could complete.", + "- 202: Unparseable onion reply. The *data* field of the error will have an *onionreply* field, a hex string representation of the raw onion reply.", + "- 203: Permanent failure at destination. The *data* field of the error will be routing failure object.", + "- 204: Failure along route; retry a different route. The *data* field of the error will be routing failure object.", + "- 208: A payment for *payment_hash* was never made and there is nothing to wait for.", + "- 209: The payment already failed, but the reason for failure was not stored. This should only occur when querying failed payments on very old databases.", + "", + "A routing failure object has the fields below:", + "", + "*erring_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on.", + "*erring_node*: The hex string of the pubkey id of the node that reported the error.", + "*erring_channel*: The short channel ID of the channel that has the error (or the final channel if the destination raised the error).", + "*erring_direction*: The direction of traversing the *erring_channel*:", + "*failcode*: The failure code, as per BOLT #4.", + "*failcodename*: The human-readable name corresponding to *failcode*, if known." + ], + "example_json_request": [ + { + "id": "example:waitsendpay#1", + "method": "waitsendpay", + "params": { + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "timeout": null, + "partid": null, + "groupid": null + } + } + ], + "example_json_response": [ + { + "created_index": 1, + "id": 1, + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "groupid": 1, + "updated_index": 1, + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount_msat": 11000000, + "amount_sent_msat": 11000000, + "created_at": 1706152930, + "completed_at": 1706152933, + "status": "complete", + "payment_preimage": "af7ba559629f719c04c43a82767fe3622790a539164d6270db07f765203e574b", + "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk" + } + ], + "author": [ + "ZmnSCPxj <> is mainly responsible." + ], + "see_also": [ + "lightning-sendpay(7)", + "lightning-pay(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-withdraw.json b/doc/schemas/lightning-withdraw.json new file mode 100644 index 000000000000..4ce43cd36149 --- /dev/null +++ b/doc/schemas/lightning-withdraw.json @@ -0,0 +1,139 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "withdraw", + "title": "Command for withdrawing funds from the internal wallet", + "description": [ + "The **withdraw** RPC command sends funds from Core Lightning's internal wallet to the address specified in *destination*." + ], + "request": { + "required": [ + "destination", + "satoshi" + ], + "properties": { + "destination": { + "type": "string", + "description": [ + "Any Bitcoin accepted type, including bech32." + ] + }, + "satoshi": { + "type": "msat_or_all", + "description": [ + "The amount to be withdrawn from the internal wallet (expressed, as name suggests, in satoshi). The string *all* can be used to specify withdrawal of all available funds (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*." + ] + }, + "feerate": { + "type": "feerate", + "description": [ + "Used for the withdrawal as initial feerate." + ], + "default": "*normal*" + }, + "minconf": { + "type": "u16", + "description": [ + "Minimum number of confirmations that used outputs should have." + ], + "default": 1 + }, + "utxos": { + "type": "array", + "description": [ + "Specifies the utxos to be used to be withdrawn from, as an array of `txid:vout`. These must be drawn from the node's available UTXO set." + ], + "items": { + "type": "outpoint" + } + } + } + }, + "response": { + "required": [ + "psbt", + "tx", + "txid" + ], + "properties": { + "tx": { + "type": "hex", + "description": [ + "The fully signed bitcoin transaction." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The transaction id of *tx*." + ] + }, + "psbt": { + "type": "string", + "description": [ + "The PSBT representing the unsigned transaction." + ] + } + } + }, + "errors": [ + "On failure, an error is reported and the withdrawal transaction is not created.", + "", + "- -1: Catchall nonspecific error.", + "- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.", + "- 302: The dust limit is not met.", + "- 313: The `min-emergency-msat` reserve not be preserved (and we have anchor channels)." + ], + "example_json_request": [ + { + "id": "example:withdraw#1", + "method": "withdraw", + "params": { + "destination": "bcrt1qjc7j2l5es4haw35c9jzm8dfm763ng5djp8f0s0", + "satoshi": 555555, + "feerate": null, + "minconf": null, + "utxos": null + } + }, + { + "id": "example:withdraw#2", + "method": "withdraw", + "params": { + "destination": "bcrt1q66ukn5mdllddnp53j0mx8mjgph7uwdygn0uy45", + "satoshi": "all", + "feerate": "20000perkb", + "minconf": 0, + "utxos": [ + "218390859cf94d869e33f69161f4187a98f691afe868c20811528f589e90a61f:1" + ] + } + } + ], + "example_json_response": [ + { + "tx": "0200000001ef28647baa13cc4c03b8a58c8bd08b69de434c22ff591eb68171ae992e3d816d0000000000fdffffff02237a080000000000160014963d257e99856fd746982c85b3b53bf6a33451b24d6808000000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a66000000", + "txid": "ccb97d7dc695cabb78b217c0b27d7d00d2941966199480e6443e0680d24d69eb", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABAWPCRda9hy4QKqUEmtb7gK7SAqzh1xBP8nZ7PCj+7+JDAAAAAAD9////Akf0EAAAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WUs/fQpAQAAABYAFOIj6yaI/g85utJBtkPPdK1X59cfAkcwRAIgH7J57HuUTpnCbDrDqE8W7ryuCXk+i/TszQ/NF55lWncCIDeN4y+EzIDP3l2XO5/wjk98krYqnzvEhrStk+0+fTowASEC6Ng5r5KTNIXBRRvjivsd8SKnHF59r/ViDj2+CLJVb75lAAAAAQEfR/QQAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZSICA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPRzBEAiBY0urYSHLnnXaAJH7yaGfvGmm+VuNCNIBhQaJU6iDNEgIgA7EASW+V00Su+lRQAE3Qbe4wavLq7l6Jn2vR+6Snyd0BIgYD10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8IAfrZCgAAAAABDiDvKGR7qhPMTAO4pYyL0Itp3kNMIv9ZHraBca6ZLj2BbQEPBAAAAAABEAT9////AAEDCCN6CAAAAAAAAQQWABSWPSV+mYVv10aYLIWztTv2ozRRsgz8CWxpZ2h0bmluZwQCAAEAAQMITWgIAAAAAAABBCJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aIQeRRTKBKkQKTXZscc05GTaUo0CuEeAS5boa2e+6bnbKUwkAwsyrFwIAAAAA" + }, + { + "tx": "02000000011fa6909e588f521108c268e8af91f6987a18f46191f6339e864df99c859083210100000000fdffffff0158070f0000000000160014d6b969d36dffdad9869193f663ee480dfdc7348867000000", + "txid": "ad9a712a201214c68c39ca5be68c9d153d1cac91e540d88aa3207b241e23acf8", + "psbt": "cHNidP8BAgQCAAAAAQMEZwAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQD9ZQECAAAAAAEBVa+m1d1amChv4Dwq1rVoS4KSm0BUUnVa3fUYcB3dH9oAAAAAAP////8CECcAAAAAAAAiUSBXeaBg8gDUDo+HGkDrkWFMxb+m0KX4UuBTQAp/7/hhUOEPDwAAAAAAIlEg7tdFgE2peEzCA/Vj76mf+lT98BsTe8lk5jwxJAcP++YEAEcwRAIgPsWO/4IxeW6OclDdXVnwL99X7B18sRlxgFqyvUAzN7gCIGOQOq0wZ6bV+wdYQP+9sH8IkfmqWZbQRRDkZEgfcprMAUcwRAIgb5/dI4+uVhluQjSA2q/3oAGxZd4vYzQWexfmcRQML7ECIFfgRwCaHYdyu5/H5moOPlfQlLc2gPgB6bgtfNSfRA6jAUdSIQIyQmbehAOzqxV6CfH3hNWHr2GDHJmMFRvMIbt0wrIxSyEC4704AJhmydqOxKqZzE6pxsDdRt8Vxh7wzh8nEpFxTldSrgAAAAABASvhDw8AAAAAACJRIO7XRYBNqXhMwgP1Y++pn/pU/fAbE3vJZOY8MSQHD/vmAQ4gH6aQnliPUhEIwmjor5H2mHoY9GGR9jOehk35nIWQgyEBDwQBAAAAARAE/f///wETQL0MqyYsx9Z9q14BhByMgWLW4oJHOqED5qcZ3wyJ4eDuLYfNGq6Ck30dAqFzJL4VhZLSuv87zN/1AEDNMl2DmTohFl03KAgp8YbLmVzcy/I4q0VkATk5c1E5YySjZXXfNN3/CQAHHEnKAAAAAAAiAgK5wMaEThKlMclo5VxVB47BbZv3a+kpD9h9HMpytIOaFwjWuWnTBAAAAAEDCFgHDwAAAAAAAQQWABTWuWnTbf/a2YaRk/Zj7kgN/cc0iAz8CWxpZ2h0bmluZwQCAAEA" + } + ], + "author": [ + "Felix <> is mainly responsible." + ], + "see_also": [ + "lightning-listfunds(7)", + "lightning-fundchannel(7)", + "lightning-newaddr(7)", + "lightning-txprepare(7)", + "lightning-feerates(7)" + ], + "resources": [ + "Main web site: " + ] +} From 9122f1f2c0a529d0d972ae90c969ccd31073bcf0 Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Sun, 3 Mar 2024 18:29:52 -0800 Subject: [PATCH 10/16] script: Updated sql-schema_gen and documented it's jq dependency. --- Dockerfile | 3 +- contrib/docker/Dockerfile.builder | 1 + contrib/docker/Dockerfile.builder.fedora | 1 + contrib/docker/Dockerfile.tester | 1 + contrib/docker/Dockerfile.ubuntu | 2 +- contrib/docker/scripts/setup.sh | 1 + contrib/reprobuild/Dockerfile.focal | 1 + contrib/reprobuild/Dockerfile.jammy | 1 + .../contributor-workflow.md | 2 +- .../getting-started/installation.md | 5 ++-- doc/lightning-sql.7.md | 5 ++-- plugins/Makefile | 29 +++++++++++++------ 12 files changed, 36 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index a5ef573f0630..feb95af15a3a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -68,7 +68,8 @@ RUN apt-get update -qq && \ libev-dev \ libevent-dev \ qemu-user-static \ - wget + wget \ + jq RUN wget -q https://zlib.net/fossils/zlib-1.2.13.tar.gz \ && tar xvf zlib-1.2.13.tar.gz \ diff --git a/contrib/docker/Dockerfile.builder b/contrib/docker/Dockerfile.builder index 2c717a907fcb..6b5e7d7ee3c2 100644 --- a/contrib/docker/Dockerfile.builder +++ b/contrib/docker/Dockerfile.builder @@ -34,6 +34,7 @@ RUN apt-get -qq update && \ libxml2-utils \ lowdown \ wget \ + jq \ gettext \ xsltproc \ zlib1g-dev && \ diff --git a/contrib/docker/Dockerfile.builder.fedora b/contrib/docker/Dockerfile.builder.fedora index 22cb8c22bf67..2c3b1f55301f 100644 --- a/contrib/docker/Dockerfile.builder.fedora +++ b/contrib/docker/Dockerfile.builder.fedora @@ -19,6 +19,7 @@ RUN dnf update -y && \ net-tools \ valgrind \ wget \ + jq \ xz \ zlib-devel && \ dnf clean all diff --git a/contrib/docker/Dockerfile.tester b/contrib/docker/Dockerfile.tester index 14b61e7b1eb4..d79c3efe58ed 100644 --- a/contrib/docker/Dockerfile.tester +++ b/contrib/docker/Dockerfile.tester @@ -50,6 +50,7 @@ RUN apt-get -qq update && \ unzip \ valgrind \ wget \ + jq \ xsltproc \ zlib1g-dev && \ rm -rf /var/lib/apt/lists/* diff --git a/contrib/docker/Dockerfile.ubuntu b/contrib/docker/Dockerfile.ubuntu index 026c549a697c..401a60d1cb2d 100644 --- a/contrib/docker/Dockerfile.ubuntu +++ b/contrib/docker/Dockerfile.ubuntu @@ -24,7 +24,7 @@ RUN locale-gen en_US.UTF-8 && dpkg-reconfigure --frontend noninteractive tzdata RUN apt-get -qq update && \ apt-get -qq install --no-install-recommends --allow-unauthenticated -yy \ - build-essential libssl-dev libffi-dev \ + jq build-essential libssl-dev libffi-dev \ python3-dev cargo python3-pip COPY . . diff --git a/contrib/docker/scripts/setup.sh b/contrib/docker/scripts/setup.sh index 9af49030ee9e..94c59361d2f2 100755 --- a/contrib/docker/scripts/setup.sh +++ b/contrib/docker/scripts/setup.sh @@ -47,6 +47,7 @@ sudo apt-get -qq install --no-install-recommends --allow-unauthenticated -yy \ unzip \ valgrind \ wget \ + jq \ xsltproc \ zlib1g-dev diff --git a/contrib/reprobuild/Dockerfile.focal b/contrib/reprobuild/Dockerfile.focal index a02e552ceb73..cbc0f45a2265 100644 --- a/contrib/reprobuild/Dockerfile.focal +++ b/contrib/reprobuild/Dockerfile.focal @@ -24,6 +24,7 @@ RUN apt-get update \ sudo \ unzip \ wget \ + jq \ zip # install Python3.8 (more reproducible than relying on python3-setuptools) diff --git a/contrib/reprobuild/Dockerfile.jammy b/contrib/reprobuild/Dockerfile.jammy index 6c97db546e4d..632799414f16 100644 --- a/contrib/reprobuild/Dockerfile.jammy +++ b/contrib/reprobuild/Dockerfile.jammy @@ -25,6 +25,7 @@ RUN apt-get update \ sudo \ unzip \ wget \ + jq \ zip # Install Python3.10 (more reproducible than relying on python3-setuptools) diff --git a/doc/contribute-to-core-lightning/contributor-workflow.md b/doc/contribute-to-core-lightning/contributor-workflow.md index 489b2c99fa59..30a610b8344b 100644 --- a/doc/contribute-to-core-lightning/contributor-workflow.md +++ b/doc/contribute-to-core-lightning/contributor-workflow.md @@ -12,7 +12,7 @@ Install the following dependencies for best results: ```shell sudo apt update -sudo apt install valgrind cppcheck shellcheck libsecp256k1-dev libpq-dev +sudo apt install jq valgrind cppcheck shellcheck libsecp256k1-dev libpq-dev ``` Re-run `configure` and build using `make`: diff --git a/doc/getting-started/getting-started/installation.md b/doc/getting-started/getting-started/installation.md index 9297f806efb8..7477785f05c0 100644 --- a/doc/getting-started/getting-started/installation.md +++ b/doc/getting-started/getting-started/installation.md @@ -82,7 +82,7 @@ Get dependencies: ```shell sudo apt-get update sudo apt-get install -y \ - autoconf automake build-essential git libtool libsqlite3-dev \ + jq autoconf automake build-essential git libtool libsqlite3-dev \ python3 python3-pip net-tools zlib1g-dev libsodium-dev gettext pip3 install --upgrade pip pip3 install --user poetry @@ -115,7 +115,7 @@ For development or running tests, get additional dependencies: ```shell sudo apt-get install -y valgrind libpq-dev shellcheck cppcheck \ - libsecp256k1-dev jq lowdown + libsecp256k1-dev lowdown ``` If you can't install `lowdown`, a version will be built in-tree. @@ -193,6 +193,7 @@ sudo dnf update -y && \ net-tools \ valgrind \ wget \ + jq \ zlib-devel \ libsodium-devel && \ sudo dnf clean all diff --git a/doc/lightning-sql.7.md b/doc/lightning-sql.7.md index 4932bee18486..c1dc06de4661 100644 --- a/doc/lightning-sql.7.md +++ b/doc/lightning-sql.7.md @@ -249,6 +249,7 @@ The following tables are currently supported: - `peerchannels` indexed by `peer_id` (see lightning-listpeerchannels(7)) - `peer_id` (type `pubkey`, sqltype `BLOB`) - `peer_connected` (type `boolean`, sqltype `INTEGER`) + - `reestablished` (type `boolean`, sqltype `INTEGER`) - `state` (type `string`, sqltype `TEXT`) - `scratch_txid` (type `txid`, sqltype `BLOB`) - related table `peerchannels_channel_type_bits`, from JSON object `channel_type` @@ -357,7 +358,6 @@ The following tables are currently supported: - `local_trimmed` (type `boolean`, sqltype `INTEGER`) - `status` (type `string`, sqltype `TEXT`) - `state` (type `string`, sqltype `TEXT`) - - `reestablished` (type `boolean`, sqltype `INTEGER`) - `close_to_addr` (type `string`, sqltype `TEXT`) - `last_tx_fee_msat` (type `msat`, sqltype `INTEGER`) - `direction` (type `u32`, sqltype `INTEGER`) @@ -389,6 +389,7 @@ The following tables are currently supported: - `bolt11` (type `string`, sqltype `TEXT`) - `description` (type `string`, sqltype `TEXT`) - `bolt12` (type `string`, sqltype `TEXT`) + - `completed_at` (type `u64`, sqltype `INTEGER`) - `payment_preimage` (type `secret`, sqltype `BLOB`) - `erroronion` (type `hex`, sqltype `BLOB`) @@ -540,4 +541,4 @@ RESOURCES --------- Main web site: -[comment]: # ( SHA256STAMP:24eeff191907cb804299716293ef0733ef25cf8e74eb1808749aebbfd9e9fa9f) +[comment]: # ( SHA256STAMP:5c2e41cab6704299c65a8537761f3864e6b3327c1bf9163b00afe723d1f84eb6) diff --git a/plugins/Makefile b/plugins/Makefile index 0da2e5738dd0..7467610db56d 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -225,16 +225,27 @@ plugins/recover: common/gossmap.o common/fp16.o $(PLUGIN_RECOVER_OBJS) $(PLUGIN # This covers all the low-level list RPCs which return simple arrays SQL_LISTRPCS := listchannels listforwards listhtlcs listinvoices listnodes listoffers listpeers listpeerchannels listclosedchannels listtransactions listsendpays bkpr-listaccountevents bkpr-listincome -SQL_LISTRPCS_SCHEMAS := $(foreach l,$(SQL_LISTRPCS),doc/schemas/$l.schema.json) -# We squeeze: -# descriptions (we don't need) -# fields with no members (we don't need) -# whitespace -# We can't simply *remove* fields, since the extra comma left over can -# make invalid JSON. Grr! -# But these simple removals drop us from 100k to 29k. +SQL_LISTRPCS_SCHEMAS := $(foreach l,$(SQL_LISTRPCS),doc/schemas/lightning-$l.json) + +# RES_JSON is generated by: +# 1: deleting description array (used for field details) but keeping description keys +# 2: deleting additionalProperties, required, enum, maxLength, minLength, pre_return_value_notes, post_return_value_notes, anyOf, oneOf, hidden, untyped, default, comment, added, maximum, minimum, pattern, format +# (We only need [field].type, [field].name, [field].deprecated, [field].allOf, [field].items.allOf and allOf from response.properties) +# 3: deleting empty objects from .response.properties +# But these simple removals drop us from 100k to 18k. plugins/sql-schema_gen.h: plugins/Makefile $(SQL_LISTRPCS_SCHEMAS) - @$(call VERBOSE,GEN $@, (SEP=""; echo '"{'; for f in $(SQL_LISTRPCS); do echo "$$SEP\\\"$$f\\\":"; sed -e s/\"description\":\ *\".\*\"/\"\":\"\"/ -e s/\".*\":\ *{}/\"\":{}/ -e s/\"/\\\\\"/g < doc/schemas/$$f.schema.json; SEP=","; done; echo '}"') | tr -d ' \n' > $@) + @$(call VERBOSE,GEN $@, \ + ( \ + SEP=""; \ + echo '"{'; \ + for f in $(SQL_LISTRPCS); do \ + RES_JSON=$$(echo "$$(jq 'walk(if type == "object" then if has("description") and (.description | type) == "array" then del(.description) else . end else . end ) | walk(if type == "object" then del(.additionalProperties, .required, .enum, .maxLength, .minLength, .pre_return_value_notes, .post_return_value_notes, .anyOf, .oneOf, .hidden, .untyped, .default, .comment, .added, .maximum, .minimum, .pattern, .format) else . end) | walk(if type == "object" then with_entries(select(.value != {})) else . end) | .response.properties' < doc/schemas/lightning-$$f.json)" | sed 's/"/\\"/g'); \ + echo "$$SEP\\\"$$f\\\":{\\\"properties\\\": $$RES_JSON}"; \ + SEP=","; \ + done; \ + echo '}"' \ + ) | tr -d ' \n' > $@ \ + ) plugins/sql.o: plugins/sql-schema_gen.h plugins/sql: $(PLUGIN_SQL_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS) common/gossip_store.o gossipd/gossip_store_wiregen.o From 9b791328bbb7f358d1dd6a560764cd887bf5240a Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Sun, 3 Mar 2024 18:30:24 -0800 Subject: [PATCH 11/16] script: Update scripts - Update `make doc-all` script - `fromschema.py` script - Updated to generate whole doc/lightning-*.md via doc/schemas/lightning-*.json file - Updated to print request params - Added `oneOfMany` condition for request params - Added `pairedWith` condition for request params - Added `dependentUpon` condition for request params - Updated for pre and post_return_value for response - Hiding `hidden` fields - `descriptions` are array now - Unified gaps between titles - Added default key-value pair - script: msggen, sql-schema, listconfig and pyln-testing script updates This does not add created markdowns for cleaner review. We will add the markdown files in a separate commit. --- .msggen.json | 17 + cln-grpc/proto/node.proto | 7 +- cln-grpc/src/convert.rs | 17 +- cln-rpc/src/model.rs | 98 ++- contrib/msggen/msggen/gen/grpc.py | 2 + contrib/msggen/msggen/gen/grpc2py.py | 2 + contrib/msggen/msggen/gen/rust.py | 2 + contrib/msggen/msggen/model.py | 15 +- contrib/msggen/msggen/schema.json | 2 +- contrib/msggen/msggen/utils/utils.py | 7 +- contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py | 784 +++++++++--------- contrib/pyln-testing/pyln/testing/fixtures.py | 25 +- contrib/pyln-testing/pyln/testing/grpc2py.py | 2 + doc/Makefile | 119 +-- doc/schemas/lightning-sql.json | 2 +- tools/fromschema.py | 400 ++++++--- 16 files changed, 868 insertions(+), 633 deletions(-) diff --git a/.msggen.json b/.msggen.json index fa522b2c7baf..e90db8050c3e 100644 --- a/.msggen.json +++ b/.msggen.json @@ -499,6 +499,9 @@ "DatastoreUsage.datastoreusage.key": 1, "DatastoreUsage.datastoreusage.total_bytes": 2 }, + "DatastoreusageRequest": { + "DatastoreUsage.key": 1 + }, "DatastoreusageResponse": { "DatastoreUsage.datastoreusage": 1 }, @@ -1215,6 +1218,7 @@ "ListPeerChannels.channels[].peer_id": 1, "ListPeerChannels.channels[].private": 18, "ListPeerChannels.channels[].receivable_msat": 34, + "ListPeerChannels.channels[].reestablished": 58, "ListPeerChannels.channels[].scratch_txid": 4, "ListPeerChannels.channels[].short_channel_id": 8, "ListPeerChannels.channels[].spendable_msat": 33, @@ -1415,6 +1419,7 @@ "ListSendPays.payments[].amount_sent_msat": 8, "ListSendPays.payments[].bolt11": 10, "ListSendPays.payments[].bolt12": 11, + "ListSendPays.payments[].completed_at": 18, "ListSendPays.payments[].created_at": 7, "ListSendPays.payments[].created_index": 16, "ListSendPays.payments[].description": 14, @@ -2213,6 +2218,10 @@ "added": "v23.11", "deprecated": false }, + "DatastoreUsage.key": { + "added": "v23.11", + "deprecated": false + }, "Decode": { "added": "v23.05", "deprecated": null @@ -4693,6 +4702,10 @@ "added": "v23.02", "deprecated": false }, + "ListPeerChannels.channels[].reestablished": { + "added": "v24.02", + "deprecated": false + }, "ListPeerChannels.channels[].scratch_txid": { "added": "v23.02", "deprecated": false @@ -5241,6 +5254,10 @@ "added": "pre-v0.10.1", "deprecated": false }, + "ListSendPays.payments[].completed_at": { + "added": "pre-v0.10.1", + "deprecated": false + }, "ListSendPays.payments[].created_at": { "added": "pre-v0.10.1", "deprecated": false diff --git a/cln-grpc/proto/node.proto b/cln-grpc/proto/node.proto index 9292eae7b069..1f923bfe6d52 100644 --- a/cln-grpc/proto/node.proto +++ b/cln-grpc/proto/node.proto @@ -494,6 +494,7 @@ message ConnectAddress { message CreateinvoiceRequest { string invstring = 1; + string label = 2; bytes preimage = 3; } @@ -551,6 +552,7 @@ message DatastoreResponse { } message DatastoreusageRequest { + repeated string key = 1; } message DatastoreusageResponse { @@ -810,6 +812,7 @@ message ListsendpaysPayments { optional string bolt11 = 10; optional string description = 14; optional string bolt12 = 11; + optional uint64 completed_at = 18; optional bytes payment_preimage = 12; optional bytes erroronion = 13; } @@ -942,6 +945,7 @@ message WaitanyinvoicePaid_outpoint { } message WaitinvoiceRequest { + string label = 1; } message WaitinvoiceResponse { @@ -1198,6 +1202,7 @@ message ListpeerchannelsChannels { } optional bytes peer_id = 1; optional bool peer_connected = 2; + optional bool reestablished = 58; optional ListpeerchannelsChannelsState state = 3; optional bytes scratch_txid = 4; optional ListpeerchannelsChannelsUpdates updates = 55; @@ -1837,7 +1842,7 @@ message OfferRequest { optional string recurrence = 7; optional string recurrence_base = 8; optional string recurrence_paywindow = 9; - optional uint64 recurrence_limit = 10; + optional uint32 recurrence_limit = 10; optional bool single_use = 11; } diff --git a/cln-grpc/src/convert.rs b/cln-grpc/src/convert.rs index 0f60980cf07e..3f26c55598f8 100644 --- a/cln-grpc/src/convert.rs +++ b/cln-grpc/src/convert.rs @@ -658,6 +658,7 @@ impl From for pb::ListsendpaysPayments { bolt11: c.bolt11, // Rule #2 for type string? description: c.description, // Rule #2 for type string? bolt12: c.bolt12, // Rule #2 for type string? + completed_at: c.completed_at, // Rule #2 for type u64? payment_preimage: c.payment_preimage.map(|v| v.to_vec()), // Rule #2 for type secret? erroronion: c.erroronion.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex? } @@ -1118,6 +1119,7 @@ impl From for pb::ListpeerchannelsChannels Self { peer_id: c.peer_id.map(|v| v.serialize().to_vec()), // Rule #2 for type pubkey? peer_connected: c.peer_connected, // Rule #2 for type boolean? + reestablished: c.reestablished, // Rule #2 for type boolean? state: c.state.map(|v| v as i32), scratch_txid: c.scratch_txid.map(|v| hex::decode(v).unwrap()), // Rule #2 for type txid? updates: c.updates.map(|v| v.into()), @@ -1576,7 +1578,7 @@ impl From for pb::FundchannelResponse { tx: hex::decode(&c.tx).unwrap(), // Rule #2 for type hex txid: hex::decode(&c.txid).unwrap(), // Rule #2 for type txid outnum: c.outnum, // Rule #2 for type u32 - channel_id: hex::decode(&c.channel_id).unwrap(), // Rule #2 for type hex + channel_id: >::as_ref(&c.channel_id).to_vec(), // Rule #2 for type hash channel_type: c.channel_type.map(|v| v.into()), close_to: c.close_to.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex? mindepth: c.mindepth, // Rule #2 for type u32? @@ -1757,7 +1759,7 @@ impl From for pb::SetchannelChannels { fn from(c: responses::SetchannelChannels) -> Self { Self { peer_id: c.peer_id.serialize().to_vec(), // Rule #2 for type pubkey - channel_id: hex::decode(&c.channel_id).unwrap(), // Rule #2 for type hex + channel_id: >::as_ref(&c.channel_id).to_vec(), // Rule #2 for type hash short_channel_id: c.short_channel_id.map(|v| v.to_string()), // Rule #2 for type short_channel_id? fee_base_msat: Some(c.fee_base_msat.into()), // Rule #2 for type msat fee_proportional_millionths: c.fee_proportional_millionths, // Rule #2 for type u32 @@ -2016,6 +2018,7 @@ impl From for pb::CreateinvoiceRequest { fn from(c: requests::CreateinvoiceRequest) -> Self { Self { invstring: c.invstring, // Rule #2 for type string + label: c.label, // Rule #2 for type string preimage: hex::decode(&c.preimage).unwrap(), // Rule #2 for type hex } } @@ -2039,6 +2042,8 @@ impl From for pb::DatastoreRequest { impl From for pb::DatastoreusageRequest { fn from(c: requests::DatastoreusageRequest) -> Self { Self { + // Field: DatastoreUsage.key + key: c.key.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 } } } @@ -2237,6 +2242,7 @@ impl From for pb::WaitanyinvoiceRequest { impl From for pb::WaitinvoiceRequest { fn from(c: requests::WaitinvoiceRequest) -> Self { Self { + label: c.label, // Rule #2 for type string } } } @@ -2552,7 +2558,7 @@ impl From for pb::OfferRequest { recurrence: c.recurrence, // Rule #2 for type string? recurrence_base: c.recurrence_base, // Rule #2 for type string? recurrence_paywindow: c.recurrence_paywindow, // Rule #2 for type string? - recurrence_limit: c.recurrence_limit, // Rule #2 for type u64? + recurrence_limit: c.recurrence_limit, // Rule #2 for type u32? single_use: c.single_use, // Rule #2 for type boolean? } } @@ -2811,6 +2817,7 @@ impl From for requests::CreateinvoiceRequest { fn from(c: pb::CreateinvoiceRequest) -> Self { Self { invstring: c.invstring, // Rule #1 for type string + label: c.label, // Rule #1 for type string preimage: hex::encode(&c.preimage), // Rule #1 for type hex } } @@ -2833,6 +2840,7 @@ impl From for requests::DatastoreRequest { impl From for requests::DatastoreusageRequest { fn from(c: pb::DatastoreusageRequest) -> Self { Self { + key: Some(c.key.into_iter().map(|s| s.into()).collect()), // Rule #4 } } } @@ -3025,6 +3033,7 @@ impl From for requests::WaitanyinvoiceRequest { impl From for requests::WaitinvoiceRequest { fn from(c: pb::WaitinvoiceRequest) -> Self { Self { + label: c.label, // Rule #1 for type string } } } @@ -3332,7 +3341,7 @@ impl From for requests::OfferRequest { recurrence: c.recurrence, // Rule #1 for type string? recurrence_base: c.recurrence_base, // Rule #1 for type string? recurrence_paywindow: c.recurrence_paywindow, // Rule #1 for type string? - recurrence_limit: c.recurrence_limit, // Rule #1 for type u64? + recurrence_limit: c.recurrence_limit, // Rule #1 for type u32? single_use: c.single_use, // Rule #1 for type boolean? } } diff --git a/cln-rpc/src/model.rs b/cln-rpc/src/model.rs index a1d5b5ee585c..e9a02ba35534 100644 --- a/cln-rpc/src/model.rs +++ b/cln-rpc/src/model.rs @@ -195,7 +195,7 @@ pub mod requests { "getinfo" } } - /// supplying level will show log entries related to that peer at the given log level + /// ['Supplying level will show log entries related to that peer at the given log level.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ListpeersLevel { #[serde(rename = "io")] @@ -491,6 +491,7 @@ pub mod requests { #[derive(Clone, Debug, Deserialize, Serialize)] pub struct CreateinvoiceRequest { pub invstring: String, + pub label: String, pub preimage: String, } @@ -511,7 +512,7 @@ pub mod requests { "createinvoice" } } - /// - `must-create`: fails if it already exists. - `must-replace`: fails if it doesn't already exist. - `create-or-replace`: never fails. - `must-append`: must already exist, append this to what's already there. - `create-or-append`: append if anything is there, otherwise create. Default is `must-create` + /// ['Write mode to determine how the record is updated:', ' * `must-create`: fails if it already exists.', " * `must-replace`: fails if it doesn't already exist.", ' * `create-or-replace`: never fails.', " * `must-append`: must already exist, append this to what's already there.", ' * `create-or-append`: append if anything is there, otherwise create.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum DatastoreMode { #[serde(rename = "must-create")] @@ -584,6 +585,8 @@ pub mod requests { } #[derive(Clone, Debug, Deserialize, Serialize)] pub struct DatastoreusageRequest { + #[serde(skip_serializing_if = "crate::is_none_or_empty")] + pub key: Option>, } impl From for Request { @@ -683,7 +686,7 @@ pub mod requests { "delexpiredinvoice" } } - /// label of the invoice to be deleted. The caller should be particularly aware of the error case caused by the *status* changing just before this command is invoked! + /// ['Label of the invoice to be deleted. The caller should be particularly aware of the error case caused by the *status* changing just before this command is invoked!'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum DelinvoiceStatus { #[serde(rename = "paid")] @@ -799,7 +802,7 @@ pub mod requests { "listdatastore" } } - /// if neither *in_channel* nor *out_channel* is specified, it controls ordering. Defaults to `created` + /// ['If neither *in_channel* nor *out_channel* is specified, it controls ordering.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ListinvoicesIndex { #[serde(rename = "created")] @@ -912,7 +915,7 @@ pub mod requests { "sendonion" } } - /// Whether the invoice has been paid, pending, or failed + /// ['Whether the invoice has been paid, pending, or failed.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ListsendpaysStatus { #[serde(rename = "pending")] @@ -945,7 +948,7 @@ pub mod requests { } } - /// if neither bolt11 or payment_hash is specified, `index` controls ordering, by `created` (default) or `updated` + /// ['If neither bolt11 or payment_hash is specified, `index` controls ordering, by `created` (default) or `updated`.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ListsendpaysIndex { #[serde(rename = "created")] @@ -1122,6 +1125,7 @@ pub mod requests { } #[derive(Clone, Debug, Deserialize, Serialize)] pub struct WaitinvoiceRequest { + pub label: String, } impl From for Request { @@ -1169,7 +1173,7 @@ pub mod requests { "waitsendpay" } } - /// it specifies the type of address wanted; currently *bech32* (e.g. `tb1qu9j4lg5f9rgjyfhvfd905vw46eg39czmktxqgg` on bitcoin testnet or `bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej` on bitcoin mainnet), or *p2tr* taproot addresses. The special value *all* generates all known address types for the same underlying key. Defaults to *bech32* address + /// ['It specifies the type of address wanted; currently *bech32* (e.g. `tb1qu9j4lg5f9rgjyfhvfd905vw46eg39czmktxqgg` on bitcoin testnet or `bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej` on bitcoin mainnet), or *p2tr* taproot addresses. The special value *all* generates all known address types for the same underlying key.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum NewaddrAddresstype { #[serde(rename = "bech32")] @@ -1602,7 +1606,7 @@ pub mod requests { "disconnect" } } - /// *perkw* - provide feerate in units of satoshis per 1000 weight (e.g. the minimum fee is usually `253perkw`) *perkb* - provide feerate in units of satoshis per 1000 virtual bytes (eg. the minimum fee is usually `1000perkb`) + /// ['Fee rate style to use. This can be:', ' *perkw* - provide feerate in units of satoshis per 1000 weight (e.g. the minimum fee is usually `253perkw`).', ' *perkb* - provide feerate in units of satoshis per 1000 virtual bytes (eg. the minimum fee is usually `1000perkb`).'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum FeeratesStyle { #[serde(rename = "perkb")] @@ -1769,7 +1773,7 @@ pub mod requests { "getroute" } } - /// if specified, then only the forwards with the given status are returned + /// ['If specified, then only the forwards with the given status are returned.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ListforwardsStatus { #[serde(rename = "offered")] @@ -1806,7 +1810,7 @@ pub mod requests { } } - /// if neither *in_channel* nor *out_channel* is specified, it controls ordering. Defaults to `created` + /// ['If neither *in_channel* nor *out_channel* is specified, it controls ordering.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ListforwardsIndex { #[serde(rename = "created")] @@ -1893,7 +1897,7 @@ pub mod requests { "listoffers" } } - /// to filter the payment by status + /// ['To filter the payment by status.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ListpaysStatus { #[serde(rename = "pending")] @@ -1995,7 +1999,7 @@ pub mod requests { #[serde(skip_serializing_if = "Option::is_none")] pub recurrence_paywindow: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub recurrence_limit: Option, + pub recurrence_limit: Option, #[serde(skip_serializing_if = "Option::is_none")] pub single_use: Option, } @@ -2168,7 +2172,7 @@ pub mod requests { "waitblockheight" } } - /// the subsystem to get the next index value from + /// ['The subsystem to get the next index value from.', ' `invoices`: corresponding to `listinvoices` (added in *v23.08*).', ' `sendpays`: corresponding to `listsendpays` (added in *v23.11*).', ' `forwards`: corresponding to `listforwards` (added in *v23.11*).'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum WaitSubsystem { #[serde(rename = "invoices")] @@ -2201,7 +2205,7 @@ pub mod requests { } } - /// the name of the index to get the next value for + /// ['The name of the index to get the next value for.', ' `created` is incremented by one for every new object.', ' `updated` is incremented by one every time an object is changed.', ' `deleted` is incremented by one every time an object is deleted.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum WaitIndexname { #[serde(rename = "created")] @@ -2397,7 +2401,7 @@ pub mod responses { pub invoice: String, } - /// Type of connection (until 23.08, `websocket` was also allowed) + /// ['Type of connection (until 23.08, `websocket` was also allowed).'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum GetinfoAddressType { #[serde(rename = "dns")] @@ -2448,7 +2452,7 @@ pub mod responses { pub address: Option, } - /// Type of connection + /// ['Type of connection.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum GetinfoBindingType { #[serde(rename = "local socket")] @@ -2612,7 +2616,7 @@ pub mod responses { pub data: Option, } - /// the channel state, in particular "CHANNELD_NORMAL" means the channel can be used normally + /// ['Current state of the channel:', ' * `OPENINGD`: The channel funding protocol with the peer is ongoing and both sides are negotiating parameters.', ' * `CHANNELD_AWAITING_LOCKIN`: The peer and you have agreed on channel parameters and are just waiting for the channel funding transaction to be confirmed deeply. Both you and the peer must acknowledge the channel funding transaction to be confirmed deeply before entering the next state.', ' * `CHANNELD_NORMAL`: The channel can be used for normal payments.', ' * `CHANNELD_SHUTTING_DOWN`: A mutual close was requested (by you or peer) and both of you are waiting for HTLCs in-flight to be either failed or succeeded. The channel can no longer be used for normal payments and forwarding. Mutual close will proceed only once all HTLCs in the channel have either been fulfilled or failed.', ' * `CLOSINGD_SIGEXCHANGE`: You and the peer are negotiating the mutual close onchain fee.', ' * `CLOSINGD_COMPLETE`: You and the peer have agreed on the mutual close onchain fee and are awaiting the mutual close getting confirmed deeply.', ' * `AWAITING_UNILATERAL`: You initiated a unilateral close, and are now waiting for the peer-selected unilateral close timeout to complete.', ' * `FUNDING_SPEND_SEEN`: You saw the funding transaction getting spent (usually the peer initiated a unilateral close) and will now determine what exactly happened (i.e. if it was a theft attempt).', ' * `ONCHAIN`: You saw the funding transaction getting spent and now know what happened (i.e. if it was a proper unilateral close by the peer, or a theft attempt).', ' * `CLOSED`: The channel closure has been confirmed deeply. The channel will eventually be removed from this array.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ListpeersPeersChannelsState { #[serde(rename = "OPENINGD")] @@ -2723,7 +2727,7 @@ pub mod responses { pub remote: Option, } - /// Whether it came from peer, or is going to peer + /// ['Whether it came from peer, or is going to peer.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ListpeersPeersChannelsHtlcsDirection { #[serde(rename = "in")] @@ -2990,7 +2994,7 @@ pub mod responses { } } - /// status of the payment (could be complete if already sent previously) + /// ['Status of the payment (could be complete if already sent previously).'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum SendpayStatus { #[serde(rename = "pending")] @@ -3153,7 +3157,7 @@ pub mod responses { } } - /// Whether we successfully negotiated a mutual close, closed without them, or discarded not-yet-opened channel + /// ['Whether we successfully negotiated a mutual close, closed without them, or discarded not-yet-opened channel.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum CloseType { #[serde(rename = "mutual")] @@ -3208,7 +3212,7 @@ pub mod responses { } } - /// Whether they initiated connection or we did + /// ['Whether they initiated connection or we did.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ConnectDirection { #[serde(rename = "in")] @@ -3237,7 +3241,7 @@ pub mod responses { } } - /// Type of connection (*torv2*/*torv3* only if **direction** is *out*) + /// ['Type of connection (*torv2*/*torv3* only if **direction** is *out*).'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ConnectAddressType { #[serde(rename = "local socket")] @@ -3311,7 +3315,7 @@ pub mod responses { } } - /// Whether it has been paid, or can no longer be paid + /// ['Whether it has been paid, or can no longer be paid.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum CreateinvoiceStatus { #[serde(rename = "paid")] @@ -3496,7 +3500,7 @@ pub mod responses { } } - /// State of invoice + /// ['State of invoice.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum DelinvoiceStatus { #[serde(rename = "paid")] @@ -3623,7 +3627,7 @@ pub mod responses { } } - /// Whether it's paid, unpaid or unpayable + /// ["Whether it's paid, unpaid or unpayable."] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ListinvoicesInvoicesStatus { #[serde(rename = "unpaid")] @@ -3715,7 +3719,7 @@ pub mod responses { } } - /// status of the payment (could be complete if already sent previously) + /// ['Status of the payment (could be complete if already sent previously).'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum SendonionStatus { #[serde(rename = "pending")] @@ -3785,7 +3789,7 @@ pub mod responses { } } - /// status of the payment + /// ['Status of the payment.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ListsendpaysPaymentsStatus { #[serde(rename = "pending")] @@ -3846,6 +3850,8 @@ pub mod responses { #[serde(skip_serializing_if = "Option::is_none")] pub bolt12: Option, #[serde(skip_serializing_if = "Option::is_none")] + pub completed_at: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub payment_preimage: Option, #[serde(skip_serializing_if = "Option::is_none")] pub erroronion: Option, @@ -3910,7 +3916,7 @@ pub mod responses { } } - /// status of payment + /// ['Status of payment.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum PayStatus { #[serde(rename = "complete")] @@ -3970,7 +3976,7 @@ pub mod responses { } } - /// Type of connection (until 23.08, `websocket` was also allowed) + /// ['Type of connection (until 23.08, `websocket` was also allowed).'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ListnodesNodesAddressesType { #[serde(rename = "dns")] @@ -4052,7 +4058,7 @@ pub mod responses { } } - /// Whether it's paid or expired + /// ["Whether it's paid or expired."] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum WaitanyinvoiceStatus { #[serde(rename = "paid")] @@ -4130,7 +4136,7 @@ pub mod responses { } } - /// Whether it's paid or expired + /// ["Whether it's paid or expired."] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum WaitinvoiceStatus { #[serde(rename = "paid")] @@ -4208,7 +4214,7 @@ pub mod responses { } } - /// status of the payment + /// ['Status of the payment.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum WaitsendpayStatus { #[serde(rename = "complete")] @@ -4313,7 +4319,7 @@ pub mod responses { } } - /// status of payment + /// ['Status of payment.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum KeysendStatus { #[serde(rename = "complete")] @@ -4515,7 +4521,7 @@ pub mod responses { } } - /// the channel state, in particular "CHANNELD_NORMAL" means the channel can be used normally + /// ['The channel state, in particular `CHANNELD_NORMAL` means the channel can be used normally.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ListpeerchannelsChannelsState { #[serde(rename = "OPENINGD")] @@ -4676,7 +4682,7 @@ pub mod responses { pub remote: Option, } - /// Whether it came from peer, or is going to peer + /// ['Whether it came from peer, or is going to peer.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ListpeerchannelsChannelsHtlcsDirection { #[serde(rename = "in")] @@ -4732,6 +4738,8 @@ pub mod responses { #[serde(skip_serializing_if = "Option::is_none")] pub peer_connected: Option, #[serde(skip_serializing_if = "Option::is_none")] + pub reestablished: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub state: Option, #[serde(skip_serializing_if = "Option::is_none")] pub scratch_txid: Option, @@ -4862,7 +4870,7 @@ pub mod responses { pub remote: Option, } - /// What caused the channel to close + /// ['What caused the channel to close.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ListclosedchannelsClosedchannelsClose_cause { #[serde(rename = "unknown")] @@ -4963,7 +4971,7 @@ pub mod responses { } } - /// the address type (if known) + /// ['The address type (if known).'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum DecodepayFallbacksType { #[serde(rename = "P2PKH")] @@ -5058,7 +5066,7 @@ pub mod responses { } } - /// what kind of object it decoded to + /// ['What kind of object it decoded to.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum DecodeType { #[serde(rename = "bolt12 offer")] @@ -5466,7 +5474,7 @@ pub mod responses { pub tx: String, pub txid: String, pub outnum: u32, - pub channel_id: String, + pub channel_id: Sha256, #[serde(skip_serializing_if = "Option::is_none")] pub channel_type: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -5486,7 +5494,7 @@ pub mod responses { } } - /// The features understood by the destination node + /// ['The features understood by the destination node.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum GetrouteRouteStyle { #[serde(rename = "tlv")] @@ -5538,7 +5546,7 @@ pub mod responses { } } - /// still ongoing, completed, failed locally, or failed after forwarding + /// ['Still ongoing, completed, failed locally, or failed after forwarding.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ListforwardsForwardsStatus { #[serde(rename = "offered")] @@ -5575,7 +5583,7 @@ pub mod responses { } } - /// Either a legacy onion format or a modern tlv format + /// ['Either a legacy onion format or a modern tlv format.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ListforwardsForwardsStyle { #[serde(rename = "legacy")] @@ -5672,7 +5680,7 @@ pub mod responses { } } - /// status of the payment + /// ['Status of the payment.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ListpaysPaysStatus { #[serde(rename = "pending")] @@ -5751,7 +5759,7 @@ pub mod responses { } } - /// out if we offered this to the peer, in if they offered it + /// ['Out if we offered this to the peer, in if they offered it.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum ListhtlcsHtlcsDirection { #[serde(rename = "out")] @@ -5867,7 +5875,7 @@ pub mod responses { #[derive(Clone, Debug, Deserialize, Serialize)] pub struct SetchannelChannels { pub peer_id: PublicKey, - pub channel_id: String, + pub channel_id: Sha256, #[serde(skip_serializing_if = "Option::is_none")] pub short_channel_id: Option, pub fee_base_msat: Amount, diff --git a/contrib/msggen/msggen/gen/grpc.py b/contrib/msggen/msggen/gen/grpc.py index d8b860e27954..6f7857db35f7 100644 --- a/contrib/msggen/msggen/gen/grpc.py +++ b/contrib/msggen/msggen/gen/grpc.py @@ -13,6 +13,7 @@ 'msat': 'Amount', 'msat_or_all': 'AmountOrAll', 'msat_or_any': 'AmountOrAny', + 'currency': 'string', 'number': 'double', 'pubkey': 'bytes', 'short_channel_id': 'string', @@ -33,6 +34,7 @@ "feerate": "Feerate", "outputdesc": "OutputDesc", "secret": "bytes", + "bip340sig": "bytes", "hash": "bytes", } diff --git a/contrib/msggen/msggen/gen/grpc2py.py b/contrib/msggen/msggen/gen/grpc2py.py index 1a0c159ed143..b90494154989 100644 --- a/contrib/msggen/msggen/gen/grpc2py.py +++ b/contrib/msggen/msggen/gen/grpc2py.py @@ -35,6 +35,7 @@ def __init__(self, dest: TextIO): 'signature': "hexlify(m.{name})", 'txid': "hexlify(m.{name})", 'hash': "hexlify(m.{name})", + 'bip340sig': "hexlify(m.{name})", 'string': "m.{name}", 'u8': "m.{name}", 'u16': "m.{name}", @@ -48,6 +49,7 @@ def __init__(self, dest: TextIO): 'boolean': "m.{name}", 'short_channel_id': "m.{name}", 'msat': "amount2msat(m.{name})", + 'currency': "m.{name}", 'number': "m.{name}", } diff --git a/contrib/msggen/msggen/gen/rust.py b/contrib/msggen/msggen/gen/rust.py index 3847566bce01..668ca5a05737 100644 --- a/contrib/msggen/msggen/gen/rust.py +++ b/contrib/msggen/msggen/gen/rust.py @@ -22,6 +22,7 @@ 'msat': 'Amount', 'msat_or_all': 'AmountOrAll', 'msat_or_any': 'AmountOrAny', + 'currency': 'String', 'number': 'f64', 'pubkey': 'PublicKey', 'short_channel_id': 'ShortChannelId', @@ -35,6 +36,7 @@ 'outputdesc': 'OutputDesc', 'hash': 'Sha256', 'secret': 'Secret', + 'bip340sig': 'Secret', 'integer': 'i64', } diff --git a/contrib/msggen/msggen/model.py b/contrib/msggen/msggen/model.py index c706e71446c9..7a6ea0343507 100644 --- a/contrib/msggen/msggen/model.py +++ b/contrib/msggen/msggen/model.py @@ -234,12 +234,6 @@ def from_js(cls, js, path): logger.warning(f"Unmanaged {fpath}, it doesn't have a type") continue - elif ftype["type"] == ["string", "null"]: - # TODO Remove the `['string', 'null']` match once - # `listpeers.peers[].channels[].closer` no longer has this - # type - ftype["type"] = "string" - # Peek into the type so we know how to decode it elif ftype["type"] in ["string", ["string", "null"]] and "enum" in ftype: field = EnumField.from_js(ftype, fpath) @@ -360,6 +354,7 @@ class PrimitiveField(Field): "msat", "msat_or_any", "msat_or_all", + "currency", "hex", "short_channel_id", "short_channel_id_dir", @@ -372,6 +367,7 @@ class PrimitiveField(Field): "utxo", # A string representing the tuple (txid, outnum) "outputdesc", # A dict that maps an address to an amount (bitcoind style) "secret", + "bip340sig", "hash", ] @@ -435,8 +431,10 @@ def __str__(self): return f"Command[name={self.name}, fields=[{fieldnames}]]" +OfferStringField = PrimitiveField("string", None, None, added=None, deprecated=None) InvoiceLabelField = PrimitiveField("string", None, None, added=None, deprecated=None) DatastoreKeyField = ArrayField(itemtype=PrimitiveField("string", None, None, added=None, deprecated=None), dims=1, path=None, description=None, added=None, deprecated=None) +DatastoreUsageKeyField = ArrayField(itemtype=PrimitiveField("string", None, None, added="v23.11", deprecated=None), dims=1, path=None, description=None, added="v23.11", deprecated=None) InvoiceExposeprivatechannelsField = PrimitiveField("boolean", None, None, added=None, deprecated=None) PayExclude = ArrayField(itemtype=PrimitiveField("string", None, None, added=None, deprecated=None), dims=1, path=None, description=None, added=None, deprecated=None) RoutehintListField = PrimitiveField( @@ -470,6 +468,11 @@ def __str__(self): 'Pay.exclude': PayExclude, 'KeySend.routehints': RoutehintListField, 'KeySend.extratlvs': TlvStreamField, + 'CreateInvoice.label': InvoiceLabelField, + 'DatastoreUsage.key': DatastoreUsageKeyField, + 'WaitInvoice.label': InvoiceLabelField, + 'Offer.recurrence_base': OfferStringField, + 'Offer.amount': OfferStringField } diff --git a/contrib/msggen/msggen/schema.json b/contrib/msggen/msggen/schema.json index 88b79159545e..01b014dda491 100644 --- a/contrib/msggen/msggen/schema.json +++ b/contrib/msggen/msggen/schema.json @@ -36245,7 +36245,7 @@ "tables": [ "Note that the first column of every table is a unique integer called `rowid`: this is used for related tables to refer to specific rows in their parent. sqlite3 usually has this as an implicit column, but we make it explicit as the implicit version is not allowed to be used as a foreign key.", "", - "The following tables are currently supported:\n- `bkpr_accountevents` (see lightning-bkpr-listaccountevents(7))\n - `account` (type `string`, sqltype `TEXT`)\n - `type` (type `string`, sqltype `TEXT`)\n - `tag` (type `string`, sqltype `TEXT`)\n - `credit_msat` (type `msat`, sqltype `INTEGER`)\n - `debit_msat` (type `msat`, sqltype `INTEGER`)\n - `currency` (type `string`, sqltype `TEXT`)\n - `timestamp` (type `u32`, sqltype `INTEGER`)\n - `outpoint` (type `string`, sqltype `TEXT`)\n - `blockheight` (type `u32`, sqltype `INTEGER`)\n - `origin` (type `string`, sqltype `TEXT`)\n - `payment_id` (type `hex`, sqltype `BLOB`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `description` (type `string`, sqltype `TEXT`)\n - `fees_msat` (type `msat`, sqltype `INTEGER`)\n - `is_rebalance` (type `boolean`, sqltype `INTEGER`)\n - `part_id` (type `u32`, sqltype `INTEGER`)\n\n- `bkpr_income` (see lightning-bkpr-listincome(7))\n - `account` (type `string`, sqltype `TEXT`)\n - `tag` (type `string`, sqltype `TEXT`)\n - `credit_msat` (type `msat`, sqltype `INTEGER`)\n - `debit_msat` (type `msat`, sqltype `INTEGER`)\n - `currency` (type `string`, sqltype `TEXT`)\n - `timestamp` (type `u32`, sqltype `INTEGER`)\n - `description` (type `string`, sqltype `TEXT`)\n - `outpoint` (type `string`, sqltype `TEXT`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `payment_id` (type `hex`, sqltype `BLOB`)\n\n- `channels` indexed by `short_channel_id` (see lightning-listchannels(7))\n - `source` (type `pubkey`, sqltype `BLOB`)\n - `destination` (type `pubkey`, sqltype `BLOB`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `direction` (type `u32`, sqltype `INTEGER`)\n - `public` (type `boolean`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `message_flags` (type `u8`, sqltype `INTEGER`)\n - `channel_flags` (type `u8`, sqltype `INTEGER`)\n - `active` (type `boolean`, sqltype `INTEGER`)\n - `last_update` (type `u32`, sqltype `INTEGER`)\n - `base_fee_millisatoshi` (type `u32`, sqltype `INTEGER`)\n - `fee_per_millionth` (type `u32`, sqltype `INTEGER`)\n - `delay` (type `u32`, sqltype `INTEGER`)\n - `htlc_minimum_msat` (type `msat`, sqltype `INTEGER`)\n - `htlc_maximum_msat` (type `msat`, sqltype `INTEGER`)\n - `features` (type `hex`, sqltype `BLOB`)\n\n- `closedchannels` (see lightning-listclosedchannels(7))\n - `peer_id` (type `pubkey`, sqltype `BLOB`)\n - `channel_id` (type `hash`, sqltype `BLOB`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `opener` (type `string`, sqltype `TEXT`)\n - `closer` (type `string`, sqltype `TEXT`)\n - `private` (type `boolean`, sqltype `INTEGER`)\n - related table `closedchannels_channel_type_bits`, from JSON object `channel_type`\n - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `bits` (type `u32`, sqltype `INTEGER`)\n - related table `closedchannels_channel_type_names`, from JSON object `channel_type`\n - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `names` (type `string`, sqltype `TEXT`)\n - `total_local_commitments` (type `u64`, sqltype `INTEGER`)\n - `total_remote_commitments` (type `u64`, sqltype `INTEGER`)\n - `total_htlcs_sent` (type `u64`, sqltype `INTEGER`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `leased` (type `boolean`, sqltype `INTEGER`)\n - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`)\n - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`)\n - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`)\n - `total_msat` (type `msat`, sqltype `INTEGER`)\n - `final_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `min_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `max_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `last_commitment_txid` (type `hash`, sqltype `BLOB`)\n - `last_commitment_fee_msat` (type `msat`, sqltype `INTEGER`)\n - `close_cause` (type `string`, sqltype `TEXT`)\n - `last_stable_connection` (type `u64`, sqltype `INTEGER`)\n\n- `forwards` indexed by `in_channel and in_htlc_id` (see lightning-listforwards(7))\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `in_channel` (type `short_channel_id`, sqltype `TEXT`)\n - `in_htlc_id` (type `u64`, sqltype `INTEGER`)\n - `in_msat` (type `msat`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `received_time` (type `number`, sqltype `REAL`)\n - `out_channel` (type `short_channel_id`, sqltype `TEXT`)\n - `out_htlc_id` (type `u64`, sqltype `INTEGER`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `style` (type `string`, sqltype `TEXT`)\n - `fee_msat` (type `msat`, sqltype `INTEGER`)\n - `out_msat` (type `msat`, sqltype `INTEGER`)\n - `resolved_time` (type `number`, sqltype `REAL`)\n - `failcode` (type `u32`, sqltype `INTEGER`)\n - `failreason` (type `string`, sqltype `TEXT`)\n\n- `htlcs` indexed by `short_channel_id and id` (see lightning-listhtlcs(7))\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `expiry` (type `u32`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `direction` (type `string`, sqltype `TEXT`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `state` (type `string`, sqltype `TEXT`)\n\n- `invoices` indexed by `payment_hash` (see lightning-listinvoices(7))\n - `label` (type `string`, sqltype `TEXT`)\n - `description` (type `string`, sqltype `TEXT`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `status` (type `string`, sqltype `TEXT`)\n - `expires_at` (type `u64`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `bolt11` (type `string`, sqltype `TEXT`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `local_offer_id` (type `hash`, sqltype `BLOB`)\n - `invreq_payer_note` (type `string`, sqltype `TEXT`)\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `pay_index` (type `u64`, sqltype `INTEGER`)\n - `amount_received_msat` (type `msat`, sqltype `INTEGER`)\n - `paid_at` (type `u64`, sqltype `INTEGER`)\n - `paid_outpoint_txid` (type `txid`, sqltype `BLOB`, from JSON object `paid_outpoint`)\n - `paid_outpoint_outnum` (type `u32`, sqltype `INTEGER`, from JSON object `paid_outpoint`)\n - `payment_preimage` (type `secret`, sqltype `BLOB`)\n\n- `nodes` indexed by `nodeid` (see lightning-listnodes(7))\n - `nodeid` (type `pubkey`, sqltype `BLOB`)\n - `last_timestamp` (type `u32`, sqltype `INTEGER`)\n - `alias` (type `string`, sqltype `TEXT`)\n - `color` (type `hex`, sqltype `BLOB`)\n - `features` (type `hex`, sqltype `BLOB`)\n - related table `nodes_addresses`\n - `row` (reference to `nodes.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `type` (type `string`, sqltype `TEXT`)\n - `port` (type `u16`, sqltype `INTEGER`)\n - `address` (type `string`, sqltype `TEXT`)\n - `option_will_fund_lease_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_lease_fee_basis` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_funding_weight` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_channel_fee_max_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_channel_fee_max_proportional_thousandths` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_compact_lease` (type `hex`, sqltype `BLOB`, from JSON object `option_will_fund`)\n\n- `offers` indexed by `offer_id` (see lightning-listoffers(7))\n - `offer_id` (type `hash`, sqltype `BLOB`)\n - `active` (type `boolean`, sqltype `INTEGER`)\n - `single_use` (type `boolean`, sqltype `INTEGER`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `used` (type `boolean`, sqltype `INTEGER`)\n - `label` (type `string`, sqltype `TEXT`)\n\n- `peerchannels` indexed by `peer_id` (see lightning-listpeerchannels(7))\n - `peer_id` (type `pubkey`, sqltype `BLOB`)\n - `peer_connected` (type `boolean`, sqltype `INTEGER`)\n - `reestablished` (type `boolean`, sqltype `INTEGER`)\n - `state` (type `string`, sqltype `TEXT`)\n - `scratch_txid` (type `txid`, sqltype `BLOB`)\n - related table `peerchannels_channel_type_bits`, from JSON object `channel_type`\n - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `bits` (type `u32`, sqltype `INTEGER`)\n - related table `peerchannels_channel_type_names`, from JSON object `channel_type`\n - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `names` (type `string`, sqltype `TEXT`)\n - `local_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `local`)\n - `local_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `local`)\n - `remote_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `remote`)\n - `ignore_fee_limits` (type `boolean`, sqltype `INTEGER`)\n - `lost_state` (type `boolean`, sqltype `INTEGER`)\n - `feerate_perkw` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`)\n - `feerate_perkb` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`)\n - `owner` (type `string`, sqltype `TEXT`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `channel_id` (type `hash`, sqltype `BLOB`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `initial_feerate` (type `string`, sqltype `TEXT`)\n - `last_feerate` (type `string`, sqltype `TEXT`)\n - `next_feerate` (type `string`, sqltype `TEXT`)\n - `next_fee_step` (type `u32`, sqltype `INTEGER`)\n - related table `peerchannels_inflight`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `feerate` (type `string`, sqltype `TEXT`)\n - `total_funding_msat` (type `msat`, sqltype `INTEGER`)\n - `splice_amount` (type `integer`, sqltype `INTEGER`)\n - `our_funding_msat` (type `msat`, sqltype `INTEGER`)\n - `scratch_txid` (type `txid`, sqltype `BLOB`)\n - `close_to` (type `hex`, sqltype `BLOB`)\n - `private` (type `boolean`, sqltype `INTEGER`)\n - `opener` (type `string`, sqltype `TEXT`)\n - `closer` (type `string`, sqltype `TEXT`)\n - related table `peerchannels_features`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `features` (type `string`, sqltype `TEXT`)\n - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_local_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_remote_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `min_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `max_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `total_msat` (type `msat`, sqltype `INTEGER`)\n - `fee_base_msat` (type `msat`, sqltype `INTEGER`)\n - `fee_proportional_millionths` (type `u32`, sqltype `INTEGER`)\n - `dust_limit_msat` (type `msat`, sqltype `INTEGER`)\n - `max_total_htlc_in_msat` (type `msat`, sqltype `INTEGER`)\n - `their_reserve_msat` (type `msat`, sqltype `INTEGER`)\n - `our_reserve_msat` (type `msat`, sqltype `INTEGER`)\n - `spendable_msat` (type `msat`, sqltype `INTEGER`)\n - `receivable_msat` (type `msat`, sqltype `INTEGER`)\n - `minimum_htlc_in_msat` (type `msat`, sqltype `INTEGER`)\n - `minimum_htlc_out_msat` (type `msat`, sqltype `INTEGER`)\n - `maximum_htlc_out_msat` (type `msat`, sqltype `INTEGER`)\n - `their_to_self_delay` (type `u32`, sqltype `INTEGER`)\n - `our_to_self_delay` (type `u32`, sqltype `INTEGER`)\n - `max_accepted_htlcs` (type `u32`, sqltype `INTEGER`)\n - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - related table `peerchannels_state_changes`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `timestamp` (type `string`, sqltype `TEXT`)\n - `old_state` (type `string`, sqltype `TEXT`)\n - `new_state` (type `string`, sqltype `TEXT`)\n - `cause` (type `string`, sqltype `TEXT`)\n - `message` (type `string`, sqltype `TEXT`)\n - related table `peerchannels_status`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `in_payments_offered` (type `u64`, sqltype `INTEGER`)\n - `in_offered_msat` (type `msat`, sqltype `INTEGER`)\n - `in_payments_fulfilled` (type `u64`, sqltype `INTEGER`)\n - `in_fulfilled_msat` (type `msat`, sqltype `INTEGER`)\n - `out_payments_offered` (type `u64`, sqltype `INTEGER`)\n - `out_offered_msat` (type `msat`, sqltype `INTEGER`)\n - `out_payments_fulfilled` (type `u64`, sqltype `INTEGER`)\n - `out_fulfilled_msat` (type `msat`, sqltype `INTEGER`)\n - `last_stable_connection` (type `u64`, sqltype `INTEGER`)\n - related table `peerchannels_htlcs`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `direction` (type `string`, sqltype `TEXT`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `expiry` (type `u32`, sqltype `INTEGER`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `local_trimmed` (type `boolean`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `state` (type `string`, sqltype `TEXT`)\n - `close_to_addr` (type `string`, sqltype `TEXT`)\n - `last_tx_fee_msat` (type `msat`, sqltype `INTEGER`)\n - `direction` (type `u32`, sqltype `INTEGER`)\n\n- `peers` indexed by `id` (see lightning-listpeers(7))\n - `id` (type `pubkey`, sqltype `BLOB`)\n - `connected` (type `boolean`, sqltype `INTEGER`)\n - `num_channels` (type `u32`, sqltype `INTEGER`)\n - related table `peers_netaddr`\n - `row` (reference to `peers.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `netaddr` (type `string`, sqltype `TEXT`)\n - `remote_addr` (type `string`, sqltype `TEXT`)\n - `features` (type `hex`, sqltype `BLOB`)\n\n- `sendpays` indexed by `payment_hash` (see lightning-listsendpays(7))\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `groupid` (type `u64`, sqltype `INTEGER`)\n - `partid` (type `u64`, sqltype `INTEGER`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `destination` (type `pubkey`, sqltype `BLOB`)\n - `created_at` (type `u64`, sqltype `INTEGER`)\n - `amount_sent_msat` (type `msat`, sqltype `INTEGER`)\n - `label` (type `string`, sqltype `TEXT`)\n - `bolt11` (type `string`, sqltype `TEXT`)\n - `description` (type `string`, sqltype `TEXT`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `payment_preimage` (type `secret`, sqltype `BLOB`)\n - `erroronion` (type `hex`, sqltype `BLOB`)\n\n- `transactions` indexed by `hash` (see lightning-listtransactions(7))\n - `hash` (type `txid`, sqltype `BLOB`)\n - `rawtx` (type `hex`, sqltype `BLOB`)\n - `blockheight` (type `u32`, sqltype `INTEGER`)\n - `txindex` (type `u32`, sqltype `INTEGER`)\n - `locktime` (type `u32`, sqltype `INTEGER`)\n - `version` (type `u32`, sqltype `INTEGER`)\n - related table `transactions_inputs`\n - `row` (reference to `transactions.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`)\n - `sequence` (type `u32`, sqltype `INTEGER`)\n - related table `transactions_outputs`\n - `row` (reference to `transactions.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `scriptPubKey` (type `hex`, sqltype `BLOB`)" + "The following tables are currently supported:\n- `bkpr_accountevents` (see lightning-bkpr-listaccountevents(7))\n - `account` (type `string`, sqltype `TEXT`)\n - `type` (type `string`, sqltype `TEXT`)\n - `tag` (type `string`, sqltype `TEXT`)\n - `credit_msat` (type `msat`, sqltype `INTEGER`)\n - `debit_msat` (type `msat`, sqltype `INTEGER`)\n - `currency` (type `string`, sqltype `TEXT`)\n - `timestamp` (type `u32`, sqltype `INTEGER`)\n - `outpoint` (type `string`, sqltype `TEXT`)\n - `blockheight` (type `u32`, sqltype `INTEGER`)\n - `origin` (type `string`, sqltype `TEXT`)\n - `payment_id` (type `hex`, sqltype `BLOB`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `description` (type `string`, sqltype `TEXT`)\n - `fees_msat` (type `msat`, sqltype `INTEGER`)\n - `is_rebalance` (type `boolean`, sqltype `INTEGER`)\n - `part_id` (type `u32`, sqltype `INTEGER`)\n\n- `bkpr_income` (see lightning-bkpr-listincome(7))\n - `account` (type `string`, sqltype `TEXT`)\n - `tag` (type `string`, sqltype `TEXT`)\n - `credit_msat` (type `msat`, sqltype `INTEGER`)\n - `debit_msat` (type `msat`, sqltype `INTEGER`)\n - `currency` (type `string`, sqltype `TEXT`)\n - `timestamp` (type `u32`, sqltype `INTEGER`)\n - `description` (type `string`, sqltype `TEXT`)\n - `outpoint` (type `string`, sqltype `TEXT`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `payment_id` (type `hex`, sqltype `BLOB`)\n\n- `channels` indexed by `short_channel_id` (see lightning-listchannels(7))\n - `source` (type `pubkey`, sqltype `BLOB`)\n - `destination` (type `pubkey`, sqltype `BLOB`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `direction` (type `u32`, sqltype `INTEGER`)\n - `public` (type `boolean`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `message_flags` (type `u8`, sqltype `INTEGER`)\n - `channel_flags` (type `u8`, sqltype `INTEGER`)\n - `active` (type `boolean`, sqltype `INTEGER`)\n - `last_update` (type `u32`, sqltype `INTEGER`)\n - `base_fee_millisatoshi` (type `u32`, sqltype `INTEGER`)\n - `fee_per_millionth` (type `u32`, sqltype `INTEGER`)\n - `delay` (type `u32`, sqltype `INTEGER`)\n - `htlc_minimum_msat` (type `msat`, sqltype `INTEGER`)\n - `htlc_maximum_msat` (type `msat`, sqltype `INTEGER`)\n - `features` (type `hex`, sqltype `BLOB`)\n\n- `closedchannels` (see lightning-listclosedchannels(7))\n - `peer_id` (type `pubkey`, sqltype `BLOB`)\n - `channel_id` (type `hash`, sqltype `BLOB`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `opener` (type `string`, sqltype `TEXT`)\n - `closer` (type `string`, sqltype `TEXT`)\n - `private` (type `boolean`, sqltype `INTEGER`)\n - related table `closedchannels_channel_type_bits`, from JSON object `channel_type`\n - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `bits` (type `u32`, sqltype `INTEGER`)\n - related table `closedchannels_channel_type_names`, from JSON object `channel_type`\n - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `names` (type `string`, sqltype `TEXT`)\n - `total_local_commitments` (type `u64`, sqltype `INTEGER`)\n - `total_remote_commitments` (type `u64`, sqltype `INTEGER`)\n - `total_htlcs_sent` (type `u64`, sqltype `INTEGER`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `leased` (type `boolean`, sqltype `INTEGER`)\n - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`)\n - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`)\n - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`)\n - `total_msat` (type `msat`, sqltype `INTEGER`)\n - `final_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `min_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `max_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `last_commitment_txid` (type `hash`, sqltype `BLOB`)\n - `last_commitment_fee_msat` (type `msat`, sqltype `INTEGER`)\n - `close_cause` (type `string`, sqltype `TEXT`)\n - `last_stable_connection` (type `u64`, sqltype `INTEGER`)\n\n- `forwards` indexed by `in_channel and in_htlc_id` (see lightning-listforwards(7))\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `in_channel` (type `short_channel_id`, sqltype `TEXT`)\n - `in_htlc_id` (type `u64`, sqltype `INTEGER`)\n - `in_msat` (type `msat`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `received_time` (type `number`, sqltype `REAL`)\n - `out_channel` (type `short_channel_id`, sqltype `TEXT`)\n - `out_htlc_id` (type `u64`, sqltype `INTEGER`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `style` (type `string`, sqltype `TEXT`)\n - `fee_msat` (type `msat`, sqltype `INTEGER`)\n - `out_msat` (type `msat`, sqltype `INTEGER`)\n - `resolved_time` (type `number`, sqltype `REAL`)\n - `failcode` (type `u32`, sqltype `INTEGER`)\n - `failreason` (type `string`, sqltype `TEXT`)\n\n- `htlcs` indexed by `short_channel_id and id` (see lightning-listhtlcs(7))\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `expiry` (type `u32`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `direction` (type `string`, sqltype `TEXT`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `state` (type `string`, sqltype `TEXT`)\n\n- `invoices` indexed by `payment_hash` (see lightning-listinvoices(7))\n - `label` (type `string`, sqltype `TEXT`)\n - `description` (type `string`, sqltype `TEXT`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `status` (type `string`, sqltype `TEXT`)\n - `expires_at` (type `u64`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `bolt11` (type `string`, sqltype `TEXT`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `local_offer_id` (type `hash`, sqltype `BLOB`)\n - `invreq_payer_note` (type `string`, sqltype `TEXT`)\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `pay_index` (type `u64`, sqltype `INTEGER`)\n - `amount_received_msat` (type `msat`, sqltype `INTEGER`)\n - `paid_at` (type `u64`, sqltype `INTEGER`)\n - `paid_outpoint_txid` (type `txid`, sqltype `BLOB`, from JSON object `paid_outpoint`)\n - `paid_outpoint_outnum` (type `u32`, sqltype `INTEGER`, from JSON object `paid_outpoint`)\n - `payment_preimage` (type `secret`, sqltype `BLOB`)\n\n- `nodes` indexed by `nodeid` (see lightning-listnodes(7))\n - `nodeid` (type `pubkey`, sqltype `BLOB`)\n - `last_timestamp` (type `u32`, sqltype `INTEGER`)\n - `alias` (type `string`, sqltype `TEXT`)\n - `color` (type `hex`, sqltype `BLOB`)\n - `features` (type `hex`, sqltype `BLOB`)\n - related table `nodes_addresses`\n - `row` (reference to `nodes.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `type` (type `string`, sqltype `TEXT`)\n - `port` (type `u16`, sqltype `INTEGER`)\n - `address` (type `string`, sqltype `TEXT`)\n - `option_will_fund_lease_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_lease_fee_basis` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_funding_weight` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_channel_fee_max_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_channel_fee_max_proportional_thousandths` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_compact_lease` (type `hex`, sqltype `BLOB`, from JSON object `option_will_fund`)\n\n- `offers` indexed by `offer_id` (see lightning-listoffers(7))\n - `offer_id` (type `hash`, sqltype `BLOB`)\n - `active` (type `boolean`, sqltype `INTEGER`)\n - `single_use` (type `boolean`, sqltype `INTEGER`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `used` (type `boolean`, sqltype `INTEGER`)\n - `label` (type `string`, sqltype `TEXT`)\n\n- `peerchannels` indexed by `peer_id` (see lightning-listpeerchannels(7))\n - `peer_id` (type `pubkey`, sqltype `BLOB`)\n - `peer_connected` (type `boolean`, sqltype `INTEGER`)\n - `reestablished` (type `boolean`, sqltype `INTEGER`)\n - `state` (type `string`, sqltype `TEXT`)\n - `scratch_txid` (type `txid`, sqltype `BLOB`)\n - related table `peerchannels_channel_type_bits`, from JSON object `channel_type`\n - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `bits` (type `u32`, sqltype `INTEGER`)\n - related table `peerchannels_channel_type_names`, from JSON object `channel_type`\n - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `names` (type `string`, sqltype `TEXT`)\n - `local_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `local`)\n - `local_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `local`)\n - `remote_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `remote`)\n - `ignore_fee_limits` (type `boolean`, sqltype `INTEGER`)\n - `lost_state` (type `boolean`, sqltype `INTEGER`)\n - `feerate_perkw` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`)\n - `feerate_perkb` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`)\n - `owner` (type `string`, sqltype `TEXT`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `channel_id` (type `hash`, sqltype `BLOB`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `initial_feerate` (type `string`, sqltype `TEXT`)\n - `last_feerate` (type `string`, sqltype `TEXT`)\n - `next_feerate` (type `string`, sqltype `TEXT`)\n - `next_fee_step` (type `u32`, sqltype `INTEGER`)\n - related table `peerchannels_inflight`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `feerate` (type `string`, sqltype `TEXT`)\n - `total_funding_msat` (type `msat`, sqltype `INTEGER`)\n - `splice_amount` (type `integer`, sqltype `INTEGER`)\n - `our_funding_msat` (type `msat`, sqltype `INTEGER`)\n - `scratch_txid` (type `txid`, sqltype `BLOB`)\n - `close_to` (type `hex`, sqltype `BLOB`)\n - `private` (type `boolean`, sqltype `INTEGER`)\n - `opener` (type `string`, sqltype `TEXT`)\n - `closer` (type `string`, sqltype `TEXT`)\n - related table `peerchannels_features`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `features` (type `string`, sqltype `TEXT`)\n - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_local_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_remote_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `min_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `max_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `total_msat` (type `msat`, sqltype `INTEGER`)\n - `fee_base_msat` (type `msat`, sqltype `INTEGER`)\n - `fee_proportional_millionths` (type `u32`, sqltype `INTEGER`)\n - `dust_limit_msat` (type `msat`, sqltype `INTEGER`)\n - `max_total_htlc_in_msat` (type `msat`, sqltype `INTEGER`)\n - `their_reserve_msat` (type `msat`, sqltype `INTEGER`)\n - `our_reserve_msat` (type `msat`, sqltype `INTEGER`)\n - `spendable_msat` (type `msat`, sqltype `INTEGER`)\n - `receivable_msat` (type `msat`, sqltype `INTEGER`)\n - `minimum_htlc_in_msat` (type `msat`, sqltype `INTEGER`)\n - `minimum_htlc_out_msat` (type `msat`, sqltype `INTEGER`)\n - `maximum_htlc_out_msat` (type `msat`, sqltype `INTEGER`)\n - `their_to_self_delay` (type `u32`, sqltype `INTEGER`)\n - `our_to_self_delay` (type `u32`, sqltype `INTEGER`)\n - `max_accepted_htlcs` (type `u32`, sqltype `INTEGER`)\n - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - related table `peerchannels_state_changes`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `timestamp` (type `string`, sqltype `TEXT`)\n - `old_state` (type `string`, sqltype `TEXT`)\n - `new_state` (type `string`, sqltype `TEXT`)\n - `cause` (type `string`, sqltype `TEXT`)\n - `message` (type `string`, sqltype `TEXT`)\n - related table `peerchannels_status`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `in_payments_offered` (type `u64`, sqltype `INTEGER`)\n - `in_offered_msat` (type `msat`, sqltype `INTEGER`)\n - `in_payments_fulfilled` (type `u64`, sqltype `INTEGER`)\n - `in_fulfilled_msat` (type `msat`, sqltype `INTEGER`)\n - `out_payments_offered` (type `u64`, sqltype `INTEGER`)\n - `out_offered_msat` (type `msat`, sqltype `INTEGER`)\n - `out_payments_fulfilled` (type `u64`, sqltype `INTEGER`)\n - `out_fulfilled_msat` (type `msat`, sqltype `INTEGER`)\n - `last_stable_connection` (type `u64`, sqltype `INTEGER`)\n - related table `peerchannels_htlcs`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `direction` (type `string`, sqltype `TEXT`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `expiry` (type `u32`, sqltype `INTEGER`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `local_trimmed` (type `boolean`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `state` (type `string`, sqltype `TEXT`)\n - `close_to_addr` (type `string`, sqltype `TEXT`)\n - `last_tx_fee_msat` (type `msat`, sqltype `INTEGER`)\n - `direction` (type `u32`, sqltype `INTEGER`)\n\n- `peers` indexed by `id` (see lightning-listpeers(7))\n - `id` (type `pubkey`, sqltype `BLOB`)\n - `connected` (type `boolean`, sqltype `INTEGER`)\n - `num_channels` (type `u32`, sqltype `INTEGER`)\n - related table `peers_netaddr`\n - `row` (reference to `peers.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `netaddr` (type `string`, sqltype `TEXT`)\n - `remote_addr` (type `string`, sqltype `TEXT`)\n - `features` (type `hex`, sqltype `BLOB`)\n\n- `sendpays` indexed by `payment_hash` (see lightning-listsendpays(7))\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `groupid` (type `u64`, sqltype `INTEGER`)\n - `partid` (type `u64`, sqltype `INTEGER`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `destination` (type `pubkey`, sqltype `BLOB`)\n - `created_at` (type `u64`, sqltype `INTEGER`)\n - `amount_sent_msat` (type `msat`, sqltype `INTEGER`)\n - `label` (type `string`, sqltype `TEXT`)\n - `bolt11` (type `string`, sqltype `TEXT`)\n - `description` (type `string`, sqltype `TEXT`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `completed_at` (type `u64`, sqltype `INTEGER`)\n - `payment_preimage` (type `secret`, sqltype `BLOB`)\n - `erroronion` (type `hex`, sqltype `BLOB`)\n\n- `transactions` indexed by `hash` (see lightning-listtransactions(7))\n - `hash` (type `txid`, sqltype `BLOB`)\n - `rawtx` (type `hex`, sqltype `BLOB`)\n - `blockheight` (type `u32`, sqltype `INTEGER`)\n - `txindex` (type `u32`, sqltype `INTEGER`)\n - `locktime` (type `u32`, sqltype `INTEGER`)\n - `version` (type `u32`, sqltype `INTEGER`)\n - related table `transactions_inputs`\n - `row` (reference to `transactions.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`)\n - `sequence` (type `u32`, sqltype `INTEGER`)\n - related table `transactions_outputs`\n - `row` (reference to `transactions.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `scriptPubKey` (type `hex`, sqltype `BLOB`)" ], "errors": [ "On failure, an error is returned." diff --git a/contrib/msggen/msggen/utils/utils.py b/contrib/msggen/msggen/utils/utils.py index f02bd4f90cd7..484e51c7fa1a 100644 --- a/contrib/msggen/msggen/utils/utils.py +++ b/contrib/msggen/msggen/utils/utils.py @@ -39,10 +39,9 @@ def load_jsonrpc_method(name): """Load a method based on the file naming conventions for the JSON-RPC. """ schema = get_schema_bundle() - req_file = f"{name.lower()}.request.json" - resp_file = f"{name.lower()}.schema.json" - request = CompositeField.from_js(schema[req_file], path=name) - response = CompositeField.from_js(schema[resp_file], path=name) + rpc_name = f"lightning-{name.lower()}.json" + request = CompositeField.from_js(schema[rpc_name]['request'], path=name) + response = CompositeField.from_js(schema[rpc_name]['response'], path=name) # Normalize the method request and response typename so they no # longer conflict. diff --git a/contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py b/contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py index 4d34f426420f..56fef2ed5e48 100644 --- a/contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py +++ b/contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py @@ -14,7 +14,7 @@ from pyln.grpc import primitives_pb2 as primitives__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\nnode.proto\x12\x03\x63ln\x1a\x10primitives.proto\"\x10\n\x0eGetinfoRequest\"\xc1\x04\n\x0fGetinfoResponse\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x12\n\x05\x61lias\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\r\n\x05\x63olor\x18\x03 \x01(\x0c\x12\x11\n\tnum_peers\x18\x04 \x01(\r\x12\x1c\n\x14num_pending_channels\x18\x05 \x01(\r\x12\x1b\n\x13num_active_channels\x18\x06 \x01(\r\x12\x1d\n\x15num_inactive_channels\x18\x07 \x01(\r\x12\x0f\n\x07version\x18\x08 \x01(\t\x12\x15\n\rlightning_dir\x18\t \x01(\t\x12\x33\n\x0cour_features\x18\n \x01(\x0b\x32\x18.cln.GetinfoOur_featuresH\x01\x88\x01\x01\x12\x13\n\x0b\x62lockheight\x18\x0b \x01(\r\x12\x0f\n\x07network\x18\x0c \x01(\t\x12(\n\x13\x66\x65\x65s_collected_msat\x18\r \x01(\x0b\x32\x0b.cln.Amount\x12$\n\x07\x61\x64\x64ress\x18\x0e \x03(\x0b\x32\x13.cln.GetinfoAddress\x12$\n\x07\x62inding\x18\x0f \x03(\x0b\x32\x13.cln.GetinfoBinding\x12\"\n\x15warning_bitcoind_sync\x18\x10 \x01(\tH\x02\x88\x01\x01\x12$\n\x17warning_lightningd_sync\x18\x11 \x01(\tH\x03\x88\x01\x01\x42\x08\n\x06_aliasB\x0f\n\r_our_featuresB\x18\n\x16_warning_bitcoind_syncB\x1a\n\x18_warning_lightningd_sync\"S\n\x13GetinfoOur_features\x12\x0c\n\x04init\x18\x01 \x01(\x0c\x12\x0c\n\x04node\x18\x02 \x01(\x0c\x12\x0f\n\x07\x63hannel\x18\x03 \x01(\x0c\x12\x0f\n\x07invoice\x18\x04 \x01(\x0c\"\xc4\x01\n\x0eGetinfoAddress\x12\x39\n\titem_type\x18\x01 \x01(\x0e\x32&.cln.GetinfoAddress.GetinfoAddressType\x12\x0c\n\x04port\x18\x02 \x01(\r\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x00\x88\x01\x01\"G\n\x12GetinfoAddressType\x12\x07\n\x03\x44NS\x10\x00\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\n\n\x08_address\"\x8a\x02\n\x0eGetinfoBinding\x12\x39\n\titem_type\x18\x01 \x01(\x0e\x32&.cln.GetinfoBinding.GetinfoBindingType\x12\x14\n\x07\x61\x64\x64ress\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04port\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x13\n\x06socket\x18\x04 \x01(\tH\x02\x88\x01\x01\"_\n\x12GetinfoBindingType\x12\x10\n\x0cLOCAL_SOCKET\x10\x00\x12\r\n\tWEBSOCKET\x10\x05\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\n\n\x08_addressB\x07\n\x05_portB\t\n\x07_socket\"\xaa\x01\n\x10ListpeersRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x38\n\x05level\x18\x02 \x01(\x0e\x32$.cln.ListpeersRequest.ListpeersLevelH\x01\x88\x01\x01\":\n\x0eListpeersLevel\x12\x06\n\x02IO\x10\x00\x12\t\n\x05\x44\x45\x42UG\x10\x01\x12\x08\n\x04INFO\x10\x02\x12\x0b\n\x07UNUSUAL\x10\x03\x42\x05\n\x03_idB\x08\n\x06_level\"7\n\x11ListpeersResponse\x12\"\n\x05peers\x18\x01 \x03(\x0b\x32\x13.cln.ListpeersPeers\"\x8e\x02\n\x0eListpeersPeers\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x11\n\tconnected\x18\x02 \x01(\x08\x12\x19\n\x0cnum_channels\x18\x08 \x01(\rH\x00\x88\x01\x01\x12#\n\x03log\x18\x03 \x03(\x0b\x32\x16.cln.ListpeersPeersLog\x12-\n\x08\x63hannels\x18\x04 \x03(\x0b\x32\x1b.cln.ListpeersPeersChannels\x12\x0f\n\x07netaddr\x18\x05 \x03(\t\x12\x18\n\x0bremote_addr\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x15\n\x08\x66\x65\x61tures\x18\x06 \x01(\x0cH\x02\x88\x01\x01\x42\x0f\n\r_num_channelsB\x0e\n\x0c_remote_addrB\x0b\n\t_features\"\xfd\x02\n\x11ListpeersPeersLog\x12?\n\titem_type\x18\x01 \x01(\x0e\x32,.cln.ListpeersPeersLog.ListpeersPeersLogType\x12\x18\n\x0bnum_skipped\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x11\n\x04time\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06source\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x10\n\x03log\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x14\n\x07node_id\x18\x06 \x01(\x0cH\x04\x88\x01\x01\x12\x11\n\x04\x64\x61ta\x18\x07 \x01(\x0cH\x05\x88\x01\x01\"i\n\x15ListpeersPeersLogType\x12\x0b\n\x07SKIPPED\x10\x00\x12\n\n\x06\x42ROKEN\x10\x01\x12\x0b\n\x07UNUSUAL\x10\x02\x12\x08\n\x04INFO\x10\x03\x12\t\n\x05\x44\x45\x42UG\x10\x04\x12\t\n\x05IO_IN\x10\x05\x12\n\n\x06IO_OUT\x10\x06\x42\x0e\n\x0c_num_skippedB\x07\n\x05_timeB\t\n\x07_sourceB\x06\n\x04_logB\n\n\x08_node_idB\x07\n\x05_data\"\x95\x18\n\x16ListpeersPeersChannels\x12\x46\n\x05state\x18\x01 \x01(\x0e\x32\x37.cln.ListpeersPeersChannels.ListpeersPeersChannelsState\x12\x19\n\x0cscratch_txid\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x38\n\x07\x66\x65\x65rate\x18\x03 \x01(\x0b\x32\".cln.ListpeersPeersChannelsFeerateH\x01\x88\x01\x01\x12\x12\n\x05owner\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x1d\n\x10short_channel_id\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x17\n\nchannel_id\x18\x06 \x01(\x0cH\x04\x88\x01\x01\x12\x19\n\x0c\x66unding_txid\x18\x07 \x01(\x0cH\x05\x88\x01\x01\x12\x1b\n\x0e\x66unding_outnum\x18\x08 \x01(\rH\x06\x88\x01\x01\x12\x1c\n\x0finitial_feerate\x18\t \x01(\tH\x07\x88\x01\x01\x12\x19\n\x0clast_feerate\x18\n \x01(\tH\x08\x88\x01\x01\x12\x19\n\x0cnext_feerate\x18\x0b \x01(\tH\t\x88\x01\x01\x12\x1a\n\rnext_fee_step\x18\x0c \x01(\rH\n\x88\x01\x01\x12\x35\n\x08inflight\x18\r \x03(\x0b\x32#.cln.ListpeersPeersChannelsInflight\x12\x15\n\x08\x63lose_to\x18\x0e \x01(\x0cH\x0b\x88\x01\x01\x12\x14\n\x07private\x18\x0f \x01(\x08H\x0c\x88\x01\x01\x12 \n\x06opener\x18\x10 \x01(\x0e\x32\x10.cln.ChannelSide\x12%\n\x06\x63loser\x18\x11 \x01(\x0e\x32\x10.cln.ChannelSideH\r\x88\x01\x01\x12\x10\n\x08\x66\x65\x61tures\x18\x12 \x03(\t\x12\x38\n\x07\x66unding\x18\x13 \x01(\x0b\x32\".cln.ListpeersPeersChannelsFundingH\x0e\x88\x01\x01\x12$\n\nto_us_msat\x18\x14 \x01(\x0b\x32\x0b.cln.AmountH\x0f\x88\x01\x01\x12(\n\x0emin_to_us_msat\x18\x15 \x01(\x0b\x32\x0b.cln.AmountH\x10\x88\x01\x01\x12(\n\x0emax_to_us_msat\x18\x16 \x01(\x0b\x32\x0b.cln.AmountH\x11\x88\x01\x01\x12$\n\ntotal_msat\x18\x17 \x01(\x0b\x32\x0b.cln.AmountH\x12\x88\x01\x01\x12\'\n\rfee_base_msat\x18\x18 \x01(\x0b\x32\x0b.cln.AmountH\x13\x88\x01\x01\x12(\n\x1b\x66\x65\x65_proportional_millionths\x18\x19 \x01(\rH\x14\x88\x01\x01\x12)\n\x0f\x64ust_limit_msat\x18\x1a \x01(\x0b\x32\x0b.cln.AmountH\x15\x88\x01\x01\x12\x30\n\x16max_total_htlc_in_msat\x18\x1b \x01(\x0b\x32\x0b.cln.AmountH\x16\x88\x01\x01\x12,\n\x12their_reserve_msat\x18\x1c \x01(\x0b\x32\x0b.cln.AmountH\x17\x88\x01\x01\x12*\n\x10our_reserve_msat\x18\x1d \x01(\x0b\x32\x0b.cln.AmountH\x18\x88\x01\x01\x12(\n\x0espendable_msat\x18\x1e \x01(\x0b\x32\x0b.cln.AmountH\x19\x88\x01\x01\x12)\n\x0freceivable_msat\x18\x1f \x01(\x0b\x32\x0b.cln.AmountH\x1a\x88\x01\x01\x12.\n\x14minimum_htlc_in_msat\x18 \x01(\x0b\x32\x0b.cln.AmountH\x1b\x88\x01\x01\x12/\n\x15minimum_htlc_out_msat\x18\x30 \x01(\x0b\x32\x0b.cln.AmountH\x1c\x88\x01\x01\x12/\n\x15maximum_htlc_out_msat\x18\x31 \x01(\x0b\x32\x0b.cln.AmountH\x1d\x88\x01\x01\x12 \n\x13their_to_self_delay\x18! \x01(\rH\x1e\x88\x01\x01\x12\x1e\n\x11our_to_self_delay\x18\" \x01(\rH\x1f\x88\x01\x01\x12\x1f\n\x12max_accepted_htlcs\x18# \x01(\rH \x88\x01\x01\x12\x34\n\x05\x61lias\x18\x32 \x01(\x0b\x32 .cln.ListpeersPeersChannelsAliasH!\x88\x01\x01\x12\x0e\n\x06status\x18% \x03(\t\x12 \n\x13in_payments_offered\x18& \x01(\x04H\"\x88\x01\x01\x12)\n\x0fin_offered_msat\x18\' \x01(\x0b\x32\x0b.cln.AmountH#\x88\x01\x01\x12\"\n\x15in_payments_fulfilled\x18( \x01(\x04H$\x88\x01\x01\x12+\n\x11in_fulfilled_msat\x18) \x01(\x0b\x32\x0b.cln.AmountH%\x88\x01\x01\x12!\n\x14out_payments_offered\x18* \x01(\x04H&\x88\x01\x01\x12*\n\x10out_offered_msat\x18+ \x01(\x0b\x32\x0b.cln.AmountH\'\x88\x01\x01\x12#\n\x16out_payments_fulfilled\x18, \x01(\x04H(\x88\x01\x01\x12,\n\x12out_fulfilled_msat\x18- \x01(\x0b\x32\x0b.cln.AmountH)\x88\x01\x01\x12/\n\x05htlcs\x18. \x03(\x0b\x32 .cln.ListpeersPeersChannelsHtlcs\x12\x1a\n\rclose_to_addr\x18/ \x01(\tH*\x88\x01\x01\"\xe0\x02\n\x1bListpeersPeersChannelsState\x12\x0c\n\x08OPENINGD\x10\x00\x12\x1c\n\x18\x43HANNELD_AWAITING_LOCKIN\x10\x01\x12\x13\n\x0f\x43HANNELD_NORMAL\x10\x02\x12\x1a\n\x16\x43HANNELD_SHUTTING_DOWN\x10\x03\x12\x18\n\x14\x43LOSINGD_SIGEXCHANGE\x10\x04\x12\x15\n\x11\x43LOSINGD_COMPLETE\x10\x05\x12\x17\n\x13\x41WAITING_UNILATERAL\x10\x06\x12\x16\n\x12\x46UNDING_SPEND_SEEN\x10\x07\x12\x0b\n\x07ONCHAIN\x10\x08\x12\x17\n\x13\x44UALOPEND_OPEN_INIT\x10\t\x12\x1d\n\x19\x44UALOPEND_AWAITING_LOCKIN\x10\n\x12\x1c\n\x18\x44UALOPEND_OPEN_COMMITTED\x10\x0b\x12\x1f\n\x1b\x44UALOPEND_OPEN_COMMIT_READY\x10\x0c\x42\x0f\n\r_scratch_txidB\n\n\x08_feerateB\x08\n\x06_ownerB\x13\n\x11_short_channel_idB\r\n\x0b_channel_idB\x0f\n\r_funding_txidB\x11\n\x0f_funding_outnumB\x12\n\x10_initial_feerateB\x0f\n\r_last_feerateB\x0f\n\r_next_feerateB\x10\n\x0e_next_fee_stepB\x0b\n\t_close_toB\n\n\x08_privateB\t\n\x07_closerB\n\n\x08_fundingB\r\n\x0b_to_us_msatB\x11\n\x0f_min_to_us_msatB\x11\n\x0f_max_to_us_msatB\r\n\x0b_total_msatB\x10\n\x0e_fee_base_msatB\x1e\n\x1c_fee_proportional_millionthsB\x12\n\x10_dust_limit_msatB\x19\n\x17_max_total_htlc_in_msatB\x15\n\x13_their_reserve_msatB\x13\n\x11_our_reserve_msatB\x11\n\x0f_spendable_msatB\x12\n\x10_receivable_msatB\x17\n\x15_minimum_htlc_in_msatB\x18\n\x16_minimum_htlc_out_msatB\x18\n\x16_maximum_htlc_out_msatB\x16\n\x14_their_to_self_delayB\x14\n\x12_our_to_self_delayB\x15\n\x13_max_accepted_htlcsB\x08\n\x06_aliasB\x16\n\x14_in_payments_offeredB\x12\n\x10_in_offered_msatB\x18\n\x16_in_payments_fulfilledB\x14\n\x12_in_fulfilled_msatB\x17\n\x15_out_payments_offeredB\x13\n\x11_out_offered_msatB\x19\n\x17_out_payments_fulfilledB\x15\n\x13_out_fulfilled_msatB\x10\n\x0e_close_to_addr\"=\n\x1dListpeersPeersChannelsFeerate\x12\r\n\x05perkw\x18\x01 \x01(\r\x12\r\n\x05perkb\x18\x02 \x01(\r\"\xf3\x01\n\x1eListpeersPeersChannelsInflight\x12\x14\n\x0c\x66unding_txid\x18\x01 \x01(\x0c\x12\x16\n\x0e\x66unding_outnum\x18\x02 \x01(\r\x12\x0f\n\x07\x66\x65\x65rate\x18\x03 \x01(\t\x12\'\n\x12total_funding_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10our_funding_msat\x18\x05 \x01(\x0b\x32\x0b.cln.Amount\x12\x1a\n\rsplice_amount\x18\x07 \x01(\x12H\x00\x88\x01\x01\x12\x14\n\x0cscratch_txid\x18\x06 \x01(\x0c\x42\x10\n\x0e_splice_amount\"\x9b\x02\n\x1dListpeersPeersChannelsFunding\x12%\n\x0bpushed_msat\x18\x03 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12%\n\x10local_funds_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12&\n\x11remote_funds_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\'\n\rfee_paid_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\'\n\rfee_rcvd_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x42\x0e\n\x0c_pushed_msatB\x10\n\x0e_fee_paid_msatB\x10\n\x0e_fee_rcvd_msat\"[\n\x1bListpeersPeersChannelsAlias\x12\x12\n\x05local\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06remote\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_localB\t\n\x07_remote\"\xf1\x02\n\x1bListpeersPeersChannelsHtlcs\x12X\n\tdirection\x18\x01 \x01(\x0e\x32\x45.cln.ListpeersPeersChannelsHtlcs.ListpeersPeersChannelsHtlcsDirection\x12\n\n\x02id\x18\x02 \x01(\x04\x12 \n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x0e\n\x06\x65xpiry\x18\x04 \x01(\r\x12\x14\n\x0cpayment_hash\x18\x05 \x01(\x0c\x12\x1a\n\rlocal_trimmed\x18\x06 \x01(\x08H\x00\x88\x01\x01\x12\x13\n\x06status\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x1d\n\x05state\x18\x08 \x01(\x0e\x32\x0e.cln.HtlcState\"7\n$ListpeersPeersChannelsHtlcsDirection\x12\x06\n\x02IN\x10\x00\x12\x07\n\x03OUT\x10\x01\x42\x10\n\x0e_local_trimmedB\t\n\x07_status\"0\n\x10ListfundsRequest\x12\x12\n\x05spent\x18\x01 \x01(\x08H\x00\x88\x01\x01\x42\x08\n\x06_spent\"e\n\x11ListfundsResponse\x12&\n\x07outputs\x18\x01 \x03(\x0b\x32\x15.cln.ListfundsOutputs\x12(\n\x08\x63hannels\x18\x02 \x03(\x0b\x32\x16.cln.ListfundsChannels\"\x83\x03\n\x10ListfundsOutputs\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x0e\n\x06output\x18\x02 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x14\n\x0cscriptpubkey\x18\x04 \x01(\x0c\x12\x14\n\x07\x61\x64\x64ress\x18\x05 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0credeemscript\x18\x06 \x01(\x0cH\x01\x88\x01\x01\x12<\n\x06status\x18\x07 \x01(\x0e\x32,.cln.ListfundsOutputs.ListfundsOutputsStatus\x12\x10\n\x08reserved\x18\t \x01(\x08\x12\x18\n\x0b\x62lockheight\x18\x08 \x01(\rH\x02\x88\x01\x01\"Q\n\x16ListfundsOutputsStatus\x12\x0f\n\x0bUNCONFIRMED\x10\x00\x12\r\n\tCONFIRMED\x10\x01\x12\t\n\x05SPENT\x10\x02\x12\x0c\n\x08IMMATURE\x10\x03\x42\n\n\x08_addressB\x0f\n\r_redeemscriptB\x0e\n\x0c_blockheight\"\xab\x02\n\x11ListfundsChannels\x12\x0f\n\x07peer_id\x18\x01 \x01(\x0c\x12$\n\x0four_amount_msat\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\x12 \n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x14\n\x0c\x66unding_txid\x18\x04 \x01(\x0c\x12\x16\n\x0e\x66unding_output\x18\x05 \x01(\r\x12\x11\n\tconnected\x18\x06 \x01(\x08\x12 \n\x05state\x18\x07 \x01(\x0e\x32\x11.cln.ChannelState\x12\x17\n\nchannel_id\x18\t \x01(\x0cH\x00\x88\x01\x01\x12\x1d\n\x10short_channel_id\x18\x08 \x01(\tH\x01\x88\x01\x01\x42\r\n\x0b_channel_idB\x13\n\x11_short_channel_id\"\xbb\x03\n\x0eSendpayRequest\x12 \n\x05route\x18\x01 \x03(\x0b\x32\x11.cln.SendpayRoute\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\x0c\x12\x12\n\x05label\x18\x03 \x01(\tH\x00\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x1b\n\x0epayment_secret\x18\x06 \x01(\x0cH\x03\x88\x01\x01\x12\x13\n\x06partid\x18\x07 \x01(\x04H\x04\x88\x01\x01\x12\x1a\n\rlocalinvreqid\x18\x0b \x01(\x0cH\x05\x88\x01\x01\x12\x14\n\x07groupid\x18\t \x01(\x04H\x06\x88\x01\x01\x12\x1d\n\x10payment_metadata\x18\x0c \x01(\x0cH\x07\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\r \x01(\tH\x08\x88\x01\x01\x42\x08\n\x06_labelB\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\x11\n\x0f_payment_secretB\t\n\x07_partidB\x10\n\x0e_localinvreqidB\n\n\x08_groupidB\x13\n\x11_payment_metadataB\x0e\n\x0c_description\"\xad\x05\n\x0fSendpayResponse\x12\x1a\n\rcreated_index\x18\x10 \x01(\x04H\x00\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x11 \x01(\x04H\x01\x88\x01\x01\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x14\n\x07groupid\x18\x02 \x01(\x04H\x02\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x32\n\x06status\x18\x04 \x01(\x0e\x32\".cln.SendpayResponse.SendpayStatus\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x06 \x01(\x0cH\x04\x88\x01\x01\x12\x12\n\ncreated_at\x18\x07 \x01(\x04\x12\x19\n\x0c\x63ompleted_at\x18\x0f \x01(\x04H\x05\x88\x01\x01\x12%\n\x10\x61mount_sent_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\t \x01(\tH\x06\x88\x01\x01\x12\x13\n\x06partid\x18\n \x01(\x04H\x07\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x0b \x01(\tH\x08\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x0c \x01(\tH\t\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\r \x01(\x0cH\n\x88\x01\x01\x12\x14\n\x07message\x18\x0e \x01(\tH\x0b\x88\x01\x01\"*\n\rSendpayStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x42\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\n\n\x08_groupidB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x0f\n\r_completed_atB\x08\n\x06_labelB\t\n\x07_partidB\t\n\x07_bolt11B\t\n\x07_bolt12B\x13\n\x11_payment_preimageB\n\n\x08_message\"\\\n\x0cSendpayRoute\x12\n\n\x02id\x18\x02 \x01(\x0c\x12\x0f\n\x07\x63hannel\x18\x04 \x01(\t\x12\r\n\x05\x64\x65lay\x18\x03 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.Amount\"\x93\x01\n\x13ListchannelsRequest\x12\x1d\n\x10short_channel_id\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06source\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x03 \x01(\x0cH\x02\x88\x01\x01\x42\x13\n\x11_short_channel_idB\t\n\x07_sourceB\x0e\n\x0c_destination\"C\n\x14ListchannelsResponse\x12+\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x19.cln.ListchannelsChannels\"\xb3\x03\n\x14ListchannelsChannels\x12\x0e\n\x06source\x18\x01 \x01(\x0c\x12\x13\n\x0b\x64\x65stination\x18\x02 \x01(\x0c\x12\x18\n\x10short_channel_id\x18\x03 \x01(\t\x12\x11\n\tdirection\x18\x10 \x01(\r\x12\x0e\n\x06public\x18\x04 \x01(\x08\x12 \n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.Amount\x12\x15\n\rmessage_flags\x18\x06 \x01(\r\x12\x15\n\rchannel_flags\x18\x07 \x01(\r\x12\x0e\n\x06\x61\x63tive\x18\x08 \x01(\x08\x12\x13\n\x0blast_update\x18\t \x01(\r\x12\x1d\n\x15\x62\x61se_fee_millisatoshi\x18\n \x01(\r\x12\x19\n\x11\x66\x65\x65_per_millionth\x18\x0b \x01(\r\x12\r\n\x05\x64\x65lay\x18\x0c \x01(\r\x12&\n\x11htlc_minimum_msat\x18\r \x01(\x0b\x32\x0b.cln.Amount\x12+\n\x11htlc_maximum_msat\x18\x0e \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x10\n\x08\x66\x65\x61tures\x18\x0f \x01(\x0c\x42\x14\n\x12_htlc_maximum_msat\"#\n\x10\x41\x64\x64gossipRequest\x12\x0f\n\x07message\x18\x01 \x01(\x0c\"\x13\n\x11\x41\x64\x64gossipResponse\"o\n\x17\x41utocleaninvoiceRequest\x12\x17\n\nexpired_by\x18\x01 \x01(\x04H\x00\x88\x01\x01\x12\x1a\n\rcycle_seconds\x18\x02 \x01(\x04H\x01\x88\x01\x01\x42\r\n\x0b_expired_byB\x10\n\x0e_cycle_seconds\"\x81\x01\n\x18\x41utocleaninvoiceResponse\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\x17\n\nexpired_by\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x1a\n\rcycle_seconds\x18\x03 \x01(\x04H\x01\x88\x01\x01\x42\r\n\x0b_expired_byB\x10\n\x0e_cycle_seconds\"U\n\x13\x43heckmessageRequest\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\r\n\x05zbase\x18\x02 \x01(\t\x12\x13\n\x06pubkey\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x42\t\n\x07_pubkey\"8\n\x14\x43heckmessageResponse\x12\x10\n\x08verified\x18\x01 \x01(\x08\x12\x0e\n\x06pubkey\x18\x02 \x01(\x0c\"\xcb\x02\n\x0c\x43loseRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x1e\n\x11unilateraltimeout\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x03 \x01(\tH\x01\x88\x01\x01\x12!\n\x14\x66\x65\x65_negotiation_step\x18\x04 \x01(\tH\x02\x88\x01\x01\x12)\n\rwrong_funding\x18\x05 \x01(\x0b\x32\r.cln.OutpointH\x03\x88\x01\x01\x12\x1f\n\x12\x66orce_lease_closed\x18\x06 \x01(\x08H\x04\x88\x01\x01\x12\x1e\n\x08\x66\x65\x65range\x18\x07 \x03(\x0b\x32\x0c.cln.FeerateB\x14\n\x12_unilateraltimeoutB\x0e\n\x0c_destinationB\x17\n\x15_fee_negotiation_stepB\x10\n\x0e_wrong_fundingB\x15\n\x13_force_lease_closed\"\xab\x01\n\rCloseResponse\x12/\n\titem_type\x18\x01 \x01(\x0e\x32\x1c.cln.CloseResponse.CloseType\x12\x0f\n\x02tx\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x11\n\x04txid\x18\x03 \x01(\x0cH\x01\x88\x01\x01\"5\n\tCloseType\x12\n\n\x06MUTUAL\x10\x00\x12\x0e\n\nUNILATERAL\x10\x01\x12\x0c\n\x08UNOPENED\x10\x02\x42\x05\n\x03_txB\x07\n\x05_txid\"T\n\x0e\x43onnectRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\x04host\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04port\x18\x03 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_hostB\x07\n\x05_port\"\xb4\x01\n\x0f\x43onnectResponse\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x10\n\x08\x66\x65\x61tures\x18\x02 \x01(\x0c\x12\x38\n\tdirection\x18\x03 \x01(\x0e\x32%.cln.ConnectResponse.ConnectDirection\x12$\n\x07\x61\x64\x64ress\x18\x04 \x01(\x0b\x32\x13.cln.ConnectAddress\"#\n\x10\x43onnectDirection\x12\x06\n\x02IN\x10\x00\x12\x07\n\x03OUT\x10\x01\"\xfb\x01\n\x0e\x43onnectAddress\x12\x39\n\titem_type\x18\x01 \x01(\x0e\x32&.cln.ConnectAddress.ConnectAddressType\x12\x13\n\x06socket\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x11\n\x04port\x18\x04 \x01(\rH\x02\x88\x01\x01\"P\n\x12\x43onnectAddressType\x12\x10\n\x0cLOCAL_SOCKET\x10\x00\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\t\n\x07_socketB\n\n\x08_addressB\x07\n\x05_port\";\n\x14\x43reateinvoiceRequest\x12\x11\n\tinvstring\x18\x01 \x01(\t\x12\x10\n\x08preimage\x18\x03 \x01(\x0c\"\xfe\x05\n\x15\x43reateinvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x06\x62olt11\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x04 \x01(\x0c\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12>\n\x06status\x18\x06 \x01(\x0e\x32..cln.CreateinvoiceResponse.CreateinvoiceStatus\x12\x13\n\x0b\x64\x65scription\x18\x07 \x01(\t\x12\x12\n\nexpires_at\x18\x08 \x01(\x04\x12\x1a\n\rcreated_index\x18\x10 \x01(\x04H\x03\x88\x01\x01\x12\x16\n\tpay_index\x18\t \x01(\x04H\x04\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x05\x88\x01\x01\x12\x14\n\x07paid_at\x18\x0b \x01(\x04H\x06\x88\x01\x01\x12;\n\rpaid_outpoint\x18\x11 \x01(\x0b\x32\x1f.cln.CreateinvoicePaid_outpointH\x07\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\x08\x88\x01\x01\x12\x1b\n\x0elocal_offer_id\x18\r \x01(\x0cH\t\x88\x01\x01\x12\x1e\n\x11invreq_payer_note\x18\x0f \x01(\tH\n\x88\x01\x01\"8\n\x13\x43reateinvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x12\n\n\x06UNPAID\x10\x02\x42\t\n\x07_bolt11B\t\n\x07_bolt12B\x0e\n\x0c_amount_msatB\x10\n\x0e_created_indexB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x10\n\x0e_paid_outpointB\x13\n\x11_payment_preimageB\x11\n\x0f_local_offer_idB\x14\n\x12_invreq_payer_note\"X\n\x1a\x43reateinvoicePaid_outpoint\x12\x11\n\x04txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x13\n\x06outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_txidB\t\n\x07_outnum\"\xb4\x02\n\x10\x44\x61tastoreRequest\x12\x0b\n\x03key\x18\x05 \x03(\t\x12\x13\n\x06string\x18\x06 \x01(\tH\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12\x36\n\x04mode\x18\x03 \x01(\x0e\x32#.cln.DatastoreRequest.DatastoreModeH\x02\x88\x01\x01\x12\x17\n\ngeneration\x18\x04 \x01(\x04H\x03\x88\x01\x01\"p\n\rDatastoreMode\x12\x0f\n\x0bMUST_CREATE\x10\x00\x12\x10\n\x0cMUST_REPLACE\x10\x01\x12\x15\n\x11\x43REATE_OR_REPLACE\x10\x02\x12\x0f\n\x0bMUST_APPEND\x10\x03\x12\x14\n\x10\x43REATE_OR_APPEND\x10\x04\x42\t\n\x07_stringB\x06\n\x04_hexB\x07\n\x05_modeB\r\n\x0b_generation\"\x82\x01\n\x11\x44\x61tastoreResponse\x12\x0b\n\x03key\x18\x05 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x12\x13\n\x06string\x18\x04 \x01(\tH\x02\x88\x01\x01\x42\r\n\x0b_generationB\x06\n\x04_hexB\t\n\x07_string\"\x17\n\x15\x44\x61tastoreusageRequest\"k\n\x16\x44\x61tastoreusageResponse\x12>\n\x0e\x64\x61tastoreusage\x18\x01 \x01(\x0b\x32!.cln.DatastoreusageDatastoreusageH\x00\x88\x01\x01\x42\x11\n\x0f_datastoreusage\"b\n\x1c\x44\x61tastoreusageDatastoreusage\x12\x10\n\x03key\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x18\n\x0btotal_bytes\x18\x02 \x01(\x04H\x01\x88\x01\x01\x42\x06\n\x04_keyB\x0e\n\x0c_total_bytes\"\x9d\x01\n\x12\x43reateonionRequest\x12\"\n\x04hops\x18\x01 \x03(\x0b\x32\x14.cln.CreateonionHops\x12\x11\n\tassocdata\x18\x02 \x01(\x0c\x12\x18\n\x0bsession_key\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x12\x17\n\nonion_size\x18\x04 \x01(\rH\x01\x88\x01\x01\x42\x0e\n\x0c_session_keyB\r\n\x0b_onion_size\"<\n\x13\x43reateonionResponse\x12\r\n\x05onion\x18\x01 \x01(\x0c\x12\x16\n\x0eshared_secrets\x18\x02 \x03(\x0c\"2\n\x0f\x43reateonionHops\x12\x0e\n\x06pubkey\x18\x01 \x01(\x0c\x12\x0f\n\x07payload\x18\x02 \x01(\x0c\"J\n\x13\x44\x65ldatastoreRequest\x12\x0b\n\x03key\x18\x03 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\r\n\x0b_generation\"\x85\x01\n\x14\x44\x65ldatastoreResponse\x12\x0b\n\x03key\x18\x05 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x12\x13\n\x06string\x18\x04 \x01(\tH\x02\x88\x01\x01\x42\r\n\x0b_generationB\x06\n\x04_hexB\t\n\x07_string\"H\n\x18\x44\x65lexpiredinvoiceRequest\x12\x1a\n\rmaxexpirytime\x18\x01 \x01(\x04H\x00\x88\x01\x01\x42\x10\n\x0e_maxexpirytime\"\x1b\n\x19\x44\x65lexpiredinvoiceResponse\"\xb6\x01\n\x11\x44\x65linvoiceRequest\x12\r\n\x05label\x18\x01 \x01(\t\x12\x37\n\x06status\x18\x02 \x01(\x0e\x32\'.cln.DelinvoiceRequest.DelinvoiceStatus\x12\x15\n\x08\x64\x65sconly\x18\x03 \x01(\x08H\x00\x88\x01\x01\"5\n\x10\x44\x65linvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x12\n\n\x06UNPAID\x10\x02\x42\x0b\n\t_desconly\"\xa1\x04\n\x12\x44\x65linvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x06\x62olt11\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x03 \x01(\tH\x01\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x06 \x01(\x0c\x12\x1a\n\rcreated_index\x18\x0c \x01(\x04H\x04\x88\x01\x01\x12\x1a\n\rupdated_index\x18\r \x01(\x04H\x05\x88\x01\x01\x12\x38\n\x06status\x18\x07 \x01(\x0e\x32(.cln.DelinvoiceResponse.DelinvoiceStatus\x12\x12\n\nexpires_at\x18\x08 \x01(\x04\x12\x1b\n\x0elocal_offer_id\x18\t \x01(\x0cH\x06\x88\x01\x01\x12\x1e\n\x11invreq_payer_note\x18\x0b \x01(\tH\x07\x88\x01\x01\"5\n\x10\x44\x65linvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x12\n\n\x06UNPAID\x10\x02\x42\t\n\x07_bolt11B\t\n\x07_bolt12B\x0e\n\x0c_amount_msatB\x0e\n\x0c_descriptionB\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\x11\n\x0f_local_offer_idB\x14\n\x12_invreq_payer_note\"\xfa\x01\n\x0eInvoiceRequest\x12%\n\x0b\x61mount_msat\x18\n \x01(\x0b\x32\x10.cln.AmountOrAny\x12\r\n\x05label\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x13\n\x06\x65xpiry\x18\x07 \x01(\x04H\x00\x88\x01\x01\x12\x11\n\tfallbacks\x18\x04 \x03(\t\x12\x15\n\x08preimage\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x11\n\x04\x63ltv\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x19\n\x0c\x64\x65schashonly\x18\t \x01(\x08H\x03\x88\x01\x01\x42\t\n\x07_expiryB\x0b\n\t_preimageB\x07\n\x05_cltvB\x0f\n\r_deschashonly\"\x95\x03\n\x0fInvoiceResponse\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\x0c\x12\x16\n\x0epayment_secret\x18\x03 \x01(\x0c\x12\x12\n\nexpires_at\x18\x04 \x01(\x04\x12\x1a\n\rcreated_index\x18\n \x01(\x04H\x00\x88\x01\x01\x12\x1d\n\x10warning_capacity\x18\x05 \x01(\tH\x01\x88\x01\x01\x12\x1c\n\x0fwarning_offline\x18\x06 \x01(\tH\x02\x88\x01\x01\x12\x1d\n\x10warning_deadends\x18\x07 \x01(\tH\x03\x88\x01\x01\x12#\n\x16warning_private_unused\x18\x08 \x01(\tH\x04\x88\x01\x01\x12\x18\n\x0bwarning_mpp\x18\t \x01(\tH\x05\x88\x01\x01\x42\x10\n\x0e_created_indexB\x13\n\x11_warning_capacityB\x12\n\x10_warning_offlineB\x13\n\x11_warning_deadendsB\x19\n\x17_warning_private_unusedB\x0e\n\x0c_warning_mpp\"#\n\x14ListdatastoreRequest\x12\x0b\n\x03key\x18\x02 \x03(\t\"G\n\x15ListdatastoreResponse\x12.\n\tdatastore\x18\x01 \x03(\x0b\x32\x1b.cln.ListdatastoreDatastore\"\x87\x01\n\x16ListdatastoreDatastore\x12\x0b\n\x03key\x18\x01 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x12\x13\n\x06string\x18\x04 \x01(\tH\x02\x88\x01\x01\x42\r\n\x0b_generationB\x06\n\x04_hexB\t\n\x07_string\"\xde\x02\n\x13ListinvoicesRequest\x12\x12\n\x05label\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x16\n\tinvstring\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x03 \x01(\x0cH\x02\x88\x01\x01\x12\x15\n\x08offer_id\x18\x04 \x01(\tH\x03\x88\x01\x01\x12>\n\x05index\x18\x05 \x01(\x0e\x32*.cln.ListinvoicesRequest.ListinvoicesIndexH\x04\x88\x01\x01\x12\x12\n\x05start\x18\x06 \x01(\x04H\x05\x88\x01\x01\x12\x12\n\x05limit\x18\x07 \x01(\rH\x06\x88\x01\x01\"-\n\x11ListinvoicesIndex\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07UPDATED\x10\x01\x42\x08\n\x06_labelB\x0c\n\n_invstringB\x0f\n\r_payment_hashB\x0b\n\t_offer_idB\x08\n\x06_indexB\x08\n\x06_startB\x08\n\x06_limit\"C\n\x14ListinvoicesResponse\x12+\n\x08invoices\x18\x01 \x03(\x0b\x32\x19.cln.ListinvoicesInvoices\"\xd4\x06\n\x14ListinvoicesInvoices\x12\r\n\x05label\x18\x01 \x01(\t\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x44\n\x06status\x18\x04 \x01(\x0e\x32\x34.cln.ListinvoicesInvoices.ListinvoicesInvoicesStatus\x12\x12\n\nexpires_at\x18\x05 \x01(\x04\x12%\n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x08 \x01(\tH\x03\x88\x01\x01\x12\x1b\n\x0elocal_offer_id\x18\t \x01(\x0cH\x04\x88\x01\x01\x12\x1e\n\x11invreq_payer_note\x18\x0f \x01(\tH\x05\x88\x01\x01\x12\x1a\n\rcreated_index\x18\x10 \x01(\x04H\x06\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x11 \x01(\x04H\x07\x88\x01\x01\x12\x16\n\tpay_index\x18\x0b \x01(\x04H\x08\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\x0c \x01(\x0b\x32\x0b.cln.AmountH\t\x88\x01\x01\x12\x14\n\x07paid_at\x18\r \x01(\x04H\n\x88\x01\x01\x12\x42\n\rpaid_outpoint\x18\x12 \x01(\x0b\x32&.cln.ListinvoicesInvoicesPaid_outpointH\x0b\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0e \x01(\x0cH\x0c\x88\x01\x01\"?\n\x1aListinvoicesInvoicesStatus\x12\n\n\x06UNPAID\x10\x00\x12\x08\n\x04PAID\x10\x01\x12\x0b\n\x07\x45XPIRED\x10\x02\x42\x0e\n\x0c_descriptionB\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\t\n\x07_bolt12B\x11\n\x0f_local_offer_idB\x14\n\x12_invreq_payer_noteB\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x10\n\x0e_paid_outpointB\x13\n\x11_payment_preimage\"_\n!ListinvoicesInvoicesPaid_outpoint\x12\x11\n\x04txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x13\n\x06outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_txidB\t\n\x07_outnum\"\xb4\x03\n\x10SendonionRequest\x12\r\n\x05onion\x18\x01 \x01(\x0c\x12*\n\tfirst_hop\x18\x02 \x01(\x0b\x32\x17.cln.SendonionFirst_hop\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x12\n\x05label\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x16\n\x0eshared_secrets\x18\x05 \x03(\x0c\x12\x13\n\x06partid\x18\x06 \x01(\rH\x01\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x02\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x0c \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\t \x01(\x0cH\x04\x88\x01\x01\x12\x1a\n\rlocalinvreqid\x18\r \x01(\x0cH\x05\x88\x01\x01\x12\x14\n\x07groupid\x18\x0b \x01(\x04H\x06\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x0e \x01(\tH\x07\x88\x01\x01\x42\x08\n\x06_labelB\t\n\x07_partidB\t\n\x07_bolt11B\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x10\n\x0e_localinvreqidB\n\n\x08_groupidB\x0e\n\x0c_description\"\xe7\x04\n\x11SendonionResponse\x12\x1a\n\rcreated_index\x18\x0e \x01(\x04H\x00\x88\x01\x01\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\x0c\x12\x36\n\x06status\x18\x03 \x01(\x0e\x32&.cln.SendonionResponse.SendonionStatus\x12%\n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x05 \x01(\x0cH\x02\x88\x01\x01\x12\x12\n\ncreated_at\x18\x06 \x01(\x04\x12%\n\x10\x61mount_sent_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\x08 \x01(\tH\x03\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\t \x01(\tH\x04\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\n \x01(\tH\x05\x88\x01\x01\x12\x13\n\x06partid\x18\r \x01(\x04H\x06\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x0f \x01(\x04H\x07\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0b \x01(\x0cH\x08\x88\x01\x01\x12\x14\n\x07message\x18\x0c \x01(\tH\t\x88\x01\x01\",\n\x0fSendonionStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x42\x10\n\x0e_created_indexB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x08\n\x06_labelB\t\n\x07_bolt11B\t\n\x07_bolt12B\t\n\x07_partidB\x10\n\x0e_updated_indexB\x13\n\x11_payment_preimageB\n\n\x08_message\"Q\n\x12SendonionFirst_hop\x12\n\n\x02id\x18\x01 \x01(\x0c\x12 \n\x0b\x61mount_msat\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\x12\r\n\x05\x64\x65lay\x18\x03 \x01(\r\"\xa0\x03\n\x13ListsendpaysRequest\x12\x13\n\x06\x62olt11\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12@\n\x06status\x18\x03 \x01(\x0e\x32+.cln.ListsendpaysRequest.ListsendpaysStatusH\x02\x88\x01\x01\x12>\n\x05index\x18\x04 \x01(\x0e\x32*.cln.ListsendpaysRequest.ListsendpaysIndexH\x03\x88\x01\x01\x12\x12\n\x05start\x18\x05 \x01(\x04H\x04\x88\x01\x01\x12\x12\n\x05limit\x18\x06 \x01(\rH\x05\x88\x01\x01\";\n\x12ListsendpaysStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\"-\n\x11ListsendpaysIndex\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07UPDATED\x10\x01\x42\t\n\x07_bolt11B\x0f\n\r_payment_hashB\t\n\x07_statusB\x08\n\x06_indexB\x08\n\x06_startB\x08\n\x06_limit\"C\n\x14ListsendpaysResponse\x12+\n\x08payments\x18\x01 \x03(\x0b\x32\x19.cln.ListsendpaysPayments\"\xd0\x05\n\x14ListsendpaysPayments\x12\x1a\n\rcreated_index\x18\x10 \x01(\x04H\x00\x88\x01\x01\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x0f\n\x07groupid\x18\x02 \x01(\x04\x12\x13\n\x06partid\x18\x0f \x01(\x04H\x01\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x1a\n\rupdated_index\x18\x11 \x01(\x04H\x02\x88\x01\x01\x12\x44\n\x06status\x18\x04 \x01(\x0e\x32\x34.cln.ListsendpaysPayments.ListsendpaysPaymentsStatus\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x06 \x01(\x0cH\x04\x88\x01\x01\x12\x12\n\ncreated_at\x18\x07 \x01(\x04\x12%\n\x10\x61mount_sent_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\t \x01(\tH\x05\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\n \x01(\tH\x06\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x0e \x01(\tH\x07\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x0b \x01(\tH\x08\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\t\x88\x01\x01\x12\x17\n\nerroronion\x18\r \x01(\x0cH\n\x88\x01\x01\"C\n\x1aListsendpaysPaymentsStatus\x12\x0b\n\x07PENDING\x10\x00\x12\n\n\x06\x46\x41ILED\x10\x01\x12\x0c\n\x08\x43OMPLETE\x10\x02\x42\x10\n\x0e_created_indexB\t\n\x07_partidB\x10\n\x0e_updated_indexB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x08\n\x06_labelB\t\n\x07_bolt11B\x0e\n\x0c_descriptionB\t\n\x07_bolt12B\x13\n\x11_payment_preimageB\r\n\x0b_erroronion\"\x19\n\x17ListtransactionsRequest\"S\n\x18ListtransactionsResponse\x12\x37\n\x0ctransactions\x18\x01 \x03(\x0b\x32!.cln.ListtransactionsTransactions\"\xf8\x01\n\x1cListtransactionsTransactions\x12\x0c\n\x04hash\x18\x01 \x01(\x0c\x12\r\n\x05rawtx\x18\x02 \x01(\x0c\x12\x13\n\x0b\x62lockheight\x18\x03 \x01(\r\x12\x0f\n\x07txindex\x18\x04 \x01(\r\x12\x10\n\x08locktime\x18\x07 \x01(\r\x12\x0f\n\x07version\x18\x08 \x01(\r\x12\x37\n\x06inputs\x18\t \x03(\x0b\x32\'.cln.ListtransactionsTransactionsInputs\x12\x39\n\x07outputs\x18\n \x03(\x0b\x32(.cln.ListtransactionsTransactionsOutputs\"S\n\"ListtransactionsTransactionsInputs\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\r\n\x05index\x18\x02 \x01(\r\x12\x10\n\x08sequence\x18\x03 \x01(\r\"l\n#ListtransactionsTransactionsOutputs\x12\r\n\x05index\x18\x01 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12\x14\n\x0cscriptPubKey\x18\x03 \x01(\x0c\"\xda\x03\n\nPayRequest\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\x12%\n\x0b\x61mount_msat\x18\r \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x12\n\x05label\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x17\n\nriskfactor\x18\x08 \x01(\x01H\x02\x88\x01\x01\x12\x1a\n\rmaxfeepercent\x18\x04 \x01(\x01H\x03\x88\x01\x01\x12\x16\n\tretry_for\x18\x05 \x01(\rH\x04\x88\x01\x01\x12\x15\n\x08maxdelay\x18\x06 \x01(\rH\x05\x88\x01\x01\x12#\n\texemptfee\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x1a\n\rlocalinvreqid\x18\x0e \x01(\x0cH\x07\x88\x01\x01\x12\x0f\n\x07\x65xclude\x18\n \x03(\t\x12 \n\x06maxfee\x18\x0b \x01(\x0b\x32\x0b.cln.AmountH\x08\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x0c \x01(\tH\t\x88\x01\x01\x42\x0e\n\x0c_amount_msatB\x08\n\x06_labelB\r\n\x0b_riskfactorB\x10\n\x0e_maxfeepercentB\x0c\n\n_retry_forB\x0b\n\t_maxdelayB\x0c\n\n_exemptfeeB\x10\n\x0e_localinvreqidB\t\n\x07_maxfeeB\x0e\n\x0c_description\"\xfb\x02\n\x0bPayResponse\x12\x18\n\x10payment_preimage\x18\x01 \x01(\x0c\x12\x18\n\x0b\x64\x65stination\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x12\n\ncreated_at\x18\x04 \x01(\x01\x12\r\n\x05parts\x18\x05 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10\x61mount_sent_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\'\n\x1awarning_partial_completion\x18\x08 \x01(\tH\x01\x88\x01\x01\x12*\n\x06status\x18\t \x01(\x0e\x32\x1a.cln.PayResponse.PayStatus\"2\n\tPayStatus\x12\x0c\n\x08\x43OMPLETE\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x42\x0e\n\x0c_destinationB\x1d\n\x1b_warning_partial_completion\"*\n\x10ListnodesRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x05\n\x03_id\"7\n\x11ListnodesResponse\x12\"\n\x05nodes\x18\x01 \x03(\x0b\x32\x13.cln.ListnodesNodes\"\xe1\x01\n\x0eListnodesNodes\x12\x0e\n\x06nodeid\x18\x01 \x01(\x0c\x12\x1b\n\x0elast_timestamp\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x12\n\x05\x61lias\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x12\n\x05\x63olor\x18\x04 \x01(\x0cH\x02\x88\x01\x01\x12\x15\n\x08\x66\x65\x61tures\x18\x05 \x01(\x0cH\x03\x88\x01\x01\x12/\n\taddresses\x18\x06 \x03(\x0b\x32\x1c.cln.ListnodesNodesAddressesB\x11\n\x0f_last_timestampB\x08\n\x06_aliasB\x08\n\x06_colorB\x0b\n\t_features\"\xe8\x01\n\x17ListnodesNodesAddresses\x12K\n\titem_type\x18\x01 \x01(\x0e\x32\x38.cln.ListnodesNodesAddresses.ListnodesNodesAddressesType\x12\x0c\n\x04port\x18\x02 \x01(\r\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x00\x88\x01\x01\"P\n\x1bListnodesNodesAddressesType\x12\x07\n\x03\x44NS\x10\x00\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\n\n\x08_address\"g\n\x15WaitanyinvoiceRequest\x12\x1a\n\rlastpay_index\x18\x01 \x01(\x04H\x00\x88\x01\x01\x12\x14\n\x07timeout\x18\x02 \x01(\x04H\x01\x88\x01\x01\x42\x10\n\x0e_lastpay_indexB\n\n\x08_timeout\"\xbf\x05\n\x16WaitanyinvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12@\n\x06status\x18\x04 \x01(\x0e\x32\x30.cln.WaitanyinvoiceResponse.WaitanyinvoiceStatus\x12\x12\n\nexpires_at\x18\x05 \x01(\x04\x12%\n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x08 \x01(\tH\x02\x88\x01\x01\x12\x1a\n\rcreated_index\x18\r \x01(\x04H\x03\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x0e \x01(\x04H\x04\x88\x01\x01\x12\x16\n\tpay_index\x18\t \x01(\x04H\x05\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x14\n\x07paid_at\x18\x0b \x01(\x04H\x07\x88\x01\x01\x12<\n\rpaid_outpoint\x18\x0f \x01(\x0b\x32 .cln.WaitanyinvoicePaid_outpointH\x08\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\t\x88\x01\x01\"-\n\x14WaitanyinvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x42\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\t\n\x07_bolt12B\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x10\n\x0e_paid_outpointB\x13\n\x11_payment_preimage\"Y\n\x1bWaitanyinvoicePaid_outpoint\x12\x11\n\x04txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x13\n\x06outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_txidB\t\n\x07_outnum\"\x14\n\x12WaitinvoiceRequest\"\xb0\x05\n\x13WaitinvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12:\n\x06status\x18\x04 \x01(\x0e\x32*.cln.WaitinvoiceResponse.WaitinvoiceStatus\x12\x12\n\nexpires_at\x18\x05 \x01(\x04\x12%\n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x08 \x01(\tH\x02\x88\x01\x01\x12\x1a\n\rcreated_index\x18\r \x01(\x04H\x03\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x0e \x01(\x04H\x04\x88\x01\x01\x12\x16\n\tpay_index\x18\t \x01(\x04H\x05\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x14\n\x07paid_at\x18\x0b \x01(\x04H\x07\x88\x01\x01\x12\x39\n\rpaid_outpoint\x18\x0f \x01(\x0b\x32\x1d.cln.WaitinvoicePaid_outpointH\x08\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\t\x88\x01\x01\"*\n\x11WaitinvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x42\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\t\n\x07_bolt12B\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x10\n\x0e_paid_outpointB\x13\n\x11_payment_preimage\"V\n\x18WaitinvoicePaid_outpoint\x12\x11\n\x04txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x13\n\x06outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_txidB\t\n\x07_outnum\"\x8e\x01\n\x12WaitsendpayRequest\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x14\n\x07timeout\x18\x03 \x01(\rH\x00\x88\x01\x01\x12\x13\n\x06partid\x18\x02 \x01(\x04H\x01\x88\x01\x01\x12\x14\n\x07groupid\x18\x04 \x01(\x04H\x02\x88\x01\x01\x42\n\n\x08_timeoutB\t\n\x07_partidB\n\n\x08_groupid\"\x8e\x05\n\x13WaitsendpayResponse\x12\x1a\n\rcreated_index\x18\x0f \x01(\x04H\x00\x88\x01\x01\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x14\n\x07groupid\x18\x02 \x01(\x04H\x01\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12:\n\x06status\x18\x04 \x01(\x0e\x32*.cln.WaitsendpayResponse.WaitsendpayStatus\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x06 \x01(\x0cH\x03\x88\x01\x01\x12\x12\n\ncreated_at\x18\x07 \x01(\x04\x12\x1a\n\rupdated_index\x18\x10 \x01(\x04H\x04\x88\x01\x01\x12\x19\n\x0c\x63ompleted_at\x18\x0e \x01(\x01H\x05\x88\x01\x01\x12%\n\x10\x61mount_sent_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\t \x01(\tH\x06\x88\x01\x01\x12\x13\n\x06partid\x18\n \x01(\x04H\x07\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x0b \x01(\tH\x08\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x0c \x01(\tH\t\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\r \x01(\x0cH\n\x88\x01\x01\"!\n\x11WaitsendpayStatus\x12\x0c\n\x08\x43OMPLETE\x10\x00\x42\x10\n\x0e_created_indexB\n\n\x08_groupidB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x10\n\x0e_updated_indexB\x0f\n\r_completed_atB\x08\n\x06_labelB\t\n\x07_partidB\t\n\x07_bolt11B\t\n\x07_bolt12B\x13\n\x11_payment_preimage\"\x97\x01\n\x0eNewaddrRequest\x12@\n\x0b\x61\x64\x64resstype\x18\x01 \x01(\x0e\x32&.cln.NewaddrRequest.NewaddrAddresstypeH\x00\x88\x01\x01\"3\n\x12NewaddrAddresstype\x12\n\n\x06\x42\x45\x43H32\x10\x00\x12\x08\n\x04P2TR\x10\x03\x12\x07\n\x03\x41LL\x10\x02\x42\x0e\n\x0c_addresstype\"M\n\x0fNewaddrResponse\x12\x11\n\x04p2tr\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06\x62\x65\x63h32\x18\x01 \x01(\tH\x01\x88\x01\x01\x42\x07\n\x05_p2trB\t\n\x07_bech32\"\xb9\x01\n\x0fWithdrawRequest\x12\x13\n\x0b\x64\x65stination\x18\x01 \x01(\t\x12!\n\x07satoshi\x18\x02 \x01(\x0b\x32\x10.cln.AmountOrAll\x12\"\n\x07\x66\x65\x65rate\x18\x05 \x01(\x0b\x32\x0c.cln.FeerateH\x00\x88\x01\x01\x12\x14\n\x07minconf\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x1c\n\x05utxos\x18\x04 \x03(\x0b\x32\r.cln.OutpointB\n\n\x08_feerateB\n\n\x08_minconf\":\n\x10WithdrawResponse\x12\n\n\x02tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\x12\x0c\n\x04psbt\x18\x03 \x01(\t\"\x82\x03\n\x0eKeysendRequest\x12\x13\n\x0b\x64\x65stination\x18\x01 \x01(\x0c\x12 \n\x0b\x61mount_msat\x18\n \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x1a\n\rmaxfeepercent\x18\x04 \x01(\x01H\x01\x88\x01\x01\x12\x16\n\tretry_for\x18\x05 \x01(\rH\x02\x88\x01\x01\x12\x15\n\x08maxdelay\x18\x06 \x01(\rH\x03\x88\x01\x01\x12#\n\texemptfee\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x12+\n\nroutehints\x18\x08 \x01(\x0b\x32\x12.cln.RoutehintListH\x05\x88\x01\x01\x12&\n\textratlvs\x18\t \x01(\x0b\x32\x0e.cln.TlvStreamH\x06\x88\x01\x01\x42\x08\n\x06_labelB\x10\n\x0e_maxfeepercentB\x0c\n\n_retry_forB\x0b\n\t_maxdelayB\x0c\n\n_exemptfeeB\r\n\x0b_routehintsB\x0c\n\n_extratlvs\"\xf2\x02\n\x0fKeysendResponse\x12\x18\n\x10payment_preimage\x18\x01 \x01(\x0c\x12\x18\n\x0b\x64\x65stination\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x12\n\ncreated_at\x18\x04 \x01(\x01\x12\r\n\x05parts\x18\x05 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10\x61mount_sent_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\'\n\x1awarning_partial_completion\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\x32\n\x06status\x18\t \x01(\x0e\x32\".cln.KeysendResponse.KeysendStatus\"\x1d\n\rKeysendStatus\x12\x0c\n\x08\x43OMPLETE\x10\x00\x42\x0e\n\x0c_destinationB\x1d\n\x1b_warning_partial_completion\"\xa4\x03\n\x0f\x46undpsbtRequest\x12!\n\x07satoshi\x18\x01 \x01(\x0b\x32\x10.cln.AmountOrAll\x12\x1d\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.Feerate\x12\x13\n\x0bstartweight\x18\x03 \x01(\r\x12\x14\n\x07minconf\x18\x04 \x01(\rH\x00\x88\x01\x01\x12\x14\n\x07reserve\x18\x05 \x01(\rH\x01\x88\x01\x01\x12\x15\n\x08locktime\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x1f\n\x12min_witness_weight\x18\x07 \x01(\rH\x03\x88\x01\x01\x12\x1d\n\x10\x65xcess_as_change\x18\x08 \x01(\x08H\x04\x88\x01\x01\x12\x17\n\nnonwrapped\x18\t \x01(\x08H\x05\x88\x01\x01\x12#\n\x16opening_anchor_channel\x18\n \x01(\x08H\x06\x88\x01\x01\x42\n\n\x08_minconfB\n\n\x08_reserveB\x0b\n\t_locktimeB\x15\n\x13_min_witness_weightB\x13\n\x11_excess_as_changeB\r\n\x0b_nonwrappedB\x19\n\x17_opening_anchor_channel\"\xd9\x01\n\x10\x46undpsbtResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x16\n\x0e\x66\x65\x65rate_per_kw\x18\x02 \x01(\r\x12\x1e\n\x16\x65stimated_final_weight\x18\x03 \x01(\r\x12 \n\x0b\x65xcess_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\x1a\n\rchange_outnum\x18\x05 \x01(\rH\x00\x88\x01\x01\x12/\n\x0creservations\x18\x06 \x03(\x0b\x32\x19.cln.FundpsbtReservationsB\x10\n\x0e_change_outnum\"u\n\x14\x46undpsbtReservations\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x0c\n\x04vout\x18\x02 \x01(\r\x12\x14\n\x0cwas_reserved\x18\x03 \x01(\x08\x12\x10\n\x08reserved\x18\x04 \x01(\x08\x12\x19\n\x11reserved_to_block\x18\x05 \x01(\r\"A\n\x0fSendpsbtRequest\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x14\n\x07reserve\x18\x02 \x01(\rH\x00\x88\x01\x01\x42\n\n\x08_reserve\",\n\x10SendpsbtResponse\x12\n\n\x02tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\"1\n\x0fSignpsbtRequest\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x10\n\x08signonly\x18\x02 \x03(\r\"\'\n\x10SignpsbtResponse\x12\x13\n\x0bsigned_psbt\x18\x01 \x01(\t\"\xa0\x03\n\x0fUtxopsbtRequest\x12!\n\x07satoshi\x18\x01 \x01(\x0b\x32\x10.cln.AmountOrAll\x12\x1d\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.Feerate\x12\x13\n\x0bstartweight\x18\x03 \x01(\r\x12\x1c\n\x05utxos\x18\x04 \x03(\x0b\x32\r.cln.Outpoint\x12\x14\n\x07reserve\x18\x05 \x01(\rH\x00\x88\x01\x01\x12\x17\n\nreservedok\x18\x08 \x01(\x08H\x01\x88\x01\x01\x12\x15\n\x08locktime\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x1f\n\x12min_witness_weight\x18\x07 \x01(\rH\x03\x88\x01\x01\x12\x1d\n\x10\x65xcess_as_change\x18\t \x01(\x08H\x04\x88\x01\x01\x12#\n\x16opening_anchor_channel\x18\n \x01(\x08H\x05\x88\x01\x01\x42\n\n\x08_reserveB\r\n\x0b_reservedokB\x0b\n\t_locktimeB\x15\n\x13_min_witness_weightB\x13\n\x11_excess_as_changeB\x19\n\x17_opening_anchor_channel\"\xd9\x01\n\x10UtxopsbtResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x16\n\x0e\x66\x65\x65rate_per_kw\x18\x02 \x01(\r\x12\x1e\n\x16\x65stimated_final_weight\x18\x03 \x01(\r\x12 \n\x0b\x65xcess_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\x1a\n\rchange_outnum\x18\x05 \x01(\rH\x00\x88\x01\x01\x12/\n\x0creservations\x18\x06 \x03(\x0b\x32\x19.cln.UtxopsbtReservationsB\x10\n\x0e_change_outnum\"u\n\x14UtxopsbtReservations\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x0c\n\x04vout\x18\x02 \x01(\r\x12\x14\n\x0cwas_reserved\x18\x03 \x01(\x08\x12\x10\n\x08reserved\x18\x04 \x01(\x08\x12\x19\n\x11reserved_to_block\x18\x05 \x01(\r\" \n\x10TxdiscardRequest\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\"6\n\x11TxdiscardResponse\x12\x13\n\x0bunsigned_tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\"\xa4\x01\n\x10TxprepareRequest\x12 \n\x07outputs\x18\x05 \x03(\x0b\x32\x0f.cln.OutputDesc\x12\"\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.FeerateH\x00\x88\x01\x01\x12\x14\n\x07minconf\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x1c\n\x05utxos\x18\x04 \x03(\x0b\x32\r.cln.OutpointB\n\n\x08_feerateB\n\n\x08_minconf\"D\n\x11TxprepareResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x13\n\x0bunsigned_tx\x18\x02 \x01(\x0c\x12\x0c\n\x04txid\x18\x03 \x01(\x0c\"\x1d\n\rTxsendRequest\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\"8\n\x0eTxsendResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\n\n\x02tx\x18\x02 \x01(\x0c\x12\x0c\n\x04txid\x18\x03 \x01(\x0c\"1\n\x17ListpeerchannelsRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x05\n\x03_id\"K\n\x18ListpeerchannelsResponse\x12/\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x1d.cln.ListpeerchannelsChannels\"\x8a\x1b\n\x18ListpeerchannelsChannels\x12\x14\n\x07peer_id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x1b\n\x0epeer_connected\x18\x02 \x01(\x08H\x01\x88\x01\x01\x12O\n\x05state\x18\x03 \x01(\x0e\x32;.cln.ListpeerchannelsChannels.ListpeerchannelsChannelsStateH\x02\x88\x01\x01\x12\x19\n\x0cscratch_txid\x18\x04 \x01(\x0cH\x03\x88\x01\x01\x12:\n\x07updates\x18\x37 \x01(\x0b\x32$.cln.ListpeerchannelsChannelsUpdatesH\x04\x88\x01\x01\x12\x1e\n\x11ignore_fee_limits\x18\x36 \x01(\x08H\x05\x88\x01\x01\x12\x17\n\nlost_state\x18\x39 \x01(\x08H\x06\x88\x01\x01\x12:\n\x07\x66\x65\x65rate\x18\x06 \x01(\x0b\x32$.cln.ListpeerchannelsChannelsFeerateH\x07\x88\x01\x01\x12\x12\n\x05owner\x18\x07 \x01(\tH\x08\x88\x01\x01\x12\x1d\n\x10short_channel_id\x18\x08 \x01(\tH\t\x88\x01\x01\x12\x17\n\nchannel_id\x18\t \x01(\x0cH\n\x88\x01\x01\x12\x19\n\x0c\x66unding_txid\x18\n \x01(\x0cH\x0b\x88\x01\x01\x12\x1b\n\x0e\x66unding_outnum\x18\x0b \x01(\rH\x0c\x88\x01\x01\x12\x1c\n\x0finitial_feerate\x18\x0c \x01(\tH\r\x88\x01\x01\x12\x19\n\x0clast_feerate\x18\r \x01(\tH\x0e\x88\x01\x01\x12\x19\n\x0cnext_feerate\x18\x0e \x01(\tH\x0f\x88\x01\x01\x12\x1a\n\rnext_fee_step\x18\x0f \x01(\rH\x10\x88\x01\x01\x12\x37\n\x08inflight\x18\x10 \x03(\x0b\x32%.cln.ListpeerchannelsChannelsInflight\x12\x15\n\x08\x63lose_to\x18\x11 \x01(\x0cH\x11\x88\x01\x01\x12\x14\n\x07private\x18\x12 \x01(\x08H\x12\x88\x01\x01\x12%\n\x06opener\x18\x13 \x01(\x0e\x32\x10.cln.ChannelSideH\x13\x88\x01\x01\x12%\n\x06\x63loser\x18\x14 \x01(\x0e\x32\x10.cln.ChannelSideH\x14\x88\x01\x01\x12:\n\x07\x66unding\x18\x16 \x01(\x0b\x32$.cln.ListpeerchannelsChannelsFundingH\x15\x88\x01\x01\x12$\n\nto_us_msat\x18\x17 \x01(\x0b\x32\x0b.cln.AmountH\x16\x88\x01\x01\x12(\n\x0emin_to_us_msat\x18\x18 \x01(\x0b\x32\x0b.cln.AmountH\x17\x88\x01\x01\x12(\n\x0emax_to_us_msat\x18\x19 \x01(\x0b\x32\x0b.cln.AmountH\x18\x88\x01\x01\x12$\n\ntotal_msat\x18\x1a \x01(\x0b\x32\x0b.cln.AmountH\x19\x88\x01\x01\x12\'\n\rfee_base_msat\x18\x1b \x01(\x0b\x32\x0b.cln.AmountH\x1a\x88\x01\x01\x12(\n\x1b\x66\x65\x65_proportional_millionths\x18\x1c \x01(\rH\x1b\x88\x01\x01\x12)\n\x0f\x64ust_limit_msat\x18\x1d \x01(\x0b\x32\x0b.cln.AmountH\x1c\x88\x01\x01\x12\x30\n\x16max_total_htlc_in_msat\x18\x1e \x01(\x0b\x32\x0b.cln.AmountH\x1d\x88\x01\x01\x12,\n\x12their_reserve_msat\x18\x1f \x01(\x0b\x32\x0b.cln.AmountH\x1e\x88\x01\x01\x12*\n\x10our_reserve_msat\x18 \x01(\x0b\x32\x0b.cln.AmountH\x1f\x88\x01\x01\x12(\n\x0espendable_msat\x18! \x01(\x0b\x32\x0b.cln.AmountH \x88\x01\x01\x12)\n\x0freceivable_msat\x18\" \x01(\x0b\x32\x0b.cln.AmountH!\x88\x01\x01\x12.\n\x14minimum_htlc_in_msat\x18# \x01(\x0b\x32\x0b.cln.AmountH\"\x88\x01\x01\x12/\n\x15minimum_htlc_out_msat\x18$ \x01(\x0b\x32\x0b.cln.AmountH#\x88\x01\x01\x12/\n\x15maximum_htlc_out_msat\x18% \x01(\x0b\x32\x0b.cln.AmountH$\x88\x01\x01\x12 \n\x13their_to_self_delay\x18& \x01(\rH%\x88\x01\x01\x12\x1e\n\x11our_to_self_delay\x18\' \x01(\rH&\x88\x01\x01\x12\x1f\n\x12max_accepted_htlcs\x18( \x01(\rH\'\x88\x01\x01\x12\x36\n\x05\x61lias\x18) \x01(\x0b\x32\".cln.ListpeerchannelsChannelsAliasH(\x88\x01\x01\x12\x0e\n\x06status\x18+ \x03(\t\x12 \n\x13in_payments_offered\x18, \x01(\x04H)\x88\x01\x01\x12)\n\x0fin_offered_msat\x18- \x01(\x0b\x32\x0b.cln.AmountH*\x88\x01\x01\x12\"\n\x15in_payments_fulfilled\x18. \x01(\x04H+\x88\x01\x01\x12+\n\x11in_fulfilled_msat\x18/ \x01(\x0b\x32\x0b.cln.AmountH,\x88\x01\x01\x12!\n\x14out_payments_offered\x18\x30 \x01(\x04H-\x88\x01\x01\x12*\n\x10out_offered_msat\x18\x31 \x01(\x0b\x32\x0b.cln.AmountH.\x88\x01\x01\x12#\n\x16out_payments_fulfilled\x18\x32 \x01(\x04H/\x88\x01\x01\x12,\n\x12out_fulfilled_msat\x18\x33 \x01(\x0b\x32\x0b.cln.AmountH0\x88\x01\x01\x12#\n\x16last_stable_connection\x18\x38 \x01(\x04H1\x88\x01\x01\x12\x31\n\x05htlcs\x18\x34 \x03(\x0b\x32\".cln.ListpeerchannelsChannelsHtlcs\x12\x1a\n\rclose_to_addr\x18\x35 \x01(\tH2\x88\x01\x01\"\x80\x03\n\x1dListpeerchannelsChannelsState\x12\x0c\n\x08OPENINGD\x10\x00\x12\x1c\n\x18\x43HANNELD_AWAITING_LOCKIN\x10\x01\x12\x13\n\x0f\x43HANNELD_NORMAL\x10\x02\x12\x1a\n\x16\x43HANNELD_SHUTTING_DOWN\x10\x03\x12\x18\n\x14\x43LOSINGD_SIGEXCHANGE\x10\x04\x12\x15\n\x11\x43LOSINGD_COMPLETE\x10\x05\x12\x17\n\x13\x41WAITING_UNILATERAL\x10\x06\x12\x16\n\x12\x46UNDING_SPEND_SEEN\x10\x07\x12\x0b\n\x07ONCHAIN\x10\x08\x12\x17\n\x13\x44UALOPEND_OPEN_INIT\x10\t\x12\x1d\n\x19\x44UALOPEND_AWAITING_LOCKIN\x10\n\x12\x1c\n\x18\x43HANNELD_AWAITING_SPLICE\x10\x0b\x12\x1c\n\x18\x44UALOPEND_OPEN_COMMITTED\x10\x0c\x12\x1f\n\x1b\x44UALOPEND_OPEN_COMMIT_READY\x10\rB\n\n\x08_peer_idB\x11\n\x0f_peer_connectedB\x08\n\x06_stateB\x0f\n\r_scratch_txidB\n\n\x08_updatesB\x14\n\x12_ignore_fee_limitsB\r\n\x0b_lost_stateB\n\n\x08_feerateB\x08\n\x06_ownerB\x13\n\x11_short_channel_idB\r\n\x0b_channel_idB\x0f\n\r_funding_txidB\x11\n\x0f_funding_outnumB\x12\n\x10_initial_feerateB\x0f\n\r_last_feerateB\x0f\n\r_next_feerateB\x10\n\x0e_next_fee_stepB\x0b\n\t_close_toB\n\n\x08_privateB\t\n\x07_openerB\t\n\x07_closerB\n\n\x08_fundingB\r\n\x0b_to_us_msatB\x11\n\x0f_min_to_us_msatB\x11\n\x0f_max_to_us_msatB\r\n\x0b_total_msatB\x10\n\x0e_fee_base_msatB\x1e\n\x1c_fee_proportional_millionthsB\x12\n\x10_dust_limit_msatB\x19\n\x17_max_total_htlc_in_msatB\x15\n\x13_their_reserve_msatB\x13\n\x11_our_reserve_msatB\x11\n\x0f_spendable_msatB\x12\n\x10_receivable_msatB\x17\n\x15_minimum_htlc_in_msatB\x18\n\x16_minimum_htlc_out_msatB\x18\n\x16_maximum_htlc_out_msatB\x16\n\x14_their_to_self_delayB\x14\n\x12_our_to_self_delayB\x15\n\x13_max_accepted_htlcsB\x08\n\x06_aliasB\x16\n\x14_in_payments_offeredB\x12\n\x10_in_offered_msatB\x18\n\x16_in_payments_fulfilledB\x14\n\x12_in_fulfilled_msatB\x17\n\x15_out_payments_offeredB\x13\n\x11_out_offered_msatB\x19\n\x17_out_payments_fulfilledB\x15\n\x13_out_fulfilled_msatB\x19\n\x17_last_stable_connectionB\x10\n\x0e_close_to_addr\"\xb6\x01\n\x1fListpeerchannelsChannelsUpdates\x12=\n\x05local\x18\x01 \x01(\x0b\x32).cln.ListpeerchannelsChannelsUpdatesLocalH\x00\x88\x01\x01\x12?\n\x06remote\x18\x02 \x01(\x0b\x32*.cln.ListpeerchannelsChannelsUpdatesRemoteH\x01\x88\x01\x01\x42\x08\n\x06_localB\t\n\x07_remote\"\xe7\x02\n$ListpeerchannelsChannelsUpdatesLocal\x12+\n\x11htlc_minimum_msat\x18\x01 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12+\n\x11htlc_maximum_msat\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x1e\n\x11\x63ltv_expiry_delta\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\'\n\rfee_base_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12(\n\x1b\x66\x65\x65_proportional_millionths\x18\x05 \x01(\rH\x04\x88\x01\x01\x42\x14\n\x12_htlc_minimum_msatB\x14\n\x12_htlc_maximum_msatB\x14\n\x12_cltv_expiry_deltaB\x10\n\x0e_fee_base_msatB\x1e\n\x1c_fee_proportional_millionths\"\xe8\x02\n%ListpeerchannelsChannelsUpdatesRemote\x12+\n\x11htlc_minimum_msat\x18\x01 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12+\n\x11htlc_maximum_msat\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x1e\n\x11\x63ltv_expiry_delta\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\'\n\rfee_base_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12(\n\x1b\x66\x65\x65_proportional_millionths\x18\x05 \x01(\rH\x04\x88\x01\x01\x42\x14\n\x12_htlc_minimum_msatB\x14\n\x12_htlc_maximum_msatB\x14\n\x12_cltv_expiry_deltaB\x10\n\x0e_fee_base_msatB\x1e\n\x1c_fee_proportional_millionths\"]\n\x1fListpeerchannelsChannelsFeerate\x12\x12\n\x05perkw\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x12\n\x05perkb\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x08\n\x06_perkwB\x08\n\x06_perkb\"\x80\x03\n ListpeerchannelsChannelsInflight\x12\x19\n\x0c\x66unding_txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x1b\n\x0e\x66unding_outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x14\n\x07\x66\x65\x65rate\x18\x03 \x01(\tH\x02\x88\x01\x01\x12,\n\x12total_funding_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x1a\n\rsplice_amount\x18\x07 \x01(\x12H\x04\x88\x01\x01\x12*\n\x10our_funding_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x05\x88\x01\x01\x12\x19\n\x0cscratch_txid\x18\x06 \x01(\x0cH\x06\x88\x01\x01\x42\x0f\n\r_funding_txidB\x11\n\x0f_funding_outnumB\n\n\x08_feerateB\x15\n\x13_total_funding_msatB\x10\n\x0e_splice_amountB\x13\n\x11_our_funding_msatB\x0f\n\r_scratch_txid\"\xd2\x02\n\x1fListpeerchannelsChannelsFunding\x12%\n\x0bpushed_msat\x18\x01 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12*\n\x10local_funds_msat\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12+\n\x11remote_funds_msat\x18\x03 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12\'\n\rfee_paid_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\'\n\rfee_rcvd_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x42\x0e\n\x0c_pushed_msatB\x13\n\x11_local_funds_msatB\x14\n\x12_remote_funds_msatB\x10\n\x0e_fee_paid_msatB\x10\n\x0e_fee_rcvd_msat\"]\n\x1dListpeerchannelsChannelsAlias\x12\x12\n\x05local\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06remote\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_localB\t\n\x07_remote\"\xe2\x03\n\x1dListpeerchannelsChannelsHtlcs\x12\x61\n\tdirection\x18\x01 \x01(\x0e\x32I.cln.ListpeerchannelsChannelsHtlcs.ListpeerchannelsChannelsHtlcsDirectionH\x00\x88\x01\x01\x12\x0f\n\x02id\x18\x02 \x01(\x04H\x01\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12\x13\n\x06\x65xpiry\x18\x04 \x01(\rH\x03\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x05 \x01(\x0cH\x04\x88\x01\x01\x12\x1a\n\rlocal_trimmed\x18\x06 \x01(\x08H\x05\x88\x01\x01\x12\x13\n\x06status\x18\x07 \x01(\tH\x06\x88\x01\x01\x12\"\n\x05state\x18\x08 \x01(\x0e\x32\x0e.cln.HtlcStateH\x07\x88\x01\x01\"9\n&ListpeerchannelsChannelsHtlcsDirection\x12\x06\n\x02IN\x10\x00\x12\x07\n\x03OUT\x10\x01\x42\x0c\n\n_directionB\x05\n\x03_idB\x0e\n\x0c_amount_msatB\t\n\x07_expiryB\x0f\n\r_payment_hashB\x10\n\x0e_local_trimmedB\t\n\x07_statusB\x08\n\x06_state\"3\n\x19ListclosedchannelsRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x05\n\x03_id\"[\n\x1aListclosedchannelsResponse\x12=\n\x0e\x63losedchannels\x18\x01 \x03(\x0b\x32%.cln.ListclosedchannelsClosedchannels\"\xf2\t\n ListclosedchannelsClosedchannels\x12\x14\n\x07peer_id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x12\n\nchannel_id\x18\x02 \x01(\x0c\x12\x1d\n\x10short_channel_id\x18\x03 \x01(\tH\x01\x88\x01\x01\x12>\n\x05\x61lias\x18\x04 \x01(\x0b\x32*.cln.ListclosedchannelsClosedchannelsAliasH\x02\x88\x01\x01\x12 \n\x06opener\x18\x05 \x01(\x0e\x32\x10.cln.ChannelSide\x12%\n\x06\x63loser\x18\x06 \x01(\x0e\x32\x10.cln.ChannelSideH\x03\x88\x01\x01\x12\x0f\n\x07private\x18\x07 \x01(\x08\x12\x1f\n\x17total_local_commitments\x18\t \x01(\x04\x12 \n\x18total_remote_commitments\x18\n \x01(\x04\x12\x18\n\x10total_htlcs_sent\x18\x0b \x01(\x04\x12\x14\n\x0c\x66unding_txid\x18\x0c \x01(\x0c\x12\x16\n\x0e\x66unding_outnum\x18\r \x01(\r\x12\x0e\n\x06leased\x18\x0e \x01(\x08\x12/\n\x15\x66unding_fee_paid_msat\x18\x0f \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x12/\n\x15\x66unding_fee_rcvd_msat\x18\x10 \x01(\x0b\x32\x0b.cln.AmountH\x05\x88\x01\x01\x12-\n\x13\x66unding_pushed_msat\x18\x11 \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x1f\n\ntotal_msat\x18\x12 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10\x66inal_to_us_msat\x18\x13 \x01(\x0b\x32\x0b.cln.Amount\x12#\n\x0emin_to_us_msat\x18\x14 \x01(\x0b\x32\x0b.cln.Amount\x12#\n\x0emax_to_us_msat\x18\x15 \x01(\x0b\x32\x0b.cln.Amount\x12!\n\x14last_commitment_txid\x18\x16 \x01(\x0cH\x07\x88\x01\x01\x12\x32\n\x18last_commitment_fee_msat\x18\x17 \x01(\x0b\x32\x0b.cln.AmountH\x08\x88\x01\x01\x12\x66\n\x0b\x63lose_cause\x18\x18 \x01(\x0e\x32Q.cln.ListclosedchannelsClosedchannels.ListclosedchannelsClosedchannelsClose_cause\x12#\n\x16last_stable_connection\x18\x19 \x01(\x04H\t\x88\x01\x01\"v\n+ListclosedchannelsClosedchannelsClose_cause\x12\x0b\n\x07UNKNOWN\x10\x00\x12\t\n\x05LOCAL\x10\x01\x12\x08\n\x04USER\x10\x02\x12\n\n\x06REMOTE\x10\x03\x12\x0c\n\x08PROTOCOL\x10\x04\x12\x0b\n\x07ONCHAIN\x10\x05\x42\n\n\x08_peer_idB\x13\n\x11_short_channel_idB\x08\n\x06_aliasB\t\n\x07_closerB\x18\n\x16_funding_fee_paid_msatB\x18\n\x16_funding_fee_rcvd_msatB\x16\n\x14_funding_pushed_msatB\x17\n\x15_last_commitment_txidB\x1b\n\x19_last_commitment_fee_msatB\x19\n\x17_last_stable_connection\"e\n%ListclosedchannelsClosedchannelsAlias\x12\x12\n\x05local\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06remote\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_localB\t\n\x07_remote\"L\n\x10\x44\x65\x63odepayRequest\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_description\"\x8d\x04\n\x11\x44\x65\x63odepayResponse\x12\x10\n\x08\x63urrency\x18\x01 \x01(\t\x12\x12\n\ncreated_at\x18\x02 \x01(\x04\x12\x0e\n\x06\x65xpiry\x18\x03 \x01(\x04\x12\r\n\x05payee\x18\x04 \x01(\x0c\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x06 \x01(\x0c\x12\x11\n\tsignature\x18\x07 \x01(\t\x12\x18\n\x0b\x64\x65scription\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\x1d\n\x10\x64\x65scription_hash\x18\t \x01(\x0cH\x02\x88\x01\x01\x12\x1d\n\x15min_final_cltv_expiry\x18\n \x01(\r\x12\x1b\n\x0epayment_secret\x18\x0b \x01(\x0cH\x03\x88\x01\x01\x12\x15\n\x08\x66\x65\x61tures\x18\x0c \x01(\x0cH\x04\x88\x01\x01\x12\x1d\n\x10payment_metadata\x18\r \x01(\x0cH\x05\x88\x01\x01\x12*\n\tfallbacks\x18\x0e \x03(\x0b\x32\x17.cln.DecodepayFallbacks\x12\"\n\x05\x65xtra\x18\x10 \x03(\x0b\x32\x13.cln.DecodepayExtraB\x0e\n\x0c_amount_msatB\x0e\n\x0c_descriptionB\x13\n\x11_description_hashB\x11\n\x0f_payment_secretB\x0b\n\t_featuresB\x13\n\x11_payment_metadata\"\xd0\x01\n\x12\x44\x65\x63odepayFallbacks\x12\x41\n\titem_type\x18\x01 \x01(\x0e\x32..cln.DecodepayFallbacks.DecodepayFallbacksType\x12\x11\n\x04\x61\x64\x64r\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x0b\n\x03hex\x18\x03 \x01(\x0c\"N\n\x16\x44\x65\x63odepayFallbacksType\x12\t\n\x05P2PKH\x10\x00\x12\x08\n\x04P2SH\x10\x01\x12\n\n\x06P2WPKH\x10\x02\x12\t\n\x05P2WSH\x10\x03\x12\x08\n\x04P2TR\x10\x04\x42\x07\n\x05_addr\"+\n\x0e\x44\x65\x63odepayExtra\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\t\"\x1f\n\rDecodeRequest\x12\x0e\n\x06string\x18\x01 \x01(\t\"\xe8!\n\x0e\x44\x65\x63odeResponse\x12\x31\n\titem_type\x18\x01 \x01(\x0e\x32\x1e.cln.DecodeResponse.DecodeType\x12\r\n\x05valid\x18\x02 \x01(\x08\x12\x15\n\x08offer_id\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x12\x14\n\x0coffer_chains\x18\x04 \x03(\x0c\x12\x1b\n\x0eoffer_metadata\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x1b\n\x0eoffer_currency\x18\x06 \x01(\tH\x02\x88\x01\x01\x12+\n\x1ewarning_unknown_offer_currency\x18\x07 \x01(\tH\x03\x88\x01\x01\x12 \n\x13\x63urrency_minor_unit\x18\x08 \x01(\rH\x04\x88\x01\x01\x12\x19\n\x0coffer_amount\x18\t \x01(\x04H\x05\x88\x01\x01\x12+\n\x11offer_amount_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x1e\n\x11offer_description\x18\x0b \x01(\tH\x07\x88\x01\x01\x12\x19\n\x0coffer_issuer\x18\x0c \x01(\tH\x08\x88\x01\x01\x12\x1b\n\x0eoffer_features\x18\r \x01(\x0cH\t\x88\x01\x01\x12\"\n\x15offer_absolute_expiry\x18\x0e \x01(\x04H\n\x88\x01\x01\x12\x1f\n\x12offer_quantity_max\x18\x0f \x01(\x04H\x0b\x88\x01\x01\x12+\n\x0boffer_paths\x18\x10 \x03(\x0b\x32\x16.cln.DecodeOffer_paths\x12\x1a\n\roffer_node_id\x18\x11 \x01(\x0cH\x0c\x88\x01\x01\x12*\n\x1dwarning_missing_offer_node_id\x18\x14 \x01(\tH\r\x88\x01\x01\x12.\n!warning_invalid_offer_description\x18\x15 \x01(\tH\x0e\x88\x01\x01\x12.\n!warning_missing_offer_description\x18\x16 \x01(\tH\x0f\x88\x01\x01\x12+\n\x1ewarning_invalid_offer_currency\x18\x17 \x01(\tH\x10\x88\x01\x01\x12)\n\x1cwarning_invalid_offer_issuer\x18\x18 \x01(\tH\x11\x88\x01\x01\x12\x1c\n\x0finvreq_metadata\x18\x19 \x01(\x0cH\x12\x88\x01\x01\x12\x1c\n\x0finvreq_payer_id\x18\x1a \x01(\x0cH\x13\x88\x01\x01\x12\x19\n\x0cinvreq_chain\x18\x1b \x01(\x0cH\x14\x88\x01\x01\x12,\n\x12invreq_amount_msat\x18\x1c \x01(\x0b\x32\x0b.cln.AmountH\x15\x88\x01\x01\x12\x1c\n\x0finvreq_features\x18\x1d \x01(\x0cH\x16\x88\x01\x01\x12\x1c\n\x0finvreq_quantity\x18\x1e \x01(\x04H\x17\x88\x01\x01\x12\x1e\n\x11invreq_payer_note\x18\x1f \x01(\tH\x18\x88\x01\x01\x12&\n\x19invreq_recurrence_counter\x18 \x01(\rH\x19\x88\x01\x01\x12$\n\x17invreq_recurrence_start\x18! \x01(\rH\x1a\x88\x01\x01\x12,\n\x1fwarning_missing_invreq_metadata\x18# \x01(\tH\x1b\x88\x01\x01\x12,\n\x1fwarning_missing_invreq_payer_id\x18$ \x01(\tH\x1c\x88\x01\x01\x12.\n!warning_invalid_invreq_payer_note\x18% \x01(\tH\x1d\x88\x01\x01\x12\x36\n)warning_missing_invoice_request_signature\x18& \x01(\tH\x1e\x88\x01\x01\x12\x36\n)warning_invalid_invoice_request_signature\x18\' \x01(\tH\x1f\x88\x01\x01\x12\x1f\n\x12invoice_created_at\x18) \x01(\x04H \x88\x01\x01\x12$\n\x17invoice_relative_expiry\x18* \x01(\rH!\x88\x01\x01\x12!\n\x14invoice_payment_hash\x18+ \x01(\x0cH\"\x88\x01\x01\x12-\n\x13invoice_amount_msat\x18, \x01(\x0b\x32\x0b.cln.AmountH#\x88\x01\x01\x12\x37\n\x11invoice_fallbacks\x18- \x03(\x0b\x32\x1c.cln.DecodeInvoice_fallbacks\x12\x1d\n\x10invoice_features\x18. \x01(\x0cH$\x88\x01\x01\x12\x1c\n\x0finvoice_node_id\x18/ \x01(\x0cH%\x88\x01\x01\x12(\n\x1binvoice_recurrence_basetime\x18\x30 \x01(\x04H&\x88\x01\x01\x12*\n\x1dwarning_missing_invoice_paths\x18\x32 \x01(\tH\'\x88\x01\x01\x12/\n\"warning_missing_invoice_blindedpay\x18\x33 \x01(\tH(\x88\x01\x01\x12/\n\"warning_missing_invoice_created_at\x18\x34 \x01(\tH)\x88\x01\x01\x12\x31\n$warning_missing_invoice_payment_hash\x18\x35 \x01(\tH*\x88\x01\x01\x12+\n\x1ewarning_missing_invoice_amount\x18\x36 \x01(\tH+\x88\x01\x01\x12\x38\n+warning_missing_invoice_recurrence_basetime\x18\x37 \x01(\tH,\x88\x01\x01\x12,\n\x1fwarning_missing_invoice_node_id\x18\x38 \x01(\tH-\x88\x01\x01\x12.\n!warning_missing_invoice_signature\x18\x39 \x01(\tH.\x88\x01\x01\x12.\n!warning_invalid_invoice_signature\x18: \x01(\tH/\x88\x01\x01\x12\'\n\tfallbacks\x18; \x03(\x0b\x32\x14.cln.DecodeFallbacks\x12\x17\n\ncreated_at\x18< \x01(\x04H0\x88\x01\x01\x12\x13\n\x06\x65xpiry\x18= \x01(\x04H1\x88\x01\x01\x12\x12\n\x05payee\x18> \x01(\x0cH2\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18? \x01(\x0cH3\x88\x01\x01\x12\x1d\n\x10\x64\x65scription_hash\x18@ \x01(\x0cH4\x88\x01\x01\x12\"\n\x15min_final_cltv_expiry\x18\x41 \x01(\rH5\x88\x01\x01\x12\x1b\n\x0epayment_secret\x18\x42 \x01(\x0cH6\x88\x01\x01\x12\x1d\n\x10payment_metadata\x18\x43 \x01(\x0cH7\x88\x01\x01\x12\x1f\n\x05\x65xtra\x18\x45 \x03(\x0b\x32\x10.cln.DecodeExtra\x12\x16\n\tunique_id\x18\x46 \x01(\tH8\x88\x01\x01\x12\x14\n\x07version\x18G \x01(\tH9\x88\x01\x01\x12\x13\n\x06string\x18H \x01(\tH:\x88\x01\x01\x12-\n\x0crestrictions\x18I \x03(\x0b\x32\x17.cln.DecodeRestrictions\x12&\n\x19warning_rune_invalid_utf8\x18J \x01(\tH;\x88\x01\x01\x12\x10\n\x03hex\x18K \x01(\x0cH<\x88\x01\x01\x12\x16\n\tdecrypted\x18L \x01(\x0cH=\x88\x01\x01\"\x83\x01\n\nDecodeType\x12\x10\n\x0c\x42OLT12_OFFER\x10\x00\x12\x12\n\x0e\x42OLT12_INVOICE\x10\x01\x12\x1a\n\x16\x42OLT12_INVOICE_REQUEST\x10\x02\x12\x12\n\x0e\x42OLT11_INVOICE\x10\x03\x12\x08\n\x04RUNE\x10\x04\x12\x15\n\x11\x45MERGENCY_RECOVER\x10\x05\x42\x0b\n\t_offer_idB\x11\n\x0f_offer_metadataB\x11\n\x0f_offer_currencyB!\n\x1f_warning_unknown_offer_currencyB\x16\n\x14_currency_minor_unitB\x0f\n\r_offer_amountB\x14\n\x12_offer_amount_msatB\x14\n\x12_offer_descriptionB\x0f\n\r_offer_issuerB\x11\n\x0f_offer_featuresB\x18\n\x16_offer_absolute_expiryB\x15\n\x13_offer_quantity_maxB\x10\n\x0e_offer_node_idB \n\x1e_warning_missing_offer_node_idB$\n\"_warning_invalid_offer_descriptionB$\n\"_warning_missing_offer_descriptionB!\n\x1f_warning_invalid_offer_currencyB\x1f\n\x1d_warning_invalid_offer_issuerB\x12\n\x10_invreq_metadataB\x12\n\x10_invreq_payer_idB\x0f\n\r_invreq_chainB\x15\n\x13_invreq_amount_msatB\x12\n\x10_invreq_featuresB\x12\n\x10_invreq_quantityB\x14\n\x12_invreq_payer_noteB\x1c\n\x1a_invreq_recurrence_counterB\x1a\n\x18_invreq_recurrence_startB\"\n _warning_missing_invreq_metadataB\"\n _warning_missing_invreq_payer_idB$\n\"_warning_invalid_invreq_payer_noteB,\n*_warning_missing_invoice_request_signatureB,\n*_warning_invalid_invoice_request_signatureB\x15\n\x13_invoice_created_atB\x1a\n\x18_invoice_relative_expiryB\x17\n\x15_invoice_payment_hashB\x16\n\x14_invoice_amount_msatB\x13\n\x11_invoice_featuresB\x12\n\x10_invoice_node_idB\x1e\n\x1c_invoice_recurrence_basetimeB \n\x1e_warning_missing_invoice_pathsB%\n#_warning_missing_invoice_blindedpayB%\n#_warning_missing_invoice_created_atB\'\n%_warning_missing_invoice_payment_hashB!\n\x1f_warning_missing_invoice_amountB.\n,_warning_missing_invoice_recurrence_basetimeB\"\n _warning_missing_invoice_node_idB$\n\"_warning_missing_invoice_signatureB$\n\"_warning_invalid_invoice_signatureB\r\n\x0b_created_atB\t\n\x07_expiryB\x08\n\x06_payeeB\x0f\n\r_payment_hashB\x13\n\x11_description_hashB\x18\n\x16_min_final_cltv_expiryB\x11\n\x0f_payment_secretB\x13\n\x11_payment_metadataB\x0c\n\n_unique_idB\n\n\x08_versionB\t\n\x07_stringB\x1c\n\x1a_warning_rune_invalid_utf8B\x06\n\x04_hexB\x0c\n\n_decrypted\"<\n\x11\x44\x65\x63odeOffer_paths\x12\x15\n\rfirst_node_id\x18\x01 \x01(\x0c\x12\x10\n\x08\x62linding\x18\x02 \x01(\x0c\"\x8a\x01\n\x1f\x44\x65\x63odeOffer_recurrencePaywindow\x12\x16\n\x0eseconds_before\x18\x01 \x01(\r\x12\x15\n\rseconds_after\x18\x02 \x01(\r\x12 \n\x13proportional_amount\x18\x03 \x01(\x08H\x00\x88\x01\x01\x42\x16\n\x14_proportional_amount\"T\n\x17\x44\x65\x63odeInvoice_pathsPath\x12\x17\n\x0f\x62linded_node_id\x18\x01 \x01(\x0c\x12 \n\x18\x65ncrypted_recipient_data\x18\x02 \x01(\x0c\"Y\n\x17\x44\x65\x63odeInvoice_fallbacks\x12\x0f\n\x07version\x18\x01 \x01(\r\x12\x0b\n\x03hex\x18\x02 \x01(\x0c\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_address\"w\n\x0f\x44\x65\x63odeFallbacks\x12\x36\n)warning_invoice_fallbacks_version_invalid\x18\x01 \x01(\tH\x00\x88\x01\x01\x42,\n*_warning_invoice_fallbacks_version_invalid\"(\n\x0b\x44\x65\x63odeExtra\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\t\";\n\x12\x44\x65\x63odeRestrictions\x12\x14\n\x0c\x61lternatives\x18\x01 \x03(\t\x12\x0f\n\x07summary\x18\x02 \x01(\t\"=\n\x11\x44isconnectRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x12\n\x05\x66orce\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\x08\n\x06_force\"\x14\n\x12\x44isconnectResponse\"k\n\x0f\x46\x65\x65ratesRequest\x12\x31\n\x05style\x18\x01 \x01(\x0e\x32\".cln.FeeratesRequest.FeeratesStyle\"%\n\rFeeratesStyle\x12\t\n\x05PERKB\x10\x00\x12\t\n\x05PERKW\x10\x01\"\x9c\x02\n\x10\x46\x65\x65ratesResponse\x12%\n\x18warning_missing_feerates\x18\x01 \x01(\tH\x00\x88\x01\x01\x12&\n\x05perkb\x18\x02 \x01(\x0b\x32\x12.cln.FeeratesPerkbH\x01\x88\x01\x01\x12&\n\x05perkw\x18\x03 \x01(\x0b\x32\x12.cln.FeeratesPerkwH\x02\x88\x01\x01\x12\x46\n\x15onchain_fee_estimates\x18\x04 \x01(\x0b\x32\".cln.FeeratesOnchain_fee_estimatesH\x03\x88\x01\x01\x42\x1b\n\x19_warning_missing_feeratesB\x08\n\x06_perkbB\x08\n\x06_perkwB\x18\n\x16_onchain_fee_estimates\"\xd3\x03\n\rFeeratesPerkb\x12\x16\n\x0emin_acceptable\x18\x01 \x01(\r\x12\x16\n\x0emax_acceptable\x18\x02 \x01(\r\x12\x12\n\x05\x66loor\x18\n \x01(\rH\x00\x88\x01\x01\x12.\n\testimates\x18\t \x03(\x0b\x32\x1b.cln.FeeratesPerkbEstimates\x12\x14\n\x07opening\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x19\n\x0cmutual_close\x18\x04 \x01(\rH\x02\x88\x01\x01\x12\x1d\n\x10unilateral_close\x18\x05 \x01(\rH\x03\x88\x01\x01\x12$\n\x17unilateral_anchor_close\x18\x0b \x01(\rH\x04\x88\x01\x01\x12\x1a\n\rdelayed_to_us\x18\x06 \x01(\rH\x05\x88\x01\x01\x12\x1c\n\x0fhtlc_resolution\x18\x07 \x01(\rH\x06\x88\x01\x01\x12\x14\n\x07penalty\x18\x08 \x01(\rH\x07\x88\x01\x01\x42\x08\n\x06_floorB\n\n\x08_openingB\x0f\n\r_mutual_closeB\x13\n\x11_unilateral_closeB\x1a\n\x18_unilateral_anchor_closeB\x10\n\x0e_delayed_to_usB\x12\n\x10_htlc_resolutionB\n\n\x08_penalty\"\x96\x01\n\x16\x46\x65\x65ratesPerkbEstimates\x12\x17\n\nblockcount\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x14\n\x07\x66\x65\x65rate\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x1d\n\x10smoothed_feerate\x18\x03 \x01(\rH\x02\x88\x01\x01\x42\r\n\x0b_blockcountB\n\n\x08_feerateB\x13\n\x11_smoothed_feerate\"\xd3\x03\n\rFeeratesPerkw\x12\x16\n\x0emin_acceptable\x18\x01 \x01(\r\x12\x16\n\x0emax_acceptable\x18\x02 \x01(\r\x12\x12\n\x05\x66loor\x18\n \x01(\rH\x00\x88\x01\x01\x12.\n\testimates\x18\t \x03(\x0b\x32\x1b.cln.FeeratesPerkwEstimates\x12\x14\n\x07opening\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x19\n\x0cmutual_close\x18\x04 \x01(\rH\x02\x88\x01\x01\x12\x1d\n\x10unilateral_close\x18\x05 \x01(\rH\x03\x88\x01\x01\x12$\n\x17unilateral_anchor_close\x18\x0b \x01(\rH\x04\x88\x01\x01\x12\x1a\n\rdelayed_to_us\x18\x06 \x01(\rH\x05\x88\x01\x01\x12\x1c\n\x0fhtlc_resolution\x18\x07 \x01(\rH\x06\x88\x01\x01\x12\x14\n\x07penalty\x18\x08 \x01(\rH\x07\x88\x01\x01\x42\x08\n\x06_floorB\n\n\x08_openingB\x0f\n\r_mutual_closeB\x13\n\x11_unilateral_closeB\x1a\n\x18_unilateral_anchor_closeB\x10\n\x0e_delayed_to_usB\x12\n\x10_htlc_resolutionB\n\n\x08_penalty\"\x96\x01\n\x16\x46\x65\x65ratesPerkwEstimates\x12\x17\n\nblockcount\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x14\n\x07\x66\x65\x65rate\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x1d\n\x10smoothed_feerate\x18\x03 \x01(\rH\x02\x88\x01\x01\x42\r\n\x0b_blockcountB\n\n\x08_feerateB\x13\n\x11_smoothed_feerate\"\x9b\x02\n\x1d\x46\x65\x65ratesOnchain_fee_estimates\x12 \n\x18opening_channel_satoshis\x18\x01 \x01(\x04\x12\x1d\n\x15mutual_close_satoshis\x18\x02 \x01(\x04\x12!\n\x19unilateral_close_satoshis\x18\x03 \x01(\x04\x12\x30\n#unilateral_close_nonanchor_satoshis\x18\x06 \x01(\x04H\x00\x88\x01\x01\x12\x1d\n\x15htlc_timeout_satoshis\x18\x04 \x01(\x04\x12\x1d\n\x15htlc_success_satoshis\x18\x05 \x01(\x04\x42&\n$_unilateral_close_nonanchor_satoshis\"\xe9\x02\n\x13\x46\x65tchinvoiceRequest\x12\r\n\x05offer\x18\x01 \x01(\t\x12%\n\x0b\x61mount_msat\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x15\n\x08quantity\x18\x03 \x01(\x04H\x01\x88\x01\x01\x12\x1f\n\x12recurrence_counter\x18\x04 \x01(\x04H\x02\x88\x01\x01\x12\x1d\n\x10recurrence_start\x18\x05 \x01(\x01H\x03\x88\x01\x01\x12\x1d\n\x10recurrence_label\x18\x06 \x01(\tH\x04\x88\x01\x01\x12\x14\n\x07timeout\x18\x07 \x01(\x01H\x05\x88\x01\x01\x12\x17\n\npayer_note\x18\x08 \x01(\tH\x06\x88\x01\x01\x42\x0e\n\x0c_amount_msatB\x0b\n\t_quantityB\x15\n\x13_recurrence_counterB\x13\n\x11_recurrence_startB\x13\n\x11_recurrence_labelB\n\n\x08_timeoutB\r\n\x0b_payer_note\"\x9a\x01\n\x14\x46\x65tchinvoiceResponse\x12\x0f\n\x07invoice\x18\x01 \x01(\t\x12)\n\x07\x63hanges\x18\x02 \x01(\x0b\x32\x18.cln.FetchinvoiceChanges\x12\x36\n\x0bnext_period\x18\x03 \x01(\x0b\x32\x1c.cln.FetchinvoiceNext_periodH\x00\x88\x01\x01\x42\x0e\n\x0c_next_period\"\x82\x02\n\x13\x46\x65tchinvoiceChanges\x12!\n\x14\x64\x65scription_appended\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x1b\n\x0evendor_removed\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06vendor\x18\x04 \x01(\tH\x03\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x42\x17\n\x15_description_appendedB\x0e\n\x0c_descriptionB\x11\n\x0f_vendor_removedB\t\n\x07_vendorB\x0e\n\x0c_amount_msat\"~\n\x17\x46\x65tchinvoiceNext_period\x12\x0f\n\x07\x63ounter\x18\x01 \x01(\x04\x12\x11\n\tstarttime\x18\x02 \x01(\x04\x12\x0f\n\x07\x65ndtime\x18\x03 \x01(\x04\x12\x17\n\x0fpaywindow_start\x18\x04 \x01(\x04\x12\x15\n\rpaywindow_end\x18\x05 \x01(\x04\"\xfb\x03\n\x12\x46undchannelRequest\x12\n\n\x02id\x18\t \x01(\x0c\x12 \n\x06\x61mount\x18\x01 \x01(\x0b\x32\x10.cln.AmountOrAll\x12\"\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.FeerateH\x00\x88\x01\x01\x12\x15\n\x08\x61nnounce\x18\x03 \x01(\x08H\x01\x88\x01\x01\x12\x14\n\x07minconf\x18\n \x01(\rH\x02\x88\x01\x01\x12#\n\tpush_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x15\n\x08\x63lose_to\x18\x06 \x01(\tH\x04\x88\x01\x01\x12%\n\x0brequest_amt\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x05\x88\x01\x01\x12\x1a\n\rcompact_lease\x18\x08 \x01(\tH\x06\x88\x01\x01\x12\x1c\n\x05utxos\x18\x0b \x03(\x0b\x32\r.cln.Outpoint\x12\x15\n\x08mindepth\x18\x0c \x01(\rH\x07\x88\x01\x01\x12!\n\x07reserve\x18\r \x01(\x0b\x32\x0b.cln.AmountH\x08\x88\x01\x01\x12\x14\n\x0c\x63hannel_type\x18\x0e \x03(\rB\n\n\x08_feerateB\x0b\n\t_announceB\n\n\x08_minconfB\x0c\n\n_push_msatB\x0b\n\t_close_toB\x0e\n\x0c_request_amtB\x10\n\x0e_compact_leaseB\x0b\n\t_mindepthB\n\n\x08_reserve\"\xe5\x01\n\x13\x46undchannelResponse\x12\n\n\x02tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\x12\x0e\n\x06outnum\x18\x03 \x01(\r\x12\x12\n\nchannel_id\x18\x04 \x01(\x0c\x12\x37\n\x0c\x63hannel_type\x18\x07 \x01(\x0b\x32\x1c.cln.FundchannelChannel_typeH\x00\x88\x01\x01\x12\x15\n\x08\x63lose_to\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x15\n\x08mindepth\x18\x06 \x01(\rH\x02\x88\x01\x01\x42\x0f\n\r_channel_typeB\x0b\n\t_close_toB\x0b\n\t_mindepth\"L\n\x17\x46undchannelChannel_type\x12\x0c\n\x04\x62its\x18\x01 \x03(\r\x12#\n\x05names\x18\x02 \x03(\x0e\x32\x14.cln.ChannelTypeName\"\xec\x01\n\x0fGetrouteRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12 \n\x0b\x61mount_msat\x18\t \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\nriskfactor\x18\x03 \x01(\x04\x12\x11\n\x04\x63ltv\x18\x04 \x01(\rH\x00\x88\x01\x01\x12\x13\n\x06\x66romid\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x18\n\x0b\x66uzzpercent\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x0f\n\x07\x65xclude\x18\x07 \x03(\t\x12\x14\n\x07maxhops\x18\x08 \x01(\rH\x03\x88\x01\x01\x42\x07\n\x05_cltvB\t\n\x07_fromidB\x0e\n\x0c_fuzzpercentB\n\n\x08_maxhops\"5\n\x10GetrouteResponse\x12!\n\x05route\x18\x01 \x03(\x0b\x32\x12.cln.GetrouteRoute\"\xc5\x01\n\rGetrouteRoute\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x0f\n\x07\x63hannel\x18\x02 \x01(\t\x12\x11\n\tdirection\x18\x03 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\r\n\x05\x64\x65lay\x18\x05 \x01(\r\x12\x34\n\x05style\x18\x06 \x01(\x0e\x32%.cln.GetrouteRoute.GetrouteRouteStyle\"\x1d\n\x12GetrouteRouteStyle\x12\x07\n\x03TLV\x10\x00\"\xb7\x03\n\x13ListforwardsRequest\x12@\n\x06status\x18\x01 \x01(\x0e\x32+.cln.ListforwardsRequest.ListforwardsStatusH\x00\x88\x01\x01\x12\x17\n\nin_channel\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x18\n\x0bout_channel\x18\x03 \x01(\tH\x02\x88\x01\x01\x12>\n\x05index\x18\x04 \x01(\x0e\x32*.cln.ListforwardsRequest.ListforwardsIndexH\x03\x88\x01\x01\x12\x12\n\x05start\x18\x05 \x01(\x04H\x04\x88\x01\x01\x12\x12\n\x05limit\x18\x06 \x01(\rH\x05\x88\x01\x01\"L\n\x12ListforwardsStatus\x12\x0b\n\x07OFFERED\x10\x00\x12\x0b\n\x07SETTLED\x10\x01\x12\x10\n\x0cLOCAL_FAILED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\"-\n\x11ListforwardsIndex\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07UPDATED\x10\x01\x42\t\n\x07_statusB\r\n\x0b_in_channelB\x0e\n\x0c_out_channelB\x08\n\x06_indexB\x08\n\x06_startB\x08\n\x06_limit\"C\n\x14ListforwardsResponse\x12+\n\x08\x66orwards\x18\x01 \x03(\x0b\x32\x19.cln.ListforwardsForwards\"\xba\x05\n\x14ListforwardsForwards\x12\x1a\n\rcreated_index\x18\x0c \x01(\x04H\x00\x88\x01\x01\x12\x12\n\nin_channel\x18\x01 \x01(\t\x12\x17\n\nin_htlc_id\x18\n \x01(\x04H\x01\x88\x01\x01\x12\x1c\n\x07in_msat\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\x12\x44\n\x06status\x18\x03 \x01(\x0e\x32\x34.cln.ListforwardsForwards.ListforwardsForwardsStatus\x12\x15\n\rreceived_time\x18\x04 \x01(\x01\x12\x18\n\x0bout_channel\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x18\n\x0bout_htlc_id\x18\x0b \x01(\x04H\x03\x88\x01\x01\x12\x1a\n\rupdated_index\x18\r \x01(\x04H\x04\x88\x01\x01\x12G\n\x05style\x18\t \x01(\x0e\x32\x33.cln.ListforwardsForwards.ListforwardsForwardsStyleH\x05\x88\x01\x01\x12\"\n\x08\x66\x65\x65_msat\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\"\n\x08out_msat\x18\x08 \x01(\x0b\x32\x0b.cln.AmountH\x07\x88\x01\x01\"T\n\x1aListforwardsForwardsStatus\x12\x0b\n\x07OFFERED\x10\x00\x12\x0b\n\x07SETTLED\x10\x01\x12\x10\n\x0cLOCAL_FAILED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\"0\n\x19ListforwardsForwardsStyle\x12\n\n\x06LEGACY\x10\x00\x12\x07\n\x03TLV\x10\x01\x42\x10\n\x0e_created_indexB\r\n\x0b_in_htlc_idB\x0e\n\x0c_out_channelB\x0e\n\x0c_out_htlc_idB\x10\n\x0e_updated_indexB\x08\n\x06_styleB\x0b\n\t_fee_msatB\x0b\n\t_out_msat\"a\n\x11ListoffersRequest\x12\x15\n\x08offer_id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x18\n\x0b\x61\x63tive_only\x18\x02 \x01(\x08H\x01\x88\x01\x01\x42\x0b\n\t_offer_idB\x0e\n\x0c_active_only\";\n\x12ListoffersResponse\x12%\n\x06offers\x18\x01 \x03(\x0b\x32\x15.cln.ListoffersOffers\"\x84\x01\n\x10ListoffersOffers\x12\x10\n\x08offer_id\x18\x01 \x01(\x0c\x12\x0e\n\x06\x61\x63tive\x18\x02 \x01(\x08\x12\x12\n\nsingle_use\x18\x03 \x01(\x08\x12\x0e\n\x06\x62olt12\x18\x04 \x01(\t\x12\x0c\n\x04used\x18\x05 \x01(\x08\x12\x12\n\x05label\x18\x06 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_label\"\xdb\x01\n\x0fListpaysRequest\x12\x13\n\x06\x62olt11\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12\x38\n\x06status\x18\x03 \x01(\x0e\x32#.cln.ListpaysRequest.ListpaysStatusH\x02\x88\x01\x01\"7\n\x0eListpaysStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x42\t\n\x07_bolt11B\x0f\n\r_payment_hashB\t\n\x07_status\"3\n\x10ListpaysResponse\x12\x1f\n\x04pays\x18\x01 \x03(\x0b\x32\x11.cln.ListpaysPays\"\xff\x04\n\x0cListpaysPays\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x34\n\x06status\x18\x02 \x01(\x0e\x32$.cln.ListpaysPays.ListpaysPaysStatus\x12\x18\n\x0b\x64\x65stination\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x12\x12\n\ncreated_at\x18\x04 \x01(\x04\x12\x19\n\x0c\x63ompleted_at\x18\x0c \x01(\x04H\x01\x88\x01\x01\x12\x12\n\x05label\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x06 \x01(\tH\x03\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x0b \x01(\tH\x04\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x07 \x01(\tH\x05\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x08 \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12*\n\x10\x61mount_sent_msat\x18\t \x01(\x0b\x32\x0b.cln.AmountH\x07\x88\x01\x01\x12\x15\n\x08preimage\x18\r \x01(\x0cH\x08\x88\x01\x01\x12\x1c\n\x0fnumber_of_parts\x18\x0e \x01(\x04H\t\x88\x01\x01\x12\x17\n\nerroronion\x18\n \x01(\x0cH\n\x88\x01\x01\";\n\x12ListpaysPaysStatus\x12\x0b\n\x07PENDING\x10\x00\x12\n\n\x06\x46\x41ILED\x10\x01\x12\x0c\n\x08\x43OMPLETE\x10\x02\x42\x0e\n\x0c_destinationB\x0f\n\r_completed_atB\x08\n\x06_labelB\t\n\x07_bolt11B\x0e\n\x0c_descriptionB\t\n\x07_bolt12B\x0e\n\x0c_amount_msatB\x13\n\x11_amount_sent_msatB\x0b\n\t_preimageB\x12\n\x10_number_of_partsB\r\n\x0b_erroronion\"*\n\x10ListhtlcsRequest\x12\x0f\n\x02id\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x05\n\x03_id\"7\n\x11ListhtlcsResponse\x12\"\n\x05htlcs\x18\x01 \x03(\x0b\x32\x13.cln.ListhtlcsHtlcs\"\x89\x02\n\x0eListhtlcsHtlcs\x12\x18\n\x10short_channel_id\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\x04\x12\x0e\n\x06\x65xpiry\x18\x03 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12>\n\tdirection\x18\x05 \x01(\x0e\x32+.cln.ListhtlcsHtlcs.ListhtlcsHtlcsDirection\x12\x14\n\x0cpayment_hash\x18\x06 \x01(\x0c\x12\x1d\n\x05state\x18\x07 \x01(\x0e\x32\x0e.cln.HtlcState\"*\n\x17ListhtlcsHtlcsDirection\x12\x07\n\x03OUT\x10\x00\x12\x06\n\x02IN\x10\x01\"\xc1\x03\n\x0cOfferRequest\x12\x0e\n\x06\x61mount\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x13\n\x06issuer\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x12\n\x05label\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x19\n\x0cquantity_max\x18\x05 \x01(\x04H\x02\x88\x01\x01\x12\x1c\n\x0f\x61\x62solute_expiry\x18\x06 \x01(\x04H\x03\x88\x01\x01\x12\x17\n\nrecurrence\x18\x07 \x01(\tH\x04\x88\x01\x01\x12\x1c\n\x0frecurrence_base\x18\x08 \x01(\tH\x05\x88\x01\x01\x12!\n\x14recurrence_paywindow\x18\t \x01(\tH\x06\x88\x01\x01\x12\x1d\n\x10recurrence_limit\x18\n \x01(\x04H\x07\x88\x01\x01\x12\x17\n\nsingle_use\x18\x0b \x01(\x08H\x08\x88\x01\x01\x42\t\n\x07_issuerB\x08\n\x06_labelB\x0f\n\r_quantity_maxB\x12\n\x10_absolute_expiryB\r\n\x0b_recurrenceB\x12\n\x10_recurrence_baseB\x17\n\x15_recurrence_paywindowB\x13\n\x11_recurrence_limitB\r\n\x0b_single_use\"\x92\x01\n\rOfferResponse\x12\x10\n\x08offer_id\x18\x01 \x01(\x0c\x12\x0e\n\x06\x61\x63tive\x18\x02 \x01(\x08\x12\x12\n\nsingle_use\x18\x03 \x01(\x08\x12\x0e\n\x06\x62olt12\x18\x04 \x01(\t\x12\x0c\n\x04used\x18\x05 \x01(\x08\x12\x0f\n\x07\x63reated\x18\x06 \x01(\x08\x12\x12\n\x05label\x18\x07 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_label\"Y\n\x0bPingRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x10\n\x03len\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x16\n\tpongbytes\x18\x03 \x01(\rH\x01\x88\x01\x01\x42\x06\n\x04_lenB\x0c\n\n_pongbytes\"\x1e\n\x0cPingResponse\x12\x0e\n\x06totlen\x18\x01 \x01(\r\"4\n\x14SendcustommsgRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\x0b\n\x03msg\x18\x02 \x01(\x0c\"\'\n\x15SendcustommsgResponse\x12\x0e\n\x06status\x18\x01 \x01(\t\"\xaa\x02\n\x11SetchannelRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12!\n\x07\x66\x65\x65\x62\x61se\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x13\n\x06\x66\x65\x65ppm\x18\x03 \x01(\rH\x01\x88\x01\x01\x12!\n\x07htlcmin\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12!\n\x07htlcmax\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x19\n\x0c\x65nforcedelay\x18\x06 \x01(\rH\x04\x88\x01\x01\x12\x1c\n\x0fignorefeelimits\x18\x07 \x01(\x08H\x05\x88\x01\x01\x42\n\n\x08_feebaseB\t\n\x07_feeppmB\n\n\x08_htlcminB\n\n\x08_htlcmaxB\x0f\n\r_enforcedelayB\x12\n\x10_ignorefeelimits\"?\n\x12SetchannelResponse\x12)\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x17.cln.SetchannelChannels\"\xca\x03\n\x12SetchannelChannels\x12\x0f\n\x07peer_id\x18\x01 \x01(\x0c\x12\x12\n\nchannel_id\x18\x02 \x01(\x0c\x12\x1d\n\x10short_channel_id\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\"\n\rfee_base_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12#\n\x1b\x66\x65\x65_proportional_millionths\x18\x05 \x01(\r\x12\x1e\n\x11ignore_fee_limits\x18\n \x01(\x08H\x01\x88\x01\x01\x12*\n\x15minimum_htlc_out_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12$\n\x17warning_htlcmin_too_low\x18\x07 \x01(\tH\x02\x88\x01\x01\x12*\n\x15maximum_htlc_out_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x18warning_htlcmax_too_high\x18\t \x01(\tH\x03\x88\x01\x01\x42\x13\n\x11_short_channel_idB\x14\n\x12_ignore_fee_limitsB\x1a\n\x18_warning_htlcmin_too_lowB\x1b\n\x19_warning_htlcmax_too_high\"\'\n\x12SigninvoiceRequest\x12\x11\n\tinvstring\x18\x01 \x01(\t\"%\n\x13SigninvoiceResponse\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\"%\n\x12SignmessageRequest\x12\x0f\n\x07message\x18\x01 \x01(\t\"F\n\x13SignmessageResponse\x12\x11\n\tsignature\x18\x01 \x01(\x0c\x12\r\n\x05recid\x18\x02 \x01(\x0c\x12\r\n\x05zbase\x18\x03 \x01(\t\"O\n\x16WaitblockheightRequest\x12\x13\n\x0b\x62lockheight\x18\x01 \x01(\r\x12\x14\n\x07timeout\x18\x02 \x01(\rH\x00\x88\x01\x01\x42\n\n\x08_timeout\".\n\x17WaitblockheightResponse\x12\x13\n\x0b\x62lockheight\x18\x01 \x01(\r\"\xf9\x01\n\x0bWaitRequest\x12\x31\n\tsubsystem\x18\x01 \x01(\x0e\x32\x1e.cln.WaitRequest.WaitSubsystem\x12\x31\n\tindexname\x18\x02 \x01(\x0e\x32\x1e.cln.WaitRequest.WaitIndexname\x12\x11\n\tnextvalue\x18\x03 \x01(\x04\"9\n\rWaitSubsystem\x12\x0c\n\x08INVOICES\x10\x00\x12\x0c\n\x08\x46ORWARDS\x10\x01\x12\x0c\n\x08SENDPAYS\x10\x02\"6\n\rWaitIndexname\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07UPDATED\x10\x01\x12\x0b\n\x07\x44\x45LETED\x10\x02\"\xe3\x01\n\x0cWaitResponse\x12\x32\n\tsubsystem\x18\x01 \x01(\x0e\x32\x1f.cln.WaitResponse.WaitSubsystem\x12\x14\n\x07\x63reated\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x14\n\x07updated\x18\x03 \x01(\x04H\x01\x88\x01\x01\x12\x14\n\x07\x64\x65leted\x18\x04 \x01(\x04H\x02\x88\x01\x01\"9\n\rWaitSubsystem\x12\x0c\n\x08INVOICES\x10\x00\x12\x0c\n\x08\x46ORWARDS\x10\x01\x12\x0c\n\x08SENDPAYS\x10\x02\x42\n\n\x08_createdB\n\n\x08_updatedB\n\n\x08_deleted\"\r\n\x0bStopRequest\"q\n\x0cStopResponse\x12\x31\n\x06result\x18\x01 \x01(\x0e\x32\x1c.cln.StopResponse.StopResultH\x00\x88\x01\x01\"#\n\nStopResult\x12\x15\n\x11SHUTDOWN_COMPLETE\x10\x00\x42\t\n\x07_result\"\xa7\x01\n\x18PreapprovekeysendRequest\x12\x18\n\x0b\x64\x65stination\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x42\x0e\n\x0c_destinationB\x0f\n\r_payment_hashB\x0e\n\x0c_amount_msat\"\x1b\n\x19PreapprovekeysendResponse\":\n\x18PreapproveinvoiceRequest\x12\x13\n\x06\x62olt11\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\t\n\x07_bolt11\"\x1b\n\x19PreapproveinvoiceResponse\"\x15\n\x13StaticbackupRequest\"#\n\x14StaticbackupResponse\x12\x0b\n\x03scb\x18\x01 \x03(\x0c\"\x97\x01\n\x15\x42kprlistincomeRequest\x12\x1d\n\x10\x63onsolidate_fees\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x17\n\nstart_time\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x15\n\x08\x65nd_time\x18\x03 \x01(\rH\x02\x88\x01\x01\x42\x13\n\x11_consolidate_feesB\r\n\x0b_start_timeB\x0b\n\t_end_time\"Q\n\x16\x42kprlistincomeResponse\x12\x37\n\rincome_events\x18\x01 \x03(\x0b\x32 .cln.BkprlistincomeIncome_events\"\xb5\x02\n\x1b\x42kprlistincomeIncome_events\x12\x0f\n\x07\x61\x63\x63ount\x18\x01 \x01(\t\x12\x0b\n\x03tag\x18\x02 \x01(\t\x12 \n\x0b\x63redit_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x1f\n\ndebit_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\x10\n\x08\x63urrency\x18\x05 \x01(\t\x12\x11\n\ttimestamp\x18\x06 \x01(\r\x12\x18\n\x0b\x64\x65scription\x18\x07 \x01(\tH\x00\x88\x01\x01\x12\x15\n\x08outpoint\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\x11\n\x04txid\x18\t \x01(\x0cH\x02\x88\x01\x01\x12\x17\n\npayment_id\x18\n \x01(\x0cH\x03\x88\x01\x01\x42\x0e\n\x0c_descriptionB\x0b\n\t_outpointB\x07\n\x05_txidB\r\n\x0b_payment_id2\xe2 \n\x04Node\x12\x36\n\x07Getinfo\x12\x13.cln.GetinfoRequest\x1a\x14.cln.GetinfoResponse\"\x00\x12<\n\tListPeers\x12\x15.cln.ListpeersRequest\x1a\x16.cln.ListpeersResponse\"\x00\x12<\n\tListFunds\x12\x15.cln.ListfundsRequest\x1a\x16.cln.ListfundsResponse\"\x00\x12\x36\n\x07SendPay\x12\x13.cln.SendpayRequest\x1a\x14.cln.SendpayResponse\"\x00\x12\x45\n\x0cListChannels\x12\x18.cln.ListchannelsRequest\x1a\x19.cln.ListchannelsResponse\"\x00\x12<\n\tAddGossip\x12\x15.cln.AddgossipRequest\x1a\x16.cln.AddgossipResponse\"\x00\x12Q\n\x10\x41utoCleanInvoice\x12\x1c.cln.AutocleaninvoiceRequest\x1a\x1d.cln.AutocleaninvoiceResponse\"\x00\x12\x45\n\x0c\x43heckMessage\x12\x18.cln.CheckmessageRequest\x1a\x19.cln.CheckmessageResponse\"\x00\x12\x30\n\x05\x43lose\x12\x11.cln.CloseRequest\x1a\x12.cln.CloseResponse\"\x00\x12:\n\x0b\x43onnectPeer\x12\x13.cln.ConnectRequest\x1a\x14.cln.ConnectResponse\"\x00\x12H\n\rCreateInvoice\x12\x19.cln.CreateinvoiceRequest\x1a\x1a.cln.CreateinvoiceResponse\"\x00\x12<\n\tDatastore\x12\x15.cln.DatastoreRequest\x1a\x16.cln.DatastoreResponse\"\x00\x12K\n\x0e\x44\x61tastoreUsage\x12\x1a.cln.DatastoreusageRequest\x1a\x1b.cln.DatastoreusageResponse\"\x00\x12\x42\n\x0b\x43reateOnion\x12\x17.cln.CreateonionRequest\x1a\x18.cln.CreateonionResponse\"\x00\x12\x45\n\x0c\x44\x65lDatastore\x12\x18.cln.DeldatastoreRequest\x1a\x19.cln.DeldatastoreResponse\"\x00\x12T\n\x11\x44\x65lExpiredInvoice\x12\x1d.cln.DelexpiredinvoiceRequest\x1a\x1e.cln.DelexpiredinvoiceResponse\"\x00\x12?\n\nDelInvoice\x12\x16.cln.DelinvoiceRequest\x1a\x17.cln.DelinvoiceResponse\"\x00\x12\x36\n\x07Invoice\x12\x13.cln.InvoiceRequest\x1a\x14.cln.InvoiceResponse\"\x00\x12H\n\rListDatastore\x12\x19.cln.ListdatastoreRequest\x1a\x1a.cln.ListdatastoreResponse\"\x00\x12\x45\n\x0cListInvoices\x12\x18.cln.ListinvoicesRequest\x1a\x19.cln.ListinvoicesResponse\"\x00\x12<\n\tSendOnion\x12\x15.cln.SendonionRequest\x1a\x16.cln.SendonionResponse\"\x00\x12\x45\n\x0cListSendPays\x12\x18.cln.ListsendpaysRequest\x1a\x19.cln.ListsendpaysResponse\"\x00\x12Q\n\x10ListTransactions\x12\x1c.cln.ListtransactionsRequest\x1a\x1d.cln.ListtransactionsResponse\"\x00\x12*\n\x03Pay\x12\x0f.cln.PayRequest\x1a\x10.cln.PayResponse\"\x00\x12<\n\tListNodes\x12\x15.cln.ListnodesRequest\x1a\x16.cln.ListnodesResponse\"\x00\x12K\n\x0eWaitAnyInvoice\x12\x1a.cln.WaitanyinvoiceRequest\x1a\x1b.cln.WaitanyinvoiceResponse\"\x00\x12\x42\n\x0bWaitInvoice\x12\x17.cln.WaitinvoiceRequest\x1a\x18.cln.WaitinvoiceResponse\"\x00\x12\x42\n\x0bWaitSendPay\x12\x17.cln.WaitsendpayRequest\x1a\x18.cln.WaitsendpayResponse\"\x00\x12\x36\n\x07NewAddr\x12\x13.cln.NewaddrRequest\x1a\x14.cln.NewaddrResponse\"\x00\x12\x39\n\x08Withdraw\x12\x14.cln.WithdrawRequest\x1a\x15.cln.WithdrawResponse\"\x00\x12\x36\n\x07KeySend\x12\x13.cln.KeysendRequest\x1a\x14.cln.KeysendResponse\"\x00\x12\x39\n\x08\x46undPsbt\x12\x14.cln.FundpsbtRequest\x1a\x15.cln.FundpsbtResponse\"\x00\x12\x39\n\x08SendPsbt\x12\x14.cln.SendpsbtRequest\x1a\x15.cln.SendpsbtResponse\"\x00\x12\x39\n\x08SignPsbt\x12\x14.cln.SignpsbtRequest\x1a\x15.cln.SignpsbtResponse\"\x00\x12\x39\n\x08UtxoPsbt\x12\x14.cln.UtxopsbtRequest\x1a\x15.cln.UtxopsbtResponse\"\x00\x12<\n\tTxDiscard\x12\x15.cln.TxdiscardRequest\x1a\x16.cln.TxdiscardResponse\"\x00\x12<\n\tTxPrepare\x12\x15.cln.TxprepareRequest\x1a\x16.cln.TxprepareResponse\"\x00\x12\x33\n\x06TxSend\x12\x12.cln.TxsendRequest\x1a\x13.cln.TxsendResponse\"\x00\x12Q\n\x10ListPeerChannels\x12\x1c.cln.ListpeerchannelsRequest\x1a\x1d.cln.ListpeerchannelsResponse\"\x00\x12W\n\x12ListClosedChannels\x12\x1e.cln.ListclosedchannelsRequest\x1a\x1f.cln.ListclosedchannelsResponse\"\x00\x12<\n\tDecodePay\x12\x15.cln.DecodepayRequest\x1a\x16.cln.DecodepayResponse\"\x00\x12\x33\n\x06\x44\x65\x63ode\x12\x12.cln.DecodeRequest\x1a\x13.cln.DecodeResponse\"\x00\x12?\n\nDisconnect\x12\x16.cln.DisconnectRequest\x1a\x17.cln.DisconnectResponse\"\x00\x12\x39\n\x08\x46\x65\x65rates\x12\x14.cln.FeeratesRequest\x1a\x15.cln.FeeratesResponse\"\x00\x12\x45\n\x0c\x46\x65tchInvoice\x12\x18.cln.FetchinvoiceRequest\x1a\x19.cln.FetchinvoiceResponse\"\x00\x12\x42\n\x0b\x46undChannel\x12\x17.cln.FundchannelRequest\x1a\x18.cln.FundchannelResponse\"\x00\x12\x39\n\x08GetRoute\x12\x14.cln.GetrouteRequest\x1a\x15.cln.GetrouteResponse\"\x00\x12\x45\n\x0cListForwards\x12\x18.cln.ListforwardsRequest\x1a\x19.cln.ListforwardsResponse\"\x00\x12?\n\nListOffers\x12\x16.cln.ListoffersRequest\x1a\x17.cln.ListoffersResponse\"\x00\x12\x39\n\x08ListPays\x12\x14.cln.ListpaysRequest\x1a\x15.cln.ListpaysResponse\"\x00\x12<\n\tListHtlcs\x12\x15.cln.ListhtlcsRequest\x1a\x16.cln.ListhtlcsResponse\"\x00\x12\x30\n\x05Offer\x12\x11.cln.OfferRequest\x1a\x12.cln.OfferResponse\"\x00\x12-\n\x04Ping\x12\x10.cln.PingRequest\x1a\x11.cln.PingResponse\"\x00\x12H\n\rSendCustomMsg\x12\x19.cln.SendcustommsgRequest\x1a\x1a.cln.SendcustommsgResponse\"\x00\x12?\n\nSetChannel\x12\x16.cln.SetchannelRequest\x1a\x17.cln.SetchannelResponse\"\x00\x12\x42\n\x0bSignInvoice\x12\x17.cln.SigninvoiceRequest\x1a\x18.cln.SigninvoiceResponse\"\x00\x12\x42\n\x0bSignMessage\x12\x17.cln.SignmessageRequest\x1a\x18.cln.SignmessageResponse\"\x00\x12N\n\x0fWaitBlockHeight\x12\x1b.cln.WaitblockheightRequest\x1a\x1c.cln.WaitblockheightResponse\"\x00\x12-\n\x04Wait\x12\x10.cln.WaitRequest\x1a\x11.cln.WaitResponse\"\x00\x12-\n\x04Stop\x12\x10.cln.StopRequest\x1a\x11.cln.StopResponse\"\x00\x12T\n\x11PreApproveKeysend\x12\x1d.cln.PreapprovekeysendRequest\x1a\x1e.cln.PreapprovekeysendResponse\"\x00\x12T\n\x11PreApproveInvoice\x12\x1d.cln.PreapproveinvoiceRequest\x1a\x1e.cln.PreapproveinvoiceResponse\"\x00\x12\x45\n\x0cStaticBackup\x12\x18.cln.StaticbackupRequest\x1a\x19.cln.StaticbackupResponse\"\x00\x12K\n\x0e\x42kprListIncome\x12\x1a.cln.BkprlistincomeRequest\x1a\x1b.cln.BkprlistincomeResponse\"\x00\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\nnode.proto\x12\x03\x63ln\x1a\x10primitives.proto\"\x10\n\x0eGetinfoRequest\"\xc1\x04\n\x0fGetinfoResponse\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x12\n\x05\x61lias\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\r\n\x05\x63olor\x18\x03 \x01(\x0c\x12\x11\n\tnum_peers\x18\x04 \x01(\r\x12\x1c\n\x14num_pending_channels\x18\x05 \x01(\r\x12\x1b\n\x13num_active_channels\x18\x06 \x01(\r\x12\x1d\n\x15num_inactive_channels\x18\x07 \x01(\r\x12\x0f\n\x07version\x18\x08 \x01(\t\x12\x15\n\rlightning_dir\x18\t \x01(\t\x12\x33\n\x0cour_features\x18\n \x01(\x0b\x32\x18.cln.GetinfoOur_featuresH\x01\x88\x01\x01\x12\x13\n\x0b\x62lockheight\x18\x0b \x01(\r\x12\x0f\n\x07network\x18\x0c \x01(\t\x12(\n\x13\x66\x65\x65s_collected_msat\x18\r \x01(\x0b\x32\x0b.cln.Amount\x12$\n\x07\x61\x64\x64ress\x18\x0e \x03(\x0b\x32\x13.cln.GetinfoAddress\x12$\n\x07\x62inding\x18\x0f \x03(\x0b\x32\x13.cln.GetinfoBinding\x12\"\n\x15warning_bitcoind_sync\x18\x10 \x01(\tH\x02\x88\x01\x01\x12$\n\x17warning_lightningd_sync\x18\x11 \x01(\tH\x03\x88\x01\x01\x42\x08\n\x06_aliasB\x0f\n\r_our_featuresB\x18\n\x16_warning_bitcoind_syncB\x1a\n\x18_warning_lightningd_sync\"S\n\x13GetinfoOur_features\x12\x0c\n\x04init\x18\x01 \x01(\x0c\x12\x0c\n\x04node\x18\x02 \x01(\x0c\x12\x0f\n\x07\x63hannel\x18\x03 \x01(\x0c\x12\x0f\n\x07invoice\x18\x04 \x01(\x0c\"\xc4\x01\n\x0eGetinfoAddress\x12\x39\n\titem_type\x18\x01 \x01(\x0e\x32&.cln.GetinfoAddress.GetinfoAddressType\x12\x0c\n\x04port\x18\x02 \x01(\r\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x00\x88\x01\x01\"G\n\x12GetinfoAddressType\x12\x07\n\x03\x44NS\x10\x00\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\n\n\x08_address\"\x8a\x02\n\x0eGetinfoBinding\x12\x39\n\titem_type\x18\x01 \x01(\x0e\x32&.cln.GetinfoBinding.GetinfoBindingType\x12\x14\n\x07\x61\x64\x64ress\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04port\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x13\n\x06socket\x18\x04 \x01(\tH\x02\x88\x01\x01\"_\n\x12GetinfoBindingType\x12\x10\n\x0cLOCAL_SOCKET\x10\x00\x12\r\n\tWEBSOCKET\x10\x05\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\n\n\x08_addressB\x07\n\x05_portB\t\n\x07_socket\"\xaa\x01\n\x10ListpeersRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x38\n\x05level\x18\x02 \x01(\x0e\x32$.cln.ListpeersRequest.ListpeersLevelH\x01\x88\x01\x01\":\n\x0eListpeersLevel\x12\x06\n\x02IO\x10\x00\x12\t\n\x05\x44\x45\x42UG\x10\x01\x12\x08\n\x04INFO\x10\x02\x12\x0b\n\x07UNUSUAL\x10\x03\x42\x05\n\x03_idB\x08\n\x06_level\"7\n\x11ListpeersResponse\x12\"\n\x05peers\x18\x01 \x03(\x0b\x32\x13.cln.ListpeersPeers\"\x8e\x02\n\x0eListpeersPeers\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x11\n\tconnected\x18\x02 \x01(\x08\x12\x19\n\x0cnum_channels\x18\x08 \x01(\rH\x00\x88\x01\x01\x12#\n\x03log\x18\x03 \x03(\x0b\x32\x16.cln.ListpeersPeersLog\x12-\n\x08\x63hannels\x18\x04 \x03(\x0b\x32\x1b.cln.ListpeersPeersChannels\x12\x0f\n\x07netaddr\x18\x05 \x03(\t\x12\x18\n\x0bremote_addr\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x15\n\x08\x66\x65\x61tures\x18\x06 \x01(\x0cH\x02\x88\x01\x01\x42\x0f\n\r_num_channelsB\x0e\n\x0c_remote_addrB\x0b\n\t_features\"\xfd\x02\n\x11ListpeersPeersLog\x12?\n\titem_type\x18\x01 \x01(\x0e\x32,.cln.ListpeersPeersLog.ListpeersPeersLogType\x12\x18\n\x0bnum_skipped\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x11\n\x04time\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06source\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x10\n\x03log\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x14\n\x07node_id\x18\x06 \x01(\x0cH\x04\x88\x01\x01\x12\x11\n\x04\x64\x61ta\x18\x07 \x01(\x0cH\x05\x88\x01\x01\"i\n\x15ListpeersPeersLogType\x12\x0b\n\x07SKIPPED\x10\x00\x12\n\n\x06\x42ROKEN\x10\x01\x12\x0b\n\x07UNUSUAL\x10\x02\x12\x08\n\x04INFO\x10\x03\x12\t\n\x05\x44\x45\x42UG\x10\x04\x12\t\n\x05IO_IN\x10\x05\x12\n\n\x06IO_OUT\x10\x06\x42\x0e\n\x0c_num_skippedB\x07\n\x05_timeB\t\n\x07_sourceB\x06\n\x04_logB\n\n\x08_node_idB\x07\n\x05_data\"\x95\x18\n\x16ListpeersPeersChannels\x12\x46\n\x05state\x18\x01 \x01(\x0e\x32\x37.cln.ListpeersPeersChannels.ListpeersPeersChannelsState\x12\x19\n\x0cscratch_txid\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x38\n\x07\x66\x65\x65rate\x18\x03 \x01(\x0b\x32\".cln.ListpeersPeersChannelsFeerateH\x01\x88\x01\x01\x12\x12\n\x05owner\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x1d\n\x10short_channel_id\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x17\n\nchannel_id\x18\x06 \x01(\x0cH\x04\x88\x01\x01\x12\x19\n\x0c\x66unding_txid\x18\x07 \x01(\x0cH\x05\x88\x01\x01\x12\x1b\n\x0e\x66unding_outnum\x18\x08 \x01(\rH\x06\x88\x01\x01\x12\x1c\n\x0finitial_feerate\x18\t \x01(\tH\x07\x88\x01\x01\x12\x19\n\x0clast_feerate\x18\n \x01(\tH\x08\x88\x01\x01\x12\x19\n\x0cnext_feerate\x18\x0b \x01(\tH\t\x88\x01\x01\x12\x1a\n\rnext_fee_step\x18\x0c \x01(\rH\n\x88\x01\x01\x12\x35\n\x08inflight\x18\r \x03(\x0b\x32#.cln.ListpeersPeersChannelsInflight\x12\x15\n\x08\x63lose_to\x18\x0e \x01(\x0cH\x0b\x88\x01\x01\x12\x14\n\x07private\x18\x0f \x01(\x08H\x0c\x88\x01\x01\x12 \n\x06opener\x18\x10 \x01(\x0e\x32\x10.cln.ChannelSide\x12%\n\x06\x63loser\x18\x11 \x01(\x0e\x32\x10.cln.ChannelSideH\r\x88\x01\x01\x12\x10\n\x08\x66\x65\x61tures\x18\x12 \x03(\t\x12\x38\n\x07\x66unding\x18\x13 \x01(\x0b\x32\".cln.ListpeersPeersChannelsFundingH\x0e\x88\x01\x01\x12$\n\nto_us_msat\x18\x14 \x01(\x0b\x32\x0b.cln.AmountH\x0f\x88\x01\x01\x12(\n\x0emin_to_us_msat\x18\x15 \x01(\x0b\x32\x0b.cln.AmountH\x10\x88\x01\x01\x12(\n\x0emax_to_us_msat\x18\x16 \x01(\x0b\x32\x0b.cln.AmountH\x11\x88\x01\x01\x12$\n\ntotal_msat\x18\x17 \x01(\x0b\x32\x0b.cln.AmountH\x12\x88\x01\x01\x12\'\n\rfee_base_msat\x18\x18 \x01(\x0b\x32\x0b.cln.AmountH\x13\x88\x01\x01\x12(\n\x1b\x66\x65\x65_proportional_millionths\x18\x19 \x01(\rH\x14\x88\x01\x01\x12)\n\x0f\x64ust_limit_msat\x18\x1a \x01(\x0b\x32\x0b.cln.AmountH\x15\x88\x01\x01\x12\x30\n\x16max_total_htlc_in_msat\x18\x1b \x01(\x0b\x32\x0b.cln.AmountH\x16\x88\x01\x01\x12,\n\x12their_reserve_msat\x18\x1c \x01(\x0b\x32\x0b.cln.AmountH\x17\x88\x01\x01\x12*\n\x10our_reserve_msat\x18\x1d \x01(\x0b\x32\x0b.cln.AmountH\x18\x88\x01\x01\x12(\n\x0espendable_msat\x18\x1e \x01(\x0b\x32\x0b.cln.AmountH\x19\x88\x01\x01\x12)\n\x0freceivable_msat\x18\x1f \x01(\x0b\x32\x0b.cln.AmountH\x1a\x88\x01\x01\x12.\n\x14minimum_htlc_in_msat\x18 \x01(\x0b\x32\x0b.cln.AmountH\x1b\x88\x01\x01\x12/\n\x15minimum_htlc_out_msat\x18\x30 \x01(\x0b\x32\x0b.cln.AmountH\x1c\x88\x01\x01\x12/\n\x15maximum_htlc_out_msat\x18\x31 \x01(\x0b\x32\x0b.cln.AmountH\x1d\x88\x01\x01\x12 \n\x13their_to_self_delay\x18! \x01(\rH\x1e\x88\x01\x01\x12\x1e\n\x11our_to_self_delay\x18\" \x01(\rH\x1f\x88\x01\x01\x12\x1f\n\x12max_accepted_htlcs\x18# \x01(\rH \x88\x01\x01\x12\x34\n\x05\x61lias\x18\x32 \x01(\x0b\x32 .cln.ListpeersPeersChannelsAliasH!\x88\x01\x01\x12\x0e\n\x06status\x18% \x03(\t\x12 \n\x13in_payments_offered\x18& \x01(\x04H\"\x88\x01\x01\x12)\n\x0fin_offered_msat\x18\' \x01(\x0b\x32\x0b.cln.AmountH#\x88\x01\x01\x12\"\n\x15in_payments_fulfilled\x18( \x01(\x04H$\x88\x01\x01\x12+\n\x11in_fulfilled_msat\x18) \x01(\x0b\x32\x0b.cln.AmountH%\x88\x01\x01\x12!\n\x14out_payments_offered\x18* \x01(\x04H&\x88\x01\x01\x12*\n\x10out_offered_msat\x18+ \x01(\x0b\x32\x0b.cln.AmountH\'\x88\x01\x01\x12#\n\x16out_payments_fulfilled\x18, \x01(\x04H(\x88\x01\x01\x12,\n\x12out_fulfilled_msat\x18- \x01(\x0b\x32\x0b.cln.AmountH)\x88\x01\x01\x12/\n\x05htlcs\x18. \x03(\x0b\x32 .cln.ListpeersPeersChannelsHtlcs\x12\x1a\n\rclose_to_addr\x18/ \x01(\tH*\x88\x01\x01\"\xe0\x02\n\x1bListpeersPeersChannelsState\x12\x0c\n\x08OPENINGD\x10\x00\x12\x1c\n\x18\x43HANNELD_AWAITING_LOCKIN\x10\x01\x12\x13\n\x0f\x43HANNELD_NORMAL\x10\x02\x12\x1a\n\x16\x43HANNELD_SHUTTING_DOWN\x10\x03\x12\x18\n\x14\x43LOSINGD_SIGEXCHANGE\x10\x04\x12\x15\n\x11\x43LOSINGD_COMPLETE\x10\x05\x12\x17\n\x13\x41WAITING_UNILATERAL\x10\x06\x12\x16\n\x12\x46UNDING_SPEND_SEEN\x10\x07\x12\x0b\n\x07ONCHAIN\x10\x08\x12\x17\n\x13\x44UALOPEND_OPEN_INIT\x10\t\x12\x1d\n\x19\x44UALOPEND_AWAITING_LOCKIN\x10\n\x12\x1c\n\x18\x44UALOPEND_OPEN_COMMITTED\x10\x0b\x12\x1f\n\x1b\x44UALOPEND_OPEN_COMMIT_READY\x10\x0c\x42\x0f\n\r_scratch_txidB\n\n\x08_feerateB\x08\n\x06_ownerB\x13\n\x11_short_channel_idB\r\n\x0b_channel_idB\x0f\n\r_funding_txidB\x11\n\x0f_funding_outnumB\x12\n\x10_initial_feerateB\x0f\n\r_last_feerateB\x0f\n\r_next_feerateB\x10\n\x0e_next_fee_stepB\x0b\n\t_close_toB\n\n\x08_privateB\t\n\x07_closerB\n\n\x08_fundingB\r\n\x0b_to_us_msatB\x11\n\x0f_min_to_us_msatB\x11\n\x0f_max_to_us_msatB\r\n\x0b_total_msatB\x10\n\x0e_fee_base_msatB\x1e\n\x1c_fee_proportional_millionthsB\x12\n\x10_dust_limit_msatB\x19\n\x17_max_total_htlc_in_msatB\x15\n\x13_their_reserve_msatB\x13\n\x11_our_reserve_msatB\x11\n\x0f_spendable_msatB\x12\n\x10_receivable_msatB\x17\n\x15_minimum_htlc_in_msatB\x18\n\x16_minimum_htlc_out_msatB\x18\n\x16_maximum_htlc_out_msatB\x16\n\x14_their_to_self_delayB\x14\n\x12_our_to_self_delayB\x15\n\x13_max_accepted_htlcsB\x08\n\x06_aliasB\x16\n\x14_in_payments_offeredB\x12\n\x10_in_offered_msatB\x18\n\x16_in_payments_fulfilledB\x14\n\x12_in_fulfilled_msatB\x17\n\x15_out_payments_offeredB\x13\n\x11_out_offered_msatB\x19\n\x17_out_payments_fulfilledB\x15\n\x13_out_fulfilled_msatB\x10\n\x0e_close_to_addr\"=\n\x1dListpeersPeersChannelsFeerate\x12\r\n\x05perkw\x18\x01 \x01(\r\x12\r\n\x05perkb\x18\x02 \x01(\r\"\xf3\x01\n\x1eListpeersPeersChannelsInflight\x12\x14\n\x0c\x66unding_txid\x18\x01 \x01(\x0c\x12\x16\n\x0e\x66unding_outnum\x18\x02 \x01(\r\x12\x0f\n\x07\x66\x65\x65rate\x18\x03 \x01(\t\x12\'\n\x12total_funding_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10our_funding_msat\x18\x05 \x01(\x0b\x32\x0b.cln.Amount\x12\x1a\n\rsplice_amount\x18\x07 \x01(\x12H\x00\x88\x01\x01\x12\x14\n\x0cscratch_txid\x18\x06 \x01(\x0c\x42\x10\n\x0e_splice_amount\"\x9b\x02\n\x1dListpeersPeersChannelsFunding\x12%\n\x0bpushed_msat\x18\x03 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12%\n\x10local_funds_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12&\n\x11remote_funds_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\'\n\rfee_paid_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\'\n\rfee_rcvd_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x42\x0e\n\x0c_pushed_msatB\x10\n\x0e_fee_paid_msatB\x10\n\x0e_fee_rcvd_msat\"[\n\x1bListpeersPeersChannelsAlias\x12\x12\n\x05local\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06remote\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_localB\t\n\x07_remote\"\xf1\x02\n\x1bListpeersPeersChannelsHtlcs\x12X\n\tdirection\x18\x01 \x01(\x0e\x32\x45.cln.ListpeersPeersChannelsHtlcs.ListpeersPeersChannelsHtlcsDirection\x12\n\n\x02id\x18\x02 \x01(\x04\x12 \n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x0e\n\x06\x65xpiry\x18\x04 \x01(\r\x12\x14\n\x0cpayment_hash\x18\x05 \x01(\x0c\x12\x1a\n\rlocal_trimmed\x18\x06 \x01(\x08H\x00\x88\x01\x01\x12\x13\n\x06status\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x1d\n\x05state\x18\x08 \x01(\x0e\x32\x0e.cln.HtlcState\"7\n$ListpeersPeersChannelsHtlcsDirection\x12\x06\n\x02IN\x10\x00\x12\x07\n\x03OUT\x10\x01\x42\x10\n\x0e_local_trimmedB\t\n\x07_status\"0\n\x10ListfundsRequest\x12\x12\n\x05spent\x18\x01 \x01(\x08H\x00\x88\x01\x01\x42\x08\n\x06_spent\"e\n\x11ListfundsResponse\x12&\n\x07outputs\x18\x01 \x03(\x0b\x32\x15.cln.ListfundsOutputs\x12(\n\x08\x63hannels\x18\x02 \x03(\x0b\x32\x16.cln.ListfundsChannels\"\x83\x03\n\x10ListfundsOutputs\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x0e\n\x06output\x18\x02 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x14\n\x0cscriptpubkey\x18\x04 \x01(\x0c\x12\x14\n\x07\x61\x64\x64ress\x18\x05 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0credeemscript\x18\x06 \x01(\x0cH\x01\x88\x01\x01\x12<\n\x06status\x18\x07 \x01(\x0e\x32,.cln.ListfundsOutputs.ListfundsOutputsStatus\x12\x10\n\x08reserved\x18\t \x01(\x08\x12\x18\n\x0b\x62lockheight\x18\x08 \x01(\rH\x02\x88\x01\x01\"Q\n\x16ListfundsOutputsStatus\x12\x0f\n\x0bUNCONFIRMED\x10\x00\x12\r\n\tCONFIRMED\x10\x01\x12\t\n\x05SPENT\x10\x02\x12\x0c\n\x08IMMATURE\x10\x03\x42\n\n\x08_addressB\x0f\n\r_redeemscriptB\x0e\n\x0c_blockheight\"\xab\x02\n\x11ListfundsChannels\x12\x0f\n\x07peer_id\x18\x01 \x01(\x0c\x12$\n\x0four_amount_msat\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\x12 \n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x14\n\x0c\x66unding_txid\x18\x04 \x01(\x0c\x12\x16\n\x0e\x66unding_output\x18\x05 \x01(\r\x12\x11\n\tconnected\x18\x06 \x01(\x08\x12 \n\x05state\x18\x07 \x01(\x0e\x32\x11.cln.ChannelState\x12\x17\n\nchannel_id\x18\t \x01(\x0cH\x00\x88\x01\x01\x12\x1d\n\x10short_channel_id\x18\x08 \x01(\tH\x01\x88\x01\x01\x42\r\n\x0b_channel_idB\x13\n\x11_short_channel_id\"\xbb\x03\n\x0eSendpayRequest\x12 \n\x05route\x18\x01 \x03(\x0b\x32\x11.cln.SendpayRoute\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\x0c\x12\x12\n\x05label\x18\x03 \x01(\tH\x00\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x1b\n\x0epayment_secret\x18\x06 \x01(\x0cH\x03\x88\x01\x01\x12\x13\n\x06partid\x18\x07 \x01(\x04H\x04\x88\x01\x01\x12\x1a\n\rlocalinvreqid\x18\x0b \x01(\x0cH\x05\x88\x01\x01\x12\x14\n\x07groupid\x18\t \x01(\x04H\x06\x88\x01\x01\x12\x1d\n\x10payment_metadata\x18\x0c \x01(\x0cH\x07\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\r \x01(\tH\x08\x88\x01\x01\x42\x08\n\x06_labelB\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\x11\n\x0f_payment_secretB\t\n\x07_partidB\x10\n\x0e_localinvreqidB\n\n\x08_groupidB\x13\n\x11_payment_metadataB\x0e\n\x0c_description\"\xad\x05\n\x0fSendpayResponse\x12\x1a\n\rcreated_index\x18\x10 \x01(\x04H\x00\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x11 \x01(\x04H\x01\x88\x01\x01\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x14\n\x07groupid\x18\x02 \x01(\x04H\x02\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x32\n\x06status\x18\x04 \x01(\x0e\x32\".cln.SendpayResponse.SendpayStatus\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x06 \x01(\x0cH\x04\x88\x01\x01\x12\x12\n\ncreated_at\x18\x07 \x01(\x04\x12\x19\n\x0c\x63ompleted_at\x18\x0f \x01(\x04H\x05\x88\x01\x01\x12%\n\x10\x61mount_sent_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\t \x01(\tH\x06\x88\x01\x01\x12\x13\n\x06partid\x18\n \x01(\x04H\x07\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x0b \x01(\tH\x08\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x0c \x01(\tH\t\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\r \x01(\x0cH\n\x88\x01\x01\x12\x14\n\x07message\x18\x0e \x01(\tH\x0b\x88\x01\x01\"*\n\rSendpayStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x42\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\n\n\x08_groupidB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x0f\n\r_completed_atB\x08\n\x06_labelB\t\n\x07_partidB\t\n\x07_bolt11B\t\n\x07_bolt12B\x13\n\x11_payment_preimageB\n\n\x08_message\"\\\n\x0cSendpayRoute\x12\n\n\x02id\x18\x02 \x01(\x0c\x12\x0f\n\x07\x63hannel\x18\x04 \x01(\t\x12\r\n\x05\x64\x65lay\x18\x03 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.Amount\"\x93\x01\n\x13ListchannelsRequest\x12\x1d\n\x10short_channel_id\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06source\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x03 \x01(\x0cH\x02\x88\x01\x01\x42\x13\n\x11_short_channel_idB\t\n\x07_sourceB\x0e\n\x0c_destination\"C\n\x14ListchannelsResponse\x12+\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x19.cln.ListchannelsChannels\"\xb3\x03\n\x14ListchannelsChannels\x12\x0e\n\x06source\x18\x01 \x01(\x0c\x12\x13\n\x0b\x64\x65stination\x18\x02 \x01(\x0c\x12\x18\n\x10short_channel_id\x18\x03 \x01(\t\x12\x11\n\tdirection\x18\x10 \x01(\r\x12\x0e\n\x06public\x18\x04 \x01(\x08\x12 \n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.Amount\x12\x15\n\rmessage_flags\x18\x06 \x01(\r\x12\x15\n\rchannel_flags\x18\x07 \x01(\r\x12\x0e\n\x06\x61\x63tive\x18\x08 \x01(\x08\x12\x13\n\x0blast_update\x18\t \x01(\r\x12\x1d\n\x15\x62\x61se_fee_millisatoshi\x18\n \x01(\r\x12\x19\n\x11\x66\x65\x65_per_millionth\x18\x0b \x01(\r\x12\r\n\x05\x64\x65lay\x18\x0c \x01(\r\x12&\n\x11htlc_minimum_msat\x18\r \x01(\x0b\x32\x0b.cln.Amount\x12+\n\x11htlc_maximum_msat\x18\x0e \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x10\n\x08\x66\x65\x61tures\x18\x0f \x01(\x0c\x42\x14\n\x12_htlc_maximum_msat\"#\n\x10\x41\x64\x64gossipRequest\x12\x0f\n\x07message\x18\x01 \x01(\x0c\"\x13\n\x11\x41\x64\x64gossipResponse\"o\n\x17\x41utocleaninvoiceRequest\x12\x17\n\nexpired_by\x18\x01 \x01(\x04H\x00\x88\x01\x01\x12\x1a\n\rcycle_seconds\x18\x02 \x01(\x04H\x01\x88\x01\x01\x42\r\n\x0b_expired_byB\x10\n\x0e_cycle_seconds\"\x81\x01\n\x18\x41utocleaninvoiceResponse\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\x17\n\nexpired_by\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x1a\n\rcycle_seconds\x18\x03 \x01(\x04H\x01\x88\x01\x01\x42\r\n\x0b_expired_byB\x10\n\x0e_cycle_seconds\"U\n\x13\x43heckmessageRequest\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\r\n\x05zbase\x18\x02 \x01(\t\x12\x13\n\x06pubkey\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x42\t\n\x07_pubkey\"8\n\x14\x43heckmessageResponse\x12\x10\n\x08verified\x18\x01 \x01(\x08\x12\x0e\n\x06pubkey\x18\x02 \x01(\x0c\"\xcb\x02\n\x0c\x43loseRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x1e\n\x11unilateraltimeout\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x03 \x01(\tH\x01\x88\x01\x01\x12!\n\x14\x66\x65\x65_negotiation_step\x18\x04 \x01(\tH\x02\x88\x01\x01\x12)\n\rwrong_funding\x18\x05 \x01(\x0b\x32\r.cln.OutpointH\x03\x88\x01\x01\x12\x1f\n\x12\x66orce_lease_closed\x18\x06 \x01(\x08H\x04\x88\x01\x01\x12\x1e\n\x08\x66\x65\x65range\x18\x07 \x03(\x0b\x32\x0c.cln.FeerateB\x14\n\x12_unilateraltimeoutB\x0e\n\x0c_destinationB\x17\n\x15_fee_negotiation_stepB\x10\n\x0e_wrong_fundingB\x15\n\x13_force_lease_closed\"\xab\x01\n\rCloseResponse\x12/\n\titem_type\x18\x01 \x01(\x0e\x32\x1c.cln.CloseResponse.CloseType\x12\x0f\n\x02tx\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x11\n\x04txid\x18\x03 \x01(\x0cH\x01\x88\x01\x01\"5\n\tCloseType\x12\n\n\x06MUTUAL\x10\x00\x12\x0e\n\nUNILATERAL\x10\x01\x12\x0c\n\x08UNOPENED\x10\x02\x42\x05\n\x03_txB\x07\n\x05_txid\"T\n\x0e\x43onnectRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\x04host\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04port\x18\x03 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_hostB\x07\n\x05_port\"\xb4\x01\n\x0f\x43onnectResponse\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x10\n\x08\x66\x65\x61tures\x18\x02 \x01(\x0c\x12\x38\n\tdirection\x18\x03 \x01(\x0e\x32%.cln.ConnectResponse.ConnectDirection\x12$\n\x07\x61\x64\x64ress\x18\x04 \x01(\x0b\x32\x13.cln.ConnectAddress\"#\n\x10\x43onnectDirection\x12\x06\n\x02IN\x10\x00\x12\x07\n\x03OUT\x10\x01\"\xfb\x01\n\x0e\x43onnectAddress\x12\x39\n\titem_type\x18\x01 \x01(\x0e\x32&.cln.ConnectAddress.ConnectAddressType\x12\x13\n\x06socket\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x11\n\x04port\x18\x04 \x01(\rH\x02\x88\x01\x01\"P\n\x12\x43onnectAddressType\x12\x10\n\x0cLOCAL_SOCKET\x10\x00\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\t\n\x07_socketB\n\n\x08_addressB\x07\n\x05_port\"J\n\x14\x43reateinvoiceRequest\x12\x11\n\tinvstring\x18\x01 \x01(\t\x12\r\n\x05label\x18\x02 \x01(\t\x12\x10\n\x08preimage\x18\x03 \x01(\x0c\"\xfe\x05\n\x15\x43reateinvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x06\x62olt11\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x04 \x01(\x0c\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12>\n\x06status\x18\x06 \x01(\x0e\x32..cln.CreateinvoiceResponse.CreateinvoiceStatus\x12\x13\n\x0b\x64\x65scription\x18\x07 \x01(\t\x12\x12\n\nexpires_at\x18\x08 \x01(\x04\x12\x1a\n\rcreated_index\x18\x10 \x01(\x04H\x03\x88\x01\x01\x12\x16\n\tpay_index\x18\t \x01(\x04H\x04\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x05\x88\x01\x01\x12\x14\n\x07paid_at\x18\x0b \x01(\x04H\x06\x88\x01\x01\x12;\n\rpaid_outpoint\x18\x11 \x01(\x0b\x32\x1f.cln.CreateinvoicePaid_outpointH\x07\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\x08\x88\x01\x01\x12\x1b\n\x0elocal_offer_id\x18\r \x01(\x0cH\t\x88\x01\x01\x12\x1e\n\x11invreq_payer_note\x18\x0f \x01(\tH\n\x88\x01\x01\"8\n\x13\x43reateinvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x12\n\n\x06UNPAID\x10\x02\x42\t\n\x07_bolt11B\t\n\x07_bolt12B\x0e\n\x0c_amount_msatB\x10\n\x0e_created_indexB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x10\n\x0e_paid_outpointB\x13\n\x11_payment_preimageB\x11\n\x0f_local_offer_idB\x14\n\x12_invreq_payer_note\"X\n\x1a\x43reateinvoicePaid_outpoint\x12\x11\n\x04txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x13\n\x06outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_txidB\t\n\x07_outnum\"\xb4\x02\n\x10\x44\x61tastoreRequest\x12\x0b\n\x03key\x18\x05 \x03(\t\x12\x13\n\x06string\x18\x06 \x01(\tH\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12\x36\n\x04mode\x18\x03 \x01(\x0e\x32#.cln.DatastoreRequest.DatastoreModeH\x02\x88\x01\x01\x12\x17\n\ngeneration\x18\x04 \x01(\x04H\x03\x88\x01\x01\"p\n\rDatastoreMode\x12\x0f\n\x0bMUST_CREATE\x10\x00\x12\x10\n\x0cMUST_REPLACE\x10\x01\x12\x15\n\x11\x43REATE_OR_REPLACE\x10\x02\x12\x0f\n\x0bMUST_APPEND\x10\x03\x12\x14\n\x10\x43REATE_OR_APPEND\x10\x04\x42\t\n\x07_stringB\x06\n\x04_hexB\x07\n\x05_modeB\r\n\x0b_generation\"\x82\x01\n\x11\x44\x61tastoreResponse\x12\x0b\n\x03key\x18\x05 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x12\x13\n\x06string\x18\x04 \x01(\tH\x02\x88\x01\x01\x42\r\n\x0b_generationB\x06\n\x04_hexB\t\n\x07_string\"$\n\x15\x44\x61tastoreusageRequest\x12\x0b\n\x03key\x18\x01 \x03(\t\"k\n\x16\x44\x61tastoreusageResponse\x12>\n\x0e\x64\x61tastoreusage\x18\x01 \x01(\x0b\x32!.cln.DatastoreusageDatastoreusageH\x00\x88\x01\x01\x42\x11\n\x0f_datastoreusage\"b\n\x1c\x44\x61tastoreusageDatastoreusage\x12\x10\n\x03key\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x18\n\x0btotal_bytes\x18\x02 \x01(\x04H\x01\x88\x01\x01\x42\x06\n\x04_keyB\x0e\n\x0c_total_bytes\"\x9d\x01\n\x12\x43reateonionRequest\x12\"\n\x04hops\x18\x01 \x03(\x0b\x32\x14.cln.CreateonionHops\x12\x11\n\tassocdata\x18\x02 \x01(\x0c\x12\x18\n\x0bsession_key\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x12\x17\n\nonion_size\x18\x04 \x01(\rH\x01\x88\x01\x01\x42\x0e\n\x0c_session_keyB\r\n\x0b_onion_size\"<\n\x13\x43reateonionResponse\x12\r\n\x05onion\x18\x01 \x01(\x0c\x12\x16\n\x0eshared_secrets\x18\x02 \x03(\x0c\"2\n\x0f\x43reateonionHops\x12\x0e\n\x06pubkey\x18\x01 \x01(\x0c\x12\x0f\n\x07payload\x18\x02 \x01(\x0c\"J\n\x13\x44\x65ldatastoreRequest\x12\x0b\n\x03key\x18\x03 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\r\n\x0b_generation\"\x85\x01\n\x14\x44\x65ldatastoreResponse\x12\x0b\n\x03key\x18\x05 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x12\x13\n\x06string\x18\x04 \x01(\tH\x02\x88\x01\x01\x42\r\n\x0b_generationB\x06\n\x04_hexB\t\n\x07_string\"H\n\x18\x44\x65lexpiredinvoiceRequest\x12\x1a\n\rmaxexpirytime\x18\x01 \x01(\x04H\x00\x88\x01\x01\x42\x10\n\x0e_maxexpirytime\"\x1b\n\x19\x44\x65lexpiredinvoiceResponse\"\xb6\x01\n\x11\x44\x65linvoiceRequest\x12\r\n\x05label\x18\x01 \x01(\t\x12\x37\n\x06status\x18\x02 \x01(\x0e\x32\'.cln.DelinvoiceRequest.DelinvoiceStatus\x12\x15\n\x08\x64\x65sconly\x18\x03 \x01(\x08H\x00\x88\x01\x01\"5\n\x10\x44\x65linvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x12\n\n\x06UNPAID\x10\x02\x42\x0b\n\t_desconly\"\xa1\x04\n\x12\x44\x65linvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x06\x62olt11\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x03 \x01(\tH\x01\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x06 \x01(\x0c\x12\x1a\n\rcreated_index\x18\x0c \x01(\x04H\x04\x88\x01\x01\x12\x1a\n\rupdated_index\x18\r \x01(\x04H\x05\x88\x01\x01\x12\x38\n\x06status\x18\x07 \x01(\x0e\x32(.cln.DelinvoiceResponse.DelinvoiceStatus\x12\x12\n\nexpires_at\x18\x08 \x01(\x04\x12\x1b\n\x0elocal_offer_id\x18\t \x01(\x0cH\x06\x88\x01\x01\x12\x1e\n\x11invreq_payer_note\x18\x0b \x01(\tH\x07\x88\x01\x01\"5\n\x10\x44\x65linvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x12\n\n\x06UNPAID\x10\x02\x42\t\n\x07_bolt11B\t\n\x07_bolt12B\x0e\n\x0c_amount_msatB\x0e\n\x0c_descriptionB\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\x11\n\x0f_local_offer_idB\x14\n\x12_invreq_payer_note\"\xfa\x01\n\x0eInvoiceRequest\x12%\n\x0b\x61mount_msat\x18\n \x01(\x0b\x32\x10.cln.AmountOrAny\x12\r\n\x05label\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x13\n\x06\x65xpiry\x18\x07 \x01(\x04H\x00\x88\x01\x01\x12\x11\n\tfallbacks\x18\x04 \x03(\t\x12\x15\n\x08preimage\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x11\n\x04\x63ltv\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x19\n\x0c\x64\x65schashonly\x18\t \x01(\x08H\x03\x88\x01\x01\x42\t\n\x07_expiryB\x0b\n\t_preimageB\x07\n\x05_cltvB\x0f\n\r_deschashonly\"\x95\x03\n\x0fInvoiceResponse\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\x0c\x12\x16\n\x0epayment_secret\x18\x03 \x01(\x0c\x12\x12\n\nexpires_at\x18\x04 \x01(\x04\x12\x1a\n\rcreated_index\x18\n \x01(\x04H\x00\x88\x01\x01\x12\x1d\n\x10warning_capacity\x18\x05 \x01(\tH\x01\x88\x01\x01\x12\x1c\n\x0fwarning_offline\x18\x06 \x01(\tH\x02\x88\x01\x01\x12\x1d\n\x10warning_deadends\x18\x07 \x01(\tH\x03\x88\x01\x01\x12#\n\x16warning_private_unused\x18\x08 \x01(\tH\x04\x88\x01\x01\x12\x18\n\x0bwarning_mpp\x18\t \x01(\tH\x05\x88\x01\x01\x42\x10\n\x0e_created_indexB\x13\n\x11_warning_capacityB\x12\n\x10_warning_offlineB\x13\n\x11_warning_deadendsB\x19\n\x17_warning_private_unusedB\x0e\n\x0c_warning_mpp\"#\n\x14ListdatastoreRequest\x12\x0b\n\x03key\x18\x02 \x03(\t\"G\n\x15ListdatastoreResponse\x12.\n\tdatastore\x18\x01 \x03(\x0b\x32\x1b.cln.ListdatastoreDatastore\"\x87\x01\n\x16ListdatastoreDatastore\x12\x0b\n\x03key\x18\x01 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x12\x13\n\x06string\x18\x04 \x01(\tH\x02\x88\x01\x01\x42\r\n\x0b_generationB\x06\n\x04_hexB\t\n\x07_string\"\xde\x02\n\x13ListinvoicesRequest\x12\x12\n\x05label\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x16\n\tinvstring\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x03 \x01(\x0cH\x02\x88\x01\x01\x12\x15\n\x08offer_id\x18\x04 \x01(\tH\x03\x88\x01\x01\x12>\n\x05index\x18\x05 \x01(\x0e\x32*.cln.ListinvoicesRequest.ListinvoicesIndexH\x04\x88\x01\x01\x12\x12\n\x05start\x18\x06 \x01(\x04H\x05\x88\x01\x01\x12\x12\n\x05limit\x18\x07 \x01(\rH\x06\x88\x01\x01\"-\n\x11ListinvoicesIndex\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07UPDATED\x10\x01\x42\x08\n\x06_labelB\x0c\n\n_invstringB\x0f\n\r_payment_hashB\x0b\n\t_offer_idB\x08\n\x06_indexB\x08\n\x06_startB\x08\n\x06_limit\"C\n\x14ListinvoicesResponse\x12+\n\x08invoices\x18\x01 \x03(\x0b\x32\x19.cln.ListinvoicesInvoices\"\xd4\x06\n\x14ListinvoicesInvoices\x12\r\n\x05label\x18\x01 \x01(\t\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x44\n\x06status\x18\x04 \x01(\x0e\x32\x34.cln.ListinvoicesInvoices.ListinvoicesInvoicesStatus\x12\x12\n\nexpires_at\x18\x05 \x01(\x04\x12%\n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x08 \x01(\tH\x03\x88\x01\x01\x12\x1b\n\x0elocal_offer_id\x18\t \x01(\x0cH\x04\x88\x01\x01\x12\x1e\n\x11invreq_payer_note\x18\x0f \x01(\tH\x05\x88\x01\x01\x12\x1a\n\rcreated_index\x18\x10 \x01(\x04H\x06\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x11 \x01(\x04H\x07\x88\x01\x01\x12\x16\n\tpay_index\x18\x0b \x01(\x04H\x08\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\x0c \x01(\x0b\x32\x0b.cln.AmountH\t\x88\x01\x01\x12\x14\n\x07paid_at\x18\r \x01(\x04H\n\x88\x01\x01\x12\x42\n\rpaid_outpoint\x18\x12 \x01(\x0b\x32&.cln.ListinvoicesInvoicesPaid_outpointH\x0b\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0e \x01(\x0cH\x0c\x88\x01\x01\"?\n\x1aListinvoicesInvoicesStatus\x12\n\n\x06UNPAID\x10\x00\x12\x08\n\x04PAID\x10\x01\x12\x0b\n\x07\x45XPIRED\x10\x02\x42\x0e\n\x0c_descriptionB\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\t\n\x07_bolt12B\x11\n\x0f_local_offer_idB\x14\n\x12_invreq_payer_noteB\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x10\n\x0e_paid_outpointB\x13\n\x11_payment_preimage\"_\n!ListinvoicesInvoicesPaid_outpoint\x12\x11\n\x04txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x13\n\x06outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_txidB\t\n\x07_outnum\"\xb4\x03\n\x10SendonionRequest\x12\r\n\x05onion\x18\x01 \x01(\x0c\x12*\n\tfirst_hop\x18\x02 \x01(\x0b\x32\x17.cln.SendonionFirst_hop\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x12\n\x05label\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x16\n\x0eshared_secrets\x18\x05 \x03(\x0c\x12\x13\n\x06partid\x18\x06 \x01(\rH\x01\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x02\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x0c \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\t \x01(\x0cH\x04\x88\x01\x01\x12\x1a\n\rlocalinvreqid\x18\r \x01(\x0cH\x05\x88\x01\x01\x12\x14\n\x07groupid\x18\x0b \x01(\x04H\x06\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x0e \x01(\tH\x07\x88\x01\x01\x42\x08\n\x06_labelB\t\n\x07_partidB\t\n\x07_bolt11B\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x10\n\x0e_localinvreqidB\n\n\x08_groupidB\x0e\n\x0c_description\"\xe7\x04\n\x11SendonionResponse\x12\x1a\n\rcreated_index\x18\x0e \x01(\x04H\x00\x88\x01\x01\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\x0c\x12\x36\n\x06status\x18\x03 \x01(\x0e\x32&.cln.SendonionResponse.SendonionStatus\x12%\n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x05 \x01(\x0cH\x02\x88\x01\x01\x12\x12\n\ncreated_at\x18\x06 \x01(\x04\x12%\n\x10\x61mount_sent_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\x08 \x01(\tH\x03\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\t \x01(\tH\x04\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\n \x01(\tH\x05\x88\x01\x01\x12\x13\n\x06partid\x18\r \x01(\x04H\x06\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x0f \x01(\x04H\x07\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0b \x01(\x0cH\x08\x88\x01\x01\x12\x14\n\x07message\x18\x0c \x01(\tH\t\x88\x01\x01\",\n\x0fSendonionStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x42\x10\n\x0e_created_indexB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x08\n\x06_labelB\t\n\x07_bolt11B\t\n\x07_bolt12B\t\n\x07_partidB\x10\n\x0e_updated_indexB\x13\n\x11_payment_preimageB\n\n\x08_message\"Q\n\x12SendonionFirst_hop\x12\n\n\x02id\x18\x01 \x01(\x0c\x12 \n\x0b\x61mount_msat\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\x12\r\n\x05\x64\x65lay\x18\x03 \x01(\r\"\xa0\x03\n\x13ListsendpaysRequest\x12\x13\n\x06\x62olt11\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12@\n\x06status\x18\x03 \x01(\x0e\x32+.cln.ListsendpaysRequest.ListsendpaysStatusH\x02\x88\x01\x01\x12>\n\x05index\x18\x04 \x01(\x0e\x32*.cln.ListsendpaysRequest.ListsendpaysIndexH\x03\x88\x01\x01\x12\x12\n\x05start\x18\x05 \x01(\x04H\x04\x88\x01\x01\x12\x12\n\x05limit\x18\x06 \x01(\rH\x05\x88\x01\x01\";\n\x12ListsendpaysStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\"-\n\x11ListsendpaysIndex\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07UPDATED\x10\x01\x42\t\n\x07_bolt11B\x0f\n\r_payment_hashB\t\n\x07_statusB\x08\n\x06_indexB\x08\n\x06_startB\x08\n\x06_limit\"C\n\x14ListsendpaysResponse\x12+\n\x08payments\x18\x01 \x03(\x0b\x32\x19.cln.ListsendpaysPayments\"\xfc\x05\n\x14ListsendpaysPayments\x12\x1a\n\rcreated_index\x18\x10 \x01(\x04H\x00\x88\x01\x01\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x0f\n\x07groupid\x18\x02 \x01(\x04\x12\x13\n\x06partid\x18\x0f \x01(\x04H\x01\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x1a\n\rupdated_index\x18\x11 \x01(\x04H\x02\x88\x01\x01\x12\x44\n\x06status\x18\x04 \x01(\x0e\x32\x34.cln.ListsendpaysPayments.ListsendpaysPaymentsStatus\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x06 \x01(\x0cH\x04\x88\x01\x01\x12\x12\n\ncreated_at\x18\x07 \x01(\x04\x12%\n\x10\x61mount_sent_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\t \x01(\tH\x05\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\n \x01(\tH\x06\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x0e \x01(\tH\x07\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x0b \x01(\tH\x08\x88\x01\x01\x12\x19\n\x0c\x63ompleted_at\x18\x12 \x01(\x04H\t\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\n\x88\x01\x01\x12\x17\n\nerroronion\x18\r \x01(\x0cH\x0b\x88\x01\x01\"C\n\x1aListsendpaysPaymentsStatus\x12\x0b\n\x07PENDING\x10\x00\x12\n\n\x06\x46\x41ILED\x10\x01\x12\x0c\n\x08\x43OMPLETE\x10\x02\x42\x10\n\x0e_created_indexB\t\n\x07_partidB\x10\n\x0e_updated_indexB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x08\n\x06_labelB\t\n\x07_bolt11B\x0e\n\x0c_descriptionB\t\n\x07_bolt12B\x0f\n\r_completed_atB\x13\n\x11_payment_preimageB\r\n\x0b_erroronion\"\x19\n\x17ListtransactionsRequest\"S\n\x18ListtransactionsResponse\x12\x37\n\x0ctransactions\x18\x01 \x03(\x0b\x32!.cln.ListtransactionsTransactions\"\xf8\x01\n\x1cListtransactionsTransactions\x12\x0c\n\x04hash\x18\x01 \x01(\x0c\x12\r\n\x05rawtx\x18\x02 \x01(\x0c\x12\x13\n\x0b\x62lockheight\x18\x03 \x01(\r\x12\x0f\n\x07txindex\x18\x04 \x01(\r\x12\x10\n\x08locktime\x18\x07 \x01(\r\x12\x0f\n\x07version\x18\x08 \x01(\r\x12\x37\n\x06inputs\x18\t \x03(\x0b\x32\'.cln.ListtransactionsTransactionsInputs\x12\x39\n\x07outputs\x18\n \x03(\x0b\x32(.cln.ListtransactionsTransactionsOutputs\"S\n\"ListtransactionsTransactionsInputs\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\r\n\x05index\x18\x02 \x01(\r\x12\x10\n\x08sequence\x18\x03 \x01(\r\"l\n#ListtransactionsTransactionsOutputs\x12\r\n\x05index\x18\x01 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12\x14\n\x0cscriptPubKey\x18\x03 \x01(\x0c\"\xda\x03\n\nPayRequest\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\x12%\n\x0b\x61mount_msat\x18\r \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x12\n\x05label\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x17\n\nriskfactor\x18\x08 \x01(\x01H\x02\x88\x01\x01\x12\x1a\n\rmaxfeepercent\x18\x04 \x01(\x01H\x03\x88\x01\x01\x12\x16\n\tretry_for\x18\x05 \x01(\rH\x04\x88\x01\x01\x12\x15\n\x08maxdelay\x18\x06 \x01(\rH\x05\x88\x01\x01\x12#\n\texemptfee\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x1a\n\rlocalinvreqid\x18\x0e \x01(\x0cH\x07\x88\x01\x01\x12\x0f\n\x07\x65xclude\x18\n \x03(\t\x12 \n\x06maxfee\x18\x0b \x01(\x0b\x32\x0b.cln.AmountH\x08\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x0c \x01(\tH\t\x88\x01\x01\x42\x0e\n\x0c_amount_msatB\x08\n\x06_labelB\r\n\x0b_riskfactorB\x10\n\x0e_maxfeepercentB\x0c\n\n_retry_forB\x0b\n\t_maxdelayB\x0c\n\n_exemptfeeB\x10\n\x0e_localinvreqidB\t\n\x07_maxfeeB\x0e\n\x0c_description\"\xfb\x02\n\x0bPayResponse\x12\x18\n\x10payment_preimage\x18\x01 \x01(\x0c\x12\x18\n\x0b\x64\x65stination\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x12\n\ncreated_at\x18\x04 \x01(\x01\x12\r\n\x05parts\x18\x05 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10\x61mount_sent_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\'\n\x1awarning_partial_completion\x18\x08 \x01(\tH\x01\x88\x01\x01\x12*\n\x06status\x18\t \x01(\x0e\x32\x1a.cln.PayResponse.PayStatus\"2\n\tPayStatus\x12\x0c\n\x08\x43OMPLETE\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x42\x0e\n\x0c_destinationB\x1d\n\x1b_warning_partial_completion\"*\n\x10ListnodesRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x05\n\x03_id\"7\n\x11ListnodesResponse\x12\"\n\x05nodes\x18\x01 \x03(\x0b\x32\x13.cln.ListnodesNodes\"\xe1\x01\n\x0eListnodesNodes\x12\x0e\n\x06nodeid\x18\x01 \x01(\x0c\x12\x1b\n\x0elast_timestamp\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x12\n\x05\x61lias\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x12\n\x05\x63olor\x18\x04 \x01(\x0cH\x02\x88\x01\x01\x12\x15\n\x08\x66\x65\x61tures\x18\x05 \x01(\x0cH\x03\x88\x01\x01\x12/\n\taddresses\x18\x06 \x03(\x0b\x32\x1c.cln.ListnodesNodesAddressesB\x11\n\x0f_last_timestampB\x08\n\x06_aliasB\x08\n\x06_colorB\x0b\n\t_features\"\xe8\x01\n\x17ListnodesNodesAddresses\x12K\n\titem_type\x18\x01 \x01(\x0e\x32\x38.cln.ListnodesNodesAddresses.ListnodesNodesAddressesType\x12\x0c\n\x04port\x18\x02 \x01(\r\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x00\x88\x01\x01\"P\n\x1bListnodesNodesAddressesType\x12\x07\n\x03\x44NS\x10\x00\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\n\n\x08_address\"g\n\x15WaitanyinvoiceRequest\x12\x1a\n\rlastpay_index\x18\x01 \x01(\x04H\x00\x88\x01\x01\x12\x14\n\x07timeout\x18\x02 \x01(\x04H\x01\x88\x01\x01\x42\x10\n\x0e_lastpay_indexB\n\n\x08_timeout\"\xbf\x05\n\x16WaitanyinvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12@\n\x06status\x18\x04 \x01(\x0e\x32\x30.cln.WaitanyinvoiceResponse.WaitanyinvoiceStatus\x12\x12\n\nexpires_at\x18\x05 \x01(\x04\x12%\n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x08 \x01(\tH\x02\x88\x01\x01\x12\x1a\n\rcreated_index\x18\r \x01(\x04H\x03\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x0e \x01(\x04H\x04\x88\x01\x01\x12\x16\n\tpay_index\x18\t \x01(\x04H\x05\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x14\n\x07paid_at\x18\x0b \x01(\x04H\x07\x88\x01\x01\x12<\n\rpaid_outpoint\x18\x0f \x01(\x0b\x32 .cln.WaitanyinvoicePaid_outpointH\x08\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\t\x88\x01\x01\"-\n\x14WaitanyinvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x42\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\t\n\x07_bolt12B\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x10\n\x0e_paid_outpointB\x13\n\x11_payment_preimage\"Y\n\x1bWaitanyinvoicePaid_outpoint\x12\x11\n\x04txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x13\n\x06outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_txidB\t\n\x07_outnum\"#\n\x12WaitinvoiceRequest\x12\r\n\x05label\x18\x01 \x01(\t\"\xb0\x05\n\x13WaitinvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12:\n\x06status\x18\x04 \x01(\x0e\x32*.cln.WaitinvoiceResponse.WaitinvoiceStatus\x12\x12\n\nexpires_at\x18\x05 \x01(\x04\x12%\n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x08 \x01(\tH\x02\x88\x01\x01\x12\x1a\n\rcreated_index\x18\r \x01(\x04H\x03\x88\x01\x01\x12\x1a\n\rupdated_index\x18\x0e \x01(\x04H\x04\x88\x01\x01\x12\x16\n\tpay_index\x18\t \x01(\x04H\x05\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x14\n\x07paid_at\x18\x0b \x01(\x04H\x07\x88\x01\x01\x12\x39\n\rpaid_outpoint\x18\x0f \x01(\x0b\x32\x1d.cln.WaitinvoicePaid_outpointH\x08\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\t\x88\x01\x01\"*\n\x11WaitinvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x42\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\t\n\x07_bolt12B\x10\n\x0e_created_indexB\x10\n\x0e_updated_indexB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x10\n\x0e_paid_outpointB\x13\n\x11_payment_preimage\"V\n\x18WaitinvoicePaid_outpoint\x12\x11\n\x04txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x13\n\x06outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_txidB\t\n\x07_outnum\"\x8e\x01\n\x12WaitsendpayRequest\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x14\n\x07timeout\x18\x03 \x01(\rH\x00\x88\x01\x01\x12\x13\n\x06partid\x18\x02 \x01(\x04H\x01\x88\x01\x01\x12\x14\n\x07groupid\x18\x04 \x01(\x04H\x02\x88\x01\x01\x42\n\n\x08_timeoutB\t\n\x07_partidB\n\n\x08_groupid\"\x8e\x05\n\x13WaitsendpayResponse\x12\x1a\n\rcreated_index\x18\x0f \x01(\x04H\x00\x88\x01\x01\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x14\n\x07groupid\x18\x02 \x01(\x04H\x01\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12:\n\x06status\x18\x04 \x01(\x0e\x32*.cln.WaitsendpayResponse.WaitsendpayStatus\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x06 \x01(\x0cH\x03\x88\x01\x01\x12\x12\n\ncreated_at\x18\x07 \x01(\x04\x12\x1a\n\rupdated_index\x18\x10 \x01(\x04H\x04\x88\x01\x01\x12\x19\n\x0c\x63ompleted_at\x18\x0e \x01(\x01H\x05\x88\x01\x01\x12%\n\x10\x61mount_sent_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\t \x01(\tH\x06\x88\x01\x01\x12\x13\n\x06partid\x18\n \x01(\x04H\x07\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x0b \x01(\tH\x08\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x0c \x01(\tH\t\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\r \x01(\x0cH\n\x88\x01\x01\"!\n\x11WaitsendpayStatus\x12\x0c\n\x08\x43OMPLETE\x10\x00\x42\x10\n\x0e_created_indexB\n\n\x08_groupidB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x10\n\x0e_updated_indexB\x0f\n\r_completed_atB\x08\n\x06_labelB\t\n\x07_partidB\t\n\x07_bolt11B\t\n\x07_bolt12B\x13\n\x11_payment_preimage\"\x97\x01\n\x0eNewaddrRequest\x12@\n\x0b\x61\x64\x64resstype\x18\x01 \x01(\x0e\x32&.cln.NewaddrRequest.NewaddrAddresstypeH\x00\x88\x01\x01\"3\n\x12NewaddrAddresstype\x12\n\n\x06\x42\x45\x43H32\x10\x00\x12\x08\n\x04P2TR\x10\x03\x12\x07\n\x03\x41LL\x10\x02\x42\x0e\n\x0c_addresstype\"M\n\x0fNewaddrResponse\x12\x11\n\x04p2tr\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06\x62\x65\x63h32\x18\x01 \x01(\tH\x01\x88\x01\x01\x42\x07\n\x05_p2trB\t\n\x07_bech32\"\xb9\x01\n\x0fWithdrawRequest\x12\x13\n\x0b\x64\x65stination\x18\x01 \x01(\t\x12!\n\x07satoshi\x18\x02 \x01(\x0b\x32\x10.cln.AmountOrAll\x12\"\n\x07\x66\x65\x65rate\x18\x05 \x01(\x0b\x32\x0c.cln.FeerateH\x00\x88\x01\x01\x12\x14\n\x07minconf\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x1c\n\x05utxos\x18\x04 \x03(\x0b\x32\r.cln.OutpointB\n\n\x08_feerateB\n\n\x08_minconf\":\n\x10WithdrawResponse\x12\n\n\x02tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\x12\x0c\n\x04psbt\x18\x03 \x01(\t\"\x82\x03\n\x0eKeysendRequest\x12\x13\n\x0b\x64\x65stination\x18\x01 \x01(\x0c\x12 \n\x0b\x61mount_msat\x18\n \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x1a\n\rmaxfeepercent\x18\x04 \x01(\x01H\x01\x88\x01\x01\x12\x16\n\tretry_for\x18\x05 \x01(\rH\x02\x88\x01\x01\x12\x15\n\x08maxdelay\x18\x06 \x01(\rH\x03\x88\x01\x01\x12#\n\texemptfee\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x12+\n\nroutehints\x18\x08 \x01(\x0b\x32\x12.cln.RoutehintListH\x05\x88\x01\x01\x12&\n\textratlvs\x18\t \x01(\x0b\x32\x0e.cln.TlvStreamH\x06\x88\x01\x01\x42\x08\n\x06_labelB\x10\n\x0e_maxfeepercentB\x0c\n\n_retry_forB\x0b\n\t_maxdelayB\x0c\n\n_exemptfeeB\r\n\x0b_routehintsB\x0c\n\n_extratlvs\"\xf2\x02\n\x0fKeysendResponse\x12\x18\n\x10payment_preimage\x18\x01 \x01(\x0c\x12\x18\n\x0b\x64\x65stination\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x12\n\ncreated_at\x18\x04 \x01(\x01\x12\r\n\x05parts\x18\x05 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10\x61mount_sent_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\'\n\x1awarning_partial_completion\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\x32\n\x06status\x18\t \x01(\x0e\x32\".cln.KeysendResponse.KeysendStatus\"\x1d\n\rKeysendStatus\x12\x0c\n\x08\x43OMPLETE\x10\x00\x42\x0e\n\x0c_destinationB\x1d\n\x1b_warning_partial_completion\"\xa4\x03\n\x0f\x46undpsbtRequest\x12!\n\x07satoshi\x18\x01 \x01(\x0b\x32\x10.cln.AmountOrAll\x12\x1d\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.Feerate\x12\x13\n\x0bstartweight\x18\x03 \x01(\r\x12\x14\n\x07minconf\x18\x04 \x01(\rH\x00\x88\x01\x01\x12\x14\n\x07reserve\x18\x05 \x01(\rH\x01\x88\x01\x01\x12\x15\n\x08locktime\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x1f\n\x12min_witness_weight\x18\x07 \x01(\rH\x03\x88\x01\x01\x12\x1d\n\x10\x65xcess_as_change\x18\x08 \x01(\x08H\x04\x88\x01\x01\x12\x17\n\nnonwrapped\x18\t \x01(\x08H\x05\x88\x01\x01\x12#\n\x16opening_anchor_channel\x18\n \x01(\x08H\x06\x88\x01\x01\x42\n\n\x08_minconfB\n\n\x08_reserveB\x0b\n\t_locktimeB\x15\n\x13_min_witness_weightB\x13\n\x11_excess_as_changeB\r\n\x0b_nonwrappedB\x19\n\x17_opening_anchor_channel\"\xd9\x01\n\x10\x46undpsbtResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x16\n\x0e\x66\x65\x65rate_per_kw\x18\x02 \x01(\r\x12\x1e\n\x16\x65stimated_final_weight\x18\x03 \x01(\r\x12 \n\x0b\x65xcess_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\x1a\n\rchange_outnum\x18\x05 \x01(\rH\x00\x88\x01\x01\x12/\n\x0creservations\x18\x06 \x03(\x0b\x32\x19.cln.FundpsbtReservationsB\x10\n\x0e_change_outnum\"u\n\x14\x46undpsbtReservations\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x0c\n\x04vout\x18\x02 \x01(\r\x12\x14\n\x0cwas_reserved\x18\x03 \x01(\x08\x12\x10\n\x08reserved\x18\x04 \x01(\x08\x12\x19\n\x11reserved_to_block\x18\x05 \x01(\r\"A\n\x0fSendpsbtRequest\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x14\n\x07reserve\x18\x02 \x01(\rH\x00\x88\x01\x01\x42\n\n\x08_reserve\",\n\x10SendpsbtResponse\x12\n\n\x02tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\"1\n\x0fSignpsbtRequest\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x10\n\x08signonly\x18\x02 \x03(\r\"\'\n\x10SignpsbtResponse\x12\x13\n\x0bsigned_psbt\x18\x01 \x01(\t\"\xa0\x03\n\x0fUtxopsbtRequest\x12!\n\x07satoshi\x18\x01 \x01(\x0b\x32\x10.cln.AmountOrAll\x12\x1d\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.Feerate\x12\x13\n\x0bstartweight\x18\x03 \x01(\r\x12\x1c\n\x05utxos\x18\x04 \x03(\x0b\x32\r.cln.Outpoint\x12\x14\n\x07reserve\x18\x05 \x01(\rH\x00\x88\x01\x01\x12\x17\n\nreservedok\x18\x08 \x01(\x08H\x01\x88\x01\x01\x12\x15\n\x08locktime\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x1f\n\x12min_witness_weight\x18\x07 \x01(\rH\x03\x88\x01\x01\x12\x1d\n\x10\x65xcess_as_change\x18\t \x01(\x08H\x04\x88\x01\x01\x12#\n\x16opening_anchor_channel\x18\n \x01(\x08H\x05\x88\x01\x01\x42\n\n\x08_reserveB\r\n\x0b_reservedokB\x0b\n\t_locktimeB\x15\n\x13_min_witness_weightB\x13\n\x11_excess_as_changeB\x19\n\x17_opening_anchor_channel\"\xd9\x01\n\x10UtxopsbtResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x16\n\x0e\x66\x65\x65rate_per_kw\x18\x02 \x01(\r\x12\x1e\n\x16\x65stimated_final_weight\x18\x03 \x01(\r\x12 \n\x0b\x65xcess_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\x1a\n\rchange_outnum\x18\x05 \x01(\rH\x00\x88\x01\x01\x12/\n\x0creservations\x18\x06 \x03(\x0b\x32\x19.cln.UtxopsbtReservationsB\x10\n\x0e_change_outnum\"u\n\x14UtxopsbtReservations\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x0c\n\x04vout\x18\x02 \x01(\r\x12\x14\n\x0cwas_reserved\x18\x03 \x01(\x08\x12\x10\n\x08reserved\x18\x04 \x01(\x08\x12\x19\n\x11reserved_to_block\x18\x05 \x01(\r\" \n\x10TxdiscardRequest\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\"6\n\x11TxdiscardResponse\x12\x13\n\x0bunsigned_tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\"\xa4\x01\n\x10TxprepareRequest\x12 \n\x07outputs\x18\x05 \x03(\x0b\x32\x0f.cln.OutputDesc\x12\"\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.FeerateH\x00\x88\x01\x01\x12\x14\n\x07minconf\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x1c\n\x05utxos\x18\x04 \x03(\x0b\x32\r.cln.OutpointB\n\n\x08_feerateB\n\n\x08_minconf\"D\n\x11TxprepareResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x13\n\x0bunsigned_tx\x18\x02 \x01(\x0c\x12\x0c\n\x04txid\x18\x03 \x01(\x0c\"\x1d\n\rTxsendRequest\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\"8\n\x0eTxsendResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\n\n\x02tx\x18\x02 \x01(\x0c\x12\x0c\n\x04txid\x18\x03 \x01(\x0c\"1\n\x17ListpeerchannelsRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x05\n\x03_id\"K\n\x18ListpeerchannelsResponse\x12/\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x1d.cln.ListpeerchannelsChannels\"\xb8\x1b\n\x18ListpeerchannelsChannels\x12\x14\n\x07peer_id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x1b\n\x0epeer_connected\x18\x02 \x01(\x08H\x01\x88\x01\x01\x12\x1a\n\rreestablished\x18: \x01(\x08H\x02\x88\x01\x01\x12O\n\x05state\x18\x03 \x01(\x0e\x32;.cln.ListpeerchannelsChannels.ListpeerchannelsChannelsStateH\x03\x88\x01\x01\x12\x19\n\x0cscratch_txid\x18\x04 \x01(\x0cH\x04\x88\x01\x01\x12:\n\x07updates\x18\x37 \x01(\x0b\x32$.cln.ListpeerchannelsChannelsUpdatesH\x05\x88\x01\x01\x12\x1e\n\x11ignore_fee_limits\x18\x36 \x01(\x08H\x06\x88\x01\x01\x12\x17\n\nlost_state\x18\x39 \x01(\x08H\x07\x88\x01\x01\x12:\n\x07\x66\x65\x65rate\x18\x06 \x01(\x0b\x32$.cln.ListpeerchannelsChannelsFeerateH\x08\x88\x01\x01\x12\x12\n\x05owner\x18\x07 \x01(\tH\t\x88\x01\x01\x12\x1d\n\x10short_channel_id\x18\x08 \x01(\tH\n\x88\x01\x01\x12\x17\n\nchannel_id\x18\t \x01(\x0cH\x0b\x88\x01\x01\x12\x19\n\x0c\x66unding_txid\x18\n \x01(\x0cH\x0c\x88\x01\x01\x12\x1b\n\x0e\x66unding_outnum\x18\x0b \x01(\rH\r\x88\x01\x01\x12\x1c\n\x0finitial_feerate\x18\x0c \x01(\tH\x0e\x88\x01\x01\x12\x19\n\x0clast_feerate\x18\r \x01(\tH\x0f\x88\x01\x01\x12\x19\n\x0cnext_feerate\x18\x0e \x01(\tH\x10\x88\x01\x01\x12\x1a\n\rnext_fee_step\x18\x0f \x01(\rH\x11\x88\x01\x01\x12\x37\n\x08inflight\x18\x10 \x03(\x0b\x32%.cln.ListpeerchannelsChannelsInflight\x12\x15\n\x08\x63lose_to\x18\x11 \x01(\x0cH\x12\x88\x01\x01\x12\x14\n\x07private\x18\x12 \x01(\x08H\x13\x88\x01\x01\x12%\n\x06opener\x18\x13 \x01(\x0e\x32\x10.cln.ChannelSideH\x14\x88\x01\x01\x12%\n\x06\x63loser\x18\x14 \x01(\x0e\x32\x10.cln.ChannelSideH\x15\x88\x01\x01\x12:\n\x07\x66unding\x18\x16 \x01(\x0b\x32$.cln.ListpeerchannelsChannelsFundingH\x16\x88\x01\x01\x12$\n\nto_us_msat\x18\x17 \x01(\x0b\x32\x0b.cln.AmountH\x17\x88\x01\x01\x12(\n\x0emin_to_us_msat\x18\x18 \x01(\x0b\x32\x0b.cln.AmountH\x18\x88\x01\x01\x12(\n\x0emax_to_us_msat\x18\x19 \x01(\x0b\x32\x0b.cln.AmountH\x19\x88\x01\x01\x12$\n\ntotal_msat\x18\x1a \x01(\x0b\x32\x0b.cln.AmountH\x1a\x88\x01\x01\x12\'\n\rfee_base_msat\x18\x1b \x01(\x0b\x32\x0b.cln.AmountH\x1b\x88\x01\x01\x12(\n\x1b\x66\x65\x65_proportional_millionths\x18\x1c \x01(\rH\x1c\x88\x01\x01\x12)\n\x0f\x64ust_limit_msat\x18\x1d \x01(\x0b\x32\x0b.cln.AmountH\x1d\x88\x01\x01\x12\x30\n\x16max_total_htlc_in_msat\x18\x1e \x01(\x0b\x32\x0b.cln.AmountH\x1e\x88\x01\x01\x12,\n\x12their_reserve_msat\x18\x1f \x01(\x0b\x32\x0b.cln.AmountH\x1f\x88\x01\x01\x12*\n\x10our_reserve_msat\x18 \x01(\x0b\x32\x0b.cln.AmountH \x88\x01\x01\x12(\n\x0espendable_msat\x18! \x01(\x0b\x32\x0b.cln.AmountH!\x88\x01\x01\x12)\n\x0freceivable_msat\x18\" \x01(\x0b\x32\x0b.cln.AmountH\"\x88\x01\x01\x12.\n\x14minimum_htlc_in_msat\x18# \x01(\x0b\x32\x0b.cln.AmountH#\x88\x01\x01\x12/\n\x15minimum_htlc_out_msat\x18$ \x01(\x0b\x32\x0b.cln.AmountH$\x88\x01\x01\x12/\n\x15maximum_htlc_out_msat\x18% \x01(\x0b\x32\x0b.cln.AmountH%\x88\x01\x01\x12 \n\x13their_to_self_delay\x18& \x01(\rH&\x88\x01\x01\x12\x1e\n\x11our_to_self_delay\x18\' \x01(\rH\'\x88\x01\x01\x12\x1f\n\x12max_accepted_htlcs\x18( \x01(\rH(\x88\x01\x01\x12\x36\n\x05\x61lias\x18) \x01(\x0b\x32\".cln.ListpeerchannelsChannelsAliasH)\x88\x01\x01\x12\x0e\n\x06status\x18+ \x03(\t\x12 \n\x13in_payments_offered\x18, \x01(\x04H*\x88\x01\x01\x12)\n\x0fin_offered_msat\x18- \x01(\x0b\x32\x0b.cln.AmountH+\x88\x01\x01\x12\"\n\x15in_payments_fulfilled\x18. \x01(\x04H,\x88\x01\x01\x12+\n\x11in_fulfilled_msat\x18/ \x01(\x0b\x32\x0b.cln.AmountH-\x88\x01\x01\x12!\n\x14out_payments_offered\x18\x30 \x01(\x04H.\x88\x01\x01\x12*\n\x10out_offered_msat\x18\x31 \x01(\x0b\x32\x0b.cln.AmountH/\x88\x01\x01\x12#\n\x16out_payments_fulfilled\x18\x32 \x01(\x04H0\x88\x01\x01\x12,\n\x12out_fulfilled_msat\x18\x33 \x01(\x0b\x32\x0b.cln.AmountH1\x88\x01\x01\x12#\n\x16last_stable_connection\x18\x38 \x01(\x04H2\x88\x01\x01\x12\x31\n\x05htlcs\x18\x34 \x03(\x0b\x32\".cln.ListpeerchannelsChannelsHtlcs\x12\x1a\n\rclose_to_addr\x18\x35 \x01(\tH3\x88\x01\x01\"\x80\x03\n\x1dListpeerchannelsChannelsState\x12\x0c\n\x08OPENINGD\x10\x00\x12\x1c\n\x18\x43HANNELD_AWAITING_LOCKIN\x10\x01\x12\x13\n\x0f\x43HANNELD_NORMAL\x10\x02\x12\x1a\n\x16\x43HANNELD_SHUTTING_DOWN\x10\x03\x12\x18\n\x14\x43LOSINGD_SIGEXCHANGE\x10\x04\x12\x15\n\x11\x43LOSINGD_COMPLETE\x10\x05\x12\x17\n\x13\x41WAITING_UNILATERAL\x10\x06\x12\x16\n\x12\x46UNDING_SPEND_SEEN\x10\x07\x12\x0b\n\x07ONCHAIN\x10\x08\x12\x17\n\x13\x44UALOPEND_OPEN_INIT\x10\t\x12\x1d\n\x19\x44UALOPEND_AWAITING_LOCKIN\x10\n\x12\x1c\n\x18\x43HANNELD_AWAITING_SPLICE\x10\x0b\x12\x1c\n\x18\x44UALOPEND_OPEN_COMMITTED\x10\x0c\x12\x1f\n\x1b\x44UALOPEND_OPEN_COMMIT_READY\x10\rB\n\n\x08_peer_idB\x11\n\x0f_peer_connectedB\x10\n\x0e_reestablishedB\x08\n\x06_stateB\x0f\n\r_scratch_txidB\n\n\x08_updatesB\x14\n\x12_ignore_fee_limitsB\r\n\x0b_lost_stateB\n\n\x08_feerateB\x08\n\x06_ownerB\x13\n\x11_short_channel_idB\r\n\x0b_channel_idB\x0f\n\r_funding_txidB\x11\n\x0f_funding_outnumB\x12\n\x10_initial_feerateB\x0f\n\r_last_feerateB\x0f\n\r_next_feerateB\x10\n\x0e_next_fee_stepB\x0b\n\t_close_toB\n\n\x08_privateB\t\n\x07_openerB\t\n\x07_closerB\n\n\x08_fundingB\r\n\x0b_to_us_msatB\x11\n\x0f_min_to_us_msatB\x11\n\x0f_max_to_us_msatB\r\n\x0b_total_msatB\x10\n\x0e_fee_base_msatB\x1e\n\x1c_fee_proportional_millionthsB\x12\n\x10_dust_limit_msatB\x19\n\x17_max_total_htlc_in_msatB\x15\n\x13_their_reserve_msatB\x13\n\x11_our_reserve_msatB\x11\n\x0f_spendable_msatB\x12\n\x10_receivable_msatB\x17\n\x15_minimum_htlc_in_msatB\x18\n\x16_minimum_htlc_out_msatB\x18\n\x16_maximum_htlc_out_msatB\x16\n\x14_their_to_self_delayB\x14\n\x12_our_to_self_delayB\x15\n\x13_max_accepted_htlcsB\x08\n\x06_aliasB\x16\n\x14_in_payments_offeredB\x12\n\x10_in_offered_msatB\x18\n\x16_in_payments_fulfilledB\x14\n\x12_in_fulfilled_msatB\x17\n\x15_out_payments_offeredB\x13\n\x11_out_offered_msatB\x19\n\x17_out_payments_fulfilledB\x15\n\x13_out_fulfilled_msatB\x19\n\x17_last_stable_connectionB\x10\n\x0e_close_to_addr\"\xb6\x01\n\x1fListpeerchannelsChannelsUpdates\x12=\n\x05local\x18\x01 \x01(\x0b\x32).cln.ListpeerchannelsChannelsUpdatesLocalH\x00\x88\x01\x01\x12?\n\x06remote\x18\x02 \x01(\x0b\x32*.cln.ListpeerchannelsChannelsUpdatesRemoteH\x01\x88\x01\x01\x42\x08\n\x06_localB\t\n\x07_remote\"\xe7\x02\n$ListpeerchannelsChannelsUpdatesLocal\x12+\n\x11htlc_minimum_msat\x18\x01 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12+\n\x11htlc_maximum_msat\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x1e\n\x11\x63ltv_expiry_delta\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\'\n\rfee_base_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12(\n\x1b\x66\x65\x65_proportional_millionths\x18\x05 \x01(\rH\x04\x88\x01\x01\x42\x14\n\x12_htlc_minimum_msatB\x14\n\x12_htlc_maximum_msatB\x14\n\x12_cltv_expiry_deltaB\x10\n\x0e_fee_base_msatB\x1e\n\x1c_fee_proportional_millionths\"\xe8\x02\n%ListpeerchannelsChannelsUpdatesRemote\x12+\n\x11htlc_minimum_msat\x18\x01 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12+\n\x11htlc_maximum_msat\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x1e\n\x11\x63ltv_expiry_delta\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\'\n\rfee_base_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12(\n\x1b\x66\x65\x65_proportional_millionths\x18\x05 \x01(\rH\x04\x88\x01\x01\x42\x14\n\x12_htlc_minimum_msatB\x14\n\x12_htlc_maximum_msatB\x14\n\x12_cltv_expiry_deltaB\x10\n\x0e_fee_base_msatB\x1e\n\x1c_fee_proportional_millionths\"]\n\x1fListpeerchannelsChannelsFeerate\x12\x12\n\x05perkw\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x12\n\x05perkb\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x08\n\x06_perkwB\x08\n\x06_perkb\"\x80\x03\n ListpeerchannelsChannelsInflight\x12\x19\n\x0c\x66unding_txid\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x1b\n\x0e\x66unding_outnum\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x14\n\x07\x66\x65\x65rate\x18\x03 \x01(\tH\x02\x88\x01\x01\x12,\n\x12total_funding_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x1a\n\rsplice_amount\x18\x07 \x01(\x12H\x04\x88\x01\x01\x12*\n\x10our_funding_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x05\x88\x01\x01\x12\x19\n\x0cscratch_txid\x18\x06 \x01(\x0cH\x06\x88\x01\x01\x42\x0f\n\r_funding_txidB\x11\n\x0f_funding_outnumB\n\n\x08_feerateB\x15\n\x13_total_funding_msatB\x10\n\x0e_splice_amountB\x13\n\x11_our_funding_msatB\x0f\n\r_scratch_txid\"\xd2\x02\n\x1fListpeerchannelsChannelsFunding\x12%\n\x0bpushed_msat\x18\x01 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12*\n\x10local_funds_msat\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12+\n\x11remote_funds_msat\x18\x03 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12\'\n\rfee_paid_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\'\n\rfee_rcvd_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x42\x0e\n\x0c_pushed_msatB\x13\n\x11_local_funds_msatB\x14\n\x12_remote_funds_msatB\x10\n\x0e_fee_paid_msatB\x10\n\x0e_fee_rcvd_msat\"]\n\x1dListpeerchannelsChannelsAlias\x12\x12\n\x05local\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06remote\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_localB\t\n\x07_remote\"\xe2\x03\n\x1dListpeerchannelsChannelsHtlcs\x12\x61\n\tdirection\x18\x01 \x01(\x0e\x32I.cln.ListpeerchannelsChannelsHtlcs.ListpeerchannelsChannelsHtlcsDirectionH\x00\x88\x01\x01\x12\x0f\n\x02id\x18\x02 \x01(\x04H\x01\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12\x13\n\x06\x65xpiry\x18\x04 \x01(\rH\x03\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x05 \x01(\x0cH\x04\x88\x01\x01\x12\x1a\n\rlocal_trimmed\x18\x06 \x01(\x08H\x05\x88\x01\x01\x12\x13\n\x06status\x18\x07 \x01(\tH\x06\x88\x01\x01\x12\"\n\x05state\x18\x08 \x01(\x0e\x32\x0e.cln.HtlcStateH\x07\x88\x01\x01\"9\n&ListpeerchannelsChannelsHtlcsDirection\x12\x06\n\x02IN\x10\x00\x12\x07\n\x03OUT\x10\x01\x42\x0c\n\n_directionB\x05\n\x03_idB\x0e\n\x0c_amount_msatB\t\n\x07_expiryB\x0f\n\r_payment_hashB\x10\n\x0e_local_trimmedB\t\n\x07_statusB\x08\n\x06_state\"3\n\x19ListclosedchannelsRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x05\n\x03_id\"[\n\x1aListclosedchannelsResponse\x12=\n\x0e\x63losedchannels\x18\x01 \x03(\x0b\x32%.cln.ListclosedchannelsClosedchannels\"\xf2\t\n ListclosedchannelsClosedchannels\x12\x14\n\x07peer_id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x12\n\nchannel_id\x18\x02 \x01(\x0c\x12\x1d\n\x10short_channel_id\x18\x03 \x01(\tH\x01\x88\x01\x01\x12>\n\x05\x61lias\x18\x04 \x01(\x0b\x32*.cln.ListclosedchannelsClosedchannelsAliasH\x02\x88\x01\x01\x12 \n\x06opener\x18\x05 \x01(\x0e\x32\x10.cln.ChannelSide\x12%\n\x06\x63loser\x18\x06 \x01(\x0e\x32\x10.cln.ChannelSideH\x03\x88\x01\x01\x12\x0f\n\x07private\x18\x07 \x01(\x08\x12\x1f\n\x17total_local_commitments\x18\t \x01(\x04\x12 \n\x18total_remote_commitments\x18\n \x01(\x04\x12\x18\n\x10total_htlcs_sent\x18\x0b \x01(\x04\x12\x14\n\x0c\x66unding_txid\x18\x0c \x01(\x0c\x12\x16\n\x0e\x66unding_outnum\x18\r \x01(\r\x12\x0e\n\x06leased\x18\x0e \x01(\x08\x12/\n\x15\x66unding_fee_paid_msat\x18\x0f \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x12/\n\x15\x66unding_fee_rcvd_msat\x18\x10 \x01(\x0b\x32\x0b.cln.AmountH\x05\x88\x01\x01\x12-\n\x13\x66unding_pushed_msat\x18\x11 \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x1f\n\ntotal_msat\x18\x12 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10\x66inal_to_us_msat\x18\x13 \x01(\x0b\x32\x0b.cln.Amount\x12#\n\x0emin_to_us_msat\x18\x14 \x01(\x0b\x32\x0b.cln.Amount\x12#\n\x0emax_to_us_msat\x18\x15 \x01(\x0b\x32\x0b.cln.Amount\x12!\n\x14last_commitment_txid\x18\x16 \x01(\x0cH\x07\x88\x01\x01\x12\x32\n\x18last_commitment_fee_msat\x18\x17 \x01(\x0b\x32\x0b.cln.AmountH\x08\x88\x01\x01\x12\x66\n\x0b\x63lose_cause\x18\x18 \x01(\x0e\x32Q.cln.ListclosedchannelsClosedchannels.ListclosedchannelsClosedchannelsClose_cause\x12#\n\x16last_stable_connection\x18\x19 \x01(\x04H\t\x88\x01\x01\"v\n+ListclosedchannelsClosedchannelsClose_cause\x12\x0b\n\x07UNKNOWN\x10\x00\x12\t\n\x05LOCAL\x10\x01\x12\x08\n\x04USER\x10\x02\x12\n\n\x06REMOTE\x10\x03\x12\x0c\n\x08PROTOCOL\x10\x04\x12\x0b\n\x07ONCHAIN\x10\x05\x42\n\n\x08_peer_idB\x13\n\x11_short_channel_idB\x08\n\x06_aliasB\t\n\x07_closerB\x18\n\x16_funding_fee_paid_msatB\x18\n\x16_funding_fee_rcvd_msatB\x16\n\x14_funding_pushed_msatB\x17\n\x15_last_commitment_txidB\x1b\n\x19_last_commitment_fee_msatB\x19\n\x17_last_stable_connection\"e\n%ListclosedchannelsClosedchannelsAlias\x12\x12\n\x05local\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06remote\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_localB\t\n\x07_remote\"L\n\x10\x44\x65\x63odepayRequest\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_description\"\x8d\x04\n\x11\x44\x65\x63odepayResponse\x12\x10\n\x08\x63urrency\x18\x01 \x01(\t\x12\x12\n\ncreated_at\x18\x02 \x01(\x04\x12\x0e\n\x06\x65xpiry\x18\x03 \x01(\x04\x12\r\n\x05payee\x18\x04 \x01(\x0c\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x06 \x01(\x0c\x12\x11\n\tsignature\x18\x07 \x01(\t\x12\x18\n\x0b\x64\x65scription\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\x1d\n\x10\x64\x65scription_hash\x18\t \x01(\x0cH\x02\x88\x01\x01\x12\x1d\n\x15min_final_cltv_expiry\x18\n \x01(\r\x12\x1b\n\x0epayment_secret\x18\x0b \x01(\x0cH\x03\x88\x01\x01\x12\x15\n\x08\x66\x65\x61tures\x18\x0c \x01(\x0cH\x04\x88\x01\x01\x12\x1d\n\x10payment_metadata\x18\r \x01(\x0cH\x05\x88\x01\x01\x12*\n\tfallbacks\x18\x0e \x03(\x0b\x32\x17.cln.DecodepayFallbacks\x12\"\n\x05\x65xtra\x18\x10 \x03(\x0b\x32\x13.cln.DecodepayExtraB\x0e\n\x0c_amount_msatB\x0e\n\x0c_descriptionB\x13\n\x11_description_hashB\x11\n\x0f_payment_secretB\x0b\n\t_featuresB\x13\n\x11_payment_metadata\"\xd0\x01\n\x12\x44\x65\x63odepayFallbacks\x12\x41\n\titem_type\x18\x01 \x01(\x0e\x32..cln.DecodepayFallbacks.DecodepayFallbacksType\x12\x11\n\x04\x61\x64\x64r\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x0b\n\x03hex\x18\x03 \x01(\x0c\"N\n\x16\x44\x65\x63odepayFallbacksType\x12\t\n\x05P2PKH\x10\x00\x12\x08\n\x04P2SH\x10\x01\x12\n\n\x06P2WPKH\x10\x02\x12\t\n\x05P2WSH\x10\x03\x12\x08\n\x04P2TR\x10\x04\x42\x07\n\x05_addr\"+\n\x0e\x44\x65\x63odepayExtra\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\t\"\x1f\n\rDecodeRequest\x12\x0e\n\x06string\x18\x01 \x01(\t\"\xe8!\n\x0e\x44\x65\x63odeResponse\x12\x31\n\titem_type\x18\x01 \x01(\x0e\x32\x1e.cln.DecodeResponse.DecodeType\x12\r\n\x05valid\x18\x02 \x01(\x08\x12\x15\n\x08offer_id\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x12\x14\n\x0coffer_chains\x18\x04 \x03(\x0c\x12\x1b\n\x0eoffer_metadata\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x1b\n\x0eoffer_currency\x18\x06 \x01(\tH\x02\x88\x01\x01\x12+\n\x1ewarning_unknown_offer_currency\x18\x07 \x01(\tH\x03\x88\x01\x01\x12 \n\x13\x63urrency_minor_unit\x18\x08 \x01(\rH\x04\x88\x01\x01\x12\x19\n\x0coffer_amount\x18\t \x01(\x04H\x05\x88\x01\x01\x12+\n\x11offer_amount_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x1e\n\x11offer_description\x18\x0b \x01(\tH\x07\x88\x01\x01\x12\x19\n\x0coffer_issuer\x18\x0c \x01(\tH\x08\x88\x01\x01\x12\x1b\n\x0eoffer_features\x18\r \x01(\x0cH\t\x88\x01\x01\x12\"\n\x15offer_absolute_expiry\x18\x0e \x01(\x04H\n\x88\x01\x01\x12\x1f\n\x12offer_quantity_max\x18\x0f \x01(\x04H\x0b\x88\x01\x01\x12+\n\x0boffer_paths\x18\x10 \x03(\x0b\x32\x16.cln.DecodeOffer_paths\x12\x1a\n\roffer_node_id\x18\x11 \x01(\x0cH\x0c\x88\x01\x01\x12*\n\x1dwarning_missing_offer_node_id\x18\x14 \x01(\tH\r\x88\x01\x01\x12.\n!warning_invalid_offer_description\x18\x15 \x01(\tH\x0e\x88\x01\x01\x12.\n!warning_missing_offer_description\x18\x16 \x01(\tH\x0f\x88\x01\x01\x12+\n\x1ewarning_invalid_offer_currency\x18\x17 \x01(\tH\x10\x88\x01\x01\x12)\n\x1cwarning_invalid_offer_issuer\x18\x18 \x01(\tH\x11\x88\x01\x01\x12\x1c\n\x0finvreq_metadata\x18\x19 \x01(\x0cH\x12\x88\x01\x01\x12\x1c\n\x0finvreq_payer_id\x18\x1a \x01(\x0cH\x13\x88\x01\x01\x12\x19\n\x0cinvreq_chain\x18\x1b \x01(\x0cH\x14\x88\x01\x01\x12,\n\x12invreq_amount_msat\x18\x1c \x01(\x0b\x32\x0b.cln.AmountH\x15\x88\x01\x01\x12\x1c\n\x0finvreq_features\x18\x1d \x01(\x0cH\x16\x88\x01\x01\x12\x1c\n\x0finvreq_quantity\x18\x1e \x01(\x04H\x17\x88\x01\x01\x12\x1e\n\x11invreq_payer_note\x18\x1f \x01(\tH\x18\x88\x01\x01\x12&\n\x19invreq_recurrence_counter\x18 \x01(\rH\x19\x88\x01\x01\x12$\n\x17invreq_recurrence_start\x18! \x01(\rH\x1a\x88\x01\x01\x12,\n\x1fwarning_missing_invreq_metadata\x18# \x01(\tH\x1b\x88\x01\x01\x12,\n\x1fwarning_missing_invreq_payer_id\x18$ \x01(\tH\x1c\x88\x01\x01\x12.\n!warning_invalid_invreq_payer_note\x18% \x01(\tH\x1d\x88\x01\x01\x12\x36\n)warning_missing_invoice_request_signature\x18& \x01(\tH\x1e\x88\x01\x01\x12\x36\n)warning_invalid_invoice_request_signature\x18\' \x01(\tH\x1f\x88\x01\x01\x12\x1f\n\x12invoice_created_at\x18) \x01(\x04H \x88\x01\x01\x12$\n\x17invoice_relative_expiry\x18* \x01(\rH!\x88\x01\x01\x12!\n\x14invoice_payment_hash\x18+ \x01(\x0cH\"\x88\x01\x01\x12-\n\x13invoice_amount_msat\x18, \x01(\x0b\x32\x0b.cln.AmountH#\x88\x01\x01\x12\x37\n\x11invoice_fallbacks\x18- \x03(\x0b\x32\x1c.cln.DecodeInvoice_fallbacks\x12\x1d\n\x10invoice_features\x18. \x01(\x0cH$\x88\x01\x01\x12\x1c\n\x0finvoice_node_id\x18/ \x01(\x0cH%\x88\x01\x01\x12(\n\x1binvoice_recurrence_basetime\x18\x30 \x01(\x04H&\x88\x01\x01\x12*\n\x1dwarning_missing_invoice_paths\x18\x32 \x01(\tH\'\x88\x01\x01\x12/\n\"warning_missing_invoice_blindedpay\x18\x33 \x01(\tH(\x88\x01\x01\x12/\n\"warning_missing_invoice_created_at\x18\x34 \x01(\tH)\x88\x01\x01\x12\x31\n$warning_missing_invoice_payment_hash\x18\x35 \x01(\tH*\x88\x01\x01\x12+\n\x1ewarning_missing_invoice_amount\x18\x36 \x01(\tH+\x88\x01\x01\x12\x38\n+warning_missing_invoice_recurrence_basetime\x18\x37 \x01(\tH,\x88\x01\x01\x12,\n\x1fwarning_missing_invoice_node_id\x18\x38 \x01(\tH-\x88\x01\x01\x12.\n!warning_missing_invoice_signature\x18\x39 \x01(\tH.\x88\x01\x01\x12.\n!warning_invalid_invoice_signature\x18: \x01(\tH/\x88\x01\x01\x12\'\n\tfallbacks\x18; \x03(\x0b\x32\x14.cln.DecodeFallbacks\x12\x17\n\ncreated_at\x18< \x01(\x04H0\x88\x01\x01\x12\x13\n\x06\x65xpiry\x18= \x01(\x04H1\x88\x01\x01\x12\x12\n\x05payee\x18> \x01(\x0cH2\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18? \x01(\x0cH3\x88\x01\x01\x12\x1d\n\x10\x64\x65scription_hash\x18@ \x01(\x0cH4\x88\x01\x01\x12\"\n\x15min_final_cltv_expiry\x18\x41 \x01(\rH5\x88\x01\x01\x12\x1b\n\x0epayment_secret\x18\x42 \x01(\x0cH6\x88\x01\x01\x12\x1d\n\x10payment_metadata\x18\x43 \x01(\x0cH7\x88\x01\x01\x12\x1f\n\x05\x65xtra\x18\x45 \x03(\x0b\x32\x10.cln.DecodeExtra\x12\x16\n\tunique_id\x18\x46 \x01(\tH8\x88\x01\x01\x12\x14\n\x07version\x18G \x01(\tH9\x88\x01\x01\x12\x13\n\x06string\x18H \x01(\tH:\x88\x01\x01\x12-\n\x0crestrictions\x18I \x03(\x0b\x32\x17.cln.DecodeRestrictions\x12&\n\x19warning_rune_invalid_utf8\x18J \x01(\tH;\x88\x01\x01\x12\x10\n\x03hex\x18K \x01(\x0cH<\x88\x01\x01\x12\x16\n\tdecrypted\x18L \x01(\x0cH=\x88\x01\x01\"\x83\x01\n\nDecodeType\x12\x10\n\x0c\x42OLT12_OFFER\x10\x00\x12\x12\n\x0e\x42OLT12_INVOICE\x10\x01\x12\x1a\n\x16\x42OLT12_INVOICE_REQUEST\x10\x02\x12\x12\n\x0e\x42OLT11_INVOICE\x10\x03\x12\x08\n\x04RUNE\x10\x04\x12\x15\n\x11\x45MERGENCY_RECOVER\x10\x05\x42\x0b\n\t_offer_idB\x11\n\x0f_offer_metadataB\x11\n\x0f_offer_currencyB!\n\x1f_warning_unknown_offer_currencyB\x16\n\x14_currency_minor_unitB\x0f\n\r_offer_amountB\x14\n\x12_offer_amount_msatB\x14\n\x12_offer_descriptionB\x0f\n\r_offer_issuerB\x11\n\x0f_offer_featuresB\x18\n\x16_offer_absolute_expiryB\x15\n\x13_offer_quantity_maxB\x10\n\x0e_offer_node_idB \n\x1e_warning_missing_offer_node_idB$\n\"_warning_invalid_offer_descriptionB$\n\"_warning_missing_offer_descriptionB!\n\x1f_warning_invalid_offer_currencyB\x1f\n\x1d_warning_invalid_offer_issuerB\x12\n\x10_invreq_metadataB\x12\n\x10_invreq_payer_idB\x0f\n\r_invreq_chainB\x15\n\x13_invreq_amount_msatB\x12\n\x10_invreq_featuresB\x12\n\x10_invreq_quantityB\x14\n\x12_invreq_payer_noteB\x1c\n\x1a_invreq_recurrence_counterB\x1a\n\x18_invreq_recurrence_startB\"\n _warning_missing_invreq_metadataB\"\n _warning_missing_invreq_payer_idB$\n\"_warning_invalid_invreq_payer_noteB,\n*_warning_missing_invoice_request_signatureB,\n*_warning_invalid_invoice_request_signatureB\x15\n\x13_invoice_created_atB\x1a\n\x18_invoice_relative_expiryB\x17\n\x15_invoice_payment_hashB\x16\n\x14_invoice_amount_msatB\x13\n\x11_invoice_featuresB\x12\n\x10_invoice_node_idB\x1e\n\x1c_invoice_recurrence_basetimeB \n\x1e_warning_missing_invoice_pathsB%\n#_warning_missing_invoice_blindedpayB%\n#_warning_missing_invoice_created_atB\'\n%_warning_missing_invoice_payment_hashB!\n\x1f_warning_missing_invoice_amountB.\n,_warning_missing_invoice_recurrence_basetimeB\"\n _warning_missing_invoice_node_idB$\n\"_warning_missing_invoice_signatureB$\n\"_warning_invalid_invoice_signatureB\r\n\x0b_created_atB\t\n\x07_expiryB\x08\n\x06_payeeB\x0f\n\r_payment_hashB\x13\n\x11_description_hashB\x18\n\x16_min_final_cltv_expiryB\x11\n\x0f_payment_secretB\x13\n\x11_payment_metadataB\x0c\n\n_unique_idB\n\n\x08_versionB\t\n\x07_stringB\x1c\n\x1a_warning_rune_invalid_utf8B\x06\n\x04_hexB\x0c\n\n_decrypted\"<\n\x11\x44\x65\x63odeOffer_paths\x12\x15\n\rfirst_node_id\x18\x01 \x01(\x0c\x12\x10\n\x08\x62linding\x18\x02 \x01(\x0c\"\x8a\x01\n\x1f\x44\x65\x63odeOffer_recurrencePaywindow\x12\x16\n\x0eseconds_before\x18\x01 \x01(\r\x12\x15\n\rseconds_after\x18\x02 \x01(\r\x12 \n\x13proportional_amount\x18\x03 \x01(\x08H\x00\x88\x01\x01\x42\x16\n\x14_proportional_amount\"T\n\x17\x44\x65\x63odeInvoice_pathsPath\x12\x17\n\x0f\x62linded_node_id\x18\x01 \x01(\x0c\x12 \n\x18\x65ncrypted_recipient_data\x18\x02 \x01(\x0c\"Y\n\x17\x44\x65\x63odeInvoice_fallbacks\x12\x0f\n\x07version\x18\x01 \x01(\r\x12\x0b\n\x03hex\x18\x02 \x01(\x0c\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_address\"w\n\x0f\x44\x65\x63odeFallbacks\x12\x36\n)warning_invoice_fallbacks_version_invalid\x18\x01 \x01(\tH\x00\x88\x01\x01\x42,\n*_warning_invoice_fallbacks_version_invalid\"(\n\x0b\x44\x65\x63odeExtra\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\t\";\n\x12\x44\x65\x63odeRestrictions\x12\x14\n\x0c\x61lternatives\x18\x01 \x03(\t\x12\x0f\n\x07summary\x18\x02 \x01(\t\"=\n\x11\x44isconnectRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x12\n\x05\x66orce\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\x08\n\x06_force\"\x14\n\x12\x44isconnectResponse\"k\n\x0f\x46\x65\x65ratesRequest\x12\x31\n\x05style\x18\x01 \x01(\x0e\x32\".cln.FeeratesRequest.FeeratesStyle\"%\n\rFeeratesStyle\x12\t\n\x05PERKB\x10\x00\x12\t\n\x05PERKW\x10\x01\"\x9c\x02\n\x10\x46\x65\x65ratesResponse\x12%\n\x18warning_missing_feerates\x18\x01 \x01(\tH\x00\x88\x01\x01\x12&\n\x05perkb\x18\x02 \x01(\x0b\x32\x12.cln.FeeratesPerkbH\x01\x88\x01\x01\x12&\n\x05perkw\x18\x03 \x01(\x0b\x32\x12.cln.FeeratesPerkwH\x02\x88\x01\x01\x12\x46\n\x15onchain_fee_estimates\x18\x04 \x01(\x0b\x32\".cln.FeeratesOnchain_fee_estimatesH\x03\x88\x01\x01\x42\x1b\n\x19_warning_missing_feeratesB\x08\n\x06_perkbB\x08\n\x06_perkwB\x18\n\x16_onchain_fee_estimates\"\xd3\x03\n\rFeeratesPerkb\x12\x16\n\x0emin_acceptable\x18\x01 \x01(\r\x12\x16\n\x0emax_acceptable\x18\x02 \x01(\r\x12\x12\n\x05\x66loor\x18\n \x01(\rH\x00\x88\x01\x01\x12.\n\testimates\x18\t \x03(\x0b\x32\x1b.cln.FeeratesPerkbEstimates\x12\x14\n\x07opening\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x19\n\x0cmutual_close\x18\x04 \x01(\rH\x02\x88\x01\x01\x12\x1d\n\x10unilateral_close\x18\x05 \x01(\rH\x03\x88\x01\x01\x12$\n\x17unilateral_anchor_close\x18\x0b \x01(\rH\x04\x88\x01\x01\x12\x1a\n\rdelayed_to_us\x18\x06 \x01(\rH\x05\x88\x01\x01\x12\x1c\n\x0fhtlc_resolution\x18\x07 \x01(\rH\x06\x88\x01\x01\x12\x14\n\x07penalty\x18\x08 \x01(\rH\x07\x88\x01\x01\x42\x08\n\x06_floorB\n\n\x08_openingB\x0f\n\r_mutual_closeB\x13\n\x11_unilateral_closeB\x1a\n\x18_unilateral_anchor_closeB\x10\n\x0e_delayed_to_usB\x12\n\x10_htlc_resolutionB\n\n\x08_penalty\"\x96\x01\n\x16\x46\x65\x65ratesPerkbEstimates\x12\x17\n\nblockcount\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x14\n\x07\x66\x65\x65rate\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x1d\n\x10smoothed_feerate\x18\x03 \x01(\rH\x02\x88\x01\x01\x42\r\n\x0b_blockcountB\n\n\x08_feerateB\x13\n\x11_smoothed_feerate\"\xd3\x03\n\rFeeratesPerkw\x12\x16\n\x0emin_acceptable\x18\x01 \x01(\r\x12\x16\n\x0emax_acceptable\x18\x02 \x01(\r\x12\x12\n\x05\x66loor\x18\n \x01(\rH\x00\x88\x01\x01\x12.\n\testimates\x18\t \x03(\x0b\x32\x1b.cln.FeeratesPerkwEstimates\x12\x14\n\x07opening\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x19\n\x0cmutual_close\x18\x04 \x01(\rH\x02\x88\x01\x01\x12\x1d\n\x10unilateral_close\x18\x05 \x01(\rH\x03\x88\x01\x01\x12$\n\x17unilateral_anchor_close\x18\x0b \x01(\rH\x04\x88\x01\x01\x12\x1a\n\rdelayed_to_us\x18\x06 \x01(\rH\x05\x88\x01\x01\x12\x1c\n\x0fhtlc_resolution\x18\x07 \x01(\rH\x06\x88\x01\x01\x12\x14\n\x07penalty\x18\x08 \x01(\rH\x07\x88\x01\x01\x42\x08\n\x06_floorB\n\n\x08_openingB\x0f\n\r_mutual_closeB\x13\n\x11_unilateral_closeB\x1a\n\x18_unilateral_anchor_closeB\x10\n\x0e_delayed_to_usB\x12\n\x10_htlc_resolutionB\n\n\x08_penalty\"\x96\x01\n\x16\x46\x65\x65ratesPerkwEstimates\x12\x17\n\nblockcount\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x14\n\x07\x66\x65\x65rate\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x1d\n\x10smoothed_feerate\x18\x03 \x01(\rH\x02\x88\x01\x01\x42\r\n\x0b_blockcountB\n\n\x08_feerateB\x13\n\x11_smoothed_feerate\"\x9b\x02\n\x1d\x46\x65\x65ratesOnchain_fee_estimates\x12 \n\x18opening_channel_satoshis\x18\x01 \x01(\x04\x12\x1d\n\x15mutual_close_satoshis\x18\x02 \x01(\x04\x12!\n\x19unilateral_close_satoshis\x18\x03 \x01(\x04\x12\x30\n#unilateral_close_nonanchor_satoshis\x18\x06 \x01(\x04H\x00\x88\x01\x01\x12\x1d\n\x15htlc_timeout_satoshis\x18\x04 \x01(\x04\x12\x1d\n\x15htlc_success_satoshis\x18\x05 \x01(\x04\x42&\n$_unilateral_close_nonanchor_satoshis\"\xe9\x02\n\x13\x46\x65tchinvoiceRequest\x12\r\n\x05offer\x18\x01 \x01(\t\x12%\n\x0b\x61mount_msat\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x15\n\x08quantity\x18\x03 \x01(\x04H\x01\x88\x01\x01\x12\x1f\n\x12recurrence_counter\x18\x04 \x01(\x04H\x02\x88\x01\x01\x12\x1d\n\x10recurrence_start\x18\x05 \x01(\x01H\x03\x88\x01\x01\x12\x1d\n\x10recurrence_label\x18\x06 \x01(\tH\x04\x88\x01\x01\x12\x14\n\x07timeout\x18\x07 \x01(\x01H\x05\x88\x01\x01\x12\x17\n\npayer_note\x18\x08 \x01(\tH\x06\x88\x01\x01\x42\x0e\n\x0c_amount_msatB\x0b\n\t_quantityB\x15\n\x13_recurrence_counterB\x13\n\x11_recurrence_startB\x13\n\x11_recurrence_labelB\n\n\x08_timeoutB\r\n\x0b_payer_note\"\x9a\x01\n\x14\x46\x65tchinvoiceResponse\x12\x0f\n\x07invoice\x18\x01 \x01(\t\x12)\n\x07\x63hanges\x18\x02 \x01(\x0b\x32\x18.cln.FetchinvoiceChanges\x12\x36\n\x0bnext_period\x18\x03 \x01(\x0b\x32\x1c.cln.FetchinvoiceNext_periodH\x00\x88\x01\x01\x42\x0e\n\x0c_next_period\"\x82\x02\n\x13\x46\x65tchinvoiceChanges\x12!\n\x14\x64\x65scription_appended\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x1b\n\x0evendor_removed\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06vendor\x18\x04 \x01(\tH\x03\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x42\x17\n\x15_description_appendedB\x0e\n\x0c_descriptionB\x11\n\x0f_vendor_removedB\t\n\x07_vendorB\x0e\n\x0c_amount_msat\"~\n\x17\x46\x65tchinvoiceNext_period\x12\x0f\n\x07\x63ounter\x18\x01 \x01(\x04\x12\x11\n\tstarttime\x18\x02 \x01(\x04\x12\x0f\n\x07\x65ndtime\x18\x03 \x01(\x04\x12\x17\n\x0fpaywindow_start\x18\x04 \x01(\x04\x12\x15\n\rpaywindow_end\x18\x05 \x01(\x04\"\xfb\x03\n\x12\x46undchannelRequest\x12\n\n\x02id\x18\t \x01(\x0c\x12 \n\x06\x61mount\x18\x01 \x01(\x0b\x32\x10.cln.AmountOrAll\x12\"\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.FeerateH\x00\x88\x01\x01\x12\x15\n\x08\x61nnounce\x18\x03 \x01(\x08H\x01\x88\x01\x01\x12\x14\n\x07minconf\x18\n \x01(\rH\x02\x88\x01\x01\x12#\n\tpush_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x15\n\x08\x63lose_to\x18\x06 \x01(\tH\x04\x88\x01\x01\x12%\n\x0brequest_amt\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x05\x88\x01\x01\x12\x1a\n\rcompact_lease\x18\x08 \x01(\tH\x06\x88\x01\x01\x12\x1c\n\x05utxos\x18\x0b \x03(\x0b\x32\r.cln.Outpoint\x12\x15\n\x08mindepth\x18\x0c \x01(\rH\x07\x88\x01\x01\x12!\n\x07reserve\x18\r \x01(\x0b\x32\x0b.cln.AmountH\x08\x88\x01\x01\x12\x14\n\x0c\x63hannel_type\x18\x0e \x03(\rB\n\n\x08_feerateB\x0b\n\t_announceB\n\n\x08_minconfB\x0c\n\n_push_msatB\x0b\n\t_close_toB\x0e\n\x0c_request_amtB\x10\n\x0e_compact_leaseB\x0b\n\t_mindepthB\n\n\x08_reserve\"\xe5\x01\n\x13\x46undchannelResponse\x12\n\n\x02tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\x12\x0e\n\x06outnum\x18\x03 \x01(\r\x12\x12\n\nchannel_id\x18\x04 \x01(\x0c\x12\x37\n\x0c\x63hannel_type\x18\x07 \x01(\x0b\x32\x1c.cln.FundchannelChannel_typeH\x00\x88\x01\x01\x12\x15\n\x08\x63lose_to\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x15\n\x08mindepth\x18\x06 \x01(\rH\x02\x88\x01\x01\x42\x0f\n\r_channel_typeB\x0b\n\t_close_toB\x0b\n\t_mindepth\"L\n\x17\x46undchannelChannel_type\x12\x0c\n\x04\x62its\x18\x01 \x03(\r\x12#\n\x05names\x18\x02 \x03(\x0e\x32\x14.cln.ChannelTypeName\"\xec\x01\n\x0fGetrouteRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12 \n\x0b\x61mount_msat\x18\t \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\nriskfactor\x18\x03 \x01(\x04\x12\x11\n\x04\x63ltv\x18\x04 \x01(\rH\x00\x88\x01\x01\x12\x13\n\x06\x66romid\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x18\n\x0b\x66uzzpercent\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x0f\n\x07\x65xclude\x18\x07 \x03(\t\x12\x14\n\x07maxhops\x18\x08 \x01(\rH\x03\x88\x01\x01\x42\x07\n\x05_cltvB\t\n\x07_fromidB\x0e\n\x0c_fuzzpercentB\n\n\x08_maxhops\"5\n\x10GetrouteResponse\x12!\n\x05route\x18\x01 \x03(\x0b\x32\x12.cln.GetrouteRoute\"\xc5\x01\n\rGetrouteRoute\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x0f\n\x07\x63hannel\x18\x02 \x01(\t\x12\x11\n\tdirection\x18\x03 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\r\n\x05\x64\x65lay\x18\x05 \x01(\r\x12\x34\n\x05style\x18\x06 \x01(\x0e\x32%.cln.GetrouteRoute.GetrouteRouteStyle\"\x1d\n\x12GetrouteRouteStyle\x12\x07\n\x03TLV\x10\x00\"\xb7\x03\n\x13ListforwardsRequest\x12@\n\x06status\x18\x01 \x01(\x0e\x32+.cln.ListforwardsRequest.ListforwardsStatusH\x00\x88\x01\x01\x12\x17\n\nin_channel\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x18\n\x0bout_channel\x18\x03 \x01(\tH\x02\x88\x01\x01\x12>\n\x05index\x18\x04 \x01(\x0e\x32*.cln.ListforwardsRequest.ListforwardsIndexH\x03\x88\x01\x01\x12\x12\n\x05start\x18\x05 \x01(\x04H\x04\x88\x01\x01\x12\x12\n\x05limit\x18\x06 \x01(\rH\x05\x88\x01\x01\"L\n\x12ListforwardsStatus\x12\x0b\n\x07OFFERED\x10\x00\x12\x0b\n\x07SETTLED\x10\x01\x12\x10\n\x0cLOCAL_FAILED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\"-\n\x11ListforwardsIndex\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07UPDATED\x10\x01\x42\t\n\x07_statusB\r\n\x0b_in_channelB\x0e\n\x0c_out_channelB\x08\n\x06_indexB\x08\n\x06_startB\x08\n\x06_limit\"C\n\x14ListforwardsResponse\x12+\n\x08\x66orwards\x18\x01 \x03(\x0b\x32\x19.cln.ListforwardsForwards\"\xba\x05\n\x14ListforwardsForwards\x12\x1a\n\rcreated_index\x18\x0c \x01(\x04H\x00\x88\x01\x01\x12\x12\n\nin_channel\x18\x01 \x01(\t\x12\x17\n\nin_htlc_id\x18\n \x01(\x04H\x01\x88\x01\x01\x12\x1c\n\x07in_msat\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\x12\x44\n\x06status\x18\x03 \x01(\x0e\x32\x34.cln.ListforwardsForwards.ListforwardsForwardsStatus\x12\x15\n\rreceived_time\x18\x04 \x01(\x01\x12\x18\n\x0bout_channel\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x18\n\x0bout_htlc_id\x18\x0b \x01(\x04H\x03\x88\x01\x01\x12\x1a\n\rupdated_index\x18\r \x01(\x04H\x04\x88\x01\x01\x12G\n\x05style\x18\t \x01(\x0e\x32\x33.cln.ListforwardsForwards.ListforwardsForwardsStyleH\x05\x88\x01\x01\x12\"\n\x08\x66\x65\x65_msat\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\"\n\x08out_msat\x18\x08 \x01(\x0b\x32\x0b.cln.AmountH\x07\x88\x01\x01\"T\n\x1aListforwardsForwardsStatus\x12\x0b\n\x07OFFERED\x10\x00\x12\x0b\n\x07SETTLED\x10\x01\x12\x10\n\x0cLOCAL_FAILED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\"0\n\x19ListforwardsForwardsStyle\x12\n\n\x06LEGACY\x10\x00\x12\x07\n\x03TLV\x10\x01\x42\x10\n\x0e_created_indexB\r\n\x0b_in_htlc_idB\x0e\n\x0c_out_channelB\x0e\n\x0c_out_htlc_idB\x10\n\x0e_updated_indexB\x08\n\x06_styleB\x0b\n\t_fee_msatB\x0b\n\t_out_msat\"a\n\x11ListoffersRequest\x12\x15\n\x08offer_id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x18\n\x0b\x61\x63tive_only\x18\x02 \x01(\x08H\x01\x88\x01\x01\x42\x0b\n\t_offer_idB\x0e\n\x0c_active_only\";\n\x12ListoffersResponse\x12%\n\x06offers\x18\x01 \x03(\x0b\x32\x15.cln.ListoffersOffers\"\x84\x01\n\x10ListoffersOffers\x12\x10\n\x08offer_id\x18\x01 \x01(\x0c\x12\x0e\n\x06\x61\x63tive\x18\x02 \x01(\x08\x12\x12\n\nsingle_use\x18\x03 \x01(\x08\x12\x0e\n\x06\x62olt12\x18\x04 \x01(\t\x12\x0c\n\x04used\x18\x05 \x01(\x08\x12\x12\n\x05label\x18\x06 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_label\"\xdb\x01\n\x0fListpaysRequest\x12\x13\n\x06\x62olt11\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12\x38\n\x06status\x18\x03 \x01(\x0e\x32#.cln.ListpaysRequest.ListpaysStatusH\x02\x88\x01\x01\"7\n\x0eListpaysStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x42\t\n\x07_bolt11B\x0f\n\r_payment_hashB\t\n\x07_status\"3\n\x10ListpaysResponse\x12\x1f\n\x04pays\x18\x01 \x03(\x0b\x32\x11.cln.ListpaysPays\"\xff\x04\n\x0cListpaysPays\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x34\n\x06status\x18\x02 \x01(\x0e\x32$.cln.ListpaysPays.ListpaysPaysStatus\x12\x18\n\x0b\x64\x65stination\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x12\x12\n\ncreated_at\x18\x04 \x01(\x04\x12\x19\n\x0c\x63ompleted_at\x18\x0c \x01(\x04H\x01\x88\x01\x01\x12\x12\n\x05label\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x06 \x01(\tH\x03\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x0b \x01(\tH\x04\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x07 \x01(\tH\x05\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x08 \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12*\n\x10\x61mount_sent_msat\x18\t \x01(\x0b\x32\x0b.cln.AmountH\x07\x88\x01\x01\x12\x15\n\x08preimage\x18\r \x01(\x0cH\x08\x88\x01\x01\x12\x1c\n\x0fnumber_of_parts\x18\x0e \x01(\x04H\t\x88\x01\x01\x12\x17\n\nerroronion\x18\n \x01(\x0cH\n\x88\x01\x01\";\n\x12ListpaysPaysStatus\x12\x0b\n\x07PENDING\x10\x00\x12\n\n\x06\x46\x41ILED\x10\x01\x12\x0c\n\x08\x43OMPLETE\x10\x02\x42\x0e\n\x0c_destinationB\x0f\n\r_completed_atB\x08\n\x06_labelB\t\n\x07_bolt11B\x0e\n\x0c_descriptionB\t\n\x07_bolt12B\x0e\n\x0c_amount_msatB\x13\n\x11_amount_sent_msatB\x0b\n\t_preimageB\x12\n\x10_number_of_partsB\r\n\x0b_erroronion\"*\n\x10ListhtlcsRequest\x12\x0f\n\x02id\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x05\n\x03_id\"7\n\x11ListhtlcsResponse\x12\"\n\x05htlcs\x18\x01 \x03(\x0b\x32\x13.cln.ListhtlcsHtlcs\"\x89\x02\n\x0eListhtlcsHtlcs\x12\x18\n\x10short_channel_id\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\x04\x12\x0e\n\x06\x65xpiry\x18\x03 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12>\n\tdirection\x18\x05 \x01(\x0e\x32+.cln.ListhtlcsHtlcs.ListhtlcsHtlcsDirection\x12\x14\n\x0cpayment_hash\x18\x06 \x01(\x0c\x12\x1d\n\x05state\x18\x07 \x01(\x0e\x32\x0e.cln.HtlcState\"*\n\x17ListhtlcsHtlcsDirection\x12\x07\n\x03OUT\x10\x00\x12\x06\n\x02IN\x10\x01\"\xc1\x03\n\x0cOfferRequest\x12\x0e\n\x06\x61mount\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x13\n\x06issuer\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x12\n\x05label\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x19\n\x0cquantity_max\x18\x05 \x01(\x04H\x02\x88\x01\x01\x12\x1c\n\x0f\x61\x62solute_expiry\x18\x06 \x01(\x04H\x03\x88\x01\x01\x12\x17\n\nrecurrence\x18\x07 \x01(\tH\x04\x88\x01\x01\x12\x1c\n\x0frecurrence_base\x18\x08 \x01(\tH\x05\x88\x01\x01\x12!\n\x14recurrence_paywindow\x18\t \x01(\tH\x06\x88\x01\x01\x12\x1d\n\x10recurrence_limit\x18\n \x01(\rH\x07\x88\x01\x01\x12\x17\n\nsingle_use\x18\x0b \x01(\x08H\x08\x88\x01\x01\x42\t\n\x07_issuerB\x08\n\x06_labelB\x0f\n\r_quantity_maxB\x12\n\x10_absolute_expiryB\r\n\x0b_recurrenceB\x12\n\x10_recurrence_baseB\x17\n\x15_recurrence_paywindowB\x13\n\x11_recurrence_limitB\r\n\x0b_single_use\"\x92\x01\n\rOfferResponse\x12\x10\n\x08offer_id\x18\x01 \x01(\x0c\x12\x0e\n\x06\x61\x63tive\x18\x02 \x01(\x08\x12\x12\n\nsingle_use\x18\x03 \x01(\x08\x12\x0e\n\x06\x62olt12\x18\x04 \x01(\t\x12\x0c\n\x04used\x18\x05 \x01(\x08\x12\x0f\n\x07\x63reated\x18\x06 \x01(\x08\x12\x12\n\x05label\x18\x07 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_label\"Y\n\x0bPingRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x10\n\x03len\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x16\n\tpongbytes\x18\x03 \x01(\rH\x01\x88\x01\x01\x42\x06\n\x04_lenB\x0c\n\n_pongbytes\"\x1e\n\x0cPingResponse\x12\x0e\n\x06totlen\x18\x01 \x01(\r\"4\n\x14SendcustommsgRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\x0b\n\x03msg\x18\x02 \x01(\x0c\"\'\n\x15SendcustommsgResponse\x12\x0e\n\x06status\x18\x01 \x01(\t\"\xaa\x02\n\x11SetchannelRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12!\n\x07\x66\x65\x65\x62\x61se\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x13\n\x06\x66\x65\x65ppm\x18\x03 \x01(\rH\x01\x88\x01\x01\x12!\n\x07htlcmin\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12!\n\x07htlcmax\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x19\n\x0c\x65nforcedelay\x18\x06 \x01(\rH\x04\x88\x01\x01\x12\x1c\n\x0fignorefeelimits\x18\x07 \x01(\x08H\x05\x88\x01\x01\x42\n\n\x08_feebaseB\t\n\x07_feeppmB\n\n\x08_htlcminB\n\n\x08_htlcmaxB\x0f\n\r_enforcedelayB\x12\n\x10_ignorefeelimits\"?\n\x12SetchannelResponse\x12)\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x17.cln.SetchannelChannels\"\xca\x03\n\x12SetchannelChannels\x12\x0f\n\x07peer_id\x18\x01 \x01(\x0c\x12\x12\n\nchannel_id\x18\x02 \x01(\x0c\x12\x1d\n\x10short_channel_id\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\"\n\rfee_base_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12#\n\x1b\x66\x65\x65_proportional_millionths\x18\x05 \x01(\r\x12\x1e\n\x11ignore_fee_limits\x18\n \x01(\x08H\x01\x88\x01\x01\x12*\n\x15minimum_htlc_out_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12$\n\x17warning_htlcmin_too_low\x18\x07 \x01(\tH\x02\x88\x01\x01\x12*\n\x15maximum_htlc_out_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x18warning_htlcmax_too_high\x18\t \x01(\tH\x03\x88\x01\x01\x42\x13\n\x11_short_channel_idB\x14\n\x12_ignore_fee_limitsB\x1a\n\x18_warning_htlcmin_too_lowB\x1b\n\x19_warning_htlcmax_too_high\"\'\n\x12SigninvoiceRequest\x12\x11\n\tinvstring\x18\x01 \x01(\t\"%\n\x13SigninvoiceResponse\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\"%\n\x12SignmessageRequest\x12\x0f\n\x07message\x18\x01 \x01(\t\"F\n\x13SignmessageResponse\x12\x11\n\tsignature\x18\x01 \x01(\x0c\x12\r\n\x05recid\x18\x02 \x01(\x0c\x12\r\n\x05zbase\x18\x03 \x01(\t\"O\n\x16WaitblockheightRequest\x12\x13\n\x0b\x62lockheight\x18\x01 \x01(\r\x12\x14\n\x07timeout\x18\x02 \x01(\rH\x00\x88\x01\x01\x42\n\n\x08_timeout\".\n\x17WaitblockheightResponse\x12\x13\n\x0b\x62lockheight\x18\x01 \x01(\r\"\xf9\x01\n\x0bWaitRequest\x12\x31\n\tsubsystem\x18\x01 \x01(\x0e\x32\x1e.cln.WaitRequest.WaitSubsystem\x12\x31\n\tindexname\x18\x02 \x01(\x0e\x32\x1e.cln.WaitRequest.WaitIndexname\x12\x11\n\tnextvalue\x18\x03 \x01(\x04\"9\n\rWaitSubsystem\x12\x0c\n\x08INVOICES\x10\x00\x12\x0c\n\x08\x46ORWARDS\x10\x01\x12\x0c\n\x08SENDPAYS\x10\x02\"6\n\rWaitIndexname\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07UPDATED\x10\x01\x12\x0b\n\x07\x44\x45LETED\x10\x02\"\xe3\x01\n\x0cWaitResponse\x12\x32\n\tsubsystem\x18\x01 \x01(\x0e\x32\x1f.cln.WaitResponse.WaitSubsystem\x12\x14\n\x07\x63reated\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x14\n\x07updated\x18\x03 \x01(\x04H\x01\x88\x01\x01\x12\x14\n\x07\x64\x65leted\x18\x04 \x01(\x04H\x02\x88\x01\x01\"9\n\rWaitSubsystem\x12\x0c\n\x08INVOICES\x10\x00\x12\x0c\n\x08\x46ORWARDS\x10\x01\x12\x0c\n\x08SENDPAYS\x10\x02\x42\n\n\x08_createdB\n\n\x08_updatedB\n\n\x08_deleted\"\r\n\x0bStopRequest\"q\n\x0cStopResponse\x12\x31\n\x06result\x18\x01 \x01(\x0e\x32\x1c.cln.StopResponse.StopResultH\x00\x88\x01\x01\"#\n\nStopResult\x12\x15\n\x11SHUTDOWN_COMPLETE\x10\x00\x42\t\n\x07_result\"\xa7\x01\n\x18PreapprovekeysendRequest\x12\x18\n\x0b\x64\x65stination\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x42\x0e\n\x0c_destinationB\x0f\n\r_payment_hashB\x0e\n\x0c_amount_msat\"\x1b\n\x19PreapprovekeysendResponse\":\n\x18PreapproveinvoiceRequest\x12\x13\n\x06\x62olt11\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\t\n\x07_bolt11\"\x1b\n\x19PreapproveinvoiceResponse\"\x15\n\x13StaticbackupRequest\"#\n\x14StaticbackupResponse\x12\x0b\n\x03scb\x18\x01 \x03(\x0c\"\x97\x01\n\x15\x42kprlistincomeRequest\x12\x1d\n\x10\x63onsolidate_fees\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x17\n\nstart_time\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x15\n\x08\x65nd_time\x18\x03 \x01(\rH\x02\x88\x01\x01\x42\x13\n\x11_consolidate_feesB\r\n\x0b_start_timeB\x0b\n\t_end_time\"Q\n\x16\x42kprlistincomeResponse\x12\x37\n\rincome_events\x18\x01 \x03(\x0b\x32 .cln.BkprlistincomeIncome_events\"\xb5\x02\n\x1b\x42kprlistincomeIncome_events\x12\x0f\n\x07\x61\x63\x63ount\x18\x01 \x01(\t\x12\x0b\n\x03tag\x18\x02 \x01(\t\x12 \n\x0b\x63redit_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x1f\n\ndebit_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\x10\n\x08\x63urrency\x18\x05 \x01(\t\x12\x11\n\ttimestamp\x18\x06 \x01(\r\x12\x18\n\x0b\x64\x65scription\x18\x07 \x01(\tH\x00\x88\x01\x01\x12\x15\n\x08outpoint\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\x11\n\x04txid\x18\t \x01(\x0cH\x02\x88\x01\x01\x12\x17\n\npayment_id\x18\n \x01(\x0cH\x03\x88\x01\x01\x42\x0e\n\x0c_descriptionB\x0b\n\t_outpointB\x07\n\x05_txidB\r\n\x0b_payment_id2\xe2 \n\x04Node\x12\x36\n\x07Getinfo\x12\x13.cln.GetinfoRequest\x1a\x14.cln.GetinfoResponse\"\x00\x12<\n\tListPeers\x12\x15.cln.ListpeersRequest\x1a\x16.cln.ListpeersResponse\"\x00\x12<\n\tListFunds\x12\x15.cln.ListfundsRequest\x1a\x16.cln.ListfundsResponse\"\x00\x12\x36\n\x07SendPay\x12\x13.cln.SendpayRequest\x1a\x14.cln.SendpayResponse\"\x00\x12\x45\n\x0cListChannels\x12\x18.cln.ListchannelsRequest\x1a\x19.cln.ListchannelsResponse\"\x00\x12<\n\tAddGossip\x12\x15.cln.AddgossipRequest\x1a\x16.cln.AddgossipResponse\"\x00\x12Q\n\x10\x41utoCleanInvoice\x12\x1c.cln.AutocleaninvoiceRequest\x1a\x1d.cln.AutocleaninvoiceResponse\"\x00\x12\x45\n\x0c\x43heckMessage\x12\x18.cln.CheckmessageRequest\x1a\x19.cln.CheckmessageResponse\"\x00\x12\x30\n\x05\x43lose\x12\x11.cln.CloseRequest\x1a\x12.cln.CloseResponse\"\x00\x12:\n\x0b\x43onnectPeer\x12\x13.cln.ConnectRequest\x1a\x14.cln.ConnectResponse\"\x00\x12H\n\rCreateInvoice\x12\x19.cln.CreateinvoiceRequest\x1a\x1a.cln.CreateinvoiceResponse\"\x00\x12<\n\tDatastore\x12\x15.cln.DatastoreRequest\x1a\x16.cln.DatastoreResponse\"\x00\x12K\n\x0e\x44\x61tastoreUsage\x12\x1a.cln.DatastoreusageRequest\x1a\x1b.cln.DatastoreusageResponse\"\x00\x12\x42\n\x0b\x43reateOnion\x12\x17.cln.CreateonionRequest\x1a\x18.cln.CreateonionResponse\"\x00\x12\x45\n\x0c\x44\x65lDatastore\x12\x18.cln.DeldatastoreRequest\x1a\x19.cln.DeldatastoreResponse\"\x00\x12T\n\x11\x44\x65lExpiredInvoice\x12\x1d.cln.DelexpiredinvoiceRequest\x1a\x1e.cln.DelexpiredinvoiceResponse\"\x00\x12?\n\nDelInvoice\x12\x16.cln.DelinvoiceRequest\x1a\x17.cln.DelinvoiceResponse\"\x00\x12\x36\n\x07Invoice\x12\x13.cln.InvoiceRequest\x1a\x14.cln.InvoiceResponse\"\x00\x12H\n\rListDatastore\x12\x19.cln.ListdatastoreRequest\x1a\x1a.cln.ListdatastoreResponse\"\x00\x12\x45\n\x0cListInvoices\x12\x18.cln.ListinvoicesRequest\x1a\x19.cln.ListinvoicesResponse\"\x00\x12<\n\tSendOnion\x12\x15.cln.SendonionRequest\x1a\x16.cln.SendonionResponse\"\x00\x12\x45\n\x0cListSendPays\x12\x18.cln.ListsendpaysRequest\x1a\x19.cln.ListsendpaysResponse\"\x00\x12Q\n\x10ListTransactions\x12\x1c.cln.ListtransactionsRequest\x1a\x1d.cln.ListtransactionsResponse\"\x00\x12*\n\x03Pay\x12\x0f.cln.PayRequest\x1a\x10.cln.PayResponse\"\x00\x12<\n\tListNodes\x12\x15.cln.ListnodesRequest\x1a\x16.cln.ListnodesResponse\"\x00\x12K\n\x0eWaitAnyInvoice\x12\x1a.cln.WaitanyinvoiceRequest\x1a\x1b.cln.WaitanyinvoiceResponse\"\x00\x12\x42\n\x0bWaitInvoice\x12\x17.cln.WaitinvoiceRequest\x1a\x18.cln.WaitinvoiceResponse\"\x00\x12\x42\n\x0bWaitSendPay\x12\x17.cln.WaitsendpayRequest\x1a\x18.cln.WaitsendpayResponse\"\x00\x12\x36\n\x07NewAddr\x12\x13.cln.NewaddrRequest\x1a\x14.cln.NewaddrResponse\"\x00\x12\x39\n\x08Withdraw\x12\x14.cln.WithdrawRequest\x1a\x15.cln.WithdrawResponse\"\x00\x12\x36\n\x07KeySend\x12\x13.cln.KeysendRequest\x1a\x14.cln.KeysendResponse\"\x00\x12\x39\n\x08\x46undPsbt\x12\x14.cln.FundpsbtRequest\x1a\x15.cln.FundpsbtResponse\"\x00\x12\x39\n\x08SendPsbt\x12\x14.cln.SendpsbtRequest\x1a\x15.cln.SendpsbtResponse\"\x00\x12\x39\n\x08SignPsbt\x12\x14.cln.SignpsbtRequest\x1a\x15.cln.SignpsbtResponse\"\x00\x12\x39\n\x08UtxoPsbt\x12\x14.cln.UtxopsbtRequest\x1a\x15.cln.UtxopsbtResponse\"\x00\x12<\n\tTxDiscard\x12\x15.cln.TxdiscardRequest\x1a\x16.cln.TxdiscardResponse\"\x00\x12<\n\tTxPrepare\x12\x15.cln.TxprepareRequest\x1a\x16.cln.TxprepareResponse\"\x00\x12\x33\n\x06TxSend\x12\x12.cln.TxsendRequest\x1a\x13.cln.TxsendResponse\"\x00\x12Q\n\x10ListPeerChannels\x12\x1c.cln.ListpeerchannelsRequest\x1a\x1d.cln.ListpeerchannelsResponse\"\x00\x12W\n\x12ListClosedChannels\x12\x1e.cln.ListclosedchannelsRequest\x1a\x1f.cln.ListclosedchannelsResponse\"\x00\x12<\n\tDecodePay\x12\x15.cln.DecodepayRequest\x1a\x16.cln.DecodepayResponse\"\x00\x12\x33\n\x06\x44\x65\x63ode\x12\x12.cln.DecodeRequest\x1a\x13.cln.DecodeResponse\"\x00\x12?\n\nDisconnect\x12\x16.cln.DisconnectRequest\x1a\x17.cln.DisconnectResponse\"\x00\x12\x39\n\x08\x46\x65\x65rates\x12\x14.cln.FeeratesRequest\x1a\x15.cln.FeeratesResponse\"\x00\x12\x45\n\x0c\x46\x65tchInvoice\x12\x18.cln.FetchinvoiceRequest\x1a\x19.cln.FetchinvoiceResponse\"\x00\x12\x42\n\x0b\x46undChannel\x12\x17.cln.FundchannelRequest\x1a\x18.cln.FundchannelResponse\"\x00\x12\x39\n\x08GetRoute\x12\x14.cln.GetrouteRequest\x1a\x15.cln.GetrouteResponse\"\x00\x12\x45\n\x0cListForwards\x12\x18.cln.ListforwardsRequest\x1a\x19.cln.ListforwardsResponse\"\x00\x12?\n\nListOffers\x12\x16.cln.ListoffersRequest\x1a\x17.cln.ListoffersResponse\"\x00\x12\x39\n\x08ListPays\x12\x14.cln.ListpaysRequest\x1a\x15.cln.ListpaysResponse\"\x00\x12<\n\tListHtlcs\x12\x15.cln.ListhtlcsRequest\x1a\x16.cln.ListhtlcsResponse\"\x00\x12\x30\n\x05Offer\x12\x11.cln.OfferRequest\x1a\x12.cln.OfferResponse\"\x00\x12-\n\x04Ping\x12\x10.cln.PingRequest\x1a\x11.cln.PingResponse\"\x00\x12H\n\rSendCustomMsg\x12\x19.cln.SendcustommsgRequest\x1a\x1a.cln.SendcustommsgResponse\"\x00\x12?\n\nSetChannel\x12\x16.cln.SetchannelRequest\x1a\x17.cln.SetchannelResponse\"\x00\x12\x42\n\x0bSignInvoice\x12\x17.cln.SigninvoiceRequest\x1a\x18.cln.SigninvoiceResponse\"\x00\x12\x42\n\x0bSignMessage\x12\x17.cln.SignmessageRequest\x1a\x18.cln.SignmessageResponse\"\x00\x12N\n\x0fWaitBlockHeight\x12\x1b.cln.WaitblockheightRequest\x1a\x1c.cln.WaitblockheightResponse\"\x00\x12-\n\x04Wait\x12\x10.cln.WaitRequest\x1a\x11.cln.WaitResponse\"\x00\x12-\n\x04Stop\x12\x10.cln.StopRequest\x1a\x11.cln.StopResponse\"\x00\x12T\n\x11PreApproveKeysend\x12\x1d.cln.PreapprovekeysendRequest\x1a\x1e.cln.PreapprovekeysendResponse\"\x00\x12T\n\x11PreApproveInvoice\x12\x1d.cln.PreapproveinvoiceRequest\x1a\x1e.cln.PreapproveinvoiceResponse\"\x00\x12\x45\n\x0cStaticBackup\x12\x18.cln.StaticbackupRequest\x1a\x19.cln.StaticbackupResponse\"\x00\x12K\n\x0e\x42kprListIncome\x12\x1a.cln.BkprlistincomeRequest\x1a\x1b.cln.BkprlistincomeResponse\"\x00\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -117,395 +117,395 @@ _globals['_CONNECTADDRESS_CONNECTADDRESSTYPE']._serialized_start=10326 _globals['_CONNECTADDRESS_CONNECTADDRESSTYPE']._serialized_end=10406 _globals['_CREATEINVOICEREQUEST']._serialized_start=10440 - _globals['_CREATEINVOICEREQUEST']._serialized_end=10499 - _globals['_CREATEINVOICERESPONSE']._serialized_start=10502 - _globals['_CREATEINVOICERESPONSE']._serialized_end=11268 - _globals['_CREATEINVOICERESPONSE_CREATEINVOICESTATUS']._serialized_start=11025 - _globals['_CREATEINVOICERESPONSE_CREATEINVOICESTATUS']._serialized_end=11081 - _globals['_CREATEINVOICEPAID_OUTPOINT']._serialized_start=11270 - _globals['_CREATEINVOICEPAID_OUTPOINT']._serialized_end=11358 - _globals['_DATASTOREREQUEST']._serialized_start=11361 - _globals['_DATASTOREREQUEST']._serialized_end=11669 - _globals['_DATASTOREREQUEST_DATASTOREMODE']._serialized_start=11514 - _globals['_DATASTOREREQUEST_DATASTOREMODE']._serialized_end=11626 - _globals['_DATASTORERESPONSE']._serialized_start=11672 - _globals['_DATASTORERESPONSE']._serialized_end=11802 - _globals['_DATASTOREUSAGEREQUEST']._serialized_start=11804 - _globals['_DATASTOREUSAGEREQUEST']._serialized_end=11827 - _globals['_DATASTOREUSAGERESPONSE']._serialized_start=11829 - _globals['_DATASTOREUSAGERESPONSE']._serialized_end=11936 - _globals['_DATASTOREUSAGEDATASTOREUSAGE']._serialized_start=11938 - _globals['_DATASTOREUSAGEDATASTOREUSAGE']._serialized_end=12036 - _globals['_CREATEONIONREQUEST']._serialized_start=12039 - _globals['_CREATEONIONREQUEST']._serialized_end=12196 - _globals['_CREATEONIONRESPONSE']._serialized_start=12198 - _globals['_CREATEONIONRESPONSE']._serialized_end=12258 - _globals['_CREATEONIONHOPS']._serialized_start=12260 - _globals['_CREATEONIONHOPS']._serialized_end=12310 - _globals['_DELDATASTOREREQUEST']._serialized_start=12312 - _globals['_DELDATASTOREREQUEST']._serialized_end=12386 - _globals['_DELDATASTORERESPONSE']._serialized_start=12389 - _globals['_DELDATASTORERESPONSE']._serialized_end=12522 - _globals['_DELEXPIREDINVOICEREQUEST']._serialized_start=12524 - _globals['_DELEXPIREDINVOICEREQUEST']._serialized_end=12596 - _globals['_DELEXPIREDINVOICERESPONSE']._serialized_start=12598 - _globals['_DELEXPIREDINVOICERESPONSE']._serialized_end=12625 - _globals['_DELINVOICEREQUEST']._serialized_start=12628 - _globals['_DELINVOICEREQUEST']._serialized_end=12810 - _globals['_DELINVOICEREQUEST_DELINVOICESTATUS']._serialized_start=12744 - _globals['_DELINVOICEREQUEST_DELINVOICESTATUS']._serialized_end=12797 - _globals['_DELINVOICERESPONSE']._serialized_start=12813 - _globals['_DELINVOICERESPONSE']._serialized_end=13358 - _globals['_DELINVOICERESPONSE_DELINVOICESTATUS']._serialized_start=12744 - _globals['_DELINVOICERESPONSE_DELINVOICESTATUS']._serialized_end=12797 - _globals['_INVOICEREQUEST']._serialized_start=13361 - _globals['_INVOICEREQUEST']._serialized_end=13611 - _globals['_INVOICERESPONSE']._serialized_start=13614 - _globals['_INVOICERESPONSE']._serialized_end=14019 - _globals['_LISTDATASTOREREQUEST']._serialized_start=14021 - _globals['_LISTDATASTOREREQUEST']._serialized_end=14056 - _globals['_LISTDATASTORERESPONSE']._serialized_start=14058 - _globals['_LISTDATASTORERESPONSE']._serialized_end=14129 - _globals['_LISTDATASTOREDATASTORE']._serialized_start=14132 - _globals['_LISTDATASTOREDATASTORE']._serialized_end=14267 - _globals['_LISTINVOICESREQUEST']._serialized_start=14270 - _globals['_LISTINVOICESREQUEST']._serialized_end=14620 - _globals['_LISTINVOICESREQUEST_LISTINVOICESINDEX']._serialized_start=14491 - _globals['_LISTINVOICESREQUEST_LISTINVOICESINDEX']._serialized_end=14536 - _globals['_LISTINVOICESRESPONSE']._serialized_start=14622 - _globals['_LISTINVOICESRESPONSE']._serialized_end=14689 - _globals['_LISTINVOICESINVOICES']._serialized_start=14692 - _globals['_LISTINVOICESINVOICES']._serialized_end=15544 - _globals['_LISTINVOICESINVOICES_LISTINVOICESINVOICESSTATUS']._serialized_start=15260 - _globals['_LISTINVOICESINVOICES_LISTINVOICESINVOICESSTATUS']._serialized_end=15323 - _globals['_LISTINVOICESINVOICESPAID_OUTPOINT']._serialized_start=15546 - _globals['_LISTINVOICESINVOICESPAID_OUTPOINT']._serialized_end=15641 - _globals['_SENDONIONREQUEST']._serialized_start=15644 - _globals['_SENDONIONREQUEST']._serialized_end=16080 - _globals['_SENDONIONRESPONSE']._serialized_start=16083 - _globals['_SENDONIONRESPONSE']._serialized_end=16698 - _globals['_SENDONIONRESPONSE_SENDONIONSTATUS']._serialized_start=16510 - _globals['_SENDONIONRESPONSE_SENDONIONSTATUS']._serialized_end=16554 - _globals['_SENDONIONFIRST_HOP']._serialized_start=16700 - _globals['_SENDONIONFIRST_HOP']._serialized_end=16781 - _globals['_LISTSENDPAYSREQUEST']._serialized_start=16784 - _globals['_LISTSENDPAYSREQUEST']._serialized_end=17200 - _globals['_LISTSENDPAYSREQUEST_LISTSENDPAYSSTATUS']._serialized_start=17025 - _globals['_LISTSENDPAYSREQUEST_LISTSENDPAYSSTATUS']._serialized_end=17084 - _globals['_LISTSENDPAYSREQUEST_LISTSENDPAYSINDEX']._serialized_start=17086 - _globals['_LISTSENDPAYSREQUEST_LISTSENDPAYSINDEX']._serialized_end=17131 - _globals['_LISTSENDPAYSRESPONSE']._serialized_start=17202 - _globals['_LISTSENDPAYSRESPONSE']._serialized_end=17269 - _globals['_LISTSENDPAYSPAYMENTS']._serialized_start=17272 - _globals['_LISTSENDPAYSPAYMENTS']._serialized_end=17992 - _globals['_LISTSENDPAYSPAYMENTS_LISTSENDPAYSPAYMENTSSTATUS']._serialized_start=17762 - _globals['_LISTSENDPAYSPAYMENTS_LISTSENDPAYSPAYMENTSSTATUS']._serialized_end=17829 - _globals['_LISTTRANSACTIONSREQUEST']._serialized_start=17994 - _globals['_LISTTRANSACTIONSREQUEST']._serialized_end=18019 - _globals['_LISTTRANSACTIONSRESPONSE']._serialized_start=18021 - _globals['_LISTTRANSACTIONSRESPONSE']._serialized_end=18104 - _globals['_LISTTRANSACTIONSTRANSACTIONS']._serialized_start=18107 - _globals['_LISTTRANSACTIONSTRANSACTIONS']._serialized_end=18355 - _globals['_LISTTRANSACTIONSTRANSACTIONSINPUTS']._serialized_start=18357 - _globals['_LISTTRANSACTIONSTRANSACTIONSINPUTS']._serialized_end=18440 - _globals['_LISTTRANSACTIONSTRANSACTIONSOUTPUTS']._serialized_start=18442 - _globals['_LISTTRANSACTIONSTRANSACTIONSOUTPUTS']._serialized_end=18550 - _globals['_PAYREQUEST']._serialized_start=18553 - _globals['_PAYREQUEST']._serialized_end=19027 - _globals['_PAYRESPONSE']._serialized_start=19030 - _globals['_PAYRESPONSE']._serialized_end=19409 - _globals['_PAYRESPONSE_PAYSTATUS']._serialized_start=19312 - _globals['_PAYRESPONSE_PAYSTATUS']._serialized_end=19362 - _globals['_LISTNODESREQUEST']._serialized_start=19411 - _globals['_LISTNODESREQUEST']._serialized_end=19453 - _globals['_LISTNODESRESPONSE']._serialized_start=19455 - _globals['_LISTNODESRESPONSE']._serialized_end=19510 - _globals['_LISTNODESNODES']._serialized_start=19513 - _globals['_LISTNODESNODES']._serialized_end=19738 - _globals['_LISTNODESNODESADDRESSES']._serialized_start=19741 - _globals['_LISTNODESNODESADDRESSES']._serialized_end=19973 - _globals['_LISTNODESNODESADDRESSES_LISTNODESNODESADDRESSESTYPE']._serialized_start=19881 - _globals['_LISTNODESNODESADDRESSES_LISTNODESNODESADDRESSESTYPE']._serialized_end=19961 - _globals['_WAITANYINVOICEREQUEST']._serialized_start=19975 - _globals['_WAITANYINVOICEREQUEST']._serialized_end=20078 - _globals['_WAITANYINVOICERESPONSE']._serialized_start=20081 - _globals['_WAITANYINVOICERESPONSE']._serialized_end=20784 - _globals['_WAITANYINVOICERESPONSE_WAITANYINVOICESTATUS']._serialized_start=20575 - _globals['_WAITANYINVOICERESPONSE_WAITANYINVOICESTATUS']._serialized_end=20620 - _globals['_WAITANYINVOICEPAID_OUTPOINT']._serialized_start=20786 - _globals['_WAITANYINVOICEPAID_OUTPOINT']._serialized_end=20875 - _globals['_WAITINVOICEREQUEST']._serialized_start=20877 - _globals['_WAITINVOICEREQUEST']._serialized_end=20897 - _globals['_WAITINVOICERESPONSE']._serialized_start=20900 - _globals['_WAITINVOICERESPONSE']._serialized_end=21588 - _globals['_WAITINVOICERESPONSE_WAITINVOICESTATUS']._serialized_start=21382 - _globals['_WAITINVOICERESPONSE_WAITINVOICESTATUS']._serialized_end=21424 - _globals['_WAITINVOICEPAID_OUTPOINT']._serialized_start=21590 - _globals['_WAITINVOICEPAID_OUTPOINT']._serialized_end=21676 - _globals['_WAITSENDPAYREQUEST']._serialized_start=21679 - _globals['_WAITSENDPAYREQUEST']._serialized_end=21821 - _globals['_WAITSENDPAYRESPONSE']._serialized_start=21824 - _globals['_WAITSENDPAYRESPONSE']._serialized_end=22478 - _globals['_WAITSENDPAYRESPONSE_WAITSENDPAYSTATUS']._serialized_start=22284 - _globals['_WAITSENDPAYRESPONSE_WAITSENDPAYSTATUS']._serialized_end=22317 - _globals['_NEWADDRREQUEST']._serialized_start=22481 - _globals['_NEWADDRREQUEST']._serialized_end=22632 - _globals['_NEWADDRREQUEST_NEWADDRADDRESSTYPE']._serialized_start=22565 - _globals['_NEWADDRREQUEST_NEWADDRADDRESSTYPE']._serialized_end=22616 - _globals['_NEWADDRRESPONSE']._serialized_start=22634 - _globals['_NEWADDRRESPONSE']._serialized_end=22711 - _globals['_WITHDRAWREQUEST']._serialized_start=22714 - _globals['_WITHDRAWREQUEST']._serialized_end=22899 - _globals['_WITHDRAWRESPONSE']._serialized_start=22901 - _globals['_WITHDRAWRESPONSE']._serialized_end=22959 - _globals['_KEYSENDREQUEST']._serialized_start=22962 - _globals['_KEYSENDREQUEST']._serialized_end=23348 - _globals['_KEYSENDRESPONSE']._serialized_start=23351 - _globals['_KEYSENDRESPONSE']._serialized_end=23721 - _globals['_KEYSENDRESPONSE_KEYSENDSTATUS']._serialized_start=23645 - _globals['_KEYSENDRESPONSE_KEYSENDSTATUS']._serialized_end=23674 - _globals['_FUNDPSBTREQUEST']._serialized_start=23724 - _globals['_FUNDPSBTREQUEST']._serialized_end=24144 - _globals['_FUNDPSBTRESPONSE']._serialized_start=24147 - _globals['_FUNDPSBTRESPONSE']._serialized_end=24364 - _globals['_FUNDPSBTRESERVATIONS']._serialized_start=24366 - _globals['_FUNDPSBTRESERVATIONS']._serialized_end=24483 - _globals['_SENDPSBTREQUEST']._serialized_start=24485 - _globals['_SENDPSBTREQUEST']._serialized_end=24550 - _globals['_SENDPSBTRESPONSE']._serialized_start=24552 - _globals['_SENDPSBTRESPONSE']._serialized_end=24596 - _globals['_SIGNPSBTREQUEST']._serialized_start=24598 - _globals['_SIGNPSBTREQUEST']._serialized_end=24647 - _globals['_SIGNPSBTRESPONSE']._serialized_start=24649 - _globals['_SIGNPSBTRESPONSE']._serialized_end=24688 - _globals['_UTXOPSBTREQUEST']._serialized_start=24691 - _globals['_UTXOPSBTREQUEST']._serialized_end=25107 - _globals['_UTXOPSBTRESPONSE']._serialized_start=25110 - _globals['_UTXOPSBTRESPONSE']._serialized_end=25327 - _globals['_UTXOPSBTRESERVATIONS']._serialized_start=25329 - _globals['_UTXOPSBTRESERVATIONS']._serialized_end=25446 - _globals['_TXDISCARDREQUEST']._serialized_start=25448 - _globals['_TXDISCARDREQUEST']._serialized_end=25480 - _globals['_TXDISCARDRESPONSE']._serialized_start=25482 - _globals['_TXDISCARDRESPONSE']._serialized_end=25536 - _globals['_TXPREPAREREQUEST']._serialized_start=25539 - _globals['_TXPREPAREREQUEST']._serialized_end=25703 - _globals['_TXPREPARERESPONSE']._serialized_start=25705 - _globals['_TXPREPARERESPONSE']._serialized_end=25773 - _globals['_TXSENDREQUEST']._serialized_start=25775 - _globals['_TXSENDREQUEST']._serialized_end=25804 - _globals['_TXSENDRESPONSE']._serialized_start=25806 - _globals['_TXSENDRESPONSE']._serialized_end=25862 - _globals['_LISTPEERCHANNELSREQUEST']._serialized_start=25864 - _globals['_LISTPEERCHANNELSREQUEST']._serialized_end=25913 - _globals['_LISTPEERCHANNELSRESPONSE']._serialized_start=25915 - _globals['_LISTPEERCHANNELSRESPONSE']._serialized_end=25990 - _globals['_LISTPEERCHANNELSCHANNELS']._serialized_start=25993 - _globals['_LISTPEERCHANNELSCHANNELS']._serialized_end=29459 - _globals['_LISTPEERCHANNELSCHANNELS_LISTPEERCHANNELSCHANNELSSTATE']._serialized_start=28106 - _globals['_LISTPEERCHANNELSCHANNELS_LISTPEERCHANNELSCHANNELSSTATE']._serialized_end=28490 - _globals['_LISTPEERCHANNELSCHANNELSUPDATES']._serialized_start=29462 - _globals['_LISTPEERCHANNELSCHANNELSUPDATES']._serialized_end=29644 - _globals['_LISTPEERCHANNELSCHANNELSUPDATESLOCAL']._serialized_start=29647 - _globals['_LISTPEERCHANNELSCHANNELSUPDATESLOCAL']._serialized_end=30006 - _globals['_LISTPEERCHANNELSCHANNELSUPDATESREMOTE']._serialized_start=30009 - _globals['_LISTPEERCHANNELSCHANNELSUPDATESREMOTE']._serialized_end=30369 - _globals['_LISTPEERCHANNELSCHANNELSFEERATE']._serialized_start=30371 - _globals['_LISTPEERCHANNELSCHANNELSFEERATE']._serialized_end=30464 - _globals['_LISTPEERCHANNELSCHANNELSINFLIGHT']._serialized_start=30467 - _globals['_LISTPEERCHANNELSCHANNELSINFLIGHT']._serialized_end=30851 - _globals['_LISTPEERCHANNELSCHANNELSFUNDING']._serialized_start=30854 - _globals['_LISTPEERCHANNELSCHANNELSFUNDING']._serialized_end=31192 - _globals['_LISTPEERCHANNELSCHANNELSALIAS']._serialized_start=31194 - _globals['_LISTPEERCHANNELSCHANNELSALIAS']._serialized_end=31287 - _globals['_LISTPEERCHANNELSCHANNELSHTLCS']._serialized_start=31290 - _globals['_LISTPEERCHANNELSCHANNELSHTLCS']._serialized_end=31772 - _globals['_LISTPEERCHANNELSCHANNELSHTLCS_LISTPEERCHANNELSCHANNELSHTLCSDIRECTION']._serialized_start=31611 - _globals['_LISTPEERCHANNELSCHANNELSHTLCS_LISTPEERCHANNELSCHANNELSHTLCSDIRECTION']._serialized_end=31668 - _globals['_LISTCLOSEDCHANNELSREQUEST']._serialized_start=31774 - _globals['_LISTCLOSEDCHANNELSREQUEST']._serialized_end=31825 - _globals['_LISTCLOSEDCHANNELSRESPONSE']._serialized_start=31827 - _globals['_LISTCLOSEDCHANNELSRESPONSE']._serialized_end=31918 - _globals['_LISTCLOSEDCHANNELSCLOSEDCHANNELS']._serialized_start=31921 - _globals['_LISTCLOSEDCHANNELSCLOSEDCHANNELS']._serialized_end=33187 - _globals['_LISTCLOSEDCHANNELSCLOSEDCHANNELS_LISTCLOSEDCHANNELSCLOSEDCHANNELSCLOSE_CAUSE']._serialized_start=32858 - _globals['_LISTCLOSEDCHANNELSCLOSEDCHANNELS_LISTCLOSEDCHANNELSCLOSEDCHANNELSCLOSE_CAUSE']._serialized_end=32976 - _globals['_LISTCLOSEDCHANNELSCLOSEDCHANNELSALIAS']._serialized_start=33189 - _globals['_LISTCLOSEDCHANNELSCLOSEDCHANNELSALIAS']._serialized_end=33290 - _globals['_DECODEPAYREQUEST']._serialized_start=33292 - _globals['_DECODEPAYREQUEST']._serialized_end=33368 - _globals['_DECODEPAYRESPONSE']._serialized_start=33371 - _globals['_DECODEPAYRESPONSE']._serialized_end=33896 - _globals['_DECODEPAYFALLBACKS']._serialized_start=33899 - _globals['_DECODEPAYFALLBACKS']._serialized_end=34107 - _globals['_DECODEPAYFALLBACKS_DECODEPAYFALLBACKSTYPE']._serialized_start=34020 - _globals['_DECODEPAYFALLBACKS_DECODEPAYFALLBACKSTYPE']._serialized_end=34098 - _globals['_DECODEPAYEXTRA']._serialized_start=34109 - _globals['_DECODEPAYEXTRA']._serialized_end=34152 - _globals['_DECODEREQUEST']._serialized_start=34154 - _globals['_DECODEREQUEST']._serialized_end=34185 - _globals['_DECODERESPONSE']._serialized_start=34188 - _globals['_DECODERESPONSE']._serialized_end=38516 - _globals['_DECODERESPONSE_DECODETYPE']._serialized_start=36781 - _globals['_DECODERESPONSE_DECODETYPE']._serialized_end=36912 - _globals['_DECODEOFFER_PATHS']._serialized_start=38518 - _globals['_DECODEOFFER_PATHS']._serialized_end=38578 - _globals['_DECODEOFFER_RECURRENCEPAYWINDOW']._serialized_start=38581 - _globals['_DECODEOFFER_RECURRENCEPAYWINDOW']._serialized_end=38719 - _globals['_DECODEINVOICE_PATHSPATH']._serialized_start=38721 - _globals['_DECODEINVOICE_PATHSPATH']._serialized_end=38805 - _globals['_DECODEINVOICE_FALLBACKS']._serialized_start=38807 - _globals['_DECODEINVOICE_FALLBACKS']._serialized_end=38896 - _globals['_DECODEFALLBACKS']._serialized_start=38898 - _globals['_DECODEFALLBACKS']._serialized_end=39017 - _globals['_DECODEEXTRA']._serialized_start=39019 - _globals['_DECODEEXTRA']._serialized_end=39059 - _globals['_DECODERESTRICTIONS']._serialized_start=39061 - _globals['_DECODERESTRICTIONS']._serialized_end=39120 - _globals['_DISCONNECTREQUEST']._serialized_start=39122 - _globals['_DISCONNECTREQUEST']._serialized_end=39183 - _globals['_DISCONNECTRESPONSE']._serialized_start=39185 - _globals['_DISCONNECTRESPONSE']._serialized_end=39205 - _globals['_FEERATESREQUEST']._serialized_start=39207 - _globals['_FEERATESREQUEST']._serialized_end=39314 - _globals['_FEERATESREQUEST_FEERATESSTYLE']._serialized_start=39277 - _globals['_FEERATESREQUEST_FEERATESSTYLE']._serialized_end=39314 - _globals['_FEERATESRESPONSE']._serialized_start=39317 - _globals['_FEERATESRESPONSE']._serialized_end=39601 - _globals['_FEERATESPERKB']._serialized_start=39604 - _globals['_FEERATESPERKB']._serialized_end=40071 - _globals['_FEERATESPERKBESTIMATES']._serialized_start=40074 - _globals['_FEERATESPERKBESTIMATES']._serialized_end=40224 - _globals['_FEERATESPERKW']._serialized_start=40227 - _globals['_FEERATESPERKW']._serialized_end=40694 - _globals['_FEERATESPERKWESTIMATES']._serialized_start=40697 - _globals['_FEERATESPERKWESTIMATES']._serialized_end=40847 - _globals['_FEERATESONCHAIN_FEE_ESTIMATES']._serialized_start=40850 - _globals['_FEERATESONCHAIN_FEE_ESTIMATES']._serialized_end=41133 - _globals['_FETCHINVOICEREQUEST']._serialized_start=41136 - _globals['_FETCHINVOICEREQUEST']._serialized_end=41497 - _globals['_FETCHINVOICERESPONSE']._serialized_start=41500 - _globals['_FETCHINVOICERESPONSE']._serialized_end=41654 - _globals['_FETCHINVOICECHANGES']._serialized_start=41657 - _globals['_FETCHINVOICECHANGES']._serialized_end=41915 - _globals['_FETCHINVOICENEXT_PERIOD']._serialized_start=41917 - _globals['_FETCHINVOICENEXT_PERIOD']._serialized_end=42043 - _globals['_FUNDCHANNELREQUEST']._serialized_start=42046 - _globals['_FUNDCHANNELREQUEST']._serialized_end=42553 - _globals['_FUNDCHANNELRESPONSE']._serialized_start=42556 - _globals['_FUNDCHANNELRESPONSE']._serialized_end=42785 - _globals['_FUNDCHANNELCHANNEL_TYPE']._serialized_start=42787 - _globals['_FUNDCHANNELCHANNEL_TYPE']._serialized_end=42863 - _globals['_GETROUTEREQUEST']._serialized_start=42866 - _globals['_GETROUTEREQUEST']._serialized_end=43102 - _globals['_GETROUTERESPONSE']._serialized_start=43104 - _globals['_GETROUTERESPONSE']._serialized_end=43157 - _globals['_GETROUTEROUTE']._serialized_start=43160 - _globals['_GETROUTEROUTE']._serialized_end=43357 - _globals['_GETROUTEROUTE_GETROUTEROUTESTYLE']._serialized_start=43328 - _globals['_GETROUTEROUTE_GETROUTEROUTESTYLE']._serialized_end=43357 - _globals['_LISTFORWARDSREQUEST']._serialized_start=43360 - _globals['_LISTFORWARDSREQUEST']._serialized_end=43799 - _globals['_LISTFORWARDSREQUEST_LISTFORWARDSSTATUS']._serialized_start=43604 - _globals['_LISTFORWARDSREQUEST_LISTFORWARDSSTATUS']._serialized_end=43680 - _globals['_LISTFORWARDSREQUEST_LISTFORWARDSINDEX']._serialized_start=43682 - _globals['_LISTFORWARDSREQUEST_LISTFORWARDSINDEX']._serialized_end=43727 - _globals['_LISTFORWARDSRESPONSE']._serialized_start=43801 - _globals['_LISTFORWARDSRESPONSE']._serialized_end=43868 - _globals['_LISTFORWARDSFORWARDS']._serialized_start=43871 - _globals['_LISTFORWARDSFORWARDS']._serialized_end=44569 - _globals['_LISTFORWARDSFORWARDS_LISTFORWARDSFORWARDSSTATUS']._serialized_start=44316 - _globals['_LISTFORWARDSFORWARDS_LISTFORWARDSFORWARDSSTATUS']._serialized_end=44400 - _globals['_LISTFORWARDSFORWARDS_LISTFORWARDSFORWARDSSTYLE']._serialized_start=44402 - _globals['_LISTFORWARDSFORWARDS_LISTFORWARDSFORWARDSSTYLE']._serialized_end=44450 - _globals['_LISTOFFERSREQUEST']._serialized_start=44571 - _globals['_LISTOFFERSREQUEST']._serialized_end=44668 - _globals['_LISTOFFERSRESPONSE']._serialized_start=44670 - _globals['_LISTOFFERSRESPONSE']._serialized_end=44729 - _globals['_LISTOFFERSOFFERS']._serialized_start=44732 - _globals['_LISTOFFERSOFFERS']._serialized_end=44864 - _globals['_LISTPAYSREQUEST']._serialized_start=44867 - _globals['_LISTPAYSREQUEST']._serialized_end=45086 - _globals['_LISTPAYSREQUEST_LISTPAYSSTATUS']._serialized_start=44992 - _globals['_LISTPAYSREQUEST_LISTPAYSSTATUS']._serialized_end=45047 - _globals['_LISTPAYSRESPONSE']._serialized_start=45088 - _globals['_LISTPAYSRESPONSE']._serialized_end=45139 - _globals['_LISTPAYSPAYS']._serialized_start=45142 - _globals['_LISTPAYSPAYS']._serialized_end=45781 - _globals['_LISTPAYSPAYS_LISTPAYSPAYSSTATUS']._serialized_start=45556 - _globals['_LISTPAYSPAYS_LISTPAYSPAYSSTATUS']._serialized_end=45615 - _globals['_LISTHTLCSREQUEST']._serialized_start=45783 - _globals['_LISTHTLCSREQUEST']._serialized_end=45825 - _globals['_LISTHTLCSRESPONSE']._serialized_start=45827 - _globals['_LISTHTLCSRESPONSE']._serialized_end=45882 - _globals['_LISTHTLCSHTLCS']._serialized_start=45885 - _globals['_LISTHTLCSHTLCS']._serialized_end=46150 - _globals['_LISTHTLCSHTLCS_LISTHTLCSHTLCSDIRECTION']._serialized_start=46108 - _globals['_LISTHTLCSHTLCS_LISTHTLCSHTLCSDIRECTION']._serialized_end=46150 - _globals['_OFFERREQUEST']._serialized_start=46153 - _globals['_OFFERREQUEST']._serialized_end=46602 - _globals['_OFFERRESPONSE']._serialized_start=46605 - _globals['_OFFERRESPONSE']._serialized_end=46751 - _globals['_PINGREQUEST']._serialized_start=46753 - _globals['_PINGREQUEST']._serialized_end=46842 - _globals['_PINGRESPONSE']._serialized_start=46844 - _globals['_PINGRESPONSE']._serialized_end=46874 - _globals['_SENDCUSTOMMSGREQUEST']._serialized_start=46876 - _globals['_SENDCUSTOMMSGREQUEST']._serialized_end=46928 - _globals['_SENDCUSTOMMSGRESPONSE']._serialized_start=46930 - _globals['_SENDCUSTOMMSGRESPONSE']._serialized_end=46969 - _globals['_SETCHANNELREQUEST']._serialized_start=46972 - _globals['_SETCHANNELREQUEST']._serialized_end=47270 - _globals['_SETCHANNELRESPONSE']._serialized_start=47272 - _globals['_SETCHANNELRESPONSE']._serialized_end=47335 - _globals['_SETCHANNELCHANNELS']._serialized_start=47338 - _globals['_SETCHANNELCHANNELS']._serialized_end=47796 - _globals['_SIGNINVOICEREQUEST']._serialized_start=47798 - _globals['_SIGNINVOICEREQUEST']._serialized_end=47837 - _globals['_SIGNINVOICERESPONSE']._serialized_start=47839 - _globals['_SIGNINVOICERESPONSE']._serialized_end=47876 - _globals['_SIGNMESSAGEREQUEST']._serialized_start=47878 - _globals['_SIGNMESSAGEREQUEST']._serialized_end=47915 - _globals['_SIGNMESSAGERESPONSE']._serialized_start=47917 - _globals['_SIGNMESSAGERESPONSE']._serialized_end=47987 - _globals['_WAITBLOCKHEIGHTREQUEST']._serialized_start=47989 - _globals['_WAITBLOCKHEIGHTREQUEST']._serialized_end=48068 - _globals['_WAITBLOCKHEIGHTRESPONSE']._serialized_start=48070 - _globals['_WAITBLOCKHEIGHTRESPONSE']._serialized_end=48116 - _globals['_WAITREQUEST']._serialized_start=48119 - _globals['_WAITREQUEST']._serialized_end=48368 - _globals['_WAITREQUEST_WAITSUBSYSTEM']._serialized_start=48255 - _globals['_WAITREQUEST_WAITSUBSYSTEM']._serialized_end=48312 - _globals['_WAITREQUEST_WAITINDEXNAME']._serialized_start=48314 - _globals['_WAITREQUEST_WAITINDEXNAME']._serialized_end=48368 - _globals['_WAITRESPONSE']._serialized_start=48371 - _globals['_WAITRESPONSE']._serialized_end=48598 - _globals['_WAITRESPONSE_WAITSUBSYSTEM']._serialized_start=48255 - _globals['_WAITRESPONSE_WAITSUBSYSTEM']._serialized_end=48312 - _globals['_STOPREQUEST']._serialized_start=48600 - _globals['_STOPREQUEST']._serialized_end=48613 - _globals['_STOPRESPONSE']._serialized_start=48615 - _globals['_STOPRESPONSE']._serialized_end=48728 - _globals['_STOPRESPONSE_STOPRESULT']._serialized_start=48682 - _globals['_STOPRESPONSE_STOPRESULT']._serialized_end=48717 - _globals['_PREAPPROVEKEYSENDREQUEST']._serialized_start=48731 - _globals['_PREAPPROVEKEYSENDREQUEST']._serialized_end=48898 - _globals['_PREAPPROVEKEYSENDRESPONSE']._serialized_start=48900 - _globals['_PREAPPROVEKEYSENDRESPONSE']._serialized_end=48927 - _globals['_PREAPPROVEINVOICEREQUEST']._serialized_start=48929 - _globals['_PREAPPROVEINVOICEREQUEST']._serialized_end=48987 - _globals['_PREAPPROVEINVOICERESPONSE']._serialized_start=48989 - _globals['_PREAPPROVEINVOICERESPONSE']._serialized_end=49016 - _globals['_STATICBACKUPREQUEST']._serialized_start=49018 - _globals['_STATICBACKUPREQUEST']._serialized_end=49039 - _globals['_STATICBACKUPRESPONSE']._serialized_start=49041 - _globals['_STATICBACKUPRESPONSE']._serialized_end=49076 - _globals['_BKPRLISTINCOMEREQUEST']._serialized_start=49079 - _globals['_BKPRLISTINCOMEREQUEST']._serialized_end=49230 - _globals['_BKPRLISTINCOMERESPONSE']._serialized_start=49232 - _globals['_BKPRLISTINCOMERESPONSE']._serialized_end=49313 - _globals['_BKPRLISTINCOMEINCOME_EVENTS']._serialized_start=49316 - _globals['_BKPRLISTINCOMEINCOME_EVENTS']._serialized_end=49625 - _globals['_NODE']._serialized_start=49628 - _globals['_NODE']._serialized_end=53822 + _globals['_CREATEINVOICEREQUEST']._serialized_end=10514 + _globals['_CREATEINVOICERESPONSE']._serialized_start=10517 + _globals['_CREATEINVOICERESPONSE']._serialized_end=11283 + _globals['_CREATEINVOICERESPONSE_CREATEINVOICESTATUS']._serialized_start=11040 + _globals['_CREATEINVOICERESPONSE_CREATEINVOICESTATUS']._serialized_end=11096 + _globals['_CREATEINVOICEPAID_OUTPOINT']._serialized_start=11285 + _globals['_CREATEINVOICEPAID_OUTPOINT']._serialized_end=11373 + _globals['_DATASTOREREQUEST']._serialized_start=11376 + _globals['_DATASTOREREQUEST']._serialized_end=11684 + _globals['_DATASTOREREQUEST_DATASTOREMODE']._serialized_start=11529 + _globals['_DATASTOREREQUEST_DATASTOREMODE']._serialized_end=11641 + _globals['_DATASTORERESPONSE']._serialized_start=11687 + _globals['_DATASTORERESPONSE']._serialized_end=11817 + _globals['_DATASTOREUSAGEREQUEST']._serialized_start=11819 + _globals['_DATASTOREUSAGEREQUEST']._serialized_end=11855 + _globals['_DATASTOREUSAGERESPONSE']._serialized_start=11857 + _globals['_DATASTOREUSAGERESPONSE']._serialized_end=11964 + _globals['_DATASTOREUSAGEDATASTOREUSAGE']._serialized_start=11966 + _globals['_DATASTOREUSAGEDATASTOREUSAGE']._serialized_end=12064 + _globals['_CREATEONIONREQUEST']._serialized_start=12067 + _globals['_CREATEONIONREQUEST']._serialized_end=12224 + _globals['_CREATEONIONRESPONSE']._serialized_start=12226 + _globals['_CREATEONIONRESPONSE']._serialized_end=12286 + _globals['_CREATEONIONHOPS']._serialized_start=12288 + _globals['_CREATEONIONHOPS']._serialized_end=12338 + _globals['_DELDATASTOREREQUEST']._serialized_start=12340 + _globals['_DELDATASTOREREQUEST']._serialized_end=12414 + _globals['_DELDATASTORERESPONSE']._serialized_start=12417 + _globals['_DELDATASTORERESPONSE']._serialized_end=12550 + _globals['_DELEXPIREDINVOICEREQUEST']._serialized_start=12552 + _globals['_DELEXPIREDINVOICEREQUEST']._serialized_end=12624 + _globals['_DELEXPIREDINVOICERESPONSE']._serialized_start=12626 + _globals['_DELEXPIREDINVOICERESPONSE']._serialized_end=12653 + _globals['_DELINVOICEREQUEST']._serialized_start=12656 + _globals['_DELINVOICEREQUEST']._serialized_end=12838 + _globals['_DELINVOICEREQUEST_DELINVOICESTATUS']._serialized_start=12772 + _globals['_DELINVOICEREQUEST_DELINVOICESTATUS']._serialized_end=12825 + _globals['_DELINVOICERESPONSE']._serialized_start=12841 + _globals['_DELINVOICERESPONSE']._serialized_end=13386 + _globals['_DELINVOICERESPONSE_DELINVOICESTATUS']._serialized_start=12772 + _globals['_DELINVOICERESPONSE_DELINVOICESTATUS']._serialized_end=12825 + _globals['_INVOICEREQUEST']._serialized_start=13389 + _globals['_INVOICEREQUEST']._serialized_end=13639 + _globals['_INVOICERESPONSE']._serialized_start=13642 + _globals['_INVOICERESPONSE']._serialized_end=14047 + _globals['_LISTDATASTOREREQUEST']._serialized_start=14049 + _globals['_LISTDATASTOREREQUEST']._serialized_end=14084 + _globals['_LISTDATASTORERESPONSE']._serialized_start=14086 + _globals['_LISTDATASTORERESPONSE']._serialized_end=14157 + _globals['_LISTDATASTOREDATASTORE']._serialized_start=14160 + _globals['_LISTDATASTOREDATASTORE']._serialized_end=14295 + _globals['_LISTINVOICESREQUEST']._serialized_start=14298 + _globals['_LISTINVOICESREQUEST']._serialized_end=14648 + _globals['_LISTINVOICESREQUEST_LISTINVOICESINDEX']._serialized_start=14519 + _globals['_LISTINVOICESREQUEST_LISTINVOICESINDEX']._serialized_end=14564 + _globals['_LISTINVOICESRESPONSE']._serialized_start=14650 + _globals['_LISTINVOICESRESPONSE']._serialized_end=14717 + _globals['_LISTINVOICESINVOICES']._serialized_start=14720 + _globals['_LISTINVOICESINVOICES']._serialized_end=15572 + _globals['_LISTINVOICESINVOICES_LISTINVOICESINVOICESSTATUS']._serialized_start=15288 + _globals['_LISTINVOICESINVOICES_LISTINVOICESINVOICESSTATUS']._serialized_end=15351 + _globals['_LISTINVOICESINVOICESPAID_OUTPOINT']._serialized_start=15574 + _globals['_LISTINVOICESINVOICESPAID_OUTPOINT']._serialized_end=15669 + _globals['_SENDONIONREQUEST']._serialized_start=15672 + _globals['_SENDONIONREQUEST']._serialized_end=16108 + _globals['_SENDONIONRESPONSE']._serialized_start=16111 + _globals['_SENDONIONRESPONSE']._serialized_end=16726 + _globals['_SENDONIONRESPONSE_SENDONIONSTATUS']._serialized_start=16538 + _globals['_SENDONIONRESPONSE_SENDONIONSTATUS']._serialized_end=16582 + _globals['_SENDONIONFIRST_HOP']._serialized_start=16728 + _globals['_SENDONIONFIRST_HOP']._serialized_end=16809 + _globals['_LISTSENDPAYSREQUEST']._serialized_start=16812 + _globals['_LISTSENDPAYSREQUEST']._serialized_end=17228 + _globals['_LISTSENDPAYSREQUEST_LISTSENDPAYSSTATUS']._serialized_start=17053 + _globals['_LISTSENDPAYSREQUEST_LISTSENDPAYSSTATUS']._serialized_end=17112 + _globals['_LISTSENDPAYSREQUEST_LISTSENDPAYSINDEX']._serialized_start=17114 + _globals['_LISTSENDPAYSREQUEST_LISTSENDPAYSINDEX']._serialized_end=17159 + _globals['_LISTSENDPAYSRESPONSE']._serialized_start=17230 + _globals['_LISTSENDPAYSRESPONSE']._serialized_end=17297 + _globals['_LISTSENDPAYSPAYMENTS']._serialized_start=17300 + _globals['_LISTSENDPAYSPAYMENTS']._serialized_end=18064 + _globals['_LISTSENDPAYSPAYMENTS_LISTSENDPAYSPAYMENTSSTATUS']._serialized_start=17817 + _globals['_LISTSENDPAYSPAYMENTS_LISTSENDPAYSPAYMENTSSTATUS']._serialized_end=17884 + _globals['_LISTTRANSACTIONSREQUEST']._serialized_start=18066 + _globals['_LISTTRANSACTIONSREQUEST']._serialized_end=18091 + _globals['_LISTTRANSACTIONSRESPONSE']._serialized_start=18093 + _globals['_LISTTRANSACTIONSRESPONSE']._serialized_end=18176 + _globals['_LISTTRANSACTIONSTRANSACTIONS']._serialized_start=18179 + _globals['_LISTTRANSACTIONSTRANSACTIONS']._serialized_end=18427 + _globals['_LISTTRANSACTIONSTRANSACTIONSINPUTS']._serialized_start=18429 + _globals['_LISTTRANSACTIONSTRANSACTIONSINPUTS']._serialized_end=18512 + _globals['_LISTTRANSACTIONSTRANSACTIONSOUTPUTS']._serialized_start=18514 + _globals['_LISTTRANSACTIONSTRANSACTIONSOUTPUTS']._serialized_end=18622 + _globals['_PAYREQUEST']._serialized_start=18625 + _globals['_PAYREQUEST']._serialized_end=19099 + _globals['_PAYRESPONSE']._serialized_start=19102 + _globals['_PAYRESPONSE']._serialized_end=19481 + _globals['_PAYRESPONSE_PAYSTATUS']._serialized_start=19384 + _globals['_PAYRESPONSE_PAYSTATUS']._serialized_end=19434 + _globals['_LISTNODESREQUEST']._serialized_start=19483 + _globals['_LISTNODESREQUEST']._serialized_end=19525 + _globals['_LISTNODESRESPONSE']._serialized_start=19527 + _globals['_LISTNODESRESPONSE']._serialized_end=19582 + _globals['_LISTNODESNODES']._serialized_start=19585 + _globals['_LISTNODESNODES']._serialized_end=19810 + _globals['_LISTNODESNODESADDRESSES']._serialized_start=19813 + _globals['_LISTNODESNODESADDRESSES']._serialized_end=20045 + _globals['_LISTNODESNODESADDRESSES_LISTNODESNODESADDRESSESTYPE']._serialized_start=19953 + _globals['_LISTNODESNODESADDRESSES_LISTNODESNODESADDRESSESTYPE']._serialized_end=20033 + _globals['_WAITANYINVOICEREQUEST']._serialized_start=20047 + _globals['_WAITANYINVOICEREQUEST']._serialized_end=20150 + _globals['_WAITANYINVOICERESPONSE']._serialized_start=20153 + _globals['_WAITANYINVOICERESPONSE']._serialized_end=20856 + _globals['_WAITANYINVOICERESPONSE_WAITANYINVOICESTATUS']._serialized_start=20647 + _globals['_WAITANYINVOICERESPONSE_WAITANYINVOICESTATUS']._serialized_end=20692 + _globals['_WAITANYINVOICEPAID_OUTPOINT']._serialized_start=20858 + _globals['_WAITANYINVOICEPAID_OUTPOINT']._serialized_end=20947 + _globals['_WAITINVOICEREQUEST']._serialized_start=20949 + _globals['_WAITINVOICEREQUEST']._serialized_end=20984 + _globals['_WAITINVOICERESPONSE']._serialized_start=20987 + _globals['_WAITINVOICERESPONSE']._serialized_end=21675 + _globals['_WAITINVOICERESPONSE_WAITINVOICESTATUS']._serialized_start=21469 + _globals['_WAITINVOICERESPONSE_WAITINVOICESTATUS']._serialized_end=21511 + _globals['_WAITINVOICEPAID_OUTPOINT']._serialized_start=21677 + _globals['_WAITINVOICEPAID_OUTPOINT']._serialized_end=21763 + _globals['_WAITSENDPAYREQUEST']._serialized_start=21766 + _globals['_WAITSENDPAYREQUEST']._serialized_end=21908 + _globals['_WAITSENDPAYRESPONSE']._serialized_start=21911 + _globals['_WAITSENDPAYRESPONSE']._serialized_end=22565 + _globals['_WAITSENDPAYRESPONSE_WAITSENDPAYSTATUS']._serialized_start=22371 + _globals['_WAITSENDPAYRESPONSE_WAITSENDPAYSTATUS']._serialized_end=22404 + _globals['_NEWADDRREQUEST']._serialized_start=22568 + _globals['_NEWADDRREQUEST']._serialized_end=22719 + _globals['_NEWADDRREQUEST_NEWADDRADDRESSTYPE']._serialized_start=22652 + _globals['_NEWADDRREQUEST_NEWADDRADDRESSTYPE']._serialized_end=22703 + _globals['_NEWADDRRESPONSE']._serialized_start=22721 + _globals['_NEWADDRRESPONSE']._serialized_end=22798 + _globals['_WITHDRAWREQUEST']._serialized_start=22801 + _globals['_WITHDRAWREQUEST']._serialized_end=22986 + _globals['_WITHDRAWRESPONSE']._serialized_start=22988 + _globals['_WITHDRAWRESPONSE']._serialized_end=23046 + _globals['_KEYSENDREQUEST']._serialized_start=23049 + _globals['_KEYSENDREQUEST']._serialized_end=23435 + _globals['_KEYSENDRESPONSE']._serialized_start=23438 + _globals['_KEYSENDRESPONSE']._serialized_end=23808 + _globals['_KEYSENDRESPONSE_KEYSENDSTATUS']._serialized_start=23732 + _globals['_KEYSENDRESPONSE_KEYSENDSTATUS']._serialized_end=23761 + _globals['_FUNDPSBTREQUEST']._serialized_start=23811 + _globals['_FUNDPSBTREQUEST']._serialized_end=24231 + _globals['_FUNDPSBTRESPONSE']._serialized_start=24234 + _globals['_FUNDPSBTRESPONSE']._serialized_end=24451 + _globals['_FUNDPSBTRESERVATIONS']._serialized_start=24453 + _globals['_FUNDPSBTRESERVATIONS']._serialized_end=24570 + _globals['_SENDPSBTREQUEST']._serialized_start=24572 + _globals['_SENDPSBTREQUEST']._serialized_end=24637 + _globals['_SENDPSBTRESPONSE']._serialized_start=24639 + _globals['_SENDPSBTRESPONSE']._serialized_end=24683 + _globals['_SIGNPSBTREQUEST']._serialized_start=24685 + _globals['_SIGNPSBTREQUEST']._serialized_end=24734 + _globals['_SIGNPSBTRESPONSE']._serialized_start=24736 + _globals['_SIGNPSBTRESPONSE']._serialized_end=24775 + _globals['_UTXOPSBTREQUEST']._serialized_start=24778 + _globals['_UTXOPSBTREQUEST']._serialized_end=25194 + _globals['_UTXOPSBTRESPONSE']._serialized_start=25197 + _globals['_UTXOPSBTRESPONSE']._serialized_end=25414 + _globals['_UTXOPSBTRESERVATIONS']._serialized_start=25416 + _globals['_UTXOPSBTRESERVATIONS']._serialized_end=25533 + _globals['_TXDISCARDREQUEST']._serialized_start=25535 + _globals['_TXDISCARDREQUEST']._serialized_end=25567 + _globals['_TXDISCARDRESPONSE']._serialized_start=25569 + _globals['_TXDISCARDRESPONSE']._serialized_end=25623 + _globals['_TXPREPAREREQUEST']._serialized_start=25626 + _globals['_TXPREPAREREQUEST']._serialized_end=25790 + _globals['_TXPREPARERESPONSE']._serialized_start=25792 + _globals['_TXPREPARERESPONSE']._serialized_end=25860 + _globals['_TXSENDREQUEST']._serialized_start=25862 + _globals['_TXSENDREQUEST']._serialized_end=25891 + _globals['_TXSENDRESPONSE']._serialized_start=25893 + _globals['_TXSENDRESPONSE']._serialized_end=25949 + _globals['_LISTPEERCHANNELSREQUEST']._serialized_start=25951 + _globals['_LISTPEERCHANNELSREQUEST']._serialized_end=26000 + _globals['_LISTPEERCHANNELSRESPONSE']._serialized_start=26002 + _globals['_LISTPEERCHANNELSRESPONSE']._serialized_end=26077 + _globals['_LISTPEERCHANNELSCHANNELS']._serialized_start=26080 + _globals['_LISTPEERCHANNELSCHANNELS']._serialized_end=29592 + _globals['_LISTPEERCHANNELSCHANNELS_LISTPEERCHANNELSCHANNELSSTATE']._serialized_start=28221 + _globals['_LISTPEERCHANNELSCHANNELS_LISTPEERCHANNELSCHANNELSSTATE']._serialized_end=28605 + _globals['_LISTPEERCHANNELSCHANNELSUPDATES']._serialized_start=29595 + _globals['_LISTPEERCHANNELSCHANNELSUPDATES']._serialized_end=29777 + _globals['_LISTPEERCHANNELSCHANNELSUPDATESLOCAL']._serialized_start=29780 + _globals['_LISTPEERCHANNELSCHANNELSUPDATESLOCAL']._serialized_end=30139 + _globals['_LISTPEERCHANNELSCHANNELSUPDATESREMOTE']._serialized_start=30142 + _globals['_LISTPEERCHANNELSCHANNELSUPDATESREMOTE']._serialized_end=30502 + _globals['_LISTPEERCHANNELSCHANNELSFEERATE']._serialized_start=30504 + _globals['_LISTPEERCHANNELSCHANNELSFEERATE']._serialized_end=30597 + _globals['_LISTPEERCHANNELSCHANNELSINFLIGHT']._serialized_start=30600 + _globals['_LISTPEERCHANNELSCHANNELSINFLIGHT']._serialized_end=30984 + _globals['_LISTPEERCHANNELSCHANNELSFUNDING']._serialized_start=30987 + _globals['_LISTPEERCHANNELSCHANNELSFUNDING']._serialized_end=31325 + _globals['_LISTPEERCHANNELSCHANNELSALIAS']._serialized_start=31327 + _globals['_LISTPEERCHANNELSCHANNELSALIAS']._serialized_end=31420 + _globals['_LISTPEERCHANNELSCHANNELSHTLCS']._serialized_start=31423 + _globals['_LISTPEERCHANNELSCHANNELSHTLCS']._serialized_end=31905 + _globals['_LISTPEERCHANNELSCHANNELSHTLCS_LISTPEERCHANNELSCHANNELSHTLCSDIRECTION']._serialized_start=31744 + _globals['_LISTPEERCHANNELSCHANNELSHTLCS_LISTPEERCHANNELSCHANNELSHTLCSDIRECTION']._serialized_end=31801 + _globals['_LISTCLOSEDCHANNELSREQUEST']._serialized_start=31907 + _globals['_LISTCLOSEDCHANNELSREQUEST']._serialized_end=31958 + _globals['_LISTCLOSEDCHANNELSRESPONSE']._serialized_start=31960 + _globals['_LISTCLOSEDCHANNELSRESPONSE']._serialized_end=32051 + _globals['_LISTCLOSEDCHANNELSCLOSEDCHANNELS']._serialized_start=32054 + _globals['_LISTCLOSEDCHANNELSCLOSEDCHANNELS']._serialized_end=33320 + _globals['_LISTCLOSEDCHANNELSCLOSEDCHANNELS_LISTCLOSEDCHANNELSCLOSEDCHANNELSCLOSE_CAUSE']._serialized_start=32991 + _globals['_LISTCLOSEDCHANNELSCLOSEDCHANNELS_LISTCLOSEDCHANNELSCLOSEDCHANNELSCLOSE_CAUSE']._serialized_end=33109 + _globals['_LISTCLOSEDCHANNELSCLOSEDCHANNELSALIAS']._serialized_start=33322 + _globals['_LISTCLOSEDCHANNELSCLOSEDCHANNELSALIAS']._serialized_end=33423 + _globals['_DECODEPAYREQUEST']._serialized_start=33425 + _globals['_DECODEPAYREQUEST']._serialized_end=33501 + _globals['_DECODEPAYRESPONSE']._serialized_start=33504 + _globals['_DECODEPAYRESPONSE']._serialized_end=34029 + _globals['_DECODEPAYFALLBACKS']._serialized_start=34032 + _globals['_DECODEPAYFALLBACKS']._serialized_end=34240 + _globals['_DECODEPAYFALLBACKS_DECODEPAYFALLBACKSTYPE']._serialized_start=34153 + _globals['_DECODEPAYFALLBACKS_DECODEPAYFALLBACKSTYPE']._serialized_end=34231 + _globals['_DECODEPAYEXTRA']._serialized_start=34242 + _globals['_DECODEPAYEXTRA']._serialized_end=34285 + _globals['_DECODEREQUEST']._serialized_start=34287 + _globals['_DECODEREQUEST']._serialized_end=34318 + _globals['_DECODERESPONSE']._serialized_start=34321 + _globals['_DECODERESPONSE']._serialized_end=38649 + _globals['_DECODERESPONSE_DECODETYPE']._serialized_start=36914 + _globals['_DECODERESPONSE_DECODETYPE']._serialized_end=37045 + _globals['_DECODEOFFER_PATHS']._serialized_start=38651 + _globals['_DECODEOFFER_PATHS']._serialized_end=38711 + _globals['_DECODEOFFER_RECURRENCEPAYWINDOW']._serialized_start=38714 + _globals['_DECODEOFFER_RECURRENCEPAYWINDOW']._serialized_end=38852 + _globals['_DECODEINVOICE_PATHSPATH']._serialized_start=38854 + _globals['_DECODEINVOICE_PATHSPATH']._serialized_end=38938 + _globals['_DECODEINVOICE_FALLBACKS']._serialized_start=38940 + _globals['_DECODEINVOICE_FALLBACKS']._serialized_end=39029 + _globals['_DECODEFALLBACKS']._serialized_start=39031 + _globals['_DECODEFALLBACKS']._serialized_end=39150 + _globals['_DECODEEXTRA']._serialized_start=39152 + _globals['_DECODEEXTRA']._serialized_end=39192 + _globals['_DECODERESTRICTIONS']._serialized_start=39194 + _globals['_DECODERESTRICTIONS']._serialized_end=39253 + _globals['_DISCONNECTREQUEST']._serialized_start=39255 + _globals['_DISCONNECTREQUEST']._serialized_end=39316 + _globals['_DISCONNECTRESPONSE']._serialized_start=39318 + _globals['_DISCONNECTRESPONSE']._serialized_end=39338 + _globals['_FEERATESREQUEST']._serialized_start=39340 + _globals['_FEERATESREQUEST']._serialized_end=39447 + _globals['_FEERATESREQUEST_FEERATESSTYLE']._serialized_start=39410 + _globals['_FEERATESREQUEST_FEERATESSTYLE']._serialized_end=39447 + _globals['_FEERATESRESPONSE']._serialized_start=39450 + _globals['_FEERATESRESPONSE']._serialized_end=39734 + _globals['_FEERATESPERKB']._serialized_start=39737 + _globals['_FEERATESPERKB']._serialized_end=40204 + _globals['_FEERATESPERKBESTIMATES']._serialized_start=40207 + _globals['_FEERATESPERKBESTIMATES']._serialized_end=40357 + _globals['_FEERATESPERKW']._serialized_start=40360 + _globals['_FEERATESPERKW']._serialized_end=40827 + _globals['_FEERATESPERKWESTIMATES']._serialized_start=40830 + _globals['_FEERATESPERKWESTIMATES']._serialized_end=40980 + _globals['_FEERATESONCHAIN_FEE_ESTIMATES']._serialized_start=40983 + _globals['_FEERATESONCHAIN_FEE_ESTIMATES']._serialized_end=41266 + _globals['_FETCHINVOICEREQUEST']._serialized_start=41269 + _globals['_FETCHINVOICEREQUEST']._serialized_end=41630 + _globals['_FETCHINVOICERESPONSE']._serialized_start=41633 + _globals['_FETCHINVOICERESPONSE']._serialized_end=41787 + _globals['_FETCHINVOICECHANGES']._serialized_start=41790 + _globals['_FETCHINVOICECHANGES']._serialized_end=42048 + _globals['_FETCHINVOICENEXT_PERIOD']._serialized_start=42050 + _globals['_FETCHINVOICENEXT_PERIOD']._serialized_end=42176 + _globals['_FUNDCHANNELREQUEST']._serialized_start=42179 + _globals['_FUNDCHANNELREQUEST']._serialized_end=42686 + _globals['_FUNDCHANNELRESPONSE']._serialized_start=42689 + _globals['_FUNDCHANNELRESPONSE']._serialized_end=42918 + _globals['_FUNDCHANNELCHANNEL_TYPE']._serialized_start=42920 + _globals['_FUNDCHANNELCHANNEL_TYPE']._serialized_end=42996 + _globals['_GETROUTEREQUEST']._serialized_start=42999 + _globals['_GETROUTEREQUEST']._serialized_end=43235 + _globals['_GETROUTERESPONSE']._serialized_start=43237 + _globals['_GETROUTERESPONSE']._serialized_end=43290 + _globals['_GETROUTEROUTE']._serialized_start=43293 + _globals['_GETROUTEROUTE']._serialized_end=43490 + _globals['_GETROUTEROUTE_GETROUTEROUTESTYLE']._serialized_start=43461 + _globals['_GETROUTEROUTE_GETROUTEROUTESTYLE']._serialized_end=43490 + _globals['_LISTFORWARDSREQUEST']._serialized_start=43493 + _globals['_LISTFORWARDSREQUEST']._serialized_end=43932 + _globals['_LISTFORWARDSREQUEST_LISTFORWARDSSTATUS']._serialized_start=43737 + _globals['_LISTFORWARDSREQUEST_LISTFORWARDSSTATUS']._serialized_end=43813 + _globals['_LISTFORWARDSREQUEST_LISTFORWARDSINDEX']._serialized_start=43815 + _globals['_LISTFORWARDSREQUEST_LISTFORWARDSINDEX']._serialized_end=43860 + _globals['_LISTFORWARDSRESPONSE']._serialized_start=43934 + _globals['_LISTFORWARDSRESPONSE']._serialized_end=44001 + _globals['_LISTFORWARDSFORWARDS']._serialized_start=44004 + _globals['_LISTFORWARDSFORWARDS']._serialized_end=44702 + _globals['_LISTFORWARDSFORWARDS_LISTFORWARDSFORWARDSSTATUS']._serialized_start=44449 + _globals['_LISTFORWARDSFORWARDS_LISTFORWARDSFORWARDSSTATUS']._serialized_end=44533 + _globals['_LISTFORWARDSFORWARDS_LISTFORWARDSFORWARDSSTYLE']._serialized_start=44535 + _globals['_LISTFORWARDSFORWARDS_LISTFORWARDSFORWARDSSTYLE']._serialized_end=44583 + _globals['_LISTOFFERSREQUEST']._serialized_start=44704 + _globals['_LISTOFFERSREQUEST']._serialized_end=44801 + _globals['_LISTOFFERSRESPONSE']._serialized_start=44803 + _globals['_LISTOFFERSRESPONSE']._serialized_end=44862 + _globals['_LISTOFFERSOFFERS']._serialized_start=44865 + _globals['_LISTOFFERSOFFERS']._serialized_end=44997 + _globals['_LISTPAYSREQUEST']._serialized_start=45000 + _globals['_LISTPAYSREQUEST']._serialized_end=45219 + _globals['_LISTPAYSREQUEST_LISTPAYSSTATUS']._serialized_start=45125 + _globals['_LISTPAYSREQUEST_LISTPAYSSTATUS']._serialized_end=45180 + _globals['_LISTPAYSRESPONSE']._serialized_start=45221 + _globals['_LISTPAYSRESPONSE']._serialized_end=45272 + _globals['_LISTPAYSPAYS']._serialized_start=45275 + _globals['_LISTPAYSPAYS']._serialized_end=45914 + _globals['_LISTPAYSPAYS_LISTPAYSPAYSSTATUS']._serialized_start=45689 + _globals['_LISTPAYSPAYS_LISTPAYSPAYSSTATUS']._serialized_end=45748 + _globals['_LISTHTLCSREQUEST']._serialized_start=45916 + _globals['_LISTHTLCSREQUEST']._serialized_end=45958 + _globals['_LISTHTLCSRESPONSE']._serialized_start=45960 + _globals['_LISTHTLCSRESPONSE']._serialized_end=46015 + _globals['_LISTHTLCSHTLCS']._serialized_start=46018 + _globals['_LISTHTLCSHTLCS']._serialized_end=46283 + _globals['_LISTHTLCSHTLCS_LISTHTLCSHTLCSDIRECTION']._serialized_start=46241 + _globals['_LISTHTLCSHTLCS_LISTHTLCSHTLCSDIRECTION']._serialized_end=46283 + _globals['_OFFERREQUEST']._serialized_start=46286 + _globals['_OFFERREQUEST']._serialized_end=46735 + _globals['_OFFERRESPONSE']._serialized_start=46738 + _globals['_OFFERRESPONSE']._serialized_end=46884 + _globals['_PINGREQUEST']._serialized_start=46886 + _globals['_PINGREQUEST']._serialized_end=46975 + _globals['_PINGRESPONSE']._serialized_start=46977 + _globals['_PINGRESPONSE']._serialized_end=47007 + _globals['_SENDCUSTOMMSGREQUEST']._serialized_start=47009 + _globals['_SENDCUSTOMMSGREQUEST']._serialized_end=47061 + _globals['_SENDCUSTOMMSGRESPONSE']._serialized_start=47063 + _globals['_SENDCUSTOMMSGRESPONSE']._serialized_end=47102 + _globals['_SETCHANNELREQUEST']._serialized_start=47105 + _globals['_SETCHANNELREQUEST']._serialized_end=47403 + _globals['_SETCHANNELRESPONSE']._serialized_start=47405 + _globals['_SETCHANNELRESPONSE']._serialized_end=47468 + _globals['_SETCHANNELCHANNELS']._serialized_start=47471 + _globals['_SETCHANNELCHANNELS']._serialized_end=47929 + _globals['_SIGNINVOICEREQUEST']._serialized_start=47931 + _globals['_SIGNINVOICEREQUEST']._serialized_end=47970 + _globals['_SIGNINVOICERESPONSE']._serialized_start=47972 + _globals['_SIGNINVOICERESPONSE']._serialized_end=48009 + _globals['_SIGNMESSAGEREQUEST']._serialized_start=48011 + _globals['_SIGNMESSAGEREQUEST']._serialized_end=48048 + _globals['_SIGNMESSAGERESPONSE']._serialized_start=48050 + _globals['_SIGNMESSAGERESPONSE']._serialized_end=48120 + _globals['_WAITBLOCKHEIGHTREQUEST']._serialized_start=48122 + _globals['_WAITBLOCKHEIGHTREQUEST']._serialized_end=48201 + _globals['_WAITBLOCKHEIGHTRESPONSE']._serialized_start=48203 + _globals['_WAITBLOCKHEIGHTRESPONSE']._serialized_end=48249 + _globals['_WAITREQUEST']._serialized_start=48252 + _globals['_WAITREQUEST']._serialized_end=48501 + _globals['_WAITREQUEST_WAITSUBSYSTEM']._serialized_start=48388 + _globals['_WAITREQUEST_WAITSUBSYSTEM']._serialized_end=48445 + _globals['_WAITREQUEST_WAITINDEXNAME']._serialized_start=48447 + _globals['_WAITREQUEST_WAITINDEXNAME']._serialized_end=48501 + _globals['_WAITRESPONSE']._serialized_start=48504 + _globals['_WAITRESPONSE']._serialized_end=48731 + _globals['_WAITRESPONSE_WAITSUBSYSTEM']._serialized_start=48388 + _globals['_WAITRESPONSE_WAITSUBSYSTEM']._serialized_end=48445 + _globals['_STOPREQUEST']._serialized_start=48733 + _globals['_STOPREQUEST']._serialized_end=48746 + _globals['_STOPRESPONSE']._serialized_start=48748 + _globals['_STOPRESPONSE']._serialized_end=48861 + _globals['_STOPRESPONSE_STOPRESULT']._serialized_start=48815 + _globals['_STOPRESPONSE_STOPRESULT']._serialized_end=48850 + _globals['_PREAPPROVEKEYSENDREQUEST']._serialized_start=48864 + _globals['_PREAPPROVEKEYSENDREQUEST']._serialized_end=49031 + _globals['_PREAPPROVEKEYSENDRESPONSE']._serialized_start=49033 + _globals['_PREAPPROVEKEYSENDRESPONSE']._serialized_end=49060 + _globals['_PREAPPROVEINVOICEREQUEST']._serialized_start=49062 + _globals['_PREAPPROVEINVOICEREQUEST']._serialized_end=49120 + _globals['_PREAPPROVEINVOICERESPONSE']._serialized_start=49122 + _globals['_PREAPPROVEINVOICERESPONSE']._serialized_end=49149 + _globals['_STATICBACKUPREQUEST']._serialized_start=49151 + _globals['_STATICBACKUPREQUEST']._serialized_end=49172 + _globals['_STATICBACKUPRESPONSE']._serialized_start=49174 + _globals['_STATICBACKUPRESPONSE']._serialized_end=49209 + _globals['_BKPRLISTINCOMEREQUEST']._serialized_start=49212 + _globals['_BKPRLISTINCOMEREQUEST']._serialized_end=49363 + _globals['_BKPRLISTINCOMERESPONSE']._serialized_start=49365 + _globals['_BKPRLISTINCOMERESPONSE']._serialized_end=49446 + _globals['_BKPRLISTINCOMEINCOME_EVENTS']._serialized_start=49449 + _globals['_BKPRLISTINCOMEINCOME_EVENTS']._serialized_end=49758 + _globals['_NODE']._serialized_start=49761 + _globals['_NODE']._serialized_end=53955 # @@protoc_insertion_point(module_scope) diff --git a/contrib/pyln-testing/pyln/testing/fixtures.py b/contrib/pyln-testing/pyln/testing/fixtures.py index aa770388bd61..5a71c33f8b08 100644 --- a/contrib/pyln-testing/pyln/testing/fixtures.py +++ b/contrib/pyln-testing/pyln/testing/fixtures.py @@ -432,15 +432,16 @@ def is_currency(checker, instance): type_checker=type_checker) -def _load_schema(filename, is_request): +def _load_schema(filename): """Load the schema from @filename and create a validator for it""" with open(filename, 'r') as f: - return _extra_validator(is_request)(json.load(f)) + data = json.load(f) + return [_extra_validator(True)(data.get('request', {})), _extra_validator(False)(data.get('response', {}))] @pytest.fixture(autouse=True) def jsonschemas(): - """Load schema files if they exist: returns request/response schemas by pairs""" + """Load schema file if it exist: returns request/response schemas by pairs""" try: schemafiles = os.listdir('doc/schemas') except FileNotFoundError: @@ -448,20 +449,10 @@ def jsonschemas(): schemas = {} for fname in schemafiles: - if fname.endswith('.schema.json'): - base = fname.rpartition('.schema')[0] - is_request = False - index = 1 - elif fname.endswith('.request.json'): - base = fname.rpartition('.request')[0] - is_request = True - index = 0 - else: - continue - if base not in schemas: - schemas[base] = [None, None] - schemas[base][index] = _load_schema(os.path.join('doc/schemas', fname), - is_request) + if fname.startswith('lightning-') and fname.endswith('.json'): + base = fname.replace('lightning-', '').replace('.json', '') + # Request is 0 and Response is 1 + schemas[base] = _load_schema(os.path.join('doc/schemas', fname)) return schemas diff --git a/contrib/pyln-testing/pyln/testing/grpc2py.py b/contrib/pyln-testing/pyln/testing/grpc2py.py index 5ba5bc5d317a..51921f5d1995 100644 --- a/contrib/pyln-testing/pyln/testing/grpc2py.py +++ b/contrib/pyln-testing/pyln/testing/grpc2py.py @@ -512,6 +512,7 @@ def listsendpays_payments2py(m): "bolt11": m.bolt11, # PrimitiveField in generate_composite "description": m.description, # PrimitiveField in generate_composite "bolt12": m.bolt12, # PrimitiveField in generate_composite + "completed_at": m.completed_at, # PrimitiveField in generate_composite "payment_preimage": hexlify(m.payment_preimage), # PrimitiveField in generate_composite "erroronion": hexlify(m.erroronion), # PrimitiveField in generate_composite }) @@ -872,6 +873,7 @@ def listpeerchannels_channels2py(m): return remove_default({ "peer_id": hexlify(m.peer_id), # PrimitiveField in generate_composite "peer_connected": m.peer_connected, # PrimitiveField in generate_composite + "reestablished": m.reestablished, # PrimitiveField in generate_composite "state": str(m.state), # EnumField in generate_composite "scratch_txid": hexlify(m.scratch_txid), # PrimitiveField in generate_composite "ignore_fee_limits": m.ignore_fee_limits, # PrimitiveField in generate_composite diff --git a/doc/Makefile b/doc/Makefile index 647efff13d49..29a89d8aeffe 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -4,11 +4,8 @@ doc-wrongdir: $(MAKE) -C .. doc-all -MANPAGES := doc/lightning-cli.1 \ - doc/lightningd.8 \ - doc/lightningd-config.5 \ - doc/lightningd-rpc.7 \ - doc/lightning-addgossip.7 \ +GENERATE_MARKDOWN := doc/lightning-addgossip.7 \ + doc/lightning-addpsbtoutput.7 \ doc/lightning-autoclean-once.7 \ doc/lightning-autoclean-status.7 \ doc/lightning-batching.7 \ @@ -23,20 +20,20 @@ MANPAGES := doc/lightning-cli.1 \ doc/lightning-checkmessage.7 \ doc/lightning-checkrune.7 \ doc/lightning-close.7 \ - doc/lightning-connect.7 \ - doc/lightning-commando.7 \ doc/lightning-commando-blacklist.7 \ + doc/lightning-commando.7 \ doc/lightning-commando-listrunes.7 \ doc/lightning-commando-rune.7 \ - doc/lightning-createonion.7 \ + doc/lightning-connect.7 \ doc/lightning-createinvoice.7 \ + doc/lightning-createonion.7 \ doc/lightning-createrune.7 \ doc/lightning-datastore.7 \ doc/lightning-datastoreusage.7 \ - doc/lightning-decodepay.7 \ doc/lightning-decode.7 \ + doc/lightning-decodepay.7 \ doc/lightning-deldatastore.7 \ - doc/lightning-delexpiredinvoice.7 \ + doc/lightning-delexpiredinvoice.7 \ doc/lightning-delforward.7 \ doc/lightning-delinvoice.7 \ doc/lightning-delpay.7 \ @@ -47,32 +44,35 @@ MANPAGES := doc/lightning-cli.1 \ doc/lightning-emergencyrecover.7 \ doc/lightning-feerates.7 \ doc/lightning-fetchinvoice.7 \ + doc/lightning-fundchannel_cancel.7 \ + doc/lightning-fundchannel_complete.7 \ doc/lightning-fundchannel.7 \ doc/lightning-fundchannel_start.7 \ - doc/lightning-fundchannel_complete.7 \ - doc/lightning-fundchannel_cancel.7 \ doc/lightning-funderupdate.7 \ - doc/lightning-addpsbtoutput.7 \ doc/lightning-fundpsbt.7 \ + doc/lightning-getinfo.7 \ + doc/lightning-getlog.7 \ doc/lightning-getroute.7 \ - doc/lightning-hsmtool.8 \ + doc/lightning-help.7 \ doc/lightning-invoice.7 \ doc/lightning-invoicerequest.7 \ doc/lightning-keysend.7 \ doc/lightning-listchannels.7 \ doc/lightning-listclosedchannels.7 \ + doc/lightning-listconfigs.7 \ doc/lightning-listdatastore.7 \ doc/lightning-listforwards.7 \ doc/lightning-listfunds.7 \ doc/lightning-listhtlcs.7 \ - doc/lightning-listinvoices.7 \ doc/lightning-listinvoicerequests.7 \ + doc/lightning-listinvoices.7 \ + doc/lightning-listnodes.7 \ doc/lightning-listoffers.7 \ doc/lightning-listpays.7 \ - doc/lightning-listpeers.7 \ doc/lightning-listpeerchannels.7 \ - doc/lightning-showrunes.7 \ + doc/lightning-listpeers.7 \ doc/lightning-listsendpays.7 \ + doc/lightning-listtransactions.7 \ doc/lightning-makesecret.7 \ doc/lightning-multifundchannel.7 \ doc/lightning-multiwithdraw.7 \ @@ -84,61 +84,79 @@ MANPAGES := doc/lightning-cli.1 \ doc/lightning-openchannel_init.7 \ doc/lightning-openchannel_signed.7 \ doc/lightning-openchannel_update.7 \ - doc/lightning-pay.7 \ doc/lightning-parsefeerate.7 \ + doc/lightning-pay.7 \ + doc/lightning-ping.7 \ doc/lightning-plugin.7 \ doc/lightning-preapproveinvoice.7 \ doc/lightning-preapprovekeysend.7 \ - doc/lightning-recover.7 \ doc/lightning-recoverchannel.7 \ + doc/lightning-recover.7 \ doc/lightning-renepay.7 \ doc/lightning-renepaystatus.7 \ doc/lightning-reserveinputs.7 \ + doc/lightning-sendcustommsg.7 \ doc/lightning-sendinvoice.7 \ doc/lightning-sendonion.7 \ doc/lightning-sendonionmessage.7 \ doc/lightning-sendpay.7 \ + doc/lightning-sendpsbt.7 \ doc/lightning-setchannel.7 \ doc/lightning-setconfig.7 \ doc/lightning-setpsbtversion.7 \ - doc/lightning-sendcustommsg.7 \ + doc/lightning-showrunes.7 \ doc/lightning-signinvoice.7 \ doc/lightning-signmessage.7 \ + doc/lightning-signpsbt.7 \ doc/lightning-splice_init.7 \ - doc/lightning-splice_update.7 \ doc/lightning-splice_signed.7 \ - doc/lightning-staticbackup.7 \ - doc/lightning-txprepare.7 \ + doc/lightning-splice_update.7 \ + doc/lightning-staticbackup.7 \ + doc/lightning-stop.7 \ doc/lightning-txdiscard.7 \ + doc/lightning-txprepare.7 \ doc/lightning-txsend.7 \ doc/lightning-unreserveinputs.7 \ + doc/lightning-upgradewallet.7 \ doc/lightning-utxopsbt.7 \ - doc/lightning-wait.7 \ - doc/lightning-waitinvoice.7 \ doc/lightning-waitanyinvoice.7 \ doc/lightning-waitblockheight.7 \ + doc/lightning-waitinvoice.7 \ + doc/lightning-wait.7 \ doc/lightning-waitsendpay.7 \ - doc/lightning-withdraw.7 \ - doc/lightning-ping.7 \ - doc/lightning-stop.7 \ - doc/lightning-signpsbt.7 \ - doc/lightning-sendpsbt.7 \ - doc/lightning-getinfo.7 \ - doc/lightning-listtransactions.7 \ - doc/lightning-listnodes.7 \ - doc/lightning-listconfigs.7 \ - doc/lightning-help.7 \ - doc/lightning-getlog.7 \ - doc/reckless.7 + doc/lightning-withdraw.7 ifeq ($(HAVE_SQLITE3),1) -MANPAGES += doc/lightning-listsqlschemas.7 \ - doc/lightning-sql.7 +GENERATE_MARKDOWN += doc/lightning-listsqlschemas.7 \ + doc/lightning-sql.7 endif +MANPAGES := $(GENERATE_MARKDOWN) \ + doc/lightning-cli.1 \ + doc/lightningd.8 \ + doc/lightningd-config.5 \ + doc/lightningd-rpc.7 \ + doc/lightning-hsmtool.8 \ + doc/reckless.7 + +MARKDOWN_WITH_SCHEMA := $(GENERATE_MARKDOWN:=.md) + +doc/schemas/lightning-sql.json: plugins/sql +# Delete the old tables schema and generate the new ones. + @if [ "$$(jq '[.tables[] | startswith("The following tables are currently supported:")]' doc/schemas/lightning-sql.json | jq 'any')" = "true" ]; then \ + jq 'del(.tables[] | select(startswith("The following tables are currently supported:")))' "$@" > "$@.tmp" && mv "$@.tmp" "$@"; \ + fi + @plugins/sql --print-docs | jq --arg sqldata "$$(awk '{printf "%s\n", $$0}')" '.tables += [$$sqldata]' "$@" > "$@.tmp" && mv "$@.tmp" "$@"; + doc-all: $(MANPAGES) doc/index.rst -SCHEMAS := $(wildcard doc/schemas/*.json) +SCHEMAS := $(wildcard doc/schemas/lightning-*.json) + +# Don't try to build lightning-sql.json tables with plugins/sql if we don't have sqlite3 +ifeq ($(HAVE_SQLITE3),0) +SCHEMAS := $(filter-out doc/schemas/lightning-sql.json, $(SCHEMAS)) +endif + check-fmt-schemas: $(SCHEMAS:%=check-fmt-schema/%) fmt-schemas: $(SCHEMAS:%=fmt-schema/%) @@ -150,15 +168,12 @@ fmt-schema/%: % check-doc: check-config-docs check-manpages check-fmt-schemas -# Some manpages use a schema, so need that added. -MARKDOWN_WITH_SCHEMA := $(shell grep -l GENERATE-FROM-SCHEMA $(MANPAGES:=.md)) - # These are hard to use in $(call) functions. LBRACKET=( RBRACKET=) -$(MARKDOWN_WITH_SCHEMA): doc/lightning-%.7.md: doc/schemas/%.schema.json tools/fromschema.py - @if $(call SHA256STAMP_CHANGED); then $(call VERBOSE, "fromschema $@", tools/fromschema.py --markdownfile=$@ doc/schemas/$*.schema.json > $@.tmp && grep -v SHA256STAMP: $@.tmp > $@ && rm -f $@.tmp && $(call SHA256STAMP,[comment]: # $(LBRACKET),$(RBRACKET))); else touch $@; fi +$(MARKDOWN_WITH_SCHEMA): doc/lightning-%.7.md: doc/schemas/lightning-%.json tools/fromschema.py + @tools/fromschema.py --markdownfile=$@ $< > $@.tmp && mv $@.tmp $@ # If we need to build lowdown, make tools/md2man.sh depend on it. # That way it's not used in SHA256STAMP (which only uses direct @@ -172,19 +187,11 @@ LOWDOWN := lowdown endif $(MANPAGES): doc/%: doc/%.md tools/md2man.sh version_gen.h - @if $(call SHA256STAMP_CHANGED); then $(call VERBOSE, "md2man $<", VERSION=$(VERSION) tools/md2man.sh $(LOWDOWN) $< > $@ && $(call SHA256STAMP,\\\",)); else touch $@; fi + @VERSION=$(VERSION) tools/md2man.sh $(LOWDOWN) $< > $@ $(MANPAGES): $(FORCE) $(MARKDOWN_WITH_SCHEMA): $(FORCE) -# Use awk for preamble, then again for post, with the new docs in the middle. -# We can't put plugins/sql in deps directly, since they all get sha256! -doc/.sqlgen: plugins/sql - @plugins/sql --print-docs > $@ - -doc/lightning-sql.7.md: doc/.sqlgen $(FORCE) - @if $(call SHA256STAMP_CHANGED); then $(call VERBOSE, "sql-print-docs $@", awk "/GENERATE-DOC-START/ { print \$$0; exit } { print \$$0 }" < $@ > $@.tmp && cat doc/.sqlgen >> $@.tmp && (awk "/GENERATE-DOC-END/ { PRINT=1 } { if (PRINT) { print \$$0 } }" | grep -v SHA256STAMP) < $@ >> $@.tmp && mv $@.tmp $@ && $(call SHA256STAMP,[comment]: # $(LBRACKET),$(RBRACKET))); else touch $@; fi - doc/protocol-%.svg: test/test_protocol test/test_protocol --svg < test/commits/$*.script > $@ @@ -225,8 +232,8 @@ check-manpages: all-programs check-config-docs default-targets # Makes sure that fields mentioned in schema are in man page, and vice versa. check-config-docs: - @for c in `sed -n 's/^ "\(.*\)": {/\1/p' doc/schemas/listconfigs.schema.json | grep -v '^# version$$' | grep -v '^plugins$$' | grep -v '^important-plugins$$'`; do if ! grep -q "^ \*\*$$c\*\*" doc/lightningd-config.5.md; then echo "$$c undocumented!"; exit 1; fi; done - @for c in `grep -v '\[plugin ' doc/lightningd-config.5.md | sed -n 's/^ \*\*\([^*]*\)\*\*.*/\1/p' | grep -v '^\(help\|version\|mainnet\|testnet\|signet\|plugin\|important-plugin\|plugin-dir\|clear-plugins\)$$'`; do if ! grep -q '"'"$$c"'"' doc/schemas/listconfigs.schema.json; then echo "$$c documented but not in schema!"; exit 1; fi; done + @for c in `sed -n 's/^ "\(.*\)": {/\1/p' doc/schemas/lightning-listconfigs.json | grep -v '^# version$$' | grep -v '^plugins$$' | grep -v '^important-plugins$$'`; do if ! grep -q "^ \*\*$$c\*\*" doc/lightningd-config.5.md; then echo "$$c undocumented!"; exit 1; fi; done + @for c in `grep -v '\[plugin ' doc/lightningd-config.5.md | sed -n 's/^ \*\*\([^*]*\)\*\*.*/\1/p' | grep -v '^\(help\|version\|mainnet\|testnet\|signet\|plugin\|important-plugin\|plugin-dir\|clear-plugins\)$$'`; do if ! grep -q '"'"$$c"'"' doc/schemas/lightning-listconfigs.json; then echo "$$c documented but not in schema!"; exit 1; fi; done doc-maintainer-clean: $(RM) $(MANPAGES) diff --git a/doc/schemas/lightning-sql.json b/doc/schemas/lightning-sql.json index 455310941260..63088cbbc668 100644 --- a/doc/schemas/lightning-sql.json +++ b/doc/schemas/lightning-sql.json @@ -102,7 +102,7 @@ "tables": [ "Note that the first column of every table is a unique integer called `rowid`: this is used for related tables to refer to specific rows in their parent. sqlite3 usually has this as an implicit column, but we make it explicit as the implicit version is not allowed to be used as a foreign key.", "", - "The following tables are currently supported:\n- `bkpr_accountevents` (see lightning-bkpr-listaccountevents(7))\n - `account` (type `string`, sqltype `TEXT`)\n - `type` (type `string`, sqltype `TEXT`)\n - `tag` (type `string`, sqltype `TEXT`)\n - `credit_msat` (type `msat`, sqltype `INTEGER`)\n - `debit_msat` (type `msat`, sqltype `INTEGER`)\n - `currency` (type `string`, sqltype `TEXT`)\n - `timestamp` (type `u32`, sqltype `INTEGER`)\n - `outpoint` (type `string`, sqltype `TEXT`)\n - `blockheight` (type `u32`, sqltype `INTEGER`)\n - `origin` (type `string`, sqltype `TEXT`)\n - `payment_id` (type `hex`, sqltype `BLOB`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `description` (type `string`, sqltype `TEXT`)\n - `fees_msat` (type `msat`, sqltype `INTEGER`)\n - `is_rebalance` (type `boolean`, sqltype `INTEGER`)\n - `part_id` (type `u32`, sqltype `INTEGER`)\n\n- `bkpr_income` (see lightning-bkpr-listincome(7))\n - `account` (type `string`, sqltype `TEXT`)\n - `tag` (type `string`, sqltype `TEXT`)\n - `credit_msat` (type `msat`, sqltype `INTEGER`)\n - `debit_msat` (type `msat`, sqltype `INTEGER`)\n - `currency` (type `string`, sqltype `TEXT`)\n - `timestamp` (type `u32`, sqltype `INTEGER`)\n - `description` (type `string`, sqltype `TEXT`)\n - `outpoint` (type `string`, sqltype `TEXT`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `payment_id` (type `hex`, sqltype `BLOB`)\n\n- `channels` indexed by `short_channel_id` (see lightning-listchannels(7))\n - `source` (type `pubkey`, sqltype `BLOB`)\n - `destination` (type `pubkey`, sqltype `BLOB`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `direction` (type `u32`, sqltype `INTEGER`)\n - `public` (type `boolean`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `message_flags` (type `u8`, sqltype `INTEGER`)\n - `channel_flags` (type `u8`, sqltype `INTEGER`)\n - `active` (type `boolean`, sqltype `INTEGER`)\n - `last_update` (type `u32`, sqltype `INTEGER`)\n - `base_fee_millisatoshi` (type `u32`, sqltype `INTEGER`)\n - `fee_per_millionth` (type `u32`, sqltype `INTEGER`)\n - `delay` (type `u32`, sqltype `INTEGER`)\n - `htlc_minimum_msat` (type `msat`, sqltype `INTEGER`)\n - `htlc_maximum_msat` (type `msat`, sqltype `INTEGER`)\n - `features` (type `hex`, sqltype `BLOB`)\n\n- `closedchannels` (see lightning-listclosedchannels(7))\n - `peer_id` (type `pubkey`, sqltype `BLOB`)\n - `channel_id` (type `hash`, sqltype `BLOB`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `opener` (type `string`, sqltype `TEXT`)\n - `closer` (type `string`, sqltype `TEXT`)\n - `private` (type `boolean`, sqltype `INTEGER`)\n - related table `closedchannels_channel_type_bits`, from JSON object `channel_type`\n - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `bits` (type `u32`, sqltype `INTEGER`)\n - related table `closedchannels_channel_type_names`, from JSON object `channel_type`\n - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `names` (type `string`, sqltype `TEXT`)\n - `total_local_commitments` (type `u64`, sqltype `INTEGER`)\n - `total_remote_commitments` (type `u64`, sqltype `INTEGER`)\n - `total_htlcs_sent` (type `u64`, sqltype `INTEGER`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `leased` (type `boolean`, sqltype `INTEGER`)\n - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`)\n - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`)\n - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`)\n - `total_msat` (type `msat`, sqltype `INTEGER`)\n - `final_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `min_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `max_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `last_commitment_txid` (type `hash`, sqltype `BLOB`)\n - `last_commitment_fee_msat` (type `msat`, sqltype `INTEGER`)\n - `close_cause` (type `string`, sqltype `TEXT`)\n - `last_stable_connection` (type `u64`, sqltype `INTEGER`)\n\n- `forwards` indexed by `in_channel and in_htlc_id` (see lightning-listforwards(7))\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `in_channel` (type `short_channel_id`, sqltype `TEXT`)\n - `in_htlc_id` (type `u64`, sqltype `INTEGER`)\n - `in_msat` (type `msat`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `received_time` (type `number`, sqltype `REAL`)\n - `out_channel` (type `short_channel_id`, sqltype `TEXT`)\n - `out_htlc_id` (type `u64`, sqltype `INTEGER`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `style` (type `string`, sqltype `TEXT`)\n - `fee_msat` (type `msat`, sqltype `INTEGER`)\n - `out_msat` (type `msat`, sqltype `INTEGER`)\n - `resolved_time` (type `number`, sqltype `REAL`)\n - `failcode` (type `u32`, sqltype `INTEGER`)\n - `failreason` (type `string`, sqltype `TEXT`)\n\n- `htlcs` indexed by `short_channel_id and id` (see lightning-listhtlcs(7))\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `expiry` (type `u32`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `direction` (type `string`, sqltype `TEXT`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `state` (type `string`, sqltype `TEXT`)\n\n- `invoices` indexed by `payment_hash` (see lightning-listinvoices(7))\n - `label` (type `string`, sqltype `TEXT`)\n - `description` (type `string`, sqltype `TEXT`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `status` (type `string`, sqltype `TEXT`)\n - `expires_at` (type `u64`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `bolt11` (type `string`, sqltype `TEXT`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `local_offer_id` (type `hash`, sqltype `BLOB`)\n - `invreq_payer_note` (type `string`, sqltype `TEXT`)\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `pay_index` (type `u64`, sqltype `INTEGER`)\n - `amount_received_msat` (type `msat`, sqltype `INTEGER`)\n - `paid_at` (type `u64`, sqltype `INTEGER`)\n - `paid_outpoint_txid` (type `txid`, sqltype `BLOB`, from JSON object `paid_outpoint`)\n - `paid_outpoint_outnum` (type `u32`, sqltype `INTEGER`, from JSON object `paid_outpoint`)\n - `payment_preimage` (type `secret`, sqltype `BLOB`)\n\n- `nodes` indexed by `nodeid` (see lightning-listnodes(7))\n - `nodeid` (type `pubkey`, sqltype `BLOB`)\n - `last_timestamp` (type `u32`, sqltype `INTEGER`)\n - `alias` (type `string`, sqltype `TEXT`)\n - `color` (type `hex`, sqltype `BLOB`)\n - `features` (type `hex`, sqltype `BLOB`)\n - related table `nodes_addresses`\n - `row` (reference to `nodes.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `type` (type `string`, sqltype `TEXT`)\n - `port` (type `u16`, sqltype `INTEGER`)\n - `address` (type `string`, sqltype `TEXT`)\n - `option_will_fund_lease_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_lease_fee_basis` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_funding_weight` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_channel_fee_max_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_channel_fee_max_proportional_thousandths` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_compact_lease` (type `hex`, sqltype `BLOB`, from JSON object `option_will_fund`)\n\n- `offers` indexed by `offer_id` (see lightning-listoffers(7))\n - `offer_id` (type `hash`, sqltype `BLOB`)\n - `active` (type `boolean`, sqltype `INTEGER`)\n - `single_use` (type `boolean`, sqltype `INTEGER`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `used` (type `boolean`, sqltype `INTEGER`)\n - `label` (type `string`, sqltype `TEXT`)\n\n- `peerchannels` indexed by `peer_id` (see lightning-listpeerchannels(7))\n - `peer_id` (type `pubkey`, sqltype `BLOB`)\n - `peer_connected` (type `boolean`, sqltype `INTEGER`)\n - `reestablished` (type `boolean`, sqltype `INTEGER`)\n - `state` (type `string`, sqltype `TEXT`)\n - `scratch_txid` (type `txid`, sqltype `BLOB`)\n - related table `peerchannels_channel_type_bits`, from JSON object `channel_type`\n - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `bits` (type `u32`, sqltype `INTEGER`)\n - related table `peerchannels_channel_type_names`, from JSON object `channel_type`\n - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `names` (type `string`, sqltype `TEXT`)\n - `local_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `local`)\n - `local_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `local`)\n - `remote_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `remote`)\n - `ignore_fee_limits` (type `boolean`, sqltype `INTEGER`)\n - `lost_state` (type `boolean`, sqltype `INTEGER`)\n - `feerate_perkw` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`)\n - `feerate_perkb` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`)\n - `owner` (type `string`, sqltype `TEXT`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `channel_id` (type `hash`, sqltype `BLOB`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `initial_feerate` (type `string`, sqltype `TEXT`)\n - `last_feerate` (type `string`, sqltype `TEXT`)\n - `next_feerate` (type `string`, sqltype `TEXT`)\n - `next_fee_step` (type `u32`, sqltype `INTEGER`)\n - related table `peerchannels_inflight`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `feerate` (type `string`, sqltype `TEXT`)\n - `total_funding_msat` (type `msat`, sqltype `INTEGER`)\n - `splice_amount` (type `integer`, sqltype `INTEGER`)\n - `our_funding_msat` (type `msat`, sqltype `INTEGER`)\n - `scratch_txid` (type `txid`, sqltype `BLOB`)\n - `close_to` (type `hex`, sqltype `BLOB`)\n - `private` (type `boolean`, sqltype `INTEGER`)\n - `opener` (type `string`, sqltype `TEXT`)\n - `closer` (type `string`, sqltype `TEXT`)\n - related table `peerchannels_features`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `features` (type `string`, sqltype `TEXT`)\n - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_local_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_remote_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `min_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `max_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `total_msat` (type `msat`, sqltype `INTEGER`)\n - `fee_base_msat` (type `msat`, sqltype `INTEGER`)\n - `fee_proportional_millionths` (type `u32`, sqltype `INTEGER`)\n - `dust_limit_msat` (type `msat`, sqltype `INTEGER`)\n - `max_total_htlc_in_msat` (type `msat`, sqltype `INTEGER`)\n - `their_reserve_msat` (type `msat`, sqltype `INTEGER`)\n - `our_reserve_msat` (type `msat`, sqltype `INTEGER`)\n - `spendable_msat` (type `msat`, sqltype `INTEGER`)\n - `receivable_msat` (type `msat`, sqltype `INTEGER`)\n - `minimum_htlc_in_msat` (type `msat`, sqltype `INTEGER`)\n - `minimum_htlc_out_msat` (type `msat`, sqltype `INTEGER`)\n - `maximum_htlc_out_msat` (type `msat`, sqltype `INTEGER`)\n - `their_to_self_delay` (type `u32`, sqltype `INTEGER`)\n - `our_to_self_delay` (type `u32`, sqltype `INTEGER`)\n - `max_accepted_htlcs` (type `u32`, sqltype `INTEGER`)\n - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - related table `peerchannels_state_changes`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `timestamp` (type `string`, sqltype `TEXT`)\n - `old_state` (type `string`, sqltype `TEXT`)\n - `new_state` (type `string`, sqltype `TEXT`)\n - `cause` (type `string`, sqltype `TEXT`)\n - `message` (type `string`, sqltype `TEXT`)\n - related table `peerchannels_status`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `in_payments_offered` (type `u64`, sqltype `INTEGER`)\n - `in_offered_msat` (type `msat`, sqltype `INTEGER`)\n - `in_payments_fulfilled` (type `u64`, sqltype `INTEGER`)\n - `in_fulfilled_msat` (type `msat`, sqltype `INTEGER`)\n - `out_payments_offered` (type `u64`, sqltype `INTEGER`)\n - `out_offered_msat` (type `msat`, sqltype `INTEGER`)\n - `out_payments_fulfilled` (type `u64`, sqltype `INTEGER`)\n - `out_fulfilled_msat` (type `msat`, sqltype `INTEGER`)\n - `last_stable_connection` (type `u64`, sqltype `INTEGER`)\n - related table `peerchannels_htlcs`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `direction` (type `string`, sqltype `TEXT`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `expiry` (type `u32`, sqltype `INTEGER`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `local_trimmed` (type `boolean`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `state` (type `string`, sqltype `TEXT`)\n - `close_to_addr` (type `string`, sqltype `TEXT`)\n - `last_tx_fee_msat` (type `msat`, sqltype `INTEGER`)\n - `direction` (type `u32`, sqltype `INTEGER`)\n\n- `peers` indexed by `id` (see lightning-listpeers(7))\n - `id` (type `pubkey`, sqltype `BLOB`)\n - `connected` (type `boolean`, sqltype `INTEGER`)\n - `num_channels` (type `u32`, sqltype `INTEGER`)\n - related table `peers_netaddr`\n - `row` (reference to `peers.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `netaddr` (type `string`, sqltype `TEXT`)\n - `remote_addr` (type `string`, sqltype `TEXT`)\n - `features` (type `hex`, sqltype `BLOB`)\n\n- `sendpays` indexed by `payment_hash` (see lightning-listsendpays(7))\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `groupid` (type `u64`, sqltype `INTEGER`)\n - `partid` (type `u64`, sqltype `INTEGER`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `destination` (type `pubkey`, sqltype `BLOB`)\n - `created_at` (type `u64`, sqltype `INTEGER`)\n - `amount_sent_msat` (type `msat`, sqltype `INTEGER`)\n - `label` (type `string`, sqltype `TEXT`)\n - `bolt11` (type `string`, sqltype `TEXT`)\n - `description` (type `string`, sqltype `TEXT`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `payment_preimage` (type `secret`, sqltype `BLOB`)\n - `erroronion` (type `hex`, sqltype `BLOB`)\n\n- `transactions` indexed by `hash` (see lightning-listtransactions(7))\n - `hash` (type `txid`, sqltype `BLOB`)\n - `rawtx` (type `hex`, sqltype `BLOB`)\n - `blockheight` (type `u32`, sqltype `INTEGER`)\n - `txindex` (type `u32`, sqltype `INTEGER`)\n - `locktime` (type `u32`, sqltype `INTEGER`)\n - `version` (type `u32`, sqltype `INTEGER`)\n - related table `transactions_inputs`\n - `row` (reference to `transactions.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`)\n - `sequence` (type `u32`, sqltype `INTEGER`)\n - related table `transactions_outputs`\n - `row` (reference to `transactions.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `scriptPubKey` (type `hex`, sqltype `BLOB`)" + "The following tables are currently supported:\n- `bkpr_accountevents` (see lightning-bkpr-listaccountevents(7))\n - `account` (type `string`, sqltype `TEXT`)\n - `type` (type `string`, sqltype `TEXT`)\n - `tag` (type `string`, sqltype `TEXT`)\n - `credit_msat` (type `msat`, sqltype `INTEGER`)\n - `debit_msat` (type `msat`, sqltype `INTEGER`)\n - `currency` (type `string`, sqltype `TEXT`)\n - `timestamp` (type `u32`, sqltype `INTEGER`)\n - `outpoint` (type `string`, sqltype `TEXT`)\n - `blockheight` (type `u32`, sqltype `INTEGER`)\n - `origin` (type `string`, sqltype `TEXT`)\n - `payment_id` (type `hex`, sqltype `BLOB`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `description` (type `string`, sqltype `TEXT`)\n - `fees_msat` (type `msat`, sqltype `INTEGER`)\n - `is_rebalance` (type `boolean`, sqltype `INTEGER`)\n - `part_id` (type `u32`, sqltype `INTEGER`)\n\n- `bkpr_income` (see lightning-bkpr-listincome(7))\n - `account` (type `string`, sqltype `TEXT`)\n - `tag` (type `string`, sqltype `TEXT`)\n - `credit_msat` (type `msat`, sqltype `INTEGER`)\n - `debit_msat` (type `msat`, sqltype `INTEGER`)\n - `currency` (type `string`, sqltype `TEXT`)\n - `timestamp` (type `u32`, sqltype `INTEGER`)\n - `description` (type `string`, sqltype `TEXT`)\n - `outpoint` (type `string`, sqltype `TEXT`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `payment_id` (type `hex`, sqltype `BLOB`)\n\n- `channels` indexed by `short_channel_id` (see lightning-listchannels(7))\n - `source` (type `pubkey`, sqltype `BLOB`)\n - `destination` (type `pubkey`, sqltype `BLOB`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `direction` (type `u32`, sqltype `INTEGER`)\n - `public` (type `boolean`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `message_flags` (type `u8`, sqltype `INTEGER`)\n - `channel_flags` (type `u8`, sqltype `INTEGER`)\n - `active` (type `boolean`, sqltype `INTEGER`)\n - `last_update` (type `u32`, sqltype `INTEGER`)\n - `base_fee_millisatoshi` (type `u32`, sqltype `INTEGER`)\n - `fee_per_millionth` (type `u32`, sqltype `INTEGER`)\n - `delay` (type `u32`, sqltype `INTEGER`)\n - `htlc_minimum_msat` (type `msat`, sqltype `INTEGER`)\n - `htlc_maximum_msat` (type `msat`, sqltype `INTEGER`)\n - `features` (type `hex`, sqltype `BLOB`)\n\n- `closedchannels` (see lightning-listclosedchannels(7))\n - `peer_id` (type `pubkey`, sqltype `BLOB`)\n - `channel_id` (type `hash`, sqltype `BLOB`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `opener` (type `string`, sqltype `TEXT`)\n - `closer` (type `string`, sqltype `TEXT`)\n - `private` (type `boolean`, sqltype `INTEGER`)\n - related table `closedchannels_channel_type_bits`, from JSON object `channel_type`\n - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `bits` (type `u32`, sqltype `INTEGER`)\n - related table `closedchannels_channel_type_names`, from JSON object `channel_type`\n - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `names` (type `string`, sqltype `TEXT`)\n - `total_local_commitments` (type `u64`, sqltype `INTEGER`)\n - `total_remote_commitments` (type `u64`, sqltype `INTEGER`)\n - `total_htlcs_sent` (type `u64`, sqltype `INTEGER`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `leased` (type `boolean`, sqltype `INTEGER`)\n - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`)\n - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`)\n - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`)\n - `total_msat` (type `msat`, sqltype `INTEGER`)\n - `final_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `min_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `max_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `last_commitment_txid` (type `hash`, sqltype `BLOB`)\n - `last_commitment_fee_msat` (type `msat`, sqltype `INTEGER`)\n - `close_cause` (type `string`, sqltype `TEXT`)\n - `last_stable_connection` (type `u64`, sqltype `INTEGER`)\n\n- `forwards` indexed by `in_channel and in_htlc_id` (see lightning-listforwards(7))\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `in_channel` (type `short_channel_id`, sqltype `TEXT`)\n - `in_htlc_id` (type `u64`, sqltype `INTEGER`)\n - `in_msat` (type `msat`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `received_time` (type `number`, sqltype `REAL`)\n - `out_channel` (type `short_channel_id`, sqltype `TEXT`)\n - `out_htlc_id` (type `u64`, sqltype `INTEGER`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `style` (type `string`, sqltype `TEXT`)\n - `fee_msat` (type `msat`, sqltype `INTEGER`)\n - `out_msat` (type `msat`, sqltype `INTEGER`)\n - `resolved_time` (type `number`, sqltype `REAL`)\n - `failcode` (type `u32`, sqltype `INTEGER`)\n - `failreason` (type `string`, sqltype `TEXT`)\n\n- `htlcs` indexed by `short_channel_id and id` (see lightning-listhtlcs(7))\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `expiry` (type `u32`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `direction` (type `string`, sqltype `TEXT`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `state` (type `string`, sqltype `TEXT`)\n\n- `invoices` indexed by `payment_hash` (see lightning-listinvoices(7))\n - `label` (type `string`, sqltype `TEXT`)\n - `description` (type `string`, sqltype `TEXT`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `status` (type `string`, sqltype `TEXT`)\n - `expires_at` (type `u64`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `bolt11` (type `string`, sqltype `TEXT`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `local_offer_id` (type `hash`, sqltype `BLOB`)\n - `invreq_payer_note` (type `string`, sqltype `TEXT`)\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `pay_index` (type `u64`, sqltype `INTEGER`)\n - `amount_received_msat` (type `msat`, sqltype `INTEGER`)\n - `paid_at` (type `u64`, sqltype `INTEGER`)\n - `paid_outpoint_txid` (type `txid`, sqltype `BLOB`, from JSON object `paid_outpoint`)\n - `paid_outpoint_outnum` (type `u32`, sqltype `INTEGER`, from JSON object `paid_outpoint`)\n - `payment_preimage` (type `secret`, sqltype `BLOB`)\n\n- `nodes` indexed by `nodeid` (see lightning-listnodes(7))\n - `nodeid` (type `pubkey`, sqltype `BLOB`)\n - `last_timestamp` (type `u32`, sqltype `INTEGER`)\n - `alias` (type `string`, sqltype `TEXT`)\n - `color` (type `hex`, sqltype `BLOB`)\n - `features` (type `hex`, sqltype `BLOB`)\n - related table `nodes_addresses`\n - `row` (reference to `nodes.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `type` (type `string`, sqltype `TEXT`)\n - `port` (type `u16`, sqltype `INTEGER`)\n - `address` (type `string`, sqltype `TEXT`)\n - `option_will_fund_lease_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_lease_fee_basis` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_funding_weight` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_channel_fee_max_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_channel_fee_max_proportional_thousandths` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_compact_lease` (type `hex`, sqltype `BLOB`, from JSON object `option_will_fund`)\n\n- `offers` indexed by `offer_id` (see lightning-listoffers(7))\n - `offer_id` (type `hash`, sqltype `BLOB`)\n - `active` (type `boolean`, sqltype `INTEGER`)\n - `single_use` (type `boolean`, sqltype `INTEGER`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `used` (type `boolean`, sqltype `INTEGER`)\n - `label` (type `string`, sqltype `TEXT`)\n\n- `peerchannels` indexed by `peer_id` (see lightning-listpeerchannels(7))\n - `peer_id` (type `pubkey`, sqltype `BLOB`)\n - `peer_connected` (type `boolean`, sqltype `INTEGER`)\n - `reestablished` (type `boolean`, sqltype `INTEGER`)\n - `state` (type `string`, sqltype `TEXT`)\n - `scratch_txid` (type `txid`, sqltype `BLOB`)\n - related table `peerchannels_channel_type_bits`, from JSON object `channel_type`\n - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `bits` (type `u32`, sqltype `INTEGER`)\n - related table `peerchannels_channel_type_names`, from JSON object `channel_type`\n - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `names` (type `string`, sqltype `TEXT`)\n - `local_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `local`)\n - `local_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `local`)\n - `remote_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `remote`)\n - `ignore_fee_limits` (type `boolean`, sqltype `INTEGER`)\n - `lost_state` (type `boolean`, sqltype `INTEGER`)\n - `feerate_perkw` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`)\n - `feerate_perkb` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`)\n - `owner` (type `string`, sqltype `TEXT`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `channel_id` (type `hash`, sqltype `BLOB`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `initial_feerate` (type `string`, sqltype `TEXT`)\n - `last_feerate` (type `string`, sqltype `TEXT`)\n - `next_feerate` (type `string`, sqltype `TEXT`)\n - `next_fee_step` (type `u32`, sqltype `INTEGER`)\n - related table `peerchannels_inflight`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `feerate` (type `string`, sqltype `TEXT`)\n - `total_funding_msat` (type `msat`, sqltype `INTEGER`)\n - `splice_amount` (type `integer`, sqltype `INTEGER`)\n - `our_funding_msat` (type `msat`, sqltype `INTEGER`)\n - `scratch_txid` (type `txid`, sqltype `BLOB`)\n - `close_to` (type `hex`, sqltype `BLOB`)\n - `private` (type `boolean`, sqltype `INTEGER`)\n - `opener` (type `string`, sqltype `TEXT`)\n - `closer` (type `string`, sqltype `TEXT`)\n - related table `peerchannels_features`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `features` (type `string`, sqltype `TEXT`)\n - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_local_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_remote_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `min_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `max_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `total_msat` (type `msat`, sqltype `INTEGER`)\n - `fee_base_msat` (type `msat`, sqltype `INTEGER`)\n - `fee_proportional_millionths` (type `u32`, sqltype `INTEGER`)\n - `dust_limit_msat` (type `msat`, sqltype `INTEGER`)\n - `max_total_htlc_in_msat` (type `msat`, sqltype `INTEGER`)\n - `their_reserve_msat` (type `msat`, sqltype `INTEGER`)\n - `our_reserve_msat` (type `msat`, sqltype `INTEGER`)\n - `spendable_msat` (type `msat`, sqltype `INTEGER`)\n - `receivable_msat` (type `msat`, sqltype `INTEGER`)\n - `minimum_htlc_in_msat` (type `msat`, sqltype `INTEGER`)\n - `minimum_htlc_out_msat` (type `msat`, sqltype `INTEGER`)\n - `maximum_htlc_out_msat` (type `msat`, sqltype `INTEGER`)\n - `their_to_self_delay` (type `u32`, sqltype `INTEGER`)\n - `our_to_self_delay` (type `u32`, sqltype `INTEGER`)\n - `max_accepted_htlcs` (type `u32`, sqltype `INTEGER`)\n - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - related table `peerchannels_state_changes`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `timestamp` (type `string`, sqltype `TEXT`)\n - `old_state` (type `string`, sqltype `TEXT`)\n - `new_state` (type `string`, sqltype `TEXT`)\n - `cause` (type `string`, sqltype `TEXT`)\n - `message` (type `string`, sqltype `TEXT`)\n - related table `peerchannels_status`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `in_payments_offered` (type `u64`, sqltype `INTEGER`)\n - `in_offered_msat` (type `msat`, sqltype `INTEGER`)\n - `in_payments_fulfilled` (type `u64`, sqltype `INTEGER`)\n - `in_fulfilled_msat` (type `msat`, sqltype `INTEGER`)\n - `out_payments_offered` (type `u64`, sqltype `INTEGER`)\n - `out_offered_msat` (type `msat`, sqltype `INTEGER`)\n - `out_payments_fulfilled` (type `u64`, sqltype `INTEGER`)\n - `out_fulfilled_msat` (type `msat`, sqltype `INTEGER`)\n - `last_stable_connection` (type `u64`, sqltype `INTEGER`)\n - related table `peerchannels_htlcs`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `direction` (type `string`, sqltype `TEXT`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `expiry` (type `u32`, sqltype `INTEGER`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `local_trimmed` (type `boolean`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `state` (type `string`, sqltype `TEXT`)\n - `close_to_addr` (type `string`, sqltype `TEXT`)\n - `last_tx_fee_msat` (type `msat`, sqltype `INTEGER`)\n - `direction` (type `u32`, sqltype `INTEGER`)\n\n- `peers` indexed by `id` (see lightning-listpeers(7))\n - `id` (type `pubkey`, sqltype `BLOB`)\n - `connected` (type `boolean`, sqltype `INTEGER`)\n - `num_channels` (type `u32`, sqltype `INTEGER`)\n - related table `peers_netaddr`\n - `row` (reference to `peers.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `netaddr` (type `string`, sqltype `TEXT`)\n - `remote_addr` (type `string`, sqltype `TEXT`)\n - `features` (type `hex`, sqltype `BLOB`)\n\n- `sendpays` indexed by `payment_hash` (see lightning-listsendpays(7))\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `groupid` (type `u64`, sqltype `INTEGER`)\n - `partid` (type `u64`, sqltype `INTEGER`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `destination` (type `pubkey`, sqltype `BLOB`)\n - `created_at` (type `u64`, sqltype `INTEGER`)\n - `amount_sent_msat` (type `msat`, sqltype `INTEGER`)\n - `label` (type `string`, sqltype `TEXT`)\n - `bolt11` (type `string`, sqltype `TEXT`)\n - `description` (type `string`, sqltype `TEXT`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `completed_at` (type `u64`, sqltype `INTEGER`)\n - `payment_preimage` (type `secret`, sqltype `BLOB`)\n - `erroronion` (type `hex`, sqltype `BLOB`)\n\n- `transactions` indexed by `hash` (see lightning-listtransactions(7))\n - `hash` (type `txid`, sqltype `BLOB`)\n - `rawtx` (type `hex`, sqltype `BLOB`)\n - `blockheight` (type `u32`, sqltype `INTEGER`)\n - `txindex` (type `u32`, sqltype `INTEGER`)\n - `locktime` (type `u32`, sqltype `INTEGER`)\n - `version` (type `u32`, sqltype `INTEGER`)\n - related table `transactions_inputs`\n - `row` (reference to `transactions.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`)\n - `sequence` (type `u32`, sqltype `INTEGER`)\n - related table `transactions_outputs`\n - `row` (reference to `transactions.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `scriptPubKey` (type `hex`, sqltype `BLOB`)" ], "errors": [ "On failure, an error is returned." diff --git a/tools/fromschema.py b/tools/fromschema.py index a7eb310199da..90c5c3505ae3 100755 --- a/tools/fromschema.py +++ b/tools/fromschema.py @@ -6,6 +6,18 @@ import json import re +# To maintain the sequence of the before return value (body) and after return value (footer) sections in the markdown file +BODY_KEY_SEQUENCE = ['reliability', 'usage', 'restriction_format', 'example_usage', 'example_json_request', 'notes', 'notifications', 'sharing_runes', 'riskfactor_effect_on_routing', 'recommended_riskfactor_values', 'optimality', 'randomization'] +FOOTER_KEY_SEQUENCE = ['example_json_response', 'errors', 'example_json_notifications', 'trivia', 'author', 'see_also', 'resources'] + + +def output_title(title, underline='-', num_leading_newlines=1, num_trailing_newlines=2): + """Add a title to the output""" + print('\n' * num_leading_newlines + title, end='\n') + print(underline * len(title) + '\n' * num_trailing_newlines, end='') + global current_line_width + current_line_width = 0 + def esc_underscores(s): """Backslash-escape underscores outside of backtick-enclosed spans""" @@ -25,9 +37,9 @@ def json_value(obj): assert False -def outputs(lines): +def outputs(lines, separator=''): """Add these lines to the final output""" - print(''.join(lines), end='') + print(esc_underscores(separator.join(lines)), end='') def output(line): @@ -35,30 +47,68 @@ def output(line): print(line, end='') +def search_key_in_conditional_array(request, param): + """search param in all conditional subarrays/objects and return the condition and found array/obj""" + one_of_many_array = request.get('oneOfMany', []) + paired_with_array = request.get('pairedWith', []) + + # Check if the same parameter is in both 'pairedWith' and 'oneOfMany' and throw an error if found + common_key = next((element_one for subarray_one in one_of_many_array for element_one in subarray_one for subarray_paired in paired_with_array if element_one in subarray_paired), '') + assert common_key == '', f'The same parameter "{common_key}" cannot be in both "pairedWith" and "oneOfMany"' + + # Search for the parameter in 'oneOfMany' array + for sub_array_one in one_of_many_array: + if param in sub_array_one: + return 'oneOfMany', sub_array_one + + # Search for the parameter in 'pairedWith' array + for sub_array_paired in paired_with_array: + if param in sub_array_paired: + return 'pairedWith', sub_array_paired + + # If param doesn't exist in any of the conditional arrays, return empty condition and None + return '', None + + +def output_conditional_params(conditional_sub_array, condition): + """Output request parameters with appropriate separator based on the separator""" + # If the request has 'oneOfMany', then print them in one param section with OR (|) sign. + # 'oneOfMany' example `plugin`: [*plugin|directory*] + # If the request has 'pairedWith', then print them in one param section separated with space. + # 'pairedWith' example `delpay`: [*partid* *groupid*] + # If the request has 'dependentUpon', then print them in one param section separated with space. + # 'dependentUpon' example `listforwards`: [*index* [*start*] [*limit*]] + separator = {'oneOfMany': '|', 'pairedWith': '* *', 'dependentUpon': '*] [*'}.get(condition, '') + # Join all keys with the separator + keysfoundstr = format(esc_underscores(separator.join(conditional_sub_array))) + # Print the merged keys + output('{}{}'.format(fmt_paramname(keysfoundstr, True, False), '' if condition == 'dependentUpon' else ' ')) + + def output_type(properties, is_optional): - typename = esc_underscores(properties['type']) + """Add types for request and reponse parameters""" + typename = 'one of' if 'oneOf' in properties else esc_underscores(properties['type']) if typename == 'array': - typename += ' of {}s'.format(esc_underscores(properties['items']['type'])) + if 'items' in properties and 'type' in properties['items']: + typename += ' of {}s'.format(esc_underscores(properties['items']['type'])) if is_optional: - typename += ", optional" - output(" ({})".format(typename)) + typename += ', optional' + output(' ({})'.format(esc_underscores(typename))) def output_range(properties): if 'maximum' and 'minimum' in properties: - output(" ({} to {} inclusive)".format(properties['minimum'], - properties['maximum'])) + output(' ({} to {} inclusive)'.format(properties['minimum'], properties['maximum'])) elif 'maximum' in properties: - output(" (max {})".format(properties['maximum'])) + output(' (max {})'.format(properties['maximum'])) elif 'minimum' in properties: - output(" (min {})".format(properties['minimum'])) + output(' (min {})'.format(properties['minimum'])) if 'maxLength' and 'minLength' in properties: if properties['minLength'] == properties['maxLength']: output(' (always {} characters)'.format(properties['minLength'])) else: - output(' ({} to {} characters)'.format(properties['minLength'], - properties['maxLength'])) + output(' ({} to {} characters)'.format(properties['minLength'], properties['maxLength'])) elif 'maxLength' in properties: output(' (up to {} characters)'.format(properties['maxLength'])) elif 'minLength' in properties: @@ -76,11 +126,34 @@ def fmt_propname(propname): return '**{}**'.format(esc_underscores(propname)) +def fmt_paramname(paramname, is_optional=True, trailing_space=True): + """Pretty-print format a parameter name""" + return '[*{}*]{}'.format(esc_underscores(paramname), ' ' if trailing_space else '') if is_optional else '*{}*{}'.format(esc_underscores(paramname), ' ' if trailing_space else '') + + +def deprecated_to_deleted(vername): + """We promise a 6 month minumum deprecation period, and versions are every 3 months""" + assert vername.startswith('v') + base = [int(s) for s in vername[1:].split('.')[0:2]] + if base == [0, 12]: + base = [22, 8] + base[1] += 9 + if base[1] > 12: + base[0] += 1 + base[1] -= 12 + # Christian points out versions should sort well lexographically, + # so we zero-pad single-digits. + return 'v{}.{:0>2}'.format(base[0], base[1]) + + def output_member(propname, properties, is_optional, indent, print_type=True, prefix=None): """Generate description line(s) for this member""" + # Skip hidden properties + if 'hidden' in properties and properties['hidden']: + return if prefix is None: - prefix = '- ' + fmt_propname(propname) + prefix = '- ' + fmt_propname(propname) if propname is not None else '-' output(indent + prefix) # We make them explicitly note if they don't want a type! @@ -89,19 +162,25 @@ def output_member(propname, properties, is_optional, indent, print_type=True, pr if not is_untyped and print_type: output_type(properties, is_optional) + output_range(properties) + if 'description' in properties: - output(": {}".format(esc_underscores(properties['description']))) + for i in range(0, len(properties['description'])): + output('{} {}{}'.format(':' if i == 0 else '', esc_underscores(properties['description'][i]), '' if i + 1 == len(properties['description']) else '\n')) - output_range(properties) + if 'default' in properties: + output(' The default is {}.'.format(esc_underscores(properties['default']) if isinstance(properties['default'], str) else properties['default'])) if 'deprecated' in properties: - assert isinstance(properties['deprecated'], list) - assert len(properties['deprecated']) == 2 - output(" **deprecated in {}, removed after {}**".format(properties['deprecated'][0], properties['deprecated'][1])) + output(' **deprecated in {}, removed after {}**'.format(properties['deprecated'][0], properties['deprecated'][1] if len(properties['deprecated']) > 1 else deprecated_to_deleted(properties['deprecated'][0]))) + if 'added' in properties: - output(" *(added {})*".format(properties['added'])) + output(' *(added {})*'.format(properties['added'])) - if not is_untyped and properties['type'] == 'object': + if 'oneOf' in properties and isinstance(properties['oneOf'], list): + output(':\n') + output_members(properties, indent + ' ') + elif not is_untyped and properties['type'] == 'object': output(':\n') output_members(properties, indent + ' ') elif not is_untyped and properties['type'] == 'array': @@ -113,15 +192,19 @@ def output_member(propname, properties, is_optional, indent, print_type=True, pr def output_array(items, indent): """We've already said it's an array of {type}""" - if items['type'] == 'object': + if 'oneOf' in items and isinstance(items['oneOf'], list): + output_members(items, indent + ' ') + elif items['type'] == 'object': output_members(items, indent) elif items['type'] == 'array': - output(indent + '- {}:\n'.format(esc_underscores(items['description']))) - output_array(items['items'], indent + ' ') + output(indent + '-') + output_type(items, False) + output(': {}\n'.format(esc_underscores('\n'.join(items['description']))) if 'description' in items and len(items['description']) > 0 else '\n') + if 'items' in items: + output_array(items['items'], indent + ' ') else: - output(indent + '- {}'.format(esc_underscores(items['description']))) - output_range(items) - output('\n') + if 'type' in items: + output_member(None, items, True, indent) def has_members(sub): @@ -138,46 +221,37 @@ def has_members(sub): def output_members(sub, indent=''): """Generate lines for these properties""" warnings = [] - - # Remove deprecated: True and stub properties, collect warnings - # (Stubs required to keep additionalProperties: false happy) - - # FIXME: It fails for schemas which have only an array type with - # no properties, ex: - # "abcd": { - # "type": "array", - # "items": { - # "type": "whatever", - # "description": "efgh" - # } - # } - # Checkout the schema of `staticbackup`. - for p in list(sub['properties'].keys()): - if len(sub['properties'][p]) == 0 or sub['properties'][p].get('deprecated') is True: - del sub['properties'][p] - elif p.startswith('warning'): - warnings.append(p) - - # First list always-present properties - for p in sub['properties']: - if p.startswith('warning'): - continue - if 'required' in sub and p in sub['required']: - output_member(p, sub['properties'][p], False, indent) - - for p in sub['properties']: - if p.startswith('warning'): - continue - if 'required' not in sub or p not in sub['required']: - output_member(p, sub['properties'][p], True, indent) + if 'properties' in sub: + for p in list(sub['properties'].keys()): + if len(sub['properties'][p]) == 0 or sub['properties'][p].get('deprecated') is True: + del sub['properties'][p] + elif p.startswith('warning'): + warnings.append(p) + + # First list always-present properties + for p in sub['properties']: + if p.startswith('warning'): + continue + if 'required' in sub and p in sub['required']: + output_member(p, sub['properties'][p], False, indent) + + for p in sub['properties']: + if p.startswith('warning'): + continue + if 'required' not in sub or p not in sub['required']: + output_member(p, sub['properties'][p], True, indent) if warnings != []: - output(indent + "- the following warnings are possible:\n") + output(indent + '- the following warnings are possible:\n') for w in warnings: output_member(w, sub['properties'][w], False, indent + ' ', print_type=False) - # Not handled. - assert 'oneOf' not in sub + if 'oneOf' in sub: + for oneOfItem in sub['oneOf']: + if 'type' in oneOfItem and oneOfItem['type'] == 'array': + output_array(oneOfItem, indent) + else: + output_member(None, oneOfItem, False, indent, False if 'enum' in oneOfItem else True) # If we have multiple ifs, we have to wrap them in allOf. if 'allOf' in sub: @@ -191,43 +265,110 @@ def output_members(sub, indent=''): for ifclause in ifclauses: conditions = [] - # "required" are fields that simply must be present + # 'required' are fields that simply must be present for r in ifclause['if'].get('required', []): conditions.append(fmt_propname(r) + ' is present') - # "properties" are enums of field values + # 'properties' are enums of field values for tag, vals in ifclause['if'].get('properties', {}).items(): # Don't have a description field here, it's not used. assert 'description' not in vals whichvalues = vals['enum'] - cond = fmt_propname(tag) + " is" + cond = fmt_propname(tag) + ' is' if len(whichvalues) == 1: - cond += " {}".format(json_value(whichvalues[0])) + cond += ' {}'.format(json_value(whichvalues[0])) else: - cond += " {} or {}".format(", ".join([json_value(v) for v in whichvalues[:-1]]), + cond += ' {} or {}'.format(', '.join([json_value(v) for v in whichvalues[:-1]]), json_value(whichvalues[-1])) conditions.append(cond) - sentence = indent + "If " + ", and ".join(conditions) + ":\n\n" + sentence = indent + 'If ' + ', and '.join(conditions) + ':\n' if has_members(ifclause['then']): # Prefix with blank line. outputs(['\n', sentence]) - output_members(ifclause['then'], indent + ' ') -def generate_from_schema(schema): +def generate_header(schema): + """Generate lines for rpc title and synopsis with request parameters""" + output_title(esc_underscores(''.join(['lightning-', schema['rpc'], ' -- ', schema['title']])), '=', 0, 1) + output_title('SYNOPSIS') + # Add command level warning if exists + if 'warning' in schema: + output('**(WARNING: {})**\n\n'.format(esc_underscores(schema['warning']))) + # generate the rpc command details with request parameters + request = schema['request'] + properties = request['properties'] + toplevels = list(request['properties'].keys()) + output('{} '.format(fmt_propname(schema['rpc']))) + i = 0 + while i < len(toplevels): + # Skip hidden properties + if 'hidden' in properties[toplevels[i]] and properties[toplevels[i]]['hidden']: + i += 1 + continue + # Search for the parameter in 'dependentUpon' array + dependent_upon_obj = request['dependentUpon'] if 'dependentUpon' in request else [] + if toplevels[i] in dependent_upon_obj: + # Output parameters with appropriate separator + output('{}*{}* '.format('' if 'required' in request and toplevels[i] in request['required'] else '[', esc_underscores(toplevels[i]))) + output_conditional_params(dependent_upon_obj[toplevels[i]], 'dependentUpon') + toplevels = [key for key in toplevels if key not in dependent_upon_obj[toplevels[i]]] + output('{}'.format('' if 'required' in request and toplevels[i] in request['required'] else ']')) + else: + # Search for the parameter in any conditional sub-arrays (oneOfMany, pairedWith) + condition, foundinsubarray = search_key_in_conditional_array(request, toplevels[i]) + # If param found in the conditional sub-array + if condition != '' and foundinsubarray is not None: + # Output parameters with appropriate separator + output_conditional_params(foundinsubarray, condition) + # Remove found keys from toplevels array + toplevels = [key for key in toplevels if key not in foundinsubarray] + # Reset the cursor to the previous index + i = i - 1 + else: + # Print the key as it is if it doesn't exist in conditional array + output('{}'.format(fmt_paramname(toplevels[i], False if 'required' in request and toplevels[i] in request['required'] else True))) + i += 1 + # lightning-plugin.json is an exception where all parameters cannot be printed deu to their dependency on different subcommands + # So, add ... at the end for lightning-plugin schema + if schema['rpc'] == 'plugin': + output('...') + output('\n') + + +def generate_description(schema): + """Generate rpc description with request parameter descriptions""" + request = schema['request'] + output_title('DESCRIPTION') + # Add deprecated and removal information for the command + if 'deprecated' in schema: + output('Command **deprecated in {}, removed after {}**.\n\n'.format(schema['deprecated'][0], schema['deprecated'][1] if len(schema['deprecated']) > 1 else deprecated_to_deleted(schema['deprecated'][0]))) + # Version when the command was added + if 'added' in schema: + output('Command *added* in {}.\n\n'.format(schema['added'])) + # Command's detailed description + outputs(schema['description'], '\n') + # Request parameter's detailed description + output('{}'.format('\n\n' if len(request['properties']) > 0 else '\n')) + output_members(request) + + +def generate_return_value(schema): """This is not general, but works for us""" - if schema['type'] != 'object': - # 'stop' returns a single string! - output_member(None, schema, False, '', prefix='On success, returns a single element') - return + output_title('RETURN VALUE') + + response = schema['response'] + + if 'pre_return_value_notes' in response: + outputs(response['pre_return_value_notes'], '\n') + output('\n') toplevels = [] warnings = [] - props = schema['properties'] + props = response['properties'] # We handle warnings on top-level objects with a separate section, # so collect them now and remove them @@ -240,66 +381,113 @@ def generate_from_schema(schema): # No properties -> empty object. if toplevels == []: - output('On success, an empty object is returned.\n') + # Use pre/post_return_value_notes with empty properties when dynamic generation of the return value section is not required. + # But to add a custom return value section instead. Example: `commando` commands. + if "pre_return_value_notes" not in response and "post_return_value_notes" not in response: + output('On success, an empty object is returned.\n') sub = schema elif len(toplevels) == 1 and props[toplevels[0]]['type'] == 'object': - output('On success, an object containing {} is returned. It is an object containing:\n\n'.format(fmt_propname(toplevels[0]))) + output('On success, an object containing {} is returned. It is an object containing:\n\n'.format(fmt_propname(toplevels[0]))) # Don't have a description field here, it's not used. assert 'description' not in toplevels[0] sub = props[toplevels[0]] elif len(toplevels) == 1 and props[toplevels[0]]['type'] == 'array' and props[toplevels[0]]['items']['type'] == 'object': - output('On success, an object containing {} is returned. It is an array of objects, where each object contains:\n\n'.format(fmt_propname(toplevels[0]))) + output('On success, an object containing {} is returned. It is an array of objects, where each object contains:\n\n'.format(fmt_propname(toplevels[0]))) # Don't have a description field here, it's not used. assert 'description' not in toplevels[0] sub = props[toplevels[0]]['items'] else: output('On success, an object is returned, containing:\n\n') - sub = schema + sub = response output_members(sub) if warnings: - outputs(['\n', 'The following warnings may also be returned:\n\n']) + output('\nThe following warnings may also be returned:\n\n') for w, desc in warnings: - output("- {}: {}\n".format(fmt_propname(w), desc)) + output('- {}: {}\n'.format(fmt_propname(w), ''.join(desc))) - # GH markdown rendering gets upset if there isn't a blank line - # between a list and the end comment. - output('\n') + if 'post_return_value_notes' in response: + if len(props.keys()) > 0: + output('\n') + outputs(response['post_return_value_notes'], '\n') + output('\n') -def main(schemafile, markdownfile): - start_marker = '[comment]: # (GENERATE-FROM-SCHEMA-START)\n' - end_marker = '[comment]: # (GENERATE-FROM-SCHEMA-END)\n' +def generate_body(schema): + """Output sections which should be printed after description and before return value""" + # Insert extra line between description and next section with this flag + first_matching_key = True + # Only add a newline if at least there is one body key found + body_key_found = False + for key in BODY_KEY_SEQUENCE: + if key not in schema: + continue + body_key_found = True + output_title(key.replace('_', ' ').upper(), '-', 1 if first_matching_key else 2) + first_matching_key = False + if key == 'example_json_request' and len(schema[key]) > 0: + output('```json\n') + for example in schema.get(key, []): + output(json.dumps(example, indent=2).strip() + '\n') + output('```') + else: + outputs(schema[key], '\n') + if body_key_found: + output('\n') - if markdownfile is None: - with open(schemafile, "r") as f: - schema = json.load(f) - generate_from_schema(schema) - return - with open(markdownfile, "r") as f: - md = f.readlines() +def generate_footer(schema): + """Output sections which should be printed after return value""" + first_matching_key = True + for key in FOOTER_KEY_SEQUENCE: + if key not in schema: + continue + output_title(key.replace('_', ' ').upper(), '-', 1 if first_matching_key else 2) + first_matching_key = False + if key == 'see_also': + # Wrap see_also list with comma separated values + output(esc_underscores(', '.join(schema[key]))) + elif key.startswith('example_json_') and len(schema[key]) > 0: + # For printing example_json_response and example_json_notifications into code block + for i, example in enumerate(schema.get(key, [])): + # For printing string elements from example json response; example: `createonion` + if isinstance(example, str): + output(example) + if i + 1 < len(schema[key]): + output('\n') + else: + if i == 0: + output('```json\n') + output(json.dumps(example, indent=2).strip() + '\n') + if i + 1 == len(schema[key]): + output('```') + else: + outputs(schema[key], '\n') + output('\n') - suppress_output = False - for line in md: - if line == end_marker: - suppress_output = False - if not suppress_output: - print(line, end='') +def main(schemafile, markdownfile): + with open(schemafile, 'r') as f: + schema = json.load(f) + # Outputs rpc title and synopsis with request parameters + generate_header(schema) + # Outputs command description with request parameter descriptions + generate_description(schema) + # Outputs other remaining sections before return value section + generate_body(schema) + # Outputs command response with response parameter descriptions + generate_return_value(schema) + # Outputs other remaining sections after return value section + generate_footer(schema) - if line == start_marker: - with open(schemafile, "r") as f: - schema = json.load(f) - generate_from_schema(schema) - suppress_output = True + if markdownfile is None: + return -if __name__ == "__main__": +if __name__ == '__main__': parser = ArgumentParser() parser.add_argument('schemafile', help='The schema file to use') parser.add_argument('--markdownfile', help='The markdown file to read') parsed_args = parser.parse_args() - main(parsed_args.schemafile, parsed_args.markdownfile) From a9b3157e7c2e6e62297579f8b24ea3cadb296108 Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Tue, 13 Feb 2024 19:06:49 -0800 Subject: [PATCH 12/16] doc: updated markdown files --- doc/lightning-addgossip.7.md | 47 +- doc/lightning-addpsbtoutput.7.md | 90 +- doc/lightning-autoclean-once.7.md | 89 +- doc/lightning-autoclean-status.7.md | 132 ++- doc/lightning-batching.7.md | 23 +- doc/lightning-bkpr-channelsapy.7.md | 132 ++- doc/lightning-bkpr-dumpincomecsv.7.md | 50 +- doc/lightning-bkpr-inspect.7.md | 86 +- doc/lightning-bkpr-listaccountevents.7.md | 291 +++++- doc/lightning-bkpr-listbalances.7.md | 61 +- doc/lightning-bkpr-listincome.7.md | 126 ++- doc/lightning-blacklistrune.7.md | 83 +- doc/lightning-check.7.md | 87 +- doc/lightning-checkmessage.7.md | 66 +- doc/lightning-checkrune.7.md | 85 +- doc/lightning-close.7.md | 120 ++- doc/lightning-commando-blacklist.7.md | 83 +- doc/lightning-commando-listrunes.7.md | 172 +++- doc/lightning-commando-rune.7.md | 352 ++++--- doc/lightning-commando.7.md | 132 ++- doc/lightning-connect.7.md | 122 ++- doc/lightning-createinvoice.7.md | 61 +- doc/lightning-createonion.7.md | 187 ++-- doc/lightning-createrune.7.md | 343 +++---- doc/lightning-datastore.7.md | 115 ++- doc/lightning-datastoreusage.7.md | 82 +- doc/lightning-decode.7.md | 541 ++++++----- doc/lightning-decodepay.7.md | 113 ++- doc/lightning-deldatastore.7.md | 75 +- doc/lightning-delexpiredinvoice.7.md | 30 +- doc/lightning-delforward.7.md | 51 +- doc/lightning-delinvoice.7.md | 118 ++- doc/lightning-delpay.7.md | 167 ++-- doc/lightning-deprecations.7.md | 34 +- doc/lightning-disableinvoicerequest.7.md | 34 +- doc/lightning-disableoffer.7.md | 49 +- doc/lightning-disconnect.7.md | 55 +- doc/lightning-emergencyrecover.7.md | 45 +- doc/lightning-feerates.7.md | 271 ++++-- doc/lightning-fetchinvoice.7.md | 102 ++- doc/lightning-fundchannel.7.md | 216 +++-- doc/lightning-fundchannel_cancel.7.md | 64 +- doc/lightning-fundchannel_complete.7.md | 54 +- doc/lightning-fundchannel_start.7.md | 116 ++- doc/lightning-funderupdate.7.md | 98 +- doc/lightning-fundpsbt.7.md | 169 +++- doc/lightning-getinfo.7.md | 171 ++-- doc/lightning-getlog.7.md | 85 +- doc/lightning-getroute.7.md | 153 +++- doc/lightning-help.7.md | 80 +- doc/lightning-invoice.7.md | 113 ++- doc/lightning-invoicerequest.7.md | 71 +- doc/lightning-keysend.7.md | 200 ++-- doc/lightning-listchannels.7.md | 144 ++- doc/lightning-listclosedchannels.7.md | 82 +- doc/lightning-listconfigs.7.md | 1017 ++++++++++++++------- doc/lightning-listdatastore.7.md | 70 +- doc/lightning-listforwards.7.md | 136 ++- doc/lightning-listfunds.7.md | 101 +- doc/lightning-listhtlcs.7.md | 169 +++- doc/lightning-listinvoicerequests.7.md | 59 +- doc/lightning-listinvoices.7.md | 108 ++- doc/lightning-listnodes.7.md | 142 +-- doc/lightning-listoffers.7.md | 59 +- doc/lightning-listpays.7.md | 105 ++- doc/lightning-listpeerchannels.7.md | 506 ++++++---- doc/lightning-listpeers.7.md | 515 ++++------- doc/lightning-listsendpays.7.md | 152 ++- doc/lightning-listsqlschemas.7.md | 246 +++-- doc/lightning-listtransactions.7.md | 121 ++- doc/lightning-makesecret.7.md | 45 +- doc/lightning-multifundchannel.7.md | 276 ++++-- doc/lightning-multiwithdraw.7.md | 102 ++- doc/lightning-newaddr.7.md | 51 +- doc/lightning-notifications.7.md | 87 +- doc/lightning-offer.7.md | 175 ++-- doc/lightning-openchannel_abort.7.md | 62 +- doc/lightning-openchannel_bump.7.md | 61 +- doc/lightning-openchannel_init.7.md | 154 +++- doc/lightning-openchannel_signed.7.md | 45 +- doc/lightning-openchannel_update.7.md | 128 ++- doc/lightning-parsefeerate.7.md | 75 +- doc/lightning-pay.7.md | 159 ++-- doc/lightning-ping.7.md | 55 +- doc/lightning-plugin.7.md | 185 +++- doc/lightning-preapproveinvoice.7.md | 27 +- doc/lightning-preapprovekeysend.7.md | 30 +- doc/lightning-recover.7.md | 48 +- doc/lightning-recoverchannel.7.md | 44 +- doc/lightning-renepay.7.md | 146 +-- doc/lightning-renepaystatus.7.md | 45 +- doc/lightning-reserveinputs.7.md | 177 +++- doc/lightning-sendcustommsg.7.md | 56 +- doc/lightning-sendinvoice.7.md | 86 +- doc/lightning-sendonion.7.md | 119 ++- doc/lightning-sendonionmessage.7.md | 22 +- doc/lightning-sendpay.7.md | 237 +++-- doc/lightning-sendpsbt.7.md | 47 +- doc/lightning-setchannel.7.md | 129 ++- doc/lightning-setconfig.7.md | 100 +- doc/lightning-setpsbtversion.7.md | 42 +- doc/lightning-showrunes.7.md | 123 ++- doc/lightning-signinvoice.7.md | 45 +- doc/lightning-signmessage.7.md | 56 +- doc/lightning-signpsbt.7.md | 60 +- doc/lightning-splice_init.7.md | 137 +-- doc/lightning-splice_signed.7.md | 75 +- doc/lightning-splice_update.7.md | 99 +- doc/lightning-sql.7.md | 519 ++--------- doc/lightning-staticbackup.7.md | 29 +- doc/lightning-stop.7.md | 24 +- doc/lightning-txdiscard.7.md | 41 +- doc/lightning-txprepare.7.md | 88 +- doc/lightning-txsend.7.md | 45 +- doc/lightning-unreserveinputs.7.md | 72 +- doc/lightning-upgradewallet.7.md | 69 +- doc/lightning-utxopsbt.7.md | 157 +++- doc/lightning-wait.7.md | 159 ++-- doc/lightning-waitanyinvoice.7.md | 119 ++- doc/lightning-waitblockheight.7.md | 57 +- doc/lightning-waitinvoice.7.md | 94 +- doc/lightning-waitsendpay.7.md | 139 +-- doc/lightning-withdraw.7.md | 80 +- 123 files changed, 10184 insertions(+), 5342 deletions(-) diff --git a/doc/lightning-addgossip.7.md b/doc/lightning-addgossip.7.md index 2edaf9db8475..45652a4b5680 100644 --- a/doc/lightning-addgossip.7.md +++ b/doc/lightning-addgossip.7.md @@ -1,31 +1,54 @@ lightning-addgossip -- Command for injecting a gossip message (low-level) -=============================================================== +========================================================================= SYNOPSIS -------- -**addgossip** *message* +**addgossip** *message* DESCRIPTION ----------- -The **addgossip** RPC command injects a hex-encoded gossip message into -the gossip daemon. It may return an error if it is malformed, or may -update its internal state using the gossip message. +The **addgossip** RPC command injects a hex-encoded gossip message into the gossip daemon. It may return an error if it is malformed, or may update its internal state using the gossip message. -Note that currently some paths will still silently reject the gossip: it -is best effort. +Note that currently some paths will still silently reject the gossip: it is best effort. -This is particularly used by plugins which may receive channel\_update -messages within error replies. +This is particularly used by plugins which may receive channel\_update messages within error replies. + +- **message** (hex): The raw, hex-encoded, gossip message to add to the local gossip view. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:addgossip#1", + "method": "addgossip", + "params": { + "message": "010078c3314666731e339c0b8434f7824797a084ed7ca3655991a672da068e2c44cb53b57b53a296c133bc879109a8931dc31e6913a4bda3d58559b99b95663e6d52775579447ef5526300e1bb89bc6af8557aa1c3810a91814eafad6d103f43182e17b16644cb38c1d58a8edd094303959a9f1f9d42ff6c32a21f9c118531f512c8679cabaccc6e39dbd95a4dac90e75a258893c3aa3f733d1b8890174d5ddea8003cadffe557773c54d2c07ca1d535c4bf85885f879ae466c16a516e8ffcfec1740e3f5c98ca9ce13f452e867befef5517f306ed6aa5119b79059bcc6f68f329986b665d16de7bc7df64e3537504c91eeabe0e59d3a2b68e4216ead2b0f6e3ef7c000006226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f0000670000010000022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d590266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c0351802e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5702324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b" + } +} +{ + "id": "example:addgossip#2", + "method": "addgossip", + "params": { + "message": "0102420526c8eb62ec6999bbee5f1de4841cab734374ec642b7deeb0259e76220bf82e97a241c907d5ff52019655f7f9a614c285bb35690f3a1a2b928d7b2349a79e06226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f000067000001000065b32a0e010100060000000000000000000000010000000a000000003b023380" + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an empty object is returned. -[comment]: # (GENERATE-FROM-SCHEMA-END) +EXAMPLE JSON RESPONSE +--------------------- + +```json +{} +{} +``` AUTHOR ------ @@ -41,5 +64,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:b0793c2fa864b0ce3bc6f1618135f28ac551dfd1b8a0127caac73fd948e62d9d) diff --git a/doc/lightning-addpsbtoutput.7.md b/doc/lightning-addpsbtoutput.7.md index 0720ca1e33cb..ee5c9bfd6c5e 100644 --- a/doc/lightning-addpsbtoutput.7.md +++ b/doc/lightning-addpsbtoutput.7.md @@ -1,46 +1,104 @@ lightning-addpsbtoutput -- Command to populate PSBT outputs from the wallet -================================================================ +=========================================================================== SYNOPSIS -------- -**addpsbtoutput** *satoshi* [*initialpsbt*] [*locktime*] [*destination*] +**addpsbtoutput** *satoshi* [*initialpsbt*] [*locktime*] [*destination*] DESCRIPTION ----------- -`addpsbtoutput` is a low-level RPC command which creates or modifies a PSBT -by adding a single output of amount *satoshi*. +Command *added* in v23.11. -This is used to receive funds into the on-chain wallet interactively -using PSBTs. +`addpsbtoutput` is a low-level RPC command which creates or modifies a PSBT by adding a single output of amount *satoshi*. + +This is used to receive funds into the on-chain wallet interactively using PSBTs. + +- **satoshi** (sat): The satoshi value of the output. It can be a whole number, a whole number ending in *sat*, or a number with 1 to 8 decimal places ending in *btc*. +- **initialpsbt** (string, optional): Base 64 encoded PSBT to add the output to. If not specified, one will be generated automatically. +- **locktime** (u32, optional): If not set, it is set to a recent block height (if no initial psbt is specified). +- **destination** (string, optional): If it is not set, an internal address is generated. EXAMPLE USAGE ------------- -Here is a command to make a PSBT with a 100,000 sat output that leads -to the on-chain wallet. +Here is a command to make a PSBT with a 100,000 sat output that leads to the on-chain wallet. ```shell lightning-cli addpsbtoutput 100000sat ``` +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:addpsbtoutput#1", + "method": "addpsbtoutput", + "params": { + "satoshi": 100000, + "initialpsbt": null, + "locktime": null, + "destination": null + } +} +{ + "id": "example:addpsbtoutput#2", + "method": "addpsbtoutput", + "params": { + "satoshi": 1000000, + "initialpsbt": null, + "locktime": 111, + "destination": null + } +} +{ + "id": "example:addpsbtoutput#3", + "method": "addpsbtoutput", + "params": { + "satoshi": 974343, + "initialpsbt": "cHNidP8BAF4CAAAAAfwbEpvpi6D14YV4VLnuVB47Y0uF41kXEyJRL4IusySSAQAAAAD9////ASICAAAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5nAAAAAAEA9gIAAAAAAQFEkxvLatohY6mw5gr5qG1aiArSrziFPR2YoqD21Hv+RAAAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNrz8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIEu1nfVRt9i+rFM219mwhMqdwJsqygWSWTFUS+cemdh6AiBG3Qo8g9J/aAMO2RHDsIBScscj6pTTIwZp7Gw8G3EOKAEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPZgAAAAEBK68/DwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==", + "locktime": null, + "destination": "bcrt1q9tc6q49l6wrrtp8ul45rj92hsleehwwxty32zu" + } +} +``` + RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **psbt** (string): Unsigned PSBT which fulfills the parameters given -- **estimated\_added\_weight** (u32): The estimated weight of the added output -- **outnum** (u32): The 0-based number where the output was placed - -[comment]: # (GENERATE-FROM-SCHEMA-END) +- **psbt** (string): Unsigned PSBT which fulfills the parameters given. +- **estimated\_added\_weight** (u32): The estimated weight of the added output. +- **outnum** (u32): The 0-based number where the output was placed. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIoIYBAAAAAAABBCJRIHg2NV/cioLcTLAKdyxVVBUdBjhKTdZejT9orAhWa4S+AA==", + "estimated_added_weight": 172, + "outnum": 0 +} +{ + "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIJd6ICNAQALFOMhoUHuSVSuzcaUdkDKlk4K+A+DR9+4uAA==", + "estimated_added_weight": 172, + "outnum": 0 +} +{ + "psbt": "cHNidP8BAH0CAAAAAfwbEpvpi6D14YV4VLnuVB47Y0uF41kXEyJRL4IusySSAQAAAAD9////AiICAAAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4H3g4AAAAAABYAFCrxoFS/04Y1hPz9aDkVV4fzm7nGZwAAAAABAPYCAAAAAAEBRJMby2raIWOpsOYK+ahtWogK0q84hT0dmKKg9tR7/kQAAAAAAP3///8CQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAza8/DwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oCRzBEAiBLtZ31UbfYvqxTNtfZsITKncCbKsoFklkxVEvnHpnYegIgRt0KPIPSf2gDDtkRw7CAUnLHI+qU0yMGaexsPBtxDigBIQPXRURck2JmXyLg2W6edm8nPzJg3qOcina/oF3SaE3cz2YAAAABASuvPw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAAAA", + "estimated_added_weight": 172, + "outnum": 1 +} +``` AUTHOR ------ -Dusty <<@dusty_daemon>> is mainly responsible. +Dusty <<@dusty\_daemon>> is mainly responsible. SEE ALSO -------- @@ -51,5 +109,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:6a31cc1575f9112d0582b5b9db560a5217d6e1a7bd33d399958e3aff7b022ac3) diff --git a/doc/lightning-autoclean-once.7.md b/doc/lightning-autoclean-once.7.md index 541ba024e01a..e363f9cd3a08 100644 --- a/doc/lightning-autoclean-once.7.md +++ b/doc/lightning-autoclean-once.7.md @@ -4,42 +4,89 @@ lightning-autoclean-once -- A single deletion of old invoices/payments/forwards SYNOPSIS -------- -**autoclean-once** *subsystem* *age* +**autoclean-once** *subsystem* *age* DESCRIPTION ----------- -The **autoclean-once** RPC command tell the `autoclean` plugin to do a -single sweep to delete old entries. This is a manual alternative (or -addition) to the various `autoclean-...-age` parameters which -cause autoclean to run once per hour: see lightningd-config(5). +The **autoclean-once** RPC command tell the `autoclean` plugin to do a single sweep to delete old entries. This is a manual alternative (or addition) to the various `autoclean-...-age` parameters which cause autoclean to run once per hour: see lightningd-config(5). + +- **subsystem** (string) (one of "succeededforwards", "failedforwards", "succeededpays", "failedpays", "paidinvoices", "expiredinvoices"): What subsystem to clean. Currently supported subsystems are: + * `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`). + * `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`). + * `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`). + * `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`). + * `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`). + * `paidinvoices`: invoices which were paid (`paid` in listinvoices status). +- **age** (u64): Non-zero number in seconds. How many seconds old an entry must be to delete it. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:autoclean-once#1", + "method": "autoclean-once", + "params": [ + "failedpays", + 1 + ] +} +{ + "id": "example:autoclean-once#2", + "method": "autoclean-once", + "params": [ + "succeededpays", + 1 + ] +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **autoclean** is returned. It is an object containing: +On success, an object containing **autoclean** is returned. It is an object containing: - **succeededforwards** (object, optional): - - **cleaned** (u64): total number of deletions done this run - - **uncleaned** (u64): the total number of entries *not* deleted this run + - **cleaned** (u64): Total number of deletions done this run. + - **uncleaned** (u64): The total number of entries *not* deleted this run. - **failedforwards** (object, optional): - - **cleaned** (u64): total number of deletions done this run - - **uncleaned** (u64): the total number of entries *not* deleted this run + - **cleaned** (u64): Total number of deletions done this run. + - **uncleaned** (u64): The total number of entries *not* deleted this run. - **succeededpays** (object, optional): - - **cleaned** (u64): total number of deletions done this run - - **uncleaned** (u64): the total number of entries *not* deleted this run + - **cleaned** (u64): Total number of deletions done this run. + - **uncleaned** (u64): The total number of entries *not* deleted this run. - **failedpays** (object, optional): - - **cleaned** (u64): total number of deletions done this run - - **uncleaned** (u64): the total number of entries *not* deleted this run + - **cleaned** (u64): Total number of deletions done this run. + - **uncleaned** (u64): The total number of entries *not* deleted this run. - **paidinvoices** (object, optional): - - **cleaned** (u64): total number of deletions done this run - - **uncleaned** (u64): the total number of entries *not* deleted this run + - **cleaned** (u64): Total number of deletions done this run. + - **uncleaned** (u64): The total number of entries *not* deleted this run. - **expiredinvoices** (object, optional): - - **cleaned** (u64): total number of deletions done this run - - **uncleaned** (u64): the total number of entries *not* deleted this run + - **cleaned** (u64): Total number of deletions done this run. + - **uncleaned** (u64): The total number of entries *not* deleted this run. -[comment]: # (GENERATE-FROM-SCHEMA-END) +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "autoclean": { + "failedpays": { + "cleaned": 1, + "uncleaned": 1 + } + } +} +{ + "autoclean": { + "succeededpays": { + "cleaned": 1, + "uncleaned": 0 + } + } +} +``` AUTHOR ------ @@ -55,5 +102,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:c6f69b86958274c082aeb4a6154173f65644315a0f5912820803afecfece8635) diff --git a/doc/lightning-autoclean-status.7.md b/doc/lightning-autoclean-status.7.md index 5302e835097d..eef6806af018 100644 --- a/doc/lightning-autoclean-status.7.md +++ b/doc/lightning-autoclean-status.7.md @@ -4,67 +4,126 @@ lightning-autoclean-status -- Examine auto-delete of old invoices/payments/forwa SYNOPSIS -------- -**autoclean-status** [*subsystem*] +**autoclean-status** [*subsystem*] DESCRIPTION ----------- -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 autclean plugin, optionally for only one subsystem. + +- **subsystem** (string, optional) (one of "succeededforwards", "failedforwards", "succeededpays", "failedpays", "paidinvoices", "expiredinvoices"): What subsystem to ask about. Currently supported subsystems are: + * `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`). + * `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`). + * `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`). + * `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`). + * `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`). + * `paidinvoices`: invoices which were paid (`paid` in listinvoices status). + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:autoclean-status#1", + "method": "autoclean-status", + "params": { + "subsystem": "expiredinvoices" + } +} +{ + "id": "example:autoclean-status#2", + "method": "autoclean-status", + "params": { + "subsystem": null + } +} +``` RETURN VALUE ------------ -Note that the ages parameters are set by various `autoclean-...-age` -parameters in your configuration: see lightningd-config(5). - -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **autoclean** is returned. It is an object containing: +Note that the ages parameters are set by various `autoclean-...-age` parameters in your configuration: see lightningd-config(5). +On success, an object containing **autoclean** is returned. It is an object containing: - **succeededforwards** (object, optional): - - **enabled** (boolean): whether autocleaning is enabled for successful listforwards - - **cleaned** (u64): total number of deletions done (ever) + - **enabled** (boolean): Whether autocleaning is enabled for successful listforwards. + - **cleaned** (u64): Total number of deletions done (ever). If **enabled** is *true*: - - - **age** (u64): age (in seconds) to delete successful listforwards + - **age** (u64): Age (in seconds) to delete successful listforwards. - **failedforwards** (object, optional): - - **enabled** (boolean): whether autocleaning is enabled for failed listforwards - - **cleaned** (u64): total number of deletions done (ever) + - **enabled** (boolean): Whether autocleaning is enabled for failed listforwards. + - **cleaned** (u64): Total number of deletions done (ever). If **enabled** is *true*: - - - **age** (u64): age (in seconds) to delete failed listforwards + - **age** (u64): Age (in seconds) to delete failed listforwards. - **succeededpays** (object, optional): - - **enabled** (boolean): whether autocleaning is enabled for successful listpays/listsendpays - - **cleaned** (u64): total number of deletions done (ever) + - **enabled** (boolean): Whether autocleaning is enabled for successful listpays/listsendpays. + - **cleaned** (u64): Total number of deletions done (ever). If **enabled** is *true*: - - - **age** (u64): age (in seconds) to delete successful listpays/listsendpays + - **age** (u64): Age (in seconds) to delete successful listpays/listsendpays. - **failedpays** (object, optional): - - **enabled** (boolean): whether autocleaning is enabled for failed listpays/listsendpays - - **cleaned** (u64): total number of deletions done (ever) + - **enabled** (boolean): Whether autocleaning is enabled for failed listpays/listsendpays. + - **cleaned** (u64): Total number of deletions done (ever). If **enabled** is *true*: - - - **age** (u64): age (in seconds) to delete failed listpays/listsendpays + - **age** (u64): Age (in seconds) to delete failed listpays/listsendpays. - **paidinvoices** (object, optional): - - **enabled** (boolean): whether autocleaning is enabled for paid listinvoices - - **cleaned** (u64): total number of deletions done (ever) + - **enabled** (boolean): Whether autocleaning is enabled for paid listinvoices. + - **cleaned** (u64): Total number of deletions done (ever). If **enabled** is *true*: - - - **age** (u64): age (in seconds) to paid listinvoices + - **age** (u64): Age (in seconds) to paid listinvoices. - **expiredinvoices** (object, optional): - - **enabled** (boolean): whether autocleaning is enabled for expired (unpaid) listinvoices - - **cleaned** (u64): total number of deletions done (ever) + - **enabled** (boolean): Whether autocleaning is enabled for expired (unpaid) listinvoices. + - **cleaned** (u64): Total number of deletions done (ever). If **enabled** is *true*: - - - **age** (u64): age (in seconds) to expired listinvoices - -[comment]: # (GENERATE-FROM-SCHEMA-END) + - **age** (u64): Age (in seconds) to expired listinvoices. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "autoclean": { + "expiredinvoices": { + "enabled": false, + "cleaned": 0 + } + } +} +{ + "autoclean": { + "succeededforwards": { + "enabled": false, + "cleaned": 0 + }, + "failedforwards": { + "enabled": false, + "cleaned": 0 + }, + "succeededpays": { + "enabled": false, + "cleaned": 0 + }, + "failedpays": { + "enabled": false, + "cleaned": 0 + }, + "paidinvoices": { + "enabled": false, + "cleaned": 0 + }, + "expiredinvoices": { + "enabled": true, + "age": 2, + "cleaned": 0 + } + } +} +``` AUTHOR ------ @@ -74,12 +133,9 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightningd-config(5), lightning-listinvoices(7), -lightning-listpays(7), lightning-listforwards(7). +lightningd-config(5), lightning-listinvoices(7), lightning-listpays(7), lightning-listforwards(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:8706bbc3b69f4160ad40fd116556ce699b6d70122b39c20effc27930fe7eec49) diff --git a/doc/lightning-batching.7.md b/doc/lightning-batching.7.md index 5640db3b278f..e4f39b126593 100644 --- a/doc/lightning-batching.7.md +++ b/doc/lightning-batching.7.md @@ -4,24 +4,21 @@ lightning-batching -- Command to allow database batching. SYNOPSIS -------- -**batching** *enable* +**batching** *enable* DESCRIPTION ----------- -The **batching** RPC command allows (but does not guarantee!) database -commitments to be deferred when multiple commands are issued on this RPC -connection. This is only useful if many commands are being given at once, in -which case it can offer a performance improvement (the cost being that if -there is a crash, it's unclear how many of the commands will have been -persisted). +The **batching** RPC command allows (but does not guarantee!) database commitments to be deferred when multiple commands are issued on this RPC connection. This is only useful if many commands are being given at once, in which case it can offer a performance improvement (the cost being that if there is a crash, it's unclear how many of the commands will have been persisted). + +- **enable** (boolean): Whether to enable or disable transaction batching. The default is False. EXAMPLE JSON REQUEST -------------------- ```json { - "id": 82, + "id": "example:batching#1", "method": "batching", "params": { "enable": true @@ -32,10 +29,14 @@ EXAMPLE JSON REQUEST RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an empty object is returned. -[comment]: # (GENERATE-FROM-SCHEMA-END) +EXAMPLE JSON RESPONSE +--------------------- + +```json +{} +``` ERRORS ------ @@ -53,5 +54,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:b0793c2fa864b0ce3bc6f1618135f28ac551dfd1b8a0127caac73fd948e62d9d) diff --git a/doc/lightning-bkpr-channelsapy.7.md b/doc/lightning-bkpr-channelsapy.7.md index 234879eeb1a3..b27e00a477ab 100644 --- a/doc/lightning-bkpr-channelsapy.7.md +++ b/doc/lightning-bkpr-channelsapy.7.md @@ -1,63 +1,121 @@ lightning-bkpr-channelsapy -- Command to list stats on channel earnings -================================================================== +======================================================================= SYNOPSIS -------- -**bkpr-channelsapy** \[*start\_time*\] \[*end\_time*\] +**bkpr-channelsapy** [*start\_time*] [*end\_time*] DESCRIPTION ----------- -The **bkpr-channelsapy** RPC command lists stats on routing income, leasing income, -and various calculated APYs for channel routed funds. +The **bkpr-channelsapy** RPC command lists stats on routing income, leasing income, and various calculated APYs for channel routed funds. + +- **start\_time** (u64, optional): UNIX timestamp (in seconds) to filter events after the provided timestamp. The default is zero. +- **end\_time** (u64, optional): UNIX timestamp (in seconds) to filter events up to and at the provided timestamp. The default is max-int. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:bkpr-channelsapy#1", + "method": "bkpr-channelsapy", + "params": "{}" +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **channels\_apy** is returned. It is an array of objects, where each object contains: - -- **account** (string): The account name. If the account is a channel, the channel\_id. The 'net' entry is the rollup of all channel accounts -- **routed\_out\_msat** (msat): Sats routed (outbound) -- **routed\_in\_msat** (msat): Sats routed (inbound) -- **lease\_fee\_paid\_msat** (msat): Sats paid for leasing inbound (liquidity ads) -- **lease\_fee\_earned\_msat** (msat): Sats earned for leasing outbound (liquidity ads) -- **pushed\_out\_msat** (msat): Sats pushed to peer at open -- **pushed\_in\_msat** (msat): Sats pushed in from peer at open -- **our\_start\_balance\_msat** (msat): Starting balance in channel at funding. Note that if our start balance is zero, any \_initial field will be omitted (can't divide by zero) -- **channel\_start\_balance\_msat** (msat): Total starting balance at funding -- **fees\_out\_msat** (msat): Fees earned on routed outbound -- **utilization\_out** (string): Sats routed outbound / total start balance -- **utilization\_in** (string): Sats routed inbound / total start balance -- **apy\_out** (string): Fees earned on outbound routed payments / total start balance for the length of time this channel has been open amortized to a year (APY) -- **apy\_in** (string): Fees earned on inbound routed payments / total start balance for the length of time this channel has been open amortized to a year (APY) -- **apy\_total** (string): Total fees earned on routed payments / total start balance for the length of time this channel has been open amortized to a year (APY) -- **fees\_in\_msat** (msat, optional): Fees earned on routed inbound -- **utilization\_out\_initial** (string, optional): Sats routed outbound / our start balance -- **utilization\_in\_initial** (string, optional): Sats routed inbound / our start balance -- **apy\_out\_initial** (string, optional): Fees earned on outbound routed payments / our start balance for the length of time this channel has been open amortized to a year (APY) -- **apy\_in\_initial** (string, optional): Fees earned on inbound routed payments / our start balance for the length of time this channel has been open amortized to a year (APY) -- **apy\_total\_initial** (string, optional): Total fees earned on routed payments / our start balance for the length of time this channel has been open amortized to a year (APY) -- **apy\_lease** (string, optional): Lease fees earned over total amount leased for the lease term, amortized to a year (APY). Only appears if channel was leased out by us - -[comment]: # (GENERATE-FROM-SCHEMA-END) +On success, an object containing **channels\_apy** is returned. It is an array of objects, where each object contains: + +- **account** (string): The account name. If the account is a channel, the channel\_id. The 'net' entry is the rollup of all channel accounts. +- **routed\_out\_msat** (msat): Sats routed (outbound). +- **routed\_in\_msat** (msat): Sats routed (inbound). +- **lease\_fee\_paid\_msat** (msat): Sats paid for leasing inbound (liquidity ads). +- **lease\_fee\_earned\_msat** (msat): Sats earned for leasing outbound (liquidity ads). +- **pushed\_out\_msat** (msat): Sats pushed to peer at open. +- **pushed\_in\_msat** (msat): Sats pushed in from peer at open. +- **our\_start\_balance\_msat** (msat): Starting balance in channel at funding. Note that if our start balance is zero, any \_initial field will be omitted (can't divide by zero). +- **channel\_start\_balance\_msat** (msat): Total starting balance at funding. +- **fees\_out\_msat** (msat): Fees earned on routed outbound. +- **utilization\_out** (string): Sats routed outbound / total start balance. +- **utilization\_in** (string): Sats routed inbound / total start balance. +- **apy\_out** (string): Fees earned on outbound routed payments / total start balance for the length of time this channel has been open amortized to a year (APY). +- **apy\_in** (string): Fees earned on inbound routed payments / total start balance for the length of time this channel has been open amortized to a year (APY). +- **apy\_total** (string): Total fees earned on routed payments / total start balance for the length of time this channel has been open amortized to a year (APY). +- **fees\_in\_msat** (msat, optional): Fees earned on routed inbound. +- **utilization\_out\_initial** (string, optional): Sats routed outbound / our start balance. +- **utilization\_in\_initial** (string, optional): Sats routed inbound / our start balance. +- **apy\_out\_initial** (string, optional): Fees earned on outbound routed payments / our start balance for the length of time this channel has been open amortized to a year (APY). +- **apy\_in\_initial** (string, optional): Fees earned on inbound routed payments / our start balance for the length of time this channel has been open amortized to a year (APY). +- **apy\_total\_initial** (string, optional): Total fees earned on routed payments / our start balance for the length of time this channel has been open amortized to a year (APY). +- **apy\_lease** (string, optional): Lease fees earned over total amount leased for the lease term, amortized to a year (APY). Only appears if channel was leased out by us. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "channels_apy": [ + { + "account": "e41b2ec83e9139a9fd8f1d89b01e5d7df73099494e6b91504c39445e37485b0d", + "routed_out_msat": 1431440, + "routed_in_msat": 0, + "lease_fee_paid_msat": 0, + "lease_fee_earned_msat": 0, + "pushed_out_msat": 0, + "pushed_in_msat": 0, + "our_start_balance_msat": 1000000000, + "channel_start_balance_msat": 1000000000, + "fees_out_msat": 0, + "fees_in_msat": 0, + "utilization_out": "0.1431%", + "utilization_out_initial": "0.1431%", + "utilization_in": "0.0000%", + "apy_out": "0.0000%", + "apy_out_initial": "0.0000%", + "apy_in": "0.0000%", + "apy_total": "0.0000%", + "apy_total_initial": "0.0000%" + }, + { + "account": "net", + "routed_out_msat": 1431440, + "routed_in_msat": 0, + "lease_fee_paid_msat": 0, + "lease_fee_earned_msat": 0, + "pushed_out_msat": 0, + "pushed_in_msat": 0, + "our_start_balance_msat": 1000000000, + "channel_start_balance_msat": 1000000000, + "fees_out_msat": 0, + "fees_in_msat": 0, + "utilization_out": "0.1431%", + "utilization_out_initial": "0.1431%", + "utilization_in": "0.0000%", + "apy_out": "0.0000%", + "apy_out_initial": "0.0000%", + "apy_in": "0.0000%", + "apy_total": "0.0000%", + "apy_total_initial": "0.0000%" + } + ] +} +``` AUTHOR ------ -niftynei is mainly responsible. +Lisa Neigut <> is mainly responsible. SEE ALSO -------- -lightning-bkpr-listincome(7), lightning-bkpr-listfunds(7), -lightning-bkpr-listaccountevents(7), -lightning-bkpr-dumpincomecsv(7), lightning-listpeers(7). +lightning-bkpr-listincome(7), lightning-bkpr-listfunds(7), lightning-bkpr-listaccountevents(7), lightning-bkpr-dumpincomecsv(7), lightning-listpeers(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:9f598b60159787757d0b2491445af59f7e1ffad9d98da989b06e93c0df715018) diff --git a/doc/lightning-bkpr-dumpincomecsv.7.md b/doc/lightning-bkpr-dumpincomecsv.7.md index e6e416bde1cf..ca3237641115 100644 --- a/doc/lightning-bkpr-dumpincomecsv.7.md +++ b/doc/lightning-bkpr-dumpincomecsv.7.md @@ -1,43 +1,65 @@ lightning-bkpr-dumpincomecsv -- Command to emit a CSV of income events -================================================================= +====================================================================== SYNOPSIS -------- -**bkpr-dumpincomecsv** *csv\_format* \[*csv\_file*\] \[*consolidate\_fees*\] \[*start\_time*\] \[*end\_time*\] +**bkpr-dumpincomecsv** *csv\_format* [*csv\_file*] [*consolidate\_fees*] [*start\_time*] [*end\_time*] DESCRIPTION ----------- -The **bkpr-dumpincomcsv** RPC command writes a CSV file to disk at *csv\_file* -location. This is a formatted output of the **listincome** RPC command. +The **bkpr-dumpincomcsv** RPC command writes a CSV file to disk at *csv\_file* location. This is a formatted output of the **listincome** RPC command. + +- **csv\_format** (string): CSV format to use. See RETURN VALUE for options. +- **csv\_file** (string, optional): On-disk destination of the generated CSV file. +- **consolidate\_fees** (boolean, optional): If true, we emit a single, consolidated event for any onchain-fees for a txid and account. Otherwise, events for every update to the onchain fee calculation for this account and txid will be printed. Note that this means that the events emitted are non-stable, i.e. calling **dumpincomecsv** twice may result in different onchain fee events being emitted, depending on how much information we've logged for that transaction. The default is True. +- **start\_time** (u64, optional): UNIX timestamp (in seconds) that filters events after the provided timestamp. The default is zero. +- **end\_time** (u64, optional): UNIX timestamp (in seconds) that filters events up to and at the provided timestamp. The default is max-int. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:bkpr-dumpincomecsv#1", + "method": "bkpr-dumpincomecsv", + "params": [ + "koinly", + "koinly.csv" + ] +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **csv\_file** (string): File that the csv was generated to -- **csv\_format** (string): Format to print csv as (one of "cointracker", "koinly", "harmony", "quickbooks") +- **csv\_file** (string): File that the csv was generated to. +- **csv\_format** (string) (one of "cointracker", "koinly", "harmony", "quickbooks"): Format to print csv as. -[comment]: # (GENERATE-FROM-SCHEMA-END) +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "csv_file": "koinly.csv", + "csv_format": "koinly" +} +``` AUTHOR ------ -niftynei is mainly responsible. +Lisa Neigut <> is mainly responsible. SEE ALSO -------- -lightning-bkpr-listincome(7), lightning-bkpr-listfunds(7), -lightning-bkpr-listaccountevents(7), -lightning-bkpr-channelsapy(7), lightning-listpeers(7). +lightning-bkpr-listincome(7), lightning-bkpr-listfunds(7), lightning-bkpr-listaccountevents(7), lightning-bkpr-channelsapy(7), lightning-listpeers(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:e7ac14cae72e6a26d886b57e5a72139615638b4129e38337fceb216a7917133f) diff --git a/doc/lightning-bkpr-inspect.7.md b/doc/lightning-bkpr-inspect.7.md index 4c29f838d8d8..8d12829c0b56 100644 --- a/doc/lightning-bkpr-inspect.7.md +++ b/doc/lightning-bkpr-inspect.7.md @@ -1,55 +1,87 @@ lightning-bkpr-inspect -- Command to show onchain footprint of a channel -=================================================================== +======================================================================== SYNOPSIS -------- -**bkpr-inspect** *account* +**bkpr-inspect** *account* DESCRIPTION ----------- -The **bkpr-inspect** RPC command lists all known on-chain transactions and -associated events for the provided account. Useful for inspecting unilateral -closes for a given channel account. Only valid for channel accounts. +The **bkpr-inspect** RPC command lists all known on-chain transactions and associated events for the provided account. Useful for inspecting unilateral closes for a given channel account. Only valid for channel accounts. + +- **account** (string): Channel account to inspect. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:bkpr-inspect#1", + "method": "bkpr-inspect", + "params": [ + "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab" + ] +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **txs** is returned. It is an array of objects, where each object contains: +On success, an object containing **txs** is returned. It is an array of objects, where each object contains: -- **txid** (txid): transaction id -- **fees\_paid\_msat** (msat): Amount paid in sats for this tx +- **txid** (txid): Transaction id. +- **fees\_paid\_msat** (msat): Amount paid in sats for this tx. - **outputs** (array of objects): - - **account** (string): Account this output affected - - **outnum** (u32): Index of output - - **output\_value\_msat** (msat): Value of the output - - **currency** (string): human-readable bech32 part for this coin type - - **credit\_msat** (msat, optional): Amount credited to account - - **debit\_msat** (msat, optional): Amount debited from account - - **originating\_account** (string, optional): Account this output originated from - - **output\_tag** (string, optional): Description of output creation event - - **spend\_tag** (string, optional): Description of output spend event - - **spending\_txid** (txid, optional): Transaction this output was spent in - - **payment\_id** (hex, optional): lightning payment identifier. For an htlc, this will be the preimage. -- **blockheight** (u32, optional): Blockheight of transaction - -[comment]: # (GENERATE-FROM-SCHEMA-END) + - **account** (string): Account this output affected. + - **outnum** (u32): Index of output. + - **output\_value\_msat** (msat): Value of the output. + - **currency** (string): Human-readable bech32 part for this coin type. + - **credit\_msat** (msat, optional): Amount credited to account. + - **debit\_msat** (msat, optional): Amount debited from account. + - **originating\_account** (string, optional): Account this output originated from. + - **output\_tag** (string, optional): Description of output creation event. + - **spend\_tag** (string, optional): Description of output spend event. + - **spending\_txid** (txid, optional): Transaction this output was spent in. + - **payment\_id** (hex, optional): Lightning payment identifier. For an htlc, this will be the preimage. +- **blockheight** (u32, optional): Blockheight of transaction. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "txs": [ + { + "txid": "abb283035e569c190696d42a1208bb38ddc64b6377e88f2d6277c01eab7b0af3", + "fees_paid_msat": 0, + "outputs": [ + { + "account": "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab", + "outnum": 0, + "output_tag": "channel_proposed", + "output_value_msat": 996363000, + "credit_msat": 996363000, + "currency": "bcrt" + } + ] + } + ] +} +``` AUTHOR ------ -niftynei is mainly responsible. +Lisa Neigut <> is mainly responsible. SEE ALSO -------- -lightning-listbalances(7), lightning-listfunds(7), lightning-listpeers(7). +lightning-listbalances(7), lightning-listfunds(7), lightning-listpeers(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:37b3d4030d1301acd105fb750c8a131cc24b00127007fac4e5b83ef19e5e7ade) diff --git a/doc/lightning-bkpr-listaccountevents.7.md b/doc/lightning-bkpr-listaccountevents.7.md index 73daeaf47189..6b2218c4dc05 100644 --- a/doc/lightning-bkpr-listaccountevents.7.md +++ b/doc/lightning-bkpr-listaccountevents.7.md @@ -1,73 +1,294 @@ lightning-bkpr-listaccountevents -- Command for listing recorded bookkeeping events -============================================================================= +=================================================================================== SYNOPSIS -------- -**bkpr-listaccountevents** [\*account\*] +**bkpr-listaccountevents** [*account*] DESCRIPTION ----------- The **bkpr-listaccountevents** RPC command is a list of all bookkeeping events that have been recorded for this node. -If the optional parameter **account** is set, we only emit events for the -specified account, if exists. +If the optional parameter **account** is set, we only emit events for the specified account, if exists. -Note that the type **onchain\_fees** that are emitted are of opposite credit/debit than as they appear in **listincome**, as **listincome** shows all events from the perspective of the node, whereas **listaccountevents** just dumps the event data as we've got it. Onchain fees are updated/recorded as we get more information about input and output spends -- the total onchain fees that were recorded for a transaction for an account can be found by summing all onchain fee events and taking the difference between the **credit\_msat** and **debit\_msat** for these events. We do this so that successive calls to **listaccountevents** always -produce the same list of events -- no previously emitted event will be -subsequently updated, rather we add a new event to the list. +Note that the type **onchain\_fees** that are emitted are of opposite credit/debit than as they appear in **listincome**, as **listincome** shows all events from the perspective of the node, whereas **listaccountevents** just dumps the event data as we've got it. Onchain fees are updated/recorded as we get more information about input and output spends -- the total onchain fees that were recorded for a transaction for an account can be found by summing all onchain fee events and taking the difference between the **credit\_msat** and **debit\_msat** for these events. We do this so that successive calls to **listaccountevents** always produce the same list of events -- no previously emitted event will be subsequently updated, rather we add a new event to the list. + +- **account** (string, optional): Receive events for the specified account. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:bkpr-listaccountevents#1", + "method": "bkpr-listaccountevents", + "params": "{}" +} +{ + "id": "example:bkpr-listaccountevents#2", + "method": "bkpr-listaccountevents", + "params": [ + "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab" + ] +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **events** is returned. It is an array of objects, where each object contains: +On success, an object containing **events** is returned. It is an array of objects, where each object contains: -- **account** (string): The account name. If the account is a channel, the channel\_id -- **type** (string): Coin movement type (one of "onchain\_fee", "chain", "channel") -- **tag** (string): Description of movement -- **credit\_msat** (msat): Amount credited -- **debit\_msat** (msat): Amount debited -- **currency** (string): human-readable bech32 part for this coin type -- **timestamp** (u32): Timestamp this event was recorded by the node. For consolidated events such as onchain\_fees, the most recent timestamp +- **account** (string): The account name. If the account is a channel, the channel\_id. +- **type** (string) (one of "onchain\_fee", "chain", "channel"): Coin movement type. +- **tag** (string): Description of movement. +- **credit\_msat** (msat): Amount credited. +- **debit\_msat** (msat): Amount debited. +- **currency** (string): Human-readable bech32 part for this coin type. +- **timestamp** (u32): Timestamp this event was recorded by the node. For consolidated events such as onchain\_fees, the most recent timestamp. If **type** is "chain": - - - **outpoint** (string): The txid:outnum for this event - - **blockheight** (u32): For chain events, blockheight this occured at - - **origin** (string, optional): The account this movement originated from - - **payment\_id** (hex, optional): lightning payment identifier. For an htlc, this will be the preimage. - - **txid** (txid, optional): The txid of the transaction that created this event - - **description** (string, optional): The description of this event + - **outpoint** (string): The txid:outnum for this event. + - **blockheight** (u32): For chain events, blockheight this occured at. + - **origin** (string, optional): The account this movement originated from. + - **payment\_id** (hex, optional): Lightning payment identifier. For an htlc, this will be the preimage. + - **txid** (txid, optional): The txid of the transaction that created this event. + - **description** (string, optional): The description of this event. If **type** is "onchain\_fee": - - - **txid** (txid): The txid of the transaction that created this event + - **txid** (txid): The txid of the transaction that created this event. If **type** is "channel": + - **fees\_msat** (msat, optional): Amount paid in fees. + - **is\_rebalance** (boolean, optional): Is this payment part of a rebalance. + - **payment\_id** (hex, optional): Lightning payment identifier. For an htlc, this will be the preimage. + - **part\_id** (u32, optional): Counter for multi-part payments. - - **fees\_msat** (msat, optional): Amount paid in fees - - **is\_rebalance** (boolean, optional): Is this payment part of a rebalance - - **payment\_id** (hex, optional): lightning payment identifier. For an htlc, this will be the preimage. - - **part\_id** (u32, optional): Counter for multi-part payments +EXAMPLE JSON RESPONSE +--------------------- -[comment]: # (GENERATE-FROM-SCHEMA-END) +```json +{ + "events": [ + { + "account": "wallet", + "type": "channel", + "tag": "journal_entry", + "credit_msat": 0, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706152911, + "is_rebalance": false + }, + { + "account": "wallet", + "type": "chain", + "tag": "deposit", + "credit_msat": 2000000000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "7e202b3b1016e8eb6f4e936215ed6b5bdc63c17e6ebb5e6bce2f98e6757ba44c:0", + "timestamp": 1706152914, + "blockheight": 102 + }, + { + "account": "wallet", + "type": "chain", + "tag": "withdrawal", + "credit_msat": 0, + "debit_msat": 2000000000, + "currency": "bcrt", + "outpoint": "7e202b3b1016e8eb6f4e936215ed6b5bdc63c17e6ebb5e6bce2f98e6757ba44c:0", + "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b", + "timestamp": 1706152921, + "blockheight": 103 + }, + { + "account": "wallet", + "type": "chain", + "tag": "deposit", + "credit_msat": 995073000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b:1", + "timestamp": 1706152921, + "blockheight": 103 + }, + { + "account": "wallet", + "type": "onchain_fee", + "tag": "onchain_fee", + "credit_msat": 1004927000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706152921, + "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b" + }, + { + "account": "wallet", + "type": "onchain_fee", + "tag": "onchain_fee", + "credit_msat": 0, + "debit_msat": 1004927000, + "currency": "bcrt", + "timestamp": 1706152921, + "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b" + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "chain", + "tag": "channel_open", + "credit_msat": 1000000000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b:0", + "timestamp": 1706152922, + "blockheight": 103 + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "onchain_fee", + "tag": "onchain_fee", + "credit_msat": 4927000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706152922, + "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b" + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "channel", + "tag": "invoice", + "credit_msat": 0, + "debit_msat": 11000000, + "currency": "bcrt", + "payment_id": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "part_id": 0, + "timestamp": 1706152934, + "description": [ + "XEoCR94SIz6UIRUEkxum." + ], + "is_rebalance": false + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "chain", + "tag": "channel_close", + "credit_msat": 0, + "debit_msat": 989000000, + "currency": "bcrt", + "outpoint": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b:0", + "txid": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998", + "timestamp": 1706152938, + "blockheight": 104 + }, + { + "account": "external", + "origin": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "chain", + "tag": "to_them", + "credit_msat": 10899000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998:0", + "timestamp": 1706152938, + "blockheight": 104 + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "onchain_fee", + "tag": "onchain_fee", + "credit_msat": 7967000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706152938, + "txid": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998" + }, + { + "account": "wallet", + "type": "chain", + "tag": "deposit", + "credit_msat": 980912000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "85477738281c1afd652c350025f1d28658fe541c83adc9a7d5276c30cf715a11:0", + "timestamp": 1706152941, + "blockheight": 109 + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "chain", + "tag": "delayed_to_us", + "credit_msat": 981033000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998:1", + "timestamp": 1706152941, + "blockheight": 104 + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "chain", + "tag": "to_wallet", + "credit_msat": 0, + "debit_msat": 981033000, + "currency": "bcrt", + "outpoint": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998:1", + "txid": "85477738281c1afd652c350025f1d28658fe541c83adc9a7d5276c30cf715a11", + "timestamp": 1706152941, + "blockheight": 109 + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "onchain_fee", + "tag": "onchain_fee", + "credit_msat": 121000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706152941, + "txid": "85477738281c1afd652c350025f1d28658fe541c83adc9a7d5276c30cf715a11" + } + ] +} +{ + "events": [ + { + "account": "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab", + "type": "chain", + "tag": "channel_proposed", + "credit_msat": 996363000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "abb283035e569c190696d42a1208bb38ddc64b6377e88f2d6277c01eab7b0af3:0", + "timestamp": 1706246949, + "blockheight": 0 + }, + { + "account": "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab", + "type": "channel", + "tag": "pushed", + "credit_msat": 0, + "debit_msat": 20000000, + "currency": "bcrt", + "timestamp": 1706246949, + "is_rebalance": false + } + ] +} +``` AUTHOR ------ -niftynei is mainly responsible. +Lisa Neigut <> is mainly responsible. SEE ALSO -------- -lightning-bkpr-listincome(7), lightning-listfunds(7), -lightning-bkpr-listbalances(7), lightning-bkpr-channelsapy(7). +lightning-bkpr-listincome(7), lightning-listfunds(7), lightning-bkpr-listbalances(7), lightning-bkpr-channelsapy(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:8d0f6d6d1739fecaeba7ad1f1ae5e36212239dea27d3465a7342ae01dec7ad9c) diff --git a/doc/lightning-bkpr-listbalances.7.md b/doc/lightning-bkpr-listbalances.7.md index d8931e6c22ac..eeaf2a8508fa 100644 --- a/doc/lightning-bkpr-listbalances.7.md +++ b/doc/lightning-bkpr-listbalances.7.md @@ -1,10 +1,10 @@ lightning-bkpr-listbalances -- Command for listing current channel + wallet balances -=============================================================================== +==================================================================================== SYNOPSIS -------- -**bkpr-listbalances** +**bkpr-listbalances** DESCRIPTION ----------- @@ -13,42 +13,65 @@ The **bkpr-listbalances** RPC command is a list of all current and historical ac Note that any channel that was recorded will be listed. Closed channel balances will be 0msat. +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:bkpr-listbalances#1", + "method": "bkpr-listbalances", + "params": "{}" +} +``` + RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **accounts** is returned. It is an array of objects, where each object contains: +On success, an object containing **accounts** is returned. It is an array of objects, where each object contains: -- **account** (string): The account name. If the account is a channel, the channel\_id +- **account** (string): The account name. If the account is a channel, the channel\_id. - **balances** (array of objects): - - **balance\_msat** (msat): Current account balance - - **coin\_type** (string): coin type, same as HRP for bech32 + - **balance\_msat** (msat): Current account balance. + - **coin\_type** (string): Coin type, same as HRP for bech32. If **peer\_id** is present: - - - **peer\_id** (pubkey): Node id for the peer this account is with - - **we\_opened** (boolean): Did we initiate this account open (open the channel) + - **peer\_id** (pubkey): Node id for the peer this account is with. + - **we\_opened** (boolean): Did we initiate this account open (open the channel). - **account\_closed** (boolean): + - **account\_resolved** (boolean): Has this channel been closed and all outputs resolved? - - **resolved\_at\_block** (u32, optional): Blockheight account resolved on chain - -[comment]: # (GENERATE-FROM-SCHEMA-END) + - **resolved\_at\_block** (u32, optional): Blockheight account resolved on chain. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "accounts": [ + { + "account": "wallet", + "balances": [ + { + "balance_msat": 2222222000, + "coin_type": "bcrt" + } + ] + } + ] +} +``` AUTHOR ------ -niftynei is mainly responsible. +Lisa Neigut <> is mainly responsible. SEE ALSO -------- -lightning-bkpr-listincome(7), lightning-listfunds(7), -lightning-bkpr-listaccountevents(7), -lightning-bkpr-channelsapy(7), lightning-listpeers(7). +lightning-bkpr-listincome(7), lightning-listfunds(7), lightning-bkpr-listaccountevents(7), lightning-bkpr-channelsapy(7), lightning-listpeers(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:93c258c5a9352584515769c2db1f000ca8b565fea2eeb7a9c262a2edc58ed091) diff --git a/doc/lightning-bkpr-listincome.7.md b/doc/lightning-bkpr-listincome.7.md index 47de4abfb8b8..1b282c806922 100644 --- a/doc/lightning-bkpr-listincome.7.md +++ b/doc/lightning-bkpr-listincome.7.md @@ -1,49 +1,135 @@ lightning-bkpr-listincome -- Command for listing all income impacting events -======================================================================= +============================================================================ SYNOPSIS -------- -**bkpr-listincome** \[*consolidate\_fees*\] \[*start\_time*\] \[*end\_time*\] +**bkpr-listincome** [*consolidate\_fees*] [*start\_time*] [*end\_time*] DESCRIPTION ----------- +Command *added* in pre-v0.10.1. + The **bkpr-listincome** RPC command is a list of all income impacting events that the bookkeeper plugin has recorded for this node. +- **consolidate\_fees** (boolean, optional): If true, we emit a single, consolidated event for any onchain-fees for a txid and account. Otherwise, events for every update to the onchain fee calculation for this account and txid will be printed. Note that this means that the events emitted are non-stable, i.e. calling **listincome** twice may result in different onchain fee events being emitted, depending on how much information we've logged for that transaction. The default is True. +- **start\_time** (u32, optional): UNIX timestamp (in seconds) that filters events after the provided timestamp. The default is zero. +- **end\_time** (u32, optional): UNIX timestamp (in seconds) that filters events up to and at the provided timestamp. The default is max-int. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:bkpr-listincome#1", + "method": "bkpr-listincome", + "params": "{}" +} +{ + "id": "example:bkpr-listincome#2", + "method": "bkpr-listincome", + "params": { + "consolidate_fees": false + } +} +``` + RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **income\_events** is returned. It is an array of objects, where each object contains: +On success, an object containing **income\_events** is returned. It is an array of objects, where each object contains: + +- **account** (string): The account name. If the account is a channel, the channel\_id. +- **tag** (string): Type of income event. +- **credit\_msat** (msat): Amount earned (income). +- **debit\_msat** (msat): Amount spent (expenses). +- **currency** (string): Human-readable bech32 part for this coin type. +- **timestamp** (u32): Timestamp this event was recorded by the node. For consolidated events such as onchain\_fees, the most recent timestamp. +- **description** (string, optional): More information about this event. If a `invoice` type, typically the bolt11/bolt12 description. +- **outpoint** (string, optional): The txid:outnum for this event, if applicable. +- **txid** (txid, optional): The txid of the transaction that created this event, if applicable. +- **payment\_id** (hex, optional): Lightning payment identifier. For an htlc, this will be the preimage. -- **account** (string): The account name. If the account is a channel, the channel\_id -- **tag** (string): Type of income event -- **credit\_msat** (msat): Amount earned (income) -- **debit\_msat** (msat): Amount spent (expenses) -- **currency** (string): human-readable bech32 part for this coin type -- **timestamp** (u32): Timestamp this event was recorded by the node. For consolidated events such as onchain\_fees, the most recent timestamp -- **description** (string, optional): More information about this event. If a `invoice` type, typically the bolt11/bolt12 description -- **outpoint** (string, optional): The txid:outnum for this event, if applicable -- **txid** (txid, optional): The txid of the transaction that created this event, if applicable -- **payment\_id** (hex, optional): lightning payment identifier. For an htlc, this will be the preimage. +EXAMPLE JSON RESPONSE +--------------------- -[comment]: # (GENERATE-FROM-SCHEMA-END) +```json +{ + "income_events": [ + { + "account": "wallet", + "tag": "deposit", + "credit_msat": 1111111000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706153060, + "outpoint": "6d813d2e99ae7181b61e59ff224c43de698bd08b8ca5b8034ccc13aa7b6428ef:0" + }, + { + "account": "wallet", + "tag": "deposit", + "credit_msat": 1111111000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706153060, + "outpoint": "0bbbe965f76525af3876ae6f1520d91047d4be04cb4e46b7229120a60c5dc9c5:0" + } + ] +} +{ + "income_events": [ + { + "account": "wallet", + "tag": "deposit", + "credit_msat": 1111111000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1708624181, + "outpoint": "895b5eaad4544d24c99628883b4d84b2c6024d6a2da4c1de54098d985f280943:1" + }, + { + "account": "wallet", + "tag": "withdrawal", + "credit_msat": 0, + "debit_msat": 555555000, + "currency": "bcrt", + "timestamp": 1708624182, + "outpoint": "d28a2cba55da10700ddd7f1f23618160dafb3134650055654551d9b0382dcd71:0" + }, + { + "account": "wallet", + "tag": "onchain_fee", + "credit_msat": 0, + "debit_msat": 555556000, + "currency": "bcrt", + "timestamp": 1708624183, + "txid": "d28a2cba55da10700ddd7f1f23618160dafb3134650055654551d9b0382dcd71" + }, + { + "account": "wallet", + "tag": "onchain_fee", + "credit_msat": 554947000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1708624183, + "txid": "d28a2cba55da10700ddd7f1f23618160dafb3134650055654551d9b0382dcd71" + } + ] +} +``` AUTHOR ------ -niftynei is mainly responsible. +Lisa Neigut <> is mainly responsible. SEE ALSO -------- -lightning-bkpr-listaccountevents(7), lightning-listfunds(7), -lightning-bkpr-listbalances(7). +lightning-bkpr-listaccountevents(7), lightning-listfunds(7), lightning-bkpr-listbalances(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:63a3f30f3d5fd1401b14be8e45e3c5f218328ceb74e9c5842abf9e30eae93e03) diff --git a/doc/lightning-blacklistrune.7.md b/doc/lightning-blacklistrune.7.md index d0e913930f3b..0836be99851f 100644 --- a/doc/lightning-blacklistrune.7.md +++ b/doc/lightning-blacklistrune.7.md @@ -1,5 +1,5 @@ lightning-blacklistrune -- Command to prevent a rune from working -============================================================== +================================================================= SYNOPSIS -------- @@ -9,22 +9,87 @@ SYNOPSIS DESCRIPTION ----------- +Command *added* in v23.08. + The **blacklistrune** RPC command allows you to effectively revoke the rune you have created (and any runes derived from that rune with additional restictions). Attempting to use these runes will be resulted in a `Blacklisted rune` error message. Destroy a rune like in olden times with the **destroyrune** command. All runes created by lightning have a unique sequential id within them and can be blacklisted in ranges for efficiency. The command always returns the blacklisted ranges on success. If no parameters are specified, no changes have been made. If start specified without end, that single rune is blacklisted. If end is also specified, every rune from start till end inclusive is blacklisted. +- **start** (u64, optional): First rune unique id to blacklist. +- **end** (u64, optional): Final rune unique id to blacklist (defaults to start). + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:blacklistrune#1", + "method": "blacklistrune", + "params": { + "start": 2 + } +} +{ + "id": "example:blacklistrune#2", + "method": "blacklistrune", + "params": { + "start": 5, + "end": 7 + } +} +{ + "id": "example:blacklistrune#3", + "method": "blacklistrune", + "params": { + "start": 3, + "end": 4 + } +} +``` + RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **blacklist** is returned. It is an array of objects, where each object contains: - -- **start** (u64): Unique id of first rune in this blacklist range -- **end** (u64): Unique id of last rune in this blacklist range - -[comment]: # (GENERATE-FROM-SCHEMA-END) +On success, an object containing **blacklist** is returned. It is an array of objects, where each object contains: + +- **start** (u64): Unique id of first rune in this blacklist range. +- **end** (u64): Unique id of last rune in this blacklist range. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "blacklist": [ + { + "start": 2, + "end": 2 + } + ] +} +{ + "blacklist": [ + { + "start": 2, + "end": 2 + }, + { + "start": 5, + "end": 7 + } + ] +} +{ + "blacklist": [ + { + "start": 2, + "end": 7 + } + ] +} +``` AUTHOR ------ @@ -40,5 +105,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:7f9e7ab72e0e8d6e7cc59c560a274ffcfd5d257c73e37866d05ffa74d587fb3f) diff --git a/doc/lightning-check.7.md b/doc/lightning-check.7.md index b42bbc04baaa..5994f4a22e21 100644 --- a/doc/lightning-check.7.md +++ b/doc/lightning-check.7.md @@ -1,44 +1,97 @@ lightning-check -- Command for verifying parameters -============================== +=================================================== SYNOPSIS -------- -**check** *command\_to\_check* [*parameters*] +**check** *command\_to\_check* DESCRIPTION ----------- -The **check** RPC command verifies another command without actually -making any changes. +The **check** RPC command verifies another command without actually making any changes. -This is guaranteed to be safe, and will do all checks up to the point -where something in the system would need to be altered (such as checking -that channels are in the right state, peers connected, etc). +This is guaranteed to be safe, and will do all checks up to the point where something in the system would need to be altered (such as checking that channels are in the right state, peers connected, etc). -It does not guarantee successful execution of the command in all -cases. For example, a call to lightning-getroute(7) may still fail to -find a route even if checking the parameters succeeds. +It does not guarantee successful execution of the command in all cases. For example, a call to lightning-getroute(7) may still fail to find a route even if checking the parameters succeeds. + +- **command\_to\_check** (string): Name of the relevant command. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:check#1", + "method": "check", + "params": { + "command_to_check": "sendpay", + "route": [ + { + "amount_msat": 1011, + "msatoshi": 1011, + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "delay": 20, + "channel": "1x1x1" + }, + { + "amount_msat": 1000, + "msatoshi": 1000, + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "delay": 10, + "channel": "2x2x2" + } + ], + "payment_hash": "0000000000000000000000000000000000000000000000000000000000000000" + } +} +{ + "id": "example:check#2", + "method": "check", + "params": { + "command_to_check": "dev", + "subcommand": "slowcmd", + "msec": 1000 + } +} +{ + "id": "example:check#3", + "method": "check", + "params": { + "command_to_check": "recover", + "hsmsecret": "6c696768746e696e672d31000000000000000000000000000000000000000000" + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **command\_to\_check** (string): the *command\_to\_check* argument +- **command\_to\_check** (string): The *command\_to\_check* argument. -[comment]: # (GENERATE-FROM-SCHEMA-END) +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "command_to_check": "sendpay" +} +{ + "command_to_check": "dev" +} +{ + "command_to_check": "recover" +} +``` AUTHOR ------ -Mark Beckwith <> and Rusty Russell -<> are mainly responsible. +Mark Beckwith <> and Rusty Russell <> are mainly responsible. RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:4f50353d5bda2785a138f03eafd77e54d307589fe80f10a4d140d2d5f5d773f3) diff --git a/doc/lightning-checkmessage.7.md b/doc/lightning-checkmessage.7.md index 78664cc4d61b..dccefabb2231 100644 --- a/doc/lightning-checkmessage.7.md +++ b/doc/lightning-checkmessage.7.md @@ -1,35 +1,67 @@ lightning-checkmessage -- Command to check if a signature is from a node -===================================================================== +======================================================================== SYNOPSIS -------- -**checkmessage** *message* *zbase* [*pubkey*] +**checkmessage** *message* *zbase* [*pubkey*] DESCRIPTION ----------- -The **checkmessage** RPC command is the counterpart to -**signmessage**: given a node id (*pubkey*), signature (*zbase*) and a -*message*, it verifies that the signature was generated by that node -for that message (more technically: by someone who knows that node's -secret). - -As a special case, if *pubkey* is not specified, we will try every -known node key (as per *listnodes*), and verification succeeds if it -matches for any one of them. Note: this is implemented far more -efficiently than trying each one, so performance is not a concern. +The **checkmessage** RPC command is the counterpart to **signmessage**: given a node id (*pubkey*), signature (*zbase*) and a *message*, it verifies that the signature was generated by that node for that message (more technically: by someone who knows that node's secret). + +As a special case, if *pubkey* is not specified, we will try every known node key (as per *listnodes*), and verification succeeds if it matches for any one of them. Note: this is implemented far more efficiently than trying each one, so performance is not a concern. + +- **message** (string): Message to be checked against the signature. +- **zbase** (string): The Zbase32 encoded signature to verify. +- **pubkey** (pubkey, optional): The Zbase32 encoded signature to verify. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:checkmessage#1", + "method": "checkmessage", + "params": { + "message": "testcase to check new rpc error", + "zbase": "d66bqz3qsku5fxtqsi37j11pci47ydxa95iusphutggz9ezaxt56neh77kxe5hyr41kwgkncgiu94p9ecxiexgpgsz8daoq4tw8kj8yx", + "pubkey": "03be3b0e9992153b1d5a6e1623670b6c3663f72ce6cf2e0dd39c0a373a7de5a3b7" + } +} +{ + "id": "example:checkmessage#2", + "method": "checkmessage", + "params": { + "message": "this is a test!", + "zbase": "d6tqaeuonjhi98mmont9m4wag7gg4krg1f4txonug3h31e9h6p6k6nbwjondnj46dkyausobstnk7fhyy998bhgc1yr98dfmhb4k54d7", + "pubkey": null + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **verified** (boolean): whether the signature was valid (always *true*) -- **pubkey** (pubkey): the *pubkey* parameter, or the pubkey found by looking for known nodes +- **verified** (boolean) (always *true*): Whether the signature was valid. +- **pubkey** (pubkey): The *pubkey* parameter, or the pubkey found by looking for known nodes. + +EXAMPLE JSON RESPONSE +--------------------- -[comment]: # (GENERATE-FROM-SCHEMA-END) +```json +{ + "pubkey": "03be3b0e9992153b1d5a6e1623670b6c3663f72ce6cf2e0dd39c0a373a7de5a3b7", + "verified": true +} +{ + "pubkey": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "verified": true +} +``` ERRORS ------ @@ -53,5 +85,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:2e39c4cb816b9585d5e8262a09b873a9eaa0f04ac8f1281bfb36e08f71e5c923) diff --git a/doc/lightning-checkrune.7.md b/doc/lightning-checkrune.7.md index 761becbed9b4..ff050e8034ca 100644 --- a/doc/lightning-checkrune.7.md +++ b/doc/lightning-checkrune.7.md @@ -1,38 +1,105 @@ lightning-checkrune -- Command to Validate Rune -================================================ +=============================================== SYNOPSIS -------- -**checkrune** *rune* [*nodeid*] [*method*] [*params*] +**checkrune** *rune* [*nodeid*] [*method*] [*params*] DESCRIPTION ----------- +Command *added* in v23.08. + The **checkrune** RPC command checks the validity/authorization rights of specified rune for the given nodeid, method, and params. If successful, the rune "usage" counter (used for ratelimiting) is incremented. See lightning-createrune(7) for the fields in the rune which are checked. +- **rune** (string): Rune to check for authorization. +- **nodeid** (string, optional): Node id of requesting node *(required until v23.11)*. +- **method** (string, optional): Method for which rune needs to be validated *(required until v23.11)*. +- **params** (one of, optional): + - (array): Array of positional parameters. + - (object): Parameters for method.: + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:checkrune#1", + "method": "checkrune", + "params": { + "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "rune": "617Obfct0oRBj_uqGFQxDk3XZ1sDFiC2Q5ltm5z1i_k9NSZtZXRob2Q9aW52b2ljZSZwbmFtZWRlc2NyaXB0aW9uPUB0aXBqYXJcfGpiNTVAc2VuZHNhdHMubG9s", + "method": "invoice", + "params": { + "amount_msat": "any", + "label": "lbl", + "description": [ + "@tipjar|jb55@sendsats.lol." + ] + } + } +} +{ + "id": "example:checkrune#2", + "method": "checkrune", + "params": { + "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==", + "method": "listpeers", + "params": {} + } +} +{ + "id": "example:checkrune#3", + "method": "checkrune", + "params": { + "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "rune": "617Obfct0oRBj_uqGFQxDk3XZ1sDFiC2Q5ltm5z1i_k9NSZtZXRob2Q9aW52b2ljZSZwbmFtZWRlc2NyaXB0aW9uPUB0aXBqYXJcfGpiNTVAc2VuZHNhdHMubG9s", + "method": "invoice", + "params": { + "amount_msat": "any", + "label": "lbl", + "description": "@tipjar|jb55@sendsats.lol" + } + } +} +``` + RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **valid** (boolean): true if the rune is valid +- **valid** (boolean): True if the rune is valid. -[comment]: # (GENERATE-FROM-SCHEMA-END) +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "valid": true +} +{ + "valid": true +} +{ + "valid": true +} +``` ERRORS ------ The following error codes may occur: -- RUNE\_NOT\_AUTHORIZED (1501): rune is not for this node (or perhaps completely invalid) -- RUNE\_NOT\_PERMITTED (1502): rune does not allow this usage (includes a detailed reason why) -- RUNE\_BLACKLISTED (1503): rune has been explicitly blacklisted. +- 1501 (RUNE\_NOT\_AUTHORIZED): rune is not for this node (or perhaps completely invalid) +- 1502 (RUNE\_NOT\_PERMITTED): rune does not allow this usage (includes a detailed reason why) +- 1503 (RUNE\_BLACKLISTED): rune has been explicitly blacklisted. AUTHOR ------ @@ -48,5 +115,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:72ed36d7c47cf43b39c149da7d251c8bd40531b59591a50c4745f5d7aef5854e) diff --git a/doc/lightning-close.7.md b/doc/lightning-close.7.md index 58dd9333e4e2..d366c87780db 100644 --- a/doc/lightning-close.7.md +++ b/doc/lightning-close.7.md @@ -4,54 +4,114 @@ lightning-close -- Command for closing channels with direct peers SYNOPSIS -------- -**close** *id* [*unilateraltimeout*] [*destination*] [*fee\_negotiation\_step*] [*wrong\_funding*] [*force\_lease\_closed*] [*feerange*] +**close** *id* [*unilateraltimeout*] [*destination*] [*fee\_negotiation\_step*] [*wrong\_funding*] [*force\_lease\_closed*] [*feerange*] DESCRIPTION ----------- -The **close** RPC command attempts to close the channel cooperatively -with the peer, or unilaterally after *unilateraltimeout*, and the -to-local output will be sent to the address specified in *destination*. - -The peer needs to be live and connected in order to negotiate a mutual -close. The default of unilaterally closing after 48 hours is usually a -reasonable indication that you can no longer contact the peer. +The **close** RPC command attempts to close the channel cooperatively with the peer, or unilaterally after *unilateraltimeout*, and the to-local output will be sent to the address specified in *destination*. + +The peer needs to be live and connected in order to negotiate a mutual close. The default of unilaterally closing after 48 hours is usually a reasonable indication that you can no longer contact the peer. + +- **id** (string): Peer id, channel id or short\_channel\_id. If the given *id* is a peer ID (66 hex digits as a string), then it applies to the active channel of the direct peer corresponding to the given peer ID. If the given *id* is a channel ID (64 hex digits as a string, or the short channel ID *blockheight:txindex:outindex* form), then it applies to that channel. +- **unilateraltimeout** (u32, optional): If it is not zero, the command will unilaterally close the channel when that number of seconds is reached. If *unilateraltimeout* is zero, then the command will wait indefinitely until the peer is online and can negotiate a mutual close. The default is 2 days (172800 seconds). +- **destination** (string, optional): Any Bitcoin bech32 type. If the peer hasn't offered the option\_shutdown\_anysegwit feature, then taproot addresses (or other v1+ segwit) are not allowed. Tell your friends to upgrade! The default is a Core Lightning wallet address. +- **fee\_negotiation\_step** (string, optional): It controls how closing fee negotiation is performed assuming the peer proposes a fee that is different than our estimate. (Note that modern peers use the quick-close protocol which does not allow negotiation: see *feerange* instead). + + On every negotiation step we must give up some amount from our proposal towards the peer's proposal. This parameter can be an integer in which case it is interpreted as number of satoshis to step at a time. Or it can be an integer followed by `%` to designate a percentage of the interval to give up. A few examples, assuming the peer proposes a closing fee of 3000 satoshi and our estimate shows it must be 4000: + * `10`: our next proposal will be 4000-10=3990. + * `10%`: our next proposal will be 4000-(10% of (4000-3000))=3900. + * '1': our next proposal will be 3999. This is the most extreme case when we insist on our fee as much as possible. + * `100%`: our next proposal will be 3000. This is the most relaxed case when we quickly accept the peer's proposal. The default is `50%`. +- **wrong\_funding** (outpoint, optional): It can only be specified if both sides have offered the `shutdown_wrong_funding` feature (enabled by the **experimental-shutdown-wrong-funding** option). It must be a transaction id followed by a colon then the output number. Instead of negotiating a shutdown to spend the expected funding transaction, the shutdown transaction will spend this output instead. This is only allowed if this peer opened the channel and the channel is unused: it can rescue openings which have been manually miscreated. +- **force\_lease\_closed** (boolean, optional): If the channel has funds leased to the peer (option\_will\_fund), we prevent initiation of a mutual close unless this flag is passed in. The default is False. +- **feerange** (array of feerates, optional): An optional array [ *min*, *max* ], indicating the minimum and maximum feerates to offer: the peer will obey these if it supports the quick-close protocol. *slow* and *unilateral\_close* are the defaults. Note that the maximum fee will be capped at the final commitment transaction fee (unless the experimental anchor-outputs option is negotiated).: + - (feerate, optional) + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:close#1", + "method": "close", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "unilateraltimeout": 1, + "destination": null, + "fee_negotiation_step": null, + "force_lease_closed": null, + "feerange": null + } +} +{ + "id": "example:close#2", + "method": "close", + "params": { + "id": "103x1x0", + "unilateraltimeout": null, + "destination": "bcrt1qeyyk6sl5pr49ycpqyckvmttus5ttj25pd0zpvg", + "fee_negotiation_step": null, + "force_lease_closed": null, + "feerange": null + } +} +{ + "id": "example:close#3", + "method": "close", + "params": [ + "107x1x0", + null, + "bcrt1qeyyk6sl5pr49ycpqyckvmttus5ttj25pd0zpvg" + ] +} +``` NOTES ----- -Prior to 0.7.2, **close** took two parameters: *force* and *timeout*. -*timeout* was the number of seconds before *force* took effect (default, -30), and *force* determined whether the result was a unilateral close or -an RPC error (default). Even after the timeout, the channel would be -closed if the peer reconnected. +Prior to 0.7.2, **close** took two parameters: *force* and *timeout*. *timeout* was the number of seconds before *force* took effect (default, 30), and *force* determined whether the result was a unilateral close or an RPC error (default). Even after the timeout, the channel would be closed if the peer reconnected. NOTIFICATIONS ------------- -Notifications may be returned indicating what is going on, especially -if the peer is offline and we are waiting. +Notifications may be returned indicating what is going on, especially if the peer is offline and we are waiting. RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **type** (string): Whether we successfully negotiated a mutual close, closed without them, or discarded not-yet-opened channel (one of "mutual", "unilateral", "unopened") +- **type** (string) (one of "mutual", "unilateral", "unopened"): Whether we successfully negotiated a mutual close, closed without them, or discarded not-yet-opened channel. If **type** is "mutual" or "unilateral": - - - **tx** (hex): the raw bitcoin transaction used to close the channel (if it was open) - - **txid** (txid): the transaction id of the *tx* field - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -A unilateral close may still occur at any time if the peer did not -behave correctly during the close negotiation. - -Unilateral closes will return your funds after a delay. The delay will -vary based on the peer *to\_self\_delay* setting, not your own setting. + - **tx** (hex): The raw bitcoin transaction used to close the channel (if it was open). + - **txid** (txid): The transaction id of the *tx* field. + +A unilateral close may still occur at any time if the peer did not behave correctly during the close negotiation. + +Unilateral closes will return your funds after a delay. The delay will vary based on the peer *to\_self\_delay* setting, not your own setting. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "tx": "020000000001018d388ffcd216c92d25163a62096ce47d5c9bbd6270ced51c5a1484f89df33e5700000000009db0e28002a00f00000000000016001445503fa4b65ade3ffdb1a92057688456c9ffae1380130f0000000000220020be82765fdb17fd5568f2dd31c6cf1aabc620ef338995ec5d9a2f3e42f43ae4870400473044022058dcde893655f40fc8162a79596440ef3e304273f8d530401fc17bc92c58159b0220428900ca6537538ba237d569a4a09003d663a991aeb331a9f18dfe807ee78806014730440220111270eeed8b4b1a231d3ce6e0e0daad718623ad159a0fd3781fb18118a8fec70220539826ee7c76cad4116d1d8852329f80314b3434cf21c765d8004186451a4cd50147522102324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b2102e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5752ae9c3ed620", + "txid": "5d8d917dd7d39fe5a12f121457fc6d712b5e393ed4f16bc8f5976fc08cbbfecd", + "type": "unilateral" +} +{ + "tx": "0200000000010132cbce7d5f96b4003c3b5c0eab2a29fef90bb6abb833ff312fa122f31e8301810000000000ffffffff02a0860100000000002251205779a060f200d40e8f871a40eb91614cc5bfa6d0a5f852e053400a7feff8615005b10d0000000000160014c9096d43f408ea526020262ccdad7c8516b92a81040047304402207e171d056e81cf8ad2d5a613ecbaa212d5dcbd0bf713145d18911d2cbe9d858802206222911660a26d7ffddc2563ae6d41d6ffad9fbd2fc26cf40eab501a31153b9e0147304402204ae7cdc68dc7966eab73f16a1978643336333d54ae0b6f87bc11a2c19174a9710220601e5276aee0825466cc272c4eb7d353b393ef0dd230d303f46772790dee19190147522102324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b2102e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5752ae00000000", + "txid": "4a08e0508e2e39ea033fab5f77b318337f345550421799f6e0eb1b15a892eda4", + "type": "mutual" +} +{ + "tx": "02000000000101233b513665836d240423f45ffcd1fe19aeb08d62303fa5382ad3285f770683a60000000000ffffffff02a086010000000000225120b47216ab60a0fad97de0ba9b8b370d281dfe55f552d82034e2a8d054c2246e4405b10d0000000000160014c9096d43f408ea526020262ccdad7c8516b92a81040047304402207a9e3ca258861b33827d91514690a757e76730ba8c15dd222340bb13d993a1a502204d0ae329273b69abe62df1ffccce808d5f1a29101a8ee95dae99888376dbaef801473044022033c03f406db9f1c9d924cfd8f6ea42d0962f0ab02e3217aef518aea517ca5ba40220076e2af9d40c676316a2765a86f9efd481de3fc4465ceba33b0782c505ae3452014752210212284c004a3d24146e54b2a24db48f650370a08e1fe9abe8ff41f92b09cd50542102a3032ef980cc735579aa5295d927b9a1bdbafc459f2da14163dc9bd530e0a21152ae00000000", + "txid": "d44a1374a30c1a936d2d4fdbe73c0ffff42fec8c27c6cbaec2758b3042f61d08", + "type": "mutual" +} +``` AUTHOR ------ @@ -61,11 +121,9 @@ ZmnSCPxj <> is mainly responsible. SEE ALSO -------- -lightning-disconnect(7), lightning-fundchannel(7), lightningd-config(5). +lightning-disconnect(7), lightning-fundchannel(7), lightningd-config(5) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:958a08abbec73812611f72c25b656bc6095fe1d9ff7b5447d0da661151335871) diff --git a/doc/lightning-commando-blacklist.7.md b/doc/lightning-commando-blacklist.7.md index 8607f35b5529..6b81eb0fc51f 100644 --- a/doc/lightning-commando-blacklist.7.md +++ b/doc/lightning-commando-blacklist.7.md @@ -9,20 +9,87 @@ SYNOPSIS DESCRIPTION ----------- +Command **deprecated in v23.08, removed after v24.08**. + +Command *added* in v23.05. + The **commando-blacklist** RPC command allows you to effectively revoke the rune you have created (and any runes derived from that rune with additional restictions). Attempting to use these runes will be resulted in a `Blacklisted rune` error message. All runes created by commando have a unique sequential id within them and can be blacklisted in ranges for efficiency. The command always returns the blacklisted ranges on success. If no parameters are specified, no changes have been made. If start specified without end, that single rune is blacklisted. If end is also specified, every rune from start till end inclusive is blacklisted. +- **start** (u64, optional): First rune unique id to blacklist. +- **end** (u64, optional): Final rune unique id to blacklist (defaults to start). + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:commando-blacklist#1", + "method": "commando-blacklist", + "params": { + "start": 2 + } +} +{ + "id": "example:commando-blacklist#2", + "method": "commando-blacklist", + "params": { + "start": 5, + "end": 7 + } +} +{ + "id": "example:commando-blacklist#3", + "method": "commando-blacklist", + "params": { + "start": 3, + "end": 4 + } +} +``` + RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **blacklist** is returned. It is an array of objects, where each object contains: - -- **start** (u64): Unique id of first rune in this blacklist range -- **end** (u64): Unique id of last rune in this blacklist range - -[comment]: # (GENERATE-FROM-SCHEMA-END) +On success, an object containing **blacklist** is returned. It is an array of objects, where each object contains: + +- **start** (u64): Unique id of first rune in this blacklist range. +- **end** (u64): Unique id of last rune in this blacklist range. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "blacklist": [ + { + "start": 2, + "end": 2 + } + ] +} +{ + "blacklist": [ + { + "start": 2, + "end": 2 + }, + { + "start": 5, + "end": 7 + } + ] +} +{ + "blacklist": [ + { + "start": 2, + "end": 7 + } + ] +} +``` AUTHOR ------ @@ -38,5 +105,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:7f9e7ab72e0e8d6e7cc59c560a274ffcfd5d257c73e37866d05ffa74d587fb3f) diff --git a/doc/lightning-commando-listrunes.7.md b/doc/lightning-commando-listrunes.7.md index 87771cdf18f3..e656e3443cff 100644 --- a/doc/lightning-commando-listrunes.7.md +++ b/doc/lightning-commando-listrunes.7.md @@ -4,37 +4,169 @@ lightning-commando-listrunes -- Command to list previously generated runes SYNOPSIS -------- -**commando-listrunes** [*rune*] +**commando-listrunes** [*rune*] DESCRIPTION ----------- -The **commando-listrunes** RPC command either lists runes that we stored as we generate them (see lightning-commando-rune(7)) or decodes the rune given on the command line. +Command **deprecated in v23.08, removed after v24.05**. + +Command *added* in v23.05. + +The **commando-listrunes** RPC command either lists runes that we stored as we generate them (see lightning-commando-rune(7)) or decodes the rune given on the command line. NOTE: Runes generated prior to v23.05 were not stored, so will not appear in this list. +- **rune** (string, optional): Optional rune to list. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:commando-listrunes#1", + "method": "commando-listrunes", + "params": "{}" +} +{ + "id": "example:commando-listrunes#2", + "method": "commando-listrunes", + "params": { + "rune": "Am3W_wI0PRn4qVNEsJ2iInHyFPQK8wfdqEXztm8-icQ9MA==" + } +} +{ + "id": "example:commando-listrunes#3", + "method": "commando-listrunes", + "params": { + "rune": "m_tyR0qqHUuLEbFJW6AhmBg-9npxVX2yKocQBFi9cvY9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJzJnBuYW1lbGV2ZWwhfHBuYW1lbGV2ZWwvaW8mcGFycjEhfHBhcnIxL2lv" + } +} +``` + RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **runes** is returned. It is an array of objects, where each object contains: +On success, an object containing **runes** is returned. It is an array of objects, where each object contains: -- **rune** (string): Base64 encoded rune -- **unique\_id** (string): Unique id assigned when the rune was generated; this is always a u64 for commando runes -- **restrictions** (array of objects): The restrictions on what commands this rune can authorize: +- **rune** (string): Base64 encoded rune. +- **unique\_id** (string): Unique id assigned when the rune was generated; this is always a u64 for commando runes. +- **restrictions** (array of objects): The restrictions on what commands this rune can authorize.: - **alternatives** (array of objects): - - **fieldname** (string): The field this restriction applies to; see commando-rune(7) - - **value** (string): The value accepted for this field - - **condition** (string): The way to compare fieldname and value - - **english** (string): English readable description of this alternative - - **english** (string): English readable summary of alternatives above -- **restrictions\_as\_english** (string): English readable description of the restrictions array above -- **stored** (boolean, optional): This is false if the rune does not appear in our datastore (only possible when `rune` is specified) (always *false*) -- **blacklisted** (boolean, optional): The rune has been blacklisted; see commando-blacklist(7) (always *true*) -- **last\_used** (number, optional): The last time this rune was successfully used *(added 23.11)* -- **our\_rune** (boolean, optional): This is not a rune for this node (only possible when `rune` is specified) (always *false*) - -[comment]: # (GENERATE-FROM-SCHEMA-END) + - **fieldname** (string): The field this restriction applies to; see commando-rune(7). + - **value** (string): The value accepted for this field. + - **condition** (string): The way to compare fieldname and value. + - **english** (string): English readable description of this alternative. + - **english** (string): English readable summary of alternatives above. +- **restrictions\_as\_english** (string): English readable description of the restrictions array above. +- **stored** (boolean, optional) (always *false*): This is false if the rune does not appear in our datastore (only possible when `rune` is specified). +- **blacklisted** (boolean, optional) (always *true*): The rune has been blacklisted; see commando-blacklist(7). +- **last\_used** (number, optional): The last time this rune was successfully used. *(added 23.11)* +- **our\_rune** (boolean, optional) (always *false*): This is not a rune for this node (only possible when `rune` is specified). + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "runes": [ + { + "rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==", + "unique_id": "0", + "restrictions": [], + "restrictions_as_english": "" + }, + { + "rune": "Am3W_wI0PRn4qVNEsJ2iInHyFPQK8wfdqEXztm8-icQ9MA==", + "stored": false, + "our_rune": false, + "unique_id": "1", + "restrictions": [], + "restrictions_as_english": "" + } + ] +} +{ + "runes": [ + { + "rune": "Am3W_wI0PRn4qVNEsJ2iInHyFPQK8wfdqEXztm8-icQ9MA==", + "stored": false, + "our_rune": false, + "unique_id": "1", + "restrictions": [], + "restrictions_as_english": "" + } + ] +} +{ + "runes": [ + { + "rune": "m_tyR0qqHUuLEbFJW6AhmBg-9npxVX2yKocQBFi9cvY9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJzJnBuYW1lbGV2ZWwhfHBuYW1lbGV2ZWwvaW8mcGFycjEhfHBhcnIxL2lv", + "stored": false, + "unique_id": "3", + "restrictions": [ + { + "alternatives": [ + { + "fieldname": "id", + "value": "022d223620a359a47ff7", + "condition": "^", + "english": "id starts with 022d223620a359a47ff7" + } + ], + "english": "id starts with 022d223620a359a47ff7" + }, + { + "alternatives": [ + { + "fieldname": "method", + "value": "listpeers", + "condition": "=", + "english": "method equal to listpeers" + } + ], + "english": "method equal to listpeers" + }, + { + "alternatives": [ + { + "fieldname": "pnamelevel", + "value": "", + "condition": "!", + "english": "pnamelevel is missing" + }, + { + "fieldname": "pnamelevel", + "value": "io", + "condition": "/", + "english": "pnamelevel unequal to io" + } + ], + "english": "pnamelevel is missing OR pnamelevel unequal to io" + }, + { + "alternatives": [ + { + "fieldname": "parr1", + "value": "", + "condition": "!", + "english": "parr1 is missing" + }, + { + "fieldname": "parr1", + "value": "io", + "condition": "/", + "english": "parr1 unequal to io" + } + ], + "english": "parr1 is missing OR parr1 unequal to io" + } + ], + "restrictions_as_english": "id starts with 022d223620a359a47ff7 AND method equal to listpeers AND pnamelevel is missing OR pnamelevel unequal to io AND parr1 is missing OR parr1 unequal to io" + } + ] +} +``` AUTHOR ------ @@ -50,5 +182,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:f951001acafe71d2ab6d95367bd122067f449af71e755672e44e719fc5a8c1fa) diff --git a/doc/lightning-commando-rune.7.md b/doc/lightning-commando-rune.7.md index ce8e73d3dd23..599952fbc9f2 100644 --- a/doc/lightning-commando-rune.7.md +++ b/doc/lightning-commando-rune.7.md @@ -1,50 +1,40 @@ lightning-commando-rune -- Command to Authorize Remote Peer Access -=================================================================== +================================================================== SYNOPSIS -------- -**commando-rune** [*rune*] [*restrictions*] +**commando-rune** [*rune*] [*restrictions*] DESCRIPTION ----------- -The **commando-rune** RPC command creates a base64 string called a -*rune* which can be used to access commands on this node. Each *rune* -contains a unique id (a number starting at 0), and can have -restrictions inside it. Nobody can remove restrictions from a rune: if -you try, the rune will be rejected. There is no limit on how many -runes you can issue; the node simply decodes -and checks them as they are received (we do store them for lightning-commando-listrunes(7) however). - -If *rune* is supplied, the restrictions are simple appended to that -*rune* (it doesn't need to be a rune belonging to this node). If no -*rune* is supplied, a new one is constructed, with a new unique id. - -*restrictions* can be the string "readonly" (creates a rune which -allows most *get* and *list* commands, and the *summary* command), or -an array of restrictions. - -Each restriction is an array of one or more alternatives, such as "method -is listpeers", or "method is listpeers OR time is before 2023". Alternatives use a simple language to examine the command which is -being run: - -* time: the current UNIX time, e.g. "time<1656759180". -* id: the node\_id of the peer, e.g. "id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605". -* method: the command being run, e.g. "method=withdraw". -* rate: the rate limit, per minute, e.g. "rate=60". -* pnum: the number of parameters. e.g. "pnum<2". -* pnameX: the parameter named X (with any punctuation like `_` removed). e.g. "pnamedestination=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T". -* parrN: the N'th parameter. e.g. "parr0=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T". +Command **deprecated in v23.08, removed after v23.05**. + +The **commando-rune** RPC command creates a base64 string called a *rune* which can be used to access commands on this node. Each *rune* contains a unique id (a number starting at 0), and can have restrictions inside it. Nobody can remove restrictions from a rune: if you try, the rune will be rejected. There is no limit on how many runes you can issue; the node simply decodes and checks them as they are received (we do store them for lightning-commando- listrunes(7) however). + +- **rune** (string, optional): If supplied, the restrictions are simple appended to that *rune* (it doesn't need to be a rune belonging to this node). If not supplied, a new *rune* is constructed, with a new unique id. +- **restrictions** (one of, optional): It can be the string `readonly`, or an array of restrictions. + Each restriction is an array of one or more alternatives, such as "method is listpeers", or "method is listpeers OR time is before 2023".: + - (array of arrays): Alternatives use a simple language to examine the command which is being run: + * time: the current UNIX time, e.g. "time<1656759180". + * id: the node\_id of the peer, e.g. "id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605". + * method: the command being run, e.g. "method=withdraw". + * per: how often the rune can be used, with suffix "sec" (default), "min", "hour", "day" or "msec", "usec" or "nsec". e.g. "per=5sec". + * rate: the rate limit, per minute, e.g. "rate=60" is equivalent to "per=1sec". + * pnum: the number of parameters. e.g. "pnum<2". + * pnameX: the parameter named X (with any punctuation like `_` removed). e.g. "pnamedestination=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T". + * parrN: the N'th parameter. e.g. "parr0=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T". + - (array of strings) + - (string, optional) + - (always "readonly"): A rune which allows most *get* and *list* commands, and the *summary* command. RESTRICTION FORMAT ------------------ -Restrictions are one or more alternatives. Each -alternative is *name* *operator* *value*. The valid names are shown -above. Note that if a value contains `\\`, it must be preceeded by another `\\` -to form valid JSON: +Restrictions are one or more alternatives. Each alternative is *name* *operator* *value*. The valid names are shown above. +Note that if a value contains `\`, it must be preceeded by another `\` to form valid JSON: * `=`: passes if equal ie. identical. e.g. `method=withdraw` * `/`: not equals, e.g. `method/withdraw` * `^`: starts with, e.g. `id^024b9a1fa8e006f1e3937f` @@ -52,31 +42,35 @@ to form valid JSON: * `~`: contains, e.g. `id~006f1e3937f65f66c40`. * `<`: is a decimal integer, and is less than. e.g. `time<1656759180` * `>`: is a decimal integer, and is greater than. e.g. `time>1656759180` -* `{`: preceeds in alphabetical order (or matches but is shorter), e.g. `id{02ff`. -* `}`: follows in alphabetical order (or matches but is longer), e.g. `id}02ff`. +* `{`: preceeds in alphabetical order (or matches but is shorter), + e.g. `id{02ff`. +* `}`: follows in alphabetical order (or matches but is longer), + e.g. `id}02ff`. * `#`: a comment, ignored, e.g. `dumb example#`. * `!`: only passes if the *name* does *not* exist. e.g. `pnamedestination!`. - Every other operator except `#` fails if *name* does not exist! +Every other operator except `#` fails if *name* does not exist! EXAMPLE USAGE ------------- This creates a fresh rune which can do anything: - $ lightning-cli commando-rune - { - "rune": "KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA==", - "unique_id": "0" - } - +```shell +$ lightning-cli commando-rune +{ + "rune": "KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA==", + "unique_id": "0" +} +``` We can add restrictions to that rune, like so: - $ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions=readonly - { - "rune": "NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", - "unique_id": "0" - } - +```shell +$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions=readonly +{ + "rune": "NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", + "unique_id": "0" +} +``` The "readonly" restriction is a short-cut for two restrictions: 1. `["method^list", "method^get", "method=summary"]`: You may call list, get or summary. @@ -84,129 +78,185 @@ The "readonly" restriction is a short-cut for two restrictions: We can do the same manually, like so: - $ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions='[["method^list", "method^get", "method=summary"],["method/listdatastore"]]' - { - "rune": "NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", - "unique_id": "0" - } - -Let's create a rune which lets a specific peer -(024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605) -run "listpeers" on themselves: - - $ lightning-cli commando-rune restrictions='[["id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605"],["method=listpeers"],["pnum=1"],["pnameid=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605","parr0=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605"]]' - { - "rune": "FE8GHiGVvxcFqCQcClVRRiNE_XEeLYQzyG2jmqto4jM9MiZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDV8cGFycjA9MDI0YjlhMWZhOGUwMDZmMWUzOTM3ZjY1ZjY2YzQwOGU2ZGE4ZTFjYTcyOGVhNDMyMjJhNzM4MWRmMWNjNDQ5NjA1", - "unique_id": "2" - } - -This allows `listpeers` with 1 argument (`pnum=1`), which is either by name (`pnameid`), or position (`parr0`). We could shorten this in several ways: either allowing only positional or named parameters, or by testing the start of the parameters only. Here's an example which only checks the first 9 bytes of the `listpeers` parameter: - - $ lightning-cli commando-rune restrictions='[["id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605"],["method=listpeers"],["pnum=1"],["pnameid^024b9a1fa8e006f1e393", "parr0^024b9a1fa8e006f1e393"]' - { - "rune": "fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw==", - "unique_id": "3" - } - -Before we give this to our peer, let's add two more restrictions: that -it only be usable for 24 hours from now (`time<`), and that it can only -be used twice a minute (`rate=2`). `date +%s` can give us the current -time in seconds: - - $ lightning-cli commando-rune rune=fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw== restrictions='[["time<'$(($(date +%s) + 24*60*60))'","rate=2"]]' - { - "rune": "tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y", - "unique_id": "3" - } - +```shell +$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions='[["method^list", "method^get", "method=summary"],["method/listdatastore"]]' +{ + "rune": "NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", + "unique_id": "0" +} +``` +Let's create a rune which lets a specific peer (024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605) run "listpeers" on themselves: + +```shell +$ lightning-cli commando-rune restrictions='[["id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605"],["method=listpeers"],["pnum=1"],["pnameid=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605","parr0=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605"]]' +{ + "rune": "FE8GHiGVvxcFqCQcClVRRiNE_XEeLYQzyG2jmqto4jM9MiZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDV8cGFycjA9MDI0YjlhMWZhOGUwMDZmMWUzOTM3ZjY1ZjY2YzQwOGU2ZGE4ZTFjYTcyOGVhNDMyMjJhNzM4MWRmMWNjNDQ5NjA1", + "unique_id": "2" +} +``` +This allows `listpeers` with 1 argument (`pnum=1`), which is either by name (`pnameid`), or position (`parr0`). We could shorten this in several ways: either allowing only positional or named parameters, or by testing the start of the parameters only. Here's an example which only checks the first 9 bytes of the `listpeers` parameter: + +```shell +$ lightning-cli commando-rune restrictions='[["id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605"],["method=listpeers"],["pnum=1"],["pnameid^024b9a1fa8e006f1e393", "parr0^024b9a1fa8e006f1e393"]' + { + "rune": "fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw==", + "unique_id": "3" +} +``` +Before we give this to our peer, let's add two more restrictions: that it only be usable for 24 hours from now (`time<`), and that it can only be used twice a minute (`rate=2`). `date +%s` can give us the current time in seconds: + +```shell +$ lightning-cli commando-rune rune=fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw== restrictions='[["time<'$(($(date +%s) + 24*60*60))'","rate=2"]]' +{ + "rune": "tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y", + "unique_id": "3" +} +``` You can also use lightning-decode(7) to examine runes you have been given: - $ .lightning-cli decode tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y - { - "type": "rune", - "unique_id": "3", - "string": "b54f912e33220e9636534a375b5a05a306abdfa4451a95a5a0f6d6f7e46e65da:=3&id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605&method=listpeers&pnum=1&pnameid^024b9a1fa8e006f1e393|parr0^024b9a1fa8e006f1e393&time<1656920538&rate=2", - "restrictions": [ - { - "alternatives": [ - "id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605" - ], - "summary": "id (of commanding peer) equal to '024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605'" - }, - { - "alternatives": [ - "method=listpeers" - ], - "summary": "method (of command) equal to 'listpeers'" - }, - { - "alternatives": [ - "pnum=1" - ], - "summary": "pnum (number of command parameters) equal to 1" - }, - { - "alternatives": [ - "pnameid^024b9a1fa8e006f1e393", - "parr0^024b9a1fa8e006f1e393" - ], - "summary": "pnameid (object parameter 'id') starts with '024b9a1fa8e006f1e393' OR parr0 (array parameter #0) starts with '024b9a1fa8e006f1e393'" - }, - { - "alternatives": [ - "time<1656920538" - ], - "summary": "time (in seconds since 1970) less than 1656920538 (approximately 19 hours 18 minutes from now)" - }, - { - "alternatives": [ - "rate=2" - ], - "summary": "rate (max per minute) equal to 2" - } - ], - "valid": true - } - +```shell +$ lightning-cli decode tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y +{ + "type": "rune", + "unique_id": "3", + "string": "b54f912e33220e9636534a375b5a05a306abdfa4451a95a5a0f6d6f7e46e65da:=3&id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605&method=listpeers&pnum=1&pnameid^024b9a1fa8e006f1e393|parr0^024b9a1fa8e006f1e393&time<1656920538&rate=2", + "restrictions": [ + { + "alternatives": [ + "id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605" + ], + "summary": "id (of commanding peer) equal to '024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605'" + }, + { + "alternatives": [ + "method=listpeers" + ], + "summary": "method (of command) equal to 'listpeers'" + }, + { + "alternatives": [ + "pnum=1" + ], + "summary": "pnum (number of command parameters) equal to 1" + }, + { + "alternatives": [ + "pnameid^024b9a1fa8e006f1e393", + "parr0^024b9a1fa8e006f1e393" + ], + "summary": "pnameid (object parameter 'id') starts with '024b9a1fa8e006f1e393' OR parr0 (array parameter #0) starts with '024b9a1fa8e006f1e393'" + }, + { + "alternatives": [ + "time<1656920538" + ], + "summary": "time (in seconds since 1970) less than 1656920538 (approximately 19 hours 18 minutes from now)" + }, + { + "alternatives": [ + "rate=2" + ], + "summary": "rate (max per minute) equal to 2" + } + ], + "valid": true +} +``` + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:commando-rune#1", + "method": "commando-rune", + "params": "{}" +} +{ + "id": "example:commando-rune#2", + "method": "commando-rune", + "params": { + "restrictions": "readonly" + } +} +{ + "id": "example:commando-rune#3", + "method": "commando-rune", + "params": { + "restrictions": [ + [ + "id^022d223620a359a47ff7" + ], + [ + "method=listpeers" + ] + ] + } +} +{ + "id": "example:commando-rune#4", + "method": "commando-rune", + "params": { + "restrictions": [ + [ + "method=pay" + ], + [ + "pnameamountmsat<10000" + ] + ] + } +} +``` SHARING RUNES ------------- -Because anyone can add a restriction to a rune, you can always turn a -normal rune into a read-only rune, or restrict access for 30 minutes -from the time you give it to someone. Adding restrictions before -sharing runes is best practice. +Because anyone can add a restriction to a rune, you can always turn a normal rune into a read-only rune, or restrict access for 30 minutes from the time you give it to someone. Adding restrictions before sharing runes is best practice. -If a rune has a ratelimit, any derived rune will have the same id, and -thus will compete for that ratelimit. You might want to consider -adding a tighter ratelimit to a rune before sharing it, so you will -keep the remainder. For example, if you rune has a limit of 60 times -per minute, adding a limit of 5 times per minute and handing that rune -out means you can still use your original rune 55 times per minute. +If a rune has a ratelimit, any derived rune will have the same id, and thus will compete for that ratelimit. You might want to consider adding a tighter ratelimit to a rune before sharing it, so you will keep the remainder. For example, if you rune has a limit of 60 times per minute, adding a limit of 5 times per minute and handing that rune out means you can still use your original rune 55 times per minute. RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **rune** (string): the resulting rune -- **unique\_id** (string): the id of this rune: this is set at creation and cannot be changed (even as restrictions are added) +- **rune** (string): The resulting rune. +- **unique\_id** (string): The id of this rune: this is set at creation and cannot be changed (even as restrictions are added). The following warnings may also be returned: -- **warning\_unrestricted\_rune**: A warning shown when runes are created with powers that could drain your node - -[comment]: # (GENERATE-FROM-SCHEMA-END) +- **warning\_unrestricted\_rune**: A warning shown when runes are created with powers that could drain your node. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==", + "unique_id": "0", + "warning_unrestricted_rune": "WARNING: This rune has no restrictions! Anyone who has access to this rune could drain funds from your node. Be careful when giving this to apps that you don't trust. Consider using the restrictions parameter to only allow access to specific rpc methods." +} +{ + "rune": "zm0x_eLgHexaTvZn3Cz7gb_YlvrlYGDo_w4BYlR9SS09MSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", + "unique_id": "1" +} +{ + "rune": "YPojv9qgHPa3im0eiqRb-g8aRq76OasyfltGGqdFUOU9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJz", + "unique_id": "2" +} +{ + "rune": "b3hXuEM7Pqzk-C7HUw83xzvHOV7fmuGaWjdo-wHdfg89MCZtZXRob2Q9cGF5JnBuYW1lYW1vdW50bXNhdDwxMDAwMA==", + "unique_id": "3" +} +``` AUTHOR ------ -Rusty Russell <> wrote the original Python -commando.py plugin, the in-tree commando plugin, and this manual page. +Rusty Russell <> wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page. -Christian Decker came up with the name "commando", which almost -excuses his previous adoption of the name "Eltoo". +Christian Decker came up with the name "commando", which almost excuses his previous adoption of the name "Eltoo". SEE ALSO -------- @@ -217,5 +267,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:b211db22d5bb348471b259839c4fd15f72bf5d2056d1dc857f5e2db4a7268e14) diff --git a/doc/lightning-commando.7.md b/doc/lightning-commando.7.md index 97a90990b69a..a4735f1e6424 100644 --- a/doc/lightning-commando.7.md +++ b/doc/lightning-commando.7.md @@ -4,22 +4,131 @@ lightning-commando -- Command to Send a Command to a Remote Peer SYNOPSIS -------- -**commando** *peer\_id* *method* [*params*] [*rune*] +**commando** *peer\_id* *method* [*params*] [*rune*] [*filter*] DESCRIPTION ----------- -The **commando** RPC command is a homage to bad 80s movies. It also -sends a directly-connected *peer\_id* a custom message, containing a -request to run *method* (with an optional dictionary of *params*); -generally the peer will only allow you to run a command if it has -provided you with a *rune* which allows it. +The **commando** RPC command is a homage to bad 80s movies. It also sends a directly-connected *peer\_id* a custom message, containing a request to run *method* (with an optional dictionary of *params*); generally the peer will only allow you to run a command if it has provided you with a *rune* which allows it. + +- **peer\_id** (pubkey): Peer to command. +- **method** (string): Method to invoke on peer. +- **params** (one of, optional): + - (array): Array of positional parameters. + - (object): Parameters for method.: +- **rune** (string, optional): Rune to authorize the command. +- **filter** (object, optional): Filter to peer to apply to any successful result.: + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:commando#1", + "method": "commando", + "params": { + "peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "rune": "zm0x_eLgHexaTvZn3Cz7gb_YlvrlYGDo_w4BYlR9SS09MSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", + "method": "getinfo", + "params": {} + } +} +{ + "id": "example:commando#2", + "method": "commando", + "params": { + "peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "rune": "m_tyR0qqHUuLEbFJW6AhmBg-9npxVX2yKocQBFi9cvY9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJzJnBuYW1lbGV2ZWwhfHBuYW1lbGV2ZWwvaW8mcGFycjEhfHBhcnIxL2lv", + "method": "listpeers", + "params": [ + "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "broken" + ] + } +} +{ + "id": "example:commando#3", + "method": "commando", + "params": { + "peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "rune": "b3hXuEM7Pqzk-C7HUw83xzvHOV7fmuGaWjdo-wHdfg89MCZtZXRob2Q9cGF5JnBuYW1lYW1vdW50bXNhdDwxMDAwMA==", + "method": "pay", + "params": { + "bolt11": "lnbcrt1pja05v6sp5n6gnm380ckkrnhzvytz0hvym0vcf0mlrk586nlp72cq7e2hhhffspp5cwhuvl4jhlqep3st2703z89jp7j6wucm8ytlj7rk9ckk0mv7whysdq5v3jhxcmjd9c8g6t0dceqxqyjw5qcqp99qxpqysgq40udwjtktkry0yyq9408q5vtmj534h88j5nn562lamam0rtfqfu3093t2dhhc63qnqe5maa5jc9ad5pm08q2k2udvp6skw9f6ez9c9qptatlau", + "amount_msat": 9999 + } + } +} +``` RETURN VALUE ------------ On success, the return depends on the *method* invoked. +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "alias": "JUNIORBEAM-v23.11-415-gd120eba", + "color": "0266e4", + "num_peers": 1, + "num_pending_channels": 0, + "num_active_channels": 0, + "num_inactive_channels": 0, + "address": [], + "binding": [ + { + "type": "ipv4", + "address": "127.0.0.1", + "port": 42513 + } + ], + "version": "v23.11-415-gd120eba", + "blockheight": 101, + "network": "regtest", + "fees_collected_msat": 0, + "lightning-dir": "/tmp/ltests-7u_8_rtu/test_commando_rune_1/lightning-1/regtest", + "our_features": { + "init": "08a0000a8a5961", + "node": "88a0000a8a5961", + "channel": "", + "invoice": "02000002024100" + } +} +{ + "peers": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "connected": true, + "num_channels": 0, + "netaddr": [ + "127.0.0.1:40119" + ], + "features": "08a0000a8a5961", + "log": [ + { + "type": "SKIPPED", + "num_skipped": 30 + } + ] + } + ] +} +{ + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "payment_hash": "c3afc67eb2bfc190c60b579f111cb20fa5a7731b3917f978762e2d67ed9e75c9", + "created_at": 1708642714.8110592, + "parts": 1, + "amount_msat": 9999, + "amount_sent_msat": 9999, + "payment_preimage": "17632717785b1a833a296ba1831cb968602872e68881c2f324e06e87979296dc", + "status": "complete" +} +``` + ERRORS ------ @@ -30,17 +139,14 @@ On failure, one of the following error codes may be returned: - 19536: the remote commando plugin discovered an error. - 19537: the remote commando plugin said we weren't authorized. -It can also fail if the peer does not respond, in which case it will simply -hang awaiting a response. +It can also fail if the peer does not respond, in which case it will simply hang awaiting a response. AUTHOR ------ -Rusty Russell <> wrote the original Python -commando.py plugin, the in-tree commando plugin, and this manual page. +Rusty Russell <> wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page. -Christian Decker came up with the name "commando", which almost -excuses his previous adoption of the name "Eltoo". +Christian Decker came up with the name "commando", which almost excuses his previous adoption of the name "Eltoo". SEE ALSO -------- @@ -51,5 +157,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:6f4406cae30cab813b3bf4e1242af914276716a057e558474e29340665ee8c2f) diff --git a/doc/lightning-connect.7.md b/doc/lightning-connect.7.md index bc643305769a..ff4613b9f203 100644 --- a/doc/lightning-connect.7.md +++ b/doc/lightning-connect.7.md @@ -4,80 +4,114 @@ lightning-connect -- Command for connecting to another lightning node SYNOPSIS -------- -**connect** *id* [*host*] [*port*] +**connect** *id* [*host*] [*port*] DESCRIPTION ----------- -The **connect** RPC command establishes a new connection with another -node in the Lightning Network. - -Connecting to a node is just the first step in opening a channel with -another node. Once the peer is connected a channel can be opened with -lightning-fundchannel(7). - -If there are active channels with the peer, **connect** returns once -all the subdaemons are in place to handle the channels, not just once -it's connected. +The **connect** RPC command establishes a new connection with another node in the Lightning Network. + +Connecting to a node is just the first step in opening a channel with another node. Once the peer is connected a channel can be opened with lightning-fundchannel(7). + +If there are active channels with the peer, **connect** returns once all the subdaemons are in place to handle the channels, not just once it's connected. + +- **id** (string): The target node's public key. As a convenience, *id* may be of the form *id@host* or *id@host:port*. In this case, the *host* and *port* parameters must be omitted. This can fail if your C-lightning node is a fresh install that has not connected to any peers yet (your node has no gossip yet), or if the target *id* is a fresh install that has no channels yet (nobody will gossip about a node until it has one published channel). +- **host** (string, optional): The peer's hostname or IP address. If *host* is not specified (or doesn't work), the connection will be attempted to an IP belonging to *id* obtained through gossip with other already connected peers. If *host* begins with a `/` it is interpreted as a local path and the connection will be made to that local socket (see **bind-addr** in lightningd-config(5)). +- **port** (u16, optional): The peer's port number. If not specified, the *port* depends on the current network: + * bitcoin **mainnet**: 9735. + * bitcoin **testnet**: 19735. + * bitcoin **signet**: 39735. + * bitcoin **regtest**: 19846. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:connect#1", + "method": "connect", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "host": "localhost", + "port": 44619 + } +} +{ + "id": "example:connect#2", + "method": "connect", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "host": "127.0.0.1", + "port": 42839 + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **id** (pubkey): the peer we connected to -- **features** (hex): BOLT 9 features bitmap offered by peer -- **direction** (string): Whether they initiated connection or we did (one of "in", "out") -- **address** (object): Address information (mainly useful if **direction** is *out*): - - **type** (string): Type of connection (*torv2*/*torv3* only if **direction** is *out*) (one of "local socket", "ipv4", "ipv6", "torv2", "torv3") +- **id** (pubkey): The peer we connected to. +- **features** (hex): BOLT 9 features bitmap offered by peer. +- **direction** (string) (one of "in", "out"): Whether they initiated connection or we did. +- **address** (object): Address information (mainly useful if **direction** is *out*).: + - **type** (string) (one of "local socket", "ipv4", "ipv6", "torv2", "torv3"): Type of connection (*torv2*/*torv3* only if **direction** is *out*). If **type** is "local socket": - - - **socket** (string): socket filename + - **socket** (string): Socket filename. If **type** is "ipv4", "ipv6", "torv2" or "torv3": - - - **address** (string): address in expected format for **type** - - **port** (u16): port number - -[comment]: # (GENERATE-FROM-SCHEMA-END) + - **address** (string): Address in expected format for **type**. + - **port** (u16): Port number. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "features": "08a0000a0a69a2", + "direction": "out", + "address": { + "type": "ipv4", + "address": "127.0.0.1", + "port": 44619 + } +} +{ + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "features": "08a0000a8a5961", + "direction": "out", + "address": { + "type": "ipv4", + "address": "127.0.0.1", + "port": 42839 + } +} +``` ERRORS ------ On failure, one of the following errors will be returned: - { "code" : 400, "message" : "Unable to connect, no address known for peer" } - -If some addresses are known but connecting to all of them failed, the message -will contain details about the failures: - - { "code" : 401, "message" : "..." } - -If the peer disconnected while we were connecting: - - { "code" : 402, "message" : "..." } - -If the given parameters are wrong: - - { "code" : -32602, "message" : "..." } +- 400: Unable to connect, no address known for peer +- 401: If some addresses are known but connecting to all of them failed, the message will contain details about the failures +- 402: If the peer disconnected while we were connecting +- -32602: If the given parameters are wrong AUTHOR ------ -Rusty Russell <> is mainly responsible. -Felix <> is the original author of this manpage. +Rusty Russell <> is mainly responsible. Felix <> is the original author of this manpage. SEE ALSO -------- -lightning-fundchannel(7), lightning-listpeers(7), -lightning-listchannels(7), lightning-disconnect(7) +lightning-fundchannel(7), lightning-listpeers(7), lightning-listchannels(7), lightning-disconnect(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:fc79236aaca9d4c46a85e73c7f3e5fae92436a86f26e48f6bc53b870e954d769) diff --git a/doc/lightning-createinvoice.7.md b/doc/lightning-createinvoice.7.md index 7b3f2bd37f53..2b80ccae88e9 100644 --- a/doc/lightning-createinvoice.7.md +++ b/doc/lightning-createinvoice.7.md @@ -4,50 +4,48 @@ lightning-createinvoice -- Low-level invoice creation SYNOPSIS -------- -**createinvoice** *invstring* *label* *preimage* +**createinvoice** *invstring* *label* *preimage* DESCRIPTION ----------- -The **createinvoice** RPC command signs and saves an invoice into the -database. +The **createinvoice** RPC command signs and saves an invoice into the database. + +- **invstring** (string): The bolt11 form, but the final signature is ignored. Minimal sanity checks are done. (Note: if **experimental-offers** is enabled, *invstring* can actually be an unsigned bolt12 invoice). +- **label** (one of): A unique string or number (which is treated as a string, so `01` is different from `1`); it is never revealed to other nodes on the lightning network, but it can be used to query the status of this invoice.: + - (string) + - (integer) +- **preimage** (hex): The preimage to supply upon successful payment of the invoice. RETURN VALUE ------------ (Note: the return format is the same as lightning-listinvoices(7)). - -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **label** (string): the label for the invoice -- **payment\_hash** (hash): the hash of the *payment\_preimage* which will prove payment -- **status** (string): Whether it has been paid, or can no longer be paid (one of "paid", "expired", "unpaid") -- **description** (string): Description extracted from **bolt11** or **bolt12** -- **expires\_at** (u64): UNIX timestamp of when invoice expires (or expired) -- **created\_index** (u64): 1-based index indicating order this invoice was created in *(added v23.08)* -- **bolt11** (string, optional): the bolt11 string (always present unless **bolt12** is) -- **bolt12** (string, optional): the bolt12 string instead of **bolt11** (**experimental-offers** only) -- **amount\_msat** (msat, optional): The amount of the invoice (if it has one) -- **pay\_index** (u64, optional): Incrementing id for when this was paid (**status** *paid* only) -- **amount\_received\_msat** (msat, optional): Amount actually received (**status** *paid* only) -- **paid\_at** (u64, optional): UNIX timestamp of when invoice was paid (**status** *paid* only) -- **paid\_outpoint** (object, optional): Outpoint this invoice was paid with (**status** *paid* only) *(added v23.11)*: - - **txid** (txid): ID of the transaction that paid the invoice (**status** *paid* only) *(added v23.11)* - - **outnum** (u32): The 0-based output number of the transaction that paid the invoice (**status** *paid* only) *(added v23.11)* -- **payment\_preimage** (secret, optional): the proof of payment: SHA256 of this **payment\_hash** -- **local\_offer\_id** (hex, optional): the *id* of our offer which created this invoice (**experimental-offers** only). (always 64 characters) -- **invreq\_payer\_note** (string, optional): the optional *invreq\_payer\_note* from invoice\_request which created this invoice (**experimental-offers** only). - -[comment]: # (GENERATE-FROM-SCHEMA-END) +- **label** (string): The label for the invoice. +- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. +- **status** (string) (one of "paid", "expired", "unpaid"): Whether it has been paid, or can no longer be paid. +- **description** (string): Description extracted from **bolt11** or **bolt12**. +- **expires\_at** (u64): UNIX timestamp of when invoice expires (or expired). +- **created\_index** (u64): 1-based index indicating order this invoice was created in. *(added v23.08)* +- **bolt11** (string, optional): The bolt11 string (always present unless **bolt12** is). +- **bolt12** (string, optional): The bolt12 string instead of **bolt11** (**experimental-offers** only). +- **amount\_msat** (msat, optional): The amount of the invoice (if it has one). +- **pay\_index** (u64, optional): Incrementing id for when this was paid (**status** *paid* only). +- **amount\_received\_msat** (msat, optional): Amount actually received (**status** *paid* only). +- **paid\_at** (u64, optional): UNIX timestamp of when invoice was paid (**status** *paid* only). +- **paid\_outpoint** (object, optional): Outpoint this invoice was paid with (**status** *paid* only). *(added v23.11)*: + - **txid** (txid): ID of the transaction that paid the invoice (**status** *paid* only). *(added v23.11)* + - **outnum** (u32): The 0-based output number of the transaction that paid the invoice (**status** *paid* only). *(added v23.11)* +- **payment\_preimage** (secret, optional): The proof of payment: SHA256 of this **payment\_hash**. +- **local\_offer\_id** (hex, optional) (always 64 characters): The *id* of our offer which created this invoice (**experimental-offers** only). +- **invreq\_payer\_note** (string, optional): The optional *invreq\_payer\_note* from invoice\_request which created this invoice (**experimental-offers** only). ERRORS ------ -On failure, an error is returned and no invoice is created. If the -lightning process fails before responding, the caller should use -lightning-listinvoices(7) to query whether this invoice was created or -not. +On failure, an error is returned and no invoice is created. If the lightning process fails before responding, the caller should use lightning-listinvoices(7) to query whether this invoice was created or not. The following error codes may occur: @@ -62,12 +60,9 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-invoice(7), lightning-listinvoices(7), lightning-delinvoice(7), -lightning-getroute(7), lightning-sendpay(7), lightning-offer(7). +lightning-invoice(7), lightning-listinvoices(7), lightning-delinvoice(7), lightning-getroute(7), lightning-sendpay(7), lightning-offer(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:ad1c985a529da5c845c1d6d348556e61531a6ec75e9a47dc91e9a276008d3ffa) diff --git a/doc/lightning-createonion.7.md b/doc/lightning-createonion.7.md index aab8692572e3..7ed75a9dea5c 100644 --- a/doc/lightning-createonion.7.md +++ b/doc/lightning-createonion.7.md @@ -4,15 +4,19 @@ lightning-createonion -- Low-level command to create a custom onion SYNOPSIS -------- -**createonion** *hops* *assocdata* [*session\_key*] [*onion\_size*] +**createonion** *hops* *assocdata* [*session\_key*] [*onion\_size*] DESCRIPTION ----------- -The **createonion** RPC command allows the caller to create a custom onion -with custom payloads at each hop in the route. A custom onion can be used to -implement protocol extensions that are not supported by Core Lightning directly. +The **createonion** RPC command allows the caller to create a custom onion with custom payloads at each hop in the route. A custom onion can be used to implement protocol extensions that are not supported by Core Lightning directly. +- **hops** (array of objects): A JSON list of dicts, each specifying a node and the payload destined for that node.: + - **pubkey** (pubkey): Node pubkey. + - **payload** (hex): Payload to be sent to the node. +- **assocdata** (hex): The associated data that the onion should commit to. If the onion is to be used to send a payment later it MUST match the `payment_hash` of the payment in order to be valid. +- **session\_key** (secret, optional): Can be used to specify a secret that is used to generate the shared secrets used to encrypt the onion for each hop. It should only be used for testing or if a specific shared secret is important. If not specified it will be securely generated internally, and the shared secrets will be returned. +- **onion\_size** (u16, optional): A size different from the default payment onion (1300 bytes). May be used for custom protocols like trampoline routing. EXAMPLE USAGE ------------- @@ -21,90 +25,149 @@ The following is an example of a 3 hop onion: ```json [ - { - "pubkey": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "payload": "11020203e904017b06080000670000010001" - }, { - "pubkey": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "payload": "11020203e804017506080000670000030001" - }, { - "pubkey": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", - "payload": "07020203e8040175" - } + { + "pubkey": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "payload": "11020203e904017b06080000670000010001" + }, { + "pubkey": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "payload": "11020203e804017506080000670000030001" + }, { + "pubkey": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", + "payload": "07020203e8040175" + } ] ``` -The *hops* parameter is very similar to the result from `getroute` however it -needs to be modified slightly. The following is the `getroute` response from -which the above *hops* parameter was generated: +The *hops* parameter is very similar to the result from `getroute` however it needs to be modified slightly. The following is the `getroute` response from which the above *hops* parameter was generated: ```json [ - { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "channel": "103x2x1", - "direction": 1, - "msatoshi": 1002, - "amount_msat": "1002msat", - "delay": 21, - }, { - "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "channel": "103x1x1", - "direction": 0, - "msatoshi": 1001, - "amount_msat": "1001msat", - "delay": 15, - }, { - "id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", - "channel": "103x3x1", - "direction": 0, - "msatoshi": 1000, - "amount_msat": "1000msat", - "delay": 9, - } + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "channel": "103x2x1", + "direction": 1, + "msatoshi": 1002, + "amount_msat": "1002msat", + "delay": 21, + }, { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "channel": "103x1x1", + "direction": 0, + "msatoshi": 1001, + "amount_msat": "1001msat", + "delay": 15, + }, { + "id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", + "channel": "103x3x1", + "direction": 0, + "msatoshi": 1000, + "amount_msat": "1000msat", + "delay": 9, + } ] ``` - - Notice that the payload in the *hops* parameter is the hex-encoded TLV - of the parameters in the `getroute` response, with length prepended as a `bigsize_t`. - - Except for the pubkey, the values are shifted left by one, i.e., the 1st - payload in `createonion` corresponds to the 2nd set of values from `getroute`. + - Notice that the payload in the *hops* parameter is the hex-encoded TLV of the parameters in the `getroute` response, with length prepended as a `bigsize_t`. + - Except for the pubkey, the values are shifted left by one, i.e., the 1st payload in `createonion` corresponds to the 2nd set of values from `getroute`. - The final payload is a copy of the last payload sans `channel` These rules are directly derived from the onion construction. Please refer BOLT 04 for details and rationale. +The following example is the result of calling *createonion* with the above hops parameter: + + ```json + { + "onion": "0003f3f80d2142b953319336d2fe4097[...]6af33fcf4fb113bce01f56dd62248a9e5fcbbfba35c", + "shared_secrets": [ + "88ce98c73e4d9293ab1797b0a913fe9bca0213a566252047d01b8af6da871f3e", + "4474d296810e57bd460ef8b83d2e7d288321f8a99ff7686f87384699747bcfc4", + "2a862e4123e01799a732be487fbce297f7dc7cc1467e410f18369cfee476adc2" + ] + } +``` + +The `onion` corresponds to 1366 hex-encoded bytes. Each shared secret consists of 32 hex-encoded bytes. Both arguments can be passed on to **sendonion**. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:createonion#1", + "method": "createonion", + "params": { + "hops": [ + { + "pubkey": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "payload": "e4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "pubkey": "0324653eac434488002cc06bbfb7f10fe18991e35f9fe4302dbea6d2353dc0ab1c", + "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "pubkey": "027f31ebc5462c1fdce1b737ecff52d37d75dea43ce11c74d25aa297165faa2007", + "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "pubkey": "032c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991", + "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "pubkey": "02edabbd16b41c8371b92ef2f04c1185b4f03b6dcd52ba9b78d9d7c89c8f221145", + "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + ], + "assocdata": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", + "onion_size": 1301 + } +} +{ + "id": "example:createonion#2", + "method": "createonion", + "params": { + "hops": [ + { + "pubkey": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "payload": "0cfdb000084869207468657265" + } + ], + "assocdata": "36bf44cc8d80498b95eb05e36ae5811206d3a1d8b5c8d59bbcad035d386a4de8" + } +} +``` + RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **onion** (hex): the onion packet (*onion\_size* bytes) -- **shared\_secrets** (array of secrets): one shared secret for each node in the *hops* parameter: - - the shared secret with this hop - -[comment]: # (GENERATE-FROM-SCHEMA-END) +- **onion** (hex): The onion packet (*onion\_size* bytes). +- **shared\_secrets** (array of secrets): One shared secret for each node in the *hops* parameter.: + - (secret, optional): The shared secret with this hop. EXAMPLE JSON RESPONSE --------------------- -The following example is the result of calling *createonion* with the -above hops parameter: - ```json { - "onion": "0003f3f80d2142b953319336d2fe4097[...]6af33fcf4fb113bce01f56dd62248a9e5fcbbfba35c", - "shared_secrets": [ - "88ce98c73e4d9293ab1797b0a913fe9bca0213a566252047d01b8af6da871f3e", - "4474d296810e57bd460ef8b83d2e7d288321f8a99ff7686f87384699747bcfc4", - "2a862e4123e01799a732be487fbce297f7dc7cc1467e410f18369cfee476adc2" - ] + "onion": "00034c3f9e11d92555260db3ee4ba0378a645d01c2556451f4289a1d9b43c7afa9a4f9ecc7010dafb26787bb583c514c3b3990d40c8168b1046659d7bc2512d2f1ee0afd2b87c42de2b70102b649634d211b38049593dbb6ed8ee8f93f0b9ff23cd9654c1341137711ce67751d40867cc90c290a9446be2b8a5a43641d4549505b13e807b4240b5b82ffaf22cb534cff01be46db3985ac83b7db465fbd86d4c8d472f60678946c71eca97dd5db732fe5a6d3765e5a5afad72f035207173e7eaaa0da4f0a4540472c7dd269a030428ae586a61b2a70a428055c3848427d2a2e8bd521aadbaf79d56ea39df63c059772e026d57f0b6844c1ab99e936beadf42aaa78193b05f7380e242258deeaa90db316a943d311ef4f2a08f422422c9da454f9666742ad61c6ae003bce83cf6243adf64a728ea50bdaf129ab2ac70e1988a117609cbefc01c884f86b2494349d1067f5cf17760cdab6ae076631693147e8712412d4f0b17cf288b394fd9e29419156ee629966553c2e7598631cbf7493820388eef1ae9f4d2f9da88872e8afbbedb3b46cd7c461cbe4c5491dc6f4a68bc244584bc79b1bb227c869fae16dab4b16412523c984d3ed2b872f63b95a62f66563d2b03c3d1b5fff0290411b293569ce8435b96b447be776b49395a8d94f48cb2f7699a38e8de58d6fff04075d226dcac07668512b6d2c20d4c49d03ad300a52769e4ebbacf97378633126958df1817effc12fd679723123df244fd9b5421f8a2aedb9a8b6fb4049e3a7cae3985059081239bea38351f0c90ed5a0ff45cc492e6ab353e4c13d22ff48912d6ecfda711edfb88dc0767ecfc5dddf8fb0e112a538aeee55c0f73b3b8afc4f40ef3588eabde5b95344a4525adf67841dd67b1db10da180fb346e0bd2958f095d011827063c42361964f8ac2c356d2ec1868a9498dcd6b5915a4df4601c58fcbeb688e14de61300f13183c154b3320cc8e80042a46f22d796f56ff1fdd7e28440c05f14b960c1d0a7c627b09295112bcb635b0e2447a9374fafc4a23ceaf9de4d10b29b2f6cabd7f0c7706cf0404452681d7372d559b644627b2695960deb3b4ae57028e0164b29d5ef9e701d3122b6a5715c502e1dca5252e8c215ed754b01a193041ad9751ed2fff1b55991e256edd6099a38004a367ad097c7caf953da302201263715517f6d32cff57969be994df42fd6cadb649e3c738be798f779aaf4c07cada6bf1e4115b74e2670baf4b1592c70b10a6c043b6606b428b3f79545dc8e9783c876e5402909858f9c604963c37fbc477137c8908e6cfa11ece18c8784a6f25428a5ee1e91d0095fe310d6a91139a7c5c6624bbfcaa15ee847a25b06f57332917f68526a6317f575792e9bcba8576a96bc5859b1f2a00fd8ab08a5ac4ab71833b0b711d1f120cbdb374bcedcdcbeba3806644f5082ec737a945221f5d99562fcbb02a43beeafb16ceecd4e35f06a04c9ff9f4f33725ab62cf22c36650280e4cfb9e150a2c4ebee7785108522e8ecb4682d2d751168e7597299346c3a5e885e36eda66b9a1112997111135767972d771b02c1a36c1d1fb1ce539ecfb98e9e1d8f8fdbf89aec28ad34ff5c00c1a4a8c59848dc8b64c0e65f6f10122e60b4adc1cfc602f49d6cfbdd54be6b0951d3f9cafe8cdd0428f9ce6994844e92d8b72d44edda623bad428b398f88643c3904bda16dd15e886ca4ef6ea7f1450744ac38ffce902569d2e9026bcedd6d0ee54aceabda22bf2de72cba89e6c274064619e32a1192cf2d78b56cf497f7785a6d599de9f8383d1f66f47fc385dc569ee1f08ddbbc7f1aeb0a0126fc4020d948dda10255f11e776db7a037059a40fde38a2ee0c0ce49c7f3df175881bf12371fa72fec3fba657107892a97efe41dcc18aeecd99f3e46c33cf42c2a0ba8b75cf000", + "shared_secrets": [ + "ccf2512684e2508cb4a842393757e6040b7d25e29d3a2031f29d00a000af6128", + "d4cec39fe6287d41165bf5c608b0c720a411208a83c64c805a012c86662a2e5a", + "91bc712ebd4a900e05830394ca8b1f1168777ecdd6996029d96ec8838b9903b9", + "93c373dcb14dc36ababa3e0c5c55869a667ca175e09913a98c3be67e6af97e16", + "b2642a5770a6b61ade071fdf69d3ea365cf48434fc2a2c399512778821a33e5c" + ] +} +{ + "onion": "0002cdce4bfaa9faa2c060afafe001b80bde07fc670e882c063a80b4738d5f78c9351825c6461cdfcd4fe4144d3b51f63da6351b28dd49c7bfdb0b4f7d8bda4ad0d99699eda39e551084c0a095746c358d1dc6d2eec8082f2aa2f69ae8f61b1f1437ae0ed673078fec6c0510a34058167ad1a34e819a3813d4cf27b2c4917a8c6ca3d70c3381a2a41b4c1b4540adf0e922e25f57d1cfc3064f29cfec4c17244160121975cab59b44c83b4a4905bf7ebfbd308de376334bf86d8aa92c674f7bcfec85680d73e9fee72642c98c603128e358c86e0bc88a60aaebc2637441a57261c61c6be145f00f2fc56164a6495f4b52d3172cb0ef52e91fa0d32a9ae2502d17433bda58d93fbc24a70ec6b5e740952a61404c7370eafe52599c7ee52e77b1cda87c46da98d2ff0d02fe09db5adcb2d2e9bcd083ef58392907b8a21681fa4ea1e4806b4676656457fea000fa504f9b4d159fe8b241266ac91dcc0351053c6dcc1493a6b02bed652cc8b92a8470c98924ebfde6ddc5cf7fd75f6e83a7350642053b70d4834179c30eb56d8c86656cda784daf3b6cd125779bec51099301e3f79f78d85d0454aef8bf5f9058491881b73e99b662b64080cd3eb16fd7f9d9640c18738736cfc15f391232b7df92f46ceb5abf08732ff833e9409ee541d7c926f7a0fe3e233d3eee4a63b65ab23b7c835b7cdd809ddfac8abb1df471fa66a54092815aa41e6fc1a026b86c5675d39c4e8c5c4b4acd48534165239f5634b9e828a7f9df94efcd2a39045efdee4d2f006a63ae828e6e90e3610c522085da6e0198141d6e501d83aba32057f4e59f9b7dfb0bf949c5ef91917cb54561d45a9e7ead049c57deb62d14ba6e18f5d7b0fb9f15e97bf5bd9f909f99c86c787357946654b87c489d34245d07fbb72119166e338b608a4178b452695235dd96bf7fd338e29a9f054ec1a63a442e12602d2329834297f6a197d8a377d608f402f0bcc936f45f33c8d2f9d40e5aef41816dd883add81ca20f1e0631457fe00aa2bd75c9165ffcd96c100c1db83a53aeee23d59f2a542ee3ba39ba62298ddfbd9ecfafd6b5d2121eb003ee23a2ebb8c6b6b687f42492c962510c5acf5231ff96635eba37354559ba39b042d9b6883cac662f418d7c62f9908b2a67964af5e5471804f7684e0d582b8bfec99816bb3442cca1d1fe4efd75d573ebf09fa9cad811063864fb14be4a7768ec2ddb118a77969e986c6584c4b20f8622941ca73d73562857d36e17a46a68d6e10147aaefff1ffb9809f0652a5f760148ed33550661b63c8176d5679e701c221d8a49d4062eb04010ea74cc1132fbeb8934c6e582ba2a16162b7e9171f95bce4ec3e339e70c781f95aaca406cd718b74397658fdefdd093486664be7ed13efa437012f1f57f9f1f4fb4eef7501ccf0e0ac4edc01fde138038c4dd65cb5c3291ad02a6728d6761b1afa35d49bd6ef117012bdd9bd6ee8a175620feb2249aa18d6175351b4bfc2b2b4fd57ff52f5969b109aa9b6cb2cde8f350917c0da2da1bc3d52eb0c7e6080b8f69c5783f2ed26feceb05ba4e7ed66676041d03d0acd3dd6343a85ac0b9c36f9640ddd0db884822f98dc42ea7911a6938dc14ba19d3d25a2b2f82794a2b5dd751dc856d7a9ccdb2d351a0b84e7030fa925ac949a37594f3aa2ba28ae5155b0aaac9c6820b8888d0b8a9db148513b9e3dbde68333ac30a0720289b6a0145d88629d49e76a6d3538330c5aececc9d54127b0a5a0e92d5a5a73beb71132c208b589cab61d53ed357c907929198c559426ae729b374a803dd3321a45ccca39efd39eddaba6e79a2f8911bdf74e18733dc7efc51132b5608d97fd2d0f22fa8961de04cdf6d0dbfbab21e362e7abaef3976f993088aa97ed3f1f4bcf3fffb012f583558bd2f15face9cba20b3e6754b70", + "shared_secrets": [ + "3f53c03f98eb83db88ff97c2c4004051ce23265ed2414a7aebf7a3e7078839ab" + ] } ``` -The `onion` corresponds to 1366 hex-encoded bytes. Each shared secret consists -of 32 hex-encoded bytes. Both arguments can be passed on to **sendonion**. - AUTHOR ------ @@ -121,5 +184,3 @@ RESOURCES Main web site: [BOLT 04](https://github.com/lightning/bolts/blob/master/04-onion-routing.md) - -[comment]: # ( SHA256STAMP:faac7539bd94fe5e561350f36002895ad2f3d4539f8bb4688027b6a81ec6f70c) diff --git a/doc/lightning-createrune.7.md b/doc/lightning-createrune.7.md index e3ac6c3d8d62..bc3094e87063 100644 --- a/doc/lightning-createrune.7.md +++ b/doc/lightning-createrune.7.md @@ -1,54 +1,42 @@ lightning-createrune -- Command to Create/Update Rune for Authorizing Remote Peer Access -========================================================================================= +======================================================================================== SYNOPSIS -------- -**createrune** [*rune*] [*restrictions*] +**createrune** [*rune*] [*restrictions*] DESCRIPTION ----------- -The **createrune** RPC command creates a base64 string called a -*rune* which can be used to access commands on this node. Each *rune* -contains a unique id (a number starting at 0), and can have -restrictions inside it. Nobody can remove restrictions from a rune: if -you try, the rune will be rejected. There is no limit on how many -runes you can issue; the node simply decodes and checks them as they are -received. - -Oh, I almost forgot. Runes can also be invoked like in ancient times with -the **invokerune** command. Feel the magical powers of a rune by invoking it. - -If *rune* is supplied, the restrictions are simple appended to that -*rune* (it doesn't need to be a rune belonging to this node). If no -*rune* is supplied, a new one is constructed, with a new unique id. - -*restrictions* can be the string "readonly" (creates a rune which -allows most *get* and *list* commands, and the *summary* command), or -an array of restrictions. - -Each restriction is an array of one or more alternatives, such as "method -is listpeers", or "method is listpeers OR time is before 2023". Alternatives use a simple language to examine the command which is -being run: - -* time: the current UNIX time, e.g. "time<1656759180". -* id: the node\_id of the peer, e.g. "id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605". -* method: the command being run, e.g. "method=withdraw". -* per: how often the rune can be used, with suffix "sec" (default), "min", "hour", "day" or "msec", "usec" or "nsec". e.g. "per=5sec". -* rate: the rate limit, per minute, e.g. "rate=60" is equivalent to "per=1sec". -* pnum: the number of parameters. e.g. "pnum<2". -* pnameX: the parameter named X (with any punctuation like `_` removed). e.g. "pnamedestination=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T". -* parrN: the N'th parameter. e.g. "parr0=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T". +Command *added* in v23.08. + +The **createrune** RPC command creates a base64 string called a *rune* which can be used to access commands on this node. Each *rune* contains a unique id (a number starting at 0), and can have restrictions inside it. Nobody can remove restrictions from a rune: if you try, the rune will be rejected. There is no limit on how many runes you can issue; the node simply decodes and checks them as they are received. + +Oh, I almost forgot. Runes can also be invoked like in ancient times with the **invokerune** command. Feel the magical powers of a rune by invoking it. + +- **rune** (string, optional): If supplied, the restrictions are simple appended to that *rune* (it doesn't need to be a rune belonging to this node). If not supplied, a new *rune* is constructed, with a new unique id. +- **restrictions** (one of, optional): It can be the string `readonly`, or an array of restrictions. + Each restriction is an array of one or more alternatives, such as "method is listpeers", or "method is listpeers OR time is before 2023".: + - (array of arrays): Alternatives use a simple language to examine the command which is being run: + * time: the current UNIX time, e.g. "time<1656759180". + * id: the node\_id of the peer, e.g. "id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605". + * method: the command being run, e.g. "method=withdraw". + * per: how often the rune can be used, with suffix "sec" (default), "min", "hour", "day" or "msec", "usec" or "nsec". e.g. "per=5sec". + * rate: the rate limit, per minute, e.g. "rate=60" is equivalent to "per=1sec". + * pnum: the number of parameters. e.g. "pnum<2". + * pnameX: the parameter named X (with any punctuation like `_` removed). e.g. "pnamedestination=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T". + * parrN: the N'th parameter. e.g. "parr0=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T". + - (array of strings) + - (string, optional) + - (always "readonly"): A rune which allows most *get* and *list* commands, and the *summary* command. RESTRICTION FORMAT ------------------ -Restrictions are one or more alternatives. Each -alternative is *name* *operator* *value*. The valid names are shown -above. Note that if a value contains `\\`, it must be preceeded by another `\\` -to form valid JSON: +Restrictions are one or more alternatives. Each alternative is *name* *operator* *value*. The valid names are shown above. +Note that if a value contains `\`, it must be preceeded by another `\` to form valid JSON: * `=`: passes if equal ie. identical. e.g. `method=withdraw` * `/`: not equals, e.g. `method/withdraw` * `^`: starts with, e.g. `id^024b9a1fa8e006f1e3937f` @@ -56,31 +44,35 @@ to form valid JSON: * `~`: contains, e.g. `id~006f1e3937f65f66c40`. * `<`: is a decimal integer, and is less than. e.g. `time<1656759180` * `>`: is a decimal integer, and is greater than. e.g. `time>1656759180` -* `{`: preceeds in alphabetical order (or matches but is shorter), e.g. `id{02ff`. -* `}`: follows in alphabetical order (or matches but is longer), e.g. `id}02ff`. +* `{`: preceeds in alphabetical order (or matches but is shorter), + e.g. `id{02ff`. +* `}`: follows in alphabetical order (or matches but is longer), + e.g. `id}02ff`. * `#`: a comment, ignored, e.g. `dumb example#`. * `!`: only passes if the *name* does *not* exist. e.g. `pnamedestination!`. - Every other operator except `#` fails if *name* does not exist! +Every other operator except `#` fails if *name* does not exist! EXAMPLE USAGE ------------- This creates a fresh rune which can do anything: - $ lightning-cli createrune - { - "rune": "KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA==", - "unique_id": "0" - } - +```shell +$ lightning-cli commando-rune +{ + "rune": "KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA==", + "unique_id": "0" +} +``` We can add restrictions to that rune, like so: - $ lightning-cli createrune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions=readonly - { - "rune": "NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", - "unique_id": "0" - } - +```shell +$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions=readonly +{ + "rune": "NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", + "unique_id": "0" +} +``` The "readonly" restriction is a short-cut for two restrictions: 1. `["method^list", "method^get", "method=summary"]`: You may call list, get or summary. @@ -88,129 +80,170 @@ The "readonly" restriction is a short-cut for two restrictions: We can do the same manually, like so: - $ lightning-cli createrune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions='[["method^list", "method^get", "method=summary"],["method/listdatastore"]]' - { - "rune": "NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", - "unique_id": "0" - } - -Let's create a rune which lets a specific peer -(024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605) -run "listpeers" on themselves: - - $ lightning-cli createrune restrictions='[["id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605"],["method=listpeers"],["pnum=1"],["pnameid=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605","parr0=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605"]]' - { - "rune": "FE8GHiGVvxcFqCQcClVRRiNE_XEeLYQzyG2jmqto4jM9MiZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDV8cGFycjA9MDI0YjlhMWZhOGUwMDZmMWUzOTM3ZjY1ZjY2YzQwOGU2ZGE4ZTFjYTcyOGVhNDMyMjJhNzM4MWRmMWNjNDQ5NjA1", - "unique_id": "2" - } - -This allows `listpeers` with 1 argument (`pnum=1`), which is either by name (`pnameid`), or position (`parr0`). We could shorten this in several ways: either allowing only positional or named parameters, or by testing the start of the parameters only. Here's an example which only checks the first 9 bytes of the `listpeers` parameter: - - $ lightning-cli createrune restrictions='[["id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605"],["method=listpeers"],["pnum=1"],["pnameid^024b9a1fa8e006f1e393", "parr0^024b9a1fa8e006f1e393"]' - { - "rune": "fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw==", - "unique_id": "3" - } - -Before we give this to our peer, let's add two more restrictions: that -it only be usable for 24 hours from now (`time<`), and that it can only -be used twice a minute (`rate=2`). `date +%s` can give us the current -time in seconds: - - $ lightning-cli createrune rune=fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw== restrictions='[["time<'$(($(date +%s) + 24*60*60))'","rate=2"]]' - { - "rune": "tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y", - "unique_id": "3" - } - +```shell +$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions='[["method^list", "method^get", "method=summary"],["method/listdatastore"]]' +{ + "rune": "NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", + "unique_id": "0" +} +``` +Let's create a rune which lets a specific peer (024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605) run "listpeers" on themselves: + +```shell +$ lightning-cli commando-rune restrictions='[["id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605"],["method=listpeers"],["pnum=1"],["pnameid=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605","parr0=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605"]]' +{ + "rune": "FE8GHiGVvxcFqCQcClVRRiNE_XEeLYQzyG2jmqto4jM9MiZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDV8cGFycjA9MDI0YjlhMWZhOGUwMDZmMWUzOTM3ZjY1ZjY2YzQwOGU2ZGE4ZTFjYTcyOGVhNDMyMjJhNzM4MWRmMWNjNDQ5NjA1", + "unique_id": "2" +} +``` +This allows `listpeers` with 1 argument (`pnum=1`), which is either by name (`pnameid`), or position (`parr0`). We could shorten this in several ways: either allowing only positional or named parameters, or by testing the start of the parameters only. Here's an example which only checks the first 9 bytes of the `listpeers` parameter: + +```shell +$ lightning-cli commando-rune restrictions='[["id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605"],["method=listpeers"],["pnum=1"],["pnameid^024b9a1fa8e006f1e393", "parr0^024b9a1fa8e006f1e393"]' + { + "rune": "fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw==", + "unique_id": "3" +} +``` +Before we give this to our peer, let's add two more restrictions: that it only be usable for 24 hours from now (`time<`), and that it can only be used twice a minute (`rate=2`). `date +%s` can give us the current time in seconds: + +```shell +$ lightning-cli commando-rune rune=fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw== restrictions='[["time<'$(($(date +%s) + 24*60*60))'","rate=2"]]' +{ + "rune": "tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y", + "unique_id": "3" +} +``` You can also use lightning-decode(7) to examine runes you have been given: - $ .lightning-cli decode tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y - { - "type": "rune", - "unique_id": "3", - "string": "b54f912e33220e9636534a375b5a05a306abdfa4451a95a5a0f6d6f7e46e65da:=3&id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605&method=listpeers&pnum=1&pnameid^024b9a1fa8e006f1e393|parr0^024b9a1fa8e006f1e393&time<1656920538&rate=2", - "restrictions": [ - { - "alternatives": [ - "id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605" - ], - "summary": "id (of commanding peer) equal to '024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605'" - }, - { - "alternatives": [ - "method=listpeers" - ], - "summary": "method (of command) equal to 'listpeers'" - }, - { - "alternatives": [ - "pnum=1" - ], - "summary": "pnum (number of command parameters) equal to 1" - }, - { - "alternatives": [ - "pnameid^024b9a1fa8e006f1e393", - "parr0^024b9a1fa8e006f1e393" - ], - "summary": "pnameid (object parameter 'id') starts with '024b9a1fa8e006f1e393' OR parr0 (array parameter #0) starts with '024b9a1fa8e006f1e393'" - }, - { - "alternatives": [ - "time<1656920538" - ], - "summary": "time (in seconds since 1970) less than 1656920538 (approximately 19 hours 18 minutes from now)" - }, - { - "alternatives": [ - "rate=2" - ], - "summary": "rate (max per minute) equal to 2" - } - ], - "valid": true - } - +```shell +$ lightning-cli decode tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y +{ + "type": "rune", + "unique_id": "3", + "string": "b54f912e33220e9636534a375b5a05a306abdfa4451a95a5a0f6d6f7e46e65da:=3&id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605&method=listpeers&pnum=1&pnameid^024b9a1fa8e006f1e393|parr0^024b9a1fa8e006f1e393&time<1656920538&rate=2", + "restrictions": [ + { + "alternatives": [ + "id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605" + ], + "summary": "id (of commanding peer) equal to '024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605'" + }, + { + "alternatives": [ + "method=listpeers" + ], + "summary": "method (of command) equal to 'listpeers'" + }, + { + "alternatives": [ + "pnum=1" + ], + "summary": "pnum (number of command parameters) equal to 1" + }, + { + "alternatives": [ + "pnameid^024b9a1fa8e006f1e393", + "parr0^024b9a1fa8e006f1e393" + ], + "summary": "pnameid (object parameter 'id') starts with '024b9a1fa8e006f1e393' OR parr0 (array parameter #0) starts with '024b9a1fa8e006f1e393'" + }, + { + "alternatives": [ + "time<1656920538" + ], + "summary": "time (in seconds since 1970) less than 1656920538 (approximately 19 hours 18 minutes from now)" + }, + { + "alternatives": [ + "rate=2" + ], + "summary": "rate (max per minute) equal to 2" + } + ], + "valid": true +} +``` + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:createrune#1", + "method": "createrune", + "params": { + "restrictions": [ + [ + "method/getinfo" + ] + ] + } +} +{ + "id": "example:createrune#2", + "method": "createrune", + "params": { + "restrictions": "readonly" + } +} +{ + "id": "example:createrune#3", + "method": "createrune", + "params": [ + "enX0sTpHB8y1ktyTAF80CnEvGetG340Ne3AGItudBS49NCZwbnVtPTA=", + [ + [ + "rate=3" + ] + ] + ] +} +``` SHARING RUNES ------------- -Because anyone can add a restriction to a rune, you can always turn a -normal rune into a read-only rune, or restrict access for 30 minutes -from the time you give it to someone. Adding restrictions before -sharing runes is best practice. +Because anyone can add a restriction to a rune, you can always turn a normal rune into a read-only rune, or restrict access for 30 minutes from the time you give it to someone. Adding restrictions before sharing runes is best practice. -If a rune has a ratelimit, any derived rune will have the same id, and -thus will compete for that ratelimit. You might want to consider -adding a tighter ratelimit to a rune before sharing it, so you will -keep the remainder. For example, if you rune has a limit of 60 times -per minute, adding a limit of 5 times per minute and handing that rune -out means you can still use your original rune 55 times per minute. +If a rune has a ratelimit, any derived rune will have the same id, and thus will compete for that ratelimit. You might want to consider adding a tighter ratelimit to a rune before sharing it, so you will keep the remainder. For example, if you rune has a limit of 60 times per minute, adding a limit of 5 times per minute and handing that rune out means you can still use your original rune 55 times per minute. RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **rune** (string): the resulting rune -- **unique\_id** (string): the id of this rune: this is set at creation and cannot be changed (even as restrictions are added) +- **rune** (string): The resulting rune. +- **unique\_id** (string): The id of this rune: this is set at creation and cannot be changed (even as restrictions are added). The following warnings may also be returned: -- **warning\_unrestricted\_rune**: A warning shown when runes are created with powers that could drain your node - -[comment]: # (GENERATE-FROM-SCHEMA-END) +- **warning\_unrestricted\_rune**: A warning shown when runes are created with powers that could drain your node. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "rune": "S5f-BKt3rR-cvJmujdpDCUQm_XLahfB4iQuDlwqMJiQ9MCZtZXRob2QvZ2V0aW5mbw==", + "unique_id": "0" +} +{ + "rune": "oVkzoiQ67VCU1h_aRjPqCeWktGX54ARDsqqQgDL-uMs9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", + "unique_id": "1" +} +{ + "rune": "_h2eKjoK7ITAF-JQ1S5oum9oMQesrz-t1FR9kDChRB49NCZwbnVtPTAmcmF0ZT0z", + "unique_id": "2" +} +``` AUTHOR ------ -Rusty Russell <> wrote the original Python -commando.py plugin, the in-tree commando plugin, and this manual page. +Rusty Russell <> wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page. -Shahana Farooqui <> is mainly responsible -for migrating commando-rune to createrune. +Shahana Farooqui <> is mainly responsible for migrating commando-rune to createrune. SEE ALSO -------- @@ -221,5 +254,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:b211db22d5bb348471b259839c4fd15f72bf5d2056d1dc857f5e2db4a7268e14) diff --git a/doc/lightning-datastore.7.md b/doc/lightning-datastore.7.md index 9e7131e1a816..c9aef86f44d9 100644 --- a/doc/lightning-datastore.7.md +++ b/doc/lightning-datastore.7.md @@ -4,27 +4,120 @@ lightning-datastore -- Command for storing (plugin) data SYNOPSIS -------- -**datastore** *key* [*string*] [*hex*] [*mode*] [*generation*] +**datastore** *key* [*string*] [*hex*] [*mode*] [*generation*] DESCRIPTION ----------- -The **datastore** RPC command allows plugins to store data in the -Core Lightning database, for later retrieval. +The **datastore** RPC command allows plugins to store data in the Core Lightning database, for later retrieval. + +- **key** (one of): A key can either have children or a value, never both: parents are created and removed automatically.: + - (array of strings): An array of values to form a hierarchy (though a single value is treated as a one-element array). Using the first element of the key as the plugin name (e.g. `[ 'summary' ]`) is recommended. + - (string, optional) + - (string) +- **string** (string, optional): Data to be saved in string format. +- **hex** (hex, optional): Data to be saved in hex format. +- **mode** (string, optional) (one of "must-create", "must-replace", "create-or-replace", "must-append", "create-or-append"): Write mode to determine how the record is updated: + * `must-create`: fails if it already exists. + * `must-replace`: fails if it doesn't already exist. + * `create-or-replace`: never fails. + * `must-append`: must already exist, append this to what's already there. + * `create-or-append`: append if anything is there, otherwise create. The default is `must-create`. +- **generation** (u64, optional): If specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with *mode* `must-replace` or `must-append`. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:datastore#1", + "method": "datastore", + "params": { + "key": [ + "test_libplugin", + "name" + ], + "string": "foobar", + "hex": null, + "mode": "must-replace", + "generation": null + } +} +{ + "id": "example:datastore#2", + "method": "datastore", + "params": { + "key": "somekey", + "string": null, + "hex": "61", + "mode": "create-or-append", + "generation": null + } +} +{ + "id": "example:datastore#3", + "method": "datastore", + "params": { + "key": [ + "a", + "d", + "e", + "f", + "g" + ], + "string": "somedatatostoreinthedatastore", + "hex": null, + "mode": null, + "generation": null + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: - **key** (array of strings): - - Part of the key added to the datastore -- **generation** (u64, optional): The number of times this has been updated -- **hex** (hex, optional): The hex data which has been added to the datastore -- **string** (string, optional): The data as a string, if it's valid utf-8 - -[comment]: # (GENERATE-FROM-SCHEMA-END) + - (string, optional): Part of the key added to the datastore. +- **generation** (u64, optional): The number of times this has been updated. +- **hex** (hex, optional): The hex data which has been added to the datastore. +- **string** (string, optional): The data as a string, if it's valid utf-8. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "key": [ + "test_libplugin", + "name" + ], + "generation": 1, + "hex": "666f6f626172", + "string": "foobar" +} +{ + "key": [ + "somekey" + ], + "generation": 3, + "hex": "736f6d6564617461", + "string": "somedata" +} +{ + "key": [ + "a", + "d", + "e", + "f", + "g" + ], + "generation": 0, + "hex": "736f6d6564617461746f73746f7265696e7468656461746173746f7265", + "string": "somedatatostoreinthedatastore" +} +``` ERRORS ------ @@ -52,5 +145,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:098e407da175f50d8c5e9c70d61b7e9e586f74ad395a9e86532641e106eb2d60) diff --git a/doc/lightning-datastoreusage.7.md b/doc/lightning-datastoreusage.7.md index 02b16d8f4f80..5b76b40e9d2a 100644 --- a/doc/lightning-datastoreusage.7.md +++ b/doc/lightning-datastoreusage.7.md @@ -1,30 +1,86 @@ lightning-datastoreusage -- Command for listing datastore usage info -============================================================ +==================================================================== SYNOPSIS -------- -**datastoreusage** +**datastoreusage** [*key*] DESCRIPTION ----------- -The **datastoreusage** RPC command allows the caller to fetch the -total bytes that are stored under a certain *key* (or from the root), -including the size of the *key*. +Command *added* in v23.11. + +The **datastoreusage** RPC command allows the caller to fetch the total bytes that are stored under a certain *key* (or from the root), including the size of the *key*. All descendants of the *key* (or root) are taken into account. +- **key** (one of, optional): + - (array of strings): Key is an array of values (though a single value is treated as a one-element array). Used as the starting point to traverse the datastore. + - (string, optional) + - (string) + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:datastoreusage#1", + "method": "datastoreusage", + "params": { + "key": null + } +} +{ + "id": "example:datastoreusage#2", + "method": "datastoreusage", + "params": { + "key": "a" + } +} +{ + "id": "example:datastoreusage#3", + "method": "datastoreusage", + "params": { + "key": [ + "a", + "thisissomelongkeythattriestostore46bytesofdata" + ] + } +} +``` + RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **datastoreusage** is returned. It is an object containing: - -- **key** (string): The key from which the database was traversed. -- **total\_bytes** (u64): The total bytes that are stored under the *key*, including the all descendants data and the size of the keys themselves. - -[comment]: # (GENERATE-FROM-SCHEMA-END) +On success, an object containing **datastoreusage** is returned. It is an object containing: + +- **key** (string): The key from which the database was traversed. *(added v23.11)* +- **total\_bytes** (u64): The total bytes that are stored under the *key*, including the all descendants data and the size of the keys themselves. *(added v23.11)* + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "datastoreusage": { + "key": "[]", + "total_bytes": 0 + } +} +{ + "datastoreusage": { + "key": "[a]", + "total_bytes": 32 + } +} +{ + "datastoreusage": { + "key": "[a,thisissomelongkeythattriestostore46bytesofdata]", + "total_bytes": 77 + } +} +``` AUTHOR ------ @@ -40,5 +96,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:3c3f29e7b2489959fe4c36dd1bdb1db7023a47ade6298101fb4fba411bce4dc2) diff --git a/doc/lightning-decode.7.md b/doc/lightning-decode.7.md index bfd784dff2a1..caedb6d458fc 100644 --- a/doc/lightning-decode.7.md +++ b/doc/lightning-decode.7.md @@ -1,284 +1,352 @@ lightning-decode -- Command for decoding an invoice string (low-level) -======================================================================= +====================================================================== SYNOPSIS -------- -**decode** *string* +**decode** *string* DESCRIPTION ----------- -The **decode** RPC command checks and parses `bolt11`, `bolt12`, `rune` or `emergency\_recover`. It may decode other formats in future. +Command *added* in v23.05. + +The **decode** RPC command checks and parses `bolt11`, `bolt12`, `rune` or `emergency_recover`. It may decode other formats in future. + +- **string** (string): Value to be decoded: + * a *bolt11* or *bolt12* string (optionally prefixed by `lightning:` or `LIGHTNING:`) as specified by the BOLT 11 and BOLT 12 specifications. + * a *rune* as created by lightning-commando-rune(7). + * an *emergency\_recover* string generated by hsmtool like `lightning-hsmtool getemergencyrecover `. It holds `emergency.recover` contents and starts with `clnemerg1`. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:decode#1", + "method": "decode", + "params": [ + "zm0x_eLgHexaTvZn3Cz7gb_YlvrlYGDo_w4BYlR9SS09MSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl" + ] +} +{ + "id": "example:decode#2", + "method": "decode", + "params": [ + "lnbcrt1m1pja0f2hsp5xyssdvdsu24dmmesrt6x84wfrm4mscsnzq7hl2suzeu90wy6g53qpp5zyyu3anwfsfl64pewe0tg7j28map2wwnhvaam5nt70rlwxa0cegqdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqgqqqqqqqlgqqqq86qqqc9qxpqysgq7u4f99u4kepagme27t5c3gdl7czlnjaw7kxryxgm87w2j02j3g94r2vrukhpgedhcdkcdec27m7jrl2lvcr6uh3rdv9lgpz0vc0zcfcqnugjdw" + ] +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **type** (string): what kind of object it decoded to (one of "bolt12 offer", "bolt12 invoice", "bolt12 invoice\_request", "bolt11 invoice", "rune", "emergency recover") -- **valid** (boolean): if this is false, you *MUST* not use the result except for diagnostics! +- **type** (string) (one of "bolt12 offer", "bolt12 invoice", "bolt12 invoice\_request", "bolt11 invoice", "rune", "emergency recover"): What kind of object it decoded to. +- **valid** (boolean): If this is false, you *MUST* not use the result except for diagnostics! If **type** is "bolt12 offer", and **valid** is *true*: - - - **offer\_id** (hex): the id we use to identify this offer (always 64 characters) - - **offer\_description** (string): the description of the purpose of the offer - - **offer\_node\_id** (pubkey): public key of the offering node - - **offer\_chains** (array of hashs, optional): which blockchains this offer is for (missing implies bitcoin mainnet only): - - the genesis blockhash - - **offer\_metadata** (hex, optional): any metadata the creator of the offer includes - - **offer\_currency** (string, optional): ISO 4217 code of the currency (missing implies Bitcoin) (always 3 characters) - - **currency\_minor\_unit** (u32, optional): the number of decimal places to apply to amount (if currency known) - - **offer\_amount** (u64, optional): the amount in the `offer_currency` adjusted by `currency_minor_unit`, if any - - **offer\_amount\_msat** (msat, optional): the amount in bitcoin (if specified, and no `offer_currency`) - - **offer\_issuer** (string, optional): the description of the creator of the offer - - **offer\_features** (hex, optional): the feature bits of the offer - - **offer\_absolute\_expiry** (u64, optional): UNIX timestamp of when this offer expires - - **offer\_quantity\_max** (u64, optional): the maximum quantity (or, if 0, means any quantity) - - **offer\_paths** (array of objects, optional): Paths to the destination: - - **first\_node\_id** (pubkey): the (presumably well-known) public key of the start of the path - - **blinding** (pubkey): blinding factor for this path - - **path** (array of objects): an individual path: - - **blinded\_node\_id** (pubkey): node\_id of the hop - - **encrypted\_recipient\_data** (hex): encrypted TLV entry for this hop - - **offer\_recurrence** (object, optional): how often to this offer should be used: - - **time\_unit** (u32): the BOLT12 time unit - - **period** (u32): how many `time_unit` per payment period - - **time\_unit\_name** (string, optional): the name of `time_unit` (if valid) - - **basetime** (u64, optional): period starts at this UNIX timestamp - - **start\_any\_period** (boolean, optional): you can start at any period (only if `basetime` present) - - **limit** (u32, optional): maximum period number for recurrence - - **paywindow** (object, optional): when within a period will payment be accepted (default is prior and during the period): - - **seconds\_before** (u32): seconds prior to period start - - **seconds\_after** (u32): seconds after to period start - - **proportional\_amount** (boolean, optional): amount should be scaled if paid after period start (always *true*) - - **unknown\_offer\_tlvs** (array of objects, optional): Any extra fields we didn't know how to parse: - - **type** (u64): The type - - **length** (u64): The length - - **value** (hex): The value + - **offer\_id** (hex) (always 64 characters): The id we use to identify this offer. + - **offer\_description** (string): The description of the purpose of the offer. + - **offer\_node\_id** (pubkey): Public key of the offering node. + - **offer\_chains** (array of hashs, optional): Which blockchains this offer is for (missing implies bitcoin mainnet only).: + - (hash, optional): The genesis blockhash. + - **offer\_metadata** (hex, optional): Any metadata the creator of the offer includes. + - **offer\_currency** (string, optional) (always 3 characters): ISO 4217 code of the currency (missing implies Bitcoin). + - **currency\_minor\_unit** (u32, optional): The number of decimal places to apply to amount (if currency known). + - **offer\_amount** (u64, optional): The amount in the `offer_currency` adjusted by `currency_minor_unit`, if any. + - **offer\_amount\_msat** (msat, optional): The amount in bitcoin (if specified, and no `offer_currency`). + - **offer\_issuer** (string, optional): The description of the creator of the offer. + - **offer\_features** (hex, optional): The feature bits of the offer. + - **offer\_absolute\_expiry** (u64, optional): UNIX timestamp of when this offer expires. + - **offer\_quantity\_max** (u64, optional): The maximum quantity (or, if 0, means any quantity). + - **offer\_paths** (array of objects, optional): Paths to the destination.: + - **first\_node\_id** (pubkey): The (presumably well-known) public key of the start of the path. + - **blinding** (pubkey): Blinding factor for this path. + - **path** (array of objects): An individual path.: + - **blinded\_node\_id** (pubkey): Node\_id of the hop. + - **encrypted\_recipient\_data** (hex): Encrypted TLV entry for this hop. + - **offer\_recurrence** (object, optional): How often to this offer should be used.: + - **time\_unit** (u32): The BOLT12 time unit. + - **period** (u32): How many `time_unit` per payment period. + - **time\_unit\_name** (string, optional): The name of `time_unit` (if valid). + - **basetime** (u64, optional): Period starts at this UNIX timestamp. + - **start\_any\_period** (u64, optional): You can start at any period (only if `basetime` present). + - **limit** (u32, optional): Maximum period number for recurrence. + - **paywindow** (object, optional): When within a period will payment be accepted. The default is prior and during the period.: + - **seconds\_before** (u32): Seconds prior to period start. + - **seconds\_after** (u32): Seconds after to period start. + - **proportional\_amount** (boolean, optional) (always *true*): Amount should be scaled if paid after period start. + - **unknown\_offer\_tlvs** (array of objects, optional): Any extra fields we didn't know how to parse.: + - **type** (u64): The type. + - **length** (u64): The length. + - **value** (hex): The value. - the following warnings are possible: - - **warning\_unknown\_offer\_currency**: The currency code is unknown (so no `currency_minor_unit`) + - **warning\_unknown\_offer\_currency**: The currency code is unknown (so no `currency_minor_unit`). If **type** is "bolt12 offer", and **valid** is *false*: - - the following warnings are possible: - - **warning\_missing\_offer\_node\_id**: `offer_node_id` is not present - - **warning\_invalid\_offer\_description**: `offer_description` is not valid UTF8 - - **warning\_missing\_offer\_description**: `offer_description` is not present - - **warning\_invalid\_offer\_currency**: `offer_currency_code` is not valid UTF8 - - **warning\_invalid\_offer\_issuer**: `offer_issuer` is not valid UTF8 + - **warning\_missing\_offer\_node\_id**: `offer_node_id` is not present. + - **warning\_invalid\_offer\_description**: `offer_description` is not valid UTF8. + - **warning\_missing\_offer\_description**: `offer_description` is not present. + - **warning\_invalid\_offer\_currency**: `offer_currency_code` is not valid UTF8. + - **warning\_invalid\_offer\_issuer**: `offer_issuer` is not valid UTF8. If **type** is "bolt12 invoice\_request", and **valid** is *true*: - - - **offer\_description** (string): the description of the purpose of the offer - - **offer\_node\_id** (pubkey): public key of the offering node - - **invreq\_metadata** (hex): the payer-provided blob to derive invreq\_payer\_id - - **invreq\_payer\_id** (hex): the payer-provided key - - **signature** (bip340sig): BIP-340 signature of the `invreq_payer_id` on this invoice\_request - - **offer\_id** (hex, optional): the id we use to identify this offer (always 64 characters) - - **offer\_chains** (array of hexs, optional): which blockchains this offer is for (missing implies bitcoin mainnet only): - - the genesis blockhash (always 64 characters) - - **offer\_metadata** (hex, optional): any metadata the creator of the offer includes - - **offer\_currency** (string, optional): ISO 4217 code of the currency (missing implies Bitcoin) (always 3 characters) - - **currency\_minor\_unit** (u32, optional): the number of decimal places to apply to amount (if currency known) - - **offer\_amount** (u64, optional): the amount in the `offer_currency` adjusted by `currency_minor_unit`, if any - - **offer\_amount\_msat** (msat, optional): the amount in bitcoin (if specified, and no `offer_currency`) - - **offer\_issuer** (string, optional): the description of the creator of the offer - - **offer\_features** (hex, optional): the feature bits of the offer - - **offer\_absolute\_expiry** (u64, optional): UNIX timestamp of when this offer expires - - **offer\_quantity\_max** (u64, optional): the maximum quantity (or, if 0, means any quantity) - - **offer\_paths** (array of objects, optional): Paths to the destination: - - **first\_node\_id** (pubkey): the (presumably well-known) public key of the start of the path - - **blinding** (pubkey): blinding factor for this path - - **path** (array of objects): an individual path: - - **blinded\_node\_id** (pubkey): node\_id of the hop - - **encrypted\_recipient\_data** (hex): encrypted TLV entry for this hop - - **offer\_recurrence** (object, optional): how often to this offer should be used: - - **time\_unit** (u32): the BOLT12 time unit - - **period** (u32): how many `time_unit` per payment period - - **time\_unit\_name** (string, optional): the name of `time_unit` (if valid) - - **basetime** (u64, optional): period starts at this UNIX timestamp - - **start\_any\_period** (boolean, optional): you can start at any period (only if `basetime` present) - - **limit** (u32, optional): maximum period number for recurrence - - **paywindow** (object, optional): when within a period will payment be accepted (default is prior and during the period): - - **seconds\_before** (u32): seconds prior to period start - - **seconds\_after** (u32): seconds after to period start - - **proportional\_amount** (boolean, optional): amount should be scaled if paid after period start (always *true*) - - **invreq\_chain** (hex, optional): which blockchain this offer is for (missing implies bitcoin mainnet only) (always 64 characters) - - **invreq\_amount\_msat** (msat, optional): the amount the invoice should be for - - **invreq\_features** (hex, optional): the feature bits of the invoice\_request - - **invreq\_quantity** (u64, optional): the number of items to invoice for - - **invreq\_payer\_note** (string, optional): a note attached by the payer - - **invreq\_recurrence\_counter** (u32, optional): which number request this is for the same invoice - - **invreq\_recurrence\_start** (u32, optional): when we're requesting to start an invoice at a non-zero period - - **unknown\_invoice\_request\_tlvs** (array of objects, optional): Any extra fields we didn't know how to parse: - - **type** (u64): The type - - **length** (u64): The length - - **value** (hex): The value + - **offer\_description** (string): The description of the purpose of the offer. + - **offer\_node\_id** (pubkey): Public key of the offering node. + - **invreq\_metadata** (hex): The payer-provided blob to derive invreq\_payer\_id. + - **invreq\_payer\_id** (hex): The payer-provided key. + - **signature** (bip340sig): BIP-340 signature of the `invreq_payer_id` on this invoice\_request. + - **offer\_id** (hex, optional) (always 64 characters): The id we use to identify this offer. + - **offer\_chains** (array of hexs, optional): Which blockchains this offer is for (missing implies bitcoin mainnet only).: + - (hex, optional) (always 64 characters): The genesis blockhash. + - **offer\_metadata** (hex, optional): Any metadata the creator of the offer includes. + - **offer\_currency** (string, optional) (always 3 characters): ISO 4217 code of the currency (missing implies Bitcoin). + - **currency\_minor\_unit** (u32, optional): The number of decimal places to apply to amount (if currency known). + - **offer\_amount** (u64, optional): The amount in the `offer_currency` adjusted by `currency_minor_unit`, if any. + - **offer\_amount\_msat** (msat, optional): The amount in bitcoin (if specified, and no `offer_currency`). + - **offer\_issuer** (string, optional): The description of the creator of the offer. + - **offer\_features** (hex, optional): The feature bits of the offer. + - **offer\_absolute\_expiry** (u64, optional): UNIX timestamp of when this offer expires. + - **offer\_quantity\_max** (u64, optional): The maximum quantity (or, if 0, means any quantity). + - **offer\_paths** (array of objects, optional): Paths to the destination.: + - **first\_node\_id** (pubkey): The (presumably well-known) public key of the start of the path. + - **blinding** (pubkey): Blinding factor for this path. + - **path** (array of objects): An individual path.: + - **blinded\_node\_id** (pubkey): Node\_id of the hop. + - **encrypted\_recipient\_data** (hex): Encrypted TLV entry for this hop. + - **offer\_recurrence** (object, optional): How often to this offer should be used.: + - **time\_unit** (u32): The BOLT12 time unit. + - **period** (u32): How many `time_unit` per payment period. + - **time\_unit\_name** (string, optional): The name of `time_unit` (if valid). + - **basetime** (u64, optional): Period starts at this UNIX timestamp. + - **start\_any\_period** (u64, optional): You can start at any period (only if `basetime` present). + - **limit** (u32, optional): Maximum period number for recurrence. + - **paywindow** (object, optional): When within a period will payment be accepted. The default is prior and during the period.: + - **seconds\_before** (u32): Seconds prior to period start. + - **seconds\_after** (u32): Seconds after to period start. + - **proportional\_amount** (boolean, optional) (always *true*): Amount should be scaled if paid after period start. + - **invreq\_chain** (hex, optional) (always 64 characters): Which blockchain this offer is for (missing implies bitcoin mainnet only). + - **invreq\_amount\_msat** (msat, optional): The amount the invoice should be for. + - **invreq\_features** (hex, optional): The feature bits of the invoice\_request. + - **invreq\_quantity** (u64, optional): The number of items to invoice for. + - **invreq\_payer\_note** (string, optional): A note attached by the payer. + - **invreq\_recurrence\_counter** (u32, optional): Which number request this is for the same invoice. + - **invreq\_recurrence\_start** (u32, optional): When we're requesting to start an invoice at a non-zero period. + - **unknown\_invoice\_request\_tlvs** (array of objects, optional): Any extra fields we didn't know how to parse.: + - **type** (u64): The type. + - **length** (u64): The length. + - **value** (hex): The value. - the following warnings are possible: - - **warning\_unknown\_offer\_currency**: The currency code is unknown (so no `currency_minor_unit`) + - **warning\_unknown\_offer\_currency**: The currency code is unknown (so no `currency_minor_unit`). If **type** is "bolt12 invoice\_request", and **valid** is *false*: - - the following warnings are possible: - - **warning\_invalid\_offer\_description**: `offer_description` is not valid UTF8 - - **warning\_missing\_offer\_description**: `offer_description` is not present - - **warning\_invalid\_offer\_currency**: `offer_currency_code` is not valid UTF8 - - **warning\_invalid\_offer\_issuer**: `offer_issuer` is not valid UTF8 - - **warning\_missing\_invreq\_metadata**: `invreq_metadata` is not present - - **warning\_missing\_invreq\_payer\_id**: `invreq_payer_id` is not present - - **warning\_invalid\_invreq\_payer\_note**: `invreq_payer_note` is not valid UTF8 - - **warning\_missing\_invoice\_request\_signature**: `signature` is not present - - **warning\_invalid\_invoice\_request\_signature**: Incorrect `signature` + - **warning\_invalid\_offer\_description**: `offer_description` is not valid UTF8. + - **warning\_missing\_offer\_description**: `offer_description` is not present. + - **warning\_invalid\_offer\_currency**: `offer_currency_code` is not valid UTF8. + - **warning\_invalid\_offer\_issuer**: `offer_issuer` is not valid UTF8. + - **warning\_missing\_invreq\_metadata**: `invreq_metadata` is not present. + - **warning\_missing\_invreq\_payer\_id**: `invreq_payer_id` is not present. + - **warning\_invalid\_invreq\_payer\_note**: `invreq_payer_note` is not valid UTF8. + - **warning\_missing\_invoice\_request\_signature**: `signature` is not present. + - **warning\_invalid\_invoice\_request\_signature**: Incorrect `signature`. If **type** is "bolt12 invoice", and **valid** is *true*: - - - **offer\_description** (string): the description of the purpose of the offer - - **offer\_node\_id** (pubkey): public key of the offering node - - **invreq\_metadata** (hex): the payer-provided blob to derive invreq\_payer\_id - - **invreq\_payer\_id** (hex): the payer-provided key - - **invoice\_paths** (array of objects): Paths to pay the destination: - - **first\_node\_id** (pubkey): the (presumably well-known) public key of the start of the path - - **blinding** (pubkey): blinding factor for this path + - **offer\_description** (string): The description of the purpose of the offer. + - **offer\_node\_id** (pubkey): Public key of the offering node. + - **invreq\_metadata** (hex): The payer-provided blob to derive invreq\_payer\_id. + - **invreq\_payer\_id** (hex): The payer-provided key. + - **invoice\_paths** (array of objects): Paths to pay the destination.: + - **first\_node\_id** (pubkey): The (presumably well-known) public key of the start of the path. + - **blinding** (pubkey): Blinding factor for this path. - **payinfo** (object): - - **fee\_base\_msat** (msat): basefee for path - - **fee\_proportional\_millionths** (u32): proportional fee for path - - **cltv\_expiry\_delta** (u32): CLTV delta for path - - **features** (hex): features allowed for path - - **path** (array of objects): an individual path: - - **blinded\_node\_id** (pubkey): node\_id of the hop - - **encrypted\_recipient\_data** (hex): encrypted TLV entry for this hop - - **invoice\_created\_at** (u64): the UNIX timestamp of invoice creation - - **invoice\_payment\_hash** (hex): the hash of the *payment\_preimage* (always 64 characters) - - **invoice\_amount\_msat** (msat): the amount required to fulfill invoice - - **signature** (bip340sig): BIP-340 signature of the `offer_node_id` on this invoice - - **offer\_id** (hex, optional): the id we use to identify this offer (always 64 characters) - - **offer\_chains** (array of hexs, optional): which blockchains this offer is for (missing implies bitcoin mainnet only): - - the genesis blockhash (always 64 characters) - - **offer\_metadata** (hex, optional): any metadata the creator of the offer includes - - **offer\_currency** (string, optional): ISO 4217 code of the currency (missing implies Bitcoin) (always 3 characters) - - **currency\_minor\_unit** (u32, optional): the number of decimal places to apply to amount (if currency known) - - **offer\_amount** (u64, optional): the amount in the `offer_currency` adjusted by `currency_minor_unit`, if any - - **offer\_amount\_msat** (msat, optional): the amount in bitcoin (if specified, and no `offer_currency`) - - **offer\_issuer** (string, optional): the description of the creator of the offer - - **offer\_features** (hex, optional): the feature bits of the offer - - **offer\_absolute\_expiry** (u64, optional): UNIX timestamp of when this offer expires - - **offer\_quantity\_max** (u64, optional): the maximum quantity (or, if 0, means any quantity) - - **offer\_paths** (array of objects, optional): Paths to the destination: - - **first\_node\_id** (pubkey): the (presumably well-known) public key of the start of the path - - **blinding** (pubkey): blinding factor for this path - - **path** (array of objects): an individual path: - - **blinded\_node\_id** (pubkey): node\_id of the hop - - **encrypted\_recipient\_data** (hex): encrypted TLV entry for this hop - - **offer\_recurrence** (object, optional): how often to this offer should be used: - - **time\_unit** (u32): the BOLT12 time unit - - **period** (u32): how many `time_unit` per payment period - - **time\_unit\_name** (string, optional): the name of `time_unit` (if valid) - - **basetime** (u64, optional): period starts at this UNIX timestamp - - **start\_any\_period** (boolean, optional): you can start at any period (only if `basetime` present) - - **limit** (u32, optional): maximum period number for recurrence - - **paywindow** (object, optional): when within a period will payment be accepted (default is prior and during the period): - - **seconds\_before** (u32): seconds prior to period start - - **seconds\_after** (u32): seconds after to period start - - **proportional\_amount** (boolean, optional): amount should be scaled if paid after period start (always *true*) - - **invreq\_chain** (hex, optional): which blockchain this offer is for (missing implies bitcoin mainnet only) (always 64 characters) - - **invreq\_amount\_msat** (msat, optional): the amount the invoice should be for - - **invreq\_features** (hex, optional): the feature bits of the invoice\_request - - **invreq\_quantity** (u64, optional): the number of items to invoice for - - **invreq\_payer\_note** (string, optional): a note attached by the payer - - **invreq\_recurrence\_counter** (u32, optional): which number request this is for the same invoice - - **invreq\_recurrence\_start** (u32, optional): when we're requesting to start an invoice at a non-zero period - - **invoice\_relative\_expiry** (u32, optional): the number of seconds after *invoice\_created\_at* when this expires - - **invoice\_fallbacks** (array of objects, optional): onchain addresses: - - **version** (u8): Segwit address version - - **hex** (hex): Raw encoded segwit address - - **address** (string, optional): bech32 segwit address - - **invoice\_features** (hex, optional): the feature bits of the invoice - - **invoice\_node\_id** (pubkey, optional): the id to pay (usually the same as offer\_node\_id) - - **invoice\_recurrence\_basetime** (u64, optional): the UNIX timestamp to base the invoice periods on - - **unknown\_invoice\_tlvs** (array of objects, optional): Any extra fields we didn't know how to parse: - - **type** (u64): The type - - **length** (u64): The length - - **value** (hex): The value + - **fee\_base\_msat** (msat): Basefee for path. + - **fee\_proportional\_millionths** (u32): Proportional fee for path. + - **cltv\_expiry\_delta** (u32): CLTV delta for path. + - **features** (hex): Features allowed for path. + - **path** (array of objects): An individual path.: + - **blinded\_node\_id** (pubkey): Node\_id of the hop. + - **encrypted\_recipient\_data** (hex): Encrypted TLV entry for this hop. + - **invoice\_created\_at** (u64): The UNIX timestamp of invoice creation. + - **invoice\_payment\_hash** (hex) (always 64 characters): The hash of the *payment\_preimage*. + - **invoice\_amount\_msat** (msat): The amount required to fulfill invoice. + - **signature** (bip340sig): BIP-340 signature of the `offer_node_id` on this invoice. + - **offer\_id** (hex, optional) (always 64 characters): The id we use to identify this offer. + - **offer\_chains** (array of hexs, optional): Which blockchains this offer is for (missing implies bitcoin mainnet only).: + - (hex, optional) (always 64 characters): The genesis blockhash. + - **offer\_metadata** (hex, optional): Any metadata the creator of the offer includes. + - **offer\_currency** (string, optional) (always 3 characters): ISO 4217 code of the currency (missing implies Bitcoin). + - **currency\_minor\_unit** (u32, optional): The number of decimal places to apply to amount (if currency known). + - **offer\_amount** (u64, optional): The amount in the `offer_currency` adjusted by `currency_minor_unit`, if any. + - **offer\_amount\_msat** (msat, optional): The amount in bitcoin (if specified, and no `offer_currency`). + - **offer\_issuer** (string, optional): The description of the creator of the offer. + - **offer\_features** (hex, optional): The feature bits of the offer. + - **offer\_absolute\_expiry** (u64, optional): UNIX timestamp of when this offer expires. + - **offer\_quantity\_max** (u64, optional): The maximum quantity (or, if 0, means any quantity). + - **offer\_paths** (array of objects, optional): Paths to the destination.: + - **first\_node\_id** (pubkey): The (presumably well-known) public key of the start of the path. + - **blinding** (pubkey): Blinding factor for this path. + - **path** (array of objects): An individual path.: + - **blinded\_node\_id** (pubkey): Node\_id of the hop. + - **encrypted\_recipient\_data** (hex): Encrypted TLV entry for this hop. + - **offer\_recurrence** (object, optional): How often to this offer should be used.: + - **time\_unit** (u32): The BOLT12 time unit. + - **period** (u32): How many `time_unit` per payment period. + - **time\_unit\_name** (string, optional): The name of `time_unit` (if valid). + - **basetime** (u64, optional): Period starts at this UNIX timestamp. + - **start\_any\_period** (u64, optional): You can start at any period (only if `basetime` present). + - **limit** (u32, optional): Maximum period number for recurrence. + - **paywindow** (object, optional): When within a period will payment be accepted. The default is prior and during the period.: + - **seconds\_before** (u32): Seconds prior to period start. + - **seconds\_after** (u32): Seconds after to period start. + - **proportional\_amount** (boolean, optional) (always *true*): Amount should be scaled if paid after period start. + - **invreq\_chain** (hex, optional) (always 64 characters): Which blockchain this offer is for (missing implies bitcoin mainnet only). + - **invreq\_amount\_msat** (msat, optional): The amount the invoice should be for. + - **invreq\_features** (hex, optional): The feature bits of the invoice\_request. + - **invreq\_quantity** (u64, optional): The number of items to invoice for. + - **invreq\_payer\_note** (string, optional): A note attached by the payer. + - **invreq\_recurrence\_counter** (u32, optional): Which number request this is for the same invoice. + - **invreq\_recurrence\_start** (u32, optional): When we're requesting to start an invoice at a non-zero period. + - **invoice\_relative\_expiry** (u32, optional): The number of seconds after *invoice\_created\_at* when this expires. + - **invoice\_fallbacks** (array of objects, optional): Onchain addresses.: + - **version** (u8): Segwit address version. + - **hex** (hex): Raw encoded segwit address. + - **address** (string, optional): Bech32 segwit address. + - **invoice\_features** (hex, optional): The feature bits of the invoice. + - **invoice\_node\_id** (pubkey, optional): The id to pay (usually the same as offer\_node\_id). + - **invoice\_recurrence\_basetime** (u64, optional): The UNIX timestamp to base the invoice periods on. + - **unknown\_invoice\_tlvs** (array of objects, optional): Any extra fields we didn't know how to parse.: + - **type** (u64): The type. + - **length** (u64): The length. + - **value** (hex): The value. - the following warnings are possible: - - **warning\_unknown\_offer\_currency**: The currency code is unknown (so no `currency_minor_unit`) + - **warning\_unknown\_offer\_currency**: The currency code is unknown (so no `currency_minor_unit`). If **type** is "bolt12 invoice", and **valid** is *false*: - - **fallbacks** (array of objects, optional): - the following warnings are possible: - - **warning\_invoice\_fallbacks\_version\_invalid**: `version` is > 16 + - **warning\_invoice\_fallbacks\_version\_invalid**: `version` is > 16. - the following warnings are possible: - - **warning\_invalid\_offer\_description**: `offer_description` is not valid UTF8 - - **warning\_missing\_offer\_description**: `offer_description` is not present - - **warning\_invalid\_offer\_currency**: `offer_currency_code` is not valid UTF8 - - **warning\_invalid\_offer\_issuer**: `offer_issuer` is not valid UTF8 - - **warning\_missing\_invreq\_metadata**: `invreq_metadata` is not present - - **warning\_invalid\_invreq\_payer\_note**: `invreq_payer_note` is not valid UTF8 - - **warning\_missing\_invoice\_paths**: `invoice_paths` is not present - - **warning\_missing\_invoice\_blindedpay**: `invoice_blindedpay` is not present - - **warning\_missing\_invoice\_created\_at**: `invoice_created_at` is not present - - **warning\_missing\_invoice\_payment\_hash**: `invoice_payment_hash` is not present - - **warning\_missing\_invoice\_amount**: `invoice_amount` is not present - - **warning\_missing\_invoice\_recurrence\_basetime**: `invoice_recurrence_basetime` is not present - - **warning\_missing\_invoice\_node\_id**: `invoice_node_id` is not present - - **warning\_missing\_invoice\_signature**: `signature` is not present - - **warning\_invalid\_invoice\_signature**: Incorrect `signature` + - **warning\_invalid\_offer\_description**: `offer_description` is not valid UTF8. + - **warning\_missing\_offer\_description**: `offer_description` is not present. + - **warning\_invalid\_offer\_currency**: `offer_currency_code` is not valid UTF8. + - **warning\_invalid\_offer\_issuer**: `offer_issuer` is not valid UTF8. + - **warning\_missing\_invreq\_metadata**: `invreq_metadata` is not present. + - **warning\_invalid\_invreq\_payer\_note**: `invreq_payer_note` is not valid UTF8. + - **warning\_missing\_invoice\_paths**: `invoice_paths` is not present. + - **warning\_missing\_invoice\_blindedpay**: `invoice_blindedpay` is not present. + - **warning\_missing\_invoice\_created\_at**: `invoice_created_at` is not present. + - **warning\_missing\_invoice\_payment\_hash**: `invoice_payment_hash` is not present. + - **warning\_missing\_invoice\_amount**: `invoice_amount` is not present. + - **warning\_missing\_invoice\_recurrence\_basetime**: `invoice_recurrence_basetime` is not present. + - **warning\_missing\_invoice\_node\_id**: `invoice_node_id` is not present. + - **warning\_missing\_invoice\_signature**: `signature` is not present. + - **warning\_invalid\_invoice\_signature**: Incorrect `signature`. If **type** is "bolt11 invoice", and **valid** is *true*: - - - **currency** (string): the BIP173 name for the currency - - **created\_at** (u64): the UNIX-style timestamp of the invoice - - **expiry** (u64): the number of seconds this is valid after `created_at` - - **payee** (pubkey): the public key of the recipient - - **payment\_hash** (hash): the hash of the *payment\_preimage* - - **signature** (signature): signature of the *payee* on this invoice - - **min\_final\_cltv\_expiry** (u32): the minimum CLTV delay for the final node - - **amount\_msat** (msat, optional): Amount the invoice asked for - - **description** (string, optional): the description of the purpose of the purchase - - **description\_hash** (hash, optional): the hash of the description, in place of *description* - - **payment\_secret** (secret, optional): the secret to hand to the payee node - - **features** (hex, optional): the features bitmap for this invoice - - **payment\_metadata** (hex, optional): the payment\_metadata to put in the payment - - **fallbacks** (array of objects, optional): onchain addresses: - - **type** (string): the address type (if known) (one of "P2PKH", "P2SH", "P2WPKH", "P2WSH", "P2TR") - - **hex** (hex): Raw encoded address - - **addr** (string, optional): the address in appropriate format for *type* - - **routes** (array of arrays, optional): Route hints to the *payee*: - - hops in the route: - - **pubkey** (pubkey): the public key of the node - - **short\_channel\_id** (short\_channel\_id): a channel to the next peer - - **fee\_base\_msat** (msat): the base fee for payments - - **fee\_proportional\_millionths** (u32): the parts-per-million fee for payments - - **cltv\_expiry\_delta** (u32): the CLTV delta across this hop - - **extra** (array of objects, optional): Any extra fields we didn't know how to parse: - - **tag** (string): The bech32 letter which identifies this field (always 1 characters) - - **data** (string): The bech32 data for this field + - **currency** (string): The BIP173 name for the currency. + - **created\_at** (u64): The UNIX-style timestamp of the invoice. + - **expiry** (u64): The number of seconds this is valid after `created_at`. + - **payee** (pubkey): The public key of the recipient. + - **payment\_hash** (hash): The hash of the *payment\_preimage*. + - **signature** (signature): Signature of the *payee* on this invoice. + - **min\_final\_cltv\_expiry** (u32): The minimum CLTV delay for the final node. + - **amount\_msat** (msat, optional): Amount the invoice asked for. + - **description** (string, optional): The description of the purpose of the purchase. + - **description\_hash** (hash, optional): The hash of the description, in place of *description*. + - **payment\_secret** (secret, optional): The secret to hand to the payee node. + - **features** (hex, optional): The features bitmap for this invoice. + - **payment\_metadata** (hex, optional): The payment\_metadata to put in the payment. + - **fallbacks** (array of objects, optional): Onchain addresses.: + - **type** (string) (one of "P2PKH", "P2SH", "P2WPKH", "P2WSH", "P2TR"): The address type (if known). + - **hex** (hex): Raw encoded address. + - **addr** (string, optional): The address in appropriate format for *type*. + - **routes** (array of arrays, optional): Route hints to the *payee*.: + - (array of objects): Hops in the route. + - **pubkey** (pubkey): The public key of the node. + - **short\_channel\_id** (short\_channel\_id): A channel to the next peer. + - **fee\_base\_msat** (msat): The base fee for payments. + - **fee\_proportional\_millionths** (u32): The parts-per-million fee for payments. + - **cltv\_expiry\_delta** (u32): The CLTV delta across this hop. + - **extra** (array of objects, optional): Any extra fields we didn't know how to parse.: + - **tag** (string) (always 1 characters): The bech32 letter which identifies this field. + - **data** (string): The bech32 data for this field. If **type** is "rune", and **valid** is *true*: - - **valid** (boolean) (always *true*) - - **string** (string): the string encoding of the rune - - **restrictions** (array of objects): restrictions built into the rune: all must pass: - - **alternatives** (array of strings): each way restriction can be met: any can pass: - - the alternative of form fieldname condition fieldname - - **summary** (string): human-readable summary of this restriction - - **unique\_id** (string, optional): unique id (always a numeric id on runes we create) - - **version** (string, optional): rune version, not currently set on runes we create + - **string** (string): The string encoding of the rune. + - **restrictions** (array of objects): Restrictions built into the rune: all must pass.: + - **alternatives** (array of strings): Each way restriction can be met: any can pass.: + - (string, optional): The alternative of form fieldname condition fieldname. + - **summary** (string): Human-readable summary of this restriction. + - **unique\_id** (string, optional): Unique id (always a numeric id on runes we create). + - **version** (string, optional): Rune version, not currently set on runes we create. If **type** is "rune", and **valid** is *false*: - - **valid** (boolean) (always *false*) - - **hex** (hex, optional): the raw rune in hex + - **hex** (hex, optional): The raw rune in hex. - the following warnings are possible: - - **warning\_rune\_invalid\_utf8**: the rune contains invalid UTF-8 strings + - **warning\_rune\_invalid\_utf8**: The rune contains invalid UTF-8 strings. If **type** is "emergency recover", and **valid** is *true*: - - - **decrypted** (hex): The decrypted value of the provided bech32 of emergency.recover *(added v23.11)* - -[comment]: # (GENERATE-FROM-SCHEMA-END) + - **decrypted** (hex): The decrypted value of the provided bech32 of emergency.recover. *(added v23.11)* + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "type": "rune", + "unique_id": "1", + "string": "ce6d31fde2e01dec5a4ef667dc2cfb81bfd896fae56060e8ff0e0162547d492d:=1&method^list|method^get|method=summary&method/listdatastore", + "restrictions": [ + { + "alternatives": [ + "method^list", + "method^get", + "method=summary" + ], + "summary": "method (of command) starts with 'list' OR method (of command) starts with 'get' OR method (of command) equal to 'summary'" + }, + { + "alternatives": [ + "method/listdatastore" + ], + "summary": "method (of command) unequal to 'listdatastore'" + } + ], + "valid": true +} +{ + "type": "bolt11 invoice", + "currency": "bcrt", + "created_at": 1708631383, + "expiry": 604800, + "payee": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount_msat": 100000000, + "description": "description", + "min_final_cltv_expiry": 5, + "payment_secret": "312106b1b0e2aaddef301af463d5c91eebb86213103d7faa1c167857b89a4522", + "features": "02024100", + "routes": [ + [ + { + "pubkey": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "short_channel_id": "103x1x0", + "fee_base_msat": 1000, + "fee_proportional_millionths": 1000, + "cltv_expiry_delta": 6 + } + ] + ], + "payment_hash": "1109c8f66e4c13fd5439765eb47a4a3efa1539d3bb3bddd26bf3c7f71bafc650", + "signature": "3045022100f72a929795b643d46f2af2e988a1bff605f9cbaef58c32191b3f9ca93d528a0b022051a983e5ae1465b7c36d86e70af6fd21fd5f6607ae5e236b0bf4044f661e2c27", + "valid": true +} +``` AUTHOR ------ @@ -295,8 +363,7 @@ RESOURCES [BOLT #11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md) -[BOLT #12](https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md) (experimental, [bolt](https://github.com/lightning/bolts) #798) +[BOLT #12](https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md) +(experimental, [bolt](https://github.com/lightning/bolts) #798) Main web site: - -[comment]: # ( SHA256STAMP:59bcc38bf3c4b2aa6f4258c1327d16171c4ba37276ac3a96528a2f12a2ef3ad5) diff --git a/doc/lightning-decodepay.7.md b/doc/lightning-decodepay.7.md index 2a345eef0b77..31a5171419d4 100644 --- a/doc/lightning-decodepay.7.md +++ b/doc/lightning-decodepay.7.md @@ -4,54 +4,87 @@ lightning-decodepay -- Command for decoding a bolt11 string (low-level) SYNOPSIS -------- -**decodepay** *bolt11* [*description*] +**decodepay** *bolt11* [*description*] DESCRIPTION ----------- -The **decodepay** RPC command checks and parses a *bolt11* string as -specified by the BOLT 11 specification. +Command *added* in v23.05. + +The **decodepay** RPC command checks and parses a *bolt11* string as specified by the BOLT 11 specification. + +- **bolt11** (string): Bolt11 invoice to decode. +- **description** (string, optional): Description of the invoice to decode. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:decodepay#1", + "method": "decodepay", + "params": { + "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk", + "description": null + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **currency** (string): the BIP173 name for the currency -- **created\_at** (u64): the UNIX-style timestamp of the invoice -- **expiry** (u64): the number of seconds this is valid after *timestamp* -- **payee** (pubkey): the public key of the recipient -- **payment\_hash** (hash): the hash of the *payment\_preimage* -- **signature** (signature): signature of the *payee* on this invoice -- **min\_final\_cltv\_expiry** (u32): the minimum CLTV delay for the final node -- **amount\_msat** (msat, optional): Amount the invoice asked for -- **description** (string, optional): the description of the purpose of the purchase -- **description\_hash** (hash, optional): the hash of the description, in place of *description* -- **payment\_secret** (hash, optional): the secret to hand to the payee node -- **features** (hex, optional): the features bitmap for this invoice -- **payment\_metadata** (hex, optional): the payment\_metadata to put in the payment -- **fallbacks** (array of objects, optional): onchain addresses: - - **type** (string): the address type (if known) (one of "P2PKH", "P2SH", "P2WPKH", "P2WSH", "P2TR") - - **hex** (hex): Raw encoded address - - **addr** (string, optional): the address in appropriate format for *type* -- **routes** (array of arrays, optional): Route hints to the *payee*: - - hops in the route: - - **pubkey** (pubkey): the public key of the node - - **short\_channel\_id** (short\_channel\_id): a channel to the next peer - - **fee\_base\_msat** (msat): the base fee for payments - - **fee\_proportional\_millionths** (u32): the parts-per-million fee for payments - - **cltv\_expiry\_delta** (u32): the CLTV delta across this hop -- **extra** (array of objects, optional): Any extra fields we didn't know how to parse: - - **tag** (string): The bech32 letter which identifies this field (always 1 characters) - - **data** (string): The bech32 data for this field - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -Technically, the *description* field is optional if a -*description\_hash* field is given, but in this case **decodepay** will -only succeed if the optional *description* field is passed and matches -the *description\_hash*. In practice, these are currently unused. +- **currency** (string): The BIP173 name for the currency. +- **created\_at** (u64): The UNIX-style timestamp of the invoice. +- **expiry** (u64): The number of seconds this is valid after *timestamp*. +- **payee** (pubkey): The public key of the recipient. +- **payment\_hash** (hash): The hash of the *payment\_preimage*. +- **signature** (signature): Signature of the *payee* on this invoice. +- **min\_final\_cltv\_expiry** (u32): The minimum CLTV delay for the final node. +- **amount\_msat** (msat, optional): Amount the invoice asked for. +- **description** (string, optional): The description of the purpose of the purchase. +- **description\_hash** (hash, optional): The hash of the description, in place of *description*. +- **payment\_secret** (hash, optional): The secret to hand to the payee node. +- **features** (hex, optional): The features bitmap for this invoice. +- **payment\_metadata** (hex, optional): The payment\_metadata to put in the payment. +- **fallbacks** (array of objects, optional): Onchain addresses.: + - **type** (string) (one of "P2PKH", "P2SH", "P2WPKH", "P2WSH", "P2TR"): The address type (if known). + - **hex** (hex): Raw encoded address. + - **addr** (string, optional): The address in appropriate format for *type*. +- **routes** (array of arrays, optional): Route hints to the *payee*.: + - (array of objects): Hops in the route. + - **pubkey** (pubkey): The public key of the node. + - **short\_channel\_id** (short\_channel\_id): A channel to the next peer. + - **fee\_base\_msat** (msat): The base fee for payments. + - **fee\_proportional\_millionths** (u32): The parts-per-million fee for payments. + - **cltv\_expiry\_delta** (u32): The CLTV delta across this hop. +- **extra** (array of objects, optional): Any extra fields we didn't know how to parse.: + - **tag** (string) (always 1 characters): The bech32 letter which identifies this field. + - **data** (string): The bech32 data for this field. + +Technically, the *description* field is optional if a *description\_hash* field is given, but in this case **decodepay** will only succeed if the optional *description* field is passed and matches the *description\_hash*. In practice, these are currently unused. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "currency": "bcrt", + "created_at": 1706152930, + "expiry": 604800, + "payee": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount_msat": 11000000, + "description": [ + "XEoCR94SIz6UIRUEkxum." + ], + "min_final_cltv_expiry": 5, + "payment_secret": "82644944d3f70d42aad1d5f7b5d7a629e7afa30b529cc952a4c59fc0e3790ea2", + "features": "02024100", + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "signature": "3045022100e3b7d8886eae1a7c9e55e1797aa0dcb77b8c5a19d56c657cad030e360c90682802203a35713acb098245e53a37faeac98754a29a7078db5ed6f2166f917e55b94484" +} +``` AUTHOR ------ @@ -61,7 +94,7 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-pay(7), lightning-getroute(7), lightning-sendpay(7). +lightning-pay(7), lightning-getroute(7), lightning-sendpay(7) RESOURCES --------- @@ -69,5 +102,3 @@ RESOURCES [BOLT #11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md) Main web site: - -[comment]: # ( SHA256STAMP:a5939424a8e93fc4e79a702753b58fa3da4e4c5efa00571d46dd35c9a68ea38e) diff --git a/doc/lightning-deldatastore.7.md b/doc/lightning-deldatastore.7.md index 2eb0ecfc06c3..c6b8c5f78f5c 100644 --- a/doc/lightning-deldatastore.7.md +++ b/doc/lightning-deldatastore.7.md @@ -4,30 +4,77 @@ lightning-deldatastore -- Command for removing (plugin) data SYNOPSIS -------- -**deldatastore** *key* [*generation*] +**deldatastore** *key* [*generation*] DESCRIPTION ----------- -The **deldatastore** RPC command allows plugins to delete data it has -stored in the Core Lightning database. - -The command fails if the *key* isn't present, or if *generation* -is specified and the generation of the data does not exactly match. +The **deldatastore** RPC command allows plugins to delete data it has stored in the Core Lightning database. + +The command fails if the *key* isn't present, or if *generation* is specified and the generation of the data does not exactly match. + +- **key** (one of): + - (array of strings): Key is an array of values (though a single value is treated as a one-element array), to form a heirarchy. Using the first element of the key as the plugin name (e.g. [ 'summary' ]) is recommended. A key can either have children or a value, never both: parents are created and removed automatically. + - (string, optional) + - (string) +- **generation** (u64, optional): If specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with mode `must-replace` or `must-append`. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:deldatastore#1", + "method": "deldatastore", + "params": { + "key": "otherkey", + "generation": 1 + } +} +{ + "id": "example:deldatastore#2", + "method": "deldatastore", + "params": { + "key": [ + "a" + ], + "generation": null + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: - **key** (array of strings): - - Part of the key added to the datastore -- **generation** (u64, optional): The number of times this has been updated -- **hex** (hex, optional): The hex data which has removed from the datastore -- **string** (string, optional): The data as a string, if it's valid utf-8 - -[comment]: # (GENERATE-FROM-SCHEMA-END) + - (string, optional): Part of the key added to the datastore. +- **generation** (u64, optional): The number of times this has been updated. +- **hex** (hex, optional): The hex data which has removed from the datastore. +- **string** (string, optional): The data as a string, if it's valid utf-8. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "key": [ + "otherkey" + ], + "generation": 1, + "hex": "6f746865726461746161", + "string": "otherdataa" +} +{ + "key": [ + "a" + ], + "generation": 0, + "hex": "6176616c", + "string": "aval" +} +``` ERRORS ------ @@ -52,5 +99,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:7eaa7b42799aa2a1ee0719abd3e1c12cd135c1031b6c363ae52e339aa5670a47) diff --git a/doc/lightning-delexpiredinvoice.7.md b/doc/lightning-delexpiredinvoice.7.md index 53890a7798f0..c0b5083e950f 100644 --- a/doc/lightning-delexpiredinvoice.7.md +++ b/doc/lightning-delexpiredinvoice.7.md @@ -4,21 +4,39 @@ lightning-delexpiredinvoice -- Command for removing expired invoices SYNOPSIS -------- -**delexpiredinvoice** [*maxexpirytime*] +**delexpiredinvoice** [*maxexpirytime*] DESCRIPTION ----------- -The **delexpiredinvoice** RPC command removes all invoices that have -expired on or before the given *maxexpirytime*. +The **delexpiredinvoice** RPC command removes all invoices that have expired on or before the given *maxexpirytime*. + +- **maxexpirytime** (u64, optional): Invoice expiry time in seconds. If not specified then all expired invoices are deleted. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:delexpiredinvoice#1", + "method": "delexpiredinvoice", + "params": { + "maxexpirytime": null + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an empty object is returned. -[comment]: # (GENERATE-FROM-SCHEMA-END) +EXAMPLE JSON RESPONSE +--------------------- + +```json +{} +``` AUTHOR ------ @@ -34,5 +52,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:8e8ea93d37e6896251df4a07648383e72064aa75f0a415820f773178fc35083c) diff --git a/doc/lightning-delforward.7.md b/doc/lightning-delforward.7.md index 002132895b47..4377a26878ed 100644 --- a/doc/lightning-delforward.7.md +++ b/doc/lightning-delforward.7.md @@ -4,26 +4,55 @@ lightning-delforward -- Command for removing a forwarding entry SYNOPSIS -------- -**delforward** *in\_channel* *in\_htlc\_id* *status* +**delforward** *in\_channel* *in\_htlc\_id* *status* DESCRIPTION ----------- -The **delforward** RPC command removes a single forward from **listforwards**, -using the uniquely-identifying *in\_channel* and *in\_htlc\_id* (and, as a sanity -check, the *status*) given by that command. - -This command is mainly used by the *autoclean* plugin (see lightningd-config(7)), -As these database entries are only kept for your own analysis, removing them -has no effect on the running of your node. +The **delforward** RPC command removes a single forward from **listforwards**, using the uniquely-identifying *in\_channel* and *in\_htlc\_id* (and, as a sanity check, the *status*) given by that command. + +This command is mainly used by the *autoclean* plugin (see lightningd- config(7)), As these database entries are only kept for your own analysis, removing them has no effect on the running of your node. + +- **in\_channel** (short\_channel\_id): Only the matching forwards on the given inbound channel are deleted. Note: for **listforwards** entries without an *in\_htlc\_id* entry (no longer created in v22.11, but can exist from older versions), a value of 18446744073709551615 can be used, but then it will delete *all* entries without *in\_htlc\_id* for this *in\_channel* and *status*. +- **in\_htlc\_id** (u64): The unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11). +- **status** (string) (one of "settled", "local\_failed", "failed"): The status of the forward to delete. You cannot delete forwards which have status *offered* (i.e. are currently active). + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:delforward#1", + "method": "delforward", + "params": { + "in_channel": "103x1x0", + "in_htlc_id": 2, + "status": "local_failed" + } +} +{ + "id": "example:delforward#2", + "method": "delforward", + "params": [ + "103x1x0", + 1, + "failed" + ] +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an empty object is returned. -[comment]: # (GENERATE-FROM-SCHEMA-END) +EXAMPLE JSON RESPONSE +--------------------- + +```json +{} +{} +``` ERRORS ------ @@ -46,5 +75,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:3faddc7dd03a73725f4a3e7249c7a417a11c6ac31f8666a9df2a8e5ebcfe2875) diff --git a/doc/lightning-delinvoice.7.md b/doc/lightning-delinvoice.7.md index 048ed361472e..953fdd7d4d39 100644 --- a/doc/lightning-delinvoice.7.md +++ b/doc/lightning-delinvoice.7.md @@ -4,59 +4,107 @@ lightning-delinvoice -- Command for removing an invoice (or just its description SYNOPSIS -------- -**delinvoice** *label* *status* [*desconly*] +**delinvoice** *label* *status* [*desconly*] DESCRIPTION ----------- -The **delinvoice** RPC command removes an invoice with *status* as given -in **listinvoices**, or with *desconly* set, removes its description. +The **delinvoice** RPC command removes an invoice with *status* as given in **listinvoices**, or with *desconly* set, removes its description. + +- **label** (one of): Label of the invoice to be deleted.: + - (string) + - (u64) +- **status** (string) (one of "paid", "expired", "unpaid"): Label of the invoice to be deleted. The caller should be particularly aware of the error case caused by the *status* changing just before this command is invoked! +- **desconly** (boolean, optional): If set to True, the invoice is not deleted, but has its description removed (this can save space with very large descriptions, as would be used with lightning-invoice(7) *deschashonly*. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:delinvoice#1", + "method": "delinvoice", + "params": { + "label": "invlabel2", + "status": "unpaid", + "desconly": true + } +} +{ + "id": "example:delinvoice#2", + "method": "delinvoice", + "params": { + "label": "keysend-1708640419.666098582", + "status": "paid", + "desconly": null + } +} +``` RETURN VALUE ------------ Note: The return is the same as an object from lightning-listinvoice(7). - -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **label** (string): Unique label given at creation time -- **payment\_hash** (hash): the hash of the *payment\_preimage* which will prove payment -- **created\_index** (u64): 1-based index indicating order this invoice was created in *(added v23.08)* -- **status** (string): State of invoice (one of "paid", "expired", "unpaid") -- **expires\_at** (u64): UNIX timestamp when invoice expires (or expired) -- **bolt11** (string, optional): BOLT11 string -- **bolt12** (string, optional): BOLT12 string -- **amount\_msat** (msat, optional): the amount required to pay this invoice -- **description** (string, optional): description used in the invoice -- **updated\_index** (u64, optional): 1-based index indicating order this invoice was changed (only present if it has changed since creation) *(added v23.08)* +- **label** (string): Unique label given at creation time. +- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. +- **created\_index** (u64): 1-based index indicating order this invoice was created in. *(added v23.08)* +- **status** (string) (one of "paid", "expired", "unpaid"): State of invoice. +- **expires\_at** (u64): UNIX timestamp when invoice expires (or expired). +- **bolt11** (string, optional): BOLT11 string. +- **bolt12** (string, optional): BOLT12 string. +- **amount\_msat** (msat, optional): The amount required to pay this invoice. +- **description** (string, optional): Description used in the invoice. +- **updated\_index** (u64, optional): 1-based index indicating order this invoice was changed (only present if it has changed since creation). *(added v23.08)* If **bolt12** is present: - - - **local\_offer\_id** (hex, optional): offer for which this invoice was created - - **invreq\_payer\_note** (string, optional): the optional *invreq\_payer\_note* from invoice\_request which created this invoice + - **local\_offer\_id** (hex, optional): Offer for which this invoice was created. + - **invreq\_payer\_note** (string, optional): The optional *invreq\_payer\_note* from invoice\_request which created this invoice. If **status** is "paid": - - - **pay\_index** (u64): unique index for this invoice payment - - **amount\_received\_msat** (msat): how much was actually received - - **paid\_at** (u64): UNIX timestamp of when payment was received - - **payment\_preimage** (secret): SHA256 of this is the *payment\_hash* offered in the invoice - -[comment]: # (GENERATE-FROM-SCHEMA-END) + - **pay\_index** (u64): Unique index for this invoice payment. + - **amount\_received\_msat** (msat): How much was actually received. + - **paid\_at** (u64): UNIX timestamp of when payment was received. + - **payment\_preimage** (secret): SHA256 of this is the *payment\_hash* offered in the invoice. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "label": "invlabel2", + "bolt11": "lnbcrt420p1pja0tefsp5vvzg40t4g24l0eqk0jch7mc6jm3ec52ts8w8gwzpwtx9c8nv05rspp533e9csxurt7j9sn2cx7hsn6m00475qgrau8sux5r7djpdedwy2fshp5xqsmrtgfcwsnhxcxmf3tuc65kl6fxvqhvujfmxw2kpeh95yy2x8sxqyjw5qcqp99qxpqysgqgfjrz4q5zcq2lluxxg9h475mq2d3w0tpdstm5274zmhadjl8cqapylfskzk96apka5599a2flm90rmavsk7q8mhh87yle3sgh5vrlycq72fern", + "payment_hash": "8c725c40dc1afd22c26ac1bd784f5b7bebea0103ef0f0e1a83f36416e5ae2293", + "amount_msat": 42, + "status": "unpaid", + "expires_at": 1709238697, + "created_index": 3 +} +{ + "label": "keysend-1708640419.666098582", + "bolt11": "lnbcrt1pja0j9rsp5tg3zvj846gcdzw394njazq40s946sq2ur3hkl4xu4xudtjdtckxspp5fuunrfzsnyz2uxjmg2n95mqhghv4fpvv2kud3kvq4fkys3vmzu5sdqvddjhjum9dejqxqyjw5qcqp99qxpqysgqwt7r0gjlgt7zrfldc3um9myfc36acpqnsdn77c2m42facjtps30yufc5nsmwzhgexlj59f6xa5hess6e3tqrxynt9fejzj3rrshddtcqnappmj", + "payment_hash": "4f3931a4509904ae1a5b42a65a6c1745d954858c55b8d8d980aa6c48459b1729", + "status": "paid", + "pay_index": 1, + "amount_received_msat": 10000000, + "paid_at": 1708640419, + "payment_preimage": "b760af47f456a217e8dfda21a282f1f78c903487c1b21b3b318135f75aa3bf11", + "description": "keysend", + "expires_at": 1709245219, + "created_index": 1, + "updated_index": 1 +} +``` ERRORS ------ The following errors may be reported: -- -1: Database error. -- 905: An invoice with that label does not exist. -- 906: The invoice *status* does not match the parameter. - An error object will be returned as error *data*, containing - *current\_status* and *expected\_status* fields. - This is most likely due to the *status* of the invoice - changing just before this command is invoked. +- -1: Database error. +- 905: An invoice with that label does not exist. +- 906: The invoice *status* does not match the parameter. An error object will be returned as error *data*, containing *current\_status* and *expected\_status* fields. This is most likely due to the *status* of the invoice changing just before this command is invoked. - 908: The invoice already has no description, and *desconly* was set. AUTHOR @@ -67,13 +115,9 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-listinvoice(7), lightning-waitinvoice(7), -lightning-invoice(7), lightning-delexpiredinvoice(7), -lightning-autoclean-status(7) +lightning-listinvoice(7), lightning-waitinvoice(7), lightning-invoice(7), lightning-delexpiredinvoice(7), lightning-autoclean-status(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:de866707ddf6d47a646cf83f7c190a9f09f623d6d4e39dab01357c0074f6566c) diff --git a/doc/lightning-delpay.7.md b/doc/lightning-delpay.7.md index c82a196dad8e..87c8f8f55eb9 100644 --- a/doc/lightning-delpay.7.md +++ b/doc/lightning-delpay.7.md @@ -1,60 +1,136 @@ lightning-delpay -- Command for removing a completed or failed payment -============================================================ +====================================================================== SYNOPSIS -------- -**delpay** *payment\_hash* *status* [*partid* *groupid*] +**delpay** *payment\_hash* *status* [*partid* *groupid*] DESCRIPTION ----------- The **delpay** RPC command deletes a payment with the given `payment_hash` if its status is either `complete` or `failed`. If *partid* and *groupid* are not specified, all payment parts with matchin status are deleted. +- **payment\_hash** (hash): The unique identifier of a payment. +- **status** (string) (one of "complete", "failed"): Expected status of the payment. Only deletes if the payment status matches. Deleting a `pending` payment will return an error. +- **partid** (u64, optional): Specific partid to delete (must be paired with *groupid*). +- **groupid** (u64, optional): Specific groupid to delete (must be paired with *partid*). + EXAMPLE JSON REQUEST ------------- +-------------------- ```json { - "id": 82, + "id": "example:delpay#1", "method": "delpay", "params": { "payment_hash": "4fa2f1b001067ec06d7f95b8695b8acd9ef04c1b4d1110e3b94e1fa0687bb1e0", "status": "complete" } } +{ + "id": "example:delpay#2", + "method": "delpay", + "params": [ + "c9d4547473d0d646f1fdd8ca7f01803e4d31ceab01df33c79456f9c24b04034e", + "failed" + ] +} +{ + "id": "example:delpay#3", + "method": "delpay", + "params": { + "payment_hash": "bbc35e0a46d1483292a4ff8d4daaceaab8c3c084dd835be4128785b52e469c64", + "status": "complete", + "groupid": 1, + "partid": 1 + } +} ``` - RETURN VALUE ------------ -The returned format is the same as lightning-listsendpays(7). If the -payment is a multi-part payment (MPP) the command return a list of -payments will be returned -- one payment object for each partid. - -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **payments** is returned. It is an array of objects, where each object contains: - -- **created\_index** (u64): 1-based index indicating order this payment was created in *(added v23.11)* -- **id** (u64): old synonym for created\_index -- **payment\_hash** (hash): the hash of the *payment\_preimage* which will prove payment -- **status** (string): status of the payment (one of "pending", "failed", "complete") -- **amount\_sent\_msat** (msat): the amount we actually sent, including fees -- **created\_at** (u64): the UNIX timestamp showing when this payment was initiated -- **partid** (u64, optional): unique ID within this (multi-part) payment -- **destination** (pubkey, optional): the final destination of the payment if known -- **amount\_msat** (msat, optional): the amount the destination received, if known -- **updated\_index** (u64, optional): 1-based index indicating order this payment was changed (only present if it has changed since creation) *(added v23.11)* -- **completed\_at** (u64, optional): the UNIX timestamp showing when this payment was completed -- **groupid** (u64, optional): Grouping key to disambiguate multiple attempts to pay an invoice or the same payment\_hash -- **payment\_preimage** (secret, optional): proof of payment -- **label** (string, optional): the label, if given to sendpay -- **bolt11** (string, optional): the bolt11 string (if pay supplied one) -- **bolt12** (string, optional): the bolt12 string (if supplied for pay: **experimental-offers** only). -- **erroronion** (hex, optional): the error onion returned on failure, if any. - -[comment]: # (GENERATE-FROM-SCHEMA-END) +The returned format is the same as lightning-listsendpays(7). If the payment is a multi-part payment (MPP) the command return a list of payments will be returned -- one payment object for each partid. +On success, an object containing **payments** is returned. It is an array of objects, where each object contains: + +- **created\_index** (u64): 1-based index indicating order this payment was created in. *(added v23.11)* +- **id** (u64): Old synonym for created\_index. +- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. +- **status** (string) (one of "pending", "failed", "complete"): Status of the payment. +- **amount\_sent\_msat** (msat): The amount we actually sent, including fees. +- **created\_at** (u64): The UNIX timestamp showing when this payment was initiated. +- **partid** (u64, optional): Unique ID within this (multi-part) payment. +- **destination** (pubkey, optional): The final destination of the payment if known. +- **amount\_msat** (msat, optional): The amount the destination received, if known. +- **updated\_index** (u64, optional): 1-based index indicating order this payment was changed (only present if it has changed since creation). *(added v23.11)* +- **completed\_at** (u64, optional): The UNIX timestamp showing when this payment was completed. +- **groupid** (u64, optional): Grouping key to disambiguate multiple attempts to pay an invoice or the same payment\_hash. +- **payment\_preimage** (secret, optional): Proof of payment. +- **label** (string, optional): The label, if given to sendpay. +- **bolt11** (string, optional): The bolt11 string (if pay supplied one). +- **bolt12** (string, optional): The bolt12 string (if supplied for pay: **experimental-offers** only). +- **erroronion** (hex, optional): The error onion returned on failure, if any. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "payments": [ + { + "id": 1, + "payment_hash": "8dfd6538eeb33811c9114a75f792a143728d7f05643f38c3d574d3097e8910c0", + "destination": "0219f8900ee78a89f050c24d8b69492954f9fdbabed753710845eb75d3a75a5880", + "msatoshi": 1000, + "amount_msat": "1000msat", + "msatoshi_sent": 1000, + "amount_sent_msat": "1000msat", + "created_at": 1596224858, + "status": "complete", + "payment_preimage": "35bd4e2b481a1a84a22215b5372672cf81460a671816960ddb206464359e1822", + "bolt11": "lntb10n1p0jga20pp53h7k2w8wkvuprjg3ff6l0y4pgdeg6lc9vsln3s74wnfsjl5fzrqqdqdw3jhxazldahx2xqyjw5qcqp2sp5wut5jnhr6n7jd5747ky2g5flmw7hgx9yjnqzu60ps2jf6f7tc0us9qy9qsqu2a0k37nckl62005p69xavlkydkvhnypk4dphffy4x09zltwh9437ad7xkl83tefdarzhu5t30ju5s56wlrg97qkx404pq3srfc425cq3ke9af" + } + ] +} +{ + "payments": [ + { + "created_index": 2, + "id": 2, + "payment_hash": "c9d4547473d0d646f1fdd8ca7f01803e4d31ceab01df33c79456f9c24b04034e", + "groupid": 1, + "updated_index": 2, + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount_msat": 100000, + "amount_sent_msat": 100002, + "created_at": 1706316468, + "completed_at": 1706316471, + "status": "failed", + "bolt11": "lnbcrt1u1pjmg54nsp5ke626txv6wwwmqmpuy63t3jnu9hqxwj880zsfkkj7jjqagdaz2sqpp5e829garn6rtydu0amr987qvq8exnrn4tq80n83u52muuyjcyqd8qdq8v3jhxccxqyjw5qcqp99qxpqysgqalktfwy9svsamvvvrzzzzpdaa4rh7n6s5p7t9lx7qv0raz4vnm9knkh5ury3u5cmnhx2gms98nxkclm3833uhjrlnzmftc685vz2f0gpfnjy4y" + } + ] +} +{ + "payments": [ + { + "created_index": 3, + "id": 3, + "payment_hash": "bbc35e0a46d1483292a4ff8d4daaceaab8c3c084dd835be4128785b52e469c64", + "groupid": 1, + "updated_index": 3, + "partid": 1, + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount_msat": 100000, + "amount_sent_msat": 102100, + "created_at": 1708641193, + "completed_at": 1708641194, + "status": "complete", + "payment_preimage": "a6ebb1cfbf69e76200f196f1eafd28a3d850633499c223a7eb7a7dba3b995286" + } + ] +} +``` ERRORS ------ @@ -68,31 +144,6 @@ The following error codes may occur: - 211: Payment status mismatch. Check the correct status via **paystatus**; - 208: Payment with payment\_hash not found. -EXAMPLE JSON RESPONSE ------ - -```json -{ - "payments": [ - { - "id": 2, - "payment_hash": "8dfd6538eeb33811c9114a75f792a143728d7f05643f38c3d574d3097e8910c0", - "destination": "0219f8900ee78a89f050c24d8b69492954f9fdbabed753710845eb75d3a75a5880", - "msatoshi": 1000, - "amount_msat": "1000msat", - "msatoshi_sent": 1000, - "amount_sent_msat": "1000msat", - "created_at": 1596224858, - "status": "complete", - "payment_preimage": "35bd4e2b481a1a84a22215b5372672cf81460a671816960ddb206464359e1822", - "bolt11": "lntb10n1p0jga20pp53h7k2w8wkvuprjg3ff6l0y4pgdeg6lc9vsln3s74wnfsjl5fzrqqdqdw3jhxazldahx2xqyjw5qcqp2sp5wut5jnhr6n7jd5747ky2g5flmw7hgx9yjnqzu60ps2jf6f7tc0us9qy9qsqu2a0k37nckl62005p69xavlkydkvhnypk4dphffy4x09zltwh9437ad7xkl83tefdarzhu5t30ju5s56wlrg97qkx404pq3srfc425cq3ke9af" - } - ] -} - -``` - - AUTHOR ------ @@ -101,11 +152,9 @@ Vincenzo Palazzo <> is mainly responsible. SEE ALSO -------- -lightning-listpays(7), lightning-listsendpays(7), lightning-paystatus(7). +lightning-listpays(7), lightning-listsendpays(7), lightning-paystatus(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:87c307a83021fbdf026d7755ad803bfc9fc9cb9754f4384ee1a63e3dd7a8b776) diff --git a/doc/lightning-deprecations.7.md b/doc/lightning-deprecations.7.md index 55506b05b32a..9b55e86f422b 100644 --- a/doc/lightning-deprecations.7.md +++ b/doc/lightning-deprecations.7.md @@ -4,29 +4,26 @@ lightning-deprecations -- Command to enable/disable deprecated APIs SYNOPSIS -------- -**deprecations** *enable* +**deprecations** *enable* DESCRIPTION ----------- -(Added *v24.02*) +Command *added* in v24.02. -The **deprecations** RPC command overrides the global `allow-deprecated-apis` flag for further RPC commands on this same connection. In particular, setting *enable* to `false` will neither accept deprecated parameters or commands, nor output -deprecated fields. - -This is equivalent to the config option `allow-deprecated-apis`, but can -be used on useful for developer testing to ensure you don't accidentally rely on -deprecated features. +The **deprecations** RPC command is used to override global config option `allow-deprecated-apis` for further RPC commands on this same connection. This can be useful for developer testing to ensure you don't accidentally rely on deprecated features. +- **enable** (boolean): Flag to enable or disable deprecated APIs. Setting it to `false` will neither accept deprecated parameters or commands, nor output deprecated fields. EXAMPLE JSON REQUEST -------------------- + ```json { - "id": 82, + "id": "example:deprecations#1", "method": "deprecations", "params": { - "enable": false + "enable": false } } ``` @@ -34,6 +31,18 @@ EXAMPLE JSON REQUEST RETURN VALUE ------------ +On success, an empty object is returned. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{} +``` + +ERRORS +------ + On failure, one of the following error codes may be returned: - -32602: Error in given parameters. @@ -43,6 +52,11 @@ AUTHOR Rusty Russell <> wrote the initial version of this man page. +SEE ALSO +-------- + +lightningd-config(5), lightning-notifications(7) + RESOURCES --------- diff --git a/doc/lightning-disableinvoicerequest.7.md b/doc/lightning-disableinvoicerequest.7.md index b6ccca7f5b70..8d3f598f46ae 100644 --- a/doc/lightning-disableinvoicerequest.7.md +++ b/doc/lightning-disableinvoicerequest.7.md @@ -6,35 +6,31 @@ SYNOPSIS **(WARNING: experimental-offers only)** -**disableinvoicerequest** *invreq\_id* +**disableinvoicerequest** *invreq\_id* DESCRIPTION ----------- -The **disableinvoicerequest** RPC command disables an -invoice\_request, so that no further invoices will be accepted (and -thus, no further payments made).. +Command *added* in v22.11. -We currently don't support deletion of invoice\_requests, so they are -not forgotten entirely (there may be payments which refer to this -invoice\_request). +The **disableinvoicerequest** RPC command disables an invoice\_request, so that no further invoices will be accepted (and thus, no further payments made).. + +We currently don't support deletion of invoice\_requests, so they are not forgotten entirely (there may be payments which refer to this invoice\_request). + +- **invreq\_id** (string): A specific invoice can be disabled by providing the `invreq_id`, which is presented by lightning-invoicerequest(7). RETURN VALUE ------------ Note: the returned object is the same format as **listinvoicerequest**. - -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **invreq\_id** (hash): the SHA256 hash of all invoice\_request fields less than 160 -- **active** (boolean): whether the invoice\_request is currently active (always *false*) -- **single\_use** (boolean): whether the invoice\_request will become inactive after we pay an invoice for it -- **bolt12** (string): the bolt12 string starting with lnr -- **used** (boolean): whether the invoice\_request has already been used -- **label** (string, optional): the label provided when creating the invoice\_request - -[comment]: # (GENERATE-FROM-SCHEMA-END) +- **invreq\_id** (hash): The SHA256 hash of all invoice\_request fields less than 160. +- **active** (boolean) (always *false*): Whether the invoice\_request is currently active. +- **single\_use** (boolean): Whether the invoice\_request will become inactive after we pay an invoice for it. +- **bolt12** (string): The bolt12 string starting with lnr. +- **used** (boolean): Whether the invoice\_request has already been used. +- **label** (string, optional): The label provided when creating the invoice\_request. AUTHOR ------ @@ -44,11 +40,9 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-invoicerequest(7), lightning-listinvoicerequest(7). +lightning-invoicerequest(7), lightning-listinvoicerequest(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:364b694d88e34dbd9e8e7c2f2d1631acbc199c14b8cdf87364b4f7c517705dbf) diff --git a/doc/lightning-disableoffer.7.md b/doc/lightning-disableoffer.7.md index eae91ad3d951..d77e723f500d 100644 --- a/doc/lightning-disableoffer.7.md +++ b/doc/lightning-disableoffer.7.md @@ -6,26 +6,26 @@ SYNOPSIS **(WARNING: experimental-offers only)** -**disableoffer** *offer\_id* +**disableoffer** *offer\_id* DESCRIPTION ----------- -The **disableoffer** RPC command disables an offer, so that no further -invoices will be given out. +The **disableoffer** RPC command disables an offer, so that no further invoices will be given out. -We currently don't support deletion of offers, so offers are not -forgotten entirely (there may be invoices which refer to this offer). +We currently don't support deletion of offers, so offers are not forgotten entirely (there may be invoices which refer to this offer). + +- **offer\_id** (hash): The id we use to identify this offer. EXAMPLE JSON REQUEST ------------- +-------------------- ```json { - "id": 82, + "id": "example:disableoffer#1", "method": "disableoffer", "params": { - "offer_id": "713a16ccd4eb10438bdcfbc2c8276be301020dd9d489c530773ba64f3b33307d ", + "offer_id": "713a16ccd4eb10438bdcfbc2c8276be301020dd9d489c530773ba64f3b33307d" } } ``` @@ -34,31 +34,26 @@ RETURN VALUE ------------ Note: the returned object is the same format as **listoffers**. - -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **offer\_id** (hash): the merkle hash of the offer -- **active** (boolean): Whether the offer can produce invoices/payments (always *false*) -- **single\_use** (boolean): Whether the offer is disabled after first successful use -- **bolt12** (string): The bolt12 string representing this offer -- **used** (boolean): Whether the offer has had an invoice paid / payment made -- **label** (string, optional): The label provided when offer was created - -[comment]: # (GENERATE-FROM-SCHEMA-END) +- **offer\_id** (hash): The merkle hash of the offer. +- **active** (boolean) (always *false*): Whether the offer can produce invoices/payments. +- **single\_use** (boolean): Whether the offer is disabled after first successful use. +- **bolt12** (string): The bolt12 string representing this offer. +- **used** (boolean): Whether the offer has had an invoice paid / payment made. +- **label** (string, optional): The label provided when offer was created. EXAMPLE JSON RESPONSE ------ +--------------------- ```json { - "offer_id": "053a5c566fbea2681a5ff9c05a913da23e45b95d09ef5bd25d7d408f23da7084", - "active": false, - "single_use": false, - "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqvqcdgq2z9pk7enxv4jjqen0wgs8yatnw3ujz83qkc6rvp4j28rt3dtrn32zkvdy7efhnlrpr5rp5geqxs783wtlj550qs8czzku4nk3pqp6m593qxgunzuqcwkmgqkmp6ty0wyvjcqdguv3pnpukedwn6cr87m89t74h3auyaeg89xkvgzpac70z3m9rn5xzu28c", - "used": false + "offer_id": "053a5c566fbea2681a5ff9c05a913da23e45b95d09ef5bd25d7d408f23da7084", + "active": false, + "single_use": false, + "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqvqcdgq2z9pk7enxv4jjqen0wgs8yatnw3ujz83qkc6rvp4j28rt3dtrn32zkvdy7efhnlrpr5rp5geqxs783wtlj550qs8czzku4nk3pqp6m593qxgunzuqcwkmgqkmp6ty0wyvjcqdguv3pnpukedwn6cr87m89t74h3auyaeg89xkvgzpac70z3m9rn5xzu28c", + "used": false } - ``` AUTHOR @@ -69,11 +64,9 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-offer(7), lightning-listoffers(7). +lightning-offer(7), lightning-listoffers(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:b8d233fdc0130cb4768ee07176707ca24a6db8c863f65530cf0ec8f1b82d7462) diff --git a/doc/lightning-disconnect.7.md b/doc/lightning-disconnect.7.md index 8671c60d9b11..4ca0407410e5 100644 --- a/doc/lightning-disconnect.7.md +++ b/doc/lightning-disconnect.7.md @@ -4,28 +4,65 @@ lightning-disconnect -- Command for disconnecting from another lightning node SYNOPSIS -------- -**disconnect** *id* [*force*] +**disconnect** *id* [*force*] DESCRIPTION ----------- -The disconnect RPC command closes an existing connection to a peer, -identified by *id*, in the Lightning Network, as long as it doesn't have -an active channel. +The disconnect RPC command closes an existing connection to a peer, identified by *id*, in the Lightning Network, as long as it doesn't have an active channel. + +- **id** (pubkey): The public key of the peer to terminate the connection. It can be discovered in the output of the listpeers command, which returns a set of peers: + { + 'peers': + [ + { + 'id': '0563aea81...', + 'connected': true, + ... + } + ] + } +- **force** (boolean, optional): If set to True, it will disconnect even with an active channel. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:disconnect#1", + "method": "disconnect", + "params": { + "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "force": false + } +} +{ + "id": "example:disconnect#2", + "method": "disconnect", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "force": true + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an empty object is returned. -[comment]: # (GENERATE-FROM-SCHEMA-END) +EXAMPLE JSON RESPONSE +--------------------- + +```json +{} +{} +``` ERRORS ------ -On error the returned object will contain `code` and `message` properties, -with `code` being one of the following: +On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -32602: If the given parameters are wrong. - -1: Catchall nonspecific error. @@ -44,5 +81,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:b0793c2fa864b0ce3bc6f1618135f28ac551dfd1b8a0127caac73fd948e62d9d) diff --git a/doc/lightning-emergencyrecover.7.md b/doc/lightning-emergencyrecover.7.md index 31af839ffda3..285c09e003da 100644 --- a/doc/lightning-emergencyrecover.7.md +++ b/doc/lightning-emergencyrecover.7.md @@ -4,27 +4,52 @@ lightning-emergencyrecover -- Command for recovering channels from the emergency SYNOPSIS -------- -**emergencyrecover** +**emergencyrecover** DESCRIPTION ----------- -The **emergencyrecover** RPC command fetches data from the emergency.recover -file and tries to reconnect to the peer and force him to close the channel. -The data in this file has enough information to reconnect and sweep the funds. +The **emergencyrecover** RPC command fetches data from the emergency.recover file and tries to reconnect to the peer and force him to close the channel. The data in this file has enough information to reconnect and sweep the funds. -This recovery method is not spontaneous and it depends on the peer, so it should -be used as a last resort to recover the funds stored in a channel in case of severe -data loss. +This recovery method is not spontaneous and it depends on the peer, so it should be used as a last resort to recover the funds stored in a channel in case of severe data loss. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:emergencyrecover#1", + "method": "emergencyrecover", + "params": "{}" +} +{ + "id": "example:emergencyrecover#2", + "method": "emergencyrecover", + "params": "{}" +} +``` RETURN VALUE ------------ On success, an object is returned, containing: -- **stubs** (array of hexs): - - Each item is the channel ID of the channel successfully inserted +- **stubs** (array of hashs): + - (hash, optional): Channel IDs of channels successfully inserted. +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "stubs": [] +} +{ + "stubs": [ + "c00734472f344fdadd0bf787de182e5cf144ccda5d731b0f7c75befd1f1eff52" + ] +} +``` AUTHOR ------ @@ -40,5 +65,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:9cfaa9eb4609b36accc3e3b12a352c00ddd402307e4461f4df274146d12f6eb0) diff --git a/doc/lightning-feerates.7.md b/doc/lightning-feerates.7.md index bd26aa1324e6..774fe1abc879 100644 --- a/doc/lightning-feerates.7.md +++ b/doc/lightning-feerates.7.md @@ -4,102 +4,59 @@ lightning-feerates -- Command for querying recommended onchain feerates SYNOPSIS -------- -**feerates** *style* +**feerates** *style* DESCRIPTION ----------- -The **feerates** command returns the feerates that CLN will use. -The feerates will be based on the recommended feerates from the backend. -The backend may fail to provide estimates, but if it was able to provide -estimates in the past, CLN will continue to use those for a while. -CLN will also smoothen feerate estimations from the backend. +The **feerates** command returns the feerates that CLN will use. The feerates will be based on the recommended feerates from the backend. The backend may fail to provide estimates, but if it was able to provide estimates in the past, CLN will continue to use those for a while. CLN will also smoothen feerate estimations from the backend. -Explorers often present fees in "sat/vB": 4 sat/vB is `4000perkb` or -`1000perkw`. +Explorers often present fees in "sat/vB": 4 sat/vB is `4000perkb` or `1000perkw`. Bitcoin transactions have non-witness and witness bytes: -* Non-witness bytes count as 4 weight, 1 virtual byte. - All bytes other than SegWit witness count as non-witness bytes. -* Witness bytes count as 1 weight, 0.25 virtual bytes. +* Non-witness bytes count as 4 weight, 1 virtual byte. All bytes other than SegWit witness count as non-witness bytes. * Witness bytes count as 1 weight, 0.25 virtual bytes. Thus, all *perkb* feerates will be exactly 4 times *perkw* feerates. -To compute the fee for a transaction, multiply its weight or virtual bytes -by the appropriate *perkw* or *perkw* feerate -returned by this command, -then divide by 1000. - -There is currently no way to change these feerates from the RPC. -If you need custom control over onchain feerates, -you will need to provide your own plugin -that replaces the `bcli` plugin backend. -For commands like lightning-withdraw(7) or lightning-fundchannel(7) you -can provide a preferred feerate directly as a parameter, -which will override the recommended feerates returned by **feerates**. - -RETURN VALUE ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object is returned, containing: - -- **perkb** (object, optional): If *style* parameter was perkb: - - **min\_acceptable** (u32): The smallest feerate that we allow peers to specify: half the 100-block estimate - - **max\_acceptable** (u32): The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet). - - **floor** (u32): The smallest feerate that our backend tells us it will accept (i.e. minrelayfee or mempoolminfee) *(added v23.05)* - - **estimates** (array of objects): Feerate estimates from plugin which we are using (usuallly bcli) *(added v23.05)*: - - **blockcount** (u32): The number of blocks the feerate is expected to get a transaction in *(added v23.05)* - - **feerate** (u32): The feerate for this estimate, in given *style* *(added v23.05)* - - **smoothed\_feerate** (u32): The feerate, smoothed over time (useful for coordinating with other nodes) *(added v23.05)* - - **opening** (u32, optional): Default feerate for lightning-fundchannel(7) and lightning-withdraw(7) - - **mutual\_close** (u32, optional): Feerate to aim for in cooperative shutdown. Note that since mutual close is a **negotiation**, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer. - - **unilateral\_close** (u32, optional): Feerate for commitment\_transaction in a live channel which we originally funded - - **unilateral\_anchor\_close** (u32, optional): Feerate for commitment\_transaction in a live channel which we originally funded (if anchor\_outputs was negotiated) *(added v23.08)* - - **delayed\_to\_us** (u32, optional): Feerate for returning unilateral close funds to our wallet **deprecated in v23.05, removed after v24.05** - - **htlc\_resolution** (u32, optional): Feerate for returning unilateral close HTLC outputs to our wallet **deprecated in v23.05, removed after v24.05** - - **penalty** (u32, optional): Feerate to use when creating penalty tx for watchtowers -- **perkw** (object, optional): If *style* parameter was perkw: - - **min\_acceptable** (u32): The smallest feerate that you can use, usually the minimum relayed feerate of the backend - - **max\_acceptable** (u32): The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet). - - **floor** (u32): The smallest feerate that our backend tells us it will accept (i.e. minrelayfee or mempoolminfee) *(added v23.05)* - - **estimates** (array of objects): Feerate estimates from plugin which we are using (usuallly bcli) *(added v23.05)*: - - **blockcount** (u32): The number of blocks the feerate is expected to get a transaction in *(added v23.05)* - - **feerate** (u32): The feerate for this estimate, in given *style* *(added v23.05)* - - **smoothed\_feerate** (u32): The feerate, smoothed over time (useful for coordinating with other nodes) *(added v23.05)* - - **opening** (u32, optional): Default feerate for lightning-fundchannel(7) and lightning-withdraw(7) - - **mutual\_close** (u32, optional): Feerate to aim for in cooperative shutdown. Note that since mutual close is a **negotiation**, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer. - - **unilateral\_close** (u32, optional): Feerate for commitment\_transaction in a live channel which we originally funded (if anchor\_outputs was not negotiated) - - **unilateral\_anchor\_close** (u32, optional): Feerate for commitment\_transaction in a live channel which we originally funded (if anchor\_outputs was negotiated) *(added v23.08)* - - **delayed\_to\_us** (u32, optional): Feerate for returning unilateral close funds to our wallet **deprecated in v23.05, removed after v24.05** - - **htlc\_resolution** (u32, optional): Feerate for returning unilateral close HTLC outputs to our wallet **deprecated in v23.05, removed after v24.05** - - **penalty** (u32, optional): Feerate to use when creating penalty tx for watchtowers -- **onchain\_fee\_estimates** (object, optional): - - **opening\_channel\_satoshis** (u64): Estimated cost of typical channel open - - **mutual\_close\_satoshis** (u64): Estimated cost of typical channel close - - **unilateral\_close\_satoshis** (u64): Estimated cost of typical unilateral close (without HTLCs). If anchors are supported, this assumes a channel with anchors. - - **htlc\_timeout\_satoshis** (u64): Estimated cost of typical HTLC timeout transaction (non-anchors) - - **htlc\_success\_satoshis** (u64): Estimated cost of typical HTLC fulfillment transaction (non-anchors) - - **unilateral\_close\_nonanchor\_satoshis** (u64, optional): Estimated cost of non-anchor typical unilateral close (without HTLCs). *(added v23.08)* - -The following warnings may also be returned: - -- **warning\_missing\_feerates**: Some fee estimates are missing - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -ERRORS ------- - -The **feerates** command will never error, -however some fields may be missing in the result -if feerate estimates for that kind of transaction are unavailable. +To compute the fee for a transaction, multiply its weight or virtual bytes by the appropriate *perkw* or *perkw* feerate returned by this command, then divide by 1000. + +There is currently no way to change these feerates from the RPC. If you need custom control over onchain feerates, you will need to provide your own plugin that replaces the `bcli` plugin backend. For commands like lightning-withdraw(7) or lightning-fundchannel(7) you can provide a preferred feerate directly as a parameter, which will override the recommended feerates returned by **feerates**. + +- **style** (string) (one of "perkb", "perkw"): Fee rate style to use. This can be: + *perkw* - provide feerate in units of satoshis per 1000 weight (e.g. the minimum fee is usually `253perkw`). + *perkb* - provide feerate in units of satoshis per 1000 virtual bytes (eg. the minimum fee is usually `1000perkb`). + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:feerates#1", + "method": "feerates", + "params": { + "style": "perkw", + "urgent": null, + "normal": null, + "slow": null + } +} +{ + "id": "example:feerates#2", + "method": "feerates", + "params": { + "style": "perkb", + "urgent": null, + "normal": null, + "slow": null + } +} +``` NOTES ----- -Many other commands have a *feerate* parameter. This can be: +Many other commands have a *feerate* parameter. This can be: * One of the strings to use lightningd's internal estimates: * *urgent* (next 6 blocks or so) @@ -111,32 +68,162 @@ Many other commands have a *feerate* parameter. This can be: * *blocks* means aim for confirmation in that many blocks (added in v23.05) * *perkw* means the number is interpreted as satoshi-per-kilosipa (weight) * *perkb* means it is interpreted bitcoind-style as satoshi-per-kilobyte. - + Omitting the suffix is equivalent to *perkb*. +RETURN VALUE +------------ + +On success, an object is returned, containing: + +- **perkb** (object, optional): If *style* parameter was perkb.: + - **min\_acceptable** (u32): The smallest feerate that we allow peers to specify: half the 100-block estimate. + - **max\_acceptable** (u32): The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet). + - **floor** (u32): The smallest feerate that our backend tells us it will accept (i.e. minrelayfee or mempoolminfee). *(added v23.05)* + - **estimates** (array of objects): Feerate estimates from plugin which we are using (usuallly bcli). *(added v23.05)*: + - **blockcount** (u32): The number of blocks the feerate is expected to get a transaction in. *(added v23.05)* + - **feerate** (u32): The feerate for this estimate, in given *style*. *(added v23.05)* + - **smoothed\_feerate** (u32): The feerate, smoothed over time (useful for coordinating with other nodes). *(added v23.05)* + - **opening** (u32, optional): Default feerate for lightning-fundchannel(7) and lightning-withdraw(7). + - **mutual\_close** (u32, optional): Feerate to aim for in cooperative shutdown. Note that since mutual close is a **negotiation**, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer. + - **unilateral\_close** (u32, optional): Feerate for commitment\_transaction in a live channel which we originally funded. + - **unilateral\_anchor\_close** (u32, optional): Feerate for commitment\_transaction in a live channel which we originally funded (if anchor\_outputs was negotiated). *(added v23.08)* + - **delayed\_to\_us** (u32, optional): Feerate for returning unilateral close funds to our wallet. **deprecated in v23.05, removed after v24.05** + - **htlc\_resolution** (u32, optional): Feerate for returning unilateral close HTLC outputs to our wallet. **deprecated in v23.05, removed after v24.05** + - **penalty** (u32, optional): Feerate to use when creating penalty tx for watchtowers. +- **perkw** (object, optional): If *style* parameter was perkw.: + - **min\_acceptable** (u32): The smallest feerate that you can use, usually the minimum relayed feerate of the backend. + - **max\_acceptable** (u32): The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet). + - **floor** (u32): The smallest feerate that our backend tells us it will accept (i.e. minrelayfee or mempoolminfee). *(added v23.05)* + - **estimates** (array of objects): Feerate estimates from plugin which we are using (usuallly bcli). *(added v23.05)*: + - **blockcount** (u32): The number of blocks the feerate is expected to get a transaction in. *(added v23.05)* + - **feerate** (u32): The feerate for this estimate, in given *style*. *(added v23.05)* + - **smoothed\_feerate** (u32): The feerate, smoothed over time (useful for coordinating with other nodes). *(added v23.05)* + - **opening** (u32, optional): Default feerate for lightning-fundchannel(7) and lightning-withdraw(7). + - **mutual\_close** (u32, optional): Feerate to aim for in cooperative shutdown. Note that since mutual close is a **negotiation**, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer. + - **unilateral\_close** (u32, optional): Feerate for commitment\_transaction in a live channel which we originally funded (if anchor\_outputs was not negotiated). + - **unilateral\_anchor\_close** (u32, optional): Feerate for commitment\_transaction in a live channel which we originally funded (if anchor\_outputs was negotiated). *(added v23.08)* + - **delayed\_to\_us** (u32, optional): Feerate for returning unilateral close funds to our wallet. **deprecated in v23.05, removed after v24.05** + - **htlc\_resolution** (u32, optional): Feerate for returning unilateral close HTLC outputs to our wallet. **deprecated in v23.05, removed after v24.05** + - **penalty** (u32, optional): Feerate to use when creating penalty tx for watchtowers. +- **onchain\_fee\_estimates** (object, optional): + - **opening\_channel\_satoshis** (u64): Estimated cost of typical channel open. + - **mutual\_close\_satoshis** (u64): Estimated cost of typical channel close. + - **unilateral\_close\_satoshis** (u64): Estimated cost of typical unilateral close (without HTLCs). If anchors are supported, this assumes a channel with anchors. + - **htlc\_timeout\_satoshis** (u64): Estimated cost of typical HTLC timeout transaction (non-anchors). + - **htlc\_success\_satoshis** (u64): Estimated cost of typical HTLC fulfillment transaction (non-anchors). + - **unilateral\_close\_nonanchor\_satoshis** (u64, optional): Estimated cost of non-anchor typical unilateral close (without HTLCs). *(added v23.08)* + +The following warnings may also be returned: + +- **warning\_missing\_feerates**: Some fee estimates are missing. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "perkw": { + "opening": 1000000, + "mutual_close": 26362, + "unilateral_close": 26362, + "unilateral_anchor_close": 1000000, + "penalty": 26362, + "min_acceptable": 3750, + "max_acceptable": 10000000, + "floor": 253, + "estimates": [ + { + "blockcount": 2, + "feerate": 1000000, + "smoothed_feerate": 26362 + }, + { + "blockcount": 6, + "feerate": 1000000, + "smoothed_feerate": 26362 + }, + { + "blockcount": 12, + "feerate": 1000000, + "smoothed_feerate": 26362 + }, + { + "blockcount": 100, + "feerate": 1000000, + "smoothed_feerate": 26362 + } + ] + }, + "onchain_fee_estimates": { + "opening_channel_satoshis": 702000, + "mutual_close_satoshis": 17741, + "unilateral_close_satoshis": 1112000, + "unilateral_close_nonanchor_satoshis": 15764, + "htlc_timeout_satoshis": 17478, + "htlc_success_satoshis": 18532 + } +} +{ + "perkb": { + "opening": 25000, + "mutual_close": 25000, + "unilateral_close": 44000, + "unilateral_anchor_close": 25000, + "penalty": 25000, + "min_acceptable": 12500, + "max_acceptable": 600000, + "floor": 1012, + "estimates": [ + { + "blockcount": 2, + "feerate": 60000, + "smoothed_feerate": 60000 + }, + { + "blockcount": 6, + "feerate": 44000, + "smoothed_feerate": 44000 + }, + { + "blockcount": 12, + "feerate": 25000, + "smoothed_feerate": 25000 + } + ] + }, + "onchain_fee_estimates": { + "opening_channel_satoshis": 4387, + "mutual_close_satoshis": 4206, + "unilateral_close_satoshis": 6578, + "unilateral_close_nonanchor_satoshis": 6578, + "htlc_timeout_satoshis": 7293, + "htlc_success_satoshis": 7733 + } +} +``` + +ERRORS +------ + +The **feerates** command will never error, however some fields may be missing in the result if feerate estimates for that kind of transaction are unavailable. + TRIVIA ------ -In C-lightning we like to call the weight unit "sipa" -in honor of Pieter Wuille, -who uses the name "sipa" on IRC and elsewhere. -Internally we call the *perkw* style as "feerate per kilosipa". +In C-lightning we like to call the weight unit "sipa" in honor of Pieter Wuille, who uses the name "sipa" on IRC and elsewhere. Internally we call the *perkw* style as "feerate per kilosipa". AUTHOR ------ -ZmnSCPxj <> wrote the initial version of this -manpage. +ZmnSCPxj <> wrote the initial version of this manpage. SEE ALSO -------- -lightning-parsefeerate(7), lightning-fundchannel(7), lightning-withdraw(7), -lightning-txprepare(7), lightning-fundchannel\_start(7). +lightning-parsefeerate(7), lightning-fundchannel(7), lightning-withdraw(7), lightning-txprepare(7), lightning-fundchannel\_start(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:e0da3f19e5ae27cebe038c1c7c3188405a56bf283ef4d897bf8fb9d63f9b3039) diff --git a/doc/lightning-fetchinvoice.7.md b/doc/lightning-fetchinvoice.7.md index 0207cf66b0d6..ccd253c48c14 100644 --- a/doc/lightning-fetchinvoice.7.md +++ b/doc/lightning-fetchinvoice.7.md @@ -6,40 +6,90 @@ SYNOPSIS **(WARNING: experimental-offers only)** -**fetchinvoice** *offer* [*amount\_msat*] [*quantity*] [*recurrence\_counter*] [*recurrence\_start*] [*recurrence\_label*] [*timeout*] [*payer\_note*] +**fetchinvoice** *offer* [*amount\_msat*] [*quantity*] [*recurrence\_counter*] [*recurrence\_start*] [*recurrence\_label*] [*timeout*] [*payer\_note*] DESCRIPTION ----------- -The **fetchinvoice** RPC command contacts the issuer of an *offer* to get -an actual invoice that can be paid. It highlights any changes between the -offer and the returned invoice. - -If **fetchinvoice-noconnect** is not specified in the configuation, it -will connect to the destination in the (currently common!) case where it -cannot find a route which supports `option_onion_messages`. +The **fetchinvoice** RPC command contacts the issuer of an *offer* to get an actual invoice that can be paid. It highlights any changes between the offer and the returned invoice. + +If **fetchinvoice-noconnect** is not specified in the configuation, it will connect to the destination in the (currently common!) case where it cannot find a route which supports `option_onion_messages`. + +- **offer** (string): Offer string to get an actual invoice that can be paid. +- **amount\_msat** (msat, optional): Required if the offer does not specify an amount at all, otherwise it is optional (but presumably if you set it to less than the offer, you will get an error from the issuer). +- **quantity** (u64, optional): Required if the offer specifies quantity\_max, otherwise it is not allowed. +- **recurrence\_counter** (u64, optional): Required if the offer specifies recurrence, otherwise it is not allowed. recurrence\_counter should first be set to 0, and incremented for each successive invoice in a given series. +- **recurrence\_start** (number, optional): Required if the offer specifies recurrence\_base with start\_any\_period set, otherwise it is not allowed. It indicates what period number to start at. +- **recurrence\_label** (string, optional): Required if recurrence\_counter is set, and otherwise is not allowed. It must be the same as prior fetchinvoice calls for the same recurrence, as it is used to link them together. +- **timeout** (number, optional): If we don't get a reply before this we fail (default, 60 seconds). +- **payer\_note** (string, optional): To ask the issuer to include in the fetched invoice. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:fetchinvoice#1", + "method": "fetchinvoice", + "params": { + "offer": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqypq5zmnd9khqmr9yp6x2um5zcssxhftzxfdlwsnfcgw2sy8t5mxa0ytcdfat2nkdwqvpy9nnsa9mzza", + "payer_note": "Thanks for the fish!" + } +} +{ + "id": "example:fetchinvoice#2", + "method": "fetchinvoice", + "params": { + "offer": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqypq5zmnd9khqmr9yp6x2um5zcssxhftzxfdlwsnfcgw2sy8t5mxa0ytcdfat2nkdwqvpy9nnsa9mzza", + "amount_msat": 3 + } +} +{ + "id": "example:fetchinvoice#3", + "method": "fetchinvoice", + "params": { + "offer": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqypq5zmnd9khqmr9yp6x2um5zsqs593pqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4j", + "quantity": 2 + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **invoice** (string): The BOLT12 invoice we fetched -- **changes** (object): Summary of changes from offer: - - **description\_appended** (string, optional): extra characters appended to the *description* field. - - **description** (string, optional): a completely replaced *description* field - - **vendor\_removed** (string, optional): The *vendor* from the offer, which is missing in the invoice - - **vendor** (string, optional): a completely replaced *vendor* field - - **amount\_msat** (msat, optional): the amount, if different from the offer amount multiplied by any *quantity* (or the offer had no amount, or was not in BTC). -- **next\_period** (object, optional): Only for recurring invoices if the next period is under the *recurrence\_limit*: - - **counter** (u64): the index of the next period to fetchinvoice - - **starttime** (u64): UNIX timestamp that the next period starts - - **endtime** (u64): UNIX timestamp that the next period ends - - **paywindow\_start** (u64): UNIX timestamp of the earliest time that the next invoice can be fetched - - **paywindow\_end** (u64): UNIX timestamp of the latest time that the next invoice can be fetched - -[comment]: # (GENERATE-FROM-SCHEMA-END) +- **invoice** (string): The BOLT12 invoice we fetched. +- **changes** (object): Summary of changes from offer.: + - **description\_appended** (string, optional): Extra characters appended to the *description* field. + - **description** (string, optional): A completely replaced *description* field. + - **vendor\_removed** (string, optional): The *vendor* from the offer, which is missing in the invoice. + - **vendor** (string, optional): A completely replaced *vendor* field. + - **amount\_msat** (msat, optional): The amount, if different from the offer amount multiplied by any *quantity* (or the offer had no amount, or was not in BTC). +- **next\_period** (object, optional): Only for recurring invoices if the next period is under the *recurrence\_limit*.: + - **counter** (u64): The index of the next period to fetchinvoice. + - **starttime** (u64): UNIX timestamp that the next period starts. + - **endtime** (u64): UNIX timestamp that the next period ends. + - **paywindow\_start** (u64): UNIX timestamp of the earliest time that the next invoice can be fetched. + - **paywindow\_end** (u64): UNIX timestamp of the latest time that the next invoice can be fetched. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "invoice": "lni1qqgvcm9h7yakcmw4mzazspu8vfgpwq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqgzpg9hx6tdwpkx2gr5v4ehg93pqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky965pqqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy84sggren772kj8mau5jp86nc6fszx48rv7ep0quszyyls8rlld3sshjr94j9z5dpsku6mnypnx7u3qw35x2grxd9eksgdqnqp462c3jt0m5y6wzrj5pp6axehtez7r20265antsrqfpvuu8fwcshgr0tsv8e6829e8xmv7laz0kwhtlx6vtk8q3d6rtthdhtwvnn6j585szquc2t7us8kguxypzasg8ewkakgx2ny5ugks0f32x67sm9e5fms4asqrylajc2dqh8ag55mv5p5ghy3e2z8zwmllle8uu7jsxv5ke8d6rr5h7kthmz7ya0hxp4nt7elvw7vghcl6fgsuqqqqqqqqqqqqqqq9qqqqqqqqqqqqq8fykt06c5sqqqqqpfqyvhtunn4gyzy0lphn4wn6ctzlsajy46wscjcglf3hxcnvlaxqs3ydkhgaklsc42spq2czzq6a9vge9ha6zd8ppe2qsawnvm4u30p484d2we4cpsyskwwr5hvgthcyqyuen02ejwpa9cjjrttvp223yxsqkrwnlaszkhas84w0ape300ued4p75xu3cqtcg0cslsx9fvh7dhdqx565t6wa0alf6u2hug90j2hs", + "changes": {} +} +{ + "invoice": "lni1qqg0mfchkz0gkmn8zzu5zaxd0qvlzq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqgzpg9hx6tdwpkx2gr5v4ehg93pqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky965pqqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy84yqgrtqss8d4vgzd3286u9rk0zg9qr7a6z2xm6mjnz9pydztcn0j74tjvch0f5zvqxhftzxfdlwsnfcgw2sy8t5mxa0ytcdfat2nkdwqvpy9nnsa9mzzaqth4fzjqxxmsaxvc4v2urs6hsh6k0e564x00g68vuyp5w7yjedzxvqgr8ltzmj0n7ltxr0tz9rafn9zcy9jldjqfuf20w6gjmr7nj04d360sqvkdwprxn22dlp3xay9yq4nhrw2jm0c8t6r7japhdad6leawxyqzkg92tx8gqxp9f2d8j5k2axta0gr7yr9zrsqqqqqqqqqqqqqqq5qqqqqqqqqqqqqayjedltzjqqqqqq9yq3ja0jwj4qswt3kgs9mxq7gck66x60m5rndykpw3a7hf4ntlp9qe2vgwzzrvcwd2qypmqggrt543ryklhgf5uy89gzr46dnwhj9ux5744fmxhqxqjzeecwja3pwlqsxyjcdwur4hl4qf7nsjgg8euvy45lznufh5kydkwz6llsucuhvwp9ezeggaj3k057ge6ftvaffjkwn6j3y7faeuysrx3m2xccphu65sx", + "changes": {} +} +{ + "invoice": "lni1qqgd508mv9rpjg2ec8dr8qcslf2cjq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqgzpg9hx6tdwpkx2gr5v4ehg9qppgtzzq3dygmzpg6e53ll0aavg37gt3rvjg762vufygdqq4xprs0regcat9gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02cqsykppqfkyy6q8ry9pchxtuajh456hhcf7dxx733cx76etuv5ftfmfa2ymhgycqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jq6uhkeymz26zx7zgw4gdmw2vj9xqn4hu2sqxhp0pcgt87pf9chyfvqsywtejxjh603kx7am3zaf6d6xuumw30p8zmcdz7r95nn4lr92exk3qqe2x6xqwpdzh2zwq3vnyra8nfc6d7y6hegpkvc7p2nulj7hvhwl5hjfr23wn60mjftqspn7d4ejhrpsr5m2y8qqqqqqqqqqqqqqqpgqqqqqqqqqqqqp6f9jm7k9yqqqqqq2gpr96l9mt2pqxuyr0gqw92h0xz2y2uy5uxss4ujcac5jehj9ay2sxkapr80t5ha65qgykqssytfzxcs2xkdy0lml0tzy0jzugmyj8kjn8zfzrgq9fsgurc72x82e7pqxhl4u29cjluw5s8fwa9wtvh0qytr7vqk0vtndsz07mrrtmjw629m8mnqkjaf43kt889qeq2f7deu6t853lngpzclapt8nj0g528v9ay", + "changes": {} +} +``` ERRORS ------ @@ -60,11 +110,9 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-sendinvoice(7), lightning-pay(7). +lightning-sendinvoice(7), lightning-pay(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:fb90f5792c2d809ee17e8bc4c838802404a1bc2c0900516cce8393fc440fecb8) diff --git a/doc/lightning-fundchannel.7.md b/doc/lightning-fundchannel.7.md index 236ba95b52ef..79097f2c62e8 100644 --- a/doc/lightning-fundchannel.7.md +++ b/doc/lightning-fundchannel.7.md @@ -4,107 +4,145 @@ lightning-fundchannel -- Command for establishing a lightning channel SYNOPSIS -------- -**fundchannel** *id* *amount* [*feerate*] [*announce*] [*minconf*] -[*utxos*] [*push\_msat*] [*close\_to*] [*request\_amt*] [*compact\_lease*] -[*reserve*] [*channel\_type*] +**fundchannel** *id* *amount* [*feerate*] [*announce*] [*minconf*] [*push\_msat*] [*close\_to*] [*request\_amt*] [*compact\_lease*] [*utxos*] [*mindepth*] [*reserve*] [*channel\_type*] DESCRIPTION ----------- -The **fundchannel** RPC command opens a payment channel with a peer by committing a -funding transaction to the blockchain as defined in BOLT #2. - -If not already connected, **fundchannel** will automatically attempt to connect if -Core Lightning knows a way to contact the node (either from normal gossip, or from -a previous **connect** call). - -This auto-connection can fail if Core Lightning does not know how to contact the -target node; see lightning-connect(7). - -*feerate* is an optional feerate used for the opening transaction and -(unless *option\_anchors\_zero\_fee\_htlc\_tx* is negotiated), as initial feerate -for commitment and HTLC transactions (see NOTES in lightning-feerates(7)). -The default is *normal*. - -*announce* is an optional flag that triggers whether to announce this -channel or not. Defaults to `true`. An unannounced channel is considered -private. - -*minconf* specifies the minimum number of confirmations that used -outputs should have. Default is 1. - -*utxos* specifies the utxos to be used to fund the channel, as an array -of "txid:vout". - -*push\_msat* is the amount of millisatoshis to push to the channel peer at -open. Note that this is a gift to the peer -- these satoshis are -added to the initial balance of the peer at channel start and are largely -unrecoverable once pushed. - -*close\_to* is a Bitcoin address to which the channel funds should be sent to -on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. -Returns `close_to` set to closing script iff is negotiated. - -*request\_amt* is an amount of liquidity you'd like to lease from the peer. -If peer supports `option_will_fund`, indicates to them to include this -much liquidity into the channel. Must also pass in *compact\_lease*. - -*compact\_lease* is a compact representation of the peer's expected -channel lease terms. If the peer's terms don't match this set, we will -fail to open the channel. - -*reserve* is the amount we want the peer to maintain on its side of the channel. -Default is 1% of the funding amount. It can be a whole number, a whole number -ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 -decimal places ending in *btc*. - -*channel\_type* *(added v24.02)* is an array of bit numbers, representing the explicit -channel type to request. There is currently no sanity checking on -this value so if you use strange values and your channel breaks, you -get to keep both pieces. BOLT 2 defines the following value types: - +The **fundchannel** RPC command opens a payment channel with a peer by committing a funding transaction to the blockchain as defined in BOLT #2. + +If not already connected, **fundchannel** will automatically attempt to connect if Core Lightning knows a way to contact the node (either from normal gossip, or from a previous **connect** call). + +This auto-connection can fail if Core Lightning does not know how to contact the target node; see lightning-connect(7). + +Once the transaction is confirmed, normal channel operations may begin. Readiness is indicated by **listpeers** reporting a *state* of `CHANNELD_NORMAL` for the channel. + +- **id** (pubkey): Id is the peer id obtained from connect. +- **amount** (msat\_or\_all): The amount in satoshis taken from the internal wallet to fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency- msat` as change). The string *all* can be used to specify all available funds (or 16777215 satoshi if more is available and large channels were not negotiated with the peer). Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The value cannot be less than the dust limit, currently set to 546, nor more than 16777215 satoshi (unless large channels were negotiated with the peer). +- **feerate** (feerate, optional): Used for the opening transaction and (unless *option\_anchors\_zero\_fee\_htlc\_tx* is negotiated), as initial feerate for commitment and HTLC transactions (see NOTES in lightning-feerates(7)). The default is *normal*. +- **announce** (boolean, optional): Whether to announce this channel or not. An unannounced channel is considered private. The default is True. +- **minconf** (u32, optional): The minimum number of confirmations that used outputs should have. The default is 1. +- **push\_msat** (msat, optional): The amount of millisatoshis to push to the channel peer at open. Note that this is a gift to the peer -- these satoshis are added to the initial balance of the peer at channel start and are largely unrecoverable once pushed. +- **close\_to** (string, optional): A Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. Returns `close_to` set to closing script iff is negotiated. +- **request\_amt** (msat, optional): An amount of liquidity you'd like to lease from the peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact\_lease*. +- **compact\_lease** (string, optional): A compact representation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel. +- **utxos** (array of outpoints, optional): The utxos to be used to fund the channel, as an array of `txid:vout`.: + - (outpoint, optional) +- **mindepth** (u32, optional): Number of confirmations required before we consider the channel active. +- **reserve** (msat, optional): The amount we want the peer to maintain on its side of the channel. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The default is 1% of the funding amount. +- **channel\_type** (array of u32s, optional) *(added v24.02)*: + - (u32, optional): Represents the explicit channel type to request. There is currently no sanity checking on this value so if you use strange values and your channel breaks, you get to keep both pieces. BOLT 2 defines the following value types: + `` + The currently defined basic types are: + - no features (no bits set). + - `option_static_remotekey` (bit 12). + - `option_anchor_outputs` and `option_static_remotekey` (bits 20 and 12). + - `option_anchors_zero_fee_htlc_tx` and `option_static_remotekey` (bits 22 and 12). + + Each basic type has the following variations allowed: + - `option_scid_alias` (bit 46). + - `option_zeroconf` (bit 50). + `` + +EXAMPLE USAGE +------------- + +This example shows how to use lightning-cli to open new channel with peer 03f...fc1 from one whole utxo bcc1...39c:0 (you can use **listfunds** command to get txid and vout): + +```shell +lightning-cli -k fundchannel id=03f...fc1 amount=all feerate=normal utxos='["bcc1...39c:0"]' ``` -The currently defined basic types are: - - no features (no bits set) - - `option_static_remotekey` (bit 12) - - `option_anchor_outputs` and `option_static_remotekey` (bits 20 and 12) - - `option_anchors_zero_fee_htlc_tx` and `option_static_remotekey` (bits 22 and 12) - -Each basic type has the following variations allowed: - - `option_scid_alias` (bit 46) - - `option_zeroconf` (bit 50) -``` - -EXAMPLE -------- -This example shows how to use lightning-cli to open new channel with peer 03f...fc1 from one whole utxo bcc1...39c:0 -(you can use **listfunds** command to get txid and vout): - - lightning-cli -k fundchannel id=03f...fc1 amount=all feerate=normal utxos='["bcc1...39c:0"]' +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:fundchannel#1", + "method": "fundchannel", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount": 1000000, + "feerate": null, + "announce": true, + "minconf": null, + "utxos": null, + "push_msat": null, + "close_to": null, + "request_amt": null, + "compact_lease": null, + "mindepth": null, + "reserve": null + } +} +{ + "id": "example:fundchannel#2", + "method": "fundchannel", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount": 10000000, + "feerate": null, + "announce": true, + "minconf": null, + "utxos": null, + "push_msat": 1000000000, + "close_to": null, + "request_amt": null, + "compact_lease": null, + "mindepth": null, + "reserve": null, + "channel_type": null + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **tx** (hex): The raw transaction which funded the channel -- **txid** (txid): The txid of the transaction which funded the channel -- **outnum** (u32): The 0-based output index showing which output funded the channel -- **channel\_id** (hex): The channel\_id of the resulting channel (always 64 characters) -- **channel\_type** (object): channel\_type as negotiated with peer *(added v24.02)*: - - **bits** (array of u32s): Each bit set in this channel\_type *(added v24.02)*: - - Bit number - - **names** (array of strings): Feature name for each bit set in this channel\_type *(added v24.02)*: - - Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even") -- **close\_to** (hex, optional): The raw scriptPubkey which mutual close will go to; only present if *close\_to* parameter was specified and peer supports `option_upfront_shutdown_script` +- **tx** (hex): The raw transaction which funded the channel. +- **txid** (txid): The txid of the transaction which funded the channel. +- **outnum** (u32): The 0-based output index showing which output funded the channel. +- **channel\_id** (hash): The channel\_id of the resulting channel. +- **channel\_type** (object): Channel\_type as negotiated with peer. *(added v24.02)*: + - **bits** (array of u32s): Each bit set in this channel\_type. *(added v24.02)*: + - (u32, optional): Bit number. + - **names** (array of strings): Feature name for each bit set in this channel\_type. *(added v24.02)*: + - (string, optional) (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even"): Name of feature bit. +- **close\_to** (hex, optional): The raw scriptPubkey which mutual close will go to; only present if *close\_to* parameter was specified and peer supports `option_upfront_shutdown_script`. - **mindepth** (u32, optional): Number of confirmations before we consider the channel active. -[comment]: # (GENERATE-FROM-SCHEMA-END) +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "tx": "020000000001014ca47b75e6982fce6b5ebb6e7ec163dc5b6bed1562934e6febe816103b2b207e0000000000fdffffff0240420f00000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd012f0f000000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a02473044022058fc4d51c8254d37b266d3db3f8fda7420882b6ec9226d66b8c0139f2707c09602205798d8ce23d4c692a7384362a2e0afd9703f062239a786d7a1840a28d3a1152e012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000", + "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b", + "channel_id": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "outnum": 0 +} +{ + "tx": "0200000000010141cfa0e9957c7c6d0bb5069d92937f9545e6e6ee9b4650f47f509d5ea65df4690100000000fdffffff0280969800000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd4118530b0000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a0247304402206488c7dfbc4180781ed0d5ca7ff2c8ce134480c349d03978765053a393229d9a022066c75dee1f19b410ea1c7756d0cb2c097e52b13f4d9bbd033efa4ed95d817e14012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000", + "txid": "6aa1231b6356777468a55aea1f49dad6415592aef6c1e652f8a64357c7235301", + "channel_id": "015323c75743a6f852e6c1f6ae925541d6da491fea5aa568747756631b23a16a", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "outnum": 0 +} +``` ERRORS -------- +------ The following error codes may occur: @@ -115,18 +153,14 @@ The following error codes may occur: - 303: Broadcasting of the funding transaction failed, the internal call to bitcoin-cli returned with an error. - 313: The `min-emergency-msat` reserve not be preserved (and we have or are opening anchor channels). -Failure may also occur if **lightningd** and the peer cannot agree on -channel parameters (funding limits, channel reserves, fees, etc.). +Failure may also occur if **lightningd** and the peer cannot agree on channel parameters (funding limits, channel reserves, fees, etc.). SEE ALSO -------- -lightning-connect(7), lightning-listfunds(), lightning-listpeers(7), -lightning-feerates(7), lightning-multifundchannel(7) +lightning-connect(7), lightning-listfunds(), lightning-listpeers(7), lightning-feerates(7), lightning-multifundchannel(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:b890bd25970e8e1ef92812daa89a25ded100173f9ab411492a87d6cd268ee32d) diff --git a/doc/lightning-fundchannel_cancel.7.md b/doc/lightning-fundchannel_cancel.7.md index 1bc2e177bf00..260f0b16658a 100644 --- a/doc/lightning-fundchannel_cancel.7.md +++ b/doc/lightning-fundchannel_cancel.7.md @@ -4,44 +4,67 @@ lightning-fundchannel\_cancel -- Command for completing channel establishment SYNOPSIS -------- -**fundchannel\_cancel** *id* +**fundchannel\_cancel** *id* DESCRIPTION ----------- -`fundchannel_cancel` is a lower level RPC command. It allows channel opener -to cancel a channel before funding broadcast with a connected peer. +`fundchannel_cancel` is a lower level RPC command. It allows channel opener to cancel a channel before funding broadcast with a connected peer. -Note that the funding transaction MUST NOT be broadcast before -`fundchannel_cancel`. Broadcasting transaction before `fundchannel_cancel` -WILL lead to unrecoverable loss of funds. +Note that the funding transaction MUST NOT be broadcast before `fundchannel_cancel`. Broadcasting transaction before `fundchannel_cancel` WILL lead to unrecoverable loss of funds. -If `fundchannel_cancel` is called after `fundchannel_complete`, the remote -peer may disconnect when command succeeds. In this case, user need to connect -to remote peer again before opening channel. +If `fundchannel_cancel` is called after `fundchannel_complete`, the remote peer may disconnect when command succeeds. In this case, user need to connect to remote peer again before opening channel. + +- **id** (pubkey): Node id of the remote peer with which to cancel. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:fundchannel_cancel#1", + "method": "fundchannel_cancel", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" + } +} +{ + "id": "example:fundchannel_cancel#2", + "method": "fundchannel_cancel", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **cancelled** (string): A message indicating it was cancelled by RPC +- **cancelled** (string): A message indicating it was cancelled by RPC. -[comment]: # (GENERATE-FROM-SCHEMA-END) +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "cancelled": "Channel open canceled by RPC" +} +{ + "cancelled": "Channel open canceled by RPC(after fundchannel_complete)" +} +``` ERRORS ------ -On error the returned object will contain `code` and `message` properties, -with `code` being one of the following: +On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -32602: If the given parameters are wrong. - 306: Unknown peer id. - 307: No channel currently being funded that can be cancelled. -- 308: It is unsafe to cancel the channel: the funding transaction - has been broadcast, or there are HTLCs already in the channel, or - the peer was the initiator and not us. +- 308: It is unsafe to cancel the channel: the funding transaction has been broadcast, or there are HTLCs already in the channel, or the peer was the initiator and not us. AUTHOR ------ @@ -51,14 +74,9 @@ Lisa Neigut <> is mainly responsible. SEE ALSO -------- -lightning-connect(7), lightning-fundchannel(7), lightning-multifundchannel(7), -lightning-fundchannel\_start(7), lightning-fundchannel\_complete(7) -lightning-openchannel\_init(7), lightning-openchannel\_update(7), -lightning-openchannel\_signed(7), lightning-openchannel\_abort(7) +lightning-connect(7), lightning-fundchannel(7), lightning-multifundchannel(7), lightning-fundchannel\_start(7), lightning-fundchannel\_complete(7), lightning-openchannel\_init(7), lightning-openchannel\_update(7), lightning-openchannel\_signed(7), lightning-openchannel\_abort(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:8b0f33ba88ad83b91b4f574b1a6320690bf5cd2fdb4cc731691a8be62edb7671) diff --git a/doc/lightning-fundchannel_complete.7.md b/doc/lightning-fundchannel_complete.7.md index 52485149d8b1..08bd27b3a5f3 100644 --- a/doc/lightning-fundchannel_complete.7.md +++ b/doc/lightning-fundchannel_complete.7.md @@ -4,36 +4,54 @@ lightning-fundchannel\_complete -- Command for completing channel establishment SYNOPSIS -------- -**fundchannel\_complete** *id* *psbt* +**fundchannel\_complete** *id* *psbt* DESCRIPTION ----------- -`fundchannel_complete` is a lower level RPC command. It allows a user to -complete an initiated channel establishment with a connected peer. +`fundchannel_complete` is a lower level RPC command. It allows a user to complete an initiated channel establishment with a connected peer. -Note that the funding transaction MUST NOT be broadcast until after -channel establishment has been successfully completed, as the commitment -transactions for this channel are not secured until this command -successfully completes. Broadcasting transaction before can lead to -unrecoverable loss of funds. +Note that the funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed, as the commitment transactions for this channel are not secured until this command successfully completes. Broadcasting transaction before can lead to unrecoverable loss of funds. + +- **id** (pubkey): Node id of the remote peer. +- **psbt** (string): Transaction to use for funding (does not need to be signed but must be otherwise complete). + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:fundchannel_complete#1", + "method": "fundchannel_complete", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "psbt": "cHNidP8BAIkCAAAAASYd4TeOHEIzrUbbELM2DK0IX09WaXqWsJFlLD455MPPAAAAAAD9////Av///wAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM1c8QUpAQAAACJRIH8AZYBKMKON4/oVmJVsVt6zy/+PkBPzziE+LtkuFvWXAAAAAAABAIMCAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////wJRAP////8CAPIFKgEAAAAWABQ5FIjuMd8ar9WFRV9eGNLF+3RMcAAAAAAAAAAAJmokqiGp7eL2HD9x0d79P6mZ36NpU3VcaQaJeZlitIvr2DaXToz5AAAAAAEBHwDyBSoBAAAAFgAUORSI7jHfGq/VhUVfXhjSxft0THAiBgMegIxEPDa2OseVTaV6ANtSwQuoj/j2an7X/Is2EekvWBhhFDNgVAAAgAEAAIAAAACAAAAAAAAAAAAAAAEFIEm9AFgqUlJwbPFtyt3a9dzvb+nAGZiQ3CT1CImhjBFpIQdJvQBYKlJScGzxbcrd2vXc72/pwBmYkNwk9QiJoYwRaRkAYRQzYFYAAIABAACAAAAAgAEAAAAAAAAAAA==" + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **channel\_id** (hex): The channel\_id of the resulting channel (always 64 characters) -- **commitments\_secured** (boolean): Indication that channel is safe to use (always *true*) +- **channel\_id** (hash): The channel\_id of the resulting channel. +- **commitments\_secured** (boolean) (always *true*): Indication that channel is safe to use. -[comment]: # (GENERATE-FROM-SCHEMA-END) +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "channel_id": "049217e5035a4a60449c6382c445b5c105bd63588d66137ad0511c57a16db6d9", + "commitments_secured": true +} +``` ERRORS ------ -On error the returned object will contain `code` and `message` properties, -with `code` being one of the following: +On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -32602: If the given parameters are wrong. - -1: Catchall nonspecific error. @@ -49,15 +67,9 @@ Lisa Neigut <> is mainly responsible. SEE ALSO -------- -lightning-connect(7), lightning-fundchannel(7), lightning-multifundchannel(7), -lightning-fundchannel\_start(7), lightning-fundchannel\_cancel(7), -lightning-openchannel\_init(7), lightning-openchannel\_update(7), -lightning-openchannel\_signed(7), lightning-openchannel\_bump(7), -lightning-openchannel\_abort(7) +lightning-connect(7), lightning-fundchannel(7), lightning-multifundchannel(7), lightning-fundchannel\_start(7), lightning-fundchannel\_cancel(7), lightning-openchannel\_init(7), lightning-openchannel\_update(7), lightning-openchannel\_signed(7), lightning-openchannel\_bump(7), lightning-openchannel\_abort(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:68a03c118fd7851c8025f52f52393d108d26e1045e126cd194e7605867114b24) diff --git a/doc/lightning-fundchannel_start.7.md b/doc/lightning-fundchannel_start.7.md index 3bf385858785..770be9337aaf 100644 --- a/doc/lightning-fundchannel_start.7.md +++ b/doc/lightning-fundchannel_start.7.md @@ -4,46 +4,106 @@ lightning-fundchannel\_start -- Command for initiating channel establishment for SYNOPSIS -------- -**fundchannel\_start** *id* *amount* [*feerate* *announce* *close\_to* *push\_msat* *channel\_type*] *mindepth* *reserve*] +**fundchannel\_start** *id* *amount* [*feerate* *announce* *close\_to* *push\_msat* *channel\_type* *mindepth* *reserve*] DESCRIPTION ----------- -`fundchannel_start` is a lower level RPC command. It allows a user to -initiate channel establishment with a connected peer. - -Note that the funding transaction MUST NOT be broadcast until after -channel establishment has been successfully completed by running -`fundchannel_complete`, as the commitment transactions for this channel -are not secured until the complete command succeeds. Broadcasting -transaction before that can lead to unrecoverable loss of funds. +`fundchannel_start` is a lower level RPC command. It allows a user to initiate channel establishment with a connected peer. + +Note that the funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`, as the commitment transactions for this channel are not secured until the complete command succeeds. Broadcasting transaction before that can lead to unrecoverable loss of funds. + +- **id** (pubkey): The peer id obtained from connect. +- **amount** (sat): Satoshi value that the channel will be funded at. This value MUST be accurate, otherwise the negotiated commitment transactions will not encompass the correct channel value. +- **feerate** (feerate, optional): Feerate for subsequent commitment transactions: see **fundchannel**. Note that this is ignored for channels with *option\_anchors\_zero\_fee\_htlc\_tx* (we always use a low commitment fee for these). +- **announce** (boolean, optional): Whether or not to announce this channel. +- **close\_to** (string, optional): Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. Returns `close_to` set to closing script iff is negotiated. +- **push\_msat** (msat, optional): Amount of millisatoshis to push to the channel peer at open. Note that this is a gift to the peer -- these satoshis are added to the initial balance of the peer at channel start and are largely unrecoverable once pushed. +- **mindepth** (u32, optional): Number of confirmations required before we consider the channel active. +- **reserve** (msat, optional): The amount we want the peer to maintain on its side. +- **channel\_type** (array of u32s, optional): Each bit set in this channel\_type.: + - (u32, optional): Bit number. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:fundchannel_start#1", + "method": "fundchannel_start", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount": 16777216, + "feerate": null, + "announce": true, + "close_to": null, + "mindepth": null + } +} +{ + "id": "example:fundchannel_start#2", + "method": "fundchannel_start", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount": "100000sat", + "feerate": null, + "announce": true, + "close_to": null, + "mindepth": null, + "channel_type": null + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: - **funding\_address** (string): The address to send funding to for the channel. DO NOT SEND COINS TO THIS ADDRESS YET. -- **scriptpubkey** (hex): The raw scriptPubkey for the address -- **channel\_type** (object): channel\_type as negotiated with peer *(added v24.02)*: - - **bits** (array of u32s): Each bit set in this channel\_type *(added v24.02)*: - - Bit number - - **names** (array of strings): Feature name for each bit set in this channel\_type *(added v24.02)*: - - Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even") -- **close\_to** (hex, optional): The raw scriptPubkey which mutual close will go to; only present if *close\_to* parameter was specified and peer supports `option_upfront_shutdown_script` +- **scriptpubkey** (hex): The raw scriptPubkey for the address. +- **channel\_type** (object, optional): Channel\_type as negotiated with peer. *(added v24.02)*: + - **bits** (array of u32s): Each bit set in this channel\_type. *(added v24.02)*: + - (u32, optional): Bit number. + - **names** (array of strings): Feature name for each bit set in this channel\_type. *(added v24.02)*: + - (string, optional) (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even"): Name of feature bit. +- **close\_to** (hex, optional): The raw scriptPubkey which mutual close will go to; only present if *close\_to* parameter was specified and peer supports `option_upfront_shutdown_script`. +- **mindepth** (u32, optional): Number of confirmations before we consider the channel active. The following warnings may also be returned: -- **warning\_usage**: A warning not to prematurely broadcast the funding transaction (always present!) - -[comment]: # (GENERATE-FROM-SCHEMA-END) +- **warning\_usage**: A warning not to prematurely broadcast the funding transaction (always present!). + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "funding_address": "bcrt1qtwxd8wg5eanumk86vfeujvp48hfkgannf77evggzct048wggsrxsum2pmm", + "scriptpubkey": "00205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd", + "warning_usage": "The funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`" +} +{ + "funding_address": "bcrt1qtwxd8wg5eanumk86vfeujvp48hfkgannf77evggzct048wggsrxsum2pmm", + "scriptpubkey": "00205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "warning_usage": "The funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`" +} +``` ERRORS ------ -On error the returned object will contain `code` and `message` properties, -with `code` being one of the following: +On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -32602: If the given parameters are wrong. - -1: Catchall nonspecific error. @@ -51,8 +111,8 @@ with `code` being one of the following: - 301: The provided `push_msat` is greater than the provided `amount`. - 304: Still syncing with bitcoin network - 305: Peer is not connected. -- 306: Unknown peer id -- 312: Peer negotiated `option_dual_fund`, must use `openchannel_init` not `fundchannel_start`. (Only if ``experimental-dual-fund` is enabled) +- 306: Unknown peer id. +- 312: Peer negotiated `option_dual_fund`, must use `openchannel_init` not `fundchannel_start`. (Only if ``experimental-dual-fund is enabled) AUTHOR ------ @@ -62,15 +122,9 @@ Lisa Neigut <> is mainly responsible. SEE ALSO -------- -lightning-connect(7), lightning-fundchannel(7), lightning-multifundchannel(7), -lightning-fundchannel\_complete(7), lightning-fundchannel\_cancel(7) -lightning-openchannel\_init(7), lightning-openchannel\_update(7), -lightning-openchannel\_signed(7), lightning-openchannel\_bump(7), -lightning-openchannel\_abort(7) +lightning-connect(7), lightning-fundchannel(7), lightning-multifundchannel(7), lightning-fundchannel\_complete(7), lightning-fundchannel\_cancel(7), lightning-openchannel\_init(7), lightning-openchannel\_update(7), lightning-openchannel\_signed(7), lightning-openchannel\_bump(7), lightning-openchannel\_abort(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:55a714d25c1e01c90076462f022ad814aad42bbf824ba44060d406d53ebcad0c) diff --git a/doc/lightning-funderupdate.7.md b/doc/lightning-funderupdate.7.md index 0a53ed9a27e6..520ee7c592b8 100644 --- a/doc/lightning-funderupdate.7.md +++ b/doc/lightning-funderupdate.7.md @@ -4,8 +4,7 @@ lightning-funderupdate -- Command for adjusting node funding v2 channels SYNOPSIS -------- -**funderupdate** [*policy*] [*policy\_mod*] [*leases\_only*] [*min\_their\_funding\_msat*] [*max\_their\_funding\_msat*] [*per\_channel\_min\_msat*] [*per\_channel\_max\_msat*] [*reserve\_tank\_msat*] [*fuzz\_percent*] [*fund\_probability*] [*lease\_fee\_base\_msat*] [*lease\_fee\_basis*] [*funding\_weight*] [*channel\_fee\_max\_base\_msat*] [*channel\_fee\_max\_proportional\_thousandths*] [*compact\_lease*] - +**funderupdate** [*policy*] [*policy\_mod*] [*leases\_only*] [*min\_their\_funding\_msat*] [*max\_their\_funding\_msat*] [*per\_channel\_min\_msat*] [*per\_channel\_max\_msat*] [*reserve\_tank\_msat*] [*fuzz\_percent*] [*fund\_probability*] [*lease\_fee\_base\_msat*] [*lease\_fee\_basis*] [*funding\_weight*] [*channel\_fee\_max\_base\_msat*] [*channel\_fee\_max\_proportional\_thousandths*] [*compact\_lease*] DESCRIPTION ----------- @@ -16,16 +15,61 @@ For channel open requests using dual funding. Note: to maximize channel leases, best policy setting is (match, 100). -Setting any of the 5 options from *lease_fee_base_msat*, *lease_fee_basis*, *funding_weight*, *channel_fee_max_base_msat* and, *channel_fee_max_proportional_thousandths* will activate channel leases for this node, and advertise these values via the lightning gossip network. If any one is set, the other values will be the default. +Setting any of the 5 options from *lease\_fee\_base\_msat*, *lease\_fee\_basis*, *funding\_weight*, *channel\_fee\_max\_base\_msat* and, *channel\_fee\_max\_proportional\_thousandths* will activate channel leases for this node, and advertise these values via the lightning gossip network. If any one is set, the other values will be the default. + +- **policy** (string, optional) (one of "match", "available", "fixed"): Funder plugin will use to decide how much capital to commit to a v2 open channel request. + There are three policy options, detailed below: + * `match` -- Contribute *policy\_mod* percent of their requested funds. Valid *policy\_mod* values are 0 to 200. If this is a channel lease request, we match based on their requested funds. If it is not a channel lease request (and *lease\_only* is false), then we match their funding amount. Note: any lease match less than 100 will likely fail, as clients will not accept a lease less than their request. + * `available` -- Contribute *policy\_mod* percent of our available node wallet funds. Valid *policy\_mod* values are 0 to 100. + * `fixed` -- Contributes a fixed *policy\_mod* sats to v2 channel open requests. The default is fixed. +- **policy\_mod** (sat, optional): Number or 'modification' to apply to the policy. The default is 0sats. +- **leases\_only** (boolean, optional): Only contribute funds to `option_will_fund` requests which pay to lease funds. It will fund any v2 open request using *policy* even if it's they're not seeking to lease funds. Note that `option_will_fund` commits funds for 4032 blocks (~1mo). Must also set *lease\_fee\_base\_msat*, *lease\_fee\_basis*, *funding\_weight*, *channel\_fee\_max\_base\_msat*, and *channel\_fee\_max\_proportional\_thousandths* to advertise available channel leases. The default is False. +- **min\_their\_funding\_msat** (msat, optional): Minimum funding sats that we require in order to activate our contribution policy to the v2 open. The default is 10k sats. +- **max\_their\_funding\_msat** (msat, optional): Maximum funding sats that we will consider to activate our contribution policy to the v2 open. Any channel open above this will not be funded. The default is no max (`UINT_MAX`). +- **per\_channel\_min\_msat** (msat, optional): Minimum amount that we will contribute to a channel open. The default is 10k sats. +- **per\_channel\_max\_msat** (msat, optional): Maximum amount that we will contribute to a channel open. The default is no max (`UINT_MAX`). +- **reserve\_tank\_msat** (msat, optional): Amount of sats to leave available in the node wallet. The default is zero sats. +- **fuzz\_percent** (u32, optional): A percentage to fuzz the resulting contribution amount by. Valid values are 0 to 100. Note that turning this on with (match, 100) policy will randomly fail `option_will_fund` leases, as most clients expect an exact or greater match of their `requested_funds`. The default is 0% (no fuzz). +- **fund\_probability** (u32, optional): The percent of v2 channel open requests to apply our policy to. Valid values are integers from 0 (fund 0% of all open requests) to 100 (fund every request). Useful for randomizing opens that receive funds. Useful for randomizing opens that receive funds. The default is 100. +- **lease\_fee\_base\_msat** (msat, optional): Flat fee for a channel lease. Node will receive this much extra added to their channel balance, paid by the opening node. Note that the minimum is 1sat. The default is 2k sats. +- **lease\_fee\_basis** (u32, optional): A basis fee that's calculated as 1/10k of the total requested funds the peer is asking for. Node will receive the total of *lease\_fee\_basis* times requested funds / 10k satoshis added to their channel balance, paid by the opening node. The default is 0.65% (65 basis points). +- **funding\_weight** (u32, optional): To calculate the fee the peer will compensate your node for its contributing inputs to the funding transaction. The total fee is calculated as the `open_channel2`.`funding_feerate_perkw` times this *funding\_weight* divided by 1000. Node will have this funding fee added to their channel balance, paid by the opening node. The default is 2 inputs + 1 P2WPKH output. +- **channel\_fee\_max\_base\_msat** (msat, optional): A commitment to a maximum `channel_fee_base_msat` that your node will charge for routing payments over this leased channel during the lease duration. The default is 5k sats. +- **channel\_fee\_max\_proportional\_thousandths** (u32, optional): A commitment to a maximum `channel_fee_proportional_millionths` that your node will charge for routing payments over this leased channel during the lease duration. Note that it's denominated in 'thousandths'. A setting of `1` is equal to 1k ppm; `5` is 5k ppm, etc. The default is 100 (100k ppm). +- **compact\_lease** (hex, optional): A compact description of the channel lease params. When opening a channel, passed in to `fundchannel` to indicate the terms we expect from the peer. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:funderupdate#1", + "method": "funderupdate", + "params": "{}" +} +{ + "id": "example:funderupdate#2", + "method": "funderupdate", + "params": { + "policy": "fixed", + "policy_mod": "50000sat", + "min_their_funding_msat": 1000, + "per_channel_min_msat": "1000sat", + "per_channel_max_msat": "500000sat", + "fund_probability": 100, + "fuzz_percent": 0, + "leases_only": false + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **summary** (string): Summary of the current funding policy e.g. (match 100) -- **policy** (string): Policy funder plugin will use to decide how much capital to commit to a v2 open channel request (one of "match", "available", "fixed") +- **summary** (string): Summary of the current funding policy e.g. (match 100). +- **policy** (string) (one of "match", "available", "fixed"): Policy funder plugin will use to decide how much capital to commit to a v2 open channel request. - **policy\_mod** (u32): The *policy\_mod* is the number or 'modification' to apply to the policy. - **leases\_only** (boolean): Only contribute funds to `option_will_fund` lease requests. - **min\_their\_funding\_msat** (msat): The minimum funding sats that we require from peer to activate our funding policy. @@ -42,7 +86,43 @@ On success, an object is returned, containing: - **channel\_fee\_max\_proportional\_thousandths** (u32, optional): Maximum channel\_fee\_proportional\_millitionths we'll charge for routing funds leased on this channel, in thousandths. - **compact\_lease** (hex, optional): Compact description of the channel lease parameters. -[comment]: # (GENERATE-FROM-SCHEMA-END) +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "summary": "match (100%)", + "policy": "match", + "policy_mod": 100, + "leases_only": true, + "min_their_funding_msat": 10000000, + "max_their_funding_msat": 4294967295000, + "per_channel_min_msat": 10000000, + "per_channel_max_msat": 4294967295000, + "reserve_tank_msat": 0, + "fuzz_percent": 0, + "fund_probability": 100, + "lease_fee_base_msat": 100000, + "lease_fee_basis": 100, + "funding_weight": 666, + "channel_fee_max_base_msat": 5000000, + "channel_fee_max_proportional_thousandths": 100, + "compact_lease": "029a00640064000000644c4b40" +} +{ + "summary": "fixed (50000sat)", + "policy": "fixed", + "policy_mod": 50000, + "leases_only": false, + "min_their_funding_msat": 1000, + "max_their_funding_msat": 4294967295000, + "per_channel_min_msat": 1000000, + "per_channel_max_msat": 500000000, + "reserve_tank_msat": 0, + "fuzz_percent": 0, + "fund_probability": 100 +} +``` ERRORS ------ @@ -54,7 +134,7 @@ The following error code may occur: AUTHOR ------ -@niftynei <> is mainly responsible. +Lisa Neigut <> is mainly responsible. SEE ALSO -------- @@ -65,5 +145,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:64262de96cbce3ee1914ffed90e5a5112c2448703406e33c0056790e6ed68320) diff --git a/doc/lightning-fundpsbt.7.md b/doc/lightning-fundpsbt.7.md index 33d7b18e9fbe..78139ea348d8 100644 --- a/doc/lightning-fundpsbt.7.md +++ b/doc/lightning-fundpsbt.7.md @@ -1,68 +1,153 @@ lightning-fundpsbt -- Command to populate PSBT inputs from the wallet -================================================================ +===================================================================== SYNOPSIS -------- -**fundpsbt** *satoshi* *feerate* *startweight* [*minconf*] [*reserve*] [*locktime*] [*min\_witness\_weight*] [*excess\_as\_change*] +**fundpsbt** *satoshi* *feerate* *startweight* [*minconf*] [*reserve*] [*locktime*] [*min\_witness\_weight*] [*excess\_as\_change*] [*nonwrapped*] [*opening\_anchor\_channel*] DESCRIPTION ----------- -`fundpsbt` is a low-level RPC command which creates a PSBT using unreserved -inputs in the wallet, optionally reserving them as well. +`fundpsbt` is a low-level RPC command which creates a PSBT using unreserved inputs in the wallet, optionally reserving them as well. + +- **satoshi** (msat\_or\_all): The minimum satoshi value of the output(s) needed (or the string `all` meaning use all unreserved inputs). If a value, it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. +- **feerate** (feerate): Used for the transaction as initial feerate. The default is *normal*. +- **startweight** (u32): The weight of the transaction before *fundpsbt* has added any inputs. +- **minconf** (u32, optional): The minimum number of confirmations that used outputs should have. The default is 1. +- **reserve** (u32, optional): If not zero, then *reserveinputs* is called (successfully, with *exclusive* true) on the returned PSBT for this number of blocks. The default is 72 blocks. +- **locktime** (u32, optional): The locktime of the transaction. if not set, it is set to a recent block height. +- **min\_witness\_weight** (u32, optional): Minimum weight to use for a UTXO's witness. If the actual witness weight is greater than the provided minimum, the actual witness weight will be used. +- **excess\_as\_change** (boolean, optional): Flag to add a change output for the excess sats. +- **nonwrapped** (boolean, optional): To signal to filter out any p2sh-wrapped inputs from funding this PSBT. *(added v23.02)* +- **opening\_anchor\_channel** (boolean, optional): To signel that it needs emergency reserve for anchors so that we can lowball our commitment tx fees, and min-emergency-msat for reserving some sats for closing anchor channels. *(added v23.08)* EXAMPLE USAGE ------------- Let's assume the caller is trying to produce a 100,000 satoshi output. -First, the caller estimates the weight of the core (typically 42) and -known outputs of the transaction (typically (9 + scriptlen) * 4). For -a simple P2WPKH it's a 22 byte scriptpubkey, so that's 124 weight. - -It calls "*fundpsbt* 100000sat slow 166", which succeeds, and returns -the *psbt* and *feerate\_per\_kw* it used, the *estimated\_final\_weight* -and any *excess\_msat*. - -If *excess\_msat* is greater than the cost of adding a change output, -the caller adds a change output randomly to position 0 or 1 in the -PSBT. Say *feerate\_per\_kw* is 253, and the change output is a P2WPKH -(weight 124), the cost is around 31 sats. With the dust limit disallowing -payments below 546 satoshis, we would only create a change output -if *excess\_msat* was greater or equal to 31 + 546. +First, the caller estimates the weight of the core (typically 42) and known outputs of the transaction (typically (9 + scriptlen) * 4). For a simple P2WPKH it's a 22 byte scriptpubkey, so that's 124 weight. + +It calls "*fundpsbt* 100000sat slow 166", which succeeds, and returns the *psbt* and *feerate\_per\_kw* it used, the *estimated\_final\_weight* and any *excess\_msat*. + +If *excess\_msat* is greater than the cost of adding a change output, the caller adds a change output randomly to position 0 or 1 in the PSBT. Say *feerate\_per\_kw* is 253, and the change output is a P2WPKH (weight 124), the cost is around 31 sats. With the dust limit disallowing payments below 546 satoshis, we would only create a change output if *excess\_msat* was greater or equal to 31 + 546. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:fundpsbt#1", + "method": "fundpsbt", + "params": { + "satoshi": 16777216, + "feerate": "253perkw", + "startweight": 250, + "minconf": null, + "reserve": 0, + "locktime": null, + "min_witness_weight": null, + "excess_as_change": false + } +} +{ + "id": "example:fundpsbt#2", + "method": "fundpsbt", + "params": { + "satoshi": "all", + "feerate": "1000perkw", + "startweight": 1000, + "minconf": null, + "reserve": null, + "locktime": null, + "min_witness_weight": null, + "excess_as_change": false + } +} +{ + "id": "example:fundpsbt#3", + "method": "fundpsbt", + "params": { + "satoshi": "109000sat", + "feerate": "slow", + "startweight": 166, + "minconf": null, + "reserve": null, + "locktime": null, + "min_witness_weight": null, + "excess_as_change": true + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **psbt** (string): Unsigned PSBT which fulfills the parameters given -- **feerate\_per\_kw** (u32): The feerate used to create the PSBT, in satoshis-per-kiloweight -- **estimated\_final\_weight** (u32): The estimated weight of the transaction once fully signed -- **excess\_msat** (msat): The amount above *satoshi* which is available. This could be zero, or dust; it will be zero if *change\_outnum* is also returned -- **change\_outnum** (u32, optional): The 0-based output number where change was placed (only if parameter *excess\_as\_change* was true and there was sufficient funds) -- **reservations** (array of objects, optional): If *reserve* was true or a non-zero number, just as per lightning-reserveinputs(7): - - **txid** (txid): The txid of the transaction - - **vout** (u32): The 0-based output number - - **was\_reserved** (boolean): Whether this output was previously reserved (always *false*) - - **reserved** (boolean): Whether this output is now reserved (always *true*) - - **reserved\_to\_block** (u32): The blockheight the reservation will expire - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -If *excess\_as\_change* is true and the excess is enough to cover -an additional output above the `dust_limit`, then an output is -added to the PSBT for the excess amount. The *excess\_msat* will -be zero. A *change\_outnum* will be returned with the index of -the change output. +- **psbt** (string): Unsigned PSBT which fulfills the parameters given. +- **feerate\_per\_kw** (u32): The feerate used to create the PSBT, in satoshis-per-kiloweight. +- **estimated\_final\_weight** (u32): The estimated weight of the transaction once fully signed. +- **excess\_msat** (msat): The amount above *satoshi* which is available. This could be zero, or dust; it will be zero if *change\_outnum* is also returned. +- **change\_outnum** (u32, optional): The 0-based output number where change was placed (only if parameter *excess\_as\_change* was true and there was sufficient funds). +- **reservations** (array of objects, optional): If *reserve* was true or a non-zero number, just as per lightning- reserveinputs(7).: + - **txid** (txid): The txid of the transaction. + - **vout** (u32): The 0-based output number. + - **was\_reserved** (boolean) (always *false*): Whether this output was previously reserved. + - **reserved** (boolean) (always *true*): Whether this output is now reserved. + - **reserved\_to\_block** (u32): The blockheight the reservation will expire. + +If *excess\_as\_change* is true and the excess is enough to cover an additional output above the `dust_limit`, then an output is added to the PSBT for the excess amount. The *excess\_msat* will be zero. A *change\_outnum* will be returned with the index of the change output. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "psbt": "cHNidP8BADMCAAAAAWzmSFzhTtXBnQewytc32WaMwJSunScwsYndBNdU80JqAAAAAAD9////AGYAAAAAAQDeAgAAAAABAU1MpIJeOOzqAYVkZaytJCmzUadBVltKar8kWtzKSVeYAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFD8W5uBNZAxN6n1jqU62dxWQbyGAAkcwRAIgUK+vMOeWiDPiJM8fpgKCjjwXog4yfWPvtKES1ZZPaM8CIB3cgouGpV6Gc7nEvAu28Mg9tkAWt/Xl5FDOseEyeZqHASECTwjR0I3gLHdSW7jRmnVXdm0+MgJ1hihnqEfXYeFWA/NlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=", + "feerate_per_kw": 253, + "estimated_final_weight": 521, + "excess_msat": 9999869000 +} +{ + "psbt": "cHNidP8BAF4CAAAAAfwbEpvpi6D14YV4VLnuVB47Y0uF41kXEyJRL4IusySSAQAAAAD9////ASICAAAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5nAAAAAAEA9gIAAAAAAQFEkxvLatohY6mw5gr5qG1aiArSrziFPR2YoqD21Hv+RAAAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNrz8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIEu1nfVRt9i+rFM219mwhMqdwJsqygWSWTFUS+cemdh6AiBG3Qo8g9J/aAMO2RHDsIBScscj6pTTIwZp7Gw8G3EOKAEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPZgAAAAEBK68/DwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==", + "feerate_per_kw": 1000, + "estimated_final_weight": 1443, + "excess_msat": 997354000, + "change_outnum": 0, + "reservations": [ + { + "txid": "9224b32e822f5122131759e3854b633b1e54eeb9547885e1f5a08be99b121bfc", + "vout": 1, + "was_reserved": false, + "reserved": true, + "reserved_to_block": 175 + } + ] +} +{ + "psbt": "cHNidP8BAF4CAAAAAbEf44mT/BPDxLkUjKy1byWksyLyuM6hbe8shzEbbXhGAQAAAAD9////AU58DQAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5sAAAAAAEA9gIAAAAAAQEV9Sj1wfHqO/ECZeHp/u7cFL5eRaa1Vu4hXWbwH72pxgEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIGILT3DrcNn6/WKOhsxxKq7lDWq47dV0IjRhj0bYHs4yAiApzODtmrz7ifK32G81A2XbBxWboFk2vN4T3ng/hYmb1wEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPZgAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==", + "feerate_per_kw": 3750, + "estimated_final_weight": 609, + "excess_msat": 0, + "change_outnum": 0, + "reservations": [ + { + "txid": "46786d1b31872cef6da1ceb8f222b3a4256fb5ac8c14b9c4c313fc9389e31fb1", + "vout": 1, + "was_reserved": false, + "reserved": true, + "reserved_to_block": 180 + } + ] +} +``` ERRORS ------ -On error the returned object will contain `code` and `message` properties, -with `code` being one of the following: +On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -32602: If the given parameters are wrong. - -1: Catchall nonspecific error. @@ -76,11 +161,9 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-utxopsbt(7), lightning-reserveinputs(7), lightning-unreserveinputs(7). +lightning-utxopsbt(7), lightning-reserveinputs(7), lightning-unreserveinputs(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:b54a80322773ed94fdf3337d709fcdeb71eb1dd91509407aaa65d2d14060da05) diff --git a/doc/lightning-getinfo.7.md b/doc/lightning-getinfo.7.md index f707a59de265..8f17e688ea57 100644 --- a/doc/lightning-getinfo.7.md +++ b/doc/lightning-getinfo.7.md @@ -1,23 +1,22 @@ lightning-getinfo -- Command to receive all information about the Core Lightning node. -============================================================ +====================================================================================== SYNOPSIS -------- -**getinfo** +**getinfo** DESCRIPTION ----------- The **getinfo** gives a summary of the current running node. - EXAMPLE JSON REQUEST ------------- +-------------------- ```json { - "id": 82, + "id": "example:getinfo#1", "method": "getinfo", "params": {} } @@ -26,122 +25,112 @@ EXAMPLE JSON REQUEST RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **id** (pubkey): The public key unique to this node -- **alias** (string): The fun alias this node will advertize (up to 32 characters) -- **color** (hex): The favorite RGB color this node will advertize (always 6 characters) -- **num\_peers** (u32): The total count of peers, connected or with channels -- **num\_pending\_channels** (u32): The total count of channels being opened -- **num\_active\_channels** (u32): The total count of channels in normal state -- **num\_inactive\_channels** (u32): The total count of channels waiting for opening or closing transactions to be mined -- **version** (string): Identifies what bugs you are running into -- **lightning-dir** (string): Identifies where you can find the configuration and other related files -- **blockheight** (u32): The highest block height we've learned -- **network** (string): represents the type of network on the node are working (e.g: `bitcoin`, `testnet`, or `regtest`) -- **fees\_collected\_msat** (msat): Total routing fees collected by this node -- **address** (array of objects): The addresses we announce to the world: - - **type** (string): Type of connection (until 23.08, `websocket` was also allowed) (one of "dns", "ipv4", "ipv6", "torv2", "torv3") - - **port** (u16): port number +- **id** (pubkey): The public key unique to this node. +- **alias** (string) (up to 32 characters): The fun alias this node will advertize. +- **color** (hex) (always 6 characters): The favorite RGB color this node will advertize. +- **num\_peers** (u32): The total count of peers, connected or with channels. +- **num\_pending\_channels** (u32): The total count of channels being opened. +- **num\_active\_channels** (u32): The total count of channels in normal state. +- **num\_inactive\_channels** (u32): The total count of channels waiting for opening or closing transactions to be mined. +- **version** (string): Identifies what bugs you are running into. +- **lightning-dir** (string): Identifies where you can find the configuration and other related files. +- **blockheight** (u32): The highest block height we've learned. +- **network** (string): Represents the type of network on the node are working (e.g: `bitcoin`, `testnet`, or `regtest`). +- **fees\_collected\_msat** (msat): Total routing fees collected by this node. +- **address** (array of objects): The addresses we announce to the world.: + - **type** (string) (one of "dns", "ipv4", "ipv6", "torv2", "torv3"): Type of connection (until 23.08, `websocket` was also allowed). + - **port** (u16): Port number. If **type** is "dns", "ipv4", "ipv6", "torv2" or "torv3": - - - **address** (string): address in expected format for **type** -- **our\_features** (object, optional): Our BOLT #9 feature bits (as hexstring) for various contexts: - - **init** (hex): features (incl. globalfeatures) in our init message, these also restrict what we offer in open\_channel or accept in accept\_channel - - **node** (hex): features in our node\_announcement message - - **channel** (hex): negotiated channel features we (as channel initiator) publish in the channel\_announcement message - - **invoice** (hex): features in our BOLT11 invoices -- **binding** (array of objects, optional): The addresses we are listening on: - - **type** (string): Type of connection (one of "local socket", "websocket", "ipv4", "ipv6", "torv2", "torv3") - - **address** (string, optional): address in expected format for **type** - - **port** (u16, optional): port number + - **address** (string): Address in expected format for **type**. +- **our\_features** (object, optional): Our BOLT #9 feature bits (as hexstring) for various contexts.: + - **init** (hex): Features (incl. globalfeatures) in our init message, these also restrict what we offer in open\_channel or accept in accept\_channel. + - **node** (hex): Features in our node\_announcement message. + - **channel** (hex): Negotiated channel features we (as channel initiator) publish in the channel\_announcement message. + - **invoice** (hex): Features in our BOLT11 invoices. +- **binding** (array of objects, optional): The addresses we are listening on.: + - **type** (string) (one of "local socket", "websocket", "ipv4", "ipv6", "torv2", "torv3"): Type of connection. + - **address** (string, optional): Address in expected format for **type**. + - **port** (u16, optional): Port number. If **type** is "local socket": - - - **socket** (string): socket filename + - **socket** (string): Socket filename. If **type** is "websocket": - - - **subtype** (string): type of address + - **subtype** (string): Type of address. The following warnings may also be returned: - **warning\_bitcoind\_sync**: Bitcoind is not up-to-date with network. - **warning\_lightningd\_sync**: Lightningd is still loading latest blocks from bitcoind. -[comment]: # (GENERATE-FROM-SCHEMA-END) - -ERRORS ------- - -On failure, one of the following error codes may be returned: - -- -32602: Error in given parameters or some error happened during the command process. - EXAMPLE JSON RESPONSE ------ +--------------------- ```json { - "id": "02bf811f7571754f0b51e6d41a8885f5561041a7b14fac093e4cffb95749de1a8d", - "alias": "SLICKERGOPHER", - "color": "02bf81", - "num_peers": 0, - "num_pending_channels": 0, - "num_active_channels": 0, - "num_inactive_channels": 0, - "address": [ - { - "type": "torv3", - "address": "fp463inc4w3lamhhduytrwdwq6q6uzugtaeapylqfc43agrdnnqsheyd.onion", - "port": 9736 - }, - { - "type": "torv3", - "address": "ifnntp5ak4homxrti2fp6ckyllaqcike447ilqfrgdw64ayrmkyashid.onion", - "port": 9736 - } - ], - "binding": [ - { - "type": "ipv4", - "address": "127.0.0.1", - "port": 9736 - } - ], - "version": "v0.10.2", - "blockheight": 724302, - "network": "bitcoin", - "msatoshi_fees_collected": 0, - "fees_collected_msat": "0msat", - "lightning-dir": "/media/vincent/Maxtor/C-lightning/node/bitcoin" - "our_features": { - "init": "8828226aa2", - "node": "80008828226aa2", - "channel": "", - "invoice": "20024200" - } + "id": "02bf811f7571754f0b51e6d41a8885f5561041a7b14fac093e4cffb95749de1a8d", + "alias": "SLICKERGOPHER", + "color": "02bf81", + "num_peers": 0, + "num_pending_channels": 0, + "num_active_channels": 0, + "num_inactive_channels": 0, + "address": [ + { + "type": "torv3", + "address": "fp463inc4w3lamhhduytrwdwq6q6uzugtaeapylqfc43agrdnnqsheyd.onion", + "port": 9736 + }, + { + "type": "torv3", + "address": "ifnntp5ak4homxrti2fp6ckyllaqcike447ilqfrgdw64ayrmkyashid.onion", + "port": 9736 + } + ], + "binding": [ + { + "type": "ipv4", + "address": "127.0.0.1", + "port": 9736 + } + ], + "version": "v0.10.2", + "blockheight": 724302, + "network": "bitcoin", + "msatoshi_fees_collected": 0, + "fees_collected_msat": "0msat", + "lightning-dir": "/media/vincent/Maxtor/C-lightning/node/bitcoin", + "our_features": { + "init": "8828226aa2", + "node": "80008828226aa2", + "channel": "", + "invoice": "20024200" + } } - ``` +ERRORS +------ + +On failure, one of the following error codes may be returned: + +- -32602: Error in given parameters or some error happened during the command process. AUTHOR ------ -Vincenzo Palazzo <> wrote the initial version of this man page, but many others did the hard work of actually implementing this rpc command. - +Vincenzo Palazzo <> wrote the initial version of this man page, +but many others did the hard work of actually implementing this rpc command. SEE ALSO ------- +-------- -lightning-connect(7), lightning-fundchannel(7), lightning-listconfigs(7). +lightning-connect(7), lightning-fundchannel(7), lightning-listconfigs(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:7cbf6da26c94f60886abf79637e70d5c00a4d50a204cc3c2c2433e929188131a) diff --git a/doc/lightning-getlog.7.md b/doc/lightning-getlog.7.md index b04bed0aa3e3..2d1ab7f76032 100644 --- a/doc/lightning-getlog.7.md +++ b/doc/lightning-getlog.7.md @@ -4,19 +4,21 @@ lightning-getlog -- Command to show logs. SYNOPSIS -------- -**getlog** [*level*] +**getlog** [*level*] DESCRIPTION ----------- The **getlog** the RPC command to show logs, with optional log *level*. +- **level** (string, optional) (one of "broken", "unusual", "info", "debug", "io"): A string that represents the log level. The default is *info*. + EXAMPLE JSON REQUEST -------------------- ```json { - "id": 82, + "id": "example:getlog#1", "method": "getlog", "params": { "level": "debug" @@ -27,35 +29,52 @@ EXAMPLE JSON REQUEST RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **created\_at** (string): UNIX timestamp with 9 decimal places, when logging was initialized -- **bytes\_used** (u32): The number of bytes used by logging records -- **bytes\_max** (u32): The bytes\_used values at which records will be trimmed +- **created\_at** (string): UNIX timestamp with 9 decimal places, when logging was initialized. +- **bytes\_used** (u32): The number of bytes used by logging records. +- **bytes\_max** (u32): The bytes\_used values at which records will be trimmed . - **log** (array of objects): - **type** (string) (one of "SKIPPED", "BROKEN", "UNUSUAL", "INFO", "DEBUG", "IO\_IN", "IO\_OUT") If **type** is "SKIPPED": - - - **num\_skipped** (u32): number of unprinted log entries (deleted or below *level* parameter) + - **num\_skipped** (u32): Number of unprinted log entries (deleted or below *level* parameter). If **type** is "BROKEN", "UNUSUAL", "INFO" or "DEBUG": - - - **time** (string): UNIX timestamp with 9 decimal places after **created\_at** - - **source** (string): The particular logbook this was found in - - **log** (string): The actual log message - - **node\_id** (pubkey, optional): The peer this is associated with + - **time** (string): UNIX timestamp with 9 decimal places after **created\_at**. + - **source** (string): The particular logbook this was found in. + - **log** (string): The actual log message. + - **node\_id** (pubkey, optional): The peer this is associated with. If **type** is "IO\_IN" or "IO\_OUT": + - **time** (string): Seconds after **created\_at**, with 9 decimal places. + - **source** (string): The particular logbook this was found in. + - **log** (string): The associated log message. + - **data** (hex): The IO which occurred. + - **node\_id** (pubkey, optional): The peer this is associated with. - - **time** (string): Seconds after **created\_at**, with 9 decimal places - - **source** (string): The particular logbook this was found in - - **log** (string): The associated log message - - **data** (hex): The IO which occurred - - **node\_id** (pubkey, optional): The peer this is associated with +EXAMPLE JSON RESPONSE +--------------------- -[comment]: # (GENERATE-FROM-SCHEMA-END) +```json +{ + "created_at": "1598192543.820753463", + "bytes_used": 89285843, + "bytes_max": 104857600, + "log": [ + { + "type": "SKIPPED", + "num_skipped": 45 + }, + { + "type": "INFO", + "time": "0.453627568", + "source": "plugin-autopilot.py", + "log": "RPCmethod'autopilot-run-once'doesnothaveadocstring." + } + ] +} +``` ERRORS ------ @@ -64,37 +83,13 @@ On failure, one of the following error codes may be returned: - -32602: Error in given parameters. -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "created_at": "1598192543.820753463", - "bytes_used": 89285843, - "bytes_max": 104857600, - "log": [ - { - "type": "SKIPPED", - "num_skipped": 45 - }, - { - "type": "INFO", - "time": "0.453627568", - "source": "plugin-autopilot.py", - "log": "RPC method 'autopilot-run-once' does not have a docstring." - } - ] -} -``` - AUTHOR ------ -Vincenzo Palazzo <> wrote the initial version of this man page, but many others did the hard work of actually implementing this rpc command. +Vincenzo Palazzo <> wrote the initial version of this man page, +but many others did the hard work of actually implementing this rpc command. RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:10caba663098a54c2273026882187958afe8cd334dfe7f3457909bf2dc0b717d) diff --git a/doc/lightning-getroute.7.md b/doc/lightning-getroute.7.md index 6ea413bcf80a..0d8c493b6f40 100644 --- a/doc/lightning-getroute.7.md +++ b/doc/lightning-getroute.7.md @@ -4,42 +4,70 @@ lightning-getroute -- Command for routing a payment (low-level) SYNOPSIS -------- -**getroute** *id* *amount\_msat* *riskfactor* [*cltv*] [*fromid*] -[*fuzzpercent*] [*exclude*] [*maxhops*] +**getroute** *id* *amount\_msat* *riskfactor* [*cltv*] [*fromid*] [*fuzzpercent*] [*exclude*] [*maxhops*] DESCRIPTION ----------- -The **getroute** RPC command attempts to find the best route for the -payment of *amount\_msat* to lightning node *id*, such that the payment will -arrive at *id* with *cltv*. +The **getroute** RPC command attempts to find the best route for the payment of *amount\_msat* to lightning node *id*, such that the payment will arrive at *id* with *cltv*. -There are two considerations for how good a route is: how low the fees -are, and how long your payment will get stuck in a delayed output if a -node goes down during the process. +There are two considerations for how good a route is: how low the fees are, and how long your payment will get stuck in a delayed output if a node goes down during the process. . + +- **id** (pubkey): Node pubkey to find the best route for the payment. +- **amount\_msat** (msat): Amount to send. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. The 0 value is special: it ignores any *htlc\_minimum\_msat* setting on channels, and simply returns a possible route (if any) which is useful for simple probing. +- **riskfactor** (u64): A non-negative floating-point field controls this tradeoff; it is the annual cost of your funds being stuck (as a percentage). For example, if you thought the convenience of keeping your funds liquid (not stuck) was worth 20% per annum interest, *riskfactor* would be 20. If you didn't care about risk, *riskfactor* would be zero. +- **cltv** (u32, optional): Cltv-blocks to spare. The default is 9. +- **fromid** (pubkey, optional): The node to start the route from. The default is this node. +- **fuzzpercent** (u32, optional): Used to distort fees to provide some randomization to the route generated, but it was not properly implemented and is ignored. +- **exclude** (array of strings, optional): A JSON array of short-channel-id/direction (e.g. ['564334x877x1/0', '564195x1292x0/1' ]) or node-id which should be excluded from consideration for routing. Note if the source or destination is excluded, the command result is undefined. The default is not to exclude any channels or nodes.: + - (string, optional) +- **maxhops** (u32, optional): The maximum number of channels to return. The default is 20. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:getroute#1", + "method": "getroute", + "params": { + "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "amount_msat": 50000000, + "riskfactor": 1, + "cltv": 9, + "fromid": null, + "fuzzpercent": null, + "exclude": null, + "maxhops": null + } +} +{ + "id": "example:getroute#2", + "method": "getroute", + "params": { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount_msat": "50000sat", + "riskfactor": 10 + } +} +``` RISKFACTOR EFFECT ON ROUTING ---------------------------- -The risk factor is treated as if it were an additional fee on the route, -for the purposes of comparing routes. +The risk factor is treated as if it were an additional fee on the route, for the purposes of comparing routes. The formula used is the following approximation: risk-fee = amount x blocks-timeout x per-block-cost -We are given a *riskfactor* expressed as a percentage. There are 52596 -blocks per year, thus *per-block-cost* is *riskfactor* divided by -5,259,600. +We are given a *riskfactor* expressed as a percentage. There are 52596 blocks per year, thus *per-block-cost* is *riskfactor* divided by 5,259,600. The final result is: risk-fee = amount x blocks-timeout x riskfactor / 5259600 -Here are the risk fees in millisatoshis, using various parameters. I -assume a channel charges the default of 1000 millisatoshis plus 1 -part-per-million. Common to\_self\_delay values on the network at 14 and -144 blocks. +Here are the risk fees in millisatoshis, using various parameters. I assume a channel charges the default of 1000 millisatoshis plus 1 part-per-million. Common to\_self\_delay values on the network at 14 and 144 blocks. @@ -233,38 +261,81 @@ part-per-million. Common to\_self\_delay values on the network at 14 and RECOMMENDED RISKFACTOR VALUES ----------------------------- -The default *fuzz* factor is 5%, so as you can see from the table above, -that tends to overwhelm the effect of *riskfactor* less than about 5. +The default *fuzz* factor is 5%, so as you can see from the table above, that tends to overwhelm the effect of *riskfactor* less than about 5. -1 is a conservative value for a stable lightning network with very few -failures. +1 is a conservative value for a stable lightning network with very few failures. -1000 is an aggressive value for trying to minimize timeouts at all -costs. +1000 is an aggressive value for trying to minimize timeouts at all costs. -The default for lightning-pay(7) is 10, which starts to become a major -factor for larger amounts, and is basically ignored for tiny ones. +The default for lightning-pay(7) is 10, which starts to become a major factor for larger amounts, and is basically ignored for tiny ones. RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **route** is returned. It is an array of objects, where each object contains: +On success, an object containing **route** is returned. It is an array of objects, where each object contains: -- **id** (pubkey): The node at the end of this hop -- **channel** (short\_channel\_id): The channel joining these nodes -- **direction** (u32): 0 if this channel is traversed from lesser to greater **id**, otherwise 1 -- **amount\_msat** (msat): The amount expected by the node at the end of this hop -- **delay** (u32): The total CLTV expected by the node at the end of this hop -- **style** (string): The features understood by the destination node (always "tlv") +- **id** (pubkey): The node at the end of this hop. +- **channel** (short\_channel\_id): The channel joining these nodes. +- **direction** (u32): 0 if this channel is traversed from lesser to greater **id**, otherwise 1. +- **amount\_msat** (msat): The amount expected by the node at the end of this hop. +- **delay** (u32): The total CLTV expected by the node at the end of this hop. +- **style** (string) (always "tlv"): The features understood by the destination node. -[comment]: # (GENERATE-FROM-SCHEMA-END) +The final *id* will be the destination *id* given in the input. The difference between the first *amount\_msat* minus the *amount\_msat* given in the input is the fee (assuming the first hop is free). The first *delay* is the very worst case timeout for the payment failure, in blocks. -The final *id* will be the destination *id* given in the input. The -difference between the first *amount\_msat* minus the *amount\_msat* given in -the input is the fee (assuming the first hop is free). The first -*delay* is the very worst case timeout for the payment failure, in -blocks. +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "route": [ + { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "channel": "103x3x0", + "direction": 1, + "amount_msat": 50001002, + "delay": 21, + "style": "tlv" + }, + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "channel": "103x1x0", + "direction": 1, + "amount_msat": 50000501, + "delay": 15, + "style": "tlv" + }, + { + "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "channel": "103x2x0", + "direction": 0, + "amount_msat": 50000000, + "delay": 9, + "style": "tlv" + } + ] +} +{ + "route": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "channel": "103x2x0", + "direction": 1, + "amount_msat": 50051000, + "delay": 15, + "style": "tlv" + }, + { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "channel": "103x1x0", + "direction": 0, + "amount_msat": 50000000, + "delay": 9, + "style": "tlv" + } + ] +} +``` AUTHOR ------ @@ -274,11 +345,9 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-pay(7), lightning-sendpay(7). +lightning-pay(7), lightning-sendpay(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:24cb35c00acd4a803c9558c9cd80922b9f83e6ad7f1358bc74e7f816c79c1705) diff --git a/doc/lightning-help.7.md b/doc/lightning-help.7.md index fa24215632a7..981fb518dfa8 100644 --- a/doc/lightning-help.7.md +++ b/doc/lightning-help.7.md @@ -4,73 +4,91 @@ lightning-help -- Command to return all information about RPC commands. SYNOPSIS -------- -**help** [*command*] +**help** [*command*] DESCRIPTION ----------- The **help** is a RPC command which is possible consult all information about the RPC commands, or a specific command if *command* is given. -Note that the lightning-cli(1) tool will prefer to list a man page when a -specific *command* is specified, and will only return the JSON if the man -page is not found. +Note that the lightning-cli(1) tool will prefer to list a man page when a specific *command* is specified, and will only return the JSON if the man page is not found. + +- **command** (string, optional): Command to get information about. EXAMPLE JSON REQUEST -------------------- ```json { - "id": 82, + "id": "example:help#1", + "method": "help", + "params": { + "command": "pay" + } +} +{ + "id": "example:help#2", "method": "help", - "params": {} + "params": { + "command": "dev" + } } ``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: - **help** (array of objects): - - **command** (string): the command - - **category** (string): the category for this command (useful for grouping) - - **description** (string): a one-line description of the purpose of this command - - **verbose** (string): a full description of this command (including whether it's deprecated) - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -ERRORS ------- - -On failure, one of the following error codes may be returned: - -- -32602: Error in given parameters. + - **command** (string): The command. + - **category** (string): The category for this command (useful for grouping). + - **description** (string): A one-line description of the purpose of this command. + - **verbose** (string): A full description of this command (including whether it's deprecated). +- **format-hint** (string, optional) (always "simple"): Prints the help in human-readable flat form. EXAMPLE JSON RESPONSE --------------------- ```json { - "help": [ - { - "command": "autocleaninvoice [cycle_seconds] [expired_by]", - "category": "plugin", - "description": "Set up autoclean of expired invoices. ", - "verbose": "Perform cleanup every {cycle_seconds} (default 3600), or disable autoclean if 0. Clean up expired invoices that have expired for {expired_by} seconds (default 86400). " - } - ] + "help": [ + { + "command": "pay bolt11 [amount_msat] [label] [riskfactor] [maxfeepercent] [retry_for] [maxdelay] [exemptfee] [localinvreqid] [exclude] [maxfee] [description] [dev_use_shadow]", + "category": "plugin", + "description": "Send payment specified by {bolt11}", + "verbose": "Attempt to pay the {bolt11} invoice." + } + ], + "format-hint": "simple" +} +{ + "help": [ + { + "command": "dev subcommand=crash|rhash|slowcmd", + "category": "developer", + "description": "Developer command test multiplexer", + "verbose": "dev rhash {secret}\n\tShow SHA256 of {secret}\ndev crash\n\tCrash lightningd by calling fatal()\ndev slowcmd {msec}\n\tTorture test for slow commands, optional {msec}\n" + } + ], + "format-hint": "simple" } ``` +ERRORS +------ + +On failure, one of the following error codes may be returned: + +- -32602: Error in given parameters. + AUTHOR ------ -Vincenzo Palazzo <> wrote the initial version of this man page, but many others did the hard work of actually implementing this rpc command. +Vincenzo Palazzo <> wrote the initial version of this man page, +but many others did the hard work of actually implementing this rpc command. RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:2215b33f35ca1e21be55a68c24708a44d5e6525e9d681a92e3f43ffc0114bff4) diff --git a/doc/lightning-invoice.7.md b/doc/lightning-invoice.7.md index bfd7fb11d1a7..ce92d6e25163 100644 --- a/doc/lightning-invoice.7.md +++ b/doc/lightning-invoice.7.md @@ -4,39 +4,108 @@ lightning-invoice -- Command for accepting payments SYNOPSIS -------- -**invoice** *amount\_msat* *label* *description* [*expiry*] -[*fallbacks*] [*preimage*] [*exposeprivatechannels*] [*cltv*] [*deschashonly*] +**invoice** *amount\_msat* *label* *description* [*expiry*] [*fallbacks*] [*preimage*] [*exposeprivatechannels*] [*cltv*] [*deschashonly*] DESCRIPTION ----------- -The **invoice** RPC command creates the expectation of a payment of a -given amount of milli-satoshi: it returns a unique token which another -lightning daemon can use to pay this invoice. This token includes a -*route hint* description of an incoming channel with capacity to pay the -invoice, if any exists. +The **invoice** RPC command creates the expectation of a payment of a given amount of milli-satoshi: it returns a unique token which another lightning daemon can use to pay this invoice. This token includes a *route hint* description of an incoming channel with capacity to pay the invoice, if any exists. + +- **amount\_msat** (msat\_or\_any): The string `any`, which creates an invoice that can be paid with any amount. Otherwise it is a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. +- **label** (one of): A unique string or number (which is treated as a string, so `01` is different from `1`); it is never revealed to other nodes on the lightning network, but it can be used to query the status of this invoice.: + - (string) + - (integer) +- **description** (string): A short description of purpose of payment, e.g. *1 cup of coffee*. This value is encoded into the BOLT11 invoice and is viewable by any node you send this invoice to (unless *deschashonly* is true as described below). It must be UTF-8, and cannot use *\u* JSON escape codes. +- **expiry** (u64, optional): The time the invoice is valid for, in seconds. If no value is provided the default of 604800 (1 week) is used. +- **fallbacks** (array of strings, optional): One or more fallback addresses to include in the invoice (in order from most- preferred to least): note that these arrays are not currently tracked to fulfill the invoice.: + - (string, optional) +- **preimage** (hex, optional): A 64-digit hex string to be used as payment preimage for the created invoice. By default, if unspecified, lightningd will generate a secure pseudorandom preimage seeded from an appropriate entropy source on your system. **IMPORTANT**: if you specify the *preimage*, you are responsible, to ensure appropriate care for generating using a secure pseudorandom generator seeded with sufficient entropy, and keeping the preimage secret. This parameter is an advanced feature intended for use with cutting-edge cryptographic protocols and should not be used unless explicitly needed. +- **exposeprivatechannels** (one of, optional): If specified, it overrides the default route hint logic, which will use unpublished channels only if there are no published channels.: + - (boolean): If *True* unpublished channels are always considered as a route hint candidate; if *False*, never. + - (array of short\_channel\_ids): Array of short channel ids (or a remote alias), only those specific channels will be considered candidates, even if they are public or dead-ends. + - (short\_channel\_id, optional) + - (short\_channel\_id): If it is a short channel id (e.g. *1x1x3*), only this specific channel will be considered candidate, even if it is public or dead-end. +- **cltv** (u32, optional): If specified, sets the *min\_final\_cltv\_expiry* for the invoice. Otherwise, it's set to the parameter **cltv-final**. +- **deschashonly** (boolean, optional): If True, then the bolt11 returned contains a hash of the *description*, rather than the *description* itself: this allows much longer descriptions, but they must be communicated via some other mechanism. The default is False. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:invoice#1", + "method": "invoice", + "params": { + "amount_msat": 11000000, + "label": "xEoCR94SIz6UIRUEkxum", + "description": [ + "XEoCR94SIz6UIRUEkxum." + ], + "expiry": null, + "fallbacks": null, + "preimage": null, + "exposeprivatechannels": null, + "cltv": null, + "deschashonly": null + } +} +{ + "id": "example:invoice#2", + "method": "invoice", + "params": { + "amount_msat": 100, + "label": "8", + "description": "inv", + "expiry": null, + "fallbacks": null, + "preimage": null, + "exposeprivatechannels": null, + "cltv": null, + "deschashonly": null + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **bolt11** (string): the bolt11 string -- **payment\_hash** (hash): the hash of the *payment\_preimage* which will prove payment -- **payment\_secret** (secret): the *payment\_secret* to place in the onion -- **expires\_at** (u64): UNIX timestamp of when invoice expires -- **created\_index** (u64): 1-based index indicating order this invoice was created in *(added v23.08)* +- **bolt11** (string): The bolt11 string. +- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. +- **payment\_secret** (secret): The *payment\_secret* to place in the onion. +- **expires\_at** (u64): UNIX timestamp of when invoice expires. +- **created\_index** (u64): 1-based index indicating order this invoice was created in. *(added v23.08)* The following warnings may also be returned: -- **warning\_capacity**: even using all possible channels, there's not enough incoming capacity to pay this invoice. -- **warning\_offline**: there would be enough incoming capacity, but some channels are offline, so there isn't. -- **warning\_deadends**: there would be enough incoming capacity, but some channels are dead-ends (no other public channels from those peers), so there isn't. -- **warning\_private\_unused**: there would be enough incoming capacity, but some channels are unannounced and *exposeprivatechannels* is *false*, so there isn't. -- **warning\_mpp**: there is sufficient capacity, but not in a single channel, so the payer will have to use multi-part payments. - -[comment]: # (GENERATE-FROM-SCHEMA-END) +- **warning\_capacity**: Even using all possible channels, there's not enough incoming capacity to pay this invoice. +- **warning\_offline**: There would be enough incoming capacity, but some channels are offline, so there isn't. +- **warning\_deadends**: There would be enough incoming capacity, but some channels are dead-ends (no other public channels from those peers), so there isn't. +- **warning\_private\_unused**: There would be enough incoming capacity, but some channels are unannounced and *exposeprivatechannels* is *false*, so there isn't. +- **warning\_mpp**: There is sufficient capacity, but not in a single channel, so the payer will have to use multi-part payments. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "expires_at": 1706757730, + "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk", + "payment_secret": "82644944d3f70d42aad1d5f7b5d7a629e7afa30b529cc952a4c59fc0e3790ea2", + "created_index": 1, + "warning_deadends": "Insufficient incoming capacity, once dead-end peers were excluded" +} +{ + "payment_hash": "f59ae0204dfe8e913207ea36646255b9d2c7c8229e8693d30547fc622eddb6b4", + "expires_at": 1709229182, + "bolt11": "lnbcrt1n1pja0z07sp5n8fk890nrq7zlcue0lgu7cduaaz765u5rg0kcud4amphuppu8wxspp57kdwqgzdl68fzvs8agmxgcj4h8fv0jpzn6rf85c9gl7xytkak66qdq9d9h8vxqyjw5qcqp99qxpqysgqrneaxh0plvjft457yv3q92rak57a6xw33m6phr0mrsy69sudzgez3adkzdsgwzy32z5usjpxm4rjgcg70h047wf0pgc4l9gyaj2h9ssqcrtv32", + "payment_secret": "99d36395f3183c2fe3997fd1cf61bcef45ed53941a1f6c71b5eec37e043c3b8d", + "created_index": 9, + "warning_capacity": "Insufficient incoming channel capacity to pay invoice" +} +``` ERRORS ------ @@ -61,11 +130,9 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-listinvoices(7), lightning-delinvoice(7), lightning-pay(7). +lightning-listinvoices(7), lightning-delinvoice(7), lightning-pay(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:1ca3d3b2f0ec5ef0a1dd702e6ce0c17125f8c9bbd3d91d73243b38eb9c4ad84e) diff --git a/doc/lightning-invoicerequest.7.md b/doc/lightning-invoicerequest.7.md index ce3c4f639688..069f6128979b 100644 --- a/doc/lightning-invoicerequest.7.md +++ b/doc/lightning-invoicerequest.7.md @@ -6,41 +6,66 @@ SYNOPSIS **(WARNING: experimental-offers only)** -**invoicerequest** *amount* *description* [*issuer*] [*label*] [*absolute\_expiry*] [*single\_use*] +**invoicerequest** *amount* *description* [*issuer*] [*label*] [*absolute\_expiry*] [*single\_use*] DESCRIPTION ----------- -The **invoicerequest** RPC command creates an `invoice_request` to -send payments: it automatically enables the processing of an incoming -invoice, and payment of it. The reader of the resulting -`invoice_request` can use lightning-sendinvoice(7) to collect their -payment. +Command *added* in v22.11. + +The **invoicerequest** RPC command creates an `invoice_request` to send payments: it automatically enables the processing of an incoming invoice, and payment of it. The reader of the resulting `invoice_request` can use lightning-sendinvoice(7) to collect their payment. + +- **amount** (msat): A positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. +- **description** (string): A short description of purpose of the payment, e.g. *ATM withdrawl*. This value is encoded into the resulting `invoice_request` and is viewable by anyone you expose it to. It must be UTF-8, and cannot use *\u* JSON escape codes. +- **issuer** (string, optional): Who is issuing it (i.e. you) if appropriate. +- **label** (string, optional): An internal-use name for the offer, which can be any UTF-8 string. +- **absolute\_expiry** (u64, optional): The time the offer is valid until, in seconds since the first day of 1970 UTC. If not set, the `invoice_request` remains valid (though it can be deactivated by the issuer of course). This is encoded in the `invoice_request`. +- **single\_use** (boolean, optional): Indicates that the `invoice_request` is only valid once; we may attempt multiple payments, but as soon as one is successful no more invoices are accepted (i.e. only one person can take the money). The default is True. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:invoicerequest#1", + "method": "invoicerequest", + "params": { + "amount": "10000sat", + "description": "simple test", + "issuer": "clightning test suite" + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **invreq\_id** (hash): the SHA256 hash of all invoice\_request fields less than 160 -- **active** (boolean): whether the invoice\_request is currently active (always *true*) -- **single\_use** (boolean): whether the invoice\_request will become inactive after we pay an invoice for it -- **bolt12** (string): the bolt12 string starting with lnr -- **used** (boolean): whether the invoice\_request has already been used (always *false*) -- **label** (string, optional): the label provided when creating the invoice\_request - -[comment]: # (GENERATE-FROM-SCHEMA-END) +- **invreq\_id** (hash): The SHA256 hash of all invoice\_request fields less than 160. +- **active** (boolean) (always *true*): Whether the invoice\_request is currently active. +- **single\_use** (boolean): Whether the invoice\_request will become inactive after we pay an invoice for it. +- **bolt12** (string): The bolt12 string starting with lnr. +- **used** (boolean) (always *false*): Whether the invoice\_request has already been used. +- **label** (string, optional): The label provided when creating the invoice\_request. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "invreq_id": "715484ead84bcdae5b33e3015c686fa1bdd4ae9ade3c4729b58257a98cfcd9b5", + "active": true, + "single_use": true, + "bolt12": "lnr1qqgteyhfyp40c79a5y3gfe33nxfs6zstwd5k6urvv5s8getnwsfp2cmvd9nksarwd9hxwgr5v4ehggrnw45hge2syqrzymjxzydqkkw24ufxqslttwlj3s608f0rx2slc7etw0833zgs75srnztgqkppqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq633uzq99smfawuu6pz0zh9jl6dl8v25u3kzes975x2j9tr0qp0ux0tlzcxjrgehxh9luz5vwjpk92tys9f9zlm038krcz4uqfxgelwf43tgfc", + "used": false +} +``` ERRORS ------ -On failure, an error is returned and no `invoice_request` is -created. If the lightning process fails before responding, the caller -should use lightning-listinvoicerequests(7) to query whether it was -created or not. - -The following error codes may occur: +On failure, an error is returned and no `invoice_request` is created. If the lightning process fails before responding, the caller should use lightning-listinvoicerequests(7) to query whether it was created or not. - -1: Catchall nonspecific error. @@ -52,11 +77,9 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-listinvoicerequests(7), lightning-disableinvoicerequest(7). +lightning-listinvoicerequests(7), lightning-disableinvoicerequest(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:5c264c66454c88f9864744218d0095f11cf85f3fcef77a9f9715e7521cf08059) diff --git a/doc/lightning-keysend.7.md b/doc/lightning-keysend.7.md index 6ea58e9f9ecf..1f16abb9b403 100644 --- a/doc/lightning-keysend.7.md +++ b/doc/lightning-keysend.7.md @@ -4,26 +4,97 @@ lightning-keysend -- Send funds to a node without an invoice SYNOPSIS -------- -**keysend** *destination* *amount\_msat* [*label*] [*maxfeepercent*] [*retry\_for*] [*maxdelay*] [*exemptfee*] [*extratlvs*] +**keysend** *destination* *amount\_msat* [*label*] [*maxfeepercent*] [*retry\_for*] [*maxdelay*] [*exemptfee*] [*routehints*] [*extratlvs*] DESCRIPTION ----------- -The **keysend** RPC command attempts to find a route to the given destination, -and send the specified amount to it. Unlike the `pay` RPC command the -`keysend` command does not require an invoice, instead it uses the -`destination` node ID, and `amount` to find a route to the specified node. - -In order for the destination to be able to claim the payment, the -`payment_key` is randomly generated by the sender and included in the -encrypted payload for the destination. As a consequence there is not -proof-of-payment, like there is with an invoice where the `payment_key` is -generated on the destination, and the only way sender could have it is by -sending a payment. Please ensure that this matches your use-case when using -`keysend`. - -When using *lightning-cli*, you may skip optional parameters by using -*null*. Alternatively, use **-k** option to provide parameters by name. +The **keysend** RPC command attempts to find a route to the given destination, and send the specified amount to it. Unlike the `pay` RPC command the `keysend` command does not require an invoice, instead it uses the `destination` node ID, and `amount` to find a route to the specified node. + +In order for the destination to be able to claim the payment, the `payment_key` is randomly generated by the sender and included in the encrypted payload for the destination. As a consequence there is not proof-of-payment, like there is with an invoice where the `payment_key` is generated on the destination, and the only way sender could have it is by sending a payment. Please ensure that this matches your use-case when using `keysend`. + +When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name. + +- **destination** (pubkey): The 33 byte, hex-encoded, node ID of the node that the payment should go to. +- **amount\_msat** (msat): A whole number, or a whole number with suffix `msat` or `sat`, or a three decimal point number with suffix `sat`, or an 1 to 11 decimal point number suffixed by `btc`. +- **label** (string, optional): Used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7). +- **maxfeepercent** (number, optional): Limits the money paid in fees as percentage of the total amount that is to be transferred. The default is 0.5. +- **retry\_for** (u32, optional): Until *retry\_for* seconds passes, the command will keep finding routes and retrying the payment. However, a payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case. The default is 60 seconds. +- **maxdelay** (u32, optional): Number of blocks the payment may be delayed. +- **exemptfee** (msat, optional): Used for tiny payments which would be dominated by the fee leveraged by forwarding nodes. Setting `exemptfee` allows the `maxfeepercent` check to be skipped on fees that are smaller than *exemptfee*. The default is 5000 millisatoshi. +- **routehints** (array of arrays, optional): + - (array of objects) + - **id** (pubkey) + - **scid** (short\_channel\_id) + - **feebase** (msat) + - **feeprop** (u32) + - **expirydelta** (u16) +- **extratlvs** (object, optional): Dictionary of additional fields to insert into the final tlv. The format is 'fieldnumber': 'hexstring'.: + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:keysend#1", + "method": "keysend", + "params": { + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount_msat": 10000, + "label": null, + "maxfeepercent": null, + "retry_for": null, + "maxdelay": null, + "exemptfee": null, + "extratlvs": null + } +} +{ + "id": "example:keysend#2", + "method": "keysend", + "params": { + "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "amount_msat": 10000000, + "label": null, + "maxfeepercent": null, + "retry_for": null, + "maxdelay": null, + "exemptfee": null, + "extratlvs": { + "133773310": "68656c6c6f776f726c64", + "133773312": "66696c7465726d65" + } + } +} +{ + "id": "example:keysend#3", + "method": "keysend", + "params": { + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount_msat": 10000, + "routehints": [ + [ + { + "scid": "4615051x2233541x57738", + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "feebase": 1, + "feeprop": 10, + "expirydelta": 9 + } + ], + [ + { + "scid": "1x2x3", + "id": "020202020202020202020202020202020202020202020202020202020202020202", + "feebase": 1, + "feeprop": 1, + "expirydelta": 9 + } + ] + ] + } +} +``` RANDOMIZATION ------------- @@ -32,64 +103,88 @@ To protect user privacy, the payment algorithm performs some randomization. 1: Route Randomization -Route randomization means the payment algorithm does not always use the -lowest-fee or shortest route. This prevents some highly-connected node -from learning all of the user payments by reducing their fees below the -network average. +Route randomization means the payment algorithm does not always use the lowest-fee or shortest route. This prevents some highly-connected node from learning all of the user payments by reducing their fees below the network average. 2: Shadow Route -Shadow route means the payment algorithm will virtually extend the route -by adding delays and fees along it, making it appear to intermediate nodes -that the route is longer than it actually is. This prevents intermediate -nodes from reliably guessing their distance from the payee. +Shadow route means the payment algorithm will virtually extend the route by adding delays and fees along it, making it appear to intermediate nodes that the route is longer than it actually is. This prevents intermediate nodes from reliably guessing their distance from the payee. -Route randomization will never exceed *maxfeepercent* of the payment. -Route randomization and shadow routing will not take routes that would -exceed *maxdelay*. +Route randomization will never exceed *maxfeepercent* of the payment. Route randomization and shadow routing will not take routes that would exceed *maxdelay*. RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **payment\_preimage** (secret): the proof of payment: SHA256 of this **payment\_hash** -- **payment\_hash** (hash): the hash of the *payment\_preimage* which will prove payment -- **created\_at** (number): the UNIX timestamp showing when this payment was initiated -- **parts** (u32): how many attempts this took -- **amount\_msat** (msat): Amount the recipient received -- **amount\_sent\_msat** (msat): Total amount we sent (including fees) -- **status** (string): status of payment (always "complete") -- **destination** (pubkey, optional): the final destination of the payment +- **payment\_preimage** (secret): The proof of payment: SHA256 of this **payment\_hash**. +- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. +- **created\_at** (number): The UNIX timestamp showing when this payment was initiated. +- **parts** (u32): How many attempts this took. +- **amount\_msat** (msat): Amount the recipient received. +- **amount\_sent\_msat** (msat): Total amount we sent (including fees). +- **status** (string) (always "complete"): Status of payment. +- **destination** (pubkey, optional): The final destination of the payment. The following warnings may also be returned: -- **warning\_partial\_completion**: Not all parts of a multi-part payment have completed - -[comment]: # (GENERATE-FROM-SCHEMA-END) +- **warning\_partial\_completion**: Not all parts of a multi-part payment have completed. You can monitor the progress and retries of a payment using the lightning-paystatus(7) command. +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "payment_hash": "b6f88603008a9f7dd84b1b94c7b972c8efbaf0b86c8d3c04512955992da9028e", + "created_at": 1706315742.6861734, + "parts": 1, + "amount_msat": 10000, + "amount_sent_msat": 10001, + "payment_preimage": "7178cf708e34dce816fc35aa692a65e1f85b92ae03bbc8ae6543302511823174", + "status": "complete" +} +{ + "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "payment_hash": "e8474eea8d5673e8407ef5f4924e58479b51a68afd136384683d5d6a97c9520d", + "created_at": 1708640424.1810749, + "parts": 1, + "amount_msat": 10000000, + "amount_sent_msat": 10000000, + "payment_preimage": "40e47272ea7da20c57a2381d81a5513ec03bd8ead9d51fbd2a91ec76d3f4bcbf", + "status": "complete" +} +{ + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "payment_hash": "56e12e6f45120bef7385c9bf307319eaa6a1b9160cdb3e62a3f492abf5bfa4bc", + "created_at": 1708640437.2895157, + "parts": 1, + "amount_msat": 10000, + "amount_sent_msat": 10001, + "payment_preimage": "682870b8f96e2aed1c86694dbb2c3e64cd396b9bba9fafd824d90eb0bd371b85", + "status": "complete" +} +``` + ERRORS ------ The following error codes may occur: -- `-1`: Catchall nonspecific error. -- `203`: Permanent failure at destination. The *data* field of the error will be routing failure object. -- `205`: Unable to find a route. -- `206`: Route too expensive. Either the fee or the needed total locktime for the route exceeds your *maxfeepercent* or *maxdelay* settings, respectively. The *data* field of the error will indicate the actual *fee* as well as the *feepercent* percentage that the fee has of the destination payment amount. It will also indicate the actual *delay* along the route. -- `210`: Payment timed out without a payment in progress. +- -1: Catchall nonspecific error. +- 203: Permanent failure at destination. The *data* field of the error will be routing failure object. +- 205: Unable to find a route. +- 206: Route too expensive. Either the fee or the needed total locktime for the route exceeds your *maxfeepercent* or *maxdelay* settings, respectively. The *data* field of the error will indicate the actual *fee* as well as the *feepercent* percentage that the fee has of the destination payment amount. It will also indicate the actual *delay* along the route. +- 210: Payment timed out without a payment in progress. A routing failure object has the fields below: -- `erring_index`: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on. -- `erring_node`: The hex string of the pubkey id of the node that reported the error. -- `erring_channel`: The short channel ID of the channel that has the error, or *0:0:0* if the destination node raised the error. -- `failcode`: The failure code, as per BOLT \#4. -- `channel_update`. The hex string of the *channel\_update* message received from the remote node. Only present if error is from the remote node and the *failcode* has the `UPDATE` bit set, as per BOLT \#4. - +*erring\_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on. +*erring\_node*: The hex string of the pubkey id of the node that reported the error. +*erring\_channel*: The short channel ID of the channel that has the error, or *0:0:0* if the destination node raised the error. +*failcode*: The failure code, as per BOLT #4. +*channel\_update*: The hex string of the *channel\_update* message received from the remote node. Only present if error is from the remote node and the *failcode* has the `UPDATE` bit set, as per BOLT #4. AUTHOR ------ @@ -99,12 +194,9 @@ Christian Decker <> is mainly responsible. SEE ALSO -------- -lightning-listpays(7), lightning-decodepay(7), lightning-listinvoice(7), -lightning-delinvoice(7), lightning-getroute(7), lightning-invoice(7). +lightning-listpays(7), lightning-decodepay(7), lightning-listinvoice(7), lightning-delinvoice(7), lightning-getroute(7), lightning-invoice(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:6b81d49a305cb833336af71dc2cadfa608957c4283194638d2b4cdc8575a1d8c) diff --git a/doc/lightning-listchannels.7.md b/doc/lightning-listchannels.7.md index 581a0a679b25..ab1ee903dc40 100644 --- a/doc/lightning-listchannels.7.md +++ b/doc/lightning-listchannels.7.md @@ -4,53 +4,120 @@ lightning-listchannels -- Command to query active lightning channels in the enti SYNOPSIS -------- -**listchannels** [*short\_channel\_id*] [*source*] [*destination*] +**listchannels** [*short\_channel\_id*] [*source*] [*destination*] DESCRIPTION ----------- -The **listchannels** RPC command returns data on channels that are known -to the node. Because channels may be bidirectional, up to 2 objects will -be returned for each channel (one for each direction). - -Only one of *short\_channel\_id*, *source* or *destination* can be supplied. -If nothing is supplied, data on all lightning channels known to this -node, are returned. These can be local channels or public channels -broadcast on the gossip network. +The **listchannels** RPC command returns data on channels that are known to the node. Because channels may be bidirectional, up to 2 objects will be returned for each channel (one for each direction). + +Only one of *short\_channel\_id*, *source* or *destination* can be supplied. If nothing is supplied, data on all lightning channels known to this node, are returned. These can be local channels or public channels broadcast on the gossip network. + +- **short\_channel\_id** (short\_channel\_id, optional): If short\_channel\_id is a short channel id, then only known channels with a matching short\_channel\_id are returned. Otherwise, it must be null. +- **source** (pubkey, optional): If source is a node id, then only channels leading from that node id are returned. +- **destination** (pubkey, optional): If destination is a node id, then only channels leading to that node id are returned. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:listchannels#1", + "method": "listchannels", + "params": { + "short_channel_id": "103x1x0", + "source": null, + "destination": null + } +} +{ + "id": "example:listchannels#2", + "method": "listchannels", + "params": { + "short_channel_id": null, + "source": null, + "destination": null + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **channels** is returned. It is an array of objects, where each object contains: - -- **source** (pubkey): the source node -- **destination** (pubkey): the destination node -- **short\_channel\_id** (short\_channel\_id): short channel id of channel -- **direction** (u32): direction (0 if source < destination, 1 otherwise). -- **public** (boolean): true if this is announced (from *v24.02*, being false is deprecated) -- **amount\_msat** (msat): the total capacity of this channel (always a whole number of satoshis) -- **message\_flags** (u8): as defined by BOLT #7 -- **channel\_flags** (u8): as defined by BOLT #7 -- **active** (boolean): true unless source has disabled it (or (deprecated in *v24.02*) it's a local channel and the peer is disconnected or it's still opening or closing) -- **last\_update** (u32): UNIX timestamp on the last channel\_update from *source* -- **base\_fee\_millisatoshi** (u32): Base fee changed by *source* to use this channel -- **fee\_per\_millionth** (u32): Proportional fee changed by *source* to use this channel, in parts-per-million -- **delay** (u32): The number of blocks delay required by *source* to use this channel -- **htlc\_minimum\_msat** (msat): The smallest payment *source* will allow via this channel -- **features** (hex): BOLT #9 features bitmap for this channel -- **htlc\_maximum\_msat** (msat, optional): The largest payment *source* will allow via this channel - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -If one of *short\_channel\_id*, *source* or *destination* is supplied and no -matching channels are found, a "channels" object with an empty list is returned. +On success, an object containing **channels** is returned. It is an array of objects, where each object contains: + +- **source** (pubkey): The source node. +- **destination** (pubkey): The destination node. +- **short\_channel\_id** (short\_channel\_id): Short channel id of channel. +- **direction** (u32): Direction (0 if source < destination, 1 otherwise). +- **public** (boolean): True if this is announced (from *v24.02*, being false is deprecated). +- **amount\_msat** (msat): The total capacity of this channel (always a whole number of satoshis). +- **message\_flags** (u8): As defined by BOLT #7. +- **channel\_flags** (u8): As defined by BOLT #7. +- **active** (boolean): True unless source has disabled it (or (deprecated in *v24.02*) it's a local channel and the peer is disconnected or it's still opening or closing). +- **last\_update** (u32): UNIX timestamp on the last channel\_update from *source*. +- **base\_fee\_millisatoshi** (u32): Base fee changed by *source* to use this channel. +- **fee\_per\_millionth** (u32): Proportional fee changed by *source* to use this channel, in parts-per-million. +- **delay** (u32): The number of blocks delay required by *source* to use this channel. +- **htlc\_minimum\_msat** (msat): The smallest payment *source* will allow via this channel. +- **features** (hex): BOLT #9 features bitmap for this channel. +- **htlc\_maximum\_msat** (msat, optional): The largest payment *source* will allow via this channel. + +If one of *short\_channel\_id*, *source* or *destination* is supplied and no matching channels are found, a 'channels' object with an empty list is returned. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "channels": [] +} +{ + "channels": [ + { + "source": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "short_channel_id": "103x1x0", + "direction": 0, + "public": true, + "amount_msat": 1000000000, + "message_flags": 1, + "channel_flags": 0, + "active": true, + "last_update": 1706153393, + "base_fee_millisatoshi": 1, + "fee_per_millionth": 10, + "delay": 6, + "htlc_minimum_msat": 0, + "htlc_maximum_msat": 990000000, + "features": "" + }, + { + "source": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "short_channel_id": "103x1x0", + "direction": 1, + "public": true, + "amount_msat": 1000000000, + "message_flags": 1, + "channel_flags": 1, + "active": true, + "last_update": 1706153393, + "base_fee_millisatoshi": 1, + "fee_per_millionth": 10, + "delay": 6, + "htlc_minimum_msat": 0, + "htlc_maximum_msat": 990000000, + "features": "" + } + ] +} +``` ERRORS ------ -On error the returned object will contain `code` and `message` properties, -with `code` being one of the following: +On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -32602: If the given parameters are wrong. @@ -69,9 +136,4 @@ RESOURCES Main web site: -Lightning RFC site - -- BOLT \#7: - - -[comment]: # ( SHA256STAMP:3c6cfe3faea9b58c4faeaa9aa695ae0ce05a9771f6e3b5396c754426d898e3eb) +BOLT #7: diff --git a/doc/lightning-listclosedchannels.7.md b/doc/lightning-listclosedchannels.7.md index e02a0023c661..324edb4595d6 100644 --- a/doc/lightning-listclosedchannels.7.md +++ b/doc/lightning-listclosedchannels.7.md @@ -4,58 +4,58 @@ lightning-listclosedchannels -- Get data on our closed historical channels SYNOPSIS -------- -**listclosedchannels** \[*id*\] +**listclosedchannels** [*id*] DESCRIPTION ----------- -The **listclosedchannels** RPC command returns data on channels which -are otherwise forgotten (more than 100 blocks after they're completely -resolved onchain). +Command *added* in v23.05. + +The **listclosedchannels** RPC command returns data on channels which are otherwise forgotten (more than 100 blocks after they're completely resolved onchain). + +- **id** (pubkey, optional): If no *id* is supplied, then channel data on all historical channels are given. Supplying *id* will filter the results to only match channels to that peer. Note that prior to v23.05, old peers were forgotten. RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **closedchannels** is returned. It is an array of objects, where each object contains: - -- **channel\_id** (hash): The full channel\_id (funding txid Xored with output number) -- **opener** (string): Who initiated the channel (one of "local", "remote") -- **private** (boolean): if True, we will not announce this channel -- **total\_local\_commitments** (u64): Number of commitment transaction we made -- **total\_remote\_commitments** (u64): Number of commitment transaction they made -- **total\_htlcs\_sent** (u64): Number of HTLCs we ever sent -- **funding\_txid** (txid): ID of the funding transaction -- **funding\_outnum** (u32): The 0-based output number of the funding transaction which opens the channel -- **leased** (boolean): Whether this channel was leased from `opener` -- **total\_msat** (msat): total amount in the channel -- **final\_to\_us\_msat** (msat): Our balance in final commitment transaction -- **min\_to\_us\_msat** (msat): Least amount owed to us ever. If the peer were to successfully steal from us, this is the amount we would still retain. -- **max\_to\_us\_msat** (msat): Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get. -- **close\_cause** (string): What caused the channel to close (one of "unknown", "local", "user", "remote", "protocol", "onchain") -- **peer\_id** (pubkey, optional): Peer public key (can be missing with pre-v23.05 closes!) -- **short\_channel\_id** (short\_channel\_id, optional): The short\_channel\_id +On success, an object containing **closedchannels** is returned. It is an array of objects, where each object contains: + +- **channel\_id** (hash): The full channel\_id (funding txid Xored with output number). +- **opener** (string) (one of "local", "remote"): Who initiated the channel. +- **private** (boolean): If True, we will not announce this channel. +- **total\_local\_commitments** (u64): Number of commitment transaction we made. +- **total\_remote\_commitments** (u64): Number of commitment transaction they made. +- **total\_htlcs\_sent** (u64): Number of HTLCs we ever sent. +- **funding\_txid** (txid): ID of the funding transaction. +- **funding\_outnum** (u32): The 0-based output number of the funding transaction which opens the channel. +- **leased** (boolean): Whether this channel was leased from `opener`. +- **total\_msat** (msat): Total amount in the channel. +- **final\_to\_us\_msat** (msat): Our balance in final commitment transaction. +- **min\_to\_us\_msat** (msat): Least amount owed to us ever. If the peer were to successfully steal from us, this is the amount we would still retain. +- **max\_to\_us\_msat** (msat): Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get. +- **close\_cause** (string) (one of "unknown", "local", "user", "remote", "protocol", "onchain"): What caused the channel to close. +- **peer\_id** (pubkey, optional): Peer public key (can be missing with pre-v23.05 closes!). +- **short\_channel\_id** (short\_channel\_id, optional): The short\_channel\_id. - **alias** (object, optional): - - **local** (short\_channel\_id, optional): An alias assigned by this node to this channel, used for outgoing payments - - **remote** (short\_channel\_id, optional): An alias assigned by the remote node to this channel, usable in routehints and invoices -- **closer** (string, optional): Who initiated the channel close (only present if closing) (one of "local", "remote") -- **channel\_type** (object, optional): channel\_type as negotiated with peer: - - **bits** (array of u32s): Each bit set in this channel\_type: - - Bit number - - **names** (array of strings): Feature name for each bit set in this channel\_type: - - Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even") -- **funding\_fee\_paid\_msat** (msat, optional): How much we paid to lease the channel (iff `leased` is true and `opener` is local) -- **funding\_fee\_rcvd\_msat** (msat, optional): How much they paid to lease the channel (iff `leased` is true and `opener` is remote) -- **funding\_pushed\_msat** (msat, optional): How much `opener` pushed immediate (if non-zero) -- **last\_commitment\_txid** (hash, optional): The final commitment tx's txid (or mutual close, if we accepted it). Not present for some very old, small channels pre-0.7.0. -- **last\_commitment\_fee\_msat** (msat, optional): The fee on `last_commitment_txid` -- **last\_stable\_connection** (u64, optional): Last time we reestablished the open channel and stayed connected for 1 minute *(added v24.02)* + - **local** (short\_channel\_id, optional): An alias assigned by this node to this channel, used for outgoing payments. + - **remote** (short\_channel\_id, optional): An alias assigned by the remote node to this channel, usable in routehints and invoices. +- **closer** (string, optional) (one of "local", "remote"): Who initiated the channel close (only present if closing). +- **channel\_type** (object, optional): Channel\_type as negotiated with peer.: + - **bits** (array of u32s): Each bit set in this channel\_type.: + - (u32, optional): Bit number. + - **names** (array of strings): Feature name for each bit set in this channel\_type.: + - (string, optional) (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even"): Name of feature bit. +- **funding\_fee\_paid\_msat** (msat, optional): How much we paid to lease the channel (iff `leased` is true and `opener` is local). +- **funding\_fee\_rcvd\_msat** (msat, optional): How much they paid to lease the channel (iff `leased` is true and `opener` is remote). +- **funding\_pushed\_msat** (msat, optional): How much `opener` pushed immediate (if non-zero). +- **last\_commitment\_txid** (hash, optional): The final commitment tx's txid (or mutual close, if we accepted it). Not present for some very old, small channels pre-0.7.0. +- **last\_commitment\_fee\_msat** (msat, optional): The fee on `last_commitment_txid`. +- **last\_stable\_connection** (u64, optional): Last time we reestablished the open channel and stayed connected for 1 minute. *(added v24.02)* ERRORS ------ -On error the returned object will contain `code` and `message` properties, -with `code` being one of the following: +On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -32602: If the given parameters are wrong. @@ -72,6 +72,4 @@ lightning-listpeerchannels(7) RESOURCES --------- -Main web site: Lightning - -[comment]: # ( SHA256STAMP:559d917217fe6d765d8bf019e46bf03d37dae9a437e530b1456252bcb901cbc9) +Main web site: diff --git a/doc/lightning-listconfigs.7.md b/doc/lightning-listconfigs.7.md index 2bd276e29363..14c59bae34a8 100644 --- a/doc/lightning-listconfigs.7.md +++ b/doc/lightning-listconfigs.7.md @@ -1,473 +1,822 @@ lightning-listconfigs -- Command to list all configuration options. -================================================================ +=================================================================== SYNOPSIS -------- -**listconfigs** [*config*] +**listconfigs** [*config*] DESCRIPTION ----------- The **listconfigs** RPC command to list all configuration options, or with *config* only one. -The returned values reflect the current configuration, including -showing default values (`dev-` options are not shown unless specified as *config* explicitly). - -Note: as plugins can add options, not all configuration settings are -listed here! The format of each entry is as follows: - -- **source** (string): source of configuration setting (`file`:`linenum`) -- **dynamic** (boolean, optional): true if this option is settable via setconfig -- **plugin** (string, optional): set if this is from a plugin - -Depending on the option type, exactly one of the following is present: - -- **set** (boolean, optional): for simple flag options -- **value\_str** (string, optional): for string options -- **value\_msat** (msat, optional): for msat options -- **value\_int** (integer, optional): for integer options -- **value\_bool** (boolean, optional): for boolean options +- **config** (string, optional): Configuration option name to restrict return. EXAMPLE JSON REQUEST -------------------- ```json { - "id": 82, + "id": "example:listconfigs#1", "method": "listconfigs", "params": { "config": "network" } } +{ + "id": "example:listconfigs#2", + "method": "listconfigs", + "params": { + "config": null + } +} +{ + "id": "example:listconfigs#3", + "method": "listconfigs", + "params": { + "config": "experimental-dual-fund" + } +} ``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) +The returned values reflect the current configuration, including showing default values (`dev-` options are not shown unless specified as *config* explicitly). + +Note: as plugins can add options, not all configuration settings are listed here! The format of each entry is as follows: + +- **source** (string): source of configuration setting (`file`:`linenum`) +- **dynamic** (boolean, optional): true if this option is settable via setconfig +- **plugin** (string, optional): set if this is from a plugin + +Depending on the option type, exactly one of the following is present: + +- **set** (boolean, optional): for simple flag options +- **value\_str** (string, optional): for string options +- **value\_msat** (msat, optional): for msat options +- **value\_int** (integer, optional): for integer options +- **value\_bool** (boolean, optional): for boolean options On success, an object is returned, containing: - **configs** (object, optional) *(added v23.08)*: - **conf** (object, optional): - - **value\_str** (string): field from cmdline - - **source** (string): source of configuration setting (always "cmdline") + - **value\_str** (string): Field from cmdline. + - **source** (string) (always "cmdline"): Source of configuration setting. - **developer** (object, optional) *(added v23.08)*: - - **set** (boolean): `true` if set in config or cmdline - - **source** (string): source of configuration setting + - **set** (boolean): `true` if set in config or cmdline. + - **source** (string): Source of configuration setting. - **clear-plugins** (object, optional): - - **set** (boolean): `true` if set in config or cmdline - - **source** (string): source of configuration setting + - **set** (boolean): `true` if set in config or cmdline. + - **source** (string): Source of configuration setting. - **disable-mpp** (object, optional): - - **set** (boolean): `true` if set in config or cmdline - - **source** (string): source of configuration setting - - **plugin** (string, optional): plugin which registered this configuration setting + - **set** (boolean): `true` if set in config or cmdline. + - **source** (string): Source of configuration setting. + - **plugin** (string, optional): Plugin which registered this configuration setting. - **mainnet** (object, optional): - - **set** (boolean): `true` if set in config or cmdline - - **source** (string): source of configuration setting + - **set** (boolean): `true` if set in config or cmdline. + - **source** (string): Source of configuration setting. - **regtest** (object, optional): - - **set** (boolean): `true` if set in config or cmdline - - **source** (string): source of configuration setting + - **set** (boolean): `true` if set in config or cmdline. + - **source** (string): Source of configuration setting. - **signet** (object, optional): - - **set** (boolean): `true` if set in config or cmdline - - **source** (string): source of configuration setting + - **set** (boolean): `true` if set in config or cmdline. + - **source** (string): Source of configuration setting. - **testnet** (object, optional): - - **set** (boolean): `true` if set in config or cmdline - - **source** (string): source of configuration setting + - **set** (boolean): `true` if set in config or cmdline. + - **source** (string): Source of configuration setting. - **important-plugin** (object, optional): - **values\_str** (array of strings): - - field from config or cmdline + - (string, optional): Field from config or cmdline. - **sources** (array of strings): - - source of configuration setting + - (string, optional): Source of configuration setting. - **plugin** (object, optional): - **values\_str** (array of strings): - - field from config or cmdline + - (string, optional): Field from config or cmdline. - **sources** (array of strings): - - source of configuration setting + - (string, optional): Source of configuration setting. - **plugin-dir** (object, optional): - **values\_str** (array of strings): - - field from config or cmdline + - (string, optional): Field from config or cmdline. - **sources** (array of strings): - - source of configuration setting + - (string, optional): Source of configuration setting. - **lightning-dir** (object, optional): - - **value\_str** (string): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_str** (string): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **network** (object, optional): - - **value\_str** (string): field from config or cmdline, or default (can also be changed by `testnet`, `signet`, `regtest` options!) - - **source** (string): source of configuration setting + - **value\_str** (string): Field from config or cmdline, or default (can also be changed by `testnet`, `signet`, `regtest` options!). + - **source** (string): Source of configuration setting. - **allow-deprecated-apis** (object, optional): - - **value\_bool** (boolean): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_bool** (boolean): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **rpc-file** (object, optional): - - **value\_str** (string): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_str** (string): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **disable-plugin** (object, optional): - **values\_str** (array of strings): - - field from config or cmdline + - (string, optional): Field from config or cmdline. - **sources** (array of strings): - - source of configuration setting + - (string, optional): Source of configuration setting. - **always-use-proxy** (object, optional): - - **value\_bool** (boolean): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_bool** (boolean): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **daemon** (object, optional): - - **set** (boolean): `true` if set in config or cmdline - - **source** (string): source of configuration setting + - **set** (boolean): `true` if set in config or cmdline. + - **source** (string): Source of configuration setting. - **wallet** (object, optional): - - **value\_str** (string): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_str** (string): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **large-channels** (object, optional): - - **set** (boolean): `true` if set in config or cmdline - - **source** (string): source of configuration setting + - **set** (boolean): `true` if set in config or cmdline. + - **source** (string): Source of configuration setting. - **experimental-dual-fund** (object, optional): - - **set** (boolean): `true` if set in config or cmdline - - **source** (string): source of configuration setting + - **set** (boolean): `true` if set in config or cmdline. + - **source** (string): Source of configuration setting. - **experimental-splicing** (object, optional) *(added v23.08)*: - - **set** (boolean): `true` if set in config or cmdline - - **source** (string): source of configuration setting + - **set** (boolean): `true` if set in config or cmdline. + - **source** (string): Source of configuration setting. - **experimental-onion-messages** (object, optional): - - **set** (boolean): `true` if set in config or cmdline - - **source** (string): source of configuration setting + - **set** (boolean): `true` if set in config or cmdline. + - **source** (string): Source of configuration setting. - **experimental-offers** (object, optional): - - **set** (boolean): `true` if set in config or cmdline - - **source** (string): source of configuration setting + - **set** (boolean): `true` if set in config or cmdline. + - **source** (string): Source of configuration setting. - **experimental-shutdown-wrong-funding** (object, optional): - - **set** (boolean): `true` if set in config or cmdline - - **source** (string): source of configuration setting + - **set** (boolean): `true` if set in config or cmdline. + - **source** (string): Source of configuration setting. - **experimental-websocket-port** (object, optional): - - **value\_int** (u32): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_int** (u32): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **experimental-peer-storage** (object, optional) *(added v23.02)*: - - **set** (boolean): `true` if set in config or cmdline - - **source** (string): source of configuration setting + - **set** (boolean): `true` if set in config or cmdline. + - **source** (string): Source of configuration setting. - **experimental-anchors** (object, optional) *(added v23.08)*: - - **set** (boolean): `true` if set in config or cmdline - - **source** (string): source of configuration setting + - **set** (boolean): `true` if set in config or cmdline. + - **source** (string): Source of configuration setting. - **database-upgrade** (object, optional): - - **value\_bool** (boolean): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_bool** (boolean): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **rgb** (object, optional): - - **value\_str** (hex): field from config or cmdline, or default (always 6 characters) - - **source** (string): source of configuration setting + - **value\_str** (hex) (always 6 characters): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **alias** (object, optional): - - **value\_str** (string): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_str** (string): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **pid-file** (object, optional): - - **value\_str** (string): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_str** (string): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **ignore-fee-limits** (object, optional): - - **value\_bool** (boolean): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_bool** (boolean): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **watchtime-blocks** (object, optional): - - **value\_int** (u32): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_int** (u32): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **max-locktime-blocks** (object, optional): - - **value\_int** (u32): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_int** (u32): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **funding-confirms** (object, optional): - - **value\_int** (u32): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_int** (u32): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **cltv-delta** (object, optional): - - **value\_int** (u32): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_int** (u32): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **cltv-final** (object, optional): - - **value\_int** (u32): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_int** (u32): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **commit-time** (object, optional): - - **value\_int** (u32): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_int** (u32): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **fee-base** (object, optional): - - **value\_int** (u32): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_int** (u32): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **rescan** (object, optional): - - **value\_int** (integer): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_int** (integer): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **fee-per-satoshi** (object, optional): - - **value\_int** (u32): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_int** (u32): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **max-concurrent-htlcs** (object, optional): - - **value\_int** (u32): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_int** (u32): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **htlc-minimum-msat** (object, optional): - - **value\_msat** (msat): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_msat** (msat): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **htlc-maximum-msat** (object, optional): - - **value\_msat** (msat): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_msat** (msat): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **max-dust-htlc-exposure-msat** (object, optional): - - **value\_msat** (msat): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_msat** (msat): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **min-capacity-sat** (object, optional): - - **value\_int** (u64): field from config or cmdline, or default - - **source** (string): source of configuration setting - - **dynamic** (boolean, optional): Can this be set by setconfig() (always *true*) + - **value\_int** (u64): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. + - **dynamic** (boolean, optional) (always *true*): Can this be set by setconfig(). - **addr** (object, optional): - **values\_str** (array of strings): - - field from config or cmdline + - (string, optional): Field from config or cmdline. - **sources** (array of strings): - - source of configuration setting + - (string, optional): Source of configuration setting. - **announce-addr** (object, optional): - **values\_str** (array of strings): - - field from config or cmdline + - (string, optional): Field from config or cmdline. - **sources** (array of strings): - - source of configuration setting + - (string, optional): Source of configuration setting. - **bind-addr** (object, optional): - **values\_str** (array of strings): - - field from config or cmdline + - (string, optional): Field from config or cmdline. - **sources** (array of strings): - - source of configuration setting + - (string, optional): Source of configuration setting. - **offline** (object, optional): - - **set** (boolean): `true` if set in config or cmdline - - **source** (string): source of configuration setting + - **set** (boolean): `true` if set in config or cmdline. + - **source** (string): Source of configuration setting. - **autolisten** (object, optional): - - **value\_bool** (boolean): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_bool** (boolean): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **proxy** (object, optional): - - **value\_str** (string): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_str** (string): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **disable-dns** (object, optional): - - **set** (boolean): `true` if set in config or cmdline - - **source** (string): source of configuration setting + - **set** (boolean): `true` if set in config or cmdline. + - **source** (string): Source of configuration setting. - **announce-addr-discovered** (object, optional) *(added v23.02)*: - - **value\_str** (string): field from config or cmdline, or default (one of "true", "false", "auto") - - **source** (string): source of configuration setting + - **value\_str** (string) (one of "true", "false", "auto"): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **announce-addr-discovered-port** (object, optional) *(added v23.02)*: - - **value\_int** (u32): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_int** (u32): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **encrypted-hsm** (object, optional): - - **set** (boolean): `true` if set in config or cmdline - - **source** (string): source of configuration setting + - **set** (boolean): `true` if set in config or cmdline. + - **source** (string): Source of configuration setting. - **rpc-file-mode** (object, optional): - - **value\_str** (string): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_str** (string): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **log-level** (object, optional): - - **value\_str** (string): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_str** (string): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **log-prefix** (object, optional): - - **value\_str** (string): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_str** (string): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **log-file** (object, optional): - **values\_str** (array of strings): - - field from config or cmdline + - (string, optional): Field from config or cmdline. - **sources** (array of strings): - - source of configuration setting + - (string, optional): Source of configuration setting. - **log-timestamps** (object, optional): - - **value\_bool** (boolean): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_bool** (boolean): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **force-feerates** (object, optional): - - **value\_str** (string): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_str** (string): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **subdaemon** (object, optional): - **values\_str** (array of strings): - - field from config or cmdline + - (string, optional): Field from config or cmdline. - **sources** (array of strings): - - source of configuration setting + - (string, optional): Source of configuration setting. - **fetchinvoice-noconnect** (object, optional): - - **set** (boolean): `true` if set in config or cmdline - - **source** (string): source of configuration setting + - **set** (boolean): `true` if set in config or cmdline. + - **source** (string): Source of configuration setting. - **accept-htlc-tlv-types** (object, optional): - - **value\_str** (string): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_str** (string): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **tor-service-password** (object, optional): - - **value\_str** (string): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_str** (string): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **announce-addr-dns** (object, optional): - - **value\_bool** (boolean): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_bool** (boolean): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **require-confirmed-inputs** (object, optional): - - **value\_bool** (boolean): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_bool** (boolean): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **commit-fee** (object, optional): - - **value\_int** (u64): field from config or cmdline, or default - - **source** (string): source of configuration setting + - **value\_int** (u64): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. - **commit-feerate-offset** (object, optional): - - **value\_int** (u32): field from config or cmdline, or default - - **source** (string): source of configuration setting -- **# version** (string, optional): Special field indicating the current version **deprecated in v23.08, removed after v24.02** + - **value\_int** (u32): Field from config or cmdline, or default. + - **source** (string): Source of configuration setting. +- **# version** (string, optional): Special field indicating the current version. **deprecated in v23.08, removed after v24.02** - **plugins** (array of objects, optional) **deprecated in v23.08, removed after v24.02**: - - **path** (string): Full path of the plugin - - **name** (string): short name of the plugin - - **options** (object, optional): Specific options set for this plugin: + - **path** (string): Full path of the plugin. + - **name** (string): Short name of the plugin. + - **options** (object, optional): Specific options set for this plugin.: - **important-plugins** (array of objects, optional) **deprecated in v23.08, removed after v24.02**: - - **path** (string): Full path of the plugin - - **name** (string): short name of the plugin - - **options** (object, optional): Specific options set for this plugin: -- **conf** (string, optional): `conf` field from cmdline, or default **deprecated in v23.08, removed after v24.02** -- **lightning-dir** (string, optional): `lightning-dir` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **network** (string, optional): `network` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **allow-deprecated-apis** (boolean, optional): `allow-deprecated-apis` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **rpc-file** (string, optional): `rpc-file` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** + - **path** (string): Full path of the plugin. + - **name** (string): Short name of the plugin. + - **options** (object, optional): Specific options set for this plugin.: +- **conf** (string, optional): `conf` field from cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **lightning-dir** (string, optional): `lightning-dir` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **network** (string, optional): `network` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **allow-deprecated-apis** (boolean, optional): `allow-deprecated-apis` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **rpc-file** (string, optional): `rpc-file` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** - **disable-plugin** (array of strings, optional) **deprecated in v23.08, removed after v24.02**: - - `disable-plugin` field from config or cmdline -- **bookkeeper-dir** (string, optional): `bookkeeper-dir` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **bookkeeper-db** (string, optional): `bookkeeper-db` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **always-use-proxy** (boolean, optional): `always-use-proxy` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **daemon** (boolean, optional): `daemon` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **wallet** (string, optional): `wallet` field from config or cmdline default **deprecated in v23.08, removed after v24.02** -- **large-channels** (boolean, optional): `large-channels` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **experimental-dual-fund** (boolean, optional): `experimental-dual-fund` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **experimental-splicing** (boolean, optional): `experimental-splicing` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **experimental-onion-messages** (boolean, optional): `experimental-onion-messages` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **experimental-offers** (boolean, optional): `experimental-offers` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **experimental-shutdown-wrong-funding** (boolean, optional): `experimental-shutdown-wrong-funding` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **experimental-websocket-port** (u16, optional): `experimental-websocket-port` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **experimental-peer-storage** (boolean, optional): `experimental-peer-storage` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** *(added v23.02)* -- **experimental-quiesce** (boolean, optional): `experimental-quiesce` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** *(added v23.08)* -- **experimental-upgrade-protocol** (boolean, optional): `experimental-upgrade-protocol` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** *(added v23.08)* -- **invoices-onchain-fallback** (boolean, optional): `invoices-onchain-fallback` field from config or cmdline, or default *(added v23.11)* -- **database-upgrade** (boolean, optional): `database-upgrade` field from config or cmdline **deprecated in v23.08, removed after v24.02** -- **rgb** (hex, optional): `rgb` field from config or cmdline, or default (always 6 characters) **deprecated in v23.08, removed after v24.02** -- **alias** (string, optional): `alias` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **pid-file** (string, optional): `pid-file` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **ignore-fee-limits** (boolean, optional): `ignore-fee-limits` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **watchtime-blocks** (u32, optional): `watchtime-blocks` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **max-locktime-blocks** (u32, optional): `max-locktime-blocks` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **funding-confirms** (u32, optional): `funding-confirms` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **cltv-delta** (u32, optional): `cltv-delta` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **cltv-final** (u32, optional): `cltv-final` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **commit-time** (u32, optional): `commit-time` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **fee-base** (u32, optional): `fee-base` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **rescan** (integer, optional): `rescan` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **fee-per-satoshi** (u32, optional): `fee-per-satoshi` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **max-concurrent-htlcs** (u32, optional): `max-concurrent-htlcs` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **htlc-minimum-msat** (msat, optional): `htlc-minimum-msat` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **htlc-maximum-msat** (msat, optional): `htlc-maximum-msat` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **max-dust-htlc-exposure-msat** (msat, optional): `max-dust-htlc-exposure-mast` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **min-capacity-sat** (u64, optional): `min-capacity-sat` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **addr** (string, optional): `addr` field from config or cmdline (can be more than one) **deprecated in v23.08, removed after v24.02** -- **announce-addr** (string, optional): `announce-addr` field from config or cmdline (can be more than one) **deprecated in v23.08, removed after v24.02** -- **bind-addr** (string, optional): `bind-addr` field from config or cmdline (can be more than one) **deprecated in v23.08, removed after v24.02** -- **offline** (boolean, optional): `true` if `offline` was set in config or cmdline **deprecated in v23.08, removed after v24.02** -- **autolisten** (boolean, optional): `autolisten` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **proxy** (string, optional): `proxy` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **disable-dns** (boolean, optional): `true` if `disable-dns` was set in config or cmdline **deprecated in v23.08, removed after v24.02** -- **announce-addr-discovered** (string, optional): `true`/`false`/`auto` depending on how `announce-addr-discovered` was set in config or cmdline **deprecated in v23.08, removed after v24.02** *(added v23.02)* + - (string, optional): `disable-plugin` field from config or cmdline. +- **bookkeeper-dir** (string, optional): `bookkeeper-dir` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **bookkeeper-db** (string, optional): `bookkeeper-db` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **always-use-proxy** (boolean, optional): `always-use-proxy` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **daemon** (boolean, optional): `daemon` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **wallet** (string, optional): `wallet` field from config or cmdline default. **deprecated in v23.08, removed after v24.02** +- **large-channels** (boolean, optional): `large-channels` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **experimental-dual-fund** (boolean, optional): `experimental-dual-fund` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **experimental-splicing** (boolean, optional): `experimental-splicing` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **experimental-onion-messages** (boolean, optional): `experimental-onion-messages` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **experimental-offers** (boolean, optional): `experimental-offers` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **experimental-shutdown-wrong-funding** (boolean, optional): `experimental-shutdown-wrong-funding` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **experimental-websocket-port** (u16, optional): `experimental-websocket-port` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **experimental-peer-storage** (boolean, optional): `experimental-peer-storage` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** *(added v23.02)* +- **experimental-quiesce** (boolean, optional): `experimental-quiesce` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** *(added v23.08)* +- **experimental-upgrade-protocol** (boolean, optional): `experimental-upgrade-protocol` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** *(added v23.08)* +- **invoices-onchain-fallback** (boolean, optional): `invoices-onchain-fallback` field from config or cmdline, or default. *(added v23.11)* +- **database-upgrade** (boolean, optional): `database-upgrade` field from config or cmdline. **deprecated in v23.08, removed after v24.02** +- **rgb** (hex, optional) (always 6 characters): `rgb` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **alias** (string, optional): `alias` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **pid-file** (string, optional): `pid-file` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **ignore-fee-limits** (boolean, optional): `ignore-fee-limits` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **watchtime-blocks** (u32, optional): `watchtime-blocks` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **max-locktime-blocks** (u32, optional): `max-locktime-blocks` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **funding-confirms** (u32, optional): `funding-confirms` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **cltv-delta** (u32, optional): `cltv-delta` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **cltv-final** (u32, optional): `cltv-final` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **commit-time** (u32, optional): `commit-time` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **fee-base** (u32, optional): `fee-base` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **rescan** (integer, optional): `rescan` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **fee-per-satoshi** (u32, optional): `fee-per-satoshi` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **max-concurrent-htlcs** (u32, optional): `max-concurrent-htlcs` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **htlc-minimum-msat** (msat, optional): `htlc-minimum-msat` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **htlc-maximum-msat** (msat, optional): `htlc-maximum-msat` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **max-dust-htlc-exposure-msat** (msat, optional): `max-dust-htlc-exposure-mast` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **min-capacity-sat** (u64, optional): `min-capacity-sat` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **addr** (string, optional): `addr` field from config or cmdline (can be more than one). **deprecated in v23.08, removed after v24.02** +- **announce-addr** (string, optional): `announce-addr` field from config or cmdline (can be more than one). **deprecated in v23.08, removed after v24.02** +- **bind-addr** (string, optional): `bind-addr` field from config or cmdline (can be more than one). **deprecated in v23.08, removed after v24.02** +- **offline** (boolean, optional): `true` if `offline` was set in config or cmdline. **deprecated in v23.08, removed after v24.02** +- **autolisten** (boolean, optional): `autolisten` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **proxy** (string, optional): `proxy` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **disable-dns** (boolean, optional): `true` if `disable-dns` was set in config or cmdline. **deprecated in v23.08, removed after v24.02** +- **announce-addr-discovered** (string, optional): `true`/`false`/`auto` depending on how `announce-addr-discovered` was set in config or cmdline. **deprecated in v23.08, removed after v24.02** *(added v23.02)* - **announce-addr-discovered-port** (integer, optional): Sets the announced TCP port for dynamically discovered IPs. **deprecated in v23.08, removed after v24.02** *(added v23.02)* -- **encrypted-hsm** (boolean, optional): `true` if `encrypted-hsm` was set in config or cmdline **deprecated in v23.08, removed after v24.02** -- **rpc-file-mode** (string, optional): `rpc-file-mode` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **log-level** (string, optional): `log-level` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **log-prefix** (string, optional): `log-prefix` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **log-file** (string, optional): `log-file` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **log-timestamps** (boolean, optional): `log-timestamps` field from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **force-feerates** (string, optional): force-feerate configuration setting, if any **deprecated in v23.08, removed after v24.02** -- **subdaemon** (string, optional): `subdaemon` fields from config or cmdline if any (can be more than one) **deprecated in v23.08, removed after v24.02** -- **fetchinvoice-noconnect** (boolean, optional): `fetchinvoice-noconnect` fields from config or cmdline, or default **deprecated in v23.08, removed after v24.02** -- **accept-htlc-tlv-types** (string, optional): `accept-htlc-tlv-types` field from config or cmdline, or not present **deprecated in v23.08, removed after v24.02** -- **tor-service-password** (string, optional): `tor-service-password` field from config or cmdline, if any **deprecated in v23.08, removed after v24.02** -- **dev-allowdustreserve** (boolean, optional): Whether we allow setting dust reserves **deprecated in v23.08, removed after v24.02** -- **announce-addr-dns** (boolean, optional): Whether we put DNS entries into node\_announcement **deprecated in v23.08, removed after v24.02** *(added v22.11.1)* -- **require-confirmed-inputs** (boolean, optional): Request peers to only send confirmed inputs (dual-fund only) **deprecated in v23.08, removed after v24.02** -- **developer** (boolean, optional): Whether developer mode is enabled *(added v23.08)* -- **commit-fee** (u64, optional): The percentage of the 6-block fee estimate to use for commitment transactions **deprecated in v23.08, removed after v24.02** *(added v23.05)* -- **min-emergency-msat** (msat, optional): field from config or cmdline, or default *(added v23.08)* -- **commit-feerate-offset** (u32, optional): additional commitment feerate applied by channel owner *(added v23.11)* - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -ERRORS ------- - -On failure, one of the following error codes may be returned: - -- -32602: Error in given parameters or field with *config* name doesn't exist. +- **encrypted-hsm** (boolean, optional): `true` if `encrypted-hsm` was set in config or cmdline. **deprecated in v23.08, removed after v24.02** +- **rpc-file-mode** (string, optional): `rpc-file-mode` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **log-level** (string, optional): `log-level` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **log-prefix** (string, optional): `log-prefix` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **log-file** (string, optional): `log-file` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **log-timestamps** (boolean, optional): `log-timestamps` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **force-feerates** (string, optional): Force-feerate configuration setting, if any. **deprecated in v23.08, removed after v24.02** +- **subdaemon** (string, optional): `subdaemon` fields from config or cmdline if any (can be more than one). **deprecated in v23.08, removed after v24.02** +- **fetchinvoice-noconnect** (boolean, optional): `fetchinvoice-noconnect` fields from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** +- **accept-htlc-tlv-types** (string, optional): `accept-htlc-tlv-types` field from config or cmdline, or not present. **deprecated in v23.08, removed after v24.02** +- **tor-service-password** (string, optional): `tor-service-password` field from config or cmdline, if any. **deprecated in v23.08, removed after v24.02** +- **dev-allowdustreserve** (boolean, optional): Whether we allow setting dust reserves. **deprecated in v23.08, removed after v24.02** +- **announce-addr-dns** (boolean, optional): Whether we put DNS entries into node\_announcement. **deprecated in v23.08, removed after v24.02** *(added v22.11.1)* +- **require-confirmed-inputs** (boolean, optional): Request peers to only send confirmed inputs (dual-fund only). **deprecated in v23.08, removed after v24.02** +- **developer** (boolean, optional): Whether developer mode is enabled. *(added v23.08)* +- **commit-fee** (u64, optional): The percentage of the 6-block fee estimate to use for commitment transactions. **deprecated in v23.08, removed after v24.02** *(added v23.05)* +- **min-emergency-msat** (msat, optional): Field from config or cmdline, or default. *(added v23.08)* +- **commit-feerate-offset** (u32, optional): Additional commitment feerate applied by channel owner. *(added v23.11)* EXAMPLE JSON RESPONSE --------------------- ```json { - "# version": "v0.9.0-1", - "lightning-dir": "/media/vincent/Maxtor/sanboxTestWrapperRPC/lightning_dir_dev", - "network": "testnet", - "allow-deprecated-apis": true, - "rpc-file": "lightning-rpc", - "plugins": [ - { - "path": "/home/vincent/Github/plugins/sauron/sauron.py", - "name": "sauron.py", - "options": { - "sauron-api-endpoint": "http://blockstream.info/testnet/api/", - "sauron-tor-proxy": "" - } - }, - { - "path": "/home/vincent/Github/reckless/reckless.py", - "name": "reckless.py" + "#version": "v0.9.0-1", + "lightning-dir": "/media/vincent/Maxtor/sanboxTestWrapperRPC/lightning_dir_dev", + "network": "testnet", + "allow-deprecated-apis": true, + "rpc-file": "lightning-rpc", + "plugins": [ + { + "path": "/home/vincent/Github/plugins/sauron/sauron.py", + "name": "sauron.py", + "options": { + "sauron-api-endpoint": "http://blockstream.info/testnet/api/", + "sauron-tor-proxy": "" + } + }, + { + "path": "/home/vincent/Github/reckless/reckless.py", + "name": "reckless.py" + } + ], + "important-plugins": [ + { + "path": "/home/vincent/Github/lightning/lightningd/../plugins/autoclean", + "name": "autoclean", + "options": { + "autocleaninvoice-cycle": null, + "autocleaninvoice-expired-by": null } - ], - "important-plugins": [ - { - "path": "/home/vincent/Github/lightning/lightningd/../plugins/autoclean", - "name": "autoclean", - "options": { - "autocleaninvoice-cycle": null, - "autocleaninvoice-expired-by": null - } - }, - { - "path": "/home/vincent/Github/lightning/lightningd/../plugins/fundchannel", - "name": "fundchannel" - }, - { - "path": "/home/vincent/Github/lightning/lightningd/../plugins/keysend", - "name": "keysend" - }, - { - "path": "/home/vincent/Github/lightning/lightningd/../plugins/pay", - "name": "pay", - "options": { - "disable-mpp": false - } + }, + { + "path": "/home/vincent/Github/lightning/lightningd/../plugins/fundchannel", + "name": "fundchannel" + }, + { + "path": "/home/vincent/Github/lightning/lightningd/../plugins/keysend", + "name": "keysend" + }, + { + "path": "/home/vincent/Github/lightning/lightningd/../plugins/pay", + "name": "pay", + "options": { + "disable-mpp": false } - ], - "important-plugin": "/home/vincent/Github/lightning/lightningd/../plugins/autoclean", - "important-plugin": "/home/vincent/Github/lightning/lightningd/../plugins/fundchannel", - "important-plugin": "/home/vincent/Github/lightning/lightningd/../plugins/keysend", - "important-plugin": "/home/vincent/Github/lightning/lightningd/../plugins/pay", - "plugin": "/home/vincent/Github/plugins/sauron/sauron.py", - "plugin": "/home/vincent/Github/reckless/reckless.py", - "disable-plugin": [ - "bcli" - ], - "always-use-proxy": false, - "daemon": "false", - "wallet": "sqlite3:///media/vincent/Maxtor/sanboxTestWrapperRPC/lightning_dir_dev/testnet/lightningd.sqlite3", - "wumbo": true, - "rgb": "03ad98", - "alias": "BRUCEWAYN-TES-DEV", - "pid-file": "/media/vincent/Maxtor/sanboxTestWrapperRPC/lightning_dir_dev/lightningd-testne...", - "ignore-fee-limits": true, - "watchtime-blocks": 6, - "max-locktime-blocks": 2016, - "funding-confirms": 1, - "commit-fee-min": 0, - "commit-fee-max": 0, - "cltv-delta": 6, - "cltv-final": 10, - "commit-time": 10, - "fee-base": 1, - "rescan": 30, - "fee-per-satoshi": 10, - "max-concurrent-htlcs": 483, - "min-capacity-sat": 10000, - "addr": "autotor:127.0.0.1:9051", - "bind-addr": "127.0.0.1:9735", - "announce-addr": "fp463inc4w3lamhhduytrwdwq6q6uzugtaeapylqfc43agrdnnqsheyd.onion:9735", - "offline": "false", - "autolisten": true, - "proxy": "127.0.0.1:9050", - "disable-dns": "false", - "encrypted-hsm": false, - "rpc-file-mode": "0600", - "log-level": "DEBUG", - "log-prefix": "lightningd", + } + ], + "important-plugin": "/home/vincent/Github/lightning/lightningd/../plugins/pay", + "plugin": "/home/vincent/Github/reckless/reckless.py", + "disable-plugin": [ + "bcli" + ], + "always-use-proxy": false, + "daemon": "false", + "wallet": "sqlite3:///media/vincent/Maxtor/sanboxTestWrapperRPC/lightning_dir_dev/testnet/lightningd.sqlite3", + "wumbo": true, + "rgb": "03ad98", + "alias": "BRUCEWAYN-TES-DEV", + "pid-file": "/media/vincent/Maxtor/sanboxTestWrapperRPC/lightning_dir_dev/lightningd-testne...", + "ignore-fee-limits": true, + "watchtime-blocks": 6, + "max-locktime-blocks": 2016, + "funding-confirms": 1, + "commit-fee-min": 0, + "commit-fee-max": 0, + "cltv-delta": 6, + "cltv-final": 10, + "commit-time": 10, + "fee-base": 1, + "rescan": 30, + "fee-per-satoshi": 10, + "max-concurrent-htlcs": 483, + "min-capacity-sat": 10000, + "addr": "autotor:127.0.0.1:9051", + "bind-addr": "127.0.0.1:9735", + "announce-addr": "fp463inc4w3lamhhduytrwdwq6q6uzugtaeapylqfc43agrdnnqsheyd.onion:9735", + "offline": "false", + "autolisten": true, + "proxy": "127.0.0.1:9050", + "disable-dns": "false", + "encrypted-hsm": false, + "rpc-file-mode": "0600", + "log-level": "DEBUG", + "log-prefix": "lightningd" +} +{ + "configs": { + "developer": { + "set": true, + "source": "cmdline" + }, + "lightning-dir": { + "value_str": "/tmp/ltests-giwf5tc7/test_plugin_start_1/lightning-1/", + "source": "cmdline" + }, + "network": { + "value_str": "regtest", + "source": "cmdline" + }, + "testnet": { + "set": false, + "source": "default" + }, + "signet": { + "set": false, + "source": "default" + }, + "mainnet": { + "set": false, + "source": "default" + }, + "regtest": { + "set": false, + "source": "default" + }, + "rpc-file": { + "value_str": "lightning-rpc", + "source": "default" + }, + "allow-deprecated-apis": { + "value_bool": false, + "source": "cmdline" + }, + "plugin": { + "values_str": [ + "~/lightning/target/debug/examples/cln-plugin-startup" + ], + "sources": [ + "cmdline" + ] + }, + "plugin-dir": { + "values_str": [], + "sources": [] + }, + "clear-plugins": { + "set": false, + "source": "default" + }, + "disable-plugin": { + "values_str": [], + "sources": [] + }, + "important-plugin": { + "values_str": [], + "sources": [] + }, + "always-use-proxy": { + "value_bool": false, + "source": "default" + }, + "daemon": { + "set": false, + "source": "default" + }, + "experimental-dual-fund": { + "set": false, + "source": "default" + }, + "experimental-splicing": { + "set": false, + "source": "default" + }, + "experimental-onion-messages": { + "set": false, + "source": "default" + }, + "experimental-offers": { + "set": false, + "source": "default" + }, + "experimental-shutdown-wrong-funding": { + "set": false, + "source": "default" + }, + "experimental-peer-storage": { + "set": false, + "source": "default" + }, + "experimental-quiesce": { + "set": false, + "source": "default" + }, + "experimental-anchors": { + "set": false, + "source": "default" + }, + "rgb": { + "value_str": "0266e4", + "source": "default" + }, + "alias": { + "value_str": "JUNIORBEAM-1-102-g7549e10-modded", + "source": "default" + }, + "pid-file": { + "value_str": "/tmp/ltests-giwf5tc7/test_plugin_start_1/lightning-1/lightningd-regtest.pid", + "source": "default" + }, + "ignore-fee-limits": { + "value_bool": false, + "source": "cmdline" + }, + "watchtime-blocks": { + "value_int": 5, + "source": "cmdline" + }, + "max-locktime-blocks": { + "value_int": 2016, + "source": "default" + }, + "funding-confirms": { + "value_int": 1, + "source": "default" + }, + "require-confirmed-inputs": { + "value_bool": false, + "source": "default" + }, + "cltv-delta": { + "value_int": 6, + "source": "cmdline" + }, + "cltv-final": { + "value_int": 5, + "source": "cmdline" + }, + "commit-time": { + "value_int": 10, + "source": "default" + }, + "fee-base": { + "value_int": 1, + "source": "default" + }, + "rescan": { + "value_int": 1, + "source": "cmdline" + }, + "fee-per-satoshi": { + "value_int": 10, + "source": "default" + }, + "htlc-minimum-msat": { + "value_msat": 0, + "source": "default" + }, + "htlc-maximum-msat": { + "value_msat": 18446744073709552000, + "source": "default" + }, + "max-concurrent-htlcs": { + "value_int": 483, + "source": "default" + }, + "max-dust-htlc-exposure-msat": { + "value_msat": 50000000, + "source": "default" + }, + "min-capacity-sat": { + "value_int": 10000, + "source": "default", + "dynamic": true + }, + "addr": { + "values_str": [ + "127.0.0.1:33157" + ], + "sources": [ + "cmdline" + ] + }, + "bind-addr": { + "values_str": [], + "sources": [] + }, + "announce-addr": { + "values_str": [], + "sources": [] + }, + "announce-addr-discovered": { + "value_str": "auto", + "source": "default" + }, + "announce-addr-discovered-port": { + "value_int": 19846, + "source": "default" + }, + "offline": { + "set": false, + "source": "default" + }, + "autolisten": { + "value_bool": false, + "source": "default" + }, + "accept-htlc-tlv-type": { + "values_int": [], + "sources": [] + }, + "disable-dns": { + "set": true, + "source": "cmdline" + }, + "encrypted-hsm": { + "set": false, + "source": "default" + }, + "rpc-file-mode": { + "value_str": "0600", + "source": "default" + }, + "commit-fee": { + "value_int": 100, + "source": "default" + }, + "commit-feerate-offset": { + "value_int": 5, + "source": "default" + }, + "min-emergency-msat": { + "value_msat": 25000000, + "source": "default" + }, + "subdaemon": { + "values_str": [], + "sources": [] + }, + "experimental-upgrade-protocol": { + "set": false, + "source": "default" + }, + "invoices-onchain-fallback": { + "set": false, + "source": "default" + }, + "log-level": { + "value_str": "debug", + "source": "cmdline" + }, + "log-timestamps": { + "value_bool": true, + "source": "default" + }, + "log-prefix": { + "value_str": "lightningd-1 ", + "source": "cmdline" + }, + "log-file": { + "values_str": [ + "-", + "/tmp/ltests-giwf5tc7/test_plugin_start_1/lightning-1/log" + ], + "sources": [ + "cmdline", + "cmdline" + ] + }, + "dev-no-plugin-checksum": { + "set": true, + "source": "cmdline" + }, + "dev-no-reconnect": { + "set": true, + "source": "cmdline" + }, + "dev-fail-on-subdaemon-fail": { + "set": true, + "source": "cmdline" + }, + "dev-bitcoind-poll": { + "value_int": 1, + "source": "cmdline" + }, + "dev-fast-gossip": { + "set": true, + "source": "cmdline" + }, + "renepay-debug-mcf": { + "set": false, + "source": "default", + "plugin": "~/lightning/plugins/cln-renepay" + }, + "renepay-debug-payflow": { + "set": false, + "source": "default", + "plugin": "~/lightning/plugins/cln-renepay" + }, + "test-option": { + "value_int": 31337, + "source": "cmdline", + "plugin": "~/lightning/target/debug/examples/cln-plugin-startup" + }, + "bitcoin-datadir": { + "value_str": "/tmp/ltests-giwf5tc7/test_plugin_start_1/lightning-1/", + "source": "cmdline", + "plugin": "~/lightning/plugins/bcli" + }, + "bitcoin-rpcuser": { + "value_str": "rpcuser", + "source": "cmdline", + "plugin": "~/lightning/plugins/bcli" + }, + "bitcoin-rpcpassword": { + "value_str": "rpcpass", + "source": "cmdline", + "plugin": "~/lightning/plugins/bcli" + }, + "bitcoin-rpcport": { + "value_int": 51309, + "source": "cmdline", + "plugin": "~/lightning/plugins/bcli" + }, + "disable-mpp": { + "set": false, + "source": "default", + "plugin": "~/lightning/plugins/pay" + } + } +} +{ + "configs": { + "experimental-dual-fund": { + "set": false, + "source": "default" + } + } } - ``` +ERRORS +------ + +On failure, one of the following error codes may be returned: + +- -32602: Error in given parameters or field with *config* name doesn't exist. + AUTHOR ------ -Vincenzo Palazzo <> wrote the initial version of this man page, but many others did the hard work of actually implementing this rpc command. +Vincenzo Palazzo <> wrote the initial version of this man page, +but many others did the hard work of actually implementing this rpc command. SEE ALSO -------- @@ -478,5 +827,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:89743916ac51dc00d774c4d3c33715521846b36bc77e0b2083a262ef32b130f4) diff --git a/doc/lightning-listdatastore.7.md b/doc/lightning-listdatastore.7.md index 980b2e119e3b..7e115feeff9b 100644 --- a/doc/lightning-listdatastore.7.md +++ b/doc/lightning-listdatastore.7.md @@ -4,27 +4,73 @@ lightning-listdatastore -- Command for listing (plugin) data SYNOPSIS -------- -**listdatastore** [*key*] +**listdatastore** [*key*] DESCRIPTION ----------- -The **listdatastore** RPC command allows plugins to fetch data which was -stored in the Core Lightning database. +The **listdatastore** RPC command allows plugins to fetch data which was stored in the Core Lightning database. + +- **key** (one of, optional): + - (array of strings): All immediate children of the *key* (or root children) are returned. + Using the first element of the key as the plugin name (e.g. `[ 'summary' ]`) is recommended. + An array of values to form a hierarchy (though a single value is treated as a one-element array). + - (string, optional) + - (string) + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:listdatastore#1", + "method": "listdatastore", + "params": { + "key": [ + "commando" + ] + } +} +{ + "id": "example:listdatastore#2", + "method": "listdatastore", + "params": { + "key": "otherkey" + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **datastore** is returned. It is an array of objects, where each object contains: +On success, an object containing **datastore** is returned. It is an array of objects, where each object contains: - **key** (array of strings): - - Part of the key added to the datastore -- **generation** (u64, optional): The number of times this has been updated -- **hex** (hex, optional): The hex data from the datastore -- **string** (string, optional): The data as a string, if it's valid utf-8 - -[comment]: # (GENERATE-FROM-SCHEMA-END) + - (string, optional): Part of the key added to the datastore. +- **generation** (u64, optional): The number of times this has been updated. +- **hex** (hex, optional): The hex data from the datastore. +- **string** (string, optional): The data as a string, if it's valid utf-8. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "datastore": [] +} +{ + "datastore": [ + { + "key": [ + "otherkey" + ], + "generation": 0, + "hex": "6f7468657264617461", + "string": "otherdata" + } + ] +} +``` ERRORS ------ @@ -47,5 +93,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:774755024cb431c96e74f5ca634cf8c03da853caa740c196b6ef24cdcf942874) diff --git a/doc/lightning-listforwards.7.md b/doc/lightning-listforwards.7.md index 2c87519b077d..262ac726461e 100644 --- a/doc/lightning-listforwards.7.md +++ b/doc/lightning-listforwards.7.md @@ -9,41 +9,127 @@ SYNOPSIS DESCRIPTION ----------- -The **listforwards** RPC command displays all htlcs that have been -attempted to be forwarded by the Core Lightning node. +The **listforwards** RPC command displays all htlcs that have been attempted to be forwarded by the Core Lightning node. + +- **status** (string, optional) (one of "offered", "settled", "local\_failed", "failed"): If specified, then only the forwards with the given status are returned. +- **in\_channel** (short\_channel\_id, optional): Only the matching forwards on the given inbound channel are returned. +- **out\_channel** (short\_channel\_id, optional): Only the matching forwards on the given outbount channel are returned. +- **index** (string, optional) (one of "created", "updated"): If neither *in\_channel* nor *out\_channel* is specified, it controls ordering. The default is `created`. *(added v23.11)* +- **start** (u64, optional): If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7). *(added v23.11)* +- **limit** (u32, optional): If `index` is specified, `limit` can be used to specify the maximum number of entries to return. *(added v23.11)* + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:listforwards#1", + "method": "listforwards", + "params": { + "status": null, + "in_channel": null, + "out_channel": null, + "index": null, + "start": null, + "limit": null + } +} +{ + "id": "example:listforwards#2", + "method": "listforwards", + "params": { + "in_channel": "0x1x2", + "out_channel": "0x2x3", + "status": "settled" + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **forwards** is returned. It is an array of objects, where each object contains: +On success, an object containing **forwards** is returned. It is an array of objects, where each object contains: -- **created\_index** (u64): 1-based index indicating order this forward was created in *(added v23.11)* -- **in\_channel** (short\_channel\_id): the channel that received the HTLC -- **in\_msat** (msat): the value of the incoming HTLC -- **status** (string): still ongoing, completed, failed locally, or failed after forwarding (one of "offered", "settled", "local\_failed", "failed") -- **received\_time** (number): the UNIX timestamp when this was received -- **in\_htlc\_id** (u64, optional): the unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11) -- **out\_channel** (short\_channel\_id, optional): the channel that the HTLC (trying to) forward to -- **out\_htlc\_id** (u64, optional): the unique HTLC id we gave this when sending (may be missing even if out\_channel is present, for old forwards before v22.11) -- **updated\_index** (u64, optional): 1-based index indicating order this forward was changed (only present if it has changed since creation) *(added v23.11)* -- **style** (string, optional): Either a legacy onion format or a modern tlv format (one of "legacy", "tlv") +- **created\_index** (u64): 1-based index indicating order this forward was created in. *(added v23.11)* +- **in\_channel** (short\_channel\_id): The channel that received the HTLC. +- **in\_msat** (msat): The value of the incoming HTLC. +- **status** (string) (one of "offered", "settled", "local\_failed", "failed"): Still ongoing, completed, failed locally, or failed after forwarding. +- **received\_time** (number): The UNIX timestamp when this was received. +- **in\_htlc\_id** (u64, optional): The unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11). +- **out\_channel** (short\_channel\_id, optional): The channel that the HTLC (trying to) forward to. +- **out\_htlc\_id** (u64, optional): The unique HTLC id we gave this when sending (may be missing even if out\_channel is present, for old forwards before v22.11). +- **updated\_index** (u64, optional): 1-based index indicating order this forward was changed (only present if it has changed since creation). *(added v23.11)* +- **style** (string, optional) (one of "legacy", "tlv"): Either a legacy onion format or a modern tlv format. If **out\_msat** is present: - - - **fee\_msat** (msat): the amount this paid in fees - - **out\_msat** (msat): the amount we sent out the *out\_channel* + - **fee\_msat** (msat): The amount this paid in fees. + - **out\_msat** (msat): The amount we sent out the *out\_channel*. If **status** is "settled" or "failed": - - - **resolved\_time** (number): the UNIX timestamp when this was resolved + - **resolved\_time** (number): The UNIX timestamp when this was resolved. If **status** is "local\_failed" or "failed": - - - **failcode** (u32, optional): the numeric onion code returned - - **failreason** (string, optional): the name of the onion code returned - -[comment]: # (GENERATE-FROM-SCHEMA-END) + - **failcode** (u32, optional): The numeric onion code returned. + - **failreason** (string, optional): The name of the onion code returned. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "forwards": [ + { + "created_index": 1, + "updated_index": 1, + "in_channel": "103x1x0", + "in_htlc_id": 0, + "out_channel": "104x1x0", + "out_htlc_id": 0, + "in_msat": 100001001, + "out_msat": 100000000, + "fee_msat": 1001, + "status": "settled", + "style": "tlv", + "received_time": 1706229285.5934534, + "resolved_time": 1706229288.830004 + }, + { + "created_index": 2, + "updated_index": 2, + "in_channel": "103x1x0", + "in_htlc_id": 1, + "out_channel": "105x1x0", + "out_htlc_id": 0, + "in_msat": 100001001, + "out_msat": 100000000, + "fee_msat": 1001, + "status": "failed", + "style": "tlv", + "received_time": 1706229290.0289993, + "resolved_time": 1706229292.9487684 + }, + { + "created_index": 3, + "updated_index": 3, + "in_channel": "103x1x0", + "in_htlc_id": 2, + "out_channel": "106x1x0", + "out_htlc_id": 0, + "in_msat": 100001000, + "out_msat": 99999999, + "fee_msat": 1001, + "status": "local_failed", + "failcode": 16392, + "failreason": "WIRE_PERMANENT_CHANNEL_FAILURE", + "style": "tlv", + "received_time": 1706229295.3175724 + } + ] +} +{ + "forwards": [] +} +``` AUTHOR ------ @@ -59,5 +145,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:59b3f52c26252730440bc305dabaf191edcacc9ba87021ce4b9065f37f873e5c) diff --git a/doc/lightning-listfunds.7.md b/doc/lightning-listfunds.7.md index 5a50c5137681..6ee0d1804ab7 100644 --- a/doc/lightning-listfunds.7.md +++ b/doc/lightning-listfunds.7.md @@ -1,60 +1,97 @@ lightning-listfunds -- Command showing all funds currently managed by the Core Lightning node -========================================================================================== +============================================================================================= SYNOPSIS -------- -**listfunds** [*spent*] +**listfunds** [*spent*] DESCRIPTION ----------- -The **listfunds** RPC command displays all funds available, either in -unspent outputs (UTXOs) in the internal wallet or funds locked in -currently open channels. +The **listfunds** RPC command displays all funds available, either in unspent outputs (UTXOs) in the internal wallet or funds locked in currently open channels. + +- **spent** (boolean, optional): If True, then the *outputs* will include spent outputs in addition to the unspent ones. The default is False. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:listfunds#1", + "method": "listfunds", + "params": { + "spent": null + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: - **outputs** (array of objects): - - **txid** (txid): the ID of the spendable transaction - - **output** (u32): the index within *txid* - - **amount\_msat** (msat): the amount of the output - - **scriptpubkey** (hex): the scriptPubkey of the output + - **txid** (txid): The ID of the spendable transaction. + - **output** (u32): The index within *txid*. + - **amount\_msat** (msat): The amount of the output. + - **scriptpubkey** (hex): The scriptPubkey of the output. - **status** (string) (one of "unconfirmed", "confirmed", "spent", "immature") - - **reserved** (boolean): whether this UTXO is currently reserved for an in-flight tx - - **address** (string, optional): the bitcoin address of the output - - **redeemscript** (hex, optional): the redeemscript, only if it's p2sh-wrapped + - **reserved** (boolean): Whether this UTXO is currently reserved for an in-flight tx. + - **address** (string, optional): The bitcoin address of the output. + - **redeemscript** (hex, optional): The redeemscript, only if it's p2sh-wrapped. If **status** is "confirmed": - - - **blockheight** (u32): Block height where it was confirmed + - **blockheight** (u32): Block height where it was confirmed. If **reserved** is "true": - - - **reserved\_to\_block** (u32): Block height where reservation will expire + - **reserved\_to\_block** (u32): Block height where reservation will expire. - **channels** (array of objects): - - **peer\_id** (pubkey): the peer with which the channel is opened - - **our\_amount\_msat** (msat): available satoshis on our node's end of the channel - - **amount\_msat** (msat): total channel value - - **funding\_txid** (txid): funding transaction id - - **funding\_output** (u32): the 0-based index of the output in the funding transaction - - **connected** (boolean): whether the channel peer is connected - - **state** (string): the channel state, in particular "CHANNELD\_NORMAL" means the channel can be used normally (one of "OPENINGD", "CHANNELD\_AWAITING\_LOCKIN", "CHANNELD\_NORMAL", "CHANNELD\_SHUTTING\_DOWN", "CLOSINGD\_SIGEXCHANGE", "CLOSINGD\_COMPLETE", "AWAITING\_UNILATERAL", "FUNDING\_SPEND\_SEEN", "ONCHAIN", "DUALOPEND\_OPEN\_INIT", "DUALOPEND\_AWAITING\_LOCKIN", "DUALOPEND\_OPEN\_COMMITTED", "DUALOPEND\_OPEN\_COMMIT\_READY") - - **channel\_id** (hash): The full channel\_id (funding txid Xored with output number) *(added v23.05)* + - **peer\_id** (pubkey): The peer with which the channel is opened. + - **our\_amount\_msat** (msat): Available satoshis on our node's end of the channel. + - **amount\_msat** (msat): Total channel value. + - **funding\_txid** (txid): Funding transaction id. + - **funding\_output** (u32): The 0-based index of the output in the funding transaction. + - **connected** (boolean): Whether the channel peer is connected. + - **state** (string) (one of "OPENINGD", "CHANNELD\_AWAITING\_LOCKIN", "CHANNELD\_NORMAL", "CHANNELD\_SHUTTING\_DOWN", "CLOSINGD\_SIGEXCHANGE", "CLOSINGD\_COMPLETE", "AWAITING\_UNILATERAL", "FUNDING\_SPEND\_SEEN", "ONCHAIN", "DUALOPEND\_OPEN\_INIT", "DUALOPEND\_AWAITING\_LOCKIN", "DUALOPEND\_OPEN\_COMMITTED", "DUALOPEND\_OPEN\_COMMIT\_READY"): The channel state, in particular `CHANNELD_NORMAL` means the channel can be used normally. + - **channel\_id** (hash): The full channel\_id (funding txid Xored with output number). *(added v23.05)* If **state** is "CHANNELD\_NORMAL": - - - **short\_channel\_id** (short\_channel\_id): short channel id of channel + - **short\_channel\_id** (short\_channel\_id): Short channel id of channel. If **state** is "CHANNELD\_SHUTTING\_DOWN", "CLOSINGD\_SIGEXCHANGE", "CLOSINGD\_COMPLETE", "AWAITING\_UNILATERAL", "FUNDING\_SPEND\_SEEN" or "ONCHAIN": - - - **short\_channel\_id** (short\_channel\_id, optional): short channel id of channel (only if funding reached lockin depth before closing) - -[comment]: # (GENERATE-FROM-SCHEMA-END) + - **short\_channel\_id** (short\_channel\_id, optional): Short channel id of channel (only if funding reached lockin depth before closing). + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "outputs": [ + { + "txid": "0f184b101569bf777af3449fa266948a9d55768f97867e48416a2c92858dd1bc", + "output": 1, + "amount_msat": 1111111000, + "scriptpubkey": "001401fad90abcd66697e2592164722de4a95ebee165", + "address": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf", + "status": "confirmed", + "blockheight": 102, + "reserved": false + }, + { + "txid": "4bee7dc3a28f2434e9bb3e9aaab418dd276485a8705b0f787bf741d3f979ec3b", + "output": 1, + "amount_msat": 1111111000, + "scriptpubkey": "001401fad90abcd66697e2592164722de4a95ebee165", + "address": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf", + "status": "confirmed", + "blockheight": 102, + "reserved": false + } + ], + "channels": [] +} +``` AUTHOR ------ @@ -70,5 +107,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:0b6c17b8595fb242b2be02fa6dac412534f355b0d41b96ff6a7cd9c389573ead) diff --git a/doc/lightning-listhtlcs.7.md b/doc/lightning-listhtlcs.7.md index 6d6513f63025..5ef3ccf03e4a 100644 --- a/doc/lightning-listhtlcs.7.md +++ b/doc/lightning-listhtlcs.7.md @@ -4,30 +4,169 @@ lightning-listhtlcs -- Command for querying HTLCs SYNOPSIS -------- -**listhtlcs** [*id*] +**listhtlcs** [*id*] DESCRIPTION ----------- -The **listhtlcs** RPC command gets all HTLCs (which, generally, we -remember for as long as a channel is open, even if they've completed -long ago). +The **listhtlcs** RPC command gets all HTLCs (which, generally, we remember for as long as a channel is open, even if they've completed long ago). + +- **id** (string, optional): A short channel id (e.g. 1x2x3) or full 64-byte hex channel id, it will only list htlcs for that channel (which must be known). + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:listhtlcs#1", + "method": "listhtlcs", + "params": "{}" +} +{ + "id": "example:listhtlcs#2", + "method": "listhtlcs", + "params": [ + "103x2x0" + ] +} +{ + "id": "example:listhtlcs#3", + "method": "listhtlcs", + "params": [ + "436c2658eb4f4689b42ff11b8b05f31ba09860d0df7168085e0796cdf40f85e0" + ] +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **htlcs** is returned. It is an array of objects, where each object contains: +On success, an object containing **htlcs** is returned. It is an array of objects, where each object contains: -- **short\_channel\_id** (short\_channel\_id): the channel that contains/contained the HTLC -- **id** (u64): the unique, incrementing HTLC id the creator gave this -- **expiry** (u32): the block number where this HTLC expires/expired -- **amount\_msat** (msat): the value of the HTLC -- **direction** (string): out if we offered this to the peer, in if they offered it (one of "out", "in") -- **payment\_hash** (hash): payment hash sought by HTLC -- **state** (string): The first 10 states are for `in`, the next 10 are for `out`. (one of "SENT\_ADD\_HTLC", "SENT\_ADD\_COMMIT", "RCVD\_ADD\_REVOCATION", "RCVD\_ADD\_ACK\_COMMIT", "SENT\_ADD\_ACK\_REVOCATION", "RCVD\_REMOVE\_HTLC", "RCVD\_REMOVE\_COMMIT", "SENT\_REMOVE\_REVOCATION", "SENT\_REMOVE\_ACK\_COMMIT", "RCVD\_REMOVE\_ACK\_REVOCATION", "RCVD\_ADD\_HTLC", "RCVD\_ADD\_COMMIT", "SENT\_ADD\_REVOCATION", "SENT\_ADD\_ACK\_COMMIT", "RCVD\_ADD\_ACK\_REVOCATION", "SENT\_REMOVE\_HTLC", "SENT\_REMOVE\_COMMIT", "RCVD\_REMOVE\_REVOCATION", "RCVD\_REMOVE\_ACK\_COMMIT", "SENT\_REMOVE\_ACK\_REVOCATION") +- **short\_channel\_id** (short\_channel\_id): The channel that contains/contained the HTLC. +- **id** (u64): The unique, incrementing HTLC id the creator gave this. +- **expiry** (u32): The block number where this HTLC expires/expired. +- **amount\_msat** (msat): The value of the HTLC. +- **direction** (string) (one of "out", "in"): Out if we offered this to the peer, in if they offered it. +- **payment\_hash** (hash): Payment hash sought by HTLC. +- **state** (string) (one of "SENT\_ADD\_HTLC", "SENT\_ADD\_COMMIT", "RCVD\_ADD\_REVOCATION", "RCVD\_ADD\_ACK\_COMMIT", "SENT\_ADD\_ACK\_REVOCATION", "RCVD\_REMOVE\_HTLC", "RCVD\_REMOVE\_COMMIT", "SENT\_REMOVE\_REVOCATION", "SENT\_REMOVE\_ACK\_COMMIT", "RCVD\_REMOVE\_ACK\_REVOCATION", "RCVD\_ADD\_HTLC", "RCVD\_ADD\_COMMIT", "SENT\_ADD\_REVOCATION", "SENT\_ADD\_ACK\_COMMIT", "RCVD\_ADD\_ACK\_REVOCATION", "SENT\_REMOVE\_HTLC", "SENT\_REMOVE\_COMMIT", "RCVD\_REMOVE\_REVOCATION", "RCVD\_REMOVE\_ACK\_COMMIT", "SENT\_REMOVE\_ACK\_REVOCATION"): The first 10 states are for `in`, the next 10 are for `out`. -[comment]: # (GENERATE-FROM-SCHEMA-END) +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "htlcs": [ + { + "short_channel_id": "103x1x0", + "id": 0, + "expiry": 117, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "d2668e77c5a2220496e813de36f1fc09ba804b16af4c6bb38299d8a6eb8a5f10", + "state": "RCVD_REMOVE_ACK_REVOCATION" + }, + { + "short_channel_id": "103x1x0", + "id": 1, + "expiry": 117, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "286e08ac8f575f10508d751fcfc93871b4344271967c7b9e5eacb3f3573b8307", + "state": "RCVD_REMOVE_ACK_REVOCATION" + }, + { + "short_channel_id": "103x1x0", + "id": 2, + "expiry": 135, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "3e4baa750ee3dfb934578f041ccb40b87432bf37ec65c9d7bce5ff28fecbd95f", + "state": "RCVD_REMOVE_ACK_REVOCATION" + }, + { + "short_channel_id": "103x1x0", + "id": 3, + "expiry": 135, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "4c3ce32565dc10ef2bd230c32802ce2fe8b007208c0a90757aa289f75c994d49", + "state": "SENT_REMOVE_REVOCATION" + } + ] +} +{ + "htlcs": [ + { + "short_channel_id": "103x2x0", + "id": 0, + "expiry": 117, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "12bb14b1d119e1ae0759e5ff6f1f6653e3fd8f71ea59411500d2871404a47a98", + "state": "RCVD_REMOVE_ACK_REVOCATION" + }, + { + "short_channel_id": "103x2x0", + "id": 1, + "expiry": 117, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "57d950209cc0b4fcc5e3027569232f96cf83ef85314c6b139a5713848d811a66", + "state": "RCVD_REMOVE_ACK_REVOCATION" + }, + { + "short_channel_id": "103x2x0", + "id": 2, + "expiry": 135, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "45ad4654715411a07a0ad6ec3f4bfaa918c90e3d1934b10b1c1c5846523ddd7f", + "state": "RCVD_REMOVE_ACK_REVOCATION" + }, + { + "short_channel_id": "103x2x0", + "id": 3, + "expiry": 135, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "cc0dcd214aa71c62bfba711a0746da821f2cdba1770b11c225920bdde12c931e", + "state": "RCVD_REMOVE_ACK_REVOCATION" + } + ] +} +{ + "htlcs": [ + { + "short_channel_id": "103x1x0", + "id": 0, + "expiry": 124, + "direction": "out", + "amount_msat": 1001, + "payment_hash": "2ab653668c8017ff2f36ac36678a8da04e11380bd9580a2926b170523b0c6e3b", + "state": "RCVD_REMOVE_ACK_REVOCATION" + }, + { + "short_channel_id": "103x1x0", + "id": 1, + "expiry": 124, + "direction": "out", + "amount_msat": 2001, + "payment_hash": "92f889cb2e48aa28e1e577228b907cdbcc371a2c018e9c8f60fa7036e232cf1d", + "state": "RCVD_REMOVE_ACK_REVOCATION" + }, + { + "short_channel_id": "103x1x0", + "id": 2, + "expiry": 128, + "direction": "out", + "amount_msat": 4001, + "payment_hash": "14ef01c9fb12d7dcac288f48ce87b19a7d5c3d5779aaed1e4adcb5c5d0e9fa45", + "state": "RCVD_REMOVE_ACK_REVOCATION" + } + ] +} +``` AUTHOR ------ @@ -43,5 +182,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:e787b9ea6bee54252239ba2f2b7220f5f3c79b2932c0b5a9ea255fbf1b14cf55) diff --git a/doc/lightning-listinvoicerequests.7.md b/doc/lightning-listinvoicerequests.7.md index 3aa138b4e66f..8ff6a1b9e68a 100644 --- a/doc/lightning-listinvoicerequests.7.md +++ b/doc/lightning-listinvoicerequests.7.md @@ -4,28 +4,59 @@ lightning-listinvoicerequests -- Command for querying invoice\_request status SYNOPSIS -------- -**listinvoicerequests** [*invreq\_id*] [*active\_only*] +**listinvoicerequests** [*invreq\_id*] [*active\_only*] DESCRIPTION ----------- -The **listinvoicerequests** RPC command gets the status of a specific `invoice_request`, -if it exists, or the status of all `invoice_requests` if given no argument. +Command *added* in v22.11. + +The **listinvoicerequests** RPC command gets the status of a specific `invoice_request`, if it exists, or the status of all `invoice_requests` if given no argument. + +- **invreq\_id** (string, optional): A specific invoice can be queried by providing the `invreq_id`, which is presented by lightning-invoicerequest(7), or can be calculated from a bolt12 invoice. +- **active\_only** (boolean, optional): If it is *True* then only active invoice requests are returned. The default is *False*. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:listinvoicerequests#1", + "method": "listinvoicerequests", + "params": [ + "cf0b41d4eb248d975909deb9accf9722b1c86839de80ee8815ce907bbb700a1d" + ] +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **invoicerequests** is returned. It is an array of objects, where each object contains: +On success, an object containing **invoicerequests** is returned. It is an array of objects, where each object contains: + +- **invreq\_id** (hash): The SHA256 hash of all invoice\_request fields less than 160. +- **active** (boolean): Whether the invoice\_request is currently active. +- **single\_use** (boolean): Whether the invoice\_request will become inactive after we pay an invoice for it. +- **bolt12** (string): The bolt12 string starting with lnr. +- **used** (boolean): Whether the invoice\_request has already been used. +- **label** (string, optional): The label provided when creating the invoice\_request. -- **invreq\_id** (hash): the SHA256 hash of all invoice\_request fields less than 160 -- **active** (boolean): whether the invoice\_request is currently active -- **single\_use** (boolean): whether the invoice\_request will become inactive after we pay an invoice for it -- **bolt12** (string): the bolt12 string starting with lnr -- **used** (boolean): whether the invoice\_request has already been used -- **label** (string, optional): the label provided when creating the invoice\_request +EXAMPLE JSON RESPONSE +--------------------- -[comment]: # (GENERATE-FROM-SCHEMA-END) +```json +{ + "invoicerequests": [ + { + "invreq_id": "cf0b41d4eb248d975909deb9accf9722b1c86839de80ee8815ce907bbb700a1d", + "active": true, + "single_use": true, + "bolt12": "lnr1qqgx9ag7nmtns87htndlgcfndlq0wzstwd5k6urvv5s8getnw3gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02gzqta0pqpvzzqnxu3vc68fug904w25y3zpskc8huazwmy34av93h2fjswe3tsp4rrcyps5sf5jwnn2tr3ghn32mdta8jvax62pwzhna8sktmaezl3f4s3zy35gx6dfay7r8zn299uwr7ugpze74zft4m8q3fnk2sr0ljqpve3jq", + "used": false + } + ] +} +``` AUTHOR ------ @@ -35,11 +66,9 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-invoicerequests(7), lightning-disableinvoicerequest(7). +lightning-invoicerequests(7), lightning-disableinvoicerequest(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:cdbdbd0dbe3776b3f6e79b88d3dc5ae3292af48234a4900e365c25663b8cdd67) diff --git a/doc/lightning-listinvoices.7.md b/doc/lightning-listinvoices.7.md index 0cd4891f9842..f1793b33c549 100644 --- a/doc/lightning-listinvoices.7.md +++ b/doc/lightning-listinvoices.7.md @@ -9,41 +9,87 @@ SYNOPSIS DESCRIPTION ----------- -The **listinvoices** RPC command gets the status of a specific invoice, -if it exists, or the status of all invoices if given no argument. - -Only one of the query parameters can be used from *label*, *invstring*, *payment_hash*, or *offer_id* +The **listinvoices** RPC command gets the status of a specific invoice, if it exists, or the status of all invoices if given no argument. + +Only one of the query parameters can be used from *label*, *invstring*, *payment\_hash*, or *offer\_id*. + +- **label** (one of, optional): A label used a the creation of the invoice to get a specific invoice.: + - (string) + - (integer) +- **invstring** (string, optional): The string value to query a specific invoice. +- **payment\_hash** (hex, optional): A payment\_hash of the invoice to get the details of a specific invoice. +- **offer\_id** (string, optional): A local `offer_id` the invoice was issued for a specific invoice details. +- **index** (string, optional) (one of "created", "updated"): If neither *in\_channel* nor *out\_channel* is specified, it controls ordering. The default is `created`. *(added v23.08)* +- **start** (u64, optional): If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7). *(added v23.08)* +- **limit** (u32, optional): If `index` is specified, `limit` can be used to specify the maximum number of entries to return. *(added v23.08)* + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:listinvoices#1", + "method": "listinvoices", + "params": { + "label": "xEoCR94SIz6UIRUEkxum", + "payment_hash": null, + "invstring": null, + "offer_id": null, + "index": null, + "start": null, + "limit": null + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **invoices** is returned. It is an array of objects, where each object contains: - -- **label** (string): unique label supplied at invoice creation -- **payment\_hash** (hash): the hash of the *payment\_preimage* which will prove payment -- **status** (string): Whether it's paid, unpaid or unpayable (one of "unpaid", "paid", "expired") -- **expires\_at** (u64): UNIX timestamp of when it will become / became unpayable -- **created\_index** (u64): 1-based index indicating order this invoice was created in *(added v23.08)* -- **description** (string, optional): description used in the invoice -- **amount\_msat** (msat, optional): the amount required to pay this invoice -- **bolt11** (string, optional): the BOLT11 string (always present unless *bolt12* is) -- **bolt12** (string, optional): the BOLT12 string (always present unless *bolt11* is) -- **local\_offer\_id** (hash, optional): the *id* of our offer which created this invoice (**experimental-offers** only). -- **invreq\_payer\_note** (string, optional): the optional *invreq\_payer\_note* from invoice\_request which created this invoice (**experimental-offers** only). -- **updated\_index** (u64, optional): 1-based index indicating order this invoice was changed (only present if it has changed since creation) *(added v23.08)* +On success, an object containing **invoices** is returned. It is an array of objects, where each object contains: + +- **label** (string): Unique label supplied at invoice creation. +- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. +- **status** (string) (one of "unpaid", "paid", "expired"): Whether it's paid, unpaid or unpayable. +- **expires\_at** (u64): UNIX timestamp of when it will become / became unpayable. +- **created\_index** (u64): 1-based index indicating order this invoice was created in. *(added v23.08)* +- **description** (string, optional): Description used in the invoice. +- **amount\_msat** (msat, optional): The amount required to pay this invoice. +- **bolt11** (string, optional): The BOLT11 string (always present unless *bolt12* is). +- **bolt12** (string, optional): The BOLT12 string (always present unless *bolt11* is). +- **local\_offer\_id** (hash, optional): The *id* of our offer which created this invoice (**experimental-offers** only). +- **invreq\_payer\_note** (string, optional): The optional *invreq\_payer\_note* from invoice\_request which created this invoice (**experimental-offers** only). +- **updated\_index** (u64, optional): 1-based index indicating order this invoice was changed (only present if it has changed since creation). *(added v23.08)* If **status** is "paid": - - - **pay\_index** (u64): Unique incrementing index for this payment - - **amount\_received\_msat** (msat): the amount actually received (could be slightly greater than *amount\_msat*, since clients may overpay) - - **paid\_at** (u64): UNIX timestamp of when it was paid - - **payment\_preimage** (secret): proof of payment - - **paid\_outpoint** (object, optional): Outpoint this invoice was paid with *(added v23.11)*: - - **txid** (txid): ID of the transaction that paid the invoice *(added v23.11)* - - **outnum** (u32): The 0-based output number of the transaction that paid the invoice *(added v23.11)* - -[comment]: # (GENERATE-FROM-SCHEMA-END) + - **pay\_index** (u64): Unique incrementing index for this payment. + - **amount\_received\_msat** (msat): The amount actually received (could be slightly greater than *amount\_msat*, since clients may overpay). + - **paid\_at** (u64): UNIX timestamp of when it was paid. + - **payment\_preimage** (secret): Proof of payment. + - **paid\_outpoint** (object, optional): Outpoint this invoice was paid with. *(added v23.11)*: + - **txid** (txid): ID of the transaction that paid the invoice. *(added v23.11)* + - **outnum** (u32): The 0-based output number of the transaction that paid the invoice. *(added v23.11)* + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "invoices": [ + { + "label": "xEoCR94SIz6UIRUEkxum", + "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk", + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "amount_msat": 11000000, + "status": "unpaid", + "description": [ + "XEoCR94SIz6UIRUEkxum." + ], + "expires_at": 1706757730, + "created_index": 1 + } + ] +} +``` AUTHOR ------ @@ -53,11 +99,9 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-waitinvoice(7), lightning-delinvoice(7), lightning-invoice(7). +lightning-waitinvoice(7), lightning-delinvoice(7), lightning-invoice(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:1fbb91a235a2bedeb30c72d9c4ab4e8c343077a9018f059c492e9358bc8d7cd6) diff --git a/doc/lightning-listnodes.7.md b/doc/lightning-listnodes.7.md index 19fa8719fc1a..bce9fbb0cf50 100644 --- a/doc/lightning-listnodes.7.md +++ b/doc/lightning-listnodes.7.md @@ -1,62 +1,125 @@ lightning-listnodes -- Command to get the list of nodes in the known network. -============================================================ +============================================================================= SYNOPSIS -------- -**listnodes** [*id*] +**listnodes** [*id*] DESCRIPTION ----------- The **listnodes** command returns nodes the node has learned about via gossip messages, or a single one if the node *id* was specified. +- **id** (pubkey, optional): The public key of the node to list. + EXAMPLE JSON REQUEST ------------- +-------------------- ```json { - "id": 82, + "id": "example:listnodes#1", "method": "listnodes", "params": { "id": "02e29856dab8ddd9044c18486e4cab79ec717b490447af2d4831e290e48d57638a" } } +{ + "id": "example:listnodes#2", + "method": "listnodes", + "params": { + "id": null + } +} ``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **nodes** is returned. It is an array of objects, where each object contains: +On success, an object containing **nodes** is returned. It is an array of objects, where each object contains: -- **nodeid** (pubkey): the public key of the node -- **last\_timestamp** (u32, optional): A node\_announcement has been received for this node (UNIX timestamp) +- **nodeid** (pubkey): The public key of the node. +- **last\_timestamp** (u32, optional): A node\_announcement has been received for this node (UNIX timestamp). If **last\_timestamp** is present: - - - **alias** (string): The fun alias this node advertized (up to 32 characters) - - **color** (hex): The favorite RGB color this node advertized (always 6 characters) - - **features** (hex): BOLT #9 features bitmap this node advertized - - **addresses** (array of objects): The addresses this node advertized: - - **type** (string): Type of connection (until 23.08, `websocket` was also allowed) (one of "dns", "ipv4", "ipv6", "torv2", "torv3") - - **port** (u16): port number + - **alias** (string) (up to 32 characters): The fun alias this node advertized. + - **color** (hex) (always 6 characters): The favorite RGB color this node advertized. + - **features** (hex): BOLT #9 features bitmap this node advertized. + - **addresses** (array of objects): The addresses this node advertized.: + - **type** (string) (one of "dns", "ipv4", "ipv6", "torv2", "torv3"): Type of connection (until 23.08, `websocket` was also allowed). + - **port** (u16): Port number. If **type** is "dns", "ipv4", "ipv6", "torv2" or "torv3": - - - **address** (string): address in expected format for **type** + - **address** (string): Address in expected format for **type**. If **option\_will\_fund** is present: - - **option\_will\_fund** (object): - - **lease\_fee\_base\_msat** (msat): the fixed fee for a lease (whole number of satoshis) - - **lease\_fee\_basis** (u32): the proportional fee in basis points (parts per 10,000) for a lease - - **funding\_weight** (u32): the onchain weight you'll have to pay for a lease - - **channel\_fee\_max\_base\_msat** (msat): the maximum base routing fee this node will charge during the lease - - **channel\_fee\_max\_proportional\_thousandths** (u32): the maximum proportional routing fee this node will charge during the lease (in thousandths, not millionths like channel\_update) - - **compact\_lease** (hex): the lease as represented in the node\_announcement + - **lease\_fee\_base\_msat** (msat): The fixed fee for a lease (whole number of satoshis). + - **lease\_fee\_basis** (u32): The proportional fee in basis points (parts per 10,000) for a lease. + - **funding\_weight** (u32): The onchain weight you'll have to pay for a lease. + - **channel\_fee\_max\_base\_msat** (msat): The maximum base routing fee this node will charge during the lease. + - **channel\_fee\_max\_proportional\_thousandths** (u32): The maximum proportional routing fee this node will charge during the lease (in thousandths, not millionths like channel\_update). + - **compact\_lease** (hex): The lease as represented in the node\_announcement. -[comment]: # (GENERATE-FROM-SCHEMA-END) +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "nodes": [ + { + "nodeid": "02e29856dab8ddd9044c14586e4cab79ec717b490447af2d4831e290e48d58638a", + "alias": "some_alias", + "color": "68f442", + "last_timestamp": 1597213741, + "features": "02a2a1", + "addresses": [ + { + "type": "ipv4", + "address": "zzz.yy.xx.xx", + "port": 9735 + } + ] + } + ] +} +{ + "nodes": [ + { + "nodeid": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "alias": "SILENTARTIST-v23.11-415-gd120eba", + "color": "022d22", + "last_timestamp": 1708624765, + "features": "88a0000a8a5961", + "addresses": [] + }, + { + "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "alias": "JUNIORBEAM-v23.11-415-gd120eba", + "color": "0266e4", + "last_timestamp": 1708624765, + "features": "88a0000a8a5961", + "addresses": [] + }, + { + "nodeid": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "alias": "HOPPINGFIRE-v23.11-415-gd120eba", + "color": "035d2b", + "last_timestamp": 1708624765, + "features": "88a0000a8a5961", + "addresses": [] + }, + { + "nodeid": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", + "alias": "JUNIORFELONY-v23.11-415-gd120eba", + "color": "0382ce", + "last_timestamp": 1708624766, + "features": "88a0000a8a5961", + "addresses": [] + } + ] +} +``` ERRORS ------ @@ -65,34 +128,11 @@ On failure, one of the following error codes may be returned: - -32602: Error in given parameters. -EXAMPLE JSON RESPONSE ------ - -```json -{ - "nodes": [ - { - "nodeid": "02e29856dab8ddd9044c14586e4cab79ec717b490447af2d4831e290e48d58638a", - "alias": "some_alias", - "color": "68f442", - "last_timestamp": 1597213741, - "features": "02a2a1", - "addresses": [ - { - "type": "ipv4", - "address": "zzz.yy.xx.xx", - "port": 9735 - } - ] - } - ] -} -``` - AUTHOR ------ -Vincenzo Palazzo <> wrote the initial version of this man page, but many others did the hard work of actually implementing this rpc command. +Vincenzo Palazzo <> wrote the initial version of this man page, +but many others did the hard work of actually implementing this rpc command. SEE ALSO -------- @@ -103,5 +143,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:54744d83c606d436d62335f02525804cbbfa9c488e45f8b776a4b4c99a251f08) diff --git a/doc/lightning-listoffers.7.md b/doc/lightning-listoffers.7.md index e8ca36a8d924..cc6f2504106c 100644 --- a/doc/lightning-listoffers.7.md +++ b/doc/lightning-listoffers.7.md @@ -1,49 +1,55 @@ lightning-listoffers -- Command for listing offers -======================================================= +================================================== SYNOPSIS -------- **(WARNING: experimental-offers only)** -**listoffers** [*offer\_id*] [*active\_only*] +**listoffers** [*offer\_id*] [*active\_only*] DESCRIPTION ----------- -The **listoffers** RPC command list all offers, or with `offer_id`, -only the offer with that offer\_id (if it exists). +The **listoffers** RPC command list all offers, or with `offer_id`, only the offer with that offer\_id (if it exists). + +- **offer\_id** (hash, optional): Offer\_id to get details for (if it exists). +- **active\_only** (boolean, optional): If set and is true, only offers with `active` true are returned. EXAMPLE JSON REQUEST ------------- +-------------------- ```json { - "id": 82, + "id": "example:listoffers#1", "method": "listoffers", "params": { - "active_only": false + "active_only": true } } +{ + "id": "example:listoffers#2", + "method": "listoffers", + "params": [ + "f61cca153d1948dade19349792d9bcdc9cef687fd27db0b553a67979f55aae48" + ] +} ``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **offers** is returned. It is an array of objects, where each object contains: - -- **offer\_id** (hash): the id of this offer (merkle hash of non-signature fields) -- **active** (boolean): whether this can still be used -- **single\_use** (boolean): whether this expires as soon as it's paid -- **bolt12** (string): the bolt12 encoding of the offer -- **used** (boolean): True if an associated invoice has been paid -- **label** (string, optional): the (optional) user-specified label +On success, an object containing **offers** is returned. It is an array of objects, where each object contains: -[comment]: # (GENERATE-FROM-SCHEMA-END) +- **offer\_id** (hash): The id of this offer (merkle hash of non-signature fields). +- **active** (boolean): Whether this can still be used. +- **single\_use** (boolean): Whether this expires as soon as it's paid. +- **bolt12** (string): The bolt12 encoding of the offer. +- **used** (boolean): True if an associated invoice has been paid. +- **label** (string, optional): The (optional) user-specified label. EXAMPLE JSON RESPONSE ------ +--------------------- ```json { @@ -64,10 +70,19 @@ EXAMPLE JSON RESPONSE } ] } - +{ + "offers": [ + { + "offer_id": "f61cca153d1948dade19349792d9bcdc9cef687fd27db0b553a67979f55aae48", + "active": true, + "single_use": false, + "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqyqs5rn5v4ehggrxdaezqvtdwdshg93pqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq63s", + "used": false + } + ] +} ``` - AUTHOR ------ @@ -76,11 +91,9 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-offer(7), lightning-listoffers(7). +lightning-offer(7), lightning-listoffers(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:7eb4649206d076a15913b2ce993a1ff6d1a47b54ebbbd1b295dc5c2af5f0e6d7) diff --git a/doc/lightning-listpays.7.md b/doc/lightning-listpays.7.md index 60411c39c672..d8ec7efd77d2 100644 --- a/doc/lightning-listpays.7.md +++ b/doc/lightning-listpays.7.md @@ -4,45 +4,100 @@ lightning-listpays -- Command for querying payment status SYNOPSIS -------- -**listpays** [*bolt11*] [*payment\_hash*] [*status*] +**listpays** [*bolt11*] [*payment\_hash*] [*status*] DESCRIPTION ----------- -The **listpay** RPC command gets the status of all *pay* commands, or a -single one if either *bolt11* or *payment\_hash* was specified. +The **listpay** RPC command gets the status of all *pay* commands, or a single one if either *bolt11* or *payment\_hash* was specified. + +- **bolt11** (string, optional): Bolt11 string to get the payment details. +- **payment\_hash** (hash, optional): Payment hash to get the payment details. +- **status** (string, optional) (one of "pending", "complete", "failed"): To filter the payment by status. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:listpays#1", + "method": "listpays", + "params": { + "bolt11": "lnbcrt123n1pjmxp7qsp5hxu7u28y0nx4v689u3hwzdzse2w9yaylhheavf9dxvwtdup7pvespp5ha66gxse68j4n6755v7299dnmq4w34gp0znxu0xzahdc43zrg40qdq5v3jhxcmjd9c8g6t0dc6sxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgqk74dvqlvr92ayy5s7x0r0u9xywez6wu4h8pfta386cw6x7cdrvn8pz87kyg5c930aent423gm9ylpaw5p35k72f02hg0s9dulg4d8fqpgj7gpm", + "payment_hash": null, + "status": null + } +} +{ + "id": "example:listpays#2", + "method": "listpays", + "params": { + "bolt11": "lnbcrt123n1pjmxp7qsp5u84368dz7yhzcqm955h96wdqch7uarasun45cr0vs5d8t0cv5avqpp5r9p0dp92guaatrmhf302m0dyj4n79gk93qu2l5tagfxq3dedgfqsdq5v3jhxcmjd9c8g6t0dc6qxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgq46wu0fznfx27rcnyzhcttf8yqx3lwqs482yxlead0fyt8mefrrrj5m379fa5qukgquf9tnwsuj3nnfmwkzkfg6pyhzq6w8gauuh6m5cqgur64n", + "payment_hash": null, + "status": null + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **pays** is returned. It is an array of objects, where each object contains: +On success, an object containing **pays** is returned. It is an array of objects, where each object contains: -- **payment\_hash** (hash): the hash of the *payment\_preimage* which will prove payment -- **status** (string): status of the payment (one of "pending", "failed", "complete") -- **created\_at** (u64): the UNIX timestamp showing when this payment was initiated -- **destination** (pubkey, optional): the final destination of the payment if known -- **completed\_at** (u64, optional): the UNIX timestamp showing when this payment was completed -- **label** (string, optional): the label, if given to sendpay -- **bolt11** (string, optional): the bolt11 string (if pay supplied one) -- **description** (string, optional): the description matching the bolt11 description hash (if pay supplied one) -- **bolt12** (string, optional): the bolt12 string (if supplied for pay: **experimental-offers** only). +- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. +- **status** (string) (one of "pending", "failed", "complete"): Status of the payment. +- **created\_at** (u64): The UNIX timestamp showing when this payment was initiated. +- **destination** (pubkey, optional): The final destination of the payment if known. +- **completed\_at** (u64, optional): The UNIX timestamp showing when this payment was completed. +- **label** (string, optional): The label, if given to sendpay. +- **bolt11** (string, optional): The bolt11 string (if pay supplied one). +- **description** (string, optional): The description matching the bolt11 description hash (if pay supplied one). +- **bolt12** (string, optional): The bolt12 string (if supplied for pay: **experimental-offers** only). If **status** is "complete": - - - **amount\_sent\_msat** (msat): The amount of millisatoshi we sent in order to pay (may include fees and not match amount\_msat) - - **preimage** (secret): proof of payment - - **amount\_msat** (msat, optional): The amount of millisatoshi we intended to send to the destination - - **number\_of\_parts** (u64, optional): the number of parts for a successful payment (only if more than one). + - **amount\_sent\_msat** (msat): The amount of millisatoshi we sent in order to pay (may include fees and not match amount\_msat). + - **preimage** (secret): Proof of payment. + - **amount\_msat** (msat, optional): The amount of millisatoshi we intended to send to the destination. + - **number\_of\_parts** (u64, optional): The number of parts for a successful payment (only if more than one). If **status** is "failed": - - - **erroronion** (hex, optional): the error onion returned on failure, if any. - -[comment]: # (GENERATE-FROM-SCHEMA-END) + - **erroronion** (hex, optional): The error onion returned on failure, if any. The returned array is ordered by increasing **created\_at** fields. +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "pays": [ + { + "bolt11": "lnbcrt123n1pjmxp7qsp5hxu7u28y0nx4v689u3hwzdzse2w9yaylhheavf9dxvwtdup7pvespp5ha66gxse68j4n6755v7299dnmq4w34gp0znxu0xzahdc43zrg40qdq5v3jhxcmjd9c8g6t0dc6sxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgqk74dvqlvr92ayy5s7x0r0u9xywez6wu4h8pfta386cw6x7cdrvn8pz87kyg5c930aent423gm9ylpaw5p35k72f02hg0s9dulg4d8fqpgj7gpm", + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "payment_hash": "bf75a41a19d1e559ebd4a33ca295b3d82ae8d50178a66e3cc2eddb8ac443455e", + "status": "failed", + "created_at": 1706231854, + "amount_sent_msat": 0 + } + ] +} +{ + "pays": [ + { + "bolt11": "lnbcrt123n1pjmxp7qsp5u84368dz7yhzcqm955h96wdqch7uarasun45cr0vs5d8t0cv5avqpp5r9p0dp92guaatrmhf302m0dyj4n79gk93qu2l5tagfxq3dedgfqsdq5v3jhxcmjd9c8g6t0dc6qxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgq46wu0fznfx27rcnyzhcttf8yqx3lwqs482yxlead0fyt8mefrrrj5m379fa5qukgquf9tnwsuj3nnfmwkzkfg6pyhzq6w8gauuh6m5cqgur64n", + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "payment_hash": "1942f684aa473bd58f774c5eadbda49567e2a2c58838afd17d424c08b72d4241", + "status": "complete", + "created_at": 1706231849, + "completed_at": 1706231854, + "preimage": "89ce412a2089cbcb72a73ce755337cf693859ea58f21ef0d1caf286a9b0f2a7c", + "amount_msat": 12300, + "amount_sent_msat": 12301 + } + ] +} +``` + AUTHOR ------ @@ -51,11 +106,9 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-pay(7), lightning-paystatus(7), lightning-listsendpays(7). +lightning-pay(7), lightning-paystatus(7), lightning-listsendpays(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:e0cf61a1f37bd8d335fd40bb56c015d0e007480dfff58948c2bb28be6388f51c) diff --git a/doc/lightning-listpeerchannels.7.md b/doc/lightning-listpeerchannels.7.md index 13d3e36b43c8..6a2c0014d1eb 100644 --- a/doc/lightning-listpeerchannels.7.md +++ b/doc/lightning-listpeerchannels.7.md @@ -1,205 +1,385 @@ lightning-listpeerchannels -- Command returning data on channels of connected lightning nodes -========================================================================== +============================================================================================= SYNOPSIS -------- -**listpeerchannels** \[*id*\] +**listpeerchannels** [*id*] DESCRIPTION ----------- +Command *added* in v23.02. + The **listpeerchannels** RPC command returns data on channels of the network, with the possibility to filter the channels by node id. -If no *id* is supplied, then channel data on all lightning nodes that are -connected, or not connected but have open channels with this node, are -returned. +If no *id* is supplied, then channel data on all lightning nodes that are connected, or not connected but have open channels with this node, are returned. + +- **id** (pubkey, optional): If supplied, limits the channels to just the peer with the given ID, if it exists. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:listpeerchannels#1", + "method": "listpeerchannels", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" + } +} +{ + "id": "example:listpeerchannels#2", + "method": "listpeerchannels", + "params": { + "id": null + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **channels** is returned. It is an array of objects, where each object contains: +On success, an object containing **channels** is returned. It is an array of objects, where each object contains: -- **peer\_id** (pubkey): Node Public key -- **peer\_connected** (boolean): A boolean flag that is set to true if the peer is online -- **state** (string): the channel state, in particular "CHANNELD\_NORMAL" means the channel can be used normally (one of "OPENINGD", "CHANNELD\_AWAITING\_LOCKIN", "CHANNELD\_NORMAL", "CHANNELD\_SHUTTING\_DOWN", "CLOSINGD\_SIGEXCHANGE", "CLOSINGD\_COMPLETE", "AWAITING\_UNILATERAL", "FUNDING\_SPEND\_SEEN", "ONCHAIN", "DUALOPEND\_OPEN\_INIT", "DUALOPEND\_AWAITING\_LOCKIN", "CHANNELD\_AWAITING\_SPLICE", "DUALOPEND\_OPEN\_COMMITTED", "DUALOPEND\_OPEN\_COMMIT\_READY") -- **opener** (string): Who initiated the channel (one of "local", "remote") +- **peer\_id** (pubkey): Node Public key. +- **peer\_connected** (boolean): A boolean flag that is set to true if the peer is online. +- **state** (string) (one of "OPENINGD", "CHANNELD\_AWAITING\_LOCKIN", "CHANNELD\_NORMAL", "CHANNELD\_SHUTTING\_DOWN", "CLOSINGD\_SIGEXCHANGE", "CLOSINGD\_COMPLETE", "AWAITING\_UNILATERAL", "FUNDING\_SPEND\_SEEN", "ONCHAIN", "DUALOPEND\_OPEN\_INIT", "DUALOPEND\_AWAITING\_LOCKIN", "CHANNELD\_AWAITING\_SPLICE", "DUALOPEND\_OPEN\_COMMITTED", "DUALOPEND\_OPEN\_COMMIT\_READY"): The channel state, in particular `CHANNELD_NORMAL` means the channel can be used normally. +- **opener** (string) (one of "local", "remote"): Who initiated the channel. - **features** (array of strings): - - BOLT #9 features which apply to this channel (one of "option\_static\_remotekey", "option\_anchor\_outputs", "option\_anchors\_zero\_fee\_htlc\_tx", "option\_scid\_alias", "option\_zeroconf") -- **scratch\_txid** (txid, optional): The txid we would use if we went onchain now -- **channel\_type** (object, optional): channel\_type as negotiated with peer *(added v23.05)*: - - **bits** (array of u32s): Each bit set in this channel\_type: - - Bit number - - **names** (array of strings): Feature name for each bit set in this channel\_type: - - Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even") -- **updates** (object, optional): Latest gossip updates sent/received *(added v24.02)*: - - **local** (object): Our gossip for channel *(added v24.02)*: - - **htlc\_minimum\_msat** (msat): Minimum msat amount we allow *(added v24.02)* - - **htlc\_maximum\_msat** (msat): Maximum msat amount we allow *(added v24.02)* - - **cltv\_expiry\_delta** (u32): Blocks delay required between incoming and outgoing HTLCs *(added v24.02)* - - **fee\_base\_msat** (msat): Amount we charge to use the channel *(added v24.02)* - - **fee\_proportional\_millionths** (u32): Amount we charge to use the channel in parts-per-million *(added v24.02)* - - **remote** (object, optional): Peer's gossip for channel *(added v24.02)*: - - **htlc\_minimum\_msat** (msat): Minimum msat amount they allow *(added v24.02)* - - **htlc\_maximum\_msat** (msat): Maximum msat amount they allow *(added v24.02)* - - **cltv\_expiry\_delta** (u32): Blocks delay required between incoming and outgoing HTLCs *(added v24.02)* - - **fee\_base\_msat** (msat): Amount they charge to use the channel *(added v24.02)* - - **fee\_proportional\_millionths** (u32): Amount they charge to use the channel in parts-per-million *(added v24.02)* -- **ignore\_fee\_limits** (boolean, optional): set if we allow this peer to set fees to anything they want *(added v23.08)* -- **lost\_state** (boolean, optional): set if we are fallen behind i.e. lost some channel state. *(added v24.02)* -- **feerate** (object, optional): Feerates for the current tx: - - **perkw** (u32): Feerate per 1000 weight (i.e kSipa) - - **perkb** (u32): Feerate per 1000 virtual bytes -- **owner** (string, optional): The current subdaemon controlling this connection -- **short\_channel\_id** (short\_channel\_id, optional): The short\_channel\_id (once locked in) -- **channel\_id** (hash, optional): The full channel\_id (funding txid Xored with output number) -- **funding\_txid** (txid, optional): ID of the funding transaction -- **funding\_outnum** (u32, optional): The 0-based output number of the funding transaction which opens the channel -- **initial\_feerate** (string, optional): For inflight opens, the first feerate used to initiate the channel open -- **last\_feerate** (string, optional): For inflight opens, the most recent feerate used on the channel open -- **next\_feerate** (string, optional): For inflight opens, the next feerate we'll use for the channel open -- **next\_fee\_step** (u32, optional): For inflight opens, the next feerate step we'll use for the channel open -- **inflight** (array of objects, optional): Current candidate funding transactions: - - **funding\_txid** (txid): ID of the funding transaction - - **funding\_outnum** (u32): The 0-based output number of the funding transaction which opens the channel - - **feerate** (string): The feerate for this funding transaction in per-1000-weight, with "kpw" appended - - **total\_funding\_msat** (msat): total amount in the channel - - **splice\_amount** (integer): The amouont of sats we're splicing in or out *(added v23.08)* - - **our\_funding\_msat** (msat): amount we have in the channel - - **scratch\_txid** (txid, optional): The commitment transaction txid we would use if we went onchain now -- **close\_to** (hex, optional): scriptPubkey which we have to close to if we mutual close -- **private** (boolean, optional): if True, we will not announce this channel -- **closer** (string, optional): Who initiated the channel close (only present if closing) (one of "local", "remote") + - (string, optional) (one of "option\_static\_remotekey", "option\_anchor\_outputs", "option\_anchors\_zero\_fee\_htlc\_tx", "option\_scid\_alias", "option\_zeroconf"): BOLT #9 features which apply to this channel. +- **reestablished** (boolean, optional): A boolean flag that is set to true if we have successfully exchanged reestablish messages with this connection. *(added v24.02)* +- **scratch\_txid** (txid, optional): The txid we would use if we went onchain now. +- **channel\_type** (object, optional): Channel\_type as negotiated with peer. *(added v23.05)*: + - **bits** (array of u32s): Each bit set in this channel\_type.: + - (u32, optional): Bit number. + - **names** (array of strings): Feature name for each bit set in this channel\_type.: + - (string, optional) (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even"): Name of feature bit. +- **updates** (object, optional): Latest gossip updates sent/received. *(added v24.02)*: + - **local** (object): Our gossip for channel. *(added v24.02)*: + - **htlc\_minimum\_msat** (msat): Minimum msat amount we allow. *(added v24.02)* + - **htlc\_maximum\_msat** (msat): Maximum msat amount we allow. *(added v24.02)* + - **cltv\_expiry\_delta** (u32): Blocks delay required between incoming and outgoing HTLCs. *(added v24.02)* + - **fee\_base\_msat** (msat): Amount we charge to use the channel. *(added v24.02)* + - **fee\_proportional\_millionths** (u32): Amount we charge to use the channel in parts-per-million. *(added v24.02)* + - **remote** (object, optional): Peer's gossip for channel. *(added v24.02)*: + - **htlc\_minimum\_msat** (msat): Minimum msat amount they allow. *(added v24.02)* + - **htlc\_maximum\_msat** (msat): Maximum msat amount they allow. *(added v24.02)* + - **cltv\_expiry\_delta** (u32): Blocks delay required between incoming and outgoing HTLCs. *(added v24.02)* + - **fee\_base\_msat** (msat): Amount they charge to use the channel. *(added v24.02)* + - **fee\_proportional\_millionths** (u32): Amount they charge to use the channel in parts-per-million. *(added v24.02)* +- **ignore\_fee\_limits** (boolean, optional): Set if we allow this peer to set fees to anything they want. *(added v23.08)* +- **lost\_state** (boolean, optional): Set if we are fallen behind i.e. lost some channel state. *(added v24.02)* +- **feerate** (object, optional): Feerates for the current tx.: + - **perkw** (u32): Feerate per 1000 weight (i.e kSipa). + - **perkb** (u32): Feerate per 1000 virtual bytes. +- **owner** (string, optional): The current subdaemon controlling this connection. +- **short\_channel\_id** (short\_channel\_id, optional): The short\_channel\_id (once locked in). +- **channel\_id** (hash, optional): The full channel\_id (funding txid Xored with output number). +- **funding\_txid** (txid, optional): ID of the funding transaction. +- **funding\_outnum** (u32, optional): The 0-based output number of the funding transaction which opens the channel. +- **initial\_feerate** (string, optional): For inflight opens, the first feerate used to initiate the channel open. +- **last\_feerate** (string, optional): For inflight opens, the most recent feerate used on the channel open. +- **next\_feerate** (string, optional): For inflight opens, the next feerate we'll use for the channel open. +- **next\_fee\_step** (u32, optional): For inflight opens, the next feerate step we'll use for the channel open. +- **inflight** (array of objects, optional): Current candidate funding transactions.: + - **funding\_txid** (txid): ID of the funding transaction. + - **funding\_outnum** (u32): The 0-based output number of the funding transaction which opens the channel. + - **feerate** (string): The feerate for this funding transaction in per-1000-weight, with `kpw` appended. + - **total\_funding\_msat** (msat): Total amount in the channel. + - **splice\_amount** (integer): The amouont of sats we're splicing in or out. *(added v23.08)* + - **our\_funding\_msat** (msat): Amount we have in the channel. + - **scratch\_txid** (txid, optional): The commitment transaction txid we would use if we went onchain now. +- **close\_to** (hex, optional): ScriptPubkey which we have to close to if we mutual close. +- **private** (boolean, optional): If True, we will not announce this channel. +- **closer** (string, optional) (one of "local", "remote"): Who initiated the channel close (only present if closing). - **funding** (object, optional): - - **local\_funds\_msat** (msat): Amount of channel we funded - - **remote\_funds\_msat** (msat): Amount of channel they funded - - **pushed\_msat** (msat, optional): Amount pushed from opener to peer - - **fee\_paid\_msat** (msat, optional): Amount we paid peer at open - - **fee\_rcvd\_msat** (msat, optional): Amount we were paid by peer at open -- **to\_us\_msat** (msat, optional): How much of channel is owed to us -- **min\_to\_us\_msat** (msat, optional): Least amount owed to us ever. If the peer were to successfully steal from us, this is the amount we would still retain. -- **max\_to\_us\_msat** (msat, optional): Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get. -- **total\_msat** (msat, optional): total amount in the channel -- **fee\_base\_msat** (msat, optional): amount we charge to use the channel -- **fee\_proportional\_millionths** (u32, optional): amount we charge to use the channel in parts-per-million -- **dust\_limit\_msat** (msat, optional): Minimum amount for an output on the channel transactions -- **max\_total\_htlc\_in\_msat** (msat, optional): Max amount accept in a single payment -- **their\_reserve\_msat** (msat, optional): Minimum we insist they keep in channel (default is 1% of the total channel capacity). If they have less than this in the channel, they cannot send to us on that channel + - **local\_funds\_msat** (msat): Amount of channel we funded. + - **remote\_funds\_msat** (msat): Amount of channel they funded. + - **pushed\_msat** (msat, optional): Amount pushed from opener to peer. + - **fee\_paid\_msat** (msat, optional): Amount we paid peer at open. + - **fee\_rcvd\_msat** (msat, optional): Amount we were paid by peer at open. +- **to\_us\_msat** (msat, optional): How much of channel is owed to us. +- **min\_to\_us\_msat** (msat, optional): Least amount owed to us ever. If the peer were to successfully steal from us, this is the amount we would still retain. +- **max\_to\_us\_msat** (msat, optional): Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get. +- **total\_msat** (msat, optional): Total amount in the channel. +- **fee\_base\_msat** (msat, optional): Amount we charge to use the channel. +- **fee\_proportional\_millionths** (u32, optional): Amount we charge to use the channel in parts-per-million. +- **dust\_limit\_msat** (msat, optional): Minimum amount for an output on the channel transactions. +- **max\_total\_htlc\_in\_msat** (msat, optional): Max amount accept in a single payment. +- **their\_reserve\_msat** (msat, optional): Minimum we insist they keep in channel. If they have less than this in the channel, they cannot send to us on that channel. The default is 1% of the total channel capacity. - **our\_reserve\_msat** (msat, optional): Minimum they insist we keep in channel. If you have less than this in the channel, you cannot send out via this channel. -- **spendable\_msat** (msat, optional): An estimate of the total we could send through channel (can be wrong because adding HTLCs requires an increase in fees paid to onchain miners, and onchain fees change dynamically according to onchain activity) -- **receivable\_msat** (msat, optional): An estimate of the total peer could send through channel -- **minimum\_htlc\_in\_msat** (msat, optional): The minimum amount HTLC we accept -- **minimum\_htlc\_out\_msat** (msat, optional): The minimum amount HTLC we will send -- **maximum\_htlc\_out\_msat** (msat, optional): The maximum amount HTLC we will send -- **their\_to\_self\_delay** (u32, optional): The number of blocks before they can take their funds if they unilateral close -- **our\_to\_self\_delay** (u32, optional): The number of blocks before we can take our funds if we unilateral close -- **max\_accepted\_htlcs** (u32, optional): Maximum number of incoming HTLC we will accept at once +- **spendable\_msat** (msat, optional): An estimate of the total we could send through channel (can be wrong because adding HTLCs requires an increase in fees paid to onchain miners, and onchain fees change dynamically according to onchain activity). +- **receivable\_msat** (msat, optional): An estimate of the total peer could send through channel. +- **minimum\_htlc\_in\_msat** (msat, optional): The minimum amount HTLC we accept. +- **minimum\_htlc\_out\_msat** (msat, optional): The minimum amount HTLC we will send. +- **maximum\_htlc\_out\_msat** (msat, optional): The maximum amount HTLC we will send. +- **their\_to\_self\_delay** (u32, optional): The number of blocks before they can take their funds if they unilateral close. +- **our\_to\_self\_delay** (u32, optional): The number of blocks before we can take our funds if we unilateral close. +- **max\_accepted\_htlcs** (u32, optional): Maximum number of incoming HTLC we will accept at once. - **alias** (object, optional): - - **local** (short\_channel\_id, optional): An alias assigned by this node to this channel, used for outgoing payments - - **remote** (short\_channel\_id, optional): An alias assigned by the remote node to this channel, usable in routehints and invoices -- **state\_changes** (array of objects, optional): Prior state changes: - - **timestamp** (string): UTC timestamp of form YYYY-mm-ddTHH:MM:SS.%03dZ - - **old\_state** (string): Previous state (one of "OPENINGD", "CHANNELD\_AWAITING\_LOCKIN", "CHANNELD\_NORMAL", "CHANNELD\_SHUTTING\_DOWN", "CLOSINGD\_SIGEXCHANGE", "CLOSINGD\_COMPLETE", "AWAITING\_UNILATERAL", "FUNDING\_SPEND\_SEEN", "ONCHAIN", "DUALOPEND\_OPEN\_INIT", "DUALOPEND\_AWAITING\_LOCKIN", "DUALOPEND\_OPEN\_COMMITTED", "DUALOPEND\_OPEN\_COMMIT\_READY", "CHANNELD\_AWAITING\_SPLICE") - - **new\_state** (string): New state (one of "OPENINGD", "CHANNELD\_AWAITING\_LOCKIN", "CHANNELD\_NORMAL", "CHANNELD\_SHUTTING\_DOWN", "CLOSINGD\_SIGEXCHANGE", "CLOSINGD\_COMPLETE", "AWAITING\_UNILATERAL", "FUNDING\_SPEND\_SEEN", "ONCHAIN", "DUALOPEND\_OPEN\_INIT", "DUALOPEND\_AWAITING\_LOCKIN", "DUALOPEND\_OPEN\_COMMITTED", "DUALOPEND\_OPEN\_COMMIT\_READY", "CHANNELD\_AWAITING\_SPLICE") - - **cause** (string): What caused the change (one of "unknown", "local", "user", "remote", "protocol", "onchain") - - **message** (string): Human-readable explanation + - **local** (short\_channel\_id, optional): An alias assigned by this node to this channel, used for outgoing payments. + - **remote** (short\_channel\_id, optional): An alias assigned by the remote node to this channel, usable in routehints and invoices. +- **state\_changes** (array of objects, optional): Prior state changes.: + - **timestamp** (string): UTC timestamp of form YYYY-mm-ddTHH:MM:SS.%03dZ. + - **old\_state** (string) (one of "OPENINGD", "CHANNELD\_AWAITING\_LOCKIN", "CHANNELD\_NORMAL", "CHANNELD\_SHUTTING\_DOWN", "CLOSINGD\_SIGEXCHANGE", "CLOSINGD\_COMPLETE", "AWAITING\_UNILATERAL", "FUNDING\_SPEND\_SEEN", "ONCHAIN", "DUALOPEND\_OPEN\_INIT", "DUALOPEND\_AWAITING\_LOCKIN", "DUALOPEND\_OPEN\_COMMITTED", "DUALOPEND\_OPEN\_COMMIT\_READY", "CHANNELD\_AWAITING\_SPLICE"): Previous state. + - **new\_state** (string) (one of "OPENINGD", "CHANNELD\_AWAITING\_LOCKIN", "CHANNELD\_NORMAL", "CHANNELD\_SHUTTING\_DOWN", "CLOSINGD\_SIGEXCHANGE", "CLOSINGD\_COMPLETE", "AWAITING\_UNILATERAL", "FUNDING\_SPEND\_SEEN", "ONCHAIN", "DUALOPEND\_OPEN\_INIT", "DUALOPEND\_AWAITING\_LOCKIN", "DUALOPEND\_OPEN\_COMMITTED", "DUALOPEND\_OPEN\_COMMIT\_READY", "CHANNELD\_AWAITING\_SPLICE"): New state. + - **cause** (string) (one of "unknown", "local", "user", "remote", "protocol", "onchain"): What caused the change. + - **message** (string): Human-readable explanation. - **status** (array of strings, optional): - - Billboard log of significant changes -- **in\_payments\_offered** (u64, optional): Number of incoming payment attempts -- **in\_offered\_msat** (msat, optional): Total amount of incoming payment attempts -- **in\_payments\_fulfilled** (u64, optional): Number of successful incoming payment attempts -- **in\_fulfilled\_msat** (msat, optional): Total amount of successful incoming payment attempts -- **out\_payments\_offered** (u64, optional): Number of outgoing payment attempts -- **out\_offered\_msat** (msat, optional): Total amount of outgoing payment attempts -- **out\_payments\_fulfilled** (u64, optional): Number of successful outgoing payment attempts -- **out\_fulfilled\_msat** (msat, optional): Total amount of successful outgoing payment attempts -- **last\_stable\_connection** (u64, optional): Last time we reestablished the open channel and stayed connected for 1 minute *(added v24.02)* -- **htlcs** (array of objects, optional): current HTLCs in this channel: - - **direction** (string): Whether it came from peer, or is going to peer (one of "in", "out") - - **id** (u64): Unique ID for this htlc on this channel in this direction - - **amount\_msat** (msat): Amount send/received for this HTLC - - **expiry** (u32): Block this HTLC expires at (after which an `in` direction HTLC will be returned to the peer, an `out` returned to us). If this expiry is too close, lightningd(8) will automatically unilaterally close the channel in order to enforce the timeout onchain. - - **payment\_hash** (hash): the hash of the payment\_preimage which will prove payment - - **local\_trimmed** (boolean, optional): If this is too small to enforce onchain; it doesn't appear in the commitment transaction and will not be enforced in a unilateral close. Generally true if the HTLC (after subtracting onchain fees) is below the `dust_limit_msat` for the channel. (always *true*) - - **status** (string, optional): set if this HTLC is currently waiting on a hook (and shows what plugin) + - (string, optional): Billboard log of significant changes. +- **in\_payments\_offered** (u64, optional): Number of incoming payment attempts. +- **in\_offered\_msat** (msat, optional): Total amount of incoming payment attempts. +- **in\_payments\_fulfilled** (u64, optional): Number of successful incoming payment attempts. +- **in\_fulfilled\_msat** (msat, optional): Total amount of successful incoming payment attempts. +- **out\_payments\_offered** (u64, optional): Number of outgoing payment attempts. +- **out\_offered\_msat** (msat, optional): Total amount of outgoing payment attempts. +- **out\_payments\_fulfilled** (u64, optional): Number of successful outgoing payment attempts. +- **out\_fulfilled\_msat** (msat, optional): Total amount of successful outgoing payment attempts. +- **last\_stable\_connection** (u64, optional): Last time we reestablished the open channel and stayed connected for 1 minute. *(added v24.02)* +- **htlcs** (array of objects, optional): Current HTLCs in this channel.: + - **direction** (string) (one of "in", "out"): Whether it came from peer, or is going to peer. *(added v23.02)* + - **id** (u64): Unique ID for this htlc on this channel in this direction. + - **amount\_msat** (msat): Amount send/received for this HTLC. + - **expiry** (u32): Block this HTLC expires at (after which an `in` direction HTLC will be returned to the peer, an `out` returned to us). If this expiry is too close, lightningd(8) will automatically unilaterally close the channel in order to enforce the timeout onchain. + - **payment\_hash** (hash): The hash of the payment\_preimage which will prove payment. + - **local\_trimmed** (boolean, optional) (always *true*): If this is too small to enforce onchain; it doesn't appear in the commitment transaction and will not be enforced in a unilateral close. Generally true if the HTLC (after subtracting onchain fees) is below the `dust_limit_msat` for the channel. + - **status** (string, optional): Set if this HTLC is currently waiting on a hook (and shows what plugin). If **direction** is "out": - - - **state** (string): Status of the HTLC (one of "SENT\_ADD\_HTLC", "SENT\_ADD\_COMMIT", "RCVD\_ADD\_REVOCATION", "RCVD\_ADD\_ACK\_COMMIT", "SENT\_ADD\_ACK\_REVOCATION", "RCVD\_REMOVE\_HTLC", "RCVD\_REMOVE\_COMMIT", "SENT\_REMOVE\_REVOCATION", "SENT\_REMOVE\_ACK\_COMMIT", "RCVD\_REMOVE\_ACK\_REVOCATION") + - **state** (string) (one of "SENT\_ADD\_HTLC", "SENT\_ADD\_COMMIT", "RCVD\_ADD\_REVOCATION", "RCVD\_ADD\_ACK\_COMMIT", "SENT\_ADD\_ACK\_REVOCATION", "RCVD\_REMOVE\_HTLC", "RCVD\_REMOVE\_COMMIT", "SENT\_REMOVE\_REVOCATION", "SENT\_REMOVE\_ACK\_COMMIT", "RCVD\_REMOVE\_ACK\_REVOCATION"): Status of the HTLC. If **direction** is "in": - - - **state** (string): Status of the HTLC (one of "RCVD\_ADD\_HTLC", "RCVD\_ADD\_COMMIT", "SENT\_ADD\_REVOCATION", "SENT\_ADD\_ACK\_COMMIT", "RCVD\_ADD\_ACK\_REVOCATION", "SENT\_REMOVE\_HTLC", "SENT\_REMOVE\_COMMIT", "RCVD\_REMOVE\_REVOCATION", "RCVD\_REMOVE\_ACK\_COMMIT", "SENT\_REMOVE\_ACK\_REVOCATION") + - **state** (string) (one of "RCVD\_ADD\_HTLC", "RCVD\_ADD\_COMMIT", "SENT\_ADD\_REVOCATION", "SENT\_ADD\_ACK\_COMMIT", "RCVD\_ADD\_ACK\_REVOCATION", "SENT\_REMOVE\_HTLC", "SENT\_REMOVE\_COMMIT", "RCVD\_REMOVE\_REVOCATION", "RCVD\_REMOVE\_ACK\_COMMIT", "SENT\_REMOVE\_ACK\_REVOCATION"): Status of the HTLC. If **peer\_connected** is *true*: - - - **reestablished** (boolean, optional): True if we have successfully exchanged reestablish messages this connection + - **reestablished** (boolean, optional): True if we have successfully exchanged reestablish messages this connection. If **close\_to** is present: - - - **close\_to\_addr** (string, optional): The bitcoin address we will close to (present if close\_to\_addr is a standardized address) + - **close\_to\_addr** (string, optional): The bitcoin address we will close to (present if close\_to\_addr is a standardized address). If **scratch\_txid** is present: - - - **last\_tx\_fee\_msat** (msat): fee attached to this the current tx + - **last\_tx\_fee\_msat** (msat): Fee attached to this the current tx. If **short\_channel\_id** is present: - - - **direction** (u32): 0 if we're the lesser node\_id, 1 if we're the greater (as used in BOLT #7 channel\_update) + - **direction** (u32): 0 if we're the lesser node\_id, 1 if we're the greater (as used in BOLT #7 channel\_update). *(added v23.02)* If **inflight** is present: - - - **initial\_feerate** (string): The feerate for the initial funding transaction in per-1000-weight, with "kpw" appended - - **last\_feerate** (string): The feerate for the latest funding transaction in per-1000-weight, with "kpw" appended - - **next\_feerate** (string): The minimum feerate for the next funding transaction in per-1000-weight, with "kpw" appended - -[comment]: # (GENERATE-FROM-SCHEMA-END) + - **initial\_feerate** (string): The feerate for the initial funding transaction in per-1000-weight, with `kpw` appended. + - **last\_feerate** (string): The feerate for the latest funding transaction in per-1000-weight, with `kpw` appended. + - **next\_feerate** (string): The minimum feerate for the next funding transaction in per-1000-weight, with `kpw` appended. The *state* field values (and *old\_state* / *new\_state*) are worth describing further: - * `"OPENINGD"`: The channel funding protocol with the peer is ongoing - and both sides are negotiating parameters. - * `"DUALOPEND_OPEN_INIT"`: Like `OPENINGD`, but for v2 connections which - are using collaborative opens. - * `"DUALOPEND_OPEN_COMMIT_READY"`: Like `OPENINGD`, but for v2 connections which - are using collaborative opens. You're ready to send your commitment signed - to your peer. - * `"DUALOPEND_OPEN_COMMITTED"`: Like `OPENINGD`, but for v2 connections which - are using collaborative opens. You've gotten an initial signed commitment - from your peer. - * `"CHANNELD_AWAITING_LOCKIN"` / `"DUALOPEND\_AWAITING\_LOCKIN"`: The peer and you have agreed on channel - parameters and are just waiting for the channel funding transaction to - be confirmed deeply (original and collaborative open protocols, respectively). - Both you and the peer must acknowledge the channel funding transaction - to be confirmed deeply before entering the next state. - Also, you can increase the onchain fee for channels in `DUALOPEND\_AWAITING\_LOCKIN` - using lightning-openchannel\_bump(7). - * `"CHANNELD_NORMAL"`: The channel can be used for normal payments. - * `"CHANNELD_SHUTTING_DOWN"`: A mutual close was requested (by you or - peer) and both of you are waiting for HTLCs in-flight to be either - failed or succeeded. - The channel can no longer be used for normal payments and forwarding. - Mutual close will proceed only once all HTLCs in the channel have - either been fulfilled or failed. - * `"CLOSINGD_SIGEXCHANGE"`: You and the peer are negotiating the mutual - close onchain fee. - * `"CLOSINGD_COMPLETE"`: You and the peer have agreed on the mutual close - onchain fee and are awaiting the mutual close getting confirmed deeply. - * `"AWAITING_UNILATERAL"`: You initiated a unilateral close, and are now - waiting for the peer-selected unilateral close timeout to complete. - * `"FUNDING_SPEND_SEEN"`: You saw the funding transaction getting - spent (usually the peer initiated a unilateral close) and will now - determine what exactly happened (i.e. if it was a theft attempt). - * `"ONCHAIN"`: You saw the funding transaction getting spent and now - know what happened (i.e. if it was a proper unilateral close by the - peer, or a theft attempt). + * `OPENINGD`: The channel funding protocol with the peer is ongoing and both sides are negotiating parameters. + * `DUALOPEND_OPEN_INIT`: Like `OPENINGD`, but for v2 connections which are using collaborative opens. + * `DUALOPEND_OPEN_COMMIT_READY`: Like `OPENINGD`, but for v2 connections which are using collaborative opens. You're ready to send your commitment signed to your peer. + * `DUALOPEND_OPEN_COMMITTED`: Like `OPENINGD`, but for v2 connections which are using collaborative opens. You've gotten an initial signed commitment from your peer. + * `CHANNELD_AWAITING_LOCKIN` / `DUALOPEND_AWAITING_LOCKIN`: The peer and you have agreed on channel parameters and are just waiting for the channel funding transaction to be confirmed deeply (original and collaborative open protocols, respectively). Both you and the peer must acknowledge the channel funding transaction to be confirmed deeply before entering the next state. Also, you can increase the onchain fee for channels in `DUALOPEND_AWAITING_LOCKIN` using lightning-openchannel\_bump(7). + * `CHANNELD_NORMAL`: The channel can be used for normal payments. + * `CHANNELD_SHUTTING_DOWN`: A mutual close was requested (by you or peer) and both of you are waiting for HTLCs in-flight to be either failed or succeeded. The channel can no longer be used for normal payments and forwarding. Mutual close will proceed only once all HTLCs in the channel have either been fulfilled or failed. + * `CLOSINGD_SIGEXCHANGE`: You and the peer are negotiating the mutual close onchain fee. + * `CLOSINGD_COMPLETE`: You and the peer have agreed on the mutual close onchain fee and are awaiting the mutual close getting confirmed deeply. + * `AWAITING_UNILATERAL`: You initiated a unilateral close, and are now waiting for the peer-selected unilateral close timeout to complete. + * `FUNDING_SPEND_SEEN`: You saw the funding transaction getting spent (usually the peer initiated a unilateral close) and will now determine what exactly happened (i.e. if it was a theft attempt). + * `ONCHAIN`: You saw the funding transaction getting spent and now know what happened (i.e. if it was a proper unilateral close by the peer, or a theft attempt). + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "channels": [ + { + "peer_id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "peer_connected": true, + "channel_type": { + "bits": [ + 12 + ], + "names": [ + "static_remotekey/even" + ] + }, + "updates": { + "local": { + "htlc_minimum_msat": 0, + "htlc_maximum_msat": 990000000, + "cltv_expiry_delta": 6, + "fee_base_msat": 1, + "fee_proportional_millionths": 10 + } + }, + "state": "CHANNELD_AWAITING_LOCKIN", + "scratch_txid": "4e9c2866b9ae1f765b89ea7ec37428c900ea97f717f85f00e3db852cb6aea3a8", + "last_tx_fee_msat": 5430000, + "feerate": { + "perkw": 7500, + "perkb": 30000 + }, + "owner": "channeld", + "direction": 1, + "channel_id": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "funding_txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b", + "funding_outnum": 0, + "close_to_addr": "bcrt1pamt5tqzd49uyessr7437l2vllf20muqmzdauje8x8scjgpc0l0nqhyqcyp", + "close_to": "5120eed745804da9784cc203f563efa99ffa54fdf01b137bc964e63c3124070ffbe6", + "private": false, + "opener": "local", + "alias": { + "local": "5589251x14022525x17398" + }, + "features": [ + "option_static_remotekey" + ], + "funding": { + "local_funds_msat": 1000000000, + "remote_funds_msat": 0, + "pushed_msat": 0 + }, + "to_us_msat": 1000000000, + "min_to_us_msat": 1000000000, + "max_to_us_msat": 1000000000, + "total_msat": 1000000000, + "fee_base_msat": 1, + "fee_proportional_millionths": 10, + "dust_limit_msat": 546000, + "max_total_htlc_in_msat": 18446744073709552000, + "their_reserve_msat": 10000000, + "our_reserve_msat": 10000000, + "spendable_msat": 973980000, + "receivable_msat": 0, + "minimum_htlc_in_msat": 0, + "minimum_htlc_out_msat": 0, + "maximum_htlc_out_msat": 990000000, + "their_to_self_delay": 5, + "our_to_self_delay": 5, + "max_accepted_htlcs": 483, + "state_changes": [], + "status": [], + "in_payments_offered": 0, + "in_offered_msat": 0, + "in_payments_fulfilled": 0, + "in_fulfilled_msat": 0, + "out_payments_offered": 0, + "out_offered_msat": 0, + "out_payments_fulfilled": 0, + "out_fulfilled_msat": 0, + "htlcs": [] + } + ] +} +{ + "channels": [ + { + "peer_id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "peer_connected": true, + "reestablished": true, + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "updates": { + "local": { + "htlc_minimum_msat": 0, + "htlc_maximum_msat": 990000000, + "cltv_expiry_delta": 6, + "fee_base_msat": 1, + "fee_proportional_millionths": 10 + }, + "remote": { + "htlc_minimum_msat": 0, + "htlc_maximum_msat": 990000000, + "cltv_expiry_delta": 6, + "fee_base_msat": 1, + "fee_proportional_millionths": 10 + } + }, + "state": "CHANNELD_NORMAL", + "scratch_txid": "ece66657d6203a4ea77807f566fd5b98a78b659f0cd59ce9200aa3bd6875ee25", + "last_tx_fee_msat": 4545000, + "lost_state": false, + "feerate": { + "perkw": 3750, + "perkb": 15000 + }, + "owner": "channeld", + "short_channel_id": "103x1x0", + "direction": 1, + "channel_id": "def5ef03e0d36ed65de814c0a8d6599a502fe1afb8e956529320bb350e876b5f", + "funding_txid": "5f6b870e35bb20935256e9b8afe12f509a59d6a8c014e85dd66ed3e003eff5de", + "funding_outnum": 0, + "close_to_addr": "bcrt1pamt5tqzd49uyessr7437l2vllf20muqmzdauje8x8scjgpc0l0nqhyqcyp", + "close_to": "5120eed745804da9784cc203f563efa99ffa54fdf01b137bc964e63c3124070ffbe6", + "private": false, + "opener": "local", + "alias": { + "local": "15447035x5589520x8959", + "remote": "6036590x13481428x5501" + }, + "features": [ + "option_static_remotekey", + "option_anchors_zero_fee_htlc_tx" + ], + "funding": { + "local_funds_msat": 1000000000, + "remote_funds_msat": 0, + "pushed_msat": 0 + }, + "to_us_msat": 1000000000, + "min_to_us_msat": 1000000000, + "max_to_us_msat": 1000000000, + "total_msat": 1000000000, + "fee_base_msat": 1, + "fee_proportional_millionths": 10, + "dust_limit_msat": 546000, + "max_total_htlc_in_msat": 18446744073709552000, + "their_reserve_msat": 10000000, + "our_reserve_msat": 10000000, + "spendable_msat": 978330000, + "receivable_msat": 0, + "minimum_htlc_in_msat": 0, + "minimum_htlc_out_msat": 0, + "maximum_htlc_out_msat": 990000000, + "their_to_self_delay": 5, + "our_to_self_delay": 5, + "max_accepted_htlcs": 483, + "state_changes": [ + { + "timestamp": "2024-02-22T17:48:57.127Z", + "old_state": "CHANNELD_AWAITING_LOCKIN", + "new_state": "CHANNELD_NORMAL", + "cause": "user", + "message": "Lockin complete" + } + ], + "status": [ + "CHANNELD_NORMAL:Channel ready for use." + ], + "in_payments_offered": 0, + "in_offered_msat": 0, + "in_payments_fulfilled": 0, + "in_fulfilled_msat": 0, + "out_payments_offered": 0, + "out_offered_msat": 0, + "out_payments_fulfilled": 0, + "out_fulfilled_msat": 0, + "htlcs": [] + } + ] +} +``` ERRORS ------ -On error the returned object will contain `code` and `message` properties, -with `code` being one of the following: +On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -32602: If the given parameters are wrong. @@ -216,8 +396,6 @@ lightning-connect(7), lightning-fundchannel\_start(7) RESOURCES --------- -Main web site: Lightning -RFC site (BOLT \#9): +Main web site: +Lightning RFC site (BOLT #9): - -[comment]: # ( SHA256STAMP:02dbb15d46497d33808d1bc021cb604529546b94f46d8de285d7b47f4615a516) diff --git a/doc/lightning-listpeers.7.md b/doc/lightning-listpeers.7.md index 2c1d0b4e7dcd..a115abdfa0d9 100644 --- a/doc/lightning-listpeers.7.md +++ b/doc/lightning-listpeers.7.md @@ -4,377 +4,225 @@ lightning-listpeers -- Command returning data on connected lightning nodes SYNOPSIS -------- -**listpeers** [*id*] [*level*] +**listpeers** [*id*] [*level*] DESCRIPTION ----------- -The **listpeers** RPC command returns data on nodes that are connected -or are not connected but have open channels with this node. +The **listpeers** RPC command returns data on nodes that are connected or are not connected but have open channels with this node. -Once a connection to another lightning node has been established, using -the **connect** command, data on the node can be returned using -**listpeers** and the *id* that was used with the **connect** command. +Once a connection to another lightning node has been established, using the **connect** command, data on the node can be returned using **listpeers** and the *id* that was used with the **connect** command. -If no *id* is supplied, then data on all lightning nodes that are -connected, or not connected but have open channels with this node, are -returned. +If no *id* is supplied, then data on all lightning nodes that are connected, or not connected but have open channels with this node, are returned. -If a channel is open with a node and the connection has been lost, then -the node will still appear in the output of the command and the value of -the *connected* attribute of the node will be "false". +If a channel is open with a node and the connection has been lost, then the node will still appear in the output of the command and the value of the *connected* attribute of the node will be "false". -The channel will remain open for a set blocktime, after which if the -connection has not been re-established, the channel will close and the -node will no longer appear in the command output. +The channel will remain open for a set blocktime, after which if the connection has not been re-established, the channel will close and the node will no longer appear in the command output. + +- **id** (pubkey, optional): If supplied, limits the result to just the peer with the given ID, if it exists. +- **level** (string, optional) (one of "io", "debug", "info", "unusual"): Supplying level will show log entries related to that peer at the given log level. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:listpeers#1", + "method": "listpeers", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "level": null + } +} +{ + "id": "example:listpeers#2", + "method": "listpeers", + "params": { + "id": null, + "level": null + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **peers** is returned. It is an array of objects, where each object contains: +On success, an object containing **peers** is returned. It is an array of objects, where each object contains: -- **id** (pubkey): the public key of the peer -- **connected** (boolean): True if the peer is currently connected -- **num\_channels** (u32): The number of channels the peer has with this node *(added v23.02)* -- **log** (array of objects, optional): if *level* is specified, logs for this peer: +- **id** (pubkey): The unique id of the peer. +- **connected** (boolean): Value showing the connection status. +- **num\_channels** (u32): The number of channels the peer has with this node. *(added v23.02)* +- **log** (array of objects, optional): If *level* is specified, logs for this peer.: - **type** (string) (one of "SKIPPED", "BROKEN", "UNUSUAL", "INFO", "DEBUG", "IO\_IN", "IO\_OUT") If **type** is "SKIPPED": - - - **num\_skipped** (u32): number of deleted/omitted entries + - **num\_skipped** (u32): Number of deleted/omitted entries. If **type** is "BROKEN", "UNUSUAL", "INFO" or "DEBUG": - - - **time** (string): UNIX timestamp with 9 decimal places - - **source** (string): The particular logbook this was found in - - **log** (string): The actual log message - - **node\_id** (pubkey): The peer this is associated with + - **time** (string): UNIX timestamp with 9 decimal places. + - **source** (string): The particular logbook this was found in. + - **log** (string): The actual log message. + - **node\_id** (pubkey): The peer this is associated with. If **type** is "IO\_IN" or "IO\_OUT": - - - **time** (string): UNIX timestamp with 9 decimal places - - **source** (string): The particular logbook this was found in - - **log** (string): The actual log message - - **node\_id** (pubkey): The peer this is associated with - - **data** (hex): The IO which occurred -- **channels** (array of objects, optional) **deprecated in v23.02, removed after v24.02**: - - **state** (string): the channel state, in particular "CHANNELD\_NORMAL" means the channel can be used normally (one of "OPENINGD", "CHANNELD\_AWAITING\_LOCKIN", "CHANNELD\_NORMAL", "CHANNELD\_SHUTTING\_DOWN", "CLOSINGD\_SIGEXCHANGE", "CLOSINGD\_COMPLETE", "AWAITING\_UNILATERAL", "FUNDING\_SPEND\_SEEN", "ONCHAIN", "DUALOPEND\_OPEN\_INIT", "DUALOPEND\_AWAITING\_LOCKIN", "DUALOPEND\_OPEN\_COMMITTED", "DUALOPEND\_OPEN\_COMMIT\_READY") - - **opener** (string): Who initiated the channel (one of "local", "remote") + - **time** (string): UNIX timestamp with 9 decimal places. + - **source** (string): The particular logbook this was found in. + - **log** (string): The actual log message. + - **node\_id** (pubkey): The peer this is associated with. + - **data** (hex): The IO which occurred. +- **channels** (array of objects, optional): Channels with this peer. **deprecated in v23.02, removed after v24.02**: + - **state** (string) (one of "OPENINGD", "CHANNELD\_AWAITING\_LOCKIN", "CHANNELD\_NORMAL", "CHANNELD\_SHUTTING\_DOWN", "CLOSINGD\_SIGEXCHANGE", "CLOSINGD\_COMPLETE", "AWAITING\_UNILATERAL", "FUNDING\_SPEND\_SEEN", "ONCHAIN", "DUALOPEND\_OPEN\_INIT", "DUALOPEND\_AWAITING\_LOCKIN", "DUALOPEND\_OPEN\_COMMITTED", "DUALOPEND\_OPEN\_COMMIT\_READY"): Current state of the channel: + * `OPENINGD`: The channel funding protocol with the peer is ongoing and both sides are negotiating parameters. + * `CHANNELD_AWAITING_LOCKIN`: The peer and you have agreed on channel parameters and are just waiting for the channel funding transaction to be confirmed deeply. Both you and the peer must acknowledge the channel funding transaction to be confirmed deeply before entering the next state. + * `CHANNELD_NORMAL`: The channel can be used for normal payments. + * `CHANNELD_SHUTTING_DOWN`: A mutual close was requested (by you or peer) and both of you are waiting for HTLCs in-flight to be either failed or succeeded. The channel can no longer be used for normal payments and forwarding. Mutual close will proceed only once all HTLCs in the channel have either been fulfilled or failed. + * `CLOSINGD_SIGEXCHANGE`: You and the peer are negotiating the mutual close onchain fee. + * `CLOSINGD_COMPLETE`: You and the peer have agreed on the mutual close onchain fee and are awaiting the mutual close getting confirmed deeply. + * `AWAITING_UNILATERAL`: You initiated a unilateral close, and are now waiting for the peer-selected unilateral close timeout to complete. + * `FUNDING_SPEND_SEEN`: You saw the funding transaction getting spent (usually the peer initiated a unilateral close) and will now determine what exactly happened (i.e. if it was a theft attempt). + * `ONCHAIN`: You saw the funding transaction getting spent and now know what happened (i.e. if it was a proper unilateral close by the peer, or a theft attempt). + * `CLOSED`: The channel closure has been confirmed deeply. The channel will eventually be removed from this array. + - **opener** (string) (one of "local", "remote"): Who initiated the channel. - **features** (array of strings): - - BOLT #9 features which apply to this channel (one of "option\_static\_remotekey", "option\_anchor\_outputs", "option\_scid\_alias", "option\_zeroconf") - - **scratch\_txid** (txid, optional): The txid we would use if we went onchain now - - **feerate** (object, optional): Feerates for the current tx: - - **perkw** (u32): Feerate per 1000 weight (i.e kSipa) - - **perkb** (u32): Feerate per 1000 virtual bytes - - **owner** (string, optional): The current subdaemon controlling this connection - - **short\_channel\_id** (short\_channel\_id, optional): The short\_channel\_id (once locked in) - - **channel\_id** (hash, optional): The full channel\_id (always 64 characters) - - **funding\_txid** (txid, optional): ID of the funding transaction - - **funding\_outnum** (u32, optional): The 0-based output number of the funding transaction which opens the channel - - **initial\_feerate** (string, optional): For inflight opens, the first feerate used to initiate the channel open - - **last\_feerate** (string, optional): For inflight opens, the most recent feerate used on the channel open - - **next\_feerate** (string, optional): For inflight opens, the next feerate we'll use for the channel open - - **next\_fee\_step** (u32, optional): For inflight opens, the next feerate step we'll use for the channel open - - **inflight** (array of objects, optional): Current candidate funding transactions (only for dual-funding): - - **funding\_txid** (txid): ID of the funding transaction - - **funding\_outnum** (u32): The 0-based output number of the funding transaction which opens the channel - - **feerate** (string): The feerate for this funding transaction in per-1000-weight, with "kpw" appended - - **total\_funding\_msat** (msat): total amount in the channel - - **our\_funding\_msat** (msat): amount we have in the channel - - **splice\_amount** (integer): The amouont of sats we're splicing in or out *(added v23.08)* - - **scratch\_txid** (txid): The commitment transaction txid we would use if we went onchain now - - **close\_to** (hex, optional): scriptPubkey which we have to close to if we mutual close - - **private** (boolean, optional): if True, we will not announce this channel - - **closer** (string, optional): Who initiated the channel close (one of "local", "remote") + - (string, optional) (one of "option\_static\_remotekey", "option\_anchor\_outputs", "option\_scid\_alias", "option\_zeroconf"): BOLT #9 features which apply to this channel. + - **scratch\_txid** (txid, optional): The txid we would use if we went onchain now. + - **feerate** (object, optional): Feerates for the current tx.: + - **perkw** (u32): Feerate per 1000 weight (i.e kSipa). + - **perkb** (u32): Feerate per 1000 virtual bytes. + - **owner** (string, optional): The current subdaemon controlling this connection. + - **short\_channel\_id** (short\_channel\_id, optional): The short\_channel\_id (once locked in). + - **channel\_id** (hash, optional): The full channel\_id (funding txid Xored with output number). + - **funding\_txid** (txid, optional): ID of the funding transaction. + - **funding\_outnum** (u32, optional): The 0-based output number of the funding transaction which opens the channel. + - **initial\_feerate** (string, optional): For inflight opens, the first feerate used to initiate the channel open. + - **last\_feerate** (string, optional): For inflight opens, the most recent feerate used on the channel open. + - **next\_feerate** (string, optional): For inflight opens, the next feerate we'll use for the channel open. + - **next\_fee\_step** (u32, optional): For inflight opens, the next feerate step we'll use for the channel open. + - **inflight** (array of objects, optional): Current candidate funding transactions.: + - **funding\_txid** (txid): ID of the funding transaction. + - **funding\_outnum** (u32): The 0-based output number of the funding transaction which opens the channel. + - **feerate** (string): The feerate for this funding transaction in per-1000-weight, with `kpw` appended. + - **total\_funding\_msat** (msat): Total amount in the channel. + - **our\_funding\_msat** (msat): Amount we have in the channel. + - **splice\_amount** (integer): The amouont of sats we're splicing in or out. *(added v23.08)* + - **scratch\_txid** (txid): The commitment transaction txid we would use if we went onchain now. + - **close\_to** (hex, optional): ScriptPubkey which we have to close to if we mutual close. + - **private** (boolean, optional): If True, we will not announce this channel. + - **closer** (string, optional) (one of "local", "remote"): Who initiated the channel close (only present if closing). - **funding** (object, optional): - - **local\_funds\_msat** (msat): Amount of channel we funded - - **remote\_funds\_msat** (msat): Amount of channel they funded - - **pushed\_msat** (msat, optional): Amount pushed from opener to peer - - **fee\_paid\_msat** (msat, optional): Amount we paid peer at open - - **fee\_rcvd\_msat** (msat, optional): Amount we were paid by peer at open - - **to\_us\_msat** (msat, optional): how much of channel is owed to us - - **min\_to\_us\_msat** (msat, optional): least amount owed to us ever - - **max\_to\_us\_msat** (msat, optional): most amount owed to us ever - - **total\_msat** (msat, optional): total amount in the channel - - **fee\_base\_msat** (msat, optional): amount we charge to use the channel - - **fee\_proportional\_millionths** (u32, optional): amount we charge to use the channel in parts-per-million - - **dust\_limit\_msat** (msat, optional): minimum amount for an output on the channel transactions - - **max\_total\_htlc\_in\_msat** (msat, optional): max amount accept in a single payment - - **their\_reserve\_msat** (msat, optional): minimum we insist they keep in channel - - **our\_reserve\_msat** (msat, optional): minimum they insist we keep in channel - - **spendable\_msat** (msat, optional): total we could send through channel - - **receivable\_msat** (msat, optional): total peer could send through channel - - **minimum\_htlc\_in\_msat** (msat, optional): the minimum amount HTLC we accept - - **minimum\_htlc\_out\_msat** (msat, optional): the minimum amount HTLC we will send - - **maximum\_htlc\_out\_msat** (msat, optional): the maximum amount HTLC we will send - - **their\_to\_self\_delay** (u32, optional): the number of blocks before they can take their funds if they unilateral close - - **our\_to\_self\_delay** (u32, optional): the number of blocks before we can take our funds if we unilateral close - - **max\_accepted\_htlcs** (u32, optional): Maximum number of incoming HTLC we will accept at once + - **local\_funds\_msat** (msat): Amount of channel we funded. + - **remote\_funds\_msat** (msat): Amount of channel they funded. + - **pushed\_msat** (msat, optional): Amount pushed from opener to peer. + - **fee\_paid\_msat** (msat, optional): Amount we paid peer at open. + - **fee\_rcvd\_msat** (msat, optional): Amount we were paid by peer at open. + - **to\_us\_msat** (msat, optional): How much of channel is owed to us. + - **min\_to\_us\_msat** (msat, optional): Least amount owed to us ever. If the peer were to successfully steal from us, this is the amount we would still retain. + - **max\_to\_us\_msat** (msat, optional): Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get. + - **total\_msat** (msat, optional): Total amount in the channel. + - **fee\_base\_msat** (msat, optional): Amount we charge to use the channel. + - **fee\_proportional\_millionths** (u32, optional): Amount we charge to use the channel in parts-per-million. + - **dust\_limit\_msat** (msat, optional): Minimum amount for an output on the channel transactions. + - **max\_total\_htlc\_in\_msat** (msat, optional): Max amount accept in a single payment. + - **their\_reserve\_msat** (msat, optional): Minimum we insist they keep in channel. If they have less than this in the channel, they cannot send to us on that channel. The default is 1% of the total channel capacity. + - **our\_reserve\_msat** (msat, optional): Minimum they insist we keep in channel. If you have less than this in the channel, you cannot send out via this channel. + - **spendable\_msat** (msat, optional): An estimate of the total we could send through channel (can be wrong because adding HTLCs requires an increase in fees paid to onchain miners, and onchain fees change dynamically according to onchain activity). + - **receivable\_msat** (msat, optional): An estimate of the total peer could send through channel. + - **minimum\_htlc\_in\_msat** (msat, optional): The minimum amount HTLC we accept. + - **minimum\_htlc\_out\_msat** (msat, optional): The minimum amount HTLC we will send. + - **maximum\_htlc\_out\_msat** (msat, optional): The maximum amount HTLC we will send. + - **their\_to\_self\_delay** (u32, optional): The number of blocks before they can take their funds if they unilateral close. + - **our\_to\_self\_delay** (u32, optional): The number of blocks before we can take our funds if we unilateral close. + - **max\_accepted\_htlcs** (u32, optional): Maximum number of incoming HTLC we will accept at once. - **alias** (object, optional): - - **local** (short\_channel\_id, optional): An alias assigned by this node to this channel, used for outgoing payments - - **remote** (short\_channel\_id, optional): An alias assigned by the remote node to this channel, usable in routehints and invoices - - **state\_changes** (array of objects, optional): Prior state changes: - - **timestamp** (string): UTC timestamp of form YYYY-mm-ddTHH:MM:SS.%03dZ - - **old\_state** (string): Previous state (one of "OPENINGD", "CHANNELD\_AWAITING\_LOCKIN", "CHANNELD\_NORMAL", "CHANNELD\_SHUTTING\_DOWN", "CLOSINGD\_SIGEXCHANGE", "CLOSINGD\_COMPLETE", "AWAITING\_UNILATERAL", "FUNDING\_SPEND\_SEEN", "ONCHAIN", "DUALOPEND\_OPEN\_INIT", "DUALOPEND\_AWAITING\_LOCKIN", "DUALOPEND\_OPEN\_COMMITTED", "DUALOPEND\_OPEN\_COMMIT\_READY") - - **new\_state** (string): New state (one of "OPENINGD", "CHANNELD\_AWAITING\_LOCKIN", "CHANNELD\_NORMAL", "CHANNELD\_SHUTTING\_DOWN", "CLOSINGD\_SIGEXCHANGE", "CLOSINGD\_COMPLETE", "AWAITING\_UNILATERAL", "FUNDING\_SPEND\_SEEN", "ONCHAIN", "DUALOPEND\_OPEN\_INIT", "DUALOPEND\_AWAITING\_LOCKIN", "DUALOPEND\_OPEN\_COMMITTED", "DUALOPEND\_OPEN\_COMMIT\_READY") - - **cause** (string): What caused the change (one of "unknown", "local", "user", "remote", "protocol", "onchain") - - **message** (string): Human-readable explanation + - **local** (short\_channel\_id, optional): An alias assigned by this node to this channel, used for outgoing payments. + - **remote** (short\_channel\_id, optional): An alias assigned by the remote node to this channel, usable in routehints and invoices. + - **state\_changes** (array of objects, optional): Prior state changes.: + - **timestamp** (string): UTC timestamp of form YYYY-mm-ddTHH:MM:SS.%03dZ. + - **old\_state** (string) (one of "OPENINGD", "CHANNELD\_AWAITING\_LOCKIN", "CHANNELD\_NORMAL", "CHANNELD\_SHUTTING\_DOWN", "CLOSINGD\_SIGEXCHANGE", "CLOSINGD\_COMPLETE", "AWAITING\_UNILATERAL", "FUNDING\_SPEND\_SEEN", "ONCHAIN", "DUALOPEND\_OPEN\_INIT", "DUALOPEND\_AWAITING\_LOCKIN", "DUALOPEND\_OPEN\_COMMITTED", "DUALOPEND\_OPEN\_COMMIT\_READY"): Previous state. + - **new\_state** (string) (one of "OPENINGD", "CHANNELD\_AWAITING\_LOCKIN", "CHANNELD\_NORMAL", "CHANNELD\_SHUTTING\_DOWN", "CLOSINGD\_SIGEXCHANGE", "CLOSINGD\_COMPLETE", "AWAITING\_UNILATERAL", "FUNDING\_SPEND\_SEEN", "ONCHAIN", "DUALOPEND\_OPEN\_INIT", "DUALOPEND\_AWAITING\_LOCKIN", "DUALOPEND\_OPEN\_COMMITTED", "DUALOPEND\_OPEN\_COMMIT\_READY"): New state. + - **cause** (string) (one of "unknown", "local", "user", "remote", "protocol", "onchain"): What caused the change. + - **message** (string): Human-readable explanation. - **status** (array of strings, optional): - - Billboard log of significant changes - - **in\_payments\_offered** (u64, optional): Number of incoming payment attempts - - **in\_offered\_msat** (msat, optional): Total amount of incoming payment attempts - - **in\_payments\_fulfilled** (u64, optional): Number of successful incoming payment attempts - - **in\_fulfilled\_msat** (msat, optional): Total amount of successful incoming payment attempts - - **out\_payments\_offered** (u64, optional): Number of outgoing payment attempts - - **out\_offered\_msat** (msat, optional): Total amount of outgoing payment attempts - - **out\_payments\_fulfilled** (u64, optional): Number of successful outgoing payment attempts - - **out\_fulfilled\_msat** (msat, optional): Total amount of successful outgoing payment attempts - - **htlcs** (array of objects, optional): current HTLCs in this channel: - - **direction** (string): Whether it came from peer, or is going to peer (one of "in", "out") - - **id** (u64): Unique ID for this htlc on this channel in this direction - - **amount\_msat** (msat): Amount send/received for this HTLC - - **expiry** (u32): Block this HTLC expires at - - **payment\_hash** (hash): the hash of the payment\_preimage which will prove payment (always 64 characters) - - **local\_trimmed** (boolean, optional): if this is too small to enforce onchain (always *true*) - - **status** (string, optional): set if this HTLC is currently waiting on a hook (and shows what plugin) + - (string, optional): Billboard log of significant changes. + - **in\_payments\_offered** (u64, optional): Number of incoming payment attempts. + - **in\_offered\_msat** (msat, optional): Total amount of incoming payment attempts. + - **in\_payments\_fulfilled** (u64, optional): Number of successful incoming payment attempts. + - **in\_fulfilled\_msat** (msat, optional): Total amount of successful incoming payment attempts. + - **out\_payments\_offered** (u64, optional): Number of outgoing payment attempts. + - **out\_offered\_msat** (msat, optional): Total amount of outgoing payment attempts. + - **out\_payments\_fulfilled** (u64, optional): Number of successful outgoing payment attempts. + - **out\_fulfilled\_msat** (msat, optional): Total amount of successful outgoing payment attempts. + - **htlcs** (array of objects, optional): Current HTLCs in this channel.: + - **direction** (string) (one of "in", "out"): Whether it came from peer, or is going to peer. + - **id** (u64): Unique ID for this htlc on this channel in this direction. + - **amount\_msat** (msat): Amount send/received for this HTLC. + - **expiry** (u32): Block this HTLC expires at (after which an `in` direction HTLC will be returned to the peer, an `out` returned to us). If this expiry is too close, lightningd(8) will automatically unilaterally close the channel in order to enforce the timeout onchain. + - **payment\_hash** (hash): The hash of the payment\_preimage which will prove payment. + - **local\_trimmed** (boolean, optional) (always *true*): If this is too small to enforce onchain; it doesn't appear in the commitment transaction and will not be enforced in a unilateral close. Generally true if the HTLC (after subtracting onchain fees) is below the `dust_limit_msat` for the channel. + - **status** (string, optional): Set if this HTLC is currently waiting on a hook (and shows what plugin). If **direction** is "out": - - - **state** (string): Status of the HTLC (one of "SENT\_ADD\_HTLC", "SENT\_ADD\_COMMIT", "RCVD\_ADD\_REVOCATION", "RCVD\_ADD\_ACK\_COMMIT", "SENT\_ADD\_ACK\_REVOCATION", "RCVD\_REMOVE\_HTLC", "RCVD\_REMOVE\_COMMIT", "SENT\_REMOVE\_REVOCATION", "SENT\_REMOVE\_ACK\_COMMIT", "RCVD\_REMOVE\_ACK\_REVOCATION") + - **state** (string) (one of "SENT\_ADD\_HTLC", "SENT\_ADD\_COMMIT", "RCVD\_ADD\_REVOCATION", "RCVD\_ADD\_ACK\_COMMIT", "SENT\_ADD\_ACK\_REVOCATION", "RCVD\_REMOVE\_HTLC", "RCVD\_REMOVE\_COMMIT", "SENT\_REMOVE\_REVOCATION", "SENT\_REMOVE\_ACK\_COMMIT", "RCVD\_REMOVE\_ACK\_REVOCATION"): Status of the HTLC. If **direction** is "in": - - - **state** (string): Status of the HTLC (one of "RCVD\_ADD\_HTLC", "RCVD\_ADD\_COMMIT", "SENT\_ADD\_REVOCATION", "SENT\_ADD\_ACK\_COMMIT", "RCVD\_ADD\_ACK\_REVOCATION", "SENT\_REMOVE\_HTLC", "SENT\_REMOVE\_COMMIT", "RCVD\_REMOVE\_REVOCATION", "RCVD\_REMOVE\_ACK\_COMMIT", "SENT\_REMOVE\_ACK\_REVOCATION") + - **state** (string) (one of "RCVD\_ADD\_HTLC", "RCVD\_ADD\_COMMIT", "SENT\_ADD\_REVOCATION", "SENT\_ADD\_ACK\_COMMIT", "RCVD\_ADD\_ACK\_REVOCATION", "SENT\_REMOVE\_HTLC", "SENT\_REMOVE\_COMMIT", "RCVD\_REMOVE\_REVOCATION", "RCVD\_REMOVE\_ACK\_COMMIT", "SENT\_REMOVE\_ACK\_REVOCATION"): Status of the HTLC. If **close\_to** is present: - - - **close\_to\_addr** (string, optional): The bitcoin address we will close to + - **close\_to\_addr** (string, optional): The bitcoin address we will close to (present if close\_to\_addr is a standardized address). If **scratch\_txid** is present: - - - **last\_tx\_fee\_msat** (msat): fee attached to this the current tx + - **last\_tx\_fee\_msat** (msat): Fee attached to this the current tx. If **short\_channel\_id** is present: - - - **direction** (u32): 0 if we're the lesser node\_id, 1 if we're the greater + - **direction** (u32): 0 if we're the lesser node\_id, 1 if we're the greater (as used in BOLT #7 channel\_update). If **inflight** is present: - - - **initial\_feerate** (string): The feerate for the initial funding transaction in per-1000-weight, with "kpw" appended - - **last\_feerate** (string): The feerate for the latest funding transaction in per-1000-weight, with "kpw" appended - - **next\_feerate** (string): The minimum feerate for the next funding transaction in per-1000-weight, with "kpw" appended + - **initial\_feerate** (string): The feerate for the initial funding transaction in per-1000-weight, with `kpw` appended. + - **last\_feerate** (string): The feerate for the latest funding transaction in per-1000-weight, with `kpw` appended. + - **next\_feerate** (string): The minimum feerate for the next funding transaction in per-1000-weight, with `kpw` appended. If **connected** is *true*: - - - **netaddr** (array of strings): A single entry array: - - address, e.g. 1.2.3.4:1234 - - **features** (hex): bitmap of BOLT #9 features from peer's INIT message - - **remote\_addr** (string, optional): The public IPv4/6 address the peer sees us from, e.g. 1.2.3.4:1234 - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -On success, an object with a "peers" key is returned containing a list -of 0 or more objects. - -Each object in the list contains the following data: - -- *id* : The unique id of the peer -- *connected* : A boolean value showing the connection status -- *netaddr* : A list of network addresses the node is listening on -- *features* : Bit flags showing supported features (BOLT \#9) -- *channels* : An array of objects describing channels with the peer. -- *log* : Only present if *level* is set. List logs related to the -peer at the specified *level* - -If *id* is supplied and no matching nodes are found, a "peers" object -with an empty list is returned. - -The objects in the *channels* array will have at least these fields: - -* *state*: Any of these strings: - * `"OPENINGD"`: The channel funding protocol with the peer is ongoing - and both sides are negotiating parameters. - * `"CHANNELD_AWAITING_LOCKIN"`: The peer and you have agreed on channel - parameters and are just waiting for the channel funding transaction to - be confirmed deeply. - Both you and the peer must acknowledge the channel funding transaction - to be confirmed deeply before entering the next state. - * `"CHANNELD_NORMAL"`: The channel can be used for normal payments. - * `"CHANNELD_SHUTTING_DOWN"`: A mutual close was requested (by you or - peer) and both of you are waiting for HTLCs in-flight to be either - failed or succeeded. - The channel can no longer be used for normal payments and forwarding. - Mutual close will proceed only once all HTLCs in the channel have - either been fulfilled or failed. - * `"CLOSINGD_SIGEXCHANGE"`: You and the peer are negotiating the mutual - close onchain fee. - * `"CLOSINGD_COMPLETE"`: You and the peer have agreed on the mutual close - onchain fee and are awaiting the mutual close getting confirmed deeply. - * `"AWAITING_UNILATERAL"`: You initiated a unilateral close, and are now - waiting for the peer-selected unilateral close timeout to complete. - * `"FUNDING_SPEND_SEEN"`: You saw the funding transaction getting - spent (usually the peer initiated a unilateral close) and will now - determine what exactly happened (i.e. if it was a theft attempt). - * `"ONCHAIN"`: You saw the funding transaction getting spent and now - know what happened (i.e. if it was a proper unilateral close by the - peer, or a theft attempt). - * `"CLOSED"`: The channel closure has been confirmed deeply. - The channel will eventually be removed from this array. -* *state\_changes*: An array of objects describing prior state change events. -* *opener*: A string `"local"` or `"remote`" describing which side opened this - channel. -* *closer*: A string `"local"` or `"remote`" describing which side - closed this channel or `null` if the channel is not (being) closed yet. -* *status*: An array of strings containing the most important log messages - relevant to this channel. - Also known as the "billboard". -* *owner*: A string describing which particular sub-daemon of `lightningd` - currently is responsible for this channel. - One of: `"lightning_openingd"`, `"lightning_channeld"`, - `"lightning_closingd"`, `"lightning_onchaind"`. -* *to\_us\_msat*: A string describing how much of the funds is owned by us; - a number followed by a string unit. -* *total\_msat*: A string describing the total capacity of the channel; - a number followed by a string unit. -* *fee\_base\_msat*: The fixed routing fee we charge for forwards going out over - this channel, regardless of payment size. -* *fee\_proportional\_millionths*: The proportional routing fees in ppm (parts- - per-millionths) we charge for forwards going out over this channel. -* *features*: An array of feature names supported by this channel. - -These fields may exist if the channel has gotten beyond the `"OPENINGD"` -state, or in various circumstances: - -* *short\_channel\_id*: A string of the short channel ID for the channel; - Format is `"BBBBxTTTxOOO"`, where `"BBBB"` is the numeric block height - at which the funding transaction was confirmed, `"TTT"` is the numeric - funding transaction index within that block, and `"OOO"` is the - numeric output index of the transaction output that actually anchors - this channel. -* *direction*: The channel-direction we own, as per BOLT \#7. - We own channel-direction 0 if our node ID is "less than" the peer node ID - in a lexicographical ordering of our node IDs, otherwise we own - channel-direction 1. - Our `channel_update` will use this *direction*. -* *channel\_id*: The full channel ID of the channel; - the funding transaction ID XORed with the output number. -* *funding\_txid*: The funding transaction ID of the channel. -* *close\_to*: The raw `scriptPubKey` that was indicated in the starting - **fundchannel\_start** command and accepted by the peer. - If the `scriptPubKey` encodes a standardized address, an additional - *close\_to\_addr* field will be present with the standardized address. -* *private*: A boolean, true if the channel is unpublished, false if the - channel is published. -* *funding\_msat*: An object, whose field names are the node - IDs involved in the channel, and whose values are strings (numbers with - a unit suffix) indicating how much that node originally contributed in - opening the channel. -* *min\_to\_us\_msat*: A string describing the historic point at which - we owned the least amount of funds in this channel; - a number followed by a string unit. - If the peer were to successfully steal from us, this is the amount we - would still retain. -* *max\_to\_us\_msat*: A string describing the historic point at which - we owned the most amount of funds in this channel; - a number followed by a string unit. - If we were to successfully steal from the peer, this is the amount we - could potentially get. -* *dust\_limit\_msat*: A string describing an amount; - if an HTLC or the amount wholly-owned by one node is at or below this - amount, it will be considered "dusty" and will not appear in a close - transaction, and will be donated to miners as fee; - a number followed by a string unit. -* *max\_total\_htlc\_in\_msat*: A string describing an amount; - the sum of all HTLCs in the channel cannot exceed this amount; - a number followed by a string unit. -* *their\_reserve\_msat*: A string describing the minimum amount that - the peer must keep in the channel when it attempts to send out; - if it has less than this in the channel, it cannot send to us on - that channel; - a number followed by a string unit. - We impose this on them, default is 1% of the total channel capacity. -* *our\_reserve\_msat*: A string describing the minimum amount that - you must keep in the channel when you attempt to send out; - if you have less than this in the channel, you cannot send out - via this channel; - a number followed by a string unit. - The peer imposes this on us, default is 1% of the total channel capacity. -* *spendable\_msat* and *receivable\_msat*: A string describing an - ***estimate*** of how much we can send or receive over this channel in a - single payment (or payment-part for multi-part payments); - a number followed by a string unit. - This is an ***estimate***, which can be wrong because adding HTLCs requires - an increase in fees paid to onchain miners, and onchain fees change - dynamically according to onchain activity. - For a sufficiently-large channel, this can be limited by the rules imposed - under certain blockchains; - for example, individual Bitcoin mainnet payment-parts cannot exceed - 42.94967295 mBTC. -* *minimum\_htlc\_in\_msat*: A string describing the minimum amount that - an HTLC must have before we accept it. -* *their\_to\_self\_delay*: The number of blocks that the peer must wait - to claim their funds, if they close unilaterally. -* *our\_to\_self\_delay*: The number of blocks that you must wait to claim - your funds, if you close unilaterally. -* *max\_accepted\_htlcs*: The maximum number of HTLCs you will accept on - this channel. -* *in\_payments\_offered*: The number of incoming HTLCs offered over this - channel. -* *in\_offered\_msat*: A string describing the total amount of all incoming - HTLCs offered over this channel; - a number followed by a string unit. -* *in\_payments\_fulfilled*: The number of incoming HTLCs offered *and - successfully claimed* over this channel. -* *in\_fulfilled\_msat*: A string describing the total amount of all - incoming HTLCs offered *and successfully claimed* over this channel; - a number followed by a string unit. -* *out\_payments\_offered*: The number of outgoing HTLCs offered over - this channel. -* *out\_offered\_msat*: A string describing the total amount of all - outgoing HTLCs offered over this channel; - a number followed by a string unit. -* *out\_payments\_fulfilled*: The number of outgoing HTLCs offered *and - successfully claimed* over this channel. -* *out\_fulfilled\_msat*: A string describing the total amount of all - outgoing HTLCs offered *and successfully claimed* over this channel; - a number followed by a string unit. -* *scratch\_txid*: The txid of the latest transaction (what we would sign and - send to chain if the channel were to fail now). -* *last\_tx\_fee*: The fee on that latest transaction. -* *feerate*: An object containing the latest feerate as both *perkw* and *perkb*. -* *htlcs*: An array of objects describing the HTLCs currently in-flight - in the channel. - -Objects in the *htlcs* array will contain these fields: - -* *direction*: Either the string `"out"` or `"in"`, whether it is an - outgoing or incoming HTLC. -* *id*: A numeric ID uniquely identifying this HTLC. -* *amount\_msat*: The value of the HTLC. -* *expiry*: The blockheight at which the HTLC will be forced to return - to its offerer: an `"in"` HTLC will be returned to the peer, an - `"out"` HTLC will be returned to you. - **NOTE** If the *expiry* of any outgoing HTLC will arrive in the next - block, `lightningd`(8) will automatically unilaterally close the - channel in order to enforce the timeout onchain. -* *payment\_hash*: The payment hash, whose preimage must be revealed to - successfully claim this HTLC. -* *state*: A string describing whether the HTLC has been communicated to - or from the peer, whether it has been signed in a new commitment, whether - the previous commitment (that does not contain it) has been revoked, as - well as when the HTLC is fulfilled or failed offchain. -* *local\_trimmed*: A boolean, existing and `true` if the HTLC is not - actually instantiated as an output (i.e. "trimmed") on the commitment - transaction (and will not be instantiated on a unilateral close). - Generally true if the HTLC is below the *dust\_limit\_msat* for the - channel. + - **netaddr** (array of strings): A single entry array.: + - (string, optional): Address, e.g. 1.2.3.4:1234. + - **features** (hex): Bitmap of BOLT #9 features from peer's INIT message. + - **remote\_addr** (string, optional): The public IPv4/6 address the peer sees us from, e.g. 1.2.3.4:1234. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "peers": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "connected": true, + "num_channels": 1, + "netaddr": [ + "127.0.0.1:44619" + ], + "features": "08a0000a0a69a2" + } + ] +} +{ + "peers": [ + { + "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "connected": true, + "num_channels": 1, + "netaddr": [ + "127.0.0.1:48862" + ], + "features": "08a0000a0a69a2" + } + ] +} +``` ERRORS ------ -On error the returned object will contain `code` and `message` properties, -with `code` being one of the following: +On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -32602: If the given parameters are wrong. @@ -386,14 +234,11 @@ Michael Hawkins <>. SEE ALSO -------- -lightning-connect(7), lightning-fundchannel\_start(7), -lightning-setchannel(7) +lightning-connect(7), lightning-fundchannel\_start(7), lightning-setchannel(7) RESOURCES --------- -Main web site: Lightning -RFC site (BOLT \#9): +Main web site: +Lightning RFC site (BOLT #9): - -[comment]: # ( SHA256STAMP:5b622ce05ce081a3184b01dc1cf5d2d5882293e171b3a3a118efff3748d8e25a) diff --git a/doc/lightning-listsendpays.7.md b/doc/lightning-listsendpays.7.md index 141b468550c2..d61e14a0f888 100644 --- a/doc/lightning-listsendpays.7.md +++ b/doc/lightning-listsendpays.7.md @@ -9,62 +9,140 @@ SYNOPSIS DESCRIPTION ----------- -The **listsendpays** RPC command gets the status of all *sendpay* -commands (which is also used by the *pay* command), or with *bolt11* or -*payment\_hash* limits results to that specific payment. You cannot -specify both. It is possible to filter the payments also by *status*. - -Note that there may be more than one concurrent *sendpay* -command per *pay*, so this command should be used with caution. +The **listsendpays** RPC command gets the status of all *sendpay* commands (which is also used by the *pay* command), or with *bolt11* or *payment\_hash* limits results to that specific payment. You cannot specify both. It is possible to filter the payments also by *status*. + +Note that there may be more than one concurrent *sendpay* command per *pay*, so this command should be used with caution. + +- **bolt11** (string, optional): Bolt11 invoice. +- **payment\_hash** (hash, optional): The hash of the payment\_preimage. +- **status** (string, optional) (one of "pending", "complete", "failed"): Whether the invoice has been paid, pending, or failed. +- **index** (string, optional) (one of "created", "updated"): If neither bolt11 or payment\_hash is specified, `index` controls ordering, by `created` (default) or `updated`. *(added v23.11)* +- **start** (u64, optional): If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7). *(added v23.11)* +- **limit** (u32, optional): If `index` is specified, `limit` can be used to specify the maximum number of entries to return. *(added v23.11)* + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:listsendpays#1", + "method": "listsendpays", + "params": { + "bolt11": null, + "payment_hash": null, + "status": null, + "index": null, + "start": null, + "limit": null + } +} +{ + "id": "example:listsendpays#2", + "method": "listsendpays", + "params": { + "bolt11": "lnbcrt1230n1pja03q9sp5xu9aypccf3n6vld2waxcysy47ct2wl5x5adtm7k8u30knqes22lspp5duw2v8csh0zh4xg9ql3amem98avlkc2ecre99tgmr2340amf9kmsdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqwh78s8wqg0kepspw0epcxmxteh5wu8n6ddlwdnyj758fqxpqk8ejf597x8ju3r32xqgae3yzjjz9e5s6l2vs5zxvkayhmemmx74wvyqqyqf8c9", + "payment_hash": null, + "status": null, + "index": null, + "start": null, + "limit": null + } +} +``` RETURN VALUE ------------ Note that the returned array is ordered by increasing *id*. - -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **payments** is returned. It is an array of objects, where each object contains: - -- **created\_index** (u64): 1-based index indicating order this payment was created in *(added v23.11)* -- **id** (u64): old synonym for created\_index -- **groupid** (u64): Grouping key to disambiguate multiple attempts to pay an invoice or the same payment\_hash -- **payment\_hash** (hash): the hash of the *payment\_preimage* which will prove payment -- **status** (string): status of the payment (one of "pending", "failed", "complete") -- **created\_at** (u64): the UNIX timestamp showing when this payment was initiated -- **amount\_sent\_msat** (msat): The amount sent -- **partid** (u64, optional): Part number (for multiple parts to a single payment) -- **updated\_index** (u64, optional): 1-based index indicating order this payment was changed (only present if it has changed since creation) *(added v23.11)* -- **amount\_msat** (msat, optional): The amount delivered to destination (if known) -- **destination** (pubkey, optional): the final destination of the payment if known -- **label** (string, optional): the label, if given to sendpay -- **bolt11** (string, optional): the bolt11 string (if pay supplied one) -- **description** (string, optional): the description matching the bolt11 description hash (if pay supplied one) -- **bolt12** (string, optional): the bolt12 string (if supplied for pay: **experimental-offers** only). +On success, an object containing **payments** is returned. It is an array of objects, where each object contains: + +- **created\_index** (u64): 1-based index indicating order this payment was created in. *(added v23.11)* +- **id** (u64): Old synonym for created\_index. +- **groupid** (u64): Grouping key to disambiguate multiple attempts to pay an invoice or the same payment\_hash. +- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. +- **status** (string) (one of "pending", "failed", "complete"): Status of the payment. +- **created\_at** (u64): The UNIX timestamp showing when this payment was initiated. +- **amount\_sent\_msat** (msat): The amount sent. +- **partid** (u64, optional): Part number (for multiple parts to a single payment). +- **updated\_index** (u64, optional): 1-based index indicating order this payment was changed (only present if it has changed since creation). *(added v23.11)* +- **amount\_msat** (msat, optional): The amount delivered to destination (if known). +- **destination** (pubkey, optional): The final destination of the payment if known. +- **label** (string, optional): The label, if given to sendpay. +- **bolt11** (string, optional): The bolt11 string (if pay supplied one). +- **description** (string, optional): The description matching the bolt11 description hash (if pay supplied one). +- **bolt12** (string, optional): The bolt12 string (if supplied for pay: **experimental-offers** only). If **status** is "complete": - - - **payment\_preimage** (secret): the proof of payment: SHA256 of this **payment\_hash** + - **payment\_preimage** (secret): The proof of payment: SHA256 of this **payment\_hash**. + - **completed\_at** (u64, optional): The UNIX timestamp showing when this payment was completed. *(added pre-v0.10.1)* If **status** is "failed": - - - **erroronion** (hex, optional): the onion message returned - -[comment]: # (GENERATE-FROM-SCHEMA-END) + - **erroronion** (hex, optional): The onion message returned. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "payments": [ + { + "created_index": 1, + "id": 1, + "payment_hash": "e3b43574acd074b0c4ba1b13b5155ff5f9c76742e643ed003e17301c5a2db149", + "groupid": 1, + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount_msat": 20000, + "amount_sent_msat": 20000, + "created_at": 1706225269, + "status": "pending", + "bolt11": "lnbcrt200n1pjm9mn5sp5gq84lgga959m6gg4g0kj29ypwjaxxnm4cu5csymq8p6nqxv800mspp5uw6r2a9v6p6tp396rvfm292l7huuwe6zuep76qp7zucpck3dk9ysdpqf9grgmt62fmk5stswefh23n2tpykvcmzxqyjw5qcqp99qxpqysgqz8s496zmwed278jvp075zlhrnj0ncg45kcfw5s2lkhtxd3wc39f8wflp5gmd827dk470xpasfpx0azsfu0k8ttwae7620h8d050w28cqan776g" + }, + { + "created_index": 2, + "id": 2, + "payment_hash": "f55d92cfe019b5a015f5e5956e9255053cda14786171d5002feb12ae5254e5a5", + "groupid": 1, + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount_msat": 30000, + "amount_sent_msat": 30000, + "created_at": 1706225269, + "status": "pending", + "bolt11": "lnbcrt300n1pjm9mn5sp5zqfkr93rp92mdyj6m8lzpcu90rfefcaqff8fxdd2sc5mace23ujspp574we9nlqrx66q904uk2kayj4q57d59rcv9ca2qp0avf2u5j5ukjsdpq29j55nfcgfcnsvzw2er57knhwcmhzwt0xqyjw5qcqp99qxpqysgq76p2jpnegtzlxmn0aqt6d3f89q4p6y5v3v2qz7t2mm6xt90nt324cq400tl82k28562aux8jxs57d603g7s0q4g3dapu9a7vln94j7spsut799" + } + ] +} +{ + "payments": [ + { + "created_index": 1, + "id": 1, + "payment_hash": "6f1ca61f10bbc57a990507e3dde7653f59fb6159c0f252ad1b1aa357f7692db7", + "groupid": 1, + "updated_index": 1, + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount_msat": 123000, + "amount_sent_msat": 123000, + "created_at": 1708639237, + "completed_at": 1708639238, + "status": "complete", + "payment_preimage": "91f8366681fdfd309c048082fcde81a79116f85a7b2dd09aef1e34f5f7c3397b", + "bolt11": "lnbcrt1230n1pja03q9sp5xu9aypccf3n6vld2waxcysy47ct2wl5x5adtm7k8u30knqes22lspp5duw2v8csh0zh4xg9ql3amem98avlkc2ecre99tgmr2340amf9kmsdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqwh78s8wqg0kepspw0epcxmxteh5wu8n6ddlwdnyj758fqxpqk8ejf597x8ju3r32xqgae3yzjjz9e5s6l2vs5zxvkayhmemmx74wvyqqyqf8c9" + } + ] +} +``` AUTHOR ------ -Christian Decker <> is mainly -responsible. +Christian Decker <> is mainly responsible. SEE ALSO -------- -lightning-listpays(7), lightning-sendpay(7), lightning-listinvoice(7). +lightning-listpays(7), lightning-sendpay(7), lightning-listinvoice(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:366f7673738e9858fb81ec80293160c421806aeb224ffa60e8fa6ce937db8da7) diff --git a/doc/lightning-listsqlschemas.7.md b/doc/lightning-listsqlschemas.7.md index e0426ab2a6a1..c554b6ff8553 100644 --- a/doc/lightning-listsqlschemas.7.md +++ b/doc/lightning-listsqlschemas.7.md @@ -4,95 +4,208 @@ lightning-listsqlschemas -- Command to example lightning-sql schemas SYNOPSIS -------- -**listsqlschemas** [*table*] +**listsqlschemas** [*table*] DESCRIPTION ----------- -This allows you to examine the schemas at runtime; while they are fully -documented for the current release in lightning-sql(7), as fields are -added or deprecated, you can use this command to determine what fields -are present. +Command *added* in v23.02. -If *table* is given, only that table is in the resulting list, otherwise -all tables are listed. +This allows you to examine the schemas at runtime; while they are fully documented for the current release in lightning-sql(7), as fields are added or deprecated, you can use this command to determine what fields are present. + +If *table* is given, only that table is in the resulting list, otherwise all tables are listed. + +- **table** (string, optional) EXAMPLE JSON REQUEST ------------- +-------------------- ```json { - "id": 82, + "id": "example:listsqlschemas#1", "method": "listsqlschemas", "params": { "table": "offers" } } -``` - -EXAMPLE JSON RESPONSE ------ - -```json { - "schemas": [ - { - "tablename": "offers", - "columns": [ - { - "name": "offer_id", - "type": "BLOB" - }, - { - "name": "active", - "type": "INTEGER" - }, - { - "name": "single_use", - "type": "INTEGER" - }, - { - "name": "bolt12", - "type": "TEXT" - }, - { - "name": "bolt12_unsigned", - "type": "TEXT" - }, - { - "name": "used", - "type": "INTEGER" - }, - { - "name": "label", - "type": "TEXT" - } - ], - "indices": [ - [ - "offer_id" - ] - ] - } - ] + "id": "example:listsqlschemas#2", + "method": "listsqlschemas", + "params": [ + "closedchannels" + ] } ``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **schemas** is returned. It is an array of objects, where each object contains: +On success, an object containing **schemas** is returned. It is an array of objects, where each object contains: -- **tablename** (string): the name of the table -- **columns** (array of objects): the columns, in database order: - - **name** (string): the name of the column - - **type** (string): the SQL type of the column (one of "INTEGER", "BLOB", "TEXT", "REAL") -- **indices** (array of arrays, optional): Any index we created to speed lookups: - - The columns for this index: - - The column name +- **tablename** (string): The name of the table. +- **columns** (array of objects): The columns, in database order.: + - **name** (string): The name of the column. + - **type** (string) (one of "INTEGER", "BLOB", "TEXT", "REAL"): The SQL type of the column. +- **indices** (array of arrays, optional): Any index we created to speed lookups.: + - (array of strings): The columns for this index. + - (string, optional): The column name. -[comment]: # (GENERATE-FROM-SCHEMA-END) +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "schemas": [ + { + "tablename": "offers", + "columns": [ + { + "name": "offer_id", + "type": "BLOB" + }, + { + "name": "active", + "type": "INTEGER" + }, + { + "name": "single_use", + "type": "INTEGER" + }, + { + "name": "bolt12", + "type": "TEXT" + }, + { + "name": "bolt12_unsigned", + "type": "TEXT" + }, + { + "name": "used", + "type": "INTEGER" + }, + { + "name": "label", + "type": "TEXT" + } + ], + "indices": [ + [ + "offer_id" + ] + ] + } + ] +} +{ + "schemas": [ + { + "tablename": "closedchannels", + "columns": [ + { + "name": "rowid", + "type": "INTEGER" + }, + { + "name": "peer_id", + "type": "BLOB" + }, + { + "name": "channel_id", + "type": "BLOB" + }, + { + "name": "short_channel_id", + "type": "TEXT" + }, + { + "name": "alias_local", + "type": "TEXT" + }, + { + "name": "alias_remote", + "type": "TEXT" + }, + { + "name": "opener", + "type": "TEXT" + }, + { + "name": "closer", + "type": "TEXT" + }, + { + "name": "private", + "type": "INTEGER" + }, + { + "name": "total_local_commitments", + "type": "INTEGER" + }, + { + "name": "total_remote_commitments", + "type": "INTEGER" + }, + { + "name": "total_htlcs_sent", + "type": "INTEGER" + }, + { + "name": "funding_txid", + "type": "BLOB" + }, + { + "name": "funding_outnum", + "type": "INTEGER" + }, + { + "name": "leased", + "type": "INTEGER" + }, + { + "name": "funding_fee_paid_msat", + "type": "INTEGER" + }, + { + "name": "funding_fee_rcvd_msat", + "type": "INTEGER" + }, + { + "name": "funding_pushed_msat", + "type": "INTEGER" + }, + { + "name": "total_msat", + "type": "INTEGER" + }, + { + "name": "final_to_us_msat", + "type": "INTEGER" + }, + { + "name": "min_to_us_msat", + "type": "INTEGER" + }, + { + "name": "max_to_us_msat", + "type": "INTEGER" + }, + { + "name": "last_commitment_txid", + "type": "BLOB" + }, + { + "name": "last_commitment_fee_msat", + "type": "INTEGER" + }, + { + "name": "close_cause", + "type": "TEXT" + } + ] + } + ] +} +``` AUTHOR ------ @@ -102,10 +215,9 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-sql(7). +lightning-sql(7) RESOURCES --------- Main web site: -[comment]: # ( SHA256STAMP:1b00b9a14c9b433321cbf661fdb39cebd2c5fd5239ab80c3ebb845d7705c47d0) diff --git a/doc/lightning-listtransactions.7.md b/doc/lightning-listtransactions.7.md index 9b0850fbd0fe..a6859362739f 100644 --- a/doc/lightning-listtransactions.7.md +++ b/doc/lightning-listtransactions.7.md @@ -1,10 +1,10 @@ lightning-listtransactions -- Command to get the list of transactions that was stored in the wallet. -============================================================ +==================================================================================================== SYNOPSIS -------- -**listtransactions** +**listtransactions** DESCRIPTION ----------- @@ -12,11 +12,11 @@ DESCRIPTION The **listtransactions** command returns transactions tracked in the wallet. This includes deposits, withdrawals and transactions related to channels. A transaction may have multiple types, e.g., a transaction may both be a close and a deposit if it closes the channel and returns funds to the wallet. EXAMPLE JSON REQUEST ------------- +-------------------- ```json { - "id": 82, + "id": "example:listtransactions#1", "method": "listtransactions", "params": {} } @@ -25,75 +25,72 @@ EXAMPLE JSON REQUEST RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **transactions** is returned. It is an array of objects, where each object contains: - -- **hash** (txid): the transaction id -- **rawtx** (hex): the raw transaction -- **blockheight** (u32): the block height of this tx -- **txindex** (u32): the transaction number within the block -- **locktime** (u32): The nLocktime for this tx -- **version** (u32): The nVersion for this tx -- **inputs** (array of objects): Each input, in order: - - **txid** (txid): the transaction id spent - - **index** (u32): the output spent - - **sequence** (u32): the nSequence value -- **outputs** (array of objects): Each output, in order: - - **index** (u32): the 0-based output number - - **amount\_msat** (msat): the amount of the output - - **scriptPubKey** (hex): the scriptPubKey - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -ERRORS ------- - -On failure, one of the following error codes may be returned: - -- -32602: Error in given parameters. +On success, an object containing **transactions** is returned. It is an array of objects, where each object contains: + +- **hash** (txid): The transaction id. +- **rawtx** (hex): The raw transaction. +- **blockheight** (u32): The block height of this tx. +- **txindex** (u32): The transaction number within the block. +- **locktime** (u32): The nLocktime for this tx. +- **version** (u32): The nVersion for this tx. +- **inputs** (array of objects): Each input, in order.: + - **txid** (txid): The transaction id spent. + - **index** (u32): The output spent. + - **sequence** (u32): The nSequence value. +- **outputs** (array of objects): Each output, in order.: + - **index** (u32): The 0-based output number. + - **amount\_msat** (msat): The amount of the output. + - **scriptPubKey** (hex): The scriptPubKey. EXAMPLE JSON RESPONSE ------ +--------------------- ```json { - "transactions": [ - { - "hash": "05985072bbe20747325e69a159fe08176cc1bbc96d25e8848edad2dddc1165d0", - "rawtx": "02000000027032912651fc25a3e0893acd5f9640598707e2dfef92143bb5a4020e335442800100000017160014a5f48b9aa3cb8ca6cc1040c11e386745bb4dc932ffffffffd229a4b4f78638ebcac10a68b0561585a5d6e4d3b769ad0a909e9b9afaeae24e00000000171600145c83da9b685f9142016c6f5eb5f98a45cfa6f686ffffffff01915a01000000000017a9143a4dfd59e781f9c3018e7d0a9b7a26d58f8d22bf8700000000", - "blockheight": 0, - "txindex": 0, - "locktime": 0, - "version": 2, - "inputs": [ - { - "txid": "804254330e02a4b53b1492efdfe207875940965fcd3a89e0a325fc5126913270", - "index": 1, - "sequence": 4294967295 - }, - { - "txid": "4ee2eafa9a9b9e900aad69b7d3e4d6a5851556b0680ac1caeb3886f7b4a429d2", - "index": 0, - "sequence": 4294967295 - } - ], - "outputs": [ - { - "index": 0, - "satoshis": "88721000msat", - "scriptPubKey": "a9143a4dfd59e781f9c3018e7d0a9b7a26d58f8d22bf87" - } - ] - } - ] + "transactions": [ + { + "hash": "05985072bbe20747325e69a159fe08176cc1bbc96d25e8848edad2dddc1165d0", + "rawtx": "02000000027032912651fc25a3e0893acd5f9640598707e2dfef92143bb5a4020e335442800100000017160014a5f48b9aa3cb8ca6cc1040c11e386745bb4dc932ffffffffd229a4b4f78638ebcac10a68b0561585a5d6e4d3b769ad0a909e9b9afaeae24e00000000171600145c83da9b685f9142016c6f5eb5f98a45cfa6f686ffffffff01915a01000000000017a9143a4dfd59e781f9c3018e7d0a9b7a26d58f8d22bf8700000000", + "blockheight": 0, + "txindex": 0, + "locktime": 0, + "version": 2, + "inputs": [ + { + "txid": "804254330e02a4b53b1492efdfe207875940965fcd3a89e0a325fc5126913270", + "index": 1, + "sequence": 4294967295 + }, + { + "txid": "4ee2eafa9a9b9e900aad69b7d3e4d6a5851556b0680ac1caeb3886f7b4a429d2", + "index": 0, + "sequence": 4294967295 + } + ], + "outputs": [ + { + "index": 0, + "satoshis": "88721000msat", + "scriptPubKey": "a9143a4dfd59e781f9c3018e7d0a9b7a26d58f8d22bf87" + } + ] + } + ] } ``` +ERRORS +------ + +On failure, one of the following error codes may be returned: + +- -32602: Error in given parameters. AUTHOR ------ -Vincenzo Palazzo <> wrote the initial version of this man page, but many others did the hard work of actually implementing this rpc command. +Vincenzo Palazzo <> wrote the initial version of this man page, +but many others did the hard work of actually implementing this rpc command. SEE ALSO -------- @@ -104,5 +101,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:6b91e8a2ad267e8ec6f0f40f5f8bd00fa7e0b415f722b1cf1535fd3f132c35bf) diff --git a/doc/lightning-makesecret.7.md b/doc/lightning-makesecret.7.md index abb078519839..645999514d54 100644 --- a/doc/lightning-makesecret.7.md +++ b/doc/lightning-makesecret.7.md @@ -1,25 +1,58 @@ lightning-makesecret -- Command for deriving pseudorandom key from HSM -===================================================================== +====================================================================== SYNOPSIS -------- -**makesecret** [*hex*] [*string*] +**makesecret** [*hex*] [*string*] DESCRIPTION ----------- The **makesecret** RPC command derives a secret key from the HSM\_secret. +- **hex** (hex, optional): One of `hex` or `string` must be specified: `hex` can be any hex data. +- **string** (string, optional): One of `hex` or `string` must be specified: `string` is a UTF-8 string interpreted literally. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:makesecret#1", + "method": "makesecret", + "params": [ + "73636220736563726574" + ] +} +{ + "id": "example:makesecret#2", + "method": "makesecret", + "params": [ + null, + "scb secret" + ] +} +``` + RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **secret** (secret): the pseudorandom key derived from HSM\_secret +- **secret** (secret): The pseudorandom key derived from HSM\_secret. + +EXAMPLE JSON RESPONSE +--------------------- -[comment]: # (GENERATE-FROM-SCHEMA-END) +```json +{ + "secret": "a9a2e742405c28f059349132923a99337ae7f71168b7485496e3365f5bc664ed" +} +{ + "secret": "a9a2e742405c28f059349132923a99337ae7f71168b7485496e3365f5bc664ed" +} +``` ERRORS ------ @@ -37,5 +70,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:098d2882774cb9f33fb8aa93b7be1bf102d96a4835c550fdda7828ab5812490d) diff --git a/doc/lightning-multifundchannel.7.md b/doc/lightning-multifundchannel.7.md index 25e5a3678282..5d4803f2f35b 100644 --- a/doc/lightning-multifundchannel.7.md +++ b/doc/lightning-multifundchannel.7.md @@ -4,115 +4,58 @@ lightning-multifundchannel -- Command for establishing many lightning channels SYNOPSIS -------- -**multifundchannel** *destinations* [*feerate*] [*minconf*] [*utxos*] [*minchannels*] [*commitment\_feerate*] [*channel\_type*] +**multifundchannel** *destinations* [*feerate*] [*minconf*] [*utxos*] [*minchannels*] [*commitment\_feerate*] DESCRIPTION ----------- -The **multifundchannel** RPC command opens multiple payment channels -with nodes by committing a single funding transaction to the blockchain -that is shared by all channels. - -If not already connected, **multifundchannel** will automatically attempt -to connect; you may provide a *@host:port* hint appended to the node ID -so that Core Lightning can learn how to connect to the node; -see lightning-connect(7). - -Once the transaction is confirmed, normal channel operations may begin. -Readiness is indicated by **listpeers** reporting a *state* of -`CHANNELD_NORMAL` for the channel. - -RETURN VALUE ------------- - -This command opens multiple channels with a single large transaction, -thus only one transaction is returned. - -If *minchannels* was specified and is less than the number of destinations, -then it is possible that one or more of the destinations -do not have a channel even if **multifundchannel** succeeded. - -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object is returned, containing: - -- **tx** (hex): The raw transaction which funded the channel -- **txid** (txid): The txid of the transaction which funded the channel -- **channel\_ids** (array of objects): - - **id** (pubkey): The peer we opened the channel with - - **outnum** (u32): The 0-based output index showing which output funded the channel - - **channel\_id** (hex): The channel\_id of the resulting channel (always 64 characters) - - **channel\_type** (object): channel\_type as negotiated with peer *(added v24.02)*: - - **bits** (array of u32s): Each bit set in this channel\_type *(added v24.02)*: - - Bit number - - **names** (array of strings): Feature name for each bit set in this channel\_type *(added v24.02)*: - - Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even") - - **close\_to** (hex, optional): The raw scriptPubkey which mutual close will go to; only present if *close\_to* parameter was specified and peer supports `option_upfront_shutdown_script` -- **failed** (array of objects, optional): any peers we failed to open with (if *minchannels* was specified less than the number of destinations): - - **id** (pubkey): The peer we failed to open the channel with - - **method** (string): What stage we failed at (one of "connect", "openchannel\_init", "fundchannel\_start", "fundchannel\_complete") - - **error** (object): - - **code** (integer): JSON error code from failing stage - - **message** (string): Message from stage - - **data**: Additional error data - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -On failure, none of the channels are created. - -ERRORS ------- - -The following error codes may occur: - -* -1: Catchall nonspecific error. -- 300: The maximum allowed funding amount is exceeded. -- 301: There are not enough funds in the internal wallet (including fees) to create the transaction. -- 302: The output amount is too small, and would be considered dust. -- 303: Broadcasting of the funding transaction failed, the internal call to bitcoin-cli returned with an error. -- 313: The `min-emergency-msat` reserve not be preserved (and we have or are opening anchor channels). - -Failure may also occur if **lightningd** and the peer cannot agree on -channel parameters (funding limits, channel reserves, fees, etc.). -See lightning-fundchannel\_start(7) and lightning-fundchannel\_complete(7). - -There may be rare edge cases where a communications failure later in -the channel funding process will cancel the funding locally, but -the peer thinks the channel is already waiting for funding lockin. -In that case, the next time we connect to the peer, our node will -tell the peer to forget the channel, but some nodes (in particular, -Core Lightning nodes) will disconnect when our node tells them to -forget the channel. -If you immediately **multifundchannel** with that peer, it could -trigger this connect-forget-disconnect behavior, causing the -second **multifundchannel** to fail as well due to disconnection. -Doing a **connect** with the peers separately, and waiting for a -few seconds, should help clear this hurdle; -running **multifundchannel** a third time would also clear this. +The **multifundchannel** RPC command opens multiple payment channels with nodes by committing a single funding transaction to the blockchain that is shared by all channels. + +If not already connected, **multifundchannel** will automatically attempt to connect; you may provide a *@host:port* hint appended to the node ID so that Core Lightning can learn how to connect to the node; see lightning-connect(7). + +Once the transaction is confirmed, normal channel operations may begin. Readiness is indicated by **listpeers** reporting a *state* of `CHANNELD_NORMAL` for the channel. + +- **destinations** (array of objects): There must be at least one entry in *destinations*; it cannot be an empty array.: + - **id** (string): Node ID, with an optional *@host:port* appended to it in a manner understood by **connect**; see lightning-connect(7). Each entry in the *destinations* array must have a unique node *id*. If not already connected, **multifundchannel** will automatically attempt to connect to the node. + - **amount** (msat): Amount in satoshis taken from the internal wallet to fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). The string *all* can be used to specify all available funds (or 16,777,215 satoshi if more is available and large channels were not negotiated with the peer). Otherwise it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The value cannot be less than the dust limit, currently 546 satoshi as of this writing, nor more than 16,777,215 satoshi (unless large channels were negotiated with the peer). + - **announce** (boolean, optional): Flag that indicates whether to announce the channel with this. If set to `False`, the channel is unpublished. The default is `True`. + - **push\_msat** (msat, optional): Amount of millisatoshis to outright give to the node. This is a gift to the peer, and you do not get a proof-of-payment out of this. + - **close\_to** (string, optional): Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script` Returns `close_to` set to closing script iff is negotiated. + - **request\_amt** (msat, optional): Amount of liquidity you'd like to lease from peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact\_lease*. + - **compact\_lease** (string, optional): Compact representation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel to this destination. + - **mindepth** (u32, optional): Number of confirmations before we consider the channel active. + - **reserve** (msat, optional): Amount we want the peer to maintain on its side of the channel. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The default is 1% of the funding amount. +- **feerate** (feerate, optional): Feerate used for the opening transaction, and if *commitment\_feerate* is not set, as initial feerate for commitment and HTLC transactions. See NOTES in lightning-feerates(7) for possible values. The default is *normal*. +- **minconf** (integer, optional): Minimum number of confirmations that used outputs should have. The default is 1. +- **utxos** (array of outpoints, optional): + - (outpoint, optional): Utxos to be used to fund the channel, as an array of `txid:vout`. +- **minchannels** (integer, optional): Re-attempt funding as long as at least this many peers remain (must not be zero). The **multifundchannel** command will only fail if too many peers fail the funding process. +- **commitment\_feerate** (feerate, optional): Initial feerate for commitment and HTLC transactions. See *feerate* for valid values. EXAMPLE USAGE ------------- This example opens three channels at once, with amounts 200,000 sats, 3,000,000 sats and the final channel using all remaining funds (actually, capped at 16,777,215 sats because large-channels is not enabled): -``` +```shell $ lightning-cli multifundchannel '[{"id":"0201f42e167959c74d396ac57652fcea63c63940f78e8239cce5720df4d85ef857@127.0.0.1:7272", "amount":"200000sat"}, {"id":"0304a2468065535f9459567686e0f02b40f06e341d3eb2a62ec6763bcf2ccfd207@127.0.0.1:7373", "amount":"0.03btc"}, {"id":"0391f4c475050bb15871da5a72b1f3a1798de3d2e5fb4ffa262899b8d8e1f0b764@127.0.0.1:7474", "amount":"all"}]' { "tx": "02000000000101fbe3c68db87b72f82c3f5447b0bc032469c78e71f229ac99c230807ff378a9d80000000000fdffffff04400d0300000000002200202e9897ed5f9b237aa27fd5d02d24157cd452b0d3f0a5bb03d38ff73f9f8f384bffffff0000000000220020439d797ada249e1e12f8d27cabb7330de3c8de0456fb54892deb7b9c72b0ff7c1dc9b50400000000225120046e3966a2d5e43c1f1e0676161905782e1e7c00811485c618f5144f328f4e2bc0c62d0000000000220020e36fd5c03c3586c3763d8b4c9d8650f396ff1c8a460137fb09b60ee82536a3b20140ea4d564e91c919b50a2d32886f1d414de773491119beb1364b92f15d6d03e1810e5ddea89c265e42f2e96bb028dfb3aa0b5b30072ddcc78daad727503c53e37fa9010000", "txid": "90dc53922b70628fc9e7804ad0b8cd0fb41f050d94ffa2db3b16e918c96c022a", - "channel\_ids": [ + "channel_ids": [ { "id": "0201f42e167959c74d396ac57652fcea63c63940f78e8239cce5720df4d85ef857", - "channel\_id": "25c8253e66a860d17916cc0c21386e310eba9900030a68ec6ff6f59a8401a872", + "channel_id": "25c8253e66a860d17916cc0c21386e310eba9900030a68ec6ff6f59a8401a872", "outnum": 0 }, { "id": "0304a2468065535f9459567686e0f02b40f06e341d3eb2a62ec6763bcf2ccfd207", - "channel\_id": "51749d724892a406896f6bf2e2f8c0b03399d0436691f294839897fa167e6521", + "channel_id": "51749d724892a406896f6bf2e2f8c0b03399d0436691f294839897fa167e6521", "outnum": 3 }, { "id": "0391f4c475050bb15871da5a72b1f3a1798de3d2e5fb4ffa262899b8d8e1f0b764", - "channel\_id": "7e1414e72c081f0754fa18c1657cedabe696aa9ffeaf0b936bfbe3a28f2829d1", + "channel_id": "7e1414e72c081f0754fa18c1657cedabe696aa9ffeaf0b936bfbe3a28f2829d1", "outnum": 1 } ], @@ -120,6 +63,164 @@ $ lightning-cli multifundchannel '[{"id":"0201f42e167959c74d396ac57652fcea63c639 } ``` +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:multifundchannel#1", + "method": "multifundchannel", + "params": { + "destinations": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59@localhost:41939", + "amount": 50000 + } + ], + "feerate": "10000perkw", + "minconf": null, + "utxos": null, + "minchannels": null, + "commitment_feerate": "2000perkw" + } +} +{ + "id": "example:multifundchannel#2", + "method": "multifundchannel", + "params": { + "destinations": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59@localhost:44663", + "amount": 50000 + }, + { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d@localhost:34631", + "amount": 50000 + }, + { + "id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199@localhost:34617", + "amount": 50000 + } + ], + "feerate": null, + "minconf": null, + "utxos": null, + "minchannels": 1 + } +} +``` + +RETURN VALUE +------------ + +This command opens multiple channels with a single large transaction, thus only one transaction is returned. + +If *minchannels* was specified and is less than the number of destinations, then it is possible that one or more of the destinations do not have a channel even if **multifundchannel** succeeded. +On success, an object is returned, containing: + +- **tx** (hex): The raw transaction which funded the channel. +- **txid** (txid): The txid of the transaction which funded the channel. +- **channel\_ids** (array of objects): + - **id** (pubkey): The peer we opened the channel with. + - **outnum** (u32): The 0-based output index showing which output funded the channel. + - **channel\_id** (hash): The channel\_id of the resulting channel. + - **channel\_type** (object): Channel\_type as negotiated with peer. *(added v24.02)*: + - **bits** (array of u32s): Each bit set in this channel\_type. *(added v24.02)*: + - (u32, optional): Bit number. + - **names** (array of strings): Feature name for each bit set in this channel\_type. *(added v24.02)*: + - (string, optional) (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even"): Name of feature bit. + - **close\_to** (hex, optional): The raw scriptPubkey which mutual close will go to; only present if *close\_to* parameter was specified and peer supports `option_upfront_shutdown_script`. +- **failed** (array of objects, optional): Any peers we failed to open with (if *minchannels* was specified less than the number of destinations).: + - **id** (pubkey): The peer we failed to open the channel with. + - **method** (string) (one of "connect", "openchannel\_init", "fundchannel\_start", "fundchannel\_complete"): What stage we failed at. + - **error** (object): + - **code** (integer): JSON error code from failing stage. + - **message** (string): Message from stage. + - **data**: Additional error data. + +On failure, none of the channels are created. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "tx": "0200000000010100a8ceb6f76c49c8c0c809ca359461540708a9a5ac56e56e6a7aaafb35f4d3850000000000fdffffff0250c30000000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd0623ff030000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a02473044022064763837f2cc84507eb1fc28c9e95d51174e1da4b8755da8e67fe21e37d0a8b402206295d0f19625f014819361a20572b936d81f6c5ba419e56997e882f3a7be094a012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000", + "txid": "ecba36e93bcf40542d43a05ef550bb0e4be51d766aa2ec8c5640a0d431ab0d06", + "channel_ids": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "channel_id": "060dab31d4a040568ceca26a761de54b0ebb50f55ea0432d5440cf3be936baec", + "channel_type": { + "bits": [ + 12 + ], + "names": [ + "static_remotekey/even" + ] + }, + "outnum": 0 + } + ], + "failed": [] +} +{ + "tx": "020000000001023041611dac05004825ab64781b4a33bf622380bf90196fae689196b1850a1f8f0000000000fdffffff5646519c565466c9588a88400ec71a39a2c0b6988beadb32491a13d9b89f85360100000000fdffffff0250c3000000000000220020181492c29a989f099fd2cf412c74b192dd095e81f4e4f6bec45bd1fbfdd2cfd983720000000000002251203e8a03f678bb7ca048baecc39788530560ea049816d604f72925e425288446c80140caa3b93c6667e4fe0026417cc87ae9dfd16d80018e7c6dcd6dfcee4d6cab7c7e84181baeb95ba25934ad1aa6b57f83c8287bf1b727123350b35549a3abe15b060140b3c6626b9b57081cc7eb5e4f518669764d265fb84316d8fb610e19ede13c5a370c1072861b909ec923acec980adb4a3e488ee3c6f9c49164bd4596945b52f62678000000", + "txid": "1fcc6d46200443ad21e3a1a1628b862bafd0d75c0b4454f5494957097bc7930d", + "channel_ids": [ + { + "id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", + "channel_id": "0d93c77b09574949f554440b5cd7d0af2b868b62a1a1e321ad430420466dcc1f", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "outnum": 0 + } + ], + "failed": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "method": "connect", + "error": { + "code": 401, + "message": "All addresses failed: 127.0.0.1:44663: Connection establishment: Connection refused. " + } + }, + { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "method": "connect", + "error": { + "code": 401, + "message": "All addresses failed: 127.0.0.1:34631: Connection establishment: Connection refused. " + } + } + ] +} +``` + +ERRORS +------ + +The following error codes may occur: + +- -1: Catchall nonspecific error. +- 300: The maximum allowed funding amount is exceeded. +- 301: There are not enough funds in the internal wallet (including fees) to create the transaction. +- 302: The output amount is too small, and would be considered dust. +- 303: Broadcasting of the funding transaction failed, the internal call to bitcoin-cli returned with an error. +- 313: The `min-emergency-msat` reserve not be preserved (and we have or are opening anchor channels). + +Failure may also occur if **lightningd** and the peer cannot agree on channel parameters (funding limits, channel reserves, fees, etc.). See lightning-fundchannel\_start(7) and lightning-fundchannel\_complete(7). + +There may be rare edge cases where a communications failure later in the channel funding process will cancel the funding locally, but the peer thinks the channel is already waiting for funding lockin. In that case, the next time we connect to the peer, our node will tell the peer to forget the channel, but some nodes (in particular, Core Lightning nodes) will disconnect when our node tells them to forget the channel. If you immediately **multifundchannel** with that peer, it could trigger this connect-forget-disconnect behavior, causing the second **multifundchannel** to fail as well due to disconnection. Doing a **connect** with the peers separately, and waiting for a few seconds, should help clear this hurdle; running **multifundchannel** a third time would also clear this. + AUTHOR ------ @@ -128,12 +229,9 @@ ZmnSCPxj <> is mainly responsible. SEE ALSO -------- -lightning-connect(7), lightning-listfunds(), lightning-listpeers(7), -lightning-fundchannel(7) +lightning-connect(7), lightning-listfunds(), lightning-listpeers(7), lightning-fundchannel(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:eb35e768173dcc45cfd56c0847995fbc8ff9e182dbade3e11c192cf27b6bfcba) diff --git a/doc/lightning-multiwithdraw.7.md b/doc/lightning-multiwithdraw.7.md index 5bface5c4f26..5b32fb2d97b5 100644 --- a/doc/lightning-multiwithdraw.7.md +++ b/doc/lightning-multiwithdraw.7.md @@ -4,36 +4,107 @@ lightning-multiwithdraw -- Command for withdrawing to multiple addresses SYNOPSIS -------- -**multiwithdraw** *outputs* [*feerate*] [*minconf*] [*utxos*] +**multiwithdraw** *outputs* [*feerate*] [*minconf*] [*utxos*] DESCRIPTION ----------- -The **multiwithdraw** RPC command sends funds from Core Lightning's internal -wallet to the addresses specified in *outputs*. +The **multiwithdraw** RPC command sends funds from Core Lightning's internal wallet to the addresses specified in *outputs*. + +- **outputs** (array of outputdescs): An array containing objects of the form `{address: amount}`. The `amount` may be the string *all*, indicating that all onchain funds be sent to the specified address. Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*.: + - (outputdesc, optional) +- **feerate** (feerate, optional): Feerate used for the withdrawals. See NOTES in lightning-feerates(7) for possible values. The default is *normal*. +- **minconf** (u32, optional): Minimum number of confirmations that used outputs should have. The default is 1. +- **utxos** (array of outpoints, optional): + - (outpoint, optional): Utxos to be used to be withdrawn from, as an array of `txid:vout`. These must be drawn from the node's available UTXO set. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:multiwithdraw#1", + "method": "multiwithdraw", + "params": { + "outputs": [ + { + "bcrt1qyusnugshkn6kh5vmdjpe8hylvxlxjy3ns0hmrs": "2222000msat" + }, + { + "bcrt1q6r4vvt7uack33qf9n05umfxy8h5s2rdcmq7ra3": "3333000msat" + } + ], + "feerate": null, + "minconf": null, + "utxos": null + } +} +{ + "id": "example:multiwithdraw#2", + "method": "multiwithdraw", + "params": { + "outputs": [ + { + "BCRT1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KYGT080": 1000 + }, + { + "bcrt1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qzf4jry": 1000 + }, + { + "bcrt1pw508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7k0ylj56": 1000 + }, + { + "BCRT1SW50QT2UWHA": 1000 + }, + { + "bcrt1zw508d6qejxtdg4y5r3zarvaryv2wuatf": 1000 + }, + { + "bcrt1qqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvseswlauz7": 1000 + }, + { + "bcrt1pqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvsesyga46z": 1000 + }, + { + "bcrt1p0xlxvlhemja6c4dqv22uapctqupfhlxm9h8z3k2e72q4k9hcz7vqc8gma6": 1000 + } + ], + "feerate": null, + "minconf": null, + "utxos": null + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **tx** (hex): The raw transaction which was sent -- **txid** (txid): The txid of the **tx** +- **tx** (hex): The raw transaction which was sent. +- **txid** (txid): The txid of the **tx**. -[comment]: # (GENERATE-FROM-SCHEMA-END) +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "tx": "02000000000101b75863b811587b4c15bb94d9285c31d6369b8ff609e44de399936f8acb268f600000000000fdffffff03050d000000000000160014d0eac62fdcee2d1881259be9cda4c43de9050db8ae0800000000000016001427213e2217b4f56bd19b6c8393dc9f61be691233d4b5f5050000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a0247304402203a001463da125de5615ff1c18f9cd4a1d2a138c91d40189d350821ac8fb3ae4f02207a507eec27e15fe43476233cd9fe8b690ebd265073a58ed18ff79a1416886f18012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000", + "txid": "94e803b98257855569d35b675d65fb4fa0061a8b5f828992e2104a2882bb18bf" +} +{ + "tx": "02000000000101dc5a50dfbafc30697b930b44e763ff7a255475d17d975fa0e2003431312098cf0100000000fdffffff09e803000000000000225120000000c4a5cad46221b2a187905e5266362b99d5e91c6ce24d165dab93e86433e803000000000000046002751ee8030000000000002a5128751e76e8199196d454941c45d1b3a323f1433bd6751e76e8199196d454941c45d1b3a323f1433bd6e80300000000000022512079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f817983b939700000000002251200518e92cd94e0f62c06f126dff98b9abe79b7ed845a156d5245678e26554475de803000000000000160014751e76e8199196d454941c45d1b3a323f1433bd6e8030000000000002200201863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262e803000000000000125210751e76e8199196d454941c45d1b3a323e803000000000000220020000000c4a5cad46221b2a187905e5266362b99d5e91c6ce24d165dab93e8643301407f0d9bc098c5439ff611507b6a7d403047ed4e0b883f293db19d4e109d350a24f790acb55547384ff2a23fcfde0eba9af7cebc321c19cfc4817ecd47d50c2cd854000000", + "txid": "062383a7c9a19a2768939087a5c89826a4ea3531080f20cc06aa1cbf431be505" +} +``` ERRORS ------ -On failure, an error is reported and the withdrawal transaction is not -created. - -The following error codes may occur: +On failure, an error is reported and the withdrawal transaction is not created. - -1: Catchall nonspecific error. -- 301: There are not enough funds in the internal wallet (including -fees) to create the transaction. +- 301: There are not enough funds in the internal wallet (including fees) to create the transaction. - 302: The dust limit is not met. AUTHOR @@ -44,12 +115,9 @@ ZmnSCPxj <> is mainly responsible. SEE ALSO -------- -lightning-listfunds(7), lightning-fundchannel(7), lightning-newaddr(7), -lightning-txprepare(7), lightning-withdraw(7). +lightning-listfunds(7), lightning-fundchannel(7), lightning-newaddr(7), lightning-txprepare(7), lightning-withdraw(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:ba123ea4052af7850655f99ee85ed42c0254d7c15ba3861df0574fd58e4d8355) diff --git a/doc/lightning-newaddr.7.md b/doc/lightning-newaddr.7.md index ea0dd95644d7..e57d3be8d6f1 100644 --- a/doc/lightning-newaddr.7.md +++ b/doc/lightning-newaddr.7.md @@ -4,34 +4,63 @@ lightning-newaddr -- Command for generating a new address to be used by Core Lig SYNOPSIS -------- -**newaddr** [*addresstype*] +**newaddr** [*addresstype*] DESCRIPTION ----------- -The **newaddr** RPC command generates a new address which can -subsequently be used to fund channels managed by the Core Lightning node. +The **newaddr** RPC command generates a new address which can subsequently be used to fund channels managed by the Core Lightning node. The funding transaction needs to be confirmed before funds can be used. -To send an on-chain payment from the Core Lightning node wallet, use `withdraw`. +To send an on-chain payment from the Core Lightning node wallet, use `withdraw`. + +- **addresstype** (string, optional) (one of "bech32", "p2tr", "all"): It specifies the type of address wanted; currently *bech32* (e.g. `tb1qu9j4lg5f9rgjyfhvfd905vw46eg39czmktxqgg` on bitcoin testnet or `bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej` on bitcoin mainnet), or *p2tr* taproot addresses. The special value *all* generates all known address types for the same underlying key. The default is *bech32* address. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:newaddr#1", + "method": "newaddr", + "params": { + "addresstype": null + } +} +{ + "id": "example:newaddr#2", + "method": "newaddr", + "params": { + "addresstype": "bech32" + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **p2tr** (string, optional): The taproot address *(added v23.08)* -- **bech32** (string, optional): The bech32 (native segwit) address +- **p2tr** (string, optional): The taproot address. *(added v23.08)* +- **bech32** (string, optional): The bech32 (native segwit) address. -[comment]: # (GENERATE-FROM-SCHEMA-END) +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "bech32": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf" +} +{ + "bech32": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf" +} +``` ERRORS ------ -If an unrecognized address type is requested an error message will be -returned. +If an unrecognized address type is requested an error message will be returned. AUTHOR ------ @@ -47,5 +76,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:443545e42992626b55c87dd694b272aba58a2fd80e776edad95428e161f229a3) diff --git a/doc/lightning-notifications.7.md b/doc/lightning-notifications.7.md index 8a6455195d37..cdb3b4c4eb6a 100644 --- a/doc/lightning-notifications.7.md +++ b/doc/lightning-notifications.7.md @@ -1,63 +1,63 @@ lightning-notifications -- Command to set up notifications. -========================================= +=========================================================== SYNOPSIS -------- -**notifications** *enable* +**notifications** *enable* DESCRIPTION ----------- -The **notifications** the RPC command enabled notifications for this JSON-RPC -connection. By default (and for backwards-compatibility) notifications are -disabled. +The **notifications** the RPC command enabled notifications for this JSON-RPC connection. By default (and for backwards-compatibility) notifications are disabled. -Various commands, especially complex and slow ones, offer -notifications which indicate their progress. +Various commands, especially complex and slow ones, offer notifications which indicate their progress. + +- **enable** (boolean): Whether to enable or disable notifications. EXAMPLE JSON REQUEST -------------------- ```json { - "id": 82, + "id": "example:notifications#1", "method": "notifications", "params": { "enable": true } } +{ + "id": "example:notifications#2", + "method": "notifications", + "params": { + "enable": false + } +} ``` NOTIFICATIONS ------------- -Notifications are JSON-RPC objects without an *id* field. *lightningd* sends -notifications (once enabled with this *notifications* command) with a *params* -*id* field indicating which command the notification refers to. +Notifications are JSON-RPC objects without an *id* field. *lightningd* sends notifications (once enabled with this *notifications* command) with a *params* *id* field indicating which command the notification refers to. -Implementations should ignore notifications without an *id* parameter, or -unknown *method*. +Implementations should ignore notifications without an *id* parameter, or unknown *method*. Common *method*s include: - -- *message*: param *message*: a descriptional string indicating something - which occurred relating to the command. Param *level* indicates the level, - as per lightning-getlog(7): *info* and *debug* are typical. -- *progress*: param *num* and *total*, where *num* starts at 0 and is always - less than *total*. Optional param *stage* with fields *num* and *total*, - indicating what stage we are progressing through. + *message*: param *message*: a descriptional string indicating something which occurred relating to the command. Param *level* indicates the level, as per lightning-getlog(7): *info* and *debug* are typical. + *progress*: param *num* and *total*, where *num* starts at 0 and is always less than *total*. Optional param *stage* with fields *num* and *total*, indicating what stage we are progressing through. RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an empty object is returned. +On success, if *enable* was *true*, notifications will be forwarded from then on. -[comment]: # (GENERATE-FROM-SCHEMA-END) +EXAMPLE JSON RESPONSE +--------------------- -On success, if *enable* was *true*, notifications will be forwarded -from then on. +```json +{} +{} +``` ERRORS ------ @@ -71,27 +71,24 @@ EXAMPLE JSON NOTIFICATIONS ```json { - "method": "message", - "params": { - "id": 83, - "message": "This is a test message", - "level": "DEBUG" - } + "method": "message", + "params": { + "id": 1, + "message": "This is a test message", + "level": "DEBUG" + } } -``` - -```json { - "method": "progress", - "params": { - "id": 83, - "num": 0, - "total": 30 - "stage": { - "num": 0, - "total": 2 - } - } + "method": "progress", + "params": { + "id": 2, + "num": 0, + "total": 30, + "stage": { + "num": 0, + "total": 2 + } + } } ``` @@ -104,5 +101,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:b0793c2fa864b0ce3bc6f1618135f28ac551dfd1b8a0127caac73fd948e62d9d) diff --git a/doc/lightning-offer.7.md b/doc/lightning-offer.7.md index e5b6ed07b13b..f9a828a4b45e 100644 --- a/doc/lightning-offer.7.md +++ b/doc/lightning-offer.7.md @@ -6,118 +6,95 @@ SYNOPSIS **(WARNING: experimental-offers only)** -**offer** *amount* *description* [*issuer*] [*label*] [*quantity\_max*] [*absolute\_expiry*] [*recurrence*] [*recurrence\_base*] [*recurrence\_paywindow*] [*recurrence\_limit*] [*single\_use*] [*recurrence\_start\_any\ -_period*] +**offer** *amount* *description* [*issuer*] [*label*] [*quantity\_max*] [*absolute\_expiry*] [*recurrence*] [*recurrence\_base*] [*recurrence\_paywindow*] [*recurrence\_limit*] [*single\_use*] DESCRIPTION ----------- -The **offer** RPC command creates an offer (or returns an existing -one), which is a precursor to creating one or more invoices. It -automatically enables the processing of an incoming invoice\_request, -and issuing of invoices. - -Note that for making an offer to *pay* someone else, see lightning-invoicerequest(7). - -The *amount* parameter can be the string "any", which creates an offer -that can be paid with any amount (e.g. a donation). Otherwise it can -be a positive value in millisatoshi precision; it can be a whole -number, or a whole number ending in *msat* or *sat*, or a number with -three decimal places ending in *sat*, or a number with 1 to 11 decimal -places ending in *btc*. - -*amount* can also have an ISO 4217 postfix (i.e. USD), in which case -currency conversion will need to be done for the invoice itself. A -plugin is needed which provides the "currencyconvert" API for this -currency, otherwise the offer creation will fail. - -The *description* is a short description of purpose of the offer, -e.g. *coffee*. This value is encoded into the resulting offer and is -viewable by anyone you expose this offer to. It must be UTF-8, and -cannot use *\\u* JSON escape codes. - -The *issuer* is another (optional) field exposed in the offer, and -reflects who is issuing this offer (i.e. you) if appropriate. - -The *label* field is an internal-use name for the offer, which can -be any UTF-8 string. This is *NOT* encoded in the offer not sent -to the issuer. - -The presence of *quantity\_max* indicates that the -invoice can specify more than one of the items up (and including) -this maximum: 0 is a special value meaning "no maximuim". -The *amount* for the invoice will need to be multiplied -accordingly. This is encoded in the offer. - -The *absolute\_expiry* is optionally the time the offer is valid until, -in seconds since the first day of 1970 UTC. If not set, the offer -remains valid (though it can be deactivated by the issuer of course). -This is encoded in the offer. - -*recurrence* means that an invoice is expected at regular intervals. -The argument is a positive number followed by one of "seconds", -"minutes", "hours", "days", "weeks", "months" or "years" (variants -without the trailing "s" are also permitted). This is encoded in the -offer. The semantics of recurrence is fairly predictable, but fully -documented in BOLT 12. e.g. "4weeks". - -*recurrence\_base* is an optional time in seconds since the first day -of 1970 UTC. This indicates when the -first period begins; without this, the recurrence periods start from -the first invoice. - -*recurrence\_paywindow* is an optional argument of form -'-time+time[%]'. The first time is the number of seconds before the -start of a period in which an invoice and payment is valid, the second -time is the number of seconds after the start of the period. For -example *-604800+86400* means you can fetch an pay the invoice 4 weeks -before the given period starts, and up to 1 day afterwards. The -optional *%* indicates that the amount of the invoice will be scaled -by the time remaining in the period. If this is not specified, the -default is that payment is allowed during the current and previous -periods. This is encoded in the offer. - -*recurrence\_limit* is an optional argument to indicate the maximum -period which exists. eg. "12" means there are 13 periods, from 0 to -12 inclusive. This is encoded in the offer. - -*single\_use* (default false) indicates that the offer is only valid -once; we may issue multiple invoices, but as soon as one is paid all other -invoices will be expired (i.e. only one person can pay this offer). - -*recurrence\_start\_any\_period* (default true) means that the invoice must -start by paying during any period; otherwise it must start by paying -at the first period. Setting this to false only makes sense if -*recurrence\_base* was provided. This is encoded in the offer. +The **offer** RPC command creates an offer (or returns an existing one), which is a precursor to creating one or more invoices. It automatically enables the processing of an incoming invoice\_request, and issuing of invoices. + +Note that for making an offer to *pay* someone else, see lightning- invoicerequest(7). + +- **amount** (one of): Can be the string `any`, which creates an offer that can be paid with any amount (e.g. a donation). Otherwise it can be a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. It can also have an ISO 4217 postfix (e.g. USD), in which case currency conversion will need to be done for the invoice itself. A plugin is needed which provides the `currencyconvert` API for this currency, otherwise the offer creation will fail.: + - (msat\_or\_any) + - (currency) +- **description** (string): A short description of purpose of the offer, e.g. *coffee*. This value is encoded into the resulting offer and is viewable by anyone you expose this offer to. It must be UTF-8, and cannot use *\u* JSON escape codes. +- **issuer** (string, optional): Who is issuing this offer (i.e. you) if appropriate. +- **label** (string, optional): An internal-use name for the offer, which can be any UTF-8 string. This is *NOT* encoded in the offer not sent to the issuer. +- **quantity\_max** (u64, optional): Invoice can specify more than one of the items up (and including) this maximum: 0 is a special value meaning `no maximuim`. The *amount* for the invoice will need to be multiplied accordingly. This is encoded in the offer. +- **absolute\_expiry** (u64, optional): Time the offer is valid until,in seconds since the first day of 1970 UTC. If not set, the offer remains valid (though it can be deactivated by the issuer of course). This is encoded in the offer. +- **recurrence** (string, optional): An invoice is expected at regular intervals. The argument is a positive number followed by one of `seconds`, `minutes`, `hours`, `days`, `weeks`, `months` or `years` (variants without the trailing `s` are also permitted). This is encoded in the offer. The semantics of recurrence is fairly predictable, but fully documented in BOLT 12. e.g. `4weeks`. +- **recurrence\_base** (one of, optional): Time in seconds since the first day of 1970 UTC, optionally with a `@` prefix. This indicates when the first period begins; without this, the recurrence periods start from the first invoice. The `@` prefix means that the invoice must start by paying the first period; otherwise it is permitted to start at any period. This is encoded in the offer. e.g. `@1609459200` indicates you must start paying on the 1st January 2021.: + - (string) + - (integer) +- **recurrence\_paywindow** (string, optional): Argument of form `-time+time[%]`. The first time is the number of seconds before the start of a period in which an invoice and payment is valid, the second time is the number of seconds after the start of the period. For example *-604800+86400* means you can fetch an pay the invoice 4 weeks before the given period starts, and up to 1 day afterwards. The optional *%* indicates that the amount of the invoice will be scaled by the time remaining in the period. This is encoded in the offer. The default is that payment is allowed during the current and previous periods. +- **recurrence\_limit** (u32, optional): To indicate the maximum period which exists. eg. `12` means there are 13 periods, from 0 to 12 inclusive. This is encoded in the offer. +- **single\_use** (boolean, optional): Indicates that the offer is only valid once; we may issue multiple invoices, but as soon as one is paid all other invoices will be expired (i.e. only one person can pay this offer). The default is False. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:offer#1", + "method": "offer", + "params": { + "amount": "1msat", + "description": "test for 1msat" + } +} +{ + "id": "example:offer#2", + "method": "offer", + "params": { + "amount": "100000sat", + "description": "quantity_max test", + "recurrence": "1week" + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **offer\_id** (hash): the id of this offer (merkle hash of non-signature fields) -- **active** (boolean): whether this can still be used (always *true*) -- **single\_use** (boolean): whether this expires as soon as it's paid (reflects the *single\_use* parameter) -- **bolt12** (string): the bolt12 encoding of the offer -- **used** (boolean): True if an associated invoice has been paid -- **created** (boolean): false if the offer already existed -- **label** (string, optional): the (optional) user-specified label - -[comment]: # (GENERATE-FROM-SCHEMA-END) +- **offer\_id** (hash): The id of this offer (merkle hash of non-signature fields). +- **active** (boolean) (always *true*): Whether this can still be used. +- **single\_use** (boolean): Whether this expires as soon as it's paid (reflects the *single\_use* parameter). +- **bolt12** (string): The bolt12 encoding of the offer. +- **used** (boolean): True if an associated invoice has been paid. +- **created** (boolean): False if the offer already existed. +- **label** (string, optional): The (optional) user-specified label. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "offer_id": "f61cca153d1948dade19349792d9bcdc9cef687fd27db0b553a67979f55aae48", + "active": true, + "single_use": false, + "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqyqs5rn5v4ehggrxdaezqvtdwdshg93pqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq63s", + "used": false, + "created": true +} +{ + "offer_id": "f7a501e51e2a90d032150b9100b1977c625f05cfda22469bdc81d8a20b1e303f", + "active": true, + "single_use": false, + "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqszltcgqpgghzatpde6xjaretakkz7pqw3jhxaqkyypxdeze35wncs2l2u4gfzyrpds00e6yakfrt6ctrw5n9qanzhqr2xq6qgqsw", + "used": false, + "created": true +} +``` ERRORS ------ -On failure, an error is returned and no offer is created. If the -lightning process fails before responding, the caller should use -lightning-listoffers(7) to query whether this offer was created or -not. - -If the offer already existed, and is still active, that is returned; -if it's not active then this call fails. +On failure, an error is returned and no offer is created. If the lightning process fails before responding, the caller should use lightning-listoffers(7) to query whether this offer was created or not. -The following error codes may occur: +If the offer already existed, and is still active, that is returned; if it's not active then this call fails. - -1: Catchall nonspecific error. - 1000: Offer with this offer\_id already exists (but is not active). @@ -130,11 +107,9 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-listoffers(7), lightning-disableoffer(7), lightning-invoicerequest(7). +lightning-listoffers(7), lightning-disableoffer(7), lightning-invoicerequest(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:9938c16e54f86deabe03d86788600f87dffc54492ea4896d4f590916683afb0a) diff --git a/doc/lightning-openchannel_abort.7.md b/doc/lightning-openchannel_abort.7.md index cedb79dbef87..fd846296c227 100644 --- a/doc/lightning-openchannel_abort.7.md +++ b/doc/lightning-openchannel_abort.7.md @@ -1,35 +1,55 @@ lightning-openchannel\_abort -- Command to abort a channel to a peer -===================================================================== +==================================================================== SYNOPSIS -------- -**openchannel\_abort** *channel\_id* +**openchannel\_abort** *channel\_id* DESCRIPTION ----------- -`openchannel_init` is a low level RPC command which initiates a channel -open with a specified peer. It uses the openchannel protocol -which allows for interactive transaction construction. +`openchannel_init` is a low level RPC command which initiates a channel open with a specified peer. It uses the openchannel protocol which allows for interactive transaction construction. + +- **channel\_id** (hash): Channel id of the channel to be aborted. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:openchannel_abort#1", + "method": "openchannel_abort", + "params": { + "channel_id": "aec3dfd0c7643a23b679cd2e493c053f8fdf621ff2624949f9582c4118b818c6" + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **channel\_id** (hex): the channel id of the aborted channel (always 64 characters) -- **channel\_canceled** (boolean): whether this is completely canceled (there may be remaining in-flight transactions) -- **reason** (string): usually "Abort requested", but if it happened to fail at the same time it could be different +- **channel\_id** (hash): The channel id of the aborted channel. +- **channel\_canceled** (boolean): Whether this is completely canceled (there may be remaining in-flight transactions). +- **reason** (string): Usually "Abort requested", but if it happened to fail at the same time it could be different. + +EXAMPLE JSON RESPONSE +--------------------- -[comment]: # (GENERATE-FROM-SCHEMA-END) +```json +{ + "channel_id": "aec3dfd0c7643a23b679cd2e493c053f8fdf621ff2624949f9582c4118b818c6", + "channel_canceled": true, + "reason": "Abort requested" +} +``` ERRORS ------ -On error the returned object will contain `code` and `message` properties, -with `code` being one of the following: +On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -32602: If the given parameters are wrong. - -1: Catchall nonspecific error. @@ -37,23 +57,17 @@ with `code` being one of the following: - 311: Unknown channel id. - 312: Channel in an invalid state -SEE ALSO --------- - -lightning-openchannel\_init(7), lightning-openchannel\_update(7), -lightning-openchannel\_signed(7), lightning-openchannel\_bump(7), -lightning-fundchannel\_start(7), lightning-fundchannel\_complete(7), -lightning-fundchannel(7), lightning-fundpsbt(7), lightning-utxopsbt(7), -lightning-multifundchannel(7) - AUTHOR ------ -@niftynei <> is mainly responsible. +Lisa Neigut <> is mainly responsible. + +SEE ALSO +-------- + +lightning-openchannel\_init(7), lightning-openchannel\_update(7), lightning-openchannel\_signed(7), lightning-openchannel\_bump(7), lightning-fundchannel\_start(7), lightning-fundchannel\_complete(7), lightning-fundchannel(7), lightning-fundpsbt(7), lightning-utxopsbt(7), lightning-multifundchannel(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:59ff1f15b6e89bdaaaef184267e8d6ab5c8c0b0ce04b003375de758dc0c345f3) diff --git a/doc/lightning-openchannel_bump.7.md b/doc/lightning-openchannel_bump.7.md index 88a4eea73018..2f24777b81fe 100644 --- a/doc/lightning-openchannel_bump.7.md +++ b/doc/lightning-openchannel_bump.7.md @@ -1,50 +1,47 @@ lightning-openchannel\_bump -- Command to initiate a channel RBF -===================================================================== +================================================================ SYNOPSIS -------- -**openchannel\_bump** *channel\_id* *amount* *initalpsbt* [*funding\_feerate*] +**openchannel\_bump** *channel\_id* *amount* *initialpsbt* [*funding\_feerate*] DESCRIPTION ----------- -`openchannel_bump` is a RPC command which initiates a channel -RBF (Replace-By-Fee) for the specified channel. It uses the openchannel protocol -which allows for interactive transaction construction. +`openchannel_bump` is a RPC command which initiates a channel RBF (Replace-By-Fee) for the specified channel. It uses the openchannel protocol which allows for interactive transaction construction. Warning: bumping a leased channel will lose the lease. +- **channel\_id** (hash): Id of the channel to RBF. +- **amount** (sat): Satoshi value that we will contribute to the channel. This value will be \_added\_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel. +- **initialpsbt** (string): The funded, incomplete PSBT that specifies the UTXOs and change output for our channel contribution. It can be updated, see `openchannel_update`; *initialpsbt* must have at least one input. Must have the Non-Witness UTXO (PSBT\_IN\_NON\_WITNESS\_UTXO) set for every input. An error (code 309) will be returned if this requirement is not met. +- **funding\_feerate** (feerate, optional): Feerate for the funding transaction. The default is 1/64th greater than the last feerate used for this channel. + RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **channel\_id** (hex): the channel id of the channel (always 64 characters) -- **channel\_type** (object): channel\_type as negotiated with peer *(added v24.02)*: - - **bits** (array of u32s): Each bit set in this channel\_type *(added v24.02)*: - - Bit number - - **names** (array of strings): Feature name for each bit set in this channel\_type *(added v24.02)*: - - Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even") -- **psbt** (string): the (incomplete) PSBT of the RBF transaction -- **commitments\_secured** (boolean): whether the *psbt* is complete (always *false*) -- **funding\_serial** (u64): the serial\_id of the funding output in the *psbt* +- **channel\_id** (hash): The channel id of the channel. +- **channel\_type** (object): Channel\_type as negotiated with peer. *(added v24.02)*: + - **bits** (array of u32s): Each bit set in this channel\_type. *(added v24.02)*: + - (u32, optional): Bit number. + - **names** (array of strings): Feature name for each bit set in this channel\_type. *(added v24.02)*: + - (string, optional) (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even"): Name of feature bit. +- **psbt** (string): The (incomplete) PSBT of the RBF transaction. +- **commitments\_secured** (boolean) (always *false*): Whether the *psbt* is complete. +- **funding\_serial** (u64): The serial\_id of the funding output in the *psbt*. - **requires\_confirmed\_inputs** (boolean, optional): Does peer require confirmed inputs in psbt? -[comment]: # (GENERATE-FROM-SCHEMA-END) - -If the peer does not support `option_dual_fund`, this command -will return an error. +If the peer does not support `option_dual_fund`, this command will return an error. -If the channel is not in a state that is eligible for RBF, this command -will return an error. +If the channel is not in a state that is eligible for RBF, this command will return an error. ERRORS ------ -On error the returned object will contain `code` and `message` properties, -with `code` being one of the following: +On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -32602: If the given parameters are wrong. - -1: Catchall nonspecific error. @@ -55,23 +52,17 @@ with `code` being one of the following: - 311: Unknown channel id. - 312: Channel in an invalid state -SEE ALSO --------- - -lightning-openchannel\_init(7), lightning-openchannel\_update(7), -lightning-openchannel\_signed(7), lightning-openchannel\_abort(7), -lightning-fundchannel\_start(7), lightning-fundchannel\_complete(7), -lightning-fundchannel(7), lightning-fundpsbt(7), lightning-utxopsbt(7), -lightning-multifundchannel(7) - AUTHOR ------ -@niftynei <> is mainly responsible. +Lisa Neigut <> is mainly responsible. + +SEE ALSO +-------- + +lightning-openchannel\_init(7), lightning-openchannel\_update(7), lightning-openchannel\_signed(7), lightning-openchannel\_abort(7), lightning-fundchannel\_start(7), lightning-fundchannel\_complete(7), lightning-fundchannel(7), lightning-fundpsbt(7), lightning-utxopsbt(7), lightning-multifundchannel(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:98faf34f08ec57a266c82dfdb876f35d08187a16c1b6d53fedaa12570144a64f) diff --git a/doc/lightning-openchannel_init.7.md b/doc/lightning-openchannel_init.7.md index 1654dc0308e0..8403cb09a175 100644 --- a/doc/lightning-openchannel_init.7.md +++ b/doc/lightning-openchannel_init.7.md @@ -1,53 +1,131 @@ lightning-openchannel\_init -- Command to initiate a channel to a peer -===================================================================== +====================================================================== SYNOPSIS -------- -**openchannel\_init** *id* *amount* *initalpsbt* [*commitment\_feerate*] [*funding\_feerate*] [*announce*] [*close\_to*] [*request\_amt*] [*compact\_lease*] [*channel\_type*] +**openchannel\_init** *id* *amount* *initialpsbt* [*commitment\_feerate*] [*funding\_feerate*] [*announce*] [*close\_to*] [*request\_amt*] [*compact\_lease*] [*channel\_type*] DESCRIPTION ----------- -`openchannel_init` is a low level RPC command which initiates a channel -open with a specified peer. It uses the openchannel protocol -which allows for interactive transaction construction. +`openchannel_init` is a low level RPC command which initiates a channel open with a specified peer. It uses the openchannel protocol which allows for interactive transaction construction. + +- **id** (pubkey): Node id of the remote peer. +- **amount** (sat): Satoshi value that we will contribute to the channel. This value will be \_added\_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel. +- **initialpsbt** (string): Funded, incomplete PSBT that specifies the UTXOs and change output for our channel contribution. It can be updated, see `openchannel_update`; *initialpsbt* must have at least one input. Must have the Non-Witness UTXO (PSBT\_IN\_NON\_WITNESS\_UTXO) set for every input. An error (code 309) will be returned if this requirement is not met. +- **commitment\_feerate** (feerate, optional): Feerate for commitment transactions for non-anchor channels: see **fundchannel**. For anchor channels, it is ignored. +- **funding\_feerate** (feerate, optional): Feerate for the funding transaction. The default is 'opening' feerate. +- **announce** (boolean, optional): Whether or not to announce this channel. +- **close\_to** (string, optional): Bitcoin address to which the channel funds should be sent on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. +- **request\_amt** (msat, optional): An amount of liquidity you'd like to lease from the peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact\_lease*. +- **compact\_lease** (hex, optional): A compact representation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel. +- **channel\_type** (array of u32s, optional): Each bit set in this channel\_type.: + - (u32, optional): Bit number. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:openchannel_init#1", + "method": "openchannel_init", + "params": { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount": 999000, + "initialpsbt": "cHNidP8BADMCAAAAAYbThUhSzYr7ph6Z434bdcW7eoirYOFMmUt2GXZ79sF/AQAAAAD9////AGYAAAAAAQDeAgAAAAABARVD4QKlmwy8SNcNypf1o9TzbIFZjj4dqVzHAL0SLDoTAAAAAAD9////AjOv9ikBAAAAFgAUXJGglH7At5HOVY4ZHp0+19kv655AQg8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgVIxRXqIykOOxm/6YPaFFx2Qh1618qlXPUhDiliVQ2KUCIHQcHniUTcm1XT8SyRE8ev52jm0uiIYum15XcR/tPh+NASEC3Pby7xL4+Ig/Z8TchQ0QT1upLGet3da8qjSjgHO9LOJlAAAAAQEfQEIPAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=", + "commitment_feerate": null, + "funding_feerate": null, + "announce": true, + "close_to": null, + "request_amt": null, + "channel_type": [ + 12, + 22 + ] + } +} +{ + "id": "example:openchannel_init#2", + "method": "openchannel_init", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount": 16777216, + "initialpsbt": "cHNidP8BADMCAAAAAQVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAAAAAAD9////AGYAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=", + "commitment_feerate": null, + "funding_feerate": null, + "announce": true, + "close_to": null, + "request_amt": null, + "channel_type": null + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **channel\_id** (hex): the channel id of the channel (always 64 characters) -- **psbt** (string): the (incomplete) PSBT of the funding transaction -- **channel\_type** (object): channel\_type as negotiated with peer *(added v24.02)*: - - **bits** (array of u32s): Each bit set in this channel\_type *(added v24.02)*: - - Bit number - - **names** (array of strings): Feature name for each bit set in this channel\_type *(added v24.02)*: - - Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even") -- **commitments\_secured** (boolean): whether the *psbt* is complete (always *false*) -- **funding\_serial** (u64): the serial\_id of the funding output in the *psbt* +- **channel\_id** (hash): The channel id of the channel. +- **psbt** (string): The (incomplete) PSBT of the funding transaction. +- **channel\_type** (object): Channel\_type as negotiated with peer. *(added v24.02)*: + - **bits** (array of u32s): Each bit set in this channel\_type. *(added v24.02)*: + - (u32, optional): Bit number. + - **names** (array of strings): Feature name for each bit set in this channel\_type. *(added v24.02)*: + - (string, optional) (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even"): Name of feature bit. +- **commitments\_secured** (boolean) (always *false*): Whether the *psbt* is complete. +- **funding\_serial** (u64): The serial\_id of the funding output in the *psbt*. - **requires\_confirmed\_inputs** (boolean, optional): Does peer require confirmed inputs in psbt? -[comment]: # (GENERATE-FROM-SCHEMA-END) - -If the peer does not support `option_dual_fund`, this command -will return an error. - -If you sent a *request\_amt* and the peer supports `option_will_fund` and is -interested in leasing you liquidity in this channel, returns their updated -channel fee max (*channel\_fee\_proportional\_basis*, *channel\_fee\_base\_msat*), -updated rate card for the lease fee (*lease\_fee\_proportional\_basis*, -*lease\_fee\_base\_sat*) and their on-chain weight *weight\_charge*, which will -be added to the lease fee at a rate of *funding\_feerate* * *weight\_charge* -/ 1000. +If the peer does not support `option_dual_fund`, this command will return an error. + +If you sent a *request\_amt* and the peer supports `option_will_fund` and is interested in leasing you liquidity in this channel, returns their updated channel fee max (*channel\_fee\_proportional\_basis*, *channel\_fee\_base\_msat*), updated rate card for the lease fee (*lease\_fee\_proportional\_basis*, *lease\_fee\_base\_sat*) and their on-chain weight *weight\_charge*, which will be added to the lease fee at a rate of *funding\_feerate* * *weight\_charge* / 1000. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "channel_id": "53fa2b1ca0d8f21abeaaac0495ab9925cdfaf2ca8b04dbe4aeb061823e1ff2c8", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABARVD4QKlmwy8SNcNypf1o9TzbIFZjj4dqVzHAL0SLDoTAAAAAAD9////AjOv9ikBAAAAFgAUXJGglH7At5HOVY4ZHp0+19kv655AQg8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgVIxRXqIykOOxm/6YPaFFx2Qh1618qlXPUhDiliVQ2KUCIHQcHniUTcm1XT8SyRE8ev52jm0uiIYum15XcR/tPh+NASEC3Pby7xL4+Ig/Z8TchQ0QT1upLGet3da8qjSjgHO9LOJlAAAAAQEfQEIPAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIIbThUhSzYr7ph6Z434bdcW7eoirYOFMmUt2GXZ79sF/AQ8EAQAAAAEQBP3///8M/AlsaWdodG5pbmcBCMCDK/6LyRi8AAEDCFg+DwAAAAAAAQQiACDYM+8ZRsbTj0OCG/yzqLt2buFQn9LuMPDZqFFcgmCmfAz8CWxpZ2h0bmluZwEIchtFHfZ5FBgA", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "commitments_secured": false, + "funding_serial": 8222241539686471000, + "requires_confirmed_inputs": false +} +{ + "channel_id": "252d1b0a1e57895e84137f28cf19ab2c35847e284c112fefdecc7afeaa5c1de7", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCLR8RjOq9lmcAAEDCAAAAAEAAAAAAQQiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQz8CWxpZ2h0bmluZwEIZZtc7LD4y9YA", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "commitments_secured": false, + "funding_serial": 7321547790872006000, + "requires_confirmed_inputs": false +} +``` ERRORS ------ -On error the returned object will contain `code` and `message` properties, -with `code` being one of the following: +On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -32602: If the given parameters are wrong. - -1: Catchall nonspecific error. @@ -60,23 +138,17 @@ with `code` being one of the following: - 310: v2 channel open protocol not supported by peer - 312: Channel in an invalid state -SEE ALSO --------- - -lightning-openchannel\_update(7), lightning-openchannel\_signed(7), -lightning-openchannel\_abort(7), lightning-openchannel\_bump(7), -lightning-fundchannel\_start(7), -lightning-fundchannel\_complete(7), lightning-fundchannel(7), -lightning-fundpsbt(7), lightning-utxopsbt(7), lightning-multifundchannel(7) - AUTHOR ------ -@niftynei <> is mainly responsible. +Lisa Neigut <> is mainly responsible. + +SEE ALSO +-------- + +lightning-openchannel\_update(7), lightning-openchannel\_signed(7), lightning-openchannel\_abort(7), lightning-openchannel\_bump(7), lightning-fundchannel\_start(7), lightning-fundchannel\_complete(7), lightning-fundchannel(7), lightning-fundpsbt(7), lightning-utxopsbt(7), lightning-multifundchannel(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:2815e0b486c5346d0d058a7670b7e34f55b7ce0f5d35861dd76316e42b7b589d) diff --git a/doc/lightning-openchannel_signed.7.md b/doc/lightning-openchannel_signed.7.md index dfc6e72258d3..abb3b90f5510 100644 --- a/doc/lightning-openchannel_signed.7.md +++ b/doc/lightning-openchannel_signed.7.md @@ -4,38 +4,33 @@ lightning-openchannel\_signed -- Command to conclude a channel open SYNOPSIS -------- -**openchannel\_signed** *channel\_id* *signed\_psbt* +**openchannel\_signed** *channel\_id* *signed\_psbt* DESCRIPTION ----------- -`openchannel_signed` is a low level RPC command which concludes a channel -open with the specified peer. It uses the v2 openchannel protocol, which -allows for interactive transaction construction. +`openchannel_signed` is a low level RPC command which concludes a channel open with the specified peer. It uses the v2 openchannel protocol, which allows for interactive transaction construction. -This command should be called after `openchannel_update` returns -*commitments\_secured* `true`. +This command should be called after `openchannel_update` returns *commitments\_secured* `true`. -This command will broadcast the finalized funding transaction, -if we receive valid signatures from the peer. +This command will broadcast the finalized funding transaction, if we receive valid signatures from the peer. + +- **channel\_id** (hash): Id of the channel. +- **signed\_psbt** (string): The PSBT returned from `openchannel_update` (where *commitments\_secured* was true) with partial signatures or finalized witness stacks included for every input that we contributed to the PSBT. RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **channel\_id** (hex): the channel id of the channel (always 64 characters) -- **tx** (hex): the funding transaction -- **txid** (txid): The txid of the **tx** - -[comment]: # (GENERATE-FROM-SCHEMA-END) +- **channel\_id** (hash): The channel id of the channel. +- **tx** (hex): The funding transaction. +- **txid** (txid): The txid of the **tx**. ERRORS ------ -On error, the returned object will contain `code` and `message` properties, -with `code` being one of the following: +On error, the returned object will contain `code` and `message` properties, with `code` being one of the following: - -32602: If the given parameters are wrong. - -1: Catchall nonspecific error. @@ -45,23 +40,17 @@ with `code` being one of the following: - 311: Unknown channel id. - 312: Channel in an invalid state -SEE ALSO --------- - -lightning-openchannel\_init(7), lightning-openchannel\_update(7), -lightning-openchannel\_abort(7), lightning-openchannel\_bump(7), -lightning-fundchannel\_start(7), lightning-fundchannel\_complete(7), -lightning-fundchannel(7), lightning-fundpsbt(7), -lightning-utxopsbt(7), lightning-multifundchannel(7) - AUTHOR ------ -@niftynei <> is mainly responsible. +Lisa Neigut <> is mainly responsible. + +SEE ALSO +-------- + +lightning-openchannel\_init(7), lightning-openchannel\_update(7), lightning-openchannel\_abort(7), lightning-openchannel\_bump(7), lightning-fundchannel\_start(7), lightning-fundchannel\_complete(7), lightning-fundchannel(7), lightning-fundpsbt(7), lightning-utxopsbt(7), lightning-multifundchannel(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:80378065a1b5cf6db0e6a677a1b4f63e9ddeb54268b31bd278349513be943164) diff --git a/doc/lightning-openchannel_update.7.md b/doc/lightning-openchannel_update.7.md index 92af793972d9..3f951c2df4a2 100644 --- a/doc/lightning-openchannel_update.7.md +++ b/doc/lightning-openchannel_update.7.md @@ -4,50 +4,102 @@ lightning-openchannel\_update -- Command to update a collab channel open SYNOPSIS -------- -**openchannel\_update** *channel\_id* *psbt* +**openchannel\_update** *channel\_id* *psbt* DESCRIPTION ----------- -`openchannel_update` is a low level RPC command which continues an open -channel, as specified by *channel\_id*. An updated *psbt* is passed in; any -changes from the PSBT last returned (either from `openchannel_init` or -a previous call to `openchannel_update`) will be communicated to the peer. +`openchannel_update` is a low level RPC command which continues an open channel, as specified by *channel\_id*. An updated *psbt* is passed in; any changes from the PSBT last returned (either from `openchannel_init` or a previous call to `openchannel_update`) will be communicated to the peer. Must be called after `openchannel_init` and before `openchannel_signed`. -Must be called until *commitments\_secured* is returned as true, at which point -`openchannel_signed` should be called with a signed version of the PSBT -returned by the last call to `openchannel_update`. - +Must be called until *commitments\_secured* is returned as true, at which point `openchannel_signed` should be called with a signed version of the PSBT returned by the last call to `openchannel_update`. + +- **channel\_id** (hash): Id of the channel. +- **psbt** (string): Updated PSBT to be sent to the peer. May be identical to the PSBT last returned by either `openchannel_init` or `openchannel_update`. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:openchannel_update#1", + "method": "openchannel_update", + "params": { + "channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA" + } +} +{ + "id": "example:openchannel_update#2", + "method": "openchannel_update", + "params": { + "channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA" + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **channel\_id** (hex): the channel id of the channel (always 64 characters) -- **channel\_type** (object): channel\_type as negotiated with peer *(added v24.02)*: - - **bits** (array of u32s): Each bit set in this channel\_type *(added v24.02)*: - - Bit number - - **names** (array of strings): Feature name for each bit set in this channel\_type *(added v24.02)*: - - Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even") -- **psbt** (string): the PSBT of the funding transaction -- **commitments\_secured** (boolean): whether the *psbt* is complete (if true, sign *psbt* and call `openchannel_signed` to complete the channel open) -- **funding\_outnum** (u32): The index of the funding output in the psbt -- **close\_to** (hex, optional): scriptPubkey which we have to close to if we mutual close +- **channel\_id** (hash): The channel id of the channel. +- **channel\_type** (object): Channel\_type as negotiated with peer. *(added v24.02)*: + - **bits** (array of u32s): Each bit set in this channel\_type. *(added v24.02)*: + - (u32, optional): Bit number. + - **names** (array of strings): Feature name for each bit set in this channel\_type. *(added v24.02)*: + - (string, optional) (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even"): Name of feature bit. +- **psbt** (string): The PSBT of the funding transaction. +- **commitments\_secured** (boolean): Whether the *psbt* is complete (if true, sign *psbt* and call `openchannel_signed` to complete the channel open). +- **funding\_outnum** (u32): The index of the funding output in the psbt. +- **close\_to** (hex, optional): Scriptpubkey which we have to close to if we mutual close. - **requires\_confirmed\_inputs** (boolean, optional): Does peer require confirmed inputs in psbt? -[comment]: # (GENERATE-FROM-SCHEMA-END) - -If *commitments\_secured* is true, will also return: - -- The derived *channel\_id*. -- A *close\_to* script, iff a `close_to` address was provided to - `openchannel_init` and the peer supports `option_upfront_shutdownscript`. -- The *funding\_outnum*, the index of the funding output for this channel - in the funding transaction. +If **commitments\_secured** is *true*: + - **channel\_id** (hash): The derived channel id. + - **funding\_outnum** (u32): The index of the funding output for this channel in the funding transaction. + - **close\_to** (hex, optional): If a `close_to` address was provided to `openchannel_init` and the peer supports `option_upfront_shutdownscript`. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "commitments_secured": true, + "funding_outnum": 0 +} +{ + "channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "commitments_secured": true, + "funding_outnum": 0, + "close_to": "5120eed745804da9784cc203f563efa99ffa54fdf01b137bc964e63c3124070ffbe6" +} +``` ERRORS ------ @@ -62,23 +114,17 @@ with `code` being one of the following: - 311: Unknown channel id. - 312: Channel in an invalid state -SEE ALSO --------- - -lightning-openchannel\_init(7), lightning-openchannel\_signed(7), -lightning-openchannel\_bump(7), lightning-openchannel\_abort(7), -lightning-fundchannel\_start(7), lightning-fundchannel\_complete(7), -lightning-fundchannel(7), lightning-fundpsbt(7), lightning-utxopsbt(7), -lightning-multifundchannel(7) - AUTHOR ------ -@niftynei <> is mainly responsible. +Lisa Neigut <> is mainly responsible. + +SEE ALSO +-------- + +lightning-openchannel\_init(7), lightning-openchannel\_signed(7), lightning-openchannel\_bump(7), lightning-openchannel\_abort(7), lightning-fundchannel\_start(7), lightning-fundchannel\_complete(7), lightning-fundchannel(7), lightning-fundpsbt(7), lightning-utxopsbt(7), lightning-multifundchannel(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:13df70a54c29a3ac4b8f44a0d2f4cdc47928417b7c810bc19ec35fe820558730) diff --git a/doc/lightning-parsefeerate.7.md b/doc/lightning-parsefeerate.7.md index e27cdda658e9..edd871516abb 100644 --- a/doc/lightning-parsefeerate.7.md +++ b/doc/lightning-parsefeerate.7.md @@ -4,44 +4,87 @@ lightning-parsefeerate -- Command for parsing a feerate string to a feerate SYNOPSIS -------- -**parsefeerate** *feerate\_str* +**parsefeerate** *feerate\_str* DESCRIPTION ----------- -The **parsefeerate** command returns the current feerate for any valid -*feerate\_str*. This is useful for finding the current feerate that a -**fundpsbt** or **utxopsbt** command might use. +The **parsefeerate** command returns the current feerate for any valid *feerate\_str*. This is useful for finding the current feerate that a **fundpsbt** or **utxopsbt** command might use. + +- **feerate\_str** (string): The feerate string to parse. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:parsefeerate#1", + "method": "parsefeerate", + "params": [ + "unilateral_close" + ] +} +{ + "id": "example:parsefeerate#2", + "method": "parsefeerate", + "params": [ + "9999perkw" + ] +} +{ + "id": "example:parsefeerate#3", + "method": "parsefeerate", + "params": [ + 10000 + ] +} +{ + "id": "example:parsefeerate#4", + "method": "parsefeerate", + "params": [ + "urgent" + ] +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **perkw** (u32, optional): Value of *feerate\_str* in kilosipa - -[comment]: # (GENERATE-FROM-SCHEMA-END) +- **perkw** (u32, optional): Value of *feerate\_str* in kilosipa. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "perkw": 11000 +} +{ + "perkw": 9999 +} +{ + "perkw": 2500 +} +{ + "perkw": 11000 +} +``` ERRORS ------ -The **parsefeerate** command will error if the *feerate\_str* format is -not recognized. +The **parsefeerate** command will error if the *feerate\_str* format is not recognized. - -32602: If the given parameters are wrong. TRIVIA ------ -In CLN we like to call the weight unit "sipa" -in honor of Pieter Wuille, -who uses the name "sipa" on IRC and elsewhere. -Internally we call the *perkw* style as "feerate per kilosipa". +In CLN we like to call the weight unit "sipa" in honor of Pieter Wuille, who uses the name "sipa" on IRC and elsewhere. Internally we call the *perkw* style as "feerate per kilosipa". RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:01ed00df0f944625c827aa538c173e988a7ba7cebbddb16f5a392206a296fbd3) diff --git a/doc/lightning-pay.7.md b/doc/lightning-pay.7.md index 44d629d0c6a1..4d49e10fb8cc 100644 --- a/doc/lightning-pay.7.md +++ b/doc/lightning-pay.7.md @@ -4,70 +4,106 @@ lightning-pay -- Command for sending a payment to a BOLT11 invoice SYNOPSIS -------- -**pay** *bolt11* [*amount\_msat*] [*label*] [*riskfactor*] -[*maxfeepercent*] [*retry\_for*] [*maxdelay*] [*exemptfee*] -[*localinvreqid*] [*exclude*] [*maxfee*] [*description*] +**pay** *bolt11* [*amount\_msat*] [*label*] [*riskfactor*] [*maxfeepercent*] [*retry\_for*] [*maxdelay*] [*exemptfee*] [*localinvreqid*] [*exclude*] [*maxfee*] [*description*] DESCRIPTION ----------- -The **pay** RPC command attempts to find a route to the given -destination, and send the funds it asks for. - -The response will occur when the payment fails or succeeds. Once a -payment has succeeded, calls to **pay** with the same *bolt11* will -succeed immediately. - -When using *lightning-cli*, you may skip optional parameters by using -*null*. Alternatively, use **-k** option to provide parameters by name. +The **pay** RPC command attempts to find a route to the given destination, and send the funds it asks for. . + +The response will occur when the payment fails or succeeds. Once a payment has succeeded, calls to **pay** with the same *bolt11* will succeed immediately. + +When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name. + +- **bolt11** (string): Bolt11 invoice, if **experimental-offers** is enabled, it can actually be a bolt12 invoice, such as one received from lightningd-fetchinvoice(7). If it does not contain an amount, *amount\_msat* is required, otherwise if it is specified it must be *null*. +- **amount\_msat** (msat, optional): *amount\_msat* is in millisatoshi precision; it can be a whole number, or a whole number with suffix *msat* or *sat*, or a three decimal point number with suffix *sat*, or an 1 to 11 decimal point number suffixed by *btc*. +- **label** (string, optional): It is used to attach a label to payments, and is returned in lightning- listpays(7) and lightning-listsendpays(7). +- **riskfactor** (number, optional): The *riskfactor* is described in detail in lightning-getroute(7). The default is 10. +- **maxfeepercent** (number, optional): Percentage of the amount that is to be paid. The default is 0.5. +- **retry\_for** (u16, optional): Until *retry\_for* seconds passes, the command will keep finding routes and retrying the payment. The default is 60 seconds. +- **maxdelay** (u16, optional): A payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case. +- **exemptfee** (msat, optional): This option can be used for tiny payments which would be dominated by the fee leveraged by forwarding nodes. Setting `exemptfee` allows the `maxfeepercent` check to be skipped on fees that are smaller than `exemptfee`. The default is 5000 millisatoshi. +- **localinvreqid** (hex, optional): `localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7). This ensures that we only make a single payment for an offer, and that the offer is marked `used` once paid. +- **exclude** (array, optional): *exclude* is a JSON array of short-channel-id/direction (e.g. [ '564334x877x1/0', '564195x1292x0/1' ]) or pubkey which should be excluded from consideration for routing. The default is not to exclude any channels or nodes.: + - (short\_channel\_id\_dir) + - (pubkey) +- **maxfee** (msat, optional): *maxfee* overrides both *maxfeepercent* and *exemptfee* defaults (and if you specify *maxfee* you cannot specify either of those), and creates an absolute limit on what fee we will pay. This allows you to implement your own heuristics rather than the primitive ones used here. +- **description** (string, optional): It is only required for bolt11 invoices which do not contain a description themselves, but contain a description hash: in this case *description* is required. *description* is then checked against the hash inside the invoice before it will be paid. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:pay#1", + "method": "pay", + "params": { + "bolt11": "lni1qqgxr7gha7gusyg83lsr8qcqg4axgq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqtypg3hgetnwsszycn0d36rzv3zypjx2umrwf5hqarfdahzcg8sn7jmpuyl423pvggzvmj9nrga83q474e2sjygxzmq7ln5fmvjxh4skxafx2pmx9wqx5v9qgqxyfhyvyg6pdvu4tcjvpp7kkal9rp57wj7xv4pl3ajku70rzy3pavzzqjz06c8s2vvmrpjlkcse0txx0gmc6jalqqxmeyjm75qcnfnqxwyt2sfsqnxu3vc68fug904w25y3zpskc8huazwmy34av93h2fjswe3tsp4rqpe8qlx9xssexfc0aguke3q6u0jgw2qmn008mzu04mkmqmjmhes3gcpqdqdnzl270s48vsp635rd4jm04snvgkcp65qlkgp8qztu2mdp7c5uqpj2rll3pzu56st537rct3v62gfqeamzthjuwkr0pkvsdnnffpn4sq9sz0lryaufktx0nfxlffum3yesqev5gwqqqqqqqqqqqqqqqzsqqqqqqqqqqqqr5jt9hav2gqqqqqq5szxtvwkyz5zq2000hlwvadejz366lqjt9sd2j4rf5tfd9rgmmyegt4dqd34cf6v4gqkfvppqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq633uzqn3n74ccym4wcvq20vsx7lmk450kprpvlrh4cukk8xy9ptjcef4rnhytnkyn4vnxxtd57yeaksze2s30y26cs6u3rjd9322eg9puk24q", + "amount_msat": null, + "label": null, + "riskfactor": null, + "maxfeepercent": null, + "retry_for": null, + "maxdelay": null, + "exemptfee": null, + "localinvreqid": null, + "exclude": null, + "maxfee": null, + "description": null + } +} +``` RANDOMIZATION ------------- -To protect user privacy, the payment algorithm performs some -randomization. +To protect user privacy, the payment algorithm performs some randomization. 1: Route Randomization -Route randomization means the payment algorithm does not always use the -lowest-fee or shortest route. This prevents some highly-connected node -from learning all of the user payments by reducing their fees below the -network average. +Route randomization means the payment algorithm does not always use the lowest-fee or shortest route. This prevents some highly-connected node from learning all of the user payments by reducing their fees below the network average. 2: Shadow Route -Shadow route means the payment algorithm will virtually extend the route -by adding delays and fees along it, making it appear to intermediate nodes -that the route is longer than it actually is. This prevents intermediate -nodes from reliably guessing their distance from the payee. +Shadow route means the payment algorithm will virtually extend the route by adding delays and fees along it, making it appear to intermediate nodes that the route is longer than it actually is. This prevents intermediate nodes from reliably guessing their distance from the payee. -Route randomization will never exceed *maxfeepercent* of the payment. -Route randomization and shadow routing will not take routes that would -exceed *maxdelay*. +Route randomization will never exceed *maxfeepercent* of the payment. Route randomization and shadow routing will not take routes that would exceed *maxdelay*. RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **payment\_preimage** (secret): the proof of payment: SHA256 of this **payment\_hash** -- **payment\_hash** (hash): the hash of the *payment\_preimage* which will prove payment -- **created\_at** (number): the UNIX timestamp showing when this payment was initiated -- **parts** (u32): how many attempts this took -- **amount\_msat** (msat): Amount the recipient received -- **amount\_sent\_msat** (msat): Total amount we sent (including fees) -- **status** (string): status of payment (one of "complete", "pending", "failed") -- **destination** (pubkey, optional): the final destination of the payment +- **payment\_preimage** (secret): The proof of payment: SHA256 of this **payment\_hash**. +- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. +- **created\_at** (number): The UNIX timestamp showing when this payment was initiated. +- **parts** (u32): How many attempts this took. +- **amount\_msat** (msat): Amount the recipient received. +- **amount\_sent\_msat** (msat): Total amount we sent (including fees). +- **status** (string) (one of "complete", "pending", "failed"): Status of payment. +- **destination** (pubkey, optional): The final destination of the payment. The following warnings may also be returned: -- **warning\_partial\_completion**: Not all parts of a multi-part payment have completed +- **warning\_partial\_completion**: Not all parts of a multi-part payment have completed. + +You can monitor the progress and retries of a payment using the lightning-paystatus(7) command. -[comment]: # (GENERATE-FROM-SCHEMA-END) +EXAMPLE JSON RESPONSE +--------------------- -You can monitor the progress and retries of a payment using the -lightning-paystatus(7) command. +```json +{ + "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "payment_hash": "29ef7dfee675b990a3ad7c125960d54aa34d16969468dec9942ead03635c274c", + "created_at": 1706153504.76628, + "parts": 1, + "amount_msat": 100, + "amount_sent_msat": 100, + "payment_preimage": "6634c1b549c6615d234832f377e06d5a5ab088c40cebdc5cfb8c1262030abcad", + "status": "complete" +} +``` ERRORS ------ @@ -75,42 +111,24 @@ ERRORS The following error codes may occur: - -1: Catchall nonspecific error. -- 201: Already paid with this *hash* using different amount or -destination. -- 203: Permanent failure at destination. The *data* field of the error -will be routing failure object (except for self-payment, which currently returns the error directly from lightning-sendpay(7)). +- 201: Already paid with this *hash* using different amount or destination. +- 203: Permanent failure at destination. The *data* field of the error will be routing failure object (except for self-payment, which currently returns the error directly from lightning-sendpay(7)). - 205: Unable to find a route. -- 206: Route too expensive. Either the fee or the needed total -locktime for the route exceeds your *maxfeepercent* or *maxdelay* -settings, respectively. The *data* field of the error will indicate -the actual *fee* as well as the *feepercent* percentage that the fee -has of the destination payment amount. It will also indicate the -actual *delay* along the route. -- 207: Invoice expired. Payment took too long before expiration, or -already expired at the time you initiated payment. The *data* field -of the error indicates *now* (the current time) and *expiry* (the -invoice expiration) as UNIX epoch time in seconds. +- 206: Route too expensive. Either the fee or the needed total locktime for the route exceeds your *maxfeepercent* or *maxdelay* settings, respectively. The *data* field of the error will indicate the actual *fee* as well as the *feepercent* percentage that the fee has of the destination payment amount. It will also indicate the actual *delay* along the route. +- 207: Invoice expired. Payment took too long before expiration, or already expired at the time you initiated payment. The *data* field of the error indicates *now* (the current time) and *expiry* (the invoice expiration) as UNIX epoch time in seconds. - 210: Payment timed out without a payment in progress. -Error codes 202 and 204 will only get reported at **sendpay**; in -**pay** we will keep retrying if we would have gotten those errors. +Error codes 202 and 204 will only get reported at **sendpay**; in **pay** we will keep retrying if we would have gotten those errors. A routing failure object has the fields below: -- *erring\_index*: The index of the node along the route that reported -the error. 0 for the local node, 1 for the first hop, and so on. -- *erring\_node*: The hex string of the pubkey id of the node that -reported the error. -- *erring\_channel*: The short channel ID of the channel that has the -error, or *0:0:0* if the destination node raised the error. -- *failcode*: The failure code, as per BOLT \#4. -- *channel\_update*. The hex string of the *channel\_update* message -received from the remote node. Only present if error is from the -remote node and the *failcode* has the UPDATE bit set, as per BOLT \#4. - -The *data* field of errors will include statistics *getroute\_tries* and -*sendpay\_tries*. It will also contain a *failures* field with detailed -data about routing errors. +*erring\_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on. +*erring\_node*: The hex string of the pubkey id of the node that reported the error. +*erring\_channel*: The short channel ID of the channel that has the error, or *0:0:0* if the destination node raised the error. +*failcode*: The failure code, as per BOLT #4. +*channel\_update*: The hex string of the *channel\_update* message received from the remote node. Only present if error is from the remote node and the *failcode* has the UPDATE bit set, as per BOLT #4. + +The *data* field of errors will include statistics *getroute\_tries* and *sendpay\_tries*. It will also contain a *failures* field with detailed data about routing errors. AUTHOR ------ @@ -120,12 +138,9 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-listpays(7), lightning-decodepay(7), lightning-listinvoice(7), -lightning-delinvoice(7), lightning-getroute(7), lightning-invoice(7). +lightning-listpays(7), lightning-decodepay(7), lightning-listinvoice(7), lightning-delinvoice(7), lightning-getroute(7), lightning-invoice(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:1d2a7a9867493439268aa1b6036f5d23bdfe9337ca3a29463997c9ccdb11b95f) diff --git a/doc/lightning-ping.7.md b/doc/lightning-ping.7.md index ee921f16cd02..b4fc84ce5ee1 100644 --- a/doc/lightning-ping.7.md +++ b/doc/lightning-ping.7.md @@ -1,63 +1,74 @@ lightning-ping -- Command to check if a node is up. -============================================================ +=================================================== SYNOPSIS -------- -**ping** *id* [*len*] [*pongbytes*] +**ping** *id* [*len*] [*pongbytes*] DESCRIPTION ----------- -The **ping** command checks if the node with *id* is ready to talk. -It currently only works for peers we have a channel with. +The **ping** command checks if the node with *id* is ready to talk. It currently only works for peers we have a channel with. + +- **id** (pubkey): The pubkey of the node to ping. +- **len** (u16, optional): The length of the ping. The default is 128. +- **pongbytes** (u16, optional): The length of the reply. A value of 65532 to 65535 means `don't reply`. The default is 128. EXAMPLE JSON REQUEST ------------- +-------------------- ```json { - "id": 82, + "id": "example:ping#1", "method": "ping", "params": { "len": 128, "pongbytes": 128 } } +{ + "id": "example:ping#2", + "method": "ping", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "len": 1000, + "pongbytes": 65535 + } +} ``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **totlen** (u16): the answer length of the reply message (including header: 0 means no reply expected) - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -ERRORS ------- - -On failure, one of the following error codes may be returned: - -- -32602: Error in given parameters or we're already waiting for a ping response from peer. +- **totlen** (u16): The answer length of the reply message (including header: 0 means no reply expected). EXAMPLE JSON RESPONSE ------ +--------------------- ```json { - "totlen": 132 + "totlen": 132 +} +{ + "totlen": 0 } - ``` +ERRORS +------ + +On failure, one of the following error codes may be returned: + +- -32602: Error in given parameters or we're already waiting for a ping response from peer. AUTHOR ------ -Vincenzo Palazzo <> wrote the initial version of this man page, but many others did the hard work of actually implementing this rpc command. +Vincenzo Palazzo <> wrote the initial version of this man page, +but many others did the hard work of actually implementing this rpc command. SEE ALSO -------- @@ -68,5 +79,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:3d65bfe95b32d6f1229fcf9215045516ff04e670de8ba0485e585d699e1b1f71) diff --git a/doc/lightning-plugin.7.md b/doc/lightning-plugin.7.md index 36a778993a89..373399a659cf 100644 --- a/doc/lightning-plugin.7.md +++ b/doc/lightning-plugin.7.md @@ -4,85 +4,172 @@ lightning-plugin -- Manage plugins with RPC SYNOPSIS -------- -**plugin** *subcommand* [plugin|directory] [*options*] ... - +**plugin** *subcommand* [*plugin|directory*] [*options*] ... DESCRIPTION ----------- -The **plugin** RPC command can be used to control dynamic plugins, -i.e. plugins that declared themself "dynamic" (in getmanifest). - -*subcommand* **start** takes a *path* to an executable as argument and starts it as plugin. -*path* may be an absolute path or a path relative to the plugins directory (default *~/.lightning/plugins*). -If the plugin is already running and the executable (checksum) has changed, the plugin is -killed and restarted except if its an important (or builtin) plugin. -If the plugin doesn't complete the "getmanifest" and "init" handshakes within 60 seconds, -the command will timeout and kill the plugin. -Additional *options* may be passed to the plugin, but requires all parameters to -be passed as keyword=value pairs using the `-k|--keyword` option which -is recommended. For example the following command starts the plugin -helloworld.py (present in the plugin directory) with the option -greeting set to 'A crazy': - -``` -lightning-cli -k plugin subcommand=start plugin=helloworld.py greeting='A crazy' +The **plugin** RPC command can be used to control dynamic plugins, i.e. plugins that declared themself 'dynamic' (in getmanifest). + +- **subcommand** (string) (one of "start", "stop", "rescan", "startdir", "list"): Determines what action is taken: + - *subcommand* **start** takes a *path* to an executable as argument and starts it as plugin. *path* may be an absolute path or a path relative to the plugins directory (default *~/.lightning/plugins*). If the plugin is already running and the executable (checksum) has changed, the plugin is killed and restarted except if its an important (or builtin) plugin. If the plugin doesn't complete the 'getmanifest' and 'init' handshakes within 60 seconds, the command will timeout and kill the plugin. Additional *options* may be passed to the plugin, but requires all parameters to be passed as keyword=value pairs using the `-k|--keyword` option which is recommended. For example the following command starts the plugin helloworld.py (present in the plugin directory) with the option greeting set to 'A crazy': + ``shell. + lightning-cli -k plugin subcommand=start plugin=helloworld.py greeting='A crazy'. + ``. + - *subcommand* **stop** takes a plugin executable *path* or *name* as argument and stops the plugin. If the plugin subscribed to 'shutdown', it may take up to 30 seconds before this command returns. If the plugin is important and dynamic, this will shutdown `lightningd`. + - *subcommand* **startdir** starts all executables it can find in *directory* (excl. subdirectories) as plugins. Checksum and timeout behavior as in **start** applies. + - *subcommand* **rescan** starts all plugins in the default plugins directory (default *~/.lightning/plugins*) that are not already running. Checksum and timeout behavior as in **start** applies. + - *subcommand* **list** lists all running plugins (incl. non-dynamic). +- **plugin** (string, optional): *path* or *name* of a plugin executable to start or stop. +- **directory** (string, optional): *path* of a directory containing plugins. +- **options** (array of strings, optional): + - (string, optional): *keyword=value* options passed to plugin, can be repeated. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:plugin#1", + "method": "plugin", + "params": [ + "list" + ] +} +{ + "id": "example:plugin#2", + "method": "plugin", + "params": { + "subcommand": "stop", + "plugin": "fail_htlcs.py" + } +} ``` -*subcommand* **stop** takes a plugin executable *path* or *name* as argument and stops the plugin. -If the plugin subscribed to "shutdown", it may take up to 30 seconds before this -command returns. If the plugin is important and dynamic, this will shutdown `lightningd`. - -*subcommand* **startdir** starts all executables it can find in *directory* (excl. subdirectories) -as plugins. Checksum and timeout behavior as in **start** applies. - -*subcommand* **rescan** starts all plugins in the default plugins directory (default *~/.lightning/plugins*) -that are not already running. Checksum and timeout behavior as in **start** applies. - -*subcommand* **list** lists all running plugins (incl. non-dynamic) - RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **command** (string): the subcommand this is responding to (one of "start", "stop", "rescan", "startdir", "list") +- **command** (string) (one of "start", "stop", "rescan", "startdir", "list"): The subcommand this is responding to. If **command** is "start", "startdir", "rescan" or "list": - - **plugins** (array of objects): - - **name** (string): full pathname of the plugin - - **active** (boolean): status; plugin completed init and is operational, plugins are configured asynchronously. - - **dynamic** (boolean): plugin can be stopped or started without restarting lightningd + - **name** (string): Full pathname of the plugin. + - **active** (boolean): Status; plugin completed init and is operational, plugins are configured asynchronously. + - **dynamic** (boolean): Plugin can be stopped or started without restarting lightningd. If **command** is "stop": + - **result** (string): A message saying it successfully stopped. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "command": "list", + "plugins": [ + { + "name": "~/lightning/plugins/autoclean", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/chanbackup", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/bcli", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/commando", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/funder", + "active": true, + "dynamic": true + }, + { + "name": "~/lightning/plugins/topology", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/keysend", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/offers", + "active": true, + "dynamic": true + }, + { + "name": "~/lightning/plugins/pay", + "active": true, + "dynamic": true + }, + { + "name": "~/lightning/plugins/txprepare", + "active": true, + "dynamic": true + }, + { + "name": "~/lightning/plugins/cln-renepay", + "active": true, + "dynamic": true + }, + { + "name": "~/lightning/plugins/spenderp", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/sql", + "active": true, + "dynamic": true + }, + { + "name": "~/lightning/plugins/bookkeeper", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/target/debug/examples/cln-plugin-startup", + "active": true, + "dynamic": false + } + ] +} +{ + "command": "stop", + "result": "Successfully stopped fail_htlcs.py." +} +``` - - **result** (string): A message saying it successfully stopped +ERRORS +------ -[comment]: # (GENERATE-FROM-SCHEMA-END) +On error, the reason why the action could not be taken upon the plugin is returned. -ERRORS +AUTHOR ------ -On error, the reason why the action could not be taken upon the -plugin is returned. +Antoine Poinsot <> is mainly responsible. SEE ALSO -------- lightning-cli(1), lightning-listconfigs(1), [writing plugins][writing plugins] -AUTHOR ------- - -Antoine Poinsot <> is mainly responsible. - RESOURCES --------- Main web site: [writing plugins]: PLUGINS.md - -[comment]: # ( SHA256STAMP:83b40cc97b040fc0d7d47ebfda887c7c7ab0f305330978cd8426b6eed01737d2) diff --git a/doc/lightning-preapproveinvoice.7.md b/doc/lightning-preapproveinvoice.7.md index 28f767e5a8e7..00da015fb04b 100644 --- a/doc/lightning-preapproveinvoice.7.md +++ b/doc/lightning-preapproveinvoice.7.md @@ -1,38 +1,33 @@ lightning-preapproveinvoice -- Ask the HSM to preapprove an invoice (low-level) -================================================================== +=============================================================================== SYNOPSIS -------- -**preapproveinvoice** *bolt11* +**preapproveinvoice** *bolt11* DESCRIPTION ----------- -The **preapproveinvoice** RPC command submits the *bolt11* invoice to -the HSM to check that it is approved for payment. +Command *added* in v23.02. -Generally the **preapproveinvoice** request does not need to be made -explicitly, it is automatically generated as part of a **pay** request. +The **preapproveinvoice** RPC command submits the *bolt11* invoice to the HSM to check that it is approved for payment. + +Generally the **preapproveinvoice** request does not need to be made explicitly, it is automatically generated as part of a **pay** request. By default, the HSM will approve all **preapproveinvoice** requests. -If a remote signer is being used it might decline an **preapproveinvoice** -request because it would exceed velocity controls, is not covered by -allowlist controls, was declined manually, or other reasons. +If a remote signer is being used it might decline an **preapproveinvoice** request because it would exceed velocity controls, is not covered by allowlist controls, was declined manually, or other reasons. + +If a remote signer declines a **preapproveinvoice** request a subsequent attempt to pay the invoice anyway will fail; the signer will refuse to sign the commitment. -If a remote signer declines a **preapproveinvoice** request a subsequent -attempt to pay the invoice anyway will fail; the signer will refuse to sign -the commitment. +- **bolt11** (string): Bolt11 invoice to submit to the HSM to check. *(added v23.02)* RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an empty object is returned. -[comment]: # (GENERATE-FROM-SCHEMA-END) - AUTHOR ------ @@ -47,5 +42,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:351b7e2537562036bab7c45cfa1108991ade2a9190ef902afbf9e2804cc0f466) diff --git a/doc/lightning-preapprovekeysend.7.md b/doc/lightning-preapprovekeysend.7.md index c9a6940af90e..94032239d2f2 100644 --- a/doc/lightning-preapprovekeysend.7.md +++ b/doc/lightning-preapprovekeysend.7.md @@ -1,39 +1,35 @@ lightning-preapprovekeysend -- Ask the HSM to preapprove a keysend payment (low-level) -================================================================== +====================================================================================== SYNOPSIS -------- -**preapprovekeysend** *destination* *payment\_hash* *amount\_msat* +**preapprovekeysend** *destination* *payment\_hash* *amount\_msat* DESCRIPTION ----------- -The **preapprovekeysend** RPC command submits the *destination*, *payment\_hash*, -and *amount\_msat* parameters to the HSM to check that they are approved as a -keysend payment. +Command *added* in v23.02. -Generally the **preapprovekeysend** request does not need to be made -explicitly, it is automatically generated as part of a **keysend** request. +The **preapprovekeysend** RPC command submits the *destination*, *payment\_hash*, and *amount\_msat* parameters to the HSM to check that they are approved as a keysend payment. + +Generally the **preapprovekeysend** request does not need to be made explicitly, it is automatically generated as part of a **keysend** request. By default, the HSM will approve all **preapprovekeysend** requests. -If a remote signer is being used it might decline an **preapprovekeysend** -request because it would exceed velocity controls, is not covered by -allowlist controls, was declined manually, or other reasons. +If a remote signer is being used it might decline an **preapprovekeysend** request because it would exceed velocity controls, is not covered by allowlist controls, was declined manually, or other reasons. + +If a remote signer declines a **preapprovekeysend** request a subsequent attempt to pay the keysend anyway will fail; the signer will refuse to sign the commitment. -If a remote signer declines a **preapprovekeysend** request a subsequent -attempt to pay the keysend anyway will fail; the signer will refuse to sign -the commitment. +- **destination** (pubkey): It is a 33 byte, hex-encoded, node ID of the node that the payment should go to. *(added v23.02)* +- **payment\_hash** (hex) (always 64 characters): It is the unique identifier of a payment. *(added v23.02)* +- **amount\_msat** (msat): The amount to send in millisatoshi precision; it can be a whole number, or a whole number with suffix `msat` or `sat`, or a three decimal point number with suffix `sat`, or an 1 to 11 decimal point number suffixed by `btc`. *(added v23.02)* RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an empty object is returned. -[comment]: # (GENERATE-FROM-SCHEMA-END) - AUTHOR ------ @@ -48,5 +44,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:b0793c2fa864b0ce3bc6f1618135f28ac551dfd1b8a0127caac73fd948e62d9d) diff --git a/doc/lightning-recover.7.md b/doc/lightning-recover.7.md index cbb8c8309ece..900a6323fcf2 100644 --- a/doc/lightning-recover.7.md +++ b/doc/lightning-recover.7.md @@ -4,25 +4,55 @@ lightning-recover -- Reinitialize Your Node for Recovery SYNOPSIS -------- -**recover** *hsmsecret* +**recover** *hsmsecret* DESCRIPTION ----------- -The **recover** RPC command wipes your node and restarts it with -the `--recover` option. This is only permitted if the node is unused: -no channels, no bitcoin addresses issued (you can use `check` to see -if recovery is possible). +The **recover** RPC command wipes your node and restarts it with the `--recover` option. This is only permitted if the node is unused: no channels, no bitcoin addresses issued (you can use `check` to see if recovery is possible). -*hsmsecret* is either a codex32 secret starting with "cl1" as returned -by `hsmtool getcodexsecret`, or a raw 64 character hex string. +*hsmsecret* is either a codex32 secret starting with "cl1" as returned by `hsmtool getcodexsecret`, or a raw 64 character hex string. NOTE: this command only currently works with the `sqlite3` database backend. +- **hsmsecret** (string): Either a codex32 secret starting with `cl1` as returned by `hsmtool getcodexsecret`, or a raw 64 character hex string. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:recover#1", + "method": "recover", + "params": { + "hsmsecret": "cl10leetsd35kw6r5de5kueedxgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqdeuq7xuh94k9g" + } +} +{ + "id": "example:recover#2", + "method": "recover", + "params": { + "hsmsecret": "6c696768746e696e672d31000000000000000000000000000000000000000000" + } +} +``` + RETURN VALUE ------------ -On success, an empty object is returned, and your node is restarted. +On success, an object is returned, containing: + +- **result** (string) (always "Recovery restart in progress") *(added v24.05)* + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{} +{ + "result": "Recovery restart in progress" +} +``` AUTHOR ------ @@ -38,5 +68,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:9cfaa9eb4609b36accc3e3b12a352c00ddd402307e4461f4df274146d12f6eb0) diff --git a/doc/lightning-recoverchannel.7.md b/doc/lightning-recoverchannel.7.md index ac6c1cfed1b1..80c514ed4de1 100644 --- a/doc/lightning-recoverchannel.7.md +++ b/doc/lightning-recoverchannel.7.md @@ -4,29 +4,51 @@ lightning-recoverchannel -- Command for recovering channels bundeled in an array SYNOPSIS -------- -**recoverchannel** *scb* +**recoverchannel** *scb* DESCRIPTION ----------- -The **recoverchannel** RPC command tries to force the peer (with whom you -already had a channel) to close the channel and sweeps on-chain fund. This -method is not spontaneous and depends on the peer, so use it in case of -severe data loss. +The **recoverchannel** RPC command tries to force the peer (with whom you already had a channel) to close the channel and sweeps on-chain fund. This method is not spontaneous and depends on the peer, so use it in case of severe data loss. -The *scb* parameter is an array containing minimum required info to -reconnect and sweep funds. You can get the scb for already stored channels -by using the RPC command 'staticbackup' +The *scb* parameter is an array containing minimum required info to reconnect and sweep funds. You can get the scb for already stored channels by using the RPC command 'staticbackup'. +- **scb** (array of hexs): SCB of the channels in an array.: + - (hex, optional) + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:recoverchannel#1", + "method": "recoverchannel", + "params": [ + [ + "0000000000000001c3a7b9d74a174497122bc52d74d6d69836acadc77e0429c6d8b68b48d5c9139a022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d5904017f0000019f0bc3a7b9d74a174497122bc52d74d6d69836acadc77e0429c6d8b68b48d5c9139a0000000000000000000186a000021000" + ] + ] +} +``` RETURN VALUE ------------ On success, an object is returned, containing: -- **stubs** (array of hexs): - - Each item is the channel ID of the channel successfully inserted +- **stubs** (array of strings): + - (string, optional): Channel IDs of channels successfully inserted. +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "stubs": [ + "c3a7b9d74a174497122bc52d74d6d69836acadc77e0429c6d8b68b48d5c9139a" + ] +} +``` AUTHOR ------ @@ -42,5 +64,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:9cfaa9eb4609b36accc3e3b12a352c00ddd402307e4461f4df274146d12f6eb0) diff --git a/doc/lightning-renepay.7.md b/doc/lightning-renepay.7.md index 10f89315726b..04e02de0310c 100644 --- a/doc/lightning-renepay.7.md +++ b/doc/lightning-renepay.7.md @@ -4,84 +4,107 @@ lightning-renepay -- Command for sending a payment to a BOLT11 invoice SYNOPSIS -------- -**renepay** *invstring* [*amount\_msat*] [*maxfee*] [*maxdelay*] -[*retry\_for*] [*description*] [*label*] +**renepay** *invstring* [*amount\_msat*] [*maxfee*] [*maxdelay*] [*retry\_for*] [*description*] [*label*] DESCRIPTION ----------- -**renepay** is a new payment plugin based on Pickhardt-Richter optimization -method for Multi-Path-Payments. This implementation has not been thoroughly -tested and it should be used with caution. - -The response will occur when the payment fails or succeeds. Once a -payment has succeeded, calls to **renepay** with the same *invstring* -will not lead to a new payment attempt, but instead it will succeed immediately. - -When using *lightning-cli*, you may skip optional parameters by using -*null*. Alternatively, use **-k** option to provide parameters by name. +Command *added* in v23.08. + +**renepay** is a new payment plugin based on Pickhardt-Richter optimization method for Multi-Path-Payments. This implementation has not been thoroughly tested and it should be used with caution. + +The response will occur when the payment fails or succeeds. Once a payment has succeeded, calls to **renepay** with the same *invstring* will not lead to a new payment attempt, but instead it will succeed immediately. + +When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name. + +- **invstring** (string): Bolt11 invoice which the RPC command attempts to pay. Currently, **renepay** supports bolt11 invoices only. +- **amount\_msat** (msat, optional): If the *invstring* does not contain an amount, *amount\_msat* is required, otherwise if it is specified it must be *null*. in millisatoshi precision; it can be a whole number, or a whole number with suffix *msat* or *sat*, or a three decimal point number with suffix *sat*, or an 1 to 11 decimal point number suffixed by *btc*. +- **maxfee** (msat, optional): *maxfee* is a hard bound, in the sense that the command will never attempt a payment when the fees exceed that value. +- **maxdelay** (u32, optional): Overrides the value of `max-locktime-blocks` for this payment. It serves to limit the locktime of funds in the payment HTLC measured in blocks. +- **retry\_for** (u32, optional): Measured in seconds specifies how much time it is allowed for the command to keep retrying the payment. The default is 60 seconds. +- **description** (string, optional): Only required for bolt11 invoices which do not contain a description themselves, but contain a description hash: in this case *description* is required. *description* is then checked against the hash inside the invoice before it will be paid. +- **label** (string, optional): Used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7). + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:renepay#1", + "method": "renepay", + "params": { + "invstring": "lnbcrt1230n1pjmxj9jsp5suc4cag0lv3wemllkvms56e6ll0w867cczqfttuu8cpfl089f9kspp56wvxtdh8fxg5r5y3kg3klxceakqaydskwzatga25v95da8nzkmwqdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqkmyhymt0j7hy38vzqxx465s4ys0fg78flnjqfx4clvdq9mrmgglpcnjrrnhtk7maa87pfvjez88hke8w97zvuecwswaf9gzyqlsthegpza67eu" + } +} +{ + "id": "example:renepay#2", + "method": "renepay", + "params": { + "invstring": "lnbcrt1pja0f9asp50kzadmeyy78eymjvhnlk5dznl3g5k5x8agh52ewjtg0jclas4ylspp5crsutd9hg05lxyhzphdcuyng6z3knrsdae83mxwawa842gz3vj3sdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqr5yzhxmup4muyaz6x8u2dy4qyu9t5qzuf5k9xayvj5kg7tve60gjk4jrv2l76exnj2xkuzhtwky23pkkxedzy6p9yrsgyqdwj7dv5gsp4zcw6v", + "amount_msat": 548925 + } +} +``` OPTIMALITY ---------- -**renepay** is based on the work by Pickhardt-Richter's -*Optimally Reliable & Cheap Payment Flows on the Lightning Network*. -Which means the payment command will prefer routes that have a higher -probability of success while keeping fees low. - -The algorithm records some partial knowledge of the state of the Network -deduced from the responses obtained after evey payment attempt. -This knowledge is kept through different payment requests, but decays with time -to account for the dynamics of the Network (after 1 hour all previous knowledge -will be erased). -Knowledge from previous payment attempts increases the reliability for -subsequent ones. +**renepay** is based on the work by Pickhardt-Richter's *Optimally Reliable & Cheap Payment Flows on the Lightning Network*. Which means the payment command will prefer routes that have a higher probability of success while keeping fees low. -Higher probabilities of success and lower fees cannot generally by optimized at -once. Hence **renepay** combines the two in different amounts seeking solutions -that satisfy *maxfee* bound and a target for 90% probability of success. -*maxfee* is a hard bound, in the sense that the command will never attempt a -payment when the fees exceed that value. While the probability target is not -compulsory (but desirable), i.e. if the best route does not satisfy the -90% probability target it will be tried anyways. +The algorithm records some partial knowledge of the state of the Network deduced from the responses obtained after evey payment attempt. This knowledge is kept through different payment requests, but decays with time to account for the dynamics of the Network (after 1 hour all previous knowledge will be erased). Knowledge from previous payment attempts increases the reliability for subsequent ones. -When *maxfee* and the 90% probability bounds are satified, the algorithm will -optimize the fees to its lowest value. +Higher probabilities of success and lower fees cannot generally by optimized at once. Hence **renepay** combines the two in different amounts seeking solutions that satisfy *maxfee* bound and a target for 90% probability of success. *maxfee* is a hard bound, in the sense that the command will never attempt a payment when the fees exceed that value. While the probability target is not compulsory (but desirable), i.e. if the best route does not satisfy the 90% probability target it will be tried anyways. +When *maxfee* and the 90% probability bounds are satified, the algorithm will optimize the fees to its lowest value. RANDOMIZATION ------------- -To protect user privacy, the payment algorithm performs *shadow route* -randomization. -Which means the payment algorithm will virtually extend the route -by adding delays and fees along it, making it appear to intermediate nodes -that the route is longer than it actually is. This prevents intermediate -nodes from reliably guessing their distance from the payee. +To protect user privacy, the payment algorithm performs *shadow route* randomization. Which means the payment algorithm will virtually extend the route by adding delays and fees along it, making it appear to intermediate nodes that the route is longer than it actually is. This prevents intermediate nodes from reliably guessing their distance from the payee. -Route randomization will never exceed *maxfee* of the payment. -Route randomization and shadow routing will not take routes that would -exceed *maxdelay*. +Route randomization will never exceed *maxfee* of the payment. Route randomization and shadow routing will not take routes that would exceed *maxdelay*. RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **payment\_preimage** (secret): the proof of payment: SHA256 of this **payment\_hash** -- **payment\_hash** (hash): the hash of the *payment\_preimage* which will prove payment -- **created\_at** (number): the UNIX timestamp showing when this payment was initiated -- **parts** (u32): how many attempts this took -- **amount\_msat** (msat): amount the recipient received -- **amount\_sent\_msat** (msat): total amount we sent (including fees) -- **status** (string): status of payment (one of "complete", "pending", "failed") -- **destination** (pubkey, optional): the final destination of the payment - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -You can monitor the progress and retries of a payment using the -lightning-renepaystatus(7) command. +- **payment\_preimage** (secret): The proof of payment: SHA256 of this **payment\_hash**. +- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. +- **created\_at** (number): The UNIX timestamp showing when this payment was initiated. +- **parts** (u32): How many attempts this took. +- **amount\_msat** (msat): Amount the recipient received. +- **amount\_sent\_msat** (msat): Total amount we sent (including fees). +- **status** (string) (one of "complete", "pending", "failed"): Status of payment. +- **destination** (pubkey, optional): The final destination of the payment. + +You can monitor the progress and retries of a payment using the lightning-renepaystatus(7) command. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "payment_preimage": "0a3fd704b34f47d6e306dbac78141753be83848d3a19725c972abfc367dcc591", + "payment_hash": "d39865b6e7499141d091b2236f9b19ed81d2361670bab475546168de9e62b6dc", + "created_at": 1706248370.6267352, + "parts": 1, + "amount_msat": 123000, + "amount_sent_msat": 123000, + "status": "complete", + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" +} +{ + "payment_preimage": "a635e92d024beebfc58519e6544888aa560ba3bcaba7e74924e4b8432eaa56f5", + "payment_hash": "c0e1c5b4b743e9f312e20ddb8e1268d0a3698e0dee4f1d99dd774f55205164a3", + "created_at": 1708631229.7841823, + "parts": 1, + "amount_msat": 548925, + "amount_sent_msat": 548925, + "status": "complete", + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" +} +``` ERRORS ------ @@ -93,8 +116,7 @@ The following error codes may occur: - 203: Permanent failure at destination. - 205: Unable to find a route. - 206: Payment routes are too expensive. -- 207: Invoice expired. Payment took too long before expiration, or -already expired at the time you initiated payment. +- 207: Invoice expired. Payment took too long before expiration, or already expired at the time you initiated payment. - 210: Payment timed out without a payment in progress. - 212: Invoice is invalid. @@ -106,13 +128,11 @@ Eduardo Quintana-Miranda <> is mainly responsible. SEE ALSO -------- -lightning-renepaystatus(7), lightning-listpays(7), lightning-invoice(7). +lightning-renepaystatus(7), lightning-listpays(7), lightning-invoice(7) RESOURCES --------- -- Main web site: - -- Pickhardt R. and Richter S., *Optimally Reliable & Cheap Payment Flows on the Lightning Network* +Main web site: -[comment]: # ( SHA256STAMP:946ad2fc9ef6bb6dbab6613b9cb55d34ed5a15dd876efcaeaa41174f0bdc40b0) +Pickhardt R. and Richter S., *Optimally Reliable & Cheap Payment Flows on the Lightning Network* diff --git a/doc/lightning-renepaystatus.7.md b/doc/lightning-renepaystatus.7.md index e554e31deb68..a02a4a27f8b7 100644 --- a/doc/lightning-renepaystatus.7.md +++ b/doc/lightning-renepaystatus.7.md @@ -4,37 +4,36 @@ lightning-renepaystatus -- Command for quering the status of previous renepay at SYNOPSIS -------- -**renepaystatus** [*invstring*] - +**renepaystatus** [*invstring*] DESCRIPTION ----------- -The **renepaystatus** RPC command queries the payment plugin **renepay** -for the status of previous payment attempts. +Command *added* in v23.08. + +The **renepaystatus** RPC command queries the payment plugin **renepay** for the status of previous payment attempts. This command always succeeds. +- **invstring** (string, optional): If specified, the command will return a list of payment attempts whose invoice matches *invstring*, otherwise all payments with be listed. + RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **paystatus** is returned. It is an array of objects, where each object contains: - -- **bolt11** (string): invoice string BOLT11 -- **payment\_hash** (hash): the hash of the *payment\_preimage* which will prove payment -- **created\_at** (number): the UNIX timestamp showing when this payment was initiated -- **groupid** (u32): the id for this payment attempt -- **amount\_msat** (msat): amount the recipient received -- **status** (string): status of payment (one of "complete", "pending", "failed") -- **notes** (array of strings): a list of messages for debugging purposes: - - a message generated by renepay -- **payment\_preimage** (secret, optional): the proof of payment: SHA256 of this **payment\_hash** (for completed payments only) -- **parts** (u32, optional): how many attempts this took -- **amount\_sent\_msat** (msat, optional): total amount we sent including fees (for completed payments only) -- **destination** (pubkey, optional): the final destination of the payment - -[comment]: # (GENERATE-FROM-SCHEMA-END) +On success, an object containing **paystatus** is returned. It is an array of objects, where each object contains: + +- **bolt11** (string): Invoice string BOLT11. +- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. +- **created\_at** (number): The UNIX timestamp showing when this payment was initiated. +- **groupid** (u32): The id for this payment attempt. +- **amount\_msat** (msat): Amount the recipient received. +- **status** (string) (one of "complete", "pending", "failed"): Status of payment. +- **notes** (array of strings): A list of messages for debugging purposes.: + - (string, optional): A message generated by renepay. +- **payment\_preimage** (secret, optional): The proof of payment: SHA256 of this **payment\_hash** (for completed payments only). +- **parts** (u32, optional): How many attempts this took. +- **amount\_sent\_msat** (msat, optional): Total amount we sent including fees (for completed payments only). +- **destination** (pubkey, optional): The final destination of the payment. AUTHOR ------ @@ -44,11 +43,9 @@ Eduardo Quintana-Miranda <> is mainly responsible. SEE ALSO -------- -lightning-renepay(7), lightning-listpays(7). +lightning-renepay(7), lightning-listpays(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:de6ff34f457b5fb836c2b08da62577e689f81afcceb5864f519665b2360c0907) diff --git a/doc/lightning-reserveinputs.7.md b/doc/lightning-reserveinputs.7.md index 3c1b491b1ba5..25fb87c2ddf4 100644 --- a/doc/lightning-reserveinputs.7.md +++ b/doc/lightning-reserveinputs.7.md @@ -4,55 +4,170 @@ lightning-reserveinputs -- Construct a transaction and reserve the UTXOs it spen SYNOPSIS -------- -**reserveinputs** *psbt* [*exclusive*] [*reserve*] +**reserveinputs** *psbt* [*exclusive*] [*reserve*] DESCRIPTION ----------- -The **reserveinputs** RPC command places (or increases) reservations on any -inputs specified in *psbt* which are known to lightningd. It will fail -with an error if any of the inputs are known to be spent, and ignore inputs -which are unknown. - -Normally the command will fail (with no reservations made) if an input -is already reserved. +The **reserveinputs** RPC command places (or increases) reservations on any inputs specified in *psbt* which are known to lightningd. It will fail with an error if any of the inputs are known to be spent, and ignore inputs which are unknown. + +Normally the command will fail (with no reservations made) if an input is already reserved. + +- **psbt** (string): The PSBT to reserve inputs from. +- **exclusive** (boolean, optional): If set to *False*, existing reservations are simply extended, rather than causing failure. +- **reserve** (u32, optional): The number of blocks to reserve. By default, reservations are for the next 72 blocks (approximately 6 hours). + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:reserveinputs#1", + "method": "reserveinputs", + "params": { + "psbt": "cHNidP8BAFwCAAAAAkwJVUqB0xXTO7JZ3PnPdGnxoYfQxhU+xqXGFYXsyX0RAAAAAAD9////TAlVSoHTFdM7slnc+c90afGhh9DGFT7GpcYVhezJfREBAAAAAP3///8AAAAAAAAAAA==", + "exclusive": true, + "reserve": null + } +} +{ + "id": "example:reserveinputs#2", + "method": "reserveinputs", + "params": { + "psbt": "cHNidP8BAP32AQIAAAAMgnW099dbh1uD153ih5eU5WhluynLxekXjAOjkEdNBg8BAAAAAP3///9FWKQt8C+1y4741+beFSqWAaj9DuvzHNpxvpxS+GB8lwEAAAAA/f///6E5TAGqktI29Oso6b9kZZoAFFGGvpJQUM8VO+3LMTlmAAAAAAD9////nSDT7hrkuoQtAV1yNnbpkJsB5ifKoM2zP+CcLPfis1gBAAAAAP3///+P1rW90UXfD0gIk58h3sXxxy3ZfJJLP0H1I4Jpzy/87QEAAAAA/f///w0UKZ/s9DnPpV+FJ8h2BEI7tl+qVxSGRFRv9FYw4girAQAAAAD9////EPNsUFrEOZyfjbqbh8rfHQ4C9RQECw12n3c1yhFqkzoAAAAAAP3///8QW9LEsSmuvSnvVzy+FDktM7ewQmZnIJI/TJMahLmSzwEAAAAA/f///+4edbWRHDdRJcMeHHElgSmb+nENPsz/g/0AmAEU6hXeAAAAAAD9////T15YLGmk7HBsrL+awdcxi3db3esp8AcCTS9XGrEnfoAAAAAAAP3///8q7xInvEk7J0Ir9cpKXqU2lArUskkYLrimIE0+Yb6a2QEAAAAA/f///8hBLKyMa2zRJqwNOk7DmsDIfG7IvJtQiJ+QnkkHl6atAAAAAAD9////AAAAAAAAAAAAAAAAAAAAAAAA", + "exclusive": false, + "reserve": null + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **reservations** is returned. It is an array of objects, where each object contains: - -- **txid** (txid): the transaction id -- **vout** (u32): the output number which was reserved -- **was\_reserved** (boolean): whether the input was already reserved -- **reserved** (boolean): whether the input is now reserved (always *true*) -- **reserved\_to\_block** (u32): what blockheight the reservation will expire - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -On success, a *reservations* array is returned, with an entry for each input -which was reserved: - -- *txid* is the input transaction id. -- *vout* is the input index. -- *was\_reserved* indicates whether the input was already reserved. -- *reserved* indicates that the input is now reserved (i.e. true). -- *reserved\_to\_block* indicates what blockheight the reservation will expire. +On success, an object containing **reservations** is returned. It is an array of objects, where each object contains: + +- **txid** (txid): The input transaction id. +- **vout** (u32): The input index output number which was reserved. +- **was\_reserved** (boolean): Whether the input was already reserved. +- **reserved** (boolean) (always *true*): Whether the input is now reserved. +- **reserved\_to\_block** (u32): What blockheight the reservation will expire. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "reservations": [ + { + "txid": "117dc9ec8515c6a5c63e15c6d087a1f16974cff9dc59b23bd315d3814a55094c", + "vout": 1, + "was_reserved": false, + "reserved": true, + "reserved_to_block": 175 + } + ] +} +{ + "reservations": [ + { + "txid": "0f064d4790a3038c17e9c5cb29bb6568e5949787e29dd7835b875bd7f7b47582", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "977c60f8529cbe71da1cf3eb0efda801962a15dee6d7f88ecbb52ff02da45845", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "663931cbed3b15cf505092be865114009a6564bfe928ebf436d292aa014c39a1", + "vout": 0, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "58b3e2f72c9ce03fb3cda0ca27e6019b90e97636725d012d84bae41aeed3209d", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "edfc2fcf698223f5413f4b927cd92dc7f1c5de219f9308480fdf45d1bdb5d68f", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "ab08e23056f46f5444861457aa5fb63b420476c827855fa5cf39f4ec9f29140d", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "3a936a11ca35779f760d0b0414f5020e1ddfca879bba8d9f9c39c45a506cf310", + "vout": 0, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "cf92b9841a934c3f9220676642b0b7332d3914be3c57ef29bdae29b1c4d25b10", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "de15ea14019800fd83ffcc3e0d71fa9b298125711c1ec32551371c91b5751eee", + "vout": 0, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "807e27b11a572f4d0207f029ebdd5b778b31d7c19abfac6c70eca4692c585e4f", + "vout": 0, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "d99abe613e4d20a6b82e1849b2d40a9436a55e4acaf52b42273b49bc2712ef2a", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "ada69707499e909f88509bbcc86e7cc8c09ac34e3a0dac26d16c6b8cac2c41c8", + "vout": 0, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + } + ] +} +``` ERRORS ------ On failure, an error is reported and no UTXOs are reserved. -The following error codes may occur: - - -32602: Invalid parameter, such as specifying a spent/reserved input in *psbt*. AUTHOR ------ -niftynei <> is mainly responsible. +Lisa Neigut <> is mainly responsible. SEE ALSO -------- @@ -63,5 +178,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:ca50532790e2f80730b6ec6f066cee5a1e57867548fd36503e8faebc16a205b5) diff --git a/doc/lightning-sendcustommsg.7.md b/doc/lightning-sendcustommsg.7.md index 315aee820cd9..303cab980679 100644 --- a/doc/lightning-sendcustommsg.7.md +++ b/doc/lightning-sendcustommsg.7.md @@ -1,41 +1,55 @@ lightning-sendcustommsg -- Low-level interface to send protocol messages to peers -===================================================================================== +================================================================================= SYNOPSIS -------- -**sendcustommsg** *node\_id* *msg* +**sendcustommsg** *node\_id* *msg* DESCRIPTION ----------- -The `sendcustommsg` RPC method allows the user to inject a custom message -into the communication with the peer with the given `node_id`. This is -intended as a low-level interface to implement custom protocol extensions on -top, not for direct use by end-users. +Command *added* in v0.10.1. -On the receiving end a plugin may implement the `custommsg` plugin hook and -get notified about incoming messages, and allow additional unknown even types -in their getmanifest response. +The `sendcustommsg` RPC method allows the user to inject a custom message into the communication with the peer with the given `node_id`. This is intended as a low-level interface to implement custom protocol extensions on top, not for direct use by end-users. + +On the receiving end a plugin may implement the `custommsg` plugin hook and get notified about incoming messages, and allow additional unknown even types in their getmanifest response. + +- **node\_id** (pubkey): The node specified by `node_id` must be a peer, i.e., it must have a direct connection with the node receiving the RPC call, and the connection must be established. For a method to send arbitrary messages over multiple hops, including hops that do not understand the custom message, see the `createonion` and `sendonion` RPC methods. Messages can only be injected if the connection is handled by `openingd` or `channeld`. Messages cannot be injected when the peer is handled by `onchaind` or `closingd` since these do not have a connection, or are synchronous daemons that do not handle spontaneous messages. +- **msg** (hex): Must be a hex encoded well-formed message, including the 2-byte type prefix, but excluding the length prefix which will be added by the RPC method. The message types may not be one of the internally handled types, since that may cause issues with the internal state tracking of Core Lightning. We do (as of *v23.11*) allow sending of even types, but note that peers (as per the spec) will disconnect on receiving unknown even types. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:sendcustommsg#5", + "method": "sendcustommsg", + "params": { + "node_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "msg": "77770012" + } +} +``` RETURN VALUE ------------ -The method will validate the arguments and queue the message for delivery -through the daemon that is currently handling the connection. Queuing provides -best effort guarantees and the message may not be delivered if the connection -is terminated while the message is queued. The RPC method will return as soon -as the message is queued. +The method will validate the arguments and queue the message for delivery through the daemon that is currently handling the connection. Queuing provides best effort guarantees and the message may not be delivered if the connection is terminated while the message is queued. The RPC method will return as soon as the message is queued. -If any of the above limitations is not respected the method returns an -explicit error message stating the issue. - -[comment]: # (GENERATE-FROM-SCHEMA-START) +If any of the above limitations is not respected the method returns an explicit error message stating the issue. On success, an object is returned, containing: -- **status** (string): Information about where message was queued +- **status** (string): Information about where message was queued. + +EXAMPLE JSON RESPONSE +--------------------- -[comment]: # (GENERATE-FROM-SCHEMA-END) +```json +{ + "status": "Message sent to connectd for delivery" +} +``` AUTHOR ------ @@ -51,5 +65,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:5603fac5f46c7f91c625b33d98df1a2a587262788465ebd1db24433989425a2e) diff --git a/doc/lightning-sendinvoice.7.md b/doc/lightning-sendinvoice.7.md index ffa633a7d10f..bd79ddb8c077 100644 --- a/doc/lightning-sendinvoice.7.md +++ b/doc/lightning-sendinvoice.7.md @@ -6,42 +6,78 @@ SYNOPSIS **(WARNING: experimental-offers only)** -**sendinvoice** *invreq* *label* [*amount\_msat*] [*timeout*] [*quantity*] +**sendinvoice** *invreq* *label* [*amount\_msat*] [*timeout*] [*quantity*] DESCRIPTION ----------- -The **sendinvoice** RPC command creates and sends an invoice to the -issuer of an *invoice\_request* for it to pay: lightning-invoicerequest(7). +The **sendinvoice** RPC command creates and sends an invoice to the issuer of an *invoice\_request* for it to pay: lightning-invoicerequest(7). -If **fetchinvoice-noconnect** is not specified in the configuation, it -will connect to the destination in the (currently common!) case where it -cannot find a route which supports `option_onion_messages`. +If **fetchinvoice-noconnect** is not specified in the configuation, it will connect to the destination in the (currently common!) case where it cannot find a route which supports `option_onion_messages`. + +- **invreq** (string): The bolt12 invoice\_request string beginning with `lnr1`. +- **label** (one of): The unique label to use for this invoice.: + - (string) + - (integer) +- **amount\_msat** (msat, optional): Required if the *offer* does not specify an amount at all, or specifies it in a different currency. Otherwise you may set it (e.g. to provide a tip). The default is the amount contained in the offer (multiplied by *quantity* if any). +- **timeout** (u32, optional): Seconds to wait for the offering node to pay the invoice or return an error. This will also be the timeout on the invoice that is sent. The default is 90 seconds. +- **quantity** (u64, optional): Quantity is is required if the offer specifies quantity\_max, otherwise it is not allowed. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:sendinvoice#1", + "method": "sendinvoice", + "params": { + "invreq": "lnr1qqg804wzdsyn8g4mf2yc22k8xvjpjzstwd5k6urvv5s8getnw3gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02gqsykppqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4nuzqw5w7y7xqm2rushk5a5n3mcuvqel954raykd5nqa830nq9hpd4s4fcnxw266vp9d5c8f3m3w40hmm6gm8akxx3rsnr7d4usunv0x3q8q", + "label": "payme for real!" + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **label** (string): unique label supplied at invoice creation -- **description** (string): description used in the invoice -- **payment\_hash** (hash): the hash of the *payment\_preimage* which will prove payment -- **status** (string): Whether it's paid, unpaid or unpayable (one of "unpaid", "paid", "expired") -- **expires\_at** (u64): UNIX timestamp of when it will become / became unpayable -- **created\_index** (u64): 1-based index indicating order this invoice was created in *(added v23.08)* -- **amount\_msat** (msat, optional): the amount required to pay this invoice -- **bolt12** (string, optional): the BOLT12 string -- **updated\_index** (u64, optional): 1-based index indicating order this invoice was changed (only present if it has changed since creation) *(added v23.08)* +- **label** (string): Unique label supplied at invoice creation. +- **description** (string): Description used in the invoice. +- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. +- **status** (string) (one of "unpaid", "paid", "expired"): Whether it's paid, unpaid or unpayable. +- **expires\_at** (u64): UNIX timestamp of when it will become / became unpayable. +- **created\_index** (u64): 1-based index indicating order this invoice was created in. *(added v23.08)* +- **amount\_msat** (msat, optional): The amount required to pay this invoice. +- **bolt12** (string, optional): The BOLT12 string. +- **updated\_index** (u64, optional): 1-based index indicating order this invoice was changed (only present if it has changed since creation). *(added v23.08)* If **status** is "paid": - - - **pay\_index** (u64): Unique incrementing index for this payment - - **amount\_received\_msat** (msat): the amount actually received (could be slightly greater than *amount\_msat*, since clients may overpay) - - **paid\_at** (u64): UNIX timestamp of when it was paid - - **payment\_preimage** (secret): proof of payment - -[comment]: # (GENERATE-FROM-SCHEMA-END) + - **pay\_index** (u64): Unique incrementing index for this payment. + - **amount\_received\_msat** (msat): The amount actually received (could be slightly greater than *amount\_msat*, since clients may overpay). + - **paid\_at** (u64): UNIX timestamp of when it was paid. + - **payment\_preimage** (secret): Proof of payment. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "label": "payme for real!", + "bolt12": "lni1qqg804wzdsyn8g4mf2yc22k8xvjpjzstwd5k6urvv5s8getnw3gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02gqsykppqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4ngycqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky96qmcmtl30xtt7jdakfyhzm8f0gny6f4d2ukx5gurem04z8lfd2wza5qs9pz6wp9vu7cm6n4wmmrz77y4w6z5xv4q93yudkdtkl5zmzdzuawzqqex7gd5v0x0r83pqj82udd542fl4krh50s0dkx47d0hd5wh77g52xxl75ccpkt35mc8n282wslju9ufyys2y8qqqqqqqqqqqqqqqpgqqqqqqqqqqqqp6f9jm7k9yqqqqqq2gpr96l99lfspt25zqnyfgu7hznmt2tzkjdt92d2wc3dsq7keph7w8gudjs46spfzqrlu4gqs9vppqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky9muzqpze8kk43g0wh4h8qlac5lswwesrvsaxcza2f5j90c2h3ts8yzmn9g4mxqe89fngrqny8nf52xxuxep6548etda8lp876jr0nnxgdkdq", + "payment_hash": "4c89473d714f6b52c56935655354ec45b007ad90dfce3a38d942ba8052200ffc", + "amount_msat": 2, + "status": "paid", + "pay_index": 1, + "amount_received_msat": 2, + "paid_at": 1708640865, + "payment_preimage": "305951ab02cb2ea5eb884dbfd8fb110b4e088ecb8338b3e84e8f9c70919c19bf", + "description": "simple test", + "expires_at": 1708640953, + "created_index": 2, + "updated_index": 1 +} +``` ERRORS ------ @@ -62,11 +98,9 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-fetchinvoice(7). +lightning-fetchinvoice(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:d0fbe11d7a39dce76da63f0d3e4d06ad7da6d94f5efcaaa8c43daafd192d86f9) diff --git a/doc/lightning-sendonion.7.md b/doc/lightning-sendonion.7.md index f2f4d14c827a..c5bc5b5ae93d 100644 --- a/doc/lightning-sendonion.7.md +++ b/doc/lightning-sendonion.7.md @@ -4,61 +4,108 @@ lightning-sendonion -- Send a payment with a custom onion packet SYNOPSIS -------- -**sendonion** *onion* *first\_hop* *payment\_hash* [*label*] [*shared\_secrets*] [*partid*] [*bolt11*] -[*amount\_msat*] [*destination*] +**sendonion** *onion* *first\_hop* *payment\_hash* [*label*] [*shared\_secrets*] [*partid*] [*bolt11*] [*amount\_msat*] [*destination*] [*localinvreqid*] [*groupid*] [*description*] DESCRIPTION ----------- -The **sendonion** RPC command can be used to initiate a payment attempt with a -custom onion packet. The onion packet is used to deliver instructions for hops -along the route on how to behave. Normally these instructions are indications -on where to forward a payment and what parameters to use, or contain details -of the payment for the final hop. However, it is possible to add arbitrary -information for hops in the custom onion, allowing for custom extensions that -are not directly supported by Core Lightning. +The **sendonion** RPC command can be used to initiate a payment attempt with a custom onion packet. The onion packet is used to deliver instructions for hops along the route on how to behave. Normally these instructions are indications on where to forward a payment and what parameters to use, or contain details of the payment for the final hop. However, it is possible to add arbitrary information for hops in the custom onion, allowing for custom extensions that are not directly supported by Core Lightning. -If the first element of *route* does not have "channel" set, a -suitable channel (if any) will be chosen, otherwise that specific -short-channel-id is used. The following is an example of a 3 hop onion: +If the first element of *route* does not have "channel" set, a suitable channel (if any) will be chosen, otherwise that specific short-channel-id is used. The following is an example of a 3 hop onion: ```json [ - "298606954e9de3e9d938d18a74fed794c440e8eda82e52dc08600953c8acf9c4", - "2dc094de72adb03b90894192edf9f67919cb2691b37b1f7d4a2f4f31c108b087", - "a7b82b240dbd77a4ac8ea07709b1395d8c510c73c17b4b392bb1f0605d989c85" + "298606954e9de3e9d938d18a74fed794c440e8eda82e52dc08600953c8acf9c4", + "2dc094de72adb03b90894192edf9f67919cb2691b37b1f7d4a2f4f31c108b087", + "a7b82b240dbd77a4ac8ea07709b1395d8c510c73c17b4b392bb1f0605d989c85" ] ``` +- **onion** (hex): Hex-encoded 1366 bytes long blob that was returned by either of the tools that can generate onions. It contains the payloads destined for each hop and some metadata. Please refer to [BOLT 04][bolt04] for further details. If is specific to the route that is being used and the *payment\_hash* used to construct, and therefore cannot be reused for other payments or to attempt a separate route. The custom onion can generally be created using the `devtools/onion` CLI tool, or the **createonion** RPC command. +- **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*.: + - **id** (pubkey): Node id for the peer. Use any available channel available to this peer. + - **amount\_msat** (msat): The amount to add an HTLC for millisatoshis. + - **delay** (u16): The number of blocks delay of blocks on top of the current blockheight. +- **payment\_hash** (hash): Specifies the 32 byte hex-encoded hash to use as a challenge to the HTLC that we are sending. It is specific to the onion and has to match the one the onion was created with. +- **label** (string, optional): Can be used to provide a human readable reference to retrieve the payment at a later time. +- **shared\_secrets** (array of secrets, optional): A JSON list of 32 byte hex-encoded secrets that were used when creating the onion. Core Lightning can send a payment with a custom onion without the knowledge of these secrets, however it will not be able to parse an eventual error message since that is encrypted with the shared secrets used in the onion. If *shared\_secrets* is provided Core Lightning will decrypt the error, act accordingly, e.g., add a `channel_update` included in the error to its network view, and set the details in *listsendpays* correctly. If it is not provided Core Lightning will store the encrypted onion, and expose it in *listsendpays* allowing the caller to decrypt it externally. If it is not provided the Core Lightning node does not know how long the route is, which channels or nodes are involved, and what an eventual error could have been. It can therefore be used for oblivious payments.: + - (secret, optional) +- **partid** (u16, optional): If provided and non-zero, allows for multiple parallel partial payments with the same *payment\_hash*. +- **bolt11** (string, optional): If provided, it will be returned in *waitsendpay* and *listsendpays* results. +- **amount\_msat** (msat, optional): Used to annotate the payment, and is returned by *waitsendpay* and *listsendpays*. +- **destination** (pubkey, optional): If provided, it will be returned in **listpays** result. +- **localinvreqid** (hash, optional): `localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7). +- **groupid** (u64, optional): Grouping key to disambiguate multiple attempts to pay an invoice or the same payment\_hash. +- **description** (string, optional): If provided, it will be returned in *waitsendpay* and *listsendpays* results. *(added v0.11.0)* + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:sendonion#1", + "method": "sendonion", + "params": { + "onion": "00034928294556b10308f9aeac7a240223d4d5f72097db1ef36a36b10cab937f2f205ed7218b47d4600eaf7fd390940bf9a6cdac99aafdb4783c468150eeeab9b57e56a06778d023ffb3bb84c7d8c2ad8868b61c28b566634af52c288ed6569583db66f5bd0edfb801c252f078020e1df6359af5969296b4698a71d17c5ca6e5ee4b64b7cce3ad0a1aa31e6be4d5fe3a31fa7a25259c640716020a9a248ca3ebb68eb823f8884b5df3710969f4c2ffb153779a923bab946ed43c1f6658d7f8e7e25303bb78ef4862fb550b8b1c79d522b035eedfda9ab70a61322522acf7233bb8ea2423958448fc8ac3d000835fda04bf661f1bf2ad2d091f506840bb2f10f82c0812149d99267a47824defe90877ed70db526b2200e18dccb92b17516de3778c055645728eadf4c74375aa0aae80a7773a536a908ca1e25c0fdca90e50ce0be05eeb973ec5e83ce3ab6b35818e021780428af81320a694483c1c15f64e685ba1fd3b1e1b926e6b4ec9eeeac8aca60c60e0f0f583e35e7f081dc6f4c64157e100c79c4c25101bed77cd9f93416f9a67d9f1916a782c498c38365af4a5fabb1b745fa840a054a06564c3f4b376aeb72cdd059d3794c82bbbf12a1f62234016a6912b384e7e4cebbd39ee4395aeff43c461e226d1e0151cce508a181a9c61275bf4b89e4556cf24df13b993dec96541555f8b9a699be9488568a11ac7f25849da62765472511ad74a6660c10e37f5fa13d4e4665ef7825ae1f2da4a86d5581912262de89b4b11a722fd127b31aa0d7fab8c679b07bf95e65cb80b2dacb5b90794399fb8f23823f68058431aa1c399b5baceccaf8521d004f45dba6ec1fddc54473343e9e67cd50cc3f2f3d8a5dab8a7ab9ae553dc3cd34e74b858da75975265f7c673a25e8d01a5130ab40eaba712b80c608cd0431b4b45ea0d81af595e21f24976608429127bf586f7507666500bc7245cf9266fa0bd0e58404c496e190c873cd143ace9048e9d5021c23967a24e09f2e54166e54b4ee8888dc1af535624e7ee8b426c1628175017a9e8a73eb1d0d49028a4f4d77897f3c08f1cd7bdee2b00f9bb9eadc49a69bf4f6c0cb2c95a16f03d7958f1b8f83cb40ae87ddf75f26050e2c2ed9f8f8523b3d389a50b217bda651dc21f095fe7d2d3851a0a6cf01051f3f3c6f1ad59ed46d44928d15a0e6e1bd4df4c99bdb82a05b0e781b69a73bc30fe579c8ac9fe8aeb6beb1c0f44def2775b7341af37e6ef58ceb34958b29d3e36112b78644612228761b8badc802f0b2b8fcaeb1db8f3a8db4afa2d7b4540a7c331db6f5141fa3909a513df875ff8a63f5b542d662781ca96a69e3b2925d6a63555b2c5825ffb2ad848d71122f54110e0d203000f3e9cc23b793c3540dfb8d881caedd25055a8f495e9e7a0391dbf9cbd9344f7df659ee8d3ce5ec16217ab83e1394ba991eb8ffd9a869f8ebb2e2428845e779979c57b5f8875f502728229a55ce87b3eba85c75264d30eaf7b373f6b09ba3086d9e98348d87b049468c2c30a6501cb2a3862f1703bbf29895e8b4262353eae720ed8ae678750011e2eb51f4800d3f4725fa873d7deec1c46f77a5f61c73dc938239e77f432bcc245c7b935413c51c0bc92bdaae144452aa95910909e46e500557961203f4e1483b9c09c124464907825e1ff74c87c58d6e2e91970baac9b89a554beca6df9acee16d77dd929d0caa7797e06f2c384c03fdedc89c697b9c34787a50cf399a8d7f195e79b347efc8267c474a477ce210f11049d432b280eaf3fccd451f6218d35c64cbd1006bcc54eeea8b856855c9aa92bc3adc6900a7c7a0eee09834c5a1f2da3d8ea9a478aea90c954952ad2a72d3856350ac3132d17e1e8116fa774066a22c857a827699c98285111a405e74685a3ae579ae78c545774f45491e4935bf4", + "first_hop": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "channel": "103x3x0", + "direction": 1, + "amount_msat": 1002, + "delay": 21, + "style": "tlv" + }, + "payment_hash": "f584c14bb23506acdd94cf3cea377f3cc5805f3cba5430bc3756ef83ede1a0dc", + "label": null, + "shared_secrets": null, + "partid": null, + "bolt11": null, + "amount_msat": null, + "destination": null + } +} +``` + RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **created\_index** (u64): 1-based index indicating order this payment was created in *(added v23.11)* -- **id** (u64): old synonym for created\_index -- **payment\_hash** (hash): the hash of the *payment\_preimage* which will prove payment -- **status** (string): status of the payment (could be complete if already sent previously) (one of "pending", "complete") -- **created\_at** (u64): the UNIX timestamp showing when this payment was initiated -- **amount\_sent\_msat** (msat): The amount sent -- **amount\_msat** (msat, optional): The amount delivered to destination (if known) -- **destination** (pubkey, optional): the final destination of the payment if known -- **label** (string, optional): the label, if given to sendpay -- **bolt11** (string, optional): the bolt11 string (if supplied) -- **bolt12** (string, optional): the bolt12 string (if supplied: **experimental-offers** only). -- **partid** (u64, optional): the partid (if supplied) to sendonion/sendpay +- **created\_index** (u64): 1-based index indicating order this payment was created in. *(added v23.11)* +- **id** (u64): Old synonym for created\_index. +- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. +- **status** (string) (one of "pending", "complete"): Status of the payment (could be complete if already sent previously). +- **created\_at** (u64): The UNIX timestamp showing when this payment was initiated. +- **amount\_sent\_msat** (msat): The amount sent. +- **amount\_msat** (msat, optional): The amount delivered to destination (if known). +- **destination** (pubkey, optional): The final destination of the payment if known. +- **label** (string, optional): The label, if given to sendpay. +- **bolt11** (string, optional): The bolt11 string (if supplied). +- **bolt12** (string, optional): The bolt12 string (if supplied: **experimental-offers** only). +- **partid** (u64, optional): The partid (if supplied) to sendonion/sendpay. If **status** is "complete": - - - **payment\_preimage** (secret): the proof of payment: SHA256 of this **payment\_hash** - - **updated\_index** (u64, optional): 1-based index indicating order this payment was changed *(added v23.11)* + - **payment\_preimage** (secret): The proof of payment: SHA256 of this **payment\_hash**. + - **updated\_index** (u64, optional): 1-based index indicating order this payment was changed. *(added v23.11)* If **status** is "pending": + - **message** (string, optional): Monitor status with listpays or waitsendpay. - - **message** (string, optional): Monitor status with listpays or waitsendpay +EXAMPLE JSON RESPONSE +--------------------- -[comment]: # (GENERATE-FROM-SCHEMA-END) +```json +{ + "message": "Monitor status with listpays or waitsendpay", + "created_index": 1, + "id": 1, + "payment_hash": "f584c14bb23506acdd94cf3cea377f3cc5805f3cba5430bc3756ef83ede1a0dc", + "groupid": 1, + "amount_sent_msat": 1002, + "created_at": 1706315098, + "status": "pending" +} +``` ERRORS ------ @@ -66,8 +113,8 @@ ERRORS The following error codes may occur: - 202: an parseable onion -- the error details are decrypted and presented here, if *shared\_secrets* was provided and an error was returned by one of the -intermediate nodes + +the error details are decrypted and presented here, if *shared\_secrets* was provided and an error was returned by one of the intermediate nodes AUTHOR ------ @@ -85,5 +132,3 @@ RESOURCES Main web site: [bolt04]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md - -[comment]: # ( SHA256STAMP:eb3725c7a47c32298ca9e13ad6ef3fc90a818354b21fc0b17abd16d8e9515a24) diff --git a/doc/lightning-sendonionmessage.7.md b/doc/lightning-sendonionmessage.7.md index 6b0e01999bee..af5fb7fc61af 100644 --- a/doc/lightning-sendonionmessage.7.md +++ b/doc/lightning-sendonionmessage.7.md @@ -1,28 +1,30 @@ lightning-sendonionmessage -- low-level command to send an onion message -================================================================ +======================================================================== SYNOPSIS -------- **(WARNING: experimental-onion-messages only)** -**sendonionmessage** *first\_id* *blinding* *hops* +**sendonionmessage** *first\_id* *blinding* *hops* DESCRIPTION ----------- -The **sendonionmessage** RPC command can be used to send a message via -the lightning network. These are currently used by *offers* to request -and receive invoices. +The **sendonionmessage** RPC command can be used to send a message via the lightning network. These are currently used by *offers* to request and receive invoices. + +- **first\_id** (pubkey): The (presumably well-known) public key of the start of the path. +- **blinding** (pubkey): Blinding factor for this path. +- **hops** (array of objects): + : + - **node** (pubkey): Public key of the node. + - **tlv** (u8): Contains a hexadecimal TLV to include. RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an empty object is returned. -[comment]: # (GENERATE-FROM-SCHEMA-END) - AUTHOR ------ @@ -31,7 +33,7 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-fetchinvoice(7), lightning-offer(7). +lightning-fetchinvoice(7), lightning-offer(7) RESOURCES --------- @@ -39,5 +41,3 @@ RESOURCES Main web site: [bolt04]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md - -[comment]: # ( SHA256STAMP:3faddc7dd03a73725f4a3e7249c7a417a11c6ac31f8666a9df2a8e5ebcfe2875) diff --git a/doc/lightning-sendpay.7.md b/doc/lightning-sendpay.7.md index 76ce0d6e0cf7..eb6306c00597 100644 --- a/doc/lightning-sendpay.7.md +++ b/doc/lightning-sendpay.7.md @@ -4,105 +4,180 @@ lightning-sendpay -- Low-level command for sending a payment via a route SYNOPSIS -------- -**sendpay** *route* *payment\_hash* [*label*] [*amount\_msat*] -[*bolt11*] [*payment\_secret*] [*partid*] [*localinvreqid*] [*groupid*] -[*payment\_metadata*] [*description*] +**sendpay** *route* *payment\_hash* [*label*] [*amount\_msat*] [*bolt11*] [*payment\_secret*] [*partid*] [*localinvreqid*] [*groupid*] [*payment\_metadata*] [*description*] DESCRIPTION ----------- -The **sendpay** RPC command attempts to send funds associated with the -given *payment\_hash*, along a route to the final destination in the -route. - -Generally, a client would call lightning-getroute(7) to resolve a route, -then use **sendpay** to send it. If it fails, it would call -lightning-getroute(7) again to retry. If the route is empty, a payment-to-self is attempted. - -The response will occur when the payment is on its way to the -destination. The **sendpay** RPC command does not wait for definite -success or definite failure of the payment (except for already-succeeded -payments, or to-self payments). Instead, use the -**waitsendpay** RPC command to poll or wait for definite success or -definite failure. - -Once a payment has succeeded, calls to **sendpay** with the same -*payment\_hash* but a different *amount\_msat* or destination will fail; -this prevents accidental multiple payments. Calls to **sendpay** with -the same *payment\_hash*, *amount\_msat*, and destination as a previous -successful payment (even if a different route or *partid*) will return immediately -with success. +The **sendpay** RPC command attempts to send funds associated with the given *payment\_hash*, along a route to the final destination in the route. + +Generally, a client would call lightning-getroute(7) to resolve a route, then use **sendpay** to send it. If it fails, it would call lightning-getroute(7) again to retry. If the route is empty, a payment-to-self is attempted. + +The response will occur when the payment is on its way to the destination. The **sendpay** RPC command does not wait for definite success or definite failure of the payment (except for already-succeeded payments, or to-self payments). Instead, use the **waitsendpay** RPC command to poll or wait for definite success or definite failure. + +Once a payment has succeeded, calls to **sendpay** with the same *payment\_hash* but a different *amount\_msat* or destination will fail; this prevents accidental multiple payments. Calls to **sendpay** with the same *payment\_hash*, *amount\_msat*, and destination as a previous successful payment (even if a different route or *partid*) will return immediately with success. + +- **route** (array of objects): + - **id** (pubkey): The node at the end of this hop. + - **channel** (short\_channel\_id): The channel joining these nodes. + - **delay** (u32): The total CLTV expected by the node at the end of this hop. + - **amount\_msat** (msat): The amount expected by the node at the end of this hop. +- **payment\_hash** (hash): The hash of the payment\_preimage. +- **label** (string, optional): The label provided when creating the invoice\_request. +- **amount\_msat** (msat, optional): Amount must be provided if *partid* is non-zero, or the payment is to-self, otherwise it must be equal to the final amount to the destination. it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. The default is in millisatoshi precision. +- **bolt11** (string, optional): Bolt11 invoice to pay. If provided, will be returned in *waitsendpay* and *listsendpays* results. +- **payment\_secret** (secret, optional): Value that the final recipient requires to accept the payment, as defined by the `payment_data` field in BOLT 4 and the `s` field in the BOLT 11 invoice format. It is required if *partid* is non-zero. +- **partid** (u64, optional): Must not be provided for self-payments. If provided and non-zero, allows for multiple parallel partial payments with the same *payment\_hash*. The *amount\_msat* amount (which must be provided) for each **sendpay** with matching *payment\_hash* must be equal, and **sendpay** will fail if there are differing values given. +- **localinvreqid** (hex, optional): Indicates that this payment is being made for a local invoice\_request. This ensures that we only send a payment for a single-use invoice\_request once. +- **groupid** (u64, optional): Allows you to attach a number which appears in **listsendpays** so payments can be identified as part of a logical group. The *pay* plugin uses this to identify one attempt at a MPP payment, for example. +- **payment\_metadata** (hex, optional): Placed in the final onion hop TLV. *(added v0.11.0)* +- **description** (string, optional): Description used in the invoice. *(added v0.11.0)* + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:sendpay#1", + "method": "sendpay", + "params": { + "route": [ + { + "amount_msat": 11000000, + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "delay": 5, + "channel": "103x1x0" + } + ], + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "label": null, + "amount_msat": null, + "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk", + "payment_secret": "82644944d3f70d42aad1d5f7b5d7a629e7afa30b529cc952a4c59fc0e3790ea2", + "partid": null, + "groupid": null, + "payment_metadata": null + } +} +{ + "id": "example:sendpay#2", + "method": "sendpay", + "params": { + "route": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "channel": "103x1x0", + "direction": 1, + "amount_msat": 4211, + "style": "tlv", + "delay": 24 + }, + { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "channel": "105x1x0", + "direction": 0, + "amount_msat": 3710, + "style": "tlv", + "delay": 16 + }, + { + "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "channel": "107x1x0", + "direction": 1, + "amount_msat": 3210, + "style": "tlv", + "delay": 8 + } + ], + "payment_hash": "bc747053329402620a26bdc187cd134cdb699130d85be499ecd24160aff04c5c", + "label": null, + "amount_msat": null, + "bolt11": null, + "payment_secret": "c36a2fe9aced78c06960e2f21b369ed03f0492c97e53ba3b662163bcdaf1d7fa", + "partid": null, + "groupid": null, + "payment_metadata": null + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **created\_index** (u64): 1-based index indicating order this payment was created in *(added v23.11)* -- **id** (u64): old synonym for created\_index -- **payment\_hash** (hash): the hash of the *payment\_preimage* which will prove payment -- **status** (string): status of the payment (could be complete if already sent previously) (one of "pending", "complete") -- **created\_at** (u64): the UNIX timestamp showing when this payment was initiated -- **amount\_sent\_msat** (msat): The amount sent -- **updated\_index** (u64, optional): 1-based index indicating order this payment was changed (only present if it has changed since creation) *(added v23.11)* -- **groupid** (u64, optional): Grouping key to disambiguate multiple attempts to pay an invoice or the same payment\_hash -- **amount\_msat** (msat, optional): The amount delivered to destination (if known) -- **destination** (pubkey, optional): the final destination of the payment if known -- **completed\_at** (u64, optional): the UNIX timestamp showing when this payment was completed -- **label** (string, optional): the *label*, if given to sendpay -- **partid** (u64, optional): the *partid*, if given to sendpay -- **bolt11** (string, optional): the bolt11 string (if supplied) -- **bolt12** (string, optional): the bolt12 string (if supplied: **experimental-offers** only). +- **created\_index** (u64): 1-based index indicating order this payment was created in. *(added v23.11)* +- **id** (u64): Old synonym for created\_index. +- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. +- **status** (string) (one of "pending", "complete"): Status of the payment (could be complete if already sent previously). +- **created\_at** (u64): The UNIX timestamp showing when this payment was initiated. +- **amount\_sent\_msat** (msat): The amount sent. +- **updated\_index** (u64, optional): 1-based index indicating order this payment was changed (only present if it has changed since creation). *(added v23.11)* +- **groupid** (u64, optional): Grouping key to disambiguate multiple attempts to pay an invoice or the same payment\_hash. +- **amount\_msat** (msat, optional): The amount delivered to destination (if known). +- **destination** (pubkey, optional): The final destination of the payment if known. +- **completed\_at** (u64, optional): The UNIX timestamp showing when this payment was completed. +- **label** (string, optional): The *label*, if given to sendpay. +- **partid** (u64, optional): The *partid*, if given to sendpay. +- **bolt11** (string, optional): The bolt11 string (if supplied). +- **bolt12** (string, optional): The bolt12 string (if supplied: **experimental-offers** only). If **status** is "complete": - - - **payment\_preimage** (secret): the proof of payment: SHA256 of this **payment\_hash** + - **payment\_preimage** (secret): The proof of payment: SHA256 of this **payment\_hash**. If **status** is "pending": - - - **message** (string): Monitor status with listpays or waitsendpay - -[comment]: # (GENERATE-FROM-SCHEMA-END) + - **message** (string): Monitor status with listpays or waitsendpay. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "message": "Monitor status with listpays or waitsendpay", + "created_index": 1, + "id": 1, + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "groupid": 1, + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount_msat": 11000000, + "amount_sent_msat": 11000000, + "created_at": 1706152930, + "status": "pending", + "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk" +} +{ + "message": "Monitor status with listpays or waitsendpay", + "created_index": 2, + "id": 2, + "payment_hash": "bc747053329402620a26bdc187cd134cdb699130d85be499ecd24160aff04c5c", + "groupid": 1, + "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "amount_msat": 3210, + "amount_sent_msat": 4211, + "created_at": 1708624260, + "status": "pending" +} +``` ERRORS ------ -On error, if the error occurred from a node other than the final -destination, the route table will be updated so that -lightning-getroute(7) should return an alternate route (if any). An -error from the final destination implies the payment should not be -retried. - -The following error codes may occur: - -- -1: Catchall nonspecific error. -- 201: Already paid with this *hash* using different amount or - destination. -- 202: Unparseable onion reply. The *data* field of the error will - have an *onionreply* field, a hex string representation of the raw - onion reply. -- 203: Permanent failure at destination. The *data* field of the error - will be routing failure object. -- 204: Failure along route; retry a different route. The *data* field - of the error will be routing failure object. -- 212: *localinvreqid* refers to an invalid, or used, local invoice\_request. +On error, if the error occurred from a node other than the final destination, the route table will be updated so that lightning-getroute(7) should return an alternate route (if any). An error from the final destination implies the payment should not be retried. + +- -1: Catchall nonspecific error. +- 201: Already paid with this *hash* using different amount or destination. +- 202: Unparseable onion reply. The *data* field of the error will have an *onionreply* field, a hex string representation of the raw onion reply. +- 203: Permanent failure at destination. The *data* field of the error will be routing failure object. +- 204: Failure along route; retry a different route. The *data* field of the error will be routing failure object. +- 212: *localinvreqid* refers to an invalid, or used, local invoice\_request. A routing failure object has the fields below: -- *erring\_index*. The index of the node along the route that reported - the error. 0 for the local node, 1 for the first hop, and so on. -- *erring\_node*. The hex string of the pubkey id of the node that - reported the error. -- *erring\_channel*. The short channel ID of the channel that has - the error, or *0:0:0* if the destination node raised the error. In - addition *erring\_direction* will indicate which direction of the - channel caused the failure. -- *failcode*. The failure code, as per BOLT \#4. -- *channel\_update*. The hex string of the *channel\_update* message - received from the remote node. Only present if error is from the - remote node and the *failcode* has the UPDATE bit set, as per BOLT - \#4. +*erring\_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on. +*erring\_node*: The hex string of the pubkey id of the node that reported the error. +*erring\_channel*: The short channel ID of the channel that has the error, or *0:0:0* if the destination node raised the error. In addition *erring\_direction* will indicate which direction of the channel caused the failure. +*failcode*: The failure code, as per BOLT #4. +*channel\_update*: The hex string of the *channel\_update* message received from the remote node. Only present if error is from the remote node and the *failcode* has the UPDATE bit set, as per BOLT #4. AUTHOR ------ @@ -112,13 +187,9 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-listinvoice(7), lightning-delinvoice(7), -lightning-getroute(7), lightning-invoice(7), lightning-pay(7), -lightning-waitsendpay(7). +lightning-listinvoice(7), lightning-delinvoice(7), lightning-getroute(7), lightning-invoice(7), lightning-pay(7), lightning-waitsendpay(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:663977d29846cd633000accebcb272e7983764e5f7aea8704517451836294a46) diff --git a/doc/lightning-sendpsbt.7.md b/doc/lightning-sendpsbt.7.md index d76bd544aa66..60fb5726ad00 100644 --- a/doc/lightning-sendpsbt.7.md +++ b/doc/lightning-sendpsbt.7.md @@ -4,27 +4,35 @@ lightning-sendpsbt -- Command to finalize, extract and send a partially signed b SYNOPSIS -------- -**sendpsbt** *psbt* [*reserve*] +**sendpsbt** *psbt* [*reserve*] DESCRIPTION ----------- The **sendpsbt** is a low-level RPC command which sends a fully-signed PSBT. -- **psbt** (string): the fully signed psbt to be sent -- **reserve** (u32, optional): number of blocks to increase reservation of any of our inputs by. Default is 72 +- **psbt** (string): The fully signed psbt to be sent. +- **reserve** (u32, optional): Number of blocks to increase reservation of any of our inputs by. The default is 72. EXAMPLE JSON REQUEST -------------------- ```json { - "id": 82, + "id": "example:sendpsbt#1", "method": "sendpsbt", "params": { "psbt": "some_psbt" } } +{ + "id": "example:sendpsbt#2", + "method": "sendpsbt", + "params": { + "psbt": "cHNidP8BAM0CAAAABEV+dnFRINmyeHxi4Id0OrcuzI5au5/BlPtTfu7E2m3EAAAAAAD9////cv8oioDx+0NCEnjBSYtnwF0H4VR13j+bkyb5gOOQLUUBAAAAAP3///8ehOrKm7JEq6zflkp9+zmSwE1iPe1yh3KTXvk+om/legEAAAAA/f///2s31wNrI1UavMgjC1GyrOHNbxOm68KYa13WX/mGfmjcAQAAAAD9////AcEAPQAAAAAAFgAUyQltQ/QI6lJgICYsza18hRa5KoEAAAAAAAEAcQIAAAABTzfqjIqV1wPpqc/3/Cb+tMX5EDrLmnhb5BMNx3aB/hYAAAAAAP3///8CQEIPAAAAAAAWABR9CNmX36nN45+GhjqvD4LjLMMMg/+juSkBAAAAFgAUJB0adsMdjkacZWrLwyteqfOaTrRlAAAAAQEfQEIPAAAAAAAWABR9CNmX36nN45+GhjqvD4LjLMMMgyICA1p5u7tAbUvCjfBfpqhzKM+wKn4TdDvs3NHfz+BxwuAQRzBEAiBwFb9rA0nUVlIPGd2aaiRbJ+KH4MLM3Bu+f0JuXB/hwAIgT2rrIUG9gXBZoH9fcPjCnbbM1SR4GiLYGLeALB8yENoBIgYDWnm7u0BtS8KN8F+mqHMoz7AqfhN0O+zc0d/P4HHC4BAIfQjZlwAAAAAAAQBxAgAAAAGANpEFI+CgfALTim/MWsAa62g+EmFWrFrzBDBCmCB3MgAAAAAA/f///wKZKdgpAQAAABYAFB+xhfU1pgl9WIvDKzAHZp8UeNkzQEIPAAAAAAAWABQHHEnK0vQg88gF+fa5ilcmnLFBUGUAAAABAR9AQg8AAAAAABYAFAccScrS9CDzyAX59rmKVyacsUFQIgICXTcoCCnxhsuZXNzL8jirRWQBOTlzUTljJKNldd803f9HMEQCIDtx/kEoc4PHDDm4eX5SEOmuRGu7ShpEG7xKBbuD/NjiAiBYkIKod39dcBarCT7Dbchkuwx70tJhOxQSJi2EMioGrwEiBgJdNygIKfGGy5lc3MvyOKtFZAE5OXNROWMko2V13zTd/wgHHEnKAAAAAAABAHECAAAAAVHU7RCZylzRMdlMBJ2ba4XKxv0l7LdWVnPYS6mhkf60AAAAAAD9////Av5VbSkBAAAAFgAU0BhRKzRbIC6H+s6j86d6cMpTNNhAQg8AAAAAABYAFD1D0ia8wnAZreUtej3FKnrBvii4ZQAAAAEBH0BCDwAAAAAAFgAUPUPSJrzCcBmt5S16PcUqesG+KLgiAgKKWZFo08l968cbxm5icOzwVPMA2Igwm6BUcaSCF13ZMEcwRAIgNAeIVGvUj9MWM18am0dx3JtEf79iQMX7Rqz1tttes3ICIAtNCglUlvpSidAxc/xoiy9cA13bgimJx25G+eZXfYJeASIGAopZkWjTyX3rxxvGbmJw7PBU8wDYiDCboFRxpIIXXdkwCD1D0iYAAAAAAAEAcQIAAAABRX52cVEg2bJ4fGLgh3Q6ty7Mjlq7n8GU+1N+7sTabcQBAAAAAP3///8CMmGqKQEAAAAWABSxLq0p9YAKl+hX7pFc0K/X+PIWmUBCDwAAAAAAFgAUZhwjt5DdNJE3OvCx2L7Qh31c3iJlAAAAAQEfQEIPAAAAAAAWABRmHCO3kN00kTc68LHYvtCHfVzeIiICA/qclQheQrHlADzR9BgXjDDJbkrneVTKD8SMWIJv9OsORzBEAiBKABqNV7cF5DKhtd+m+ZEmWF21vBt2uBKnzeDuUFqvDwIgJc6+/6GQqIfz869kJpUFTAMYTeL2qWR6d28EQEOJgkMBIgYD+pyVCF5CseUAPNH0GBeMMMluSud5VMoPxIxYgm/06w4IZhwjtwAAAAAAAA==", + "reserve": null + } +} ``` RETURN VALUE @@ -32,30 +40,35 @@ RETURN VALUE On success, an object is returned, containing: -- **tx** (hex): The raw transaction which was sent -- **txid** (txid): The txid of the **tx** - -ERRORS ------- - -On failure, one of the following error codes may be returned: - -- -32602: Error in given parameters or some error happened during the command process. +- **tx** (hex): The raw transaction which was sent. +- **txid** (txid): The txid of the **tx**. EXAMPLE JSON RESPONSE --------------------- ```json { - "txid": "05985072bbe20747325e69a159fe08176cc1bbc96d25e8848edad2dddc1165d0", - "tx": "02000000027032912651fc25a3e0893acd5f9640598707e2dfef92143bb5a4020e335442800100000017160014a5f48b9aa3cb8ca6cc1040c11e386745bb4dc932ffffffffd229a4b4f78638ebcac10a68b0561585a5d6e4d3b769ad0a909e9b9afaeae24e00000000171600145c83da9b685f9142016c6f5eb5f98a45cfa6f686ffffffff01915a01000000000017a9143a4dfd59e781f9c3018e7d0a9b7a26d58f8d22bf8700000000", + "txid": "05985072bbe20747325e69a159fe08176cc1bbc96d25e8848edad2dddc1165d0", + "tx": "02000000027032912651fc25a3e0893acd5f9640598707e2dfef92143bb5a4020e335442800100000017160014a5f48b9aa3cb8ca6cc1040c11e386745bb4dc932ffffffffd229a4b4f78638ebcac10a68b0561585a5d6e4d3b769ad0a909e9b9afaeae24e00000000171600145c83da9b685f9142016c6f5eb5f98a45cfa6f686ffffffff01915a01000000000017a9143a4dfd59e781f9c3018e7d0a9b7a26d58f8d22bf8700000000" +} +{ + "tx": "02000000000104457e76715120d9b2787c62e087743ab72ecc8e5abb9fc194fb537eeec4da6dc40000000000fdffffff72ff288a80f1fb43421278c1498b67c05d07e15475de3f9b9326f980e3902d450100000000fdffffff1e84eaca9bb244abacdf964a7dfb3992c04d623ded728772935ef93ea26fe57a0100000000fdffffff6b37d7036b23551abcc8230b51b2ace1cd6f13a6ebc2986b5dd65ff9867e68dc0100000000fdffffff01c1003d0000000000160014c9096d43f408ea526020262ccdad7c8516b92a810247304402207015bf6b0349d456520f19dd9a6a245b27e287e0c2ccdc1bbe7f426e5c1fe1c002204f6aeb2141bd817059a07f5f70f8c29db6ccd524781a22d818b7802c1f3210da0121035a79bbbb406d4bc28df05fa6a87328cfb02a7e13743becdcd1dfcfe071c2e0100247304402203b71fe41287383c70c39b8797e5210e9ae446bbb4a1a441bbc4a05bb83fcd8e20220589082a8777f5d7016ab093ec36dc864bb0c7bd2d2613b1412262d84322a06af0121025d37280829f186cb995cdccbf238ab45640139397351396324a36575df34ddff024730440220340788546bd48fd316335f1a9b4771dc9b447fbf6240c5fb46acf5b6db5eb37202200b4d0a095496fa5289d03173fc688b2f5c035ddb822989c76e46f9e6577d825e0121028a599168d3c97debc71bc66e6270ecf054f300d888309ba05471a482175dd9300247304402204a001a8d57b705e432a1b5dfa6f99126585db5bc1b76b812a7cde0ee505aaf0f022025cebeffa190a887f3f3af642695054c03184de2f6a9647a776f044043898243012103fa9c95085e42b1e5003cd1f418178c30c96e4ae77954ca0fc48c58826ff4eb0e00000000", + "txid": "43bb1c1bce6763ffe4d5df6b49f152f907f36f7849e55bb56075e2b256d17502" } ``` +ERRORS +------ + +On failure, one of the following error codes may be returned: + +- -32602: Error in given parameters or some error happened during the command process. + AUTHOR ------ -Vincenzo Palazzo <> wrote the initial version of this man page, but many others did the hard work of actually implementing this rpc command. +Vincenzo Palazzo <> wrote the initial version of this man page, +but many others did the hard work of actually implementing this rpc command. SEE ALSO -------- @@ -66,5 +79,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:e1ba1085f321e876c047232a3923fe3340481010c8c7dcf1d1dddaa723589134) diff --git a/doc/lightning-setchannel.7.md b/doc/lightning-setchannel.7.md index 3ad12141627c..78acb95c4bab 100644 --- a/doc/lightning-setchannel.7.md +++ b/doc/lightning-setchannel.7.md @@ -1,43 +1,108 @@ lightning-setchannel -- Command for configuring fees / htlc range advertized for a channel -=========================================================================================== +========================================================================================== SYNOPSIS -------- -**setchannel** *id* [*feebase*] [*feeppm*] [*htlcmin*] [*htlcmax*] [*enforcedelay*] [*ignorefeelimits*] +**setchannel** *id* [*feebase*] [*feeppm*] [*htlcmin*] [*htlcmax*] [*enforcedelay*] [*ignorefeelimits*] DESCRIPTION ----------- -The **setchannel** RPC command sets channel specific routing fees, and -`htlc_minimum_msat` or `htlc_maximum_msat` as defined in BOLT \#7. The channel has to be in -normal or awaiting state. This can be checked by **listpeers** -reporting a *state* of CHANNELD\_NORMAL or CHANNELD\_AWAITING\_LOCKIN -for the channel. - -These changes (for a public channel) will be broadcast to the rest of -the network (though many nodes limit the rate of such changes they -will accept: we allow 2 a day, with a few extra occasionally). +The **setchannel** RPC command sets channel specific routing fees, and `htlc_minimum_msat` or `htlc_maximum_msat` as defined in BOLT #7. The channel has to be in normal or awaiting state. This can be checked by **listpeers** reporting a *state* of CHANNELD\_NORMAL or CHANNELD\_AWAITING\_LOCKIN for the channel. + +These changes (for a public channel) will be broadcast to the rest of the network (though many nodes limit the rate of such changes they will accept: we allow 2 a day, with a few extra occasionally). + +- **id** (string): Should contain a scid (short channel ID), channel id or peerid (pubkey) of the channel to be modified. If *id* is set to `all`, the updates are applied to all channels in states CHANNELD\_NORMAL CHANNELD\_AWAITING\_LOCKIN or DUALOPEND\_AWAITING\_LOCKIN. If *id* is a peerid, all channels with the +peer in those states are changed. +- **feebase** (msat, optional): Value in millisatoshi that is added as base fee to any routed payment: if omitted, it is unchanged. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. +- **feeppm** (u32, optional): Value that is added proportionally per-millionths to any routed payment volume in satoshi. For example, if ppm is 1,000 and 1,000,000 satoshi is being routed through the channel, an proportional fee of 1,000 satoshi is added, resulting in a 0.1% fee. +- **htlcmin** (msat, optional): Value that limits how small an HTLC we will forward: if omitted, it is unchanged. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. Note that the peer also enforces a minimum for the channel: setting it below that will simply set it to that value with a warning. Also note that *htlcmin* only applies to forwarded HTLCs: we can still send smaller payments ourselves. The default is no lower limit. +- **htlcmax** (msat, optional): Value that limits how large an HTLC we will forward: if omitted, it is unchanged. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. Note that *htlcmax* only applies to forwarded HTLCs: we can still send larger payments ourselves. The default is no effective limit. +- **enforcedelay** (u32, optional): Number of seconds to delay before enforcing the new fees/htlc max. This gives the network a chance to catch up with the new rates and avoids rejecting HTLCs before they do. This only has an effect if rates are increased (we always allow users to overpay fees) or *htlcmax* is decreased, and only applied to a single rate increase per channel (we don't remember an arbitrary number of prior feerates) and if the node is restarted the updated configuration is enforced immediately. The default is 600, which is ten minutes. +- **ignorefeelimits** (boolean, optional): If set to True means to allow the peer to set the commitment transaction fees (or closing transaction fees) to any value they want. This is dangerous: they could set an exorbitant fee (so HTLCs are unenforcable), or a tiny fee (so that commitment transactions cannot be relayed), but avoids channel breakage in case of feerate disagreements. (Note: the global `ignore_fee_limits` setting overrides this). *(added v23.08)* + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:setchannel#1", + "method": "setchannel", + "params": { + "id": "103x1x0", + "feebase": null, + "feeppm": null, + "htlcmin": null, + "htlcmax": null, + "enforcedelay": null, + "ignorefeelimits": true + } +} +{ + "id": "example:setchannel#2", + "method": "setchannel", + "params": { + "id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", + "feebase": 4000, + "feeppm": 300, + "htlcmin": null, + "htlcmax": null, + "enforcedelay": 0, + "ignorefeelimits": null + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **channels** is returned. It is an array of objects, where each object contains: - -- **peer\_id** (pubkey): The node\_id of the peer -- **channel\_id** (hex): The channel\_id of the channel (always 64 characters) -- **fee\_base\_msat** (msat): The resulting feebase (this is the BOLT #7 name) -- **fee\_proportional\_millionths** (u32): The resulting feeppm (this is the BOLT #7 name) -- **ignore\_fee\_limits** (boolean): If we are now allowing peer to set feerate on commitment transaction without restriction *(added v23.08)* -- **minimum\_htlc\_out\_msat** (msat): The resulting htlcmin we will advertize (the BOLT #7 name is htlc\_minimum\_msat) -- **maximum\_htlc\_out\_msat** (msat): The resulting htlcmax we will advertize (the BOLT #7 name is htlc\_maximum\_msat) -- **short\_channel\_id** (short\_channel\_id, optional): the short\_channel\_id (if locked in) -- the following warnings are possible: - - **warning\_htlcmin\_too\_low**: The requested htlcmin was too low for this peer, so we set it to the minimum they will allow - - **warning\_htlcmax\_too\_high**: The requested htlcmax was greater than the channel capacity, so we set it to the channel capacity +On success, an object containing **channels** is returned. It is an array of objects, where each object contains: -[comment]: # (GENERATE-FROM-SCHEMA-END) +- **peer\_id** (pubkey): The node\_id of the peer. +- **channel\_id** (hash): The channel\_id of the channel. +- **fee\_base\_msat** (msat): The resulting feebase (this is the BOLT #7 name). +- **fee\_proportional\_millionths** (u32): The resulting feeppm (this is the BOLT #7 name). +- **ignore\_fee\_limits** (boolean): If we are now allowing peer to set feerate on commitment transaction without restriction. *(added v23.08)* +- **minimum\_htlc\_out\_msat** (msat): The resulting htlcmin we will advertize (the BOLT #7 name is htlc\_minimum\_msat). +- **maximum\_htlc\_out\_msat** (msat): The resulting htlcmax we will advertize (the BOLT #7 name is htlc\_maximum\_msat). +- **short\_channel\_id** (short\_channel\_id, optional): The short\_channel\_id (if locked in). +- the following warnings are possible: + - **warning\_htlcmin\_too\_low**: The requested htlcmin was too low for this peer, so we set it to the minimum they will allow. + - **warning\_htlcmax\_too\_high**: The requested htlcmax was greater than the channel capacity, so we set it to the channel capacity. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "channels": [ + { + "peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "channel_id": "90210d39d12a65d239ece267c5f48e0a82e7cb95724e658f6d99f370064faad1", + "short_channel_id": "103x1x0", + "fee_base_msat": 1, + "fee_proportional_millionths": 10, + "minimum_htlc_out_msat": 0, + "maximum_htlc_out_msat": 990000000, + "ignore_fee_limits": true + } + ] +} +{ + "channels": [ + { + "peer_id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", + "channel_id": "9c54c71bbbe59591cc3162e14fc4ff58c146f085c07d0f206ea679a8231d03ab", + "short_channel_id": "103x3x0", + "fee_base_msat": 4000, + "fee_proportional_millionths": 300, + "minimum_htlc_out_msat": 0, + "maximum_htlc_out_msat": 990000000, + "ignore_fee_limits": false + } + ] +} +``` ERRORS ------ @@ -45,25 +110,19 @@ ERRORS The following error codes may occur: - -1: Channel is in incorrect state, i.e. Catchall nonspecific error. -- -32602: JSONRPC2\_INVALID\_PARAMS, i.e. Given id is not a channel ID -or short channel ID. +- -32602: JSONRPC2\_INVALID\_PARAMS, i.e. Given id is not a channel ID or short channel ID. AUTHOR ------ -Michael Schmoock <> is the author of this -feature. Rusty Russell <> is mainly -responsible for the Core Lightning project. +Michael Schmoock <> is the author of this feature. SEE ALSO -------- -lightningd-config(5), lightning-fundchannel(7), -lightning-listchannels(7), lightning-listpeers(7) +lightningd-config(5), lightning-fundchannel(7), lightning-listchannels(7), lightning-listpeers(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:b9516a162d2448b85ca9628fdf965c037eb5947f5fed827ddc674ba7c283e9f0) diff --git a/doc/lightning-setconfig.7.md b/doc/lightning-setconfig.7.md index 1231579f3b9e..bfda1701e0c0 100644 --- a/doc/lightning-setconfig.7.md +++ b/doc/lightning-setconfig.7.md @@ -4,34 +4,101 @@ lightning-setconfig -- Dynamically change some config options SYNOPSIS -------- -**setconfig** *config* [*val*] +**setconfig** *config* [*val*] DESCRIPTION ----------- +Command *added* in v23.08. + The **setconfig** RPC command allows you set the (dynamic) configuration option named by `config`: options which take a value (as separate from simple flag options) also need a `val` parameter. This new value will *also* be written at the end of the config file, for persistence across restarts (and any old value commented out). -You can see what options are dynamically adjustable using lightning-listconfigs(7). Note that you can also adjust existing options for stopped plugins; they will have an effect when the plugin is restarted. +You can see what options are dynamically adjustable using lightning- listconfigs(7). Note that you can also adjust existing options for stopped plugins; they will have an effect when the plugin is restarted. + +- **config** (string): Name of the config variable which should be set to the value of the variable. +- **val** (one of, optional): Value of the config variable to be set or updated.: + - (string) + - (integer) + - (boolean) + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:setconfig#1", + "method": "setconfig", + "params": [ + "autoclean-paidinvoices-age", + 1 + ] +} +{ + "id": "example:setconfig#2", + "method": "setconfig", + "params": [ + "test-dynamic-config", + "changed" + ] +} +{ + "id": "example:setconfig#3", + "method": "setconfig", + "params": { + "config": "min-capacity-sat", + "val": 500000 + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object containing **config** is returned. It is an object containing: -- **config** (string): name of the config variable which was set -- **source** (string): source of configuration setting (`file`:`linenum`) -- **dynamic** (boolean): whether this option is settable via setconfig (always *true*) -- **plugin** (string, optional): the plugin this configuration setting is for -- **set** (boolean, optional): for simple flag options -- **value\_str** (string, optional): for string options -- **value\_msat** (msat, optional): for msat options -- **value\_int** (integer, optional): for integer options -- **value\_bool** (boolean, optional): for boolean options - -[comment]: # (GENERATE-FROM-SCHEMA-END) +- **config** (string): Name of the config variable which was set. +- **source** (string): Source of configuration setting (`file`:`linenum`). +- **dynamic** (boolean) (always *true*): Whether this option is settable via setconfig. +- **plugin** (string, optional): The plugin this configuration setting is for. +- **set** (boolean, optional): For simple flag options. +- **value\_str** (string, optional): For string options. +- **value\_msat** (msat, optional): For msat options. +- **value\_int** (integer, optional): For integer options. +- **value\_bool** (boolean, optional): For boolean options. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "config": { + "config": "autoclean-paidinvoices-age", + "value_int": 1, + "source": "/tmp/ltests-7u_8_rtu/test_autoclean_1/lightning-3/regtest/config:6", + "plugin": "~/lightning/plugins/autoclean", + "dynamic": true + } +} +{ + "config": { + "config": "test-dynamic-config", + "value_str": "changed", + "source": "/tmp/ltests-7u_8_rtu/test_dynamic_option_python_plugin_1/lightning-1/regtest/config:2", + "plugin": "~/lightning/tests/plugins/dynamic_option.py", + "dynamic": true + } +} +{ + "config": { + "config": "min-capacity-sat", + "value_int": 500000, + "source": "/tmp/ltests-nvfdbou2/test_setconfig_1/lightning-2/regtest/config:2", + "dynamic": true + } +} +``` ERRORS ------ @@ -43,8 +110,7 @@ The following error codes may occur: AUTHOR ------ -Rusty Russell <> is mainly responsible for this -feature. +Rusty Russell <> is mainly responsible for this feature. SEE ALSO -------- @@ -55,5 +121,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:9acb35e4b599c17e776ed0bf37b2e55022968ca10cb9d467c2e3f1f8e8d88662) diff --git a/doc/lightning-setpsbtversion.7.md b/doc/lightning-setpsbtversion.7.md index c317992e6808..653aa4987206 100644 --- a/doc/lightning-setpsbtversion.7.md +++ b/doc/lightning-setpsbtversion.7.md @@ -4,48 +4,64 @@ lightning-setpsbtversion -- Command for setting PSBT version SYNOPSIS -------- -**setpsbtversion** *psbt* *version* +**setpsbtversion** *psbt* *version* DESCRIPTION ----------- The **setpsbtversion** RPC command converts the provided PSBT to the given version, and returns the base64 result of the conversion. Returns an error if version is invalid. +- **psbt** (string): The PSBT to change versions. +- **version** (u32): The version to set. + EXAMPLE JSON REQUEST ------------- +-------------------- ```json { - "id": 82, + "id": "example:setpsbtversion#1", "method": "setpsbtversion", "params": { "psbt": "cHNidP8BAAoCAAAAAAAAAAAAAA==", "version": "2" } } +{ + "id": "example:setpsbtversion#2", + "method": "setpsbtversion", + "params": [ + "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIJd6ICNAQALFOMhoUHuSVSuzcaUdkDKlk4K+A+DR9+4uAA==", + 0 + ] +} ``` RETURN VALUE ------------ -If successful the command returns a converted PSBT of the requested version. - -ERRORS ------- - -The following error codes may occur: +On success, an object is returned, containing: -- 32602: Parameter missed or malformed. +- **psbt** (string): A converted PSBT of the requested version. EXAMPLE JSON RESPONSE ------ +--------------------- ```json { - "psbt": "cHNidP8BAgQCAAAAAQQBAAEFAQABBgEDAfsEAgAAAAA=" + "psbt": "cHNidP8BAgQCAAAAAQQBAAEFAQABBgEDAfsEAgAAAAA=" +} +{ + "psbt": "cHNidP8BADUCAAAAAAFAQg8AAAAAACJRIJd6ICNAQALFOMhoUHuSVSuzcaUdkDKlk4K+A+DR9+4ubwAAAAAA" } ``` +ERRORS +------ + +The following error codes may occur: + +- -32602: Parameter missed or malformed. + AUTHOR ------ @@ -54,7 +70,7 @@ Gregory Sanders <> is mainly responsible. SEE ALSO -------- -lightning-fundpsbt(7), lightning-utxopsbt(7), lightning-signpsbt(7). +lightning-fundpsbt(7), lightning-utxopsbt(7), lightning-signpsbt(7) RESOURCES --------- diff --git a/doc/lightning-showrunes.7.md b/doc/lightning-showrunes.7.md index d4b133c9e81d..bc1bf3208c1b 100644 --- a/doc/lightning-showrunes.7.md +++ b/doc/lightning-showrunes.7.md @@ -1,38 +1,119 @@ lightning-showrunes -- Command to list previously generated runes -================================================================== +================================================================= SYNOPSIS -------- -**showrunes** [*rune*] +**showrunes** [*rune*] DESCRIPTION ----------- -The **showrunes** RPC command either lists runes that we stored as we generate them (see lightning-createrune(7)) or decodes the rune given on the command line. +Command *added* in v23.08. + +The **showrunes** RPC command either lists runes that we stored as we generate them (see lightning-createrune(7)) or decodes the rune given on the command line. + +- **rune** (string, optional): If specified, only details of that rune will be returned. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:showrunes#1", + "method": "showrunes", + "params": "{}" +} +{ + "id": "example:showrunes#2", + "method": "showrunes", + "params": { + "rune": "Bl0V_vkVkGr4h356JbCMCcoDyyKE8djkoQ2156iPB509MCZwZXI9MTAwMDAwMDAwMG5zZWM=" + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **runes** is returned. It is an array of objects, where each object contains: +On success, an object containing **runes** is returned. It is an array of objects, where each object contains: -- **rune** (string): Base64 encoded rune -- **unique\_id** (string): Unique id assigned when the rune was generated; this is always a u64 for commando runes -- **restrictions** (array of objects): The restrictions on what commands this rune can authorize: +- **rune** (string): Base64 encoded rune. +- **unique\_id** (string): Unique id assigned when the rune was generated; this is always a u64 for commando runes. +- **restrictions** (array of objects): The restrictions on what commands this rune can authorize.: - **alternatives** (array of objects): - - **fieldname** (string): The field this restriction applies to; see commando-rune(7) - - **value** (string): The value accepted for this field - - **condition** (string): The way to compare fieldname and value - - **english** (string): English readable description of this alternative - - **english** (string): English readable summary of alternatives above -- **restrictions\_as\_english** (string): English readable description of the restrictions array above -- **stored** (boolean, optional): This is false if the rune does not appear in our datastore (only possible when `rune` is specified) (always *false*) -- **blacklisted** (boolean, optional): The rune has been blacklisted; see commando-blacklist(7) (always *true*) -- **last\_used** (number, optional): The last time this rune was successfully used *(added 23.11)* -- **our\_rune** (boolean, optional): This is not a rune for this node (only possible when `rune` is specified) (always *false*) - -[comment]: # (GENERATE-FROM-SCHEMA-END) + - **fieldname** (string): The field this restriction applies to; see commando-rune(7). + - **value** (string): The value accepted for this field. + - **condition** (string): The way to compare fieldname and value. + - **english** (string): English readable description of this alternative. + - **english** (string): English readable summary of alternatives above. +- **restrictions\_as\_english** (string): English readable description of the restrictions array above. +- **stored** (boolean, optional) (always *false*): This is false if the rune does not appear in our datastore (only possible when `rune` is specified). +- **blacklisted** (boolean, optional) (always *true*): The rune has been blacklisted; see commando-blacklist(7). +- **last\_used** (number, optional): The last time this rune was successfully used. *(added 23.11)* +- **our\_rune** (boolean, optional) (always *false*): This is not a rune for this node (only possible when `rune` is specified). + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "runes": [ + { + "rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==", + "unique_id": "0", + "restrictions": [], + "restrictions_as_english": "" + }, + { + "rune": "geZmO6U7yqpHn-moaX93FVMVWrDRfSNY4AXx9ypLcqg9MQ==", + "unique_id": "1", + "restrictions": [], + "restrictions_as_english": "" + }, + { + "rune": "Bl0V_vkVkGr4h356JbCMCcoDyyKE8djkoQ2156iPB509MCZwZXI9MTAwMDAwMDAwMG5zZWM=", + "unique_id": "2", + "restrictions": [ + { + "alternatives": [ + { + "fieldname": "per", + "value": "1000000000nsec", + "condition": "=", + "english": "per equal to 1000000000nsec" + } + ], + "english": "per equal to 1000000000nsec" + } + ], + "restrictions_as_english": "per equal to 1000000000nsec" + } + ] +} +{ + "runes": [ + { + "rune": "Bl0V_vkVkGr4h356JbCMCcoDyyKE8djkoQ2156iPB509MCZwZXI9MTAwMDAwMDAwMG5zZWM=", + "unique_id": "2", + "restrictions": [ + { + "alternatives": [ + { + "fieldname": "per", + "value": "1000000000nsec", + "condition": "=", + "english": "per equal to 1000000000nsec" + } + ], + "english": "per equal to 1000000000nsec" + } + ], + "restrictions_as_english": "per equal to 1000000000nsec" + } + ] +} +``` AUTHOR ------ @@ -48,5 +129,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:f951001acafe71d2ab6d95367bd122067f449af71e755672e44e719fc5a8c1fa) diff --git a/doc/lightning-signinvoice.7.md b/doc/lightning-signinvoice.7.md index d9c6248afd00..54e57547fb91 100644 --- a/doc/lightning-signinvoice.7.md +++ b/doc/lightning-signinvoice.7.md @@ -1,33 +1,52 @@ lightning-signinvoice -- Low-level invoice signing -===================================================== +================================================== SYNOPSIS -------- -**signinvoice** *invstring* +**signinvoice** *invstring* DESCRIPTION ----------- -The **signinvoice** RPC command signs an invoice. Unlike -**createinvoice** it does not save the invoice into the database and -thus does not require the preimage. +Command *added* in v23.02. + +The **signinvoice** RPC command signs an invoice. Unlike **createinvoice** it does not save the invoice into the database and thus does not require the preimage. + +- **invstring** (string): Bolt11 form, but the final signature is ignored. Minimal sanity checks are done. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:signinvoice#1", + "method": "signinvoice", + "params": [ + "lnbcrt10n1pjmxt3lsp5jumuz2sv3ca68kzd92hp3wdtpx8ghnxur65fs6maw6dyxsleqd0spp5nadvvh7uzk2qzh8d9d7tsxr08l9uaz2vjeuuahqtufjv52d0eassdq8d9h8vvgxqyjw5qcqp99qxpqysgq4rrn702eum6c9ld9khlz39vdyd8zcwrav5ygqvu6w54aep6yarkyfrnk990yf5prpasgzmj52stektf6mzwdl5hc6qlsglt2a0pwp0spwww44w" + ] +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **bolt11** (string): the bolt11 string +- **bolt11** (string): The bolt11 string. -[comment]: # (GENERATE-FROM-SCHEMA-END) +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "bolt11": "lnbcrt10n1pjmxt3lsp5jumuz2sv3ca68kzd92hp3wdtpx8ghnxur65fs6maw6dyxsleqd0spp5nadvvh7uzk2qzh8d9d7tsxr08l9uaz2vjeuuahqtufjv52d0eassdq8d9h8vvgxqyjw5qcqp99qxpqysgq3nhrd72qe7wmc2hvwhaqnx05y6dzxh2tal02kw055er7uutkkrcreccm37ce6wv7ee8q70ktlr9fy3fd635hc2k98a4svd9c8v4cpjsppm2eee" +} +``` ERRORS ------ -On failure, an error is returned. - The following error codes may occur: - -1: Catchall nonspecific error. @@ -40,13 +59,9 @@ Carl Dong <> is mainly responsible. SEE ALSO -------- -lightning-createinvoice(7), lightning-invoice(7), lightning-listinvoices(7), -lightning-delinvoice(7), lightning-getroute(7), lightning-sendpay(7), -lightning-offer(7). +lightning-createinvoice(7), lightning-invoice(7), lightning-listinvoices(7), lightning-delinvoice(7), lightning-getroute(7), lightning-sendpay(7), lightning-offer(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:5f0154bc5c2e60c7ae5e238cd803a1171552c7c7fa46ddda538cd71ea1511533) diff --git a/doc/lightning-signmessage.7.md b/doc/lightning-signmessage.7.md index 111282f01b41..af5835083035 100644 --- a/doc/lightning-signmessage.7.md +++ b/doc/lightning-signmessage.7.md @@ -4,27 +4,59 @@ lightning-signmessage -- Command to create a signature from this node SYNOPSIS -------- -**signmessage** *message* +**signmessage** *message* DESCRIPTION ----------- -The **signmessage** RPC command creates a digital signature of -*message* using this node's secret key. A receiver who knows your -node's *id* and the *message* can be sure that the resulting signature could -only be created by something with access to this node's secret key. +The **signmessage** RPC command creates a digital signature of *message* using this node's secret key. A receiver who knows your node's *id* and the *message* can be sure that the resulting signature could only be created by something with access to this node's secret key. + +- **message** (string): Less than 65536 characters long message to be signed by the node. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:signmessage#1", + "method": "signmessage", + "params": { + "message": "this is a test!" + } +} +{ + "id": "example:signmessage#2", + "method": "signmessage", + "params": { + "message": "message for you" + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **signature** (hex): The signature (always 128 characters) -- **recid** (hex): The recovery id (0, 1, 2 or 3) (always 2 characters) -- **zbase** (string): *signature* and *recid* encoded in a style compatible with **lnd**'s [SignMessageRequest](https://api.lightning.community/#grpc-request-signmessagerequest) - -[comment]: # (GENERATE-FROM-SCHEMA-END) +- **signature** (hex) (always 128 characters): The signature. +- **recid** (hex) (always 2 characters): The recovery id (0, 1, 2 or 3). +- **zbase** (string): *signature* and *recid* encoded in a style compatible with **lnd**'s [SignMessageRequest](https://api.lightning.community/#grpc-request- signmessagerequest). + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "signature": "a2ec227012795f9d6b80a3f5ea98374c6d2886917517c05336799923fcf37caf08344c0431275e1a8189da01b444ae978007fe70f0cc9009f38cabe074ade87d", + "recid": "00", + "zbase": "d6tqaeuonjhi98mmont9m4wag7gg4krg1f4txonug3h31e9h6p6k6nbwjondnj46dkyausobstnk7fhyy998bhgc1yr98dfmhb4k54d7" +} +{ + "signature": "85843b010bc517b32eaafe70232e2c44bb5a354c74d2202390af1b272e4c6ac23ac3f97ea663d8b49116ad6c2d080515b43bcdf1ea4f38cdb18af0edf8209cd8", + "recid": "00", + "zbase": "d6naeqabbxntxc3qim98ye3qftnmsstijt4prebd1nztsj3qjticrqsd9f9kca6as1etpmmcfwrykfpw8xg9d41x8dg5dnzo7zhnb8ga" +} +``` AUTHOR ------ @@ -42,5 +74,3 @@ RESOURCES Main web site: [SignMessageRequest](https://api.lightning.community/#grpc-request-signmessagerequest) - -[comment]: # ( SHA256STAMP:485db85e3822babcb397b55f251e6797528c3b9e14743d2823e890e2b22432c0) diff --git a/doc/lightning-signpsbt.7.md b/doc/lightning-signpsbt.7.md index 65f20d5e3a1a..e55b4da29973 100644 --- a/doc/lightning-signpsbt.7.md +++ b/doc/lightning-signpsbt.7.md @@ -4,30 +4,41 @@ lightning-signpsbt -- Command to sign a wallet's inputs on a provided bitcoin tr SYNOPSIS -------- -**signpsbt** *psbt* [*signonly*] +**signpsbt** *psbt* [*signonly*] DESCRIPTION ----------- -**signpsbt** is a low-level RPC command which signs a PSBT as defined by -BIP-174. +**signpsbt** is a low-level RPC command which signs a PSBT as defined by BIP-174. -By default, all known inputs are signed, and others ignored: with -*signonly*, only those inputs are signed, and an error is returned if -one of them cannot be signed. +By default, all known inputs are signed, and others ignored: with *signonly*, only those inputs are signed, and an error is returned if one of them cannot be signed. -Note that the command will fail if there are no inputs to sign, or -if the inputs to be signed were not previously reserved. +Note that the command will fail if there are no inputs to sign, or if the inputs to be signed were not previously reserved. + +- **psbt** (string): The psbt to be signed. +- **signonly** (array of u32s, optional): Input numbers to sign.: + - (u32, optional) EXAMPLE JSON REQUEST -------------------- ```json { - "id": 82, + "id": "example:signpsbt#1", + "method": "signpsbt", + "params": { + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAAAAAAEQBAAAAAAM/AlsaWdodG5pbmcBCCvyYqqdIt0mAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oBDiBWd3IcNaQkoj1tzHyQkDblBa5oZQ4J1ZcztLfnMAOk3AEPBAEAAAABEAT9////DPwJbGlnaHRuaW5nAQg5j4QWOQoUFAABAwhOfA0AAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4M/AlsaWdodG5pbmcBCMbeD+3qn9/kAAEDCODIEAAAAAAAAQQiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQz8CWxpZ2h0bmluZwEI4upB+mjl6AIA", + "signonly": null + } +} +{ + "id": "example:signpsbt#2", "method": "signpsbt", "params": { - "psbt": "some_psbt" + "psbt": "cHNidP8BAP1xAQIAAAAIFTef27H2GAJBzP4UZMeDePsDVkglO47/q4jqK18ibCYAAAAAAP3///+axwap6WKnEHvLjIJZX0ZeJ87cs7PKkXBfwvbGVmjpTQEAAAAA/f///wQ1cVzb9NR7nXadyRuhQBv+2iqhZkhvUA+sPo5z/SsSAQAAAAD9////lXQ788meUtSxhBX13mx2XhyM3Ddo30QtmNW0YuE2TDABAAAAAP3///8Kr4BwElAScx3bA5ZdavrHwh4Zh+rFNvkE/+7gu1WbngEAAAAA/f///3Uei7j3k/b5tnjFGvNZhe2iWz8O6FQjTEpM5XIoduNsAQAAAAD9////fm5Om4MojcnfZiTmrwb4b5Byw9emrjITi/nkEqTK9MsBAAAAAP3///8lwdpZqt3ILPRwhINY4PGvkg2CSw7agcMPSuFoHDDkIQAAAAAA/f///wGCAXoAAAAAABYAFMkJbUP0COpSYCAmLM2tfIUWuSqBAAAAAAABAHECAAAAAZVxzFxyEg7tiQTgRHwGleR8Srxw6taAGOoEpJK/Xj5sAAAAAAD9////AkBCDwAAAAAAFgAUKvGgVL/ThjWE/P1oORVXh/ObucYzr/YpAQAAABYAFKmkod5S53U4m5tKFApyeC35UbnbZwAAAAEBH0BCDwAAAAAAFgAUKvGgVL/ThjWE/P1oORVXh/ObucYAAQBxAgAAAAEVN5/bsfYYAkHM/hRkx4N4+wNWSCU7jv+riOorXyJsJgEAAAAA/f///wJmbOcpAQAAABYAFCCSJBD9wY/VwxnBcnFiu1tA6CGTQEIPAAAAAAAWABSjI8KCqaGX/BGOwJza8hyiuxuIcmcAAAABAR9AQg8AAAAAABYAFKMjwoKpoZf8EY7AnNryHKK7G4hyAAEAcQIAAAAB98EwKZMOHiyRYWyToae6Kce3gCwqUvnVXXHlB/ps9ocBAAAAAP3///8CmNuLKQEAAAAWABQ4roxw+phYHelaRr71DYB3FEy/30BCDwAAAAAAFgAUwSDtQiY7PVvBc7ww56Y72YIQdjllAAAAAQEfQEIPAAAAAAAWABTBIO1CJjs9W8FzvDDnpjvZghB2OQABAHECAAAAAZH/SvCXvDW7b8qb55CDC4M+jgZ61H/e8rZnAGaXp+Z+AAAAAAD9////Apkp2CkBAAAAFgAUc/Y+sIq3oYyEe40GkKJsXawkzwFAQg8AAAAAABYAFLdt1h5Bte8FKvIc2jJgiIwHC7mvZwAAAAEBH0BCDwAAAAAAFgAUt23WHkG17wUq8hzaMmCIjAcLua8AAQBxAgAAAAETC3wMCv9qK3lvVkVJu9b/v2VgMepZtnfngMp2xMXRnwAAAAAA/f///wJk0E4pAQAAABYAFEIsc4cBl+BTN33Kn80+YYfkMt+cQEIPAAAAAAAWABT2/7RIxKohhGbacpBz0BZNYcnfsGUAAAABAR9AQg8AAAAAABYAFPb/tEjEqiGEZtpykHPQFk1hyd+wAAEAcQIAAAABA8J/OnC+cuH79Z6wZmzwdAjhBDaPHavh3yvhr4odDXQBAAAAAP3///8CykowKQEAAAAWABTVHuO8cKOOX/JlmMU66on6Uc54mkBCDwAAAAAAFgAUunZMZryWMqCTiMuVWNF/cleg6dVnAAAAAQEfQEIPAAAAAAAWABS6dkxmvJYyoJOIy5VY0X9yV6Dp1QABAHECAAAAAfRxBaZZ3FfDGwxhZQLYCurN+7kJj0x6nzChg434dnjRAAAAAAD9////AszmyCkBAAAAFgAULSqRp54barF/7R9XOmsLDCVWdAFAQg8AAAAAABYAFNa5adNt/9rZhpGT9mPuSA39xzSIZQAAAAEBH0BCDwAAAAAAFgAU1rlp023/2tmGkZP2Y+5IDf3HNIgAAQBxAgAAAAEgk1JYyP4oIoPoYYcTPPDvZynVfXWINJnBEFBsLv0MtAAAAAAA/f///wJAQg8AAAAAABYAFGYcI7eQ3TSRNzrwsdi+0Id9XN4iMmGqKQEAAAAWABT5XKNwVIFsUKh26sqHFSlOLq5TFGUAAAABAR9AQg8AAAAAABYAFGYcI7eQ3TSRNzrwsdi+0Id9XN4iAAA=", + "signonly": [ + 7 + ] } } ``` @@ -35,33 +46,34 @@ EXAMPLE JSON REQUEST RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **signed\_psbt** (string): The fully signed PSBT - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -ERRORS ------- - -On failure, one of the following error codes may be returned: - -- -32602: Error in given parameters, or there aren't wallet's inputs to sign, or we couldn't sign all of *signonly*, or inputs are not reserved. +- **signed\_psbt** (string): The fully signed PSBT. EXAMPLE JSON RESPONSE --------------------- ```json { - "psbt": "some_psbt" + "signed_psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAAAAAAEQBAAAAAAM/AlsaWdodG5pbmcBCCvyYqqdIt0mAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oBDiBWd3IcNaQkoj1tzHyQkDblBa5oZQ4J1ZcztLfnMAOk3AEPBAEAAAABEAT9////ARNACI9TcWG+6uC9ElBFN3qhND7amsor/dtBhJ5ujEQAT/80548avrt7d7IJiOAaCNzzYLSXITdL2xjx6mhbBi9hTiEWkUUygSpECk12bHHNORk2lKNArhHgEuW6Gtnvum52ylMJAMLMqxcAAAAADPwJbGlnaHRuaW5nAQg5j4QWOQoUFAABAwhOfA0AAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4hB7nAxoROEqUxyWjlXFUHjsFtm/dr6SkP2H0cynK0g5oXCQDWuWnTBAAAAAz8CWxpZ2h0bmluZwEIxt4P7eqf3+QAAQMI4MgQAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQji6kH6aOXoAgA=" +} +{ + "signed_psbt": "cHNidP8BAP1xAQIAAAAIFTef27H2GAJBzP4UZMeDePsDVkglO47/q4jqK18ibCYAAAAAAP3///+axwap6WKnEHvLjIJZX0ZeJ87cs7PKkXBfwvbGVmjpTQEAAAAA/f///wQ1cVzb9NR7nXadyRuhQBv+2iqhZkhvUA+sPo5z/SsSAQAAAAD9////lXQ788meUtSxhBX13mx2XhyM3Ddo30QtmNW0YuE2TDABAAAAAP3///8Kr4BwElAScx3bA5ZdavrHwh4Zh+rFNvkE/+7gu1WbngEAAAAA/f///3Uei7j3k/b5tnjFGvNZhe2iWz8O6FQjTEpM5XIoduNsAQAAAAD9////fm5Om4MojcnfZiTmrwb4b5Byw9emrjITi/nkEqTK9MsBAAAAAP3///8lwdpZqt3ILPRwhINY4PGvkg2CSw7agcMPSuFoHDDkIQAAAAAA/f///wGCAXoAAAAAABYAFMkJbUP0COpSYCAmLM2tfIUWuSqBAAAAAAABAHECAAAAAZVxzFxyEg7tiQTgRHwGleR8Srxw6taAGOoEpJK/Xj5sAAAAAAD9////AkBCDwAAAAAAFgAUKvGgVL/ThjWE/P1oORVXh/ObucYzr/YpAQAAABYAFKmkod5S53U4m5tKFApyeC35UbnbZwAAAAEBH0BCDwAAAAAAFgAUKvGgVL/ThjWE/P1oORVXh/ObucYAAQBxAgAAAAEVN5/bsfYYAkHM/hRkx4N4+wNWSCU7jv+riOorXyJsJgEAAAAA/f///wJmbOcpAQAAABYAFCCSJBD9wY/VwxnBcnFiu1tA6CGTQEIPAAAAAAAWABSjI8KCqaGX/BGOwJza8hyiuxuIcmcAAAABAR9AQg8AAAAAABYAFKMjwoKpoZf8EY7AnNryHKK7G4hyAAEAcQIAAAAB98EwKZMOHiyRYWyToae6Kce3gCwqUvnVXXHlB/ps9ocBAAAAAP3///8CmNuLKQEAAAAWABQ4roxw+phYHelaRr71DYB3FEy/30BCDwAAAAAAFgAUwSDtQiY7PVvBc7ww56Y72YIQdjllAAAAAQEfQEIPAAAAAAAWABTBIO1CJjs9W8FzvDDnpjvZghB2OQABAHECAAAAAZH/SvCXvDW7b8qb55CDC4M+jgZ61H/e8rZnAGaXp+Z+AAAAAAD9////Apkp2CkBAAAAFgAUc/Y+sIq3oYyEe40GkKJsXawkzwFAQg8AAAAAABYAFLdt1h5Bte8FKvIc2jJgiIwHC7mvZwAAAAEBH0BCDwAAAAAAFgAUt23WHkG17wUq8hzaMmCIjAcLua8AAQBxAgAAAAETC3wMCv9qK3lvVkVJu9b/v2VgMepZtnfngMp2xMXRnwAAAAAA/f///wJk0E4pAQAAABYAFEIsc4cBl+BTN33Kn80+YYfkMt+cQEIPAAAAAAAWABT2/7RIxKohhGbacpBz0BZNYcnfsGUAAAABAR9AQg8AAAAAABYAFPb/tEjEqiGEZtpykHPQFk1hyd+wAAEAcQIAAAABA8J/OnC+cuH79Z6wZmzwdAjhBDaPHavh3yvhr4odDXQBAAAAAP3///8CykowKQEAAAAWABTVHuO8cKOOX/JlmMU66on6Uc54mkBCDwAAAAAAFgAUunZMZryWMqCTiMuVWNF/cleg6dVnAAAAAQEfQEIPAAAAAAAWABS6dkxmvJYyoJOIy5VY0X9yV6Dp1QABAHECAAAAAfRxBaZZ3FfDGwxhZQLYCurN+7kJj0x6nzChg434dnjRAAAAAAD9////AszmyCkBAAAAFgAULSqRp54barF/7R9XOmsLDCVWdAFAQg8AAAAAABYAFNa5adNt/9rZhpGT9mPuSA39xzSIZQAAAAEBH0BCDwAAAAAAFgAU1rlp023/2tmGkZP2Y+5IDf3HNIgAAQBxAgAAAAEgk1JYyP4oIoPoYYcTPPDvZynVfXWINJnBEFBsLv0MtAAAAAAA/f///wJAQg8AAAAAABYAFGYcI7eQ3TSRNzrwsdi+0Id9XN4iMmGqKQEAAAAWABT5XKNwVIFsUKh26sqHFSlOLq5TFGUAAAABAR9AQg8AAAAAABYAFGYcI7eQ3TSRNzrwsdi+0Id9XN4iIgID+pyVCF5CseUAPNH0GBeMMMluSud5VMoPxIxYgm/06w5HMEQCIG90DSr+fGNoWhCrgLbJG3Wt8PJNMWYqaa5MLWRwA0oTAiA9rsLEqqVhjV6wENfzzpudaE949uLlVqWgDjE/FSgKNAEiBgP6nJUIXkKx5QA80fQYF4wwyW5K53lUyg/EjFiCb/TrDghmHCO3AAAAAAAA" } ``` +ERRORS +------ + +On failure, one of the following error codes may be returned: + +- -32602: Error in given parameters, or there aren't wallet's inputs to sign, or we couldn't sign all of *signonly*, or inputs are not reserved. + AUTHOR ------ -Vincenzo Palazzo <> wrote the initial version of this man page, but many others did the hard work of actually implementing this rpc command. +Vincenzo Palazzo <> wrote the initial version of this man page, +but many others did the hard work of actually implementing this rpc command. SEE ALSO -------- @@ -72,5 +84,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:f6607621c81dec26313167c524e994d2511ea556577ee2aca7135cb27ac653c3) diff --git a/doc/lightning-splice_init.7.md b/doc/lightning-splice_init.7.md index cd3803193f9b..5dc42f00b1c9 100644 --- a/doc/lightning-splice_init.7.md +++ b/doc/lightning-splice_init.7.md @@ -1,100 +1,133 @@ lightning-splice\_init -- Command to initiate a channel to a peer -===================================================================== +================================================================= SYNOPSIS -------- **(WARNING: experimental-splicing only)** -**splice\_init** *channel\_id* *relative\_amount* [*initalpsbt*] [*feerate\_per\_kw*] [*force\_feerate*] +**splice\_init** *channel\_id* *relative\_amount* [*initialpsbt*] [*feerate\_per\_kw*] [*force\_feerate*] DESCRIPTION ----------- -`splice_init` is a low level RPC command which initiates a channel splice for a -given channel specified by `channel_id`. +Command *added* in v23.08. -Note you may need to add a double dash (\-\-) after splice\_init if using a negative -*relative\_amount* so it is not interpretted as a command modifier. For example: -```shell -lightning-cli splice_init -- $CHANNEL_ID -100000 -``` +`splice_init` is a low level RPC command which initiates a channel splice for a given channel specified by `channel_id`. + +- **channel\_id** (hash): The channel id of the channel to be spliced. +- **relative\_amount** (integer): A positive or negative amount of satoshis to add or subtract from the channel. Note you may need to add a double dash (--) after splice\_init if using a negative *relative\_amount* so it is not interpretted as a command modifier. For example: ```shell lightning-cli splice_init -- $CHANNEL_ID -100000 ```. +- **initialpsbt** (string, optional): The (optional) base 64 encoded PSBT to begin with. If not specified, one will be generated automatically. +- **feerate\_per\_kw** (u32, optional): The miner fee we promise our peer to pay for our side of the splice transaction. It is calculated by `feerate_per_kw` * our\_bytes\_in\_splice\_tx / 1000. +- **force\_feerate** (boolean, optional): By default splices will fail if the fee provided looks too high. This is to protect against accidentally setting your fee higher than intended. Set `force_feerate` to true to skip this saftey check. + +EXAMPLE USAGE +------------- -Here is an example set of splice commands that will splice in 100,000 sats to -the first channel that comes out of `listpeerchannels`. The example assumes -you already have at least one confirmed channel. +Here is an example set of splice commands that will splice in 100,000 sats to the first channel that comes out of `listpeerchannels`. The example assumes you already have at least one confirmed channel. ```shell -RESULT=$(lightning-cli listpeerchannels); -CHANNEL_ID=$(echo $RESULT| jq -r ".channels[0].channel_id"); -echo $RESULT; +RESULT=$(lightning-cli listpeerchannels) +CHANNEL_ID=$(echo $RESULT| jq -r ".channels[0].channel_id") +echo $RESULT -RESULT=$(lightning-cli fundpsbt -k satoshi=100000sat feerate=urgent startweight=800 excess_as_change=true); -INITIALPSBT=$(echo $RESULT | jq -r ".psbt"); -echo $RESULT; +RESULT=$(lightning-cli fundpsbt -k satoshi=100000sat feerate=urgent startweight=800 excess_as_change=true) +INITIALPSBT=$(echo $RESULT | jq -r ".psbt") +echo $RESULT -RESULT=$(lightning-cli splice_init $CHANNEL_ID 100000 $INITIALPSBT); -PSBT=$(echo $RESULT | jq -r ".psbt"); -echo $RESULT; +RESULT=$(lightning-cli splice_init $CHANNEL_ID 100000 $INITIALPSBT) +PSBT=$(echo $RESULT | jq -r ".psbt") +echo $RESULT -RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT); -PSBT=$(echo $RESULT | jq -r ".psbt"); -echo $RESULT; +RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT) +PSBT=$(echo $RESULT | jq -r ".psbt") +echo $RESULT -RESULT=$(lightning-cli signpsbt -k psbt="$PSBT"); -PSBT=$(echo $RESULT | jq -r ".signed_psbt"); -echo $RESULT; +RESULT=$(lightning-cli signpsbt -k psbt="$PSBT") +PSBT=$(echo $RESULT | jq -r ".signed_psbt") +echo $RESULT lightning-cli splice_signed $CHANNEL_ID $PSBT ``` -Here is an example set of splice commands that will splice out 100,000 sats from - first channel that comes out of `listpeerchannels`. The example assumes -you already have at least one confirmed channel. +Here is an example set of splice commands that will splice out 100,000 sats from first channel that comes out of `listpeerchannels`. The example assumes you already have at least one confirmed channel. ```shell -RESULT=$(lightning-cli listpeerchannels); -CHANNEL_ID=$(echo $RESULT| jq -r ".channels[0].channel_id"); -echo $RESULT; +RESULT=$(lightning-cli listpeerchannels) +CHANNEL_ID=$(echo $RESULT| jq -r ".channels[0].channel_id") +echo $RESULT -RESULT=$(lightning-cli addpsbtoutput 100000); -INITIALPSBT=$(echo $RESULT | jq -r ".psbt"); -echo $RESULT; +RESULT=$(lightning-cli addpsbtoutput 100000) +INITIALPSBT=$(echo $RESULT | jq -r ".psbt") +echo $RESULT -RESULT=$(lightning-cli splice_init -- $CHANNEL_ID -100500 $INITIALPSBT); -PSBT=$(echo $RESULT | jq -r ".psbt"); -echo $RESULT; +RESULT=$(lightning-cli splice_init -- $CHANNEL_ID -100500 $INITIALPSBT) +PSBT=$(echo $RESULT | jq -r ".psbt") +echo $RESULT -RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT); -PSBT=$(echo $RESULT | jq -r ".psbt"); -echo $RESULT; +RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT) +PSBT=$(echo $RESULT | jq -r ".psbt") +echo $RESULT lightning-cli splice_signed $CHANNEL_ID $PSBT ``` +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:splice_init#1", + "method": "splice_init", + "params": { + "channel_id": "5677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc", + "relative_amount": 100000, + "initialpsbt": "cHNidP8BAF4CAAAAAVZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQAAAAD9////AU58DQAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5sAAAAAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==", + "feerate_per_kw": null + } +} +{ + "id": "example:splice_init#2", + "method": "splice_init", + "params": { + "channel_id": "a40bb442dab0231b51d8f842d95aad548aa35e1d13c4cfcf2997344f805453a1", + "relative_amount": -105000, + "initialpsbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIoIYBAAAAAAABBCJRIHg2NV/cioLcTLAKdyxVVBUdBjhKTdZejT9orAhWa4S+AA==", + "feerate_per_kw": null + } +} +``` + RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **psbt** (string): the (incomplete) PSBT of the splice transaction +- **psbt** (string): The (incomplete) PSBT of the splice transaction. -[comment]: # (GENERATE-FROM-SCHEMA-END) +EXAMPLE JSON RESPONSE +--------------------- -SEE ALSO --------- - -lightning-splice_signed(7), lightning-splice_update(7) +```json +{ + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEFR1IhAjJCZt6EA7OrFXoJ8feE1YevYYMcmYwVG8whu3TCsjFLIQLjvTgAmGbJ2o7EqpnMTqnGwN1G3xXGHvDOHycSkXFOV1KuAQ4gVndyHDWkJKI9bcx8kJA25QWuaGUOCdWXM7S35zADpNwBDwQAAAAAARAEAAAAAAz8CWxpZ2h0bmluZwEIK/Jiqp0i3SYAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAQAAAAEQBP3///8M/AlsaWdodG5pbmcBCDmPhBY5ChQUAAEDCE58DQAAAAAAAQQiUSB4NjVf3IqC3EywCncsVVQVHQY4Sk3WXo0/aKwIVmuEvgz8CWxpZ2h0bmluZwEIxt4P7eqf3+QAAQMIAAAAAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQji6kH6aOXoAgA=" +} +{ + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABARzi7RBt64yrfqRL2p+KiUw8cYtiKICRFHmp/4eCSemSAQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgTCjR9L+TfzP7pLJVVto5egTRbRNj/RaBhyrA3UW0aEcCIAJO5FZjXvdpRcGR949C4DnfHs3soklTjn/1upkia+TgASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M9mAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEFR1IhAjJCZt6EA7OrFXoJ8feE1YevYYMcmYwVG8whu3TCsjFLIQLjvTgAmGbJ2o7EqpnMTqnGwN1G3xXGHvDOHycSkXFOV1KuAQ4gpAu0QtqwIxtR2PhC2VqtVIqjXh0TxM/PKZc0T4BUU6EBDwQAAAAAARAEAAAAAAz8CWxpZ2h0bmluZwEIn2Ac8fyFEJwAAQMIAAAAAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQgu7JK9IpBWOAABAwighgEAAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4M/AlsaWdodG5pbmcBCOZ1GpRwbKfuAA==" +} +``` AUTHOR ------ -Dusty <<@dusty_daemon>> is mainly responsible. +Dusty <<@dusty\_daemon>> is mainly responsible. + +SEE ALSO +-------- + +lightning-splice\_signed(7), lightning-splice\_update(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:86db6fc3e01abf0d325ab80cc82a4c7bd68358511f4a8bd6528040e5db402cd4) diff --git a/doc/lightning-splice_signed.7.md b/doc/lightning-splice_signed.7.md index 16d9112b657f..7283d6508834 100644 --- a/doc/lightning-splice_signed.7.md +++ b/doc/lightning-splice_signed.7.md @@ -1,24 +1,30 @@ lightning-splice\_signed -- Command to initiate a channel to a peer -===================================================================== +=================================================================== SYNOPSIS -------- **(WARNING: experimental-splicing only)** -**splice\_signed** *channel\_id* *psbt* [*sign\_first*] +**splice\_signed** *channel\_id* *psbt* [*sign\_first*] DESCRIPTION ----------- -`splice_signed` is a low level RPC command which finishes the active channel -splice associated with `channel_id`. +Command *added* in v23.08. -The *psbt* must have all signatures attached to all inputs that you have added -to it or it will fail. +`splice_signed` is a low level RPC command which finishes the active channel splice associated with `channel_id`. -In this example we funded the psbt from our lightning node, so we can use the -lightning node to sign for its funds. +The *psbt* must have all signatures attached to all inputs that you have added to it or it will fail. + +- **channel\_id** (hash): The channel id of the channel to be spliced. +- **psbt** (string): The final version of the psbt to complete the splice with. +- **sign\_first** (boolean, optional): A flag that makes our node offer the final splice signature first (defaults to false). When false, the node will calculate who should sign first based off who is adding inputting the least sats to the splice as per spec. + +EXAMPLE USAGE +------------- + +In this example we funded the psbt from our lightning node, so we can use the lightning node to sign for its funds. ```shell RESULT=$(lightning-cli signpsbt $PSBT) @@ -28,9 +34,7 @@ echo $RESULT lightning-cli splice_signed $CHANNEL_ID $PSBT ``` -Here is a full example set of splice commands that will splice in 100,000 sats -to the first channel that comes out of `listpeerchannels`. The example assumes -you already have at least one confirmed channel. +Here is a full example set of splice commands that will splice in 100,000 sats to the first channel that comes out of `listpeerchannels`. The example assumes you already have at least one confirmed channel. ```shell RESULT=$(lightning-cli listpeerchannels) @@ -45,12 +49,12 @@ RESULT=$(lightning-cli splice_init $CHANNEL_ID 100000 $INITIALPSBT) PSBT=$(echo $RESULT | jq -r ".psbt") echo $RESULT -RESULT="{\"commitments_secured\":false}" +RESULT={"commitments_secured":false} while [[ $(echo $RESULT | jq -r ".commitments_secured") == "false" ]] do - RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT) - PSBT=$(echo $RESULT | jq -r ".psbt") - echo $RESULT + RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT) + PSBT=$(echo $RESULT | jq -r ".psbt") + echo $RESULT done RESULT=$(lightning-cli signpsbt -k psbt="$PSBT") @@ -60,30 +64,49 @@ echo $RESULT lightning-cli splice_signed $CHANNEL_ID $PSBT ``` +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:splice_signed#1", + "method": "splice_signed", + "params": { + "channel_id": "5677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc", + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAAAAAAEQBAAAAAAM/AlsaWdodG5pbmcBCCvyYqqdIt0mAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oBDiBWd3IcNaQkoj1tzHyQkDblBa5oZQ4J1ZcztLfnMAOk3AEPBAEAAAABEAT9////ARNACI9TcWG+6uC9ElBFN3qhND7amsor/dtBhJ5ujEQAT/80548avrt7d7IJiOAaCNzzYLSXITdL2xjx6mhbBi9hTiEWkUUygSpECk12bHHNORk2lKNArhHgEuW6Gtnvum52ylMJAMLMqxcAAAAADPwJbGlnaHRuaW5nAQg5j4QWOQoUFAABAwhOfA0AAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4hB7nAxoROEqUxyWjlXFUHjsFtm/dr6SkP2H0cynK0g5oXCQDWuWnTBAAAAAz8CWxpZ2h0bmluZwEIxt4P7eqf3+QAAQMI4MgQAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQji6kH6aOXoAgA=" + } +} +``` + RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **tx** (hex): The hex representation of the final transaction that is published -- **txid** (txid): The txid is of the final transaction - -[comment]: # (GENERATE-FROM-SCHEMA-END) +- **tx** (hex): The hex representation of the final transaction that is published. +- **txid** (txid): The txid is of the final transaction. -SEE ALSO --------- +EXAMPLE JSON RESPONSE +--------------------- -lightning-splice_init(7), lightning-splice_update(7) +```json +{ + "tx": "020000000001025677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc0000000000000000005677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc0100000000fdffffff024e7c0d00000000002251207836355fdc8a82dc4cb00a772c5554151d06384a4dd65e8d3f68ac08566b84bee0c81000000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd0400473044022053269f3951a1fc942174ac0dde8462405a86c89b31b444890664ee9735872cff02204cd822c4456c15e90ad342b23e9bb252d383d4e17a8a04818c4919e4fd61efd80147304402205ac0787c79e74ebfa0eaf18964625c53eb672cc4bed2c65303bd9cc192dad6f902206c6c0cded47201dae0020f50a8998555e654d3420c64e801fc668238e3c1cdfa0147522102324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b2102e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5752ae0140088f537161beeae0bd125045377aa1343eda9aca2bfddb41849e6e8c44004fff34e78f1abebb7b77b20988e01a08dcf360b49721374bdb18f1ea685b062f614e6c000000", + "txid": "f00d5e230b401274c88d3e6205e2c6117028cb9878b7d2bc52b1441f0b589427" +} +``` AUTHOR ------ -Dusty <<@dusty_daemon>> is mainly responsible. +Dusty <<@dusty\_daemon>> is mainly responsible. + +SEE ALSO +-------- + +lightning-splice\_init(7), lightning-splice\_update(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:429eb13039cd6af7180c7de1d74f001eb1090c6c6d404bac0dcb2af51e0ab0f4) diff --git a/doc/lightning-splice_update.7.md b/doc/lightning-splice_update.7.md index c49318d5ba77..aabc8fdc17c3 100644 --- a/doc/lightning-splice_update.7.md +++ b/doc/lightning-splice_update.7.md @@ -1,53 +1,49 @@ lightning-splice\_update -- Command to initiate a channel to a peer -===================================================================== +=================================================================== SYNOPSIS -------- **(WARNING: experimental-splicing only)** -**splice\_update** *channel\_id* *psbt* +**splice\_update** *channel\_id* *psbt* DESCRIPTION ----------- -`splice_update` is a low level RPC command which updates the active channel -splice associated with `channel_id`. +Command *added* in v23.08. -`splice_update` must be called repeatidly until the result `commitments_secured` -is `true`. Each time `splice_update` is called, it will return a new PSBT that -may have changes. In the simplest case, you take the returned `psbt` and pass -it back into `splice_update` for the incoming `psbt` field. +`splice_update` is a low level RPC command which updates the active channel splice associated with `channel_id`. -For more complex use cases, you may modify the `psbt` both before calling -`splice_update` and inbetween subsequent calls until `commitments_secured` is -`true`. After which point you can no long make modifications to the PSBT (beyond -signing, which comes later with `splice_signed`). +`splice_update` must be called repeatidly until the result `commitments_secured` is `true`. Each time `splice_update` is called, it will return a new PSBT that may have changes. In the simplest case, you take the returned `psbt` and pass it back into `splice_update` for the incoming `psbt` field. -Each `splice_update` result may include changes to the PSBT specified by your -channel peer. You can review these changes between calls to `splice_update` to -perform additional validation or strategy adjustment. +For more complex use cases, you may modify the `psbt` both before calling `splice_update` and inbetween subsequent calls until `commitments_secured` is `true`. After which point you can no long make modifications to the PSBT (beyond signing, which comes later with `splice_signed`). -Typically, `splice_update` will return `commitments_secured` true after one call -but you should assume it will need multiple calls. Here is an example way to -call `splice_update` +Each `splice_update` result may include changes to the PSBT specified by your channel peer. You can review these changes between calls to `splice_update` to perform additional validation or strategy adjustment. + +Typically, `splice_update` will return `commitments_secured` true after one call but you should assume it will need multiple calls. + +- **channel\_id** (hash): The channel id of the channel to be spliced. +- **psbt** (string): The base 64 encoded PSBT returned from `splice_init` with any changes added by the user. + +EXAMPLE USAGE +------------- + +Here is an example way to call `splice_update` ```shell -RESULT="{\"commitments_secured\":false}" +RESULT={"commitments_secured":false} while [[ $(echo $RESULT | jq -r ".commitments_secured") == "false" ]] do - RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT) - PSBT=$(echo $RESULT | jq -r ".psbt") - echo $RESULT + RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT) + PSBT=$(echo $RESULT | jq -r ".psbt") + echo $RESULT done ``` -Before each call to `splice_update` you have the opportunity -to make additional changes. +Before each call to `splice_update` you have the opportunity to make additional changes. -Here is a full example set of splice commands that will splice in 100,000 sats -to the first channel that comes out of `listpeerchannels`. The example assumes -you already have at least one confirmed channel. +Here is a full example set of splice commands that will splice in 100,000 sats to the first channel that comes out of `listpeerchannels`. The example assumes you already have at least one confirmed channel. ```shell RESULT=$(lightning-cli listpeerchannels) @@ -62,12 +58,12 @@ RESULT=$(lightning-cli splice_init $CHANNEL_ID 100000 $INITIALPSBT) PSBT=$(echo $RESULT | jq -r ".psbt") echo $RESULT -RESULT="{\"commitments_secured\":false}" +RESULT={"commitments_secured":false} while [[ $(echo $RESULT | jq -r ".commitments_secured") == "false" ]] do - RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT) - PSBT=$(echo $RESULT | jq -r ".psbt") - echo $RESULT + RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT) + PSBT=$(echo $RESULT | jq -r ".psbt") + echo $RESULT done RESULT=$(lightning-cli signpsbt -k psbt="$PSBT") @@ -77,30 +73,49 @@ echo $RESULT lightning-cli splice_signed $CHANNEL_ID $PSBT ``` +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:splice_update#1", + "method": "splice_update", + "params": { + "channel_id": "5677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc", + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEFR1IhAjJCZt6EA7OrFXoJ8feE1YevYYMcmYwVG8whu3TCsjFLIQLjvTgAmGbJ2o7EqpnMTqnGwN1G3xXGHvDOHycSkXFOV1KuAQ4gVndyHDWkJKI9bcx8kJA25QWuaGUOCdWXM7S35zADpNwBDwQAAAAAARAEAAAAAAz8CWxpZ2h0bmluZwEIK/Jiqp0i3SYAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAQAAAAEQBP3///8M/AlsaWdodG5pbmcBCDmPhBY5ChQUAAEDCE58DQAAAAAAAQQiUSB4NjVf3IqC3EywCncsVVQVHQY4Sk3WXo0/aKwIVmuEvgz8CWxpZ2h0bmluZwEIxt4P7eqf3+QAAQMIAAAAAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQji6kH6aOXoAgA=" + } +} +``` + RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **psbt** (string): the (incomplete) PSBT of the splice transaction -- **commitments\_secured** (boolean): whether or not the commitments were secured +- **psbt** (string): The (incomplete) PSBT of the splice transaction. +- **commitments\_secured** (boolean): Whether or not the commitments were secured. -[comment]: # (GENERATE-FROM-SCHEMA-END) +EXAMPLE JSON RESPONSE +--------------------- -SEE ALSO --------- - -lightning-splice_init(7), lightning-splice_signed(7) +```json +{ + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAAAAAAEQBAAAAAAM/AlsaWdodG5pbmcBCCvyYqqdIt0mAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oBDiBWd3IcNaQkoj1tzHyQkDblBa5oZQ4J1ZcztLfnMAOk3AEPBAEAAAABEAT9////DPwJbGlnaHRuaW5nAQg5j4QWOQoUFAABAwhOfA0AAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4M/AlsaWdodG5pbmcBCMbeD+3qn9/kAAEDCODIEAAAAAAAAQQiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQz8CWxpZ2h0bmluZwEI4upB+mjl6AIA", + "commitments_secured": true +} +``` AUTHOR ------ -Dusty <<@dusty_daemon>> is mainly responsible. +Dusty <<@dusty\_daemon>> is mainly responsible. + +SEE ALSO +-------- + +lightning-splice\_init(7), lightning-splice\_signed(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:60ebb90eba3d3e5a52266efdad0e226bc2a4fa7b16f7cc67a5bcc33055ddc92c) diff --git a/doc/lightning-sql.7.md b/doc/lightning-sql.7.md index c1dc06de4661..1bb81e3de16b 100644 --- a/doc/lightning-sql.7.md +++ b/doc/lightning-sql.7.md @@ -4,440 +4,30 @@ lightning-sql -- Command to do complex queries on list commands SYNOPSIS -------- -**sql** *query* +**sql** *query* DESCRIPTION ----------- -The **sql** RPC command runs the given query across a sqlite3 database -created from various list commands. +Command *added* in v23.02. -When tables are accessed, it calls the above commands, so it's no -faster than any other local access (though it goes to great length to -cache `listnodes` and `listchannels`) which then processes the results. +The **sql** RPC command runs the given query across a sqlite3 database created from various list commands. -It is, however faster for remote access if the result of the query is -much smaller than the list commands would be. +When tables are accessed, it calls the below commands, so it's no faster than any other local access (though it goes to great length to cache `listnodes` and `listchannels`) which then processes the results. -Note that queries like "SELECT *" are fragile, as columns will -change across releases; see lightning-listsqlschemas(7). +It is, however faster for remote access if the result of the query is much smaller than the list commands would be. -TREATMENT OF TYPES ------------------- - -The following types are supported in schemas, and this shows how they -are presented in the database. This matters: a JSON boolean is -represented as an integer in the database, so a query will return 0 or -1, not true or false. - -* *hex*. A hex string. - * JSON: a string - * sqlite3: BLOB - -* *hash*/*secret*/*pubkey*/*txid*: just like *hex*. - -* *msat*/*integer*/*u64*/*u32*/*u16*/*u8*. Normal numbers. - * JSON: an unsigned integer - * sqlite3: INTEGER - -* *boolean*. True or false. - * JSON: literal **true** or **false** - * sqlite3: INTEGER - -* *number*. A floating point number (used for times in some places). - * JSON: number - * sqlite3: REAL - -* *string*. Text. - * JSON: string - * sqlite3: TEXT - -* *short\_channel\_id*. A short-channel-id of form 1x2x3. - * JSON: string - * sqlite3: TEXT - -PERMITTED SQLITE3 FUNCTIONS ---------------------------- - -Writing to the database is not permitted, and limits are placed -on various other query parameters. - -Additionally, only the following functions are allowed: - -* abs -* avg -* coalesce -* count -* hex -* quote -* length -* like -* lower -* upper -* min -* max -* sum -* total - -TABLES ------- - -Note that the first column of every table is a unique integer called -`rowid`: this is used for related tables to refer to specific rows in -their parent. sqlite3 usually has this as an implicit column, but we -make it explicit as the implicit version is not allowed to be used as -a foreign key. - -[comment]: # (GENERATE-DOC-START) -The following tables are currently supported: -- `bkpr_accountevents` (see lightning-bkpr-listaccountevents(7)) - - `account` (type `string`, sqltype `TEXT`) - - `type` (type `string`, sqltype `TEXT`) - - `tag` (type `string`, sqltype `TEXT`) - - `credit_msat` (type `msat`, sqltype `INTEGER`) - - `debit_msat` (type `msat`, sqltype `INTEGER`) - - `currency` (type `string`, sqltype `TEXT`) - - `timestamp` (type `u32`, sqltype `INTEGER`) - - `outpoint` (type `string`, sqltype `TEXT`) - - `blockheight` (type `u32`, sqltype `INTEGER`) - - `origin` (type `string`, sqltype `TEXT`) - - `payment_id` (type `hex`, sqltype `BLOB`) - - `txid` (type `txid`, sqltype `BLOB`) - - `description` (type `string`, sqltype `TEXT`) - - `fees_msat` (type `msat`, sqltype `INTEGER`) - - `is_rebalance` (type `boolean`, sqltype `INTEGER`) - - `part_id` (type `u32`, sqltype `INTEGER`) - -- `bkpr_income` (see lightning-bkpr-listincome(7)) - - `account` (type `string`, sqltype `TEXT`) - - `tag` (type `string`, sqltype `TEXT`) - - `credit_msat` (type `msat`, sqltype `INTEGER`) - - `debit_msat` (type `msat`, sqltype `INTEGER`) - - `currency` (type `string`, sqltype `TEXT`) - - `timestamp` (type `u32`, sqltype `INTEGER`) - - `description` (type `string`, sqltype `TEXT`) - - `outpoint` (type `string`, sqltype `TEXT`) - - `txid` (type `txid`, sqltype `BLOB`) - - `payment_id` (type `hex`, sqltype `BLOB`) - -- `channels` indexed by `short_channel_id` (see lightning-listchannels(7)) - - `source` (type `pubkey`, sqltype `BLOB`) - - `destination` (type `pubkey`, sqltype `BLOB`) - - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`) - - `direction` (type `u32`, sqltype `INTEGER`) - - `public` (type `boolean`, sqltype `INTEGER`) - - `amount_msat` (type `msat`, sqltype `INTEGER`) - - `message_flags` (type `u8`, sqltype `INTEGER`) - - `channel_flags` (type `u8`, sqltype `INTEGER`) - - `active` (type `boolean`, sqltype `INTEGER`) - - `last_update` (type `u32`, sqltype `INTEGER`) - - `base_fee_millisatoshi` (type `u32`, sqltype `INTEGER`) - - `fee_per_millionth` (type `u32`, sqltype `INTEGER`) - - `delay` (type `u32`, sqltype `INTEGER`) - - `htlc_minimum_msat` (type `msat`, sqltype `INTEGER`) - - `htlc_maximum_msat` (type `msat`, sqltype `INTEGER`) - - `features` (type `hex`, sqltype `BLOB`) - -- `closedchannels` (see lightning-listclosedchannels(7)) - - `peer_id` (type `pubkey`, sqltype `BLOB`) - - `channel_id` (type `hash`, sqltype `BLOB`) - - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`) - - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`) - - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`) - - `opener` (type `string`, sqltype `TEXT`) - - `closer` (type `string`, sqltype `TEXT`) - - `private` (type `boolean`, sqltype `INTEGER`) - - related table `closedchannels_channel_type_bits`, from JSON object `channel_type` - - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `bits` (type `u32`, sqltype `INTEGER`) - - related table `closedchannels_channel_type_names`, from JSON object `channel_type` - - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `names` (type `string`, sqltype `TEXT`) - - `total_local_commitments` (type `u64`, sqltype `INTEGER`) - - `total_remote_commitments` (type `u64`, sqltype `INTEGER`) - - `total_htlcs_sent` (type `u64`, sqltype `INTEGER`) - - `funding_txid` (type `txid`, sqltype `BLOB`) - - `funding_outnum` (type `u32`, sqltype `INTEGER`) - - `leased` (type `boolean`, sqltype `INTEGER`) - - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`) - - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`) - - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`) - - `total_msat` (type `msat`, sqltype `INTEGER`) - - `final_to_us_msat` (type `msat`, sqltype `INTEGER`) - - `min_to_us_msat` (type `msat`, sqltype `INTEGER`) - - `max_to_us_msat` (type `msat`, sqltype `INTEGER`) - - `last_commitment_txid` (type `hash`, sqltype `BLOB`) - - `last_commitment_fee_msat` (type `msat`, sqltype `INTEGER`) - - `close_cause` (type `string`, sqltype `TEXT`) - - `last_stable_connection` (type `u64`, sqltype `INTEGER`) - -- `forwards` indexed by `in_channel and in_htlc_id` (see lightning-listforwards(7)) - - `created_index` (type `u64`, sqltype `INTEGER`) - - `in_channel` (type `short_channel_id`, sqltype `TEXT`) - - `in_htlc_id` (type `u64`, sqltype `INTEGER`) - - `in_msat` (type `msat`, sqltype `INTEGER`) - - `status` (type `string`, sqltype `TEXT`) - - `received_time` (type `number`, sqltype `REAL`) - - `out_channel` (type `short_channel_id`, sqltype `TEXT`) - - `out_htlc_id` (type `u64`, sqltype `INTEGER`) - - `updated_index` (type `u64`, sqltype `INTEGER`) - - `style` (type `string`, sqltype `TEXT`) - - `fee_msat` (type `msat`, sqltype `INTEGER`) - - `out_msat` (type `msat`, sqltype `INTEGER`) - - `resolved_time` (type `number`, sqltype `REAL`) - - `failcode` (type `u32`, sqltype `INTEGER`) - - `failreason` (type `string`, sqltype `TEXT`) - -- `htlcs` indexed by `short_channel_id and id` (see lightning-listhtlcs(7)) - - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`) - - `id` (type `u64`, sqltype `INTEGER`) - - `expiry` (type `u32`, sqltype `INTEGER`) - - `amount_msat` (type `msat`, sqltype `INTEGER`) - - `direction` (type `string`, sqltype `TEXT`) - - `payment_hash` (type `hash`, sqltype `BLOB`) - - `state` (type `string`, sqltype `TEXT`) - -- `invoices` indexed by `payment_hash` (see lightning-listinvoices(7)) - - `label` (type `string`, sqltype `TEXT`) - - `description` (type `string`, sqltype `TEXT`) - - `payment_hash` (type `hash`, sqltype `BLOB`) - - `status` (type `string`, sqltype `TEXT`) - - `expires_at` (type `u64`, sqltype `INTEGER`) - - `amount_msat` (type `msat`, sqltype `INTEGER`) - - `bolt11` (type `string`, sqltype `TEXT`) - - `bolt12` (type `string`, sqltype `TEXT`) - - `local_offer_id` (type `hash`, sqltype `BLOB`) - - `invreq_payer_note` (type `string`, sqltype `TEXT`) - - `created_index` (type `u64`, sqltype `INTEGER`) - - `updated_index` (type `u64`, sqltype `INTEGER`) - - `pay_index` (type `u64`, sqltype `INTEGER`) - - `amount_received_msat` (type `msat`, sqltype `INTEGER`) - - `paid_at` (type `u64`, sqltype `INTEGER`) - - `paid_outpoint_txid` (type `txid`, sqltype `BLOB`, from JSON object `paid_outpoint`) - - `paid_outpoint_outnum` (type `u32`, sqltype `INTEGER`, from JSON object `paid_outpoint`) - - `payment_preimage` (type `secret`, sqltype `BLOB`) - -- `nodes` indexed by `nodeid` (see lightning-listnodes(7)) - - `nodeid` (type `pubkey`, sqltype `BLOB`) - - `last_timestamp` (type `u32`, sqltype `INTEGER`) - - `alias` (type `string`, sqltype `TEXT`) - - `color` (type `hex`, sqltype `BLOB`) - - `features` (type `hex`, sqltype `BLOB`) - - related table `nodes_addresses` - - `row` (reference to `nodes.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `type` (type `string`, sqltype `TEXT`) - - `port` (type `u16`, sqltype `INTEGER`) - - `address` (type `string`, sqltype `TEXT`) - - `option_will_fund_lease_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`) - - `option_will_fund_lease_fee_basis` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`) - - `option_will_fund_funding_weight` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`) - - `option_will_fund_channel_fee_max_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`) - - `option_will_fund_channel_fee_max_proportional_thousandths` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`) - - `option_will_fund_compact_lease` (type `hex`, sqltype `BLOB`, from JSON object `option_will_fund`) - -- `offers` indexed by `offer_id` (see lightning-listoffers(7)) - - `offer_id` (type `hash`, sqltype `BLOB`) - - `active` (type `boolean`, sqltype `INTEGER`) - - `single_use` (type `boolean`, sqltype `INTEGER`) - - `bolt12` (type `string`, sqltype `TEXT`) - - `used` (type `boolean`, sqltype `INTEGER`) - - `label` (type `string`, sqltype `TEXT`) - -- `peerchannels` indexed by `peer_id` (see lightning-listpeerchannels(7)) - - `peer_id` (type `pubkey`, sqltype `BLOB`) - - `peer_connected` (type `boolean`, sqltype `INTEGER`) - - `reestablished` (type `boolean`, sqltype `INTEGER`) - - `state` (type `string`, sqltype `TEXT`) - - `scratch_txid` (type `txid`, sqltype `BLOB`) - - related table `peerchannels_channel_type_bits`, from JSON object `channel_type` - - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `bits` (type `u32`, sqltype `INTEGER`) - - related table `peerchannels_channel_type_names`, from JSON object `channel_type` - - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `names` (type `string`, sqltype `TEXT`) - - `local_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`) - - `local_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`) - - `local_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `local`) - - `local_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`) - - `local_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `local`) - - `remote_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`) - - `remote_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`) - - `remote_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `remote`) - - `remote_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`) - - `remote_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `remote`) - - `ignore_fee_limits` (type `boolean`, sqltype `INTEGER`) - - `lost_state` (type `boolean`, sqltype `INTEGER`) - - `feerate_perkw` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`) - - `feerate_perkb` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`) - - `owner` (type `string`, sqltype `TEXT`) - - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`) - - `channel_id` (type `hash`, sqltype `BLOB`) - - `funding_txid` (type `txid`, sqltype `BLOB`) - - `funding_outnum` (type `u32`, sqltype `INTEGER`) - - `initial_feerate` (type `string`, sqltype `TEXT`) - - `last_feerate` (type `string`, sqltype `TEXT`) - - `next_feerate` (type `string`, sqltype `TEXT`) - - `next_fee_step` (type `u32`, sqltype `INTEGER`) - - related table `peerchannels_inflight` - - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `funding_txid` (type `txid`, sqltype `BLOB`) - - `funding_outnum` (type `u32`, sqltype `INTEGER`) - - `feerate` (type `string`, sqltype `TEXT`) - - `total_funding_msat` (type `msat`, sqltype `INTEGER`) - - `splice_amount` (type `integer`, sqltype `INTEGER`) - - `our_funding_msat` (type `msat`, sqltype `INTEGER`) - - `scratch_txid` (type `txid`, sqltype `BLOB`) - - `close_to` (type `hex`, sqltype `BLOB`) - - `private` (type `boolean`, sqltype `INTEGER`) - - `opener` (type `string`, sqltype `TEXT`) - - `closer` (type `string`, sqltype `TEXT`) - - related table `peerchannels_features` - - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `features` (type `string`, sqltype `TEXT`) - - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`) - - `funding_local_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`) - - `funding_remote_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`) - - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`) - - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`) - - `to_us_msat` (type `msat`, sqltype `INTEGER`) - - `min_to_us_msat` (type `msat`, sqltype `INTEGER`) - - `max_to_us_msat` (type `msat`, sqltype `INTEGER`) - - `total_msat` (type `msat`, sqltype `INTEGER`) - - `fee_base_msat` (type `msat`, sqltype `INTEGER`) - - `fee_proportional_millionths` (type `u32`, sqltype `INTEGER`) - - `dust_limit_msat` (type `msat`, sqltype `INTEGER`) - - `max_total_htlc_in_msat` (type `msat`, sqltype `INTEGER`) - - `their_reserve_msat` (type `msat`, sqltype `INTEGER`) - - `our_reserve_msat` (type `msat`, sqltype `INTEGER`) - - `spendable_msat` (type `msat`, sqltype `INTEGER`) - - `receivable_msat` (type `msat`, sqltype `INTEGER`) - - `minimum_htlc_in_msat` (type `msat`, sqltype `INTEGER`) - - `minimum_htlc_out_msat` (type `msat`, sqltype `INTEGER`) - - `maximum_htlc_out_msat` (type `msat`, sqltype `INTEGER`) - - `their_to_self_delay` (type `u32`, sqltype `INTEGER`) - - `our_to_self_delay` (type `u32`, sqltype `INTEGER`) - - `max_accepted_htlcs` (type `u32`, sqltype `INTEGER`) - - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`) - - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`) - - related table `peerchannels_state_changes` - - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `timestamp` (type `string`, sqltype `TEXT`) - - `old_state` (type `string`, sqltype `TEXT`) - - `new_state` (type `string`, sqltype `TEXT`) - - `cause` (type `string`, sqltype `TEXT`) - - `message` (type `string`, sqltype `TEXT`) - - related table `peerchannels_status` - - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `status` (type `string`, sqltype `TEXT`) - - `in_payments_offered` (type `u64`, sqltype `INTEGER`) - - `in_offered_msat` (type `msat`, sqltype `INTEGER`) - - `in_payments_fulfilled` (type `u64`, sqltype `INTEGER`) - - `in_fulfilled_msat` (type `msat`, sqltype `INTEGER`) - - `out_payments_offered` (type `u64`, sqltype `INTEGER`) - - `out_offered_msat` (type `msat`, sqltype `INTEGER`) - - `out_payments_fulfilled` (type `u64`, sqltype `INTEGER`) - - `out_fulfilled_msat` (type `msat`, sqltype `INTEGER`) - - `last_stable_connection` (type `u64`, sqltype `INTEGER`) - - related table `peerchannels_htlcs` - - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `direction` (type `string`, sqltype `TEXT`) - - `id` (type `u64`, sqltype `INTEGER`) - - `amount_msat` (type `msat`, sqltype `INTEGER`) - - `expiry` (type `u32`, sqltype `INTEGER`) - - `payment_hash` (type `hash`, sqltype `BLOB`) - - `local_trimmed` (type `boolean`, sqltype `INTEGER`) - - `status` (type `string`, sqltype `TEXT`) - - `state` (type `string`, sqltype `TEXT`) - - `close_to_addr` (type `string`, sqltype `TEXT`) - - `last_tx_fee_msat` (type `msat`, sqltype `INTEGER`) - - `direction` (type `u32`, sqltype `INTEGER`) - -- `peers` indexed by `id` (see lightning-listpeers(7)) - - `id` (type `pubkey`, sqltype `BLOB`) - - `connected` (type `boolean`, sqltype `INTEGER`) - - `num_channels` (type `u32`, sqltype `INTEGER`) - - related table `peers_netaddr` - - `row` (reference to `peers.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `netaddr` (type `string`, sqltype `TEXT`) - - `remote_addr` (type `string`, sqltype `TEXT`) - - `features` (type `hex`, sqltype `BLOB`) - -- `sendpays` indexed by `payment_hash` (see lightning-listsendpays(7)) - - `created_index` (type `u64`, sqltype `INTEGER`) - - `id` (type `u64`, sqltype `INTEGER`) - - `groupid` (type `u64`, sqltype `INTEGER`) - - `partid` (type `u64`, sqltype `INTEGER`) - - `payment_hash` (type `hash`, sqltype `BLOB`) - - `updated_index` (type `u64`, sqltype `INTEGER`) - - `status` (type `string`, sqltype `TEXT`) - - `amount_msat` (type `msat`, sqltype `INTEGER`) - - `destination` (type `pubkey`, sqltype `BLOB`) - - `created_at` (type `u64`, sqltype `INTEGER`) - - `amount_sent_msat` (type `msat`, sqltype `INTEGER`) - - `label` (type `string`, sqltype `TEXT`) - - `bolt11` (type `string`, sqltype `TEXT`) - - `description` (type `string`, sqltype `TEXT`) - - `bolt12` (type `string`, sqltype `TEXT`) - - `completed_at` (type `u64`, sqltype `INTEGER`) - - `payment_preimage` (type `secret`, sqltype `BLOB`) - - `erroronion` (type `hex`, sqltype `BLOB`) - -- `transactions` indexed by `hash` (see lightning-listtransactions(7)) - - `hash` (type `txid`, sqltype `BLOB`) - - `rawtx` (type `hex`, sqltype `BLOB`) - - `blockheight` (type `u32`, sqltype `INTEGER`) - - `txindex` (type `u32`, sqltype `INTEGER`) - - `locktime` (type `u32`, sqltype `INTEGER`) - - `version` (type `u32`, sqltype `INTEGER`) - - related table `transactions_inputs` - - `row` (reference to `transactions.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `txid` (type `txid`, sqltype `BLOB`) - - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`) - - `sequence` (type `u32`, sqltype `INTEGER`) - - related table `transactions_outputs` - - `row` (reference to `transactions.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`) - - `amount_msat` (type `msat`, sqltype `INTEGER`) - - `scriptPubKey` (type `hex`, sqltype `BLOB`) - -[comment]: # (GENERATE-DOC-END) - -RETURN VALUE ------------- - -[comment]: # (FIXME: we don't handle this schema in fromschema.py) -On success, an object containing **rows** is returned. It is an array. Each array entry contains an array of values, each an integer, real number, string or *null*, depending on the sqlite3 type. - -The object may contain **warning\_db\_failure** if the database fails partway through its operation. - -ERRORS ------- - -On failure, an error is returned. +- **query** (string): The standard sqlite3 query to run. + Note that queries like "SELECT *" are fragile, as columns will change across releases; see lightning-listsqlschemas(7). EXAMPLE USAGE ------------- -Here are some example using lightning-cli. Note that you may need to -use `-o` if you use queries which contain `=` (which make -lightning-cli(1) default to keyword style): +Here are some example using lightning-cli. Note that you may need to use `-o` if you use queries which contain `=` (which make lightning-cli(1) default to keyword style): A simple peer selection query: -``` +```shell $ lightning-cli sql "SELECT id FROM peers" { "rows": [ @@ -450,7 +40,7 @@ $ lightning-cli sql "SELECT id FROM peers" A statement containing using `=` needs `-o`: -``` +```shell $ lightning-cli sql -o "SELECT node_id,last_timestamp FROM nodes WHERE last_timestamp>=1669578892" { "rows": [ @@ -464,7 +54,7 @@ $ lightning-cli sql -o "SELECT node_id,last_timestamp FROM nodes WHERE last_time If you want to compare a BLOB column, `x'hex'` or `X'hex'` are needed: -``` +```shell $ lightning-cli sql -o "SELECT nodeid FROM nodes WHERE nodeid != x'03c9d25b6c0ce4bde5ad97d7ab83f00ae8bd3800a98ccbee36f3c3205315147de1';" { "rows": [ @@ -491,7 +81,7 @@ $ lightning-cli sql -o "SELECT nodeid FROM nodes WHERE nodeid IN (x'03c9d25b6c0c Related tables are usually referenced by JOIN: -``` +```shell $ lightning-cli sql -o "SELECT nodeid, alias, nodes_addresses.type, nodes_addresses.port, nodes_addresses.address FROM nodes INNER JOIN nodes_addresses ON nodes_addresses.row = nodes.rowid" { "rows": [ @@ -513,10 +103,9 @@ $ lightning-cli sql -o "SELECT nodeid, alias, nodes_addresses.type, nodes_addres } ``` -Simple function usage, in this case COUNT. Strings inside arrays need -", and ' to protect them from the shell: +Simple function usage, in this case COUNT. Strings inside arrays need ", and ' to protect them from the shell: -``` +```shell $ lightning-cli sql 'SELECT COUNT(*) FROM nodes" { "rows": [ @@ -527,6 +116,83 @@ $ lightning-cli sql 'SELECT COUNT(*) FROM nodes" } ``` +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:sql#1", + "method": "sql", + "params": [ + "SELECT * FROM forwards;" + ] +} +{ + "id": "example:sql#2", + "method": "sql", + "params": [ + "SELECT * from peerchannels_features" + ] +} +``` + +RETURN VALUE +------------ + +On success, an object containing **rows** is returned. It is an array. Each array entry contains an array of values, each an integer, real number, string or *null*, depending on the sqlite3 type. + +The object may contain **warning\_db\_failure** if the database fails partway through its operation. +On success, an object is returned, containing: + +- **rows** (array of arrays): + - (array) + +The following warnings may also be returned: + +- **warning\_db\_failure**: A message if the database encounters an error partway through. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "rows": [] +} +{ + "rows": [ + [ + 6, + 1, + 0, + "option_static_remotekey" + ], + [ + 7, + 1, + 1, + "option_anchors_zero_fee_htlc_tx" + ], + [ + 16, + 11, + 0, + "option_static_remotekey" + ], + [ + 17, + 11, + 1, + "option_anchors_zero_fee_htlc_tx" + ] + ] +} +``` + +ERRORS +------ + +On failure, an error is returned. + AUTHOR ------ @@ -535,10 +201,9 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-listtransactions(7), lightning-listchannels(7), lightning-listpeers(7), lightning-listnodes(7), lightning-listforwards(7). +lightning-listtransactions(7), lightning-listchannels(7), lightning-listpeers(7), lightning-listnodes(7), lightning-listforwards(7) RESOURCES --------- Main web site: -[comment]: # ( SHA256STAMP:5c2e41cab6704299c65a8537761f3864e6b3327c1bf9163b00afe723d1f84eb6) diff --git a/doc/lightning-staticbackup.7.md b/doc/lightning-staticbackup.7.md index 317734bc4f88..a390f4364f35 100644 --- a/doc/lightning-staticbackup.7.md +++ b/doc/lightning-staticbackup.7.md @@ -1,28 +1,45 @@ lightning-staticbackup -- Command for deriving getting SCB of all the existing channels -====================================================================================== +======================================================================================= SYNOPSIS -------- -**staticbackup** +**staticbackup** DESCRIPTION ----------- The **staticbackup** RPC command returns an object with SCB of all the channels in an array. +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:staticbackup#1", + "method": "staticbackup", + "params": "{}" +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: - **scb** (array of hexs): - - SCB of a channel in TLV format + - (hex, optional): SCB of a channel in TLV format. -[comment]: # (GENERATE-FROM-SCHEMA-END) +EXAMPLE JSON RESPONSE +--------------------- +```json +{ + "scb": [ + "0000000000000001c707da9b230e1655b0a6c082b8daf4fa44d9d1f68163ed4d531d45cf453dc651022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d5900017f000001b2e3c707da9b230e1655b0a6c082b8daf4fa44d9d1f68163ed4d531d45cf453dc6510000000000000000000186a000021000" + ] +} +``` AUTHOR ------ @@ -38,5 +55,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:2d991663ce45ada109fd8b0bfca5cee3c9f4f59503d63a5f5b1f669f83cefc67) diff --git a/doc/lightning-stop.7.md b/doc/lightning-stop.7.md index 245f2f2b31e8..1ef9ba31e9fd 100644 --- a/doc/lightning-stop.7.md +++ b/doc/lightning-stop.7.md @@ -4,7 +4,7 @@ lightning-stop -- Command to shutdown the Core Lightning node. SYNOPSIS -------- -**stop** +**stop** DESCRIPTION ----------- @@ -12,11 +12,11 @@ DESCRIPTION The **stop** is a RPC command to shut off the Core Lightning node. EXAMPLE JSON REQUEST ------------- +-------------------- ```json { - "id": 82, + "id": "example:stop#1", "method": "stop", "params": {} } @@ -25,26 +25,26 @@ EXAMPLE JSON REQUEST RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: - **result** (string) (always "Shutdown complete") *(added v24.05)* -[comment]: # (GENERATE-FROM-SCHEMA-END) - -Once it has returned, the daemon has cleaned up completely, and if -desired may be restarted immediately. +EXAMPLE JSON RESPONSE +--------------------- +```json +{ + "result": "Shutdown complete" +} +``` AUTHOR ------ -Vincenzo Palazzo <> wrote the initial version of this man page, but many others did the hard work of actually implementing this rpc command. - +Vincenzo Palazzo <> wrote the initial version of this man page, +but many others did the hard work of actually implementing this rpc command. RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:91bba4770ed15de26de26d1fa380817a0f323293aae7a95eda835b7d566aad85) diff --git a/doc/lightning-txdiscard.7.md b/doc/lightning-txdiscard.7.md index 04d3990257f2..2e71b65a2b70 100644 --- a/doc/lightning-txdiscard.7.md +++ b/doc/lightning-txdiscard.7.md @@ -4,28 +4,47 @@ lightning-txdiscard -- Abandon a transaction from txprepare, release inputs SYNOPSIS -------- -**txdiscard** *txid* +**txdiscard** *txid* DESCRIPTION ----------- -The **txdiscard** RPC command releases inputs which were reserved for -use of the *txid* from lightning-txprepare(7). +The **txdiscard** RPC command releases inputs which were reserved for use of the *txid* from lightning-txprepare(7). + +- **txid** (txid): The transaction id, inputs should be unreseverd from. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:txdiscard#1", + "method": "txdiscard", + "params": { + "txid": "6e680cb76077f11c838cc7aee0c0aa360f9857f00856bb1614025a1af53739fc" + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **unsigned\_tx** (hex): the unsigned transaction -- **txid** (txid): the transaction id of *unsigned\_tx* +- **unsigned\_tx** (hex): The unsigned transaction. +- **txid** (txid): The transaction id of *unsigned\_tx*. -[comment]: # (GENERATE-FROM-SCHEMA-END) +If there is no matching *txid*, an error is reported. Note that this may happen due to incorrect usage, such as **txdiscard** or **txsend** already being called for *txid*. -If there is no matching *txid*, an error is reported. Note that this may -happen due to incorrect usage, such as **txdiscard** or **txsend** -already being called for *txid*. +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "unsigned_tx": "020000000142dc00d81359c3a551e170e3bf5262fa9cacc2eb2e283a10e579491cd86dce4b0000000000fdffffff02ffffff00000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd42839800000000002251207836355fdc8a82dc4cb00a772c5554151d06384a4dd65e8d3f68ac08566b84be66000000", + "txid": "6e680cb76077f11c838cc7aee0c0aa360f9857f00856bb1614025a1af53739fc" +} +``` ERRORS ------ @@ -48,5 +67,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:8186e8767a80b13a133ecfe5a433252514f4a7eb31387f0380c04eb2b2d0a696) diff --git a/doc/lightning-txprepare.7.md b/doc/lightning-txprepare.7.md index 7c00bd9f4e46..01f6ed2c5c15 100644 --- a/doc/lightning-txprepare.7.md +++ b/doc/lightning-txprepare.7.md @@ -4,41 +4,88 @@ lightning-txprepare -- Command to prepare to withdraw funds from the internal wa SYNOPSIS -------- -**txprepare** *outputs* [*feerate*] [*minconf*] [*utxos*] +**txprepare** *outputs* [*feerate*] [*minconf*] [*utxos*] DESCRIPTION ----------- -The **txprepare** RPC command creates an unsigned transaction which -spends funds from Core Lightning's internal wallet to the outputs specified -in *outputs*. - -**txprepare** is similar to the first part of a **withdraw** command, but -supports multiple outputs and uses *outputs* as parameter. The second part -is provided by **txsend**. +The **txprepare** RPC command creates an unsigned transaction which spends funds from Core Lightning's internal wallet to the outputs specified in *outputs*. + +**txprepare** is similar to the first part of a **withdraw** command, but supports multiple outputs and uses *outputs* as parameter. The second part is provided by **txsend**. + +- **outputs** (array of outputdescs): Format is like: [{destination1: amount1}, {destination2: amount2}] or [{destination: *all*}]. It supports any number of **confirmed** outputs.: + - (outputdesc, optional) +- **feerate** (feerate, optional): Used for the transaction as initial feerate. The default is *normal*. +- **minconf** (u32, optional): The minimum number of confirmations that used outputs should have. The default is 1. +- **utxos** (array of outpoints, optional): To be used to fund the transaction, as an array of `txid:vout`. These must be drawn from the node's available UTXO set.: + - (outpoint, optional) + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:txprepare#1", + "method": "txprepare", + "params": { + "outputs": [ + { + "bcrt1qtwxd8wg5eanumk86vfeujvp48hfkgannf77evggzct048wggsrxsum2pmm": 16777215 + } + ], + "feerate": null, + "minconf": null, + "utxos": null + } +} +{ + "id": "example:txprepare#2", + "method": "txprepare", + "params": { + "outputs": [ + { + "bcrt1qyhu7rxj3rrlcj84jtzp2mk9d89xm9v2rx4d4h8au830axugx6mmqsuplng": "100000sat" + } + ], + "feerate": null, + "minconf": null, + "utxos": null + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **psbt** (string): the PSBT representing the unsigned transaction -- **unsigned\_tx** (hex): the unsigned transaction -- **txid** (txid): the transaction id of *unsigned\_tx*; you hand this to lightning-txsend(7) or lightning-txdiscard(7), as the inputs of this transaction are reserved. - -[comment]: # (GENERATE-FROM-SCHEMA-END) +- **psbt** (string): The PSBT representing the unsigned transaction. +- **unsigned\_tx** (hex): The unsigned transaction. +- **txid** (txid): The transaction id of *unsigned\_tx*; you hand this to lightning-txsend(7) or lightning-txdiscard(7), as the inputs of this transaction are reserved. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "unsigned_tx": "020000000142dc00d81359c3a551e170e3bf5262fa9cacc2eb2e283a10e579491cd86dce4b0000000000fdffffff02ffffff00000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd42839800000000002251207836355fdc8a82dc4cb00a772c5554151d06384a4dd65e8d3f68ac08566b84be66000000", + "txid": "6e680cb76077f11c838cc7aee0c0aa360f9857f00856bb1614025a1af53739fc", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABATRHoQ9tEMHRHpf06v5uTEdjdMk1rccIaA6MNGMipNQWAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFLnqitWTi465LGxeucwoSAj16NGbAkcwRAIgVtOsUaQaPgH86aW6e6qmJa1xVb8KWvc+HALGosqVVmQCIFi4JU8Gy+vl2a2/frY+71hitYIBB/tjsRP7fpgb8b9TASECHUIV5q1r2ownjOlAFPQASTlZxxNgBvi5O3hCRvajwdJlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIELcANgTWcOlUeFw479SYvqcrMLrLig6EOV5SRzYbc5LAQ8EAAAAAAEQBP3///8AAQMI////AAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAAEDCEKDmAAAAAAAAQQiUSB4NjVf3IqC3EywCncsVVQVHQY4Sk3WXo0/aKwIVmuEvgA=" +} +{ + "unsigned_tx": "0200000001a91077a134fb9fe4a8d13a482b718368bfd9ce3eff61ff7d96549480a1f97dca0100000000fdffffff02a08601000000000022002025f9e19a5118ff891eb25882add8ad394db2b143355b5b9fbc3c5fd37106d6f66173010000000000225120a2a01c7965289eee56b5cfcddb9856c70fa476c264d21f711c6a69af776ae40366000000", + "txid": "f11d436054607603e903fc69c4bd9b39ce97421341c7cf814ad025cb5bf59c1c", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABAYZ4QwAgPq6Os8kk073f5Yx4T9LXYfbOjAdkzMXfuBQdAAAAAAD9////AjPkAioBAAAAFgAUeOeqzyifepeJAMCl4vnnJ/TRptRADQMAAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgYBFwmqWCrVkxxZ0/tte3z4lIem0L7MkhXzGAOvBWa6YCIFx7H4zOzxjixlZMi0DYYbIEflDjYHJXLfN1wVcXYuekASEDgztw/3Rks6vKGYMXJ83VEvQcNIjg3rJW6KdxEh26uwplAAAAAQEfQA0DAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIKkQd6E0+5/kqNE6SCtxg2i/2c4+/2H/fZZUlICh+X3KAQ8EAQAAAAEQBP3///8AAQMIoIYBAAAAAAABBCIAICX54ZpRGP+JHrJYgq3YrTlNsrFDNVtbn7w8X9NxBtb2AAEDCGFzAQAAAAAAAQQiUSCioBx5ZSie7la1z83bmFbHD6R2wmTSH3Ecammvd2rkAwA=" +} +``` ERRORS ------ On failure, an error is reported and the transaction is not created. -The following error codes may occur: - - -1: Catchall nonspecific error. -- 301: There are not enough funds in the internal wallet (including -fees) to create the transaction. +- 301: There are not enough funds in the internal wallet (including fees) to create the transaction. - 302: The dust limit is not met. AUTHOR @@ -49,12 +96,9 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-withdraw(7), lightning-txsend(7), lightning-txdiscard(7), -lightning-feerates(7) +lightning-withdraw(7), lightning-txsend(7), lightning-txdiscard(7), lightning-feerates(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:2711c2b658ca99c61153facb3a532ae3b3a5b8ac86419796e0bf2f7daa6e53c5) diff --git a/doc/lightning-txsend.7.md b/doc/lightning-txsend.7.md index eff2f7365edd..6321605cf913 100644 --- a/doc/lightning-txsend.7.md +++ b/doc/lightning-txsend.7.md @@ -4,33 +4,52 @@ lightning-txsend -- Command to sign and send transaction from txprepare SYNOPSIS -------- -**txsend** *txid* +**txsend** *txid* DESCRIPTION ----------- -The **txsend** RPC command signs and broadcasts a transaction created by -**txprepare**. +The **txsend** RPC command signs and broadcasts a transaction created by *txprepare* RPC command. + +- **txid** (txid): The transaction id of the transaction created by `txprepare` rpc command. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:txsend#1", + "method": "txsend", + "params": { + "txid": "c9f59ba6bda8e095bb43ecabfa37de8d5194e5c839b6b63be4e29bceaae483ce" + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **psbt** (string): the completed PSBT representing the signed transaction -- **tx** (hex): the fully signed transaction -- **txid** (txid): the transaction id of *tx* +- **psbt** (string): The completed PSBT representing the signed transaction. +- **tx** (hex): The fully signed transaction. +- **txid** (txid): The transaction id of *tx*. -[comment]: # (GENERATE-FROM-SCHEMA-END) +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "tx": "020000000142dc00d81359c3a551e170e3bf5262fa9cacc2eb2e283a10e579491cd86dce4b0000000000fdffffff020000000100000000220020b636f07026ea64952ece5b7620a9337d9ac2321c796a499260994d1b373667504183980000000000225120754a77b503fcba0fd80f0a1a8226ed6764ff9a9d9bb61b485d40d4c9f4be245966000000", + "txid": "c9f59ba6bda8e095bb43ecabfa37de8d5194e5c839b6b63be4e29bceaae483ce", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABATRHoQ9tEMHRHpf06v5uTEdjdMk1rccIaA6MNGMipNQWAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFLnqitWTi465LGxeucwoSAj16NGbAkcwRAIgVtOsUaQaPgH86aW6e6qmJa1xVb8KWvc+HALGosqVVmQCIFi4JU8Gy+vl2a2/frY+71hitYIBB/tjsRP7fpgb8b9TASECHUIV5q1r2ownjOlAFPQASTlZxxNgBvi5O3hCRvajwdJlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZSICA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPRzBEAiBp/HPhg1ObOXqTr5rIjUYLMspGLz+sk1pjD9pjRFzf3wIgWycOB/dQPzwZAK3OXYs269h8o85ucDpdVhH4AyX69a0BIgYD10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8IAfrZCgAAAAABDiBC3ADYE1nDpVHhcOO/UmL6nKzC6y4oOhDleUkc2G3OSwEPBAAAAAABEAT9////AAEDCAAAAAEAAAAAAQQiACC2NvBwJupklS7OW3YgqTN9msIyHHlqSZJgmU0bNzZnUAABAwhBg5gAAAAAAAEEIlEgdUp3tQP8ug/YDwoagibtZ2T/mp2bthtIXUDUyfS+JFkhBycqmiXx/+1S+rBKLMiK6rE1tTcjhWqPFIHCZBf4ipIuCQDVXEk5CwAAAAA=" +} +``` ERRORS ------ -On failure, an error is reported (from bitcoind), and the inputs from -the transaction are unreserved. - -The following error codes may occur: +On failure, an error is reported (from bitcoind), and the inputs from the transaction are unreserved. - -1: Catchall nonspecific error. @@ -48,5 +67,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:26872287dd544ccf20343128682f0b1a496f816cadc5c1accc814dae02fcc420) diff --git a/doc/lightning-unreserveinputs.7.md b/doc/lightning-unreserveinputs.7.md index 0083c6b05a1c..a3eccdd6337c 100644 --- a/doc/lightning-unreserveinputs.7.md +++ b/doc/lightning-unreserveinputs.7.md @@ -4,45 +4,81 @@ lightning-unreserveinputs -- Release reserved UTXOs SYNOPSIS -------- -**unreserveinputs** *psbt* [*reserve*] +**unreserveinputs** *psbt* [*reserve*] DESCRIPTION ----------- -The **unreserveinputs** RPC command releases (or reduces reservation) -on UTXOs which were previously marked as reserved, generally by -lightning-reserveinputs(7). +The **unreserveinputs** RPC command releases (or reduces reservation) on UTXOs which were previously marked as reserved, generally by lightning-reserveinputs(7). + +- **psbt** (string): Inputs to unreserve are the inputs specified in the passed-in *psbt*. +- **reserve** (u32, optional): The number of blocks to decrease reservation by. The default is 72. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:unreserveinputs#1", + "method": "unreserveinputs", + "params": { + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABAXyy20ynmOFyRbegGyApk50yNIAb4C+RKV5c2n5VKL3lAAAAAAD9////Akf0EAAAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WUs/fQpAQAAABYAFN9HebR4q6498ytdeRKjC64CkCOMAkcwRAIgSTJCpWVH1FLZYPdwFe7gZckxCtk+AxPp20KUVKqPIdUCIA3hkoUco68vffiwt6TrE3KgX09JE9m7PDUUgrHQANMRASEDBOBlCza/8qXE5q8uJ+OWsKscDERWfdA+LLCa/lwMH0BlAAAAAQEfR/QQAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZSICA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPRzBEAiBKjSasyN29ODqXSemEQCZfRIvbJP8thKRBrd4e+NLEMQIgMGNz3+DWDnLmjnIDCaVcC7BKxuycwvtJq1qlKFtTaXcBIgYD10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8IAfrZCgAAAAABDiAoXS6QUlCcOApG/j+hr4OhNt0tT4GvCzI6z16Hepi7OwEPBAAAAAABEAT9////AAEDCCN6CAAAAAAAAQQWABQfJ4Qjje0sa2yGBz++6jkM2hGRmAz8CWxpZ2h0bmluZwQCAAEAAQMIinkIAAAAAAABBCJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aIQeRRTKBKkQKTXZscc05GTaUo0CuEeAS5boa2e+6bnbKUwkAwsyrFwIAAAAA", + "reserve": 200 + } +} +{ + "id": "example:unreserveinputs#2", + "method": "unreserveinputs", + "params": { + "psbt": "cHNidP8BAF4CAAAAAVa79WPJoiYrzo/RgzIAn5HanoBFZo0vZvEjxPAVwLv4AAAAAAD9////AXzpHAAAAAAAIlEgBRjpLNlOD2LAbxJt/5i5q+ebfthFoVbVJFZ44mVUR11mAAAAAAEA3gIAAAAAAQENwcSElLyC0jcwUHiODBhtapHyzIdiwytOGiu/Raf4BwAAAAAA/f///wKAhB4AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFl82znKQEAAAAWABQyIWyAI6LDf6dJ58BDPdkh+PWUZwJHMEQCIGiJFhVi/d/Hz19Cz48uHTjhgBJ6WAlgl/bLVS7A6VtxAiAwlb7xYzIM4uopFvMnpOmGIOp3+upOPPF2F8VaB8U/HQEhA6BAjey7RADP4ifoh2VXhX7QXkh+sZqozv1EPuU5TxZmZQAAAAEBH4CEHgAAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WUAAA==", + "reserve": null + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object containing **reservations** 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: -- **txid** (txid): the transaction id -- **vout** (u32): the output number which was reserved -- **was\_reserved** (boolean): whether the input was already reserved (usually `true`) -- **reserved** (boolean): whether the input is now reserved (may still be `true` if it was reserved for a long time) +- **txid** (txid): The transaction id. +- **vout** (u32): The output number which was reserved. +- **was\_reserved** (boolean): Whether the input was already reserved (usually `true`). +- **reserved** (boolean): Whether the input is now reserved (may still be `true` if it was reserved for a long time). If **reserved** is *true*: - - - **reserved\_to\_block** (u32): what blockheight the reservation will expire - -[comment]: # (GENERATE-FROM-SCHEMA-END) + - **reserved\_to\_block** (u32): What blockheight the reservation will expire. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "reservations": [ + { + "txid": "3bbb987a875ecf3a320baf814f2ddd36a183afa13ffe460a389c5052902e5d28", + "vout": 0, + "was_reserved": true, + "reserved": false + } + ] +} +{ + "reservations": [] +} +``` ERRORS ------ On failure, an error is reported and no UTXOs are unreserved. -The following error codes may occur: - - -32602: Invalid parameter, i.e. an unparseable PSBT. AUTHOR ------ -niftynei <> is mainly responsible. +Lisa Neigut <> is mainly responsible. SEE ALSO -------- @@ -53,5 +89,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:2957a85bf8b9d70f8e253d6646f31aa9c2f135c7a161fd52d0e86d933adc3c57) diff --git a/doc/lightning-upgradewallet.7.md b/doc/lightning-upgradewallet.7.md index f2a8775c6222..fb99cd40ea62 100644 --- a/doc/lightning-upgradewallet.7.md +++ b/doc/lightning-upgradewallet.7.md @@ -1,52 +1,81 @@ lightning-upgradewallet -- Command to spend all P2SH-wrapped inputs into a Native Segwit output -================================================================ +=============================================================================================== SYNOPSIS -------- -**upgradewallet** [*feerate*] [*reservedok*] +**upgradewallet** [*feerate*] [*reservedok*] DESCRIPTION ----------- -`upgradewallet` is a convenience RPC which will spend all p2sh-wrapped -Segwit deposits in a wallet into a single Native Segwit P2WPKH address. +`upgradewallet` is a convenience RPC which will spend all p2sh-wrapped Segwit deposits in a wallet into a single Native Segwit P2WPKH address. -*feerate* is an optional feerate: see NOTES in lightning-feerates(7) -for possible values. The default is *opening*. - -*reservedok* tells the wallet to include all P2SH-wrapped inputs, including -reserved ones. +- **feerate** (feerate, optional): Feerate for the upgrade transaction. The default is *opening*. *(added v23.02)* +- **reservedok** (boolean, optional): Tells the wallet to include all P2SH-wrapped inputs, including reserved ones. *(added v23.02)* EXAMPLE USAGE ------------- -The caller is trying to buy a liquidity ad but the command keeps failing. -They have funds in their wallet, but they're all P2SH-wrapped outputs. - -The caller can call `upgradewallet` to convert their funds to native segwit -outputs, which are valid for liquidity ad buys. +The caller is trying to buy a liquidity ad but the command keeps failing. They have funds in their wallet, but they're all P2SH-wrapped outputs. + +The caller can call `upgradewallet` to convert their funds to native segwit outputs, which are valid for liquidity ad buys. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:upgradewallet#1", + "method": "upgradewallet", + "params": "{}" +} +{ + "id": "example:upgradewallet#2", + "method": "upgradewallet", + "params": { + "feerate": "urgent", + "reservedok": true + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) -[comment]: # (GENERATE-FROM-SCHEMA-END) +On success, an object is returned, containing: + +- **upgraded\_outs** (u64): Count of spent/upgraded UTXOs. *(added v23.02)* +- **psbt** (string, optional): The PSBT that was finalized and sent. *(added v23.02)* +- **tx** (hex, optional): The raw transaction which was sent. *(added v23.02)* +- **txid** (txid, optional): The txid of the **tx**. *(added v23.02)* +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "upgraded_outs": 0 +} +{ + "tx": "0200000001c08ce0a9ea1e00179ea603cb8619ec2a2df990ef931e1ccd87fa7a0e271ed8370100000000fdffffff013514310100000000225120888ab14b6e1655d1d00039b836d70b66e3351543ab6cd2f94166255f3d5e6cb5cf000000", + "txid": "de5f1d6f0b2f95cfe5cfbf8cc33bd3f279a8f800ee0efc27bbfafb2b6ead9560", + "psbt": "cHNidP8BAgQCAAAAAQMEzwAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDgAgAAAAABAZRZ0m0kaJA+ubJw1eYurGROu1BYc0i7l9xbyG06R6uZAQAAAAD9////AmQtPCgBAAAAF6kUnoGu9IUv0FGnzol3Lb/BNBNkOViHAC0xAQAAAAAXqRRlVyjzbP420BqlDTI2cERp+EpVQIcCRzBEAiBliJpjBsipwFgsLZMlzbESZ6hMTh+pgKQlXUIL0nLb3wIga/xwr/IJgEc7Ie6ApS4aVDr9xr1TZ3wj+8bRvI6WqScBIQPgYuc48PzUufScX6A6YOsdmJwn+bAQjLZ/g9jhQYduHM4AAAABASAALTEBAAAAABepFGVXKPNs/jbQGqUNMjZwRGn4SlVAhyICArnAxoROEqUxyWjlXFUHjsFtm/dr6SkP2H0cynK0g5oXRzBEAiBlTUNYfS5n5rGRVmoNb0z3AMGJjHijwpXROGIVxfoBnQIgeTx32KY3CcfYTYzXUIRQAMUQB7rlPWRptWMDD3UttkcBAQQWABTWuWnTbf/a2YaRk/Zj7kgN/cc0iCIGArnAxoROEqUxyWjlXFUHjsFtm/dr6SkP2H0cynK0g5oXCNa5adMAAAAAAQ4gwIzgqeoeABeepgPLhhnsKi35kO+THhzNh/p6Dice2DcBDwQBAAAAARAE/f///wABAwg1FDEBAAAAAAEEIlEgiIqxS24WVdHQADm4NtcLZuM1FUOrbNL5QWYlXz1ebLUhByjMj8l44gnxaV+ltWVQYdsaqyMRtSQXaUW/EBXvLUuJCQCftnv8BwAAAAA=", + "upgraded_outs": 1 +} +``` AUTHOR ------ -~niftynei~ <> is mainly responsible. +Lisa Neigut <> is mainly responsible. SEE ALSO -------- -lightning-utxopsbt(7), lightning-reserveinputs(7), lightning-unreserveinputs(7). +lightning-utxopsbt(7), lightning-reserveinputs(7), lightning-unreserveinputs(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:0f290582f49c6103258b7f781a9e7fa4075ec6c05335a459a91da0b6fd58c68d) diff --git a/doc/lightning-utxopsbt.7.md b/doc/lightning-utxopsbt.7.md index 6ff19b921299..f5f705f7ded1 100644 --- a/doc/lightning-utxopsbt.7.md +++ b/doc/lightning-utxopsbt.7.md @@ -1,65 +1,132 @@ lightning-utxopsbt -- Command to populate PSBT inputs from given UTXOs -================================================================ +====================================================================== SYNOPSIS -------- -**utxopsbt** *satoshi* *feerate* *startweight* *utxos* [*reserve*] [*reservedok*] [*locktime*] [*min\_witness\_weight*] [*excess\_as\_change*] [*opening\_anchor\_channel*] +**utxopsbt** *satoshi* *feerate* *startweight* *utxos* [*reserve*] [*reservedok*] [*locktime*] [*min\_witness\_weight*] [*excess\_as\_change*] [*opening\_anchor\_channel*] DESCRIPTION ----------- -*utxopsbt* is a low-level RPC command which creates a PSBT using unreserved -inputs in the wallet, optionally reserving them as well. - -It deliberately mirrors the parameters and output of -lightning-fundpsbt(7) except instead of an optional *minconf* -parameter to select unreserved outputs from the wallet, it takes a -compulsory list of outputs to use. +*utxopsbt* is a low-level RPC command which creates a PSBT using unreserved inputs in the wallet, optionally reserving them as well. + +It deliberately mirrors the parameters and output of lightning-fundpsbt(7) except instead of an optional *minconf* parameter to select unreserved outputs from the wallet, it takes a compulsory list of outputs to use. + +- **satoshi** (msat\_or\_all): The minimum satoshi value of the output(s) needed (or the string `all` meaning use all unreserved inputs). If a value, it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. +- **feerate** (feerate): Used for the transaction as initial feerate. The default is *normal*. +- **startweight** (u32): The weight of the transaction before *fundpsbt* has added any inputs. +- **utxos** (array of outpoints): An array of `txid:vout`, each of which must be reserved or available.: + - (outpoint, optional) +- **reserve** (u32, optional): If not zero, then *reserveinputs* is called (successfully, with *exclusive* true) on the returned PSBT for this number of blocks. The default is 72 blocks. +- **reservedok** (boolean, optional): If set to true, it will also fail if any of the *utxos* are already reserved. The default is false. +- **locktime** (u32, optional): If not set, it is set to a recent block height. +- **min\_witness\_weight** (u32, optional): Minimum weight to use for a UTXO's witness. If the actual witness weight is greater than the provided minimum, the actual witness weight will be used. +- **excess\_as\_change** (boolean, optional): Flag to add a change output for the excess sats. +- **opening\_anchor\_channel** (boolean, optional): To signel that it needs emergency reserve for anchors so that we can lowball our commitment tx fees, and min-emergency-msat for reserving some sats for closing anchor channels. *(added v23.08)* + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:utxopsbt#1", + "method": "utxopsbt", + "params": { + "satoshi": 0, + "feerate": "253perkw", + "startweight": 0, + "utxos": [ + "d82a99192fb333106ea8d08f5231ed45f2ed5b1ef9eb81b0fef8f9ea354d2637:1" + ], + "reserve": 0, + "reservedok": true, + "locktime": null, + "min_witness_weight": null, + "excess_as_change": false + } +} +{ + "id": "example:utxopsbt#2", + "method": "utxopsbt", + "params": { + "satoshi": 1000000, + "feerate": "7500perkw", + "startweight": 0, + "utxos": [ + "2fc3b9f8d4aed120f6d9a6f206f07c35ef4d518ec0305d1d974873d256e38ca7:1", + "2f669f6a605ee5c7ddd2abb753bc64b1a90bd1b7448264f5d78a7ca823c00a1b:1" + ], + "reserve": null, + "reservedok": true, + "locktime": null, + "min_witness_weight": null, + "excess_as_change": false + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **psbt** (string): Unsigned PSBT which fulfills the parameters given -- **feerate\_per\_kw** (u32): The feerate used to create the PSBT, in satoshis-per-kiloweight -- **estimated\_final\_weight** (u32): The estimated weight of the transaction once fully signed -- **excess\_msat** (msat): The amount above *satoshi* which is available. This could be zero, or dust; it will be zero if *change\_outnum* is also returned -- **change\_outnum** (u32, optional): The 0-based output number where change was placed (only if parameter *excess\_as\_change* was true and there was sufficient funds) -- **reservations** (array of objects, optional): If *reserve* was true or a non-zero number, just as per lightning-reserveinputs(7): - - **txid** (txid): The txid of the transaction - - **vout** (u32): The 0-based output number - - **was\_reserved** (boolean): Whether this output was previously reserved - - **reserved** (boolean): Whether this output is now reserved (always *true*) - - **reserved\_to\_block** (u32): The blockheight the reservation will expire - -[comment]: # (GENERATE-FROM-SCHEMA-END) - - -On success, returns the *psbt* it created, containing the inputs, -*feerate\_per\_kw* showing the exact numeric feerate it used, -*estimated\_final\_weight* for the estimated weight of the transaction -once fully signed, and *excess\_msat* containing the amount above *satoshi* -which is available. This could be zero, or dust. If *satoshi* was "all", -then *excess\_msat* is the entire amount once fees are subtracted -for the weights of the inputs and *startweight*. - -If *reserve* was *true* or a non-zero number, then a *reservations* -array is returned, exactly like *reserveinputs*. - -If *excess\_as\_change* is true and the excess is enough to cover -an additional output above the `dust_limit`, then an output is -added to the PSBT for the excess amount. The *excess\_msat* will -be zero. A *change\_outnum* will be returned with the index of -the change output. +- **psbt** (string): Unsigned PSBT which fulfills the parameters given. +- **feerate\_per\_kw** (u32): The feerate used to create the PSBT, in satoshis-per-kiloweight. +- **estimated\_final\_weight** (u32): The estimated weight of the transaction once fully signed. +- **excess\_msat** (msat): The amount above *satoshi* which is available. This could be zero, or dust; it will be zero if *change\_outnum* is also returned. +- **change\_outnum** (u32, optional): The 0-based output number where change was placed (only if parameter *excess\_as\_change* was true and there was sufficient funds). +- **reservations** (array of objects, optional): If *reserve* was true or a non-zero number, just as per lightning- reserveinputs(7).: + - **txid** (txid): The txid of the transaction. + - **vout** (u32): The 0-based output number. + - **was\_reserved** (boolean): Whether this output was previously reserved. + - **reserved** (boolean) (always *true*): Whether this output is now reserved. + - **reserved\_to\_block** (u32): The blockheight the reservation will expire. + +On success, returns the *psbt* it created, containing the inputs, *feerate\_per\_kw* showing the exact numeric feerate it used, *estimated\_final\_weight* for the estimated weight of the transaction once fully signed, and *excess\_msat* containing the amount above *satoshi* which is available. This could be zero, or dust. If *satoshi* was `all`, then *excess\_msat* is the entire amount once fees are subtracted for the weights of the inputs and *startweight*. + +If *reserve* was *true* or a non-zero number, then a *reservations* array is returned, exactly like *reserveinputs*. + +If *excess\_as\_change* is true and the excess is enough to cover an additional output above the `dust_limit`, then an output is added to the PSBT for the excess amount. The *excess\_msat* will be zero. A *change\_outnum* will be returned with the index of the change output. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "psbt": "cHNidP8BADMCAAAAATcmTTXq+fj+sIHr+R5b7fJF7TFSj9CobhAzsy8ZmSrYAQAAAAD9////AGYAAAAAAQDeAgAAAAABAWQACJva49ga8OCYXvPRWQRhoXndrJykwjgXbwT251dEAAAAAAD9////AiOI9ikBAAAAFgAU3gClv/YpAKRpfDuiFu6mIL2E4+5QaQ8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgUXIQFs7oRkorVThUn3sLj7WI7g8c8RHai4ChoCvIkWsCICp1CqHl4BlMJCKFHRWHXhhekaj0r1EFSNrh8UnvysQPASEDqHIAEdaH3H6pb3VJzbJNDG4lL8PTfsheL+h2p6baK3JlAAAAAQEfUGkPAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=", + "feerate_per_kw": 253, + "estimated_final_weight": 271, + "excess_msat": 1009932000 +} +{ + "psbt": "cHNidP8BAFwCAAAAAqeM41bSc0iXHV0wwI5RTe81fPAG8qbZ9iDRrtT4ucMvAQAAAAD9////GwrAI6h8itf1ZIJEt9ELqbFkvFO3q9Ldx+VeYGqfZi8BAAAAAP3///8AZgAAAAABAN4CAAAAAAEBEaK0TQ97IsrzuO1gLt+vYbvLBG90NrCOZp7SCgrRknYAAAAAAP3///8CM6/2KQEAAAAWABQ1B/KkIVbg7yFRcCEN/VOptfOX/EBCDwAAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WUCRzBEAiA1oI1us81XEa/DRlvcP2qnbWLsV5pZcRfvj9MLyT202gIgb7noMqHYWMmm7H7VNEfWa29jjtuV9yrrSc9ui11ECQ0BIQKhZOHR4gFKMu2EKKgZ/7qnhzq9PvhtnAW2sxPZ4c9RIWUAAAABAR9AQg8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAAEA3gIAAAAAAQGnjONW0nNIlx1dMMCOUU3vNXzwBvKm2fYg0a7U+LnDLwAAAAAA/f///wJmbOcpAQAAABYAFOwPo5eUrDF7UgZBFQLRHOeX6PiGQEIPAAAAAAAWABTCzKsXHCpb6dq1LsQbglhjAkxUZgJHMEQCICgjGlauGj2eiMS4MWUK6zAWqMe1OuidQR+Hy9ZgSTuzAiA8JTb9OrLqS3hiWtT+TQ/NBsKJ2hhHLDaKUUNdgi4OkAEhA9g3oH5ejmGIqUY2ZWxc8YWF2+T+XpE/6oC40Cx3+e97ZQAAAAEBH0BCDwAAAAAAFgAUwsyrFxwqW+natS7EG4JYYwJMVGYA", + "feerate_per_kw": 7500, + "estimated_final_weight": 542, + "excess_msat": 995935000, + "reservations": [ + { + "txid": "2fc3b9f8d4aed120f6d9a6f206f07c35ef4d518ec0305d1d974873d256e38ca7", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "2f669f6a605ee5c7ddd2abb753bc64b1a90bd1b7448264f5d78a7ca823c00a1b", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + } + ] +} +``` ERRORS ------ -On error the returned object will contain `code` and `message` properties, -with `code` being one of the following: +On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -32602: If the given parameters are wrong. - -1: Catchall nonspecific error. @@ -73,11 +140,9 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-fundpsbt(7). +lightning-fundpsbt(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:5fe266fd3032274779129a8bf3868228a22481f178f3ec98a4fa9b6ad8a127d5) diff --git a/doc/lightning-wait.7.md b/doc/lightning-wait.7.md index 0dd5aa274a98..79bb02a40af5 100644 --- a/doc/lightning-wait.7.md +++ b/doc/lightning-wait.7.md @@ -4,103 +4,146 @@ lightning-wait -- Command to wait for creations, changes and deletions SYNOPSIS -------- -**wait** *subsystem* *indexname* *nextvalue* +**wait** *subsystem* *indexname* *nextvalue* DESCRIPTION ----------- -The **wait** RPC command returns once the index given by *indexname* -in *subsystem* reaches or exceeds *nextvalue*. All indexes start at 0, when no -events have happened (**wait** with a *nextvalue* of 0 is a way of getting -the current index, though naturally this is racy!). +Command *added* in v23.08. -*indexname* is one of `created`, `updated` or `deleted`: - -- `created` is incremented by one for every new object. -- `updated` is incremented by one every time an object is changed. -- `deleted` is incremented by one every time an object is deleted. - -*subsystem* is one of: - -- `invoices`: corresponding to `listinvoices` (added in *v23.08*) -- `sendpays`: corresponding to `listsendpays` (added in *v23.11*) -- `forwards`: corresponding to `listforwards` (added in *v23.11*) +The **wait** RPC command returns once the index given by *indexname* in *subsystem* reaches or exceeds *nextvalue*. All indexes start at 0, when no events have happened (**wait** with a *nextvalue* of 0 is a way of getting the current index, though naturally this is racy!). +- **subsystem** (string) (one of "invoices", "forwards", "sendpays"): The subsystem to get the next index value from. + `invoices`: corresponding to `listinvoices` (added in *v23.08*). + `sendpays`: corresponding to `listsendpays` (added in *v23.11*). + `forwards`: corresponding to `listforwards` (added in *v23.11*). +- **indexname** (string) (one of "created", "updated", "deleted"): The name of the index to get the next value for. + `created` is incremented by one for every new object. + `updated` is incremented by one every time an object is changed. + `deleted` is incremented by one every time an object is deleted. +- **nextvalue** (u64): The next value of the index. RELIABILITY ----------- -Indices can go forward by more than one; in particlar, if multiple -objects were created and the one deleted, you could see this effect. -Similarly, there are some places (e.g. invoice expiration) where we -can update multiple entries at once. +Indices can go forward by more than one; in particlar, if multiple objects were created and the one deleted, you could see this effect. Similarly, there are some places (e.g. invoice expiration) where we can update multiple entries at once. Indices only monotoncally increase. USAGE ----- -The **wait** RPC is used to track changes in the system. Consider -tracking invoices being paid or expiring. The simplest (and -inefficient method) would be: - -1. Call `listinvoices` to get the current state of all invoices, and - remember the highest `updated_index`. Say it was 5. +The **wait** RPC is used to track changes in the system. Consider tracking invoices being paid or expiring. The simplest (and inefficient method) would be: +1. Call `listinvoices` to get the current state of all invoices, and remember the highest `updated_index`. Say it was 5. 2. Call `wait invoices updated 6`. 3. When it returns, call `listinvoices` again to see what changed. This is obviously inefficient, so there are two optimizations: - -1. Call `listinvoices` with `index=updated` and `start=6` to only see invoices - with `updated_index` greater than or equal to 6. -2. `wait` itself may also return some limited subset of fields from the list - command (it can't do this in all cases); for `invoices` this is `label` - and `status`, allowing many callers to avoid the `listinvoices` call. +1. Call `listinvoices` with `index=updated` and `start=6` to only see invoices with `updated_index` greater than or equal to 6. +2. `wait` itself may also return some limited subset of fields from the list command (it can't do this in all cases); for `invoices` this is `label` and `status`, allowing many callers to avoid the `listinvoices` call. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:wait#1", + "method": "wait", + "params": { + "subsystem": "invoices", + "indexname": "created", + "nextvalue": 1 + } +} +{ + "id": "example:wait#2", + "method": "wait", + "params": { + "subsystem": "invoices", + "indexname": "updated", + "nextvalue": 2 + } +} +{ + "id": "example:wait#3", + "method": "wait", + "params": { + "subsystem": "sendpays", + "indexname": "updated", + "nextvalue": 2 + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: - **subsystem** (string) (one of "invoices", "forwards", "sendpays") -- **created** (u64, optional): 1-based index indicating order entry was created -- **updated** (u64, optional): 1-based index indicating order entry was updated -- **deleted** (u64, optional): 1-based index indicating order entry was deleted +- **created** (u64, optional): 1-based index indicating order entry was created. +- **updated** (u64, optional): 1-based index indicating order entry was updated. +- **deleted** (u64, optional): 1-based index indicating order entry was deleted. If **subsystem** is "invoices": - - **details** (object, optional): - - **status** (string, optional): Whether it's paid, unpaid or unpayable (one of "unpaid", "paid", "expired") - - **label** (string, optional): unique label supplied at invoice creation - - **description** (string, optional): description used in the invoice - - **bolt11** (string, optional): the BOLT11 string - - **bolt12** (string, optional): the BOLT12 string + - **status** (string, optional) (one of "unpaid", "paid", "expired"): Whether it's paid, unpaid or unpayable. + - **label** (string, optional): Unique label supplied at invoice creation. + - **description** (string, optional): Description used in the invoice. + - **bolt11** (string, optional): The BOLT11 string. + - **bolt12** (string, optional): The BOLT12 string. If **subsystem** is "forwards": - - **details** (object, optional): - - **status** (string, optional): still ongoing, completed, failed locally, or failed after forwarding (one of "offered", "settled", "failed", "local\_failed") - - **in\_channel** (short\_channel\_id, optional): unique label supplied at invoice creation - - **in\_htlc\_id** (u64, optional): the unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11) - - **in\_msat** (msat, optional): the value of the incoming HTLC - - **out\_channel** (short\_channel\_id, optional): the channel that the HTLC (trying to) forward to + - **status** (string, optional) (one of "offered", "settled", "failed", "local\_failed"): Still ongoing, completed, failed locally, or failed after forwarding. + - **in\_channel** (short\_channel\_id, optional): Unique label supplied at invoice creation. + - **in\_htlc\_id** (u64, optional): The unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11). + - **in\_msat** (msat, optional): The value of the incoming HTLC. + - **out\_channel** (short\_channel\_id, optional): The channel that the HTLC (trying to) forward to. If **subsystem** is "sendpays": - - **details** (object, optional): - - **status** (string, optional): status of the payment (one of "pending", "failed", "complete") - - **partid** (u64, optional): Part number (for multiple parts to a single payment) - - **groupid** (u64, optional): Grouping key to disambiguate multiple attempts to pay an invoice or the same payment\_hash - - **payment\_hash** (hash, optional): the hash of the *payment\_preimage* which will prove payment - -[comment]: # (GENERATE-FROM-SCHEMA-END) + - **status** (string, optional) (one of "pending", "failed", "complete"): Status of the payment. + - **partid** (u64, optional): Part number (for multiple parts to a single payment). + - **groupid** (u64, optional): Grouping key to disambiguate multiple attempts to pay an invoice or the same payment\_hash. + - **payment\_hash** (hash, optional): The hash of the *payment\_preimage* which will prove payment. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "subsystem": "invoices", + "created": 1, + "details": { + "status": "unpaid", + "label": "invlabel", + "bolt11": "lnbcrt420p1pjmxtevsp5d8c6gnaj8lyjy2qly783vklda9dfaqeyzyc37agxxp8h3uguv8pqpp5w6lhwxhqnuew4hle5h7qwjm27zz784mvsrzhmayhscy5t2hy5c4qdqvd9h8ver9wd3sxqyjw5qcqp99qxpqysgq09gxhjhwu9u3z6dlt5ln5f4g8zl78wz4pgh0am3kz54m9lllhqckf4gmhmt2ftrclq5x62zkqmggc7y0ju0ghdfwjz8hyd8l5cqvemgpyyhm6w" + } +} +{ + "subsystem": "invoices", + "updated": 2, + "details": { + "status": "expired" + } +} +{ + "subsystem": "sendpays", + "updated": 2, + "details": { + "status": "complete", + "partid": 0, + "groupid": 1, + "payment_hash": "220dcfcf43e1fab3ce30f70eb943c3ce962393f5a65ced52d749e324b443d19e" + } +} +``` ERRORS ------ -On error the returned object will contain `code` and `message` properties, -with `code` being one of the following: +On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -32602: If the given parameters are wrong. @@ -118,5 +161,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:a6686d2d46b49984c3848305dc15129a7436dd48d95f6afd9ba0e2902b52fc5d) diff --git a/doc/lightning-waitanyinvoice.7.md b/doc/lightning-waitanyinvoice.7.md index 0920c381df37..826af9f34a85 100644 --- a/doc/lightning-waitanyinvoice.7.md +++ b/doc/lightning-waitanyinvoice.7.md @@ -4,48 +4,102 @@ lightning-waitanyinvoice -- Command for waiting for payments SYNOPSIS -------- -**waitanyinvoice** [*lastpay\_index*] [*timeout*] +**waitanyinvoice** [*lastpay\_index*] [*timeout*] DESCRIPTION ----------- -The **waitanyinvoice** RPC command waits until an invoice is paid, then -returns a single entry as per **listinvoice**. It will not return for -any invoices paid prior to or including the *lastpay\_index*. - -This is usually called iteratively: once with no arguments, then -repeatedly with the returned *pay\_index* entry. This ensures that no -paid invoice is missed. The *pay\_index* is a monotonically-increasing number -assigned to an invoice when it gets paid. The first valid *pay\_index* is 1. +The **waitanyinvoice** RPC command waits until an invoice is paid, then returns a single entry as per **listinvoice**. It will not return for any invoices paid prior to or including the *lastpay\_index*. + +This is usually called iteratively: once with no arguments, then repeatedly with the returned *pay\_index* entry. This ensures that no paid invoice is missed. The *pay\_index* is a monotonically-increasing number assigned to an invoice when it gets paid. The first valid *pay\_index* is 1. + +- **lastpay\_index** (u64, optional): Ignores any invoices paid prior to or including this index. 0 is equivalent to not specifying and negative value is invalid. +- **timeout** (u64, optional): If specified, wait at most that number of seconds, which must be an integer. If the specified *timeout* is reached, this command will return with an error. You can specify this to 0 so that **waitanyinvoice** will return immediately with an error if no pending invoice is available yet. If unspecified, this command will wait indefinitely. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:waitanyinvoice#1", + "method": "waitanyinvoice", + "params": { + "lastpay_index": null, + "timeout": null + } +} +{ + "id": "example:waitanyinvoice#2", + "method": "waitanyinvoice", + "params": { + "lastpay_index": 3, + "timeout": 0 + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **label** (string): unique label supplied at invoice creation -- **description** (string): description used in the invoice -- **payment\_hash** (hash): the hash of the *payment\_preimage* which will prove payment -- **status** (string): Whether it's paid or expired (one of "paid", "expired") -- **expires\_at** (u64): UNIX timestamp of when it will become / became unpayable -- **created\_index** (u64): 1-based index indicating order this invoice was created in *(added v23.08)* -- **amount\_msat** (msat, optional): the amount required to pay this invoice -- **bolt11** (string, optional): the BOLT11 string (always present unless *bolt12* is) -- **bolt12** (string, optional): the BOLT12 string (always present unless *bolt11* is) -- **updated\_index** (u64, optional): 1-based index indicating order this invoice was changed (only present if it has changed since creation) *(added v23.08)* +- **label** (string): Unique label supplied at invoice creation. +- **description** (string): Description used in the invoice. +- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. +- **status** (string) (one of "paid", "expired"): Whether it's paid or expired. +- **expires\_at** (u64): UNIX timestamp of when it will become / became unpayable. +- **created\_index** (u64): 1-based index indicating order this invoice was created in. *(added v23.08)* +- **amount\_msat** (msat, optional): The amount required to pay this invoice. +- **bolt11** (string, optional): The BOLT11 string (always present unless *bolt12* is). +- **bolt12** (string, optional): The BOLT12 string (always present unless *bolt11* is). +- **updated\_index** (u64, optional): 1-based index indicating order this invoice was changed (only present if it has changed since creation). *(added v23.08)* If **status** is "paid": - - - **pay\_index** (u64): Unique incrementing index for this payment - - **amount\_received\_msat** (msat): the amount actually received (could be slightly greater than *amount\_msat*, since clients may overpay) - - **paid\_at** (u64): UNIX timestamp of when it was paid - - **payment\_preimage** (secret): proof of payment - - **paid\_outpoint** (object, optional): Outpoint this invoice was paid with *(added v23.11)*: - - **txid** (txid): ID of the transaction that paid the invoice *(added v23.11)* - - **outnum** (u32): The 0-based output number of the transaction that paid the invoice *(added v23.11)* - -[comment]: # (GENERATE-FROM-SCHEMA-END) + - **pay\_index** (u64): Unique incrementing index for this payment. + - **amount\_received\_msat** (msat): The amount actually received (could be slightly greater than *amount\_msat*, since clients may overpay). + - **paid\_at** (u64): UNIX timestamp of when it was paid. + - **payment\_preimage** (secret): Proof of payment. + - **paid\_outpoint** (object, optional): Outpoint this invoice was paid with. *(added v23.11)*: + - **txid** (txid): ID of the transaction that paid the invoice. *(added v23.11)* + - **outnum** (u32): The 0-based output number of the transaction that paid the invoice. *(added v23.11)* + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "label": "inv1", + "bolt11": "lnbcrt10n1pjmxtsxsp56sn02x8lccjfsvunnhz5858zuyxztug9luy226w4qsmfm4r8pkcspp5gw5r0dw99yf3zqxrg24l8g9m9hun9cu06ldg4rga8s9t9kv8z45sdq8d9h8vvgxqyjw5qcqp99qxpqysgqv537uh2sx8ch640mf4t43t8qjtpg3z7gukgm07tlyq986m7nvsnxkapg37z4vsxtl4thfqzc64anqr83geygkc2xaftxgr97dltqfjqpe3mhja", + "payment_hash": "43a837b5c529131100c342abf3a0bb2df932e38fd7da8a8d1d3c0ab2d9871569", + "amount_msat": 1000, + "status": "paid", + "pay_index": 1, + "amount_received_msat": 1000, + "paid_at": 1706241546, + "payment_preimage": "a0c668998de14b975f33e1060b3efd7efc0bde784ac266ab667a1b2fddab3cd1", + "description": [ + "Inv1." + ], + "expires_at": 1706846342, + "created_index": 1, + "updated_index": 1 +} +{ + "label": "inv4", + "bolt11": "lnbcrt10n1pja0tkmsp57j4z9zwvdsyh57unh3da7aac5z20clfnrwy5nqm6wujaelduw23qpp580mdrwakz9xewc2vhvpucset9gjkgdvyhw7h9frcy2d6p2lwdw2qdq8d9h8vdqxqyjw5qcqp99qxpqysgqtgyzhtxs3p2dyk8wk9q028033303702d2hml4frmu38qe79mrkgzgxvyjmq2q4nhjgcuz3uhmlda3jnhf9w6mj8mj97pkgnda9l5kdcqsdgewf", + "payment_hash": "3bf6d1bbb6114d97614cbb03cc432b2a25643584bbbd72a478229ba0abee6b94", + "amount_msat": 1000, + "status": "paid", + "pay_index": 4, + "amount_received_msat": 1000, + "paid_at": 1708633825, + "payment_preimage": "77336a342dde76050c7ee7fc18599e407dfc1edad3c784ba68e9603004365b94", + "description": "inv4", + "expires_at": 1709238619, + "created_index": 4, + "updated_index": 4 +} +``` ERRORS ------ @@ -62,12 +116,9 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-waitinvoice(7), lightning-listinvoice(7), -lightning-delinvoice(7), lightning-invoice(7). +lightning-waitinvoice(7), lightning-listinvoice(7), lightning-delinvoice(7), lightning-invoice(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:9e15a21311e8822a4e61a2f47f047caea6a8fa2a65acd1c81854c0c42ea6bba1) diff --git a/doc/lightning-waitblockheight.7.md b/doc/lightning-waitblockheight.7.md index 2a1344c319f6..31236ab7f976 100644 --- a/doc/lightning-waitblockheight.7.md +++ b/doc/lightning-waitblockheight.7.md @@ -4,26 +4,65 @@ lightning-waitblockheight -- Command for waiting for blocks on the blockchain SYNOPSIS -------- -**waitblockheight** *blockheight* [*timeout*] +**waitblockheight** *blockheight* [*timeout*] DESCRIPTION ----------- -The **waitblockheight** RPC command waits until the blockchain -has reached the specified *blockheight*. +The **waitblockheight** RPC command waits until the blockchain has reached the specified *blockheight*. + +- **blockheight** (u32): Current blockheight of the blockchain if the value is greater than this number. If it is a present or past block height, then the command returns immediately. +- **timeout** (u32, optional): Only wait up to specified seconds. The default is 60 seconds. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:waitblockheight#1", + "method": "waitblockheight", + "params": { + "blockheight": 99, + "timeout": null + } +} +{ + "id": "example:waitblockheight#2", + "method": "waitblockheight", + "params": { + "blockheight": 103, + "timeout": 600 + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **blockheight** (u32): The current block height (> *blockheight* parameter) +- **blockheight** (u32): The current block height (>= *blockheight* parameter). -[comment]: # (GENERATE-FROM-SCHEMA-END) +If *timeout* seconds is reached without the specified blockheight being reached, this command will fail with a code of `2000`. -If *timeout* seconds is reached without the specified blockheight -being reached, this command will fail with a code of `2000`. +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "blockheight": 99 +} +{ + "blockheight": 103 +} +``` + +ERRORS +------ + +The following error codes may occur: + +- 2000: Timed out. AUTHOR ------ @@ -34,5 +73,3 @@ RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:4c77e26ed8145c090bf5c5765fe8817a0d819e302fd479dd451ae78443921826) diff --git a/doc/lightning-waitinvoice.7.md b/doc/lightning-waitinvoice.7.md index a64725cf1663..f9364d93243f 100644 --- a/doc/lightning-waitinvoice.7.md +++ b/doc/lightning-waitinvoice.7.md @@ -4,48 +4,82 @@ lightning-waitinvoice -- Command for waiting for specific payment SYNOPSIS -------- -**waitinvoice** *label* +**waitinvoice** *label* DESCRIPTION ----------- -The **waitinvoice** RPC command waits until a specific invoice is paid, -then returns that single entry as per **listinvoice**. +The **waitinvoice** RPC command waits until a specific invoice is paid, then returns that single entry as per **listinvoice**. + +- **label** (one of): Unique label of the invoice waiting to be paid.: + - (string) + - (integer) + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:waitinvoice#1", + "method": "waitinvoice", + "params": { + "label": "inv2" + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **label** (string): unique label supplied at invoice creation -- **description** (string): description used in the invoice -- **payment\_hash** (hash): the hash of the *payment\_preimage* which will prove payment -- **status** (string): Whether it's paid or expired (one of "paid", "expired") -- **expires\_at** (u64): UNIX timestamp of when it will become / became unpayable -- **created\_index** (u64): 1-based index indicating order this invoice was created in *(added v23.08)* -- **amount\_msat** (msat, optional): the amount required to pay this invoice -- **bolt11** (string, optional): the BOLT11 string (always present unless *bolt12* is) -- **bolt12** (string, optional): the BOLT12 string (always present unless *bolt11* is) -- **updated\_index** (u64, optional): 1-based index indicating order this invoice was changed (only present if it has changed since creation) *(added v23.08)* +- **label** (string): Unique label supplied at invoice creation. +- **description** (string): Description used in the invoice. +- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. +- **status** (string) (one of "paid", "expired"): Whether it's paid or expired. +- **expires\_at** (u64): UNIX timestamp of when it will become / became unpayable. +- **created\_index** (u64): 1-based index indicating order this invoice was created in. *(added v23.08)* +- **amount\_msat** (msat, optional): The amount required to pay this invoice. +- **bolt11** (string, optional): The BOLT11 string (always present unless *bolt12* is). +- **bolt12** (string, optional): The BOLT12 string (always present unless *bolt11* is). +- **updated\_index** (u64, optional): 1-based index indicating order this invoice was changed (only present if it has changed since creation). *(added v23.08)* If **status** is "paid": - - - **pay\_index** (u64): Unique incrementing index for this payment - - **amount\_received\_msat** (msat): the amount actually received (could be slightly greater than *amount\_msat*, since clients may overpay) - - **paid\_at** (u64): UNIX timestamp of when it was paid - - **payment\_preimage** (secret): proof of payment - - **paid\_outpoint** (object, optional): Outpoint this invoice was paid with *(added v23.11)*: - - **txid** (txid): ID of the transaction that paid the invoice *(added v23.11)* - - **outnum** (u32): The 0-based output number of the transaction that paid the invoice *(added v23.11)* - -[comment]: # (GENERATE-FROM-SCHEMA-END) + - **pay\_index** (u64): Unique incrementing index for this payment. + - **amount\_received\_msat** (msat): The amount actually received (could be slightly greater than *amount\_msat*, since clients may overpay). + - **paid\_at** (u64): UNIX timestamp of when it was paid. + - **payment\_preimage** (secret): Proof of payment. + - **paid\_outpoint** (object, optional): Outpoint this invoice was paid with. *(added v23.11)*: + - **txid** (txid): ID of the transaction that paid the invoice. *(added v23.11)* + - **outnum** (u32): The 0-based output number of the transaction that paid the invoice. *(added v23.11)* + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "label": "inv2", + "bolt11": "lnbcrt10n1pjmxtwjsp5mzvdu6v8hqsf2tlj0nlyks23afqp7ejs444syjxf74p60ztmld8qpp5q4ayz5pys3t0yj0dmkmh7ctarkv9z434paz4u9rdwnj4f43thhaqdq8d9h8vvsxqyjw5qcqp99qxpqysgqn0055ttns6pafsxh6xuqce6e4vz8gtxlzqx0l9d9f5crmqx4jymh4zy9jdaszm0dj89sq39fvhpwcs626dt0n3gw8kassfdehp5sy3sq7fzy3w", + "payment_hash": "057a4150248456f249edddb77f617d1d985156350f455e146d74e554d62bbdfa", + "amount_msat": 1000, + "status": "paid", + "pay_index": 1, + "amount_received_msat": 1000, + "paid_at": 1706241494, + "payment_preimage": "34ccd37cc85e067cb376f9ea8c70d70469f58bf296f2566ed9ad4dfb70971a26", + "description": [ + "Inv2." + ], + "expires_at": 1706846290, + "created_index": 2, + "updated_index": 1 +} +``` ERRORS ------ -On error the returned object will contain `code` and `message` properties, -with `code` being one of the following: +On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -32602: If the given parameters are wrong. - -1: If the invoice is deleted while unpaid, or the invoice does not exist. @@ -54,18 +88,14 @@ with `code` being one of the following: AUTHOR ------ -Christian Decker <> is mainly -responsible. +Christian Decker <> is mainly responsible. SEE ALSO -------- -lightning-waitanyinvoice(7), lightning-listinvoice(7), -lightning-delinvoice(7), lightning-invoice(7) +lightning-waitanyinvoice(7), lightning-listinvoice(7), lightning-delinvoice(7), lightning-invoice(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:9e15a21311e8822a4e61a2f47f047caea6a8fa2a65acd1c81854c0c42ea6bba1) diff --git a/doc/lightning-waitsendpay.7.md b/doc/lightning-waitsendpay.7.md index c2aa28943e6e..c2ae24b75a1f 100644 --- a/doc/lightning-waitsendpay.7.md +++ b/doc/lightning-waitsendpay.7.md @@ -4,85 +4,102 @@ lightning-waitsendpay -- Command for sending a payment via a route SYNOPSIS -------- -**waitsendpay** *payment\_hash* [*timeout*] [*partid* *groupid*] +**waitsendpay** *payment\_hash* [*timeout*] [*partid* *groupid*] DESCRIPTION ----------- -The **waitsendpay** RPC command polls or waits for the status of an -outgoing payment that was initiated by a previous **sendpay** -invocation. +The **waitsendpay** RPC command polls or waits for the status of an outgoing payment that was initiated by a previous **sendpay** invocation. -If the payment completed with success, this command returns with -success. Otherwise, if the payment completed with failure, this command -returns an error. +If the payment completed with success, this command returns with success. Otherwise, if the payment completed with failure, this command returns an error. + +- **payment\_hash** (hash): The hash of the *payment\_preimage*. +- **timeout** (u32, optional): A timeout in seconds, for this RPC command to return. If the *timeout* is provided and the given amount of time passes without the payment definitely succeeding or definitely failing, this command returns with a 200 error code (payment still in progress). If *timeout* is not provided this call will wait indefinitely. Indicating a *timeout* of 0 effectively makes this call a pollable query of the status of the payment. +- **partid** (u64, optional): Unique ID within this (multi-part) payment. It must match that of the **sendpay** command. +- **groupid** (u64, optional): Grouping key to disambiguate multiple attempts to pay the same payment\_hash. + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:waitsendpay#1", + "method": "waitsendpay", + "params": { + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "timeout": null, + "partid": null, + "groupid": null + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **created\_index** (u64): 1-based index indicating order this payment was created in *(added v23.11)* -- **id** (u64): old synonym for created\_index -- **payment\_hash** (hash): the hash of the *payment\_preimage* which will prove payment -- **status** (string): status of the payment (always "complete") -- **created\_at** (u64): the UNIX timestamp showing when this payment was initiated -- **amount\_sent\_msat** (msat): The amount sent -- **groupid** (u64, optional): Grouping key to disambiguate multiple attempts to pay an invoice or the same payment\_hash -- **amount\_msat** (msat, optional): The amount delivered to destination (if known) -- **destination** (pubkey, optional): the final destination of the payment if known -- **updated\_index** (u64, optional): 1-based index indicating order this payment was changed (only present if it has changed since creation) *(added v23.11)* -- **completed\_at** (number, optional): the UNIX timestamp showing when this payment was completed -- **label** (string, optional): the label, if given to sendpay -- **partid** (u64, optional): the *partid*, if given to sendpay -- **bolt11** (string, optional): the bolt11 string (if pay supplied one) -- **bolt12** (string, optional): the bolt12 string (if supplied for pay: **experimental-offers** only). +- **created\_index** (u64): 1-based index indicating order this payment was created in. *(added v23.11)* +- **id** (u64): Old synonym for created\_index. +- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. +- **status** (string) (always "complete"): Status of the payment. +- **created\_at** (u64): The UNIX timestamp showing when this payment was initiated. +- **amount\_sent\_msat** (msat): The amount sent. +- **groupid** (u64, optional): Grouping key to disambiguate multiple attempts to pay an invoice or the same payment\_hash. +- **amount\_msat** (msat, optional): The amount delivered to destination (if known). +- **destination** (pubkey, optional): The final destination of the payment if known. +- **updated\_index** (u64, optional): 1-based index indicating order this payment was changed (only present if it has changed since creation). *(added v23.11)* +- **completed\_at** (number, optional): The UNIX timestamp showing when this payment was completed. +- **label** (string, optional): The label, if given to sendpay. +- **partid** (u64, optional): The *partid*, if given to sendpay. +- **bolt11** (string, optional): The bolt11 string (if pay supplied one). +- **bolt12** (string, optional): The bolt12 string (if supplied for pay: **experimental-offers** only). If **status** is "complete": - - - **payment\_preimage** (secret): the proof of payment: SHA256 of this **payment\_hash** - -[comment]: # (GENERATE-FROM-SCHEMA-END) + - **payment\_preimage** (secret): The proof of payment: SHA256 of this **payment\_hash**. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "created_index": 1, + "id": 1, + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "groupid": 1, + "updated_index": 1, + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount_msat": 11000000, + "amount_sent_msat": 11000000, + "created_at": 1706152930, + "completed_at": 1706152933, + "status": "complete", + "payment_preimage": "af7ba559629f719c04c43a82767fe3622790a539164d6270db07f765203e574b", + "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk" +} +``` ERRORS ------ -On error, and even if the error occurred from a node other than the -final destination, the route table will no longer be updated. Use the -*exclude* parameter of the `getroute` command to ignore the failing -route. - -The following error codes may occur: - -- -1: Catchall nonspecific error. -- 200: Timed out before the payment could complete. -- 202: Unparseable onion reply. The *data* field of the error will - have an *onionreply* field, a hex string representation of the raw - onion reply. -- 203: Permanent failure at destination. The *data* field of the error - will be routing failure object. -- 204: Failure along route; retry a different route. The *data* field - of the error will be routing failure object. -- 208: A payment for *payment\_hash* was never made and there is - nothing to wait for. -- 209: The payment already failed, but the reason for failure was not - stored. This should only occur when querying failed payments on very - old databases. +On error, and even if the error occurred from a node other than the final destination, the route table will no longer be updated. Use the *exclude* parameter of the `getroute` command to ignore the failing route. + +- -1: Catchall nonspecific error. +- 200: Timed out before the payment could complete. +- 202: Unparseable onion reply. The *data* field of the error will have an *onionreply* field, a hex string representation of the raw onion reply. +- 203: Permanent failure at destination. The *data* field of the error will be routing failure object. +- 204: Failure along route; retry a different route. The *data* field of the error will be routing failure object. +- 208: A payment for *payment\_hash* was never made and there is nothing to wait for. +- 209: The payment already failed, but the reason for failure was not stored. This should only occur when querying failed payments on very old databases. A routing failure object has the fields below: -- *erring\_index*: The index of the node along the route that reported - the error. 0 for the local node, 1 for the first hop, and so on. -- *erring\_node*: The hex string of the pubkey id of the node that - reported the error. -- *erring\_channel*: The short channel ID of the channel that has the - error (or the final channel if the destination raised the error). -- *erring\_direction*: The direction of traversing the - *erring\_channel*: -- *failcode*: The failure code, as per BOLT \#4. -- *failcodename*: The human-readable name corresponding to *failcode*, - if known. +*erring\_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on. +*erring\_node*: The hex string of the pubkey id of the node that reported the error. +*erring\_channel*: The short channel ID of the channel that has the error (or the final channel if the destination raised the error). +*erring\_direction*: The direction of traversing the *erring\_channel*: +*failcode*: The failure code, as per BOLT #4. +*failcodename*: The human-readable name corresponding to *failcode*, if known. AUTHOR ------ @@ -92,11 +109,9 @@ ZmnSCPxj <> is mainly responsible. SEE ALSO -------- -lightning-sendpay(7), lightning-pay(7). +lightning-sendpay(7), lightning-pay(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:241504486cac188734d741260c5cc2931570bdf190f91c227e8d13e348656312) diff --git a/doc/lightning-withdraw.7.md b/doc/lightning-withdraw.7.md index 3d2870af8851..a22ab6d88257 100644 --- a/doc/lightning-withdraw.7.md +++ b/doc/lightning-withdraw.7.md @@ -4,37 +4,82 @@ lightning-withdraw -- Command for withdrawing funds from the internal wallet SYNOPSIS -------- -**withdraw** *destination* *satoshi* [*feerate*] [*minconf*] [*utxos*] +**withdraw** *destination* *satoshi* [*feerate*] [*minconf*] [*utxos*] DESCRIPTION ----------- -The **withdraw** RPC command sends funds from Core Lightning's internal -wallet to the address specified in *destination*. +The **withdraw** RPC command sends funds from Core Lightning's internal wallet to the address specified in *destination*. + +- **destination** (string): Any Bitcoin accepted type, including bech32. +- **satoshi** (msat\_or\_all): The amount to be withdrawn from the internal wallet (expressed, as name suggests, in satoshi). The string *all* can be used to specify withdrawal of all available funds (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. +- **feerate** (feerate, optional): Used for the withdrawal as initial feerate. The default is *normal*. +- **minconf** (u16, optional): Minimum number of confirmations that used outputs should have. The default is 1. +- **utxos** (array of outpoints, optional): Specifies the utxos to be used to be withdrawn from, as an array of `txid:vout`. These must be drawn from the node's available UTXO set.: + - (outpoint, optional) + +EXAMPLE JSON REQUEST +-------------------- + +```json +{ + "id": "example:withdraw#1", + "method": "withdraw", + "params": { + "destination": "bcrt1qjc7j2l5es4haw35c9jzm8dfm763ng5djp8f0s0", + "satoshi": 555555, + "feerate": null, + "minconf": null, + "utxos": null + } +} +{ + "id": "example:withdraw#2", + "method": "withdraw", + "params": { + "destination": "bcrt1q66ukn5mdllddnp53j0mx8mjgph7uwdygn0uy45", + "satoshi": "all", + "feerate": "20000perkb", + "minconf": 0, + "utxos": [ + "218390859cf94d869e33f69161f4187a98f691afe868c20811528f589e90a61f:1" + ] + } +} +``` RETURN VALUE ------------ -[comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object is returned, containing: -- **tx** (hex): the fully signed bitcoin transaction -- **txid** (txid): the transaction id of *tx* -- **psbt** (string): the PSBT representing the unsigned transaction - -[comment]: # (GENERATE-FROM-SCHEMA-END) +- **tx** (hex): The fully signed bitcoin transaction. +- **txid** (txid): The transaction id of *tx*. +- **psbt** (string): The PSBT representing the unsigned transaction. + +EXAMPLE JSON RESPONSE +--------------------- + +```json +{ + "tx": "0200000001ef28647baa13cc4c03b8a58c8bd08b69de434c22ff591eb68171ae992e3d816d0000000000fdffffff02237a080000000000160014963d257e99856fd746982c85b3b53bf6a33451b24d6808000000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a66000000", + "txid": "ccb97d7dc695cabb78b217c0b27d7d00d2941966199480e6443e0680d24d69eb", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABAWPCRda9hy4QKqUEmtb7gK7SAqzh1xBP8nZ7PCj+7+JDAAAAAAD9////Akf0EAAAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WUs/fQpAQAAABYAFOIj6yaI/g85utJBtkPPdK1X59cfAkcwRAIgH7J57HuUTpnCbDrDqE8W7ryuCXk+i/TszQ/NF55lWncCIDeN4y+EzIDP3l2XO5/wjk98krYqnzvEhrStk+0+fTowASEC6Ng5r5KTNIXBRRvjivsd8SKnHF59r/ViDj2+CLJVb75lAAAAAQEfR/QQAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZSICA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPRzBEAiBY0urYSHLnnXaAJH7yaGfvGmm+VuNCNIBhQaJU6iDNEgIgA7EASW+V00Su+lRQAE3Qbe4wavLq7l6Jn2vR+6Snyd0BIgYD10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8IAfrZCgAAAAABDiDvKGR7qhPMTAO4pYyL0Itp3kNMIv9ZHraBca6ZLj2BbQEPBAAAAAABEAT9////AAEDCCN6CAAAAAAAAQQWABSWPSV+mYVv10aYLIWztTv2ozRRsgz8CWxpZ2h0bmluZwQCAAEAAQMITWgIAAAAAAABBCJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aIQeRRTKBKkQKTXZscc05GTaUo0CuEeAS5boa2e+6bnbKUwkAwsyrFwIAAAAA" +} +{ + "tx": "02000000011fa6909e588f521108c268e8af91f6987a18f46191f6339e864df99c859083210100000000fdffffff0158070f0000000000160014d6b969d36dffdad9869193f663ee480dfdc7348867000000", + "txid": "ad9a712a201214c68c39ca5be68c9d153d1cac91e540d88aa3207b241e23acf8", + "psbt": "cHNidP8BAgQCAAAAAQMEZwAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQD9ZQECAAAAAAEBVa+m1d1amChv4Dwq1rVoS4KSm0BUUnVa3fUYcB3dH9oAAAAAAP////8CECcAAAAAAAAiUSBXeaBg8gDUDo+HGkDrkWFMxb+m0KX4UuBTQAp/7/hhUOEPDwAAAAAAIlEg7tdFgE2peEzCA/Vj76mf+lT98BsTe8lk5jwxJAcP++YEAEcwRAIgPsWO/4IxeW6OclDdXVnwL99X7B18sRlxgFqyvUAzN7gCIGOQOq0wZ6bV+wdYQP+9sH8IkfmqWZbQRRDkZEgfcprMAUcwRAIgb5/dI4+uVhluQjSA2q/3oAGxZd4vYzQWexfmcRQML7ECIFfgRwCaHYdyu5/H5moOPlfQlLc2gPgB6bgtfNSfRA6jAUdSIQIyQmbehAOzqxV6CfH3hNWHr2GDHJmMFRvMIbt0wrIxSyEC4704AJhmydqOxKqZzE6pxsDdRt8Vxh7wzh8nEpFxTldSrgAAAAABASvhDw8AAAAAACJRIO7XRYBNqXhMwgP1Y++pn/pU/fAbE3vJZOY8MSQHD/vmAQ4gH6aQnliPUhEIwmjor5H2mHoY9GGR9jOehk35nIWQgyEBDwQBAAAAARAE/f///wETQL0MqyYsx9Z9q14BhByMgWLW4oJHOqED5qcZ3wyJ4eDuLYfNGq6Ck30dAqFzJL4VhZLSuv87zN/1AEDNMl2DmTohFl03KAgp8YbLmVzcy/I4q0VkATk5c1E5YySjZXXfNN3/CQAHHEnKAAAAAAAiAgK5wMaEThKlMclo5VxVB47BbZv3a+kpD9h9HMpytIOaFwjWuWnTBAAAAAEDCFgHDwAAAAAAAQQWABTWuWnTbf/a2YaRk/Zj7kgN/cc0iAz8CWxpZ2h0bmluZwQCAAEA" +} +``` ERRORS ------ -On failure, an error is reported and the withdrawal transaction is not -created. - -The following error codes may occur: +On failure, an error is reported and the withdrawal transaction is not created. - -1: Catchall nonspecific error. -- 301: There are not enough funds in the internal wallet (including -fees) to create the transaction. +- 301: There are not enough funds in the internal wallet (including fees) to create the transaction. - 302: The dust limit is not met. - 313: The `min-emergency-msat` reserve not be preserved (and we have anchor channels). @@ -46,12 +91,9 @@ Felix <> is mainly responsible. SEE ALSO -------- -lightning-listfunds(7), lightning-fundchannel(7), lightning-newaddr(7), -lightning-txprepare(7), lightning-feerates(7). +lightning-listfunds(7), lightning-fundchannel(7), lightning-newaddr(7), lightning-txprepare(7), lightning-feerates(7) RESOURCES --------- Main web site: - -[comment]: # ( SHA256STAMP:e5f8da653907dd205d79e41cb64147c2042908d307ea2e36fb1b55c55a366c37) From 42ee1d5844a97328b16dd2dcf6b7fb73529c803e Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Mon, 15 Jan 2024 21:48:59 -0800 Subject: [PATCH 13/16] doc: Remove unused request.json and schema.json files --- contrib/msggen/msggen/schema.json | 71920 ++++++---------- doc/schemas/addgossip.request.json | 14 - doc/schemas/addgossip.schema.json | 6 - doc/schemas/addpsbtoutput.request.json | 27 - doc/schemas/addpsbtoutput.schema.json | 25 - doc/schemas/autoclean-once.request.json | 27 - doc/schemas/autoclean-once.schema.json | 124 - doc/schemas/autoclean-status.request.json | 20 - doc/schemas/autoclean-status.schema.json | 346 - doc/schemas/autocleaninvoice.request.json | 16 - doc/schemas/autocleaninvoice.schema.json | 48 - doc/schemas/batching.request.json | 14 - doc/schemas/batching.schema.json | 6 - doc/schemas/bkpr-channelsapy.request.json | 16 - doc/schemas/bkpr-channelsapy.schema.json | 124 - doc/schemas/bkpr-dumpincomecsv.request.json | 30 - doc/schemas/bkpr-dumpincomecsv.schema.json | 25 - doc/schemas/bkpr-inspect.request.json | 14 - doc/schemas/bkpr-inspect.schema.json | 150 - .../bkpr-listaccountevents.request.json | 12 - .../bkpr-listaccountevents.schema.json | 188 - doc/schemas/bkpr-listbalances.request.json | 7 - doc/schemas/bkpr-listbalances.schema.json | 95 - doc/schemas/bkpr-listincome.request.json | 21 - doc/schemas/bkpr-listincome.schema.json | 67 - doc/schemas/blacklistrune.request.json | 17 - doc/schemas/blacklistrune.schema.json | 32 - doc/schemas/check.request.json | 14 - doc/schemas/check.schema.json | 14 - doc/schemas/checkmessage.request.json | 23 - doc/schemas/checkmessage.schema.json | 22 - doc/schemas/checkrune.request.json | 35 - doc/schemas/checkrune.schema.json | 14 - doc/schemas/close.request.json | 41 - doc/schemas/close.schema.json | 53 - doc/schemas/commando-blacklist.request.json | 21 - doc/schemas/commando-blacklist.schema.json | 32 - doc/schemas/commando-listrunes.request.json | 17 - doc/schemas/commando-listrunes.schema.json | 112 - doc/schemas/commando-rune.request.json | 37 - doc/schemas/commando-rune.schema.json | 23 - doc/schemas/commando.request.json | 40 - doc/schemas/commando.schema.json | 11 - doc/schemas/connect.request.json | 22 - doc/schemas/connect.schema.json | 110 - doc/schemas/createinvoice.request.json | 31 - doc/schemas/createinvoice.schema.json | 105 - doc/schemas/createonion.request.json | 45 - doc/schemas/createonion.schema.json | 23 - doc/schemas/createrune.request.json | 34 - doc/schemas/createrune.schema.json | 23 - doc/schemas/datastore.request.json | 48 - doc/schemas/datastore.schema.json | 29 - doc/schemas/datastoreusage.request.json | 23 - doc/schemas/datastoreusage.schema.json | 28 - doc/schemas/decode.request.json | 15 - doc/schemas/decode.schema.json | 1548 - doc/schemas/decodepay.request.json | 19 - doc/schemas/decodepay.schema.json | 166 - doc/schemas/deldatastore.request.json | 28 - doc/schemas/deldatastore.schema.json | 29 - doc/schemas/delexpiredinvoice.request.json | 12 - doc/schemas/delexpiredinvoice.schema.json | 7 - doc/schemas/delforward.request.json | 28 - doc/schemas/delforward.schema.json | 7 - doc/schemas/delinvoice.request.json | 35 - doc/schemas/delinvoice.schema.json | 192 - doc/schemas/delpay.request.json | 31 - doc/schemas/delpay.schema.json | 102 - .../disableinvoicerequest.request.json | 15 - doc/schemas/disableinvoicerequest.schema.json | 42 - doc/schemas/disableoffer.request.json | 14 - doc/schemas/disableoffer.schema.json | 41 - doc/schemas/disconnect.request.json | 18 - doc/schemas/disconnect.schema.json | 6 - doc/schemas/emergencyrecover.request.json | 7 - doc/schemas/emergencyrecover.schema.json | 17 - doc/schemas/feerates.request.json | 18 - doc/schemas/feerates.schema.json | 238 - doc/schemas/fetchinvoice.request.json | 42 - doc/schemas/fetchinvoice.schema.json | 77 - doc/schemas/fundchannel.request.json | 69 - doc/schemas/fundchannel.schema.json | 77 - doc/schemas/fundchannel_cancel.request.json | 14 - doc/schemas/fundchannel_cancel.schema.json | 14 - doc/schemas/fundchannel_complete.request.json | 19 - doc/schemas/fundchannel_complete.schema.json | 24 - doc/schemas/fundchannel_start.request.json | 51 - doc/schemas/fundchannel_start.schema.json | 70 - doc/schemas/funderupdate.request.json | 77 - doc/schemas/funderupdate.schema.json | 92 - doc/schemas/fundpsbt.request.json | 54 - doc/schemas/fundpsbt.schema.json | 76 - doc/schemas/getinfo.request.json | 7 - doc/schemas/getinfo.schema.json | 297 - doc/schemas/getlog.request.json | 19 - doc/schemas/getlog.schema.json | 163 - doc/schemas/getroute.request.json | 46 - doc/schemas/getroute.schema.json | 54 - doc/schemas/help.request.json | 12 - doc/schemas/help.schema.json | 42 - doc/schemas/invoice.request.json | 74 - doc/schemas/invoice.schema.json | 55 - doc/schemas/invoicerequest.request.json | 36 - doc/schemas/invoicerequest.schema.json | 44 - doc/schemas/keysend.request.json | 79 - doc/schemas/keysend.schema.json | 55 - doc/schemas/listchannels.request.json | 20 - doc/schemas/listchannels.schema.json | 101 - doc/schemas/listclosedchannels.request.json | 13 - doc/schemas/listclosedchannels.schema.json | 193 - doc/schemas/listconfigs.request.json | 12 - doc/schemas/listconfigs.schema.json | 1994 - doc/schemas/listdatastore.request.json | 22 - doc/schemas/listdatastore.schema.json | 41 - doc/schemas/listforwards.request.json | 44 - doc/schemas/listforwards.schema.json | 267 - doc/schemas/listfunds.request.json | 12 - doc/schemas/listfunds.schema.json | 275 - doc/schemas/listhtlcs.request.json | 11 - doc/schemas/listhtlcs.schema.json | 82 - doc/schemas/listinvoicerequests.request.json | 17 - doc/schemas/listinvoicerequests.schema.json | 50 - doc/schemas/listinvoices.request.json | 50 - doc/schemas/listinvoices.schema.json | 175 - doc/schemas/listnodes.request.json | 12 - doc/schemas/listnodes.schema.json | 199 - doc/schemas/listoffers.request.json | 16 - doc/schemas/listoffers.schema.json | 50 - doc/schemas/listpays.request.json | 25 - doc/schemas/listpays.schema.json | 146 - doc/schemas/listpeerchannels.request.json | 13 - doc/schemas/listpeerchannels.schema.json | 1125 - doc/schemas/listpeers.request.json | 22 - doc/schemas/listpeers.schema.json | 1134 - doc/schemas/listsendpays.request.json | 44 - doc/schemas/listsendpays.schema.json | 214 - doc/schemas/listsqlschemas.request.json | 11 - doc/schemas/listsqlschemas.schema.json | 67 - doc/schemas/listtransactions.request.json | 7 - doc/schemas/listtransactions.schema.json | 107 - doc/schemas/makesecret.request.json | 16 - doc/schemas/makesecret.schema.json | 14 - doc/schemas/multifundchannel.request.json | 84 - doc/schemas/multifundchannel.schema.json | 141 - doc/schemas/multiwithdraw.request.json | 33 - doc/schemas/multiwithdraw.schema.json | 19 - doc/schemas/newaddr.request.json | 17 - doc/schemas/newaddr.schema.json | 17 - doc/schemas/notifications.request.json | 14 - doc/schemas/notifications.schema.json | 6 - doc/schemas/offer.request.json | 54 - doc/schemas/offer.schema.json | 46 - doc/schemas/openchannel_abort.request.json | 14 - doc/schemas/openchannel_abort.schema.json | 26 - doc/schemas/openchannel_bump.request.json | 28 - doc/schemas/openchannel_bump.schema.json | 76 - doc/schemas/openchannel_init.request.json | 56 - doc/schemas/openchannel_init.schema.json | 76 - doc/schemas/openchannel_signed.request.json | 19 - doc/schemas/openchannel_signed.schema.json | 26 - doc/schemas/openchannel_update.request.json | 19 - doc/schemas/openchannel_update.schema.json | 77 - doc/schemas/parsefeerate.request.json | 14 - doc/schemas/parsefeerate.schema.json | 13 - doc/schemas/pay.request.json | 68 - doc/schemas/pay.schema.json | 57 - doc/schemas/ping.request.json | 22 - doc/schemas/ping.schema.json | 14 - doc/schemas/plugin.request.json | 29 - doc/schemas/plugin.schema.json | 100 - doc/schemas/preapproveinvoice.request.json | 16 - doc/schemas/preapproveinvoice.schema.json | 7 - doc/schemas/preapprovekeysend.request.json | 30 - doc/schemas/preapprovekeysend.schema.json | 6 - doc/schemas/recover.request.json | 14 - doc/schemas/recover.schema.json | 17 - doc/schemas/recoverchannel.request.json | 17 - doc/schemas/recoverchannel.schema.json | 17 - doc/schemas/renepay.request.json | 42 - doc/schemas/renepay.schema.json | 54 - doc/schemas/renepaystatus.request.json | 12 - doc/schemas/renepaystatus.schema.json | 83 - doc/schemas/reserveinputs.request.json | 22 - doc/schemas/reserveinputs.schema.json | 49 - doc/schemas/sendcustommsg.request.json | 20 - doc/schemas/sendcustommsg.schema.json | 14 - doc/schemas/sendinvoice.request.json | 38 - doc/schemas/sendinvoice.schema.json | 109 - doc/schemas/sendonion.request.json | 83 - doc/schemas/sendonion.schema.json | 151 - doc/schemas/sendonionmessage.request.json | 42 - doc/schemas/sendonionmessage.schema.json | 7 - doc/schemas/sendpay.request.json | 83 - doc/schemas/sendpay.schema.json | 165 - doc/schemas/sendpsbt.request.json | 18 - doc/schemas/sendpsbt.schema.json | 19 - doc/schemas/setchannel.request.json | 39 - doc/schemas/setchannel.schema.json | 72 - doc/schemas/setconfig.request.json | 29 - doc/schemas/setconfig.schema.json | 62 - doc/schemas/setpsbtversion.request.json | 19 - doc/schemas/setpsbtversion.schema.json | 14 - doc/schemas/showrunes.request.json | 13 - doc/schemas/showrunes.schema.json | 112 - doc/schemas/signinvoice.request.json | 15 - doc/schemas/signinvoice.schema.json | 14 - doc/schemas/signmessage.request.json | 14 - doc/schemas/signmessage.schema.json | 28 - doc/schemas/signpsbt.request.json | 21 - doc/schemas/signpsbt.schema.json | 14 - doc/schemas/splice_init.request.json | 32 - doc/schemas/splice_init.schema.json | 15 - doc/schemas/splice_signed.request.json | 24 - doc/schemas/splice_signed.schema.json | 20 - doc/schemas/splice_update.request.json | 20 - doc/schemas/splice_update.schema.json | 20 - doc/schemas/sql.request.json | 13 - doc/schemas/sql.schema.json | 20 - doc/schemas/staticbackup.request.json | 7 - doc/schemas/staticbackup.schema.json | 17 - doc/schemas/stop.request.json | 7 - doc/schemas/stop.schema.json | 17 - doc/schemas/txdiscard.request.json | 14 - doc/schemas/txdiscard.schema.json | 18 - doc/schemas/txprepare.request.json | 32 - doc/schemas/txprepare.schema.json | 23 - doc/schemas/txsend.request.json | 14 - doc/schemas/txsend.schema.json | 23 - doc/schemas/unreserveinputs.request.json | 18 - doc/schemas/unreserveinputs.schema.json | 70 - doc/schemas/upgradewallet.request.json | 18 - doc/schemas/upgradewallet.schema.json | 30 - doc/schemas/utxopsbt.request.json | 57 - doc/schemas/utxopsbt.schema.json | 73 - doc/schemas/wait.request.json | 35 - doc/schemas/wait.schema.json | 189 - doc/schemas/waitanyinvoice.request.json | 16 - doc/schemas/waitanyinvoice.schema.json | 151 - doc/schemas/waitblockheight.request.json | 18 - doc/schemas/waitblockheight.schema.json | 13 - doc/schemas/waitinvoice.request.json | 21 - doc/schemas/waitinvoice.schema.json | 151 - doc/schemas/waitsendpay.request.json | 26 - doc/schemas/waitsendpay.schema.json | 123 - doc/schemas/withdraw.request.json | 34 - doc/schemas/withdraw.schema.json | 23 - 247 files changed, 27138 insertions(+), 62426 deletions(-) delete mode 100644 doc/schemas/addgossip.request.json delete mode 100644 doc/schemas/addgossip.schema.json delete mode 100644 doc/schemas/addpsbtoutput.request.json delete mode 100644 doc/schemas/addpsbtoutput.schema.json delete mode 100644 doc/schemas/autoclean-once.request.json delete mode 100644 doc/schemas/autoclean-once.schema.json delete mode 100644 doc/schemas/autoclean-status.request.json delete mode 100644 doc/schemas/autoclean-status.schema.json delete mode 100644 doc/schemas/autocleaninvoice.request.json delete mode 100644 doc/schemas/autocleaninvoice.schema.json delete mode 100644 doc/schemas/batching.request.json delete mode 100644 doc/schemas/batching.schema.json delete mode 100644 doc/schemas/bkpr-channelsapy.request.json delete mode 100644 doc/schemas/bkpr-channelsapy.schema.json delete mode 100644 doc/schemas/bkpr-dumpincomecsv.request.json delete mode 100644 doc/schemas/bkpr-dumpincomecsv.schema.json delete mode 100644 doc/schemas/bkpr-inspect.request.json delete mode 100644 doc/schemas/bkpr-inspect.schema.json delete mode 100644 doc/schemas/bkpr-listaccountevents.request.json delete mode 100644 doc/schemas/bkpr-listaccountevents.schema.json delete mode 100644 doc/schemas/bkpr-listbalances.request.json delete mode 100644 doc/schemas/bkpr-listbalances.schema.json delete mode 100644 doc/schemas/bkpr-listincome.request.json delete mode 100644 doc/schemas/bkpr-listincome.schema.json delete mode 100644 doc/schemas/blacklistrune.request.json delete mode 100644 doc/schemas/blacklistrune.schema.json delete mode 100644 doc/schemas/check.request.json delete mode 100644 doc/schemas/check.schema.json delete mode 100644 doc/schemas/checkmessage.request.json delete mode 100644 doc/schemas/checkmessage.schema.json delete mode 100644 doc/schemas/checkrune.request.json delete mode 100644 doc/schemas/checkrune.schema.json delete mode 100644 doc/schemas/close.request.json delete mode 100644 doc/schemas/close.schema.json delete mode 100644 doc/schemas/commando-blacklist.request.json delete mode 100644 doc/schemas/commando-blacklist.schema.json delete mode 100644 doc/schemas/commando-listrunes.request.json delete mode 100644 doc/schemas/commando-listrunes.schema.json delete mode 100644 doc/schemas/commando-rune.request.json delete mode 100644 doc/schemas/commando-rune.schema.json delete mode 100644 doc/schemas/commando.request.json delete mode 100644 doc/schemas/commando.schema.json delete mode 100644 doc/schemas/connect.request.json delete mode 100644 doc/schemas/connect.schema.json delete mode 100644 doc/schemas/createinvoice.request.json delete mode 100644 doc/schemas/createinvoice.schema.json delete mode 100644 doc/schemas/createonion.request.json delete mode 100644 doc/schemas/createonion.schema.json delete mode 100644 doc/schemas/createrune.request.json delete mode 100644 doc/schemas/createrune.schema.json delete mode 100644 doc/schemas/datastore.request.json delete mode 100644 doc/schemas/datastore.schema.json delete mode 100644 doc/schemas/datastoreusage.request.json delete mode 100644 doc/schemas/datastoreusage.schema.json delete mode 100644 doc/schemas/decode.request.json delete mode 100644 doc/schemas/decode.schema.json delete mode 100644 doc/schemas/decodepay.request.json delete mode 100644 doc/schemas/decodepay.schema.json delete mode 100644 doc/schemas/deldatastore.request.json delete mode 100644 doc/schemas/deldatastore.schema.json delete mode 100644 doc/schemas/delexpiredinvoice.request.json delete mode 100644 doc/schemas/delexpiredinvoice.schema.json delete mode 100644 doc/schemas/delforward.request.json delete mode 100644 doc/schemas/delforward.schema.json delete mode 100644 doc/schemas/delinvoice.request.json delete mode 100644 doc/schemas/delinvoice.schema.json delete mode 100644 doc/schemas/delpay.request.json delete mode 100644 doc/schemas/delpay.schema.json delete mode 100644 doc/schemas/disableinvoicerequest.request.json delete mode 100644 doc/schemas/disableinvoicerequest.schema.json delete mode 100644 doc/schemas/disableoffer.request.json delete mode 100644 doc/schemas/disableoffer.schema.json delete mode 100644 doc/schemas/disconnect.request.json delete mode 100644 doc/schemas/disconnect.schema.json delete mode 100644 doc/schemas/emergencyrecover.request.json delete mode 100644 doc/schemas/emergencyrecover.schema.json delete mode 100644 doc/schemas/feerates.request.json delete mode 100644 doc/schemas/feerates.schema.json delete mode 100644 doc/schemas/fetchinvoice.request.json delete mode 100644 doc/schemas/fetchinvoice.schema.json delete mode 100644 doc/schemas/fundchannel.request.json delete mode 100644 doc/schemas/fundchannel.schema.json delete mode 100644 doc/schemas/fundchannel_cancel.request.json delete mode 100644 doc/schemas/fundchannel_cancel.schema.json delete mode 100644 doc/schemas/fundchannel_complete.request.json delete mode 100644 doc/schemas/fundchannel_complete.schema.json delete mode 100644 doc/schemas/fundchannel_start.request.json delete mode 100644 doc/schemas/fundchannel_start.schema.json delete mode 100644 doc/schemas/funderupdate.request.json delete mode 100644 doc/schemas/funderupdate.schema.json delete mode 100644 doc/schemas/fundpsbt.request.json delete mode 100644 doc/schemas/fundpsbt.schema.json delete mode 100644 doc/schemas/getinfo.request.json delete mode 100644 doc/schemas/getinfo.schema.json delete mode 100644 doc/schemas/getlog.request.json delete mode 100644 doc/schemas/getlog.schema.json delete mode 100644 doc/schemas/getroute.request.json delete mode 100644 doc/schemas/getroute.schema.json delete mode 100644 doc/schemas/help.request.json delete mode 100644 doc/schemas/help.schema.json delete mode 100644 doc/schemas/invoice.request.json delete mode 100644 doc/schemas/invoice.schema.json delete mode 100644 doc/schemas/invoicerequest.request.json delete mode 100644 doc/schemas/invoicerequest.schema.json delete mode 100644 doc/schemas/keysend.request.json delete mode 100644 doc/schemas/keysend.schema.json delete mode 100644 doc/schemas/listchannels.request.json delete mode 100644 doc/schemas/listchannels.schema.json delete mode 100644 doc/schemas/listclosedchannels.request.json delete mode 100644 doc/schemas/listclosedchannels.schema.json delete mode 100644 doc/schemas/listconfigs.request.json delete mode 100644 doc/schemas/listconfigs.schema.json delete mode 100644 doc/schemas/listdatastore.request.json delete mode 100644 doc/schemas/listdatastore.schema.json delete mode 100644 doc/schemas/listforwards.request.json delete mode 100644 doc/schemas/listforwards.schema.json delete mode 100644 doc/schemas/listfunds.request.json delete mode 100644 doc/schemas/listfunds.schema.json delete mode 100644 doc/schemas/listhtlcs.request.json delete mode 100644 doc/schemas/listhtlcs.schema.json delete mode 100644 doc/schemas/listinvoicerequests.request.json delete mode 100644 doc/schemas/listinvoicerequests.schema.json delete mode 100644 doc/schemas/listinvoices.request.json delete mode 100644 doc/schemas/listinvoices.schema.json delete mode 100644 doc/schemas/listnodes.request.json delete mode 100644 doc/schemas/listnodes.schema.json delete mode 100644 doc/schemas/listoffers.request.json delete mode 100644 doc/schemas/listoffers.schema.json delete mode 100644 doc/schemas/listpays.request.json delete mode 100644 doc/schemas/listpays.schema.json delete mode 100644 doc/schemas/listpeerchannels.request.json delete mode 100644 doc/schemas/listpeerchannels.schema.json delete mode 100644 doc/schemas/listpeers.request.json delete mode 100644 doc/schemas/listpeers.schema.json delete mode 100644 doc/schemas/listsendpays.request.json delete mode 100644 doc/schemas/listsendpays.schema.json delete mode 100644 doc/schemas/listsqlschemas.request.json delete mode 100644 doc/schemas/listsqlschemas.schema.json delete mode 100644 doc/schemas/listtransactions.request.json delete mode 100644 doc/schemas/listtransactions.schema.json delete mode 100644 doc/schemas/makesecret.request.json delete mode 100644 doc/schemas/makesecret.schema.json delete mode 100644 doc/schemas/multifundchannel.request.json delete mode 100644 doc/schemas/multifundchannel.schema.json delete mode 100644 doc/schemas/multiwithdraw.request.json delete mode 100644 doc/schemas/multiwithdraw.schema.json delete mode 100644 doc/schemas/newaddr.request.json delete mode 100644 doc/schemas/newaddr.schema.json delete mode 100644 doc/schemas/notifications.request.json delete mode 100644 doc/schemas/notifications.schema.json delete mode 100644 doc/schemas/offer.request.json delete mode 100644 doc/schemas/offer.schema.json delete mode 100644 doc/schemas/openchannel_abort.request.json delete mode 100644 doc/schemas/openchannel_abort.schema.json delete mode 100644 doc/schemas/openchannel_bump.request.json delete mode 100644 doc/schemas/openchannel_bump.schema.json delete mode 100644 doc/schemas/openchannel_init.request.json delete mode 100644 doc/schemas/openchannel_init.schema.json delete mode 100644 doc/schemas/openchannel_signed.request.json delete mode 100644 doc/schemas/openchannel_signed.schema.json delete mode 100644 doc/schemas/openchannel_update.request.json delete mode 100644 doc/schemas/openchannel_update.schema.json delete mode 100644 doc/schemas/parsefeerate.request.json delete mode 100644 doc/schemas/parsefeerate.schema.json delete mode 100644 doc/schemas/pay.request.json delete mode 100644 doc/schemas/pay.schema.json delete mode 100644 doc/schemas/ping.request.json delete mode 100644 doc/schemas/ping.schema.json delete mode 100644 doc/schemas/plugin.request.json delete mode 100644 doc/schemas/plugin.schema.json delete mode 100644 doc/schemas/preapproveinvoice.request.json delete mode 100644 doc/schemas/preapproveinvoice.schema.json delete mode 100644 doc/schemas/preapprovekeysend.request.json delete mode 100644 doc/schemas/preapprovekeysend.schema.json delete mode 100644 doc/schemas/recover.request.json delete mode 100644 doc/schemas/recover.schema.json delete mode 100644 doc/schemas/recoverchannel.request.json delete mode 100644 doc/schemas/recoverchannel.schema.json delete mode 100644 doc/schemas/renepay.request.json delete mode 100644 doc/schemas/renepay.schema.json delete mode 100644 doc/schemas/renepaystatus.request.json delete mode 100644 doc/schemas/renepaystatus.schema.json delete mode 100644 doc/schemas/reserveinputs.request.json delete mode 100644 doc/schemas/reserveinputs.schema.json delete mode 100644 doc/schemas/sendcustommsg.request.json delete mode 100644 doc/schemas/sendcustommsg.schema.json delete mode 100644 doc/schemas/sendinvoice.request.json delete mode 100644 doc/schemas/sendinvoice.schema.json delete mode 100644 doc/schemas/sendonion.request.json delete mode 100644 doc/schemas/sendonion.schema.json delete mode 100644 doc/schemas/sendonionmessage.request.json delete mode 100644 doc/schemas/sendonionmessage.schema.json delete mode 100644 doc/schemas/sendpay.request.json delete mode 100644 doc/schemas/sendpay.schema.json delete mode 100644 doc/schemas/sendpsbt.request.json delete mode 100644 doc/schemas/sendpsbt.schema.json delete mode 100644 doc/schemas/setchannel.request.json delete mode 100644 doc/schemas/setchannel.schema.json delete mode 100644 doc/schemas/setconfig.request.json delete mode 100644 doc/schemas/setconfig.schema.json delete mode 100644 doc/schemas/setpsbtversion.request.json delete mode 100644 doc/schemas/setpsbtversion.schema.json delete mode 100644 doc/schemas/showrunes.request.json delete mode 100644 doc/schemas/showrunes.schema.json delete mode 100644 doc/schemas/signinvoice.request.json delete mode 100644 doc/schemas/signinvoice.schema.json delete mode 100644 doc/schemas/signmessage.request.json delete mode 100644 doc/schemas/signmessage.schema.json delete mode 100644 doc/schemas/signpsbt.request.json delete mode 100644 doc/schemas/signpsbt.schema.json delete mode 100644 doc/schemas/splice_init.request.json delete mode 100644 doc/schemas/splice_init.schema.json delete mode 100644 doc/schemas/splice_signed.request.json delete mode 100644 doc/schemas/splice_signed.schema.json delete mode 100644 doc/schemas/splice_update.request.json delete mode 100644 doc/schemas/splice_update.schema.json delete mode 100644 doc/schemas/sql.request.json delete mode 100644 doc/schemas/sql.schema.json delete mode 100644 doc/schemas/staticbackup.request.json delete mode 100644 doc/schemas/staticbackup.schema.json delete mode 100644 doc/schemas/stop.request.json delete mode 100644 doc/schemas/stop.schema.json delete mode 100644 doc/schemas/txdiscard.request.json delete mode 100644 doc/schemas/txdiscard.schema.json delete mode 100644 doc/schemas/txprepare.request.json delete mode 100644 doc/schemas/txprepare.schema.json delete mode 100644 doc/schemas/txsend.request.json delete mode 100644 doc/schemas/txsend.schema.json delete mode 100644 doc/schemas/unreserveinputs.request.json delete mode 100644 doc/schemas/unreserveinputs.schema.json delete mode 100644 doc/schemas/upgradewallet.request.json delete mode 100644 doc/schemas/upgradewallet.schema.json delete mode 100644 doc/schemas/utxopsbt.request.json delete mode 100644 doc/schemas/utxopsbt.schema.json delete mode 100644 doc/schemas/wait.request.json delete mode 100644 doc/schemas/wait.schema.json delete mode 100644 doc/schemas/waitanyinvoice.request.json delete mode 100644 doc/schemas/waitanyinvoice.schema.json delete mode 100644 doc/schemas/waitblockheight.request.json delete mode 100644 doc/schemas/waitblockheight.schema.json delete mode 100644 doc/schemas/waitinvoice.request.json delete mode 100644 doc/schemas/waitinvoice.schema.json delete mode 100644 doc/schemas/waitsendpay.request.json delete mode 100644 doc/schemas/waitsendpay.schema.json delete mode 100644 doc/schemas/withdraw.request.json delete mode 100644 doc/schemas/withdraw.schema.json diff --git a/contrib/msggen/msggen/schema.json b/contrib/msggen/msggen/schema.json index 01b014dda491..fe695da2eb6f 100644 --- a/contrib/msggen/msggen/schema.json +++ b/contrib/msggen/msggen/schema.json @@ -1,7563 +1,4251 @@ { - "addgossip.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-addgossip.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "message" + "rpc": "addgossip", + "title": "Command for injecting a gossip message (low-level)", + "description": [ + "The **addgossip** RPC command injects a hex-encoded gossip message into the gossip daemon. It may return an error if it is malformed, or may update its internal state using the gossip message.", + "", + "Note that currently some paths will still silently reject the gossip: it is best effort.", + "", + "This is particularly used by plugins which may receive channel_update messages within error replies." ], - "properties": { - "message": { - "type": "hex", - "description": "The raw, hex-encoded, gossip message to add to the local gossip view" + "request": { + "required": [ + "message" + ], + "properties": { + "message": { + "type": "hex", + "description": [ + "The raw, hex-encoded, gossip message to add to the local gossip view." + ] + } } - } - }, - "addgossip.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "properties": {} + }, + "response": { + "properties": {} + }, + "example_json_request": [ + { + "id": "example:addgossip#1", + "method": "addgossip", + "params": { + "message": "010078c3314666731e339c0b8434f7824797a084ed7ca3655991a672da068e2c44cb53b57b53a296c133bc879109a8931dc31e6913a4bda3d58559b99b95663e6d52775579447ef5526300e1bb89bc6af8557aa1c3810a91814eafad6d103f43182e17b16644cb38c1d58a8edd094303959a9f1f9d42ff6c32a21f9c118531f512c8679cabaccc6e39dbd95a4dac90e75a258893c3aa3f733d1b8890174d5ddea8003cadffe557773c54d2c07ca1d535c4bf85885f879ae466c16a516e8ffcfec1740e3f5c98ca9ce13f452e867befef5517f306ed6aa5119b79059bcc6f68f329986b665d16de7bc7df64e3537504c91eeabe0e59d3a2b68e4216ead2b0f6e3ef7c000006226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f0000670000010000022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d590266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c0351802e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5702324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b" + } + }, + { + "id": "example:addgossip#2", + "method": "addgossip", + "params": { + "message": "0102420526c8eb62ec6999bbee5f1de4841cab734374ec642b7deeb0259e76220bf82e97a241c907d5ff52019655f7f9a614c285bb35690f3a1a2b928d7b2349a79e06226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f000067000001000065b32a0e010100060000000000000000000000010000000a000000003b023380" + } + } + ], + "example_json_response": [ + {}, + {} + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-pay(7)" + ], + "resources": [ + "Main web site: " + ] }, - "addpsbtoutput.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-addpsbtoutput.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "satoshi" - ], "added": "v23.11", - "properties": { - "satoshi": { - "type": "msat", - "description": "the satoshi value of the output. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" - }, - "initialpsbt": { - "type": "string", - "description": "base 64 encoded PSBT to add the output to. If not specified, one will be generated automatically" + "rpc": "addpsbtoutput", + "title": "Command to populate PSBT outputs from the wallet", + "description": [ + "`addpsbtoutput` is a low-level RPC command which creates or modifies a PSBT by adding a single output of amount *satoshi*.", + "", + "This is used to receive funds into the on-chain wallet interactively using PSBTs." + ], + "request": { + "required": [ + "satoshi" + ], + "properties": { + "satoshi": { + "type": "sat", + "description": [ + "The satoshi value of the output. It can be a whole number, a whole number ending in *sat*, or a number with 1 to 8 decimal places ending in *btc*." + ] + }, + "initialpsbt": { + "type": "string", + "description": [ + "Base 64 encoded PSBT to add the output to. If not specified, one will be generated automatically." + ] + }, + "locktime": { + "type": "u32", + "description": [ + "If not set, it is set to a recent block height (if no initial psbt is specified)." + ] + }, + "destination": { + "type": "string", + "description": [ + "If it is not set, an internal address is generated." + ] + } + } + }, + "response": { + "required": [ + "psbt", + "estimated_added_weight", + "outnum" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "Unsigned PSBT which fulfills the parameters given." + ] + }, + "estimated_added_weight": { + "type": "u32", + "description": [ + "The estimated weight of the added output." + ] + }, + "outnum": { + "type": "u32", + "description": [ + "The 0-based number where the output was placed." + ] + } + } + }, + "example_usage": [ + "Here is a command to make a PSBT with a 100,000 sat output that leads to the on-chain wallet.", + "", + "```shell", + "lightning-cli addpsbtoutput 100000sat", + "```" + ], + "example_json_request": [ + { + "id": "example:addpsbtoutput#1", + "method": "addpsbtoutput", + "params": { + "satoshi": 100000, + "initialpsbt": null, + "locktime": null, + "destination": null + } }, - "locktime": { - "type": "u32", - "description": "if not set, it is set to a recent block height (if no initial psbt is specified)" + { + "id": "example:addpsbtoutput#2", + "method": "addpsbtoutput", + "params": { + "satoshi": 1000000, + "initialpsbt": null, + "locktime": 111, + "destination": null + } }, - "destination": { - "type": "string", - "description": "if it is not set, an internal address is generated" + { + "id": "example:addpsbtoutput#3", + "method": "addpsbtoutput", + "params": { + "satoshi": 974343, + "initialpsbt": "cHNidP8BAF4CAAAAAfwbEpvpi6D14YV4VLnuVB47Y0uF41kXEyJRL4IusySSAQAAAAD9////ASICAAAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5nAAAAAAEA9gIAAAAAAQFEkxvLatohY6mw5gr5qG1aiArSrziFPR2YoqD21Hv+RAAAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNrz8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIEu1nfVRt9i+rFM219mwhMqdwJsqygWSWTFUS+cemdh6AiBG3Qo8g9J/aAMO2RHDsIBScscj6pTTIwZp7Gw8G3EOKAEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPZgAAAAEBK68/DwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==", + "locktime": null, + "destination": "bcrt1q9tc6q49l6wrrtp8ul45rj92hsleehwwxty32zu" + } } - } - }, - "addpsbtoutput.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt", - "estimated_added_weight", - "outnum" ], - "added": "v23.11", - "properties": { - "psbt": { - "type": "string", - "description": "Unsigned PSBT which fulfills the parameters given" + "example_json_response": [ + { + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIoIYBAAAAAAABBCJRIHg2NV/cioLcTLAKdyxVVBUdBjhKTdZejT9orAhWa4S+AA==", + "estimated_added_weight": 172, + "outnum": 0 }, - "estimated_added_weight": { - "type": "u32", - "description": "The estimated weight of the added output" + { + "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIJd6ICNAQALFOMhoUHuSVSuzcaUdkDKlk4K+A+DR9+4uAA==", + "estimated_added_weight": 172, + "outnum": 0 }, - "outnum": { - "type": "u32", - "description": "The 0-based number where the output was placed" + { + "psbt": "cHNidP8BAH0CAAAAAfwbEpvpi6D14YV4VLnuVB47Y0uF41kXEyJRL4IusySSAQAAAAD9////AiICAAAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4H3g4AAAAAABYAFCrxoFS/04Y1hPz9aDkVV4fzm7nGZwAAAAABAPYCAAAAAAEBRJMby2raIWOpsOYK+ahtWogK0q84hT0dmKKg9tR7/kQAAAAAAP3///8CQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAza8/DwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oCRzBEAiBLtZ31UbfYvqxTNtfZsITKncCbKsoFklkxVEvnHpnYegIgRt0KPIPSf2gDDtkRw7CAUnLHI+qU0yMGaexsPBtxDigBIQPXRURck2JmXyLg2W6edm8nPzJg3qOcina/oF3SaE3cz2YAAAABASuvPw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAAAA", + "estimated_added_weight": 172, + "outnum": 1 } - } + ], + "author": [ + "Dusty <<@dusty_daemon>> is mainly responsible." + ], + "see_also": [ + "lightning-fundpsbt(7)", + "lightning-utxopsbt(7)" + ], + "resources": [ + "Main web site: " + ] }, - "autoclean-once.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-autoclean-once.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "subsystem", - "age" - ], - "properties": { - "subsystem": { - "type": "string", - "enum": [ - "succeededforwards", - "failedforwards", - "succeededpays", - "failedpays", - "paidinvoices", - "expiredinvoices" - ], - "description": "What subsystem to clean. Currently supported subsystems are:\t* `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`).\t* `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`).\t* `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`).\t* `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`).\t* `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`).\t* `paidinvoices`: invoices which were paid (`paid` in listinvoices `status)" - }, - "age": { - "type": "u64", - "description": "non-zero number in seconds. How many seconds old an entry must be to delete it" - } - } - }, - "autoclean-once.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": true, - "required": [ - "autoclean" - ], - "properties": { - "autoclean": { - "type": "object", - "additionalProperties": false, - "properties": { - "succeededforwards": { - "type": "object", - "additionalProperties": false, - "required": [ - "cleaned", - "uncleaned" - ], - "properties": { - "cleaned": { - "type": "u64", - "description": "total number of deletions done this run" - }, - "uncleaned": { - "type": "u64", - "description": "the total number of entries *not* deleted this run" - } - } - }, - "failedforwards": { - "type": "object", - "additionalProperties": false, - "required": [ - "cleaned", - "uncleaned" - ], - "properties": { - "cleaned": { - "type": "u64", - "description": "total number of deletions done this run" - }, - "uncleaned": { - "type": "u64", - "description": "the total number of entries *not* deleted this run" - } - } - }, - "succeededpays": { - "type": "object", - "additionalProperties": false, - "required": [ - "cleaned", - "uncleaned" - ], - "properties": { - "cleaned": { - "type": "u64", - "description": "total number of deletions done this run" - }, - "uncleaned": { - "type": "u64", - "description": "the total number of entries *not* deleted this run" - } - } - }, - "failedpays": { - "type": "object", - "additionalProperties": false, - "required": [ - "cleaned", - "uncleaned" - ], - "properties": { - "cleaned": { - "type": "u64", - "description": "total number of deletions done this run" - }, - "uncleaned": { - "type": "u64", - "description": "the total number of entries *not* deleted this run" - } - } - }, - "paidinvoices": { - "type": "object", - "additionalProperties": false, - "required": [ - "cleaned", - "uncleaned" - ], - "properties": { - "cleaned": { - "type": "u64", - "description": "total number of deletions done this run" - }, - "uncleaned": { - "type": "u64", - "description": "the total number of entries *not* deleted this run" - } - } - }, - "expiredinvoices": { - "type": "object", - "additionalProperties": false, - "required": [ - "cleaned", - "uncleaned" - ], - "properties": { - "cleaned": { - "type": "u64", - "description": "total number of deletions done this run" - }, - "uncleaned": { - "type": "u64", - "description": "the total number of entries *not* deleted this run" - } - } - } + "rpc": "autoclean-once", + "title": "A single deletion of old invoices/payments/forwards", + "description": [ + "The **autoclean-once** RPC command tell the `autoclean` plugin to do a single sweep to delete old entries. This is a manual alternative (or addition) to the various `autoclean-...-age` parameters which cause autoclean to run once per hour: see lightningd-config(5)." + ], + "request": { + "required": [ + "subsystem", + "age" + ], + "properties": { + "subsystem": { + "type": "string", + "enum": [ + "succeededforwards", + "failedforwards", + "succeededpays", + "failedpays", + "paidinvoices", + "expiredinvoices" + ], + "description": [ + "What subsystem to clean. Currently supported subsystems are:", + " * `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`).", + " * `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`).", + " * `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`).", + " * `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`).", + " * `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`).", + " * `paidinvoices`: invoices which were paid (`paid` in listinvoices `status)." + ] + }, + "age": { + "type": "u64", + "description": [ + "Non-zero number in seconds. How many seconds old an entry must be to delete it." + ] } } - } - }, - "autoclean-status.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "subsystem": { - "type": "string", - "enum": [ - "succeededforwards", - "failedforwards", - "succeededpays", - "failedpays", - "paidinvoices", - "expiredinvoices" - ], - "description": "What subsystem to ask about. Currently supported subsystems are:\t* `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`).\t* `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`).\t* `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`).\t* `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`).\t* `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`).\t* `paidinvoices`: invoices which were paid (`paid` in listinvoices `status)" - } - } - }, - "autoclean-status.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "autoclean" - ], - "properties": { - "autoclean": { - "type": "object", - "additionalProperties": false, - "properties": { - "succeededforwards": { - "type": "object", - "additionalProperties": true, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": { - "type": "boolean", - "description": "whether autocleaning is enabled for successful listforwards" - }, - "cleaned": { - "type": "u64", - "description": "total number of deletions done (ever)" - } - }, - "if": { - "properties": { - "enabled": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { + }, + "response": { + "required": [ + "autoclean" + ], + "properties": { + "autoclean": { + "type": "object", + "additionalProperties": false, + "properties": { + "succeededforwards": { + "type": "object", "additionalProperties": false, "required": [ - "enabled", - "age", - "cleaned" + "cleaned", + "uncleaned" ], "properties": { - "enabled": {}, - "cleaned": {}, - "age": { + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done this run." + ] + }, + "uncleaned": { "type": "u64", - "description": "age (in seconds) to delete successful listforwards" + "description": [ + "The total number of entries *not* deleted this run." + ] } } }, - "else": { + "failedforwards": { + "type": "object", "additionalProperties": false, "required": [ - "enabled", - "cleaned" + "cleaned", + "uncleaned" ], "properties": { - "enabled": {}, - "cleaned": {} - } - } - }, - "failedforwards": { - "type": "object", - "additionalProperties": true, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": { - "type": "boolean", - "description": "whether autocleaning is enabled for failed listforwards" - }, - "cleaned": { - "type": "u64", - "description": "total number of deletions done (ever)" - } - }, - "if": { - "properties": { - "enabled": { - "type": "boolean", - "enum": [ - true + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done this run." + ] + }, + "uncleaned": { + "type": "u64", + "description": [ + "The total number of entries *not* deleted this run." ] } } }, - "then": { + "succeededpays": { + "type": "object", "additionalProperties": false, "required": [ - "enabled", - "age", - "cleaned" + "cleaned", + "uncleaned" ], "properties": { - "enabled": {}, - "cleaned": {}, - "age": { + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done this run." + ] + }, + "uncleaned": { "type": "u64", - "description": "age (in seconds) to delete failed listforwards" + "description": [ + "The total number of entries *not* deleted this run." + ] } } }, - "else": { + "failedpays": { + "type": "object", "additionalProperties": false, "required": [ - "enabled", - "cleaned" + "cleaned", + "uncleaned" ], "properties": { - "enabled": {}, - "cleaned": {} - } - } - }, - "succeededpays": { - "type": "object", - "additionalProperties": true, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": { - "type": "boolean", - "description": "whether autocleaning is enabled for successful listpays/listsendpays" - }, - "cleaned": { - "type": "u64", - "description": "total number of deletions done (ever)" - } - }, - "if": { - "properties": { - "enabled": { - "type": "boolean", - "enum": [ - true + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done this run." + ] + }, + "uncleaned": { + "type": "u64", + "description": [ + "The total number of entries *not* deleted this run." ] } } }, - "then": { + "paidinvoices": { + "type": "object", "additionalProperties": false, "required": [ - "enabled", - "age", - "cleaned" + "cleaned", + "uncleaned" ], "properties": { - "enabled": {}, - "cleaned": {}, - "age": { + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done this run." + ] + }, + "uncleaned": { "type": "u64", - "description": "age (in seconds) to delete successful listpays/listsendpays" + "description": [ + "The total number of entries *not* deleted this run." + ] } } }, - "else": { + "expiredinvoices": { + "type": "object", "additionalProperties": false, "required": [ - "enabled", - "cleaned" + "cleaned", + "uncleaned" ], "properties": { - "enabled": {}, - "cleaned": {} + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done this run." + ] + }, + "uncleaned": { + "type": "u64", + "description": [ + "The total number of entries *not* deleted this run." + ] + } } } - }, - "failedpays": { - "type": "object", - "additionalProperties": true, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": { - "type": "boolean", - "description": "whether autocleaning is enabled for failed listpays/listsendpays" - }, - "cleaned": { - "type": "u64", - "description": "total number of deletions done (ever)" - } - }, - "if": { - "properties": { - "enabled": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "additionalProperties": false, + } + } + } + }, + "example_json_request": [ + { + "id": "example:autoclean-once#1", + "method": "autoclean-once", + "params": [ + "failedpays", + 1 + ] + }, + { + "id": "example:autoclean-once#2", + "method": "autoclean-once", + "params": [ + "succeededpays", + 1 + ] + } + ], + "example_json_response": [ + { + "autoclean": { + "failedpays": { + "cleaned": 1, + "uncleaned": 1 + } + } + }, + { + "autoclean": { + "succeededpays": { + "cleaned": 1, + "uncleaned": 0 + } + } + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightningd-config(5)", + "lightning-autoclean-status(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-autoclean-status.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "autoclean-status", + "title": "Examine auto-delete of old invoices/payments/forwards", + "description": [ + "The **autoclean-status** RPC command tells you about the status of the autclean plugin, optionally for only one subsystem." + ], + "request": { + "required": [], + "properties": { + "subsystem": { + "type": "string", + "enum": [ + "succeededforwards", + "failedforwards", + "succeededpays", + "failedpays", + "paidinvoices", + "expiredinvoices" + ], + "description": [ + "What subsystem to ask about. Currently supported subsystems are:", + " * `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`).", + " * `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`).", + " * `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`).", + " * `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`).", + " * `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`).", + " * `paidinvoices`: invoices which were paid (`paid` in listinvoices `status)." + ] + } + } + }, + "response": { + "required": [ + "autoclean" + ], + "properties": { + "autoclean": { + "type": "object", + "additionalProperties": false, + "properties": { + "succeededforwards": { + "type": "object", + "additionalProperties": true, "required": [ "enabled", - "age", "cleaned" ], "properties": { - "enabled": {}, - "cleaned": {}, - "age": { + "enabled": { + "type": "boolean", + "description": [ + "Whether autocleaning is enabled for successful listforwards." + ] + }, + "cleaned": { "type": "u64", - "description": "age (in seconds) to delete failed listpays/listsendpays" + "description": [ + "Total number of deletions done (ever)." + ] + } + }, + "if": { + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "enabled", + "age", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {}, + "age": { + "type": "u64", + "description": [ + "Age (in seconds) to delete successful listforwards." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {} } } }, - "else": { - "additionalProperties": false, + "failedforwards": { + "type": "object", + "additionalProperties": true, "required": [ "enabled", "cleaned" ], - "properties": { - "enabled": {}, - "cleaned": {} - } - } - }, - "paidinvoices": { - "type": "object", - "additionalProperties": true, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": { - "type": "boolean", - "description": "whether autocleaning is enabled for paid listinvoices" - }, - "cleaned": { - "type": "u64", - "description": "total number of deletions done (ever)" - } - }, - "if": { "properties": { "enabled": { "type": "boolean", - "enum": [ - true + "description": [ + "Whether autocleaning is enabled for failed listforwards." + ] + }, + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done (ever)." ] } + }, + "if": { + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "enabled", + "age", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {}, + "age": { + "type": "u64", + "description": [ + "Age (in seconds) to delete failed listforwards." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {} + } } }, - "then": { - "additionalProperties": false, + "succeededpays": { + "type": "object", + "additionalProperties": true, "required": [ "enabled", - "age", "cleaned" ], "properties": { - "enabled": {}, - "cleaned": {}, - "age": { + "enabled": { + "type": "boolean", + "description": [ + "Whether autocleaning is enabled for successful listpays/listsendpays." + ] + }, + "cleaned": { "type": "u64", - "description": "age (in seconds) to paid listinvoices" + "description": [ + "Total number of deletions done (ever)." + ] + } + }, + "if": { + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "enabled", + "age", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {}, + "age": { + "type": "u64", + "description": [ + "Age (in seconds) to delete successful listpays/listsendpays." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {} } } }, - "else": { - "additionalProperties": false, + "failedpays": { + "type": "object", + "additionalProperties": true, "required": [ "enabled", "cleaned" ], - "properties": { - "enabled": {}, - "cleaned": {} - } - } - }, - "expiredinvoices": { - "type": "object", - "additionalProperties": true, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": { - "type": "boolean", - "description": "whether autocleaning is enabled for expired (unpaid) listinvoices" - }, - "cleaned": { - "type": "u64", - "description": "total number of deletions done (ever)" - } - }, - "if": { "properties": { "enabled": { "type": "boolean", - "enum": [ - true + "description": [ + "Whether autocleaning is enabled for failed listpays/listsendpays." + ] + }, + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done (ever)." ] } + }, + "if": { + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "enabled", + "age", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {}, + "age": { + "type": "u64", + "description": [ + "Age (in seconds) to delete failed listpays/listsendpays." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {} + } } }, - "then": { - "additionalProperties": false, + "paidinvoices": { + "type": "object", + "additionalProperties": true, "required": [ "enabled", - "age", "cleaned" ], "properties": { - "enabled": {}, - "cleaned": {}, - "age": { + "enabled": { + "type": "boolean", + "description": [ + "Whether autocleaning is enabled for paid listinvoices." + ] + }, + "cleaned": { "type": "u64", - "description": "age (in seconds) to expired listinvoices" + "description": [ + "Total number of deletions done (ever)." + ] + } + }, + "if": { + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "enabled", + "age", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {}, + "age": { + "type": "u64", + "description": [ + "Age (in seconds) to paid listinvoices." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {} } } }, - "else": { - "additionalProperties": false, + "expiredinvoices": { + "type": "object", + "additionalProperties": true, "required": [ "enabled", "cleaned" ], "properties": { - "enabled": {}, - "cleaned": {} + "enabled": { + "type": "boolean", + "description": [ + "Whether autocleaning is enabled for expired (unpaid) listinvoices." + ] + }, + "cleaned": { + "type": "u64", + "description": [ + "Total number of deletions done (ever)." + ] + } + }, + "if": { + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "enabled", + "age", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {}, + "age": { + "type": "u64", + "description": [ + "Age (in seconds) to expired listinvoices." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [ + "enabled", + "cleaned" + ], + "properties": { + "enabled": {}, + "cleaned": {} + } } } } } - } - } - }, - "autocleaninvoice.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "expired_by": { - "type": "u64", - "description": "How long an invoice must be expired (seconds) before we delete it." }, - "cycle_seconds": { - "type": "u64", - "description": "The interval (in seconds) between cleaning expired invoices" - } - } - }, - "autocleaninvoice.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": true, - "required": [ - "enabled" - ], - "properties": { - "enabled": { - "type": "boolean", - "description": "whether invoice autocleaning is active" - } + "pre_return_value_notes": [ + "Note that the ages parameters are set by various `autoclean-...-age` parameters in your configuration: see lightningd-config(5)." + ] }, - "if": { - "properties": { - "enabled": { - "type": "boolean", - "enum": [ - true - ] + "example_json_request": [ + { + "id": "example:autoclean-status#1", + "method": "autoclean-status", + "params": { + "subsystem": "expiredinvoices" } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "expired_by", - "cycle_seconds" - ], - "properties": { - "enabled": {}, - "expired_by": { - "type": "u64", - "description": "how long an invoice must be expired (seconds) before we delete it" - }, - "cycle_seconds": { - "type": "u64", - "description": "how long an invoice must be expired (seconds) before we delete it" + }, + { + "id": "example:autoclean-status#2", + "method": "autoclean-status", + "params": { + "subsystem": null } } - }, - "else": { - "additionalProperties": false, - "properties": { - "enabled": {} - } - } - }, - "batching.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "enable" ], - "properties": { - "enable": { - "type": "boolean", - "description": "whether to enable or disable transaction batching. Defaults to *False*" - } - } - }, - "batching.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "properties": {} - }, - "bkpr-channelsapy.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "start_time": { - "type": "u64", - "description": "UNIX timestamp (in seconds) to filter events after the provided timestamp. Defaults to zero" + "example_json_response": [ + { + "autoclean": { + "expiredinvoices": { + "enabled": false, + "cleaned": 0 + } + } }, - "end_time": { - "type": "u64", - "description": "UNIX timestamp (in seconds) to filter events up to and at the provided timestamp. Defaults to max-int" - } - } - }, - "bkpr-channelsapy.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channels_apy" - ], - "properties": { - "channels_apy": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "account", - "routed_out_msat", - "routed_in_msat", - "lease_fee_paid_msat", - "lease_fee_earned_msat", - "pushed_out_msat", - "pushed_in_msat", - "our_start_balance_msat", - "channel_start_balance_msat", - "fees_out_msat", - "utilization_out", - "utilization_in", - "apy_out", - "apy_in", - "apy_total" - ], - "properties": { - "account": { - "type": "string", - "description": "The account name. If the account is a channel, the channel_id. The 'net' entry is the rollup of all channel accounts" - }, - "routed_out_msat": { - "type": "msat", - "description": "Sats routed (outbound)" - }, - "routed_in_msat": { - "type": "msat", - "description": "Sats routed (inbound)" - }, - "lease_fee_paid_msat": { - "type": "msat", - "description": "Sats paid for leasing inbound (liquidity ads)" - }, - "lease_fee_earned_msat": { - "type": "msat", - "description": "Sats earned for leasing outbound (liquidity ads)" - }, - "pushed_out_msat": { - "type": "msat", - "description": "Sats pushed to peer at open" - }, - "pushed_in_msat": { - "type": "msat", - "description": "Sats pushed in from peer at open" - }, - "our_start_balance_msat": { - "type": "msat", - "description": "Starting balance in channel at funding. Note that if our start balance is zero, any _initial field will be omitted (can't divide by zero)" - }, - "channel_start_balance_msat": { - "type": "msat", - "description": "Total starting balance at funding" - }, - "fees_out_msat": { - "type": "msat", - "description": "Fees earned on routed outbound" - }, - "fees_in_msat": { - "type": "msat", - "description": "Fees earned on routed inbound" - }, - "utilization_out": { - "type": "string", - "description": "Sats routed outbound / total start balance" - }, - "utilization_out_initial": { - "type": "string", - "description": "Sats routed outbound / our start balance" - }, - "utilization_in": { - "type": "string", - "description": "Sats routed inbound / total start balance" - }, - "utilization_in_initial": { - "type": "string", - "description": "Sats routed inbound / our start balance" - }, - "apy_out": { - "type": "string", - "description": "Fees earned on outbound routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)" - }, - "apy_out_initial": { - "type": "string", - "description": "Fees earned on outbound routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)" - }, - "apy_in": { - "type": "string", - "description": "Fees earned on inbound routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)" - }, - "apy_in_initial": { - "type": "string", - "description": "Fees earned on inbound routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)" - }, - "apy_total": { - "type": "string", - "description": "Total fees earned on routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)" - }, - "apy_total_initial": { - "type": "string", - "description": "Total fees earned on routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)" - }, - "apy_lease": { - "type": "string", - "description": "Lease fees earned over total amount leased for the lease term, amortized to a year (APY). Only appears if channel was leased out by us" - } + { + "autoclean": { + "succeededforwards": { + "enabled": false, + "cleaned": 0 + }, + "failedforwards": { + "enabled": false, + "cleaned": 0 + }, + "succeededpays": { + "enabled": false, + "cleaned": 0 + }, + "failedpays": { + "enabled": false, + "cleaned": 0 + }, + "paidinvoices": { + "enabled": false, + "cleaned": 0 + }, + "expiredinvoices": { + "enabled": true, + "age": 2, + "cleaned": 0 } } } - } - }, - "bkpr-dumpincomecsv.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "csv_format" ], - "properties": { - "csv_format": { - "type": "string", - "description": "CSV format to use. See RETURN VALUE for options" - }, - "csv_file": { - "type": "string", - "description": "on-disk destination of the generated CSV file" - }, - "consolidate_fees": { - "type": "boolean", - "description": "if true, we emit a single, consolidated event for any onchain-fees for a txid and account. Otherwise, events for every update to the onchain fee calculation for this account and txid will be printed. Defaults to true. Note that this means that the events emitted are non-stable, i.e. calling **dumpincomecsv** twice may result in different onchain fee events being emitted, depending on how much information we've logged for that transaction" - }, - "start_time": { - "type": "u64", - "description": "UNIX timestamp (in seconds) that filters events after the provided timestamp. Defaults to zero" - }, - "end_time": { - "type": "u64", - "description": "UNIX timestamp (in seconds) that filters events up to and at the provided timestamp. Defaults to max-int" - } - } - }, - "bkpr-dumpincomecsv.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "unevaluatedProperties": false, - "required": [ - "csv_file", - "csv_format" - ], - "properties": { - "csv_file": { - "type": "string", - "description": "File that the csv was generated to" - }, - "csv_format": { - "type": "string", - "enum": [ - "cointracker", - "koinly", - "harmony", - "quickbooks" - ], - "description": "Format to print csv as" - } - } - }, - "bkpr-inspect.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "account" + "author": [ + "Rusty Russell <> is mainly responsible." ], - "properties": { - "account": { - "type": "string", - "description": "channel account to inspect" - } - } - }, - "bkpr-inspect.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "txs" + "see_also": [ + "lightningd-config(5)", + "lightning-listinvoices(7)", + "lightning-listpays(7)", + "lightning-listforwards(7)" ], - "properties": { - "txs": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "txid", - "fees_paid_msat", - "outputs" - ], - "properties": { - "txid": { - "type": "txid", - "description": "transaction id" - }, - "blockheight": { - "type": "u32", - "description": "Blockheight of transaction" - }, - "fees_paid_msat": { - "type": "msat", - "description": "Amount paid in sats for this tx" - }, - "outputs": { - "type": "array", - "items": { - "type": "object", - "required": [ - "account", - "outnum", - "output_value_msat", - "currency" - ], - "additionalProperties": false, - "properties": { - "account": { - "type": "string", - "description": "Account this output affected" - }, - "outnum": { - "type": "u32", - "description": "Index of output" - }, - "output_value_msat": { - "type": "msat", - "description": "Value of the output" - }, - "currency": { - "type": "string", - "description": "human-readable bech32 part for this coin type" - }, - "credit_msat": { - "type": "msat", - "description": "Amount credited to account" - }, - "debit_msat": { - "type": "msat", - "description": "Amount debited from account" - }, - "originating_account": { - "type": "string", - "description": "Account this output originated from" - }, - "output_tag": { - "type": "string", - "description": "Description of output creation event" - }, - "spend_tag": { - "type": "string", - "description": "Description of output spend event" - }, - "spending_txid": { - "type": "txid", - "description": "Transaction this output was spent in" - }, - "payment_id": { - "type": "hex", - "description": "lightning payment identifier. For an htlc, this will be the preimage." - } - }, - "allOf": [ - { - "if": { - "required": [ - "credit_msat" - ] - }, - "then": { - "required": [ - "output_tag" - ], - "additionalProperties": false, - "properties": { - "account": {}, - "outnum": {}, - "output_value_msat": {}, - "currency": {}, - "credit_msat": {}, - "originating_account": {}, - "debit_msat": {}, - "output_tag": {}, - "spend_tag": {}, - "spending_txid": {}, - "payment_id": {} - } - } - }, - { - "if": { - "required": [ - "spending_txid" - ] - }, - "then": { - "required": [ - "spend_tag", - "debit_msat" - ], - "additionalProperties": false, - "properties": { - "account": {}, - "outnum": {}, - "output_value_msat": {}, - "currency": {}, - "credit_msat": {}, - "originating_account": {}, - "debit_msat": {}, - "output_tag": {}, - "spend_tag": {}, - "spending_txid": {}, - "payment_id": {} - } - } - } - ] - } - } - } - } - } - } - }, - "bkpr-listaccountevents.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "account": { - "type": "string", - "description": "receive events for the specified account" - } - } + "resources": [ + "Main web site: " + ] }, - "bkpr-listaccountevents.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-autocleaninvoice.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "events" - ], - "properties": { - "events": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "account", - "type", - "tag", - "credit_msat", - "debit_msat", - "currency", - "timestamp" - ], - "properties": { - "account": { - "type": "string", - "description": "The account name. If the account is a channel, the channel_id" - }, - "type": { - "type": "string", - "enum": [ - "onchain_fee", - "chain", - "channel" - ], - "description": "Coin movement type" - }, - "tag": { - "type": "string", - "description": "Description of movement" - }, - "credit_msat": { - "type": "msat", - "description": "Amount credited" - }, - "debit_msat": { - "type": "msat", - "description": "Amount debited" - }, - "currency": { - "type": "string", - "description": "human-readable bech32 part for this coin type" - }, - "timestamp": { - "type": "u32", - "description": "Timestamp this event was recorded by the node. For consolidated events such as onchain_fees, the most recent timestamp" - } - }, - "allOf": [ - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "chain" - ] - } - } - }, - "then": { - "properties": { - "account": {}, - "type": {}, - "tag": {}, - "credit_msat": {}, - "debit_msat": {}, - "currency": {}, - "timestamp": {}, - "outpoint": { - "type": "string", - "description": "The txid:outnum for this event" - }, - "blockheight": { - "type": "u32", - "description": "For chain events, blockheight this occured at" - }, - "origin": { - "type": "string", - "description": "The account this movement originated from" - }, - "payment_id": { - "type": "hex", - "description": "lightning payment identifier. For an htlc, this will be the preimage." - }, - "txid": { - "type": "txid", - "description": "The txid of the transaction that created this event" - }, - "description": { - "type": "string", - "description": "The description of this event" - } - }, - "required": [ - "outpoint", - "blockheight" - ], - "additionalProperties": false - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "onchain_fee" - ] - } - } - }, - "then": { - "properties": { - "account": {}, - "type": {}, - "tag": {}, - "credit_msat": {}, - "debit_msat": {}, - "currency": {}, - "timestamp": {}, - "description": {}, - "txid": { - "type": "txid", - "description": "The txid of the transaction that created this event" - } - }, - "required": [ - "txid" - ], - "additionalProperties": false - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "channel" - ] - } - } - }, - "then": { - "properties": { - "account": {}, - "type": {}, - "tag": {}, - "credit_msat": {}, - "debit_msat": {}, - "currency": {}, - "timestamp": {}, - "description": {}, - "fees_msat": { - "type": "msat", - "description": "Amount paid in fees" - }, - "is_rebalance": { - "type": "boolean", - "description": "Is this payment part of a rebalance" - }, - "payment_id": { - "type": "hex", - "description": "lightning payment identifier. For an htlc, this will be the preimage." - }, - "part_id": { - "type": "u32", - "description": "Counter for multi-part payments" - } - }, - "additionalProperties": false - } - } + "rpc": "setchannel", + "title": "Command for configuring fees / htlc range advertized for a channel", + "description": [], + "request": { + "required": [], + "properties": { + "expired_by": { + "type": "u64", + "description": [ + "How long an invoice must be expired (seconds) before we delete it." + ] + }, + "cycle_seconds": { + "type": "u64", + "description": [ + "The interval (in seconds) between cleaning expired invoices." ] } } - } - }, - "bkpr-listbalances.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": {} - }, - "bkpr-listbalances.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "accounts" - ], - "properties": { - "accounts": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "account", - "balances" - ], - "properties": { - "account": { - "type": "string", - "description": "The account name. If the account is a channel, the channel_id" - }, - "balances": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "balance_msat", - "coin_type" - ], - "properties": { - "balance_msat": { - "type": "msat", - "description": "Current account balance" - }, - "coin_type": { - "type": "string", - "description": "coin type, same as HRP for bech32" - } - } + }, + "response": { + "required": [ + "enabled" + ], + "properties": { + "enabled": { + "type": "boolean", + "description": [ + "Whether invoice autocleaning is active." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true + ] } } }, - "if": { - "required": [ - "peer_id" - ] - }, "then": { + "additionalProperties": false, "required": [ - "account", - "balances", - "peer_id", - "we_opened", - "account_closed", - "account_resolved" + "expired_by", + "cycle_seconds" ], - "additionalProperties": false, "properties": { - "account": {}, - "balances": {}, - "peer_id": { - "type": "pubkey", - "description": "Node id for the peer this account is with" - }, - "we_opened": { - "type": "boolean", - "description": "Did we initiate this account open (open the channel)" - }, - "account_closed": { - "type": "boolean", - "description": "" - }, - "account_resolved": { - "type": "boolean", - "description": "Has this channel been closed and all outputs resolved?" + "enabled": {}, + "expired_by": { + "type": "u64", + "description": [ + "How long an invoice must be expired (seconds) before we delete it." + ] }, - "resolved_at_block": { - "type": "u32", - "description": "Blockheight account resolved on chain" + "cycle_seconds": { + "type": "u64", + "description": [ + "How long an invoice must be expired (seconds) before we delete it." + ] } } }, "else": { + "additionalProperties": false, "properties": { - "account": {}, - "balances": {} - }, - "additionalProperties": false - } - } - } - } - }, - "bkpr-listincome.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "added": "pre-v0.10.1", - "required": [], - "additionalProperties": false, - "properties": { - "consolidate_fees": { - "type": "boolean", - "description": "if true, we emit a single, consolidated event for any onchain-fees for a txid and account. Otherwise, events for every update to the onchain fee calculation for this account and txid will be printed. Defaults to true. Note that this means that the events emitted are non-stable, i.e. calling **listincome** twice may result in different onchain fee events being emitted, depending on how much information we've logged for that transaction" - }, - "start_time": { - "type": "u32", - "description": "UNIX timestamp (in seconds) that filters events after the provided timestamp. Defaults to zero" - }, - "end_time": { - "type": "u32", - "description": "UNIX timestamp (in seconds) that filters events up to and at the provided timestamp. Defaults to max-int" - } - } - }, - "bkpr-listincome.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "income_events" - ], - "properties": { - "income_events": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "account", - "tag", - "credit_msat", - "debit_msat", - "currency", - "timestamp" - ], - "properties": { - "account": { - "type": "string", - "description": "The account name. If the account is a channel, the channel_id" - }, - "tag": { - "type": "string", - "description": "Type of income event" - }, - "credit_msat": { - "type": "msat", - "description": "Amount earned (income)" - }, - "debit_msat": { - "type": "msat", - "description": "Amount spent (expenses)" - }, - "currency": { - "type": "string", - "description": "human-readable bech32 part for this coin type" - }, - "timestamp": { - "type": "u32", - "description": "Timestamp this event was recorded by the node. For consolidated events such as onchain_fees, the most recent timestamp" - }, - "description": { - "type": "string", - "description": "More information about this event. If a `invoice` type, typically the bolt11/bolt12 description" - }, - "outpoint": { - "type": "string", - "description": "The txid:outnum for this event, if applicable" - }, - "txid": { - "type": "txid", - "description": "The txid of the transaction that created this event, if applicable" - }, - "payment_id": { - "type": "hex", - "description": "lightning payment identifier. For an htlc, this will be the preimage." + "enabled": {} } } } - } - } - }, - "blacklistrune.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "added": "v23.08", - "properties": { - "start": { - "type": "u64", - "description": "first rune unique id to blacklist" + ] + }, + "example_json_request": [ + { + "id": "example:autocleaninvoice#1", + "method": "autocleaninvoice", + "params": { + "cycle_seconds": 8, + "expired_by": 2 + } }, - "end": { - "type": "u64", - "description": "final rune unique id to blacklist (defaults to start)" - } - } - }, - "blacklistrune.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "blacklist" - ], - "properties": { - "blacklist": { - "type": "array", - "description": "the resulting blacklist ranges after the command", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "start", - "end" - ], - "properties": { - "start": { - "type": "u64", - "description": "Unique id of first rune in this blacklist range" - }, - "end": { - "type": "u64", - "description": "Unique id of last rune in this blacklist range" - } - } + { + "id": "example:autocleaninvoice#2", + "method": "autocleaninvoice", + "params": { + "cycle_seconds": 1, + "expired_by": 1 } } - } - }, - "check.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": true, - "required": [ - "command_to_check" ], - "properties": { - "command_to_check": { - "type": "string", - "description": "name of the relevant command" - } - } - }, - "check.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "properties": { - "command_to_check": { - "type": "string", - "description": "the *command_to_check* argument" + "example_json_response": [ + { + "enabled": true, + "cycle_seconds": 8, + "expired_by": 2 + }, + { + "enabled": true, + "cycle_seconds": 1, + "expired_by": 1 } - }, - "required": [ - "command_to_check" + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightningd-config(5)", + "lightning-listinvoices(7)" + ], + "resources": [ + "Main web site: " ] }, - "checkmessage.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-batching.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "message", - "zbase" - ], - "properties": { - "message": { - "type": "string", - "description": "Message to be checked against the signature" - }, - "zbase": { - "type": "string", - "description": "The Zbase32 encoded signature to verify" - }, - "pubkey": { - "type": "pubkey", - "description": "The Zbase32 encoded signature to verify" - } - } - }, - "checkmessage.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "verified", - "pubkey" + "rpc": "batching", + "title": "Command to allow database batching.", + "description": [ + "The **batching** RPC command allows (but does not guarantee!) database commitments to be deferred when multiple commands are issued on this RPC connection. This is only useful if many commands are being given at once, in which case it can offer a performance improvement (the cost being that if there is a crash, it's unclear how many of the commands will have been persisted)." ], - "additionalProperties": false, - "properties": { - "verified": { - "type": "boolean", - "enum": [ - true - ], - "description": "whether the signature was valid" - }, - "pubkey": { - "type": "pubkey", - "description": "the *pubkey* parameter, or the pubkey found by looking for known nodes" + "request": { + "required": [ + "enable" + ], + "properties": { + "enable": { + "type": "boolean", + "description": [ + "Whether to enable or disable transaction batching." + ], + "default": "False" + } + } + }, + "response": { + "properties": {} + }, + "example_json_request": [ + { + "id": "example:batching#1", + "method": "batching", + "params": { + "enable": true + } } - } + ], + "example_json_response": [ + {} + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters." + ], + "author": [ + "Rusty Russell <> wrote the initial version of this man page." + ], + "resources": [ + "Main web site: " + ] }, - "checkrune.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-bkpr-channelsapy.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "rune" + "rpc": "bkpr-channelsapy", + "title": "Command to list stats on channel earnings", + "description": [ + "The **bkpr-channelsapy** RPC command lists stats on routing income, leasing income, and various calculated APYs for channel routed funds." ], - "added": "v23.08", - "properties": { - "rune": { - "type": "string", - "description": "rune to check for authorization" - }, - "nodeid": { - "type": "string", - "description": "node id of requesting node *(required until v23.11)*" - }, - "method": { - "type": "string", - "description": "method for which rune needs to be validated *(required until v23.11)*" - }, - "params": { - "oneOf": [ + "request": { + "required": [], + "properties": { + "start_time": { + "type": "u64", + "description": [ + "UNIX timestamp (in seconds) to filter events after the provided timestamp." + ], + "default": "zero" + }, + "end_time": { + "type": "u64", + "description": [ + "UNIX timestamp (in seconds) to filter events up to and at the provided timestamp." + ], + "default": "max-int" + } + } + }, + "response": { + "required": [ + "channels_apy" + ], + "properties": { + "channels_apy": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "account", + "routed_out_msat", + "routed_in_msat", + "lease_fee_paid_msat", + "lease_fee_earned_msat", + "pushed_out_msat", + "pushed_in_msat", + "our_start_balance_msat", + "channel_start_balance_msat", + "fees_out_msat", + "utilization_out", + "utilization_in", + "apy_out", + "apy_in", + "apy_total" + ], + "properties": { + "account": { + "type": "string", + "description": [ + "The account name. If the account is a channel, the channel_id. The 'net' entry is the rollup of all channel accounts." + ] + }, + "routed_out_msat": { + "type": "msat", + "description": [ + "Sats routed (outbound)." + ] + }, + "routed_in_msat": { + "type": "msat", + "description": [ + "Sats routed (inbound)." + ] + }, + "lease_fee_paid_msat": { + "type": "msat", + "description": [ + "Sats paid for leasing inbound (liquidity ads)." + ] + }, + "lease_fee_earned_msat": { + "type": "msat", + "description": [ + "Sats earned for leasing outbound (liquidity ads)." + ] + }, + "pushed_out_msat": { + "type": "msat", + "description": [ + "Sats pushed to peer at open." + ] + }, + "pushed_in_msat": { + "type": "msat", + "description": [ + "Sats pushed in from peer at open." + ] + }, + "our_start_balance_msat": { + "type": "msat", + "description": [ + "Starting balance in channel at funding. Note that if our start balance is zero, any _initial field will be omitted (can't divide by zero)." + ] + }, + "channel_start_balance_msat": { + "type": "msat", + "description": [ + "Total starting balance at funding." + ] + }, + "fees_out_msat": { + "type": "msat", + "description": [ + "Fees earned on routed outbound." + ] + }, + "fees_in_msat": { + "type": "msat", + "description": [ + "Fees earned on routed inbound." + ] + }, + "utilization_out": { + "type": "string", + "description": [ + "Sats routed outbound / total start balance." + ] + }, + "utilization_out_initial": { + "type": "string", + "description": [ + "Sats routed outbound / our start balance." + ] + }, + "utilization_in": { + "type": "string", + "description": [ + "Sats routed inbound / total start balance." + ] + }, + "utilization_in_initial": { + "type": "string", + "description": [ + "Sats routed inbound / our start balance." + ] + }, + "apy_out": { + "type": "string", + "description": [ + "Fees earned on outbound routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)." + ] + }, + "apy_out_initial": { + "type": "string", + "description": [ + "Fees earned on outbound routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)." + ] + }, + "apy_in": { + "type": "string", + "description": [ + "Fees earned on inbound routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)." + ] + }, + "apy_in_initial": { + "type": "string", + "description": [ + "Fees earned on inbound routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)." + ] + }, + "apy_total": { + "type": "string", + "description": [ + "Total fees earned on routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)." + ] + }, + "apy_total_initial": { + "type": "string", + "description": [ + "Total fees earned on routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)." + ] + }, + "apy_lease": { + "type": "string", + "description": [ + "Lease fees earned over total amount leased for the lease term, amortized to a year (APY). Only appears if channel was leased out by us." + ] + } + } + } + } + } + }, + "example_json_request": [ + { + "id": "example:bkpr-channelsapy#1", + "method": "bkpr-channelsapy", + "params": "{}" + } + ], + "example_json_response": [ + { + "channels_apy": [ { - "type": "array", - "description": "array of positional parameters" + "account": "e41b2ec83e9139a9fd8f1d89b01e5d7df73099494e6b91504c39445e37485b0d", + "routed_out_msat": 1431440, + "routed_in_msat": 0, + "lease_fee_paid_msat": 0, + "lease_fee_earned_msat": 0, + "pushed_out_msat": 0, + "pushed_in_msat": 0, + "our_start_balance_msat": 1000000000, + "channel_start_balance_msat": 1000000000, + "fees_out_msat": 0, + "fees_in_msat": 0, + "utilization_out": "0.1431%", + "utilization_out_initial": "0.1431%", + "utilization_in": "0.0000%", + "apy_out": "0.0000%", + "apy_out_initial": "0.0000%", + "apy_in": "0.0000%", + "apy_total": "0.0000%", + "apy_total_initial": "0.0000%" }, { - "type": "object", - "description": "parameters for method" + "account": "net", + "routed_out_msat": 1431440, + "routed_in_msat": 0, + "lease_fee_paid_msat": 0, + "lease_fee_earned_msat": 0, + "pushed_out_msat": 0, + "pushed_in_msat": 0, + "our_start_balance_msat": 1000000000, + "channel_start_balance_msat": 1000000000, + "fees_out_msat": 0, + "fees_in_msat": 0, + "utilization_out": "0.1431%", + "utilization_out_initial": "0.1431%", + "utilization_in": "0.0000%", + "apy_out": "0.0000%", + "apy_out_initial": "0.0000%", + "apy_in": "0.0000%", + "apy_total": "0.0000%", + "apy_total_initial": "0.0000%" } ] } - } - }, - "checkrune.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "valid" ], - "properties": { - "valid": { - "type": "boolean", - "description": "true if the rune is valid" - } - } + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-bkpr-listincome(7)", + "lightning-bkpr-listfunds(7)", + "lightning-bkpr-listaccountevents(7)", + "lightning-bkpr-dumpincomecsv(7)", + "lightning-listpeers(7)" + ], + "resources": [ + "Main web site: " + ] }, - "close.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-bkpr-dumpincomecsv.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "id" + "rpc": "bkpr-dumpincomecsv", + "title": "Command to emit a CSV of income events", + "description": [ + "The **bkpr-dumpincomcsv** RPC command writes a CSV file to disk at *csv_file* location. This is a formatted output of the **listincome** RPC command." ], - "properties": { - "id": { - "type": "string", - "description": "peer id, channel id or short_channel_id. If the given *id* is a peer ID (66 hex digits as a string), then it applies to the active channel of the direct peer corresponding to the given peer ID. If the given *id* is a channel ID (64 hex digits as a string, or the short channel ID *blockheight:txindex:outindex* form), then it applies to that channel" - }, - "unilateraltimeout": { - "type": "u32", - "description": "if it is not zero, the command will unilaterally close the channel when that number of seconds is reached. If *unilateraltimeout* is zero, then the command will wait indefinitely until the peer is online and can negotiate a mutual close. The default is 2 days (172800 seconds)" - }, - "destination": { - "type": "string", - "description": "any Bitcoin bech32 type. If it isn't specified, the default is a Core Lightning wallet address. If the peer hasn't offered the option_shutdown_anysegwit` feature, then taproot addresses (or other v1+ segwit) are not allowed. Tell your friends to upgrade!" - }, - "fee_negotiation_step": { - "type": "string", - "description": "it controls how closing fee negotiation is performed assuming the peer proposes a fee that is different than our estimate. (Note that modern peers use the quick-close protocol which does not allow negotiation: see *feerange* instead)\tOn every negotiation step we must give up some amount from our proposal towards the peer's proposal. This parameter can be an integer in which case it is interpreted as number of satoshis to step at a time. Or it can be an integer followed by `%` to designate a percentage of the interval to give up. A few examples, assuming the peer proposes a closing fee of 3000 satoshi and our estimate shows it must be 4000:\t- `10`: our next proposal will be 4000-10=3990.\t- `10%`: our next proposal will be 4000-(10% of (4000-3000))=3900.\t- '1': our next proposal will be 3999. This is the most extreme case when we insist on our fee as much as possible.\t- `100%`: our next proposal will be 3000. This is the most relaxed case when we quickly accept the peer's proposal.\tThe default is `50%`" - }, - "wrong_funding": { - "type": "outpoint", - "description": "it can only be specified if both sides have offered the `shutdown_wrong_funding` feature (enabled by the **experimental-shutdown-wrong-funding** option): it must be a transaction id followed by a colon then the output number. Instead of negotiating a shutdown to spend the expected funding transaction, the shutdown transaction will spend this output instead. This is only allowed if this peer opened the channel and the channel is unused: it can rescue openings which have been manually miscreated" - }, - "force_lease_closed": { - "type": "boolean", - "description": "if the channel has funds leased to the peer (option_will_fund), we prevent initiation of a mutual close unless this flag is passed in. Defaults to false" - }, - "feerange": { - "type": "array", - "items": { - "type": "feerate" - }, - "description": "an optional array [ *min*, *max* ], indicating the minimum and maximum feerates to offer: the peer will obey these if it supports the quick-close protocol. *slow* and *unilateral_close* are the defaults.\tNote that the maximum fee will be capped at the final commitment transaction fee (unless the experimental anchor-outputs option is negotiated)" - } - } - }, - "close.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "mutual", - "unilateral", - "unopened" - ], - "description": "Whether we successfully negotiated a mutual close, closed without them, or discarded not-yet-opened channel" - } - }, - "if": { + "request": { + "required": [ + "csv_format" + ], "properties": { - "type": { + "csv_format": { "type": "string", - "enum": [ - "mutual", - "unilateral" + "description": [ + "CSV format to use. See RETURN VALUE for options." + ] + }, + "csv_file": { + "type": "string", + "description": [ + "On-disk destination of the generated CSV file." ] + }, + "consolidate_fees": { + "type": "boolean", + "description": [ + "If true, we emit a single, consolidated event for any onchain-fees for a txid and account. Otherwise, events for every update to the onchain fee calculation for this account and txid will be printed. Note that this means that the events emitted are non-stable, i.e. calling **dumpincomecsv** twice may result in different onchain fee events being emitted, depending on how much information we've logged for that transaction." + ], + "default": "True" + }, + "start_time": { + "type": "u64", + "description": [ + "UNIX timestamp (in seconds) that filters events after the provided timestamp." + ], + "default": "zero" + }, + "end_time": { + "type": "u64", + "description": [ + "UNIX timestamp (in seconds) that filters events up to and at the provided timestamp." + ], + "default": "max-int" } } }, - "then": { - "additionalProperties": false, + "response": { "required": [ - "tx", - "txid" + "csv_file", + "csv_format" ], "properties": { - "type": {}, - "tx": { - "type": "hex", - "description": "the raw bitcoin transaction used to close the channel (if it was open)" + "csv_file": { + "type": "string", + "description": [ + "File that the csv was generated to." + ] }, - "txid": { - "type": "txid", - "description": "the transaction id of the *tx* field" + "csv_format": { + "type": "string", + "enum": [ + "cointracker", + "koinly", + "harmony", + "quickbooks" + ], + "description": [ + "Format to print csv as." + ] } } }, - "else": { - "additionalProperties": false, - "properties": { - "type": {} + "example_json_request": [ + { + "id": "example:bkpr-dumpincomecsv#1", + "method": "bkpr-dumpincomecsv", + "params": [ + "koinly", + "koinly.csv" + ] } - } - }, - "commando-blacklist.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "added": "v23.05", - "deprecated": [ - "v23.08", - "v24.08" ], - "properties": { - "start": { - "type": "u64", - "description": "first rune unique id to blacklist" - }, - "end": { - "type": "u64", - "description": "final rune unique id to blacklist (defaults to start)" - } - } - }, - "commando-blacklist.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "blacklist" - ], - "properties": { - "blacklist": { - "type": "array", - "description": "the resulting blacklist ranges after the command", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "start", - "end" - ], - "properties": { - "start": { - "type": "u64", - "description": "Unique id of first rune in this blacklist range" - }, - "end": { - "type": "u64", - "description": "Unique id of last rune in this blacklist range" - } - } - } + "example_json_response": [ + { + "csv_file": "koinly.csv", + "csv_format": "koinly" } - } - }, - "commando-listrunes.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "added": "v23.05", - "deprecated": [ - "v23.08", - "v24.05" ], - "properties": { - "rune": { - "type": "string", - "description": "optional rune to list" - } - } + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-bkpr-listincome(7)", + "lightning-bkpr-listfunds(7)", + "lightning-bkpr-listaccountevents(7)", + "lightning-bkpr-channelsapy(7)", + "lightning-listpeers(7)" + ], + "resources": [ + "Main web site: " + ] }, - "commando-listrunes.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-bkpr-inspect.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "runes" + "rpc": "bkpr-inspect", + "title": "Command to show onchain footprint of a channel", + "description": [ + "The **bkpr-inspect** RPC command lists all known on-chain transactions and associated events for the provided account. Useful for inspecting unilateral closes for a given channel account. Only valid for channel accounts." ], - "properties": { - "runes": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "rune", - "unique_id", - "restrictions", - "restrictions_as_english" - ], - "properties": { - "rune": { - "type": "string", - "description": "Base64 encoded rune" - }, - "unique_id": { - "type": "string", - "description": "Unique id assigned when the rune was generated; this is always a u64 for commando runes" - }, - "restrictions": { - "type": "array", - "description": "The restrictions on what commands this rune can authorize", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "alternatives", - "english" - ], - "properties": { - "alternatives": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "fieldname", - "value", - "condition", - "english" - ], - "properties": { - "fieldname": { - "type": "string", - "description": "The field this restriction applies to; see commando-rune(7)" - }, - "value": { - "type": "string", - "description": "The value accepted for this field" - }, - "condition": { - "type": "string", - "description": "The way to compare fieldname and value" - }, - "english": { - "type": "string", - "description": "English readable description of this alternative" - } - } - } - }, - "english": { - "type": "string", - "description": "English readable summary of alternatives above" - } - } - } - }, - "restrictions_as_english": { - "type": "string", - "description": "English readable description of the restrictions array above" - }, - "stored": { - "type": "boolean", - "enum": [ - false - ], - "description": "This is false if the rune does not appear in our datastore (only possible when `rune` is specified)" - }, - "blacklisted": { - "type": "boolean", - "enum": [ - true - ], - "description": "The rune has been blacklisted; see commando-blacklist(7)" - }, - "last_used": { - "type": "number", - "description": "The last time this rune was successfully used", - "added": "23.11" - }, - "our_rune": { - "type": "boolean", - "enum": [ - false - ], - "description": "This is not a rune for this node (only possible when `rune` is specified)" - } - } + "request": { + "required": [ + "account" + ], + "properties": { + "account": { + "type": "string", + "description": [ + "Channel account to inspect." + ] } } - } - }, - "commando-rune.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "deprecated": [ - "v23.08", - "v23.05" - ], - "properties": { - "rune": { - "type": "string", - "description": "optional rune to add to" - }, - "restrictions": { - "oneOf": [ - { - "type": "array", - "description": "array of restrictions to add to rune", - "items": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "type": "string", - "enum": [ - "readonly" - ], - "description": "readonly string to indicate standard readonly restrictions" - } - ] - } - } - }, - "commando-rune.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "rune", - "unique_id" - ], - "properties": { - "rune": { - "type": "string", - "description": "the resulting rune" - }, - "unique_id": { - "type": "string", - "description": "the id of this rune: this is set at creation and cannot be changed (even as restrictions are added)" - }, - "warning_unrestricted_rune": { - "type": "string", - "description": "A warning shown when runes are created with powers that could drain your node" - } - } - }, - "commando.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "peer_id", - "method" - ], - "properties": { - "peer_id": { - "type": "pubkey", - "description": "peer to command" - }, - "method": { - "type": "string", - "description": "method to invoke on peer" - }, - "params": { - "oneOf": [ - { - "type": "array", - "description": "array of positional parameters" - }, - { + }, + "response": { + "required": [ + "txs" + ], + "properties": { + "txs": { + "type": "array", + "items": { "type": "object", - "description": "parameters for method" - } - ] - }, - "rune": { - "type": "string", - "description": "rune to authorize the command" - }, - "filter": { - "type": "object", - "additionalProperties": true, - "description": "filter to peer to apply to any successful result" - } - } - }, - "commando.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": true, - "required": [], - "properties": { - "any": { - "description": "the return depends on the *method* invoked" - } - } - }, - "connect.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string", - "description": "the target node's public key. As a convenience, *id* may be of the form *id@host* or *id@host:port*. In this case, the *host* and *port* parameters must be omitted. This can fail if your C-lightning node is a fresh install that has not connected to any peers yet (your node has no gossip yet), or if the target *id* is a fresh install that has no channels yet (nobody will gossip about a node until it has one published channel)" - }, - "host": { - "type": "string", - "description": "the peer's hostname or IP address.\tIf *host* is not specified (or doesn't work), the connection will be attempted to an IP belonging to *id* obtained through gossip with other already connected peers.\tIf *host* begins with a `/` it is interpreted as a local path and the connection will be made to that local socket (see **bind-addr** in lightningd-config(5))" - }, - "port": { - "type": "u16", - "description": "the peer's port number. If not specified, the *port* depends on the current network:\t- bitcoin **mainnet**: 9735.\t- bitcoin **testnet**: 19735.\t- bitcoin **signet**: 39735.\t- bitcoin **regtest**: 19846" - } - } - }, - "connect.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "features", - "direction", - "address" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "the peer we connected to" - }, - "features": { - "type": "hex", - "description": "BOLT 9 features bitmap offered by peer" - }, - "direction": { - "type": "string", - "enum": [ - "in", - "out" - ], - "description": "Whether they initiated connection or we did" - }, - "address": { - "type": "object", - "description": "Address information (mainly useful if **direction** is *out*)", - "additionalProperties": true, - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "local socket", - "ipv4", - "ipv6", - "torv2", - "torv3" + "additionalProperties": false, + "required": [ + "txid", + "fees_paid_msat", + "outputs" ], - "description": "Type of connection (*torv2*/*torv3* only if **direction** is *out*)" - } - }, - "allOf": [ - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "local socket" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "socket" - ], - "properties": { - "type": {}, - "socket": { - "type": "string", - "description": "socket filename" - } - } - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "ipv4", - "ipv6", - "torv2", - "torv3" + "properties": { + "txid": { + "type": "txid", + "description": [ + "Transaction id." + ] + }, + "blockheight": { + "type": "u32", + "description": [ + "Blockheight of transaction." + ] + }, + "fees_paid_msat": { + "type": "msat", + "description": [ + "Amount paid in sats for this tx." + ] + }, + "outputs": { + "type": "array", + "items": { + "type": "object", + "required": [ + "account", + "outnum", + "output_value_msat", + "currency" + ], + "additionalProperties": false, + "properties": { + "account": { + "type": "string", + "description": [ + "Account this output affected." + ] + }, + "outnum": { + "type": "u32", + "description": [ + "Index of output." + ] + }, + "output_value_msat": { + "type": "msat", + "description": [ + "Value of the output." + ] + }, + "currency": { + "type": "string", + "description": [ + "Human-readable bech32 part for this coin type." + ] + }, + "credit_msat": { + "type": "msat", + "description": [ + "Amount credited to account." + ] + }, + "debit_msat": { + "type": "msat", + "description": [ + "Amount debited from account." + ] + }, + "originating_account": { + "type": "string", + "description": [ + "Account this output originated from." + ] + }, + "output_tag": { + "type": "string", + "description": [ + "Description of output creation event." + ] + }, + "spend_tag": { + "type": "string", + "description": [ + "Description of output spend event." + ] + }, + "spending_txid": { + "type": "txid", + "description": [ + "Transaction this output was spent in." + ] + }, + "payment_id": { + "type": "hex", + "description": [ + "Lightning payment identifier. For an htlc, this will be the preimage." + ] + } + }, + "allOf": [ + { + "if": { + "required": [ + "credit_msat" + ] + }, + "then": { + "required": [ + "output_tag" + ], + "additionalProperties": false, + "properties": { + "account": {}, + "outnum": {}, + "output_value_msat": {}, + "currency": {}, + "credit_msat": {}, + "originating_account": {}, + "debit_msat": {}, + "output_tag": {}, + "spend_tag": {}, + "spending_txid": {}, + "payment_id": {} + } + } + }, + { + "if": { + "required": [ + "spending_txid" + ] + }, + "then": { + "required": [ + "spend_tag", + "debit_msat" + ], + "additionalProperties": false, + "properties": { + "account": {}, + "outnum": {}, + "output_value_msat": {}, + "currency": {}, + "credit_msat": {}, + "originating_account": {}, + "debit_msat": {}, + "output_tag": {}, + "spend_tag": {}, + "spending_txid": {}, + "payment_id": {} + } + } + } ] } } - }, - "then": { - "additionalProperties": false, - "required": [ - "address", - "port" - ], - "properties": { - "type": {}, - "address": { - "type": "string", - "description": "address in expected format for **type**" - }, - "port": { - "type": "u16", - "description": "port number" - } - } - } - } - ] - } - } - }, - "createinvoice.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "invstring", - "label", - "preimage" - ], - "properties": { - "invstring": { - "type": "string", - "description": "" - }, - "label": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ], - "description": "a unique string or number (which is treated as a string, so `01` is different from `1`); it is never revealed to other nodes on the lightning network, but it can be used to query the status of this invoice" - }, - "preimage": { - "type": "hex", - "description": "" - } - } - }, - "createinvoice.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "label", - "created_index", - "payment_hash", - "status", - "description", - "expires_at" - ], - "properties": { - "label": { - "type": "string", - "description": "the label for the invoice" - }, - "bolt11": { - "type": "string", - "description": "the bolt11 string (always present unless **bolt12** is)" - }, - "bolt12": { - "type": "string", - "description": "the bolt12 string instead of **bolt11** (**experimental-offers** only)" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "amount_msat": { - "type": "msat", - "description": "The amount of the invoice (if it has one)" - }, - "status": { - "type": "string", - "enum": [ - "paid", - "expired", - "unpaid" - ], - "description": "Whether it has been paid, or can no longer be paid" - }, - "description": { - "type": "string", - "description": "Description extracted from **bolt11** or **bolt12**" - }, - "expires_at": { - "type": "u64", - "description": "UNIX timestamp of when invoice expires (or expired)" - }, - "created_index": { - "type": "u64", - "added": "v23.08", - "description": "1-based index indicating order this invoice was created in" - }, - "pay_index": { - "type": "u64", - "description": "Incrementing id for when this was paid (**status** *paid* only)" - }, - "amount_received_msat": { - "type": "msat", - "description": "Amount actually received (**status** *paid* only)" - }, - "paid_at": { - "type": "u64", - "description": "UNIX timestamp of when invoice was paid (**status** *paid* only)" - }, - "paid_outpoint": { - "type": "object", - "description": "Outpoint this invoice was paid with (**status** *paid* only)", - "added": "v23.11", - "additionalProperties": false, - "required": [ - "txid", - "outnum" - ], - "properties": { - "txid": { - "added": "v23.11", - "type": "txid", - "description": "ID of the transaction that paid the invoice (**status** *paid* only)" - }, - "outnum": { - "added": "v23.11", - "type": "u32", - "description": "The 0-based output number of the transaction that paid the invoice (**status** *paid* only)" - } - } - }, - "payment_preimage": { - "type": "secret", - "description": "the proof of payment: SHA256 of this **payment_hash**" - }, - "local_offer_id": { - "type": "hex", - "description": "the *id* of our offer which created this invoice (**experimental-offers** only).", - "maxLength": 64, - "minLength": 64 - }, - "invreq_payer_note": { - "type": "string", - "description": "the optional *invreq_payer_note* from invoice_request which created this invoice (**experimental-offers** only)." - } - } - }, - "createonion.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "hops", - "assocdata" - ], - "properties": { - "hops": { - "type": "array", - "description": "a JSON list of dicts, each specifying a node and the payload destined for that node", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "pubkey", - "payload" - ], - "properties": { - "pubkey": { - "type": "pubkey", - "description": "node pubkey" - }, - "payload": { - "type": "hex", - "description": "payload to be sent to the node" } } } - }, - "assocdata": { - "type": "hex", - "description": "the associated data that the onion should commit to. If the onion is to be used to send a payment later it MUST match the `payment_hash` of the payment in order to be valid" - }, - "session_key": { - "type": "secret", - "description": "can be used to specify a secret that is used to generate the shared secrets used to encrypt the onion for each hop. It should only be used for testing or if a specific shared secret is important. If not specified it will be securely generated internally, and the shared secrets will be returned" - }, - "onion_size": { - "type": "u16", - "description": "a size different from the default payment onion (1300 bytes). May be used for custom protocols like trampoline routing" - } - } - }, - "createonion.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "onion", - "shared_secrets" - ], - "properties": { - "onion": { - "type": "hex", - "description": "the onion packet (*onion_size* bytes)" - }, - "shared_secrets": { - "type": "array", - "description": "one shared secret for each node in the *hops* parameter", - "items": { - "type": "secret", - "description": "the shared secret with this hop" - } } - } - }, - "createrune.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "added": "v23.08", - "properties": { - "rune": { - "type": "string", - "description": "optional rune to add to" - }, - "restrictions": { - "oneOf": [ - { - "type": "array", - "description": "array of restrictions to add to rune", - "items": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "type": "string", - "enum": [ - "readonly" - ], - "description": "readonly string to indicate standard readonly restrictions" - } + }, + "example_json_request": [ + { + "id": "example:bkpr-inspect#1", + "method": "bkpr-inspect", + "params": [ + "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab" ] } - } - }, - "createrune.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "rune", - "unique_id" - ], - "properties": { - "rune": { - "type": "string", - "description": "the resulting rune" - }, - "unique_id": { - "type": "string", - "description": "the id of this rune: this is set at creation and cannot be changed (even as restrictions are added)" - }, - "warning_unrestricted_rune": { - "type": "string", - "description": "A warning shown when runes are created with powers that could drain your node" - } - } - }, - "datastore.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "key" ], - "properties": { - "key": { - "description": "a key can either have children or a value, never both: parents are created and removed automatically", - "oneOf": [ - { - "type": "array", - "description": "an array of values to form a hierarchy (though a single value is treated as a one-element array). Using the first element of the key as the plugin name (e.g. `[ 'summary' ]`) is recommended", - "items": { - "type": "string" - } - }, + "example_json_response": [ + { + "txs": [ { - "type": "string" + "txid": "abb283035e569c190696d42a1208bb38ddc64b6377e88f2d6277c01eab7b0af3", + "fees_paid_msat": 0, + "outputs": [ + { + "account": "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab", + "outnum": 0, + "output_tag": "channel_proposed", + "output_value_msat": 996363000, + "credit_msat": 996363000, + "currency": "bcrt" + } + ] } ] - }, - "string": { - "type": "string", - "description": "data to be saved in string format" - }, - "hex": { - "type": "hex", - "description": "data to be saved in hex format" - }, - "mode": { - "type": "string", - "description": "\t- `must-create`: fails if it already exists.\t- `must-replace`: fails if it doesn't already exist.\t- `create-or-replace`: never fails.\t- `must-append`: must already exist, append this to what's already there.\t- `create-or-append`: append if anything is there, otherwise create.\tDefault is `must-create`", - "enum": [ - "must-create", - "must-replace", - "create-or-replace", - "must-append", - "create-or-append" - ] - }, - "generation": { - "type": "u64", - "description": "if specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with *mode* `must-replace` or `must-append`" } - } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-listbalances(7)", + "lightning-listfunds(7)", + "lightning-listpeers(7)" + ], + "resources": [ + "Main web site: " + ] }, - "datastore.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-bkpr-listaccountevents.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "key" + "rpc": "bkpr-listaccountevents", + "title": "Command for listing recorded bookkeeping events", + "description": [ + "The **bkpr-listaccountevents** RPC command is a list of all bookkeeping events that have been recorded for this node.", + "", + "If the optional parameter **account** is set, we only emit events for the specified account, if exists.", + "", + "Note that the type **onchain_fees** that are emitted are of opposite credit/debit than as they appear in **listincome**, as **listincome** shows all events from the perspective of the node, whereas **listaccountevents** just dumps the event data as we've got it. Onchain fees are updated/recorded as we get more information about input and output spends -- the total onchain fees that were recorded for a transaction for an account can be found by summing all onchain fee events and taking the difference between the **credit_msat** and **debit_msat** for these events. We do this so that successive calls to **listaccountevents** always produce the same list of events -- no previously emitted event will be subsequently updated, rather we add a new event to the list." ], - "properties": { - "key": { - "type": "array", - "items": { + "request": { + "required": [], + "properties": { + "account": { "type": "string", - "description": "Part of the key added to the datastore" - } - }, - "generation": { - "type": "u64", - "description": "The number of times this has been updated" - }, - "hex": { - "type": "hex", - "description": "The hex data which has been added to the datastore" - }, - "string": { - "type": "string", - "description": "The data as a string, if it's valid utf-8" - } - } - }, - "datastoreusage.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "added": "v23.11", - "properties": { - "key": { - "oneOf": [ - { - "type": "array", - "description": "key is an array of values (though a single value is treated as a one-element array). Used as the starting point to traverse the datastore", - "items": { - "type": "string" - } - }, - { - "type": "string" - } - ] - } - } - }, - "datastoreusage.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "datastoreusage" - ], - "properties": { - "datastoreusage": { - "type": "object", - "additionalProperties": false, - "required": [ - "key", - "total_bytes" - ], - "properties": { - "key": { - "type": "string", - "description": "The key from which the database was traversed." - }, - "total_bytes": { - "type": "u64", - "description": "The total bytes that are stored under the *key*, including the all descendants data and the size of the keys themselves." - } + "description": [ + "Receive events for the specified account." + ] } } - } - }, - "decode.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "added": "v23.05", - "required": [ - "string" - ], - "properties": { - "string": { - "type": "string", - "description": "value to be decoded\t- a *bolt11* or *bolt12* string (optionally prefixed by `lightning:` or `LIGHTNING:`) as specified by the BOLT 11 and BOLT 12 specifications.\t- a *rune* as created by lightning-commando-rune(7).\t- an *emergency_recover* string generated by hsmtool like `lightning-hsmtool getemergencyrecover `. It holds `emergency.recover` contents and starts with `clnemerg1`" - } - } - }, - "decode.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "type", - "valid" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 offer", - "bolt12 invoice", - "bolt12 invoice_request", - "bolt11 invoice", - "rune", - "emergency recover" - ], - "description": "what kind of object it decoded to" - }, - "valid": { - "type": "boolean", - "description": "if this is false, you *MUST* not use the result except for diagnostics!" - } }, - "allOf": [ - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 offer" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "required": [ - "offer_id", - "offer_node_id", - "offer_description" - ], - "additionalProperties": false, - "properties": { - "type": {}, - "valid": {}, - "offer_id": { - "type": "hex", - "description": "the id we use to identify this offer", - "maxLength": 64, - "minLength": 64 - }, - "offer_chains": { - "type": "array", - "description": "which blockchains this offer is for (missing implies bitcoin mainnet only)", - "items": { - "type": "hash", - "description": "the genesis blockhash" - } - }, - "offer_metadata": { - "type": "hex", - "description": "any metadata the creater of the offer includes" - }, - "offer_currency": { - "type": "string", - "description": "ISO 4217 code of the currency (missing implies Bitcoin)", - "maxLength": 3, - "minLength": 3 - }, - "warning_unknown_offer_currency": { - "type": "string", - "description": "The currency code is unknown (so no `currency_minor_unit`)" - }, - "currency_minor_unit": { - "type": "u32", - "description": "the number of decimal places to apply to amount (if currency known)" - }, - "offer_amount": { - "type": "u64", - "description": "the amount in the `offer_currency` adjusted by `currency_minor_unit`, if any" - }, - "offer_amount_msat": { - "type": "msat", - "description": "the amount in bitcoin (if specified, and no `offer_currency`)" - }, - "offer_description": { - "type": "string", - "description": "the description of the purpose of the offer" - }, - "offer_issuer": { - "type": "string", - "description": "the description of the creator of the offer" - }, - "offer_features": { - "type": "hex", - "description": "the feature bits of the offer" - }, - "offer_absolute_expiry": { - "type": "u64", - "description": "UNIX timestamp of when this offer expires" - }, - "offer_quantity_max": { - "type": "u64", - "description": "the maximum quantity (or, if 0, means any quantity)" - }, - "offer_paths": { - "type": "array", - "description": "Paths to the destination", - "items": { - "type": "object", - "required": [ - "first_node_id", - "blinding", - "path" + "response": { + "required": [ + "events" + ], + "properties": { + "events": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "account", + "type", + "tag", + "credit_msat", + "debit_msat", + "currency", + "timestamp" + ], + "properties": { + "account": { + "type": "string", + "description": [ + "The account name. If the account is a channel, the channel_id." + ] + }, + "type": { + "type": "string", + "enum": [ + "onchain_fee", + "chain", + "channel" ], - "additionalProperties": false, - "properties": { - "first_node_id": { - "type": "pubkey", - "description": "the (presumably well-known) public key of the start of the path" - }, - "blinding": { - "type": "pubkey", - "description": "blinding factor for this path" - }, - "path": { - "type": "array", - "description": "an individual path", - "items": { - "type": "object", - "required": [ - "blinded_node_id", - "encrypted_recipient_data" - ], - "additionalProperties": false, - "properties": { - "blinded_node_id": { - "type": "pubkey", - "description": "node_id of the hop" - }, - "encrypted_recipient_data": { - "type": "hex", - "description": "encrypted TLV entry for this hop" - } - } - } - } - } + "description": [ + "Coin movement type." + ] + }, + "tag": { + "type": "string", + "description": [ + "Description of movement." + ] + }, + "credit_msat": { + "type": "msat", + "description": [ + "Amount credited." + ] + }, + "debit_msat": { + "type": "msat", + "description": [ + "Amount debited." + ] + }, + "currency": { + "type": "string", + "description": [ + "Human-readable bech32 part for this coin type." + ] + }, + "timestamp": { + "type": "u32", + "description": [ + "Timestamp this event was recorded by the node. For consolidated events such as onchain_fees, the most recent timestamp." + ] } }, - "offer_node_id": { - "type": "pubkey", - "description": "public key of the offering node" - }, - "offer_recurrence": { - "type": "object", - "description": "how often to this offer should be used", - "required": [ - "period", - "time_unit" - ], - "additionalProperties": false, - "properties": { - "time_unit": { - "type": "u32", - "description": "the BOLT12 time unit" - }, - "time_unit_name": { - "type": "string", - "description": "the name of `time_unit` (if valid)" - }, - "period": { - "type": "u32", - "description": "how many `time_unit` per payment period" - }, - "basetime": { - "type": "u64", - "description": "period starts at this UNIX timestamp" - }, - "start_any_period": { - "type": "boolean", - "description": "you can start at any period (only if `basetime` present)" - }, - "limit": { - "type": "u32", - "description": "maximum period number for recurrence" + "allOf": [ + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "chain" + ] + } + } }, - "paywindow": { - "type": "object", - "description": "when within a period will payment be accepted (default is prior and during the period)", - "required": [ - "seconds_before", - "seconds_after" - ], - "additionalProperties": false, + "then": { "properties": { - "seconds_before": { - "type": "u32", - "description": "seconds prior to period start" + "account": {}, + "type": {}, + "tag": {}, + "credit_msat": {}, + "debit_msat": {}, + "currency": {}, + "timestamp": {}, + "outpoint": { + "type": "string", + "description": [ + "The txid:outnum for this event." + ] }, - "seconds_after": { + "blockheight": { "type": "u32", - "description": "seconds after to period start" + "description": [ + "For chain events, blockheight this occured at." + ] }, - "proportional_amount": { - "type": "boolean", - "enum": [ - true - ], - "description": "amount should be scaled if payed after period start" + "origin": { + "type": "string", + "description": [ + "The account this movement originated from." + ] + }, + "payment_id": { + "type": "hex", + "description": [ + "Lightning payment identifier. For an htlc, this will be the preimage." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The txid of the transaction that created this event." + ] + }, + "description": { + "type": "string", + "description": [ + "The description of this event." + ] } - } - } - } - }, - "unknown_offer_tlvs": { - "type": "array", - "description": "Any extra fields we didn't know how to parse", - "items": { - "type": "object", - "required": [ - "type", - "length", - "value" - ], - "additionalProperties": false, - "properties": { - "type": { - "type": "u64", - "description": "The type" - }, - "length": { - "type": "u64", - "description": "The length" }, - "value": { - "type": "hex", - "description": "The value" - } + "required": [ + "outpoint", + "blockheight" + ], + "additionalProperties": false } - } - } - } - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 offer" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - false - ] - } - } - }, - "then": { - "required": [], - "additionalProperties": false, - "properties": { - "type": {}, - "valid": {}, - "offer_id": {}, - "node_id": {}, - "signature": {}, - "chains": {}, - "currency": {}, - "minor_unit": {}, - "warning_unknown_offer_currency": {}, - "amount": {}, - "amount_msat": {}, - "send_invoice": {}, - "description": {}, - "vendor": {}, - "features": {}, - "absolute_expiry": {}, - "paths": {}, - "quantity_max": {}, - "unknown_offer_tlvs": {}, - "recurrence": {}, - "warning_missing_offer_node_id": { - "type": "string", - "description": "`offer_node_id` is not present" - }, - "warning_invalid_offer_description": { - "type": "string", - "description": "`offer_description` is not valid UTF8" - }, - "warning_missing_offer_description": { - "type": "string", - "description": "`offer_description` is not present" - }, - "warning_invalid_offer_currency": { - "type": "string", - "description": "`offer_currency_code` is not valid UTF8" - }, - "warning_invalid_offer_issuer": { - "type": "string", - "description": "`offer_issuer` is not valid UTF8" - } - } - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 invoice_request" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "required": [ - "offer_node_id", - "offer_description", - "invreq_metadata", - "invreq_payer_id", - "signature" - ], - "additionalProperties": false, - "properties": { - "type": {}, - "valid": {}, - "offer_id": { - "type": "hex", - "description": "the id we use to identify this offer", - "maxLength": 64, - "minLength": 64 - }, - "offer_chains": { - "type": "array", - "description": "which blockchains this offer is for (missing implies bitcoin mainnet only)", - "items": { - "type": "hex", - "description": "the genesis blockhash", - "maxLength": 64, - "minLength": 64 - } - }, - "offer_metadata": { - "type": "hex", - "description": "any metadata the creator of the offer includes" - }, - "offer_currency": { - "type": "string", - "description": "ISO 4217 code of the currency (missing implies Bitcoin)", - "maxLength": 3, - "minLength": 3 - }, - "warning_unknown_offer_currency": { - "type": "string", - "description": "The currency code is unknown (so no `currency_minor_unit`)" - }, - "currency_minor_unit": { - "type": "u32", - "description": "the number of decimal places to apply to amount (if currency known)" - }, - "offer_amount": { - "type": "u64", - "description": "the amount in the `offer_currency` adjusted by `currency_minor_unit`, if any" - }, - "offer_amount_msat": { - "type": "msat", - "description": "the amount in bitcoin (if specified, and no `offer_currency`)" - }, - "offer_description": { - "type": "string", - "description": "the description of the purpose of the offer" - }, - "offer_issuer": { - "type": "string", - "description": "the description of the creator of the offer" - }, - "offer_features": { - "type": "hex", - "description": "the feature bits of the offer" - }, - "offer_absolute_expiry": { - "type": "u64", - "description": "UNIX timestamp of when this offer expires" - }, - "offer_quantity_max": { - "type": "u64", - "description": "the maximum quantity (or, if 0, means any quantity)" - }, - "offer_paths": { - "type": "array", - "description": "Paths to the destination", - "items": { - "type": "object", - "required": [ - "first_node_id", - "blinding", - "path" - ], - "additionalProperties": false, - "properties": { - "first_node_id": { - "type": "pubkey", - "description": "the (presumably well-known) public key of the start of the path" - }, - "blinding": { - "type": "pubkey", - "description": "blinding factor for this path" - }, - "path": { - "type": "array", - "description": "an individual path", - "items": { - "type": "object", - "required": [ - "blinded_node_id", - "encrypted_recipient_data" - ], - "additionalProperties": false, - "properties": { - "blinded_node_id": { - "type": "pubkey", - "description": "node_id of the hop" - }, - "encrypted_recipient_data": { - "type": "hex", - "description": "encrypted TLV entry for this hop" - } - } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "onchain_fee" + ] } } - } - } - }, - "offer_node_id": { - "type": "pubkey", - "description": "public key of the offering node" - }, - "offer_recurrence": { - "type": "object", - "description": "how often to this offer should be used", - "required": [ - "period", - "time_unit" - ], - "additionalProperties": false, - "properties": { - "time_unit": { - "type": "u32", - "description": "the BOLT12 time unit" - }, - "time_unit_name": { - "type": "string", - "description": "the name of `time_unit` (if valid)" - }, - "period": { - "type": "u32", - "description": "how many `time_unit` per payment period" }, - "basetime": { - "type": "u64", - "description": "period starts at this UNIX timestamp" - }, - "start_any_period": { - "type": "boolean", - "description": "you can start at any period (only if `basetime` present)" - }, - "limit": { - "type": "u32", - "description": "maximum period number for recurrence" - }, - "paywindow": { - "type": "object", - "description": "when within a period will payment be accepted (default is prior and during the period)", + "then": { + "properties": { + "account": {}, + "type": {}, + "tag": {}, + "credit_msat": {}, + "debit_msat": {}, + "currency": {}, + "timestamp": {}, + "description": {}, + "txid": { + "type": "txid", + "description": [ + "The txid of the transaction that created this event." + ] + } + }, "required": [ - "seconds_before", - "seconds_after" + "txid" ], - "additionalProperties": false, + "additionalProperties": false + } + }, + { + "if": { "properties": { - "seconds_before": { - "type": "u32", - "description": "seconds prior to period start" - }, - "seconds_after": { - "type": "u32", - "description": "seconds after to period start" - }, - "proportional_amount": { - "type": "boolean", + "type": { + "type": "string", "enum": [ - true - ], - "description": "amount should be scaled if payed after period start" + "channel" + ] } } - } - } - }, - "invreq_metadata": { - "type": "hex", - "description": "the payer-provided blob to derive invreq_payer_id" - }, - "invreq_payer_id": { - "type": "hex", - "description": "the payer-provided key" - }, - "invreq_chain": { - "type": "hex", - "description": "which blockchain this offer is for (missing implies bitcoin mainnet only)", - "maxLength": 64, - "minLength": 64 - }, - "invreq_amount_msat": { - "type": "msat", - "description": "the amount the invoice should be for" - }, - "invreq_features": { - "type": "hex", - "description": "the feature bits of the invoice_request" - }, - "invreq_quantity": { - "type": "u64", - "description": "the number of items to invoice for" - }, - "invreq_payer_note": { - "type": "string", - "description": "a note attached by the payer" - }, - "invreq_recurrence_counter": { - "type": "u32", - "description": "which number request this is for the same invoice" - }, - "invreq_recurrence_start": { - "type": "u32", - "description": "when we're requesting to start an invoice at a non-zero period" - }, - "signature": { - "type": "bip340sig", - "description": "BIP-340 signature of the `invreq_payer_id` on this invoice_request" - }, - "unknown_invoice_request_tlvs": { - "type": "array", - "description": "Any extra fields we didn't know how to parse", - "items": { - "type": "object", - "required": [ - "type", - "length", - "value" - ], - "additionalProperties": false, - "properties": { - "type": { - "type": "u64", - "description": "The type" - }, - "length": { - "type": "u64", - "description": "The length" + }, + "then": { + "properties": { + "account": {}, + "type": {}, + "tag": {}, + "credit_msat": {}, + "debit_msat": {}, + "currency": {}, + "timestamp": {}, + "description": {}, + "fees_msat": { + "type": "msat", + "description": [ + "Amount paid in fees." + ] + }, + "is_rebalance": { + "type": "boolean", + "description": [ + "Is this payment part of a rebalance." + ] + }, + "payment_id": { + "type": "hex", + "description": [ + "Lightning payment identifier. For an htlc, this will be the preimage." + ] + }, + "part_id": { + "type": "u32", + "description": [ + "Counter for multi-part payments." + ] + } }, - "value": { - "type": "hex", - "description": "The value" - } + "additionalProperties": false } } - } + ] } } - }, + } + }, + "example_json_request": [ { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 invoice_request" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - false - ] - } - } - }, - "then": { - "required": [], - "additionalProperties": false, - "properties": { - "type": {}, - "valid": {}, - "offer_id": {}, - "offer_chains": {}, - "offer_metadata": {}, - "offer_currency": {}, - "warning_unknown_offer_currency": {}, - "currency_minor_unit": {}, - "offer_amount": {}, - "offer_amount_msat": {}, - "offer_description": {}, - "offer_issuer": {}, - "offer_features": {}, - "offer_absolute_expiry": {}, - "offer_quantity_max": {}, - "offer_paths": {}, - "offer_node_id": {}, - "offer_recurrence": {}, - "invreq_metadata": {}, - "invreq_payer_id": {}, - "invreq_chain": {}, - "invreq_amount_msat": {}, - "invreq_features": {}, - "invreq_quantity": {}, - "invreq_payer_note": {}, - "invreq_recurrence_counter": {}, - "invreq_recurrence_start": {}, - "warning_invalid_offer_description": { - "type": "string", - "description": "`offer_description` is not valid UTF8" - }, - "warning_missing_offer_description": { - "type": "string", - "description": "`offer_description` is not present" - }, - "warning_invalid_offer_currency": { - "type": "string", - "description": "`offer_currency_code` is not valid UTF8" - }, - "warning_invalid_offer_issuer": { - "type": "string", - "description": "`offer_issuer` is not valid UTF8" - }, - "warning_missing_invreq_metadata": { - "type": "string", - "description": "`invreq_metadata` is not present" - }, - "warning_missing_invreq_payer_id": { - "type": "string", - "description": "`invreq_payer_id` is not present" - }, - "warning_invalid_invreq_payer_note": { - "type": "string", - "description": "`invreq_payer_note` is not valid UTF8" - }, - "warning_missing_invoice_request_signature": { - "type": "string", - "description": "`signature` is not present" - }, - "warning_invalid_invoice_request_signature": { - "type": "string", - "description": "Incorrect `signature`" - } - } - } + "id": "example:bkpr-listaccountevents#1", + "method": "bkpr-listaccountevents", + "params": "{}" }, { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 invoice" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "required": [ - "offer_node_id", - "offer_description", - "invreq_metadata", - "invreq_payer_id", - "invoice_paths", - "invoice_created_at", - "invoice_payment_hash", - "invoice_amount_msat", - "signature" - ], - "additionalProperties": false, - "properties": { - "type": {}, - "valid": {}, - "offer_id": { - "type": "hex", - "description": "the id we use to identify this offer", - "maxLength": 64, - "minLength": 64 - }, - "offer_chains": { - "type": "array", - "description": "which blockchains this offer is for (missing implies bitcoin mainnet only)", - "items": { - "type": "hex", - "description": "the genesis blockhash", - "maxLength": 64, - "minLength": 64 - } - }, - "offer_metadata": { - "type": "hex", - "description": "any metadata the creator of the offer includes" - }, - "offer_currency": { - "type": "string", - "description": "ISO 4217 code of the currency (missing implies Bitcoin)", - "maxLength": 3, - "minLength": 3 - }, - "warning_unknown_offer_currency": { - "type": "string", - "description": "The currency code is unknown (so no `currency_minor_unit`)" - }, - "currency_minor_unit": { - "type": "u32", - "description": "the number of decimal places to apply to amount (if currency known)" - }, - "offer_amount": { - "type": "u64", - "description": "the amount in the `offer_currency` adjusted by `currency_minor_unit`, if any" - }, - "offer_amount_msat": { - "type": "msat", - "description": "the amount in bitcoin (if specified, and no `offer_currency`)" - }, - "offer_description": { - "type": "string", - "description": "the description of the purpose of the offer" - }, - "offer_issuer": { - "type": "string", - "description": "the description of the creator of the offer" - }, - "offer_features": { - "type": "hex", - "description": "the feature bits of the offer" - }, - "offer_absolute_expiry": { - "type": "u64", - "description": "UNIX timestamp of when this offer expires" - }, - "offer_quantity_max": { - "type": "u64", - "description": "the maximum quantity (or, if 0, means any quantity)" - }, - "offer_paths": { - "type": "array", - "description": "Paths to the destination", - "items": { - "type": "object", - "required": [ - "first_node_id", - "blinding", - "path" - ], - "additionalProperties": false, - "properties": { - "first_node_id": { - "type": "pubkey", - "description": "the (presumably well-known) public key of the start of the path" - }, - "blinding": { - "type": "pubkey", - "description": "blinding factor for this path" - }, - "path": { - "type": "array", - "description": "an individual path", - "items": { - "type": "object", - "required": [ - "blinded_node_id", - "encrypted_recipient_data" - ], - "additionalProperties": false, - "properties": { - "blinded_node_id": { - "type": "pubkey", - "description": "node_id of the hop" - }, - "encrypted_recipient_data": { - "type": "hex", - "description": "encrypted TLV entry for this hop" - } - } + "id": "example:bkpr-listaccountevents#2", + "method": "bkpr-listaccountevents", + "params": [ + "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab" + ] + } + ], + "example_json_response": [ + { + "events": [ + { + "account": "wallet", + "type": "channel", + "tag": "journal_entry", + "credit_msat": 0, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706152911, + "is_rebalance": false + }, + { + "account": "wallet", + "type": "chain", + "tag": "deposit", + "credit_msat": 2000000000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "7e202b3b1016e8eb6f4e936215ed6b5bdc63c17e6ebb5e6bce2f98e6757ba44c:0", + "timestamp": 1706152914, + "blockheight": 102 + }, + { + "account": "wallet", + "type": "chain", + "tag": "withdrawal", + "credit_msat": 0, + "debit_msat": 2000000000, + "currency": "bcrt", + "outpoint": "7e202b3b1016e8eb6f4e936215ed6b5bdc63c17e6ebb5e6bce2f98e6757ba44c:0", + "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b", + "timestamp": 1706152921, + "blockheight": 103 + }, + { + "account": "wallet", + "type": "chain", + "tag": "deposit", + "credit_msat": 995073000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b:1", + "timestamp": 1706152921, + "blockheight": 103 + }, + { + "account": "wallet", + "type": "onchain_fee", + "tag": "onchain_fee", + "credit_msat": 1004927000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706152921, + "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b" + }, + { + "account": "wallet", + "type": "onchain_fee", + "tag": "onchain_fee", + "credit_msat": 0, + "debit_msat": 1004927000, + "currency": "bcrt", + "timestamp": 1706152921, + "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b" + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "chain", + "tag": "channel_open", + "credit_msat": 1000000000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b:0", + "timestamp": 1706152922, + "blockheight": 103 + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "onchain_fee", + "tag": "onchain_fee", + "credit_msat": 4927000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706152922, + "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b" + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "channel", + "tag": "invoice", + "credit_msat": 0, + "debit_msat": 11000000, + "currency": "bcrt", + "payment_id": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "part_id": 0, + "timestamp": 1706152934, + "description": [ + "XEoCR94SIz6UIRUEkxum." + ], + "is_rebalance": false + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "chain", + "tag": "channel_close", + "credit_msat": 0, + "debit_msat": 989000000, + "currency": "bcrt", + "outpoint": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b:0", + "txid": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998", + "timestamp": 1706152938, + "blockheight": 104 + }, + { + "account": "external", + "origin": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "chain", + "tag": "to_them", + "credit_msat": 10899000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998:0", + "timestamp": 1706152938, + "blockheight": 104 + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "onchain_fee", + "tag": "onchain_fee", + "credit_msat": 7967000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706152938, + "txid": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998" + }, + { + "account": "wallet", + "type": "chain", + "tag": "deposit", + "credit_msat": 980912000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "85477738281c1afd652c350025f1d28658fe541c83adc9a7d5276c30cf715a11:0", + "timestamp": 1706152941, + "blockheight": 109 + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "chain", + "tag": "delayed_to_us", + "credit_msat": 981033000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998:1", + "timestamp": 1706152941, + "blockheight": 104 + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "chain", + "tag": "to_wallet", + "credit_msat": 0, + "debit_msat": 981033000, + "currency": "bcrt", + "outpoint": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998:1", + "txid": "85477738281c1afd652c350025f1d28658fe541c83adc9a7d5276c30cf715a11", + "timestamp": 1706152941, + "blockheight": 109 + }, + { + "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "type": "onchain_fee", + "tag": "onchain_fee", + "credit_msat": 121000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706152941, + "txid": "85477738281c1afd652c350025f1d28658fe541c83adc9a7d5276c30cf715a11" + } + ] + }, + { + "events": [ + { + "account": "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab", + "type": "chain", + "tag": "channel_proposed", + "credit_msat": 996363000, + "debit_msat": 0, + "currency": "bcrt", + "outpoint": "abb283035e569c190696d42a1208bb38ddc64b6377e88f2d6277c01eab7b0af3:0", + "timestamp": 1706246949, + "blockheight": 0 + }, + { + "account": "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab", + "type": "channel", + "tag": "pushed", + "credit_msat": 0, + "debit_msat": 20000000, + "currency": "bcrt", + "timestamp": 1706246949, + "is_rebalance": false + } + ] + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-bkpr-listincome(7)", + "lightning-listfunds(7)", + "lightning-bkpr-listbalances(7)", + "lightning-bkpr-channelsapy(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-bkpr-listbalances.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "bkpr-listbalances", + "title": "Command for listing current channel + wallet balances", + "description": [ + "The **bkpr-listbalances** RPC command is a list of all current and historical account balances. An account is either the on-chain *wallet* or a channel balance. Any funds sent to an *external* account will not be accounted for here.", + "", + "Note that any channel that was recorded will be listed. Closed channel balances will be 0msat." + ], + "request": { + "required": [], + "properties": {} + }, + "response": { + "required": [ + "accounts" + ], + "properties": { + "accounts": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "account", + "balances" + ], + "properties": { + "account": { + "type": "string", + "description": [ + "The account name. If the account is a channel, the channel_id." + ] + }, + "balances": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "balance_msat", + "coin_type" + ], + "properties": { + "balance_msat": { + "type": "msat", + "description": [ + "Current account balance." + ] + }, + "coin_type": { + "type": "string", + "description": [ + "Coin type, same as HRP for bech32." + ] } } } } }, - "offer_node_id": { - "type": "pubkey", - "description": "public key of the offering node" + "if": { + "required": [ + "peer_id" + ] }, - "offer_recurrence": { - "type": "object", - "description": "how often to this offer should be used", + "then": { "required": [ - "period", - "time_unit" + "account", + "balances", + "peer_id", + "we_opened", + "account_closed", + "account_resolved" ], "additionalProperties": false, "properties": { - "time_unit": { - "type": "u32", - "description": "the BOLT12 time unit" - }, - "time_unit_name": { - "type": "string", - "description": "the name of `time_unit` (if valid)" + "account": {}, + "balances": {}, + "peer_id": { + "type": "pubkey", + "description": [ + "Node id for the peer this account is with." + ] }, - "period": { - "type": "u32", - "description": "how many `time_unit` per payment period" + "we_opened": { + "type": "boolean", + "description": [ + "Did we initiate this account open (open the channel)." + ] }, - "basetime": { - "type": "u64", - "description": "period starts at this UNIX timestamp" + "account_closed": { + "type": "boolean", + "description": [ + "", + "" + ] }, - "start_any_period": { + "account_resolved": { "type": "boolean", - "description": "you can start at any period (only if `basetime` present)" + "description": [ + "Has this channel been closed and all outputs resolved?" + ] }, - "limit": { + "resolved_at_block": { "type": "u32", - "description": "maximum period number for recurrence" - }, - "paywindow": { - "type": "object", - "description": "when within a period will payment be accepted (default is prior and during the period)", - "required": [ - "seconds_before", - "seconds_after" - ], - "additionalProperties": false, - "properties": { - "seconds_before": { - "type": "u32", - "description": "seconds prior to period start" - }, - "seconds_after": { - "type": "u32", - "description": "seconds after to period start" - }, - "proportional_amount": { - "type": "boolean", - "enum": [ - true - ], - "description": "amount should be scaled if payed after period start" - } - } - } - } - }, - "invreq_metadata": { - "type": "hex", - "description": "the payer-provided blob to derive invreq_payer_id" - }, - "invreq_payer_id": { - "type": "hex", - "description": "the payer-provided key" - }, - "invreq_chain": { - "type": "hex", - "description": "which blockchain this offer is for (missing implies bitcoin mainnet only)", - "maxLength": 64, - "minLength": 64 - }, - "invreq_amount_msat": { - "type": "msat", - "description": "the amount the invoice should be for" - }, - "invreq_features": { - "type": "hex", - "description": "the feature bits of the invoice_request" - }, - "invreq_quantity": { - "type": "u64", - "description": "the number of items to invoice for" - }, - "invreq_payer_note": { - "type": "string", - "description": "a note attached by the payer" - }, - "invreq_recurrence_counter": { - "type": "u32", - "description": "which number request this is for the same invoice" - }, - "invreq_recurrence_start": { - "type": "u32", - "description": "when we're requesting to start an invoice at a non-zero period" - }, - "invoice_paths": { - "type": "array", - "description": "Paths to pay the destination", - "items": { - "type": "object", - "required": [ - "first_node_id", - "blinding", - "payinfo", - "path" - ], - "additionalProperties": false, - "properties": { - "first_node_id": { - "type": "pubkey", - "description": "the (presumably well-known) public key of the start of the path" - }, - "blinding": { - "type": "pubkey", - "description": "blinding factor for this path" - }, - "payinfo": { - "type": "object", - "required": [ - "fee_base_msat", - "fee_proportional_millionths", - "cltv_expiry_delta", - "features" - ], - "additionalProperties": false, - "properties": { - "fee_base_msat": { - "type": "msat", - "description": "basefee for path" - }, - "fee_proportional_millionths": { - "type": "u32", - "description": "proportional fee for path" - }, - "cltv_expiry_delta": { - "type": "u32", - "description": "CLTV delta for path" - }, - "features": { - "type": "hex", - "description": "features allowed for path" - } - } - }, - "path": { - "type": "array", - "description": "an individual path", - "items": { - "type": "object", - "required": [ - "blinded_node_id", - "encrypted_recipient_data" - ], - "additionalProperties": false, - "properties": { - "blinded_node_id": { - "type": "pubkey", - "description": "node_id of the hop" - }, - "encrypted_recipient_data": { - "type": "hex", - "description": "encrypted TLV entry for this hop" - } - } - } - } - } - } - }, - "invoice_created_at": { - "type": "u64", - "description": "the UNIX timestamp of invoice creation" - }, - "invoice_relative_expiry": { - "type": "u32", - "description": "the number of seconds after *invoice_created_at* when this expires" - }, - "invoice_payment_hash": { - "type": "hex", - "description": "the hash of the *payment_preimage*", - "maxLength": 64, - "minLength": 64 - }, - "invoice_amount_msat": { - "type": "msat", - "description": "the amount required to fulfill invoice" - }, - "invoice_fallbacks": { - "type": "array", - "description": "onchain addresses", - "items": { - "type": "object", - "required": [ - "version", - "hex" - ], - "additionalProperties": false, - "properties": { - "version": { - "type": "u8", - "description": "Segwit address version" - }, - "hex": { - "type": "hex", - "description": "Raw encoded segwit address" - }, - "address": { - "type": "string", - "description": "bech32 segwit address" - } + "description": [ + "Blockheight account resolved on chain." + ] } } }, - "invoice_features": { - "type": "hex", - "description": "the feature bits of the invoice" - }, - "invoice_node_id": { - "type": "pubkey", - "description": "the id to pay (usually the same as offer_node_id)" - }, - "invoice_recurrence_basetime": { - "type": "u64", - "description": "the UNIX timestamp to base the invoice periods on" - }, - "signature": { - "type": "bip340sig", - "description": "BIP-340 signature of the `offer_node_id` on this invoice" - }, - "unknown_invoice_tlvs": { - "type": "array", - "description": "Any extra fields we didn't know how to parse", - "items": { - "type": "object", - "required": [ - "type", - "length", - "value" - ], - "additionalProperties": false, - "properties": { - "type": { - "type": "u64", - "description": "The type" - }, - "length": { - "type": "u64", - "description": "The length" - }, - "value": { - "type": "hex", - "description": "The value" - } - } - } + "else": { + "properties": { + "account": {}, + "balances": {} + }, + "additionalProperties": false } } } - }, + } + }, + "example_json_request": [ { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 invoice" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - false - ] - } - } - }, - "then": { - "required": [], - "additionalProperties": false, - "properties": { - "type": {}, - "valid": {}, - "offer_id": {}, - "offer_chains": {}, - "offer_metadata": {}, - "offer_currency": {}, - "warning_unknown_offer_currency": {}, - "currency_minor_unit": {}, - "offer_amount": {}, - "offer_amount_msat": {}, - "offer_description": {}, - "offer_issuer": {}, - "offer_features": {}, - "offer_absolute_expiry": {}, - "offer_quantity_max": {}, - "offer_paths": {}, - "offer_node_id": {}, - "offer_recurrence": {}, - "invreq_metadata": {}, - "invreq_payer_id": {}, - "invreq_chain": {}, - "invreq_amount_msat": {}, - "invreq_features": {}, - "invreq_quantity": {}, - "invreq_payer_note": {}, - "invreq_node_id": {}, - "invreq_recurrence_counter": {}, - "invreq_recurrence_start": {}, - "warning_invalid_offer_description": { - "type": "string", - "description": "`offer_description` is not valid UTF8" - }, - "warning_missing_offer_description": { - "type": "string", - "description": "`offer_description` is not present" - }, - "warning_invalid_offer_currency": { - "type": "string", - "description": "`offer_currency_code` is not valid UTF8" - }, - "warning_invalid_offer_issuer": { - "type": "string", - "description": "`offer_issuer` is not valid UTF8" - }, - "warning_missing_invreq_metadata": { - "type": "string", - "description": "`invreq_metadata` is not present" - }, - "warning_invalid_invreq_payer_note": { - "type": "string", - "description": "`invreq_payer_note` is not valid UTF8" - }, - "warning_missing_invoice_paths": { - "type": "string", - "description": "`invoice_paths` is not present" - }, - "warning_missing_invoice_blindedpay": { - "type": "string", - "description": "`invoice_blindedpay` is not present" - }, - "warning_missing_invoice_created_at": { - "type": "string", - "description": "`invoice_created_at` is not present" - }, - "warning_missing_invoice_payment_hash": { - "type": "string", - "description": "`invoice_payment_hash` is not present" - }, - "warning_missing_invoice_amount": { - "type": "string", - "description": "`invoice_amount` is not present" - }, - "warning_missing_invoice_recurrence_basetime": { - "type": "string", - "description": "`invoice_recurrence_basetime` is not present" - }, - "warning_missing_invoice_node_id": { - "type": "string", - "description": "`invoice_node_id` is not present" - }, - "warning_missing_invoice_signature": { - "type": "string", - "description": "`signature` is not present" - }, - "warning_invalid_invoice_signature": { - "type": "string", - "description": "Incorrect `signature`" - }, - "fallbacks": { - "type": "array", - "items": { - "type": "object", - "required": [ - "version", - "hex" - ], - "properties": { - "version": {}, - "hex": {}, - "address": {}, - "warning_invoice_fallbacks_version_invalid": { - "type": "string", - "description": "`version` is > 16" - } - } - } - } - } - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt11 invoice" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "required": [ - "currency", - "created_at", - "expiry", - "payee", - "min_final_cltv_expiry", - "payment_hash", - "signature" - ], - "additionalProperties": false, - "properties": { - "type": {}, - "valid": {}, - "currency": { - "type": "string", - "description": "the BIP173 name for the currency" - }, - "created_at": { - "type": "u64", - "description": "the UNIX-style timestamp of the invoice" - }, - "expiry": { - "type": "u64", - "description": "the number of seconds this is valid after `created_at`" - }, - "payee": { - "type": "pubkey", - "description": "the public key of the recipient" - }, - "amount_msat": { - "type": "msat", - "description": "Amount the invoice asked for" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage*" - }, - "signature": { - "type": "signature", - "description": "signature of the *payee* on this invoice" - }, - "description": { - "type": "string", - "description": "the description of the purpose of the purchase" - }, - "description_hash": { - "type": "hash", - "description": "the hash of the description, in place of *description*" - }, - "min_final_cltv_expiry": { - "type": "u32", - "description": "the minimum CLTV delay for the final node" - }, - "payment_secret": { - "type": "secret", - "description": "the secret to hand to the payee node" - }, - "features": { - "type": "hex", - "description": "the features bitmap for this invoice" - }, - "payment_metadata": { - "type": "hex", - "description": "the payment_metadata to put in the payment" - }, - "fallbacks": { - "type": "array", - "description": "onchain addresses", - "items": { - "type": "object", - "required": [ - "type", - "hex" - ], - "additionalProperties": false, - "properties": { - "type": { - "type": "string", - "description": "the address type (if known)", - "enum": [ - "P2PKH", - "P2SH", - "P2WPKH", - "P2WSH", - "P2TR" - ] - }, - "addr": { - "type": "string", - "description": "the address in appropriate format for *type*" - }, - "hex": { - "type": "hex", - "description": "Raw encoded address" - } - } - } - }, - "routes": { - "type": "array", - "description": "Route hints to the *payee*", - "items": { - "type": "array", - "description": "hops in the route", - "items": { - "type": "object", - "required": [ - "pubkey", - "short_channel_id", - "fee_base_msat", - "fee_proportional_millionths", - "cltv_expiry_delta" - ], - "additionalProperties": false, - "properties": { - "pubkey": { - "type": "pubkey", - "description": "the public key of the node" - }, - "short_channel_id": { - "type": "short_channel_id", - "description": "a channel to the next peer" - }, - "fee_base_msat": { - "type": "msat", - "description": "the base fee for payments" - }, - "fee_proportional_millionths": { - "type": "u32", - "description": "the parts-per-million fee for payments" - }, - "cltv_expiry_delta": { - "type": "u32", - "description": "the CLTV delta across this hop" - } - } - } - } - }, - "extra": { - "type": "array", - "description": "Any extra fields we didn't know how to parse", - "items": { - "type": "object", - "required": [ - "tag", - "data" - ], - "additionalProperties": false, - "properties": { - "tag": { - "type": "string", - "description": "The bech32 letter which identifies this field", - "maxLength": 1, - "minLength": 1 - }, - "data": { - "type": "string", - "description": "The bech32 data for this field" - } - } - } - } - } - } - }, + "id": "example:bkpr-listbalances#1", + "method": "bkpr-listbalances", + "params": "{}" + } + ], + "example_json_response": [ { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "rune" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "required": [ - "string", - "restrictions", - "valid" - ], - "additionalProperties": false, - "properties": { - "unique_id": { - "type": "string", - "description": "unique id (always a numeric id on runes we create)" - }, - "version": { - "type": "string", - "description": "rune version, not currently set on runes we create" - }, - "valid": { - "type": "boolean", - "enum": [ - true - ] - }, - "type": {}, - "string": { - "type": "string", - "description": "the string encoding of the rune" - }, - "restrictions": { - "type": "array", - "description": "restrictions built into the rune: all must pass", - "items": { - "type": "object", - "required": [ - "alternatives", - "summary" - ], - "additionalProperties": false, - "properties": { - "alternatives": { - "type": "array", - "description": "each way restriction can be met: any can pass", - "items": { - "type": "string", - "description": "the alternative of form fieldname condition fieldname" - } - }, - "summary": { - "type": "string", - "description": "human-readable summary of this restriction" - } - } + "accounts": [ + { + "account": "wallet", + "balances": [ + { + "balance_msat": 2222222000, + "coin_type": "bcrt" } - } - } - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "rune" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - false - ] - } - } - }, - "then": { - "required": [ - "valid" - ], - "additionalProperties": false, - "properties": { - "valid": { - "type": "boolean", - "enum": [ - false - ] - }, - "type": {}, - "warning_rune_invalid_utf8": { - "type": "string", - "description": "the rune contains invalid UTF-8 strings" - }, - "hex": { - "type": "hex", - "description": "the raw rune in hex" - } - } - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "emergency recover" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "required": [ - "decrypted" - ], - "additionalProperties": false, - "properties": { - "type": {}, - "valid": {}, - "decrypted": { - "type": "hex", - "description": "The decrypted value of the provided bech32 of emergency.recover", - "added": "v23.11" - } + ] } - } + ] } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-bkpr-listincome(7)", + "lightning-listfunds(7)", + "lightning-bkpr-listaccountevents(7)", + "lightning-bkpr-channelsapy(7)", + "lightning-listpeers(7)" + ], + "resources": [ + "Main web site: " ] }, - "decodepay.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-bkpr-listincome.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "added": "v23.05", - "required": [ - "bolt11" - ], - "properties": { - "bolt11": { - "type": "string", - "description": "bolt11 invoice to decode" - }, - "description": { - "type": "string", - "description": "description of the invoice to decode" - } - } - }, - "decodepay.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "currency", - "created_at", - "expiry", - "payee", - "min_final_cltv_expiry", - "payment_hash", - "signature" + "added": "pre-v0.10.1", + "rpc": "bkpr-listincome", + "title": "Command for listing all income impacting events", + "description": [ + "The **bkpr-listincome** RPC command is a list of all income impacting events that the bookkeeper plugin has recorded for this node." ], - "additionalProperties": false, - "properties": { - "currency": { - "type": "string", - "description": "the BIP173 name for the currency" - }, - "created_at": { - "type": "u64", - "description": "the UNIX-style timestamp of the invoice" - }, - "expiry": { - "type": "u64", - "description": "the number of seconds this is valid after *timestamp*" - }, - "payee": { - "type": "pubkey", - "description": "the public key of the recipient" - }, - "amount_msat": { - "type": "msat", - "description": "Amount the invoice asked for" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage*" - }, - "signature": { - "type": "signature", - "description": "signature of the *payee* on this invoice" - }, - "description": { - "type": "string", - "description": "the description of the purpose of the purchase" - }, - "description_hash": { - "type": "hash", - "description": "the hash of the description, in place of *description*" - }, - "min_final_cltv_expiry": { - "type": "u32", - "description": "the minimum CLTV delay for the final node" - }, - "payment_secret": { - "type": "hash", - "description": "the secret to hand to the payee node" - }, - "features": { - "type": "hex", - "description": "the features bitmap for this invoice" - }, - "payment_metadata": { - "type": "hex", - "description": "the payment_metadata to put in the payment" - }, - "fallbacks": { - "type": "array", - "description": "onchain addresses", - "items": { - "type": "object", - "required": [ - "type", - "hex" + "request": { + "required": [], + "properties": { + "consolidate_fees": { + "type": "boolean", + "description": [ + "If true, we emit a single, consolidated event for any onchain-fees for a txid and account. Otherwise, events for every update to the onchain fee calculation for this account and txid will be printed. Note that this means that the events emitted are non-stable, i.e. calling **listincome** twice may result in different onchain fee events being emitted, depending on how much information we've logged for that transaction." ], - "additionalProperties": false, - "properties": { - "type": { - "type": "string", - "description": "the address type (if known)", - "enum": [ - "P2PKH", - "P2SH", - "P2WPKH", - "P2WSH", - "P2TR" - ] - }, - "addr": { - "type": "string", - "description": "the address in appropriate format for *type*" - }, - "hex": { - "type": "hex", - "description": "Raw encoded address" - } - } + "default": "True" + }, + "start_time": { + "type": "u32", + "description": [ + "UNIX timestamp (in seconds) that filters events after the provided timestamp." + ], + "default": "zero" + }, + "end_time": { + "type": "u32", + "description": [ + "UNIX timestamp (in seconds) that filters events up to and at the provided timestamp." + ], + "default": "max-int" } - }, - "routes": { - "type": "array", - "description": "Route hints to the *payee*", - "items": { + } + }, + "response": { + "required": [ + "income_events" + ], + "properties": { + "income_events": { "type": "array", - "description": "hops in the route", "items": { "type": "object", + "additionalProperties": false, "required": [ - "pubkey", - "short_channel_id", - "fee_base_msat", - "fee_proportional_millionths", - "cltv_expiry_delta" + "account", + "tag", + "credit_msat", + "debit_msat", + "currency", + "timestamp" ], - "additionalProperties": false, "properties": { - "pubkey": { - "type": "pubkey", - "description": "the public key of the node" + "account": { + "type": "string", + "description": [ + "The account name. If the account is a channel, the channel_id." + ] }, - "short_channel_id": { - "type": "short_channel_id", - "description": "a channel to the next peer" + "tag": { + "type": "string", + "description": [ + "Type of income event." + ] }, - "fee_base_msat": { + "credit_msat": { "type": "msat", - "description": "the base fee for payments" + "description": [ + "Amount earned (income)." + ] }, - "fee_proportional_millionths": { - "type": "u32", - "description": "the parts-per-million fee for payments" + "debit_msat": { + "type": "msat", + "description": [ + "Amount spent (expenses)." + ] + }, + "currency": { + "type": "string", + "description": [ + "Human-readable bech32 part for this coin type." + ] }, - "cltv_expiry_delta": { + "timestamp": { "type": "u32", - "description": "the CLTV delta across this hop" + "description": [ + "Timestamp this event was recorded by the node. For consolidated events such as onchain_fees, the most recent timestamp." + ] + }, + "description": { + "type": "string", + "description": [ + "More information about this event. If a `invoice` type, typically the bolt11/bolt12 description." + ] + }, + "outpoint": { + "type": "string", + "description": [ + "The txid:outnum for this event, if applicable." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The txid of the transaction that created this event, if applicable." + ] + }, + "payment_id": { + "type": "hex", + "description": [ + "Lightning payment identifier. For an htlc, this will be the preimage." + ] } } } } + } + }, + "example_json_request": [ + { + "id": "example:bkpr-listincome#1", + "method": "bkpr-listincome", + "params": "{}" }, - "extra": { - "type": "array", - "description": "Any extra fields we didn't know how to parse", - "items": { - "type": "object", - "required": [ - "tag", - "data" - ], - "additionalProperties": false, - "properties": { - "tag": { - "type": "string", - "description": "The bech32 letter which identifies this field", - "maxLength": 1, - "minLength": 1 - }, - "data": { - "type": "string", - "description": "The bech32 data for this field" - } - } + { + "id": "example:bkpr-listincome#2", + "method": "bkpr-listincome", + "params": { + "consolidate_fees": false } } - } - }, - "deldatastore.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "key" ], - "properties": { - "key": { - "oneOf": [ + "example_json_response": [ + { + "income_events": [ { - "type": "array", - "description": "key is an array of values (though a single value is treated as a one-element array), to form a heirarchy. Using the first element of the key as the plugin name (e.g. [ 'summary' ]) is recommended. A key can either have children or a value, never both: parents are created and removed automatically", - "items": { - "type": "string" - } + "account": "wallet", + "tag": "deposit", + "credit_msat": 1111111000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706153060, + "outpoint": "6d813d2e99ae7181b61e59ff224c43de698bd08b8ca5b8034ccc13aa7b6428ef:0" }, { - "type": "string" + "account": "wallet", + "tag": "deposit", + "credit_msat": 1111111000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1706153060, + "outpoint": "0bbbe965f76525af3876ae6f1520d91047d4be04cb4e46b7229120a60c5dc9c5:0" } ] }, - "generation": { - "type": "u64", - "description": "If specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with mode \u201cmust-replace\u201d or \u201cmust-append\u201d" + { + "income_events": [ + { + "account": "wallet", + "tag": "deposit", + "credit_msat": 1111111000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1708624181, + "outpoint": "895b5eaad4544d24c99628883b4d84b2c6024d6a2da4c1de54098d985f280943:1" + }, + { + "account": "wallet", + "tag": "withdrawal", + "credit_msat": 0, + "debit_msat": 555555000, + "currency": "bcrt", + "timestamp": 1708624182, + "outpoint": "d28a2cba55da10700ddd7f1f23618160dafb3134650055654551d9b0382dcd71:0" + }, + { + "account": "wallet", + "tag": "onchain_fee", + "credit_msat": 0, + "debit_msat": 555556000, + "currency": "bcrt", + "timestamp": 1708624183, + "txid": "d28a2cba55da10700ddd7f1f23618160dafb3134650055654551d9b0382dcd71" + }, + { + "account": "wallet", + "tag": "onchain_fee", + "credit_msat": 554947000, + "debit_msat": 0, + "currency": "bcrt", + "timestamp": 1708624183, + "txid": "d28a2cba55da10700ddd7f1f23618160dafb3134650055654551d9b0382dcd71" + } + ] } - } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-bkpr-listaccountevents(7)", + "lightning-listfunds(7)", + "lightning-bkpr-listbalances(7)" + ], + "resources": [ + "Main web site: " + ] }, - "deldatastore.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-blacklistrune.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "key" - ], - "properties": { - "key": { - "type": "array", - "items": { - "type": "string", - "description": "Part of the key added to the datastore" - } - }, - "generation": { - "type": "u64", - "description": "The number of times this has been updated" - }, - "hex": { - "type": "hex", - "description": "The hex data which has removed from the datastore" + "added": "v23.08", + "rpc": "blacklistrune", + "title": "Command to prevent a rune from working", + "description": [ + "The **blacklistrune** RPC command allows you to effectively revoke the rune you have created (and any runes derived from that rune with additional restictions). Attempting to use these runes will be resulted in a `Blacklisted rune` error message.", + "", + "Destroy a rune like in olden times with the **destroyrune** command.", + "", + "All runes created by lightning have a unique sequential id within them and can be blacklisted in ranges for efficiency. The command always returns the blacklisted ranges on success. If no parameters are specified, no changes have been made. If start specified without end, that single rune is blacklisted. If end is also specified, every rune from start till end inclusive is blacklisted." + ], + "request": { + "required": [], + "properties": { + "start": { + "type": "u64", + "description": [ + "First rune unique id to blacklist." + ] + }, + "end": { + "type": "u64", + "description": [ + "Final rune unique id to blacklist (defaults to start)." + ] + } }, - "string": { - "type": "string", - "description": "The data as a string, if it's valid utf-8" + "dependentUpon": { + "start": [ + "end" + ] } - } - }, - "delexpiredinvoice.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "maxexpirytime": { - "type": "u64", - "description": "invoice expiry time in seconds. If not specified then all expired invoices are deleted" + }, + "response": { + "required": [ + "blacklist" + ], + "properties": { + "blacklist": { + "type": "array", + "description": [ + "The resulting blacklist ranges after the command." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "start", + "end" + ], + "properties": { + "start": { + "type": "u64", + "description": [ + "Unique id of first rune in this blacklist range." + ] + }, + "end": { + "type": "u64", + "description": [ + "Unique id of last rune in this blacklist range." + ] + } + } + } + } } - } - }, - "delexpiredinvoice.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": {} - }, - "delforward.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "in_channel", - "in_htlc_id", - "status" - ], - "properties": { - "in_channel": { - "type": "short_channel_id", - "description": "only the matching forwards on the given inbound channel are deleted.\tNote: for **listforwards** entries without an *in_htlc_id* entry (no longer created in v22.11, but can exist from older versions), a value of 18446744073709551615 can be used, but then it will delete *all* entries without *in_htlc_id* for this *in_channel* and *status*" + }, + "example_json_request": [ + { + "id": "example:blacklistrune#1", + "method": "blacklistrune", + "params": { + "start": 2 + } }, - "in_htlc_id": { - "type": "u64", - "description": "the unique HTLC id the sender gave this (not present if incoming channel was closed before ugprade to v22.11)" + { + "id": "example:blacklistrune#2", + "method": "blacklistrune", + "params": { + "start": 5, + "end": 7 + } }, - "status": { - "type": "string", - "description": "the status of the forward to delete. You cannot delete forwards which have status *offered* (i.e. are currently active)", - "enum": [ - "settled", - "local_failed", - "failed" - ] + { + "id": "example:blacklistrune#3", + "method": "blacklistrune", + "params": { + "start": 3, + "end": 4 + } } - } - }, - "delforward.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": {} - }, - "delinvoice.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "label", - "status" ], - "properties": { - "label": { - "oneOf": [ + "example_json_response": [ + { + "blacklist": [ { - "type": "string" + "start": 2, + "end": 2 + } + ] + }, + { + "blacklist": [ + { + "start": 2, + "end": 2 }, { - "type": "u64" + "start": 5, + "end": 7 } - ], - "description": "label of the invoice to be deleted" - }, - "status": { - "type": "string", - "description": "label of the invoice to be deleted. The caller should be particularly aware of the error case caused by the *status* changing just before this command is invoked!", - "enum": [ - "paid", - "expired", - "unpaid" ] }, - "desconly": { - "type": "boolean", - "description": "if set to True, the invoice is not deleted, but has its description removed (this can save space with very large descriptions, as would be used with lightning-invoice(7) *deschashonly*" + { + "blacklist": [ + { + "start": 2, + "end": 7 + } + ] } - } + ], + "author": [ + "Shahana Farooqui <> is mainly responsible." + ], + "see_also": [ + "lightning-commando-blacklist(7)", + "lightning-showrunes(7)" + ], + "resources": [ + "Main web site: " + ] }, - "delinvoice.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-check.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", - "required": [ - "label", - "payment_hash", - "status", - "created_index", - "expires_at" + "additionalProperties": false, + "rpc": "check", + "title": "Command for verifying parameters", + "description": [ + "The **check** RPC command verifies another command without actually making any changes.", + "", + "This is guaranteed to be safe, and will do all checks up to the point where something in the system would need to be altered (such as checking that channels are in the right state, peers connected, etc).", + "", + "It does not guarantee successful execution of the command in all cases. For example, a call to lightning-getroute(7) may still fail to find a route even if checking the parameters succeeds." ], - "additionalProperties": true, - "properties": { - "label": { - "type": "string", - "description": "Unique label given at creation time" - }, - "bolt11": { - "type": "string", - "description": "BOLT11 string" - }, - "bolt12": { - "type": "string", - "description": "BOLT12 string" - }, - "amount_msat": { - "type": "msat", - "description": "the amount required to pay this invoice" - }, - "description": { - "type": "string", - "description": "description used in the invoice" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "created_index": { - "type": "u64", - "added": "v23.08", - "description": "1-based index indicating order this invoice was created in" - }, - "updated_index": { - "type": "u64", - "added": "v23.08", - "description": "1-based index indicating order this invoice was changed (only present if it has changed since creation)" - }, - "status": { - "type": "string", - "description": "State of invoice", - "enum": [ - "paid", - "expired", - "unpaid" - ] - }, - "expires_at": { - "type": "u64", - "description": "UNIX timestamp when invoice expires (or expired)" + "request": { + "required": [ + "command_to_check" + ], + "properties": { + "command_to_check": { + "type": "string", + "description": [ + "Name of the relevant command." + ] + } } }, - "allOf": [ - { - "if": { - "required": [ - "bolt12" + "response": { + "properties": { + "command_to_check": { + "type": "string", + "description": [ + "The *command_to_check* argument." ] - }, - "then": { - "required": [], - "additionalProperties": false, - "properties": { - "label": {}, - "bolt12": {}, - "status": {}, - "expires_at": {}, - "msatoshi": {}, - "amount_msat": {}, - "description": {}, - "payment_hash": {}, - "pay_index": {}, - "created_index": {}, - "updated_index": {}, - "amount_received_msat": {}, - "paid_at": {}, - "payment_preimage": {}, - "local_offer_id": { - "type": "hex", - "description": "offer for which this invoice was created" + } + }, + "required": [ + "command_to_check" + ] + }, + "example_json_request": [ + { + "id": "example:check#1", + "method": "check", + "params": { + "command_to_check": "sendpay", + "route": [ + { + "amount_msat": 1011, + "msatoshi": 1011, + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "delay": 20, + "channel": "1x1x1" }, - "invreq_payer_note": { - "type": "string", - "description": "the optional *invreq_payer_note* from invoice_request which created this invoice" + { + "amount_msat": 1000, + "msatoshi": 1000, + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "delay": 10, + "channel": "2x2x2" } - } - }, - "else": { - "required": [ - "bolt11" ], - "additionalProperties": false, - "properties": { - "label": {}, - "bolt11": {}, - "status": {}, - "expires_at": {}, - "msatoshi": {}, - "amount_msat": {}, - "description": {}, - "payment_hash": {}, - "pay_index": {}, - "created_index": {}, - "updated_index": {}, - "amount_received_msat": {}, - "msatoshi_received": {}, - "paid_at": {}, - "payment_preimage": {} - } + "payment_hash": "0000000000000000000000000000000000000000000000000000000000000000" } }, { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "paid" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "pay_index", - "amount_received_msat", - "paid_at", - "payment_preimage" - ], - "properties": { - "label": {}, - "bolt11": {}, - "bolt12": {}, - "status": {}, - "expires_at": {}, - "msatoshi": {}, - "amount_msat": {}, - "description": {}, - "payment_hash": {}, - "invreq_payer_note": {}, - "local_offer_id": {}, - "created_index": {}, - "updated_index": {}, - "pay_index": { - "type": "u64", - "description": "unique index for this invoice payment" - }, - "amount_received_msat": { - "type": "msat", - "description": "how much was actually received" - }, - "paid_at": { - "type": "u64", - "description": "UNIX timestamp of when payment was received" - }, - "payment_preimage": { - "type": "secret", - "description": "SHA256 of this is the *payment_hash* offered in the invoice" - } - } - }, - "else": { - "additionalProperties": false, - "properties": { - "label": {}, - "bolt11": {}, - "bolt12": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "description": {}, - "payment_hash": {}, - "expires_at": {}, - "created_index": {}, - "updated_index": {}, - "pay_index": {}, - "invreq_payer_note": {}, - "local_offer_id": {} - } + "id": "example:check#2", + "method": "check", + "params": { + "command_to_check": "dev", + "subcommand": "slowcmd", + "msec": 1000 + } + }, + { + "id": "example:check#3", + "method": "check", + "params": { + "command_to_check": "recover", + "hsmsecret": "6c696768746e696e672d31000000000000000000000000000000000000000000" } } - ] - }, - "delpay.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "payment_hash", - "status" ], - "additionalProperties": false, - "properties": { - "payment_hash": { - "type": "hash", - "description": "the unique identifier of a payment" - }, - "status": { - "type": "string", - "description": "expected status of the payment. Only deletes if the payment status matches. Deleting a `pending` payment will return an error", - "enum": [ - "complete", - "failed" - ] + "example_json_response": [ + { + "command_to_check": "sendpay" }, - "partid": { - "type": "u64", - "description": "specific partid to delete (must be paired with *groupid*)" + { + "command_to_check": "dev" }, - "groupid": { - "type": "u64", - "description": "specific groupid to delete (must be paired with *partid*)" + { + "command_to_check": "recover" } - } - }, - "delpay.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "payments" ], - "additionalProperties": false, - "properties": { - "payments": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "created_index", - "id", - "payment_hash", - "status", - "amount_sent_msat", - "created_at" - ], - "properties": { - "created_index": { - "added": "v23.11", - "type": "u64", - "description": "1-based index indicating order this payment was created in" - }, - "id": { - "type": "u64", - "description": "old synonym for created_index" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "status": { - "type": "string", - "enum": [ - "pending", - "failed", - "complete" - ], - "description": "status of the payment" - }, - "amount_sent_msat": { - "type": "msat", - "description": "the amount we actually sent, including fees" - }, - "partid": { - "type": "u64", - "description": "unique ID within this (multi-part) payment" - }, - "destination": { - "type": "pubkey", - "description": "the final destination of the payment if known" - }, - "amount_msat": { - "type": "msat", - "description": "the amount the destination received, if known" - }, - "created_at": { - "type": "u64", - "description": "the UNIX timestamp showing when this payment was initiated" - }, - "updated_index": { - "added": "v23.11", - "type": "u64", - "description": "1-based index indicating order this payment was changed (only present if it has changed since creation)" - }, - "completed_at": { - "type": "u64", - "description": "the UNIX timestamp showing when this payment was completed" - }, - "groupid": { - "type": "u64", - "description": "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash" - }, - "payment_preimage": { - "type": "secret", - "description": "proof of payment" - }, - "label": { - "type": "string", - "description": "the label, if given to sendpay" - }, - "bolt11": { - "type": "string", - "description": "the bolt11 string (if pay supplied one)" - }, - "bolt12": { - "type": "string", - "description": "the bolt12 string (if supplied for pay: **experimental-offers** only)." - }, - "erroronion": { - "type": "hex", - "description": "the error onion returned on failure, if any." - } - } - } - } - } - }, - "disableinvoicerequest.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "added": "v22.11", - "required": [ - "invreq_id" + "author": [ + "Mark Beckwith <> and Rusty Russell <> are mainly responsible." ], - "properties": { - "invreq_id": { - "type": "string", - "description": "a specific invoice can be disabled by providing the `invreq_id`, which is presented by lightning-invoicerequest(7)" - } - } + "resources": [ + "Main web site: " + ] }, - "disableinvoicerequest.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-checkmessage.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "invreq_id", - "single_use", - "active", - "bolt12", - "used" + "rpc": "checkmessage", + "title": "Command to check if a signature is from a node", + "description": [ + "The **checkmessage** RPC command is the counterpart to **signmessage**: given a node id (*pubkey*), signature (*zbase*) and a *message*, it verifies that the signature was generated by that node for that message (more technically: by someone who knows that node's secret).", + "", + "As a special case, if *pubkey* is not specified, we will try every known node key (as per *listnodes*), and verification succeeds if it matches for any one of them. Note: this is implemented far more efficiently than trying each one, so performance is not a concern." ], - "added": "v22.11", - "properties": { - "invreq_id": { - "type": "hash", - "description": "the SHA256 hash of all invoice_request fields less than 160" - }, - "active": { - "type": "boolean", - "enum": [ - false - ], - "description": "whether the invoice_request is currently active" - }, - "single_use": { - "type": "boolean", - "description": "whether the invoice_request will become inactive after we pay an invoice for it" - }, - "bolt12": { - "type": "string", - "description": "the bolt12 string starting with lnr" - }, - "used": { - "type": "boolean", - "description": "whether the invoice_request has already been used" - }, - "label": { - "type": "string", - "description": "the label provided when creating the invoice_request" + "request": { + "required": [ + "message", + "zbase" + ], + "properties": { + "message": { + "type": "string", + "description": [ + "Message to be checked against the signature." + ] + }, + "zbase": { + "type": "string", + "description": [ + "The Zbase32 encoded signature to verify." + ] + }, + "pubkey": { + "type": "pubkey", + "description": [ + "The Zbase32 encoded signature to verify." + ] + } } - } - }, - "disableoffer.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "offer_id" - ], - "properties": { - "offer_id": { - "type": "hash", - "description": "the id we use to identify this offer" + }, + "response": { + "required": [ + "verified", + "pubkey" + ], + "properties": { + "verified": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Whether the signature was valid." + ] + }, + "pubkey": { + "type": "pubkey", + "description": [ + "The *pubkey* parameter, or the pubkey found by looking for known nodes." + ] + } } - } - }, - "disableoffer.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "offer_id", - "active", - "single_use", - "bolt12", - "used" - ], - "additionalProperties": false, - "properties": { - "offer_id": { - "type": "hash", - "description": "the merkle hash of the offer" - }, - "active": { - "type": "boolean", - "enum": [ - false - ], - "description": "Whether the offer can produce invoices/payments" - }, - "single_use": { - "type": "boolean", - "description": "Whether the offer is disabled after first successful use" - }, - "bolt12": { - "type": "string", - "description": "The bolt12 string representing this offer" - }, - "used": { - "type": "boolean", - "description": "Whether the offer has had an invoice paid / payment made" + }, + "example_json_request": [ + { + "id": "example:checkmessage#1", + "method": "checkmessage", + "params": { + "message": "testcase to check new rpc error", + "zbase": "d66bqz3qsku5fxtqsi37j11pci47ydxa95iusphutggz9ezaxt56neh77kxe5hyr41kwgkncgiu94p9ecxiexgpgsz8daoq4tw8kj8yx", + "pubkey": "03be3b0e9992153b1d5a6e1623670b6c3663f72ce6cf2e0dd39c0a373a7de5a3b7" + } }, - "label": { - "type": "string", - "description": "The label provided when offer was created" + { + "id": "example:checkmessage#2", + "method": "checkmessage", + "params": { + "message": "this is a test!", + "zbase": "d6tqaeuonjhi98mmont9m4wag7gg4krg1f4txonug3h31e9h6p6k6nbwjondnj46dkyausobstnk7fhyy998bhgc1yr98dfmhb4k54d7", + "pubkey": null + } } - } - }, - "disconnect.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "id" ], - "properties": { - "id": { - "type": "pubkey", - "description": "the public key of the peer to terminate the connection.\tIt can be discovered in the output of the listpeers command, which returns a set of peers:\t{\t\t'peers': [\t\t\t{\t\t\t'id': '0563aea81...',\t\t\t'connected': true,\t\t\t...\t\t}\t\t]\t}" + "example_json_response": [ + { + "pubkey": "03be3b0e9992153b1d5a6e1623670b6c3663f72ce6cf2e0dd39c0a373a7de5a3b7", + "verified": true }, - "force": { - "type": "boolean", - "description": "if set to True, it will disconnect even with an active channel" + { + "pubkey": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "verified": true } - } - }, - "disconnect.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "properties": {} - }, - "emergencyrecover.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": {} + ], + "errors": [ + "On failure, an error is returned and core lightning exit with the following error code:", + "", + "- -32602: Parameter missed or malformed;", + "- 1301: *pubkey* not found in the graph." + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-signmessage(7)" + ], + "resources": [ + "Main web site: " + ] }, - "emergencyrecover.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-checkrune.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "stubs" + "added": "v23.08", + "rpc": "checkrune", + "title": "Command to Validate Rune", + "description": [ + "The **checkrune** RPC command checks the validity/authorization rights of specified rune for the given nodeid, method, and params.", + "", + "If successful, the rune \"usage\" counter (used for ratelimiting) is incremented.", + "", + "See lightning-createrune(7) for the fields in the rune which are checked." ], - "properties": { - "stubs": { - "type": "array", - "items": { - "type": "hash", - "description": "Channel IDs of channels successfully inserted." + "request": { + "required": [ + "rune" + ], + "properties": { + "rune": { + "type": "string", + "description": [ + "Rune to check for authorization." + ] + }, + "nodeid": { + "type": "string", + "description": [ + "Node id of requesting node *(required until v23.11)*." + ] + }, + "method": { + "type": "string", + "description": [ + "Method for which rune needs to be validated *(required until v23.11)*." + ] + }, + "params": { + "oneOf": [ + { + "type": "array", + "description": [ + "Array of positional parameters." + ] + }, + { + "type": "object", + "description": [ + "Parameters for method." + ] + } + ] } } - } - }, - "feerates.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "style" - ], - "properties": { - "style": { - "type": "string", - "description": "\t*perkw* - provide feerate in units of satoshis per 1000 weight (e.g. the minimum fee is usually `253perkw`)\t*perkb* - provide feerate in units of satoshis per 1000 virtual bytes (eg. the minimum fee is usually `1000perkb`)", - "enum": [ - "perkb", - "perkw" - ] - } - } - }, - "feerates.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "warning_missing_feerates": { - "type": "string", - "description": "Some fee estimates are missing" - }, - "perkb": { - "type": "object", - "description": "If *style* parameter was perkb", - "additionalProperties": false, - "required": [ - "min_acceptable", - "max_acceptable", - "floor", - "estimates" - ], - "properties": { - "min_acceptable": { - "type": "u32", - "description": "The smallest feerate that we allow peers to specify: half the 100-block estimate" - }, - "max_acceptable": { - "type": "u32", - "description": "The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet)." - }, - "floor": { - "type": "u32", - "added": "v23.05", - "description": "The smallest feerate that our backend tells us it will accept (i.e. minrelayfee or mempoolminfee)" - }, - "estimates": { - "type": "array", - "added": "v23.05", - "description": "Feerate estimates from plugin which we are using (usuallly bcli)", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "blockcount", - "feerate", - "smoothed_feerate" - ], - "properties": { - "blockcount": { - "type": "u32", - "added": "v23.05", - "description": "The number of blocks the feerate is expected to get a transaction in" - }, - "feerate": { - "type": "u32", - "added": "v23.05", - "description": "The feerate for this estimate, in given *style*" - }, - "smoothed_feerate": { - "type": "u32", - "added": "v23.05", - "description": "The feerate, smoothed over time (useful for coordinating with other nodes)" - } - } - } - }, - "opening": { - "type": "u32", - "description": "Default feerate for lightning-fundchannel(7) and lightning-withdraw(7)" - }, - "mutual_close": { - "type": "u32", - "description": "Feerate to aim for in cooperative shutdown. Note that since mutual close is a **negotiation**, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer." - }, - "unilateral_close": { - "type": "u32", - "description": "Feerate for commitment_transaction in a live channel which we originally funded" - }, - "unilateral_anchor_close": { - "type": "u32", - "added": "v23.08", - "description": "Feerate for commitment_transaction in a live channel which we originally funded (if anchor_outputs was negotiated)" - }, - "delayed_to_us": { - "type": "u32", - "deprecated": [ - "v23.05", - "v24.05" - ], - "description": "Feerate for returning unilateral close funds to our wallet" - }, - "htlc_resolution": { - "type": "u32", - "deprecated": [ - "v23.05", - "v24.05" - ], - "description": "Feerate for returning unilateral close HTLC outputs to our wallet" - }, - "penalty": { - "type": "u32", - "description": "Feerate to use when creating penalty tx for watchtowers" + }, + "response": { + "required": [ + "valid" + ], + "properties": { + "valid": { + "type": "boolean", + "description": [ + "True if the rune is valid." + ] + } + } + }, + "errors": [ + "The following error codes may occur:", + "", + "- 1501 (RUNE_NOT_AUTHORIZED): rune is not for this node (or perhaps completely invalid)", + "- 1502 (RUNE_NOT_PERMITTED): rune does not allow this usage (includes a detailed reason why)", + "- 1503 (RUNE_BLACKLISTED): rune has been explicitly blacklisted." + ], + "example_json_request": [ + { + "id": "example:checkrune#1", + "method": "checkrune", + "params": { + "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "rune": "617Obfct0oRBj_uqGFQxDk3XZ1sDFiC2Q5ltm5z1i_k9NSZtZXRob2Q9aW52b2ljZSZwbmFtZWRlc2NyaXB0aW9uPUB0aXBqYXJcfGpiNTVAc2VuZHNhdHMubG9s", + "method": "invoice", + "params": { + "amount_msat": "any", + "label": "lbl", + "description": [ + "@tipjar|jb55@sendsats.lol." + ] } } }, - "perkw": { - "type": "object", - "description": "If *style* parameter was perkw", - "additionalProperties": false, - "required": [ - "min_acceptable", - "max_acceptable", - "floor", - "estimates" - ], - "properties": { - "min_acceptable": { - "type": "u32", - "description": "The smallest feerate that you can use, usually the minimum relayed feerate of the backend" - }, - "max_acceptable": { - "type": "u32", - "description": "The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet)." - }, - "floor": { - "type": "u32", - "added": "v23.05", - "description": "The smallest feerate that our backend tells us it will accept (i.e. minrelayfee or mempoolminfee)" - }, - "estimates": { - "type": "array", - "added": "v23.05", - "description": "Feerate estimates from plugin which we are using (usuallly bcli)", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "blockcount", - "feerate", - "smoothed_feerate" - ], - "properties": { - "blockcount": { - "type": "u32", - "added": "v23.05", - "description": "The number of blocks the feerate is expected to get a transaction in" - }, - "feerate": { - "type": "u32", - "added": "v23.05", - "description": "The feerate for this estimate, in given *style*" - }, - "smoothed_feerate": { - "type": "u32", - "added": "v23.05", - "description": "The feerate, smoothed over time (useful for coordinating with other nodes)" - } - } - } - }, - "opening": { - "type": "u32", - "description": "Default feerate for lightning-fundchannel(7) and lightning-withdraw(7)" - }, - "mutual_close": { - "type": "u32", - "description": "Feerate to aim for in cooperative shutdown. Note that since mutual close is a **negotiation**, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer." - }, - "unilateral_close": { - "type": "u32", - "description": "Feerate for commitment_transaction in a live channel which we originally funded (if anchor_outputs was not negotiated)" - }, - "unilateral_anchor_close": { - "type": "u32", - "added": "v23.08", - "description": "Feerate for commitment_transaction in a live channel which we originally funded (if anchor_outputs was negotiated)" - }, - "delayed_to_us": { - "type": "u32", - "deprecated": [ - "v23.05", - "v24.05" - ], - "description": "Feerate for returning unilateral close funds to our wallet" - }, - "htlc_resolution": { - "type": "u32", - "deprecated": [ - "v23.05", - "v24.05" - ], - "description": "Feerate for returning unilateral close HTLC outputs to our wallet" - }, - "penalty": { - "type": "u32", - "description": "Feerate to use when creating penalty tx for watchtowers" - } + { + "id": "example:checkrune#2", + "method": "checkrune", + "params": { + "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==", + "method": "listpeers", + "params": {} } }, - "onchain_fee_estimates": { - "type": "object", - "additionalProperties": false, - "required": [ - "opening_channel_satoshis", - "mutual_close_satoshis", - "unilateral_close_satoshis", - "htlc_timeout_satoshis", - "htlc_success_satoshis" - ], - "properties": { - "opening_channel_satoshis": { - "type": "u64", - "description": "Estimated cost of typical channel open" - }, - "mutual_close_satoshis": { - "type": "u64", - "description": "Estimated cost of typical channel close" - }, - "unilateral_close_satoshis": { - "type": "u64", - "description": "Estimated cost of typical unilateral close (without HTLCs). If anchors are supported, this assumes a channel with anchors." - }, - "unilateral_close_nonanchor_satoshis": { - "added": "v23.08", - "type": "u64", - "description": "Estimated cost of non-anchor typical unilateral close (without HTLCs)." - }, - "htlc_timeout_satoshis": { - "type": "u64", - "description": "Estimated cost of typical HTLC timeout transaction (non-anchors)" - }, - "htlc_success_satoshis": { - "type": "u64", - "description": "Estimated cost of typical HTLC fulfillment transaction (non-anchors)" + { + "id": "example:checkrune#3", + "method": "checkrune", + "params": { + "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "rune": "617Obfct0oRBj_uqGFQxDk3XZ1sDFiC2Q5ltm5z1i_k9NSZtZXRob2Q9aW52b2ljZSZwbmFtZWRlc2NyaXB0aW9uPUB0aXBqYXJcfGpiNTVAc2VuZHNhdHMubG9s", + "method": "invoice", + "params": { + "amount_msat": "any", + "label": "lbl", + "description": "@tipjar|jb55@sendsats.lol" } } } - } - }, - "fetchinvoice.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "offer" ], - "additionalProperties": false, - "properties": { - "offer": { - "type": "string", - "description": "offer string to get an actual invoice that can be paid" - }, - "amount_msat": { - "type": "msat", - "description": "required if the offer does not specify an amount at all, otherwise it is optional (but presumably if you set it to less than the offer, you will get an error from the issuer)" - }, - "quantity": { - "type": "u64", - "description": "required if the offer specifies quantity_max, otherwise it is not allowed" - }, - "recurrence_counter": { - "type": "u64", - "description": "required if the offer specifies recurrence, otherwise it is not allowed. recurrence_counter should first be set to 0, and incremented for each successive invoice in a given series" - }, - "recurrence_start": { - "type": "number", - "description": "required if the offer specifies recurrence_base with start_any_period set, otherwise it is not allowed. It indicates what period number to start at" - }, - "recurrence_label": { - "type": "string", - "description": "required if recurrence_counter is set, and otherwise is not allowed. It must be the same as prior fetchinvoice calls for the same recurrence, as it is used to link them together" + "example_json_response": [ + { + "valid": true }, - "timeout": { - "type": "number", - "description": "if we don't get a reply before this we fail (default, 60 seconds)" + { + "valid": true }, - "payer_note": { - "type": "string", - "description": "to ask the issuer to include in the fetched invoice" + { + "valid": true } - } + ], + "author": [ + "Shahana Farooqui <> is mainly responsible for consolidating logic from commando." + ], + "see_also": [ + "lightning-createrune(7)", + "lightning-blacklistrune(7)" + ], + "resources": [ + "Main web site: " + ] }, - "fetchinvoice.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-close.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "invoice", - "changes" - ], - "properties": { - "invoice": { - "type": "string", - "description": "The BOLT12 invoice we fetched" - }, - "changes": { - "type": "object", - "description": "Summary of changes from offer", - "additionalProperties": false, - "required": [], - "properties": { - "description_appended": { - "type": "string", - "description": "extra characters appended to the *description* field." - }, - "description": { - "type": "string", - "description": "a completely replaced *description* field" - }, - "vendor_removed": { - "type": "string", - "description": "The *vendor* from the offer, which is missing in the invoice" - }, - "vendor": { - "type": "string", - "description": "a completely replaced *vendor* field" - }, - "amount_msat": { - "type": "msat", - "description": "the amount, if different from the offer amount multiplied by any *quantity* (or the offer had no amount, or was not in BTC)." - } - } - }, - "next_period": { - "type": "object", - "description": "Only for recurring invoices if the next period is under the *recurrence_limit*", - "additionalProperties": false, - "required": [ - "counter", - "starttime", - "endtime", - "paywindow_start", - "paywindow_end" - ], - "properties": { - "counter": { - "type": "u64", - "description": "the index of the next period to fetchinvoice" - }, - "starttime": { - "type": "u64", - "description": "UNIX timestamp that the next period starts" - }, - "endtime": { - "type": "u64", - "description": "UNIX timestamp that the next period ends" - }, - "paywindow_start": { - "type": "u64", - "description": "UNIX timestamp of the earliest time that the next invoice can be fetched" + "rpc": "close", + "title": "Command for closing channels with direct peers", + "description": [ + "The **close** RPC command attempts to close the channel cooperatively with the peer, or unilaterally after *unilateraltimeout*, and the to-local output will be sent to the address specified in *destination*.", + "", + "The peer needs to be live and connected in order to negotiate a mutual close. The default of unilaterally closing after 48 hours is usually a reasonable indication that you can no longer contact the peer." + ], + "request": { + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string", + "description": [ + "Peer id, channel id or short_channel_id. If the given *id* is a peer ID (66 hex digits as a string), then it applies to the active channel of the direct peer corresponding to the given peer ID. If the given *id* is a channel ID (64 hex digits as a string, or the short channel ID *blockheight:txindex:outindex* form), then it applies to that channel." + ] + }, + "unilateraltimeout": { + "type": "u32", + "description": [ + "If it is not zero, the command will unilaterally close the channel when that number of seconds is reached. If *unilateraltimeout* is zero, then the command will wait indefinitely until the peer is online and can negotiate a mutual close." + ], + "default": "2 days (172800 seconds)" + }, + "destination": { + "type": "string", + "description": [ + "Any Bitcoin bech32 type. If the peer hasn't offered the option_shutdown_anysegwit feature, then taproot addresses (or other v1+ segwit) are not allowed. Tell your friends to upgrade!" + ], + "default": "a Core Lightning wallet address" + }, + "fee_negotiation_step": { + "type": "string", + "description": [ + "It controls how closing fee negotiation is performed assuming the peer proposes a fee that is different than our estimate. (Note that modern peers use the quick-close protocol which does not allow negotiation: see *feerange* instead).", + "", + "On every negotiation step we must give up some amount from our proposal towards the peer's proposal. This parameter can be an integer in which case it is interpreted as number of satoshis to step at a time. Or it can be an integer followed by `%` to designate a percentage of the interval to give up. A few examples, assuming the peer proposes a closing fee of 3000 satoshi and our estimate shows it must be 4000:", + " * `10`: our next proposal will be 4000-10=3990.", + " * `10%`: our next proposal will be 4000-(10% of (4000-3000))=3900.", + " * '1': our next proposal will be 3999. This is the most extreme case when we insist on our fee as much as possible.", + " * `100%`: our next proposal will be 3000. This is the most relaxed case when we quickly accept the peer's proposal." + ], + "default": "`50%`" + }, + "wrong_funding": { + "type": "outpoint", + "description": [ + "It can only be specified if both sides have offered the `shutdown_wrong_funding` feature (enabled by the **experimental-shutdown-wrong-funding** option). It must be a transaction id followed by a colon then the output number. Instead of negotiating a shutdown to spend the expected funding transaction, the shutdown transaction will spend this output instead. This is only allowed if this peer opened the channel and the channel is unused: it can rescue openings which have been manually miscreated." + ] + }, + "force_lease_closed": { + "type": "boolean", + "description": [ + "If the channel has funds leased to the peer (option_will_fund), we prevent initiation of a mutual close unless this flag is passed in." + ], + "default": "False" + }, + "feerange": { + "type": "array", + "items": { + "type": "feerate" }, - "paywindow_end": { - "type": "u64", - "description": "UNIX timestamp of the latest time that the next invoice can be fetched" - } + "description": [ + "An optional array [ *min*, *max* ], indicating the minimum and maximum feerates to offer: the peer will obey these if it supports the quick-close protocol. *slow* and *unilateral_close* are the defaults. Note that the maximum fee will be capped at the final commitment transaction fee (unless the experimental anchor-outputs option is negotiated)." + ] } } - } - }, - "fundchannel.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "amount" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "id is the peer id obtained from connect" - }, - "amount": { - "type": "msat_or_all", - "description": "the amount in satoshis taken from the internal wallet to fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). The string *all* can be used to specify all available funds (or 16777215 satoshi if more is available and large channels were not negotiated with the peer). Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The value cannot be less than the dust limit, currently set to 546, nor more than 16777215 satoshi (unless large channels were negotiated with the peer)" - }, - "feerate": { - "type": "feerate", - "description": "used for the opening transaction and (unless *option_anchors_zero_fee_htlc_tx* is negotiated), as initial feerate for commitment and HTLC transactions (see NOTES in lightning-feerates(7)). The default is *normal*" - }, - "announce": { - "type": "boolean", - "description": "whether to announce this channel or not. An unannounced channel is considered private. Defaults to *True*" - }, - "minconf": { - "type": "u32", - "description": "the minimum number of confirmations that used outputs should have. Default is 1" - }, - "push_msat": { - "type": "msat", - "description": "the amount of millisatoshis to push to the channel peer at open. Note that this is a gift to the peer -- these satoshis are added to the initial balance of the peer at channel start and are largely unrecoverable once pushed" - }, - "close_to": { - "type": "string", - "description": "a Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. Returns `close_to` set to closing script iff is negotiated" - }, - "request_amt": { - "type": "msat", - "description": "an amount of liquidity you'd like to lease from the peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*" - }, - "compact_lease": { - "type": "string", - "description": "a compact represenation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel" - }, - "utxos": { - "type": "array", - "description": "the utxos to be used to fund the channel, as an array of `txid:vout`", - "items": { - "type": "outpoint" - } - }, - "mindepth": { - "description": "Number of confirmations required before we consider the channel active", - "type": "u32" - }, - "reserve": { - "type": "msat", - "description": "the amount we want the peer to maintain on its side of the channel. Default is 1% of the funding amount. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" - }, - "channel_type": { - "added": "v24.02", - "type": "array", - "items": { - "type": "u32" + }, + "response": { + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "mutual", + "unilateral", + "unopened" + ], + "description": [ + "Whether we successfully negotiated a mutual close, closed without them, or discarded not-yet-opened channel." + ] } - } - } - }, - "fundchannel.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "tx", - "txid", - "outnum", - "channel_type", - "channel_id" - ], - "properties": { - "tx": { - "type": "hex", - "description": "The raw transaction which funded the channel" - }, - "txid": { - "type": "txid", - "description": "The txid of the transaction which funded the channel" }, - "outnum": { - "type": "u32", - "description": "The 0-based output index showing which output funded the channel" - }, - "channel_id": { - "type": "hex", - "description": "The channel_id of the resulting channel", - "minLength": 64, - "maxLength": 64 - }, - "channel_type": { - "type": "object", - "description": "channel_type as negotiated with peer", - "added": "v24.02", - "additionalProperties": false, - "required": [ - "bits", - "names" - ], - "properties": { - "bits": { - "type": "array", - "description": "Each bit set in this channel_type", - "added": "v24.02", - "items": { - "type": "u32", - "description": "Bit number" + "allOf": [ + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "mutual", + "unilateral" + ] + } } }, - "names": { - "type": "array", - "description": "Feature name for each bit set in this channel_type", - "added": "v24.02", - "items": { - "type": "string", - "enum": [ - "static_remotekey/even", - "anchor_outputs/even", - "anchors_zero_fee_htlc_tx/even", - "scid_alias/even", - "zeroconf/even" - ], - "description": "Name of feature bit" + "then": { + "additionalProperties": false, + "required": [ + "tx", + "txid" + ], + "properties": { + "type": {}, + "tx": { + "type": "hex", + "description": [ + "The raw bitcoin transaction used to close the channel (if it was open)." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The transaction id of the *tx* field." + ] + } + } + }, + "else": { + "additionalProperties": false, + "properties": { + "type": {} } } } - }, - "close_to": { - "type": "hex", - "description": "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`" - }, - "mindepth": { - "type": "u32", - "description": "Number of confirmations before we consider the channel active." - } - } - }, - "fundchannel_cancel.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "id" + ], + "post_return_value_notes": [ + "A unilateral close may still occur at any time if the peer did not behave correctly during the close negotiation.", + "", + "Unilateral closes will return your funds after a delay. The delay will vary based on the peer *to_self_delay* setting, not your own setting." + ] + }, + "notes": [ + "Prior to 0.7.2, **close** took two parameters: *force* and *timeout*. *timeout* was the number of seconds before *force* took effect (default, 30), and *force* determined whether the result was a unilateral close or an RPC error (default). Even after the timeout, the channel would be closed if the peer reconnected." ], - "properties": { - "id": { - "type": "pubkey", - "description": "node id of the remote peer with which to cancel" - } - } - }, - "fundchannel_cancel.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "cancelled" + "notifications": [ + "Notifications may be returned indicating what is going on, especially if the peer is offline and we are waiting." ], - "properties": { - "cancelled": { - "type": "string", - "description": "A message indicating it was cancelled by RPC" - } - } - }, - "fundchannel_complete.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "psbt" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "node id of the remote peer" + "example_json_request": [ + { + "id": "example:close#1", + "method": "close", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "unilateraltimeout": 1, + "destination": null, + "fee_negotiation_step": null, + "force_lease_closed": null, + "feerange": null + } }, - "psbt": { - "type": "string", - "description": "transaction to use for funding (does not need to be signed but must be otherwise complete)" - } - } - }, - "fundchannel_complete.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channel_id", - "commitments_secured" - ], - "properties": { - "channel_id": { - "type": "hex", - "description": "The channel_id of the resulting channel", - "minLength": 64, - "maxLength": 64 + { + "id": "example:close#2", + "method": "close", + "params": { + "id": "103x1x0", + "unilateraltimeout": null, + "destination": "bcrt1qeyyk6sl5pr49ycpqyckvmttus5ttj25pd0zpvg", + "fee_negotiation_step": null, + "force_lease_closed": null, + "feerange": null + } }, - "commitments_secured": { - "type": "boolean", - "enum": [ - true - ], - "description": "Indication that channel is safe to use" + { + "id": "example:close#3", + "method": "close", + "params": [ + "107x1x0", + null, + "bcrt1qeyyk6sl5pr49ycpqyckvmttus5ttj25pd0zpvg" + ] } - } - }, - "fundchannel_start.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "amount" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "node id of the remote peer" - }, - "amount": { - "type": "sat", - "description": "satoshi value that the channel will be funded at. This value MUST be accurate, otherwise the negotiated commitment transactions will not encompass the correct channel value" - }, - "feerate": { - "type": "feerate", - "description": "feerate for subsequent commitment transactions: see **fundchannel**. Note that this is ignored for channels with *option_anchors_zero_fee_htlc_tx* (we always use a low commitment fee for these)" - }, - "announce": { - "type": "boolean", - "description": "whether or not to announce this channel" - }, - "close_to": { - "type": "string", - "description": "bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. Returns `close_to` set to closing script iff is negotiated" - }, - "push_msat": { - "type": "msat", - "description": "amount of millisatoshis to push to the channel peer at open. Note that this is a gift to the peer -- these satoshis are added to the initial balance of the peer at channel start and are largely unrecoverable once pushed" - }, - "mindepth": { - "type": "u32", - "description": "Number of confirmations required before we consider the channel active" + ], + "example_json_response": [ + { + "tx": "020000000001018d388ffcd216c92d25163a62096ce47d5c9bbd6270ced51c5a1484f89df33e5700000000009db0e28002a00f00000000000016001445503fa4b65ade3ffdb1a92057688456c9ffae1380130f0000000000220020be82765fdb17fd5568f2dd31c6cf1aabc620ef338995ec5d9a2f3e42f43ae4870400473044022058dcde893655f40fc8162a79596440ef3e304273f8d530401fc17bc92c58159b0220428900ca6537538ba237d569a4a09003d663a991aeb331a9f18dfe807ee78806014730440220111270eeed8b4b1a231d3ce6e0e0daad718623ad159a0fd3781fb18118a8fec70220539826ee7c76cad4116d1d8852329f80314b3434cf21c765d8004186451a4cd50147522102324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b2102e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5752ae9c3ed620", + "txid": "5d8d917dd7d39fe5a12f121457fc6d712b5e393ed4f16bc8f5976fc08cbbfecd", + "type": "unilateral" }, - "reserve": { - "type": "msat", - "description": "The amount we want the peer to maintain on its side" + { + "tx": "0200000000010132cbce7d5f96b4003c3b5c0eab2a29fef90bb6abb833ff312fa122f31e8301810000000000ffffffff02a0860100000000002251205779a060f200d40e8f871a40eb91614cc5bfa6d0a5f852e053400a7feff8615005b10d0000000000160014c9096d43f408ea526020262ccdad7c8516b92a81040047304402207e171d056e81cf8ad2d5a613ecbaa212d5dcbd0bf713145d18911d2cbe9d858802206222911660a26d7ffddc2563ae6d41d6ffad9fbd2fc26cf40eab501a31153b9e0147304402204ae7cdc68dc7966eab73f16a1978643336333d54ae0b6f87bc11a2c19174a9710220601e5276aee0825466cc272c4eb7d353b393ef0dd230d303f46772790dee19190147522102324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b2102e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5752ae00000000", + "txid": "4a08e0508e2e39ea033fab5f77b318337f345550421799f6e0eb1b15a892eda4", + "type": "mutual" }, - "channel_type": { - "type": "array", - "description": "Each bit set in this channel_type", - "items": { - "type": "u32", - "description": "Bit number" - } + { + "tx": "02000000000101233b513665836d240423f45ffcd1fe19aeb08d62303fa5382ad3285f770683a60000000000ffffffff02a086010000000000225120b47216ab60a0fad97de0ba9b8b370d281dfe55f552d82034e2a8d054c2246e4405b10d0000000000160014c9096d43f408ea526020262ccdad7c8516b92a81040047304402207a9e3ca258861b33827d91514690a757e76730ba8c15dd222340bb13d993a1a502204d0ae329273b69abe62df1ffccce808d5f1a29101a8ee95dae99888376dbaef801473044022033c03f406db9f1c9d924cfd8f6ea42d0962f0ab02e3217aef518aea517ca5ba40220076e2af9d40c676316a2765a86f9efd481de3fc4465ceba33b0782c505ae3452014752210212284c004a3d24146e54b2a24db48f650370a08e1fe9abe8ff41f92b09cd50542102a3032ef980cc735579aa5295d927b9a1bdbafc459f2da14163dc9bd530e0a21152ae00000000", + "txid": "d44a1374a30c1a936d2d4fdbe73c0ffff42fec8c27c6cbaec2758b3042f61d08", + "type": "mutual" } - } + ], + "author": [ + "ZmnSCPxj <> is mainly responsible." + ], + "see_also": [ + "lightning-disconnect(7)", + "lightning-fundchannel(7)", + "lightningd-config(5)" + ], + "resources": [ + "Main web site: " + ] }, - "fundchannel_start.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-commando-blacklist.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "funding_address", - "scriptpubkey", - "channel_type", - "warning_usage" - ], - "properties": { - "funding_address": { - "type": "string", - "description": "The address to send funding to for the channel. DO NOT SEND COINS TO THIS ADDRESS YET." - }, - "scriptpubkey": { - "type": "hex", - "description": "The raw scriptPubkey for the address" + "added": "v23.05", + "deprecated": [ + "v23.08", + "v24.08" + ], + "rpc": "commando-blacklist", + "title": "Command to prevent a rune from working", + "description": [ + "The **commando-blacklist** RPC command allows you to effectively revoke the rune you have created (and any runes derived from that rune with additional restictions). Attempting to use these runes will be resulted in a `Blacklisted rune` error message.", + "", + "All runes created by commando have a unique sequential id within them and can be blacklisted in ranges for efficiency. The command always returns the blacklisted ranges on success. If no parameters are specified, no changes have been made. If start specified without end, that single rune is blacklisted. If end is also specified, every rune from start till end inclusive is blacklisted." + ], + "request": { + "required": [], + "properties": { + "start": { + "type": "u64", + "description": [ + "First rune unique id to blacklist." + ] + }, + "end": { + "type": "u64", + "description": [ + "Final rune unique id to blacklist (defaults to start)." + ] + } }, - "channel_type": { - "type": "object", - "description": "channel_type as negotiated with peer", - "added": "v24.02", - "additionalProperties": false, - "required": [ - "bits", - "names" - ], - "properties": { - "bits": { - "type": "array", - "added": "v24.02", - "description": "Each bit set in this channel_type", - "items": { - "type": "u32", - "description": "Bit number" - } - }, - "names": { - "type": "array", - "description": "Feature name for each bit set in this channel_type", - "added": "v24.02", - "items": { - "type": "string", - "enum": [ - "static_remotekey/even", - "anchor_outputs/even", - "anchors_zero_fee_htlc_tx/even", - "scid_alias/even", - "zeroconf/even" - ], - "description": "Name of feature bit" + "dependentUpon": { + "start": [ + "end" + ] + } + }, + "response": { + "required": [ + "blacklist" + ], + "properties": { + "blacklist": { + "type": "array", + "description": [ + "The resulting blacklist ranges after the command." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "start", + "end" + ], + "properties": { + "start": { + "type": "u64", + "description": [ + "Unique id of first rune in this blacklist range." + ] + }, + "end": { + "type": "u64", + "description": [ + "Unique id of last rune in this blacklist range." + ] + } } } } - }, - "close_to": { - "type": "hex", - "description": "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`" - }, - "warning_usage": { - "type": "string", - "description": "A warning not to prematurely broadcast the funding transaction (always present!)" - }, - "mindepth": { - "type": "u32", - "description": "Number of confirmations before we consider the channel active." } - } - }, - "funderupdate.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "policy": { - "type": "string", - "enum": [ - "match", - "available", - "fixed" - ], - "description": "funder plugin will use to decide how much captial to commit to a v2 open channel request.\n\tThere are three policy options, detailed below:\n\t* `match` -- Contribute *policy_mod* percent of their requested funds.\n\tValid *policy_mod* values are 0 to 200. If this is a channel lease\n\trequest, we match based on their requested funds. If it is not a\n\tchannel lease request (and *lease_only* is false), then we match\n\ttheir funding amount. Note: any lease match less than 100 will\n\tlikely fail, as clients will not accept a lease less than their request.\n\t* `available` -- Contribute *policy_mod* percent of our available\n\tnode wallet funds. Valid *policy_mod* values are 0 to 100.\n\t* `fixed` -- Contributes a fixed *policy_mod* sats to v2 channel open requests.\n\tDefault is fixed" - }, - "policy_mod": { - "type": "sat", - "description": "number or 'modification' to apply to the policy. Default is 0sats" - }, - "leases_only": { - "type": "boolean", - "description": "only contribute funds to `option_will_fund` requests which pay to lease funds. It will fund any v2 open request using *policy* even if it's they're not seeking to lease funds. Note that `option_will_fund` commits funds for 4032 blocks (~1mo). Must also set *lease_fee_base_msat*, *lease_fee_basis*, *funding_weight*, *channel_fee_max_base_msat*, and *channel_fee_max_proportional_thousandths* to advertise available channel leases. Defaults to *False*" - }, - "min_their_funding_msat": { - "type": "msat", - "description": "minimum funding sats that we require in order to activate our contribution policy to the v2 open. Defaults to 10k sats" - }, - "max_their_funding_msat": { - "type": "msat", - "description": "maximum funding sats that we will consider to activate our contribution policy to the v2 open. Any channel open above this will not be funded. Defaults to no max (`UINT_MAX`)" - }, - "per_channel_min_msat": { - "type": "msat", - "description": "minimum amount that we will contribute to a channel open. Defaults to 10k sats" - }, - "per_channel_max_msat": { - "type": "msat", - "description": "maximum amount that we will contribute to a channel open. Defaults to no max (`UINT_MAX`)" - }, - "reserve_tank_msat": { - "type": "msat", - "description": "amount of sats to leave available in the node wallet. Defaults to zero sats" - }, - "fuzz_percent": { - "type": "u32", - "description": "a percentage to fuzz the resulting contribution amount by. Valid values are 0 to 100. Note that turning this on with (match, 100) policy will randomly fail `option_will_fund` leases, as most clients expect an exact or greater match of their `requested_funds`. Defaults to 0% (no fuzz)" - }, - "fund_probability": { - "type": "u32", - "description": "the percent of v2 channel open requests to apply our policy to. Valid values are integers from 0 (fund 0% of all open requests) to 100 (fund every request). Useful for randomizing opens that receive funds. Useful for randomizing opens that receive funds. Defaults to 100" - }, - "lease_fee_base_msat": { - "type": "msat", - "description": "flat fee for a channel lease. Node will receive this much extra added to their channel balance, paid by the opening node. Defaults to 2k sats. Note that the minimum is 1sat" - }, - "lease_fee_basis": { - "type": "u32", - "description": "a basis fee that's calculated as 1/10k of the total requested funds the peer is asking for. Node will receive the total of *lease_fee_basis* times requested funds / 10k satoshis added to their channel balance, paid by the opening node. Default is 0.65% (65 basis points)" - }, - "funding_weight": { - "type": "u32", - "description": "to calculate the fee the peer will compensate your node for its contributing inputs to the funding transaction. The total fee is calculated as the `open_channel2`.`funding_feerate_perkw` times this *funding_weight* divided by 1000. Node will have this funding fee added to their channel balance, paid by the opening node. Default is 2 inputs + 1 P2WPKH output" - }, - "channel_fee_max_base_msat": { - "type": "msat", - "description": "a commitment to a maximum `channel_fee_base_msat` that your node will charge for routing payments over this leased channel during the lease duration. Default is 5k sats" - }, - "channel_fee_max_proportional_thousandths": { - "type": "u32", - "description": "a commitment to a maximum `channel_fee_proportional_millionths` that your node will charge for routing payments over this leased channel during the lease duration. Note that it's denominated in 'thousandths'. A setting of `1` is equal to 1k ppm; `5` is 5k ppm, etc. Default is 100 (100k ppm)" - }, - "compact_lease": { - "type": "hex", - "description": "a compact description of the channel lease params. When opening a channel, passed in to `fundchannel` to indicate the terms we expect from the peer" - } - } - }, - "funderupdate.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "summary", - "policy", - "policy_mod", - "leases_only", - "min_their_funding_msat", - "max_their_funding_msat", - "per_channel_min_msat", - "per_channel_max_msat", - "reserve_tank_msat", - "fuzz_percent", - "fund_probability" - ], - "properties": { - "summary": { - "type": "string", - "description": "Summary of the current funding policy e.g. (match 100)" - }, - "policy": { - "type": "string", - "enum": [ - "match", - "available", - "fixed" - ], - "description": "Policy funder plugin will use to decide how much captial to commit to a v2 open channel request" - }, - "policy_mod": { - "type": "u32", - "description": "The *policy_mod* is the number or 'modification' to apply to the policy." - }, - "leases_only": { - "type": "boolean", - "description": "Only contribute funds to `option_will_fund` lease requests." - }, - "min_their_funding_msat": { - "type": "msat", - "description": "The minimum funding sats that we require from peer to activate our funding policy." - }, - "max_their_funding_msat": { - "type": "msat", - "description": "The maximum funding sats that we'll allow from peer to activate our funding policy." - }, - "per_channel_min_msat": { - "type": "msat", - "description": "The minimum amount that we will fund a channel open with." - }, - "per_channel_max_msat": { - "type": "msat", - "description": "The maximum amount that we will fund a channel open with." - }, - "reserve_tank_msat": { - "type": "msat", - "description": "Amount of sats to leave available in the node wallet." - }, - "fuzz_percent": { - "type": "u32", - "description": "Percentage to fuzz our funding amount by." - }, - "fund_probability": { - "type": "u32", - "description": "Percent of opens to consider funding. 100 means we'll consider funding every requested open channel request." - }, - "lease_fee_base_msat": { - "type": "msat", - "description": "Flat fee to charge for a channel lease." - }, - "lease_fee_basis": { - "type": "u32", - "description": "Proportional fee to charge for a channel lease, calculated as 1/10,000th of requested funds." - }, - "funding_weight": { - "type": "u32", - "description": "Transaction weight the channel opener will pay us for a leased funding transaction." - }, - "channel_fee_max_base_msat": { - "type": "msat", - "description": "Maximum channel_fee_base_msat we'll charge for routing funds leased on this channel." - }, - "channel_fee_max_proportional_thousandths": { - "type": "u32", - "description": "Maximum channel_fee_proportional_millitionths we'll charge for routing funds leased on this channel, in thousandths." - }, - "compact_lease": { - "type": "hex", - "description": "Compact description of the channel lease parameters." - } - } - }, - "fundpsbt.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "satoshi", - "feerate", - "startweight" - ], - "properties": { - "satoshi": { - "type": "msat_or_all", - "description": "the minimum satoshi value of the output(s) needed (or the string `all` meaning use all unreserved inputs). If a value, it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" - }, - "feerate": { - "type": "feerate", - "description": "used for the transaction as initial feerate. The default is *normal*" - }, - "startweight": { - "type": "u32", - "description": "the weight of the transaction before *fundpsbt* has added any inputs" - }, - "minconf": { - "type": "u32", - "description": "the minimum number of confirmations that used outputs should have. Default is 1" - }, - "reserve": { - "type": "u32", - "description": "if not zero, then *reserveinputs* is called (successfully, with *exclusive* true) on the returned PSBT for this number of blocks. Defaults to 72 blocks if unspecified" - }, - "locktime": { - "type": "u32", - "description": "the locktime of the transaction. if not set, it is set to a recent block height" - }, - "min_witness_weight": { - "type": "u32", - "description": "minimum weight to use for a UTXO's witness. If the actual witness weight is greater than the provided minimum, the actual witness weight will be used" - }, - "excess_as_change": { - "type": "boolean", - "description": "flag to add a change output for the excess sats" + }, + "example_json_request": [ + { + "id": "example:commando-blacklist#1", + "method": "commando-blacklist", + "params": { + "start": 2 + } }, - "nonwrapped": { - "added": "v23.02", - "type": "boolean", - "description": "to signal to filter out any p2sh-wrapped inputs from funding this PSBT" + { + "id": "example:commando-blacklist#2", + "method": "commando-blacklist", + "params": { + "start": 5, + "end": 7 + } }, - "opening_anchor_channel": { - "added": "v23.08", - "type": "boolean", - "description": "to signel that it needs emergency reserve for anchors so that we can lowball our commitment tx fees, and min-emergency-msat for reserving some sats for closing anchor channels" + { + "id": "example:commando-blacklist#3", + "method": "commando-blacklist", + "params": { + "start": 3, + "end": 4 + } } - } - }, - "fundpsbt.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt", - "feerate_per_kw", - "estimated_final_weight", - "excess_msat" - ], - "properties": { - "psbt": { - "type": "string", - "description": "Unsigned PSBT which fulfills the parameters given" - }, - "feerate_per_kw": { - "type": "u32", - "description": "The feerate used to create the PSBT, in satoshis-per-kiloweight" - }, - "estimated_final_weight": { - "type": "u32", - "description": "The estimated weight of the transaction once fully signed" - }, - "excess_msat": { - "type": "msat", - "description": "The amount above *satoshi* which is available. This could be zero, or dust; it will be zero if *change_outnum* is also returned" + ], + "example_json_response": [ + { + "blacklist": [ + { + "start": 2, + "end": 2 + } + ] }, - "change_outnum": { - "type": "u32", - "description": "The 0-based output number where change was placed (only if parameter *excess_as_change* was true and there was sufficient funds)" + { + "blacklist": [ + { + "start": 2, + "end": 2 + }, + { + "start": 5, + "end": 7 + } + ] }, - "reservations": { - "type": "array", - "description": "If *reserve* was true or a non-zero number, just as per lightning-reserveinputs(7)", - "items": { - "type": "object", - "required": [ - "txid", - "vout", - "was_reserved", - "reserved", - "reserved_to_block" - ], - "additionalProperties": false, - "properties": { - "txid": { - "type": "txid", - "description": "The txid of the transaction" - }, - "vout": { - "type": "u32", - "description": "The 0-based output number" - }, - "was_reserved": { - "type": "boolean", - "enum": [ - false - ], - "description": "Whether this output was previously reserved" - }, - "reserved": { - "type": "boolean", - "enum": [ - true - ], - "description": "Whether this output is now reserved" - }, - "reserved_to_block": { - "type": "u32", - "description": "The blockheight the reservation will expire" - } + { + "blacklist": [ + { + "start": 2, + "end": 7 } - } + ] } - } - }, - "getinfo.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": {} + ], + "author": [ + "Shahana Farooqui <> is mainly responsible." + ], + "see_also": [ + "lightning-commando-listrunes(7)" + ], + "resources": [ + "Main web site: " + ] }, - "getinfo.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-commando-listrunes.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "id", - "alias", - "color", - "num_peers", - "num_pending_channels", - "num_active_channels", - "num_inactive_channels", - "version", - "blockheight", - "network", - "fees_collected_msat", - "lightning-dir", - "address" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "The public key unique to this node" - }, - "alias": { - "type": "string", - "description": "The fun alias this node will advertize", - "maxLength": 32 - }, - "color": { - "type": "hex", - "description": "The favorite RGB color this node will advertize", - "minLength": 6, - "maxLength": 6 - }, - "num_peers": { - "type": "u32", - "description": "The total count of peers, connected or with channels" - }, - "num_pending_channels": { - "type": "u32", - "description": "The total count of channels being opened" - }, - "num_active_channels": { - "type": "u32", - "description": "The total count of channels in normal state" - }, - "num_inactive_channels": { - "type": "u32", - "description": "The total count of channels waiting for opening or closing transactions to be mined" - }, - "version": { - "type": "string", - "description": "Identifies what bugs you are running into" - }, - "lightning-dir": { - "type": "string", - "description": "Identifies where you can find the configuration and other related files" - }, - "our_features": { - "type": "object", - "description": "Our BOLT #9 feature bits (as hexstring) for various contexts", - "additionalProperties": true, - "required": [ - "init", - "node", - "channel", - "invoice" - ], - "properties": { - "init": { - "type": "hex", - "description": "features (incl. globalfeatures) in our init message, these also restrict what we offer in open_channel or accept in accept_channel" - }, - "node": { - "type": "hex", - "description": "features in our node_announcement message" - }, - "channel": { - "type": "hex", - "description": "negotiated channel features we (as channel initiator) publish in the channel_announcement message" - }, - "invoice": { - "type": "hex", - "description": "features in our BOLT11 invoices" - } + "added": "v23.05", + "deprecated": [ + "v23.08", + "v24.05" + ], + "rpc": "commando-listrunes", + "title": "Command to list previously generated runes", + "description": [ + "The **commando-listrunes** RPC command either lists runes that we stored as we generate them (see lightning-commando-rune(7)) or decodes the rune given on the command line.", + "", + "NOTE: Runes generated prior to v23.05 were not stored, so will not appear in this list." + ], + "request": { + "required": [], + "properties": { + "rune": { + "type": "string", + "description": [ + "Optional rune to list." + ] } - }, - "blockheight": { - "type": "u32", - "description": "The highest block height we've learned" - }, - "network": { - "type": "string", - "description": "represents the type of network on the node are working (e.g: `bitcoin`, `testnet`, or `regtest`)" - }, - "fees_collected_msat": { - "type": "msat", - "description": "Total routing fees collected by this node" - }, - "address": { - "type": "array", - "description": "The addresses we announce to the world", - "items": { - "type": "object", - "required": [ - "type", - "port" - ], - "additionalProperties": true, - "properties": { - "type": { - "type": "string", - "enum": [ - "dns", - "ipv4", - "ipv6", - "torv2", - "torv3" - ], - "description": "Type of connection (until 23.08, `websocket` was also allowed)" - }, - "port": { - "type": "u16", - "description": "port number" - } - }, - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "dns", - "ipv4", - "ipv6", - "torv2", - "torv3" - ] - } - } - }, - "then": { - "required": [ - "type", - "address", - "port" - ], + } + }, + "response": { + "required": [ + "runes" + ], + "properties": { + "runes": { + "type": "array", + "items": { + "type": "object", "additionalProperties": false, - "properties": { - "type": {}, - "port": {}, - "address": { - "type": "string", - "description": "address in expected format for **type**" - } - } - }, - "else": { "required": [ - "type", - "port" + "rune", + "unique_id", + "restrictions", + "restrictions_as_english" ], - "additionalProperties": false, "properties": { - "type": {}, - "port": {} - } - } - } - }, - "binding": { - "type": "array", - "description": "The addresses we are listening on", - "items": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "*FIXME*": "The variant in connect.schema.json is more complete", - "enum": [ - "local socket", - "websocket", - "ipv4", - "ipv6", - "torv2", - "torv3" - ], - "description": "Type of connection" - }, - "address": { - "type": "string", - "description": "address in expected format for **type**" - }, - "port": { - "type": "u16", - "description": "port number" - } - }, - "allOf": [ - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "local socket" - ] - } - } + "rune": { + "type": "string", + "description": [ + "Base64 encoded rune." + ] }, - "then": { - "additionalProperties": false, - "required": [ - "type", - "socket" + "unique_id": { + "type": "string", + "description": [ + "Unique id assigned when the rune was generated; this is always a u64 for commando runes." + ] + }, + "restrictions": { + "type": "array", + "description": [ + "The restrictions on what commands this rune can authorize." ], - "properties": { - "type": {}, - "socket": { - "type": "string", - "description": "socket filename" + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "alternatives", + "english" + ], + "properties": { + "alternatives": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "fieldname", + "value", + "condition", + "english" + ], + "properties": { + "fieldname": { + "type": "string", + "description": [ + "The field this restriction applies to; see commando-rune(7)." + ] + }, + "value": { + "type": "string", + "description": [ + "The value accepted for this field." + ] + }, + "condition": { + "type": "string", + "description": [ + "The way to compare fieldname and value." + ] + }, + "english": { + "type": "string", + "description": [ + "English readable description of this alternative." + ] + } + } + } + }, + "english": { + "type": "string", + "description": [ + "English readable summary of alternatives above." + ] + } } } }, - "else": { - "additionalProperties": false, - "required": [ - "type", - "address", - "port" + "restrictions_as_english": { + "type": "string", + "description": [ + "English readable description of the restrictions array above." + ] + }, + "stored": { + "type": "boolean", + "enum": [ + false ], - "properties": { - "type": {}, - "address": {}, - "port": {}, - "subtype": {} - } - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "websocket" - ] - } - } + "description": [ + "This is false if the rune does not appear in our datastore (only possible when `rune` is specified)." + ] }, - "then": { - "additionalProperties": false, - "required": [ - "type", - "address", - "port", - "subtype" + "blacklisted": { + "type": "boolean", + "enum": [ + true ], - "properties": { - "type": {}, - "address": {}, - "port": {}, - "subtype": { - "type": "string", - "description": "type of address" - } - } + "description": [ + "The rune has been blacklisted; see commando-blacklist(7)." + ] }, - "else": { - "additionalProperties": false, - "required": [ - "type" + "last_used": { + "type": "number", + "description": [ + "The last time this rune was successfully used." ], - "properties": { - "type": {}, - "address": {}, - "port": {}, - "socket": {} - } + "added": "23.11" + }, + "our_rune": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "This is not a rune for this node (only possible when `rune` is specified)." + ] } } - ] + } } + } + }, + "example_json_request": [ + { + "id": "example:commando-listrunes#1", + "method": "commando-listrunes", + "params": "{}" }, - "warning_bitcoind_sync": { - "type": "string", - "description": "Bitcoind is not up-to-date with network." + { + "id": "example:commando-listrunes#2", + "method": "commando-listrunes", + "params": { + "rune": "Am3W_wI0PRn4qVNEsJ2iInHyFPQK8wfdqEXztm8-icQ9MA==" + } }, - "warning_lightningd_sync": { - "type": "string", - "description": "Lightningd is still loading latest blocks from bitcoind." - } - } - }, - "getlog.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "level": { - "type": "string", - "enum": [ - "broken", - "unusual", - "info", - "debug", - "io" - ], - "description": "a string that represents the log level. The default is *info*" + { + "id": "example:commando-listrunes#3", + "method": "commando-listrunes", + "params": { + "rune": "m_tyR0qqHUuLEbFJW6AhmBg-9npxVX2yKocQBFi9cvY9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJzJnBuYW1lbGV2ZWwhfHBuYW1lbGV2ZWwvaW8mcGFycjEhfHBhcnIxL2lv" + } } - } - }, - "getlog.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "created_at", - "bytes_used", - "bytes_max", - "log" - ], - "properties": { - "created_at": { - "type": "string", - "description": "UNIX timestamp with 9 decimal places, when logging was initialized" - }, - "bytes_used": { - "type": "u32", - "description": "The number of bytes used by logging records" + ], + "example_json_response": [ + { + "runes": [ + { + "rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==", + "unique_id": "0", + "restrictions": [], + "restrictions_as_english": "" + }, + { + "rune": "Am3W_wI0PRn4qVNEsJ2iInHyFPQK8wfdqEXztm8-icQ9MA==", + "stored": false, + "our_rune": false, + "unique_id": "1", + "restrictions": [], + "restrictions_as_english": "" + } + ] }, - "bytes_max": { - "type": "u32", - "description": "The bytes_used values at which records will be trimmed " + { + "runes": [ + { + "rune": "Am3W_wI0PRn4qVNEsJ2iInHyFPQK8wfdqEXztm8-icQ9MA==", + "stored": false, + "our_rune": false, + "unique_id": "1", + "restrictions": [], + "restrictions_as_english": "" + } + ] }, - "log": { - "type": "array", - "items": { - "type": "object", - "required": [ - "type" - ], - "additionalProperties": true, - "properties": { - "type": { - "type": "string", - "enum": [ - "SKIPPED", - "BROKEN", - "UNUSUAL", - "INFO", - "DEBUG", - "IO_IN", - "IO_OUT" - ] - } - }, - "allOf": [ - { - "if": { - "additionalProperties": true, - "properties": { - "type": { - "enum": [ - "SKIPPED" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "num_skipped" - ], - "properties": { - "type": {}, - "num_skipped": { - "type": "u32", - "description": "number of unprinted log entries (deleted or below *level* parameter)" - } - } - } - }, - { - "if": { - "additionalProperties": true, - "properties": { - "type": { - "enum": [ - "BROKEN", - "UNUSUAL", - "INFO", - "DEBUG" - ] + { + "runes": [ + { + "rune": "m_tyR0qqHUuLEbFJW6AhmBg-9npxVX2yKocQBFi9cvY9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJzJnBuYW1lbGV2ZWwhfHBuYW1lbGV2ZWwvaW8mcGFycjEhfHBhcnIxL2lv", + "stored": false, + "unique_id": "3", + "restrictions": [ + { + "alternatives": [ + { + "fieldname": "id", + "value": "022d223620a359a47ff7", + "condition": "^", + "english": "id starts with 022d223620a359a47ff7" } - } + ], + "english": "id starts with 022d223620a359a47ff7" }, - "then": { - "additionalProperties": false, - "required": [ - "time", - "source", - "log" + { + "alternatives": [ + { + "fieldname": "method", + "value": "listpeers", + "condition": "=", + "english": "method equal to listpeers" + } ], - "properties": { - "type": {}, - "time": { - "type": "string", - "description": "UNIX timestamp with 9 decimal places after **created_at**" - }, - "source": { - "type": "string", - "description": "The particular logbook this was found in" - }, - "log": { - "type": "string", - "description": "The actual log message" + "english": "method equal to listpeers" + }, + { + "alternatives": [ + { + "fieldname": "pnamelevel", + "value": "", + "condition": "!", + "english": "pnamelevel is missing" }, - "node_id": { - "type": "pubkey", - "description": "The peer this is associated with" - } - } - } - }, - { - "if": { - "additionalProperties": true, - "properties": { - "type": { - "enum": [ - "IO_IN", - "IO_OUT" - ] + { + "fieldname": "pnamelevel", + "value": "io", + "condition": "/", + "english": "pnamelevel unequal to io" } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "time", - "source", - "log", - "data" ], - "properties": { - "type": {}, - "time": { - "type": "string", - "description": "Seconds after **created_at**, with 9 decimal places" - }, - "source": { - "type": "string", - "description": "The particular logbook this was found in" - }, - "log": { - "type": "string", - "description": "The associated log message" - }, - "node_id": { - "type": "pubkey", - "description": "The peer this is associated with" + "english": "pnamelevel is missing OR pnamelevel unequal to io" + }, + { + "alternatives": [ + { + "fieldname": "parr1", + "value": "", + "condition": "!", + "english": "parr1 is missing" }, - "data": { - "type": "hex", - "description": "The IO which occurred" + { + "fieldname": "parr1", + "value": "io", + "condition": "/", + "english": "parr1 unequal to io" } - } + ], + "english": "parr1 is missing OR parr1 unequal to io" } - } - ] - } - } - } - }, - "getroute.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "id", - "amount_msat", - "riskfactor" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "node pubkey to find the best route for the payment" - }, - "amount_msat": { - "type": "msat", - "description": "amount to send. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. The 0 value is special: it ignores any *htlc_minimum_msat* setting on channels, and simply returns a possible route (if any) which is useful for simple probing" - }, - "riskfactor": { - "type": "u64", - "description": "a non-negative floating-point field controls this tradeoff; it is the annual cost of your funds being stuck (as a percentage).\tFor example, if you thought the convenience of keeping your funds liquid (not stuck) was worth 20% per annum interest, *riskfactor* would be 20.\tIf you didn't care about risk, *riskfactor* would be zero" - }, - "cltv": { - "type": "u32", - "description": "cltv-blocks to spare. Default is 9" - }, - "fromid": { - "type": "pubkey", - "description": "the node to start the route from. Default is this node" - }, - "fuzzpercent": { - "type": "u32", - "description": "used to distort fees to provide some randomization to the route generated, but it was not properly implemented and is ignored" - }, - "exclude": { - "type": "array", - "description": "a JSON array of short-channel-id/direction (e.g. ['564334x877x1/0', '564195x1292x0/1' ]) or node-id which should be excluded from consideration for routing. The default is not to exclude any channels or nodes. Note if the source or destination is excluded, the command result is undefined", - "items": { - "type": "string" - } - }, - "maxhops": { - "type": "u32", - "description": "the maximum number of channels to return. Default is 20" - } - } - }, - "getroute.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "route" - ], - "properties": { - "route": { - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "direction", - "channel", - "amount_msat", - "delay", - "style" - ], - "additionalProperties": false, - "properties": { - "id": { - "type": "pubkey", - "description": "The node at the end of this hop" - }, - "channel": { - "type": "short_channel_id", - "description": "The channel joining these nodes" - }, - "direction": { - "type": "u32", - "description": "0 if this channel is traversed from lesser to greater **id**, otherwise 1" - }, - "amount_msat": { - "type": "msat", - "description": "The amount expected by the node at the end of this hop" - }, - "delay": { - "type": "u32", - "description": "The total CLTV expected by the node at the end of this hop" - }, - "style": { - "type": "string", - "description": "The features understood by the destination node", - "enum": [ - "tlv" - ] - } - } - } - } - } - }, - "help.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "command": { - "type": "string", - "description": "command to get information about" - } - } - }, - "help.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "help" - ], - "properties": { - "help": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "command", - "category", - "description", - "verbose" - ], - "properties": { - "command": { - "type": "string", - "description": "the command" - }, - "category": { - "type": "string", - "description": "the category for this command (useful for grouping)" - }, - "description": { - "type": "string", - "description": "a one-line description of the purpose of this command" - }, - "verbose": { - "type": "string", - "description": "a full description of this command (including whether it's deprecated)" - } - } - } - }, - "format-hint": {} - } - }, - "invoice.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "amount_msat", - "label", - "description" - ], - "properties": { - "amount_msat": { - "type": "msat_or_any", - "description": "the string `any`, which creates an invoice that can be paid with any amount. Otherwise it is a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*" - }, - "label": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ], - "description": "a unique string or number (which is treated as a string, so `01` is different from `1`); it is never revealed to other nodes on the lightning network, but it can be used to query the status of this invoice" - }, - "description": { - "type": "string", - "description": "a short description of purpose of payment, e.g. *1 cup of coffee*. This value is encoded into the BOLT11 invoice and is viewable by any node you send this invoice to (unless *deschashonly* is true as described below). It must be UTF-8, and cannot use *\\u* JSON escape codes" - }, - "expiry": { - "type": "u64", - "description": "the time the invoice is valid for, in seconds. If no value is provided the default of 604800 (1 week) is used" - }, - "fallbacks": { - "type": "array", - "description": "one or more fallback addresses to include in the invoice (in order from most-preferred to least): note that these arrays are not currently tracked to fulfill the invoice", - "items": { - "type": "string" - } - }, - "preimage": { - "type": "hex", - "description": "a 64-digit hex string to be used as payment preimage for the created invoice. By default, if unspecified, lightningd will generate a secure pseudorandom preimage seeded from an appropriate entropy source on your system. **IMPORTANT**: if you specify the *preimage*, you are responsible, to ensure appropriate care for generating using a secure pseudorandom generator seeded with sufficient entropy, and keeping the preimage secret. This parameter is an advanced feature intended for use with cutting-edge cryptographic protocols and should not be used unless explicitly needed" - }, - "exposeprivatechannels": { - "description": "if specified, it overrides the default route hint logic, which will use unpublished channels only if there are no published channels", - "oneOf": [ - { - "type": "boolean", - "description": "if *True* unpublished channels are always considered as a route hint candidate; if *False*, never" - }, - { - "type": "array", - "description": "array of short channel ids (or a remote alias), only those specific channels will be considered candidates, even if they are public or dead-ends", - "items": { - "type": "short_channel_id" - } - }, - { - "type": "short_channel_id", - "description": "if it is a short channel id (e.g. *1x1x3*), only this specific channel will be considered candidate, even if it is public or dead-end" - } - ] - }, - "cltv": { - "type": "u32", - "description": "if specified, sets the *min_final_cltv_expiry* for the invoice. Otherwise, it's set to the parameter **cltv-final**" - }, - "deschashonly": { - "type": "boolean", - "description": "if True, then the bolt11 returned contains a hash of the *description*, rather than the *description* itself: this allows much longer descriptions, but they must be communicated via some other mechanism. Defaults to False" - } - } - }, - "invoice.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "payment_hash", - "expires_at", - "created_index", - "bolt11", - "payment_secret" - ], - "properties": { - "bolt11": { - "type": "string", - "description": "the bolt11 string" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "payment_secret": { - "type": "secret", - "description": "the *payment_secret* to place in the onion" - }, - "expires_at": { - "type": "u64", - "description": "UNIX timestamp of when invoice expires" - }, - "created_index": { - "type": "u64", - "added": "v23.08", - "description": "1-based index indicating order this invoice was created in" - }, - "warning_capacity": { - "type": "string", - "description": "even using all possible channels, there's not enough incoming capacity to pay this invoice." - }, - "warning_offline": { - "type": "string", - "description": "there would be enough incoming capacity, but some channels are offline, so there isn't." - }, - "warning_deadends": { - "type": "string", - "description": "there would be enough incoming capacity, but some channels are dead-ends (no other public channels from those peers), so there isn't." - }, - "warning_private_unused": { - "type": "string", - "description": "there would be enough incoming capacity, but some channels are unannounced and *exposeprivatechannels* is *false*, so there isn't." - }, - "warning_mpp": { - "type": "string", - "description": "there is sufficient capacity, but not in a single channel, so the payer will have to use multi-part payments." - } - } - }, - "invoicerequest.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "amount", - "description" - ], - "added": "v22.11", - "properties": { - "amount": { - "type": "msat", - "description": "a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*" - }, - "description": { - "type": "string", - "description": "a short description of purpose of the payment, e.g. *ATM withdrawl*. This value is encoded into the resulting `invoice_request` and is viewable by anyone you expose it to. It must be UTF-8, and cannot use *\\u* JSON escape codes" - }, - "issuer": { - "type": "string", - "description": "who is issuing it (i.e. you) if appropriate" - }, - "label": { - "type": "string", - "description": "an internal-use name for the offer, which can be any UTF-8 string" - }, - "absolute_expiry": { - "type": "u64", - "description": "the time the offer is valid until, in seconds since the first day of 1970 UTC. If not set, the `invoice_request` remains valid (though it can be deactivated by the issuer of course). This is encoded in the `invoice_request`" - }, - "single_use": { - "type": "boolean", - "description": "indicates that the `invoice_request` is only valid once; we may attempt multiple payments, but as soon as one is successful no more invoices are accepted (i.e. only one person can take the money). Defaults to True" - } - } - }, - "invoicerequest.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "invreq_id", - "single_use", - "active", - "bolt12", - "used" - ], - "properties": { - "invreq_id": { - "type": "hash", - "description": "the SHA256 hash of all invoice_request fields less than 160" - }, - "active": { - "type": "boolean", - "enum": [ - true - ], - "description": "whether the invoice_request is currently active" - }, - "single_use": { - "type": "boolean", - "description": "whether the invoice_request will become inactive after we pay an invoice for it" - }, - "bolt12": { - "type": "string", - "description": "the bolt12 string starting with lnr" - }, - "used": { - "type": "boolean", - "enum": [ - false - ], - "description": "whether the invoice_request has already been used" - }, - "label": { - "type": "string", - "description": "the label provided when creating the invoice_request" - } - } - }, - "keysend.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "destination", - "amount_msat" - ], - "properties": { - "destination": { - "type": "pubkey", - "description": "the 33 byte, hex-encoded, node ID of the node that the payment should go to" - }, - "amount_msat": { - "type": "msat", - "description": "a whole number, or a whole number with suffix `msat` or `sat`, or a three decimal point number with suffix `sat`, or an 1 to 11 decimal point number suffixed by `btc`" - }, - "label": { - "type": "string", - "description": "used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7)" - }, - "maxfeepercent": { - "type": "number", - "description": "limits the money paid in fees as percentage of the total amount that is to be transferred, and defaults to *0.5*" - }, - "retry_for": { - "type": "u32", - "description": "until *retry_for* seconds passes, the command will keep finding routes and retrying the payment. However, a payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case. Defaults to 60 seconds" - }, - "maxdelay": { - "type": "u32", - "description": "number of blocks the payment may be delayed" - }, - "exemptfee": { - "type": "msat", - "description": "used for tiny payments which would be dominated by the fee leveraged by forwarding nodes. Setting `exemptfee` allows the `maxfeepercent` check to be skipped on fees that are smaller than *exemptfee*. Defaults to 5000 millisatoshi" - }, - "routehints": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "scid", - "feebase", - "feeprop", - "expirydelta" ], - "properties": { - "id": { - "type": "pubkey" - }, - "scid": { - "type": "short_channel_id" - }, - "feebase": { - "type": "msat" - }, - "feeprop": { - "type": "u32" - }, - "expirydelta": { - "type": "u16" - } - } + "restrictions_as_english": "id starts with 022d223620a359a47ff7 AND method equal to listpeers AND pnamelevel is missing OR pnamelevel unequal to io AND parr1 is missing OR parr1 unequal to io" } - } - }, - "extratlvs": { - "type": "object", - "additionalProperties": true, - "required": [], - "description": "dictionary of additional fields to insert into the final tlv. The format is 'fieldnumber': 'hexstring'" - } - } - }, - "keysend.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "payment_preimage", - "payment_hash", - "created_at", - "parts", - "amount_msat", - "amount_sent_msat", - "status" - ], - "properties": { - "payment_preimage": { - "type": "secret", - "description": "the proof of payment: SHA256 of this **payment_hash**" - }, - "destination": { - "type": "pubkey", - "description": "the final destination of the payment" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "created_at": { - "type": "number", - "description": "the UNIX timestamp showing when this payment was initiated" - }, - "parts": { - "type": "u32", - "description": "how many attempts this took" - }, - "amount_msat": { - "type": "msat", - "description": "Amount the recipient received" - }, - "amount_sent_msat": { - "type": "msat", - "description": "Total amount we sent (including fees)" - }, - "warning_partial_completion": { - "type": "string", - "description": "Not all parts of a multi-part payment have completed" - }, - "status": { - "type": "string", - "enum": [ - "complete" - ], - "description": "status of payment" - } - } - }, - "lightning-addgossip.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "addgossip", - "title": "Command for injecting a gossip message (low-level)", - "description": [ - "The **addgossip** RPC command injects a hex-encoded gossip message into the gossip daemon. It may return an error if it is malformed, or may update its internal state using the gossip message.", - "", - "Note that currently some paths will still silently reject the gossip: it is best effort.", - "", - "This is particularly used by plugins which may receive channel_update messages within error replies." - ], - "request": { - "required": [ - "message" - ], - "properties": { - "message": { - "type": "hex", - "description": [ - "The raw, hex-encoded, gossip message to add to the local gossip view." - ] - } - } - }, - "response": { - "properties": {} - }, - "example_json_request": [ - { - "id": "example:addgossip#1", - "method": "addgossip", - "params": { - "message": "010078c3314666731e339c0b8434f7824797a084ed7ca3655991a672da068e2c44cb53b57b53a296c133bc879109a8931dc31e6913a4bda3d58559b99b95663e6d52775579447ef5526300e1bb89bc6af8557aa1c3810a91814eafad6d103f43182e17b16644cb38c1d58a8edd094303959a9f1f9d42ff6c32a21f9c118531f512c8679cabaccc6e39dbd95a4dac90e75a258893c3aa3f733d1b8890174d5ddea8003cadffe557773c54d2c07ca1d535c4bf85885f879ae466c16a516e8ffcfec1740e3f5c98ca9ce13f452e867befef5517f306ed6aa5119b79059bcc6f68f329986b665d16de7bc7df64e3537504c91eeabe0e59d3a2b68e4216ead2b0f6e3ef7c000006226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f0000670000010000022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d590266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c0351802e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5702324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b" - } - }, - { - "id": "example:addgossip#2", - "method": "addgossip", - "params": { - "message": "0102420526c8eb62ec6999bbee5f1de4841cab734374ec642b7deeb0259e76220bf82e97a241c907d5ff52019655f7f9a614c285bb35690f3a1a2b928d7b2349a79e06226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f000067000001000065b32a0e010100060000000000000000000000010000000a000000003b023380" - } + ] } ], - "example_json_response": [ - {}, - {} - ], "author": [ - "Rusty Russell <> is mainly responsible." + "Shahana Farooqui <> is mainly responsible." ], "see_also": [ - "lightning-pay(7)" + "lightning-commando-rune(7)", + "lightning-commando-blacklist(7)" ], "resources": [ "Main web site: " ] }, - "lightning-addpsbtoutput.json": { + "lightning-commando-rune.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "added": "v23.11", - "rpc": "addpsbtoutput", - "title": "Command to populate PSBT outputs from the wallet", + "deprecated": [ + "v23.08", + "v23.05" + ], + "rpc": "commando-rune", + "title": "Command to Authorize Remote Peer Access", "description": [ - "`addpsbtoutput` is a low-level RPC command which creates or modifies a PSBT by adding a single output of amount *satoshi*.", - "", - "This is used to receive funds into the on-chain wallet interactively using PSBTs." + "The **commando-rune** RPC command creates a base64 string called a *rune* which can be used to access commands on this node. Each *rune* contains a unique id (a number starting at 0), and can have restrictions inside it. Nobody can remove restrictions from a rune: if you try, the rune will be rejected. There is no limit on how many runes you can issue; the node simply decodes and checks them as they are received (we do store them for lightning-commando- listrunes(7) however)." ], "request": { - "required": [ - "satoshi" - ], + "required": [], "properties": { - "satoshi": { - "type": "sat", - "description": [ - "The satoshi value of the output. It can be a whole number, a whole number ending in *sat*, or a number with 1 to 8 decimal places ending in *btc*." - ] - }, - "initialpsbt": { + "rune": { "type": "string", "description": [ - "Base 64 encoded PSBT to add the output to. If not specified, one will be generated automatically." - ] - }, - "locktime": { - "type": "u32", - "description": [ - "If not set, it is set to a recent block height (if no initial psbt is specified)." + "If supplied, the restrictions are simple appended to that *rune* (it doesn't need to be a rune belonging to this node). If not supplied, a new *rune* is constructed, with a new unique id." ] }, - "destination": { - "type": "string", + "restrictions": { "description": [ - "If it is not set, an internal address is generated." + "It can be the string `readonly`, or an array of restrictions.", + "Each restriction is an array of one or more alternatives, such as \"method is listpeers\", or \"method is listpeers OR time is before 2023\"." + ], + "oneOf": [ + { + "type": "array", + "description": [ + "Alternatives use a simple language to examine the command which is being run:", + " * time: the current UNIX time, e.g. \"time<1656759180\".", + " * id: the node_id of the peer, e.g. \"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\".", + " * method: the command being run, e.g. \"method=withdraw\".", + " * per: how often the rune can be used, with suffix \"sec\" (default), \"min\", \"hour\", \"day\" or \"msec\", \"usec\" or \"nsec\". e.g. \"per=5sec\".", + " * rate: the rate limit, per minute, e.g. \"rate=60\" is equivalent to \"per=1sec\".", + " * pnum: the number of parameters. e.g. \"pnum<2\".", + " * pnameX: the parameter named X (with any punctuation like `_` removed). e.g. \"pnamedestination=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T\".", + " * parrN: the N'th parameter. e.g. \"parr0=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T\"." + ], + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "type": "string", + "enum": [ + "readonly" + ], + "description": [ + "A rune which allows most *get* and *list* commands, and the *summary* command." + ] + } ] } } }, "response": { "required": [ - "psbt", - "estimated_added_weight", - "outnum" + "rune", + "unique_id" ], "properties": { - "psbt": { + "rune": { "type": "string", "description": [ - "Unsigned PSBT which fulfills the parameters given." + "The resulting rune." ] }, - "estimated_added_weight": { - "type": "u32", + "unique_id": { + "type": "string", "description": [ - "The estimated weight of the added output." + "The id of this rune: this is set at creation and cannot be changed (even as restrictions are added)." ] }, - "outnum": { - "type": "u32", + "warning_unrestricted_rune": { + "type": "string", "description": [ - "The 0-based number where the output was placed." + "A warning shown when runes are created with powers that could drain your node." ] } } }, + "restriction_format": [ + "Restrictions are one or more alternatives. Each alternative is *name* *operator* *value*. The valid names are shown above.", + "", + "Note that if a value contains `\\`, it must be preceeded by another `\\` to form valid JSON:", + "* `=`: passes if equal ie. identical. e.g. `method=withdraw`", + "* `/`: not equals, e.g. `method/withdraw`", + "* `^`: starts with, e.g. `id^024b9a1fa8e006f1e3937f`", + "* `$`: ends with, e.g. `id$381df1cc449605`.", + "* `~`: contains, e.g. `id~006f1e3937f65f66c40`.", + "* `<`: is a decimal integer, and is less than. e.g. `time<1656759180`", + "* `>`: is a decimal integer, and is greater than. e.g. `time>1656759180`", + "* `{`: preceeds in alphabetical order (or matches but is shorter),", + " e.g. `id{02ff`.", + "* `}`: follows in alphabetical order (or matches but is longer),", + " e.g. `id}02ff`.", + "* `#`: a comment, ignored, e.g. `dumb example#`.", + "* `!`: only passes if the *name* does *not* exist. e.g. `pnamedestination!`.", + "Every other operator except `#` fails if *name* does not exist!" + ], "example_usage": [ - "Here is a command to make a PSBT with a 100,000 sat output that leads to the on-chain wallet.", + "This creates a fresh rune which can do anything:", "", "```shell", - "lightning-cli addpsbtoutput 100000sat", - "```" - ], - "example_json_request": [ - { - "id": "example:addpsbtoutput#1", - "method": "addpsbtoutput", - "params": { - "satoshi": 100000, - "initialpsbt": null, - "locktime": null, - "destination": null - } - }, - { - "id": "example:addpsbtoutput#2", - "method": "addpsbtoutput", - "params": { - "satoshi": 1000000, - "initialpsbt": null, - "locktime": 111, - "destination": null - } - }, - { - "id": "example:addpsbtoutput#3", - "method": "addpsbtoutput", - "params": { - "satoshi": 974343, - "initialpsbt": "cHNidP8BAF4CAAAAAfwbEpvpi6D14YV4VLnuVB47Y0uF41kXEyJRL4IusySSAQAAAAD9////ASICAAAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5nAAAAAAEA9gIAAAAAAQFEkxvLatohY6mw5gr5qG1aiArSrziFPR2YoqD21Hv+RAAAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNrz8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIEu1nfVRt9i+rFM219mwhMqdwJsqygWSWTFUS+cemdh6AiBG3Qo8g9J/aAMO2RHDsIBScscj6pTTIwZp7Gw8G3EOKAEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPZgAAAAEBK68/DwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==", - "locktime": null, - "destination": "bcrt1q9tc6q49l6wrrtp8ul45rj92hsleehwwxty32zu" - } - } - ], - "example_json_response": [ - { - "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIoIYBAAAAAAABBCJRIHg2NV/cioLcTLAKdyxVVBUdBjhKTdZejT9orAhWa4S+AA==", - "estimated_added_weight": 172, - "outnum": 0 - }, - { - "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIJd6ICNAQALFOMhoUHuSVSuzcaUdkDKlk4K+A+DR9+4uAA==", - "estimated_added_weight": 172, - "outnum": 0 - }, - { - "psbt": "cHNidP8BAH0CAAAAAfwbEpvpi6D14YV4VLnuVB47Y0uF41kXEyJRL4IusySSAQAAAAD9////AiICAAAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4H3g4AAAAAABYAFCrxoFS/04Y1hPz9aDkVV4fzm7nGZwAAAAABAPYCAAAAAAEBRJMby2raIWOpsOYK+ahtWogK0q84hT0dmKKg9tR7/kQAAAAAAP3///8CQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAza8/DwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oCRzBEAiBLtZ31UbfYvqxTNtfZsITKncCbKsoFklkxVEvnHpnYegIgRt0KPIPSf2gDDtkRw7CAUnLHI+qU0yMGaexsPBtxDigBIQPXRURck2JmXyLg2W6edm8nPzJg3qOcina/oF3SaE3cz2YAAAABASuvPw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAAAA", - "estimated_added_weight": 172, - "outnum": 1 - } - ], - "author": [ - "Dusty <<@dusty_daemon>> is mainly responsible." - ], - "see_also": [ - "lightning-fundpsbt(7)", - "lightning-utxopsbt(7)" + "$ lightning-cli commando-rune", + "{", + " \"rune\": \"KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA==\",", + " \"unique_id\": \"0\"", + "}", + "```", + "We can add restrictions to that rune, like so:", + "", + "```shell", + "$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions=readonly", + "{", + " \"rune\": \"NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl\",", + " \"unique_id\": \"0\"", + "}", + "```", + "The \"readonly\" restriction is a short-cut for two restrictions:", + "", + "1. `[\"method^list\", \"method^get\", \"method=summary\"]`: You may call list, get or summary.", + "2. `[\"method/listdatastore\"]`: But not listdatastore: that contains sensitive stuff!", + "", + "We can do the same manually, like so:", + "", + "```shell", + "$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions='[[\"method^list\", \"method^get\", \"method=summary\"],[\"method/listdatastore\"]]'", + "{", + " \"rune\": \"NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl\",", + " \"unique_id\": \"0\"", + "}", + "```", + "Let's create a rune which lets a specific peer (024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605) run \"listpeers\" on themselves:", + "", + "```shell", + "$ lightning-cli commando-rune restrictions='[[\"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"],[\"method=listpeers\"],[\"pnum=1\"],[\"pnameid=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\",\"parr0=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"]]'", + "{", + " \"rune\": \"FE8GHiGVvxcFqCQcClVRRiNE_XEeLYQzyG2jmqto4jM9MiZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDV8cGFycjA9MDI0YjlhMWZhOGUwMDZmMWUzOTM3ZjY1ZjY2YzQwOGU2ZGE4ZTFjYTcyOGVhNDMyMjJhNzM4MWRmMWNjNDQ5NjA1\",", + " \"unique_id\": \"2\"", + "}", + "```", + "This allows `listpeers` with 1 argument (`pnum=1`), which is either by name (`pnameid`), or position (`parr0`). We could shorten this in several ways: either allowing only positional or named parameters, or by testing the start of the parameters only. Here's an example which only checks the first 9 bytes of the `listpeers` parameter:", + "", + "```shell", + "$ lightning-cli commando-rune restrictions='[[\"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"],[\"method=listpeers\"],[\"pnum=1\"],[\"pnameid^024b9a1fa8e006f1e393\", \"parr0^024b9a1fa8e006f1e393\"]'", + " {", + " \"rune\": \"fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw==\",", + " \"unique_id\": \"3\"", + "}", + "```", + "Before we give this to our peer, let's add two more restrictions: that it only be usable for 24 hours from now (`time<`), and that it can only be used twice a minute (`rate=2`). `date +%s` can give us the current time in seconds:", + "", + "```shell", + "$ lightning-cli commando-rune rune=fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw== restrictions='[[\"time<'$(($(date +%s) + 24*60*60))'\",\"rate=2\"]]'", + "{", + " \"rune\": \"tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y\",", + " \"unique_id\": \"3\"", + "}", + "```", + "You can also use lightning-decode(7) to examine runes you have been given:", + "", + "```shell", + "$ lightning-cli decode tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y", + "{", + " \"type\": \"rune\",", + " \"unique_id\": \"3\",", + " \"string\": \"b54f912e33220e9636534a375b5a05a306abdfa4451a95a5a0f6d6f7e46e65da:=3&id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605&method=listpeers&pnum=1&pnameid^024b9a1fa8e006f1e393|parr0^024b9a1fa8e006f1e393&time<1656920538&rate=2\",", + " \"restrictions\": [", + " {", + " \"alternatives\": [", + " \"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"", + " ],", + " \"summary\": \"id (of commanding peer) equal to '024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605'\"", + " },", + " {", + " \"alternatives\": [", + " \"method=listpeers\"", + " ],", + " \"summary\": \"method (of command) equal to 'listpeers'\"", + " },", + " {", + " \"alternatives\": [", + " \"pnum=1\"", + " ],", + " \"summary\": \"pnum (number of command parameters) equal to 1\"", + " },", + " {", + " \"alternatives\": [", + " \"pnameid^024b9a1fa8e006f1e393\",", + " \"parr0^024b9a1fa8e006f1e393\"", + " ],", + " \"summary\": \"pnameid (object parameter 'id') starts with '024b9a1fa8e006f1e393' OR parr0 (array parameter #0) starts with '024b9a1fa8e006f1e393'\"", + " },", + " {", + " \"alternatives\": [", + " \"time<1656920538\"", + " ],", + " \"summary\": \"time (in seconds since 1970) less than 1656920538 (approximately 19 hours 18 minutes from now)\"", + " },", + " {", + " \"alternatives\": [", + " \"rate=2\"", + " ],", + " \"summary\": \"rate (max per minute) equal to 2\"", + " }", + " ],", + " \"valid\": true", + "}", + "```" + ], + "sharing_runes": [ + "Because anyone can add a restriction to a rune, you can always turn a normal rune into a read-only rune, or restrict access for 30 minutes from the time you give it to someone. Adding restrictions before sharing runes is best practice.", + "", + "If a rune has a ratelimit, any derived rune will have the same id, and thus will compete for that ratelimit. You might want to consider adding a tighter ratelimit to a rune before sharing it, so you will keep the remainder. For example, if you rune has a limit of 60 times per minute, adding a limit of 5 times per minute and handing that rune out means you can still use your original rune 55 times per minute." + ], + "example_json_request": [ + { + "id": "example:commando-rune#1", + "method": "commando-rune", + "params": "{}" + }, + { + "id": "example:commando-rune#2", + "method": "commando-rune", + "params": { + "restrictions": "readonly" + } + }, + { + "id": "example:commando-rune#3", + "method": "commando-rune", + "params": { + "restrictions": [ + [ + "id^022d223620a359a47ff7" + ], + [ + "method=listpeers" + ] + ] + } + }, + { + "id": "example:commando-rune#4", + "method": "commando-rune", + "params": { + "restrictions": [ + [ + "method=pay" + ], + [ + "pnameamountmsat<10000" + ] + ] + } + } + ], + "example_json_response": [ + { + "rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==", + "unique_id": "0", + "warning_unrestricted_rune": "WARNING: This rune has no restrictions! Anyone who has access to this rune could drain funds from your node. Be careful when giving this to apps that you don't trust. Consider using the restrictions parameter to only allow access to specific rpc methods." + }, + { + "rune": "zm0x_eLgHexaTvZn3Cz7gb_YlvrlYGDo_w4BYlR9SS09MSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", + "unique_id": "1" + }, + { + "rune": "YPojv9qgHPa3im0eiqRb-g8aRq76OasyfltGGqdFUOU9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJz", + "unique_id": "2" + }, + { + "rune": "b3hXuEM7Pqzk-C7HUw83xzvHOV7fmuGaWjdo-wHdfg89MCZtZXRob2Q9cGF5JnBuYW1lYW1vdW50bXNhdDwxMDAwMA==", + "unique_id": "3" + } + ], + "author": [ + "Rusty Russell <> wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page.", + "", + "Christian Decker came up with the name \"commando\", which almost excuses his previous adoption of the name \"Eltoo\"." + ], + "see_also": [ + "lightning-commando(7)", + "lightning-decode(7)" ], "resources": [ "Main web site: " ] }, - "lightning-autoclean-once.json": { + "lightning-commando.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "autoclean-once", - "title": "A single deletion of old invoices/payments/forwards", + "rpc": "commando", + "title": "Command to Send a Command to a Remote Peer", "description": [ - "The **autoclean-once** RPC command tell the `autoclean` plugin to do a single sweep to delete old entries. This is a manual alternative (or addition) to the various `autoclean-...-age` parameters which cause autoclean to run once per hour: see lightningd-config(5)." + "The **commando** RPC command is a homage to bad 80s movies. It also sends a directly-connected *peer_id* a custom message, containing a request to run *method* (with an optional dictionary of *params*); generally the peer will only allow you to run a command if it has provided you with a *rune* which allows it." ], "request": { "required": [ - "subsystem", - "age" + "peer_id", + "method" ], "properties": { - "subsystem": { - "type": "string", - "enum": [ - "succeededforwards", - "failedforwards", - "succeededpays", - "failedpays", - "paidinvoices", - "expiredinvoices" - ], + "peer_id": { + "type": "pubkey", "description": [ - "What subsystem to clean. Currently supported subsystems are:", - " * `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`).", - " * `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`).", - " * `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`).", - " * `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`).", - " * `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`).", - " * `paidinvoices`: invoices which were paid (`paid` in listinvoices `status)." + "Peer to command." ] }, - "age": { - "type": "u64", + "method": { + "type": "string", "description": [ - "Non-zero number in seconds. How many seconds old an entry must be to delete it." + "Method to invoke on peer." ] - } - } - }, - "response": { - "required": [ - "autoclean" - ], - "properties": { - "autoclean": { - "type": "object", - "additionalProperties": false, - "properties": { - "succeededforwards": { - "type": "object", - "additionalProperties": false, - "required": [ - "cleaned", - "uncleaned" - ], - "properties": { - "cleaned": { - "type": "u64", - "description": [ - "Total number of deletions done this run." - ] - }, - "uncleaned": { - "type": "u64", - "description": [ - "The total number of entries *not* deleted this run." - ] - } - } - }, - "failedforwards": { - "type": "object", - "additionalProperties": false, - "required": [ - "cleaned", - "uncleaned" - ], - "properties": { - "cleaned": { - "type": "u64", - "description": [ - "Total number of deletions done this run." - ] - }, - "uncleaned": { - "type": "u64", - "description": [ - "The total number of entries *not* deleted this run." - ] - } - } - }, - "succeededpays": { - "type": "object", - "additionalProperties": false, - "required": [ - "cleaned", - "uncleaned" - ], - "properties": { - "cleaned": { - "type": "u64", - "description": [ - "Total number of deletions done this run." - ] - }, - "uncleaned": { - "type": "u64", - "description": [ - "The total number of entries *not* deleted this run." - ] - } - } - }, - "failedpays": { - "type": "object", - "additionalProperties": false, - "required": [ - "cleaned", - "uncleaned" - ], - "properties": { - "cleaned": { - "type": "u64", - "description": [ - "Total number of deletions done this run." - ] - }, - "uncleaned": { - "type": "u64", - "description": [ - "The total number of entries *not* deleted this run." - ] - } - } - }, - "paidinvoices": { - "type": "object", - "additionalProperties": false, - "required": [ - "cleaned", - "uncleaned" - ], - "properties": { - "cleaned": { - "type": "u64", - "description": [ - "Total number of deletions done this run." - ] - }, - "uncleaned": { - "type": "u64", - "description": [ - "The total number of entries *not* deleted this run." - ] - } - } + }, + "params": { + "oneOf": [ + { + "type": "array", + "description": [ + "Array of positional parameters." + ] }, - "expiredinvoices": { + { "type": "object", - "additionalProperties": false, - "required": [ - "cleaned", - "uncleaned" - ], - "properties": { - "cleaned": { - "type": "u64", - "description": [ - "Total number of deletions done this run." - ] - }, - "uncleaned": { - "type": "u64", - "description": [ - "The total number of entries *not* deleted this run." - ] - } - } + "description": [ + "Parameters for method." + ] } - } + ] + }, + "rune": { + "type": "string", + "description": [ + "Rune to authorize the command." + ] + }, + "filter": { + "type": "object", + "description": [ + "Filter to peer to apply to any successful result." + ] } } }, + "response": { + "required": [], + "properties": {}, + "pre_return_value_notes": [ + "On success, the return depends on the *method* invoked." + ] + }, + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32600: Usually means peer is not connected", + "- 19535: the local commando plugin discovered an error.", + "- 19536: the remote commando plugin discovered an error.", + "- 19537: the remote commando plugin said we weren't authorized.", + "", + "It can also fail if the peer does not respond, in which case it will simply hang awaiting a response." + ], "example_json_request": [ { - "id": "example:autoclean-once#1", - "method": "autoclean-once", - "params": [ - "failedpays", - 1 - ] + "id": "example:commando#1", + "method": "commando", + "params": { + "peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "rune": "zm0x_eLgHexaTvZn3Cz7gb_YlvrlYGDo_w4BYlR9SS09MSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", + "method": "getinfo", + "params": {} + } }, { - "id": "example:autoclean-once#2", - "method": "autoclean-once", - "params": [ - "succeededpays", - 1 - ] + "id": "example:commando#2", + "method": "commando", + "params": { + "peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "rune": "m_tyR0qqHUuLEbFJW6AhmBg-9npxVX2yKocQBFi9cvY9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJzJnBuYW1lbGV2ZWwhfHBuYW1lbGV2ZWwvaW8mcGFycjEhfHBhcnIxL2lv", + "method": "listpeers", + "params": [ + "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "broken" + ] + } + }, + { + "id": "example:commando#3", + "method": "commando", + "params": { + "peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "rune": "b3hXuEM7Pqzk-C7HUw83xzvHOV7fmuGaWjdo-wHdfg89MCZtZXRob2Q9cGF5JnBuYW1lYW1vdW50bXNhdDwxMDAwMA==", + "method": "pay", + "params": { + "bolt11": "lnbcrt1pja05v6sp5n6gnm380ckkrnhzvytz0hvym0vcf0mlrk586nlp72cq7e2hhhffspp5cwhuvl4jhlqep3st2703z89jp7j6wucm8ytlj7rk9ckk0mv7whysdq5v3jhxcmjd9c8g6t0dceqxqyjw5qcqp99qxpqysgq40udwjtktkry0yyq9408q5vtmj534h88j5nn562lamam0rtfqfu3093t2dhhc63qnqe5maa5jc9ad5pm08q2k2udvp6skw9f6ez9c9qptatlau", + "amount_msat": 9999 + } + } } ], "example_json_response": [ { - "autoclean": { - "failedpays": { - "cleaned": 1, - "uncleaned": 1 + "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "alias": "JUNIORBEAM-v23.11-415-gd120eba", + "color": "0266e4", + "num_peers": 1, + "num_pending_channels": 0, + "num_active_channels": 0, + "num_inactive_channels": 0, + "address": [], + "binding": [ + { + "type": "ipv4", + "address": "127.0.0.1", + "port": 42513 } + ], + "version": "v23.11-415-gd120eba", + "blockheight": 101, + "network": "regtest", + "fees_collected_msat": 0, + "lightning-dir": "/tmp/ltests-7u_8_rtu/test_commando_rune_1/lightning-1/regtest", + "our_features": { + "init": "08a0000a8a5961", + "node": "88a0000a8a5961", + "channel": "", + "invoice": "02000002024100" } }, { - "autoclean": { - "succeededpays": { - "cleaned": 1, - "uncleaned": 0 + "peers": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "connected": true, + "num_channels": 0, + "netaddr": [ + "127.0.0.1:40119" + ], + "features": "08a0000a8a5961", + "log": [ + { + "type": "SKIPPED", + "num_skipped": 30 + } + ] } - } + ] + }, + { + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "payment_hash": "c3afc67eb2bfc190c60b579f111cb20fa5a7731b3917f978762e2d67ed9e75c9", + "created_at": 1708642714.8110592, + "parts": 1, + "amount_msat": 9999, + "amount_sent_msat": 9999, + "payment_preimage": "17632717785b1a833a296ba1831cb968602872e68881c2f324e06e87979296dc", + "status": "complete" } ], "author": [ - "Rusty Russell <> is mainly responsible." + "Rusty Russell <> wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page.", + "", + "Christian Decker came up with the name \"commando\", which almost excuses his previous adoption of the name \"Eltoo\"." ], "see_also": [ - "lightningd-config(5)", - "lightning-autoclean-status(7)" + "lightning-commando-rune(7)" ], "resources": [ "Main web site: " ] }, - "lightning-autoclean-status.json": { + "lightning-connect.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "autoclean-status", - "title": "Examine auto-delete of old invoices/payments/forwards", + "rpc": "connect", + "title": "Command for connecting to another lightning node", "description": [ - "The **autoclean-status** RPC command tells you about the status of the autclean plugin, optionally for only one subsystem." + "The **connect** RPC command establishes a new connection with another node in the Lightning Network.", + "", + "Connecting to a node is just the first step in opening a channel with another node. Once the peer is connected a channel can be opened with lightning-fundchannel(7).", + "", + "If there are active channels with the peer, **connect** returns once all the subdaemons are in place to handle the channels, not just once it's connected." ], "request": { - "required": [], + "required": [ + "id" + ], "properties": { - "subsystem": { + "id": { "type": "string", - "enum": [ - "succeededforwards", - "failedforwards", - "succeededpays", - "failedpays", - "paidinvoices", - "expiredinvoices" - ], "description": [ - "What subsystem to ask about. Currently supported subsystems are:", - " * `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`).", - " * `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`).", - " * `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`).", - " * `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`).", - " * `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`).", - " * `paidinvoices`: invoices which were paid (`paid` in listinvoices `status)." + "The target node's public key. As a convenience, *id* may be of the form *id@host* or *id@host:port*. In this case, the *host* and *port* parameters must be omitted. This can fail if your C-lightning node is a fresh install that has not connected to any peers yet (your node has no gossip yet), or if the target *id* is a fresh install that has no channels yet (nobody will gossip about a node until it has one published channel)." + ] + }, + "host": { + "type": "string", + "description": [ + "The peer's hostname or IP address. If *host* is not specified (or doesn't work), the connection will be attempted to an IP belonging to *id* obtained through gossip with other already connected peers. If *host* begins with a `/` it is interpreted as a local path and the connection will be made to that local socket (see **bind-addr** in lightningd-config(5))." + ] + }, + "port": { + "type": "u16", + "description": [ + "The peer's port number. If not specified, the *port* depends on the current network:", + " * bitcoin **mainnet**: 9735.", + " * bitcoin **testnet**: 19735.", + " * bitcoin **signet**: 39735.", + " * bitcoin **regtest**: 19846." ] } } }, "response": { "required": [ - "autoclean" + "id", + "features", + "direction", + "address" ], "properties": { - "autoclean": { + "id": { + "type": "pubkey", + "description": [ + "The peer we connected to." + ] + }, + "features": { + "type": "hex", + "description": [ + "BOLT 9 features bitmap offered by peer." + ] + }, + "direction": { + "type": "string", + "enum": [ + "in", + "out" + ], + "description": [ + "Whether they initiated connection or we did." + ] + }, + "address": { "type": "object", - "additionalProperties": false, + "description": [ + "Address information (mainly useful if **direction** is *out*)." + ], + "additionalProperties": true, + "required": [ + "type" + ], "properties": { - "succeededforwards": { - "type": "object", - "additionalProperties": true, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": { - "type": "boolean", - "description": [ - "Whether autocleaning is enabled for successful listforwards." - ] - }, - "cleaned": { - "type": "u64", - "description": [ - "Total number of deletions done (ever)." - ] - } - }, - "if": { - "properties": { - "enabled": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "enabled", - "age", - "cleaned" - ], - "properties": { - "enabled": {}, - "cleaned": {}, - "age": { - "type": "u64", - "description": [ - "Age (in seconds) to delete successful listforwards." - ] - } - } - }, - "else": { - "additionalProperties": false, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": {}, - "cleaned": {} - } - } - }, - "failedforwards": { - "type": "object", - "additionalProperties": true, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": { - "type": "boolean", - "description": [ - "Whether autocleaning is enabled for failed listforwards." - ] - }, - "cleaned": { - "type": "u64", - "description": [ - "Total number of deletions done (ever)." - ] - } - }, - "if": { - "properties": { - "enabled": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "enabled", - "age", - "cleaned" - ], - "properties": { - "enabled": {}, - "cleaned": {}, - "age": { - "type": "u64", - "description": [ - "Age (in seconds) to delete failed listforwards." - ] - } - } - }, - "else": { - "additionalProperties": false, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": {}, - "cleaned": {} - } - } - }, - "succeededpays": { - "type": "object", - "additionalProperties": true, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": { - "type": "boolean", - "description": [ - "Whether autocleaning is enabled for successful listpays/listsendpays." - ] - }, - "cleaned": { - "type": "u64", - "description": [ - "Total number of deletions done (ever)." - ] - } - }, - "if": { - "properties": { - "enabled": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "enabled", - "age", - "cleaned" - ], - "properties": { - "enabled": {}, - "cleaned": {}, - "age": { - "type": "u64", - "description": [ - "Age (in seconds) to delete successful listpays/listsendpays." - ] - } - } - }, - "else": { - "additionalProperties": false, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": {}, - "cleaned": {} - } - } - }, - "failedpays": { - "type": "object", - "additionalProperties": true, - "required": [ - "enabled", - "cleaned" + "type": { + "type": "string", + "enum": [ + "local socket", + "ipv4", + "ipv6", + "torv2", + "torv3" ], - "properties": { - "enabled": { - "type": "boolean", - "description": [ - "Whether autocleaning is enabled for failed listpays/listsendpays." - ] - }, - "cleaned": { - "type": "u64", - "description": [ - "Total number of deletions done (ever)." - ] - } - }, + "description": [ + "Type of connection (*torv2*/*torv3* only if **direction** is *out*)." + ] + } + }, + "allOf": [ + { "if": { "properties": { - "enabled": { - "type": "boolean", + "type": { + "type": "string", "enum": [ - true + "local socket" ] } } @@ -7565,60 +4253,29 @@ "then": { "additionalProperties": false, "required": [ - "enabled", - "age", - "cleaned" + "socket" ], "properties": { - "enabled": {}, - "cleaned": {}, - "age": { - "type": "u64", + "type": {}, + "socket": { + "type": "string", "description": [ - "Age (in seconds) to delete failed listpays/listsendpays." + "Socket filename." ] } } - }, - "else": { - "additionalProperties": false, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": {}, - "cleaned": {} - } } }, - "paidinvoices": { - "type": "object", - "additionalProperties": true, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": { - "type": "boolean", - "description": [ - "Whether autocleaning is enabled for paid listinvoices." - ] - }, - "cleaned": { - "type": "u64", - "description": [ - "Total number of deletions done (ever)." - ] - } - }, + { "if": { "properties": { - "enabled": { - "type": "boolean", + "type": { + "type": "string", "enum": [ - true + "ipv4", + "ipv6", + "torv2", + "torv3" ] } } @@ -7626,3664 +4283,3831 @@ "then": { "additionalProperties": false, "required": [ - "enabled", - "age", - "cleaned" + "address", + "port" ], "properties": { - "enabled": {}, - "cleaned": {}, - "age": { - "type": "u64", + "type": {}, + "address": { + "type": "string", "description": [ - "Age (in seconds) to paid listinvoices." - ] - } - } - }, - "else": { - "additionalProperties": false, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": {}, - "cleaned": {} - } - } - }, - "expiredinvoices": { - "type": "object", - "additionalProperties": true, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": { - "type": "boolean", - "description": [ - "Whether autocleaning is enabled for expired (unpaid) listinvoices." - ] - }, - "cleaned": { - "type": "u64", - "description": [ - "Total number of deletions done (ever)." - ] - } - }, - "if": { - "properties": { - "enabled": { - "type": "boolean", - "enum": [ - true + "Address in expected format for **type**." ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "enabled", - "age", - "cleaned" - ], - "properties": { - "enabled": {}, - "cleaned": {}, - "age": { - "type": "u64", + }, + "port": { + "type": "u16", "description": [ - "Age (in seconds) to expired listinvoices." + "Port number." ] } } - }, - "else": { - "additionalProperties": false, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": {}, - "cleaned": {} - } } } - } + ] } - }, - "pre_return_value_notes": [ - "Note that the ages parameters are set by various `autoclean-...-age` parameters in your configuration: see lightningd-config(5)." - ] + } }, + "errors": [ + "On failure, one of the following errors will be returned:", + "", + "- 400: Unable to connect, no address known for peer", + "- 401: If some addresses are known but connecting to all of them failed, the message will contain details about the failures", + "- 402: If the peer disconnected while we were connecting", + "- -32602: If the given parameters are wrong" + ], "example_json_request": [ { - "id": "example:autoclean-status#1", - "method": "autoclean-status", + "id": "example:connect#1", + "method": "connect", "params": { - "subsystem": "expiredinvoices" + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "host": "localhost", + "port": 44619 } }, { - "id": "example:autoclean-status#2", - "method": "autoclean-status", + "id": "example:connect#2", + "method": "connect", "params": { - "subsystem": null + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "host": "127.0.0.1", + "port": 42839 } } ], "example_json_response": [ { - "autoclean": { - "expiredinvoices": { - "enabled": false, - "cleaned": 0 - } + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "features": "08a0000a0a69a2", + "direction": "out", + "address": { + "type": "ipv4", + "address": "127.0.0.1", + "port": 44619 } }, { - "autoclean": { - "succeededforwards": { - "enabled": false, - "cleaned": 0 - }, - "failedforwards": { - "enabled": false, - "cleaned": 0 - }, - "succeededpays": { - "enabled": false, - "cleaned": 0 - }, - "failedpays": { - "enabled": false, - "cleaned": 0 - }, - "paidinvoices": { - "enabled": false, - "cleaned": 0 - }, - "expiredinvoices": { - "enabled": true, - "age": 2, - "cleaned": 0 - } + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "features": "08a0000a8a5961", + "direction": "out", + "address": { + "type": "ipv4", + "address": "127.0.0.1", + "port": 42839 } } ], "author": [ - "Rusty Russell <> is mainly responsible." + "Rusty Russell <> is mainly responsible. Felix <> is the original author of this manpage." ], "see_also": [ - "lightningd-config(5)", - "lightning-listinvoices(7)", - "lightning-listpays(7)", - "lightning-listforwards(7)" + "lightning-fundchannel(7)", + "lightning-listpeers(7)", + "lightning-listchannels(7)", + "lightning-disconnect(7)" ], "resources": [ "Main web site: " ] }, - "lightning-autocleaninvoice.json": { + "lightning-createinvoice.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "setchannel", - "title": "Command for configuring fees / htlc range advertized for a channel", - "description": [], + "rpc": "createinvoice", + "title": "Low-level invoice creation", + "description": [ + "The **createinvoice** RPC command signs and saves an invoice into the database." + ], "request": { - "required": [], + "required": [ + "invstring", + "label", + "preimage" + ], "properties": { - "expired_by": { - "type": "u64", + "invstring": { + "type": "string", "description": [ - "How long an invoice must be expired (seconds) before we delete it." + "The bolt11 form, but the final signature is ignored. Minimal sanity checks are done. (Note: if **experimental-offers** is enabled, *invstring* can actually be an unsigned bolt12 invoice)." ] }, - "cycle_seconds": { - "type": "u64", + "label": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], "description": [ - "The interval (in seconds) between cleaning expired invoices." + "A unique string or number (which is treated as a string, so `01` is different from `1`); it is never revealed to other nodes on the lightning network, but it can be used to query the status of this invoice." + ] + }, + "preimage": { + "type": "hex", + "description": [ + "The preimage to supply upon successful payment of the invoice." ] } } }, "response": { "required": [ - "enabled" + "label", + "created_index", + "payment_hash", + "status", + "description", + "expires_at" ], "properties": { - "enabled": { - "type": "boolean", + "label": { + "type": "string", "description": [ - "Whether invoice autocleaning is active." + "The label for the invoice." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string (always present unless **bolt12** is)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string instead of **bolt11** (**experimental-offers** only)." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount of the invoice (if it has one)." + ] + }, + "status": { + "type": "string", + "enum": [ + "paid", + "expired", + "unpaid" + ], + "description": [ + "Whether it has been paid, or can no longer be paid." + ] + }, + "description": { + "type": "string", + "description": [ + "Description extracted from **bolt11** or **bolt12**." + ] + }, + "expires_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when invoice expires (or expired)." + ] + }, + "created_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was created in." + ] + }, + "pay_index": { + "type": "u64", + "description": [ + "Incrementing id for when this was paid (**status** *paid* only)." + ] + }, + "amount_received_msat": { + "type": "msat", + "description": [ + "Amount actually received (**status** *paid* only)." + ] + }, + "paid_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when invoice was paid (**status** *paid* only)." + ] + }, + "paid_outpoint": { + "type": "object", + "description": [ + "Outpoint this invoice was paid with (**status** *paid* only)." + ], + "added": "v23.11", + "additionalProperties": false, + "required": [ + "txid", + "outnum" + ], + "properties": { + "txid": { + "added": "v23.11", + "type": "txid", + "description": [ + "ID of the transaction that paid the invoice (**status** *paid* only)." + ] + }, + "outnum": { + "added": "v23.11", + "type": "u32", + "description": [ + "The 0-based output number of the transaction that paid the invoice (**status** *paid* only)." + ] + } + } + }, + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash**." + ] + }, + "local_offer_id": { + "type": "hex", + "description": [ + "The *id* of our offer which created this invoice (**experimental-offers** only)." + ], + "maxLength": 64, + "minLength": 64 + }, + "invreq_payer_note": { + "type": "string", + "description": [ + "The optional *invreq_payer_note* from invoice_request which created this invoice (**experimental-offers** only)." ] } }, - "allOf": [ - { - "if": { - "properties": { - "enabled": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { + "pre_return_value_notes": [ + "(Note: the return format is the same as lightning-listinvoices(7))." + ] + }, + "errors": [ + "On failure, an error is returned and no invoice is created. If the lightning process fails before responding, the caller should use lightning-listinvoices(7) to query whether this invoice was created or not.", + "", + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error.", + "- 900: An invoice with the given *label* already exists." + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-invoice(7)", + "lightning-listinvoices(7)", + "lightning-delinvoice(7)", + "lightning-getroute(7)", + "lightning-sendpay(7)", + "lightning-offer(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-createonion.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "createonion", + "title": "Low-level command to create a custom onion", + "description": [ + "The **createonion** RPC command allows the caller to create a custom onion with custom payloads at each hop in the route. A custom onion can be used to implement protocol extensions that are not supported by Core Lightning directly." + ], + "request": { + "required": [ + "hops", + "assocdata" + ], + "properties": { + "hops": { + "type": "array", + "description": [ + "A JSON list of dicts, each specifying a node and the payload destined for that node." + ], + "items": { + "type": "object", "additionalProperties": false, "required": [ - "expired_by", - "cycle_seconds" + "pubkey", + "payload" ], "properties": { - "enabled": {}, - "expired_by": { - "type": "u64", + "pubkey": { + "type": "pubkey", "description": [ - "How long an invoice must be expired (seconds) before we delete it." + "Node pubkey." ] }, - "cycle_seconds": { - "type": "u64", + "payload": { + "type": "hex", "description": [ - "How long an invoice must be expired (seconds) before we delete it." + "Payload to be sent to the node." ] } } - }, - "else": { - "additionalProperties": false, - "properties": { - "enabled": {} - } } + }, + "assocdata": { + "type": "hex", + "description": [ + "The associated data that the onion should commit to. If the onion is to be used to send a payment later it MUST match the `payment_hash` of the payment in order to be valid." + ] + }, + "session_key": { + "type": "secret", + "description": [ + "Can be used to specify a secret that is used to generate the shared secrets used to encrypt the onion for each hop. It should only be used for testing or if a specific shared secret is important. If not specified it will be securely generated internally, and the shared secrets will be returned." + ] + }, + "onion_size": { + "type": "u16", + "description": [ + "A size different from the default payment onion (1300 bytes). May be used for custom protocols like trampoline routing." + ] } - ] + } + }, + "response": { + "required": [ + "onion", + "shared_secrets" + ], + "properties": { + "onion": { + "type": "hex", + "description": [ + "The onion packet (*onion_size* bytes)." + ] + }, + "shared_secrets": { + "type": "array", + "description": [ + "One shared secret for each node in the *hops* parameter." + ], + "items": { + "type": "secret", + "description": [ + "The shared secret with this hop." + ] + } + } + } }, + "example_usage": [ + "The following is an example of a 3 hop onion:", + "", + "```json", + "[", + " {", + " \"pubkey\": \"022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59\",", + " \"payload\": \"11020203e904017b06080000670000010001\"", + " }, {", + " \"pubkey\": \"035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d\",", + " \"payload\": \"11020203e804017506080000670000030001\"", + " }, {", + " \"pubkey\": \"0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199\",", + " \"payload\": \"07020203e8040175\"", + " }", + "]", + "```", + "", + "The *hops* parameter is very similar to the result from `getroute` however it needs to be modified slightly. The following is the `getroute` response from which the above *hops* parameter was generated:", + "", + "```json", + "[", + " {", + " \"id\": \"022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59\",", + " \"channel\": \"103x2x1\",", + " \"direction\": 1,", + " \"msatoshi\": 1002,", + " \"amount_msat\": \"1002msat\",", + " \"delay\": 21,", + " }, {", + " \"id\": \"035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d\",", + " \"channel\": \"103x1x1\",", + " \"direction\": 0,", + " \"msatoshi\": 1001,", + " \"amount_msat\": \"1001msat\",", + " \"delay\": 15,", + " }, {", + " \"id\": \"0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199\",", + " \"channel\": \"103x3x1\",", + " \"direction\": 0,", + " \"msatoshi\": 1000,", + " \"amount_msat\": \"1000msat\",", + " \"delay\": 9,", + " }", + "]", + "```", + "", + " - Notice that the payload in the *hops* parameter is the hex-encoded TLV of the parameters in the `getroute` response, with length prepended as a `bigsize_t`.", + " - Except for the pubkey, the values are shifted left by one, i.e., the 1st payload in `createonion` corresponds to the 2nd set of values from `getroute`.", + " - The final payload is a copy of the last payload sans `channel`", + "", + "These rules are directly derived from the onion construction. Please refer BOLT 04 for details and rationale.", + "", + "The following example is the result of calling *createonion* with the above hops parameter:", + "", + " ```json", + " {", + " \"onion\": \"0003f3f80d2142b953319336d2fe4097[...]6af33fcf4fb113bce01f56dd62248a9e5fcbbfba35c\",", + " \"shared_secrets\": [", + " \"88ce98c73e4d9293ab1797b0a913fe9bca0213a566252047d01b8af6da871f3e\",", + " \"4474d296810e57bd460ef8b83d2e7d288321f8a99ff7686f87384699747bcfc4\",", + " \"2a862e4123e01799a732be487fbce297f7dc7cc1467e410f18369cfee476adc2\"", + " ]", + " }", + "```", + "", + "The `onion` corresponds to 1366 hex-encoded bytes. Each shared secret consists of 32 hex-encoded bytes. Both arguments can be passed on to **sendonion**." + ], "example_json_request": [ { - "id": "example:autocleaninvoice#1", - "method": "autocleaninvoice", + "id": "example:createonion#1", + "method": "createonion", "params": { - "cycle_seconds": 8, - "expired_by": 2 + "hops": [ + { + "pubkey": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "payload": "e4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "pubkey": "0324653eac434488002cc06bbfb7f10fe18991e35f9fe4302dbea6d2353dc0ab1c", + "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "pubkey": "027f31ebc5462c1fdce1b737ecff52d37d75dea43ce11c74d25aa297165faa2007", + "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "pubkey": "032c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991", + "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "pubkey": "02edabbd16b41c8371b92ef2f04c1185b4f03b6dcd52ba9b78d9d7c89c8f221145", + "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + ], + "assocdata": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", + "onion_size": 1301 } }, { - "id": "example:autocleaninvoice#2", - "method": "autocleaninvoice", + "id": "example:createonion#2", + "method": "createonion", "params": { - "cycle_seconds": 1, - "expired_by": 1 + "hops": [ + { + "pubkey": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "payload": "0cfdb000084869207468657265" + } + ], + "assocdata": "36bf44cc8d80498b95eb05e36ae5811206d3a1d8b5c8d59bbcad035d386a4de8" } } ], "example_json_response": [ { - "enabled": true, - "cycle_seconds": 8, - "expired_by": 2 + "onion": "00034c3f9e11d92555260db3ee4ba0378a645d01c2556451f4289a1d9b43c7afa9a4f9ecc7010dafb26787bb583c514c3b3990d40c8168b1046659d7bc2512d2f1ee0afd2b87c42de2b70102b649634d211b38049593dbb6ed8ee8f93f0b9ff23cd9654c1341137711ce67751d40867cc90c290a9446be2b8a5a43641d4549505b13e807b4240b5b82ffaf22cb534cff01be46db3985ac83b7db465fbd86d4c8d472f60678946c71eca97dd5db732fe5a6d3765e5a5afad72f035207173e7eaaa0da4f0a4540472c7dd269a030428ae586a61b2a70a428055c3848427d2a2e8bd521aadbaf79d56ea39df63c059772e026d57f0b6844c1ab99e936beadf42aaa78193b05f7380e242258deeaa90db316a943d311ef4f2a08f422422c9da454f9666742ad61c6ae003bce83cf6243adf64a728ea50bdaf129ab2ac70e1988a117609cbefc01c884f86b2494349d1067f5cf17760cdab6ae076631693147e8712412d4f0b17cf288b394fd9e29419156ee629966553c2e7598631cbf7493820388eef1ae9f4d2f9da88872e8afbbedb3b46cd7c461cbe4c5491dc6f4a68bc244584bc79b1bb227c869fae16dab4b16412523c984d3ed2b872f63b95a62f66563d2b03c3d1b5fff0290411b293569ce8435b96b447be776b49395a8d94f48cb2f7699a38e8de58d6fff04075d226dcac07668512b6d2c20d4c49d03ad300a52769e4ebbacf97378633126958df1817effc12fd679723123df244fd9b5421f8a2aedb9a8b6fb4049e3a7cae3985059081239bea38351f0c90ed5a0ff45cc492e6ab353e4c13d22ff48912d6ecfda711edfb88dc0767ecfc5dddf8fb0e112a538aeee55c0f73b3b8afc4f40ef3588eabde5b95344a4525adf67841dd67b1db10da180fb346e0bd2958f095d011827063c42361964f8ac2c356d2ec1868a9498dcd6b5915a4df4601c58fcbeb688e14de61300f13183c154b3320cc8e80042a46f22d796f56ff1fdd7e28440c05f14b960c1d0a7c627b09295112bcb635b0e2447a9374fafc4a23ceaf9de4d10b29b2f6cabd7f0c7706cf0404452681d7372d559b644627b2695960deb3b4ae57028e0164b29d5ef9e701d3122b6a5715c502e1dca5252e8c215ed754b01a193041ad9751ed2fff1b55991e256edd6099a38004a367ad097c7caf953da302201263715517f6d32cff57969be994df42fd6cadb649e3c738be798f779aaf4c07cada6bf1e4115b74e2670baf4b1592c70b10a6c043b6606b428b3f79545dc8e9783c876e5402909858f9c604963c37fbc477137c8908e6cfa11ece18c8784a6f25428a5ee1e91d0095fe310d6a91139a7c5c6624bbfcaa15ee847a25b06f57332917f68526a6317f575792e9bcba8576a96bc5859b1f2a00fd8ab08a5ac4ab71833b0b711d1f120cbdb374bcedcdcbeba3806644f5082ec737a945221f5d99562fcbb02a43beeafb16ceecd4e35f06a04c9ff9f4f33725ab62cf22c36650280e4cfb9e150a2c4ebee7785108522e8ecb4682d2d751168e7597299346c3a5e885e36eda66b9a1112997111135767972d771b02c1a36c1d1fb1ce539ecfb98e9e1d8f8fdbf89aec28ad34ff5c00c1a4a8c59848dc8b64c0e65f6f10122e60b4adc1cfc602f49d6cfbdd54be6b0951d3f9cafe8cdd0428f9ce6994844e92d8b72d44edda623bad428b398f88643c3904bda16dd15e886ca4ef6ea7f1450744ac38ffce902569d2e9026bcedd6d0ee54aceabda22bf2de72cba89e6c274064619e32a1192cf2d78b56cf497f7785a6d599de9f8383d1f66f47fc385dc569ee1f08ddbbc7f1aeb0a0126fc4020d948dda10255f11e776db7a037059a40fde38a2ee0c0ce49c7f3df175881bf12371fa72fec3fba657107892a97efe41dcc18aeecd99f3e46c33cf42c2a0ba8b75cf000", + "shared_secrets": [ + "ccf2512684e2508cb4a842393757e6040b7d25e29d3a2031f29d00a000af6128", + "d4cec39fe6287d41165bf5c608b0c720a411208a83c64c805a012c86662a2e5a", + "91bc712ebd4a900e05830394ca8b1f1168777ecdd6996029d96ec8838b9903b9", + "93c373dcb14dc36ababa3e0c5c55869a667ca175e09913a98c3be67e6af97e16", + "b2642a5770a6b61ade071fdf69d3ea365cf48434fc2a2c399512778821a33e5c" + ] }, { - "enabled": true, - "cycle_seconds": 1, - "expired_by": 1 + "onion": "0002cdce4bfaa9faa2c060afafe001b80bde07fc670e882c063a80b4738d5f78c9351825c6461cdfcd4fe4144d3b51f63da6351b28dd49c7bfdb0b4f7d8bda4ad0d99699eda39e551084c0a095746c358d1dc6d2eec8082f2aa2f69ae8f61b1f1437ae0ed673078fec6c0510a34058167ad1a34e819a3813d4cf27b2c4917a8c6ca3d70c3381a2a41b4c1b4540adf0e922e25f57d1cfc3064f29cfec4c17244160121975cab59b44c83b4a4905bf7ebfbd308de376334bf86d8aa92c674f7bcfec85680d73e9fee72642c98c603128e358c86e0bc88a60aaebc2637441a57261c61c6be145f00f2fc56164a6495f4b52d3172cb0ef52e91fa0d32a9ae2502d17433bda58d93fbc24a70ec6b5e740952a61404c7370eafe52599c7ee52e77b1cda87c46da98d2ff0d02fe09db5adcb2d2e9bcd083ef58392907b8a21681fa4ea1e4806b4676656457fea000fa504f9b4d159fe8b241266ac91dcc0351053c6dcc1493a6b02bed652cc8b92a8470c98924ebfde6ddc5cf7fd75f6e83a7350642053b70d4834179c30eb56d8c86656cda784daf3b6cd125779bec51099301e3f79f78d85d0454aef8bf5f9058491881b73e99b662b64080cd3eb16fd7f9d9640c18738736cfc15f391232b7df92f46ceb5abf08732ff833e9409ee541d7c926f7a0fe3e233d3eee4a63b65ab23b7c835b7cdd809ddfac8abb1df471fa66a54092815aa41e6fc1a026b86c5675d39c4e8c5c4b4acd48534165239f5634b9e828a7f9df94efcd2a39045efdee4d2f006a63ae828e6e90e3610c522085da6e0198141d6e501d83aba32057f4e59f9b7dfb0bf949c5ef91917cb54561d45a9e7ead049c57deb62d14ba6e18f5d7b0fb9f15e97bf5bd9f909f99c86c787357946654b87c489d34245d07fbb72119166e338b608a4178b452695235dd96bf7fd338e29a9f054ec1a63a442e12602d2329834297f6a197d8a377d608f402f0bcc936f45f33c8d2f9d40e5aef41816dd883add81ca20f1e0631457fe00aa2bd75c9165ffcd96c100c1db83a53aeee23d59f2a542ee3ba39ba62298ddfbd9ecfafd6b5d2121eb003ee23a2ebb8c6b6b687f42492c962510c5acf5231ff96635eba37354559ba39b042d9b6883cac662f418d7c62f9908b2a67964af5e5471804f7684e0d582b8bfec99816bb3442cca1d1fe4efd75d573ebf09fa9cad811063864fb14be4a7768ec2ddb118a77969e986c6584c4b20f8622941ca73d73562857d36e17a46a68d6e10147aaefff1ffb9809f0652a5f760148ed33550661b63c8176d5679e701c221d8a49d4062eb04010ea74cc1132fbeb8934c6e582ba2a16162b7e9171f95bce4ec3e339e70c781f95aaca406cd718b74397658fdefdd093486664be7ed13efa437012f1f57f9f1f4fb4eef7501ccf0e0ac4edc01fde138038c4dd65cb5c3291ad02a6728d6761b1afa35d49bd6ef117012bdd9bd6ee8a175620feb2249aa18d6175351b4bfc2b2b4fd57ff52f5969b109aa9b6cb2cde8f350917c0da2da1bc3d52eb0c7e6080b8f69c5783f2ed26feceb05ba4e7ed66676041d03d0acd3dd6343a85ac0b9c36f9640ddd0db884822f98dc42ea7911a6938dc14ba19d3d25a2b2f82794a2b5dd751dc856d7a9ccdb2d351a0b84e7030fa925ac949a37594f3aa2ba28ae5155b0aaac9c6820b8888d0b8a9db148513b9e3dbde68333ac30a0720289b6a0145d88629d49e76a6d3538330c5aececc9d54127b0a5a0e92d5a5a73beb71132c208b589cab61d53ed357c907929198c559426ae729b374a803dd3321a45ccca39efd39eddaba6e79a2f8911bdf74e18733dc7efc51132b5608d97fd2d0f22fa8961de04cdf6d0dbfbab21e362e7abaef3976f993088aa97ed3f1f4bcf3fffb012f583558bd2f15face9cba20b3e6754b70", + "shared_secrets": [ + "3f53c03f98eb83db88ff97c2c4004051ce23265ed2414a7aebf7a3e7078839ab" + ] } ], "author": [ - "Rusty Russell <> is mainly responsible." + "Christian Decker <> is mainly responsible." ], "see_also": [ - "lightningd-config(5)", - "lightning-listinvoices(7)" + "lightning-sendonion(7)", + "lightning-getroute(7)" ], "resources": [ - "Main web site: " + "Main web site: ", + "", + "[BOLT 04](https://github.com/lightning/bolts/blob/master/04-onion-routing.md)" ] }, - "lightning-batching.json": { + "lightning-createrune.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "batching", - "title": "Command to allow database batching.", + "added": "v23.08", + "rpc": "createrune", + "title": "Command to Create/Update Rune for Authorizing Remote Peer Access", "description": [ - "The **batching** RPC command allows (but does not guarantee!) database commitments to be deferred when multiple commands are issued on this RPC connection. This is only useful if many commands are being given at once, in which case it can offer a performance improvement (the cost being that if there is a crash, it's unclear how many of the commands will have been persisted)." + "The **createrune** RPC command creates a base64 string called a *rune* which can be used to access commands on this node. Each *rune* contains a unique id (a number starting at 0), and can have restrictions inside it. Nobody can remove restrictions from a rune: if you try, the rune will be rejected. There is no limit on how many runes you can issue; the node simply decodes and checks them as they are received.", + "", + "Oh, I almost forgot. Runes can also be invoked like in ancient times with the **invokerune** command. Feel the magical powers of a rune by invoking it." ], "request": { - "required": [ - "enable" - ], + "required": [], "properties": { - "enable": { - "type": "boolean", + "rune": { + "type": "string", "description": [ - "Whether to enable or disable transaction batching." + "If supplied, the restrictions are simple appended to that *rune* (it doesn't need to be a rune belonging to this node). If not supplied, a new *rune* is constructed, with a new unique id." + ] + }, + "restrictions": { + "description": [ + "It can be the string `readonly`, or an array of restrictions.", + "Each restriction is an array of one or more alternatives, such as \"method is listpeers\", or \"method is listpeers OR time is before 2023\"." ], - "default": "False" - } - } - }, - "response": { - "properties": {} - }, - "example_json_request": [ - { - "id": "example:batching#1", - "method": "batching", + "oneOf": [ + { + "type": "array", + "description": [ + "Alternatives use a simple language to examine the command which is being run:", + " * time: the current UNIX time, e.g. \"time<1656759180\".", + " * id: the node_id of the peer, e.g. \"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\".", + " * method: the command being run, e.g. \"method=withdraw\".", + " * per: how often the rune can be used, with suffix \"sec\" (default), \"min\", \"hour\", \"day\" or \"msec\", \"usec\" or \"nsec\". e.g. \"per=5sec\".", + " * rate: the rate limit, per minute, e.g. \"rate=60\" is equivalent to \"per=1sec\".", + " * pnum: the number of parameters. e.g. \"pnum<2\".", + " * pnameX: the parameter named X (with any punctuation like `_` removed). e.g. \"pnamedestination=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T\".", + " * parrN: the N'th parameter. e.g. \"parr0=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T\"." + ], + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "type": "string", + "enum": [ + "readonly" + ], + "description": [ + "A rune which allows most *get* and *list* commands, and the *summary* command." + ] + } + ] + } + } + }, + "response": { + "required": [ + "rune", + "unique_id" + ], + "properties": { + "rune": { + "type": "string", + "description": [ + "The resulting rune." + ] + }, + "unique_id": { + "type": "string", + "description": [ + "The id of this rune: this is set at creation and cannot be changed (even as restrictions are added)." + ] + }, + "warning_unrestricted_rune": { + "type": "string", + "description": [ + "A warning shown when runes are created with powers that could drain your node." + ] + } + } + }, + "restriction_format": [ + "Restrictions are one or more alternatives. Each alternative is *name* *operator* *value*. The valid names are shown above.", + "", + "Note that if a value contains `\\`, it must be preceeded by another `\\` to form valid JSON:", + "* `=`: passes if equal ie. identical. e.g. `method=withdraw`", + "* `/`: not equals, e.g. `method/withdraw`", + "* `^`: starts with, e.g. `id^024b9a1fa8e006f1e3937f`", + "* `$`: ends with, e.g. `id$381df1cc449605`.", + "* `~`: contains, e.g. `id~006f1e3937f65f66c40`.", + "* `<`: is a decimal integer, and is less than. e.g. `time<1656759180`", + "* `>`: is a decimal integer, and is greater than. e.g. `time>1656759180`", + "* `{`: preceeds in alphabetical order (or matches but is shorter),", + " e.g. `id{02ff`.", + "* `}`: follows in alphabetical order (or matches but is longer),", + " e.g. `id}02ff`.", + "* `#`: a comment, ignored, e.g. `dumb example#`.", + "* `!`: only passes if the *name* does *not* exist. e.g. `pnamedestination!`.", + "Every other operator except `#` fails if *name* does not exist!" + ], + "example_usage": [ + "This creates a fresh rune which can do anything:", + "", + "```shell", + "$ lightning-cli commando-rune", + "{", + " \"rune\": \"KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA==\",", + " \"unique_id\": \"0\"", + "}", + "```", + "We can add restrictions to that rune, like so:", + "", + "```shell", + "$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions=readonly", + "{", + " \"rune\": \"NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl\",", + " \"unique_id\": \"0\"", + "}", + "```", + "The \"readonly\" restriction is a short-cut for two restrictions:", + "", + "1. `[\"method^list\", \"method^get\", \"method=summary\"]`: You may call list, get or summary.", + "2. `[\"method/listdatastore\"]`: But not listdatastore: that contains sensitive stuff!", + "", + "We can do the same manually, like so:", + "", + "```shell", + "$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions='[[\"method^list\", \"method^get\", \"method=summary\"],[\"method/listdatastore\"]]'", + "{", + " \"rune\": \"NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl\",", + " \"unique_id\": \"0\"", + "}", + "```", + "Let's create a rune which lets a specific peer (024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605) run \"listpeers\" on themselves:", + "", + "```shell", + "$ lightning-cli commando-rune restrictions='[[\"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"],[\"method=listpeers\"],[\"pnum=1\"],[\"pnameid=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\",\"parr0=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"]]'", + "{", + " \"rune\": \"FE8GHiGVvxcFqCQcClVRRiNE_XEeLYQzyG2jmqto4jM9MiZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDV8cGFycjA9MDI0YjlhMWZhOGUwMDZmMWUzOTM3ZjY1ZjY2YzQwOGU2ZGE4ZTFjYTcyOGVhNDMyMjJhNzM4MWRmMWNjNDQ5NjA1\",", + " \"unique_id\": \"2\"", + "}", + "```", + "This allows `listpeers` with 1 argument (`pnum=1`), which is either by name (`pnameid`), or position (`parr0`). We could shorten this in several ways: either allowing only positional or named parameters, or by testing the start of the parameters only. Here's an example which only checks the first 9 bytes of the `listpeers` parameter:", + "", + "```shell", + "$ lightning-cli commando-rune restrictions='[[\"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"],[\"method=listpeers\"],[\"pnum=1\"],[\"pnameid^024b9a1fa8e006f1e393\", \"parr0^024b9a1fa8e006f1e393\"]'", + " {", + " \"rune\": \"fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw==\",", + " \"unique_id\": \"3\"", + "}", + "```", + "Before we give this to our peer, let's add two more restrictions: that it only be usable for 24 hours from now (`time<`), and that it can only be used twice a minute (`rate=2`). `date +%s` can give us the current time in seconds:", + "", + "```shell", + "$ lightning-cli commando-rune rune=fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw== restrictions='[[\"time<'$(($(date +%s) + 24*60*60))'\",\"rate=2\"]]'", + "{", + " \"rune\": \"tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y\",", + " \"unique_id\": \"3\"", + "}", + "```", + "You can also use lightning-decode(7) to examine runes you have been given:", + "", + "```shell", + "$ lightning-cli decode tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y", + "{", + " \"type\": \"rune\",", + " \"unique_id\": \"3\",", + " \"string\": \"b54f912e33220e9636534a375b5a05a306abdfa4451a95a5a0f6d6f7e46e65da:=3&id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605&method=listpeers&pnum=1&pnameid^024b9a1fa8e006f1e393|parr0^024b9a1fa8e006f1e393&time<1656920538&rate=2\",", + " \"restrictions\": [", + " {", + " \"alternatives\": [", + " \"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"", + " ],", + " \"summary\": \"id (of commanding peer) equal to '024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605'\"", + " },", + " {", + " \"alternatives\": [", + " \"method=listpeers\"", + " ],", + " \"summary\": \"method (of command) equal to 'listpeers'\"", + " },", + " {", + " \"alternatives\": [", + " \"pnum=1\"", + " ],", + " \"summary\": \"pnum (number of command parameters) equal to 1\"", + " },", + " {", + " \"alternatives\": [", + " \"pnameid^024b9a1fa8e006f1e393\",", + " \"parr0^024b9a1fa8e006f1e393\"", + " ],", + " \"summary\": \"pnameid (object parameter 'id') starts with '024b9a1fa8e006f1e393' OR parr0 (array parameter #0) starts with '024b9a1fa8e006f1e393'\"", + " },", + " {", + " \"alternatives\": [", + " \"time<1656920538\"", + " ],", + " \"summary\": \"time (in seconds since 1970) less than 1656920538 (approximately 19 hours 18 minutes from now)\"", + " },", + " {", + " \"alternatives\": [", + " \"rate=2\"", + " ],", + " \"summary\": \"rate (max per minute) equal to 2\"", + " }", + " ],", + " \"valid\": true", + "}", + "```" + ], + "sharing_runes": [ + "Because anyone can add a restriction to a rune, you can always turn a normal rune into a read-only rune, or restrict access for 30 minutes from the time you give it to someone. Adding restrictions before sharing runes is best practice.", + "", + "If a rune has a ratelimit, any derived rune will have the same id, and thus will compete for that ratelimit. You might want to consider adding a tighter ratelimit to a rune before sharing it, so you will keep the remainder. For example, if you rune has a limit of 60 times per minute, adding a limit of 5 times per minute and handing that rune out means you can still use your original rune 55 times per minute." + ], + "example_json_request": [ + { + "id": "example:createrune#1", + "method": "createrune", "params": { - "enable": true + "restrictions": [ + [ + "method/getinfo" + ] + ] + } + }, + { + "id": "example:createrune#2", + "method": "createrune", + "params": { + "restrictions": "readonly" } + }, + { + "id": "example:createrune#3", + "method": "createrune", + "params": [ + "enX0sTpHB8y1ktyTAF80CnEvGetG340Ne3AGItudBS49NCZwbnVtPTA=", + [ + [ + "rate=3" + ] + ] + ] } ], "example_json_response": [ - {} + { + "rune": "S5f-BKt3rR-cvJmujdpDCUQm_XLahfB4iQuDlwqMJiQ9MCZtZXRob2QvZ2V0aW5mbw==", + "unique_id": "0" + }, + { + "rune": "oVkzoiQ67VCU1h_aRjPqCeWktGX54ARDsqqQgDL-uMs9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", + "unique_id": "1" + }, + { + "rune": "_h2eKjoK7ITAF-JQ1S5oum9oMQesrz-t1FR9kDChRB49NCZwbnVtPTAmcmF0ZT0z", + "unique_id": "2" + } ], - "errors": [ - "On failure, one of the following error codes may be returned:", + "author": [ + "Rusty Russell <> wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page.", "", - "- -32602: Error in given parameters." + "Shahana Farooqui <> is mainly responsible for migrating commando-rune to createrune." ], - "author": [ - "Rusty Russell <> wrote the initial version of this man page." + "see_also": [ + "lightning-commando-rune(7)", + "lightning-checkrune(7)" ], "resources": [ "Main web site: " ] }, - "lightning-bkpr-channelsapy.json": { + "lightning-datastore.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "bkpr-channelsapy", - "title": "Command to list stats on channel earnings", + "rpc": "datastore", + "title": "Command for storing (plugin) data", "description": [ - "The **bkpr-channelsapy** RPC command lists stats on routing income, leasing income, and various calculated APYs for channel routed funds." + "The **datastore** RPC command allows plugins to store data in the Core Lightning database, for later retrieval." ], "request": { - "required": [], + "required": [ + "key" + ], "properties": { - "start_time": { - "type": "u64", + "key": { "description": [ - "UNIX timestamp (in seconds) to filter events after the provided timestamp." + "A key can either have children or a value, never both: parents are created and removed automatically." ], - "default": "zero" + "oneOf": [ + { + "type": "array", + "description": [ + "An array of values to form a hierarchy (though a single value is treated as a one-element array). Using the first element of the key as the plugin name (e.g. `[ 'summary' ]`) is recommended." + ], + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] }, - "end_time": { - "type": "u64", + "string": { + "type": "string", "description": [ - "UNIX timestamp (in seconds) to filter events up to and at the provided timestamp." + "Data to be saved in string format." + ] + }, + "hex": { + "type": "hex", + "description": [ + "Data to be saved in hex format." + ] + }, + "mode": { + "type": "string", + "description": [ + "Write mode to determine how the record is updated:", + " * `must-create`: fails if it already exists.", + " * `must-replace`: fails if it doesn't already exist.", + " * `create-or-replace`: never fails.", + " * `must-append`: must already exist, append this to what's already there.", + " * `create-or-append`: append if anything is there, otherwise create." ], - "default": "max-int" + "enum": [ + "must-create", + "must-replace", + "create-or-replace", + "must-append", + "create-or-append" + ], + "default": "`must-create`" + }, + "generation": { + "type": "u64", + "description": [ + "If specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with *mode* `must-replace` or `must-append`." + ] } } }, "response": { "required": [ - "channels_apy" + "key" ], "properties": { - "channels_apy": { + "key": { "type": "array", "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "account", - "routed_out_msat", - "routed_in_msat", - "lease_fee_paid_msat", - "lease_fee_earned_msat", - "pushed_out_msat", - "pushed_in_msat", - "our_start_balance_msat", - "channel_start_balance_msat", - "fees_out_msat", - "utilization_out", - "utilization_in", - "apy_out", - "apy_in", - "apy_total" - ], - "properties": { - "account": { - "type": "string", - "description": [ - "The account name. If the account is a channel, the channel_id. The 'net' entry is the rollup of all channel accounts." - ] - }, - "routed_out_msat": { - "type": "msat", - "description": [ - "Sats routed (outbound)." - ] - }, - "routed_in_msat": { - "type": "msat", - "description": [ - "Sats routed (inbound)." - ] - }, - "lease_fee_paid_msat": { - "type": "msat", - "description": [ - "Sats paid for leasing inbound (liquidity ads)." - ] - }, - "lease_fee_earned_msat": { - "type": "msat", - "description": [ - "Sats earned for leasing outbound (liquidity ads)." - ] - }, - "pushed_out_msat": { - "type": "msat", - "description": [ - "Sats pushed to peer at open." - ] - }, - "pushed_in_msat": { - "type": "msat", - "description": [ - "Sats pushed in from peer at open." - ] - }, - "our_start_balance_msat": { - "type": "msat", - "description": [ - "Starting balance in channel at funding. Note that if our start balance is zero, any _initial field will be omitted (can't divide by zero)." - ] - }, - "channel_start_balance_msat": { - "type": "msat", - "description": [ - "Total starting balance at funding." - ] - }, - "fees_out_msat": { - "type": "msat", - "description": [ - "Fees earned on routed outbound." - ] - }, - "fees_in_msat": { - "type": "msat", - "description": [ - "Fees earned on routed inbound." - ] - }, - "utilization_out": { - "type": "string", - "description": [ - "Sats routed outbound / total start balance." - ] - }, - "utilization_out_initial": { - "type": "string", - "description": [ - "Sats routed outbound / our start balance." - ] - }, - "utilization_in": { - "type": "string", - "description": [ - "Sats routed inbound / total start balance." - ] - }, - "utilization_in_initial": { - "type": "string", - "description": [ - "Sats routed inbound / our start balance." - ] - }, - "apy_out": { - "type": "string", - "description": [ - "Fees earned on outbound routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)." - ] - }, - "apy_out_initial": { - "type": "string", - "description": [ - "Fees earned on outbound routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)." - ] - }, - "apy_in": { - "type": "string", - "description": [ - "Fees earned on inbound routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)." - ] - }, - "apy_in_initial": { - "type": "string", - "description": [ - "Fees earned on inbound routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)." - ] - }, - "apy_total": { - "type": "string", - "description": [ - "Total fees earned on routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)." - ] - }, - "apy_total_initial": { - "type": "string", - "description": [ - "Total fees earned on routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)." - ] - }, - "apy_lease": { - "type": "string", - "description": [ - "Lease fees earned over total amount leased for the lease term, amortized to a year (APY). Only appears if channel was leased out by us." - ] - } - } + "type": "string", + "description": [ + "Part of the key added to the datastore." + ] } + }, + "generation": { + "type": "u64", + "description": [ + "The number of times this has been updated." + ] + }, + "hex": { + "type": "hex", + "description": [ + "The hex data which has been added to the datastore." + ] + }, + "string": { + "type": "string", + "description": [ + "The data as a string, if it's valid utf-8." + ] } } }, + "errors": [ + "The following error codes may occur:", + "", + "- 1202: The key already exists (and mode said it must not)", + "- 1203: The key does not exist (and mode said it must)", + "- 1204: The generation was wrong (and generation was specified)", + "- 1205: The key has children already.", + "- 1206: One of the parents already exists with a value.", + "- -32602: invalid parameters" + ], "example_json_request": [ { - "id": "example:bkpr-channelsapy#1", - "method": "bkpr-channelsapy", - "params": "{}" - } + "id": "example:datastore#1", + "method": "datastore", + "params": { + "key": [ + "test_libplugin", + "name" + ], + "string": "foobar", + "hex": null, + "mode": "must-replace", + "generation": null + } + }, + { + "id": "example:datastore#2", + "method": "datastore", + "params": { + "key": "somekey", + "string": null, + "hex": "61", + "mode": "create-or-append", + "generation": null + } + }, + { + "id": "example:datastore#3", + "method": "datastore", + "params": { + "key": [ + "a", + "d", + "e", + "f", + "g" + ], + "string": "somedatatostoreinthedatastore", + "hex": null, + "mode": null, + "generation": null + } + } ], "example_json_response": [ { - "channels_apy": [ - { - "account": "e41b2ec83e9139a9fd8f1d89b01e5d7df73099494e6b91504c39445e37485b0d", - "routed_out_msat": 1431440, - "routed_in_msat": 0, - "lease_fee_paid_msat": 0, - "lease_fee_earned_msat": 0, - "pushed_out_msat": 0, - "pushed_in_msat": 0, - "our_start_balance_msat": 1000000000, - "channel_start_balance_msat": 1000000000, - "fees_out_msat": 0, - "fees_in_msat": 0, - "utilization_out": "0.1431%", - "utilization_out_initial": "0.1431%", - "utilization_in": "0.0000%", - "apy_out": "0.0000%", - "apy_out_initial": "0.0000%", - "apy_in": "0.0000%", - "apy_total": "0.0000%", - "apy_total_initial": "0.0000%" - }, - { - "account": "net", - "routed_out_msat": 1431440, - "routed_in_msat": 0, - "lease_fee_paid_msat": 0, - "lease_fee_earned_msat": 0, - "pushed_out_msat": 0, - "pushed_in_msat": 0, - "our_start_balance_msat": 1000000000, - "channel_start_balance_msat": 1000000000, - "fees_out_msat": 0, - "fees_in_msat": 0, - "utilization_out": "0.1431%", - "utilization_out_initial": "0.1431%", - "utilization_in": "0.0000%", - "apy_out": "0.0000%", - "apy_out_initial": "0.0000%", - "apy_in": "0.0000%", - "apy_total": "0.0000%", - "apy_total_initial": "0.0000%" - } - ] + "key": [ + "test_libplugin", + "name" + ], + "generation": 1, + "hex": "666f6f626172", + "string": "foobar" + }, + { + "key": [ + "somekey" + ], + "generation": 3, + "hex": "736f6d6564617461", + "string": "somedata" + }, + { + "key": [ + "a", + "d", + "e", + "f", + "g" + ], + "generation": 0, + "hex": "736f6d6564617461746f73746f7265696e7468656461746173746f7265", + "string": "somedatatostoreinthedatastore" } ], "author": [ - "Lisa Neigut <> is mainly responsible." + "Rusty Russell <> is mainly responsible." ], "see_also": [ - "lightning-bkpr-listincome(7)", - "lightning-bkpr-listfunds(7)", - "lightning-bkpr-listaccountevents(7)", - "lightning-bkpr-dumpincomecsv(7)", - "lightning-listpeers(7)" + "lightning-listdatastore(7)", + "lightning-deldatastore(7)", + "lightning-datastoreusage(7)" ], "resources": [ "Main web site: " ] }, - "lightning-bkpr-dumpincomecsv.json": { + "lightning-datastoreusage.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "bkpr-dumpincomecsv", - "title": "Command to emit a CSV of income events", + "added": "v23.11", + "rpc": "datastoreusage", + "title": "Command for listing datastore usage info", "description": [ - "The **bkpr-dumpincomcsv** RPC command writes a CSV file to disk at *csv_file* location. This is a formatted output of the **listincome** RPC command." + "The **datastoreusage** RPC command allows the caller to fetch the total bytes that are stored under a certain *key* (or from the root), including the size of the *key*.", + "", + "All descendants of the *key* (or root) are taken into account." ], "request": { - "required": [ - "csv_format" - ], + "required": [], "properties": { - "csv_format": { - "type": "string", - "description": [ - "CSV format to use. See RETURN VALUE for options." - ] - }, - "csv_file": { - "type": "string", - "description": [ - "On-disk destination of the generated CSV file." + "key": { + "oneOf": [ + { + "type": "array", + "description": [ + "Key is an array of values (though a single value is treated as a one-element array). Used as the starting point to traverse the datastore." + ], + "items": { + "type": "string" + } + }, + { + "type": "string" + } ] - }, - "consolidate_fees": { - "type": "boolean", - "description": [ - "If true, we emit a single, consolidated event for any onchain-fees for a txid and account. Otherwise, events for every update to the onchain fee calculation for this account and txid will be printed. Note that this means that the events emitted are non-stable, i.e. calling **dumpincomecsv** twice may result in different onchain fee events being emitted, depending on how much information we've logged for that transaction." - ], - "default": "True" - }, - "start_time": { - "type": "u64", - "description": [ - "UNIX timestamp (in seconds) that filters events after the provided timestamp." - ], - "default": "zero" - }, - "end_time": { - "type": "u64", - "description": [ - "UNIX timestamp (in seconds) that filters events up to and at the provided timestamp." - ], - "default": "max-int" } } }, "response": { "required": [ - "csv_file", - "csv_format" + "datastoreusage" ], "properties": { - "csv_file": { - "type": "string", - "description": [ - "File that the csv was generated to." - ] - }, - "csv_format": { - "type": "string", - "enum": [ - "cointracker", - "koinly", - "harmony", - "quickbooks" + "datastoreusage": { + "type": "object", + "additionalProperties": false, + "required": [ + "key", + "total_bytes" ], - "description": [ - "Format to print csv as." - ] + "properties": { + "key": { + "type": "string", + "added": "v23.11", + "description": [ + "The key from which the database was traversed." + ] + }, + "total_bytes": { + "type": "u64", + "added": "v23.11", + "description": [ + "The total bytes that are stored under the *key*, including the all descendants data and the size of the keys themselves." + ] + } + } } } }, "example_json_request": [ { - "id": "example:bkpr-dumpincomecsv#1", - "method": "bkpr-dumpincomecsv", - "params": [ - "koinly", - "koinly.csv" - ] + "id": "example:datastoreusage#1", + "method": "datastoreusage", + "params": { + "key": null + } + }, + { + "id": "example:datastoreusage#2", + "method": "datastoreusage", + "params": { + "key": "a" + } + }, + { + "id": "example:datastoreusage#3", + "method": "datastoreusage", + "params": { + "key": [ + "a", + "thisissomelongkeythattriestostore46bytesofdata" + ] + } } ], "example_json_response": [ { - "csv_file": "koinly.csv", - "csv_format": "koinly" + "datastoreusage": { + "key": "[]", + "total_bytes": 0 + } + }, + { + "datastoreusage": { + "key": "[a]", + "total_bytes": 32 + } + }, + { + "datastoreusage": { + "key": "[a,thisissomelongkeythattriestostore46bytesofdata]", + "total_bytes": 77 + } } ], "author": [ - "Lisa Neigut <> is mainly responsible." + "Peter Neuroth <> is mainly responsible." ], "see_also": [ - "lightning-bkpr-listincome(7)", - "lightning-bkpr-listfunds(7)", - "lightning-bkpr-listaccountevents(7)", - "lightning-bkpr-channelsapy(7)", - "lightning-listpeers(7)" + "lightning-datastore(7)", + "lightning-deldatastore(7)", + "lightning-listdatastore(7)" ], "resources": [ "Main web site: " ] }, - "lightning-bkpr-inspect.json": { + "lightning-decode.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "bkpr-inspect", - "title": "Command to show onchain footprint of a channel", + "added": "v23.05", + "rpc": "decode", + "title": "Command for decoding an invoice string (low-level)", "description": [ - "The **bkpr-inspect** RPC command lists all known on-chain transactions and associated events for the provided account. Useful for inspecting unilateral closes for a given channel account. Only valid for channel accounts." + "The **decode** RPC command checks and parses `bolt11`, `bolt12`, `rune` or `emergency_recover`. It may decode other formats in future." ], "request": { "required": [ - "account" + "string" ], "properties": { - "account": { + "string": { "type": "string", "description": [ - "Channel account to inspect." + "Value to be decoded:", + " * a *bolt11* or *bolt12* string (optionally prefixed by `lightning:` or `LIGHTNING:`) as specified by the BOLT 11 and BOLT 12 specifications.", + " * a *rune* as created by lightning-commando-rune(7).", + " * an *emergency_recover* string generated by hsmtool like `lightning-hsmtool getemergencyrecover `. It holds `emergency.recover` contents and starts with `clnemerg1`." ] } } }, "response": { "required": [ - "txs" + "type", + "valid" ], "properties": { - "txs": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, + "type": { + "type": "string", + "enum": [ + "bolt12 offer", + "bolt12 invoice", + "bolt12 invoice_request", + "bolt11 invoice", + "rune", + "emergency recover" + ], + "description": [ + "What kind of object it decoded to." + ] + }, + "valid": { + "type": "boolean", + "description": [ + "If this is false, you *MUST* not use the result except for diagnostics!" + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt12 offer" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { "required": [ - "txid", - "fees_paid_msat", - "outputs" + "offer_id", + "offer_node_id", + "offer_description" ], + "additionalProperties": false, "properties": { - "txid": { - "type": "txid", + "type": {}, + "valid": {}, + "offer_id": { + "type": "hex", "description": [ - "Transaction id." + "The id we use to identify this offer." + ], + "maxLength": 64, + "minLength": 64 + }, + "offer_chains": { + "type": "array", + "description": [ + "Which blockchains this offer is for (missing implies bitcoin mainnet only)." + ], + "items": { + "type": "hash", + "description": [ + "The genesis blockhash." + ] + } + }, + "offer_metadata": { + "type": "hex", + "description": [ + "Any metadata the creator of the offer includes." ] }, - "blockheight": { + "offer_currency": { + "type": "string", + "description": [ + "ISO 4217 code of the currency (missing implies Bitcoin)." + ], + "maxLength": 3, + "minLength": 3 + }, + "warning_unknown_offer_currency": { + "type": "string", + "description": [ + "The currency code is unknown (so no `currency_minor_unit`)." + ] + }, + "currency_minor_unit": { "type": "u32", "description": [ - "Blockheight of transaction." + "The number of decimal places to apply to amount (if currency known)." ] }, - "fees_paid_msat": { + "offer_amount": { + "type": "u64", + "description": [ + "The amount in the `offer_currency` adjusted by `currency_minor_unit`, if any." + ] + }, + "offer_amount_msat": { "type": "msat", "description": [ - "Amount paid in sats for this tx." + "The amount in bitcoin (if specified, and no `offer_currency`)." ] }, - "outputs": { + "offer_description": { + "type": "string", + "description": [ + "The description of the purpose of the offer." + ] + }, + "offer_issuer": { + "type": "string", + "description": [ + "The description of the creator of the offer." + ] + }, + "offer_features": { + "type": "hex", + "description": [ + "The feature bits of the offer." + ] + }, + "offer_absolute_expiry": { + "type": "u64", + "description": [ + "UNIX timestamp of when this offer expires." + ] + }, + "offer_quantity_max": { + "type": "u64", + "description": [ + "The maximum quantity (or, if 0, means any quantity)." + ] + }, + "offer_paths": { "type": "array", + "description": [ + "Paths to the destination." + ], "items": { "type": "object", "required": [ - "account", - "outnum", - "output_value_msat", - "currency" + "first_node_id", + "blinding", + "path" ], "additionalProperties": false, "properties": { - "account": { - "type": "string", - "description": [ - "Account this output affected." - ] - }, - "outnum": { - "type": "u32", - "description": [ - "Index of output." - ] - }, - "output_value_msat": { - "type": "msat", - "description": [ - "Value of the output." - ] - }, - "currency": { - "type": "string", - "description": [ - "Human-readable bech32 part for this coin type." - ] - }, - "credit_msat": { - "type": "msat", - "description": [ - "Amount credited to account." - ] - }, - "debit_msat": { - "type": "msat", - "description": [ - "Amount debited from account." - ] - }, - "originating_account": { - "type": "string", - "description": [ - "Account this output originated from." - ] - }, - "output_tag": { - "type": "string", + "first_node_id": { + "type": "pubkey", "description": [ - "Description of output creation event." + "The (presumably well-known) public key of the start of the path." ] }, - "spend_tag": { - "type": "string", + "blinding": { + "type": "pubkey", "description": [ - "Description of output spend event." + "Blinding factor for this path." ] }, - "spending_txid": { - "type": "txid", + "path": { + "type": "array", "description": [ - "Transaction this output was spent in." - ] - }, - "payment_id": { - "type": "hex", - "description": [ - "Lightning payment identifier. For an htlc, this will be the preimage." - ] - } - }, - "allOf": [ - { - "if": { - "required": [ - "credit_msat" - ] - }, - "then": { + "An individual path." + ], + "items": { + "type": "object", "required": [ - "output_tag" + "blinded_node_id", + "encrypted_recipient_data" ], "additionalProperties": false, "properties": { - "account": {}, - "outnum": {}, - "output_value_msat": {}, - "currency": {}, - "credit_msat": {}, - "originating_account": {}, - "debit_msat": {}, - "output_tag": {}, - "spend_tag": {}, - "spending_txid": {}, - "payment_id": {} + "blinded_node_id": { + "type": "pubkey", + "description": [ + "Node_id of the hop." + ] + }, + "encrypted_recipient_data": { + "type": "hex", + "description": [ + "Encrypted TLV entry for this hop." + ] + } } } - }, - { - "if": { - "required": [ - "spending_txid" + } + } + } + }, + "offer_node_id": { + "type": "pubkey", + "description": [ + "Public key of the offering node." + ] + }, + "offer_recurrence": { + "type": "object", + "description": [ + "How often to this offer should be used." + ], + "required": [ + "period", + "time_unit" + ], + "additionalProperties": false, + "properties": { + "time_unit": { + "type": "u32", + "description": [ + "The BOLT12 time unit." + ] + }, + "time_unit_name": { + "type": "string", + "description": [ + "The name of `time_unit` (if valid)." + ] + }, + "period": { + "type": "u32", + "description": [ + "How many `time_unit` per payment period." + ] + }, + "basetime": { + "type": "u64", + "description": [ + "Period starts at this UNIX timestamp." + ] + }, + "start_any_period": { + "type": "u64", + "description": [ + "You can start at any period (only if `basetime` present)." + ] + }, + "limit": { + "type": "u32", + "description": [ + "Maximum period number for recurrence." + ] + }, + "paywindow": { + "type": "object", + "description": [ + "When within a period will payment be accepted." + ], + "default": "prior and during the period", + "required": [ + "seconds_before", + "seconds_after" + ], + "additionalProperties": false, + "properties": { + "seconds_before": { + "type": "u32", + "description": [ + "Seconds prior to period start." ] }, - "then": { - "required": [ - "spend_tag", - "debit_msat" + "seconds_after": { + "type": "u32", + "description": [ + "Seconds after to period start." + ] + }, + "proportional_amount": { + "type": "boolean", + "enum": [ + true ], - "additionalProperties": false, - "properties": { - "account": {}, - "outnum": {}, - "output_value_msat": {}, - "currency": {}, - "credit_msat": {}, - "originating_account": {}, - "debit_msat": {}, - "output_tag": {}, - "spend_tag": {}, - "spending_txid": {}, - "payment_id": {} - } + "description": [ + "Amount should be scaled if paid after period start." + ] } } - ] + } + } + }, + "unknown_offer_tlvs": { + "type": "array", + "description": [ + "Any extra fields we didn't know how to parse." + ], + "items": { + "type": "object", + "required": [ + "type", + "length", + "value" + ], + "additionalProperties": false, + "properties": { + "type": { + "type": "u64", + "description": [ + "The type." + ] + }, + "length": { + "type": "u64", + "description": [ + "The length." + ] + }, + "value": { + "type": "hex", + "description": [ + "The value." + ] + } + } } } } } - } - } - }, - "example_json_request": [ - { - "id": "example:bkpr-inspect#1", - "method": "bkpr-inspect", - "params": [ - "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab" - ] - } - ], - "example_json_response": [ - { - "txs": [ - { - "txid": "abb283035e569c190696d42a1208bb38ddc64b6377e88f2d6277c01eab7b0af3", - "fees_paid_msat": 0, - "outputs": [ - { - "account": "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab", - "outnum": 0, - "output_tag": "channel_proposed", - "output_value_msat": 996363000, - "credit_msat": 996363000, - "currency": "bcrt" + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt12 offer" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + false + ] } - ] - } - ] - } - ], - "author": [ - "Lisa Neigut <> is mainly responsible." - ], - "see_also": [ - "lightning-listbalances(7)", - "lightning-listfunds(7)", - "lightning-listpeers(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-bkpr-listaccountevents.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "bkpr-listaccountevents", - "title": "Command for listing recorded bookkeeping events", - "description": [ - "The **bkpr-listaccountevents** RPC command is a list of all bookkeeping events that have been recorded for this node.", - "", - "If the optional parameter **account** is set, we only emit events for the specified account, if exists.", - "", - "Note that the type **onchain_fees** that are emitted are of opposite credit/debit than as they appear in **listincome**, as **listincome** shows all events from the perspective of the node, whereas **listaccountevents** just dumps the event data as we've got it. Onchain fees are updated/recorded as we get more information about input and output spends -- the total onchain fees that were recorded for a transaction for an account can be found by summing all onchain fee events and taking the difference between the **credit_msat** and **debit_msat** for these events. We do this so that successive calls to **listaccountevents** always produce the same list of events -- no previously emitted event will be subsequently updated, rather we add a new event to the list." - ], - "request": { - "required": [], - "properties": { - "account": { - "type": "string", - "description": [ - "Receive events for the specified account." - ] - } - } - }, - "response": { - "required": [ - "events" - ], - "properties": { - "events": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "account", - "type", - "tag", - "credit_msat", - "debit_msat", - "currency", - "timestamp" - ], + } + }, + "then": { + "required": [], + "additionalProperties": false, "properties": { - "account": { + "type": {}, + "valid": {}, + "offer_id": {}, + "node_id": {}, + "signature": {}, + "chains": {}, + "currency": {}, + "minor_unit": {}, + "warning_unknown_offer_currency": {}, + "amount": {}, + "amount_msat": {}, + "send_invoice": {}, + "description": {}, + "vendor": {}, + "features": {}, + "absolute_expiry": {}, + "paths": {}, + "quantity_max": {}, + "unknown_offer_tlvs": {}, + "recurrence": {}, + "warning_missing_offer_node_id": { "type": "string", "description": [ - "The account name. If the account is a channel, the channel_id." + "`offer_node_id` is not present." ] }, + "warning_invalid_offer_description": { + "type": "string", + "description": [ + "`offer_description` is not valid UTF8." + ] + }, + "warning_missing_offer_description": { + "type": "string", + "description": [ + "`offer_description` is not present." + ] + }, + "warning_invalid_offer_currency": { + "type": "string", + "description": [ + "`offer_currency_code` is not valid UTF8." + ] + }, + "warning_invalid_offer_issuer": { + "type": "string", + "description": [ + "`offer_issuer` is not valid UTF8." + ] + } + } + } + }, + { + "if": { + "properties": { "type": { "type": "string", "enum": [ - "onchain_fee", - "chain", - "channel" + "bolt12 invoice_request" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "required": [ + "offer_node_id", + "offer_description", + "invreq_metadata", + "invreq_payer_id", + "signature" + ], + "additionalProperties": false, + "properties": { + "type": {}, + "valid": {}, + "offer_id": { + "type": "hex", + "description": [ + "The id we use to identify this offer." + ], + "maxLength": 64, + "minLength": 64 + }, + "offer_chains": { + "type": "array", + "description": [ + "Which blockchains this offer is for (missing implies bitcoin mainnet only)." ], + "items": { + "type": "hex", + "description": [ + "The genesis blockhash." + ], + "maxLength": 64, + "minLength": 64 + } + }, + "offer_metadata": { + "type": "hex", "description": [ - "Coin movement type." + "Any metadata the creator of the offer includes." ] }, - "tag": { + "offer_currency": { "type": "string", "description": [ - "Description of movement." + "ISO 4217 code of the currency (missing implies Bitcoin)." + ], + "maxLength": 3, + "minLength": 3 + }, + "warning_unknown_offer_currency": { + "type": "string", + "description": [ + "The currency code is unknown (so no `currency_minor_unit`)." ] }, - "credit_msat": { - "type": "msat", + "currency_minor_unit": { + "type": "u32", "description": [ - "Amount credited." + "The number of decimal places to apply to amount (if currency known)." ] }, - "debit_msat": { + "offer_amount": { + "type": "u64", + "description": [ + "The amount in the `offer_currency` adjusted by `currency_minor_unit`, if any." + ] + }, + "offer_amount_msat": { "type": "msat", "description": [ - "Amount debited." + "The amount in bitcoin (if specified, and no `offer_currency`)." ] }, - "currency": { + "offer_description": { "type": "string", "description": [ - "Human-readable bech32 part for this coin type." + "The description of the purpose of the offer." ] }, - "timestamp": { - "type": "u32", + "offer_issuer": { + "type": "string", "description": [ - "Timestamp this event was recorded by the node. For consolidated events such as onchain_fees, the most recent timestamp." + "The description of the creator of the offer." ] - } - }, - "allOf": [ - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "chain" - ] - } - } - }, - "then": { + }, + "offer_features": { + "type": "hex", + "description": [ + "The feature bits of the offer." + ] + }, + "offer_absolute_expiry": { + "type": "u64", + "description": [ + "UNIX timestamp of when this offer expires." + ] + }, + "offer_quantity_max": { + "type": "u64", + "description": [ + "The maximum quantity (or, if 0, means any quantity)." + ] + }, + "offer_paths": { + "type": "array", + "description": [ + "Paths to the destination." + ], + "items": { + "type": "object", + "required": [ + "first_node_id", + "blinding", + "path" + ], + "additionalProperties": false, "properties": { - "account": {}, - "type": {}, - "tag": {}, - "credit_msat": {}, - "debit_msat": {}, - "currency": {}, - "timestamp": {}, - "outpoint": { - "type": "string", + "first_node_id": { + "type": "pubkey", "description": [ - "The txid:outnum for this event." + "The (presumably well-known) public key of the start of the path." ] }, - "blockheight": { - "type": "u32", + "blinding": { + "type": "pubkey", "description": [ - "For chain events, blockheight this occured at." + "Blinding factor for this path." ] }, - "origin": { - "type": "string", + "path": { + "type": "array", "description": [ - "The account this movement originated from." - ] - }, - "payment_id": { - "type": "hex", - "description": [ - "Lightning payment identifier. For an htlc, this will be the preimage." - ] - }, - "txid": { - "type": "txid", - "description": [ - "The txid of the transaction that created this event." - ] - }, - "description": { - "type": "string", - "description": [ - "The description of this event." - ] + "An individual path." + ], + "items": { + "type": "object", + "required": [ + "blinded_node_id", + "encrypted_recipient_data" + ], + "additionalProperties": false, + "properties": { + "blinded_node_id": { + "type": "pubkey", + "description": [ + "Node_id of the hop." + ] + }, + "encrypted_recipient_data": { + "type": "hex", + "description": [ + "Encrypted TLV entry for this hop." + ] + } + } + } } - }, - "required": [ - "outpoint", - "blockheight" - ], - "additionalProperties": false + } } }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "onchain_fee" - ] + "offer_node_id": { + "type": "pubkey", + "description": [ + "Public key of the offering node." + ] + }, + "offer_recurrence": { + "type": "object", + "description": [ + "How often to this offer should be used." + ], + "required": [ + "period", + "time_unit" + ], + "additionalProperties": false, + "properties": { + "time_unit": { + "type": "u32", + "description": [ + "The BOLT12 time unit." + ] + }, + "time_unit_name": { + "type": "string", + "description": [ + "The name of `time_unit` (if valid)." + ] + }, + "period": { + "type": "u32", + "description": [ + "How many `time_unit` per payment period." + ] + }, + "basetime": { + "type": "u64", + "description": [ + "Period starts at this UNIX timestamp." + ] + }, + "start_any_period": { + "type": "u64", + "description": [ + "You can start at any period (only if `basetime` present)." + ] + }, + "limit": { + "type": "u32", + "description": [ + "Maximum period number for recurrence." + ] + }, + "paywindow": { + "type": "object", + "description": [ + "When within a period will payment be accepted." + ], + "default": "prior and during the period", + "required": [ + "seconds_before", + "seconds_after" + ], + "additionalProperties": false, + "properties": { + "seconds_before": { + "type": "u32", + "description": [ + "Seconds prior to period start." + ] + }, + "seconds_after": { + "type": "u32", + "description": [ + "Seconds after to period start." + ] + }, + "proportional_amount": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Amount should be scaled if paid after period start." + ] + } } } - }, - "then": { - "properties": { - "account": {}, - "type": {}, - "tag": {}, - "credit_msat": {}, - "debit_msat": {}, - "currency": {}, - "timestamp": {}, - "description": {}, - "txid": { - "type": "txid", - "description": [ - "The txid of the transaction that created this event." - ] - } - }, - "required": [ - "txid" - ], - "additionalProperties": false } }, - { - "if": { + "invreq_metadata": { + "type": "hex", + "description": [ + "The payer-provided blob to derive invreq_payer_id." + ] + }, + "invreq_payer_id": { + "type": "hex", + "description": [ + "The payer-provided key." + ] + }, + "invreq_chain": { + "type": "hex", + "description": [ + "Which blockchain this offer is for (missing implies bitcoin mainnet only)." + ], + "maxLength": 64, + "minLength": 64 + }, + "invreq_amount_msat": { + "type": "msat", + "description": [ + "The amount the invoice should be for." + ] + }, + "invreq_features": { + "type": "hex", + "description": [ + "The feature bits of the invoice_request." + ] + }, + "invreq_quantity": { + "type": "u64", + "description": [ + "The number of items to invoice for." + ] + }, + "invreq_payer_note": { + "type": "string", + "description": [ + "A note attached by the payer." + ] + }, + "invreq_recurrence_counter": { + "type": "u32", + "description": [ + "Which number request this is for the same invoice." + ] + }, + "invreq_recurrence_start": { + "type": "u32", + "description": [ + "When we're requesting to start an invoice at a non-zero period." + ] + }, + "signature": { + "type": "bip340sig", + "description": [ + "BIP-340 signature of the `invreq_payer_id` on this invoice_request." + ] + }, + "unknown_invoice_request_tlvs": { + "type": "array", + "description": [ + "Any extra fields we didn't know how to parse." + ], + "items": { + "type": "object", + "required": [ + "type", + "length", + "value" + ], + "additionalProperties": false, "properties": { "type": { - "type": "string", - "enum": [ - "channel" - ] - } - } - }, - "then": { - "properties": { - "account": {}, - "type": {}, - "tag": {}, - "credit_msat": {}, - "debit_msat": {}, - "currency": {}, - "timestamp": {}, - "description": {}, - "fees_msat": { - "type": "msat", + "type": "u64", "description": [ - "Amount paid in fees." + "The type." ] }, - "is_rebalance": { - "type": "boolean", + "length": { + "type": "u64", "description": [ - "Is this payment part of a rebalance." + "The length." ] }, - "payment_id": { + "value": { "type": "hex", "description": [ - "Lightning payment identifier. For an htlc, this will be the preimage." - ] - }, - "part_id": { - "type": "u32", - "description": [ - "Counter for multi-part payments." + "The value." ] } - }, - "additionalProperties": false + } } } - ] + } } - } - } - }, - "example_json_request": [ - { - "id": "example:bkpr-listaccountevents#1", - "method": "bkpr-listaccountevents", - "params": "{}" - }, - { - "id": "example:bkpr-listaccountevents#2", - "method": "bkpr-listaccountevents", - "params": [ - "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab" - ] - } - ], - "example_json_response": [ - { - "events": [ - { - "account": "wallet", - "type": "channel", - "tag": "journal_entry", - "credit_msat": 0, - "debit_msat": 0, - "currency": "bcrt", - "timestamp": 1706152911, - "is_rebalance": false - }, - { - "account": "wallet", - "type": "chain", - "tag": "deposit", - "credit_msat": 2000000000, - "debit_msat": 0, - "currency": "bcrt", - "outpoint": "7e202b3b1016e8eb6f4e936215ed6b5bdc63c17e6ebb5e6bce2f98e6757ba44c:0", - "timestamp": 1706152914, - "blockheight": 102 - }, - { - "account": "wallet", - "type": "chain", - "tag": "withdrawal", - "credit_msat": 0, - "debit_msat": 2000000000, - "currency": "bcrt", - "outpoint": "7e202b3b1016e8eb6f4e936215ed6b5bdc63c17e6ebb5e6bce2f98e6757ba44c:0", - "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b", - "timestamp": 1706152921, - "blockheight": 103 - }, - { - "account": "wallet", - "type": "chain", - "tag": "deposit", - "credit_msat": 995073000, - "debit_msat": 0, - "currency": "bcrt", - "outpoint": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b:1", - "timestamp": 1706152921, - "blockheight": 103 - }, - { - "account": "wallet", - "type": "onchain_fee", - "tag": "onchain_fee", - "credit_msat": 1004927000, - "debit_msat": 0, - "currency": "bcrt", - "timestamp": 1706152921, - "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b" - }, - { - "account": "wallet", - "type": "onchain_fee", - "tag": "onchain_fee", - "credit_msat": 0, - "debit_msat": 1004927000, - "currency": "bcrt", - "timestamp": 1706152921, - "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b" - }, - { - "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", - "type": "chain", - "tag": "channel_open", - "credit_msat": 1000000000, - "debit_msat": 0, - "currency": "bcrt", - "outpoint": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b:0", - "timestamp": 1706152922, - "blockheight": 103 + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt12 invoice_request" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + false + ] + } + } }, - { - "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", - "type": "onchain_fee", - "tag": "onchain_fee", - "credit_msat": 4927000, - "debit_msat": 0, - "currency": "bcrt", - "timestamp": 1706152922, - "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b" + "then": { + "required": [], + "additionalProperties": false, + "properties": { + "type": {}, + "valid": {}, + "offer_id": {}, + "offer_chains": {}, + "offer_metadata": {}, + "offer_currency": {}, + "warning_unknown_offer_currency": {}, + "currency_minor_unit": {}, + "offer_amount": {}, + "offer_amount_msat": {}, + "offer_description": {}, + "offer_issuer": {}, + "offer_features": {}, + "offer_absolute_expiry": {}, + "offer_quantity_max": {}, + "offer_paths": {}, + "offer_node_id": {}, + "offer_recurrence": {}, + "invreq_metadata": {}, + "invreq_payer_id": {}, + "invreq_chain": {}, + "invreq_amount_msat": {}, + "invreq_features": {}, + "invreq_quantity": {}, + "invreq_payer_note": {}, + "invreq_recurrence_counter": {}, + "invreq_recurrence_start": {}, + "warning_invalid_offer_description": { + "type": "string", + "description": [ + "`offer_description` is not valid UTF8." + ] + }, + "warning_missing_offer_description": { + "type": "string", + "description": [ + "`offer_description` is not present." + ] + }, + "warning_invalid_offer_currency": { + "type": "string", + "description": [ + "`offer_currency_code` is not valid UTF8." + ] + }, + "warning_invalid_offer_issuer": { + "type": "string", + "description": [ + "`offer_issuer` is not valid UTF8." + ] + }, + "warning_missing_invreq_metadata": { + "type": "string", + "description": [ + "`invreq_metadata` is not present." + ] + }, + "warning_missing_invreq_payer_id": { + "type": "string", + "description": [ + "`invreq_payer_id` is not present." + ] + }, + "warning_invalid_invreq_payer_note": { + "type": "string", + "description": [ + "`invreq_payer_note` is not valid UTF8." + ] + }, + "warning_missing_invoice_request_signature": { + "type": "string", + "description": [ + "`signature` is not present." + ] + }, + "warning_invalid_invoice_request_signature": { + "type": "string", + "description": [ + "Incorrect `signature`." + ] + } + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt12 invoice" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + true + ] + } + } }, - { - "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", - "type": "channel", - "tag": "invoice", - "credit_msat": 0, - "debit_msat": 11000000, - "currency": "bcrt", - "payment_id": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", - "part_id": 0, - "timestamp": 1706152934, - "description": [ - "XEoCR94SIz6UIRUEkxum." - ], - "is_rebalance": false - }, - { - "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", - "type": "chain", - "tag": "channel_close", - "credit_msat": 0, - "debit_msat": 989000000, - "currency": "bcrt", - "outpoint": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b:0", - "txid": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998", - "timestamp": 1706152938, - "blockheight": 104 - }, - { - "account": "external", - "origin": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", - "type": "chain", - "tag": "to_them", - "credit_msat": 10899000, - "debit_msat": 0, - "currency": "bcrt", - "outpoint": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998:0", - "timestamp": 1706152938, - "blockheight": 104 - }, - { - "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", - "type": "onchain_fee", - "tag": "onchain_fee", - "credit_msat": 7967000, - "debit_msat": 0, - "currency": "bcrt", - "timestamp": 1706152938, - "txid": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998" - }, - { - "account": "wallet", - "type": "chain", - "tag": "deposit", - "credit_msat": 980912000, - "debit_msat": 0, - "currency": "bcrt", - "outpoint": "85477738281c1afd652c350025f1d28658fe541c83adc9a7d5276c30cf715a11:0", - "timestamp": 1706152941, - "blockheight": 109 - }, - { - "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", - "type": "chain", - "tag": "delayed_to_us", - "credit_msat": 981033000, - "debit_msat": 0, - "currency": "bcrt", - "outpoint": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998:1", - "timestamp": 1706152941, - "blockheight": 104 - }, - { - "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", - "type": "chain", - "tag": "to_wallet", - "credit_msat": 0, - "debit_msat": 981033000, - "currency": "bcrt", - "outpoint": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998:1", - "txid": "85477738281c1afd652c350025f1d28658fe541c83adc9a7d5276c30cf715a11", - "timestamp": 1706152941, - "blockheight": 109 - }, - { - "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", - "type": "onchain_fee", - "tag": "onchain_fee", - "credit_msat": 121000, - "debit_msat": 0, - "currency": "bcrt", - "timestamp": 1706152941, - "txid": "85477738281c1afd652c350025f1d28658fe541c83adc9a7d5276c30cf715a11" - } - ] - }, - { - "events": [ - { - "account": "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab", - "type": "chain", - "tag": "channel_proposed", - "credit_msat": 996363000, - "debit_msat": 0, - "currency": "bcrt", - "outpoint": "abb283035e569c190696d42a1208bb38ddc64b6377e88f2d6277c01eab7b0af3:0", - "timestamp": 1706246949, - "blockheight": 0 - }, - { - "account": "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab", - "type": "channel", - "tag": "pushed", - "credit_msat": 0, - "debit_msat": 20000000, - "currency": "bcrt", - "timestamp": 1706246949, - "is_rebalance": false - } - ] - } - ], - "author": [ - "Lisa Neigut <> is mainly responsible." - ], - "see_also": [ - "lightning-bkpr-listincome(7)", - "lightning-listfunds(7)", - "lightning-bkpr-listbalances(7)", - "lightning-bkpr-channelsapy(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-bkpr-listbalances.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "bkpr-listbalances", - "title": "Command for listing current channel + wallet balances", - "description": [ - "The **bkpr-listbalances** RPC command is a list of all current and historical account balances. An account is either the on-chain *wallet* or a channel balance. Any funds sent to an *external* account will not be accounted for here.", - "", - "Note that any channel that was recorded will be listed. Closed channel balances will be 0msat." - ], - "request": { - "required": [], - "properties": {} - }, - "response": { - "required": [ - "accounts" - ], - "properties": { - "accounts": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, + "then": { "required": [ - "account", - "balances" + "offer_node_id", + "offer_description", + "invreq_metadata", + "invreq_payer_id", + "invoice_paths", + "invoice_created_at", + "invoice_payment_hash", + "invoice_amount_msat", + "signature" ], + "additionalProperties": false, "properties": { - "account": { - "type": "string", + "type": {}, + "valid": {}, + "offer_id": { + "type": "hex", "description": [ - "The account name. If the account is a channel, the channel_id." - ] + "The id we use to identify this offer." + ], + "maxLength": 64, + "minLength": 64 }, - "balances": { + "offer_chains": { "type": "array", + "description": [ + "Which blockchains this offer is for (missing implies bitcoin mainnet only)." + ], "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "balance_msat", - "coin_type" - ], - "properties": { - "balance_msat": { - "type": "msat", - "description": [ - "Current account balance." - ] - }, - "coin_type": { - "type": "string", - "description": [ - "Coin type, same as HRP for bech32." - ] - } - } - } - } - }, - "if": { - "required": [ - "peer_id" - ] - }, - "then": { - "required": [ - "account", - "balances", - "peer_id", - "we_opened", - "account_closed", - "account_resolved" - ], - "additionalProperties": false, - "properties": { - "account": {}, - "balances": {}, - "peer_id": { - "type": "pubkey", - "description": [ - "Node id for the peer this account is with." - ] - }, - "we_opened": { - "type": "boolean", - "description": [ - "Did we initiate this account open (open the channel)." - ] - }, - "account_closed": { - "type": "boolean", - "description": [ - "", - "" - ] - }, - "account_resolved": { - "type": "boolean", - "description": [ - "Has this channel been closed and all outputs resolved?" - ] - }, - "resolved_at_block": { - "type": "u32", + "type": "hex", "description": [ - "Blockheight account resolved on chain." - ] + "The genesis blockhash." + ], + "maxLength": 64, + "minLength": 64 } - } - }, - "else": { - "properties": { - "account": {}, - "balances": {} }, - "additionalProperties": false - } - } - } - } - }, - "example_json_request": [ - { - "id": "example:bkpr-listbalances#1", - "method": "bkpr-listbalances", - "params": "{}" - } - ], - "example_json_response": [ - { - "accounts": [ - { - "account": "wallet", - "balances": [ - { - "balance_msat": 2222222000, - "coin_type": "bcrt" - } - ] - } - ] - } - ], - "author": [ - "Lisa Neigut <> is mainly responsible." - ], - "see_also": [ - "lightning-bkpr-listincome(7)", - "lightning-listfunds(7)", - "lightning-bkpr-listaccountevents(7)", - "lightning-bkpr-channelsapy(7)", - "lightning-listpeers(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-bkpr-listincome.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "added": "pre-v0.10.1", - "rpc": "bkpr-listincome", - "title": "Command for listing all income impacting events", - "description": [ - "The **bkpr-listincome** RPC command is a list of all income impacting events that the bookkeeper plugin has recorded for this node." - ], - "request": { - "required": [], - "properties": { - "consolidate_fees": { - "type": "boolean", - "description": [ - "If true, we emit a single, consolidated event for any onchain-fees for a txid and account. Otherwise, events for every update to the onchain fee calculation for this account and txid will be printed. Note that this means that the events emitted are non-stable, i.e. calling **listincome** twice may result in different onchain fee events being emitted, depending on how much information we've logged for that transaction." - ], - "default": "True" - }, - "start_time": { - "type": "u32", - "description": [ - "UNIX timestamp (in seconds) that filters events after the provided timestamp." - ], - "default": "zero" - }, - "end_time": { - "type": "u32", - "description": [ - "UNIX timestamp (in seconds) that filters events up to and at the provided timestamp." - ], - "default": "max-int" - } - } - }, - "response": { - "required": [ - "income_events" - ], - "properties": { - "income_events": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "account", - "tag", - "credit_msat", - "debit_msat", - "currency", - "timestamp" - ], - "properties": { - "account": { - "type": "string", + "offer_metadata": { + "type": "hex", "description": [ - "The account name. If the account is a channel, the channel_id." + "Any metadata the creator of the offer includes." ] }, - "tag": { + "offer_currency": { "type": "string", "description": [ - "Type of income event." + "ISO 4217 code of the currency (missing implies Bitcoin)." + ], + "maxLength": 3, + "minLength": 3 + }, + "warning_unknown_offer_currency": { + "type": "string", + "description": [ + "The currency code is unknown (so no `currency_minor_unit`)." ] }, - "credit_msat": { - "type": "msat", + "currency_minor_unit": { + "type": "u32", "description": [ - "Amount earned (income)." + "The number of decimal places to apply to amount (if currency known)." ] }, - "debit_msat": { + "offer_amount": { + "type": "u64", + "description": [ + "The amount in the `offer_currency` adjusted by `currency_minor_unit`, if any." + ] + }, + "offer_amount_msat": { "type": "msat", "description": [ - "Amount spent (expenses)." + "The amount in bitcoin (if specified, and no `offer_currency`)." ] }, - "currency": { + "offer_description": { "type": "string", "description": [ - "Human-readable bech32 part for this coin type." + "The description of the purpose of the offer." ] }, - "timestamp": { - "type": "u32", + "offer_issuer": { + "type": "string", "description": [ - "Timestamp this event was recorded by the node. For consolidated events such as onchain_fees, the most recent timestamp." + "The description of the creator of the offer." ] }, - "description": { - "type": "string", + "offer_features": { + "type": "hex", "description": [ - "More information about this event. If a `invoice` type, typically the bolt11/bolt12 description." + "The feature bits of the offer." ] }, - "outpoint": { - "type": "string", + "offer_absolute_expiry": { + "type": "u64", "description": [ - "The txid:outnum for this event, if applicable." + "UNIX timestamp of when this offer expires." ] }, - "txid": { - "type": "txid", + "offer_quantity_max": { + "type": "u64", "description": [ - "The txid of the transaction that created this event, if applicable." + "The maximum quantity (or, if 0, means any quantity)." ] }, - "payment_id": { - "type": "hex", + "offer_paths": { + "type": "array", "description": [ - "Lightning payment identifier. For an htlc, this will be the preimage." + "Paths to the destination." + ], + "items": { + "type": "object", + "required": [ + "first_node_id", + "blinding", + "path" + ], + "additionalProperties": false, + "properties": { + "first_node_id": { + "type": "pubkey", + "description": [ + "The (presumably well-known) public key of the start of the path." + ] + }, + "blinding": { + "type": "pubkey", + "description": [ + "Blinding factor for this path." + ] + }, + "path": { + "type": "array", + "description": [ + "An individual path." + ], + "items": { + "type": "object", + "required": [ + "blinded_node_id", + "encrypted_recipient_data" + ], + "additionalProperties": false, + "properties": { + "blinded_node_id": { + "type": "pubkey", + "description": [ + "Node_id of the hop." + ] + }, + "encrypted_recipient_data": { + "type": "hex", + "description": [ + "Encrypted TLV entry for this hop." + ] + } + } + } + } + } + } + }, + "offer_node_id": { + "type": "pubkey", + "description": [ + "Public key of the offering node." ] - } - } - } - } - } - }, - "example_json_request": [ - { - "id": "example:bkpr-listincome#1", - "method": "bkpr-listincome", - "params": "{}" - }, - { - "id": "example:bkpr-listincome#2", - "method": "bkpr-listincome", - "params": { - "consolidate_fees": false - } - } - ], - "example_json_response": [ - { - "income_events": [ - { - "account": "wallet", - "tag": "deposit", - "credit_msat": 1111111000, - "debit_msat": 0, - "currency": "bcrt", - "timestamp": 1706153060, - "outpoint": "6d813d2e99ae7181b61e59ff224c43de698bd08b8ca5b8034ccc13aa7b6428ef:0" - }, - { - "account": "wallet", - "tag": "deposit", - "credit_msat": 1111111000, - "debit_msat": 0, - "currency": "bcrt", - "timestamp": 1706153060, - "outpoint": "0bbbe965f76525af3876ae6f1520d91047d4be04cb4e46b7229120a60c5dc9c5:0" - } - ] - }, - { - "income_events": [ - { - "account": "wallet", - "tag": "deposit", - "credit_msat": 1111111000, - "debit_msat": 0, - "currency": "bcrt", - "timestamp": 1708624181, - "outpoint": "895b5eaad4544d24c99628883b4d84b2c6024d6a2da4c1de54098d985f280943:1" - }, - { - "account": "wallet", - "tag": "withdrawal", - "credit_msat": 0, - "debit_msat": 555555000, - "currency": "bcrt", - "timestamp": 1708624182, - "outpoint": "d28a2cba55da10700ddd7f1f23618160dafb3134650055654551d9b0382dcd71:0" - }, - { - "account": "wallet", - "tag": "onchain_fee", - "credit_msat": 0, - "debit_msat": 555556000, - "currency": "bcrt", - "timestamp": 1708624183, - "txid": "d28a2cba55da10700ddd7f1f23618160dafb3134650055654551d9b0382dcd71" - }, - { - "account": "wallet", - "tag": "onchain_fee", - "credit_msat": 554947000, - "debit_msat": 0, - "currency": "bcrt", - "timestamp": 1708624183, - "txid": "d28a2cba55da10700ddd7f1f23618160dafb3134650055654551d9b0382dcd71" - } - ] - } - ], - "author": [ - "Lisa Neigut <> is mainly responsible." - ], - "see_also": [ - "lightning-bkpr-listaccountevents(7)", - "lightning-listfunds(7)", - "lightning-bkpr-listbalances(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-blacklistrune.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "added": "v23.08", - "rpc": "blacklistrune", - "title": "Command to prevent a rune from working", - "description": [ - "The **blacklistrune** RPC command allows you to effectively revoke the rune you have created (and any runes derived from that rune with additional restictions). Attempting to use these runes will be resulted in a `Blacklisted rune` error message.", - "", - "Destroy a rune like in olden times with the **destroyrune** command.", - "", - "All runes created by lightning have a unique sequential id within them and can be blacklisted in ranges for efficiency. The command always returns the blacklisted ranges on success. If no parameters are specified, no changes have been made. If start specified without end, that single rune is blacklisted. If end is also specified, every rune from start till end inclusive is blacklisted." - ], - "request": { - "required": [], - "properties": { - "start": { - "type": "u64", - "description": [ - "First rune unique id to blacklist." - ] - }, - "end": { - "type": "u64", - "description": [ - "Final rune unique id to blacklist (defaults to start)." - ] - } - }, - "dependentUpon": { - "start": [ - "end" - ] - } - }, - "response": { - "required": [ - "blacklist" - ], - "properties": { - "blacklist": { - "type": "array", - "description": [ - "The resulting blacklist ranges after the command." - ], - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "start", - "end" - ], - "properties": { - "start": { + }, + "offer_recurrence": { + "type": "object", + "description": [ + "How often to this offer should be used." + ], + "required": [ + "period", + "time_unit" + ], + "additionalProperties": false, + "properties": { + "time_unit": { + "type": "u32", + "description": [ + "The BOLT12 time unit." + ] + }, + "time_unit_name": { + "type": "string", + "description": [ + "The name of `time_unit` (if valid)." + ] + }, + "period": { + "type": "u32", + "description": [ + "How many `time_unit` per payment period." + ] + }, + "basetime": { + "type": "u64", + "description": [ + "Period starts at this UNIX timestamp." + ] + }, + "start_any_period": { + "type": "u64", + "description": [ + "You can start at any period (only if `basetime` present)." + ] + }, + "limit": { + "type": "u32", + "description": [ + "Maximum period number for recurrence." + ] + }, + "paywindow": { + "type": "object", + "description": [ + "When within a period will payment be accepted." + ], + "default": "prior and during the period", + "required": [ + "seconds_before", + "seconds_after" + ], + "additionalProperties": false, + "properties": { + "seconds_before": { + "type": "u32", + "description": [ + "Seconds prior to period start." + ] + }, + "seconds_after": { + "type": "u32", + "description": [ + "Seconds after to period start." + ] + }, + "proportional_amount": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Amount should be scaled if paid after period start." + ] + } + } + } + } + }, + "invreq_metadata": { + "type": "hex", + "description": [ + "The payer-provided blob to derive invreq_payer_id." + ] + }, + "invreq_payer_id": { + "type": "hex", + "description": [ + "The payer-provided key." + ] + }, + "invreq_chain": { + "type": "hex", + "description": [ + "Which blockchain this offer is for (missing implies bitcoin mainnet only)." + ], + "maxLength": 64, + "minLength": 64 + }, + "invreq_amount_msat": { + "type": "msat", + "description": [ + "The amount the invoice should be for." + ] + }, + "invreq_features": { + "type": "hex", + "description": [ + "The feature bits of the invoice_request." + ] + }, + "invreq_quantity": { "type": "u64", "description": [ - "Unique id of first rune in this blacklist range." + "The number of items to invoice for." ] }, - "end": { + "invreq_payer_note": { + "type": "string", + "description": [ + "A note attached by the payer." + ] + }, + "invreq_recurrence_counter": { + "type": "u32", + "description": [ + "Which number request this is for the same invoice." + ] + }, + "invreq_recurrence_start": { + "type": "u32", + "description": [ + "When we're requesting to start an invoice at a non-zero period." + ] + }, + "invoice_paths": { + "type": "array", + "description": [ + "Paths to pay the destination." + ], + "items": { + "type": "object", + "required": [ + "first_node_id", + "blinding", + "payinfo", + "path" + ], + "additionalProperties": false, + "properties": { + "first_node_id": { + "type": "pubkey", + "description": [ + "The (presumably well-known) public key of the start of the path." + ] + }, + "blinding": { + "type": "pubkey", + "description": [ + "Blinding factor for this path." + ] + }, + "payinfo": { + "type": "object", + "required": [ + "fee_base_msat", + "fee_proportional_millionths", + "cltv_expiry_delta", + "features" + ], + "additionalProperties": false, + "properties": { + "fee_base_msat": { + "type": "msat", + "description": [ + "Basefee for path." + ] + }, + "fee_proportional_millionths": { + "type": "u32", + "description": [ + "Proportional fee for path." + ] + }, + "cltv_expiry_delta": { + "type": "u32", + "description": [ + "CLTV delta for path." + ] + }, + "features": { + "type": "hex", + "description": [ + "Features allowed for path." + ] + } + } + }, + "path": { + "type": "array", + "description": [ + "An individual path." + ], + "items": { + "type": "object", + "required": [ + "blinded_node_id", + "encrypted_recipient_data" + ], + "additionalProperties": false, + "properties": { + "blinded_node_id": { + "type": "pubkey", + "description": [ + "Node_id of the hop." + ] + }, + "encrypted_recipient_data": { + "type": "hex", + "description": [ + "Encrypted TLV entry for this hop." + ] + } + } + } + } + } + } + }, + "invoice_created_at": { "type": "u64", "description": [ - "Unique id of last rune in this blacklist range." + "The UNIX timestamp of invoice creation." + ] + }, + "invoice_relative_expiry": { + "type": "u32", + "description": [ + "The number of seconds after *invoice_created_at* when this expires." + ] + }, + "invoice_payment_hash": { + "type": "hex", + "description": [ + "The hash of the *payment_preimage*." + ], + "maxLength": 64, + "minLength": 64 + }, + "invoice_amount_msat": { + "type": "msat", + "description": [ + "The amount required to fulfill invoice." + ] + }, + "invoice_fallbacks": { + "type": "array", + "description": [ + "Onchain addresses." + ], + "items": { + "type": "object", + "required": [ + "version", + "hex" + ], + "additionalProperties": false, + "properties": { + "version": { + "type": "u8", + "description": [ + "Segwit address version." + ] + }, + "hex": { + "type": "hex", + "description": [ + "Raw encoded segwit address." + ] + }, + "address": { + "type": "string", + "description": [ + "Bech32 segwit address." + ] + } + } + } + }, + "invoice_features": { + "type": "hex", + "description": [ + "The feature bits of the invoice." + ] + }, + "invoice_node_id": { + "type": "pubkey", + "description": [ + "The id to pay (usually the same as offer_node_id)." + ] + }, + "invoice_recurrence_basetime": { + "type": "u64", + "description": [ + "The UNIX timestamp to base the invoice periods on." + ] + }, + "signature": { + "type": "bip340sig", + "description": [ + "BIP-340 signature of the `offer_node_id` on this invoice." ] + }, + "unknown_invoice_tlvs": { + "type": "array", + "description": [ + "Any extra fields we didn't know how to parse." + ], + "items": { + "type": "object", + "required": [ + "type", + "length", + "value" + ], + "additionalProperties": false, + "properties": { + "type": { + "type": "u64", + "description": [ + "The type." + ] + }, + "length": { + "type": "u64", + "description": [ + "The length." + ] + }, + "value": { + "type": "hex", + "description": [ + "The value." + ] + } + } + } } } } - } - } - }, - "example_json_request": [ - { - "id": "example:blacklistrune#1", - "method": "blacklistrune", - "params": { - "start": 2 - } - }, - { - "id": "example:blacklistrune#2", - "method": "blacklistrune", - "params": { - "start": 5, - "end": 7 - } - }, - { - "id": "example:blacklistrune#3", - "method": "blacklistrune", - "params": { - "start": 3, - "end": 4 - } - } - ], - "example_json_response": [ - { - "blacklist": [ - { - "start": 2, - "end": 2 - } - ] - }, - { - "blacklist": [ - { - "start": 2, - "end": 2 - }, - { - "start": 5, - "end": 7 - } - ] - }, - { - "blacklist": [ - { - "start": 2, - "end": 7 - } - ] - } - ], - "author": [ - "Shahana Farooqui <> is mainly responsible." - ], - "see_also": [ - "lightning-commando-blacklist(7)", - "lightning-showrunes(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-check.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "check", - "title": "Command for verifying parameters", - "description": [ - "The **check** RPC command verifies another command without actually making any changes.", - "", - "This is guaranteed to be safe, and will do all checks up to the point where something in the system would need to be altered (such as checking that channels are in the right state, peers connected, etc).", - "", - "It does not guarantee successful execution of the command in all cases. For example, a call to lightning-getroute(7) may still fail to find a route even if checking the parameters succeeds." - ], - "request": { - "required": [ - "command_to_check" - ], - "properties": { - "command_to_check": { - "type": "string", - "description": [ - "Name of the relevant command." - ] - } - } - }, - "response": { - "properties": { - "command_to_check": { - "type": "string", - "description": [ - "The *command_to_check* argument." - ] - } - }, - "required": [ - "command_to_check" - ] - }, - "example_json_request": [ - { - "id": "example:check#1", - "method": "check", - "params": { - "command_to_check": "sendpay", - "route": [ - { - "amount_msat": 1011, - "msatoshi": 1011, - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "delay": 20, - "channel": "1x1x1" - }, - { - "amount_msat": 1000, - "msatoshi": 1000, - "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "delay": 10, - "channel": "2x2x2" - } - ], - "payment_hash": "0000000000000000000000000000000000000000000000000000000000000000" - } - }, - { - "id": "example:check#2", - "method": "check", - "params": { - "command_to_check": "dev", - "subcommand": "slowcmd", - "msec": 1000 - } - }, - { - "id": "example:check#3", - "method": "check", - "params": { - "command_to_check": "recover", - "hsmsecret": "6c696768746e696e672d31000000000000000000000000000000000000000000" - } - } - ], - "example_json_response": [ - { - "command_to_check": "sendpay" - }, - { - "command_to_check": "dev" - }, - { - "command_to_check": "recover" - } - ], - "author": [ - "Mark Beckwith <> and Rusty Russell <> are mainly responsible." - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-checkmessage.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "checkmessage", - "title": "Command to check if a signature is from a node", - "description": [ - "The **checkmessage** RPC command is the counterpart to **signmessage**: given a node id (*pubkey*), signature (*zbase*) and a *message*, it verifies that the signature was generated by that node for that message (more technically: by someone who knows that node's secret).", - "", - "As a special case, if *pubkey* is not specified, we will try every known node key (as per *listnodes*), and verification succeeds if it matches for any one of them. Note: this is implemented far more efficiently than trying each one, so performance is not a concern." - ], - "request": { - "required": [ - "message", - "zbase" - ], - "properties": { - "message": { - "type": "string", - "description": [ - "Message to be checked against the signature." - ] - }, - "zbase": { - "type": "string", - "description": [ - "The Zbase32 encoded signature to verify." - ] - }, - "pubkey": { - "type": "pubkey", - "description": [ - "The Zbase32 encoded signature to verify." - ] - } - } - }, - "response": { - "required": [ - "verified", - "pubkey" - ], - "properties": { - "verified": { - "type": "boolean", - "enum": [ - true - ], - "description": [ - "Whether the signature was valid." - ] - }, - "pubkey": { - "type": "pubkey", - "description": [ - "The *pubkey* parameter, or the pubkey found by looking for known nodes." - ] - } - } - }, - "example_json_request": [ - { - "id": "example:checkmessage#1", - "method": "checkmessage", - "params": { - "message": "testcase to check new rpc error", - "zbase": "d66bqz3qsku5fxtqsi37j11pci47ydxa95iusphutggz9ezaxt56neh77kxe5hyr41kwgkncgiu94p9ecxiexgpgsz8daoq4tw8kj8yx", - "pubkey": "03be3b0e9992153b1d5a6e1623670b6c3663f72ce6cf2e0dd39c0a373a7de5a3b7" - } - }, - { - "id": "example:checkmessage#2", - "method": "checkmessage", - "params": { - "message": "this is a test!", - "zbase": "d6tqaeuonjhi98mmont9m4wag7gg4krg1f4txonug3h31e9h6p6k6nbwjondnj46dkyausobstnk7fhyy998bhgc1yr98dfmhb4k54d7", - "pubkey": null - } - } - ], - "example_json_response": [ - { - "pubkey": "03be3b0e9992153b1d5a6e1623670b6c3663f72ce6cf2e0dd39c0a373a7de5a3b7", - "verified": true - }, - { - "pubkey": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "verified": true - } - ], - "errors": [ - "On failure, an error is returned and core lightning exit with the following error code:", - "", - "- -32602: Parameter missed or malformed;", - "- 1301: *pubkey* not found in the graph." - ], - "author": [ - "Rusty Russell <> is mainly responsible." - ], - "see_also": [ - "lightning-signmessage(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-checkrune.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "added": "v23.08", - "rpc": "checkrune", - "title": "Command to Validate Rune", - "description": [ - "The **checkrune** RPC command checks the validity/authorization rights of specified rune for the given nodeid, method, and params.", - "", - "If successful, the rune \"usage\" counter (used for ratelimiting) is incremented.", - "", - "See lightning-createrune(7) for the fields in the rune which are checked." - ], - "request": { - "required": [ - "rune" - ], - "properties": { - "rune": { - "type": "string", - "description": [ - "Rune to check for authorization." - ] - }, - "nodeid": { - "type": "string", - "description": [ - "Node id of requesting node *(required until v23.11)*." - ] - }, - "method": { - "type": "string", - "description": [ - "Method for which rune needs to be validated *(required until v23.11)*." - ] - }, - "params": { - "oneOf": [ - { - "type": "array", - "description": [ - "Array of positional parameters." - ] - }, - { - "type": "object", - "description": [ - "Parameters for method." - ] - } - ] - } - } - }, - "response": { - "required": [ - "valid" - ], - "properties": { - "valid": { - "type": "boolean", - "description": [ - "True if the rune is valid." - ] - } - } - }, - "errors": [ - "The following error codes may occur:", - "", - "- 1501 (RUNE_NOT_AUTHORIZED): rune is not for this node (or perhaps completely invalid)", - "- 1502 (RUNE_NOT_PERMITTED): rune does not allow this usage (includes a detailed reason why)", - "- 1503 (RUNE_BLACKLISTED): rune has been explicitly blacklisted." - ], - "example_json_request": [ - { - "id": "example:checkrune#1", - "method": "checkrune", - "params": { - "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "rune": "617Obfct0oRBj_uqGFQxDk3XZ1sDFiC2Q5ltm5z1i_k9NSZtZXRob2Q9aW52b2ljZSZwbmFtZWRlc2NyaXB0aW9uPUB0aXBqYXJcfGpiNTVAc2VuZHNhdHMubG9s", - "method": "invoice", - "params": { - "amount_msat": "any", - "label": "lbl", - "description": [ - "@tipjar|jb55@sendsats.lol." - ] - } - } - }, - { - "id": "example:checkrune#2", - "method": "checkrune", - "params": { - "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==", - "method": "listpeers", - "params": {} - } - }, - { - "id": "example:checkrune#3", - "method": "checkrune", - "params": { - "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "rune": "617Obfct0oRBj_uqGFQxDk3XZ1sDFiC2Q5ltm5z1i_k9NSZtZXRob2Q9aW52b2ljZSZwbmFtZWRlc2NyaXB0aW9uPUB0aXBqYXJcfGpiNTVAc2VuZHNhdHMubG9s", - "method": "invoice", - "params": { - "amount_msat": "any", - "label": "lbl", - "description": "@tipjar|jb55@sendsats.lol" - } - } - } - ], - "example_json_response": [ - { - "valid": true - }, - { - "valid": true - }, - { - "valid": true - } - ], - "author": [ - "Shahana Farooqui <> is mainly responsible for consolidating logic from commando." - ], - "see_also": [ - "lightning-createrune(7)", - "lightning-blacklistrune(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-close.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "close", - "title": "Command for closing channels with direct peers", - "description": [ - "The **close** RPC command attempts to close the channel cooperatively with the peer, or unilaterally after *unilateraltimeout*, and the to-local output will be sent to the address specified in *destination*.", - "", - "The peer needs to be live and connected in order to negotiate a mutual close. The default of unilaterally closing after 48 hours is usually a reasonable indication that you can no longer contact the peer." - ], - "request": { - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string", - "description": [ - "Peer id, channel id or short_channel_id. If the given *id* is a peer ID (66 hex digits as a string), then it applies to the active channel of the direct peer corresponding to the given peer ID. If the given *id* is a channel ID (64 hex digits as a string, or the short channel ID *blockheight:txindex:outindex* form), then it applies to that channel." - ] - }, - "unilateraltimeout": { - "type": "u32", - "description": [ - "If it is not zero, the command will unilaterally close the channel when that number of seconds is reached. If *unilateraltimeout* is zero, then the command will wait indefinitely until the peer is online and can negotiate a mutual close." - ], - "default": "2 days (172800 seconds)" - }, - "destination": { - "type": "string", - "description": [ - "Any Bitcoin bech32 type. If the peer hasn't offered the option_shutdown_anysegwit feature, then taproot addresses (or other v1+ segwit) are not allowed. Tell your friends to upgrade!" - ], - "default": "a Core Lightning wallet address" - }, - "fee_negotiation_step": { - "type": "string", - "description": [ - "It controls how closing fee negotiation is performed assuming the peer proposes a fee that is different than our estimate. (Note that modern peers use the quick-close protocol which does not allow negotiation: see *feerange* instead).", - "", - "On every negotiation step we must give up some amount from our proposal towards the peer's proposal. This parameter can be an integer in which case it is interpreted as number of satoshis to step at a time. Or it can be an integer followed by `%` to designate a percentage of the interval to give up. A few examples, assuming the peer proposes a closing fee of 3000 satoshi and our estimate shows it must be 4000:", - " * `10`: our next proposal will be 4000-10=3990.", - " * `10%`: our next proposal will be 4000-(10% of (4000-3000))=3900.", - " * '1': our next proposal will be 3999. This is the most extreme case when we insist on our fee as much as possible.", - " * `100%`: our next proposal will be 3000. This is the most relaxed case when we quickly accept the peer's proposal." - ], - "default": "`50%`" - }, - "wrong_funding": { - "type": "outpoint", - "description": [ - "It can only be specified if both sides have offered the `shutdown_wrong_funding` feature (enabled by the **experimental-shutdown-wrong-funding** option). It must be a transaction id followed by a colon then the output number. Instead of negotiating a shutdown to spend the expected funding transaction, the shutdown transaction will spend this output instead. This is only allowed if this peer opened the channel and the channel is unused: it can rescue openings which have been manually miscreated." - ] }, - "force_lease_closed": { - "type": "boolean", - "description": [ - "If the channel has funds leased to the peer (option_will_fund), we prevent initiation of a mutual close unless this flag is passed in." - ], - "default": "False" - }, - "feerange": { - "type": "array", - "items": { - "type": "feerate" - }, - "description": [ - "An optional array [ *min*, *max* ], indicating the minimum and maximum feerates to offer: the peer will obey these if it supports the quick-close protocol. *slow* and *unilateral_close* are the defaults. Note that the maximum fee will be capped at the final commitment transaction fee (unless the experimental anchor-outputs option is negotiated)." - ] - } - } - }, - "response": { - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "mutual", - "unilateral", - "unopened" - ], - "description": [ - "Whether we successfully negotiated a mutual close, closed without them, or discarded not-yet-opened channel." - ] - } - }, - "allOf": [ { "if": { "properties": { "type": { "type": "string", "enum": [ - "mutual", - "unilateral" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "tx", - "txid" - ], - "properties": { - "type": {}, - "tx": { - "type": "hex", - "description": [ - "The raw bitcoin transaction used to close the channel (if it was open)." + "bolt12 invoice" ] }, - "txid": { - "type": "txid", - "description": [ - "The transaction id of the *tx* field." + "valid": { + "type": "boolean", + "enum": [ + false ] } } }, - "else": { + "then": { + "required": [], "additionalProperties": false, "properties": { - "type": {} - } - } - } - ], - "post_return_value_notes": [ - "A unilateral close may still occur at any time if the peer did not behave correctly during the close negotiation.", - "", - "Unilateral closes will return your funds after a delay. The delay will vary based on the peer *to_self_delay* setting, not your own setting." - ] - }, - "notes": [ - "Prior to 0.7.2, **close** took two parameters: *force* and *timeout*. *timeout* was the number of seconds before *force* took effect (default, 30), and *force* determined whether the result was a unilateral close or an RPC error (default). Even after the timeout, the channel would be closed if the peer reconnected." - ], - "notifications": [ - "Notifications may be returned indicating what is going on, especially if the peer is offline and we are waiting." - ], - "example_json_request": [ - { - "id": "example:close#1", - "method": "close", - "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "unilateraltimeout": 1, - "destination": null, - "fee_negotiation_step": null, - "force_lease_closed": null, - "feerange": null - } - }, - { - "id": "example:close#2", - "method": "close", - "params": { - "id": "103x1x0", - "unilateraltimeout": null, - "destination": "bcrt1qeyyk6sl5pr49ycpqyckvmttus5ttj25pd0zpvg", - "fee_negotiation_step": null, - "force_lease_closed": null, - "feerange": null - } - }, - { - "id": "example:close#3", - "method": "close", - "params": [ - "107x1x0", - null, - "bcrt1qeyyk6sl5pr49ycpqyckvmttus5ttj25pd0zpvg" - ] - } - ], - "example_json_response": [ - { - "tx": "020000000001018d388ffcd216c92d25163a62096ce47d5c9bbd6270ced51c5a1484f89df33e5700000000009db0e28002a00f00000000000016001445503fa4b65ade3ffdb1a92057688456c9ffae1380130f0000000000220020be82765fdb17fd5568f2dd31c6cf1aabc620ef338995ec5d9a2f3e42f43ae4870400473044022058dcde893655f40fc8162a79596440ef3e304273f8d530401fc17bc92c58159b0220428900ca6537538ba237d569a4a09003d663a991aeb331a9f18dfe807ee78806014730440220111270eeed8b4b1a231d3ce6e0e0daad718623ad159a0fd3781fb18118a8fec70220539826ee7c76cad4116d1d8852329f80314b3434cf21c765d8004186451a4cd50147522102324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b2102e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5752ae9c3ed620", - "txid": "5d8d917dd7d39fe5a12f121457fc6d712b5e393ed4f16bc8f5976fc08cbbfecd", - "type": "unilateral" - }, - { - "tx": "0200000000010132cbce7d5f96b4003c3b5c0eab2a29fef90bb6abb833ff312fa122f31e8301810000000000ffffffff02a0860100000000002251205779a060f200d40e8f871a40eb91614cc5bfa6d0a5f852e053400a7feff8615005b10d0000000000160014c9096d43f408ea526020262ccdad7c8516b92a81040047304402207e171d056e81cf8ad2d5a613ecbaa212d5dcbd0bf713145d18911d2cbe9d858802206222911660a26d7ffddc2563ae6d41d6ffad9fbd2fc26cf40eab501a31153b9e0147304402204ae7cdc68dc7966eab73f16a1978643336333d54ae0b6f87bc11a2c19174a9710220601e5276aee0825466cc272c4eb7d353b393ef0dd230d303f46772790dee19190147522102324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b2102e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5752ae00000000", - "txid": "4a08e0508e2e39ea033fab5f77b318337f345550421799f6e0eb1b15a892eda4", - "type": "mutual" - }, - { - "tx": "02000000000101233b513665836d240423f45ffcd1fe19aeb08d62303fa5382ad3285f770683a60000000000ffffffff02a086010000000000225120b47216ab60a0fad97de0ba9b8b370d281dfe55f552d82034e2a8d054c2246e4405b10d0000000000160014c9096d43f408ea526020262ccdad7c8516b92a81040047304402207a9e3ca258861b33827d91514690a757e76730ba8c15dd222340bb13d993a1a502204d0ae329273b69abe62df1ffccce808d5f1a29101a8ee95dae99888376dbaef801473044022033c03f406db9f1c9d924cfd8f6ea42d0962f0ab02e3217aef518aea517ca5ba40220076e2af9d40c676316a2765a86f9efd481de3fc4465ceba33b0782c505ae3452014752210212284c004a3d24146e54b2a24db48f650370a08e1fe9abe8ff41f92b09cd50542102a3032ef980cc735579aa5295d927b9a1bdbafc459f2da14163dc9bd530e0a21152ae00000000", - "txid": "d44a1374a30c1a936d2d4fdbe73c0ffff42fec8c27c6cbaec2758b3042f61d08", - "type": "mutual" - } - ], - "author": [ - "ZmnSCPxj <> is mainly responsible." - ], - "see_also": [ - "lightning-disconnect(7)", - "lightning-fundchannel(7)", - "lightningd-config(5)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-commando-blacklist.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "added": "v23.05", - "deprecated": [ - "v23.08", - "v24.08" - ], - "rpc": "commando-blacklist", - "title": "Command to prevent a rune from working", - "description": [ - "The **commando-blacklist** RPC command allows you to effectively revoke the rune you have created (and any runes derived from that rune with additional restictions). Attempting to use these runes will be resulted in a `Blacklisted rune` error message.", - "", - "All runes created by commando have a unique sequential id within them and can be blacklisted in ranges for efficiency. The command always returns the blacklisted ranges on success. If no parameters are specified, no changes have been made. If start specified without end, that single rune is blacklisted. If end is also specified, every rune from start till end inclusive is blacklisted." - ], - "request": { - "required": [], - "properties": { - "start": { - "type": "u64", - "description": [ - "First rune unique id to blacklist." - ] - }, - "end": { - "type": "u64", - "description": [ - "Final rune unique id to blacklist (defaults to start)." - ] - } - }, - "dependentUpon": { - "start": [ - "end" - ] - } - }, - "response": { - "required": [ - "blacklist" - ], - "properties": { - "blacklist": { - "type": "array", - "description": [ - "The resulting blacklist ranges after the command." - ], - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "start", - "end" - ], - "properties": { - "start": { - "type": "u64", + "type": {}, + "valid": {}, + "offer_id": {}, + "offer_chains": {}, + "offer_metadata": {}, + "offer_currency": {}, + "warning_unknown_offer_currency": {}, + "currency_minor_unit": {}, + "offer_amount": {}, + "offer_amount_msat": {}, + "offer_description": {}, + "offer_issuer": {}, + "offer_features": {}, + "offer_absolute_expiry": {}, + "offer_quantity_max": {}, + "offer_paths": {}, + "offer_node_id": {}, + "offer_recurrence": {}, + "invreq_metadata": {}, + "invreq_payer_id": {}, + "invreq_chain": {}, + "invreq_amount_msat": {}, + "invreq_features": {}, + "invreq_quantity": {}, + "invreq_payer_note": {}, + "invreq_node_id": {}, + "invreq_recurrence_counter": {}, + "invreq_recurrence_start": {}, + "warning_invalid_offer_description": { + "type": "string", "description": [ - "Unique id of first rune in this blacklist range." + "`offer_description` is not valid UTF8." ] }, - "end": { - "type": "u64", + "warning_missing_offer_description": { + "type": "string", "description": [ - "Unique id of last rune in this blacklist range." + "`offer_description` is not present." ] - } - } - } - } - } - }, - "example_json_request": [ - { - "id": "example:commando-blacklist#1", - "method": "commando-blacklist", - "params": { - "start": 2 - } - }, - { - "id": "example:commando-blacklist#2", - "method": "commando-blacklist", - "params": { - "start": 5, - "end": 7 - } - }, - { - "id": "example:commando-blacklist#3", - "method": "commando-blacklist", - "params": { - "start": 3, - "end": 4 - } - } - ], - "example_json_response": [ - { - "blacklist": [ - { - "start": 2, - "end": 2 - } - ] - }, - { - "blacklist": [ - { - "start": 2, - "end": 2 - }, - { - "start": 5, - "end": 7 - } - ] - }, - { - "blacklist": [ - { - "start": 2, - "end": 7 - } - ] - } - ], - "author": [ - "Shahana Farooqui <> is mainly responsible." - ], - "see_also": [ - "lightning-commando-listrunes(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-commando-listrunes.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "added": "v23.05", - "deprecated": [ - "v23.08", - "v24.05" - ], - "rpc": "commando-listrunes", - "title": "Command to list previously generated runes", - "description": [ - "The **commando-listrunes** RPC command either lists runes that we stored as we generate them (see lightning-commando-rune(7)) or decodes the rune given on the command line.", - "", - "NOTE: Runes generated prior to v23.05 were not stored, so will not appear in this list." - ], - "request": { - "required": [], - "properties": { - "rune": { - "type": "string", - "description": [ - "Optional rune to list." - ] - } - } - }, - "response": { - "required": [ - "runes" - ], - "properties": { - "runes": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "rune", - "unique_id", - "restrictions", - "restrictions_as_english" - ], - "properties": { - "rune": { + }, + "warning_invalid_offer_currency": { "type": "string", "description": [ - "Base64 encoded rune." + "`offer_currency_code` is not valid UTF8." ] }, - "unique_id": { + "warning_invalid_offer_issuer": { "type": "string", "description": [ - "Unique id assigned when the rune was generated; this is always a u64 for commando runes." + "`offer_issuer` is not valid UTF8." ] }, - "restrictions": { - "type": "array", + "warning_missing_invreq_metadata": { + "type": "string", "description": [ - "The restrictions on what commands this rune can authorize." - ], + "`invreq_metadata` is not present." + ] + }, + "warning_invalid_invreq_payer_note": { + "type": "string", + "description": [ + "`invreq_payer_note` is not valid UTF8." + ] + }, + "warning_missing_invoice_paths": { + "type": "string", + "description": [ + "`invoice_paths` is not present." + ] + }, + "warning_missing_invoice_blindedpay": { + "type": "string", + "description": [ + "`invoice_blindedpay` is not present." + ] + }, + "warning_missing_invoice_created_at": { + "type": "string", + "description": [ + "`invoice_created_at` is not present." + ] + }, + "warning_missing_invoice_payment_hash": { + "type": "string", + "description": [ + "`invoice_payment_hash` is not present." + ] + }, + "warning_missing_invoice_amount": { + "type": "string", + "description": [ + "`invoice_amount` is not present." + ] + }, + "warning_missing_invoice_recurrence_basetime": { + "type": "string", + "description": [ + "`invoice_recurrence_basetime` is not present." + ] + }, + "warning_missing_invoice_node_id": { + "type": "string", + "description": [ + "`invoice_node_id` is not present." + ] + }, + "warning_missing_invoice_signature": { + "type": "string", + "description": [ + "`signature` is not present." + ] + }, + "warning_invalid_invoice_signature": { + "type": "string", + "description": [ + "Incorrect `signature`." + ] + }, + "fallbacks": { + "type": "array", "items": { "type": "object", - "additionalProperties": false, "required": [ - "alternatives", - "english" + "version", + "hex" ], "properties": { - "alternatives": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "fieldname", - "value", - "condition", - "english" - ], - "properties": { - "fieldname": { - "type": "string", - "description": [ - "The field this restriction applies to; see commando-rune(7)." - ] - }, - "value": { - "type": "string", - "description": [ - "The value accepted for this field." - ] - }, - "condition": { - "type": "string", - "description": [ - "The way to compare fieldname and value." - ] - }, - "english": { - "type": "string", - "description": [ - "English readable description of this alternative." - ] - } - } - } - }, - "english": { + "version": {}, + "hex": {}, + "address": {}, + "warning_invoice_fallbacks_version_invalid": { "type": "string", "description": [ - "English readable summary of alternatives above." + "`version` is > 16." ] } } } - }, - "restrictions_as_english": { + } + } + } + }, + { + "if": { + "properties": { + "type": { "type": "string", - "description": [ - "English readable description of the restrictions array above." + "enum": [ + "bolt11 invoice" ] }, - "stored": { + "valid": { "type": "boolean", "enum": [ - false - ], + true + ] + } + } + }, + "then": { + "required": [ + "currency", + "created_at", + "expiry", + "payee", + "min_final_cltv_expiry", + "payment_hash", + "signature" + ], + "additionalProperties": false, + "properties": { + "type": {}, + "valid": {}, + "currency": { + "type": "string", "description": [ - "This is false if the rune does not appear in our datastore (only possible when `rune` is specified)." + "The BIP173 name for the currency." ] }, - "blacklisted": { - "type": "boolean", - "enum": [ - true - ], + "created_at": { + "type": "u64", "description": [ - "The rune has been blacklisted; see commando-blacklist(7)." + "The UNIX-style timestamp of the invoice." ] }, - "last_used": { - "type": "number", + "expiry": { + "type": "u64", "description": [ - "The last time this rune was successfully used." - ], - "added": "23.11" + "The number of seconds this is valid after `created_at`." + ] }, - "our_rune": { - "type": "boolean", - "enum": [ - false - ], + "payee": { + "type": "pubkey", "description": [ - "This is not a rune for this node (only possible when `rune` is specified)." + "The public key of the recipient." ] - } - } - } - } - } - }, - "example_json_request": [ - { - "id": "example:commando-listrunes#1", - "method": "commando-listrunes", - "params": "{}" - }, - { - "id": "example:commando-listrunes#2", - "method": "commando-listrunes", - "params": { - "rune": "Am3W_wI0PRn4qVNEsJ2iInHyFPQK8wfdqEXztm8-icQ9MA==" - } - }, - { - "id": "example:commando-listrunes#3", - "method": "commando-listrunes", - "params": { - "rune": "m_tyR0qqHUuLEbFJW6AhmBg-9npxVX2yKocQBFi9cvY9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJzJnBuYW1lbGV2ZWwhfHBuYW1lbGV2ZWwvaW8mcGFycjEhfHBhcnIxL2lv" - } - } - ], - "example_json_response": [ - { - "runes": [ - { - "rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==", - "unique_id": "0", - "restrictions": [], - "restrictions_as_english": "" - }, - { - "rune": "Am3W_wI0PRn4qVNEsJ2iInHyFPQK8wfdqEXztm8-icQ9MA==", - "stored": false, - "our_rune": false, - "unique_id": "1", - "restrictions": [], - "restrictions_as_english": "" - } - ] - }, - { - "runes": [ - { - "rune": "Am3W_wI0PRn4qVNEsJ2iInHyFPQK8wfdqEXztm8-icQ9MA==", - "stored": false, - "our_rune": false, - "unique_id": "1", - "restrictions": [], - "restrictions_as_english": "" - } - ] - }, - { - "runes": [ - { - "rune": "m_tyR0qqHUuLEbFJW6AhmBg-9npxVX2yKocQBFi9cvY9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJzJnBuYW1lbGV2ZWwhfHBuYW1lbGV2ZWwvaW8mcGFycjEhfHBhcnIxL2lv", - "stored": false, - "unique_id": "3", - "restrictions": [ - { - "alternatives": [ - { - "fieldname": "id", - "value": "022d223620a359a47ff7", - "condition": "^", - "english": "id starts with 022d223620a359a47ff7" - } - ], - "english": "id starts with 022d223620a359a47ff7" }, - { - "alternatives": [ - { - "fieldname": "method", - "value": "listpeers", - "condition": "=", - "english": "method equal to listpeers" - } - ], - "english": "method equal to listpeers" + "amount_msat": { + "type": "msat", + "description": [ + "Amount the invoice asked for." + ] }, - { - "alternatives": [ - { - "fieldname": "pnamelevel", - "value": "", - "condition": "!", - "english": "pnamelevel is missing" - }, - { - "fieldname": "pnamelevel", - "value": "io", - "condition": "/", - "english": "pnamelevel unequal to io" + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage*." + ] + }, + "signature": { + "type": "signature", + "description": [ + "Signature of the *payee* on this invoice." + ] + }, + "description": { + "type": "string", + "description": [ + "The description of the purpose of the purchase." + ] + }, + "description_hash": { + "type": "hash", + "description": [ + "The hash of the description, in place of *description*." + ] + }, + "min_final_cltv_expiry": { + "type": "u32", + "description": [ + "The minimum CLTV delay for the final node." + ] + }, + "payment_secret": { + "type": "secret", + "description": [ + "The secret to hand to the payee node." + ] + }, + "features": { + "type": "hex", + "description": [ + "The features bitmap for this invoice." + ] + }, + "payment_metadata": { + "type": "hex", + "description": [ + "The payment_metadata to put in the payment." + ] + }, + "fallbacks": { + "type": "array", + "description": [ + "Onchain addresses." + ], + "items": { + "type": "object", + "required": [ + "type", + "hex" + ], + "additionalProperties": false, + "properties": { + "type": { + "type": "string", + "description": [ + "The address type (if known)." + ], + "enum": [ + "P2PKH", + "P2SH", + "P2WPKH", + "P2WSH", + "P2TR" + ] + }, + "addr": { + "type": "string", + "description": [ + "The address in appropriate format for *type*." + ] + }, + "hex": { + "type": "hex", + "description": [ + "Raw encoded address." + ] + } } + } + }, + "routes": { + "type": "array", + "description": [ + "Route hints to the *payee*." ], - "english": "pnamelevel is missing OR pnamelevel unequal to io" + "items": { + "type": "array", + "description": [ + "Hops in the route." + ], + "items": { + "type": "object", + "required": [ + "pubkey", + "short_channel_id", + "fee_base_msat", + "fee_proportional_millionths", + "cltv_expiry_delta" + ], + "additionalProperties": false, + "properties": { + "pubkey": { + "type": "pubkey", + "description": [ + "The public key of the node." + ] + }, + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "A channel to the next peer." + ] + }, + "fee_base_msat": { + "type": "msat", + "description": [ + "The base fee for payments." + ] + }, + "fee_proportional_millionths": { + "type": "u32", + "description": [ + "The parts-per-million fee for payments." + ] + }, + "cltv_expiry_delta": { + "type": "u32", + "description": [ + "The CLTV delta across this hop." + ] + } + } + } + } }, - { - "alternatives": [ - { - "fieldname": "parr1", - "value": "", - "condition": "!", - "english": "parr1 is missing" - }, - { - "fieldname": "parr1", - "value": "io", - "condition": "/", - "english": "parr1 unequal to io" + "extra": { + "type": "array", + "description": [ + "Any extra fields we didn't know how to parse." + ], + "items": { + "type": "object", + "required": [ + "tag", + "data" + ], + "additionalProperties": false, + "properties": { + "tag": { + "type": "string", + "description": [ + "The bech32 letter which identifies this field." + ], + "maxLength": 1, + "minLength": 1 + }, + "data": { + "type": "string", + "description": [ + "The bech32 data for this field." + ] + } } + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "rune" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "required": [ + "string", + "restrictions", + "valid" + ], + "additionalProperties": false, + "properties": { + "unique_id": { + "type": "string", + "description": [ + "Unique id (always a numeric id on runes we create)." + ] + }, + "version": { + "type": "string", + "description": [ + "Rune version, not currently set on runes we create." + ] + }, + "valid": { + "type": "boolean", + "enum": [ + true + ] + }, + "type": {}, + "string": { + "type": "string", + "description": [ + "The string encoding of the rune." + ] + }, + "restrictions": { + "type": "array", + "description": [ + "Restrictions built into the rune: all must pass." ], - "english": "parr1 is missing OR parr1 unequal to io" + "items": { + "type": "object", + "required": [ + "alternatives", + "summary" + ], + "additionalProperties": false, + "properties": { + "alternatives": { + "type": "array", + "description": [ + "Each way restriction can be met: any can pass." + ], + "items": { + "type": "string", + "description": [ + "The alternative of form fieldname condition fieldname." + ] + } + }, + "summary": { + "type": "string", + "description": [ + "Human-readable summary of this restriction." + ] + } + } + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "rune" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + false + ] } + } + }, + "then": { + "required": [ + "valid" ], - "restrictions_as_english": "id starts with 022d223620a359a47ff7 AND method equal to listpeers AND pnamelevel is missing OR pnamelevel unequal to io AND parr1 is missing OR parr1 unequal to io" + "additionalProperties": false, + "properties": { + "valid": { + "type": "boolean", + "enum": [ + false + ] + }, + "type": {}, + "warning_rune_invalid_utf8": { + "type": "string", + "description": [ + "The rune contains invalid UTF-8 strings." + ] + }, + "hex": { + "type": "hex", + "description": [ + "The raw rune in hex." + ] + } + } } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "emergency recover" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "required": [ + "decrypted" + ], + "additionalProperties": false, + "properties": { + "type": {}, + "valid": {}, + "decrypted": { + "type": "hex", + "description": [ + "The decrypted value of the provided bech32 of emergency.recover." + ], + "added": "v23.11" + } + } + } + } + ] + }, + "example_json_request": [ + { + "id": "example:decode#1", + "method": "decode", + "params": [ + "zm0x_eLgHexaTvZn3Cz7gb_YlvrlYGDo_w4BYlR9SS09MSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl" + ] + }, + { + "id": "example:decode#2", + "method": "decode", + "params": [ + "lnbcrt1m1pja0f2hsp5xyssdvdsu24dmmesrt6x84wfrm4mscsnzq7hl2suzeu90wy6g53qpp5zyyu3anwfsfl64pewe0tg7j28map2wwnhvaam5nt70rlwxa0cegqdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqgqqqqqqqlgqqqq86qqqc9qxpqysgq7u4f99u4kepagme27t5c3gdl7czlnjaw7kxryxgm87w2j02j3g94r2vrukhpgedhcdkcdec27m7jrl2lvcr6uh3rdv9lgpz0vc0zcfcqnugjdw" ] } ], + "example_json_response": [ + { + "type": "rune", + "unique_id": "1", + "string": "ce6d31fde2e01dec5a4ef667dc2cfb81bfd896fae56060e8ff0e0162547d492d:=1&method^list|method^get|method=summary&method/listdatastore", + "restrictions": [ + { + "alternatives": [ + "method^list", + "method^get", + "method=summary" + ], + "summary": "method (of command) starts with 'list' OR method (of command) starts with 'get' OR method (of command) equal to 'summary'" + }, + { + "alternatives": [ + "method/listdatastore" + ], + "summary": "method (of command) unequal to 'listdatastore'" + } + ], + "valid": true + }, + { + "type": "bolt11 invoice", + "currency": "bcrt", + "created_at": 1708631383, + "expiry": 604800, + "payee": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount_msat": 100000000, + "description": "description", + "min_final_cltv_expiry": 5, + "payment_secret": "312106b1b0e2aaddef301af463d5c91eebb86213103d7faa1c167857b89a4522", + "features": "02024100", + "routes": [ + [ + { + "pubkey": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "short_channel_id": "103x1x0", + "fee_base_msat": 1000, + "fee_proportional_millionths": 1000, + "cltv_expiry_delta": 6 + } + ] + ], + "payment_hash": "1109c8f66e4c13fd5439765eb47a4a3efa1539d3bb3bddd26bf3c7f71bafc650", + "signature": "3045022100f72a929795b643d46f2af2e988a1bff605f9cbaef58c32191b3f9ca93d528a0b022051a983e5ae1465b7c36d86e70af6fd21fd5f6607ae5e236b0bf4044f661e2c27", + "valid": true + } + ], "author": [ - "Shahana Farooqui <> is mainly responsible." + "Rusty Russell <> is mainly responsible." ], "see_also": [ - "lightning-commando-rune(7)", - "lightning-commando-blacklist(7)" + "lightning-pay(7)", + "lightning-offer(7)", + "lightning-fetchinvoice(7)", + "lightning-sendinvoice(7)", + "lightning-commando-rune(7)" ], "resources": [ + "[BOLT #11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md)", + "", + "[BOLT #12](https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md)", + "(experimental, [bolt](https://github.com/lightning/bolts) #798)", + "", "Main web site: " ] }, - "lightning-commando-rune.json": { + "lightning-decodepay.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "deprecated": [ - "v23.08", - "v23.05" - ], - "rpc": "commando-rune", - "title": "Command to Authorize Remote Peer Access", + "added": "v23.05", + "rpc": "decodepay", + "title": "Command for decoding a bolt11 string (low-level)", "description": [ - "The **commando-rune** RPC command creates a base64 string called a *rune* which can be used to access commands on this node. Each *rune* contains a unique id (a number starting at 0), and can have restrictions inside it. Nobody can remove restrictions from a rune: if you try, the rune will be rejected. There is no limit on how many runes you can issue; the node simply decodes and checks them as they are received (we do store them for lightning-commando- listrunes(7) however)." + "The **decodepay** RPC command checks and parses a *bolt11* string as specified by the BOLT 11 specification." ], "request": { - "required": [], + "required": [ + "bolt11" + ], "properties": { - "rune": { + "bolt11": { "type": "string", "description": [ - "If supplied, the restrictions are simple appended to that *rune* (it doesn't need to be a rune belonging to this node). If not supplied, a new *rune* is constructed, with a new unique id." + "Bolt11 invoice to decode." ] }, - "restrictions": { + "description": { + "type": "string", "description": [ - "It can be the string `readonly`, or an array of restrictions.", - "Each restriction is an array of one or more alternatives, such as \"method is listpeers\", or \"method is listpeers OR time is before 2023\"." - ], - "oneOf": [ - { - "type": "array", - "description": [ - "Alternatives use a simple language to examine the command which is being run:", - " * time: the current UNIX time, e.g. \"time<1656759180\".", - " * id: the node_id of the peer, e.g. \"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\".", - " * method: the command being run, e.g. \"method=withdraw\".", - " * per: how often the rune can be used, with suffix \"sec\" (default), \"min\", \"hour\", \"day\" or \"msec\", \"usec\" or \"nsec\". e.g. \"per=5sec\".", - " * rate: the rate limit, per minute, e.g. \"rate=60\" is equivalent to \"per=1sec\".", - " * pnum: the number of parameters. e.g. \"pnum<2\".", - " * pnameX: the parameter named X (with any punctuation like `_` removed). e.g. \"pnamedestination=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T\".", - " * parrN: the N'th parameter. e.g. \"parr0=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T\"." - ], - "items": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "type": "string", - "enum": [ - "readonly" - ], - "description": [ - "A rune which allows most *get* and *list* commands, and the *summary* command." - ] - } + "Description of the invoice to decode." ] } } }, "response": { "required": [ - "rune", - "unique_id" + "currency", + "created_at", + "expiry", + "payee", + "min_final_cltv_expiry", + "payment_hash", + "signature" ], "properties": { - "rune": { + "currency": { "type": "string", "description": [ - "The resulting rune." + "The BIP173 name for the currency." ] }, - "unique_id": { - "type": "string", + "created_at": { + "type": "u64", "description": [ - "The id of this rune: this is set at creation and cannot be changed (even as restrictions are added)." + "The UNIX-style timestamp of the invoice." ] }, - "warning_unrestricted_rune": { + "expiry": { + "type": "u64", + "description": [ + "The number of seconds this is valid after *timestamp*." + ] + }, + "payee": { + "type": "pubkey", + "description": [ + "The public key of the recipient." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount the invoice asked for." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage*." + ] + }, + "signature": { + "type": "signature", + "description": [ + "Signature of the *payee* on this invoice." + ] + }, + "description": { "type": "string", "description": [ - "A warning shown when runes are created with powers that could drain your node." + "The description of the purpose of the purchase." ] - } - } - }, - "restriction_format": [ - "Restrictions are one or more alternatives. Each alternative is *name* *operator* *value*. The valid names are shown above.", - "", - "Note that if a value contains `\\`, it must be preceeded by another `\\` to form valid JSON:", - "* `=`: passes if equal ie. identical. e.g. `method=withdraw`", - "* `/`: not equals, e.g. `method/withdraw`", - "* `^`: starts with, e.g. `id^024b9a1fa8e006f1e3937f`", - "* `$`: ends with, e.g. `id$381df1cc449605`.", - "* `~`: contains, e.g. `id~006f1e3937f65f66c40`.", - "* `<`: is a decimal integer, and is less than. e.g. `time<1656759180`", - "* `>`: is a decimal integer, and is greater than. e.g. `time>1656759180`", - "* `{`: preceeds in alphabetical order (or matches but is shorter),", - " e.g. `id{02ff`.", - "* `}`: follows in alphabetical order (or matches but is longer),", - " e.g. `id}02ff`.", - "* `#`: a comment, ignored, e.g. `dumb example#`.", - "* `!`: only passes if the *name* does *not* exist. e.g. `pnamedestination!`.", - "Every other operator except `#` fails if *name* does not exist!" - ], - "example_usage": [ - "This creates a fresh rune which can do anything:", - "", - "```shell", - "$ lightning-cli commando-rune", - "{", - " \"rune\": \"KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA==\",", - " \"unique_id\": \"0\"", - "}", - "```", - "We can add restrictions to that rune, like so:", - "", - "```shell", - "$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions=readonly", - "{", - " \"rune\": \"NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl\",", - " \"unique_id\": \"0\"", - "}", - "```", - "The \"readonly\" restriction is a short-cut for two restrictions:", - "", - "1. `[\"method^list\", \"method^get\", \"method=summary\"]`: You may call list, get or summary.", - "2. `[\"method/listdatastore\"]`: But not listdatastore: that contains sensitive stuff!", - "", - "We can do the same manually, like so:", - "", - "```shell", - "$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions='[[\"method^list\", \"method^get\", \"method=summary\"],[\"method/listdatastore\"]]'", - "{", - " \"rune\": \"NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl\",", - " \"unique_id\": \"0\"", - "}", - "```", - "Let's create a rune which lets a specific peer (024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605) run \"listpeers\" on themselves:", - "", - "```shell", - "$ lightning-cli commando-rune restrictions='[[\"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"],[\"method=listpeers\"],[\"pnum=1\"],[\"pnameid=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\",\"parr0=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"]]'", - "{", - " \"rune\": \"FE8GHiGVvxcFqCQcClVRRiNE_XEeLYQzyG2jmqto4jM9MiZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDV8cGFycjA9MDI0YjlhMWZhOGUwMDZmMWUzOTM3ZjY1ZjY2YzQwOGU2ZGE4ZTFjYTcyOGVhNDMyMjJhNzM4MWRmMWNjNDQ5NjA1\",", - " \"unique_id\": \"2\"", - "}", - "```", - "This allows `listpeers` with 1 argument (`pnum=1`), which is either by name (`pnameid`), or position (`parr0`). We could shorten this in several ways: either allowing only positional or named parameters, or by testing the start of the parameters only. Here's an example which only checks the first 9 bytes of the `listpeers` parameter:", - "", - "```shell", - "$ lightning-cli commando-rune restrictions='[[\"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"],[\"method=listpeers\"],[\"pnum=1\"],[\"pnameid^024b9a1fa8e006f1e393\", \"parr0^024b9a1fa8e006f1e393\"]'", - " {", - " \"rune\": \"fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw==\",", - " \"unique_id\": \"3\"", - "}", - "```", - "Before we give this to our peer, let's add two more restrictions: that it only be usable for 24 hours from now (`time<`), and that it can only be used twice a minute (`rate=2`). `date +%s` can give us the current time in seconds:", - "", - "```shell", - "$ lightning-cli commando-rune rune=fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw== restrictions='[[\"time<'$(($(date +%s) + 24*60*60))'\",\"rate=2\"]]'", - "{", - " \"rune\": \"tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y\",", - " \"unique_id\": \"3\"", - "}", - "```", - "You can also use lightning-decode(7) to examine runes you have been given:", - "", - "```shell", - "$ lightning-cli decode tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y", - "{", - " \"type\": \"rune\",", - " \"unique_id\": \"3\",", - " \"string\": \"b54f912e33220e9636534a375b5a05a306abdfa4451a95a5a0f6d6f7e46e65da:=3&id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605&method=listpeers&pnum=1&pnameid^024b9a1fa8e006f1e393|parr0^024b9a1fa8e006f1e393&time<1656920538&rate=2\",", - " \"restrictions\": [", - " {", - " \"alternatives\": [", - " \"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"", - " ],", - " \"summary\": \"id (of commanding peer) equal to '024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605'\"", - " },", - " {", - " \"alternatives\": [", - " \"method=listpeers\"", - " ],", - " \"summary\": \"method (of command) equal to 'listpeers'\"", - " },", - " {", - " \"alternatives\": [", - " \"pnum=1\"", - " ],", - " \"summary\": \"pnum (number of command parameters) equal to 1\"", - " },", - " {", - " \"alternatives\": [", - " \"pnameid^024b9a1fa8e006f1e393\",", - " \"parr0^024b9a1fa8e006f1e393\"", - " ],", - " \"summary\": \"pnameid (object parameter 'id') starts with '024b9a1fa8e006f1e393' OR parr0 (array parameter #0) starts with '024b9a1fa8e006f1e393'\"", - " },", - " {", - " \"alternatives\": [", - " \"time<1656920538\"", - " ],", - " \"summary\": \"time (in seconds since 1970) less than 1656920538 (approximately 19 hours 18 minutes from now)\"", - " },", - " {", - " \"alternatives\": [", - " \"rate=2\"", - " ],", - " \"summary\": \"rate (max per minute) equal to 2\"", - " }", - " ],", - " \"valid\": true", - "}", - "```" - ], - "sharing_runes": [ - "Because anyone can add a restriction to a rune, you can always turn a normal rune into a read-only rune, or restrict access for 30 minutes from the time you give it to someone. Adding restrictions before sharing runes is best practice.", - "", - "If a rune has a ratelimit, any derived rune will have the same id, and thus will compete for that ratelimit. You might want to consider adding a tighter ratelimit to a rune before sharing it, so you will keep the remainder. For example, if you rune has a limit of 60 times per minute, adding a limit of 5 times per minute and handing that rune out means you can still use your original rune 55 times per minute." - ], - "example_json_request": [ - { - "id": "example:commando-rune#1", - "method": "commando-rune", - "params": "{}" - }, - { - "id": "example:commando-rune#2", - "method": "commando-rune", - "params": { - "restrictions": "readonly" - } - }, - { - "id": "example:commando-rune#3", - "method": "commando-rune", - "params": { - "restrictions": [ - [ - "id^022d223620a359a47ff7" - ], - [ - "method=listpeers" - ] + }, + "description_hash": { + "type": "hash", + "description": [ + "The hash of the description, in place of *description*." + ] + }, + "min_final_cltv_expiry": { + "type": "u32", + "description": [ + "The minimum CLTV delay for the final node." + ] + }, + "payment_secret": { + "type": "hash", + "description": [ + "The secret to hand to the payee node." + ] + }, + "features": { + "type": "hex", + "description": [ + "The features bitmap for this invoice." + ] + }, + "payment_metadata": { + "type": "hex", + "description": [ + "The payment_metadata to put in the payment." ] + }, + "fallbacks": { + "type": "array", + "description": [ + "Onchain addresses." + ], + "items": { + "type": "object", + "required": [ + "type", + "hex" + ], + "additionalProperties": false, + "properties": { + "type": { + "type": "string", + "description": [ + "The address type (if known)." + ], + "enum": [ + "P2PKH", + "P2SH", + "P2WPKH", + "P2WSH", + "P2TR" + ] + }, + "addr": { + "type": "string", + "description": [ + "The address in appropriate format for *type*." + ] + }, + "hex": { + "type": "hex", + "description": [ + "Raw encoded address." + ] + } + } + } + }, + "routes": { + "type": "array", + "description": [ + "Route hints to the *payee*." + ], + "items": { + "type": "array", + "description": [ + "Hops in the route." + ], + "items": { + "type": "object", + "required": [ + "pubkey", + "short_channel_id", + "fee_base_msat", + "fee_proportional_millionths", + "cltv_expiry_delta" + ], + "additionalProperties": false, + "properties": { + "pubkey": { + "type": "pubkey", + "description": [ + "The public key of the node." + ] + }, + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "A channel to the next peer." + ] + }, + "fee_base_msat": { + "type": "msat", + "description": [ + "The base fee for payments." + ] + }, + "fee_proportional_millionths": { + "type": "u32", + "description": [ + "The parts-per-million fee for payments." + ] + }, + "cltv_expiry_delta": { + "type": "u32", + "description": [ + "The CLTV delta across this hop." + ] + } + } + } + } + }, + "extra": { + "type": "array", + "description": [ + "Any extra fields we didn't know how to parse." + ], + "items": { + "type": "object", + "required": [ + "tag", + "data" + ], + "additionalProperties": false, + "properties": { + "tag": { + "type": "string", + "description": [ + "The bech32 letter which identifies this field." + ], + "maxLength": 1, + "minLength": 1 + }, + "data": { + "type": "string", + "description": [ + "The bech32 data for this field." + ] + } + } + } } }, + "post_return_value_notes": [ + "Technically, the *description* field is optional if a *description_hash* field is given, but in this case **decodepay** will only succeed if the optional *description* field is passed and matches the *description_hash*. In practice, these are currently unused." + ] + }, + "example_json_request": [ { - "id": "example:commando-rune#4", - "method": "commando-rune", + "id": "example:decodepay#1", + "method": "decodepay", "params": { - "restrictions": [ - [ - "method=pay" - ], - [ - "pnameamountmsat<10000" - ] - ] + "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk", + "description": null } } ], "example_json_response": [ { - "rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==", - "unique_id": "0", - "warning_unrestricted_rune": "WARNING: This rune has no restrictions! Anyone who has access to this rune could drain funds from your node. Be careful when giving this to apps that you don't trust. Consider using the restrictions parameter to only allow access to specific rpc methods." - }, - { - "rune": "zm0x_eLgHexaTvZn3Cz7gb_YlvrlYGDo_w4BYlR9SS09MSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", - "unique_id": "1" - }, - { - "rune": "YPojv9qgHPa3im0eiqRb-g8aRq76OasyfltGGqdFUOU9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJz", - "unique_id": "2" - }, - { - "rune": "b3hXuEM7Pqzk-C7HUw83xzvHOV7fmuGaWjdo-wHdfg89MCZtZXRob2Q9cGF5JnBuYW1lYW1vdW50bXNhdDwxMDAwMA==", - "unique_id": "3" + "currency": "bcrt", + "created_at": 1706152930, + "expiry": 604800, + "payee": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount_msat": 11000000, + "description": [ + "XEoCR94SIz6UIRUEkxum." + ], + "min_final_cltv_expiry": 5, + "payment_secret": "82644944d3f70d42aad1d5f7b5d7a629e7afa30b529cc952a4c59fc0e3790ea2", + "features": "02024100", + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "signature": "3045022100e3b7d8886eae1a7c9e55e1797aa0dcb77b8c5a19d56c657cad030e360c90682802203a35713acb098245e53a37faeac98754a29a7078db5ed6f2166f917e55b94484" } ], "author": [ - "Rusty Russell <> wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page.", - "", - "Christian Decker came up with the name \"commando\", which almost excuses his previous adoption of the name \"Eltoo\"." + "Rusty Russell <> is mainly responsible." ], "see_also": [ - "lightning-commando(7)", - "lightning-decode(7)" + "lightning-pay(7)", + "lightning-getroute(7)", + "lightning-sendpay(7)" ], "resources": [ + "[BOLT #11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md)", + "", "Main web site: " ] }, - "lightning-commando.json": { + "lightning-deldatastore.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "commando", - "title": "Command to Send a Command to a Remote Peer", + "rpc": "deldatastore", + "title": "Command for removing (plugin) data", "description": [ - "The **commando** RPC command is a homage to bad 80s movies. It also sends a directly-connected *peer_id* a custom message, containing a request to run *method* (with an optional dictionary of *params*); generally the peer will only allow you to run a command if it has provided you with a *rune* which allows it." + "The **deldatastore** RPC command allows plugins to delete data it has stored in the Core Lightning database.", + "", + "The command fails if the *key* isn't present, or if *generation* is specified and the generation of the data does not exactly match." ], "request": { "required": [ - "peer_id", - "method" + "key" ], "properties": { - "peer_id": { - "type": "pubkey", - "description": [ - "Peer to command." - ] - }, - "method": { - "type": "string", - "description": [ - "Method to invoke on peer." - ] - }, - "params": { + "key": { "oneOf": [ { "type": "array", "description": [ - "Array of positional parameters." - ] + "Key is an array of values (though a single value is treated as a one-element array), to form a heirarchy. Using the first element of the key as the plugin name (e.g. [ 'summary' ]) is recommended. A key can either have children or a value, never both: parents are created and removed automatically." + ], + "items": { + "type": "string" + } }, { - "type": "object", - "description": [ - "Parameters for method." - ] + "type": "string" } ] }, - "rune": { - "type": "string", + "generation": { + "type": "u64", "description": [ - "Rune to authorize the command." + "If specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with mode `must-replace` or `must-append`." ] + } + } + }, + "response": { + "required": [ + "key" + ], + "properties": { + "key": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Part of the key added to the datastore." + ] + } }, - "filter": { - "type": "object", + "generation": { + "type": "u64", "description": [ - "Filter to peer to apply to any successful result." + "The number of times this has been updated." + ] + }, + "hex": { + "type": "hex", + "description": [ + "The hex data which has removed from the datastore." + ] + }, + "string": { + "type": "string", + "description": [ + "The data as a string, if it's valid utf-8." ] } } }, - "response": { - "required": [], - "properties": {}, - "pre_return_value_notes": [ - "On success, the return depends on the *method* invoked." - ] - }, "errors": [ - "On failure, one of the following error codes may be returned:", - "", - "- -32600: Usually means peer is not connected", - "- 19535: the local commando plugin discovered an error.", - "- 19536: the remote commando plugin discovered an error.", - "- 19537: the remote commando plugin said we weren't authorized.", + "The following error codes may occur:", "", - "It can also fail if the peer does not respond, in which case it will simply hang awaiting a response." + "- 1200: the key does not exist", + "- 1201: the key does exist, but the generation is wrong", + "- -32602: invalid parameters" ], "example_json_request": [ { - "id": "example:commando#1", - "method": "commando", - "params": { - "peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "rune": "zm0x_eLgHexaTvZn3Cz7gb_YlvrlYGDo_w4BYlR9SS09MSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", - "method": "getinfo", - "params": {} - } - }, - { - "id": "example:commando#2", - "method": "commando", + "id": "example:deldatastore#1", + "method": "deldatastore", "params": { - "peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "rune": "m_tyR0qqHUuLEbFJW6AhmBg-9npxVX2yKocQBFi9cvY9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJzJnBuYW1lbGV2ZWwhfHBuYW1lbGV2ZWwvaW8mcGFycjEhfHBhcnIxL2lv", - "method": "listpeers", - "params": [ - "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "broken" - ] + "key": "otherkey", + "generation": 1 } }, { - "id": "example:commando#3", - "method": "commando", + "id": "example:deldatastore#2", + "method": "deldatastore", "params": { - "peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "rune": "b3hXuEM7Pqzk-C7HUw83xzvHOV7fmuGaWjdo-wHdfg89MCZtZXRob2Q9cGF5JnBuYW1lYW1vdW50bXNhdDwxMDAwMA==", - "method": "pay", - "params": { - "bolt11": "lnbcrt1pja05v6sp5n6gnm380ckkrnhzvytz0hvym0vcf0mlrk586nlp72cq7e2hhhffspp5cwhuvl4jhlqep3st2703z89jp7j6wucm8ytlj7rk9ckk0mv7whysdq5v3jhxcmjd9c8g6t0dceqxqyjw5qcqp99qxpqysgq40udwjtktkry0yyq9408q5vtmj534h88j5nn562lamam0rtfqfu3093t2dhhc63qnqe5maa5jc9ad5pm08q2k2udvp6skw9f6ez9c9qptatlau", - "amount_msat": 9999 - } + "key": [ + "a" + ], + "generation": null } } ], "example_json_response": [ { - "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "alias": "JUNIORBEAM-v23.11-415-gd120eba", - "color": "0266e4", - "num_peers": 1, - "num_pending_channels": 0, - "num_active_channels": 0, - "num_inactive_channels": 0, - "address": [], - "binding": [ - { - "type": "ipv4", - "address": "127.0.0.1", - "port": 42513 - } + "key": [ + "otherkey" ], - "version": "v23.11-415-gd120eba", - "blockheight": 101, - "network": "regtest", - "fees_collected_msat": 0, - "lightning-dir": "/tmp/ltests-7u_8_rtu/test_commando_rune_1/lightning-1/regtest", - "our_features": { - "init": "08a0000a8a5961", - "node": "88a0000a8a5961", - "channel": "", - "invoice": "02000002024100" - } - }, - { - "peers": [ - { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "connected": true, - "num_channels": 0, - "netaddr": [ - "127.0.0.1:40119" - ], - "features": "08a0000a8a5961", - "log": [ - { - "type": "SKIPPED", - "num_skipped": 30 - } - ] - } - ] + "generation": 1, + "hex": "6f746865726461746161", + "string": "otherdataa" }, { - "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "payment_hash": "c3afc67eb2bfc190c60b579f111cb20fa5a7731b3917f978762e2d67ed9e75c9", - "created_at": 1708642714.8110592, - "parts": 1, - "amount_msat": 9999, - "amount_sent_msat": 9999, - "payment_preimage": "17632717785b1a833a296ba1831cb968602872e68881c2f324e06e87979296dc", - "status": "complete" + "key": [ + "a" + ], + "generation": 0, + "hex": "6176616c", + "string": "aval" } ], "author": [ - "Rusty Russell <> wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page.", - "", - "Christian Decker came up with the name \"commando\", which almost excuses his previous adoption of the name \"Eltoo\"." + "Rusty Russell <> is mainly responsible." ], "see_also": [ - "lightning-commando-rune(7)" + "lightning-listdatastore(7)", + "lightning-datastore(7)", + "lightning-datastoreusage(7)" ], "resources": [ "Main web site: " ] }, - "lightning-connect.json": { + "lightning-delexpiredinvoice.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "connect", - "title": "Command for connecting to another lightning node", + "rpc": "delexpiredinvoice", + "title": "Command for removing expired invoices", "description": [ - "The **connect** RPC command establishes a new connection with another node in the Lightning Network.", - "", - "Connecting to a node is just the first step in opening a channel with another node. Once the peer is connected a channel can be opened with lightning-fundchannel(7).", - "", - "If there are active channels with the peer, **connect** returns once all the subdaemons are in place to handle the channels, not just once it's connected." + "The **delexpiredinvoice** RPC command removes all invoices that have expired on or before the given *maxexpirytime*." ], "request": { - "required": [ - "id" - ], + "required": [], "properties": { - "id": { - "type": "string", - "description": [ - "The target node's public key. As a convenience, *id* may be of the form *id@host* or *id@host:port*. In this case, the *host* and *port* parameters must be omitted. This can fail if your C-lightning node is a fresh install that has not connected to any peers yet (your node has no gossip yet), or if the target *id* is a fresh install that has no channels yet (nobody will gossip about a node until it has one published channel)." - ] - }, - "host": { - "type": "string", - "description": [ - "The peer's hostname or IP address. If *host* is not specified (or doesn't work), the connection will be attempted to an IP belonging to *id* obtained through gossip with other already connected peers. If *host* begins with a `/` it is interpreted as a local path and the connection will be made to that local socket (see **bind-addr** in lightningd-config(5))." - ] - }, - "port": { - "type": "u16", + "maxexpirytime": { + "type": "u64", "description": [ - "The peer's port number. If not specified, the *port* depends on the current network:", - " * bitcoin **mainnet**: 9735.", - " * bitcoin **testnet**: 19735.", - " * bitcoin **signet**: 39735.", - " * bitcoin **regtest**: 19846." + "Invoice expiry time in seconds. If not specified then all expired invoices are deleted." ] } } }, "response": { + "required": [], + "properties": {} + }, + "example_json_request": [ + { + "id": "example:delexpiredinvoice#1", + "method": "delexpiredinvoice", + "params": { + "maxexpirytime": null + } + } + ], + "example_json_response": [ + {} + ], + "author": [ + "ZmnSCPxj <> is mainly responsible." + ], + "see_also": [ + "lightning-delinvoice(7)", + "lightning-autoclean-status(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-delforward.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "delforward", + "title": "Command for removing a forwarding entry", + "description": [ + "The **delforward** RPC command removes a single forward from **listforwards**, using the uniquely-identifying *in_channel* and *in_htlc_id* (and, as a sanity check, the *status*) given by that command.", + "", + "This command is mainly used by the *autoclean* plugin (see lightningd- config(7)), As these database entries are only kept for your own analysis, removing them has no effect on the running of your node." + ], + "request": { "required": [ - "id", - "features", - "direction", - "address" + "in_channel", + "in_htlc_id", + "status" ], "properties": { - "id": { - "type": "pubkey", + "in_channel": { + "type": "short_channel_id", "description": [ - "The peer we connected to." + "Only the matching forwards on the given inbound channel are deleted. Note: for **listforwards** entries without an *in_htlc_id* entry (no longer created in v22.11, but can exist from older versions), a value of 18446744073709551615 can be used, but then it will delete *all* entries without *in_htlc_id* for this *in_channel* and *status*." ] }, - "features": { - "type": "hex", + "in_htlc_id": { + "type": "u64", "description": [ - "BOLT 9 features bitmap offered by peer." + "The unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11)." ] }, - "direction": { + "status": { "type": "string", - "enum": [ - "in", - "out" - ], - "description": [ - "Whether they initiated connection or we did." - ] - }, - "address": { - "type": "object", "description": [ - "Address information (mainly useful if **direction** is *out*)." - ], - "additionalProperties": true, - "required": [ - "type" + "The status of the forward to delete. You cannot delete forwards which have status *offered* (i.e. are currently active)." ], - "properties": { - "type": { - "type": "string", - "enum": [ - "local socket", - "ipv4", - "ipv6", - "torv2", - "torv3" - ], - "description": [ - "Type of connection (*torv2*/*torv3* only if **direction** is *out*)." - ] - } - }, - "allOf": [ - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "local socket" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "socket" - ], - "properties": { - "type": {}, - "socket": { - "type": "string", - "description": [ - "Socket filename." - ] - } - } - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "ipv4", - "ipv6", - "torv2", - "torv3" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "address", - "port" - ], - "properties": { - "type": {}, - "address": { - "type": "string", - "description": [ - "Address in expected format for **type**." - ] - }, - "port": { - "type": "u16", - "description": [ - "Port number." - ] - } - } - } - } + "enum": [ + "settled", + "local_failed", + "failed" ] } } }, + "response": { + "required": [], + "properties": {} + }, "errors": [ - "On failure, one of the following errors will be returned:", + "The following errors may be reported:", "", - "- 400: Unable to connect, no address known for peer", - "- 401: If some addresses are known but connecting to all of them failed, the message will contain details about the failures", - "- 402: If the peer disconnected while we were connecting", - "- -32602: If the given parameters are wrong" + "- 1401: The forward specified does not exist." ], "example_json_request": [ { - "id": "example:connect#1", - "method": "connect", + "id": "example:delforward#1", + "method": "delforward", "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "host": "localhost", - "port": 44619 + "in_channel": "103x1x0", + "in_htlc_id": 2, + "status": "local_failed" } }, { - "id": "example:connect#2", - "method": "connect", - "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "host": "127.0.0.1", - "port": 42839 - } + "id": "example:delforward#2", + "method": "delforward", + "params": [ + "103x1x0", + 1, + "failed" + ] } ], "example_json_response": [ - { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "features": "08a0000a0a69a2", - "direction": "out", - "address": { - "type": "ipv4", - "address": "127.0.0.1", - "port": 44619 - } - }, - { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "features": "08a0000a8a5961", - "direction": "out", - "address": { - "type": "ipv4", - "address": "127.0.0.1", - "port": 42839 - } - } + {}, + {} ], "author": [ - "Rusty Russell <> is mainly responsible. Felix <> is the original author of this manpage." + "Rusty Russell <> is mainly responsible." ], "see_also": [ - "lightning-fundchannel(7)", - "lightning-listpeers(7)", - "lightning-listchannels(7)", - "lightning-disconnect(7)" + "lightning-autoclean(7)" ], "resources": [ "Main web site: " ] }, - "lightning-createinvoice.json": { + "lightning-delinvoice.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "createinvoice", - "title": "Low-level invoice creation", + "rpc": "delinvoice", + "title": "Command for removing an invoice (or just its description)", "description": [ - "The **createinvoice** RPC command signs and saves an invoice into the database." + "The **delinvoice** RPC command removes an invoice with *status* as given in **listinvoices**, or with *desconly* set, removes its description." ], "request": { "required": [ - "invstring", "label", - "preimage" + "status" ], "properties": { - "invstring": { - "type": "string", - "description": [ - "The bolt11 form, but the final signature is ignored. Minimal sanity checks are done. (Note: if **experimental-offers** is enabled, *invstring* can actually be an unsigned bolt12 invoice)." - ] - }, "label": { "oneOf": [ { "type": "string" }, { - "type": "integer" + "type": "u64" } ], "description": [ - "A unique string or number (which is treated as a string, so `01` is different from `1`); it is never revealed to other nodes on the lightning network, but it can be used to query the status of this invoice." + "Label of the invoice to be deleted." ] }, - "preimage": { - "type": "hex", + "status": { + "type": "string", "description": [ - "The preimage to supply upon successful payment of the invoice." + "Label of the invoice to be deleted. The caller should be particularly aware of the error case caused by the *status* changing just before this command is invoked!" + ], + "enum": [ + "paid", + "expired", + "unpaid" + ] + }, + "desconly": { + "type": "boolean", + "description": [ + "If set to True, the invoice is not deleted, but has its description removed (this can save space with very large descriptions, as would be used with lightning-invoice(7) *deschashonly*." ] } } @@ -11291,64 +8115,46 @@ "response": { "required": [ "label", - "created_index", "payment_hash", "status", - "description", + "created_index", "expires_at" ], "properties": { "label": { "type": "string", "description": [ - "The label for the invoice." + "Unique label given at creation time." ] }, "bolt11": { "type": "string", "description": [ - "The bolt11 string (always present unless **bolt12** is)." + "BOLT11 string." ] }, "bolt12": { "type": "string", "description": [ - "The bolt12 string instead of **bolt11** (**experimental-offers** only)." - ] - }, - "payment_hash": { - "type": "hash", - "description": [ - "The hash of the *payment_preimage* which will prove payment." + "BOLT12 string." ] }, "amount_msat": { "type": "msat", "description": [ - "The amount of the invoice (if it has one)." - ] - }, - "status": { - "type": "string", - "enum": [ - "paid", - "expired", - "unpaid" - ], - "description": [ - "Whether it has been paid, or can no longer be paid." + "The amount required to pay this invoice." ] }, "description": { "type": "string", "description": [ - "Description extracted from **bolt11** or **bolt12**." + "Description used in the invoice." ] }, - "expires_at": { - "type": "u64", + "payment_hash": { + "type": "hash", "description": [ - "UNIX timestamp of when invoice expires (or expired)." + "The hash of the *payment_preimage* which will prove payment." ] }, "created_index": { @@ -11358,9634 +8164,6220 @@ "1-based index indicating order this invoice was created in." ] }, - "pay_index": { + "updated_index": { "type": "u64", + "added": "v23.08", "description": [ - "Incrementing id for when this was paid (**status** *paid* only)." + "1-based index indicating order this invoice was changed (only present if it has changed since creation)." ] }, - "amount_received_msat": { - "type": "msat", + "status": { + "type": "string", "description": [ - "Amount actually received (**status** *paid* only)." + "State of invoice." + ], + "enum": [ + "paid", + "expired", + "unpaid" ] }, - "paid_at": { + "expires_at": { "type": "u64", "description": [ - "UNIX timestamp of when invoice was paid (**status** *paid* only)." + "UNIX timestamp when invoice expires (or expired)." ] - }, - "paid_outpoint": { - "type": "object", - "description": [ - "Outpoint this invoice was paid with (**status** *paid* only)." - ], - "added": "v23.11", - "additionalProperties": false, - "required": [ - "txid", - "outnum" - ], - "properties": { - "txid": { - "added": "v23.11", - "type": "txid", - "description": [ - "ID of the transaction that paid the invoice (**status** *paid* only)." - ] - }, - "outnum": { - "added": "v23.11", - "type": "u32", - "description": [ - "The 0-based output number of the transaction that paid the invoice (**status** *paid* only)." - ] + } + }, + "allOf": [ + { + "if": { + "required": [ + "bolt12" + ] + }, + "then": { + "required": [], + "additionalProperties": false, + "properties": { + "label": {}, + "bolt12": {}, + "status": {}, + "expires_at": {}, + "msatoshi": {}, + "amount_msat": {}, + "description": {}, + "payment_hash": {}, + "pay_index": {}, + "created_index": {}, + "updated_index": {}, + "amount_received_msat": {}, + "paid_at": {}, + "payment_preimage": {}, + "local_offer_id": { + "type": "hex", + "description": [ + "Offer for which this invoice was created." + ] + }, + "invreq_payer_note": { + "type": "string", + "description": [ + "The optional *invreq_payer_note* from invoice_request which created this invoice." + ] + } + } + }, + "else": { + "required": [ + "bolt11" + ], + "additionalProperties": false, + "properties": { + "label": {}, + "bolt11": {}, + "status": {}, + "expires_at": {}, + "msatoshi": {}, + "amount_msat": {}, + "description": {}, + "payment_hash": {}, + "pay_index": {}, + "created_index": {}, + "updated_index": {}, + "amount_received_msat": {}, + "msatoshi_received": {}, + "paid_at": {}, + "payment_preimage": {} } } }, - "payment_preimage": { - "type": "secret", - "description": [ - "The proof of payment: SHA256 of this **payment_hash**." - ] - }, - "local_offer_id": { - "type": "hex", - "description": [ - "The *id* of our offer which created this invoice (**experimental-offers** only)." - ], - "maxLength": 64, - "minLength": 64 - }, - "invreq_payer_note": { - "type": "string", - "description": [ - "The optional *invreq_payer_note* from invoice_request which created this invoice (**experimental-offers** only)." - ] - } - }, - "pre_return_value_notes": [ - "(Note: the return format is the same as lightning-listinvoices(7))." - ] - }, - "errors": [ - "On failure, an error is returned and no invoice is created. If the lightning process fails before responding, the caller should use lightning-listinvoices(7) to query whether this invoice was created or not.", - "", - "The following error codes may occur:", - "", - "- -1: Catchall nonspecific error.", - "- 900: An invoice with the given *label* already exists." - ], - "author": [ - "Rusty Russell <> is mainly responsible." - ], - "see_also": [ - "lightning-invoice(7)", - "lightning-listinvoices(7)", - "lightning-delinvoice(7)", - "lightning-getroute(7)", - "lightning-sendpay(7)", - "lightning-offer(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-createonion.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "createonion", - "title": "Low-level command to create a custom onion", - "description": [ - "The **createonion** RPC command allows the caller to create a custom onion with custom payloads at each hop in the route. A custom onion can be used to implement protocol extensions that are not supported by Core Lightning directly." - ], - "request": { - "required": [ - "hops", - "assocdata" - ], - "properties": { - "hops": { - "type": "array", - "description": [ - "A JSON list of dicts, each specifying a node and the payload destined for that node." - ], - "items": { - "type": "object", + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "paid" + ] + } + } + }, + "then": { "additionalProperties": false, "required": [ - "pubkey", - "payload" + "pay_index", + "amount_received_msat", + "paid_at", + "payment_preimage" ], "properties": { - "pubkey": { - "type": "pubkey", + "label": {}, + "bolt11": {}, + "bolt12": {}, + "status": {}, + "expires_at": {}, + "msatoshi": {}, + "amount_msat": {}, + "description": {}, + "payment_hash": {}, + "invreq_payer_note": {}, + "local_offer_id": {}, + "created_index": {}, + "updated_index": {}, + "pay_index": { + "type": "u64", "description": [ - "Node pubkey." + "Unique index for this invoice payment." ] }, - "payload": { - "type": "hex", + "amount_received_msat": { + "type": "msat", "description": [ - "Payload to be sent to the node." + "How much was actually received." + ] + }, + "paid_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when payment was received." + ] + }, + "payment_preimage": { + "type": "secret", + "description": [ + "SHA256 of this is the *payment_hash* offered in the invoice." ] } } + }, + "else": { + "additionalProperties": false, + "properties": { + "label": {}, + "bolt11": {}, + "bolt12": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "description": {}, + "payment_hash": {}, + "expires_at": {}, + "created_index": {}, + "updated_index": {}, + "pay_index": {}, + "invreq_payer_note": {}, + "local_offer_id": {} + } } - }, - "assocdata": { - "type": "hex", - "description": [ - "The associated data that the onion should commit to. If the onion is to be used to send a payment later it MUST match the `payment_hash` of the payment in order to be valid." - ] - }, - "session_key": { - "type": "secret", - "description": [ - "Can be used to specify a secret that is used to generate the shared secrets used to encrypt the onion for each hop. It should only be used for testing or if a specific shared secret is important. If not specified it will be securely generated internally, and the shared secrets will be returned." - ] - }, - "onion_size": { - "type": "u16", - "description": [ - "A size different from the default payment onion (1300 bytes). May be used for custom protocols like trampoline routing." - ] } - } - }, - "response": { - "required": [ - "onion", - "shared_secrets" ], - "properties": { - "onion": { - "type": "hex", - "description": [ - "The onion packet (*onion_size* bytes)." - ] - }, - "shared_secrets": { - "type": "array", - "description": [ - "One shared secret for each node in the *hops* parameter." - ], - "items": { - "type": "secret", - "description": [ - "The shared secret with this hop." - ] - } - } - } + "pre_return_value_notes": [ + "Note: The return is the same as an object from lightning-listinvoice(7)." + ] }, - "example_usage": [ - "The following is an example of a 3 hop onion:", - "", - "```json", - "[", - " {", - " \"pubkey\": \"022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59\",", - " \"payload\": \"11020203e904017b06080000670000010001\"", - " }, {", - " \"pubkey\": \"035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d\",", - " \"payload\": \"11020203e804017506080000670000030001\"", - " }, {", - " \"pubkey\": \"0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199\",", - " \"payload\": \"07020203e8040175\"", - " }", - "]", - "```", - "", - "The *hops* parameter is very similar to the result from `getroute` however it needs to be modified slightly. The following is the `getroute` response from which the above *hops* parameter was generated:", - "", - "```json", - "[", - " {", - " \"id\": \"022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59\",", - " \"channel\": \"103x2x1\",", - " \"direction\": 1,", - " \"msatoshi\": 1002,", - " \"amount_msat\": \"1002msat\",", - " \"delay\": 21,", - " }, {", - " \"id\": \"035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d\",", - " \"channel\": \"103x1x1\",", - " \"direction\": 0,", - " \"msatoshi\": 1001,", - " \"amount_msat\": \"1001msat\",", - " \"delay\": 15,", - " }, {", - " \"id\": \"0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199\",", - " \"channel\": \"103x3x1\",", - " \"direction\": 0,", - " \"msatoshi\": 1000,", - " \"amount_msat\": \"1000msat\",", - " \"delay\": 9,", - " }", - "]", - "```", - "", - " - Notice that the payload in the *hops* parameter is the hex-encoded TLV of the parameters in the `getroute` response, with length prepended as a `bigsize_t`.", - " - Except for the pubkey, the values are shifted left by one, i.e., the 1st payload in `createonion` corresponds to the 2nd set of values from `getroute`.", - " - The final payload is a copy of the last payload sans `channel`", - "", - "These rules are directly derived from the onion construction. Please refer BOLT 04 for details and rationale.", - "", - "The following example is the result of calling *createonion* with the above hops parameter:", - "", - " ```json", - " {", - " \"onion\": \"0003f3f80d2142b953319336d2fe4097[...]6af33fcf4fb113bce01f56dd62248a9e5fcbbfba35c\",", - " \"shared_secrets\": [", - " \"88ce98c73e4d9293ab1797b0a913fe9bca0213a566252047d01b8af6da871f3e\",", - " \"4474d296810e57bd460ef8b83d2e7d288321f8a99ff7686f87384699747bcfc4\",", - " \"2a862e4123e01799a732be487fbce297f7dc7cc1467e410f18369cfee476adc2\"", - " ]", - " }", - "```", + "errors": [ + "The following errors may be reported:", "", - "The `onion` corresponds to 1366 hex-encoded bytes. Each shared secret consists of 32 hex-encoded bytes. Both arguments can be passed on to **sendonion**." + "- -1: Database error.", + "- 905: An invoice with that label does not exist.", + "- 906: The invoice *status* does not match the parameter. An error object will be returned as error *data*, containing *current_status* and *expected_status* fields. This is most likely due to the *status* of the invoice changing just before this command is invoked.", + "- 908: The invoice already has no description, and *desconly* was set." ], "example_json_request": [ { - "id": "example:createonion#1", - "method": "createonion", + "id": "example:delinvoice#1", + "method": "delinvoice", "params": { - "hops": [ - { - "pubkey": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "payload": "e4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - }, - { - "pubkey": "0324653eac434488002cc06bbfb7f10fe18991e35f9fe4302dbea6d2353dc0ab1c", - "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - }, - { - "pubkey": "027f31ebc5462c1fdce1b737ecff52d37d75dea43ce11c74d25aa297165faa2007", - "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - }, - { - "pubkey": "032c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991", - "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - }, - { - "pubkey": "02edabbd16b41c8371b92ef2f04c1185b4f03b6dcd52ba9b78d9d7c89c8f221145", - "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - } - ], - "assocdata": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", - "onion_size": 1301 + "label": "invlabel2", + "status": "unpaid", + "desconly": true } }, { - "id": "example:createonion#2", - "method": "createonion", + "id": "example:delinvoice#2", + "method": "delinvoice", "params": { - "hops": [ - { - "pubkey": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "payload": "0cfdb000084869207468657265" - } - ], - "assocdata": "36bf44cc8d80498b95eb05e36ae5811206d3a1d8b5c8d59bbcad035d386a4de8" + "label": "keysend-1708640419.666098582", + "status": "paid", + "desconly": null } } ], "example_json_response": [ { - "onion": "00034c3f9e11d92555260db3ee4ba0378a645d01c2556451f4289a1d9b43c7afa9a4f9ecc7010dafb26787bb583c514c3b3990d40c8168b1046659d7bc2512d2f1ee0afd2b87c42de2b70102b649634d211b38049593dbb6ed8ee8f93f0b9ff23cd9654c1341137711ce67751d40867cc90c290a9446be2b8a5a43641d4549505b13e807b4240b5b82ffaf22cb534cff01be46db3985ac83b7db465fbd86d4c8d472f60678946c71eca97dd5db732fe5a6d3765e5a5afad72f035207173e7eaaa0da4f0a4540472c7dd269a030428ae586a61b2a70a428055c3848427d2a2e8bd521aadbaf79d56ea39df63c059772e026d57f0b6844c1ab99e936beadf42aaa78193b05f7380e242258deeaa90db316a943d311ef4f2a08f422422c9da454f9666742ad61c6ae003bce83cf6243adf64a728ea50bdaf129ab2ac70e1988a117609cbefc01c884f86b2494349d1067f5cf17760cdab6ae076631693147e8712412d4f0b17cf288b394fd9e29419156ee629966553c2e7598631cbf7493820388eef1ae9f4d2f9da88872e8afbbedb3b46cd7c461cbe4c5491dc6f4a68bc244584bc79b1bb227c869fae16dab4b16412523c984d3ed2b872f63b95a62f66563d2b03c3d1b5fff0290411b293569ce8435b96b447be776b49395a8d94f48cb2f7699a38e8de58d6fff04075d226dcac07668512b6d2c20d4c49d03ad300a52769e4ebbacf97378633126958df1817effc12fd679723123df244fd9b5421f8a2aedb9a8b6fb4049e3a7cae3985059081239bea38351f0c90ed5a0ff45cc492e6ab353e4c13d22ff48912d6ecfda711edfb88dc0767ecfc5dddf8fb0e112a538aeee55c0f73b3b8afc4f40ef3588eabde5b95344a4525adf67841dd67b1db10da180fb346e0bd2958f095d011827063c42361964f8ac2c356d2ec1868a9498dcd6b5915a4df4601c58fcbeb688e14de61300f13183c154b3320cc8e80042a46f22d796f56ff1fdd7e28440c05f14b960c1d0a7c627b09295112bcb635b0e2447a9374fafc4a23ceaf9de4d10b29b2f6cabd7f0c7706cf0404452681d7372d559b644627b2695960deb3b4ae57028e0164b29d5ef9e701d3122b6a5715c502e1dca5252e8c215ed754b01a193041ad9751ed2fff1b55991e256edd6099a38004a367ad097c7caf953da302201263715517f6d32cff57969be994df42fd6cadb649e3c738be798f779aaf4c07cada6bf1e4115b74e2670baf4b1592c70b10a6c043b6606b428b3f79545dc8e9783c876e5402909858f9c604963c37fbc477137c8908e6cfa11ece18c8784a6f25428a5ee1e91d0095fe310d6a91139a7c5c6624bbfcaa15ee847a25b06f57332917f68526a6317f575792e9bcba8576a96bc5859b1f2a00fd8ab08a5ac4ab71833b0b711d1f120cbdb374bcedcdcbeba3806644f5082ec737a945221f5d99562fcbb02a43beeafb16ceecd4e35f06a04c9ff9f4f33725ab62cf22c36650280e4cfb9e150a2c4ebee7785108522e8ecb4682d2d751168e7597299346c3a5e885e36eda66b9a1112997111135767972d771b02c1a36c1d1fb1ce539ecfb98e9e1d8f8fdbf89aec28ad34ff5c00c1a4a8c59848dc8b64c0e65f6f10122e60b4adc1cfc602f49d6cfbdd54be6b0951d3f9cafe8cdd0428f9ce6994844e92d8b72d44edda623bad428b398f88643c3904bda16dd15e886ca4ef6ea7f1450744ac38ffce902569d2e9026bcedd6d0ee54aceabda22bf2de72cba89e6c274064619e32a1192cf2d78b56cf497f7785a6d599de9f8383d1f66f47fc385dc569ee1f08ddbbc7f1aeb0a0126fc4020d948dda10255f11e776db7a037059a40fde38a2ee0c0ce49c7f3df175881bf12371fa72fec3fba657107892a97efe41dcc18aeecd99f3e46c33cf42c2a0ba8b75cf000", - "shared_secrets": [ - "ccf2512684e2508cb4a842393757e6040b7d25e29d3a2031f29d00a000af6128", - "d4cec39fe6287d41165bf5c608b0c720a411208a83c64c805a012c86662a2e5a", - "91bc712ebd4a900e05830394ca8b1f1168777ecdd6996029d96ec8838b9903b9", - "93c373dcb14dc36ababa3e0c5c55869a667ca175e09913a98c3be67e6af97e16", - "b2642a5770a6b61ade071fdf69d3ea365cf48434fc2a2c399512778821a33e5c" - ] + "label": "invlabel2", + "bolt11": "lnbcrt420p1pja0tefsp5vvzg40t4g24l0eqk0jch7mc6jm3ec52ts8w8gwzpwtx9c8nv05rspp533e9csxurt7j9sn2cx7hsn6m00475qgrau8sux5r7djpdedwy2fshp5xqsmrtgfcwsnhxcxmf3tuc65kl6fxvqhvujfmxw2kpeh95yy2x8sxqyjw5qcqp99qxpqysgqgfjrz4q5zcq2lluxxg9h475mq2d3w0tpdstm5274zmhadjl8cqapylfskzk96apka5599a2flm90rmavsk7q8mhh87yle3sgh5vrlycq72fern", + "payment_hash": "8c725c40dc1afd22c26ac1bd784f5b7bebea0103ef0f0e1a83f36416e5ae2293", + "amount_msat": 42, + "status": "unpaid", + "expires_at": 1709238697, + "created_index": 3 }, { - "onion": "0002cdce4bfaa9faa2c060afafe001b80bde07fc670e882c063a80b4738d5f78c9351825c6461cdfcd4fe4144d3b51f63da6351b28dd49c7bfdb0b4f7d8bda4ad0d99699eda39e551084c0a095746c358d1dc6d2eec8082f2aa2f69ae8f61b1f1437ae0ed673078fec6c0510a34058167ad1a34e819a3813d4cf27b2c4917a8c6ca3d70c3381a2a41b4c1b4540adf0e922e25f57d1cfc3064f29cfec4c17244160121975cab59b44c83b4a4905bf7ebfbd308de376334bf86d8aa92c674f7bcfec85680d73e9fee72642c98c603128e358c86e0bc88a60aaebc2637441a57261c61c6be145f00f2fc56164a6495f4b52d3172cb0ef52e91fa0d32a9ae2502d17433bda58d93fbc24a70ec6b5e740952a61404c7370eafe52599c7ee52e77b1cda87c46da98d2ff0d02fe09db5adcb2d2e9bcd083ef58392907b8a21681fa4ea1e4806b4676656457fea000fa504f9b4d159fe8b241266ac91dcc0351053c6dcc1493a6b02bed652cc8b92a8470c98924ebfde6ddc5cf7fd75f6e83a7350642053b70d4834179c30eb56d8c86656cda784daf3b6cd125779bec51099301e3f79f78d85d0454aef8bf5f9058491881b73e99b662b64080cd3eb16fd7f9d9640c18738736cfc15f391232b7df92f46ceb5abf08732ff833e9409ee541d7c926f7a0fe3e233d3eee4a63b65ab23b7c835b7cdd809ddfac8abb1df471fa66a54092815aa41e6fc1a026b86c5675d39c4e8c5c4b4acd48534165239f5634b9e828a7f9df94efcd2a39045efdee4d2f006a63ae828e6e90e3610c522085da6e0198141d6e501d83aba32057f4e59f9b7dfb0bf949c5ef91917cb54561d45a9e7ead049c57deb62d14ba6e18f5d7b0fb9f15e97bf5bd9f909f99c86c787357946654b87c489d34245d07fbb72119166e338b608a4178b452695235dd96bf7fd338e29a9f054ec1a63a442e12602d2329834297f6a197d8a377d608f402f0bcc936f45f33c8d2f9d40e5aef41816dd883add81ca20f1e0631457fe00aa2bd75c9165ffcd96c100c1db83a53aeee23d59f2a542ee3ba39ba62298ddfbd9ecfafd6b5d2121eb003ee23a2ebb8c6b6b687f42492c962510c5acf5231ff96635eba37354559ba39b042d9b6883cac662f418d7c62f9908b2a67964af5e5471804f7684e0d582b8bfec99816bb3442cca1d1fe4efd75d573ebf09fa9cad811063864fb14be4a7768ec2ddb118a77969e986c6584c4b20f8622941ca73d73562857d36e17a46a68d6e10147aaefff1ffb9809f0652a5f760148ed33550661b63c8176d5679e701c221d8a49d4062eb04010ea74cc1132fbeb8934c6e582ba2a16162b7e9171f95bce4ec3e339e70c781f95aaca406cd718b74397658fdefdd093486664be7ed13efa437012f1f57f9f1f4fb4eef7501ccf0e0ac4edc01fde138038c4dd65cb5c3291ad02a6728d6761b1afa35d49bd6ef117012bdd9bd6ee8a175620feb2249aa18d6175351b4bfc2b2b4fd57ff52f5969b109aa9b6cb2cde8f350917c0da2da1bc3d52eb0c7e6080b8f69c5783f2ed26feceb05ba4e7ed66676041d03d0acd3dd6343a85ac0b9c36f9640ddd0db884822f98dc42ea7911a6938dc14ba19d3d25a2b2f82794a2b5dd751dc856d7a9ccdb2d351a0b84e7030fa925ac949a37594f3aa2ba28ae5155b0aaac9c6820b8888d0b8a9db148513b9e3dbde68333ac30a0720289b6a0145d88629d49e76a6d3538330c5aececc9d54127b0a5a0e92d5a5a73beb71132c208b589cab61d53ed357c907929198c559426ae729b374a803dd3321a45ccca39efd39eddaba6e79a2f8911bdf74e18733dc7efc51132b5608d97fd2d0f22fa8961de04cdf6d0dbfbab21e362e7abaef3976f993088aa97ed3f1f4bcf3fffb012f583558bd2f15face9cba20b3e6754b70", - "shared_secrets": [ - "3f53c03f98eb83db88ff97c2c4004051ce23265ed2414a7aebf7a3e7078839ab" - ] + "label": "keysend-1708640419.666098582", + "bolt11": "lnbcrt1pja0j9rsp5tg3zvj846gcdzw394njazq40s946sq2ur3hkl4xu4xudtjdtckxspp5fuunrfzsnyz2uxjmg2n95mqhghv4fpvv2kud3kvq4fkys3vmzu5sdqvddjhjum9dejqxqyjw5qcqp99qxpqysgqwt7r0gjlgt7zrfldc3um9myfc36acpqnsdn77c2m42facjtps30yufc5nsmwzhgexlj59f6xa5hess6e3tqrxynt9fejzj3rrshddtcqnappmj", + "payment_hash": "4f3931a4509904ae1a5b42a65a6c1745d954858c55b8d8d980aa6c48459b1729", + "status": "paid", + "pay_index": 1, + "amount_received_msat": 10000000, + "paid_at": 1708640419, + "payment_preimage": "b760af47f456a217e8dfda21a282f1f78c903487c1b21b3b318135f75aa3bf11", + "description": "keysend", + "expires_at": 1709245219, + "created_index": 1, + "updated_index": 1 } ], "author": [ - "Christian Decker <> is mainly responsible." + "Rusty Russell <> is mainly responsible." ], "see_also": [ - "lightning-sendonion(7)", - "lightning-getroute(7)" + "lightning-listinvoice(7)", + "lightning-waitinvoice(7)", + "lightning-invoice(7)", + "lightning-delexpiredinvoice(7)", + "lightning-autoclean-status(7)" ], "resources": [ - "Main web site: ", - "", - "[BOLT 04](https://github.com/lightning/bolts/blob/master/04-onion-routing.md)" + "Main web site: " ] }, - "lightning-createrune.json": { + "lightning-delpay.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "added": "v23.08", - "rpc": "createrune", - "title": "Command to Create/Update Rune for Authorizing Remote Peer Access", + "rpc": "delpay", + "title": "Command for removing a completed or failed payment", "description": [ - "The **createrune** RPC command creates a base64 string called a *rune* which can be used to access commands on this node. Each *rune* contains a unique id (a number starting at 0), and can have restrictions inside it. Nobody can remove restrictions from a rune: if you try, the rune will be rejected. There is no limit on how many runes you can issue; the node simply decodes and checks them as they are received.", - "", - "Oh, I almost forgot. Runes can also be invoked like in ancient times with the **invokerune** command. Feel the magical powers of a rune by invoking it." + "The **delpay** RPC command deletes a payment with the given `payment_hash` if its status is either `complete` or `failed`. If *partid* and *groupid* are not specified, all payment parts with matchin status are deleted." ], "request": { - "required": [], + "required": [ + "payment_hash", + "status" + ], "properties": { - "rune": { - "type": "string", + "payment_hash": { + "type": "hash", "description": [ - "If supplied, the restrictions are simple appended to that *rune* (it doesn't need to be a rune belonging to this node). If not supplied, a new *rune* is constructed, with a new unique id." + "The unique identifier of a payment." ] }, - "restrictions": { + "status": { + "type": "string", "description": [ - "It can be the string `readonly`, or an array of restrictions.", - "Each restriction is an array of one or more alternatives, such as \"method is listpeers\", or \"method is listpeers OR time is before 2023\"." + "Expected status of the payment. Only deletes if the payment status matches. Deleting a `pending` payment will return an error." ], - "oneOf": [ - { - "type": "array", - "description": [ - "Alternatives use a simple language to examine the command which is being run:", - " * time: the current UNIX time, e.g. \"time<1656759180\".", - " * id: the node_id of the peer, e.g. \"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\".", - " * method: the command being run, e.g. \"method=withdraw\".", - " * per: how often the rune can be used, with suffix \"sec\" (default), \"min\", \"hour\", \"day\" or \"msec\", \"usec\" or \"nsec\". e.g. \"per=5sec\".", - " * rate: the rate limit, per minute, e.g. \"rate=60\" is equivalent to \"per=1sec\".", - " * pnum: the number of parameters. e.g. \"pnum<2\".", - " * pnameX: the parameter named X (with any punctuation like `_` removed). e.g. \"pnamedestination=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T\".", - " * parrN: the N'th parameter. e.g. \"parr0=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T\"." - ], - "items": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "type": "string", - "enum": [ - "readonly" - ], - "description": [ - "A rune which allows most *get* and *list* commands, and the *summary* command." - ] - } - ] - } - } - }, - "response": { - "required": [ - "rune", - "unique_id" - ], - "properties": { - "rune": { - "type": "string", - "description": [ - "The resulting rune." + "enum": [ + "complete", + "failed" ] }, - "unique_id": { - "type": "string", + "partid": { + "type": "u64", "description": [ - "The id of this rune: this is set at creation and cannot be changed (even as restrictions are added)." + "Specific partid to delete (must be paired with *groupid*)." ] }, - "warning_unrestricted_rune": { - "type": "string", + "groupid": { + "type": "u64", "description": [ - "A warning shown when runes are created with powers that could drain your node." + "Specific groupid to delete (must be paired with *partid*)." ] } - } + }, + "pairedWith": [ + [ + "partid", + "groupid" + ] + ] }, - "restriction_format": [ - "Restrictions are one or more alternatives. Each alternative is *name* *operator* *value*. The valid names are shown above.", - "", - "Note that if a value contains `\\`, it must be preceeded by another `\\` to form valid JSON:", - "* `=`: passes if equal ie. identical. e.g. `method=withdraw`", - "* `/`: not equals, e.g. `method/withdraw`", - "* `^`: starts with, e.g. `id^024b9a1fa8e006f1e3937f`", - "* `$`: ends with, e.g. `id$381df1cc449605`.", - "* `~`: contains, e.g. `id~006f1e3937f65f66c40`.", - "* `<`: is a decimal integer, and is less than. e.g. `time<1656759180`", - "* `>`: is a decimal integer, and is greater than. e.g. `time>1656759180`", - "* `{`: preceeds in alphabetical order (or matches but is shorter),", - " e.g. `id{02ff`.", - "* `}`: follows in alphabetical order (or matches but is longer),", - " e.g. `id}02ff`.", - "* `#`: a comment, ignored, e.g. `dumb example#`.", - "* `!`: only passes if the *name* does *not* exist. e.g. `pnamedestination!`.", - "Every other operator except `#` fails if *name* does not exist!" - ], - "example_usage": [ - "This creates a fresh rune which can do anything:", - "", - "```shell", - "$ lightning-cli commando-rune", - "{", - " \"rune\": \"KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA==\",", - " \"unique_id\": \"0\"", - "}", - "```", - "We can add restrictions to that rune, like so:", - "", - "```shell", - "$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions=readonly", - "{", - " \"rune\": \"NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl\",", - " \"unique_id\": \"0\"", - "}", - "```", - "The \"readonly\" restriction is a short-cut for two restrictions:", - "", - "1. `[\"method^list\", \"method^get\", \"method=summary\"]`: You may call list, get or summary.", - "2. `[\"method/listdatastore\"]`: But not listdatastore: that contains sensitive stuff!", - "", - "We can do the same manually, like so:", - "", - "```shell", - "$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions='[[\"method^list\", \"method^get\", \"method=summary\"],[\"method/listdatastore\"]]'", - "{", - " \"rune\": \"NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl\",", - " \"unique_id\": \"0\"", - "}", - "```", - "Let's create a rune which lets a specific peer (024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605) run \"listpeers\" on themselves:", - "", - "```shell", - "$ lightning-cli commando-rune restrictions='[[\"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"],[\"method=listpeers\"],[\"pnum=1\"],[\"pnameid=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\",\"parr0=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"]]'", - "{", - " \"rune\": \"FE8GHiGVvxcFqCQcClVRRiNE_XEeLYQzyG2jmqto4jM9MiZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDV8cGFycjA9MDI0YjlhMWZhOGUwMDZmMWUzOTM3ZjY1ZjY2YzQwOGU2ZGE4ZTFjYTcyOGVhNDMyMjJhNzM4MWRmMWNjNDQ5NjA1\",", - " \"unique_id\": \"2\"", - "}", - "```", - "This allows `listpeers` with 1 argument (`pnum=1`), which is either by name (`pnameid`), or position (`parr0`). We could shorten this in several ways: either allowing only positional or named parameters, or by testing the start of the parameters only. Here's an example which only checks the first 9 bytes of the `listpeers` parameter:", - "", - "```shell", - "$ lightning-cli commando-rune restrictions='[[\"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"],[\"method=listpeers\"],[\"pnum=1\"],[\"pnameid^024b9a1fa8e006f1e393\", \"parr0^024b9a1fa8e006f1e393\"]'", - " {", - " \"rune\": \"fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw==\",", - " \"unique_id\": \"3\"", - "}", - "```", - "Before we give this to our peer, let's add two more restrictions: that it only be usable for 24 hours from now (`time<`), and that it can only be used twice a minute (`rate=2`). `date +%s` can give us the current time in seconds:", - "", - "```shell", - "$ lightning-cli commando-rune rune=fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw== restrictions='[[\"time<'$(($(date +%s) + 24*60*60))'\",\"rate=2\"]]'", - "{", - " \"rune\": \"tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y\",", - " \"unique_id\": \"3\"", - "}", - "```", - "You can also use lightning-decode(7) to examine runes you have been given:", - "", - "```shell", - "$ lightning-cli decode tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y", - "{", - " \"type\": \"rune\",", - " \"unique_id\": \"3\",", - " \"string\": \"b54f912e33220e9636534a375b5a05a306abdfa4451a95a5a0f6d6f7e46e65da:=3&id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605&method=listpeers&pnum=1&pnameid^024b9a1fa8e006f1e393|parr0^024b9a1fa8e006f1e393&time<1656920538&rate=2\",", - " \"restrictions\": [", - " {", - " \"alternatives\": [", - " \"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"", - " ],", - " \"summary\": \"id (of commanding peer) equal to '024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605'\"", - " },", - " {", - " \"alternatives\": [", - " \"method=listpeers\"", - " ],", - " \"summary\": \"method (of command) equal to 'listpeers'\"", - " },", - " {", - " \"alternatives\": [", - " \"pnum=1\"", - " ],", - " \"summary\": \"pnum (number of command parameters) equal to 1\"", - " },", - " {", - " \"alternatives\": [", - " \"pnameid^024b9a1fa8e006f1e393\",", - " \"parr0^024b9a1fa8e006f1e393\"", - " ],", - " \"summary\": \"pnameid (object parameter 'id') starts with '024b9a1fa8e006f1e393' OR parr0 (array parameter #0) starts with '024b9a1fa8e006f1e393'\"", - " },", - " {", - " \"alternatives\": [", - " \"time<1656920538\"", - " ],", - " \"summary\": \"time (in seconds since 1970) less than 1656920538 (approximately 19 hours 18 minutes from now)\"", - " },", - " {", - " \"alternatives\": [", - " \"rate=2\"", - " ],", - " \"summary\": \"rate (max per minute) equal to 2\"", - " }", - " ],", - " \"valid\": true", - "}", - "```" - ], - "sharing_runes": [ - "Because anyone can add a restriction to a rune, you can always turn a normal rune into a read-only rune, or restrict access for 30 minutes from the time you give it to someone. Adding restrictions before sharing runes is best practice.", - "", - "If a rune has a ratelimit, any derived rune will have the same id, and thus will compete for that ratelimit. You might want to consider adding a tighter ratelimit to a rune before sharing it, so you will keep the remainder. For example, if you rune has a limit of 60 times per minute, adding a limit of 5 times per minute and handing that rune out means you can still use your original rune 55 times per minute." - ], - "example_json_request": [ - { - "id": "example:createrune#1", - "method": "createrune", - "params": { - "restrictions": [ - [ - "method/getinfo" - ] - ] + "response": { + "required": [ + "payments" + ], + "properties": { + "payments": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "created_index", + "id", + "payment_hash", + "status", + "amount_sent_msat", + "created_at" + ], + "properties": { + "created_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was created in." + ] + }, + "id": { + "type": "u64", + "description": [ + "Old synonym for created_index." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "pending", + "failed", + "complete" + ], + "description": [ + "Status of the payment." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "The amount we actually sent, including fees." + ] + }, + "partid": { + "type": "u64", + "description": [ + "Unique ID within this (multi-part) payment." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment if known." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount the destination received, if known." + ] + }, + "created_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "updated_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was changed (only present if it has changed since creation)." + ] + }, + "completed_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was completed." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." + ] + }, + "payment_preimage": { + "type": "secret", + "description": [ + "Proof of payment." + ] + }, + "label": { + "type": "string", + "description": [ + "The label, if given to sendpay." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string (if pay supplied one)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string (if supplied for pay: **experimental-offers** only)." + ] + }, + "erroronion": { + "type": "hex", + "description": [ + "The error onion returned on failure, if any." + ] + } + } + } } }, + "pre_return_value_notes": [ + "The returned format is the same as lightning-listsendpays(7). If the payment is a multi-part payment (MPP) the command return a list of payments will be returned -- one payment object for each partid." + ] + }, + "example_json_request": [ { - "id": "example:createrune#2", - "method": "createrune", + "id": "example:delpay#1", + "method": "delpay", "params": { - "restrictions": "readonly" + "payment_hash": "4fa2f1b001067ec06d7f95b8695b8acd9ef04c1b4d1110e3b94e1fa0687bb1e0", + "status": "complete" } }, { - "id": "example:createrune#3", - "method": "createrune", + "id": "example:delpay#2", + "method": "delpay", "params": [ - "enX0sTpHB8y1ktyTAF80CnEvGetG340Ne3AGItudBS49NCZwbnVtPTA=", - [ - [ - "rate=3" - ] - ] + "c9d4547473d0d646f1fdd8ca7f01803e4d31ceab01df33c79456f9c24b04034e", + "failed" ] + }, + { + "id": "example:delpay#3", + "method": "delpay", + "params": { + "payment_hash": "bbc35e0a46d1483292a4ff8d4daaceaab8c3c084dd835be4128785b52e469c64", + "status": "complete", + "groupid": 1, + "partid": 1 + } } ], "example_json_response": [ { - "rune": "S5f-BKt3rR-cvJmujdpDCUQm_XLahfB4iQuDlwqMJiQ9MCZtZXRob2QvZ2V0aW5mbw==", - "unique_id": "0" + "payments": [ + { + "id": 1, + "payment_hash": "8dfd6538eeb33811c9114a75f792a143728d7f05643f38c3d574d3097e8910c0", + "destination": "0219f8900ee78a89f050c24d8b69492954f9fdbabed753710845eb75d3a75a5880", + "msatoshi": 1000, + "amount_msat": "1000msat", + "msatoshi_sent": 1000, + "amount_sent_msat": "1000msat", + "created_at": 1596224858, + "status": "complete", + "payment_preimage": "35bd4e2b481a1a84a22215b5372672cf81460a671816960ddb206464359e1822", + "bolt11": "lntb10n1p0jga20pp53h7k2w8wkvuprjg3ff6l0y4pgdeg6lc9vsln3s74wnfsjl5fzrqqdqdw3jhxazldahx2xqyjw5qcqp2sp5wut5jnhr6n7jd5747ky2g5flmw7hgx9yjnqzu60ps2jf6f7tc0us9qy9qsqu2a0k37nckl62005p69xavlkydkvhnypk4dphffy4x09zltwh9437ad7xkl83tefdarzhu5t30ju5s56wlrg97qkx404pq3srfc425cq3ke9af" + } + ] }, { - "rune": "oVkzoiQ67VCU1h_aRjPqCeWktGX54ARDsqqQgDL-uMs9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", - "unique_id": "1" + "payments": [ + { + "created_index": 2, + "id": 2, + "payment_hash": "c9d4547473d0d646f1fdd8ca7f01803e4d31ceab01df33c79456f9c24b04034e", + "groupid": 1, + "updated_index": 2, + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount_msat": 100000, + "amount_sent_msat": 100002, + "created_at": 1706316468, + "completed_at": 1706316471, + "status": "failed", + "bolt11": "lnbcrt1u1pjmg54nsp5ke626txv6wwwmqmpuy63t3jnu9hqxwj880zsfkkj7jjqagdaz2sqpp5e829garn6rtydu0amr987qvq8exnrn4tq80n83u52muuyjcyqd8qdq8v3jhxccxqyjw5qcqp99qxpqysgqalktfwy9svsamvvvrzzzzpdaa4rh7n6s5p7t9lx7qv0raz4vnm9knkh5ury3u5cmnhx2gms98nxkclm3833uhjrlnzmftc685vz2f0gpfnjy4y" + } + ] }, { - "rune": "_h2eKjoK7ITAF-JQ1S5oum9oMQesrz-t1FR9kDChRB49NCZwbnVtPTAmcmF0ZT0z", - "unique_id": "2" + "payments": [ + { + "created_index": 3, + "id": 3, + "payment_hash": "bbc35e0a46d1483292a4ff8d4daaceaab8c3c084dd835be4128785b52e469c64", + "groupid": 1, + "updated_index": 3, + "partid": 1, + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount_msat": 100000, + "amount_sent_msat": 102100, + "created_at": 1708641193, + "completed_at": 1708641194, + "status": "complete", + "payment_preimage": "a6ebb1cfbf69e76200f196f1eafd28a3d850633499c223a7eb7a7dba3b995286" + } + ] } ], - "author": [ - "Rusty Russell <> wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page.", + "errors": [ + "On failure, an error is returned. If the lightning process fails before responding, the", + "caller should use lightning-listsentpays(7) or lightning-listpays(7) to query whether this payment was deleted or not.", "", - "Shahana Farooqui <> is mainly responsible for migrating commando-rune to createrune." + "The following error codes may occur:", + "", + "- -32602: Parameter missed or malformed;", + "- 211: Payment status mismatch. Check the correct status via **paystatus**;", + "- 208: Payment with payment_hash not found." + ], + "author": [ + "Vincenzo Palazzo <> is mainly responsible." ], "see_also": [ - "lightning-commando-rune(7)", - "lightning-checkrune(7)" + "lightning-listpays(7)", + "lightning-listsendpays(7)", + "lightning-paystatus(7)" ], "resources": [ "Main web site: " ] }, - "lightning-datastore.json": { + "lightning-deprecations.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "datastore", - "title": "Command for storing (plugin) data", + "added": "v24.02", + "rpc": "deprecations", + "title": "Command to enable/disable deprecated APIs", "description": [ - "The **datastore** RPC command allows plugins to store data in the Core Lightning database, for later retrieval." + "The **deprecations** RPC command is used to override global config option `allow-deprecated-apis` for further RPC commands on this same connection. This can be useful for developer testing to ensure you don't accidentally rely on deprecated features." ], "request": { "required": [ - "key" + "enable" ], "properties": { - "key": { - "description": [ - "A key can either have children or a value, never both: parents are created and removed automatically." - ], - "oneOf": [ - { - "type": "array", - "description": [ - "An array of values to form a hierarchy (though a single value is treated as a one-element array). Using the first element of the key as the plugin name (e.g. `[ 'summary' ]`) is recommended." - ], - "items": { - "type": "string" - } - }, - { - "type": "string" - } - ] - }, - "string": { - "type": "string", - "description": [ - "Data to be saved in string format." - ] - }, - "hex": { - "type": "hex", - "description": [ - "Data to be saved in hex format." - ] - }, - "mode": { - "type": "string", - "description": [ - "Write mode to determine how the record is updated:", - " * `must-create`: fails if it already exists.", - " * `must-replace`: fails if it doesn't already exist.", - " * `create-or-replace`: never fails.", - " * `must-append`: must already exist, append this to what's already there.", - " * `create-or-append`: append if anything is there, otherwise create." - ], - "enum": [ - "must-create", - "must-replace", - "create-or-replace", - "must-append", - "create-or-append" - ], - "default": "`must-create`" - }, - "generation": { - "type": "u64", + "enable": { + "type": "boolean", "description": [ - "If specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with *mode* `must-replace` or `must-append`." + "Flag to enable or disable deprecated APIs. Setting it to `false` will neither accept deprecated parameters or commands, nor output deprecated fields." ] } } }, "response": { - "required": [ - "key" - ], - "properties": { - "key": { - "type": "array", - "items": { - "type": "string", - "description": [ - "Part of the key added to the datastore." - ] - } - }, - "generation": { - "type": "u64", - "description": [ - "The number of times this has been updated." - ] - }, - "hex": { - "type": "hex", - "description": [ - "The hex data which has been added to the datastore." - ] - }, - "string": { - "type": "string", - "description": [ - "The data as a string, if it's valid utf-8." - ] + "properties": {} + }, + "example_json_request": [ + { + "id": "example:deprecations#1", + "method": "deprecations", + "params": { + "enable": false } } - }, + ], + "example_json_response": [ + {} + ], "errors": [ - "The following error codes may occur:", + "On failure, one of the following error codes may be returned:", "", - "- 1202: The key already exists (and mode said it must not)", - "- 1203: The key does not exist (and mode said it must)", - "- 1204: The generation was wrong (and generation was specified)", - "- 1205: The key has children already.", - "- 1206: One of the parents already exists with a value.", - "- -32602: invalid parameters" + "- -32602: Error in given parameters." ], - "example_json_request": [ - { - "id": "example:datastore#1", - "method": "datastore", - "params": { - "key": [ - "test_libplugin", - "name" + "author": [ + "Rusty Russell <> wrote the initial version of this man page." + ], + "see_also": [ + "lightningd-config(5)", + "lightning-notifications(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-disableinvoicerequest.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v22.11", + "rpc": "disableinvoicerequest", + "title": "Command for removing an invoice request", + "warning": "experimental-offers only", + "description": [ + "The **disableinvoicerequest** RPC command disables an invoice_request, so that no further invoices will be accepted (and thus, no further payments made)..", + "", + "We currently don't support deletion of invoice_requests, so they are not forgotten entirely (there may be payments which refer to this invoice_request)." + ], + "request": { + "required": [ + "invreq_id" + ], + "properties": { + "invreq_id": { + "type": "string", + "description": [ + "A specific invoice can be disabled by providing the `invreq_id`, which is presented by lightning-invoicerequest(7)." + ] + } + } + }, + "response": { + "required": [ + "invreq_id", + "single_use", + "active", + "bolt12", + "used" + ], + "properties": { + "invreq_id": { + "type": "hash", + "description": [ + "The SHA256 hash of all invoice_request fields less than 160." + ] + }, + "active": { + "type": "boolean", + "enum": [ + false ], - "string": "foobar", - "hex": null, - "mode": "must-replace", - "generation": null + "description": [ + "Whether the invoice_request is currently active." + ] + }, + "single_use": { + "type": "boolean", + "description": [ + "Whether the invoice_request will become inactive after we pay an invoice for it." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string starting with lnr." + ] + }, + "used": { + "type": "boolean", + "description": [ + "Whether the invoice_request has already been used." + ] + }, + "label": { + "type": "string", + "description": [ + "The label provided when creating the invoice_request." + ] } }, - { - "id": "example:datastore#2", - "method": "datastore", - "params": { - "key": "somekey", - "string": null, - "hex": "61", - "mode": "create-or-append", - "generation": null + "pre_return_value_notes": [ + "Note: the returned object is the same format as **listinvoicerequest**." + ] + }, + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-invoicerequest(7)", + "lightning-listinvoicerequest(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-disableoffer.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "disableoffer", + "title": "Command for removing an offer", + "warning": "experimental-offers only", + "description": [ + "The **disableoffer** RPC command disables an offer, so that no further invoices will be given out.", + "", + "We currently don't support deletion of offers, so offers are not forgotten entirely (there may be invoices which refer to this offer)." + ], + "request": { + "required": [ + "offer_id" + ], + "properties": { + "offer_id": { + "type": "hash", + "description": [ + "The id we use to identify this offer." + ] + } + } + }, + "response": { + "required": [ + "offer_id", + "active", + "single_use", + "bolt12", + "used" + ], + "properties": { + "offer_id": { + "type": "hash", + "description": [ + "The merkle hash of the offer." + ] + }, + "active": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "Whether the offer can produce invoices/payments." + ] + }, + "single_use": { + "type": "boolean", + "description": [ + "Whether the offer is disabled after first successful use." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string representing this offer." + ] + }, + "used": { + "type": "boolean", + "description": [ + "Whether the offer has had an invoice paid / payment made." + ] + }, + "label": { + "type": "string", + "description": [ + "The label provided when offer was created." + ] } }, + "pre_return_value_notes": [ + "Note: the returned object is the same format as **listoffers**." + ] + }, + "example_json_request": [ { - "id": "example:datastore#3", - "method": "datastore", + "id": "example:disableoffer#1", + "method": "disableoffer", "params": { - "key": [ - "a", - "d", - "e", - "f", - "g" - ], - "string": "somedatatostoreinthedatastore", - "hex": null, - "mode": null, - "generation": null + "offer_id": "713a16ccd4eb10438bdcfbc2c8276be301020dd9d489c530773ba64f3b33307d" } } ], "example_json_response": [ { - "key": [ - "test_libplugin", - "name" - ], - "generation": 1, - "hex": "666f6f626172", - "string": "foobar" - }, - { - "key": [ - "somekey" - ], - "generation": 3, - "hex": "736f6d6564617461", - "string": "somedata" - }, - { - "key": [ - "a", - "d", - "e", - "f", - "g" - ], - "generation": 0, - "hex": "736f6d6564617461746f73746f7265696e7468656461746173746f7265", - "string": "somedatatostoreinthedatastore" + "offer_id": "053a5c566fbea2681a5ff9c05a913da23e45b95d09ef5bd25d7d408f23da7084", + "active": false, + "single_use": false, + "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqvqcdgq2z9pk7enxv4jjqen0wgs8yatnw3ujz83qkc6rvp4j28rt3dtrn32zkvdy7efhnlrpr5rp5geqxs783wtlj550qs8czzku4nk3pqp6m593qxgunzuqcwkmgqkmp6ty0wyvjcqdguv3pnpukedwn6cr87m89t74h3auyaeg89xkvgzpac70z3m9rn5xzu28c", + "used": false } ], "author": [ "Rusty Russell <> is mainly responsible." ], "see_also": [ - "lightning-listdatastore(7)", - "lightning-deldatastore(7)", - "lightning-datastoreusage(7)" + "lightning-offer(7)", + "lightning-listoffers(7)" ], "resources": [ "Main web site: " ] }, - "lightning-datastoreusage.json": { + "lightning-disconnect.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "added": "v23.11", - "rpc": "datastoreusage", - "title": "Command for listing datastore usage info", + "rpc": "disconnect", + "title": "Command for disconnecting from another lightning node", "description": [ - "The **datastoreusage** RPC command allows the caller to fetch the total bytes that are stored under a certain *key* (or from the root), including the size of the *key*.", - "", - "All descendants of the *key* (or root) are taken into account." + "The disconnect RPC command closes an existing connection to a peer, identified by *id*, in the Lightning Network, as long as it doesn't have an active channel." ], "request": { - "required": [], + "required": [ + "id" + ], "properties": { - "key": { - "oneOf": [ - { - "type": "array", - "description": [ - "Key is an array of values (though a single value is treated as a one-element array). Used as the starting point to traverse the datastore." - ], - "items": { - "type": "string" - } - }, - { - "type": "string" - } + "id": { + "type": "pubkey", + "description": [ + "The public key of the peer to terminate the connection. It can be discovered in the output of the listpeers command, which returns a set of peers:", + "{", + " 'peers':", + " [", + " {", + " 'id': '0563aea81...',", + " 'connected': true,", + " ...", + " }", + " ]", + "}" + ] + }, + "force": { + "type": "boolean", + "description": [ + "If set to True, it will disconnect even with an active channel." ] } } }, "response": { - "required": [ - "datastoreusage" - ], - "properties": { - "datastoreusage": { - "type": "object", - "additionalProperties": false, - "required": [ - "key", - "total_bytes" - ], - "properties": { - "key": { - "type": "string", - "added": "v23.11", - "description": [ - "The key from which the database was traversed." - ] - }, - "total_bytes": { - "type": "u64", - "added": "v23.11", - "description": [ - "The total bytes that are stored under the *key*, including the all descendants data and the size of the keys themselves." - ] - } - } - } - } + "properties": {} }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error." + ], "example_json_request": [ { - "id": "example:datastoreusage#1", - "method": "datastoreusage", - "params": { - "key": null - } - }, - { - "id": "example:datastoreusage#2", - "method": "datastoreusage", + "id": "example:disconnect#1", + "method": "disconnect", "params": { - "key": "a" + "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "force": false } }, { - "id": "example:datastoreusage#3", - "method": "datastoreusage", + "id": "example:disconnect#2", + "method": "disconnect", "params": { - "key": [ - "a", - "thisissomelongkeythattriestostore46bytesofdata" - ] + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "force": true } } ], "example_json_response": [ - { - "datastoreusage": { - "key": "[]", - "total_bytes": 0 + {}, + {} + ], + "author": [ + "Michael Hawkins <>." + ], + "see_also": [ + "lightning-connect(1)", + "lightning-listpeers(1)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-emergencyrecover.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "emergencyrecover", + "title": "Command for recovering channels from the emergency.recovery file in the lightning directory", + "description": [ + "The **emergencyrecover** RPC command fetches data from the emergency.recover file and tries to reconnect to the peer and force him to close the channel. The data in this file has enough information to reconnect and sweep the funds.", + "", + "This recovery method is not spontaneous and it depends on the peer, so it should be used as a last resort to recover the funds stored in a channel in case of severe data loss." + ], + "request": { + "required": [], + "properties": {} + }, + "response": { + "required": [ + "stubs" + ], + "properties": { + "stubs": { + "type": "array", + "items": { + "type": "hash", + "description": [ + "Channel IDs of channels successfully inserted." + ] + } } + } + }, + "example_json_request": [ + { + "id": "example:emergencyrecover#1", + "method": "emergencyrecover", + "params": "{}" }, { - "datastoreusage": { - "key": "[a]", - "total_bytes": 32 - } + "id": "example:emergencyrecover#2", + "method": "emergencyrecover", + "params": "{}" + } + ], + "example_json_response": [ + { + "stubs": [] }, { - "datastoreusage": { - "key": "[a,thisissomelongkeythattriestostore46bytesofdata]", - "total_bytes": 77 - } + "stubs": [ + "c00734472f344fdadd0bf787de182e5cf144ccda5d731b0f7c75befd1f1eff52" + ] } ], "author": [ - "Peter Neuroth <> is mainly responsible." + "Aditya <> is mainly responsible." ], "see_also": [ - "lightning-datastore(7)", - "lightning-deldatastore(7)", - "lightning-listdatastore(7)" + "lightning-getsharedsecret(7)" ], "resources": [ "Main web site: " ] }, - "lightning-decode.json": { + "lightning-feerates.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "added": "v23.05", - "rpc": "decode", - "title": "Command for decoding an invoice string (low-level)", + "rpc": "feerates", + "title": "Command for querying recommended onchain feerates", "description": [ - "The **decode** RPC command checks and parses `bolt11`, `bolt12`, `rune` or `emergency_recover`. It may decode other formats in future." + "The **feerates** command returns the feerates that CLN will use. The feerates will be based on the recommended feerates from the backend. The backend may fail to provide estimates, but if it was able to provide estimates in the past, CLN will continue to use those for a while. CLN will also smoothen feerate estimations from the backend.", + "", + "Explorers often present fees in \"sat/vB\": 4 sat/vB is `4000perkb` or `1000perkw`.", + "", + "Bitcoin transactions have non-witness and witness bytes:", + "", + "* Non-witness bytes count as 4 weight, 1 virtual byte. All bytes other than SegWit witness count as non-witness bytes. * Witness bytes count as 1 weight, 0.25 virtual bytes.", + "", + "Thus, all *perkb* feerates will be exactly 4 times *perkw* feerates.", + "", + "To compute the fee for a transaction, multiply its weight or virtual bytes by the appropriate *perkw* or *perkw* feerate returned by this command, then divide by 1000.", + "", + "There is currently no way to change these feerates from the RPC. If you need custom control over onchain feerates, you will need to provide your own plugin that replaces the `bcli` plugin backend. For commands like lightning-withdraw(7) or lightning-fundchannel(7) you can provide a preferred feerate directly as a parameter, which will override the recommended feerates returned by **feerates**." ], "request": { "required": [ - "string" + "style" ], "properties": { - "string": { + "style": { "type": "string", "description": [ - "Value to be decoded:", - " * a *bolt11* or *bolt12* string (optionally prefixed by `lightning:` or `LIGHTNING:`) as specified by the BOLT 11 and BOLT 12 specifications.", - " * a *rune* as created by lightning-commando-rune(7).", - " * an *emergency_recover* string generated by hsmtool like `lightning-hsmtool getemergencyrecover `. It holds `emergency.recover` contents and starts with `clnemerg1`." + "Fee rate style to use. This can be:", + " *perkw* - provide feerate in units of satoshis per 1000 weight (e.g. the minimum fee is usually `253perkw`).", + " *perkb* - provide feerate in units of satoshis per 1000 virtual bytes (eg. the minimum fee is usually `1000perkb`)." + ], + "enum": [ + "perkb", + "perkw" ] } } }, "response": { - "required": [ - "type", - "valid" - ], + "required": [], "properties": { - "type": { + "warning_missing_feerates": { "type": "string", - "enum": [ - "bolt12 offer", - "bolt12 invoice", - "bolt12 invoice_request", - "bolt11 invoice", - "rune", - "emergency recover" - ], "description": [ - "What kind of object it decoded to." + "Some fee estimates are missing." ] }, - "valid": { - "type": "boolean", + "perkb": { + "type": "object", "description": [ - "If this is false, you *MUST* not use the result except for diagnostics!" - ] - } - }, - "allOf": [ - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 offer" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "required": [ - "offer_id", - "offer_node_id", - "offer_description" - ], - "additionalProperties": false, - "properties": { - "type": {}, - "valid": {}, - "offer_id": { - "type": "hex", - "description": [ - "The id we use to identify this offer." - ], - "maxLength": 64, - "minLength": 64 - }, - "offer_chains": { - "type": "array", - "description": [ - "Which blockchains this offer is for (missing implies bitcoin mainnet only)." - ], - "items": { - "type": "hash", - "description": [ - "The genesis blockhash." - ] - } - }, - "offer_metadata": { - "type": "hex", - "description": [ - "Any metadata the creator of the offer includes." - ] - }, - "offer_currency": { - "type": "string", - "description": [ - "ISO 4217 code of the currency (missing implies Bitcoin)." - ], - "maxLength": 3, - "minLength": 3 - }, - "warning_unknown_offer_currency": { - "type": "string", - "description": [ - "The currency code is unknown (so no `currency_minor_unit`)." - ] - }, - "currency_minor_unit": { - "type": "u32", - "description": [ - "The number of decimal places to apply to amount (if currency known)." - ] - }, - "offer_amount": { - "type": "u64", - "description": [ - "The amount in the `offer_currency` adjusted by `currency_minor_unit`, if any." - ] - }, - "offer_amount_msat": { - "type": "msat", - "description": [ - "The amount in bitcoin (if specified, and no `offer_currency`)." - ] - }, - "offer_description": { - "type": "string", - "description": [ - "The description of the purpose of the offer." - ] - }, - "offer_issuer": { - "type": "string", - "description": [ - "The description of the creator of the offer." - ] - }, - "offer_features": { - "type": "hex", - "description": [ - "The feature bits of the offer." - ] - }, - "offer_absolute_expiry": { - "type": "u64", - "description": [ - "UNIX timestamp of when this offer expires." - ] - }, - "offer_quantity_max": { - "type": "u64", - "description": [ - "The maximum quantity (or, if 0, means any quantity)." - ] - }, - "offer_paths": { - "type": "array", - "description": [ - "Paths to the destination." - ], - "items": { - "type": "object", - "required": [ - "first_node_id", - "blinding", - "path" - ], - "additionalProperties": false, - "properties": { - "first_node_id": { - "type": "pubkey", - "description": [ - "The (presumably well-known) public key of the start of the path." - ] - }, - "blinding": { - "type": "pubkey", - "description": [ - "Blinding factor for this path." - ] - }, - "path": { - "type": "array", - "description": [ - "An individual path." - ], - "items": { - "type": "object", - "required": [ - "blinded_node_id", - "encrypted_recipient_data" - ], - "additionalProperties": false, - "properties": { - "blinded_node_id": { - "type": "pubkey", - "description": [ - "Node_id of the hop." - ] - }, - "encrypted_recipient_data": { - "type": "hex", - "description": [ - "Encrypted TLV entry for this hop." - ] - } - } - } - } - } - } - }, - "offer_node_id": { - "type": "pubkey", - "description": [ - "Public key of the offering node." - ] - }, - "offer_recurrence": { + "If *style* parameter was perkb." + ], + "additionalProperties": false, + "required": [ + "min_acceptable", + "max_acceptable", + "floor", + "estimates" + ], + "properties": { + "min_acceptable": { + "type": "u32", + "description": [ + "The smallest feerate that we allow peers to specify: half the 100-block estimate." + ] + }, + "max_acceptable": { + "type": "u32", + "description": [ + "The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet)." + ] + }, + "floor": { + "type": "u32", + "added": "v23.05", + "description": [ + "The smallest feerate that our backend tells us it will accept (i.e. minrelayfee or mempoolminfee)." + ] + }, + "estimates": { + "type": "array", + "added": "v23.05", + "description": [ + "Feerate estimates from plugin which we are using (usuallly bcli)." + ], + "items": { "type": "object", - "description": [ - "How often to this offer should be used." - ], + "additionalProperties": false, "required": [ - "period", - "time_unit" + "blockcount", + "feerate", + "smoothed_feerate" ], - "additionalProperties": false, "properties": { - "time_unit": { + "blockcount": { "type": "u32", + "added": "v23.05", "description": [ - "The BOLT12 time unit." + "The number of blocks the feerate is expected to get a transaction in." ] }, - "time_unit_name": { - "type": "string", + "feerate": { + "type": "u32", + "added": "v23.05", "description": [ - "The name of `time_unit` (if valid)." + "The feerate for this estimate, in given *style*." ] }, - "period": { + "smoothed_feerate": { "type": "u32", + "added": "v23.05", "description": [ - "How many `time_unit` per payment period." + "The feerate, smoothed over time (useful for coordinating with other nodes)." ] - }, - "basetime": { - "type": "u64", + } + } + } + }, + "opening": { + "type": "u32", + "description": [ + "Default feerate for lightning-fundchannel(7) and lightning-withdraw(7)." + ] + }, + "mutual_close": { + "type": "u32", + "description": [ + "Feerate to aim for in cooperative shutdown. Note that since mutual close is a **negotiation**, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer." + ] + }, + "unilateral_close": { + "type": "u32", + "description": [ + "Feerate for commitment_transaction in a live channel which we originally funded." + ] + }, + "unilateral_anchor_close": { + "type": "u32", + "added": "v23.08", + "description": [ + "Feerate for commitment_transaction in a live channel which we originally funded (if anchor_outputs was negotiated)." + ] + }, + "delayed_to_us": { + "type": "u32", + "deprecated": [ + "v23.05", + "v24.05" + ], + "description": [ + "Feerate for returning unilateral close funds to our wallet." + ] + }, + "htlc_resolution": { + "type": "u32", + "deprecated": [ + "v23.05", + "v24.05" + ], + "description": [ + "Feerate for returning unilateral close HTLC outputs to our wallet." + ] + }, + "penalty": { + "type": "u32", + "description": [ + "Feerate to use when creating penalty tx for watchtowers." + ] + } + } + }, + "perkw": { + "type": "object", + "description": [ + "If *style* parameter was perkw." + ], + "additionalProperties": false, + "required": [ + "min_acceptable", + "max_acceptable", + "floor", + "estimates" + ], + "properties": { + "min_acceptable": { + "type": "u32", + "description": [ + "The smallest feerate that you can use, usually the minimum relayed feerate of the backend." + ] + }, + "max_acceptable": { + "type": "u32", + "description": [ + "The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet)." + ] + }, + "floor": { + "type": "u32", + "added": "v23.05", + "description": [ + "The smallest feerate that our backend tells us it will accept (i.e. minrelayfee or mempoolminfee)." + ] + }, + "estimates": { + "type": "array", + "added": "v23.05", + "description": [ + "Feerate estimates from plugin which we are using (usuallly bcli)." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "blockcount", + "feerate", + "smoothed_feerate" + ], + "properties": { + "blockcount": { + "type": "u32", + "added": "v23.05", "description": [ - "Period starts at this UNIX timestamp." + "The number of blocks the feerate is expected to get a transaction in." ] }, - "start_any_period": { - "type": "u64", + "feerate": { + "type": "u32", + "added": "v23.05", "description": [ - "You can start at any period (only if `basetime` present)." + "The feerate for this estimate, in given *style*." ] }, - "limit": { + "smoothed_feerate": { "type": "u32", + "added": "v23.05", "description": [ - "Maximum period number for recurrence." + "The feerate, smoothed over time (useful for coordinating with other nodes)." ] - }, - "paywindow": { - "type": "object", - "description": [ - "When within a period will payment be accepted." - ], - "default": "prior and during the period", - "required": [ - "seconds_before", - "seconds_after" - ], - "additionalProperties": false, - "properties": { - "seconds_before": { - "type": "u32", - "description": [ - "Seconds prior to period start." - ] - }, - "seconds_after": { - "type": "u32", - "description": [ - "Seconds after to period start." - ] - }, - "proportional_amount": { - "type": "boolean", - "enum": [ - true - ], - "description": [ - "Amount should be scaled if paid after period start." - ] - } - } - } - } - }, - "unknown_offer_tlvs": { - "type": "array", - "description": [ - "Any extra fields we didn't know how to parse." - ], - "items": { - "type": "object", - "required": [ - "type", - "length", - "value" - ], - "additionalProperties": false, - "properties": { - "type": { - "type": "u64", - "description": [ - "The type." - ] - }, - "length": { - "type": "u64", - "description": [ - "The length." - ] - }, - "value": { - "type": "hex", - "description": [ - "The value." - ] - } } } } + }, + "opening": { + "type": "u32", + "description": [ + "Default feerate for lightning-fundchannel(7) and lightning-withdraw(7)." + ] + }, + "mutual_close": { + "type": "u32", + "description": [ + "Feerate to aim for in cooperative shutdown. Note that since mutual close is a **negotiation**, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer." + ] + }, + "unilateral_close": { + "type": "u32", + "description": [ + "Feerate for commitment_transaction in a live channel which we originally funded (if anchor_outputs was not negotiated)." + ] + }, + "unilateral_anchor_close": { + "type": "u32", + "added": "v23.08", + "description": [ + "Feerate for commitment_transaction in a live channel which we originally funded (if anchor_outputs was negotiated)." + ] + }, + "delayed_to_us": { + "type": "u32", + "deprecated": [ + "v23.05", + "v24.05" + ], + "description": [ + "Feerate for returning unilateral close funds to our wallet." + ] + }, + "htlc_resolution": { + "type": "u32", + "deprecated": [ + "v23.05", + "v24.05" + ], + "description": [ + "Feerate for returning unilateral close HTLC outputs to our wallet." + ] + }, + "penalty": { + "type": "u32", + "description": [ + "Feerate to use when creating penalty tx for watchtowers." + ] } } }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 offer" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - false - ] - } - } - }, - "then": { - "required": [], - "additionalProperties": false, - "properties": { - "type": {}, - "valid": {}, - "offer_id": {}, - "node_id": {}, - "signature": {}, - "chains": {}, - "currency": {}, - "minor_unit": {}, - "warning_unknown_offer_currency": {}, - "amount": {}, - "amount_msat": {}, - "send_invoice": {}, - "description": {}, - "vendor": {}, - "features": {}, - "absolute_expiry": {}, - "paths": {}, - "quantity_max": {}, - "unknown_offer_tlvs": {}, - "recurrence": {}, - "warning_missing_offer_node_id": { - "type": "string", - "description": [ - "`offer_node_id` is not present." - ] - }, - "warning_invalid_offer_description": { - "type": "string", - "description": [ - "`offer_description` is not valid UTF8." - ] - }, - "warning_missing_offer_description": { - "type": "string", - "description": [ - "`offer_description` is not present." - ] - }, - "warning_invalid_offer_currency": { - "type": "string", - "description": [ - "`offer_currency_code` is not valid UTF8." - ] - }, - "warning_invalid_offer_issuer": { - "type": "string", - "description": [ - "`offer_issuer` is not valid UTF8." - ] - } + "onchain_fee_estimates": { + "type": "object", + "additionalProperties": false, + "required": [ + "opening_channel_satoshis", + "mutual_close_satoshis", + "unilateral_close_satoshis", + "htlc_timeout_satoshis", + "htlc_success_satoshis" + ], + "properties": { + "opening_channel_satoshis": { + "type": "u64", + "description": [ + "Estimated cost of typical channel open." + ] + }, + "mutual_close_satoshis": { + "type": "u64", + "description": [ + "Estimated cost of typical channel close." + ] + }, + "unilateral_close_satoshis": { + "type": "u64", + "description": [ + "Estimated cost of typical unilateral close (without HTLCs). If anchors are supported, this assumes a channel with anchors." + ] + }, + "unilateral_close_nonanchor_satoshis": { + "added": "v23.08", + "type": "u64", + "description": [ + "Estimated cost of non-anchor typical unilateral close (without HTLCs)." + ] + }, + "htlc_timeout_satoshis": { + "type": "u64", + "description": [ + "Estimated cost of typical HTLC timeout transaction (non-anchors)." + ] + }, + "htlc_success_satoshis": { + "type": "u64", + "description": [ + "Estimated cost of typical HTLC fulfillment transaction (non-anchors)." + ] } } + } + } + }, + "errors": [ + "The **feerates** command will never error, however some fields may be missing in the result if feerate estimates for that kind of transaction are unavailable." + ], + "notes": [ + "Many other commands have a *feerate* parameter. This can be:", + "", + "* One of the strings to use lightningd's internal estimates:", + " * *urgent* (next 6 blocks or so)", + " * *normal* (next 12 blocks or so)", + " * *slow* (next 100 blocks or so)", + " * *minimum* for the lowest value bitcoind will currently accept (added in v23.05)", + "", + "* A number, with an optional suffix:", + " * *blocks* means aim for confirmation in that many blocks (added in v23.05)", + " * *perkw* means the number is interpreted as satoshi-per-kilosipa (weight)", + " * *perkb* means it is interpreted bitcoind-style as satoshi-per-kilobyte. ", + "", + "Omitting the suffix is equivalent to *perkb*." + ], + "trivia": [ + "In C-lightning we like to call the weight unit \"sipa\" in honor of Pieter Wuille, who uses the name \"sipa\" on IRC and elsewhere. Internally we call the *perkw* style as \"feerate per kilosipa\"." + ], + "example_json_request": [ + { + "id": "example:feerates#1", + "method": "feerates", + "params": { + "style": "perkw", + "urgent": null, + "normal": null, + "slow": null + } + }, + { + "id": "example:feerates#2", + "method": "feerates", + "params": { + "style": "perkb", + "urgent": null, + "normal": null, + "slow": null + } + } + ], + "example_json_response": [ + { + "perkw": { + "opening": 1000000, + "mutual_close": 26362, + "unilateral_close": 26362, + "unilateral_anchor_close": 1000000, + "penalty": 26362, + "min_acceptable": 3750, + "max_acceptable": 10000000, + "floor": 253, + "estimates": [ + { + "blockcount": 2, + "feerate": 1000000, + "smoothed_feerate": 26362 + }, + { + "blockcount": 6, + "feerate": 1000000, + "smoothed_feerate": 26362 + }, + { + "blockcount": 12, + "feerate": 1000000, + "smoothed_feerate": 26362 + }, + { + "blockcount": 100, + "feerate": 1000000, + "smoothed_feerate": 26362 + } + ] }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 invoice_request" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - true - ] - } + "onchain_fee_estimates": { + "opening_channel_satoshis": 702000, + "mutual_close_satoshis": 17741, + "unilateral_close_satoshis": 1112000, + "unilateral_close_nonanchor_satoshis": 15764, + "htlc_timeout_satoshis": 17478, + "htlc_success_satoshis": 18532 + } + }, + { + "perkb": { + "opening": 25000, + "mutual_close": 25000, + "unilateral_close": 44000, + "unilateral_anchor_close": 25000, + "penalty": 25000, + "min_acceptable": 12500, + "max_acceptable": 600000, + "floor": 1012, + "estimates": [ + { + "blockcount": 2, + "feerate": 60000, + "smoothed_feerate": 60000 + }, + { + "blockcount": 6, + "feerate": 44000, + "smoothed_feerate": 44000 + }, + { + "blockcount": 12, + "feerate": 25000, + "smoothed_feerate": 25000 } - }, - "then": { - "required": [ - "offer_node_id", - "offer_description", - "invreq_metadata", - "invreq_payer_id", - "signature" - ], - "additionalProperties": false, - "properties": { - "type": {}, - "valid": {}, - "offer_id": { - "type": "hex", - "description": [ - "The id we use to identify this offer." - ], - "maxLength": 64, - "minLength": 64 - }, - "offer_chains": { - "type": "array", - "description": [ - "Which blockchains this offer is for (missing implies bitcoin mainnet only)." - ], - "items": { - "type": "hex", - "description": [ - "The genesis blockhash." - ], - "maxLength": 64, - "minLength": 64 - } - }, - "offer_metadata": { - "type": "hex", - "description": [ - "Any metadata the creator of the offer includes." - ] - }, - "offer_currency": { - "type": "string", - "description": [ - "ISO 4217 code of the currency (missing implies Bitcoin)." - ], - "maxLength": 3, - "minLength": 3 - }, - "warning_unknown_offer_currency": { - "type": "string", - "description": [ - "The currency code is unknown (so no `currency_minor_unit`)." - ] - }, - "currency_minor_unit": { - "type": "u32", - "description": [ - "The number of decimal places to apply to amount (if currency known)." - ] - }, - "offer_amount": { - "type": "u64", - "description": [ - "The amount in the `offer_currency` adjusted by `currency_minor_unit`, if any." - ] - }, - "offer_amount_msat": { - "type": "msat", - "description": [ - "The amount in bitcoin (if specified, and no `offer_currency`)." - ] - }, - "offer_description": { - "type": "string", - "description": [ - "The description of the purpose of the offer." - ] - }, - "offer_issuer": { - "type": "string", - "description": [ - "The description of the creator of the offer." - ] - }, - "offer_features": { - "type": "hex", - "description": [ - "The feature bits of the offer." - ] - }, - "offer_absolute_expiry": { - "type": "u64", - "description": [ - "UNIX timestamp of when this offer expires." - ] - }, - "offer_quantity_max": { - "type": "u64", - "description": [ - "The maximum quantity (or, if 0, means any quantity)." - ] - }, - "offer_paths": { - "type": "array", - "description": [ - "Paths to the destination." - ], - "items": { - "type": "object", - "required": [ - "first_node_id", - "blinding", - "path" - ], - "additionalProperties": false, - "properties": { - "first_node_id": { - "type": "pubkey", - "description": [ - "The (presumably well-known) public key of the start of the path." - ] - }, - "blinding": { - "type": "pubkey", - "description": [ - "Blinding factor for this path." - ] - }, - "path": { - "type": "array", - "description": [ - "An individual path." - ], - "items": { - "type": "object", - "required": [ - "blinded_node_id", - "encrypted_recipient_data" - ], - "additionalProperties": false, - "properties": { - "blinded_node_id": { - "type": "pubkey", - "description": [ - "Node_id of the hop." - ] - }, - "encrypted_recipient_data": { - "type": "hex", - "description": [ - "Encrypted TLV entry for this hop." - ] - } - } - } - } - } - } - }, - "offer_node_id": { - "type": "pubkey", - "description": [ - "Public key of the offering node." - ] - }, - "offer_recurrence": { - "type": "object", - "description": [ - "How often to this offer should be used." - ], - "required": [ - "period", - "time_unit" - ], - "additionalProperties": false, - "properties": { - "time_unit": { - "type": "u32", - "description": [ - "The BOLT12 time unit." - ] - }, - "time_unit_name": { - "type": "string", - "description": [ - "The name of `time_unit` (if valid)." - ] - }, - "period": { - "type": "u32", - "description": [ - "How many `time_unit` per payment period." - ] - }, - "basetime": { - "type": "u64", - "description": [ - "Period starts at this UNIX timestamp." - ] - }, - "start_any_period": { - "type": "u64", - "description": [ - "You can start at any period (only if `basetime` present)." - ] - }, - "limit": { - "type": "u32", - "description": [ - "Maximum period number for recurrence." - ] - }, - "paywindow": { - "type": "object", - "description": [ - "When within a period will payment be accepted." - ], - "default": "prior and during the period", - "required": [ - "seconds_before", - "seconds_after" - ], - "additionalProperties": false, - "properties": { - "seconds_before": { - "type": "u32", - "description": [ - "Seconds prior to period start." - ] - }, - "seconds_after": { - "type": "u32", - "description": [ - "Seconds after to period start." - ] - }, - "proportional_amount": { - "type": "boolean", - "enum": [ - true - ], - "description": [ - "Amount should be scaled if paid after period start." - ] - } - } - } - } - }, - "invreq_metadata": { - "type": "hex", - "description": [ - "The payer-provided blob to derive invreq_payer_id." - ] - }, - "invreq_payer_id": { - "type": "hex", - "description": [ - "The payer-provided key." - ] - }, - "invreq_chain": { - "type": "hex", - "description": [ - "Which blockchain this offer is for (missing implies bitcoin mainnet only)." - ], - "maxLength": 64, - "minLength": 64 - }, - "invreq_amount_msat": { - "type": "msat", - "description": [ - "The amount the invoice should be for." - ] - }, - "invreq_features": { - "type": "hex", - "description": [ - "The feature bits of the invoice_request." - ] - }, - "invreq_quantity": { - "type": "u64", - "description": [ - "The number of items to invoice for." - ] - }, - "invreq_payer_note": { - "type": "string", - "description": [ - "A note attached by the payer." - ] - }, - "invreq_recurrence_counter": { - "type": "u32", - "description": [ - "Which number request this is for the same invoice." - ] - }, - "invreq_recurrence_start": { + ] + }, + "onchain_fee_estimates": { + "opening_channel_satoshis": 4387, + "mutual_close_satoshis": 4206, + "unilateral_close_satoshis": 6578, + "unilateral_close_nonanchor_satoshis": 6578, + "htlc_timeout_satoshis": 7293, + "htlc_success_satoshis": 7733 + } + } + ], + "author": [ + "ZmnSCPxj <> wrote the initial version of this manpage." + ], + "see_also": [ + "lightning-parsefeerate(7)", + "lightning-fundchannel(7)", + "lightning-withdraw(7)", + "lightning-txprepare(7)", + "lightning-fundchannel_start(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-fetchinvoice.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "fetchinvoice", + "title": "Command for fetch an invoice for an offer", + "warning": "experimental-offers only", + "description": [ + "The **fetchinvoice** RPC command contacts the issuer of an *offer* to get an actual invoice that can be paid. It highlights any changes between the offer and the returned invoice.", + "", + "If **fetchinvoice-noconnect** is not specified in the configuation, it will connect to the destination in the (currently common!) case where it cannot find a route which supports `option_onion_messages`." + ], + "request": { + "required": [ + "offer" + ], + "properties": { + "offer": { + "type": "string", + "description": [ + "Offer string to get an actual invoice that can be paid." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Required if the offer does not specify an amount at all, otherwise it is optional (but presumably if you set it to less than the offer, you will get an error from the issuer)." + ] + }, + "quantity": { + "type": "u64", + "description": [ + "Required if the offer specifies quantity_max, otherwise it is not allowed." + ] + }, + "recurrence_counter": { + "type": "u64", + "description": [ + "Required if the offer specifies recurrence, otherwise it is not allowed. recurrence_counter should first be set to 0, and incremented for each successive invoice in a given series." + ] + }, + "recurrence_start": { + "type": "number", + "description": [ + "Required if the offer specifies recurrence_base with start_any_period set, otherwise it is not allowed. It indicates what period number to start at." + ] + }, + "recurrence_label": { + "type": "string", + "description": [ + "Required if recurrence_counter is set, and otherwise is not allowed. It must be the same as prior fetchinvoice calls for the same recurrence, as it is used to link them together." + ] + }, + "timeout": { + "type": "number", + "description": [ + "If we don't get a reply before this we fail (default, 60 seconds)." + ] + }, + "payer_note": { + "type": "string", + "description": [ + "To ask the issuer to include in the fetched invoice." + ] + } + } + }, + "response": { + "required": [ + "invoice", + "changes" + ], + "properties": { + "invoice": { + "type": "string", + "description": [ + "The BOLT12 invoice we fetched." + ] + }, + "changes": { + "type": "object", + "description": [ + "Summary of changes from offer." + ], + "additionalProperties": false, + "required": [], + "properties": { + "description_appended": { + "type": "string", + "description": [ + "Extra characters appended to the *description* field." + ] + }, + "description": { + "type": "string", + "description": [ + "A completely replaced *description* field." + ] + }, + "vendor_removed": { + "type": "string", + "description": [ + "The *vendor* from the offer, which is missing in the invoice." + ] + }, + "vendor": { + "type": "string", + "description": [ + "A completely replaced *vendor* field." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount, if different from the offer amount multiplied by any *quantity* (or the offer had no amount, or was not in BTC)." + ] + } + } + }, + "next_period": { + "type": "object", + "description": [ + "Only for recurring invoices if the next period is under the *recurrence_limit*." + ], + "additionalProperties": false, + "required": [ + "counter", + "starttime", + "endtime", + "paywindow_start", + "paywindow_end" + ], + "properties": { + "counter": { + "type": "u64", + "description": [ + "The index of the next period to fetchinvoice." + ] + }, + "starttime": { + "type": "u64", + "description": [ + "UNIX timestamp that the next period starts." + ] + }, + "endtime": { + "type": "u64", + "description": [ + "UNIX timestamp that the next period ends." + ] + }, + "paywindow_start": { + "type": "u64", + "description": [ + "UNIX timestamp of the earliest time that the next invoice can be fetched." + ] + }, + "paywindow_end": { + "type": "u64", + "description": [ + "UNIX timestamp of the latest time that the next invoice can be fetched." + ] + } + } + } + } + }, + "errors": [ + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error.", + "- 1002: Offer has expired.", + "- 1003: Cannot find a route to the node making the offer.", + "- 1004: The node making the offer returned an error message.", + "- 1005: We timed out trying to fetch an invoice." + ], + "example_json_request": [ + { + "id": "example:fetchinvoice#1", + "method": "fetchinvoice", + "params": { + "offer": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqypq5zmnd9khqmr9yp6x2um5zcssxhftzxfdlwsnfcgw2sy8t5mxa0ytcdfat2nkdwqvpy9nnsa9mzza", + "payer_note": "Thanks for the fish!" + } + }, + { + "id": "example:fetchinvoice#2", + "method": "fetchinvoice", + "params": { + "offer": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqypq5zmnd9khqmr9yp6x2um5zcssxhftzxfdlwsnfcgw2sy8t5mxa0ytcdfat2nkdwqvpy9nnsa9mzza", + "amount_msat": 3 + } + }, + { + "id": "example:fetchinvoice#3", + "method": "fetchinvoice", + "params": { + "offer": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqypq5zmnd9khqmr9yp6x2um5zsqs593pqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4j", + "quantity": 2 + } + } + ], + "example_json_response": [ + { + "invoice": "lni1qqgvcm9h7yakcmw4mzazspu8vfgpwq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqgzpg9hx6tdwpkx2gr5v4ehg93pqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky965pqqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy84sggren772kj8mau5jp86nc6fszx48rv7ep0quszyyls8rlld3sshjr94j9z5dpsku6mnypnx7u3qw35x2grxd9eksgdqnqp462c3jt0m5y6wzrj5pp6axehtez7r20265antsrqfpvuu8fwcshgr0tsv8e6829e8xmv7laz0kwhtlx6vtk8q3d6rtthdhtwvnn6j585szquc2t7us8kguxypzasg8ewkakgx2ny5ugks0f32x67sm9e5fms4asqrylajc2dqh8ag55mv5p5ghy3e2z8zwmllle8uu7jsxv5ke8d6rr5h7kthmz7ya0hxp4nt7elvw7vghcl6fgsuqqqqqqqqqqqqqqq9qqqqqqqqqqqqq8fykt06c5sqqqqqpfqyvhtunn4gyzy0lphn4wn6ctzlsajy46wscjcglf3hxcnvlaxqs3ydkhgaklsc42spq2czzq6a9vge9ha6zd8ppe2qsawnvm4u30p484d2we4cpsyskwwr5hvgthcyqyuen02ejwpa9cjjrttvp223yxsqkrwnlaszkhas84w0ape300ued4p75xu3cqtcg0cslsx9fvh7dhdqx565t6wa0alf6u2hug90j2hs", + "changes": {} + }, + { + "invoice": "lni1qqg0mfchkz0gkmn8zzu5zaxd0qvlzq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqgzpg9hx6tdwpkx2gr5v4ehg93pqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky965pqqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy84yqgrtqss8d4vgzd3286u9rk0zg9qr7a6z2xm6mjnz9pydztcn0j74tjvch0f5zvqxhftzxfdlwsnfcgw2sy8t5mxa0ytcdfat2nkdwqvpy9nnsa9mzzaqth4fzjqxxmsaxvc4v2urs6hsh6k0e564x00g68vuyp5w7yjedzxvqgr8ltzmj0n7ltxr0tz9rafn9zcy9jldjqfuf20w6gjmr7nj04d360sqvkdwprxn22dlp3xay9yq4nhrw2jm0c8t6r7japhdad6leawxyqzkg92tx8gqxp9f2d8j5k2axta0gr7yr9zrsqqqqqqqqqqqqqqq5qqqqqqqqqqqqqayjedltzjqqqqqq9yq3ja0jwj4qswt3kgs9mxq7gck66x60m5rndykpw3a7hf4ntlp9qe2vgwzzrvcwd2qypmqggrt543ryklhgf5uy89gzr46dnwhj9ux5744fmxhqxqjzeecwja3pwlqsxyjcdwur4hl4qf7nsjgg8euvy45lznufh5kydkwz6llsucuhvwp9ezeggaj3k057ge6ftvaffjkwn6j3y7faeuysrx3m2xccphu65sx", + "changes": {} + }, + { + "invoice": "lni1qqgd508mv9rpjg2ec8dr8qcslf2cjq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqgzpg9hx6tdwpkx2gr5v4ehg9qppgtzzq3dygmzpg6e53ll0aavg37gt3rvjg762vufygdqq4xprs0regcat9gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02cqsykppqfkyy6q8ry9pchxtuajh456hhcf7dxx733cx76etuv5ftfmfa2ymhgycqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jq6uhkeymz26zx7zgw4gdmw2vj9xqn4hu2sqxhp0pcgt87pf9chyfvqsywtejxjh603kx7am3zaf6d6xuumw30p8zmcdz7r95nn4lr92exk3qqe2x6xqwpdzh2zwq3vnyra8nfc6d7y6hegpkvc7p2nulj7hvhwl5hjfr23wn60mjftqspn7d4ejhrpsr5m2y8qqqqqqqqqqqqqqqpgqqqqqqqqqqqqp6f9jm7k9yqqqqqq2gpr96l9mt2pqxuyr0gqw92h0xz2y2uy5uxss4ujcac5jehj9ay2sxkapr80t5ha65qgykqssytfzxcs2xkdy0lml0tzy0jzugmyj8kjn8zfzrgq9fsgurc72x82e7pqxhl4u29cjluw5s8fwa9wtvh0qytr7vqk0vtndsz07mrrtmjw629m8mnqkjaf43kt889qeq2f7deu6t853lngpzclapt8nj0g528v9ay", + "changes": {} + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-sendinvoice(7)", + "lightning-pay(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-fundchannel.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "fundchannel", + "title": "Command for establishing a lightning channel", + "description": [ + "The **fundchannel** RPC command opens a payment channel with a peer by committing a funding transaction to the blockchain as defined in BOLT #2.", + "", + "If not already connected, **fundchannel** will automatically attempt to connect if Core Lightning knows a way to contact the node (either from normal gossip, or from a previous **connect** call).", + "", + "This auto-connection can fail if Core Lightning does not know how to contact the target node; see lightning-connect(7).", + "", + "Once the transaction is confirmed, normal channel operations may begin. Readiness is indicated by **listpeers** reporting a *state* of `CHANNELD_NORMAL` for the channel." + ], + "request": { + "required": [ + "id", + "amount" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "Id is the peer id obtained from connect." + ] + }, + "amount": { + "type": "msat_or_all", + "description": [ + "The amount in satoshis taken from the internal wallet to fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency- msat` as change). The string *all* can be used to specify all available funds (or 16777215 satoshi if more is available and large channels were not negotiated with the peer). Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The value cannot be less than the dust limit, currently set to 546, nor more than 16777215 satoshi (unless large channels were negotiated with the peer)." + ] + }, + "feerate": { + "type": "feerate", + "description": [ + "Used for the opening transaction and (unless *option_anchors_zero_fee_htlc_tx* is negotiated), as initial feerate for commitment and HTLC transactions (see NOTES in lightning-feerates(7))." + ], + "default": "*normal*" + }, + "announce": { + "type": "boolean", + "description": [ + "Whether to announce this channel or not. An unannounced channel is considered private." + ], + "default": "True" + }, + "minconf": { + "type": "u32", + "description": [ + "The minimum number of confirmations that used outputs should have." + ], + "default": "1" + }, + "push_msat": { + "type": "msat", + "description": [ + "The amount of millisatoshis to push to the channel peer at open. Note that this is a gift to the peer -- these satoshis are added to the initial balance of the peer at channel start and are largely unrecoverable once pushed." + ] + }, + "close_to": { + "type": "string", + "description": [ + "A Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. Returns `close_to` set to closing script iff is negotiated." + ] + }, + "request_amt": { + "type": "msat", + "description": [ + "An amount of liquidity you'd like to lease from the peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*." + ] + }, + "compact_lease": { + "type": "string", + "description": [ + "A compact representation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel." + ] + }, + "utxos": { + "type": "array", + "description": [ + "The utxos to be used to fund the channel, as an array of `txid:vout`." + ], + "items": { + "type": "outpoint" + } + }, + "mindepth": { + "description": [ + "Number of confirmations required before we consider the channel active." + ], + "type": "u32" + }, + "reserve": { + "type": "msat", + "description": [ + "The amount we want the peer to maintain on its side of the channel. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*." + ], + "default": "1% of the funding amount" + }, + "channel_type": { + "added": "v24.02", + "type": "array", + "items": { + "type": "u32", + "description": [ + "Represents the explicit channel type to request. There is currently no sanity checking on this value so if you use strange values and your channel breaks, you get to keep both pieces. BOLT 2 defines the following value types:", + "```", + "The currently defined basic types are:", + " - no features (no bits set).", + " - `option_static_remotekey` (bit 12).", + " - `option_anchor_outputs` and `option_static_remotekey` (bits 20 and 12).", + " - `option_anchors_zero_fee_htlc_tx` and `option_static_remotekey` (bits 22 and 12).", + "", + "Each basic type has the following variations allowed:", + " - `option_scid_alias` (bit 46).", + " - `option_zeroconf` (bit 50).", + "```" + ] + } + } + } + }, + "response": { + "required": [ + "tx", + "txid", + "outnum", + "channel_type", + "channel_id" + ], + "properties": { + "tx": { + "type": "hex", + "description": [ + "The raw transaction which funded the channel." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The txid of the transaction which funded the channel." + ] + }, + "outnum": { + "type": "u32", + "description": [ + "The 0-based output index showing which output funded the channel." + ] + }, + "channel_id": { + "type": "hash", + "description": [ + "The channel_id of the resulting channel." + ] + }, + "channel_type": { + "type": "object", + "description": [ + "Channel_type as negotiated with peer." + ], + "added": "v24.02", + "additionalProperties": false, + "required": [ + "bits", + "names" + ], + "properties": { + "bits": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "added": "v24.02", + "items": { "type": "u32", "description": [ - "When we're requesting to start an invoice at a non-zero period." + "Bit number." ] - }, - "signature": { - "type": "bip340sig", + } + }, + "names": { + "type": "array", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" + ], "description": [ - "BIP-340 signature of the `invreq_payer_id` on this invoice_request." + "Name of feature bit." ] - }, - "unknown_invoice_request_tlvs": { - "type": "array", - "description": [ - "Any extra fields we didn't know how to parse." - ], - "items": { - "type": "object", - "required": [ - "type", - "length", - "value" - ], - "additionalProperties": false, - "properties": { - "type": { - "type": "u64", - "description": [ - "The type." - ] - }, - "length": { - "type": "u64", - "description": [ - "The length." - ] - }, - "value": { - "type": "hex", - "description": [ - "The value." - ] - } - } - } } } } }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 invoice_request" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - false - ] - } - } - }, - "then": { - "required": [], - "additionalProperties": false, - "properties": { - "type": {}, - "valid": {}, - "offer_id": {}, - "offer_chains": {}, - "offer_metadata": {}, - "offer_currency": {}, - "warning_unknown_offer_currency": {}, - "currency_minor_unit": {}, - "offer_amount": {}, - "offer_amount_msat": {}, - "offer_description": {}, - "offer_issuer": {}, - "offer_features": {}, - "offer_absolute_expiry": {}, - "offer_quantity_max": {}, - "offer_paths": {}, - "offer_node_id": {}, - "offer_recurrence": {}, - "invreq_metadata": {}, - "invreq_payer_id": {}, - "invreq_chain": {}, - "invreq_amount_msat": {}, - "invreq_features": {}, - "invreq_quantity": {}, - "invreq_payer_note": {}, - "invreq_recurrence_counter": {}, - "invreq_recurrence_start": {}, - "warning_invalid_offer_description": { - "type": "string", - "description": [ - "`offer_description` is not valid UTF8." - ] - }, - "warning_missing_offer_description": { - "type": "string", - "description": [ - "`offer_description` is not present." - ] - }, - "warning_invalid_offer_currency": { - "type": "string", - "description": [ - "`offer_currency_code` is not valid UTF8." - ] - }, - "warning_invalid_offer_issuer": { - "type": "string", + "close_to": { + "type": "hex", + "description": [ + "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`." + ] + }, + "mindepth": { + "type": "u32", + "description": [ + "Number of confirmations before we consider the channel active." + ] + } + } + }, + "example_usage": [ + "This example shows how to use lightning-cli to open new channel with peer 03f...fc1 from one whole utxo bcc1...39c:0 (you can use **listfunds** command to get txid and vout):", + "", + "```shell", + "lightning-cli -k fundchannel id=03f...fc1 amount=all feerate=normal utxos='[\"bcc1...39c:0\"]'", + "```" + ], + "example_json_request": [ + { + "id": "example:fundchannel#1", + "method": "fundchannel", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount": 1000000, + "feerate": null, + "announce": true, + "minconf": null, + "utxos": null, + "push_msat": null, + "close_to": null, + "request_amt": null, + "compact_lease": null, + "mindepth": null, + "reserve": null + } + }, + { + "id": "example:fundchannel#2", + "method": "fundchannel", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount": 10000000, + "feerate": null, + "announce": true, + "minconf": null, + "utxos": null, + "push_msat": 1000000000, + "close_to": null, + "request_amt": null, + "compact_lease": null, + "mindepth": null, + "reserve": null, + "channel_type": null + } + } + ], + "example_json_response": [ + { + "tx": "020000000001014ca47b75e6982fce6b5ebb6e7ec163dc5b6bed1562934e6febe816103b2b207e0000000000fdffffff0240420f00000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd012f0f000000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a02473044022058fc4d51c8254d37b266d3db3f8fda7420882b6ec9226d66b8c0139f2707c09602205798d8ce23d4c692a7384362a2e0afd9703f062239a786d7a1840a28d3a1152e012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000", + "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b", + "channel_id": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "outnum": 0 + }, + { + "tx": "0200000000010141cfa0e9957c7c6d0bb5069d92937f9545e6e6ee9b4650f47f509d5ea65df4690100000000fdffffff0280969800000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd4118530b0000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a0247304402206488c7dfbc4180781ed0d5ca7ff2c8ce134480c349d03978765053a393229d9a022066c75dee1f19b410ea1c7756d0cb2c097e52b13f4d9bbd033efa4ed95d817e14012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000", + "txid": "6aa1231b6356777468a55aea1f49dad6415592aef6c1e652f8a64357c7235301", + "channel_id": "015323c75743a6f852e6c1f6ae925541d6da491fea5aa568747756631b23a16a", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "outnum": 0 + } + ], + "errors": [ + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error.", + "- 300: The maximum allowed funding amount is exceeded.", + "- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.", + "- 302: The output amount is too small, and would be considered dust.", + "- 303: Broadcasting of the funding transaction failed, the internal call to bitcoin-cli returned with an error.", + "- 313: The `min-emergency-msat` reserve not be preserved (and we have or are opening anchor channels).", + "", + "Failure may also occur if **lightningd** and the peer cannot agree on channel parameters (funding limits, channel reserves, fees, etc.)." + ], + "see_also": [ + "lightning-connect(7)", + "lightning-listfunds()", + "lightning-listpeers(7)", + "lightning-feerates(7)", + "lightning-multifundchannel(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-fundchannel_cancel.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "fundchannel_cancel", + "title": "Command for completing channel establishment", + "description": [ + "`fundchannel_cancel` is a lower level RPC command. It allows channel opener to cancel a channel before funding broadcast with a connected peer.", + "", + "Note that the funding transaction MUST NOT be broadcast before `fundchannel_cancel`. Broadcasting transaction before `fundchannel_cancel` WILL lead to unrecoverable loss of funds.", + "", + "If `fundchannel_cancel` is called after `fundchannel_complete`, the remote peer may disconnect when command succeeds. In this case, user need to connect to remote peer again before opening channel." + ], + "request": { + "required": [ + "id" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "Node id of the remote peer with which to cancel." + ] + } + } + }, + "response": { + "required": [ + "cancelled" + ], + "properties": { + "cancelled": { + "type": "string", + "description": [ + "A message indicating it was cancelled by RPC." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:fundchannel_cancel#1", + "method": "fundchannel_cancel", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" + } + }, + { + "id": "example:fundchannel_cancel#2", + "method": "fundchannel_cancel", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" + } + } + ], + "example_json_response": [ + { + "cancelled": "Channel open canceled by RPC" + }, + { + "cancelled": "Channel open canceled by RPC(after fundchannel_complete)" + } + ], + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- 306: Unknown peer id.", + "- 307: No channel currently being funded that can be cancelled.", + "- 308: It is unsafe to cancel the channel: the funding transaction has been broadcast, or there are HTLCs already in the channel, or the peer was the initiator and not us." + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-connect(7)", + "lightning-fundchannel(7)", + "lightning-multifundchannel(7)", + "lightning-fundchannel_start(7)", + "lightning-fundchannel_complete(7)", + "lightning-openchannel_init(7)", + "lightning-openchannel_update(7)", + "lightning-openchannel_signed(7)", + "lightning-openchannel_abort(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-fundchannel_complete.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "fundchannel_complete", + "title": "Command for completing channel establishment", + "description": [ + "`fundchannel_complete` is a lower level RPC command. It allows a user to complete an initiated channel establishment with a connected peer.", + "", + "Note that the funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed, as the commitment transactions for this channel are not secured until this command successfully completes. Broadcasting transaction before can lead to unrecoverable loss of funds." + ], + "request": { + "required": [ + "id", + "psbt" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "Node id of the remote peer." + ] + }, + "psbt": { + "type": "string", + "description": [ + "Transaction to use for funding (does not need to be signed but must be otherwise complete)." + ] + } + } + }, + "response": { + "required": [ + "channel_id", + "commitments_secured" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "The channel_id of the resulting channel." + ] + }, + "commitments_secured": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Indication that channel is safe to use." + ] + } + } + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 305: Peer is not connected.", + "- 306: Unknown peer id.", + "- 309: PSBT does not have a unique, correct output to fund the channel." + ], + "example_json_request": [ + { + "id": "example:fundchannel_complete#1", + "method": "fundchannel_complete", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "psbt": "cHNidP8BAIkCAAAAASYd4TeOHEIzrUbbELM2DK0IX09WaXqWsJFlLD455MPPAAAAAAD9////Av///wAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM1c8QUpAQAAACJRIH8AZYBKMKON4/oVmJVsVt6zy/+PkBPzziE+LtkuFvWXAAAAAAABAIMCAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////wJRAP////8CAPIFKgEAAAAWABQ5FIjuMd8ar9WFRV9eGNLF+3RMcAAAAAAAAAAAJmokqiGp7eL2HD9x0d79P6mZ36NpU3VcaQaJeZlitIvr2DaXToz5AAAAAAEBHwDyBSoBAAAAFgAUORSI7jHfGq/VhUVfXhjSxft0THAiBgMegIxEPDa2OseVTaV6ANtSwQuoj/j2an7X/Is2EekvWBhhFDNgVAAAgAEAAIAAAACAAAAAAAAAAAAAAAEFIEm9AFgqUlJwbPFtyt3a9dzvb+nAGZiQ3CT1CImhjBFpIQdJvQBYKlJScGzxbcrd2vXc72/pwBmYkNwk9QiJoYwRaRkAYRQzYFYAAIABAACAAAAAgAEAAAAAAAAAAA==" + } + } + ], + "example_json_response": [ + { + "channel_id": "049217e5035a4a60449c6382c445b5c105bd63588d66137ad0511c57a16db6d9", + "commitments_secured": true + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-connect(7)", + "lightning-fundchannel(7)", + "lightning-multifundchannel(7)", + "lightning-fundchannel_start(7)", + "lightning-fundchannel_cancel(7)", + "lightning-openchannel_init(7)", + "lightning-openchannel_update(7)", + "lightning-openchannel_signed(7)", + "lightning-openchannel_bump(7)", + "lightning-openchannel_abort(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-fundchannel_start.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "fundchannel_start", + "title": "Command for initiating channel establishment for a lightning channel", + "description": [ + "`fundchannel_start` is a lower level RPC command. It allows a user to initiate channel establishment with a connected peer.", + "", + "Note that the funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`, as the commitment transactions for this channel are not secured until the complete command succeeds. Broadcasting transaction before that can lead to unrecoverable loss of funds." + ], + "request": { + "required": [ + "id", + "amount" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The peer id obtained from connect." + ] + }, + "amount": { + "type": "sat", + "description": [ + "Satoshi value that the channel will be funded at. This value MUST be accurate, otherwise the negotiated commitment transactions will not encompass the correct channel value." + ] + }, + "feerate": { + "type": "feerate", + "description": [ + "Feerate for subsequent commitment transactions: see **fundchannel**. Note that this is ignored for channels with *option_anchors_zero_fee_htlc_tx* (we always use a low commitment fee for these)." + ] + }, + "announce": { + "type": "boolean", + "description": [ + "Whether or not to announce this channel." + ] + }, + "close_to": { + "type": "string", + "description": [ + "Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. Returns `close_to` set to closing script iff is negotiated." + ] + }, + "push_msat": { + "type": "msat", + "description": [ + "Amount of millisatoshis to push to the channel peer at open. Note that this is a gift to the peer -- these satoshis are added to the initial balance of the peer at channel start and are largely unrecoverable once pushed." + ] + }, + "mindepth": { + "type": "u32", + "description": [ + "Number of confirmations required before we consider the channel active." + ] + }, + "reserve": { + "type": "msat", + "description": [ + "The amount we want the peer to maintain on its side." + ] + }, + "channel_type": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + } + }, + "pairedWith": [ + [ + "feerate", + "announce", + "close_to", + "push_msat", + "channel_type", + "mindepth", + "reserve" + ] + ] + }, + "response": { + "required": [ + "funding_address", + "scriptpubkey", + "warning_usage" + ], + "properties": { + "funding_address": { + "type": "string", + "description": [ + "The address to send funding to for the channel. DO NOT SEND COINS TO THIS ADDRESS YET." + ] + }, + "scriptpubkey": { + "type": "hex", + "description": [ + "The raw scriptPubkey for the address." + ] + }, + "channel_type": { + "type": "object", + "description": [ + "Channel_type as negotiated with peer." + ], + "added": "v24.02", + "additionalProperties": false, + "required": [ + "bits", + "names" + ], + "properties": { + "bits": { + "type": "array", + "added": "v24.02", + "description": [ + "Each bit set in this channel_type." + ], + "items": { + "type": "u32", "description": [ - "`offer_issuer` is not valid UTF8." + "Bit number." ] - }, - "warning_missing_invreq_metadata": { + } + }, + "names": { + "type": "array", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "added": "v24.02", + "items": { "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" + ], "description": [ - "`invreq_metadata` is not present." - ] - }, - "warning_missing_invreq_payer_id": { - "type": "string", - "description": [ - "`invreq_payer_id` is not present." - ] - }, - "warning_invalid_invreq_payer_note": { - "type": "string", - "description": [ - "`invreq_payer_note` is not valid UTF8." - ] - }, - "warning_missing_invoice_request_signature": { - "type": "string", - "description": [ - "`signature` is not present." - ] - }, - "warning_invalid_invoice_request_signature": { - "type": "string", - "description": [ - "Incorrect `signature`." + "Name of feature bit." ] } } } }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 invoice" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "required": [ - "offer_node_id", - "offer_description", - "invreq_metadata", - "invreq_payer_id", - "invoice_paths", - "invoice_created_at", - "invoice_payment_hash", - "invoice_amount_msat", - "signature" - ], - "additionalProperties": false, - "properties": { - "type": {}, - "valid": {}, - "offer_id": { - "type": "hex", - "description": [ - "The id we use to identify this offer." - ], - "maxLength": 64, - "minLength": 64 - }, - "offer_chains": { - "type": "array", - "description": [ - "Which blockchains this offer is for (missing implies bitcoin mainnet only)." - ], - "items": { - "type": "hex", - "description": [ - "The genesis blockhash." - ], - "maxLength": 64, - "minLength": 64 - } - }, - "offer_metadata": { - "type": "hex", - "description": [ - "Any metadata the creator of the offer includes." - ] - }, - "offer_currency": { - "type": "string", - "description": [ - "ISO 4217 code of the currency (missing implies Bitcoin)." - ], - "maxLength": 3, - "minLength": 3 - }, - "warning_unknown_offer_currency": { - "type": "string", - "description": [ - "The currency code is unknown (so no `currency_minor_unit`)." - ] - }, - "currency_minor_unit": { - "type": "u32", - "description": [ - "The number of decimal places to apply to amount (if currency known)." - ] - }, - "offer_amount": { - "type": "u64", - "description": [ - "The amount in the `offer_currency` adjusted by `currency_minor_unit`, if any." - ] - }, - "offer_amount_msat": { - "type": "msat", - "description": [ - "The amount in bitcoin (if specified, and no `offer_currency`)." - ] - }, - "offer_description": { - "type": "string", - "description": [ - "The description of the purpose of the offer." - ] - }, - "offer_issuer": { - "type": "string", - "description": [ - "The description of the creator of the offer." - ] - }, - "offer_features": { - "type": "hex", - "description": [ - "The feature bits of the offer." - ] - }, - "offer_absolute_expiry": { - "type": "u64", - "description": [ - "UNIX timestamp of when this offer expires." - ] - }, - "offer_quantity_max": { - "type": "u64", - "description": [ - "The maximum quantity (or, if 0, means any quantity)." - ] - }, - "offer_paths": { - "type": "array", - "description": [ - "Paths to the destination." - ], - "items": { - "type": "object", - "required": [ - "first_node_id", - "blinding", - "path" - ], - "additionalProperties": false, - "properties": { - "first_node_id": { - "type": "pubkey", - "description": [ - "The (presumably well-known) public key of the start of the path." - ] - }, - "blinding": { - "type": "pubkey", - "description": [ - "Blinding factor for this path." - ] - }, - "path": { - "type": "array", - "description": [ - "An individual path." - ], - "items": { - "type": "object", - "required": [ - "blinded_node_id", - "encrypted_recipient_data" - ], - "additionalProperties": false, - "properties": { - "blinded_node_id": { - "type": "pubkey", - "description": [ - "Node_id of the hop." - ] - }, - "encrypted_recipient_data": { - "type": "hex", - "description": [ - "Encrypted TLV entry for this hop." - ] - } - } - } - } - } - } - }, - "offer_node_id": { - "type": "pubkey", - "description": [ - "Public key of the offering node." - ] - }, - "offer_recurrence": { - "type": "object", - "description": [ - "How often to this offer should be used." - ], - "required": [ - "period", - "time_unit" - ], - "additionalProperties": false, - "properties": { - "time_unit": { - "type": "u32", - "description": [ - "The BOLT12 time unit." - ] - }, - "time_unit_name": { - "type": "string", - "description": [ - "The name of `time_unit` (if valid)." - ] - }, - "period": { - "type": "u32", - "description": [ - "How many `time_unit` per payment period." - ] - }, - "basetime": { - "type": "u64", - "description": [ - "Period starts at this UNIX timestamp." - ] - }, - "start_any_period": { - "type": "u64", - "description": [ - "You can start at any period (only if `basetime` present)." - ] - }, - "limit": { - "type": "u32", - "description": [ - "Maximum period number for recurrence." - ] - }, - "paywindow": { - "type": "object", - "description": [ - "When within a period will payment be accepted." - ], - "default": "prior and during the period", - "required": [ - "seconds_before", - "seconds_after" - ], - "additionalProperties": false, - "properties": { - "seconds_before": { - "type": "u32", - "description": [ - "Seconds prior to period start." - ] - }, - "seconds_after": { - "type": "u32", - "description": [ - "Seconds after to period start." - ] - }, - "proportional_amount": { - "type": "boolean", - "enum": [ - true - ], - "description": [ - "Amount should be scaled if paid after period start." - ] - } - } - } - } - }, - "invreq_metadata": { - "type": "hex", - "description": [ - "The payer-provided blob to derive invreq_payer_id." - ] - }, - "invreq_payer_id": { - "type": "hex", - "description": [ - "The payer-provided key." - ] - }, - "invreq_chain": { - "type": "hex", - "description": [ - "Which blockchain this offer is for (missing implies bitcoin mainnet only)." - ], - "maxLength": 64, - "minLength": 64 - }, - "invreq_amount_msat": { - "type": "msat", - "description": [ - "The amount the invoice should be for." - ] - }, - "invreq_features": { - "type": "hex", - "description": [ - "The feature bits of the invoice_request." - ] - }, - "invreq_quantity": { - "type": "u64", - "description": [ - "The number of items to invoice for." - ] - }, - "invreq_payer_note": { - "type": "string", - "description": [ - "A note attached by the payer." - ] - }, - "invreq_recurrence_counter": { - "type": "u32", - "description": [ - "Which number request this is for the same invoice." - ] - }, - "invreq_recurrence_start": { - "type": "u32", - "description": [ - "When we're requesting to start an invoice at a non-zero period." - ] - }, - "invoice_paths": { - "type": "array", - "description": [ - "Paths to pay the destination." - ], - "items": { - "type": "object", - "required": [ - "first_node_id", - "blinding", - "payinfo", - "path" - ], - "additionalProperties": false, - "properties": { - "first_node_id": { - "type": "pubkey", - "description": [ - "The (presumably well-known) public key of the start of the path." - ] - }, - "blinding": { - "type": "pubkey", - "description": [ - "Blinding factor for this path." - ] - }, - "payinfo": { - "type": "object", - "required": [ - "fee_base_msat", - "fee_proportional_millionths", - "cltv_expiry_delta", - "features" - ], - "additionalProperties": false, - "properties": { - "fee_base_msat": { - "type": "msat", - "description": [ - "Basefee for path." - ] - }, - "fee_proportional_millionths": { - "type": "u32", - "description": [ - "Proportional fee for path." - ] - }, - "cltv_expiry_delta": { - "type": "u32", - "description": [ - "CLTV delta for path." - ] - }, - "features": { - "type": "hex", - "description": [ - "Features allowed for path." - ] - } - } - }, - "path": { - "type": "array", - "description": [ - "An individual path." - ], - "items": { - "type": "object", - "required": [ - "blinded_node_id", - "encrypted_recipient_data" - ], - "additionalProperties": false, - "properties": { - "blinded_node_id": { - "type": "pubkey", - "description": [ - "Node_id of the hop." - ] - }, - "encrypted_recipient_data": { - "type": "hex", - "description": [ - "Encrypted TLV entry for this hop." - ] - } - } - } - } - } - } - }, - "invoice_created_at": { - "type": "u64", - "description": [ - "The UNIX timestamp of invoice creation." - ] - }, - "invoice_relative_expiry": { - "type": "u32", - "description": [ - "The number of seconds after *invoice_created_at* when this expires." - ] - }, - "invoice_payment_hash": { - "type": "hex", - "description": [ - "The hash of the *payment_preimage*." - ], - "maxLength": 64, - "minLength": 64 - }, - "invoice_amount_msat": { - "type": "msat", - "description": [ - "The amount required to fulfill invoice." - ] - }, - "invoice_fallbacks": { - "type": "array", - "description": [ - "Onchain addresses." - ], - "items": { - "type": "object", - "required": [ - "version", - "hex" - ], - "additionalProperties": false, - "properties": { - "version": { - "type": "u8", - "description": [ - "Segwit address version." - ] - }, - "hex": { - "type": "hex", - "description": [ - "Raw encoded segwit address." - ] - }, - "address": { - "type": "string", - "description": [ - "Bech32 segwit address." - ] - } - } - } - }, - "invoice_features": { - "type": "hex", - "description": [ - "The feature bits of the invoice." - ] - }, - "invoice_node_id": { - "type": "pubkey", - "description": [ - "The id to pay (usually the same as offer_node_id)." - ] - }, - "invoice_recurrence_basetime": { - "type": "u64", - "description": [ - "The UNIX timestamp to base the invoice periods on." - ] - }, - "signature": { - "type": "bip340sig", - "description": [ - "BIP-340 signature of the `offer_node_id` on this invoice." - ] - }, - "unknown_invoice_tlvs": { - "type": "array", - "description": [ - "Any extra fields we didn't know how to parse." - ], - "items": { - "type": "object", - "required": [ - "type", - "length", - "value" - ], - "additionalProperties": false, - "properties": { - "type": { - "type": "u64", - "description": [ - "The type." - ] - }, - "length": { - "type": "u64", - "description": [ - "The length." - ] - }, - "value": { - "type": "hex", - "description": [ - "The value." - ] - } - } - } - } - } - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 invoice" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - false - ] - } - } - }, - "then": { - "required": [], - "additionalProperties": false, - "properties": { - "type": {}, - "valid": {}, - "offer_id": {}, - "offer_chains": {}, - "offer_metadata": {}, - "offer_currency": {}, - "warning_unknown_offer_currency": {}, - "currency_minor_unit": {}, - "offer_amount": {}, - "offer_amount_msat": {}, - "offer_description": {}, - "offer_issuer": {}, - "offer_features": {}, - "offer_absolute_expiry": {}, - "offer_quantity_max": {}, - "offer_paths": {}, - "offer_node_id": {}, - "offer_recurrence": {}, - "invreq_metadata": {}, - "invreq_payer_id": {}, - "invreq_chain": {}, - "invreq_amount_msat": {}, - "invreq_features": {}, - "invreq_quantity": {}, - "invreq_payer_note": {}, - "invreq_node_id": {}, - "invreq_recurrence_counter": {}, - "invreq_recurrence_start": {}, - "warning_invalid_offer_description": { - "type": "string", - "description": [ - "`offer_description` is not valid UTF8." - ] - }, - "warning_missing_offer_description": { - "type": "string", - "description": [ - "`offer_description` is not present." - ] - }, - "warning_invalid_offer_currency": { - "type": "string", - "description": [ - "`offer_currency_code` is not valid UTF8." - ] - }, - "warning_invalid_offer_issuer": { - "type": "string", - "description": [ - "`offer_issuer` is not valid UTF8." - ] - }, - "warning_missing_invreq_metadata": { - "type": "string", - "description": [ - "`invreq_metadata` is not present." - ] - }, - "warning_invalid_invreq_payer_note": { - "type": "string", - "description": [ - "`invreq_payer_note` is not valid UTF8." - ] - }, - "warning_missing_invoice_paths": { - "type": "string", - "description": [ - "`invoice_paths` is not present." - ] - }, - "warning_missing_invoice_blindedpay": { - "type": "string", - "description": [ - "`invoice_blindedpay` is not present." - ] - }, - "warning_missing_invoice_created_at": { - "type": "string", - "description": [ - "`invoice_created_at` is not present." - ] - }, - "warning_missing_invoice_payment_hash": { - "type": "string", - "description": [ - "`invoice_payment_hash` is not present." - ] - }, - "warning_missing_invoice_amount": { - "type": "string", - "description": [ - "`invoice_amount` is not present." - ] - }, - "warning_missing_invoice_recurrence_basetime": { - "type": "string", - "description": [ - "`invoice_recurrence_basetime` is not present." - ] - }, - "warning_missing_invoice_node_id": { - "type": "string", - "description": [ - "`invoice_node_id` is not present." - ] - }, - "warning_missing_invoice_signature": { - "type": "string", - "description": [ - "`signature` is not present." - ] - }, - "warning_invalid_invoice_signature": { - "type": "string", - "description": [ - "Incorrect `signature`." - ] - }, - "fallbacks": { - "type": "array", - "items": { - "type": "object", - "required": [ - "version", - "hex" - ], - "properties": { - "version": {}, - "hex": {}, - "address": {}, - "warning_invoice_fallbacks_version_invalid": { - "type": "string", - "description": [ - "`version` is > 16." - ] - } - } - } - } - } - } + "close_to": { + "type": "hex", + "description": [ + "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`." + ] }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt11 invoice" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "required": [ - "currency", - "created_at", - "expiry", - "payee", - "min_final_cltv_expiry", - "payment_hash", - "signature" - ], - "additionalProperties": false, - "properties": { - "type": {}, - "valid": {}, - "currency": { - "type": "string", - "description": [ - "The BIP173 name for the currency." - ] - }, - "created_at": { - "type": "u64", - "description": [ - "The UNIX-style timestamp of the invoice." - ] - }, - "expiry": { - "type": "u64", - "description": [ - "The number of seconds this is valid after `created_at`." - ] - }, - "payee": { - "type": "pubkey", - "description": [ - "The public key of the recipient." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "Amount the invoice asked for." - ] - }, - "payment_hash": { - "type": "hash", - "description": [ - "The hash of the *payment_preimage*." - ] - }, - "signature": { - "type": "signature", - "description": [ - "Signature of the *payee* on this invoice." - ] - }, - "description": { - "type": "string", - "description": [ - "The description of the purpose of the purchase." - ] - }, - "description_hash": { - "type": "hash", - "description": [ - "The hash of the description, in place of *description*." - ] - }, - "min_final_cltv_expiry": { - "type": "u32", - "description": [ - "The minimum CLTV delay for the final node." - ] - }, - "payment_secret": { - "type": "secret", - "description": [ - "The secret to hand to the payee node." - ] - }, - "features": { - "type": "hex", - "description": [ - "The features bitmap for this invoice." - ] - }, - "payment_metadata": { - "type": "hex", - "description": [ - "The payment_metadata to put in the payment." - ] - }, - "fallbacks": { - "type": "array", - "description": [ - "Onchain addresses." - ], - "items": { - "type": "object", - "required": [ - "type", - "hex" - ], - "additionalProperties": false, - "properties": { - "type": { - "type": "string", - "description": [ - "The address type (if known)." - ], - "enum": [ - "P2PKH", - "P2SH", - "P2WPKH", - "P2WSH", - "P2TR" - ] - }, - "addr": { - "type": "string", - "description": [ - "The address in appropriate format for *type*." - ] - }, - "hex": { - "type": "hex", - "description": [ - "Raw encoded address." - ] - } - } - } - }, - "routes": { - "type": "array", - "description": [ - "Route hints to the *payee*." - ], - "items": { - "type": "array", - "description": [ - "Hops in the route." - ], - "items": { - "type": "object", - "required": [ - "pubkey", - "short_channel_id", - "fee_base_msat", - "fee_proportional_millionths", - "cltv_expiry_delta" - ], - "additionalProperties": false, - "properties": { - "pubkey": { - "type": "pubkey", - "description": [ - "The public key of the node." - ] - }, - "short_channel_id": { - "type": "short_channel_id", - "description": [ - "A channel to the next peer." - ] - }, - "fee_base_msat": { - "type": "msat", - "description": [ - "The base fee for payments." - ] - }, - "fee_proportional_millionths": { - "type": "u32", - "description": [ - "The parts-per-million fee for payments." - ] - }, - "cltv_expiry_delta": { - "type": "u32", - "description": [ - "The CLTV delta across this hop." - ] - } - } - } - } - }, - "extra": { - "type": "array", - "description": [ - "Any extra fields we didn't know how to parse." - ], - "items": { - "type": "object", - "required": [ - "tag", - "data" - ], - "additionalProperties": false, - "properties": { - "tag": { - "type": "string", - "description": [ - "The bech32 letter which identifies this field." - ], - "maxLength": 1, - "minLength": 1 - }, - "data": { - "type": "string", - "description": [ - "The bech32 data for this field." - ] - } - } - } - } - } - } + "warning_usage": { + "type": "string", + "description": [ + "A warning not to prematurely broadcast the funding transaction (always present!)." + ] }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "rune" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "required": [ - "string", - "restrictions", - "valid" - ], - "additionalProperties": false, - "properties": { - "unique_id": { - "type": "string", - "description": [ - "Unique id (always a numeric id on runes we create)." - ] - }, - "version": { - "type": "string", - "description": [ - "Rune version, not currently set on runes we create." - ] - }, - "valid": { - "type": "boolean", - "enum": [ - true - ] - }, - "type": {}, - "string": { - "type": "string", - "description": [ - "The string encoding of the rune." - ] - }, - "restrictions": { - "type": "array", - "description": [ - "Restrictions built into the rune: all must pass." - ], - "items": { - "type": "object", - "required": [ - "alternatives", - "summary" - ], - "additionalProperties": false, - "properties": { - "alternatives": { - "type": "array", - "description": [ - "Each way restriction can be met: any can pass." - ], - "items": { - "type": "string", - "description": [ - "The alternative of form fieldname condition fieldname." - ] - } - }, - "summary": { - "type": "string", - "description": [ - "Human-readable summary of this restriction." - ] - } - } - } - } - } - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "rune" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - false - ] - } - } - }, - "then": { - "required": [ - "valid" - ], - "additionalProperties": false, - "properties": { - "valid": { - "type": "boolean", - "enum": [ - false - ] - }, - "type": {}, - "warning_rune_invalid_utf8": { - "type": "string", - "description": [ - "The rune contains invalid UTF-8 strings." - ] - }, - "hex": { - "type": "hex", - "description": [ - "The raw rune in hex." - ] - } - } - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "emergency recover" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "required": [ - "decrypted" - ], - "additionalProperties": false, - "properties": { - "type": {}, - "valid": {}, - "decrypted": { - "type": "hex", - "description": [ - "The decrypted value of the provided bech32 of emergency.recover." - ], - "added": "v23.11" - } - } - } + "mindepth": { + "type": "u32", + "description": [ + "Number of confirmations before we consider the channel active." + ] } - ] + } }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 300: The amount exceeded the maximum configured funding amount.", + "- 301: The provided `push_msat` is greater than the provided `amount`.", + "- 304: Still syncing with bitcoin network", + "- 305: Peer is not connected.", + "- 306: Unknown peer id.", + "- 312: Peer negotiated `option_dual_fund`, must use `openchannel_init` not `fundchannel_start`. (Only if ``experimental-dual-fund` is enabled)" + ], "example_json_request": [ { - "id": "example:decode#1", - "method": "decode", - "params": [ - "zm0x_eLgHexaTvZn3Cz7gb_YlvrlYGDo_w4BYlR9SS09MSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl" - ] + "id": "example:fundchannel_start#1", + "method": "fundchannel_start", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount": 16777216, + "feerate": null, + "announce": true, + "close_to": null, + "mindepth": null + } }, { - "id": "example:decode#2", - "method": "decode", - "params": [ - "lnbcrt1m1pja0f2hsp5xyssdvdsu24dmmesrt6x84wfrm4mscsnzq7hl2suzeu90wy6g53qpp5zyyu3anwfsfl64pewe0tg7j28map2wwnhvaam5nt70rlwxa0cegqdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqgqqqqqqqlgqqqq86qqqc9qxpqysgq7u4f99u4kepagme27t5c3gdl7czlnjaw7kxryxgm87w2j02j3g94r2vrukhpgedhcdkcdec27m7jrl2lvcr6uh3rdv9lgpz0vc0zcfcqnugjdw" - ] + "id": "example:fundchannel_start#2", + "method": "fundchannel_start", + "params": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount": "100000sat", + "feerate": null, + "announce": true, + "close_to": null, + "mindepth": null, + "channel_type": null + } } ], "example_json_response": [ { - "type": "rune", - "unique_id": "1", - "string": "ce6d31fde2e01dec5a4ef667dc2cfb81bfd896fae56060e8ff0e0162547d492d:=1&method^list|method^get|method=summary&method/listdatastore", - "restrictions": [ - { - "alternatives": [ - "method^list", - "method^get", - "method=summary" - ], - "summary": "method (of command) starts with 'list' OR method (of command) starts with 'get' OR method (of command) equal to 'summary'" - }, - { - "alternatives": [ - "method/listdatastore" - ], - "summary": "method (of command) unequal to 'listdatastore'" - } - ], - "valid": true + "funding_address": "bcrt1qtwxd8wg5eanumk86vfeujvp48hfkgannf77evggzct048wggsrxsum2pmm", + "scriptpubkey": "00205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd", + "warning_usage": "The funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`" }, { - "type": "bolt11 invoice", - "currency": "bcrt", - "created_at": 1708631383, - "expiry": 604800, - "payee": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "amount_msat": 100000000, - "description": "description", - "min_final_cltv_expiry": 5, - "payment_secret": "312106b1b0e2aaddef301af463d5c91eebb86213103d7faa1c167857b89a4522", - "features": "02024100", - "routes": [ - [ - { - "pubkey": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "short_channel_id": "103x1x0", - "fee_base_msat": 1000, - "fee_proportional_millionths": 1000, - "cltv_expiry_delta": 6 - } + "funding_address": "bcrt1qtwxd8wg5eanumk86vfeujvp48hfkgannf77evggzct048wggsrxsum2pmm", + "scriptpubkey": "00205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" ] - ], - "payment_hash": "1109c8f66e4c13fd5439765eb47a4a3efa1539d3bb3bddd26bf3c7f71bafc650", - "signature": "3045022100f72a929795b643d46f2af2e988a1bff605f9cbaef58c32191b3f9ca93d528a0b022051a983e5ae1465b7c36d86e70af6fd21fd5f6607ae5e236b0bf4044f661e2c27", - "valid": true + }, + "warning_usage": "The funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`" } ], "author": [ - "Rusty Russell <> is mainly responsible." + "Lisa Neigut <> is mainly responsible." ], "see_also": [ - "lightning-pay(7)", - "lightning-offer(7)", - "lightning-fetchinvoice(7)", - "lightning-sendinvoice(7)", - "lightning-commando-rune(7)" + "lightning-connect(7)", + "lightning-fundchannel(7)", + "lightning-multifundchannel(7)", + "lightning-fundchannel_complete(7)", + "lightning-fundchannel_cancel(7)", + "lightning-openchannel_init(7)", + "lightning-openchannel_update(7)", + "lightning-openchannel_signed(7)", + "lightning-openchannel_bump(7)", + "lightning-openchannel_abort(7)" ], "resources": [ - "[BOLT #11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md)", - "", - "[BOLT #12](https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md)", - "(experimental, [bolt](https://github.com/lightning/bolts) #798)", - "", "Main web site: " ] }, - "lightning-decodepay.json": { + "lightning-funderupdate.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "added": "v23.05", - "rpc": "decodepay", - "title": "Command for decoding a bolt11 string (low-level)", + "rpc": "funderupdate", + "title": "Command for adjusting node funding v2 channels", "description": [ - "The **decodepay** RPC command checks and parses a *bolt11* string as specified by the BOLT 11 specification." + "NOTE: Must have --experimental-dual-fund enabled for these settings to take effect.", + "", + "For channel open requests using dual funding.", + "", + "Note: to maximize channel leases, best policy setting is (match, 100).", + "", + "Setting any of the 5 options from *lease_fee_base_msat*, *lease_fee_basis*, *funding_weight*, *channel_fee_max_base_msat* and, *channel_fee_max_proportional_thousandths* will activate channel leases for this node, and advertise these values via the lightning gossip network. If any one is set, the other values will be the default." ], "request": { - "required": [ - "bolt11" - ], + "required": [], "properties": { - "bolt11": { + "policy": { "type": "string", + "enum": [ + "match", + "available", + "fixed" + ], "description": [ - "Bolt11 invoice to decode." - ] + "Funder plugin will use to decide how much capital to commit to a v2 open channel request.", + "There are three policy options, detailed below:", + " * `match` -- Contribute *policy_mod* percent of their requested funds. Valid *policy_mod* values are 0 to 200. If this is a channel lease request, we match based on their requested funds. If it is not a channel lease request (and *lease_only* is false), then we match their funding amount. Note: any lease match less than 100 will likely fail, as clients will not accept a lease less than their request.", + " * `available` -- Contribute *policy_mod* percent of our available node wallet funds. Valid *policy_mod* values are 0 to 100.", + " * `fixed` -- Contributes a fixed *policy_mod* sats to v2 channel open requests." + ], + "default": "fixed" }, - "description": { - "type": "string", + "policy_mod": { + "type": "sat", "description": [ - "Description of the invoice to decode." + "Number or 'modification' to apply to the policy." + ], + "default": "0sats" + }, + "leases_only": { + "type": "boolean", + "description": [ + "Only contribute funds to `option_will_fund` requests which pay to lease funds. It will fund any v2 open request using *policy* even if it's they're not seeking to lease funds. Note that `option_will_fund` commits funds for 4032 blocks (~1mo). Must also set *lease_fee_base_msat*, *lease_fee_basis*, *funding_weight*, *channel_fee_max_base_msat*, and *channel_fee_max_proportional_thousandths* to advertise available channel leases." + ], + "default": "False" + }, + "min_their_funding_msat": { + "type": "msat", + "description": [ + "Minimum funding sats that we require in order to activate our contribution policy to the v2 open." + ], + "default": "10k sats" + }, + "max_their_funding_msat": { + "type": "msat", + "description": [ + "Maximum funding sats that we will consider to activate our contribution policy to the v2 open. Any channel open above this will not be funded." + ], + "default": "no max (`UINT_MAX`)" + }, + "per_channel_min_msat": { + "type": "msat", + "description": [ + "Minimum amount that we will contribute to a channel open." + ], + "default": "10k sats" + }, + "per_channel_max_msat": { + "type": "msat", + "description": [ + "Maximum amount that we will contribute to a channel open." + ], + "default": "no max (`UINT_MAX`)" + }, + "reserve_tank_msat": { + "type": "msat", + "description": [ + "Amount of sats to leave available in the node wallet." + ], + "default": "zero sats" + }, + "fuzz_percent": { + "type": "u32", + "description": [ + "A percentage to fuzz the resulting contribution amount by. Valid values are 0 to 100. Note that turning this on with (match, 100) policy will randomly fail `option_will_fund` leases, as most clients expect an exact or greater match of their `requested_funds`." + ], + "default": "0% (no fuzz)" + }, + "fund_probability": { + "type": "u32", + "description": [ + "The percent of v2 channel open requests to apply our policy to. Valid values are integers from 0 (fund 0% of all open requests) to 100 (fund every request). Useful for randomizing opens that receive funds. Useful for randomizing opens that receive funds." + ], + "default": "100" + }, + "lease_fee_base_msat": { + "type": "msat", + "description": [ + "Flat fee for a channel lease. Node will receive this much extra added to their channel balance, paid by the opening node. Note that the minimum is 1sat." + ], + "default": "2k sats" + }, + "lease_fee_basis": { + "type": "u32", + "description": [ + "A basis fee that's calculated as 1/10k of the total requested funds the peer is asking for. Node will receive the total of *lease_fee_basis* times requested funds / 10k satoshis added to their channel balance, paid by the opening node." + ], + "default": "0.65% (65 basis points)" + }, + "funding_weight": { + "type": "u32", + "description": [ + "To calculate the fee the peer will compensate your node for its contributing inputs to the funding transaction. The total fee is calculated as the `open_channel2`.`funding_feerate_perkw` times this *funding_weight* divided by 1000. Node will have this funding fee added to their channel balance, paid by the opening node." + ], + "default": "2 inputs + 1 P2WPKH output" + }, + "channel_fee_max_base_msat": { + "type": "msat", + "description": [ + "A commitment to a maximum `channel_fee_base_msat` that your node will charge for routing payments over this leased channel during the lease duration." + ], + "default": "5k sats" + }, + "channel_fee_max_proportional_thousandths": { + "type": "u32", + "description": [ + "A commitment to a maximum `channel_fee_proportional_millionths` that your node will charge for routing payments over this leased channel during the lease duration. Note that it's denominated in 'thousandths'. A setting of `1` is equal to 1k ppm; `5` is 5k ppm, etc." + ], + "default": "100 (100k ppm)" + }, + "compact_lease": { + "type": "hex", + "description": [ + "A compact description of the channel lease params. When opening a channel, passed in to `fundchannel` to indicate the terms we expect from the peer." ] } } }, "response": { "required": [ - "currency", - "created_at", - "expiry", - "payee", - "min_final_cltv_expiry", - "payment_hash", - "signature" + "summary", + "policy", + "policy_mod", + "leases_only", + "min_their_funding_msat", + "max_their_funding_msat", + "per_channel_min_msat", + "per_channel_max_msat", + "reserve_tank_msat", + "fuzz_percent", + "fund_probability" ], "properties": { - "currency": { + "summary": { "type": "string", "description": [ - "The BIP173 name for the currency." + "Summary of the current funding policy e.g. (match 100)." ] }, - "created_at": { - "type": "u64", + "policy": { + "type": "string", + "enum": [ + "match", + "available", + "fixed" + ], "description": [ - "The UNIX-style timestamp of the invoice." + "Policy funder plugin will use to decide how much capital to commit to a v2 open channel request." ] }, - "expiry": { - "type": "u64", + "policy_mod": { + "type": "u32", "description": [ - "The number of seconds this is valid after *timestamp*." + "The *policy_mod* is the number or 'modification' to apply to the policy." ] }, - "payee": { - "type": "pubkey", + "leases_only": { + "type": "boolean", "description": [ - "The public key of the recipient." + "Only contribute funds to `option_will_fund` lease requests." ] }, - "amount_msat": { + "min_their_funding_msat": { "type": "msat", "description": [ - "Amount the invoice asked for." + "The minimum funding sats that we require from peer to activate our funding policy." ] }, - "payment_hash": { - "type": "hash", + "max_their_funding_msat": { + "type": "msat", "description": [ - "The hash of the *payment_preimage*." + "The maximum funding sats that we'll allow from peer to activate our funding policy." ] }, - "signature": { - "type": "signature", + "per_channel_min_msat": { + "type": "msat", "description": [ - "Signature of the *payee* on this invoice." + "The minimum amount that we will fund a channel open with." ] }, - "description": { - "type": "string", + "per_channel_max_msat": { + "type": "msat", "description": [ - "The description of the purpose of the purchase." + "The maximum amount that we will fund a channel open with." ] }, - "description_hash": { - "type": "hash", + "reserve_tank_msat": { + "type": "msat", "description": [ - "The hash of the description, in place of *description*." + "Amount of sats to leave available in the node wallet." ] }, - "min_final_cltv_expiry": { + "fuzz_percent": { "type": "u32", "description": [ - "The minimum CLTV delay for the final node." + "Percentage to fuzz our funding amount by." ] }, - "payment_secret": { - "type": "hash", + "fund_probability": { + "type": "u32", "description": [ - "The secret to hand to the payee node." + "Percent of opens to consider funding. 100 means we'll consider funding every requested open channel request." ] }, - "features": { - "type": "hex", + "lease_fee_base_msat": { + "type": "msat", "description": [ - "The features bitmap for this invoice." + "Flat fee to charge for a channel lease." ] }, - "payment_metadata": { - "type": "hex", + "lease_fee_basis": { + "type": "u32", "description": [ - "The payment_metadata to put in the payment." + "Proportional fee to charge for a channel lease, calculated as 1/10,000th of requested funds." ] }, - "fallbacks": { - "type": "array", + "funding_weight": { + "type": "u32", "description": [ - "Onchain addresses." - ], - "items": { - "type": "object", - "required": [ - "type", - "hex" - ], - "additionalProperties": false, - "properties": { - "type": { - "type": "string", - "description": [ - "The address type (if known)." - ], - "enum": [ - "P2PKH", - "P2SH", - "P2WPKH", - "P2WSH", - "P2TR" - ] - }, - "addr": { - "type": "string", - "description": [ - "The address in appropriate format for *type*." - ] - }, - "hex": { - "type": "hex", - "description": [ - "Raw encoded address." - ] - } - } - } + "Transaction weight the channel opener will pay us for a leased funding transaction." + ] }, - "routes": { - "type": "array", + "channel_fee_max_base_msat": { + "type": "msat", "description": [ - "Route hints to the *payee*." - ], - "items": { - "type": "array", - "description": [ - "Hops in the route." - ], - "items": { - "type": "object", - "required": [ - "pubkey", - "short_channel_id", - "fee_base_msat", - "fee_proportional_millionths", - "cltv_expiry_delta" - ], - "additionalProperties": false, - "properties": { - "pubkey": { - "type": "pubkey", - "description": [ - "The public key of the node." - ] - }, - "short_channel_id": { - "type": "short_channel_id", - "description": [ - "A channel to the next peer." - ] - }, - "fee_base_msat": { - "type": "msat", - "description": [ - "The base fee for payments." - ] - }, - "fee_proportional_millionths": { - "type": "u32", - "description": [ - "The parts-per-million fee for payments." - ] - }, - "cltv_expiry_delta": { - "type": "u32", - "description": [ - "The CLTV delta across this hop." - ] - } - } - } - } + "Maximum channel_fee_base_msat we'll charge for routing funds leased on this channel." + ] }, - "extra": { - "type": "array", + "channel_fee_max_proportional_thousandths": { + "type": "u32", "description": [ - "Any extra fields we didn't know how to parse." - ], - "items": { - "type": "object", - "required": [ - "tag", - "data" - ], - "additionalProperties": false, - "properties": { - "tag": { - "type": "string", - "description": [ - "The bech32 letter which identifies this field." - ], - "maxLength": 1, - "minLength": 1 - }, - "data": { - "type": "string", - "description": [ - "The bech32 data for this field." - ] - } - } - } + "Maximum channel_fee_proportional_millitionths we'll charge for routing funds leased on this channel, in thousandths." + ] + }, + "compact_lease": { + "type": "hex", + "description": [ + "Compact description of the channel lease parameters." + ] } - }, - "post_return_value_notes": [ - "Technically, the *description* field is optional if a *description_hash* field is given, but in this case **decodepay** will only succeed if the optional *description* field is passed and matches the *description_hash*. In practice, these are currently unused." - ] + } }, + "errors": [ + "The following error code may occur:", + "", + "- -32602: If the given parameters are invalid." + ], "example_json_request": [ { - "id": "example:decodepay#1", - "method": "decodepay", + "id": "example:funderupdate#1", + "method": "funderupdate", + "params": "{}" + }, + { + "id": "example:funderupdate#2", + "method": "funderupdate", "params": { - "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk", - "description": null + "policy": "fixed", + "policy_mod": "50000sat", + "min_their_funding_msat": 1000, + "per_channel_min_msat": "1000sat", + "per_channel_max_msat": "500000sat", + "fund_probability": 100, + "fuzz_percent": 0, + "leases_only": false } } ], "example_json_response": [ { - "currency": "bcrt", - "created_at": 1706152930, - "expiry": 604800, - "payee": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "amount_msat": 11000000, - "description": [ - "XEoCR94SIz6UIRUEkxum." - ], - "min_final_cltv_expiry": 5, - "payment_secret": "82644944d3f70d42aad1d5f7b5d7a629e7afa30b529cc952a4c59fc0e3790ea2", - "features": "02024100", - "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", - "signature": "3045022100e3b7d8886eae1a7c9e55e1797aa0dcb77b8c5a19d56c657cad030e360c90682802203a35713acb098245e53a37faeac98754a29a7078db5ed6f2166f917e55b94484" + "summary": "match (100%)", + "policy": "match", + "policy_mod": 100, + "leases_only": true, + "min_their_funding_msat": 10000000, + "max_their_funding_msat": 4294967295000, + "per_channel_min_msat": 10000000, + "per_channel_max_msat": 4294967295000, + "reserve_tank_msat": 0, + "fuzz_percent": 0, + "fund_probability": 100, + "lease_fee_base_msat": 100000, + "lease_fee_basis": 100, + "funding_weight": 666, + "channel_fee_max_base_msat": 5000000, + "channel_fee_max_proportional_thousandths": 100, + "compact_lease": "029a00640064000000644c4b40" + }, + { + "summary": "fixed (50000sat)", + "policy": "fixed", + "policy_mod": 50000, + "leases_only": false, + "min_their_funding_msat": 1000, + "max_their_funding_msat": 4294967295000, + "per_channel_min_msat": 1000000, + "per_channel_max_msat": 500000000, + "reserve_tank_msat": 0, + "fuzz_percent": 0, + "fund_probability": 100 } ], "author": [ - "Rusty Russell <> is mainly responsible." + "Lisa Neigut <> is mainly responsible." ], "see_also": [ - "lightning-pay(7)", - "lightning-getroute(7)", - "lightning-sendpay(7)" + "lightning-fundchannel(7)", + "lightning-listfunds(7)" ], "resources": [ - "[BOLT #11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md)", - "", "Main web site: " ] }, - "lightning-deldatastore.json": { + "lightning-fundpsbt.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "deldatastore", - "title": "Command for removing (plugin) data", + "rpc": "fundpsbt", + "title": "Command to populate PSBT inputs from the wallet", "description": [ - "The **deldatastore** RPC command allows plugins to delete data it has stored in the Core Lightning database.", - "", - "The command fails if the *key* isn't present, or if *generation* is specified and the generation of the data does not exactly match." + "`fundpsbt` is a low-level RPC command which creates a PSBT using unreserved inputs in the wallet, optionally reserving them as well." ], "request": { "required": [ - "key" + "satoshi", + "feerate", + "startweight" ], "properties": { - "key": { - "oneOf": [ - { - "type": "array", - "description": [ - "Key is an array of values (though a single value is treated as a one-element array), to form a heirarchy. Using the first element of the key as the plugin name (e.g. [ 'summary' ]) is recommended. A key can either have children or a value, never both: parents are created and removed automatically." - ], - "items": { - "type": "string" - } - }, - { - "type": "string" - } + "satoshi": { + "type": "msat_or_all", + "description": [ + "The minimum satoshi value of the output(s) needed (or the string `all` meaning use all unreserved inputs). If a value, it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*." ] }, - "generation": { - "type": "u64", + "feerate": { + "type": "feerate", "description": [ - "If specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with mode `must-replace` or `must-append`." + "Used for the transaction as initial feerate." + ], + "default": "*normal*" + }, + "startweight": { + "type": "u32", + "description": [ + "The weight of the transaction before *fundpsbt* has added any inputs." + ] + }, + "minconf": { + "type": "u32", + "description": [ + "The minimum number of confirmations that used outputs should have." + ], + "default": "1" + }, + "reserve": { + "type": "u32", + "description": [ + "If not zero, then *reserveinputs* is called (successfully, with *exclusive* true) on the returned PSBT for this number of blocks." + ], + "default": "72 blocks" + }, + "locktime": { + "type": "u32", + "description": [ + "The locktime of the transaction. if not set, it is set to a recent block height." + ] + }, + "min_witness_weight": { + "type": "u32", + "description": [ + "Minimum weight to use for a UTXO's witness. If the actual witness weight is greater than the provided minimum, the actual witness weight will be used." + ] + }, + "excess_as_change": { + "type": "boolean", + "description": [ + "Flag to add a change output for the excess sats." + ] + }, + "nonwrapped": { + "added": "v23.02", + "type": "boolean", + "description": [ + "To signal to filter out any p2sh-wrapped inputs from funding this PSBT." + ] + }, + "opening_anchor_channel": { + "added": "v23.08", + "type": "boolean", + "description": [ + "To signel that it needs emergency reserve for anchors so that we can lowball our commitment tx fees, and min-emergency-msat for reserving some sats for closing anchor channels." ] } } }, "response": { "required": [ - "key" + "psbt", + "feerate_per_kw", + "estimated_final_weight", + "excess_msat" ], "properties": { - "key": { - "type": "array", - "items": { - "type": "string", - "description": [ - "Part of the key added to the datastore." - ] - } + "psbt": { + "type": "string", + "description": [ + "Unsigned PSBT which fulfills the parameters given." + ] }, - "generation": { - "type": "u64", + "feerate_per_kw": { + "type": "u32", "description": [ - "The number of times this has been updated." + "The feerate used to create the PSBT, in satoshis-per-kiloweight." ] }, - "hex": { - "type": "hex", + "estimated_final_weight": { + "type": "u32", "description": [ - "The hex data which has removed from the datastore." + "The estimated weight of the transaction once fully signed." ] }, - "string": { - "type": "string", + "excess_msat": { + "type": "msat", "description": [ - "The data as a string, if it's valid utf-8." + "The amount above *satoshi* which is available. This could be zero, or dust; it will be zero if *change_outnum* is also returned." + ] + }, + "change_outnum": { + "type": "u32", + "description": [ + "The 0-based output number where change was placed (only if parameter *excess_as_change* was true and there was sufficient funds)." ] + }, + "reservations": { + "type": "array", + "description": [ + "If *reserve* was true or a non-zero number, just as per lightning- reserveinputs(7)." + ], + "items": { + "type": "object", + "required": [ + "txid", + "vout", + "was_reserved", + "reserved", + "reserved_to_block" + ], + "additionalProperties": false, + "properties": { + "txid": { + "type": "txid", + "description": [ + "The txid of the transaction." + ] + }, + "vout": { + "type": "u32", + "description": [ + "The 0-based output number." + ] + }, + "was_reserved": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "Whether this output was previously reserved." + ] + }, + "reserved": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Whether this output is now reserved." + ] + }, + "reserved_to_block": { + "type": "u32", + "description": [ + "The blockheight the reservation will expire." + ] + } + } + } } - } + }, + "post_return_value_notes": [ + "If *excess_as_change* is true and the excess is enough to cover an additional output above the `dust_limit`, then an output is added to the PSBT for the excess amount. The *excess_msat* will be zero. A *change_outnum* will be returned with the index of the change output." + ] }, + "example_usage": [ + "Let's assume the caller is trying to produce a 100,000 satoshi output.", + "", + "First, the caller estimates the weight of the core (typically 42) and known outputs of the transaction (typically (9 + scriptlen) * 4). For a simple P2WPKH it's a 22 byte scriptpubkey, so that's 124 weight.", + "", + "It calls \"*fundpsbt* 100000sat slow 166\", which succeeds, and returns the *psbt* and *feerate_per_kw* it used, the *estimated_final_weight* and any *excess_msat*.", + "", + "If *excess_msat* is greater than the cost of adding a change output, the caller adds a change output randomly to position 0 or 1 in the PSBT. Say *feerate_per_kw* is 253, and the change output is a P2WPKH (weight 124), the cost is around 31 sats. With the dust limit disallowing payments below 546 satoshis, we would only create a change output if *excess_msat* was greater or equal to 31 + 546." + ], "errors": [ - "The following error codes may occur:", + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", "", - "- 1200: the key does not exist", - "- 1201: the key does exist, but the generation is wrong", - "- -32602: invalid parameters" + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 301: Insufficient UTXOs to meet *satoshi* value." ], "example_json_request": [ { - "id": "example:deldatastore#1", - "method": "deldatastore", + "id": "example:fundpsbt#1", + "method": "fundpsbt", "params": { - "key": "otherkey", - "generation": 1 + "satoshi": 16777216, + "feerate": "253perkw", + "startweight": 250, + "minconf": null, + "reserve": 0, + "locktime": null, + "min_witness_weight": null, + "excess_as_change": false } }, { - "id": "example:deldatastore#2", - "method": "deldatastore", + "id": "example:fundpsbt#2", + "method": "fundpsbt", "params": { - "key": [ - "a" - ], - "generation": null + "satoshi": "all", + "feerate": "1000perkw", + "startweight": 1000, + "minconf": null, + "reserve": null, + "locktime": null, + "min_witness_weight": null, + "excess_as_change": false + } + }, + { + "id": "example:fundpsbt#3", + "method": "fundpsbt", + "params": { + "satoshi": "109000sat", + "feerate": "slow", + "startweight": 166, + "minconf": null, + "reserve": null, + "locktime": null, + "min_witness_weight": null, + "excess_as_change": true } } ], "example_json_response": [ { - "key": [ - "otherkey" - ], - "generation": 1, - "hex": "6f746865726461746161", - "string": "otherdataa" + "psbt": "cHNidP8BADMCAAAAAWzmSFzhTtXBnQewytc32WaMwJSunScwsYndBNdU80JqAAAAAAD9////AGYAAAAAAQDeAgAAAAABAU1MpIJeOOzqAYVkZaytJCmzUadBVltKar8kWtzKSVeYAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFD8W5uBNZAxN6n1jqU62dxWQbyGAAkcwRAIgUK+vMOeWiDPiJM8fpgKCjjwXog4yfWPvtKES1ZZPaM8CIB3cgouGpV6Gc7nEvAu28Mg9tkAWt/Xl5FDOseEyeZqHASECTwjR0I3gLHdSW7jRmnVXdm0+MgJ1hihnqEfXYeFWA/NlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=", + "feerate_per_kw": 253, + "estimated_final_weight": 521, + "excess_msat": 9999869000 }, { - "key": [ - "a" - ], - "generation": 0, - "hex": "6176616c", - "string": "aval" + "psbt": "cHNidP8BAF4CAAAAAfwbEpvpi6D14YV4VLnuVB47Y0uF41kXEyJRL4IusySSAQAAAAD9////ASICAAAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5nAAAAAAEA9gIAAAAAAQFEkxvLatohY6mw5gr5qG1aiArSrziFPR2YoqD21Hv+RAAAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNrz8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIEu1nfVRt9i+rFM219mwhMqdwJsqygWSWTFUS+cemdh6AiBG3Qo8g9J/aAMO2RHDsIBScscj6pTTIwZp7Gw8G3EOKAEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPZgAAAAEBK68/DwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==", + "feerate_per_kw": 1000, + "estimated_final_weight": 1443, + "excess_msat": 997354000, + "change_outnum": 0, + "reservations": [ + { + "txid": "9224b32e822f5122131759e3854b633b1e54eeb9547885e1f5a08be99b121bfc", + "vout": 1, + "was_reserved": false, + "reserved": true, + "reserved_to_block": 175 + } + ] + }, + { + "psbt": "cHNidP8BAF4CAAAAAbEf44mT/BPDxLkUjKy1byWksyLyuM6hbe8shzEbbXhGAQAAAAD9////AU58DQAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5sAAAAAAEA9gIAAAAAAQEV9Sj1wfHqO/ECZeHp/u7cFL5eRaa1Vu4hXWbwH72pxgEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIGILT3DrcNn6/WKOhsxxKq7lDWq47dV0IjRhj0bYHs4yAiApzODtmrz7ifK32G81A2XbBxWboFk2vN4T3ng/hYmb1wEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPZgAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==", + "feerate_per_kw": 3750, + "estimated_final_weight": 609, + "excess_msat": 0, + "change_outnum": 0, + "reservations": [ + { + "txid": "46786d1b31872cef6da1ceb8f222b3a4256fb5ac8c14b9c4c313fc9389e31fb1", + "vout": 1, + "was_reserved": false, + "reserved": true, + "reserved_to_block": 180 + } + ] } ], "author": [ "Rusty Russell <> is mainly responsible." ], "see_also": [ - "lightning-listdatastore(7)", - "lightning-datastore(7)", - "lightning-datastoreusage(7)" + "lightning-utxopsbt(7)", + "lightning-reserveinputs(7)", + "lightning-unreserveinputs(7)" ], "resources": [ "Main web site: " ] }, - "lightning-delexpiredinvoice.json": { + "lightning-getinfo.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "delexpiredinvoice", - "title": "Command for removing expired invoices", + "rpc": "getinfo", + "title": "Command to receive all information about the Core Lightning node.", "description": [ - "The **delexpiredinvoice** RPC command removes all invoices that have expired on or before the given *maxexpirytime*." + "The **getinfo** gives a summary of the current running node." ], "request": { - "required": [], - "properties": { - "maxexpirytime": { - "type": "u64", - "description": [ - "Invoice expiry time in seconds. If not specified then all expired invoices are deleted." - ] - } - } - }, - "response": { "required": [], "properties": {} }, - "example_json_request": [ - { - "id": "example:delexpiredinvoice#1", - "method": "delexpiredinvoice", - "params": { - "maxexpirytime": null - } - } - ], - "example_json_response": [ - {} - ], - "author": [ - "ZmnSCPxj <> is mainly responsible." - ], - "see_also": [ - "lightning-delinvoice(7)", - "lightning-autoclean-status(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-delforward.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "delforward", - "title": "Command for removing a forwarding entry", - "description": [ - "The **delforward** RPC command removes a single forward from **listforwards**, using the uniquely-identifying *in_channel* and *in_htlc_id* (and, as a sanity check, the *status*) given by that command.", - "", - "This command is mainly used by the *autoclean* plugin (see lightningd- config(7)), As these database entries are only kept for your own analysis, removing them has no effect on the running of your node." - ], - "request": { + "response": { "required": [ - "in_channel", - "in_htlc_id", - "status" + "id", + "alias", + "color", + "num_peers", + "num_pending_channels", + "num_active_channels", + "num_inactive_channels", + "version", + "blockheight", + "network", + "fees_collected_msat", + "lightning-dir", + "address" ], "properties": { - "in_channel": { - "type": "short_channel_id", - "description": [ - "Only the matching forwards on the given inbound channel are deleted. Note: for **listforwards** entries without an *in_htlc_id* entry (no longer created in v22.11, but can exist from older versions), a value of 18446744073709551615 can be used, but then it will delete *all* entries without *in_htlc_id* for this *in_channel* and *status*." - ] - }, - "in_htlc_id": { - "type": "u64", + "id": { + "type": "pubkey", "description": [ - "The unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11)." + "The public key unique to this node." ] }, - "status": { + "alias": { "type": "string", "description": [ - "The status of the forward to delete. You cannot delete forwards which have status *offered* (i.e. are currently active)." - ], - "enum": [ - "settled", - "local_failed", - "failed" - ] - } - } - }, - "response": { - "required": [], - "properties": {} - }, - "errors": [ - "The following errors may be reported:", - "", - "- 1401: The forward specified does not exist." - ], - "example_json_request": [ - { - "id": "example:delforward#1", - "method": "delforward", - "params": { - "in_channel": "103x1x0", - "in_htlc_id": 2, - "status": "local_failed" - } - }, - { - "id": "example:delforward#2", - "method": "delforward", - "params": [ - "103x1x0", - 1, - "failed" - ] - } - ], - "example_json_response": [ - {}, - {} - ], - "author": [ - "Rusty Russell <> is mainly responsible." - ], - "see_also": [ - "lightning-autoclean(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-delinvoice.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "delinvoice", - "title": "Command for removing an invoice (or just its description)", - "description": [ - "The **delinvoice** RPC command removes an invoice with *status* as given in **listinvoices**, or with *desconly* set, removes its description." - ], - "request": { - "required": [ - "label", - "status" - ], - "properties": { - "label": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "u64" - } + "The fun alias this node will advertize." ], - "description": [ - "Label of the invoice to be deleted." - ] + "maxLength": 32 }, - "status": { - "type": "string", + "color": { + "type": "hex", "description": [ - "Label of the invoice to be deleted. The caller should be particularly aware of the error case caused by the *status* changing just before this command is invoked!" + "The favorite RGB color this node will advertize." ], - "enum": [ - "paid", - "expired", - "unpaid" - ] + "minLength": 6, + "maxLength": 6 }, - "desconly": { - "type": "boolean", - "description": [ - "If set to True, the invoice is not deleted, but has its description removed (this can save space with very large descriptions, as would be used with lightning-invoice(7) *deschashonly*." - ] - } - } - }, - "response": { - "required": [ - "label", - "payment_hash", - "status", - "created_index", - "expires_at" - ], - "properties": { - "label": { - "type": "string", + "num_peers": { + "type": "u32", "description": [ - "Unique label given at creation time." + "The total count of peers, connected or with channels." ] }, - "bolt11": { - "type": "string", + "num_pending_channels": { + "type": "u32", "description": [ - "BOLT11 string." + "The total count of channels being opened." ] }, - "bolt12": { - "type": "string", + "num_active_channels": { + "type": "u32", "description": [ - "BOLT12 string." + "The total count of channels in normal state." ] }, - "amount_msat": { - "type": "msat", + "num_inactive_channels": { + "type": "u32", "description": [ - "The amount required to pay this invoice." + "The total count of channels waiting for opening or closing transactions to be mined." ] }, - "description": { + "version": { "type": "string", "description": [ - "Description used in the invoice." + "Identifies what bugs you are running into." ] }, - "payment_hash": { - "type": "hash", + "lightning-dir": { + "type": "string", "description": [ - "The hash of the *payment_preimage* which will prove payment." + "Identifies where you can find the configuration and other related files." ] }, - "created_index": { - "type": "u64", - "added": "v23.08", + "our_features": { + "type": "object", "description": [ - "1-based index indicating order this invoice was created in." - ] + "Our BOLT #9 feature bits (as hexstring) for various contexts." + ], + "additionalProperties": true, + "required": [ + "init", + "node", + "channel", + "invoice" + ], + "properties": { + "init": { + "type": "hex", + "description": [ + "Features (incl. globalfeatures) in our init message, these also restrict what we offer in open_channel or accept in accept_channel." + ] + }, + "node": { + "type": "hex", + "description": [ + "Features in our node_announcement message." + ] + }, + "channel": { + "type": "hex", + "description": [ + "Negotiated channel features we (as channel initiator) publish in the channel_announcement message." + ] + }, + "invoice": { + "type": "hex", + "description": [ + "Features in our BOLT11 invoices." + ] + } + } }, - "updated_index": { - "type": "u64", - "added": "v23.08", + "blockheight": { + "type": "u32", "description": [ - "1-based index indicating order this invoice was changed (only present if it has changed since creation)." + "The highest block height we've learned." ] }, - "status": { + "network": { "type": "string", "description": [ - "State of invoice." - ], - "enum": [ - "paid", - "expired", - "unpaid" + "Represents the type of network on the node are working (e.g: `bitcoin`, `testnet`, or `regtest`)." ] }, - "expires_at": { - "type": "u64", + "fees_collected_msat": { + "type": "msat", "description": [ - "UNIX timestamp when invoice expires (or expired)." + "Total routing fees collected by this node." ] - } - }, - "allOf": [ - { - "if": { + }, + "address": { + "type": "array", + "description": [ + "The addresses we announce to the world." + ], + "items": { + "type": "object", "required": [ - "bolt12" - ] - }, - "then": { - "required": [], - "additionalProperties": false, + "type", + "port" + ], + "additionalProperties": true, "properties": { - "label": {}, - "bolt12": {}, - "status": {}, - "expires_at": {}, - "msatoshi": {}, - "amount_msat": {}, - "description": {}, - "payment_hash": {}, - "pay_index": {}, - "created_index": {}, - "updated_index": {}, - "amount_received_msat": {}, - "paid_at": {}, - "payment_preimage": {}, - "local_offer_id": { - "type": "hex", + "type": { + "type": "string", + "enum": [ + "dns", + "ipv4", + "ipv6", + "torv2", + "torv3" + ], "description": [ - "Offer for which this invoice was created." + "Type of connection (until 23.08, `websocket` was also allowed)." ] }, - "invreq_payer_note": { - "type": "string", + "port": { + "type": "u16", "description": [ - "The optional *invreq_payer_note* from invoice_request which created this invoice." + "Port number." ] } - } - }, - "else": { - "required": [ - "bolt11" - ], - "additionalProperties": false, - "properties": { - "label": {}, - "bolt11": {}, - "status": {}, - "expires_at": {}, - "msatoshi": {}, - "amount_msat": {}, - "description": {}, - "payment_hash": {}, - "pay_index": {}, - "created_index": {}, - "updated_index": {}, - "amount_received_msat": {}, - "msatoshi_received": {}, - "paid_at": {}, - "payment_preimage": {} + }, + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "dns", + "ipv4", + "ipv6", + "torv2", + "torv3" + ] + } + } + }, + "then": { + "required": [ + "type", + "address", + "port" + ], + "additionalProperties": false, + "properties": { + "type": {}, + "port": {}, + "address": { + "type": "string", + "description": [ + "Address in expected format for **type**." + ] + } + } + }, + "else": { + "required": [ + "type", + "port" + ], + "additionalProperties": false, + "properties": { + "type": {}, + "port": {} + } } } }, - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "paid" - ] - } - } - }, - "then": { - "additionalProperties": false, + "binding": { + "type": "array", + "description": [ + "The addresses we are listening on." + ], + "items": { + "type": "object", "required": [ - "pay_index", - "amount_received_msat", - "paid_at", - "payment_preimage" + "type" ], "properties": { - "label": {}, - "bolt11": {}, - "bolt12": {}, - "status": {}, - "expires_at": {}, - "msatoshi": {}, - "amount_msat": {}, - "description": {}, - "payment_hash": {}, - "invreq_payer_note": {}, - "local_offer_id": {}, - "created_index": {}, - "updated_index": {}, - "pay_index": { - "type": "u64", - "description": [ - "Unique index for this invoice payment." - ] - }, - "amount_received_msat": { - "type": "msat", + "type": { + "type": "string", + "enum": [ + "local socket", + "websocket", + "ipv4", + "ipv6", + "torv2", + "torv3" + ], "description": [ - "How much was actually received." + "Type of connection." ] }, - "paid_at": { - "type": "u64", + "address": { + "type": "string", "description": [ - "UNIX timestamp of when payment was received." + "Address in expected format for **type**." ] }, - "payment_preimage": { - "type": "secret", + "port": { + "type": "u16", "description": [ - "SHA256 of this is the *payment_hash* offered in the invoice." + "Port number." ] } - } - }, - "else": { - "additionalProperties": false, - "properties": { - "label": {}, - "bolt11": {}, - "bolt12": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "description": {}, - "payment_hash": {}, - "expires_at": {}, - "created_index": {}, - "updated_index": {}, - "pay_index": {}, - "invreq_payer_note": {}, - "local_offer_id": {} - } - } - } - ], - "pre_return_value_notes": [ - "Note: The return is the same as an object from lightning-listinvoice(7)." - ] - }, - "errors": [ - "The following errors may be reported:", - "", - "- -1: Database error.", - "- 905: An invoice with that label does not exist.", - "- 906: The invoice *status* does not match the parameter. An error object will be returned as error *data*, containing *current_status* and *expected_status* fields. This is most likely due to the *status* of the invoice changing just before this command is invoked.", - "- 908: The invoice already has no description, and *desconly* was set." - ], - "example_json_request": [ - { - "id": "example:delinvoice#1", - "method": "delinvoice", - "params": { - "label": "invlabel2", - "status": "unpaid", - "desconly": true - } - }, - { - "id": "example:delinvoice#2", - "method": "delinvoice", - "params": { - "label": "keysend-1708640419.666098582", - "status": "paid", - "desconly": null - } - } - ], - "example_json_response": [ - { - "label": "invlabel2", - "bolt11": "lnbcrt420p1pja0tefsp5vvzg40t4g24l0eqk0jch7mc6jm3ec52ts8w8gwzpwtx9c8nv05rspp533e9csxurt7j9sn2cx7hsn6m00475qgrau8sux5r7djpdedwy2fshp5xqsmrtgfcwsnhxcxmf3tuc65kl6fxvqhvujfmxw2kpeh95yy2x8sxqyjw5qcqp99qxpqysgqgfjrz4q5zcq2lluxxg9h475mq2d3w0tpdstm5274zmhadjl8cqapylfskzk96apka5599a2flm90rmavsk7q8mhh87yle3sgh5vrlycq72fern", - "payment_hash": "8c725c40dc1afd22c26ac1bd784f5b7bebea0103ef0f0e1a83f36416e5ae2293", - "amount_msat": 42, - "status": "unpaid", - "expires_at": 1709238697, - "created_index": 3 - }, - { - "label": "keysend-1708640419.666098582", - "bolt11": "lnbcrt1pja0j9rsp5tg3zvj846gcdzw394njazq40s946sq2ur3hkl4xu4xudtjdtckxspp5fuunrfzsnyz2uxjmg2n95mqhghv4fpvv2kud3kvq4fkys3vmzu5sdqvddjhjum9dejqxqyjw5qcqp99qxpqysgqwt7r0gjlgt7zrfldc3um9myfc36acpqnsdn77c2m42facjtps30yufc5nsmwzhgexlj59f6xa5hess6e3tqrxynt9fejzj3rrshddtcqnappmj", - "payment_hash": "4f3931a4509904ae1a5b42a65a6c1745d954858c55b8d8d980aa6c48459b1729", - "status": "paid", - "pay_index": 1, - "amount_received_msat": 10000000, - "paid_at": 1708640419, - "payment_preimage": "b760af47f456a217e8dfda21a282f1f78c903487c1b21b3b318135f75aa3bf11", - "description": "keysend", - "expires_at": 1709245219, - "created_index": 1, - "updated_index": 1 - } - ], - "author": [ - "Rusty Russell <> is mainly responsible." - ], - "see_also": [ - "lightning-listinvoice(7)", - "lightning-waitinvoice(7)", - "lightning-invoice(7)", - "lightning-delexpiredinvoice(7)", - "lightning-autoclean-status(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-delpay.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "delpay", - "title": "Command for removing a completed or failed payment", - "description": [ - "The **delpay** RPC command deletes a payment with the given `payment_hash` if its status is either `complete` or `failed`. If *partid* and *groupid* are not specified, all payment parts with matchin status are deleted." - ], - "request": { - "required": [ - "payment_hash", - "status" - ], - "properties": { - "payment_hash": { - "type": "hash", - "description": [ - "The unique identifier of a payment." - ] + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "local socket" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "type", + "socket" + ], + "properties": { + "type": {}, + "socket": { + "type": "string", + "description": [ + "Socket filename." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [ + "type", + "address", + "port" + ], + "properties": { + "type": {}, + "address": {}, + "port": {}, + "subtype": {} + } + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "websocket" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "type", + "address", + "port", + "subtype" + ], + "properties": { + "type": {}, + "address": {}, + "port": {}, + "subtype": { + "type": "string", + "description": [ + "Type of address." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [ + "type" + ], + "properties": { + "type": {}, + "address": {}, + "port": {}, + "socket": {} + } + } + } + ] + } }, - "status": { + "warning_bitcoind_sync": { "type": "string", "description": [ - "Expected status of the payment. Only deletes if the payment status matches. Deleting a `pending` payment will return an error." - ], - "enum": [ - "complete", - "failed" - ] - }, - "partid": { - "type": "u64", - "description": [ - "Specific partid to delete (must be paired with *groupid*)." + "Bitcoind is not up-to-date with network." ] }, - "groupid": { - "type": "u64", + "warning_lightningd_sync": { + "type": "string", "description": [ - "Specific groupid to delete (must be paired with *partid*)." + "Lightningd is still loading latest blocks from bitcoind." ] } - }, - "pairedWith": [ - [ - "partid", - "groupid" - ] - ] - }, - "response": { - "required": [ - "payments" - ], - "properties": { - "payments": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "created_index", - "id", - "payment_hash", - "status", - "amount_sent_msat", - "created_at" - ], - "properties": { - "created_index": { - "added": "v23.11", - "type": "u64", - "description": [ - "1-based index indicating order this payment was created in." - ] - }, - "id": { - "type": "u64", - "description": [ - "Old synonym for created_index." - ] - }, - "payment_hash": { - "type": "hash", - "description": [ - "The hash of the *payment_preimage* which will prove payment." - ] - }, - "status": { - "type": "string", - "enum": [ - "pending", - "failed", - "complete" - ], - "description": [ - "Status of the payment." - ] - }, - "amount_sent_msat": { - "type": "msat", - "description": [ - "The amount we actually sent, including fees." - ] - }, - "partid": { - "type": "u64", - "description": [ - "Unique ID within this (multi-part) payment." - ] - }, - "destination": { - "type": "pubkey", - "description": [ - "The final destination of the payment if known." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "The amount the destination received, if known." - ] - }, - "created_at": { - "type": "u64", - "description": [ - "The UNIX timestamp showing when this payment was initiated." - ] - }, - "updated_index": { - "added": "v23.11", - "type": "u64", - "description": [ - "1-based index indicating order this payment was changed (only present if it has changed since creation)." - ] - }, - "completed_at": { - "type": "u64", - "description": [ - "The UNIX timestamp showing when this payment was completed." - ] - }, - "groupid": { - "type": "u64", - "description": [ - "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." - ] - }, - "payment_preimage": { - "type": "secret", - "description": [ - "Proof of payment." - ] - }, - "label": { - "type": "string", - "description": [ - "The label, if given to sendpay." - ] - }, - "bolt11": { - "type": "string", - "description": [ - "The bolt11 string (if pay supplied one)." - ] - }, - "bolt12": { - "type": "string", - "description": [ - "The bolt12 string (if supplied for pay: **experimental-offers** only)." - ] - }, - "erroronion": { - "type": "hex", - "description": [ - "The error onion returned on failure, if any." - ] - } - } - } - } - }, - "pre_return_value_notes": [ - "The returned format is the same as lightning-listsendpays(7). If the payment is a multi-part payment (MPP) the command return a list of payments will be returned -- one payment object for each partid." - ] + } }, "example_json_request": [ { - "id": "example:delpay#1", - "method": "delpay", - "params": { - "payment_hash": "4fa2f1b001067ec06d7f95b8695b8acd9ef04c1b4d1110e3b94e1fa0687bb1e0", - "status": "complete" - } - }, - { - "id": "example:delpay#2", - "method": "delpay", - "params": [ - "c9d4547473d0d646f1fdd8ca7f01803e4d31ceab01df33c79456f9c24b04034e", - "failed" - ] - }, - { - "id": "example:delpay#3", - "method": "delpay", - "params": { - "payment_hash": "bbc35e0a46d1483292a4ff8d4daaceaab8c3c084dd835be4128785b52e469c64", - "status": "complete", - "groupid": 1, - "partid": 1 - } + "id": "example:getinfo#1", + "method": "getinfo", + "params": {} } ], "example_json_response": [ { - "payments": [ + "id": "02bf811f7571754f0b51e6d41a8885f5561041a7b14fac093e4cffb95749de1a8d", + "alias": "SLICKERGOPHER", + "color": "02bf81", + "num_peers": 0, + "num_pending_channels": 0, + "num_active_channels": 0, + "num_inactive_channels": 0, + "address": [ { - "id": 1, - "payment_hash": "8dfd6538eeb33811c9114a75f792a143728d7f05643f38c3d574d3097e8910c0", - "destination": "0219f8900ee78a89f050c24d8b69492954f9fdbabed753710845eb75d3a75a5880", - "msatoshi": 1000, - "amount_msat": "1000msat", - "msatoshi_sent": 1000, - "amount_sent_msat": "1000msat", - "created_at": 1596224858, - "status": "complete", - "payment_preimage": "35bd4e2b481a1a84a22215b5372672cf81460a671816960ddb206464359e1822", - "bolt11": "lntb10n1p0jga20pp53h7k2w8wkvuprjg3ff6l0y4pgdeg6lc9vsln3s74wnfsjl5fzrqqdqdw3jhxazldahx2xqyjw5qcqp2sp5wut5jnhr6n7jd5747ky2g5flmw7hgx9yjnqzu60ps2jf6f7tc0us9qy9qsqu2a0k37nckl62005p69xavlkydkvhnypk4dphffy4x09zltwh9437ad7xkl83tefdarzhu5t30ju5s56wlrg97qkx404pq3srfc425cq3ke9af" - } - ] - }, - { - "payments": [ + "type": "torv3", + "address": "fp463inc4w3lamhhduytrwdwq6q6uzugtaeapylqfc43agrdnnqsheyd.onion", + "port": 9736 + }, { - "created_index": 2, - "id": 2, - "payment_hash": "c9d4547473d0d646f1fdd8ca7f01803e4d31ceab01df33c79456f9c24b04034e", - "groupid": 1, - "updated_index": 2, - "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "amount_msat": 100000, - "amount_sent_msat": 100002, - "created_at": 1706316468, - "completed_at": 1706316471, - "status": "failed", - "bolt11": "lnbcrt1u1pjmg54nsp5ke626txv6wwwmqmpuy63t3jnu9hqxwj880zsfkkj7jjqagdaz2sqpp5e829garn6rtydu0amr987qvq8exnrn4tq80n83u52muuyjcyqd8qdq8v3jhxccxqyjw5qcqp99qxpqysgqalktfwy9svsamvvvrzzzzpdaa4rh7n6s5p7t9lx7qv0raz4vnm9knkh5ury3u5cmnhx2gms98nxkclm3833uhjrlnzmftc685vz2f0gpfnjy4y" + "type": "torv3", + "address": "ifnntp5ak4homxrti2fp6ckyllaqcike447ilqfrgdw64ayrmkyashid.onion", + "port": 9736 } - ] - }, - { - "payments": [ + ], + "binding": [ { - "created_index": 3, - "id": 3, - "payment_hash": "bbc35e0a46d1483292a4ff8d4daaceaab8c3c084dd835be4128785b52e469c64", - "groupid": 1, - "updated_index": 3, - "partid": 1, - "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "amount_msat": 100000, - "amount_sent_msat": 102100, - "created_at": 1708641193, - "completed_at": 1708641194, - "status": "complete", - "payment_preimage": "a6ebb1cfbf69e76200f196f1eafd28a3d850633499c223a7eb7a7dba3b995286" + "type": "ipv4", + "address": "127.0.0.1", + "port": 9736 } - ] + ], + "version": "v0.10.2", + "blockheight": 724302, + "network": "bitcoin", + "msatoshi_fees_collected": 0, + "fees_collected_msat": "0msat", + "lightning-dir": "/media/vincent/Maxtor/C-lightning/node/bitcoin", + "our_features": { + "init": "8828226aa2", + "node": "80008828226aa2", + "channel": "", + "invoice": "20024200" + } } ], "errors": [ - "On failure, an error is returned. If the lightning process fails before responding, the", - "caller should use lightning-listsentpays(7) or lightning-listpays(7) to query whether this payment was deleted or not.", - "", - "The following error codes may occur:", + "On failure, one of the following error codes may be returned:", "", - "- -32602: Parameter missed or malformed;", - "- 211: Payment status mismatch. Check the correct status via **paystatus**;", - "- 208: Payment with payment_hash not found." + "- -32602: Error in given parameters or some error happened during the command process." ], "author": [ - "Vincenzo Palazzo <> is mainly responsible." + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." ], "see_also": [ - "lightning-listpays(7)", - "lightning-listsendpays(7)", - "lightning-paystatus(7)" + "lightning-connect(7)", + "lightning-fundchannel(7)", + "lightning-listconfigs(7)" ], "resources": [ "Main web site: " ] }, - "lightning-deprecations.json": { + "lightning-getlog.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "added": "v24.02", - "rpc": "deprecations", - "title": "Command to enable/disable deprecated APIs", + "rpc": "getlog", + "title": "Command to show logs.", "description": [ - "The **deprecations** RPC command is used to override global config option `allow-deprecated-apis` for further RPC commands on this same connection. This can be useful for developer testing to ensure you don't accidentally rely on deprecated features." + "The **getlog** the RPC command to show logs, with optional log *level*." ], "request": { - "required": [ - "enable" - ], + "required": [], "properties": { - "enable": { - "type": "boolean", + "level": { + "type": "string", + "enum": [ + "broken", + "unusual", + "info", + "debug", + "io" + ], "description": [ - "Flag to enable or disable deprecated APIs. Setting it to `false` will neither accept deprecated parameters or commands, nor output deprecated fields." - ] + "A string that represents the log level." + ], + "default": "*info*" } } }, "response": { - "properties": {} - }, - "example_json_request": [ - { - "id": "example:deprecations#1", - "method": "deprecations", - "params": { - "enable": false - } - } - ], - "example_json_response": [ - {} - ], - "errors": [ - "On failure, one of the following error codes may be returned:", - "", - "- -32602: Error in given parameters." - ], - "author": [ - "Rusty Russell <> wrote the initial version of this man page." - ], - "see_also": [ - "lightningd-config(5)", - "lightning-notifications(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-disableinvoicerequest.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "added": "v22.11", - "rpc": "disableinvoicerequest", - "title": "Command for removing an invoice request", - "warning": "experimental-offers only", - "description": [ - "The **disableinvoicerequest** RPC command disables an invoice_request, so that no further invoices will be accepted (and thus, no further payments made)..", - "", - "We currently don't support deletion of invoice_requests, so they are not forgotten entirely (there may be payments which refer to this invoice_request)." - ], - "request": { "required": [ - "invreq_id" + "created_at", + "bytes_used", + "bytes_max", + "log" ], "properties": { - "invreq_id": { + "created_at": { "type": "string", "description": [ - "A specific invoice can be disabled by providing the `invreq_id`, which is presented by lightning-invoicerequest(7)." - ] - } - } - }, - "response": { - "required": [ - "invreq_id", - "single_use", - "active", - "bolt12", - "used" - ], - "properties": { - "invreq_id": { - "type": "hash", - "description": [ - "The SHA256 hash of all invoice_request fields less than 160." - ] - }, - "active": { - "type": "boolean", - "enum": [ - false - ], - "description": [ - "Whether the invoice_request is currently active." - ] - }, - "single_use": { - "type": "boolean", - "description": [ - "Whether the invoice_request will become inactive after we pay an invoice for it." + "UNIX timestamp with 9 decimal places, when logging was initialized." ] }, - "bolt12": { - "type": "string", + "bytes_used": { + "type": "u32", "description": [ - "The bolt12 string starting with lnr." + "The number of bytes used by logging records." ] }, - "used": { - "type": "boolean", + "bytes_max": { + "type": "u32", "description": [ - "Whether the invoice_request has already been used." + "The bytes_used values at which records will be trimmed ." ] }, - "label": { - "type": "string", - "description": [ - "The label provided when creating the invoice_request." - ] + "log": { + "type": "array", + "items": { + "type": "object", + "required": [ + "type" + ], + "additionalProperties": true, + "properties": { + "type": { + "type": "string", + "enum": [ + "SKIPPED", + "BROKEN", + "UNUSUAL", + "INFO", + "DEBUG", + "IO_IN", + "IO_OUT" + ] + } + }, + "allOf": [ + { + "if": { + "additionalProperties": true, + "properties": { + "type": { + "enum": [ + "SKIPPED" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "num_skipped" + ], + "properties": { + "type": {}, + "num_skipped": { + "type": "u32", + "description": [ + "Number of unprinted log entries (deleted or below *level* parameter)." + ] + } + } + } + }, + { + "if": { + "additionalProperties": true, + "properties": { + "type": { + "enum": [ + "BROKEN", + "UNUSUAL", + "INFO", + "DEBUG" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "time", + "source", + "log" + ], + "properties": { + "type": {}, + "time": { + "type": "string", + "description": [ + "UNIX timestamp with 9 decimal places after **created_at**." + ] + }, + "source": { + "type": "string", + "description": [ + "The particular logbook this was found in." + ] + }, + "log": { + "type": "string", + "description": [ + "The actual log message." + ] + }, + "node_id": { + "type": "pubkey", + "description": [ + "The peer this is associated with." + ] + } + } + } + }, + { + "if": { + "additionalProperties": true, + "properties": { + "type": { + "enum": [ + "IO_IN", + "IO_OUT" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "time", + "source", + "log", + "data" + ], + "properties": { + "type": {}, + "time": { + "type": "string", + "description": [ + "Seconds after **created_at**, with 9 decimal places." + ] + }, + "source": { + "type": "string", + "description": [ + "The particular logbook this was found in." + ] + }, + "log": { + "type": "string", + "description": [ + "The associated log message." + ] + }, + "node_id": { + "type": "pubkey", + "description": [ + "The peer this is associated with." + ] + }, + "data": { + "type": "hex", + "description": [ + "The IO which occurred." + ] + } + } + } + } + ] + } } - }, - "pre_return_value_notes": [ - "Note: the returned object is the same format as **listinvoicerequest**." - ] + } }, - "author": [ - "Rusty Russell <> is mainly responsible." + "example_json_request": [ + { + "id": "example:getlog#1", + "method": "getlog", + "params": { + "level": "debug" + } + } ], - "see_also": [ - "lightning-invoicerequest(7)", - "lightning-listinvoicerequest(7)" + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters." + ], + "example_json_response": [ + { + "created_at": "1598192543.820753463", + "bytes_used": 89285843, + "bytes_max": 104857600, + "log": [ + { + "type": "SKIPPED", + "num_skipped": 45 + }, + { + "type": "INFO", + "time": "0.453627568", + "source": "plugin-autopilot.py", + "log": "RPCmethod'autopilot-run-once'doesnothaveadocstring." + } + ] + } + ], + "author": [ + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." ], "resources": [ "Main web site: " ] }, - "lightning-disableoffer.json": { + "lightning-getroute.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "disableoffer", - "title": "Command for removing an offer", - "warning": "experimental-offers only", + "rpc": "getroute", + "title": "Command for routing a payment (low-level)", "description": [ - "The **disableoffer** RPC command disables an offer, so that no further invoices will be given out.", + "The **getroute** RPC command attempts to find the best route for the payment of *amount_msat* to lightning node *id*, such that the payment will arrive at *id* with *cltv*.", "", - "We currently don't support deletion of offers, so offers are not forgotten entirely (there may be invoices which refer to this offer)." + "There are two considerations for how good a route is: how low the fees are, and how long your payment will get stuck in a delayed output if a node goes down during the process. ." ], "request": { "required": [ - "offer_id" - ], - "properties": { - "offer_id": { - "type": "hash", - "description": [ - "The id we use to identify this offer." - ] - } - } - }, - "response": { - "required": [ - "offer_id", - "active", - "single_use", - "bolt12", - "used" + "id", + "amount_msat", + "riskfactor" ], "properties": { - "offer_id": { - "type": "hash", + "id": { + "type": "pubkey", "description": [ - "The merkle hash of the offer." + "Node pubkey to find the best route for the payment." ] }, - "active": { - "type": "boolean", - "enum": [ - false - ], + "amount_msat": { + "type": "msat", "description": [ - "Whether the offer can produce invoices/payments." + "Amount to send. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. The 0 value is special: it ignores any *htlc_minimum_msat* setting on channels, and simply returns a possible route (if any) which is useful for simple probing." ] }, - "single_use": { - "type": "boolean", + "riskfactor": { + "type": "u64", "description": [ - "Whether the offer is disabled after first successful use." + "A non-negative floating-point field controls this tradeoff; it is the annual cost of your funds being stuck (as a percentage). For example, if you thought the convenience of keeping your funds liquid (not stuck) was worth 20% per annum interest, *riskfactor* would be 20. If you didn't care about risk, *riskfactor* would be zero." ] }, - "bolt12": { - "type": "string", + "cltv": { + "type": "u32", "description": [ - "The bolt12 string representing this offer." - ] + "Cltv-blocks to spare." + ], + "default": "9" }, - "used": { - "type": "boolean", + "fromid": { + "type": "pubkey", "description": [ - "Whether the offer has had an invoice paid / payment made." - ] + "The node to start the route from." + ], + "default": "this node" }, - "label": { - "type": "string", + "fuzzpercent": { + "type": "u32", "description": [ - "The label provided when offer was created." + "Used to distort fees to provide some randomization to the route generated, but it was not properly implemented and is ignored." ] - } - }, - "pre_return_value_notes": [ - "Note: the returned object is the same format as **listoffers**." - ] - }, - "example_json_request": [ - { - "id": "example:disableoffer#1", - "method": "disableoffer", - "params": { - "offer_id": "713a16ccd4eb10438bdcfbc2c8276be301020dd9d489c530773ba64f3b33307d" - } - } - ], - "example_json_response": [ - { - "offer_id": "053a5c566fbea2681a5ff9c05a913da23e45b95d09ef5bd25d7d408f23da7084", - "active": false, - "single_use": false, - "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqvqcdgq2z9pk7enxv4jjqen0wgs8yatnw3ujz83qkc6rvp4j28rt3dtrn32zkvdy7efhnlrpr5rp5geqxs783wtlj550qs8czzku4nk3pqp6m593qxgunzuqcwkmgqkmp6ty0wyvjcqdguv3pnpukedwn6cr87m89t74h3auyaeg89xkvgzpac70z3m9rn5xzu28c", - "used": false - } - ], - "author": [ - "Rusty Russell <> is mainly responsible." - ], - "see_also": [ - "lightning-offer(7)", - "lightning-listoffers(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-disconnect.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "disconnect", - "title": "Command for disconnecting from another lightning node", - "description": [ - "The disconnect RPC command closes an existing connection to a peer, identified by *id*, in the Lightning Network, as long as it doesn't have an active channel." - ], - "request": { - "required": [ - "id" - ], - "properties": { - "id": { - "type": "pubkey", + }, + "exclude": { + "type": "array", "description": [ - "The public key of the peer to terminate the connection. It can be discovered in the output of the listpeers command, which returns a set of peers:", - "{", - " 'peers':", - " [", - " {", - " 'id': '0563aea81...',", - " 'connected': true,", - " ...", - " }", - " ]", - "}" - ] + "A JSON array of short-channel-id/direction (e.g. ['564334x877x1/0', '564195x1292x0/1' ]) or node-id which should be excluded from consideration for routing. Note if the source or destination is excluded, the command result is undefined." + ], + "default": "not to exclude any channels or nodes", + "items": { + "type": "string" + } }, - "force": { - "type": "boolean", + "maxhops": { + "type": "u32", "description": [ - "If set to True, it will disconnect even with an active channel." - ] - } - } - }, - "response": { - "properties": {} - }, - "errors": [ - "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", - "", - "- -32602: If the given parameters are wrong.", - "- -1: Catchall nonspecific error." - ], - "example_json_request": [ - { - "id": "example:disconnect#1", - "method": "disconnect", - "params": { - "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "force": false - } - }, - { - "id": "example:disconnect#2", - "method": "disconnect", - "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "force": true + "The maximum number of channels to return." + ], + "default": "20" } } - ], - "example_json_response": [ - {}, - {} - ], - "author": [ - "Michael Hawkins <>." - ], - "see_also": [ - "lightning-connect(1)", - "lightning-listpeers(1)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-emergencyrecover.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "emergencyrecover", - "title": "Command for recovering channels from the emergency.recovery file in the lightning directory", - "description": [ - "The **emergencyrecover** RPC command fetches data from the emergency.recover file and tries to reconnect to the peer and force him to close the channel. The data in this file has enough information to reconnect and sweep the funds.", - "", - "This recovery method is not spontaneous and it depends on the peer, so it should be used as a last resort to recover the funds stored in a channel in case of severe data loss." - ], - "request": { - "required": [], - "properties": {} }, "response": { "required": [ - "stubs" + "route" ], "properties": { - "stubs": { + "route": { "type": "array", "items": { - "type": "hash", - "description": [ - "Channel IDs of channels successfully inserted." - ] - } - } - } - }, - "example_json_request": [ - { - "id": "example:emergencyrecover#1", - "method": "emergencyrecover", - "params": "{}" - }, - { - "id": "example:emergencyrecover#2", - "method": "emergencyrecover", - "params": "{}" - } - ], - "example_json_response": [ - { - "stubs": [] - }, - { - "stubs": [ - "c00734472f344fdadd0bf787de182e5cf144ccda5d731b0f7c75befd1f1eff52" - ] + "type": "object", + "required": [ + "id", + "direction", + "channel", + "amount_msat", + "delay", + "style" + ], + "additionalProperties": false, + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The node at the end of this hop." + ] + }, + "channel": { + "type": "short_channel_id", + "description": [ + "The channel joining these nodes." + ] + }, + "direction": { + "type": "u32", + "description": [ + "0 if this channel is traversed from lesser to greater **id**, otherwise 1." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount expected by the node at the end of this hop." + ] + }, + "delay": { + "type": "u32", + "description": [ + "The total CLTV expected by the node at the end of this hop." + ] + }, + "style": { + "type": "string", + "description": [ + "The features understood by the destination node." + ], + "enum": [ + "tlv" + ] + } + } + } + } + }, + "post_return_value_notes": [ + "The final *id* will be the destination *id* given in the input. The difference between the first *amount_msat* minus the *amount_msat* given in the input is the fee (assuming the first hop is free). The first *delay* is the very worst case timeout for the payment failure, in blocks." + ] + }, + "riskfactor_effect_on_routing": [ + "The risk factor is treated as if it were an additional fee on the route, for the purposes of comparing routes.", + "", + "The formula used is the following approximation:", + "", + " risk-fee = amount x blocks-timeout x per-block-cost", + "", + "We are given a *riskfactor* expressed as a percentage. There are 52596 blocks per year, thus *per-block-cost* is *riskfactor* divided by 5,259,600.", + "", + "The final result is:", + "", + " risk-fee = amount x blocks-timeout x riskfactor / 5259600", + "", + "Here are the risk fees in millisatoshis, using various parameters. I assume a channel charges the default of 1000 millisatoshis plus 1 part-per-million. Common to_self_delay values on the network at 14 and 144 blocks.", + "", + "
", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "
Amount (msat)RiskfactorDelayRisk FeeRoute fee

10,000

1

14

0

1001

10,000

10

14

0

1001

10,000

100

14

2

1001

10,000

1000

14

26

1001

1,000,000

1

14

2

1001

1,000,000

10

14

26

1001

1,000,000

100

14

266

1001

1,000,000

1000

14

2661

1001

100,000,000

1

14

266

1100

100,000,000

10

14

2661

1100

100,000,000

100

14

26617

1100

100,000,000

1000

14

266179

1100

10,000

1

144

0

1001

10,000

10

144

2

1001

10,000

100

144

27

1001

10,000

1000

144

273

1001

1,000,000

1

144

27

1001

1,000,000

10

144

273

1001

1,000,000

100

144

2737

1001

1,000,000

1000

144

27378

1001

100,000,000

1

144

2737

1100

100,000,000

10

144

27378

1100

100,000,000

100

144

273785

1100

100,000,000

1000

144

2737850

1100

" + ], + "recommended_riskfactor_values": [ + "The default *fuzz* factor is 5%, so as you can see from the table above, that tends to overwhelm the effect of *riskfactor* less than about 5.", + "", + "1 is a conservative value for a stable lightning network with very few failures.", + "", + "1000 is an aggressive value for trying to minimize timeouts at all costs.", + "", + "The default for lightning-pay(7) is 10, which starts to become a major factor for larger amounts, and is basically ignored for tiny ones." + ], + "example_json_request": [ + { + "id": "example:getroute#1", + "method": "getroute", + "params": { + "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "amount_msat": 50000000, + "riskfactor": 1, + "cltv": 9, + "fromid": null, + "fuzzpercent": null, + "exclude": null, + "maxhops": null + } + }, + { + "id": "example:getroute#2", + "method": "getroute", + "params": { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount_msat": "50000sat", + "riskfactor": 10 + } + } + ], + "example_json_response": [ + { + "route": [ + { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "channel": "103x3x0", + "direction": 1, + "amount_msat": 50001002, + "delay": 21, + "style": "tlv" + }, + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "channel": "103x1x0", + "direction": 1, + "amount_msat": 50000501, + "delay": 15, + "style": "tlv" + }, + { + "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "channel": "103x2x0", + "direction": 0, + "amount_msat": 50000000, + "delay": 9, + "style": "tlv" + } + ] + }, + { + "route": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "channel": "103x2x0", + "direction": 1, + "amount_msat": 50051000, + "delay": 15, + "style": "tlv" + }, + { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "channel": "103x1x0", + "direction": 0, + "amount_msat": 50000000, + "delay": 9, + "style": "tlv" + } + ] } ], "author": [ - "Aditya <> is mainly responsible." + "Rusty Russell <> is mainly responsible." ], "see_also": [ - "lightning-getsharedsecret(7)" + "lightning-pay(7)", + "lightning-sendpay(7)" ], "resources": [ "Main web site: " ] }, - "lightning-feerates.json": { + "lightning-help.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "feerates", - "title": "Command for querying recommended onchain feerates", + "rpc": "help", + "title": "Command to return all information about RPC commands.", "description": [ - "The **feerates** command returns the feerates that CLN will use. The feerates will be based on the recommended feerates from the backend. The backend may fail to provide estimates, but if it was able to provide estimates in the past, CLN will continue to use those for a while. CLN will also smoothen feerate estimations from the backend.", - "", - "Explorers often present fees in \"sat/vB\": 4 sat/vB is `4000perkb` or `1000perkw`.", - "", - "Bitcoin transactions have non-witness and witness bytes:", - "", - "* Non-witness bytes count as 4 weight, 1 virtual byte. All bytes other than SegWit witness count as non-witness bytes. * Witness bytes count as 1 weight, 0.25 virtual bytes.", - "", - "Thus, all *perkb* feerates will be exactly 4 times *perkw* feerates.", - "", - "To compute the fee for a transaction, multiply its weight or virtual bytes by the appropriate *perkw* or *perkw* feerate returned by this command, then divide by 1000.", + "The **help** is a RPC command which is possible consult all information about the RPC commands, or a specific command if *command* is given.", "", - "There is currently no way to change these feerates from the RPC. If you need custom control over onchain feerates, you will need to provide your own plugin that replaces the `bcli` plugin backend. For commands like lightning-withdraw(7) or lightning-fundchannel(7) you can provide a preferred feerate directly as a parameter, which will override the recommended feerates returned by **feerates**." + "Note that the lightning-cli(1) tool will prefer to list a man page when a specific *command* is specified, and will only return the JSON if the man page is not found." ], "request": { - "required": [ - "style" - ], + "required": [], "properties": { - "style": { + "command": { "type": "string", "description": [ - "Fee rate style to use. This can be:", - " *perkw* - provide feerate in units of satoshis per 1000 weight (e.g. the minimum fee is usually `253perkw`).", - " *perkb* - provide feerate in units of satoshis per 1000 virtual bytes (eg. the minimum fee is usually `1000perkb`)." - ], - "enum": [ - "perkb", - "perkw" + "Command to get information about." ] } } }, "response": { - "required": [], + "required": [ + "help" + ], "properties": { - "warning_missing_feerates": { + "help": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "command", + "category", + "description", + "verbose" + ], + "properties": { + "command": { + "type": "string", + "description": [ + "The command." + ] + }, + "category": { + "type": "string", + "description": [ + "The category for this command (useful for grouping)." + ] + }, + "description": { + "type": "string", + "description": [ + "A one-line description of the purpose of this command." + ] + }, + "verbose": { + "type": "string", + "description": [ + "A full description of this command (including whether it's deprecated)." + ] + } + } + } + }, + "format-hint": { "type": "string", + "enum": [ + "simple" + ], "description": [ - "Some fee estimates are missing." + "Prints the help in human-readable flat form." ] - }, - "perkb": { - "type": "object", + } + } + }, + "example_json_request": [ + { + "id": "example:help#1", + "method": "help", + "params": { + "command": "pay" + } + }, + { + "id": "example:help#2", + "method": "help", + "params": { + "command": "dev" + } + } + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters." + ], + "example_json_response": [ + { + "help": [ + { + "command": "pay bolt11 [amount_msat] [label] [riskfactor] [maxfeepercent] [retry_for] [maxdelay] [exemptfee] [localinvreqid] [exclude] [maxfee] [description] [dev_use_shadow]", + "category": "plugin", + "description": "Send payment specified by {bolt11}", + "verbose": "Attempt to pay the {bolt11} invoice." + } + ], + "format-hint": "simple" + }, + { + "help": [ + { + "command": "dev subcommand=crash|rhash|slowcmd", + "category": "developer", + "description": "Developer command test multiplexer", + "verbose": "dev rhash {secret}\n\tShow SHA256 of {secret}\ndev crash\n\tCrash lightningd by calling fatal()\ndev slowcmd {msec}\n\tTorture test for slow commands, optional {msec}\n" + } + ], + "format-hint": "simple" + } + ], + "author": [ + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-invoice.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "invoice", + "title": "Command for accepting payments", + "description": [ + "The **invoice** RPC command creates the expectation of a payment of a given amount of milli-satoshi: it returns a unique token which another lightning daemon can use to pay this invoice. This token includes a *route hint* description of an incoming channel with capacity to pay the invoice, if any exists." + ], + "request": { + "required": [ + "amount_msat", + "label", + "description" + ], + "properties": { + "amount_msat": { + "type": "msat_or_any", "description": [ - "If *style* parameter was perkb." - ], - "additionalProperties": false, - "required": [ - "min_acceptable", - "max_acceptable", - "floor", - "estimates" - ], - "properties": { - "min_acceptable": { - "type": "u32", - "description": [ - "The smallest feerate that we allow peers to specify: half the 100-block estimate." - ] - }, - "max_acceptable": { - "type": "u32", - "description": [ - "The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet)." - ] - }, - "floor": { - "type": "u32", - "added": "v23.05", - "description": [ - "The smallest feerate that our backend tells us it will accept (i.e. minrelayfee or mempoolminfee)." - ] - }, - "estimates": { - "type": "array", - "added": "v23.05", - "description": [ - "Feerate estimates from plugin which we are using (usuallly bcli)." - ], - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "blockcount", - "feerate", - "smoothed_feerate" - ], - "properties": { - "blockcount": { - "type": "u32", - "added": "v23.05", - "description": [ - "The number of blocks the feerate is expected to get a transaction in." - ] - }, - "feerate": { - "type": "u32", - "added": "v23.05", - "description": [ - "The feerate for this estimate, in given *style*." - ] - }, - "smoothed_feerate": { - "type": "u32", - "added": "v23.05", - "description": [ - "The feerate, smoothed over time (useful for coordinating with other nodes)." - ] - } - } - } - }, - "opening": { - "type": "u32", - "description": [ - "Default feerate for lightning-fundchannel(7) and lightning-withdraw(7)." - ] - }, - "mutual_close": { - "type": "u32", - "description": [ - "Feerate to aim for in cooperative shutdown. Note that since mutual close is a **negotiation**, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer." - ] - }, - "unilateral_close": { - "type": "u32", - "description": [ - "Feerate for commitment_transaction in a live channel which we originally funded." - ] - }, - "unilateral_anchor_close": { - "type": "u32", - "added": "v23.08", - "description": [ - "Feerate for commitment_transaction in a live channel which we originally funded (if anchor_outputs was negotiated)." - ] - }, - "delayed_to_us": { - "type": "u32", - "deprecated": [ - "v23.05", - "v24.05" - ], - "description": [ - "Feerate for returning unilateral close funds to our wallet." - ] - }, - "htlc_resolution": { - "type": "u32", - "deprecated": [ - "v23.05", - "v24.05" - ], - "description": [ - "Feerate for returning unilateral close HTLC outputs to our wallet." - ] + "The string `any`, which creates an invoice that can be paid with any amount. Otherwise it is a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*." + ] + }, + "label": { + "oneOf": [ + { + "type": "string" }, - "penalty": { - "type": "u32", - "description": [ - "Feerate to use when creating penalty tx for watchtowers." - ] + { + "type": "integer" } - } + ], + "description": [ + "A unique string or number (which is treated as a string, so `01` is different from `1`); it is never revealed to other nodes on the lightning network, but it can be used to query the status of this invoice." + ] }, - "perkw": { - "type": "object", + "description": { + "type": "string", "description": [ - "If *style* parameter was perkw." + "A short description of purpose of payment, e.g. *1 cup of coffee*. This value is encoded into the BOLT11 invoice and is viewable by any node you send this invoice to (unless *deschashonly* is true as described below). It must be UTF-8, and cannot use *\\u* JSON escape codes." + ] + }, + "expiry": { + "type": "u64", + "description": [ + "The time the invoice is valid for, in seconds. If no value is provided the default of 604800 (1 week) is used." + ] + }, + "fallbacks": { + "type": "array", + "description": [ + "One or more fallback addresses to include in the invoice (in order from most- preferred to least): note that these arrays are not currently tracked to fulfill the invoice." ], - "additionalProperties": false, - "required": [ - "min_acceptable", - "max_acceptable", - "floor", - "estimates" + "items": { + "type": "string" + } + }, + "preimage": { + "type": "hex", + "description": [ + "A 64-digit hex string to be used as payment preimage for the created invoice. By default, if unspecified, lightningd will generate a secure pseudorandom preimage seeded from an appropriate entropy source on your system. **IMPORTANT**: if you specify the *preimage*, you are responsible, to ensure appropriate care for generating using a secure pseudorandom generator seeded with sufficient entropy, and keeping the preimage secret. This parameter is an advanced feature intended for use with cutting-edge cryptographic protocols and should not be used unless explicitly needed." + ] + }, + "exposeprivatechannels": { + "description": [ + "If specified, it overrides the default route hint logic, which will use unpublished channels only if there are no published channels." ], - "properties": { - "min_acceptable": { - "type": "u32", - "description": [ - "The smallest feerate that you can use, usually the minimum relayed feerate of the backend." - ] - }, - "max_acceptable": { - "type": "u32", - "description": [ - "The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet)." - ] - }, - "floor": { - "type": "u32", - "added": "v23.05", + "oneOf": [ + { + "type": "boolean", "description": [ - "The smallest feerate that our backend tells us it will accept (i.e. minrelayfee or mempoolminfee)." + "If *True* unpublished channels are always considered as a route hint candidate; if *False*, never." ] }, - "estimates": { + { "type": "array", - "added": "v23.05", "description": [ - "Feerate estimates from plugin which we are using (usuallly bcli)." + "Array of short channel ids (or a remote alias), only those specific channels will be considered candidates, even if they are public or dead-ends." ], "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "blockcount", - "feerate", - "smoothed_feerate" - ], - "properties": { - "blockcount": { - "type": "u32", - "added": "v23.05", - "description": [ - "The number of blocks the feerate is expected to get a transaction in." - ] - }, - "feerate": { - "type": "u32", - "added": "v23.05", - "description": [ - "The feerate for this estimate, in given *style*." - ] - }, - "smoothed_feerate": { - "type": "u32", - "added": "v23.05", - "description": [ - "The feerate, smoothed over time (useful for coordinating with other nodes)." - ] - } - } + "type": "short_channel_id" } }, - "opening": { - "type": "u32", - "description": [ - "Default feerate for lightning-fundchannel(7) and lightning-withdraw(7)." - ] - }, - "mutual_close": { - "type": "u32", - "description": [ - "Feerate to aim for in cooperative shutdown. Note that since mutual close is a **negotiation**, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer." - ] - }, - "unilateral_close": { - "type": "u32", - "description": [ - "Feerate for commitment_transaction in a live channel which we originally funded (if anchor_outputs was not negotiated)." - ] - }, - "unilateral_anchor_close": { - "type": "u32", - "added": "v23.08", - "description": [ - "Feerate for commitment_transaction in a live channel which we originally funded (if anchor_outputs was negotiated)." - ] - }, - "delayed_to_us": { - "type": "u32", - "deprecated": [ - "v23.05", - "v24.05" - ], - "description": [ - "Feerate for returning unilateral close funds to our wallet." - ] - }, - "htlc_resolution": { - "type": "u32", - "deprecated": [ - "v23.05", - "v24.05" - ], - "description": [ - "Feerate for returning unilateral close HTLC outputs to our wallet." - ] - }, - "penalty": { - "type": "u32", - "description": [ - "Feerate to use when creating penalty tx for watchtowers." - ] - } - } - }, - "onchain_fee_estimates": { - "type": "object", - "additionalProperties": false, - "required": [ - "opening_channel_satoshis", - "mutual_close_satoshis", - "unilateral_close_satoshis", - "htlc_timeout_satoshis", - "htlc_success_satoshis" - ], - "properties": { - "opening_channel_satoshis": { - "type": "u64", - "description": [ - "Estimated cost of typical channel open." - ] - }, - "mutual_close_satoshis": { - "type": "u64", - "description": [ - "Estimated cost of typical channel close." - ] - }, - "unilateral_close_satoshis": { - "type": "u64", - "description": [ - "Estimated cost of typical unilateral close (without HTLCs). If anchors are supported, this assumes a channel with anchors." - ] - }, - "unilateral_close_nonanchor_satoshis": { - "added": "v23.08", - "type": "u64", - "description": [ - "Estimated cost of non-anchor typical unilateral close (without HTLCs)." - ] - }, - "htlc_timeout_satoshis": { - "type": "u64", - "description": [ - "Estimated cost of typical HTLC timeout transaction (non-anchors)." - ] - }, - "htlc_success_satoshis": { - "type": "u64", + { + "type": "short_channel_id", "description": [ - "Estimated cost of typical HTLC fulfillment transaction (non-anchors)." + "If it is a short channel id (e.g. *1x1x3*), only this specific channel will be considered candidate, even if it is public or dead-end." ] } - } - } - } - }, - "errors": [ - "The **feerates** command will never error, however some fields may be missing in the result if feerate estimates for that kind of transaction are unavailable." - ], - "notes": [ - "Many other commands have a *feerate* parameter. This can be:", - "", - "* One of the strings to use lightningd's internal estimates:", - " * *urgent* (next 6 blocks or so)", - " * *normal* (next 12 blocks or so)", - " * *slow* (next 100 blocks or so)", - " * *minimum* for the lowest value bitcoind will currently accept (added in v23.05)", - "", - "* A number, with an optional suffix:", - " * *blocks* means aim for confirmation in that many blocks (added in v23.05)", - " * *perkw* means the number is interpreted as satoshi-per-kilosipa (weight)", - " * *perkb* means it is interpreted bitcoind-style as satoshi-per-kilobyte. ", - "", - "Omitting the suffix is equivalent to *perkb*." - ], - "trivia": [ - "In C-lightning we like to call the weight unit \"sipa\" in honor of Pieter Wuille, who uses the name \"sipa\" on IRC and elsewhere. Internally we call the *perkw* style as \"feerate per kilosipa\"." - ], - "example_json_request": [ - { - "id": "example:feerates#1", - "method": "feerates", - "params": { - "style": "perkw", - "urgent": null, - "normal": null, - "slow": null - } - }, - { - "id": "example:feerates#2", - "method": "feerates", - "params": { - "style": "perkb", - "urgent": null, - "normal": null, - "slow": null - } - } - ], - "example_json_response": [ - { - "perkw": { - "opening": 1000000, - "mutual_close": 26362, - "unilateral_close": 26362, - "unilateral_anchor_close": 1000000, - "penalty": 26362, - "min_acceptable": 3750, - "max_acceptable": 10000000, - "floor": 253, - "estimates": [ - { - "blockcount": 2, - "feerate": 1000000, - "smoothed_feerate": 26362 - }, - { - "blockcount": 6, - "feerate": 1000000, - "smoothed_feerate": 26362 - }, - { - "blockcount": 12, - "feerate": 1000000, - "smoothed_feerate": 26362 - }, - { - "blockcount": 100, - "feerate": 1000000, - "smoothed_feerate": 26362 - } ] }, - "onchain_fee_estimates": { - "opening_channel_satoshis": 702000, - "mutual_close_satoshis": 17741, - "unilateral_close_satoshis": 1112000, - "unilateral_close_nonanchor_satoshis": 15764, - "htlc_timeout_satoshis": 17478, - "htlc_success_satoshis": 18532 - } - }, - { - "perkb": { - "opening": 25000, - "mutual_close": 25000, - "unilateral_close": 44000, - "unilateral_anchor_close": 25000, - "penalty": 25000, - "min_acceptable": 12500, - "max_acceptable": 600000, - "floor": 1012, - "estimates": [ - { - "blockcount": 2, - "feerate": 60000, - "smoothed_feerate": 60000 - }, - { - "blockcount": 6, - "feerate": 44000, - "smoothed_feerate": 44000 - }, - { - "blockcount": 12, - "feerate": 25000, - "smoothed_feerate": 25000 - } + "cltv": { + "type": "u32", + "description": [ + "If specified, sets the *min_final_cltv_expiry* for the invoice. Otherwise, it's set to the parameter **cltv-final**." ] }, - "onchain_fee_estimates": { - "opening_channel_satoshis": 4387, - "mutual_close_satoshis": 4206, - "unilateral_close_satoshis": 6578, - "unilateral_close_nonanchor_satoshis": 6578, - "htlc_timeout_satoshis": 7293, - "htlc_success_satoshis": 7733 + "deschashonly": { + "type": "boolean", + "description": [ + "If True, then the bolt11 returned contains a hash of the *description*, rather than the *description* itself: this allows much longer descriptions, but they must be communicated via some other mechanism." + ], + "default": "False" } } - ], - "author": [ - "ZmnSCPxj <> wrote the initial version of this manpage." - ], - "see_also": [ - "lightning-parsefeerate(7)", - "lightning-fundchannel(7)", - "lightning-withdraw(7)", - "lightning-txprepare(7)", - "lightning-fundchannel_start(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-fetchinvoice.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "fetchinvoice", - "title": "Command for fetch an invoice for an offer", - "warning": "experimental-offers only", - "description": [ - "The **fetchinvoice** RPC command contacts the issuer of an *offer* to get an actual invoice that can be paid. It highlights any changes between the offer and the returned invoice.", - "", - "If **fetchinvoice-noconnect** is not specified in the configuation, it will connect to the destination in the (currently common!) case where it cannot find a route which supports `option_onion_messages`." - ], - "request": { + }, + "response": { "required": [ - "offer" + "payment_hash", + "expires_at", + "created_index", + "bolt11", + "payment_secret" ], "properties": { - "offer": { + "bolt11": { "type": "string", "description": [ - "Offer string to get an actual invoice that can be paid." + "The bolt11 string." ] }, - "amount_msat": { - "type": "msat", + "payment_hash": { + "type": "hash", "description": [ - "Required if the offer does not specify an amount at all, otherwise it is optional (but presumably if you set it to less than the offer, you will get an error from the issuer)." + "The hash of the *payment_preimage* which will prove payment." ] }, - "quantity": { - "type": "u64", + "payment_secret": { + "type": "secret", "description": [ - "Required if the offer specifies quantity_max, otherwise it is not allowed." + "The *payment_secret* to place in the onion." ] }, - "recurrence_counter": { + "expires_at": { "type": "u64", "description": [ - "Required if the offer specifies recurrence, otherwise it is not allowed. recurrence_counter should first be set to 0, and incremented for each successive invoice in a given series." + "UNIX timestamp of when invoice expires." ] }, - "recurrence_start": { - "type": "number", + "created_index": { + "type": "u64", + "added": "v23.08", "description": [ - "Required if the offer specifies recurrence_base with start_any_period set, otherwise it is not allowed. It indicates what period number to start at." + "1-based index indicating order this invoice was created in." ] }, - "recurrence_label": { + "warning_capacity": { "type": "string", "description": [ - "Required if recurrence_counter is set, and otherwise is not allowed. It must be the same as prior fetchinvoice calls for the same recurrence, as it is used to link them together." + "Even using all possible channels, there's not enough incoming capacity to pay this invoice." ] }, - "timeout": { - "type": "number", + "warning_offline": { + "type": "string", "description": [ - "If we don't get a reply before this we fail (default, 60 seconds)." + "There would be enough incoming capacity, but some channels are offline, so there isn't." ] }, - "payer_note": { + "warning_deadends": { "type": "string", "description": [ - "To ask the issuer to include in the fetched invoice." + "There would be enough incoming capacity, but some channels are dead-ends (no other public channels from those peers), so there isn't." ] - } - } - }, - "response": { - "required": [ - "invoice", - "changes" - ], - "properties": { - "invoice": { + }, + "warning_private_unused": { "type": "string", "description": [ - "The BOLT12 invoice we fetched." + "There would be enough incoming capacity, but some channels are unannounced and *exposeprivatechannels* is *false*, so there isn't." ] }, - "changes": { - "type": "object", - "description": [ - "Summary of changes from offer." - ], - "additionalProperties": false, - "required": [], - "properties": { - "description_appended": { - "type": "string", - "description": [ - "Extra characters appended to the *description* field." - ] - }, - "description": { - "type": "string", - "description": [ - "A completely replaced *description* field." - ] - }, - "vendor_removed": { - "type": "string", - "description": [ - "The *vendor* from the offer, which is missing in the invoice." - ] - }, - "vendor": { - "type": "string", - "description": [ - "A completely replaced *vendor* field." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "The amount, if different from the offer amount multiplied by any *quantity* (or the offer had no amount, or was not in BTC)." - ] - } - } - }, - "next_period": { - "type": "object", + "warning_mpp": { + "type": "string", "description": [ - "Only for recurring invoices if the next period is under the *recurrence_limit*." - ], - "additionalProperties": false, - "required": [ - "counter", - "starttime", - "endtime", - "paywindow_start", - "paywindow_end" - ], - "properties": { - "counter": { - "type": "u64", - "description": [ - "The index of the next period to fetchinvoice." - ] - }, - "starttime": { - "type": "u64", - "description": [ - "UNIX timestamp that the next period starts." - ] - }, - "endtime": { - "type": "u64", - "description": [ - "UNIX timestamp that the next period ends." - ] - }, - "paywindow_start": { - "type": "u64", - "description": [ - "UNIX timestamp of the earliest time that the next invoice can be fetched." - ] - }, - "paywindow_end": { - "type": "u64", - "description": [ - "UNIX timestamp of the latest time that the next invoice can be fetched." - ] - } - } + "There is sufficient capacity, but not in a single channel, so the payer will have to use multi-part payments." + ] } } }, "errors": [ + "On failure, an error is returned and no invoice is created. If the", + "lightning process fails before responding, the caller should use", + "lightning-listinvoices(7) to query whether this invoice was created or", + "not.", + "", "The following error codes may occur:", "", "- -1: Catchall nonspecific error.", - "- 1002: Offer has expired.", - "- 1003: Cannot find a route to the node making the offer.", - "- 1004: The node making the offer returned an error message.", - "- 1005: We timed out trying to fetch an invoice." + "- 900: An invoice with the given *label* already exists.", + "- 901: An invoice with the given *preimage* already exists.", + "- 902: None of the specified *exposeprivatechannels* were usable." ], "example_json_request": [ { - "id": "example:fetchinvoice#1", - "method": "fetchinvoice", - "params": { - "offer": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqypq5zmnd9khqmr9yp6x2um5zcssxhftzxfdlwsnfcgw2sy8t5mxa0ytcdfat2nkdwqvpy9nnsa9mzza", - "payer_note": "Thanks for the fish!" - } - }, - { - "id": "example:fetchinvoice#2", - "method": "fetchinvoice", + "id": "example:invoice#1", + "method": "invoice", "params": { - "offer": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqypq5zmnd9khqmr9yp6x2um5zcssxhftzxfdlwsnfcgw2sy8t5mxa0ytcdfat2nkdwqvpy9nnsa9mzza", - "amount_msat": 3 + "amount_msat": 11000000, + "label": "xEoCR94SIz6UIRUEkxum", + "description": [ + "XEoCR94SIz6UIRUEkxum." + ], + "expiry": null, + "fallbacks": null, + "preimage": null, + "exposeprivatechannels": null, + "cltv": null, + "deschashonly": null } }, { - "id": "example:fetchinvoice#3", - "method": "fetchinvoice", + "id": "example:invoice#2", + "method": "invoice", "params": { - "offer": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqypq5zmnd9khqmr9yp6x2um5zsqs593pqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4j", - "quantity": 2 + "amount_msat": 100, + "label": "8", + "description": "inv", + "expiry": null, + "fallbacks": null, + "preimage": null, + "exposeprivatechannels": null, + "cltv": null, + "deschashonly": null } } ], "example_json_response": [ { - "invoice": "lni1qqgvcm9h7yakcmw4mzazspu8vfgpwq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqgzpg9hx6tdwpkx2gr5v4ehg93pqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky965pqqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy84sggren772kj8mau5jp86nc6fszx48rv7ep0quszyyls8rlld3sshjr94j9z5dpsku6mnypnx7u3qw35x2grxd9eksgdqnqp462c3jt0m5y6wzrj5pp6axehtez7r20265antsrqfpvuu8fwcshgr0tsv8e6829e8xmv7laz0kwhtlx6vtk8q3d6rtthdhtwvnn6j585szquc2t7us8kguxypzasg8ewkakgx2ny5ugks0f32x67sm9e5fms4asqrylajc2dqh8ag55mv5p5ghy3e2z8zwmllle8uu7jsxv5ke8d6rr5h7kthmz7ya0hxp4nt7elvw7vghcl6fgsuqqqqqqqqqqqqqqq9qqqqqqqqqqqqq8fykt06c5sqqqqqpfqyvhtunn4gyzy0lphn4wn6ctzlsajy46wscjcglf3hxcnvlaxqs3ydkhgaklsc42spq2czzq6a9vge9ha6zd8ppe2qsawnvm4u30p484d2we4cpsyskwwr5hvgthcyqyuen02ejwpa9cjjrttvp223yxsqkrwnlaszkhas84w0ape300ued4p75xu3cqtcg0cslsx9fvh7dhdqx565t6wa0alf6u2hug90j2hs", - "changes": {} - }, - { - "invoice": "lni1qqg0mfchkz0gkmn8zzu5zaxd0qvlzq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqgzpg9hx6tdwpkx2gr5v4ehg93pqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky965pqqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy84yqgrtqss8d4vgzd3286u9rk0zg9qr7a6z2xm6mjnz9pydztcn0j74tjvch0f5zvqxhftzxfdlwsnfcgw2sy8t5mxa0ytcdfat2nkdwqvpy9nnsa9mzzaqth4fzjqxxmsaxvc4v2urs6hsh6k0e564x00g68vuyp5w7yjedzxvqgr8ltzmj0n7ltxr0tz9rafn9zcy9jldjqfuf20w6gjmr7nj04d360sqvkdwprxn22dlp3xay9yq4nhrw2jm0c8t6r7japhdad6leawxyqzkg92tx8gqxp9f2d8j5k2axta0gr7yr9zrsqqqqqqqqqqqqqqq5qqqqqqqqqqqqqayjedltzjqqqqqq9yq3ja0jwj4qswt3kgs9mxq7gck66x60m5rndykpw3a7hf4ntlp9qe2vgwzzrvcwd2qypmqggrt543ryklhgf5uy89gzr46dnwhj9ux5744fmxhqxqjzeecwja3pwlqsxyjcdwur4hl4qf7nsjgg8euvy45lznufh5kydkwz6llsucuhvwp9ezeggaj3k057ge6ftvaffjkwn6j3y7faeuysrx3m2xccphu65sx", - "changes": {} + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "expires_at": 1706757730, + "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk", + "payment_secret": "82644944d3f70d42aad1d5f7b5d7a629e7afa30b529cc952a4c59fc0e3790ea2", + "created_index": 1, + "warning_deadends": "Insufficient incoming capacity, once dead-end peers were excluded" }, { - "invoice": "lni1qqgd508mv9rpjg2ec8dr8qcslf2cjq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqgzpg9hx6tdwpkx2gr5v4ehg9qppgtzzq3dygmzpg6e53ll0aavg37gt3rvjg762vufygdqq4xprs0regcat9gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02cqsykppqfkyy6q8ry9pchxtuajh456hhcf7dxx733cx76etuv5ftfmfa2ymhgycqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jq6uhkeymz26zx7zgw4gdmw2vj9xqn4hu2sqxhp0pcgt87pf9chyfvqsywtejxjh603kx7am3zaf6d6xuumw30p8zmcdz7r95nn4lr92exk3qqe2x6xqwpdzh2zwq3vnyra8nfc6d7y6hegpkvc7p2nulj7hvhwl5hjfr23wn60mjftqspn7d4ejhrpsr5m2y8qqqqqqqqqqqqqqqpgqqqqqqqqqqqqp6f9jm7k9yqqqqqq2gpr96l9mt2pqxuyr0gqw92h0xz2y2uy5uxss4ujcac5jehj9ay2sxkapr80t5ha65qgykqssytfzxcs2xkdy0lml0tzy0jzugmyj8kjn8zfzrgq9fsgurc72x82e7pqxhl4u29cjluw5s8fwa9wtvh0qytr7vqk0vtndsz07mrrtmjw629m8mnqkjaf43kt889qeq2f7deu6t853lngpzclapt8nj0g528v9ay", - "changes": {} + "payment_hash": "f59ae0204dfe8e913207ea36646255b9d2c7c8229e8693d30547fc622eddb6b4", + "expires_at": 1709229182, + "bolt11": "lnbcrt1n1pja0z07sp5n8fk890nrq7zlcue0lgu7cduaaz765u5rg0kcud4amphuppu8wxspp57kdwqgzdl68fzvs8agmxgcj4h8fv0jpzn6rf85c9gl7xytkak66qdq9d9h8vxqyjw5qcqp99qxpqysgqrneaxh0plvjft457yv3q92rak57a6xw33m6phr0mrsy69sudzgez3adkzdsgwzy32z5usjpxm4rjgcg70h047wf0pgc4l9gyaj2h9ssqcrtv32", + "payment_secret": "99d36395f3183c2fe3997fd1cf61bcef45ed53941a1f6c71b5eec37e043c3b8d", + "created_index": 9, + "warning_capacity": "Insufficient incoming channel capacity to pay invoice" } ], "author": [ "Rusty Russell <> is mainly responsible." ], "see_also": [ - "lightning-sendinvoice(7)", + "lightning-listinvoices(7)", + "lightning-delinvoice(7)", "lightning-pay(7)" ], "resources": [ "Main web site: " ] }, - "lightning-fundchannel.json": { + "lightning-invoicerequest.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "fundchannel", - "title": "Command for establishing a lightning channel", + "added": "v22.11", + "rpc": "invoicerequest", + "title": "Command for offering payments", + "warning": "experimental-offers only", "description": [ - "The **fundchannel** RPC command opens a payment channel with a peer by committing a funding transaction to the blockchain as defined in BOLT #2.", - "", - "If not already connected, **fundchannel** will automatically attempt to connect if Core Lightning knows a way to contact the node (either from normal gossip, or from a previous **connect** call).", - "", - "This auto-connection can fail if Core Lightning does not know how to contact the target node; see lightning-connect(7).", - "", - "Once the transaction is confirmed, normal channel operations may begin. Readiness is indicated by **listpeers** reporting a *state* of `CHANNELD_NORMAL` for the channel." + "The **invoicerequest** RPC command creates an `invoice_request` to send payments: it automatically enables the processing of an incoming invoice, and payment of it. The reader of the resulting `invoice_request` can use lightning-sendinvoice(7) to collect their payment." ], "request": { "required": [ - "id", - "amount" + "amount", + "description" ], "properties": { - "id": { - "type": "pubkey", - "description": [ - "Id is the peer id obtained from connect." - ] - }, "amount": { - "type": "msat_or_all", - "description": [ - "The amount in satoshis taken from the internal wallet to fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency- msat` as change). The string *all* can be used to specify all available funds (or 16777215 satoshi if more is available and large channels were not negotiated with the peer). Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The value cannot be less than the dust limit, currently set to 546, nor more than 16777215 satoshi (unless large channels were negotiated with the peer)." - ] - }, - "feerate": { - "type": "feerate", - "description": [ - "Used for the opening transaction and (unless *option_anchors_zero_fee_htlc_tx* is negotiated), as initial feerate for commitment and HTLC transactions (see NOTES in lightning-feerates(7))." - ], - "default": "*normal*" - }, - "announce": { - "type": "boolean", - "description": [ - "Whether to announce this channel or not. An unannounced channel is considered private." - ], - "default": "True" - }, - "minconf": { - "type": "u32", - "description": [ - "The minimum number of confirmations that used outputs should have." - ], - "default": "1" - }, - "push_msat": { "type": "msat", "description": [ - "The amount of millisatoshis to push to the channel peer at open. Note that this is a gift to the peer -- these satoshis are added to the initial balance of the peer at channel start and are largely unrecoverable once pushed." + "A positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*." ] }, - "close_to": { + "description": { "type": "string", "description": [ - "A Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. Returns `close_to` set to closing script iff is negotiated." + "A short description of purpose of the payment, e.g. *ATM withdrawl*. This value is encoded into the resulting `invoice_request` and is viewable by anyone you expose it to. It must be UTF-8, and cannot use *\\u* JSON escape codes." ] }, - "request_amt": { - "type": "msat", + "issuer": { + "type": "string", "description": [ - "An amount of liquidity you'd like to lease from the peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*." + "Who is issuing it (i.e. you) if appropriate." ] }, - "compact_lease": { + "label": { "type": "string", "description": [ - "A compact representation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel." + "An internal-use name for the offer, which can be any UTF-8 string." ] }, - "utxos": { - "type": "array", - "description": [ - "The utxos to be used to fund the channel, as an array of `txid:vout`." - ], - "items": { - "type": "outpoint" - } - }, - "mindepth": { + "absolute_expiry": { + "type": "u64", "description": [ - "Number of confirmations required before we consider the channel active." - ], - "type": "u32" + "The time the offer is valid until, in seconds since the first day of 1970 UTC. If not set, the `invoice_request` remains valid (though it can be deactivated by the issuer of course). This is encoded in the `invoice_request`." + ] }, - "reserve": { - "type": "msat", + "single_use": { + "type": "boolean", "description": [ - "The amount we want the peer to maintain on its side of the channel. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*." + "Indicates that the `invoice_request` is only valid once; we may attempt multiple payments, but as soon as one is successful no more invoices are accepted (i.e. only one person can take the money)." ], - "default": "1% of the funding amount" - }, - "channel_type": { - "added": "v24.02", - "type": "array", - "items": { - "type": "u32", - "description": [ - "Represents the explicit channel type to request. There is currently no sanity checking on this value so if you use strange values and your channel breaks, you get to keep both pieces. BOLT 2 defines the following value types:", - "```", - "The currently defined basic types are:", - " - no features (no bits set).", - " - `option_static_remotekey` (bit 12).", - " - `option_anchor_outputs` and `option_static_remotekey` (bits 20 and 12).", - " - `option_anchors_zero_fee_htlc_tx` and `option_static_remotekey` (bits 22 and 12).", - "", - "Each basic type has the following variations allowed:", - " - `option_scid_alias` (bit 46).", - " - `option_zeroconf` (bit 50).", - "```" - ] - } + "default": "True" } } }, "response": { "required": [ - "tx", - "txid", - "outnum", - "channel_type", - "channel_id" + "invreq_id", + "single_use", + "active", + "bolt12", + "used" ], "properties": { - "tx": { - "type": "hex", + "invreq_id": { + "type": "hash", "description": [ - "The raw transaction which funded the channel." + "The SHA256 hash of all invoice_request fields less than 160." ] }, - "txid": { - "type": "txid", + "active": { + "type": "boolean", + "enum": [ + true + ], "description": [ - "The txid of the transaction which funded the channel." + "Whether the invoice_request is currently active." ] }, - "outnum": { - "type": "u32", + "single_use": { + "type": "boolean", "description": [ - "The 0-based output index showing which output funded the channel." + "Whether the invoice_request will become inactive after we pay an invoice for it." ] }, - "channel_id": { - "type": "hash", + "bolt12": { + "type": "string", "description": [ - "The channel_id of the resulting channel." + "The bolt12 string starting with lnr." ] }, - "channel_type": { - "type": "object", - "description": [ - "Channel_type as negotiated with peer." - ], - "added": "v24.02", - "additionalProperties": false, - "required": [ - "bits", - "names" + "used": { + "type": "boolean", + "enum": [ + false ], - "properties": { - "bits": { - "type": "array", - "description": [ - "Each bit set in this channel_type." - ], - "added": "v24.02", - "items": { - "type": "u32", - "description": [ - "Bit number." - ] - } - }, - "names": { - "type": "array", - "description": [ - "Feature name for each bit set in this channel_type." - ], - "added": "v24.02", - "items": { - "type": "string", - "enum": [ - "static_remotekey/even", - "anchor_outputs/even", - "anchors_zero_fee_htlc_tx/even", - "scid_alias/even", - "zeroconf/even" - ], - "description": [ - "Name of feature bit." - ] - } - } - } - }, - "close_to": { - "type": "hex", "description": [ - "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`." + "Whether the invoice_request has already been used." ] }, - "mindepth": { - "type": "u32", + "label": { + "type": "string", "description": [ - "Number of confirmations before we consider the channel active." + "The label provided when creating the invoice_request." ] } } }, - "example_usage": [ - "This example shows how to use lightning-cli to open new channel with peer 03f...fc1 from one whole utxo bcc1...39c:0 (you can use **listfunds** command to get txid and vout):", - "", - "```shell", - "lightning-cli -k fundchannel id=03f...fc1 amount=all feerate=normal utxos='[\"bcc1...39c:0\"]'", - "```" - ], "example_json_request": [ { - "id": "example:fundchannel#1", - "method": "fundchannel", - "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "amount": 1000000, - "feerate": null, - "announce": true, - "minconf": null, - "utxos": null, - "push_msat": null, - "close_to": null, - "request_amt": null, - "compact_lease": null, - "mindepth": null, - "reserve": null - } - }, - { - "id": "example:fundchannel#2", - "method": "fundchannel", + "id": "example:invoicerequest#1", + "method": "invoicerequest", "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "amount": 10000000, - "feerate": null, - "announce": true, - "minconf": null, - "utxos": null, - "push_msat": 1000000000, - "close_to": null, - "request_amt": null, - "compact_lease": null, - "mindepth": null, - "reserve": null, - "channel_type": null + "amount": "10000sat", + "description": "simple test", + "issuer": "clightning test suite" } } ], "example_json_response": [ { - "tx": "020000000001014ca47b75e6982fce6b5ebb6e7ec163dc5b6bed1562934e6febe816103b2b207e0000000000fdffffff0240420f00000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd012f0f000000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a02473044022058fc4d51c8254d37b266d3db3f8fda7420882b6ec9226d66b8c0139f2707c09602205798d8ce23d4c692a7384362a2e0afd9703f062239a786d7a1840a28d3a1152e012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000", - "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b", - "channel_id": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", - "outnum": 0 - }, - { - "tx": "0200000000010141cfa0e9957c7c6d0bb5069d92937f9545e6e6ee9b4650f47f509d5ea65df4690100000000fdffffff0280969800000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd4118530b0000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a0247304402206488c7dfbc4180781ed0d5ca7ff2c8ce134480c349d03978765053a393229d9a022066c75dee1f19b410ea1c7756d0cb2c097e52b13f4d9bbd033efa4ed95d817e14012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000", - "txid": "6aa1231b6356777468a55aea1f49dad6415592aef6c1e652f8a64357c7235301", - "channel_id": "015323c75743a6f852e6c1f6ae925541d6da491fea5aa568747756631b23a16a", - "channel_type": { - "bits": [ - 12, - 22 - ], - "names": [ - "static_remotekey/even", - "anchors_zero_fee_htlc_tx/even" - ] - }, - "outnum": 0 + "invreq_id": "715484ead84bcdae5b33e3015c686fa1bdd4ae9ade3c4729b58257a98cfcd9b5", + "active": true, + "single_use": true, + "bolt12": "lnr1qqgteyhfyp40c79a5y3gfe33nxfs6zstwd5k6urvv5s8getnwsfp2cmvd9nksarwd9hxwgr5v4ehggrnw45hge2syqrzymjxzydqkkw24ufxqslttwlj3s608f0rx2slc7etw0833zgs75srnztgqkppqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq633uzq99smfawuu6pz0zh9jl6dl8v25u3kzes975x2j9tr0qp0ux0tlzcxjrgehxh9luz5vwjpk92tys9f9zlm038krcz4uqfxgelwf43tgfc", + "used": false } ], "errors": [ - "The following error codes may occur:", - "", - "- -1: Catchall nonspecific error.", - "- 300: The maximum allowed funding amount is exceeded.", - "- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.", - "- 302: The output amount is too small, and would be considered dust.", - "- 303: Broadcasting of the funding transaction failed, the internal call to bitcoin-cli returned with an error.", - "- 313: The `min-emergency-msat` reserve not be preserved (and we have or are opening anchor channels).", + "On failure, an error is returned and no `invoice_request` is created. If the lightning process fails before responding, the caller should use lightning-listinvoicerequests(7) to query whether it was created or not.", "", - "Failure may also occur if **lightningd** and the peer cannot agree on channel parameters (funding limits, channel reserves, fees, etc.)." + "- -1: Catchall nonspecific error." + ], + "author": [ + "Rusty Russell <> is mainly responsible." ], "see_also": [ - "lightning-connect(7)", - "lightning-listfunds()", - "lightning-listpeers(7)", - "lightning-feerates(7)", - "lightning-multifundchannel(7)" + "lightning-listinvoicerequests(7)", + "lightning-disableinvoicerequest(7)" ], "resources": [ "Main web site: " ] }, - "lightning-fundchannel_cancel.json": { + "lightning-keysend.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "fundchannel_cancel", - "title": "Command for completing channel establishment", + "rpc": "keysend", + "title": "Send funds to a node without an invoice", "description": [ - "`fundchannel_cancel` is a lower level RPC command. It allows channel opener to cancel a channel before funding broadcast with a connected peer.", + "The **keysend** RPC command attempts to find a route to the given destination, and send the specified amount to it. Unlike the `pay` RPC command the `keysend` command does not require an invoice, instead it uses the `destination` node ID, and `amount` to find a route to the specified node.", "", - "Note that the funding transaction MUST NOT be broadcast before `fundchannel_cancel`. Broadcasting transaction before `fundchannel_cancel` WILL lead to unrecoverable loss of funds.", + "In order for the destination to be able to claim the payment, the `payment_key` is randomly generated by the sender and included in the encrypted payload for the destination. As a consequence there is not proof-of-payment, like there is with an invoice where the `payment_key` is generated on the destination, and the only way sender could have it is by sending a payment. Please ensure that this matches your use-case when using `keysend`.", "", - "If `fundchannel_cancel` is called after `fundchannel_complete`, the remote peer may disconnect when command succeeds. In this case, user need to connect to remote peer again before opening channel." + "When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name." ], "request": { "required": [ - "id" + "destination", + "amount_msat" ], "properties": { - "id": { + "destination": { "type": "pubkey", "description": [ - "Node id of the remote peer with which to cancel." + "The 33 byte, hex-encoded, node ID of the node that the payment should go to." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "A whole number, or a whole number with suffix `msat` or `sat`, or a three decimal point number with suffix `sat`, or an 1 to 11 decimal point number suffixed by `btc`." + ] + }, + "label": { + "type": "string", + "description": [ + "Used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7)." + ] + }, + "maxfeepercent": { + "type": "number", + "description": [ + "Limits the money paid in fees as percentage of the total amount that is to be transferred." + ], + "default": "0.5" + }, + "retry_for": { + "type": "u32", + "description": [ + "Until *retry_for* seconds passes, the command will keep finding routes and retrying the payment. However, a payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case." + ], + "default": "60 seconds" + }, + "maxdelay": { + "type": "u32", + "description": [ + "Number of blocks the payment may be delayed." + ] + }, + "exemptfee": { + "type": "msat", + "description": [ + "Used for tiny payments which would be dominated by the fee leveraged by forwarding nodes. Setting `exemptfee` allows the `maxfeepercent` check to be skipped on fees that are smaller than *exemptfee*." + ], + "default": "5000 millisatoshi" + }, + "routehints": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "id", + "scid", + "feebase", + "feeprop", + "expirydelta" + ], + "properties": { + "id": { + "type": "pubkey" + }, + "scid": { + "type": "short_channel_id" + }, + "feebase": { + "type": "msat" + }, + "feeprop": { + "type": "u32" + }, + "expirydelta": { + "type": "u16" + } + } + } + } + }, + "extratlvs": { + "type": "object", + "additionalProperties": true, + "required": [], + "description": [ + "Dictionary of additional fields to insert into the final tlv. The format is 'fieldnumber': 'hexstring'." ] } } }, "response": { "required": [ - "cancelled" + "payment_preimage", + "payment_hash", + "created_at", + "parts", + "amount_msat", + "amount_sent_msat", + "status" ], "properties": { - "cancelled": { + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash**." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "created_at": { + "type": "number", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "parts": { + "type": "u32", + "description": [ + "How many attempts this took." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount the recipient received." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "Total amount we sent (including fees)." + ] + }, + "warning_partial_completion": { "type": "string", "description": [ - "A message indicating it was cancelled by RPC." + "Not all parts of a multi-part payment have completed." + ] + }, + "status": { + "type": "string", + "enum": [ + "complete" + ], + "description": [ + "Status of payment." ] } - } + }, + "post_return_value_notes": [ + "You can monitor the progress and retries of a payment using the lightning-paystatus(7) command." + ] }, + "randomization": [ + "To protect user privacy, the payment algorithm performs some randomization.", + "", + "1: Route Randomization", + "", + "Route randomization means the payment algorithm does not always use the lowest-fee or shortest route. This prevents some highly-connected node from learning all of the user payments by reducing their fees below the network average.", + "", + "2: Shadow Route", + "", + "Shadow route means the payment algorithm will virtually extend the route by adding delays and fees along it, making it appear to intermediate nodes that the route is longer than it actually is. This prevents intermediate nodes from reliably guessing their distance from the payee.", + "", + "Route randomization will never exceed *maxfeepercent* of the payment. Route randomization and shadow routing will not take routes that would exceed *maxdelay*." + ], + "errors": [ + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error.", + "- 203: Permanent failure at destination. The *data* field of the error will be routing failure object.", + "- 205: Unable to find a route.", + "- 206: Route too expensive. Either the fee or the needed total locktime for the route exceeds your *maxfeepercent* or *maxdelay* settings, respectively. The *data* field of the error will indicate the actual *fee* as well as the *feepercent* percentage that the fee has of the destination payment amount. It will also indicate the actual *delay* along the route.", + "- 210: Payment timed out without a payment in progress.", + "", + "A routing failure object has the fields below:", + "", + "*erring_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on.", + "*erring_node*: The hex string of the pubkey id of the node that reported the error.", + "*erring_channel*: The short channel ID of the channel that has the error, or *0:0:0* if the destination node raised the error.", + "*failcode*: The failure code, as per BOLT #4.", + "*channel_update*: The hex string of the *channel_update* message received from the remote node. Only present if error is from the remote node and the *failcode* has the `UPDATE` bit set, as per BOLT #4." + ], "example_json_request": [ { - "id": "example:fundchannel_cancel#1", - "method": "fundchannel_cancel", + "id": "example:keysend#1", + "method": "keysend", "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount_msat": 10000, + "label": null, + "maxfeepercent": null, + "retry_for": null, + "maxdelay": null, + "exemptfee": null, + "extratlvs": null } }, { - "id": "example:fundchannel_cancel#2", - "method": "fundchannel_cancel", + "id": "example:keysend#2", + "method": "keysend", "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" + "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "amount_msat": 10000000, + "label": null, + "maxfeepercent": null, + "retry_for": null, + "maxdelay": null, + "exemptfee": null, + "extratlvs": { + "133773310": "68656c6c6f776f726c64", + "133773312": "66696c7465726d65" + } + } + }, + { + "id": "example:keysend#3", + "method": "keysend", + "params": { + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount_msat": 10000, + "routehints": [ + [ + { + "scid": "4615051x2233541x57738", + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "feebase": 1, + "feeprop": 10, + "expirydelta": 9 + } + ], + [ + { + "scid": "1x2x3", + "id": "020202020202020202020202020202020202020202020202020202020202020202", + "feebase": 1, + "feeprop": 1, + "expirydelta": 9 + } + ] + ] } } ], "example_json_response": [ { - "cancelled": "Channel open canceled by RPC" + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "payment_hash": "b6f88603008a9f7dd84b1b94c7b972c8efbaf0b86c8d3c04512955992da9028e", + "created_at": 1706315742.6861734, + "parts": 1, + "amount_msat": 10000, + "amount_sent_msat": 10001, + "payment_preimage": "7178cf708e34dce816fc35aa692a65e1f85b92ae03bbc8ae6543302511823174", + "status": "complete" }, { - "cancelled": "Channel open canceled by RPC(after fundchannel_complete)" + "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "payment_hash": "e8474eea8d5673e8407ef5f4924e58479b51a68afd136384683d5d6a97c9520d", + "created_at": 1708640424.1810749, + "parts": 1, + "amount_msat": 10000000, + "amount_sent_msat": 10000000, + "payment_preimage": "40e47272ea7da20c57a2381d81a5513ec03bd8ead9d51fbd2a91ec76d3f4bcbf", + "status": "complete" + }, + { + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "payment_hash": "56e12e6f45120bef7385c9bf307319eaa6a1b9160cdb3e62a3f492abf5bfa4bc", + "created_at": 1708640437.2895157, + "parts": 1, + "amount_msat": 10000, + "amount_sent_msat": 10001, + "payment_preimage": "682870b8f96e2aed1c86694dbb2c3e64cd396b9bba9fafd824d90eb0bd371b85", + "status": "complete" } ], - "errors": [ - "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", - "", - "- -32602: If the given parameters are wrong.", - "- 306: Unknown peer id.", - "- 307: No channel currently being funded that can be cancelled.", - "- 308: It is unsafe to cancel the channel: the funding transaction has been broadcast, or there are HTLCs already in the channel, or the peer was the initiator and not us." - ], "author": [ - "Lisa Neigut <> is mainly responsible." + "Christian Decker <> is mainly responsible." ], "see_also": [ - "lightning-connect(7)", - "lightning-fundchannel(7)", - "lightning-multifundchannel(7)", - "lightning-fundchannel_start(7)", - "lightning-fundchannel_complete(7)", - "lightning-openchannel_init(7)", - "lightning-openchannel_update(7)", - "lightning-openchannel_signed(7)", - "lightning-openchannel_abort(7)" + "lightning-listpays(7)", + "lightning-decodepay(7)", + "lightning-listinvoice(7)", + "lightning-delinvoice(7)", + "lightning-getroute(7)", + "lightning-invoice(7)" ], "resources": [ "Main web site: " ] }, - "lightning-fundchannel_complete.json": { + "lightning-listchannels.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "fundchannel_complete", - "title": "Command for completing channel establishment", + "rpc": "listchannels", + "title": "Command to query active lightning channels in the entire network", "description": [ - "`fundchannel_complete` is a lower level RPC command. It allows a user to complete an initiated channel establishment with a connected peer.", + "The **listchannels** RPC command returns data on channels that are known to the node. Because channels may be bidirectional, up to 2 objects will be returned for each channel (one for each direction).", "", - "Note that the funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed, as the commitment transactions for this channel are not secured until this command successfully completes. Broadcasting transaction before can lead to unrecoverable loss of funds." + "Only one of *short_channel_id*, *source* or *destination* can be supplied. If nothing is supplied, data on all lightning channels known to this node, are returned. These can be local channels or public channels broadcast on the gossip network." ], "request": { - "required": [ - "id", - "psbt" - ], + "required": [], "properties": { - "id": { + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "If short_channel_id is a short channel id, then only known channels with a matching short_channel_id are returned. Otherwise, it must be null." + ] + }, + "source": { "type": "pubkey", "description": [ - "Node id of the remote peer." + "If source is a node id, then only channels leading from that node id are returned." ] }, - "psbt": { - "type": "string", + "destination": { + "type": "pubkey", "description": [ - "Transaction to use for funding (does not need to be signed but must be otherwise complete)." + "If destination is a node id, then only channels leading to that node id are returned." ] } } }, "response": { "required": [ - "channel_id", - "commitments_secured" + "channels" ], "properties": { - "channel_id": { - "type": "hash", - "description": [ - "The channel_id of the resulting channel." - ] - }, - "commitments_secured": { - "type": "boolean", - "enum": [ - true - ], - "description": [ - "Indication that channel is safe to use." - ] + "channels": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "source", + "destination", + "short_channel_id", + "direction", + "public", + "amount_msat", + "message_flags", + "channel_flags", + "active", + "last_update", + "base_fee_millisatoshi", + "fee_per_millionth", + "delay", + "htlc_minimum_msat", + "features" + ], + "properties": { + "source": { + "type": "pubkey", + "description": [ + "The source node." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The destination node." + ] + }, + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "Short channel id of channel." + ] + }, + "direction": { + "type": "u32", + "description": [ + "Direction (0 if source < destination, 1 otherwise)." + ] + }, + "public": { + "type": "boolean", + "description": [ + "True if this is announced (from *v24.02*, being false is deprecated)." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The total capacity of this channel (always a whole number of satoshis)." + ] + }, + "message_flags": { + "type": "u8", + "description": [ + "As defined by BOLT #7." + ] + }, + "channel_flags": { + "type": "u8", + "description": [ + "As defined by BOLT #7." + ] + }, + "active": { + "type": "boolean", + "description": [ + "True unless source has disabled it (or (deprecated in *v24.02*) it's a local channel and the peer is disconnected or it's still opening or closing)." + ] + }, + "last_update": { + "type": "u32", + "description": [ + "UNIX timestamp on the last channel_update from *source*." + ] + }, + "base_fee_millisatoshi": { + "type": "u32", + "description": [ + "Base fee changed by *source* to use this channel." + ] + }, + "fee_per_millionth": { + "type": "u32", + "description": [ + "Proportional fee changed by *source* to use this channel, in parts-per-million." + ] + }, + "delay": { + "type": "u32", + "description": [ + "The number of blocks delay required by *source* to use this channel." + ] + }, + "htlc_minimum_msat": { + "type": "msat", + "description": [ + "The smallest payment *source* will allow via this channel." + ] + }, + "htlc_maximum_msat": { + "type": "msat", + "description": [ + "The largest payment *source* will allow via this channel." + ] + }, + "features": { + "type": "hex", + "description": [ + "BOLT #9 features bitmap for this channel." + ] + } + } + } } - } + }, + "post_return_value_notes": [ + "If one of *short_channel_id*, *source* or *destination* is supplied and no matching channels are found, a 'channels' object with an empty list is returned." + ] }, "errors": [ "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", "", - "- -32602: If the given parameters are wrong.", - "- -1: Catchall nonspecific error.", - "- 305: Peer is not connected.", - "- 306: Unknown peer id.", - "- 309: PSBT does not have a unique, correct output to fund the channel." + "- -32602: If the given parameters are wrong." ], "example_json_request": [ { - "id": "example:fundchannel_complete#1", - "method": "fundchannel_complete", + "id": "example:listchannels#1", + "method": "listchannels", "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "psbt": "cHNidP8BAIkCAAAAASYd4TeOHEIzrUbbELM2DK0IX09WaXqWsJFlLD455MPPAAAAAAD9////Av///wAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM1c8QUpAQAAACJRIH8AZYBKMKON4/oVmJVsVt6zy/+PkBPzziE+LtkuFvWXAAAAAAABAIMCAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////wJRAP////8CAPIFKgEAAAAWABQ5FIjuMd8ar9WFRV9eGNLF+3RMcAAAAAAAAAAAJmokqiGp7eL2HD9x0d79P6mZ36NpU3VcaQaJeZlitIvr2DaXToz5AAAAAAEBHwDyBSoBAAAAFgAUORSI7jHfGq/VhUVfXhjSxft0THAiBgMegIxEPDa2OseVTaV6ANtSwQuoj/j2an7X/Is2EekvWBhhFDNgVAAAgAEAAIAAAACAAAAAAAAAAAAAAAEFIEm9AFgqUlJwbPFtyt3a9dzvb+nAGZiQ3CT1CImhjBFpIQdJvQBYKlJScGzxbcrd2vXc72/pwBmYkNwk9QiJoYwRaRkAYRQzYFYAAIABAACAAAAAgAEAAAAAAAAAAA==" + "short_channel_id": "103x1x0", + "source": null, + "destination": null + } + }, + { + "id": "example:listchannels#2", + "method": "listchannels", + "params": { + "short_channel_id": null, + "source": null, + "destination": null } } ], "example_json_response": [ { - "channel_id": "049217e5035a4a60449c6382c445b5c105bd63588d66137ad0511c57a16db6d9", - "commitments_secured": true - } - ], - "author": [ - "Lisa Neigut <> is mainly responsible." - ], - "see_also": [ - "lightning-connect(7)", - "lightning-fundchannel(7)", - "lightning-multifundchannel(7)", - "lightning-fundchannel_start(7)", - "lightning-fundchannel_cancel(7)", - "lightning-openchannel_init(7)", - "lightning-openchannel_update(7)", - "lightning-openchannel_signed(7)", - "lightning-openchannel_bump(7)", - "lightning-openchannel_abort(7)" + "channels": [] + }, + { + "channels": [ + { + "source": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "short_channel_id": "103x1x0", + "direction": 0, + "public": true, + "amount_msat": 1000000000, + "message_flags": 1, + "channel_flags": 0, + "active": true, + "last_update": 1706153393, + "base_fee_millisatoshi": 1, + "fee_per_millionth": 10, + "delay": 6, + "htlc_minimum_msat": 0, + "htlc_maximum_msat": 990000000, + "features": "" + }, + { + "source": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "short_channel_id": "103x1x0", + "direction": 1, + "public": true, + "amount_msat": 1000000000, + "message_flags": 1, + "channel_flags": 1, + "active": true, + "last_update": 1706153393, + "base_fee_millisatoshi": 1, + "fee_per_millionth": 10, + "delay": 6, + "htlc_minimum_msat": 0, + "htlc_maximum_msat": 990000000, + "features": "" + } + ] + } + ], + "author": [ + "Michael Hawkins <>." + ], + "see_also": [ + "lightning-fundchannel(7)", + "lightning-listnodes(7)" ], "resources": [ - "Main web site: " + "Main web site: ", + "", + "BOLT #7: " ] }, - "lightning-fundchannel_start.json": { + "lightning-listclosedchannels.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "fundchannel_start", - "title": "Command for initiating channel establishment for a lightning channel", + "added": "v23.05", + "rpc": "listclosedchannels", + "title": "Get data on our closed historical channels", "description": [ - "`fundchannel_start` is a lower level RPC command. It allows a user to initiate channel establishment with a connected peer.", - "", - "Note that the funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`, as the commitment transactions for this channel are not secured until the complete command succeeds. Broadcasting transaction before that can lead to unrecoverable loss of funds." + "The **listclosedchannels** RPC command returns data on channels which are otherwise forgotten (more than 100 blocks after they're completely resolved onchain)." ], "request": { - "required": [ - "id", - "amount" - ], + "required": [], "properties": { "id": { "type": "pubkey", "description": [ - "The peer id obtained from connect." - ] - }, - "amount": { - "type": "sat", - "description": [ - "Satoshi value that the channel will be funded at. This value MUST be accurate, otherwise the negotiated commitment transactions will not encompass the correct channel value." - ] - }, - "feerate": { - "type": "feerate", - "description": [ - "Feerate for subsequent commitment transactions: see **fundchannel**. Note that this is ignored for channels with *option_anchors_zero_fee_htlc_tx* (we always use a low commitment fee for these)." - ] - }, - "announce": { - "type": "boolean", - "description": [ - "Whether or not to announce this channel." - ] - }, - "close_to": { - "type": "string", - "description": [ - "Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. Returns `close_to` set to closing script iff is negotiated." - ] - }, - "push_msat": { - "type": "msat", - "description": [ - "Amount of millisatoshis to push to the channel peer at open. Note that this is a gift to the peer -- these satoshis are added to the initial balance of the peer at channel start and are largely unrecoverable once pushed." - ] - }, - "mindepth": { - "type": "u32", - "description": [ - "Number of confirmations required before we consider the channel active." - ] - }, - "reserve": { - "type": "msat", - "description": [ - "The amount we want the peer to maintain on its side." + "If no *id* is supplied, then channel data on all historical channels are given. Supplying *id* will filter the results to only match channels to that peer. Note that prior to v23.05, old peers were forgotten." ] - }, - "channel_type": { - "type": "array", - "description": [ - "Each bit set in this channel_type." - ], - "items": { - "type": "u32", - "description": [ - "Bit number." - ] - } } - }, - "pairedWith": [ - [ - "feerate", - "announce", - "close_to", - "push_msat", - "channel_type", - "mindepth", - "reserve" - ] - ] + } }, "response": { "required": [ - "funding_address", - "scriptpubkey", - "warning_usage" + "closedchannels" ], "properties": { - "funding_address": { - "type": "string", - "description": [ - "The address to send funding to for the channel. DO NOT SEND COINS TO THIS ADDRESS YET." - ] - }, - "scriptpubkey": { - "type": "hex", - "description": [ - "The raw scriptPubkey for the address." - ] - }, - "channel_type": { - "type": "object", - "description": [ - "Channel_type as negotiated with peer." - ], - "added": "v24.02", - "additionalProperties": false, - "required": [ - "bits", - "names" - ], - "properties": { - "bits": { - "type": "array", - "added": "v24.02", - "description": [ - "Each bit set in this channel_type." - ], - "items": { + "closedchannels": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "channel_id", + "opener", + "private", + "total_msat", + "total_local_commitments", + "total_remote_commitments", + "total_htlcs_sent", + "funding_txid", + "funding_outnum", + "leased", + "final_to_us_msat", + "min_to_us_msat", + "max_to_us_msat", + "close_cause" + ], + "properties": { + "peer_id": { + "type": "pubkey", + "description": [ + "Peer public key (can be missing with pre-v23.05 closes!)." + ] + }, + "channel_id": { + "type": "hash", + "description": [ + "The full channel_id (funding txid Xored with output number)." + ] + }, + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "The short_channel_id." + ] + }, + "alias": { + "type": "object", + "required": [], + "properties": { + "local": { + "type": "short_channel_id", + "description": [ + "An alias assigned by this node to this channel, used for outgoing payments." + ] + }, + "remote": { + "type": "short_channel_id", + "description": [ + "An alias assigned by the remote node to this channel, usable in routehints and invoices." + ] + } + } + }, + "opener": { + "type": "string", + "enum": [ + "local", + "remote" + ], + "description": [ + "Who initiated the channel." + ] + }, + "closer": { + "type": "string", + "enum": [ + "local", + "remote" + ], + "description": [ + "Who initiated the channel close (only present if closing)." + ] + }, + "private": { + "type": "boolean", + "description": [ + "If True, we will not announce this channel." + ] + }, + "channel_type": { + "type": "object", + "description": [ + "Channel_type as negotiated with peer." + ], + "additionalProperties": false, + "required": [ + "bits", + "names" + ], + "properties": { + "bits": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + }, + "names": { + "type": "array", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "items": { + "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" + ], + "description": [ + "Name of feature bit." + ] + } + } + } + }, + "total_local_commitments": { + "type": "u64", + "description": [ + "Number of commitment transaction we made." + ] + }, + "total_remote_commitments": { + "type": "u64", + "description": [ + "Number of commitment transaction they made." + ] + }, + "total_htlcs_sent": { + "type": "u64", + "description": [ + "Number of HTLCs we ever sent." + ] + }, + "funding_txid": { + "type": "txid", + "description": [ + "ID of the funding transaction." + ] + }, + "funding_outnum": { "type": "u32", "description": [ - "Bit number." + "The 0-based output number of the funding transaction which opens the channel." ] - } - }, - "names": { - "type": "array", - "description": [ - "Feature name for each bit set in this channel_type." - ], - "added": "v24.02", - "items": { + }, + "leased": { + "type": "boolean", + "description": [ + "Whether this channel was leased from `opener`." + ] + }, + "funding_fee_paid_msat": { + "type": "msat", + "description": [ + "How much we paid to lease the channel (iff `leased` is true and `opener` is local)." + ] + }, + "funding_fee_rcvd_msat": { + "type": "msat", + "description": [ + "How much they paid to lease the channel (iff `leased` is true and `opener` is remote)." + ] + }, + "funding_pushed_msat": { + "type": "msat", + "description": [ + "How much `opener` pushed immediate (if non-zero)." + ] + }, + "total_msat": { + "type": "msat", + "description": [ + "Total amount in the channel." + ] + }, + "final_to_us_msat": { + "type": "msat", + "description": [ + "Our balance in final commitment transaction." + ] + }, + "min_to_us_msat": { + "type": "msat", + "description": [ + "Least amount owed to us ever. If the peer were to successfully steal from us, this is the amount we would still retain." + ] + }, + "max_to_us_msat": { + "type": "msat", + "description": [ + "Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get." + ] + }, + "last_commitment_txid": { + "type": "hash", + "description": [ + "The final commitment tx's txid (or mutual close, if we accepted it). Not present for some very old, small channels pre-0.7.0." + ] + }, + "last_commitment_fee_msat": { + "type": "msat", + "description": [ + "The fee on `last_commitment_txid`." + ] + }, + "close_cause": { "type": "string", "enum": [ - "static_remotekey/even", - "anchor_outputs/even", - "anchors_zero_fee_htlc_tx/even", - "scid_alias/even", - "zeroconf/even" + "unknown", + "local", + "user", + "remote", + "protocol", + "onchain" ], "description": [ - "Name of feature bit." + "What caused the channel to close." + ] + }, + "last_stable_connection": { + "type": "u64", + "added": "v24.02", + "description": [ + "Last time we reestablished the open channel and stayed connected for 1 minute." ] } } } - }, - "close_to": { - "type": "hex", - "description": [ - "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`." - ] - }, - "warning_usage": { - "type": "string", - "description": [ - "A warning not to prematurely broadcast the funding transaction (always present!)." - ] - }, - "mindepth": { - "type": "u32", - "description": [ - "Number of confirmations before we consider the channel active." - ] } } }, "errors": [ "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", "", - "- -32602: If the given parameters are wrong.", - "- -1: Catchall nonspecific error.", - "- 300: The amount exceeded the maximum configured funding amount.", - "- 301: The provided `push_msat` is greater than the provided `amount`.", - "- 304: Still syncing with bitcoin network", - "- 305: Peer is not connected.", - "- 306: Unknown peer id.", - "- 312: Peer negotiated `option_dual_fund`, must use `openchannel_init` not `fundchannel_start`. (Only if ``experimental-dual-fund` is enabled)" - ], - "example_json_request": [ - { - "id": "example:fundchannel_start#1", - "method": "fundchannel_start", - "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "amount": 16777216, - "feerate": null, - "announce": true, - "close_to": null, - "mindepth": null - } - }, - { - "id": "example:fundchannel_start#2", - "method": "fundchannel_start", - "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "amount": "100000sat", - "feerate": null, - "announce": true, - "close_to": null, - "mindepth": null, - "channel_type": null - } - } - ], - "example_json_response": [ - { - "funding_address": "bcrt1qtwxd8wg5eanumk86vfeujvp48hfkgannf77evggzct048wggsrxsum2pmm", - "scriptpubkey": "00205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd", - "warning_usage": "The funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`" - }, - { - "funding_address": "bcrt1qtwxd8wg5eanumk86vfeujvp48hfkgannf77evggzct048wggsrxsum2pmm", - "scriptpubkey": "00205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd", - "channel_type": { - "bits": [ - 12, - 22 - ], - "names": [ - "static_remotekey/even", - "anchors_zero_fee_htlc_tx/even" - ] - }, - "warning_usage": "The funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`" - } + "- -32602: If the given parameters are wrong." ], "author": [ - "Lisa Neigut <> is mainly responsible." + "Rusty Russell <>." ], "see_also": [ - "lightning-connect(7)", - "lightning-fundchannel(7)", - "lightning-multifundchannel(7)", - "lightning-fundchannel_complete(7)", - "lightning-fundchannel_cancel(7)", - "lightning-openchannel_init(7)", - "lightning-openchannel_update(7)", - "lightning-openchannel_signed(7)", - "lightning-openchannel_bump(7)", - "lightning-openchannel_abort(7)" + "lightning-listpeerchannels(7)" ], "resources": [ "Main web site: " ] }, - "lightning-funderupdate.json": { + "lightning-listconfigs.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "funderupdate", - "title": "Command for adjusting node funding v2 channels", + "rpc": "listconfigs", + "title": "Command to list all configuration options.", "description": [ - "NOTE: Must have --experimental-dual-fund enabled for these settings to take effect.", - "", - "For channel open requests using dual funding.", - "", - "Note: to maximize channel leases, best policy setting is (match, 100).", - "", - "Setting any of the 5 options from *lease_fee_base_msat*, *lease_fee_basis*, *funding_weight*, *channel_fee_max_base_msat* and, *channel_fee_max_proportional_thousandths* will activate channel leases for this node, and advertise these values via the lightning gossip network. If any one is set, the other values will be the default." + "The **listconfigs** RPC command to list all configuration options, or with *config* only one." ], "request": { "required": [], "properties": { - "policy": { + "config": { "type": "string", - "enum": [ - "match", - "available", - "fixed" - ], - "description": [ - "Funder plugin will use to decide how much capital to commit to a v2 open channel request.", - "There are three policy options, detailed below:", - " * `match` -- Contribute *policy_mod* percent of their requested funds. Valid *policy_mod* values are 0 to 200. If this is a channel lease request, we match based on their requested funds. If it is not a channel lease request (and *lease_only* is false), then we match their funding amount. Note: any lease match less than 100 will likely fail, as clients will not accept a lease less than their request.", - " * `available` -- Contribute *policy_mod* percent of our available node wallet funds. Valid *policy_mod* values are 0 to 100.", - " * `fixed` -- Contributes a fixed *policy_mod* sats to v2 channel open requests." - ], - "default": "fixed" - }, - "policy_mod": { - "type": "sat", - "description": [ - "Number or 'modification' to apply to the policy." - ], - "default": "0sats" - }, - "leases_only": { - "type": "boolean", - "description": [ - "Only contribute funds to `option_will_fund` requests which pay to lease funds. It will fund any v2 open request using *policy* even if it's they're not seeking to lease funds. Note that `option_will_fund` commits funds for 4032 blocks (~1mo). Must also set *lease_fee_base_msat*, *lease_fee_basis*, *funding_weight*, *channel_fee_max_base_msat*, and *channel_fee_max_proportional_thousandths* to advertise available channel leases." - ], - "default": "False" - }, - "min_their_funding_msat": { - "type": "msat", - "description": [ - "Minimum funding sats that we require in order to activate our contribution policy to the v2 open." - ], - "default": "10k sats" - }, - "max_their_funding_msat": { - "type": "msat", - "description": [ - "Maximum funding sats that we will consider to activate our contribution policy to the v2 open. Any channel open above this will not be funded." - ], - "default": "no max (`UINT_MAX`)" - }, - "per_channel_min_msat": { - "type": "msat", - "description": [ - "Minimum amount that we will contribute to a channel open." - ], - "default": "10k sats" - }, - "per_channel_max_msat": { - "type": "msat", "description": [ - "Maximum amount that we will contribute to a channel open." - ], - "default": "no max (`UINT_MAX`)" - }, - "reserve_tank_msat": { - "type": "msat", - "description": [ - "Amount of sats to leave available in the node wallet." - ], - "default": "zero sats" - }, - "fuzz_percent": { - "type": "u32", - "description": [ - "A percentage to fuzz the resulting contribution amount by. Valid values are 0 to 100. Note that turning this on with (match, 100) policy will randomly fail `option_will_fund` leases, as most clients expect an exact or greater match of their `requested_funds`." - ], - "default": "0% (no fuzz)" - }, - "fund_probability": { - "type": "u32", - "description": [ - "The percent of v2 channel open requests to apply our policy to. Valid values are integers from 0 (fund 0% of all open requests) to 100 (fund every request). Useful for randomizing opens that receive funds. Useful for randomizing opens that receive funds." - ], - "default": "100" - }, - "lease_fee_base_msat": { - "type": "msat", - "description": [ - "Flat fee for a channel lease. Node will receive this much extra added to their channel balance, paid by the opening node. Note that the minimum is 1sat." - ], - "default": "2k sats" - }, - "lease_fee_basis": { - "type": "u32", - "description": [ - "A basis fee that's calculated as 1/10k of the total requested funds the peer is asking for. Node will receive the total of *lease_fee_basis* times requested funds / 10k satoshis added to their channel balance, paid by the opening node." - ], - "default": "0.65% (65 basis points)" - }, - "funding_weight": { - "type": "u32", - "description": [ - "To calculate the fee the peer will compensate your node for its contributing inputs to the funding transaction. The total fee is calculated as the `open_channel2`.`funding_feerate_perkw` times this *funding_weight* divided by 1000. Node will have this funding fee added to their channel balance, paid by the opening node." - ], - "default": "2 inputs + 1 P2WPKH output" - }, - "channel_fee_max_base_msat": { - "type": "msat", - "description": [ - "A commitment to a maximum `channel_fee_base_msat` that your node will charge for routing payments over this leased channel during the lease duration." - ], - "default": "5k sats" - }, - "channel_fee_max_proportional_thousandths": { - "type": "u32", - "description": [ - "A commitment to a maximum `channel_fee_proportional_millionths` that your node will charge for routing payments over this leased channel during the lease duration. Note that it's denominated in 'thousandths'. A setting of `1` is equal to 1k ppm; `5` is 5k ppm, etc." - ], - "default": "100 (100k ppm)" - }, - "compact_lease": { - "type": "hex", - "description": [ - "A compact description of the channel lease params. When opening a channel, passed in to `fundchannel` to indicate the terms we expect from the peer." + "Configuration option name to restrict return." ] } } }, "response": { - "required": [ - "summary", - "policy", - "policy_mod", - "leases_only", - "min_their_funding_msat", - "max_their_funding_msat", - "per_channel_min_msat", - "per_channel_max_msat", - "reserve_tank_msat", - "fuzz_percent", - "fund_probability" - ], - "properties": { - "summary": { - "type": "string", - "description": [ - "Summary of the current funding policy e.g. (match 100)." - ] - }, - "policy": { - "type": "string", - "enum": [ - "match", - "available", - "fixed" - ], - "description": [ - "Policy funder plugin will use to decide how much capital to commit to a v2 open channel request." - ] - }, - "policy_mod": { - "type": "u32", - "description": [ - "The *policy_mod* is the number or 'modification' to apply to the policy." - ] - }, - "leases_only": { - "type": "boolean", - "description": [ - "Only contribute funds to `option_will_fund` lease requests." - ] - }, - "min_their_funding_msat": { - "type": "msat", - "description": [ - "The minimum funding sats that we require from peer to activate our funding policy." - ] - }, - "max_their_funding_msat": { - "type": "msat", - "description": [ - "The maximum funding sats that we'll allow from peer to activate our funding policy." - ] - }, - "per_channel_min_msat": { - "type": "msat", - "description": [ - "The minimum amount that we will fund a channel open with." - ] - }, - "per_channel_max_msat": { - "type": "msat", - "description": [ - "The maximum amount that we will fund a channel open with." - ] - }, - "reserve_tank_msat": { - "type": "msat", - "description": [ - "Amount of sats to leave available in the node wallet." - ] - }, - "fuzz_percent": { - "type": "u32", - "description": [ - "Percentage to fuzz our funding amount by." - ] - }, - "fund_probability": { - "type": "u32", - "description": [ - "Percent of opens to consider funding. 100 means we'll consider funding every requested open channel request." - ] - }, - "lease_fee_base_msat": { - "type": "msat", - "description": [ - "Flat fee to charge for a channel lease." - ] - }, - "lease_fee_basis": { - "type": "u32", - "description": [ - "Proportional fee to charge for a channel lease, calculated as 1/10,000th of requested funds." - ] - }, - "funding_weight": { - "type": "u32", - "description": [ - "Transaction weight the channel opener will pay us for a leased funding transaction." - ] - }, - "channel_fee_max_base_msat": { - "type": "msat", - "description": [ - "Maximum channel_fee_base_msat we'll charge for routing funds leased on this channel." - ] - }, - "channel_fee_max_proportional_thousandths": { - "type": "u32", - "description": [ - "Maximum channel_fee_proportional_millitionths we'll charge for routing funds leased on this channel, in thousandths." - ] - }, - "compact_lease": { - "type": "hex", - "description": [ - "Compact description of the channel lease parameters." - ] - } - } - }, - "errors": [ - "The following error code may occur:", - "", - "- -32602: If the given parameters are invalid." - ], - "example_json_request": [ - { - "id": "example:funderupdate#1", - "method": "funderupdate", - "params": "{}" - }, - { - "id": "example:funderupdate#2", - "method": "funderupdate", - "params": { - "policy": "fixed", - "policy_mod": "50000sat", - "min_their_funding_msat": 1000, - "per_channel_min_msat": "1000sat", - "per_channel_max_msat": "500000sat", - "fund_probability": 100, - "fuzz_percent": 0, - "leases_only": false - } - } - ], - "example_json_response": [ - { - "summary": "match (100%)", - "policy": "match", - "policy_mod": 100, - "leases_only": true, - "min_their_funding_msat": 10000000, - "max_their_funding_msat": 4294967295000, - "per_channel_min_msat": 10000000, - "per_channel_max_msat": 4294967295000, - "reserve_tank_msat": 0, - "fuzz_percent": 0, - "fund_probability": 100, - "lease_fee_base_msat": 100000, - "lease_fee_basis": 100, - "funding_weight": 666, - "channel_fee_max_base_msat": 5000000, - "channel_fee_max_proportional_thousandths": 100, - "compact_lease": "029a00640064000000644c4b40" - }, - { - "summary": "fixed (50000sat)", - "policy": "fixed", - "policy_mod": 50000, - "leases_only": false, - "min_their_funding_msat": 1000, - "max_their_funding_msat": 4294967295000, - "per_channel_min_msat": 1000000, - "per_channel_max_msat": 500000000, - "reserve_tank_msat": 0, - "fuzz_percent": 0, - "fund_probability": 100 - } - ], - "author": [ - "Lisa Neigut <> is mainly responsible." - ], - "see_also": [ - "lightning-fundchannel(7)", - "lightning-listfunds(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-fundpsbt.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "fundpsbt", - "title": "Command to populate PSBT inputs from the wallet", - "description": [ - "`fundpsbt` is a low-level RPC command which creates a PSBT using unreserved inputs in the wallet, optionally reserving them as well." - ], - "request": { - "required": [ - "satoshi", - "feerate", - "startweight" - ], + "required": [], "properties": { - "satoshi": { - "type": "msat_or_all", - "description": [ - "The minimum satoshi value of the output(s) needed (or the string `all` meaning use all unreserved inputs). If a value, it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*." - ] - }, - "feerate": { - "type": "feerate", - "description": [ - "Used for the transaction as initial feerate." - ], - "default": "*normal*" - }, - "startweight": { - "type": "u32", - "description": [ - "The weight of the transaction before *fundpsbt* has added any inputs." - ] - }, - "minconf": { - "type": "u32", - "description": [ - "The minimum number of confirmations that used outputs should have." - ], - "default": "1" - }, - "reserve": { - "type": "u32", - "description": [ - "If not zero, then *reserveinputs* is called (successfully, with *exclusive* true) on the returned PSBT for this number of blocks." - ], - "default": "72 blocks" - }, - "locktime": { - "type": "u32", - "description": [ - "The locktime of the transaction. if not set, it is set to a recent block height." - ] - }, - "min_witness_weight": { - "type": "u32", - "description": [ - "Minimum weight to use for a UTXO's witness. If the actual witness weight is greater than the provided minimum, the actual witness weight will be used." - ] - }, - "excess_as_change": { - "type": "boolean", - "description": [ - "Flag to add a change output for the excess sats." - ] - }, - "nonwrapped": { - "added": "v23.02", - "type": "boolean", - "description": [ - "To signal to filter out any p2sh-wrapped inputs from funding this PSBT." - ] - }, - "opening_anchor_channel": { + "configs": { "added": "v23.08", - "type": "boolean", - "description": [ - "To signel that it needs emergency reserve for anchors so that we can lowball our commitment tx fees, and min-emergency-msat for reserving some sats for closing anchor channels." - ] - } - } - }, - "response": { - "required": [ - "psbt", - "feerate_per_kw", - "estimated_final_weight", - "excess_msat" - ], - "properties": { - "psbt": { - "type": "string", - "description": [ - "Unsigned PSBT which fulfills the parameters given." - ] - }, - "feerate_per_kw": { - "type": "u32", - "description": [ - "The feerate used to create the PSBT, in satoshis-per-kiloweight." - ] - }, - "estimated_final_weight": { - "type": "u32", - "description": [ - "The estimated weight of the transaction once fully signed." - ] - }, - "excess_msat": { - "type": "msat", - "description": [ - "The amount above *satoshi* which is available. This could be zero, or dust; it will be zero if *change_outnum* is also returned." - ] - }, - "change_outnum": { - "type": "u32", - "description": [ - "The 0-based output number where change was placed (only if parameter *excess_as_change* was true and there was sufficient funds)." - ] - }, - "reservations": { - "type": "array", - "description": [ - "If *reserve* was true or a non-zero number, just as per lightning- reserveinputs(7)." - ], - "items": { - "type": "object", - "required": [ - "txid", - "vout", - "was_reserved", - "reserved", - "reserved_to_block" - ], - "additionalProperties": false, - "properties": { - "txid": { - "type": "txid", - "description": [ - "The txid of the transaction." - ] - }, - "vout": { - "type": "u32", - "description": [ - "The 0-based output number." - ] - }, - "was_reserved": { - "type": "boolean", - "enum": [ - false - ], - "description": [ - "Whether this output was previously reserved." - ] - }, - "reserved": { - "type": "boolean", - "enum": [ - true - ], - "description": [ - "Whether this output is now reserved." - ] - }, - "reserved_to_block": { - "type": "u32", - "description": [ - "The blockheight the reservation will expire." - ] - } - } - } - } - }, - "post_return_value_notes": [ - "If *excess_as_change* is true and the excess is enough to cover an additional output above the `dust_limit`, then an output is added to the PSBT for the excess amount. The *excess_msat* will be zero. A *change_outnum* will be returned with the index of the change output." - ] - }, - "example_usage": [ - "Let's assume the caller is trying to produce a 100,000 satoshi output.", - "", - "First, the caller estimates the weight of the core (typically 42) and known outputs of the transaction (typically (9 + scriptlen) * 4). For a simple P2WPKH it's a 22 byte scriptpubkey, so that's 124 weight.", - "", - "It calls \"*fundpsbt* 100000sat slow 166\", which succeeds, and returns the *psbt* and *feerate_per_kw* it used, the *estimated_final_weight* and any *excess_msat*.", - "", - "If *excess_msat* is greater than the cost of adding a change output, the caller adds a change output randomly to position 0 or 1 in the PSBT. Say *feerate_per_kw* is 253, and the change output is a P2WPKH (weight 124), the cost is around 31 sats. With the dust limit disallowing payments below 546 satoshis, we would only create a change output if *excess_msat* was greater or equal to 31 + 546." - ], - "errors": [ - "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", - "", - "- -32602: If the given parameters are wrong.", - "- -1: Catchall nonspecific error.", - "- 301: Insufficient UTXOs to meet *satoshi* value." - ], - "example_json_request": [ - { - "id": "example:fundpsbt#1", - "method": "fundpsbt", - "params": { - "satoshi": 16777216, - "feerate": "253perkw", - "startweight": 250, - "minconf": null, - "reserve": 0, - "locktime": null, - "min_witness_weight": null, - "excess_as_change": false - } - }, - { - "id": "example:fundpsbt#2", - "method": "fundpsbt", - "params": { - "satoshi": "all", - "feerate": "1000perkw", - "startweight": 1000, - "minconf": null, - "reserve": null, - "locktime": null, - "min_witness_weight": null, - "excess_as_change": false - } - }, - { - "id": "example:fundpsbt#3", - "method": "fundpsbt", - "params": { - "satoshi": "109000sat", - "feerate": "slow", - "startweight": 166, - "minconf": null, - "reserve": null, - "locktime": null, - "min_witness_weight": null, - "excess_as_change": true - } - } - ], - "example_json_response": [ - { - "psbt": "cHNidP8BADMCAAAAAWzmSFzhTtXBnQewytc32WaMwJSunScwsYndBNdU80JqAAAAAAD9////AGYAAAAAAQDeAgAAAAABAU1MpIJeOOzqAYVkZaytJCmzUadBVltKar8kWtzKSVeYAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFD8W5uBNZAxN6n1jqU62dxWQbyGAAkcwRAIgUK+vMOeWiDPiJM8fpgKCjjwXog4yfWPvtKES1ZZPaM8CIB3cgouGpV6Gc7nEvAu28Mg9tkAWt/Xl5FDOseEyeZqHASECTwjR0I3gLHdSW7jRmnVXdm0+MgJ1hihnqEfXYeFWA/NlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=", - "feerate_per_kw": 253, - "estimated_final_weight": 521, - "excess_msat": 9999869000 - }, - { - "psbt": "cHNidP8BAF4CAAAAAfwbEpvpi6D14YV4VLnuVB47Y0uF41kXEyJRL4IusySSAQAAAAD9////ASICAAAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5nAAAAAAEA9gIAAAAAAQFEkxvLatohY6mw5gr5qG1aiArSrziFPR2YoqD21Hv+RAAAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNrz8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIEu1nfVRt9i+rFM219mwhMqdwJsqygWSWTFUS+cemdh6AiBG3Qo8g9J/aAMO2RHDsIBScscj6pTTIwZp7Gw8G3EOKAEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPZgAAAAEBK68/DwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==", - "feerate_per_kw": 1000, - "estimated_final_weight": 1443, - "excess_msat": 997354000, - "change_outnum": 0, - "reservations": [ - { - "txid": "9224b32e822f5122131759e3854b633b1e54eeb9547885e1f5a08be99b121bfc", - "vout": 1, - "was_reserved": false, - "reserved": true, - "reserved_to_block": 175 - } - ] - }, - { - "psbt": "cHNidP8BAF4CAAAAAbEf44mT/BPDxLkUjKy1byWksyLyuM6hbe8shzEbbXhGAQAAAAD9////AU58DQAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5sAAAAAAEA9gIAAAAAAQEV9Sj1wfHqO/ECZeHp/u7cFL5eRaa1Vu4hXWbwH72pxgEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIGILT3DrcNn6/WKOhsxxKq7lDWq47dV0IjRhj0bYHs4yAiApzODtmrz7ifK32G81A2XbBxWboFk2vN4T3ng/hYmb1wEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPZgAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==", - "feerate_per_kw": 3750, - "estimated_final_weight": 609, - "excess_msat": 0, - "change_outnum": 0, - "reservations": [ - { - "txid": "46786d1b31872cef6da1ceb8f222b3a4256fb5ac8c14b9c4c313fc9389e31fb1", - "vout": 1, - "was_reserved": false, - "reserved": true, - "reserved_to_block": 180 - } - ] - } - ], - "author": [ - "Rusty Russell <> is mainly responsible." - ], - "see_also": [ - "lightning-utxopsbt(7)", - "lightning-reserveinputs(7)", - "lightning-unreserveinputs(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-getinfo.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "getinfo", - "title": "Command to receive all information about the Core Lightning node.", - "description": [ - "The **getinfo** gives a summary of the current running node." - ], - "request": { - "required": [], - "properties": {} - }, - "response": { - "required": [ - "id", - "alias", - "color", - "num_peers", - "num_pending_channels", - "num_active_channels", - "num_inactive_channels", - "version", - "blockheight", - "network", - "fees_collected_msat", - "lightning-dir", - "address" - ], - "properties": { - "id": { - "type": "pubkey", - "description": [ - "The public key unique to this node." - ] - }, - "alias": { - "type": "string", - "description": [ - "The fun alias this node will advertize." - ], - "maxLength": 32 - }, - "color": { - "type": "hex", - "description": [ - "The favorite RGB color this node will advertize." - ], - "minLength": 6, - "maxLength": 6 - }, - "num_peers": { - "type": "u32", - "description": [ - "The total count of peers, connected or with channels." - ] - }, - "num_pending_channels": { - "type": "u32", - "description": [ - "The total count of channels being opened." - ] - }, - "num_active_channels": { - "type": "u32", - "description": [ - "The total count of channels in normal state." - ] - }, - "num_inactive_channels": { - "type": "u32", - "description": [ - "The total count of channels waiting for opening or closing transactions to be mined." - ] - }, - "version": { - "type": "string", - "description": [ - "Identifies what bugs you are running into." - ] - }, - "lightning-dir": { - "type": "string", - "description": [ - "Identifies where you can find the configuration and other related files." - ] - }, - "our_features": { "type": "object", - "description": [ - "Our BOLT #9 feature bits (as hexstring) for various contexts." - ], + "comment": "Plugins can add fields to this, so we can't rule out additional properties :(", "additionalProperties": true, - "required": [ - "init", - "node", - "channel", - "invoice" - ], + "required": [], "properties": { - "init": { - "type": "hex", - "description": [ - "Features (incl. globalfeatures) in our init message, these also restrict what we offer in open_channel or accept in accept_channel." - ] - }, - "node": { - "type": "hex", - "description": [ - "Features in our node_announcement message." - ] - }, - "channel": { - "type": "hex", - "description": [ - "Negotiated channel features we (as channel initiator) publish in the channel_announcement message." - ] - }, - "invoice": { - "type": "hex", - "description": [ - "Features in our BOLT11 invoices." - ] - } - } - }, - "blockheight": { - "type": "u32", - "description": [ - "The highest block height we've learned." - ] - }, - "network": { - "type": "string", - "description": [ - "Represents the type of network on the node are working (e.g: `bitcoin`, `testnet`, or `regtest`)." - ] - }, - "fees_collected_msat": { - "type": "msat", - "description": [ - "Total routing fees collected by this node." - ] - }, - "address": { - "type": "array", - "description": [ - "The addresses we announce to the world." - ], - "items": { - "type": "object", - "required": [ - "type", - "port" - ], - "additionalProperties": true, - "properties": { - "type": { - "type": "string", - "enum": [ - "dns", - "ipv4", - "ipv6", - "torv2", - "torv3" - ], - "description": [ - "Type of connection (until 23.08, `websocket` was also allowed)." - ] - }, - "port": { - "type": "u16", - "description": [ - "Port number." - ] + "conf": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from cmdline." + ] + }, + "source": { + "type": "string", + "enum": [ + "cmdline" + ], + "description": [ + "Source of configuration setting." + ] + } } }, - "if": { + "developer": { + "type": "object", + "added": "v23.08", + "additionalProperties": false, + "required": [ + "set", + "source" + ], "properties": { - "type": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { "type": "string", - "enum": [ - "dns", - "ipv4", - "ipv6", - "torv2", - "torv3" + "description": [ + "Source of configuration setting." ] } } }, - "then": { + "clear-plugins": { + "type": "object", + "additionalProperties": false, "required": [ - "type", - "address", - "port" + "set", + "source" ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "disable-mpp": { + "type": "object", "additionalProperties": false, + "required": [ + "set", + "source" + ], "properties": { - "type": {}, - "port": {}, - "address": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { "type": "string", "description": [ - "Address in expected format for **type**." + "Source of configuration setting." + ] + }, + "plugin": { + "type": "string", + "description": [ + "Plugin which registered this configuration setting." ] } } }, - "else": { + "mainnet": { + "type": "object", + "additionalProperties": false, "required": [ - "type", - "port" + "set", + "source" ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "regtest": { + "type": "object", "additionalProperties": false, + "required": [ + "set", + "source" + ], "properties": { - "type": {}, - "port": {} + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } } - } - } - }, - "binding": { - "type": "array", - "description": [ - "The addresses we are listening on." - ], - "items": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "local socket", - "websocket", - "ipv4", - "ipv6", - "torv2", - "torv3" - ], - "description": [ - "Type of connection." - ] - }, - "address": { - "type": "string", - "description": [ - "Address in expected format for **type**." - ] - }, - "port": { - "type": "u16", - "description": [ - "Port number." - ] + }, + "signet": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } } }, - "allOf": [ - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "local socket" - ] - } - } + "testnet": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] }, - "then": { - "additionalProperties": false, - "required": [ - "type", - "socket" - ], - "properties": { - "type": {}, - "socket": { - "type": "string", - "description": [ - "Socket filename." - ] - } + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "important-plugin": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] } }, - "else": { - "additionalProperties": false, - "required": [ - "type", - "address", - "port" - ], - "properties": { - "type": {}, - "address": {}, - "port": {}, - "subtype": {} + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] } } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "websocket" - ] - } + } + }, + "plugin": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] } }, - "then": { - "additionalProperties": false, - "required": [ - "type", - "address", - "port", - "subtype" - ], - "properties": { - "type": {}, - "address": {}, - "port": {}, - "subtype": { - "type": "string", - "description": [ - "Type of address." - ] - } + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + } + }, + "plugin-dir": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] } }, - "else": { - "additionalProperties": false, - "required": [ - "type" - ], - "properties": { - "type": {}, - "address": {}, - "port": {}, - "socket": {} + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] } } } - ] - } - }, - "warning_bitcoind_sync": { - "type": "string", - "description": [ - "Bitcoind is not up-to-date with network." - ] - }, - "warning_lightningd_sync": { - "type": "string", - "description": [ - "Lightningd is still loading latest blocks from bitcoind." - ] - } - } - }, - "example_json_request": [ - { - "id": "example:getinfo#1", - "method": "getinfo", - "params": {} - } - ], - "example_json_response": [ - { - "id": "02bf811f7571754f0b51e6d41a8885f5561041a7b14fac093e4cffb95749de1a8d", - "alias": "SLICKERGOPHER", - "color": "02bf81", - "num_peers": 0, - "num_pending_channels": 0, - "num_active_channels": 0, - "num_inactive_channels": 0, - "address": [ - { - "type": "torv3", - "address": "fp463inc4w3lamhhduytrwdwq6q6uzugtaeapylqfc43agrdnnqsheyd.onion", - "port": 9736 - }, - { - "type": "torv3", - "address": "ifnntp5ak4homxrti2fp6ckyllaqcike447ilqfrgdw64ayrmkyashid.onion", - "port": 9736 - } - ], - "binding": [ - { - "type": "ipv4", - "address": "127.0.0.1", - "port": 9736 - } - ], - "version": "v0.10.2", - "blockheight": 724302, - "network": "bitcoin", - "msatoshi_fees_collected": 0, - "fees_collected_msat": "0msat", - "lightning-dir": "/media/vincent/Maxtor/C-lightning/node/bitcoin", - "our_features": { - "init": "8828226aa2", - "node": "80008828226aa2", - "channel": "", - "invoice": "20024200" - } - } - ], - "errors": [ - "On failure, one of the following error codes may be returned:", - "", - "- -32602: Error in given parameters or some error happened during the command process." - ], - "author": [ - "Vincenzo Palazzo <> wrote the initial version of this man page,", - "but many others did the hard work of actually implementing this rpc command." - ], - "see_also": [ - "lightning-connect(7)", - "lightning-fundchannel(7)", - "lightning-listconfigs(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-getlog.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "getlog", - "title": "Command to show logs.", - "description": [ - "The **getlog** the RPC command to show logs, with optional log *level*." - ], - "request": { - "required": [], - "properties": { - "level": { - "type": "string", - "enum": [ - "broken", - "unusual", - "info", - "debug", - "io" - ], - "description": [ - "A string that represents the log level." - ], - "default": "*info*" - } - } - }, - "response": { - "required": [ - "created_at", - "bytes_used", - "bytes_max", - "log" - ], - "properties": { - "created_at": { - "type": "string", - "description": [ - "UNIX timestamp with 9 decimal places, when logging was initialized." - ] - }, - "bytes_used": { - "type": "u32", - "description": [ - "The number of bytes used by logging records." - ] - }, - "bytes_max": { - "type": "u32", - "description": [ - "The bytes_used values at which records will be trimmed ." - ] - }, - "log": { - "type": "array", - "items": { - "type": "object", - "required": [ - "type" - ], - "additionalProperties": true, - "properties": { - "type": { - "type": "string", - "enum": [ - "SKIPPED", - "BROKEN", - "UNUSUAL", - "INFO", - "DEBUG", - "IO_IN", - "IO_OUT" - ] + }, + "lightning-dir": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } } }, - "allOf": [ - { - "if": { - "additionalProperties": true, - "properties": { - "type": { - "enum": [ - "SKIPPED" - ] - } - } + "network": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default (can also be changed by `testnet`, `signet`, `regtest` options!)." + ] }, - "then": { - "additionalProperties": false, - "required": [ - "num_skipped" - ], - "properties": { - "type": {}, - "num_skipped": { - "type": "u32", - "description": [ - "Number of unprinted log entries (deleted or below *level* parameter)." - ] - } - } + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] } - }, - { - "if": { - "additionalProperties": true, - "properties": { - "type": { - "enum": [ - "BROKEN", - "UNUSUAL", - "INFO", - "DEBUG" - ] - } - } + } + }, + "allow-deprecated-apis": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_bool", + "source" + ], + "properties": { + "value_bool": { + "type": "boolean", + "description": [ + "Field from config or cmdline, or default." + ] }, - "then": { - "additionalProperties": false, - "required": [ - "time", - "source", - "log" - ], - "properties": { - "type": {}, - "time": { - "type": "string", - "description": [ - "UNIX timestamp with 9 decimal places after **created_at**." - ] - }, - "source": { - "type": "string", - "description": [ - "The particular logbook this was found in." - ] - }, - "log": { - "type": "string", - "description": [ - "The actual log message." - ] - }, - "node_id": { - "type": "pubkey", - "description": [ - "The peer this is associated with." - ] - } - } + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] } - }, - { - "if": { - "additionalProperties": true, - "properties": { - "type": { - "enum": [ - "IO_IN", - "IO_OUT" - ] - } - } + } + }, + "rpc-file": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] }, - "then": { - "additionalProperties": false, - "required": [ - "time", - "source", - "log", - "data" - ], - "properties": { - "type": {}, - "time": { - "type": "string", - "description": [ - "Seconds after **created_at**, with 9 decimal places." - ] - }, - "source": { - "type": "string", - "description": [ - "The particular logbook this was found in." - ] - }, - "log": { - "type": "string", - "description": [ - "The associated log message." - ] - }, - "node_id": { - "type": "pubkey", - "description": [ - "The peer this is associated with." - ] - }, - "data": { - "type": "hex", - "description": [ - "The IO which occurred." - ] - } - } + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] } } - ] - } - } - } - }, - "example_json_request": [ - { - "id": "example:getlog#1", - "method": "getlog", - "params": { - "level": "debug" - } - } - ], - "errors": [ - "On failure, one of the following error codes may be returned:", - "", - "- -32602: Error in given parameters." - ], - "example_json_response": [ - { - "created_at": "1598192543.820753463", - "bytes_used": 89285843, - "bytes_max": 104857600, - "log": [ - { - "type": "SKIPPED", - "num_skipped": 45 - }, - { - "type": "INFO", - "time": "0.453627568", - "source": "plugin-autopilot.py", - "log": "RPCmethod'autopilot-run-once'doesnothaveadocstring." - } - ] - } - ], - "author": [ - "Vincenzo Palazzo <> wrote the initial version of this man page,", - "but many others did the hard work of actually implementing this rpc command." - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-getroute.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "getroute", - "title": "Command for routing a payment (low-level)", - "description": [ - "The **getroute** RPC command attempts to find the best route for the payment of *amount_msat* to lightning node *id*, such that the payment will arrive at *id* with *cltv*.", - "", - "There are two considerations for how good a route is: how low the fees are, and how long your payment will get stuck in a delayed output if a node goes down during the process. ." - ], - "request": { - "required": [ - "id", - "amount_msat", - "riskfactor" - ], - "properties": { - "id": { - "type": "pubkey", - "description": [ - "Node pubkey to find the best route for the payment." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "Amount to send. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. The 0 value is special: it ignores any *htlc_minimum_msat* setting on channels, and simply returns a possible route (if any) which is useful for simple probing." - ] - }, - "riskfactor": { - "type": "u64", - "description": [ - "A non-negative floating-point field controls this tradeoff; it is the annual cost of your funds being stuck (as a percentage). For example, if you thought the convenience of keeping your funds liquid (not stuck) was worth 20% per annum interest, *riskfactor* would be 20. If you didn't care about risk, *riskfactor* would be zero." - ] - }, - "cltv": { - "type": "u32", - "description": [ - "Cltv-blocks to spare." - ], - "default": "9" - }, - "fromid": { - "type": "pubkey", - "description": [ - "The node to start the route from." - ], - "default": "this node" - }, - "fuzzpercent": { - "type": "u32", - "description": [ - "Used to distort fees to provide some randomization to the route generated, but it was not properly implemented and is ignored." - ] - }, - "exclude": { - "type": "array", - "description": [ - "A JSON array of short-channel-id/direction (e.g. ['564334x877x1/0', '564195x1292x0/1' ]) or node-id which should be excluded from consideration for routing. Note if the source or destination is excluded, the command result is undefined." - ], - "default": "not to exclude any channels or nodes", - "items": { - "type": "string" - } - }, - "maxhops": { - "type": "u32", - "description": [ - "The maximum number of channels to return." - ], - "default": "20" - } - } - }, - "response": { - "required": [ - "route" - ], - "properties": { - "route": { - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "direction", - "channel", - "amount_msat", - "delay", - "style" - ], - "additionalProperties": false, - "properties": { - "id": { - "type": "pubkey", - "description": [ - "The node at the end of this hop." - ] - }, - "channel": { - "type": "short_channel_id", - "description": [ - "The channel joining these nodes." - ] - }, - "direction": { - "type": "u32", - "description": [ - "0 if this channel is traversed from lesser to greater **id**, otherwise 1." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "The amount expected by the node at the end of this hop." - ] - }, - "delay": { - "type": "u32", - "description": [ - "The total CLTV expected by the node at the end of this hop." - ] - }, - "style": { - "type": "string", - "description": [ - "The features understood by the destination node." - ], - "enum": [ - "tlv" - ] + }, + "disable-plugin": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] + } + }, + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } } - } - } - } - }, - "post_return_value_notes": [ - "The final *id* will be the destination *id* given in the input. The difference between the first *amount_msat* minus the *amount_msat* given in the input is the fee (assuming the first hop is free). The first *delay* is the very worst case timeout for the payment failure, in blocks." - ] - }, - "riskfactor_effect_on_routing": [ - "The risk factor is treated as if it were an additional fee on the route, for the purposes of comparing routes.", - "", - "The formula used is the following approximation:", - "", - " risk-fee = amount x blocks-timeout x per-block-cost", - "", - "We are given a *riskfactor* expressed as a percentage. There are 52596 blocks per year, thus *per-block-cost* is *riskfactor* divided by 5,259,600.", - "", - "The final result is:", - "", - " risk-fee = amount x blocks-timeout x riskfactor / 5259600", - "", - "Here are the risk fees in millisatoshis, using various parameters. I assume a channel charges the default of 1000 millisatoshis plus 1 part-per-million. Common to_self_delay values on the network at 14 and 144 blocks.", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "
Amount (msat)RiskfactorDelayRisk FeeRoute fee

10,000

1

14

0

1001

10,000

10

14

0

1001

10,000

100

14

2

1001

10,000

1000

14

26

1001

1,000,000

1

14

2

1001

1,000,000

10

14

26

1001

1,000,000

100

14

266

1001

1,000,000

1000

14

2661

1001

100,000,000

1

14

266

1100

100,000,000

10

14

2661

1100

100,000,000

100

14

26617

1100

100,000,000

1000

14

266179

1100

10,000

1

144

0

1001

10,000

10

144

2

1001

10,000

100

144

27

1001

10,000

1000

144

273

1001

1,000,000

1

144

27

1001

1,000,000

10

144

273

1001

1,000,000

100

144

2737

1001

1,000,000

1000

144

27378

1001

100,000,000

1

144

2737

1100

100,000,000

10

144

27378

1100

100,000,000

100

144

273785

1100

100,000,000

1000

144

2737850

1100

" - ], - "recommended_riskfactor_values": [ - "The default *fuzz* factor is 5%, so as you can see from the table above, that tends to overwhelm the effect of *riskfactor* less than about 5.", - "", - "1 is a conservative value for a stable lightning network with very few failures.", - "", - "1000 is an aggressive value for trying to minimize timeouts at all costs.", - "", - "The default for lightning-pay(7) is 10, which starts to become a major factor for larger amounts, and is basically ignored for tiny ones." - ], - "example_json_request": [ - { - "id": "example:getroute#1", - "method": "getroute", - "params": { - "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "amount_msat": 50000000, - "riskfactor": 1, - "cltv": 9, - "fromid": null, - "fuzzpercent": null, - "exclude": null, - "maxhops": null - } - }, - { - "id": "example:getroute#2", - "method": "getroute", - "params": { - "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "amount_msat": "50000sat", - "riskfactor": 10 - } - } - ], - "example_json_response": [ - { - "route": [ - { - "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "channel": "103x3x0", - "direction": 1, - "amount_msat": 50001002, - "delay": 21, - "style": "tlv" - }, - { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "channel": "103x1x0", - "direction": 1, - "amount_msat": 50000501, - "delay": 15, - "style": "tlv" - }, - { - "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "channel": "103x2x0", - "direction": 0, - "amount_msat": 50000000, - "delay": 9, - "style": "tlv" - } - ] - }, - { - "route": [ - { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "channel": "103x2x0", - "direction": 1, - "amount_msat": 50051000, - "delay": 15, - "style": "tlv" - }, - { - "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "channel": "103x1x0", - "direction": 0, - "amount_msat": 50000000, - "delay": 9, - "style": "tlv" - } - ] - } - ], - "author": [ - "Rusty Russell <> is mainly responsible." - ], - "see_also": [ - "lightning-pay(7)", - "lightning-sendpay(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-help.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "help", - "title": "Command to return all information about RPC commands.", - "description": [ - "The **help** is a RPC command which is possible consult all information about the RPC commands, or a specific command if *command* is given.", - "", - "Note that the lightning-cli(1) tool will prefer to list a man page when a specific *command* is specified, and will only return the JSON if the man page is not found." - ], - "request": { - "required": [], - "properties": { - "command": { - "type": "string", - "description": [ - "Command to get information about." - ] - } - } - }, - "response": { - "required": [ - "help" - ], - "properties": { - "help": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "command", - "category", - "description", - "verbose" - ], - "properties": { - "command": { - "type": "string", - "description": [ - "The command." - ] - }, - "category": { - "type": "string", - "description": [ - "The category for this command (useful for grouping)." - ] - }, - "description": { - "type": "string", - "description": [ - "A one-line description of the purpose of this command." - ] - }, - "verbose": { - "type": "string", - "description": [ - "A full description of this command (including whether it's deprecated)." - ] + }, + "always-use-proxy": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_bool", + "source" + ], + "properties": { + "value_bool": { + "type": "boolean", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } } - } - } - }, - "format-hint": { - "type": "string", - "enum": [ - "simple" - ], - "description": [ - "Prints the help in human-readable flat form." - ] - } - } - }, - "example_json_request": [ - { - "id": "example:help#1", - "method": "help", - "params": { - "command": "pay" - } - }, - { - "id": "example:help#2", - "method": "help", - "params": { - "command": "dev" - } - } - ], - "errors": [ - "On failure, one of the following error codes may be returned:", - "", - "- -32602: Error in given parameters." - ], - "example_json_response": [ - { - "help": [ - { - "command": "pay bolt11 [amount_msat] [label] [riskfactor] [maxfeepercent] [retry_for] [maxdelay] [exemptfee] [localinvreqid] [exclude] [maxfee] [description] [dev_use_shadow]", - "category": "plugin", - "description": "Send payment specified by {bolt11}", - "verbose": "Attempt to pay the {bolt11} invoice." - } - ], - "format-hint": "simple" - }, - { - "help": [ - { - "command": "dev subcommand=crash|rhash|slowcmd", - "category": "developer", - "description": "Developer command test multiplexer", - "verbose": "dev rhash {secret}\n\tShow SHA256 of {secret}\ndev crash\n\tCrash lightningd by calling fatal()\ndev slowcmd {msec}\n\tTorture test for slow commands, optional {msec}\n" - } - ], - "format-hint": "simple" - } - ], - "author": [ - "Vincenzo Palazzo <> wrote the initial version of this man page,", - "but many others did the hard work of actually implementing this rpc command." - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-invoice.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "invoice", - "title": "Command for accepting payments", - "description": [ - "The **invoice** RPC command creates the expectation of a payment of a given amount of milli-satoshi: it returns a unique token which another lightning daemon can use to pay this invoice. This token includes a *route hint* description of an incoming channel with capacity to pay the invoice, if any exists." - ], - "request": { - "required": [ - "amount_msat", - "label", - "description" - ], - "properties": { - "amount_msat": { - "type": "msat_or_any", - "description": [ - "The string `any`, which creates an invoice that can be paid with any amount. Otherwise it is a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*." - ] - }, - "label": { - "oneOf": [ - { - "type": "string" }, - { - "type": "integer" - } - ], - "description": [ - "A unique string or number (which is treated as a string, so `01` is different from `1`); it is never revealed to other nodes on the lightning network, but it can be used to query the status of this invoice." - ] - }, - "description": { - "type": "string", - "description": [ - "A short description of purpose of payment, e.g. *1 cup of coffee*. This value is encoded into the BOLT11 invoice and is viewable by any node you send this invoice to (unless *deschashonly* is true as described below). It must be UTF-8, and cannot use *\\u* JSON escape codes." - ] - }, - "expiry": { - "type": "u64", - "description": [ - "The time the invoice is valid for, in seconds. If no value is provided the default of 604800 (1 week) is used." - ] - }, - "fallbacks": { - "type": "array", - "description": [ - "One or more fallback addresses to include in the invoice (in order from most- preferred to least): note that these arrays are not currently tracked to fulfill the invoice." - ], - "items": { - "type": "string" - } - }, - "preimage": { - "type": "hex", - "description": [ - "A 64-digit hex string to be used as payment preimage for the created invoice. By default, if unspecified, lightningd will generate a secure pseudorandom preimage seeded from an appropriate entropy source on your system. **IMPORTANT**: if you specify the *preimage*, you are responsible, to ensure appropriate care for generating using a secure pseudorandom generator seeded with sufficient entropy, and keeping the preimage secret. This parameter is an advanced feature intended for use with cutting-edge cryptographic protocols and should not be used unless explicitly needed." - ] - }, - "exposeprivatechannels": { - "description": [ - "If specified, it overrides the default route hint logic, which will use unpublished channels only if there are no published channels." - ], - "oneOf": [ - { - "type": "boolean", - "description": [ - "If *True* unpublished channels are always considered as a route hint candidate; if *False*, never." - ] + "daemon": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } }, - { - "type": "array", - "description": [ - "Array of short channel ids (or a remote alias), only those specific channels will be considered candidates, even if they are public or dead-ends." + "wallet": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" ], - "items": { - "type": "short_channel_id" + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } } }, - { - "type": "short_channel_id", - "description": [ - "If it is a short channel id (e.g. *1x1x3*), only this specific channel will be considered candidate, even if it is public or dead-end." - ] - } - ] - }, - "cltv": { - "type": "u32", - "description": [ - "If specified, sets the *min_final_cltv_expiry* for the invoice. Otherwise, it's set to the parameter **cltv-final**." - ] - }, - "deschashonly": { - "type": "boolean", - "description": [ - "If True, then the bolt11 returned contains a hash of the *description*, rather than the *description* itself: this allows much longer descriptions, but they must be communicated via some other mechanism." - ], - "default": "False" - } - } - }, - "response": { - "required": [ - "payment_hash", - "expires_at", - "created_index", - "bolt11", - "payment_secret" - ], - "properties": { - "bolt11": { - "type": "string", - "description": [ - "The bolt11 string." - ] - }, - "payment_hash": { - "type": "hash", - "description": [ - "The hash of the *payment_preimage* which will prove payment." - ] - }, - "payment_secret": { - "type": "secret", - "description": [ - "The *payment_secret* to place in the onion." - ] - }, - "expires_at": { - "type": "u64", - "description": [ - "UNIX timestamp of when invoice expires." - ] - }, - "created_index": { - "type": "u64", - "added": "v23.08", - "description": [ - "1-based index indicating order this invoice was created in." - ] - }, - "warning_capacity": { - "type": "string", - "description": [ - "Even using all possible channels, there's not enough incoming capacity to pay this invoice." - ] - }, - "warning_offline": { - "type": "string", - "description": [ - "There would be enough incoming capacity, but some channels are offline, so there isn't." - ] - }, - "warning_deadends": { - "type": "string", - "description": [ - "There would be enough incoming capacity, but some channels are dead-ends (no other public channels from those peers), so there isn't." - ] - }, - "warning_private_unused": { - "type": "string", - "description": [ - "There would be enough incoming capacity, but some channels are unannounced and *exposeprivatechannels* is *false*, so there isn't." - ] - }, - "warning_mpp": { - "type": "string", - "description": [ - "There is sufficient capacity, but not in a single channel, so the payer will have to use multi-part payments." - ] - } - } - }, - "errors": [ - "On failure, an error is returned and no invoice is created. If the", - "lightning process fails before responding, the caller should use", - "lightning-listinvoices(7) to query whether this invoice was created or", - "not.", - "", - "The following error codes may occur:", - "", - "- -1: Catchall nonspecific error.", - "- 900: An invoice with the given *label* already exists.", - "- 901: An invoice with the given *preimage* already exists.", - "- 902: None of the specified *exposeprivatechannels* were usable." - ], - "example_json_request": [ - { - "id": "example:invoice#1", - "method": "invoice", - "params": { - "amount_msat": 11000000, - "label": "xEoCR94SIz6UIRUEkxum", - "description": [ - "XEoCR94SIz6UIRUEkxum." - ], - "expiry": null, - "fallbacks": null, - "preimage": null, - "exposeprivatechannels": null, - "cltv": null, - "deschashonly": null - } - }, - { - "id": "example:invoice#2", - "method": "invoice", - "params": { - "amount_msat": 100, - "label": "8", - "description": "inv", - "expiry": null, - "fallbacks": null, - "preimage": null, - "exposeprivatechannels": null, - "cltv": null, - "deschashonly": null - } - } - ], - "example_json_response": [ - { - "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", - "expires_at": 1706757730, - "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk", - "payment_secret": "82644944d3f70d42aad1d5f7b5d7a629e7afa30b529cc952a4c59fc0e3790ea2", - "created_index": 1, - "warning_deadends": "Insufficient incoming capacity, once dead-end peers were excluded" - }, - { - "payment_hash": "f59ae0204dfe8e913207ea36646255b9d2c7c8229e8693d30547fc622eddb6b4", - "expires_at": 1709229182, - "bolt11": "lnbcrt1n1pja0z07sp5n8fk890nrq7zlcue0lgu7cduaaz765u5rg0kcud4amphuppu8wxspp57kdwqgzdl68fzvs8agmxgcj4h8fv0jpzn6rf85c9gl7xytkak66qdq9d9h8vxqyjw5qcqp99qxpqysgqrneaxh0plvjft457yv3q92rak57a6xw33m6phr0mrsy69sudzgez3adkzdsgwzy32z5usjpxm4rjgcg70h047wf0pgc4l9gyaj2h9ssqcrtv32", - "payment_secret": "99d36395f3183c2fe3997fd1cf61bcef45ed53941a1f6c71b5eec37e043c3b8d", - "created_index": 9, - "warning_capacity": "Insufficient incoming channel capacity to pay invoice" - } - ], - "author": [ - "Rusty Russell <> is mainly responsible." - ], - "see_also": [ - "lightning-listinvoices(7)", - "lightning-delinvoice(7)", - "lightning-pay(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-invoicerequest.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "added": "v22.11", - "rpc": "invoicerequest", - "title": "Command for offering payments", - "warning": "experimental-offers only", - "description": [ - "The **invoicerequest** RPC command creates an `invoice_request` to send payments: it automatically enables the processing of an incoming invoice, and payment of it. The reader of the resulting `invoice_request` can use lightning-sendinvoice(7) to collect their payment." - ], - "request": { - "required": [ - "amount", - "description" - ], - "properties": { - "amount": { - "type": "msat", - "description": [ - "A positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*." - ] - }, - "description": { - "type": "string", - "description": [ - "A short description of purpose of the payment, e.g. *ATM withdrawl*. This value is encoded into the resulting `invoice_request` and is viewable by anyone you expose it to. It must be UTF-8, and cannot use *\\u* JSON escape codes." - ] - }, - "issuer": { - "type": "string", - "description": [ - "Who is issuing it (i.e. you) if appropriate." - ] - }, - "label": { - "type": "string", - "description": [ - "An internal-use name for the offer, which can be any UTF-8 string." - ] - }, - "absolute_expiry": { - "type": "u64", - "description": [ - "The time the offer is valid until, in seconds since the first day of 1970 UTC. If not set, the `invoice_request` remains valid (though it can be deactivated by the issuer of course). This is encoded in the `invoice_request`." - ] - }, - "single_use": { - "type": "boolean", - "description": [ - "Indicates that the `invoice_request` is only valid once; we may attempt multiple payments, but as soon as one is successful no more invoices are accepted (i.e. only one person can take the money)." - ], - "default": "True" - } - } - }, - "response": { - "required": [ - "invreq_id", - "single_use", - "active", - "bolt12", - "used" - ], - "properties": { - "invreq_id": { - "type": "hash", - "description": [ - "The SHA256 hash of all invoice_request fields less than 160." - ] - }, - "active": { - "type": "boolean", - "enum": [ - true - ], - "description": [ - "Whether the invoice_request is currently active." - ] - }, - "single_use": { - "type": "boolean", - "description": [ - "Whether the invoice_request will become inactive after we pay an invoice for it." - ] - }, - "bolt12": { - "type": "string", - "description": [ - "The bolt12 string starting with lnr." - ] - }, - "used": { - "type": "boolean", - "enum": [ - false - ], - "description": [ - "Whether the invoice_request has already been used." - ] - }, - "label": { - "type": "string", - "description": [ - "The label provided when creating the invoice_request." - ] - } - } - }, - "example_json_request": [ - { - "id": "example:invoicerequest#1", - "method": "invoicerequest", - "params": { - "amount": "10000sat", - "description": "simple test", - "issuer": "clightning test suite" - } - } - ], - "example_json_response": [ - { - "invreq_id": "715484ead84bcdae5b33e3015c686fa1bdd4ae9ade3c4729b58257a98cfcd9b5", - "active": true, - "single_use": true, - "bolt12": "lnr1qqgteyhfyp40c79a5y3gfe33nxfs6zstwd5k6urvv5s8getnwsfp2cmvd9nksarwd9hxwgr5v4ehggrnw45hge2syqrzymjxzydqkkw24ufxqslttwlj3s608f0rx2slc7etw0833zgs75srnztgqkppqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq633uzq99smfawuu6pz0zh9jl6dl8v25u3kzes975x2j9tr0qp0ux0tlzcxjrgehxh9luz5vwjpk92tys9f9zlm038krcz4uqfxgelwf43tgfc", - "used": false - } - ], - "errors": [ - "On failure, an error is returned and no `invoice_request` is created. If the lightning process fails before responding, the caller should use lightning-listinvoicerequests(7) to query whether it was created or not.", - "", - "- -1: Catchall nonspecific error." - ], - "author": [ - "Rusty Russell <> is mainly responsible." - ], - "see_also": [ - "lightning-listinvoicerequests(7)", - "lightning-disableinvoicerequest(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-keysend.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "keysend", - "title": "Send funds to a node without an invoice", - "description": [ - "The **keysend** RPC command attempts to find a route to the given destination, and send the specified amount to it. Unlike the `pay` RPC command the `keysend` command does not require an invoice, instead it uses the `destination` node ID, and `amount` to find a route to the specified node.", - "", - "In order for the destination to be able to claim the payment, the `payment_key` is randomly generated by the sender and included in the encrypted payload for the destination. As a consequence there is not proof-of-payment, like there is with an invoice where the `payment_key` is generated on the destination, and the only way sender could have it is by sending a payment. Please ensure that this matches your use-case when using `keysend`.", - "", - "When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name." - ], - "request": { - "required": [ - "destination", - "amount_msat" - ], - "properties": { - "destination": { - "type": "pubkey", - "description": [ - "The 33 byte, hex-encoded, node ID of the node that the payment should go to." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "A whole number, or a whole number with suffix `msat` or `sat`, or a three decimal point number with suffix `sat`, or an 1 to 11 decimal point number suffixed by `btc`." - ] - }, - "label": { - "type": "string", - "description": [ - "Used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7)." - ] - }, - "maxfeepercent": { - "type": "number", - "description": [ - "Limits the money paid in fees as percentage of the total amount that is to be transferred." - ], - "default": "0.5" - }, - "retry_for": { - "type": "u32", - "description": [ - "Until *retry_for* seconds passes, the command will keep finding routes and retrying the payment. However, a payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case." - ], - "default": "60 seconds" - }, - "maxdelay": { - "type": "u32", - "description": [ - "Number of blocks the payment may be delayed." - ] - }, - "exemptfee": { - "type": "msat", - "description": [ - "Used for tiny payments which would be dominated by the fee leveraged by forwarding nodes. Setting `exemptfee` allows the `maxfeepercent` check to be skipped on fees that are smaller than *exemptfee*." - ], - "default": "5000 millisatoshi" - }, - "routehints": { - "type": "array", - "items": { - "type": "array", - "items": { + "large-channels": { "type": "object", "additionalProperties": false, "required": [ - "id", - "scid", - "feebase", - "feeprop", - "expirydelta" + "set", + "source" ], "properties": { - "id": { - "type": "pubkey" + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] }, - "scid": { - "type": "short_channel_id" + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "experimental-dual-fund": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] }, - "feebase": { - "type": "msat" + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "experimental-splicing": { + "added": "v23.08", + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] }, - "feeprop": { - "type": "u32" + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "experimental-onion-messages": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] }, - "expirydelta": { - "type": "u16" + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] } } - } - } - }, - "extratlvs": { - "type": "object", - "additionalProperties": true, - "required": [], - "description": [ - "Dictionary of additional fields to insert into the final tlv. The format is 'fieldnumber': 'hexstring'." - ] - } - } - }, - "response": { - "required": [ - "payment_preimage", - "payment_hash", - "created_at", - "parts", - "amount_msat", - "amount_sent_msat", - "status" - ], - "properties": { - "payment_preimage": { - "type": "secret", - "description": [ - "The proof of payment: SHA256 of this **payment_hash**." - ] - }, - "destination": { - "type": "pubkey", - "description": [ - "The final destination of the payment." - ] - }, - "payment_hash": { - "type": "hash", - "description": [ - "The hash of the *payment_preimage* which will prove payment." - ] - }, - "created_at": { - "type": "number", - "description": [ - "The UNIX timestamp showing when this payment was initiated." - ] - }, - "parts": { - "type": "u32", - "description": [ - "How many attempts this took." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "Amount the recipient received." - ] - }, - "amount_sent_msat": { - "type": "msat", - "description": [ - "Total amount we sent (including fees)." - ] - }, - "warning_partial_completion": { - "type": "string", - "description": [ - "Not all parts of a multi-part payment have completed." - ] - }, - "status": { - "type": "string", - "enum": [ - "complete" - ], - "description": [ - "Status of payment." - ] - } - }, - "post_return_value_notes": [ - "You can monitor the progress and retries of a payment using the lightning-paystatus(7) command." - ] - }, - "randomization": [ - "To protect user privacy, the payment algorithm performs some randomization.", - "", - "1: Route Randomization", - "", - "Route randomization means the payment algorithm does not always use the lowest-fee or shortest route. This prevents some highly-connected node from learning all of the user payments by reducing their fees below the network average.", - "", - "2: Shadow Route", - "", - "Shadow route means the payment algorithm will virtually extend the route by adding delays and fees along it, making it appear to intermediate nodes that the route is longer than it actually is. This prevents intermediate nodes from reliably guessing their distance from the payee.", - "", - "Route randomization will never exceed *maxfeepercent* of the payment. Route randomization and shadow routing will not take routes that would exceed *maxdelay*." - ], - "errors": [ - "The following error codes may occur:", - "", - "- -1: Catchall nonspecific error.", - "- 203: Permanent failure at destination. The *data* field of the error will be routing failure object.", - "- 205: Unable to find a route.", - "- 206: Route too expensive. Either the fee or the needed total locktime for the route exceeds your *maxfeepercent* or *maxdelay* settings, respectively. The *data* field of the error will indicate the actual *fee* as well as the *feepercent* percentage that the fee has of the destination payment amount. It will also indicate the actual *delay* along the route.", - "- 210: Payment timed out without a payment in progress.", - "", - "A routing failure object has the fields below:", - "", - "*erring_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on.", - "*erring_node*: The hex string of the pubkey id of the node that reported the error.", - "*erring_channel*: The short channel ID of the channel that has the error, or *0:0:0* if the destination node raised the error.", - "*failcode*: The failure code, as per BOLT #4.", - "*channel_update*: The hex string of the *channel_update* message received from the remote node. Only present if error is from the remote node and the *failcode* has the `UPDATE` bit set, as per BOLT #4." - ], - "example_json_request": [ - { - "id": "example:keysend#1", - "method": "keysend", - "params": { - "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "amount_msat": 10000, - "label": null, - "maxfeepercent": null, - "retry_for": null, - "maxdelay": null, - "exemptfee": null, - "extratlvs": null - } - }, - { - "id": "example:keysend#2", - "method": "keysend", - "params": { - "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "amount_msat": 10000000, - "label": null, - "maxfeepercent": null, - "retry_for": null, - "maxdelay": null, - "exemptfee": null, - "extratlvs": { - "133773310": "68656c6c6f776f726c64", - "133773312": "66696c7465726d65" - } - } - }, - { - "id": "example:keysend#3", - "method": "keysend", - "params": { - "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "amount_msat": 10000, - "routehints": [ - [ - { - "scid": "4615051x2233541x57738", - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "feebase": 1, - "feeprop": 10, - "expirydelta": 9 + }, + "experimental-offers": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } } - ], - [ - { - "scid": "1x2x3", - "id": "020202020202020202020202020202020202020202020202020202020202020202", - "feebase": 1, - "feeprop": 1, - "expirydelta": 9 + }, + "experimental-shutdown-wrong-funding": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } } - ] - ] - } - } - ], - "example_json_response": [ - { - "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "payment_hash": "b6f88603008a9f7dd84b1b94c7b972c8efbaf0b86c8d3c04512955992da9028e", - "created_at": 1706315742.6861734, - "parts": 1, - "amount_msat": 10000, - "amount_sent_msat": 10001, - "payment_preimage": "7178cf708e34dce816fc35aa692a65e1f85b92ae03bbc8ae6543302511823174", - "status": "complete" - }, - { - "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "payment_hash": "e8474eea8d5673e8407ef5f4924e58479b51a68afd136384683d5d6a97c9520d", - "created_at": 1708640424.1810749, - "parts": 1, - "amount_msat": 10000000, - "amount_sent_msat": 10000000, - "payment_preimage": "40e47272ea7da20c57a2381d81a5513ec03bd8ead9d51fbd2a91ec76d3f4bcbf", - "status": "complete" - }, - { - "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "payment_hash": "56e12e6f45120bef7385c9bf307319eaa6a1b9160cdb3e62a3f492abf5bfa4bc", - "created_at": 1708640437.2895157, - "parts": 1, - "amount_msat": 10000, - "amount_sent_msat": 10001, - "payment_preimage": "682870b8f96e2aed1c86694dbb2c3e64cd396b9bba9fafd824d90eb0bd371b85", - "status": "complete" - } - ], - "author": [ - "Christian Decker <> is mainly responsible." - ], - "see_also": [ - "lightning-listpays(7)", - "lightning-decodepay(7)", - "lightning-listinvoice(7)", - "lightning-delinvoice(7)", - "lightning-getroute(7)", - "lightning-invoice(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-listchannels.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "listchannels", - "title": "Command to query active lightning channels in the entire network", - "description": [ - "The **listchannels** RPC command returns data on channels that are known to the node. Because channels may be bidirectional, up to 2 objects will be returned for each channel (one for each direction).", - "", - "Only one of *short_channel_id*, *source* or *destination* can be supplied. If nothing is supplied, data on all lightning channels known to this node, are returned. These can be local channels or public channels broadcast on the gossip network." - ], - "request": { - "required": [], - "properties": { - "short_channel_id": { - "type": "short_channel_id", - "description": [ - "If short_channel_id is a short channel id, then only known channels with a matching short_channel_id are returned. Otherwise, it must be null." - ] - }, - "source": { - "type": "pubkey", - "description": [ - "If source is a node id, then only channels leading from that node id are returned." - ] - }, - "destination": { - "type": "pubkey", - "description": [ - "If destination is a node id, then only channels leading to that node id are returned." - ] - } - } - }, - "response": { - "required": [ - "channels" - ], - "properties": { - "channels": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "source", - "destination", - "short_channel_id", - "direction", - "public", - "amount_msat", - "message_flags", - "channel_flags", - "active", - "last_update", - "base_fee_millisatoshi", - "fee_per_millionth", - "delay", - "htlc_minimum_msat", - "features" - ], - "properties": { - "source": { - "type": "pubkey", - "description": [ - "The source node." - ] - }, - "destination": { - "type": "pubkey", - "description": [ - "The destination node." - ] - }, - "short_channel_id": { - "type": "short_channel_id", - "description": [ - "Short channel id of channel." - ] - }, - "direction": { - "type": "u32", - "description": [ - "Direction (0 if source < destination, 1 otherwise)." - ] - }, - "public": { - "type": "boolean", - "description": [ - "True if this is announced (from *v24.02*, being false is deprecated)." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "The total capacity of this channel (always a whole number of satoshis)." - ] - }, - "message_flags": { - "type": "u8", - "description": [ - "As defined by BOLT #7." - ] - }, - "channel_flags": { - "type": "u8", - "description": [ - "As defined by BOLT #7." - ] - }, - "active": { - "type": "boolean", - "description": [ - "True unless source has disabled it (or (deprecated in *v24.02*) it's a local channel and the peer is disconnected or it's still opening or closing)." - ] - }, - "last_update": { - "type": "u32", - "description": [ - "UNIX timestamp on the last channel_update from *source*." - ] - }, - "base_fee_millisatoshi": { - "type": "u32", - "description": [ - "Base fee changed by *source* to use this channel." - ] - }, - "fee_per_millionth": { - "type": "u32", - "description": [ - "Proportional fee changed by *source* to use this channel, in parts-per-million." - ] - }, - "delay": { - "type": "u32", - "description": [ - "The number of blocks delay required by *source* to use this channel." - ] - }, - "htlc_minimum_msat": { - "type": "msat", - "description": [ - "The smallest payment *source* will allow via this channel." - ] - }, - "htlc_maximum_msat": { - "type": "msat", - "description": [ - "The largest payment *source* will allow via this channel." - ] - }, - "features": { - "type": "hex", - "description": [ - "BOLT #9 features bitmap for this channel." - ] + }, + "experimental-websocket-port": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } } - } - } - } - }, - "post_return_value_notes": [ - "If one of *short_channel_id*, *source* or *destination* is supplied and no matching channels are found, a 'channels' object with an empty list is returned." - ] - }, - "errors": [ - "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", - "", - "- -32602: If the given parameters are wrong." - ], - "example_json_request": [ - { - "id": "example:listchannels#1", - "method": "listchannels", - "params": { - "short_channel_id": "103x1x0", - "source": null, - "destination": null - } - }, - { - "id": "example:listchannels#2", - "method": "listchannels", - "params": { - "short_channel_id": null, - "source": null, - "destination": null - } - } - ], - "example_json_response": [ - { - "channels": [] - }, - { - "channels": [ - { - "source": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "short_channel_id": "103x1x0", - "direction": 0, - "public": true, - "amount_msat": 1000000000, - "message_flags": 1, - "channel_flags": 0, - "active": true, - "last_update": 1706153393, - "base_fee_millisatoshi": 1, - "fee_per_millionth": 10, - "delay": 6, - "htlc_minimum_msat": 0, - "htlc_maximum_msat": 990000000, - "features": "" - }, - { - "source": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "short_channel_id": "103x1x0", - "direction": 1, - "public": true, - "amount_msat": 1000000000, - "message_flags": 1, - "channel_flags": 1, - "active": true, - "last_update": 1706153393, - "base_fee_millisatoshi": 1, - "fee_per_millionth": 10, - "delay": 6, - "htlc_minimum_msat": 0, - "htlc_maximum_msat": 990000000, - "features": "" - } - ] - } - ], - "author": [ - "Michael Hawkins <>." - ], - "see_also": [ - "lightning-fundchannel(7)", - "lightning-listnodes(7)" - ], - "resources": [ - "Main web site: ", - "", - "BOLT #7: " - ] - }, - "lightning-listclosedchannels.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "added": "v23.05", - "rpc": "listclosedchannels", - "title": "Get data on our closed historical channels", - "description": [ - "The **listclosedchannels** RPC command returns data on channels which are otherwise forgotten (more than 100 blocks after they're completely resolved onchain)." - ], - "request": { - "required": [], - "properties": { - "id": { - "type": "pubkey", - "description": [ - "If no *id* is supplied, then channel data on all historical channels are given. Supplying *id* will filter the results to only match channels to that peer. Note that prior to v23.05, old peers were forgotten." - ] - } - } - }, - "response": { - "required": [ - "closedchannels" - ], - "properties": { - "closedchannels": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "channel_id", - "opener", - "private", - "total_msat", - "total_local_commitments", - "total_remote_commitments", - "total_htlcs_sent", - "funding_txid", - "funding_outnum", - "leased", - "final_to_us_msat", - "min_to_us_msat", - "max_to_us_msat", - "close_cause" - ], - "properties": { - "peer_id": { - "type": "pubkey", - "description": [ - "Peer public key (can be missing with pre-v23.05 closes!)." - ] - }, - "channel_id": { - "type": "hash", - "description": [ - "The full channel_id (funding txid Xored with output number)." - ] - }, - "short_channel_id": { - "type": "short_channel_id", - "description": [ - "The short_channel_id." - ] - }, - "alias": { - "type": "object", - "required": [], - "properties": { - "local": { - "type": "short_channel_id", - "description": [ - "An alias assigned by this node to this channel, used for outgoing payments." - ] - }, - "remote": { - "type": "short_channel_id", - "description": [ - "An alias assigned by the remote node to this channel, usable in routehints and invoices." - ] - } + }, + "experimental-peer-storage": { + "added": "v23.02", + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] } - }, - "opener": { - "type": "string", - "enum": [ - "local", - "remote" - ], - "description": [ - "Who initiated the channel." - ] - }, - "closer": { - "type": "string", - "enum": [ - "local", - "remote" - ], - "description": [ - "Who initiated the channel close (only present if closing)." - ] - }, - "private": { - "type": "boolean", - "description": [ - "If True, we will not announce this channel." - ] - }, - "channel_type": { - "type": "object", - "description": [ - "Channel_type as negotiated with peer." - ], - "additionalProperties": false, - "required": [ - "bits", - "names" - ], - "properties": { - "bits": { - "type": "array", - "description": [ - "Each bit set in this channel_type." - ], - "items": { - "type": "u32", - "description": [ - "Bit number." - ] - } - }, - "names": { - "type": "array", - "description": [ - "Feature name for each bit set in this channel_type." - ], - "items": { - "type": "string", - "enum": [ - "static_remotekey/even", - "anchor_outputs/even", - "anchors_zero_fee_htlc_tx/even", - "scid_alias/even", - "zeroconf/even" - ], - "description": [ - "Name of feature bit." - ] - } - } - } - }, - "total_local_commitments": { - "type": "u64", - "description": [ - "Number of commitment transaction we made." - ] - }, - "total_remote_commitments": { - "type": "u64", - "description": [ - "Number of commitment transaction they made." - ] - }, - "total_htlcs_sent": { - "type": "u64", - "description": [ - "Number of HTLCs we ever sent." - ] - }, - "funding_txid": { - "type": "txid", - "description": [ - "ID of the funding transaction." - ] - }, - "funding_outnum": { - "type": "u32", - "description": [ - "The 0-based output number of the funding transaction which opens the channel." - ] - }, - "leased": { - "type": "boolean", - "description": [ - "Whether this channel was leased from `opener`." - ] - }, - "funding_fee_paid_msat": { - "type": "msat", - "description": [ - "How much we paid to lease the channel (iff `leased` is true and `opener` is local)." - ] - }, - "funding_fee_rcvd_msat": { - "type": "msat", - "description": [ - "How much they paid to lease the channel (iff `leased` is true and `opener` is remote)." - ] - }, - "funding_pushed_msat": { - "type": "msat", - "description": [ - "How much `opener` pushed immediate (if non-zero)." - ] - }, - "total_msat": { - "type": "msat", - "description": [ - "Total amount in the channel." - ] - }, - "final_to_us_msat": { - "type": "msat", - "description": [ - "Our balance in final commitment transaction." - ] - }, - "min_to_us_msat": { - "type": "msat", - "description": [ - "Least amount owed to us ever. If the peer were to successfully steal from us, this is the amount we would still retain." - ] - }, - "max_to_us_msat": { - "type": "msat", - "description": [ - "Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get." - ] - }, - "last_commitment_txid": { - "type": "hash", - "description": [ - "The final commitment tx's txid (or mutual close, if we accepted it). Not present for some very old, small channels pre-0.7.0." - ] - }, - "last_commitment_fee_msat": { - "type": "msat", - "description": [ - "The fee on `last_commitment_txid`." - ] - }, - "close_cause": { - "type": "string", - "enum": [ - "unknown", - "local", - "user", - "remote", - "protocol", - "onchain" - ], - "description": [ - "What caused the channel to close." - ] - }, - "last_stable_connection": { - "type": "u64", - "added": "v24.02", - "description": [ - "Last time we reestablished the open channel and stayed connected for 1 minute." - ] - } - } - } - } - } - }, - "errors": [ - "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", - "", - "- -32602: If the given parameters are wrong." - ], - "author": [ - "Rusty Russell <>." - ], - "see_also": [ - "lightning-listpeerchannels(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-listconfigs.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "listconfigs", - "title": "Command to list all configuration options.", - "description": [ - "The **listconfigs** RPC command to list all configuration options, or with *config* only one." - ], - "request": { - "required": [], - "properties": { - "config": { - "type": "string", - "description": [ - "Configuration option name to restrict return." - ] - } - } - }, - "response": { - "required": [], - "properties": { - "configs": { - "added": "v23.08", - "type": "object", - "comment": "Plugins can add fields to this, so we can't rule out additional properties :(", - "additionalProperties": true, - "required": [], - "properties": { - "conf": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": [ - "Field from cmdline." - ] - }, - "source": { - "type": "string", - "enum": [ - "cmdline" - ], - "description": [ - "Source of configuration setting." - ] - } - } - }, - "developer": { - "type": "object", - "added": "v23.08", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": [ - "`true` if set in config or cmdline." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "clear-plugins": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": [ - "`true` if set in config or cmdline." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "disable-mpp": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": [ - "`true` if set in config or cmdline." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - }, - "plugin": { - "type": "string", - "description": [ - "Plugin which registered this configuration setting." - ] - } - } - }, - "mainnet": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": [ - "`true` if set in config or cmdline." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "regtest": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": [ - "`true` if set in config or cmdline." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "signet": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": [ - "`true` if set in config or cmdline." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "testnet": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": [ - "`true` if set in config or cmdline." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "important-plugin": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": [ - "Field from config or cmdline." - ] - } - }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - } - }, - "plugin": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": [ - "Field from config or cmdline." - ] - } - }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - } - }, - "plugin-dir": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": [ - "Field from config or cmdline." - ] - } - }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - } - }, - "lightning-dir": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "network": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": [ - "Field from config or cmdline, or default (can also be changed by `testnet`, `signet`, `regtest` options!)." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "allow-deprecated-apis": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_bool", - "source" - ], - "properties": { - "value_bool": { - "type": "boolean", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "rpc-file": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "disable-plugin": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": [ - "Field from config or cmdline." - ] - } - }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } + } + }, + "experimental-anchors": { + "type": "object", + "added": "v23.08", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] } } }, - "always-use-proxy": { + "database-upgrade": { "type": "object", "additionalProperties": false, "required": [ @@ -21007,29 +14399,7 @@ } } }, - "daemon": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": [ - "`true` if set in config or cmdline." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "wallet": { + "rgb": { "type": "object", "additionalProperties": false, "required": [ @@ -21038,13881 +14408,6055 @@ ], "properties": { "value_str": { - "type": "string", + "type": "hex", "description": [ "Field from config or cmdline, or default." - ] + ], + "maxLength": 6, + "minLength": 6 }, "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "large-channels": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": [ - "`true` if set in config or cmdline." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "experimental-dual-fund": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": [ - "`true` if set in config or cmdline." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "experimental-splicing": { - "added": "v23.08", - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": [ - "`true` if set in config or cmdline." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "experimental-onion-messages": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": [ - "`true` if set in config or cmdline." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "experimental-offers": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": [ - "`true` if set in config or cmdline." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "experimental-shutdown-wrong-funding": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": [ - "`true` if set in config or cmdline." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "experimental-websocket-port": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "experimental-peer-storage": { - "added": "v23.02", - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": [ - "`true` if set in config or cmdline." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "experimental-anchors": { - "type": "object", - "added": "v23.08", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": [ - "`true` if set in config or cmdline." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "database-upgrade": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_bool", - "source" - ], - "properties": { - "value_bool": { - "type": "boolean", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "rgb": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "hex", - "description": [ - "Field from config or cmdline, or default." - ], - "maxLength": 6, - "minLength": 6 - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "alias": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "pid-file": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "ignore-fee-limits": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_bool", - "source" - ], - "properties": { - "value_bool": { - "type": "boolean", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "watchtime-blocks": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "max-locktime-blocks": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "funding-confirms": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "cltv-delta": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "cltv-final": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "commit-time": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "fee-base": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "rescan": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "integer", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "fee-per-satoshi": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "max-concurrent-htlcs": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "htlc-minimum-msat": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_msat", - "source" - ], - "properties": { - "value_msat": { - "type": "msat", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "htlc-maximum-msat": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_msat", - "source" - ], - "properties": { - "value_msat": { - "type": "msat", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "max-dust-htlc-exposure-msat": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_msat", - "source" - ], - "properties": { - "value_msat": { - "type": "msat", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "min-capacity-sat": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u64", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - }, - "dynamic": { - "type": "boolean", - "enum": [ - true - ], - "description": [ - "Can this be set by setconfig()." - ] - } - } - }, - "addr": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": [ - "Field from config or cmdline." - ] - } - }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - } - }, - "announce-addr": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": [ - "Field from config or cmdline." - ] - } - }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - } - }, - "bind-addr": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": [ - "Field from config or cmdline." - ] - } - }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - } - }, - "offline": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": [ - "`true` if set in config or cmdline." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "autolisten": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_bool", - "source" - ], - "properties": { - "value_bool": { - "type": "boolean", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "proxy": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "disable-dns": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": [ - "`true` if set in config or cmdline." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "announce-addr-discovered": { - "added": "v23.02", - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "enum": [ - "true", - "false", - "auto" - ], - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "announce-addr-discovered-port": { - "added": "v23.02", - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "encrypted-hsm": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": [ - "`true` if set in config or cmdline." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "rpc-file-mode": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "log-level": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "log-prefix": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "log-file": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": [ - "Field from config or cmdline." - ] - } - }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - } - }, - "log-timestamps": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_bool", - "source" - ], - "properties": { - "value_bool": { - "type": "boolean", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "force-feerates": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "subdaemon": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": [ - "Field from config or cmdline." - ] - } - }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - } - }, - "fetchinvoice-noconnect": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": [ - "`true` if set in config or cmdline." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "accept-htlc-tlv-types": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "tor-service-password": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "announce-addr-dns": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_bool", - "source" - ], - "properties": { - "value_bool": { - "type": "boolean", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "require-confirmed-inputs": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_bool", - "source" - ], - "properties": { - "value_bool": { - "type": "boolean", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "commit-fee": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u64", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - }, - "commit-feerate-offset": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting." - ] - } - } - } - } - }, - "# version": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": [ - "Special field indicating the current version." - ] - }, - "plugins": { - "type": "array", - "deprecated": [ - "v23.08", - "v24.02" - ], - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "path", - "name" - ], - "description": [ - "`plugin` field from config or cmdline." - ], - "properties": { - "path": { - "type": "string", - "description": [ - "Full path of the plugin." - ] - }, - "name": { - "type": "string", - "description": [ - "Short name of the plugin." - ] - }, - "options": { - "type": "object", - "additionalProperties": true, - "required": [], - "description": [ - "Specific options set for this plugin." - ], - "properties": {} - } - } - } - }, - "important-plugins": { - "type": "array", - "deprecated": [ - "v23.08", - "v24.02" - ], - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "path", - "name" - ], - "description": [ - "`important-plugin` field from config or cmdline, or built-in." - ], - "properties": { - "path": { - "type": "string", - "description": [ - "Full path of the plugin." - ] - }, - "name": { - "type": "string", - "description": [ - "Short name of the plugin." - ] - }, - "options": { - "type": "object", - "additionalProperties": true, - "required": [], - "description": [ - "Specific options set for this plugin." - ], - "properties": {} - } - } - } - }, - "conf": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": [ - "`conf` field from cmdline, or default." - ] - }, - "lightning-dir": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": [ - "`lightning-dir` field from config or cmdline, or default." - ] - }, - "network": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": [ - "`network` field from config or cmdline, or default." - ] - }, - "allow-deprecated-apis": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": [ - "`allow-deprecated-apis` field from config or cmdline, or default." - ] - }, - "rpc-file": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": [ - "`rpc-file` field from config or cmdline, or default." - ] - }, - "disable-plugin": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "array", - "items": { - "type": "string", - "description": [ - "`disable-plugin` field from config or cmdline." - ] - } - }, - "bookkeeper-dir": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": [ - "`bookkeeper-dir` field from config or cmdline, or default." - ] - }, - "bookkeeper-db": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": [ - "`bookkeeper-db` field from config or cmdline, or default." - ] - }, - "always-use-proxy": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": [ - "`always-use-proxy` field from config or cmdline, or default." - ] - }, - "daemon": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": [ - "`daemon` field from config or cmdline, or default." - ] - }, - "wallet": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": [ - "`wallet` field from config or cmdline default." - ] - }, - "large-channels": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": [ - "`large-channels` field from config or cmdline, or default." - ] - }, - "experimental-dual-fund": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": [ - "`experimental-dual-fund` field from config or cmdline, or default." - ] - }, - "experimental-splicing": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": [ - "`experimental-splicing` field from config or cmdline, or default." - ] - }, - "experimental-onion-messages": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": [ - "`experimental-onion-messages` field from config or cmdline, or default." - ] - }, - "experimental-offers": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": [ - "`experimental-offers` field from config or cmdline, or default." - ] - }, - "experimental-shutdown-wrong-funding": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": [ - "`experimental-shutdown-wrong-funding` field from config or cmdline, or default." - ] - }, - "experimental-websocket-port": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u16", - "description": [ - "`experimental-websocket-port` field from config or cmdline, or default." - ] - }, - "experimental-peer-storage": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "added": "v23.02", - "description": [ - "`experimental-peer-storage` field from config or cmdline, or default." - ] - }, - "experimental-quiesce": { - "type": "boolean", - "added": "v23.08", - "deprecated": [ - "v23.08", - "v24.02" - ], - "description": [ - "`experimental-quiesce` field from config or cmdline, or default." - ] - }, - "experimental-upgrade-protocol": { - "type": "boolean", - "added": "v23.08", - "deprecated": [ - "v23.08", - "v24.02" - ], - "description": [ - "`experimental-upgrade-protocol` field from config or cmdline, or default." - ] - }, - "invoices-onchain-fallback": { - "type": "boolean", - "added": "v23.11", - "description": [ - "`invoices-onchain-fallback` field from config or cmdline, or default." - ] - }, - "database-upgrade": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": [ - "`database-upgrade` field from config or cmdline." - ] - }, - "rgb": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "hex", - "description": [ - "`rgb` field from config or cmdline, or default." - ], - "maxLength": 6, - "minLength": 6 - }, - "alias": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": [ - "`alias` field from config or cmdline, or default." - ] - }, - "pid-file": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": [ - "`pid-file` field from config or cmdline, or default." - ] - }, - "ignore-fee-limits": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": [ - "`ignore-fee-limits` field from config or cmdline, or default." - ] - }, - "watchtime-blocks": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": [ - "`watchtime-blocks` field from config or cmdline, or default." - ] - }, - "max-locktime-blocks": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": [ - "`max-locktime-blocks` field from config or cmdline, or default." - ] - }, - "funding-confirms": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": [ - "`funding-confirms` field from config or cmdline, or default." - ] - }, - "cltv-delta": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": [ - "`cltv-delta` field from config or cmdline, or default." - ] - }, - "cltv-final": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": [ - "`cltv-final` field from config or cmdline, or default." - ] - }, - "commit-time": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": [ - "`commit-time` field from config or cmdline, or default." - ] - }, - "fee-base": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": [ - "`fee-base` field from config or cmdline, or default." - ] - }, - "rescan": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "integer", - "description": [ - "`rescan` field from config or cmdline, or default." - ] - }, - "fee-per-satoshi": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": [ - "`fee-per-satoshi` field from config or cmdline, or default." - ] - }, - "max-concurrent-htlcs": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": [ - "`max-concurrent-htlcs` field from config or cmdline, or default." - ] - }, - "htlc-minimum-msat": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "msat", - "description": [ - "`htlc-minimum-msat` field from config or cmdline, or default." - ] - }, - "htlc-maximum-msat": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "msat", - "description": [ - "`htlc-maximum-msat` field from config or cmdline, or default." - ] - }, - "max-dust-htlc-exposure-msat": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "msat", - "description": [ - "`max-dust-htlc-exposure-mast` field from config or cmdline, or default." - ] - }, - "min-capacity-sat": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u64", - "description": [ - "`min-capacity-sat` field from config or cmdline, or default." - ] - }, - "addr": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": [ - "`addr` field from config or cmdline (can be more than one)." - ] - }, - "announce-addr": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": [ - "`announce-addr` field from config or cmdline (can be more than one)." - ] - }, - "bind-addr": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": [ - "`bind-addr` field from config or cmdline (can be more than one)." - ] - }, - "offline": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": [ - "`true` if `offline` was set in config or cmdline." - ] - }, - "autolisten": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": [ - "`autolisten` field from config or cmdline, or default." - ] - }, - "proxy": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": [ - "`proxy` field from config or cmdline, or default." - ] - }, - "disable-dns": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": [ - "`true` if `disable-dns` was set in config or cmdline." - ] - }, - "announce-addr-discovered": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": [ - "`true`/`false`/`auto` depending on how `announce-addr-discovered` was set in config or cmdline." - ], - "added": "v23.02" - }, - "announce-addr-discovered-port": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "integer", - "description": [ - "Sets the announced TCP port for dynamically discovered IPs." - ], - "added": "v23.02" - }, - "encrypted-hsm": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": [ - "`true` if `encrypted-hsm` was set in config or cmdline." - ] - }, - "rpc-file-mode": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": [ - "`rpc-file-mode` field from config or cmdline, or default." - ] - }, - "log-level": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": [ - "`log-level` field from config or cmdline, or default." - ] - }, - "log-prefix": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": [ - "`log-prefix` field from config or cmdline, or default." - ] - }, - "log-file": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": [ - "`log-file` field from config or cmdline, or default." - ] - }, - "log-timestamps": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": [ - "`log-timestamps` field from config or cmdline, or default." - ] - }, - "force-feerates": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": [ - "Force-feerate configuration setting, if any." - ] - }, - "subdaemon": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": [ - "`subdaemon` fields from config or cmdline if any (can be more than one)." - ] - }, - "fetchinvoice-noconnect": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": [ - "`fetchinvoice-noconnect` fields from config or cmdline, or default." - ] - }, - "accept-htlc-tlv-types": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": [ - "`accept-htlc-tlv-types` field from config or cmdline, or not present." - ] - }, - "tor-service-password": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": [ - "`tor-service-password` field from config or cmdline, if any." - ] - }, - "dev-allowdustreserve": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": [ - "Whether we allow setting dust reserves." - ] - }, - "announce-addr-dns": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "added": "v22.11.1", - "description": [ - "Whether we put DNS entries into node_announcement." - ] - }, - "require-confirmed-inputs": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": [ - "Request peers to only send confirmed inputs (dual-fund only)." - ] - }, - "developer": { - "added": "v23.08", - "type": "boolean", - "description": [ - "Whether developer mode is enabled." - ] - }, - "commit-fee": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u64", - "added": "v23.05", - "description": [ - "The percentage of the 6-block fee estimate to use for commitment transactions." - ] - }, - "min-emergency-msat": { - "type": "msat", - "added": "v23.08", - "description": [ - "Field from config or cmdline, or default." - ] - }, - "commit-feerate-offset": { - "type": "u32", - "added": "v23.11", - "description": [ - "Additional commitment feerate applied by channel owner." - ] - } - }, - "pre_return_value_notes": [ - "The returned values reflect the current configuration, including showing default values (`dev-` options are not shown unless specified as *config* explicitly).", - "", - "Note: as plugins can add options, not all configuration settings are listed here! The format of each entry is as follows:", - "", - "- **source** (string): source of configuration setting (`file`:`linenum`)", - "- **dynamic** (boolean, optional): true if this option is settable via setconfig", - "- **plugin** (string, optional): set if this is from a plugin", - "", - "Depending on the option type, exactly one of the following is present:", - "", - "- **set** (boolean, optional): for simple flag options", - "- **value_str** (string, optional): for string options", - "- **value_msat** (msat, optional): for msat options", - "- **value_int** (integer, optional): for integer options", - "- **value_bool** (boolean, optional): for boolean options" - ] - }, - "example_json_request": [ - { - "id": "example:listconfigs#1", - "method": "listconfigs", - "params": { - "config": "network" - } - }, - { - "id": "example:listconfigs#2", - "method": "listconfigs", - "params": { - "config": null - } - }, - { - "id": "example:listconfigs#3", - "method": "listconfigs", - "params": { - "config": "experimental-dual-fund" - } - } - ], - "errors": [ - "On failure, one of the following error codes may be returned:", - "", - "- -32602: Error in given parameters or field with *config* name doesn't exist." - ], - "example_json_response": [ - { - "#version": "v0.9.0-1", - "lightning-dir": "/media/vincent/Maxtor/sanboxTestWrapperRPC/lightning_dir_dev", - "network": "testnet", - "allow-deprecated-apis": true, - "rpc-file": "lightning-rpc", - "plugins": [ - { - "path": "/home/vincent/Github/plugins/sauron/sauron.py", - "name": "sauron.py", - "options": { - "sauron-api-endpoint": "http://blockstream.info/testnet/api/", - "sauron-tor-proxy": "" - } - }, - { - "path": "/home/vincent/Github/reckless/reckless.py", - "name": "reckless.py" - } - ], - "important-plugins": [ - { - "path": "/home/vincent/Github/lightning/lightningd/../plugins/autoclean", - "name": "autoclean", - "options": { - "autocleaninvoice-cycle": null, - "autocleaninvoice-expired-by": null - } - }, - { - "path": "/home/vincent/Github/lightning/lightningd/../plugins/fundchannel", - "name": "fundchannel" - }, - { - "path": "/home/vincent/Github/lightning/lightningd/../plugins/keysend", - "name": "keysend" - }, - { - "path": "/home/vincent/Github/lightning/lightningd/../plugins/pay", - "name": "pay", - "options": { - "disable-mpp": false - } - } - ], - "important-plugin": "/home/vincent/Github/lightning/lightningd/../plugins/pay", - "plugin": "/home/vincent/Github/reckless/reckless.py", - "disable-plugin": [ - "bcli" - ], - "always-use-proxy": false, - "daemon": "false", - "wallet": "sqlite3:///media/vincent/Maxtor/sanboxTestWrapperRPC/lightning_dir_dev/testnet/lightningd.sqlite3", - "wumbo": true, - "rgb": "03ad98", - "alias": "BRUCEWAYN-TES-DEV", - "pid-file": "/media/vincent/Maxtor/sanboxTestWrapperRPC/lightning_dir_dev/lightningd-testne...", - "ignore-fee-limits": true, - "watchtime-blocks": 6, - "max-locktime-blocks": 2016, - "funding-confirms": 1, - "commit-fee-min": 0, - "commit-fee-max": 0, - "cltv-delta": 6, - "cltv-final": 10, - "commit-time": 10, - "fee-base": 1, - "rescan": 30, - "fee-per-satoshi": 10, - "max-concurrent-htlcs": 483, - "min-capacity-sat": 10000, - "addr": "autotor:127.0.0.1:9051", - "bind-addr": "127.0.0.1:9735", - "announce-addr": "fp463inc4w3lamhhduytrwdwq6q6uzugtaeapylqfc43agrdnnqsheyd.onion:9735", - "offline": "false", - "autolisten": true, - "proxy": "127.0.0.1:9050", - "disable-dns": "false", - "encrypted-hsm": false, - "rpc-file-mode": "0600", - "log-level": "DEBUG", - "log-prefix": "lightningd" - }, - { - "configs": { - "developer": { - "set": true, - "source": "cmdline" - }, - "lightning-dir": { - "value_str": "/tmp/ltests-giwf5tc7/test_plugin_start_1/lightning-1/", - "source": "cmdline" - }, - "network": { - "value_str": "regtest", - "source": "cmdline" - }, - "testnet": { - "set": false, - "source": "default" - }, - "signet": { - "set": false, - "source": "default" - }, - "mainnet": { - "set": false, - "source": "default" - }, - "regtest": { - "set": false, - "source": "default" - }, - "rpc-file": { - "value_str": "lightning-rpc", - "source": "default" - }, - "allow-deprecated-apis": { - "value_bool": false, - "source": "cmdline" - }, - "plugin": { - "values_str": [ - "~/lightning/target/debug/examples/cln-plugin-startup" - ], - "sources": [ - "cmdline" - ] - }, - "plugin-dir": { - "values_str": [], - "sources": [] - }, - "clear-plugins": { - "set": false, - "source": "default" - }, - "disable-plugin": { - "values_str": [], - "sources": [] - }, - "important-plugin": { - "values_str": [], - "sources": [] - }, - "always-use-proxy": { - "value_bool": false, - "source": "default" - }, - "daemon": { - "set": false, - "source": "default" - }, - "experimental-dual-fund": { - "set": false, - "source": "default" - }, - "experimental-splicing": { - "set": false, - "source": "default" - }, - "experimental-onion-messages": { - "set": false, - "source": "default" - }, - "experimental-offers": { - "set": false, - "source": "default" - }, - "experimental-shutdown-wrong-funding": { - "set": false, - "source": "default" - }, - "experimental-peer-storage": { - "set": false, - "source": "default" - }, - "experimental-quiesce": { - "set": false, - "source": "default" - }, - "experimental-anchors": { - "set": false, - "source": "default" - }, - "rgb": { - "value_str": "0266e4", - "source": "default" - }, - "alias": { - "value_str": "JUNIORBEAM-1-102-g7549e10-modded", - "source": "default" - }, - "pid-file": { - "value_str": "/tmp/ltests-giwf5tc7/test_plugin_start_1/lightning-1/lightningd-regtest.pid", - "source": "default" - }, - "ignore-fee-limits": { - "value_bool": false, - "source": "cmdline" - }, - "watchtime-blocks": { - "value_int": 5, - "source": "cmdline" - }, - "max-locktime-blocks": { - "value_int": 2016, - "source": "default" - }, - "funding-confirms": { - "value_int": 1, - "source": "default" - }, - "require-confirmed-inputs": { - "value_bool": false, - "source": "default" - }, - "cltv-delta": { - "value_int": 6, - "source": "cmdline" - }, - "cltv-final": { - "value_int": 5, - "source": "cmdline" - }, - "commit-time": { - "value_int": 10, - "source": "default" - }, - "fee-base": { - "value_int": 1, - "source": "default" - }, - "rescan": { - "value_int": 1, - "source": "cmdline" - }, - "fee-per-satoshi": { - "value_int": 10, - "source": "default" - }, - "htlc-minimum-msat": { - "value_msat": 0, - "source": "default" - }, - "htlc-maximum-msat": { - "value_msat": 18446744073709552000, - "source": "default" - }, - "max-concurrent-htlcs": { - "value_int": 483, - "source": "default" - }, - "max-dust-htlc-exposure-msat": { - "value_msat": 50000000, - "source": "default" - }, - "min-capacity-sat": { - "value_int": 10000, - "source": "default", - "dynamic": true - }, - "addr": { - "values_str": [ - "127.0.0.1:33157" - ], - "sources": [ - "cmdline" - ] - }, - "bind-addr": { - "values_str": [], - "sources": [] - }, - "announce-addr": { - "values_str": [], - "sources": [] - }, - "announce-addr-discovered": { - "value_str": "auto", - "source": "default" - }, - "announce-addr-discovered-port": { - "value_int": 19846, - "source": "default" - }, - "offline": { - "set": false, - "source": "default" - }, - "autolisten": { - "value_bool": false, - "source": "default" - }, - "accept-htlc-tlv-type": { - "values_int": [], - "sources": [] - }, - "disable-dns": { - "set": true, - "source": "cmdline" - }, - "encrypted-hsm": { - "set": false, - "source": "default" - }, - "rpc-file-mode": { - "value_str": "0600", - "source": "default" - }, - "commit-fee": { - "value_int": 100, - "source": "default" - }, - "commit-feerate-offset": { - "value_int": 5, - "source": "default" - }, - "min-emergency-msat": { - "value_msat": 25000000, - "source": "default" - }, - "subdaemon": { - "values_str": [], - "sources": [] - }, - "experimental-upgrade-protocol": { - "set": false, - "source": "default" - }, - "invoices-onchain-fallback": { - "set": false, - "source": "default" - }, - "log-level": { - "value_str": "debug", - "source": "cmdline" - }, - "log-timestamps": { - "value_bool": true, - "source": "default" - }, - "log-prefix": { - "value_str": "lightningd-1 ", - "source": "cmdline" - }, - "log-file": { - "values_str": [ - "-", - "/tmp/ltests-giwf5tc7/test_plugin_start_1/lightning-1/log" - ], - "sources": [ - "cmdline", - "cmdline" - ] - }, - "dev-no-plugin-checksum": { - "set": true, - "source": "cmdline" - }, - "dev-no-reconnect": { - "set": true, - "source": "cmdline" - }, - "dev-fail-on-subdaemon-fail": { - "set": true, - "source": "cmdline" - }, - "dev-bitcoind-poll": { - "value_int": 1, - "source": "cmdline" - }, - "dev-fast-gossip": { - "set": true, - "source": "cmdline" - }, - "renepay-debug-mcf": { - "set": false, - "source": "default", - "plugin": "~/lightning/plugins/cln-renepay" - }, - "renepay-debug-payflow": { - "set": false, - "source": "default", - "plugin": "~/lightning/plugins/cln-renepay" - }, - "test-option": { - "value_int": 31337, - "source": "cmdline", - "plugin": "~/lightning/target/debug/examples/cln-plugin-startup" - }, - "bitcoin-datadir": { - "value_str": "/tmp/ltests-giwf5tc7/test_plugin_start_1/lightning-1/", - "source": "cmdline", - "plugin": "~/lightning/plugins/bcli" - }, - "bitcoin-rpcuser": { - "value_str": "rpcuser", - "source": "cmdline", - "plugin": "~/lightning/plugins/bcli" - }, - "bitcoin-rpcpassword": { - "value_str": "rpcpass", - "source": "cmdline", - "plugin": "~/lightning/plugins/bcli" - }, - "bitcoin-rpcport": { - "value_int": 51309, - "source": "cmdline", - "plugin": "~/lightning/plugins/bcli" - }, - "disable-mpp": { - "set": false, - "source": "default", - "plugin": "~/lightning/plugins/pay" - } - } - }, - { - "configs": { - "experimental-dual-fund": { - "set": false, - "source": "default" - } - } - } - ], - "author": [ - "Vincenzo Palazzo <> wrote the initial version of this man page,", - "but many others did the hard work of actually implementing this rpc command." - ], - "see_also": [ - "lightning-getinfo(7)", - "lightningd-config(5)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-listdatastore.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "listdatastore", - "title": "Command for listing (plugin) data", - "description": [ - "The **listdatastore** RPC command allows plugins to fetch data which was stored in the Core Lightning database." - ], - "request": { - "required": [], - "properties": { - "key": { - "oneOf": [ - { - "type": "array", - "description": [ - "All immediate children of the *key* (or root children) are returned.", - " Using the first element of the key as the plugin name (e.g. `[ 'summary' ]`) is recommended.", - " An array of values to form a hierarchy (though a single value is treated as a one-element array)." - ], - "items": { - "type": "string" - } - }, - { - "type": "string" - } - ] - } - } - }, - "response": { - "required": [ - "datastore" - ], - "properties": { - "datastore": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "key" - ], - "properties": { - "key": { - "type": "array", - "items": { - "type": "string", - "description": [ - "Part of the key added to the datastore." - ] - } - }, - "generation": { - "type": "u64", - "description": [ - "The number of times this has been updated." - ] - }, - "hex": { - "type": "hex", - "description": [ - "The hex data from the datastore." - ] - }, - "string": { - "type": "string", - "description": [ - "The data as a string, if it's valid utf-8." - ] - } - } - } - } - } - }, - "errors": [ - "The following error codes may occur:", - "", - "- -32602: invalid parameters." - ], - "example_json_request": [ - { - "id": "example:listdatastore#1", - "method": "listdatastore", - "params": { - "key": [ - "commando" - ] - } - }, - { - "id": "example:listdatastore#2", - "method": "listdatastore", - "params": { - "key": "otherkey" - } - } - ], - "example_json_response": [ - { - "datastore": [] - }, - { - "datastore": [ - { - "key": [ - "otherkey" - ], - "generation": 0, - "hex": "6f7468657264617461", - "string": "otherdata" - } - ] - } - ], - "author": [ - "Rusty Russell <> is mainly responsible." - ], - "see_also": [ - "lightning-datastore(7)", - "lightning-deldatastore(7)", - "lightning-datastoreusage(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-listforwards.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "listforwards", - "title": "Command showing all htlcs and their information", - "description": [ - "The **listforwards** RPC command displays all htlcs that have been attempted to be forwarded by the Core Lightning node." - ], - "request": { - "required": [], - "properties": { - "status": { - "type": "string", - "description": [ - "If specified, then only the forwards with the given status are returned." - ], - "enum": [ - "offered", - "settled", - "local_failed", - "failed" - ] - }, - "in_channel": { - "type": "short_channel_id", - "description": [ - "Only the matching forwards on the given inbound channel are returned." - ] - }, - "out_channel": { - "type": "short_channel_id", - "description": [ - "Only the matching forwards on the given outbount channel are returned." - ] - }, - "index": { - "type": "string", - "added": "v23.11", - "enum": [ - "created", - "updated" - ], - "description": [ - "If neither *in_channel* nor *out_channel* is specified, it controls ordering." - ], - "default": "`created`" - }, - "start": { - "type": "u64", - "added": "v23.11", - "description": [ - "If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)." - ] - }, - "limit": { - "type": "u32", - "added": "v23.11", - "description": [ - "If `index` is specified, `limit` can be used to specify the maximum number of entries to return." - ] - } - }, - "dependentUpon": { - "index": [ - "start", - "limit" - ] - } - }, - "response": { - "required": [ - "forwards" - ], - "properties": { - "forwards": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "created_index", - "in_channel", - "in_msat", - "status", - "received_time" - ], - "properties": { - "created_index": { - "added": "v23.11", - "type": "u64", - "description": [ - "1-based index indicating order this forward was created in." - ] - }, - "in_channel": { - "type": "short_channel_id", - "description": [ - "The channel that received the HTLC." - ] - }, - "in_htlc_id": { - "type": "u64", - "description": [ - "The unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11)." - ] - }, - "in_msat": { - "type": "msat", - "description": [ - "The value of the incoming HTLC." - ] - }, - "status": { - "type": "string", - "enum": [ - "offered", - "settled", - "local_failed", - "failed" - ], - "description": [ - "Still ongoing, completed, failed locally, or failed after forwarding." - ] - }, - "received_time": { - "type": "number", - "description": [ - "The UNIX timestamp when this was received." - ] - }, - "out_channel": { - "type": "short_channel_id", - "description": [ - "The channel that the HTLC (trying to) forward to." - ] - }, - "out_htlc_id": { - "type": "u64", - "description": [ - "The unique HTLC id we gave this when sending (may be missing even if out_channel is present, for old forwards before v22.11)." - ] - }, - "updated_index": { - "added": "v23.11", - "type": "u64", - "description": [ - "1-based index indicating order this forward was changed (only present if it has changed since creation)." - ] - }, - "style": { - "type": "string", - "enum": [ - "legacy", - "tlv" - ], - "description": [ - "Either a legacy onion format or a modern tlv format." - ] - } - }, - "allOf": [ - { - "if": { - "required": [ - "out_msat" - ] - }, - "then": { - "additionalProperties": false, - "required": [ - "fee_msat", - "out_msat", - "out_channel" - ], - "properties": { - "created_index": {}, - "updated_index": {}, - "in_channel": {}, - "in_htlc_id": {}, - "in_msatoshi": {}, - "in_msat": {}, - "status": {}, - "style": {}, - "received_time": {}, - "resolved_time": {}, - "out_channel": {}, - "out_htlc_id": {}, - "failcode": {}, - "failreason": {}, - "fee_msat": { - "type": "msat", - "description": [ - "The amount this paid in fees." - ] - }, - "out_msat": { - "type": "msat", - "description": [ - "The amount we sent out the *out_channel*." - ] - } - } - }, - "else": { - "additionalProperties": false, - "required": [], - "properties": { - "created_index": {}, - "updated_index": {}, - "in_channel": {}, - "in_htlc_id": {}, - "in_msatoshi": {}, - "in_msat": {}, - "status": {}, - "style": {}, - "received_time": {}, - "resolved_time": {}, - "failcode": {}, - "failreason": {}, - "out_channel": {} - } - } - }, - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "settled", - "failed" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "resolved_time" - ], - "properties": { - "created_index": {}, - "updated_index": {}, - "in_channel": {}, - "in_htlc_id": {}, - "in_msatoshi": {}, - "in_msat": {}, - "status": {}, - "style": {}, - "received_time": {}, - "out_channel": {}, - "out_htlc_id": {}, - "fee": {}, - "fee_msat": {}, - "out_msatoshi": {}, - "out_msat": {}, - "failcode": {}, - "failreason": {}, - "resolved_time": { - "type": "number", - "description": [ - "The UNIX timestamp when this was resolved." - ] - } - } - }, - "else": { - "additionalProperties": false, - "properties": { - "created_index": {}, - "updated_index": {}, - "in_channel": {}, - "in_htlc_id": {}, - "in_msatoshi": {}, - "in_msat": {}, - "status": {}, - "style": {}, - "received_time": {}, - "out_channel": {}, - "out_htlc_id": {}, - "fee": {}, - "fee_msat": {}, - "failcode": {}, - "failreason": {}, - "out_msatoshi": {}, - "out_msat": {} - } - } - }, - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "local_failed", - "failed" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [], - "properties": { - "created_index": {}, - "updated_index": {}, - "in_channel": {}, - "in_htlc_id": {}, - "in_msatoshi": {}, - "in_msat": {}, - "status": {}, - "style": {}, - "received_time": {}, - "out_channel": {}, - "out_htlc_id": {}, - "fee": {}, - "fee_msat": {}, - "out_msatoshi": {}, - "out_msat": {}, - "resolved_time": {}, - "failcode": { - "type": "u32", - "description": [ - "The numeric onion code returned." - ] - }, - "failreason": { - "type": "string", - "description": [ - "The name of the onion code returned." - ] - } - } - }, - "else": { - "additionalProperties": false, - "required": [], - "properties": { - "created_index": {}, - "updated_index": {}, - "in_channel": {}, - "in_htlc_id": {}, - "in_msatoshi": {}, - "in_msat": {}, - "status": {}, - "style": {}, - "received_time": {}, - "out_channel": {}, - "out_htlc_id": {}, - "fee": {}, - "fee_msat": {}, - "out_msatoshi": {}, - "out_msat": {}, - "resolved_time": {} - } - } - } - ] - } - } - } - }, - "example_json_request": [ - { - "id": "example:listforwards#1", - "method": "listforwards", - "params": { - "status": null, - "in_channel": null, - "out_channel": null, - "index": null, - "start": null, - "limit": null - } - }, - { - "id": "example:listforwards#2", - "method": "listforwards", - "params": { - "in_channel": "0x1x2", - "out_channel": "0x2x3", - "status": "settled" - } - } - ], - "example_json_response": [ - { - "forwards": [ - { - "created_index": 1, - "updated_index": 1, - "in_channel": "103x1x0", - "in_htlc_id": 0, - "out_channel": "104x1x0", - "out_htlc_id": 0, - "in_msat": 100001001, - "out_msat": 100000000, - "fee_msat": 1001, - "status": "settled", - "style": "tlv", - "received_time": 1706229285.5934534, - "resolved_time": 1706229288.830004 - }, - { - "created_index": 2, - "updated_index": 2, - "in_channel": "103x1x0", - "in_htlc_id": 1, - "out_channel": "105x1x0", - "out_htlc_id": 0, - "in_msat": 100001001, - "out_msat": 100000000, - "fee_msat": 1001, - "status": "failed", - "style": "tlv", - "received_time": 1706229290.0289993, - "resolved_time": 1706229292.9487684 - }, - { - "created_index": 3, - "updated_index": 3, - "in_channel": "103x1x0", - "in_htlc_id": 2, - "out_channel": "106x1x0", - "out_htlc_id": 0, - "in_msat": 100001000, - "out_msat": 99999999, - "fee_msat": 1001, - "status": "local_failed", - "failcode": 16392, - "failreason": "WIRE_PERMANENT_CHANNEL_FAILURE", - "style": "tlv", - "received_time": 1706229295.3175724 - } - ] - }, - { - "forwards": [] - } - ], - "author": [ - "Rene Pickhardt <> is mainly responsible." - ], - "see_also": [ - "lightning-autoclean-status(7)", - "lightning-getinfo(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-listfunds.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "listfunds", - "title": "Command showing all funds currently managed by the Core Lightning node", - "description": [ - "The **listfunds** RPC command displays all funds available, either in unspent outputs (UTXOs) in the internal wallet or funds locked in currently open channels." - ], - "request": { - "required": [], - "properties": { - "spent": { - "type": "boolean", - "description": [ - "If True, then the *outputs* will include spent outputs in addition to the unspent ones." - ], - "default": "False" - } - } - }, - "response": { - "required": [ - "outputs", - "channels" - ], - "properties": { - "outputs": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "txid", - "output", - "amount_msat", - "scriptpubkey", - "status", - "reserved" - ], - "properties": { - "txid": { - "type": "txid", - "description": [ - "The ID of the spendable transaction." - ] - }, - "output": { - "type": "u32", - "description": [ - "The index within *txid*." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "The amount of the output." - ] - }, - "scriptpubkey": { - "type": "hex", - "description": [ - "The scriptPubkey of the output." - ] - }, - "address": { - "type": "string", - "description": [ - "The bitcoin address of the output." - ] - }, - "redeemscript": { - "type": "hex", - "description": [ - "The redeemscript, only if it's p2sh-wrapped." - ] - }, - "status": { - "type": "string", - "enum": [ - "unconfirmed", - "confirmed", - "spent", - "immature" - ] - }, - "reserved": { - "type": "boolean", - "description": [ - "Whether this UTXO is currently reserved for an in-flight tx." - ] - } - }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "confirmed" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "blockheight" - ], - "properties": { - "txid": {}, - "output": {}, - "amount_msat": {}, - "scriptpubkey": {}, - "address": {}, - "value": {}, - "redeemscript": {}, - "status": {}, - "reserved": {}, - "reserved_to_block": {}, - "blockheight": { - "type": "u32", - "description": [ - "Block height where it was confirmed." - ] - } - } - } - }, - { - "if": { - "properties": { - "reserved": { - "type": "boolean", - "enum": [ - "true" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "reserved_to_block" - ], - "properties": { - "txid": {}, - "output": {}, - "amount_msat": {}, - "scriptpubkey": {}, - "address": {}, - "value": {}, - "redeemscript": {}, - "status": {}, - "blockheight": {}, - "reserved": {}, - "reserved_to_block": { - "type": "u32", - "description": [ - "Block height where reservation will expire." - ] - } - } - } - } - ] - } - }, - "channels": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "peer_id", - "our_amount_msat", - "amount_msat", - "funding_txid", - "funding_output", - "connected", - "state", - "channel_id" - ], - "properties": { - "peer_id": { - "type": "pubkey", - "description": [ - "The peer with which the channel is opened." - ] - }, - "our_amount_msat": { - "type": "msat", - "description": [ - "Available satoshis on our node's end of the channel." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "Total channel value." - ] - }, - "funding_txid": { - "type": "txid", - "description": [ - "Funding transaction id." - ] - }, - "funding_output": { - "type": "u32", - "description": [ - "The 0-based index of the output in the funding transaction." - ] - }, - "connected": { - "type": "boolean", - "description": [ - "Whether the channel peer is connected." - ] - }, - "state": { - "type": "string", - "enum": [ - "OPENINGD", - "CHANNELD_AWAITING_LOCKIN", - "CHANNELD_NORMAL", - "CHANNELD_SHUTTING_DOWN", - "CLOSINGD_SIGEXCHANGE", - "CLOSINGD_COMPLETE", - "AWAITING_UNILATERAL", - "FUNDING_SPEND_SEEN", - "ONCHAIN", - "DUALOPEND_OPEN_INIT", - "DUALOPEND_AWAITING_LOCKIN", - "DUALOPEND_OPEN_COMMITTED", - "DUALOPEND_OPEN_COMMIT_READY" - ], - "description": [ - "The channel state, in particular `CHANNELD_NORMAL` means the channel can be used normally." - ] - }, - "channel_id": { - "type": "hash", - "description": [ - "The full channel_id (funding txid Xored with output number)." - ], - "added": "v23.05" - } - }, - "allOf": [ - { - "if": { - "properties": { - "state": { - "type": "string", - "enum": [ - "CHANNELD_NORMAL" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "short_channel_id" - ], - "properties": { - "peer_id": {}, - "our_amount_msat": {}, - "channel_sat": {}, - "amount_msat": {}, - "channel_total_sat": {}, - "funding_txid": {}, - "funding_output": {}, - "connected": {}, - "state": {}, - "channel_id": {}, - "short_channel_id": { - "type": "short_channel_id", - "description": [ - "Short channel id of channel." - ] - } - } - } - }, - { - "if": { - "properties": { - "state": { - "type": "string", - "enum": [ - "CHANNELD_SHUTTING_DOWN", - "CLOSINGD_SIGEXCHANGE", - "CLOSINGD_COMPLETE", - "AWAITING_UNILATERAL", - "FUNDING_SPEND_SEEN", - "ONCHAIN" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [], - "properties": { - "peer_id": {}, - "our_amount_msat": {}, - "channel_sat": {}, - "amount_msat": {}, - "channel_total_sat": {}, - "funding_txid": {}, - "funding_output": {}, - "connected": {}, - "state": {}, - "channel_id": {}, - "short_channel_id": { - "type": "short_channel_id", - "description": [ - "Short channel id of channel (only if funding reached lockin depth before closing)." - ] - } - } - } - } - ] - } - } - } - }, - "example_json_request": [ - { - "id": "example:listfunds#1", - "method": "listfunds", - "params": { - "spent": null - } - } - ], - "example_json_response": [ - { - "outputs": [ - { - "txid": "0f184b101569bf777af3449fa266948a9d55768f97867e48416a2c92858dd1bc", - "output": 1, - "amount_msat": 1111111000, - "scriptpubkey": "001401fad90abcd66697e2592164722de4a95ebee165", - "address": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf", - "status": "confirmed", - "blockheight": 102, - "reserved": false - }, - { - "txid": "4bee7dc3a28f2434e9bb3e9aaab418dd276485a8705b0f787bf741d3f979ec3b", - "output": 1, - "amount_msat": 1111111000, - "scriptpubkey": "001401fad90abcd66697e2592164722de4a95ebee165", - "address": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf", - "status": "confirmed", - "blockheight": 102, - "reserved": false - } - ], - "channels": [] - } - ], - "author": [ - "Felix <> is mainly responsible." - ], - "see_also": [ - "lightning-newaddr(7)", - "lightning-fundchannel(7)", - "lightning-withdraw(7)", - "lightning-listtransactions(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-listhtlcs.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "listhtlcs", - "title": "Command for querying HTLCs", - "description": [ - "The **listhtlcs** RPC command gets all HTLCs (which, generally, we remember for as long as a channel is open, even if they've completed long ago)." - ], - "request": { - "required": [], - "properties": { - "id": { - "type": "string", - "description": [ - "A short channel id (e.g. 1x2x3) or full 64-byte hex channel id, it will only list htlcs for that channel (which must be known)." - ] - } - } - }, - "response": { - "required": [ - "htlcs" - ], - "properties": { - "htlcs": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "short_channel_id", - "id", - "expiry", - "direction", - "amount_msat", - "payment_hash", - "state" - ], - "properties": { - "short_channel_id": { - "type": "short_channel_id", - "description": [ - "The channel that contains/contained the HTLC." - ] - }, - "id": { - "type": "u64", - "description": [ - "The unique, incrementing HTLC id the creator gave this." - ] - }, - "expiry": { - "type": "u32", - "description": [ - "The block number where this HTLC expires/expired." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "The value of the HTLC." - ] - }, - "direction": { - "type": "string", - "enum": [ - "out", - "in" - ], - "description": [ - "Out if we offered this to the peer, in if they offered it." - ] - }, - "payment_hash": { - "type": "hash", - "description": [ - "Payment hash sought by HTLC." - ] - }, - "state": { - "type": "string", - "enum": [ - "SENT_ADD_HTLC", - "SENT_ADD_COMMIT", - "RCVD_ADD_REVOCATION", - "RCVD_ADD_ACK_COMMIT", - "SENT_ADD_ACK_REVOCATION", - "RCVD_REMOVE_HTLC", - "RCVD_REMOVE_COMMIT", - "SENT_REMOVE_REVOCATION", - "SENT_REMOVE_ACK_COMMIT", - "RCVD_REMOVE_ACK_REVOCATION", - "RCVD_ADD_HTLC", - "RCVD_ADD_COMMIT", - "SENT_ADD_REVOCATION", - "SENT_ADD_ACK_COMMIT", - "RCVD_ADD_ACK_REVOCATION", - "SENT_REMOVE_HTLC", - "SENT_REMOVE_COMMIT", - "RCVD_REMOVE_REVOCATION", - "RCVD_REMOVE_ACK_COMMIT", - "SENT_REMOVE_ACK_REVOCATION" - ], - "description": [ - "The first 10 states are for `in`, the next 10 are for `out`." - ] - } - } - } - } - } - }, - "example_json_request": [ - { - "id": "example:listhtlcs#1", - "method": "listhtlcs", - "params": "{}" - }, - { - "id": "example:listhtlcs#2", - "method": "listhtlcs", - "params": [ - "103x2x0" - ] - }, - { - "id": "example:listhtlcs#3", - "method": "listhtlcs", - "params": [ - "436c2658eb4f4689b42ff11b8b05f31ba09860d0df7168085e0796cdf40f85e0" - ] - } - ], - "example_json_response": [ - { - "htlcs": [ - { - "short_channel_id": "103x1x0", - "id": 0, - "expiry": 117, - "direction": "out", - "amount_msat": 100001001, - "payment_hash": "d2668e77c5a2220496e813de36f1fc09ba804b16af4c6bb38299d8a6eb8a5f10", - "state": "RCVD_REMOVE_ACK_REVOCATION" - }, - { - "short_channel_id": "103x1x0", - "id": 1, - "expiry": 117, - "direction": "out", - "amount_msat": 100001001, - "payment_hash": "286e08ac8f575f10508d751fcfc93871b4344271967c7b9e5eacb3f3573b8307", - "state": "RCVD_REMOVE_ACK_REVOCATION" - }, - { - "short_channel_id": "103x1x0", - "id": 2, - "expiry": 135, - "direction": "out", - "amount_msat": 100001001, - "payment_hash": "3e4baa750ee3dfb934578f041ccb40b87432bf37ec65c9d7bce5ff28fecbd95f", - "state": "RCVD_REMOVE_ACK_REVOCATION" - }, - { - "short_channel_id": "103x1x0", - "id": 3, - "expiry": 135, - "direction": "out", - "amount_msat": 100001001, - "payment_hash": "4c3ce32565dc10ef2bd230c32802ce2fe8b007208c0a90757aa289f75c994d49", - "state": "SENT_REMOVE_REVOCATION" - } - ] - }, - { - "htlcs": [ - { - "short_channel_id": "103x2x0", - "id": 0, - "expiry": 117, - "direction": "out", - "amount_msat": 100001001, - "payment_hash": "12bb14b1d119e1ae0759e5ff6f1f6653e3fd8f71ea59411500d2871404a47a98", - "state": "RCVD_REMOVE_ACK_REVOCATION" - }, - { - "short_channel_id": "103x2x0", - "id": 1, - "expiry": 117, - "direction": "out", - "amount_msat": 100001001, - "payment_hash": "57d950209cc0b4fcc5e3027569232f96cf83ef85314c6b139a5713848d811a66", - "state": "RCVD_REMOVE_ACK_REVOCATION" - }, - { - "short_channel_id": "103x2x0", - "id": 2, - "expiry": 135, - "direction": "out", - "amount_msat": 100001001, - "payment_hash": "45ad4654715411a07a0ad6ec3f4bfaa918c90e3d1934b10b1c1c5846523ddd7f", - "state": "RCVD_REMOVE_ACK_REVOCATION" - }, - { - "short_channel_id": "103x2x0", - "id": 3, - "expiry": 135, - "direction": "out", - "amount_msat": 100001001, - "payment_hash": "cc0dcd214aa71c62bfba711a0746da821f2cdba1770b11c225920bdde12c931e", - "state": "RCVD_REMOVE_ACK_REVOCATION" - } - ] - }, - { - "htlcs": [ - { - "short_channel_id": "103x1x0", - "id": 0, - "expiry": 124, - "direction": "out", - "amount_msat": 1001, - "payment_hash": "2ab653668c8017ff2f36ac36678a8da04e11380bd9580a2926b170523b0c6e3b", - "state": "RCVD_REMOVE_ACK_REVOCATION" - }, - { - "short_channel_id": "103x1x0", - "id": 1, - "expiry": 124, - "direction": "out", - "amount_msat": 2001, - "payment_hash": "92f889cb2e48aa28e1e577228b907cdbcc371a2c018e9c8f60fa7036e232cf1d", - "state": "RCVD_REMOVE_ACK_REVOCATION" - }, - { - "short_channel_id": "103x1x0", - "id": 2, - "expiry": 128, - "direction": "out", - "amount_msat": 4001, - "payment_hash": "14ef01c9fb12d7dcac288f48ce87b19a7d5c3d5779aaed1e4adcb5c5d0e9fa45", - "state": "RCVD_REMOVE_ACK_REVOCATION" - } - ] - } - ], - "author": [ - "Rusty Russell <> is mainly responsible." - ], - "see_also": [ - "lightning-listforwards(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-listinvoicerequests.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "added": "v22.11", - "rpc": "listinvoicerequests", - "title": "Command for querying invoice_request status", - "description": [ - "The **listinvoicerequests** RPC command gets the status of a specific `invoice_request`, if it exists, or the status of all `invoice_requests` if given no argument." - ], - "request": { - "required": [], - "properties": { - "invreq_id": { - "type": "string", - "description": [ - "A specific invoice can be queried by providing the `invreq_id`, which is presented by lightning-invoicerequest(7), or can be calculated from a bolt12 invoice." - ] - }, - "active_only": { - "type": "boolean", - "description": [ - "If it is *True* then only active invoice requests are returned." - ], - "default": "*False*" - } - } - }, - "response": { - "required": [ - "invoicerequests" - ], - "properties": { - "invoicerequests": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "invreq_id", - "single_use", - "active", - "bolt12", - "used" - ], - "properties": { - "invreq_id": { - "type": "hash", - "description": [ - "The SHA256 hash of all invoice_request fields less than 160." - ] - }, - "active": { - "type": "boolean", - "description": [ - "Whether the invoice_request is currently active." - ] - }, - "single_use": { - "type": "boolean", - "description": [ - "Whether the invoice_request will become inactive after we pay an invoice for it." - ] - }, - "bolt12": { - "type": "string", - "description": [ - "The bolt12 string starting with lnr." - ] - }, - "used": { - "type": "boolean", - "description": [ - "Whether the invoice_request has already been used." - ] - }, - "label": { - "type": "string", - "description": [ - "The label provided when creating the invoice_request." - ] - } - } - } - } - } - }, - "example_json_request": [ - { - "id": "example:listinvoicerequests#1", - "method": "listinvoicerequests", - "params": [ - "cf0b41d4eb248d975909deb9accf9722b1c86839de80ee8815ce907bbb700a1d" - ] - } - ], - "example_json_response": [ - { - "invoicerequests": [ - { - "invreq_id": "cf0b41d4eb248d975909deb9accf9722b1c86839de80ee8815ce907bbb700a1d", - "active": true, - "single_use": true, - "bolt12": "lnr1qqgx9ag7nmtns87htndlgcfndlq0wzstwd5k6urvv5s8getnw3gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02gzqta0pqpvzzqnxu3vc68fug904w25y3zpskc8huazwmy34av93h2fjswe3tsp4rrcyps5sf5jwnn2tr3ghn32mdta8jvax62pwzhna8sktmaezl3f4s3zy35gx6dfay7r8zn299uwr7ugpze74zft4m8q3fnk2sr0ljqpve3jq", - "used": false - } - ] - } - ], - "author": [ - "Rusty Russell <> is mainly responsible." - ], - "see_also": [ - "lightning-invoicerequests(7)", - "lightning-disableinvoicerequest(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-listinvoices.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "listinvoices", - "title": "Command for querying invoice status", - "description": [ - "The **listinvoices** RPC command gets the status of a specific invoice, if it exists, or the status of all invoices if given no argument.", - "", - "Only one of the query parameters can be used from *label*, *invstring*, *payment_hash*, or *offer_id*." - ], - "request": { - "required": [], - "properties": { - "label": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ], - "description": [ - "A label used a the creation of the invoice to get a specific invoice." - ] - }, - "invstring": { - "type": "string", - "description": [ - "The string value to query a specific invoice." - ] - }, - "payment_hash": { - "type": "hex", - "description": [ - "A payment_hash of the invoice to get the details of a specific invoice." - ] - }, - "offer_id": { - "type": "string", - "description": [ - "A local `offer_id` the invoice was issued for a specific invoice details." - ] - }, - "index": { - "type": "string", - "added": "v23.08", - "enum": [ - "created", - "updated" - ], - "description": [ - "If neither *in_channel* nor *out_channel* is specified, it controls ordering." - ], - "default": "`created`" - }, - "start": { - "type": "u64", - "added": "v23.08", - "description": [ - "If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)." - ] - }, - "limit": { - "type": "u32", - "added": "v23.08", - "description": [ - "If `index` is specified, `limit` can be used to specify the maximum number of entries to return." - ] - } - }, - "dependentUpon": { - "index": [ - "start", - "limit" - ] - } - }, - "response": { - "required": [ - "invoices" - ], - "properties": { - "invoices": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "label", - "created_index", - "payment_hash", - "status", - "expires_at" - ], - "properties": { - "label": { - "type": "string", - "description": [ - "Unique label supplied at invoice creation." - ] - }, - "description": { - "type": "string", - "description": [ - "Description used in the invoice." - ] - }, - "payment_hash": { - "type": "hash", - "description": [ - "The hash of the *payment_preimage* which will prove payment." - ] - }, - "status": { - "type": "string", - "enum": [ - "unpaid", - "paid", - "expired" - ], - "description": [ - "Whether it's paid, unpaid or unpayable." - ] - }, - "expires_at": { - "type": "u64", - "description": [ - "UNIX timestamp of when it will become / became unpayable." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "The amount required to pay this invoice." - ] - }, - "bolt11": { - "type": "string", - "description": [ - "The BOLT11 string (always present unless *bolt12* is)." - ] - }, - "bolt12": { - "type": "string", - "description": [ - "The BOLT12 string (always present unless *bolt11* is)." - ] - }, - "local_offer_id": { - "type": "hash", - "description": [ - "The *id* of our offer which created this invoice (**experimental-offers** only)." - ] - }, - "invreq_payer_note": { - "type": "string", - "description": [ - "The optional *invreq_payer_note* from invoice_request which created this invoice (**experimental-offers** only)." - ] - }, - "created_index": { - "type": "u64", - "added": "v23.08", - "description": [ - "1-based index indicating order this invoice was created in." - ] - }, - "updated_index": { - "type": "u64", - "added": "v23.08", - "description": [ - "1-based index indicating order this invoice was changed (only present if it has changed since creation)." - ] - } - }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "paid" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "pay_index", - "amount_received_msat", - "paid_at", - "payment_preimage" - ], - "properties": { - "label": {}, - "description": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "bolt11": {}, - "bolt12": {}, - "local_offer_id": {}, - "invreq_payer_note": {}, - "expires_at": {}, - "created_index": {}, - "updated_index": {}, - "pay_index": { - "type": "u64", - "description": [ - "Unique incrementing index for this payment." - ] - }, - "amount_received_msat": { - "type": "msat", - "description": [ - "The amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)." - ] - }, - "paid_at": { - "type": "u64", - "description": [ - "UNIX timestamp of when it was paid." - ] - }, - "paid_outpoint": { - "type": "object", - "description": [ - "Outpoint this invoice was paid with." - ], - "added": "v23.11", - "additionalProperties": false, - "required": [ - "txid", - "outnum" - ], - "properties": { - "txid": { - "added": "v23.11", - "type": "txid", - "description": [ - "ID of the transaction that paid the invoice." - ] - }, - "outnum": { - "added": "v23.11", - "type": "u32", - "description": [ - "The 0-based output number of the transaction that paid the invoice." - ] - } - } - }, - "payment_preimage": { - "type": "secret", - "description": [ - "Proof of payment." - ] - } - } - }, - "else": { - "additionalProperties": false, - "properties": { - "label": {}, - "description": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "bolt11": {}, - "bolt12": {}, - "local_offer_id": {}, - "invreq_payer_note": {}, - "created_index": {}, - "updated_index": {}, - "expires_at": {} - } - } - } - ] - } - } - } - }, - "example_json_request": [ - { - "id": "example:listinvoices#1", - "method": "listinvoices", - "params": { - "label": "xEoCR94SIz6UIRUEkxum", - "payment_hash": null, - "invstring": null, - "offer_id": null, - "index": null, - "start": null, - "limit": null - } - } - ], - "example_json_response": [ - { - "invoices": [ - { - "label": "xEoCR94SIz6UIRUEkxum", - "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk", - "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", - "amount_msat": 11000000, - "status": "unpaid", - "description": [ - "XEoCR94SIz6UIRUEkxum." - ], - "expires_at": 1706757730, - "created_index": 1 - } - ] - } - ], - "author": [ - "Rusty Russell <> is mainly responsible." - ], - "see_also": [ - "lightning-waitinvoice(7)", - "lightning-delinvoice(7)", - "lightning-invoice(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-listnodes.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "listnodes", - "title": "Command to get the list of nodes in the known network.", - "description": [ - "The **listnodes** command returns nodes the node has learned about via gossip messages, or a single one if the node *id* was specified." - ], - "request": { - "required": [], - "properties": { - "id": { - "type": "pubkey", - "description": [ - "The public key of the node to list." - ] - } - } - }, - "response": { - "required": [ - "nodes" - ], - "properties": { - "nodes": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "nodeid" - ], - "properties": { - "nodeid": { - "type": "pubkey", - "description": [ - "The public key of the node." - ] - }, - "last_timestamp": { - "type": "u32", - "description": [ - "A node_announcement has been received for this node (UNIX timestamp)." - ] - } - }, - "allOf": [ - { - "if": { - "required": [ - "last_timestamp" - ] - }, - "then": { - "additionalProperties": false, - "required": [ - "nodeid", - "last_timestamp", - "alias", - "color", - "features", - "addresses" - ], - "properties": { - "nodeid": {}, - "last_timestamp": {}, - "option_will_fund": {}, - "alias": { - "type": "string", - "description": [ - "The fun alias this node advertized." - ], - "maxLength": 32 - }, - "color": { - "type": "hex", - "description": [ - "The favorite RGB color this node advertized." - ], - "minLength": 6, - "maxLength": 6 - }, - "features": { - "type": "hex", - "description": [ - "BOLT #9 features bitmap this node advertized." - ] - }, - "addresses": { - "type": "array", - "description": [ - "The addresses this node advertized." - ], - "items": { - "type": "object", - "required": [ - "type", - "port" - ], - "additionalProperties": true, - "properties": { - "type": { - "type": "string", - "enum": [ - "dns", - "ipv4", - "ipv6", - "torv2", - "torv3" - ], - "description": [ - "Type of connection (until 23.08, `websocket` was also allowed)." - ] - }, - "port": { - "type": "u16", - "description": [ - "Port number." - ] - } - }, - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "dns", - "ipv4", - "ipv6", - "torv2", - "torv3" - ] - } - } - }, - "then": { - "required": [ - "type", - "address", - "port" - ], - "additionalProperties": false, - "properties": { - "type": {}, - "port": {}, - "address": { - "type": "string", - "description": [ - "Address in expected format for **type**." - ] - } - } - }, - "else": { - "required": [ - "type", - "port" - ], - "additionalProperties": false, - "properties": { - "type": {}, - "port": {} - } - } - } - } - } - }, - "else": { - "additionalProperties": false, - "properties": { - "nodeid": {} - } - } - }, - { - "if": { - "required": [ - "option_will_fund" - ] - }, - "then": { - "additionalProperties": true, - "required": [ - "option_will_fund" - ], - "properties": { - "option_will_fund": { - "type": "object", - "additionalProperties": false, - "required": [ - "lease_fee_base_msat", - "lease_fee_basis", - "funding_weight", - "channel_fee_max_base_msat", - "channel_fee_max_proportional_thousandths", - "compact_lease" - ], - "properties": { - "lease_fee_base_msat": { - "type": "msat", - "description": [ - "The fixed fee for a lease (whole number of satoshis)." - ] - }, - "lease_fee_basis": { - "type": "u32", - "description": [ - "The proportional fee in basis points (parts per 10,000) for a lease." - ] - }, - "funding_weight": { - "type": "u32", - "description": [ - "The onchain weight you'll have to pay for a lease." - ] - }, - "channel_fee_max_base_msat": { - "type": "msat", - "description": [ - "The maximum base routing fee this node will charge during the lease." - ] - }, - "channel_fee_max_proportional_thousandths": { - "type": "u32", - "description": [ - "The maximum proportional routing fee this node will charge during the lease (in thousandths, not millionths like channel_update)." - ] - }, - "compact_lease": { - "type": "hex", - "description": [ - "The lease as represented in the node_announcement." - ] - } - } - } - } - } - } - ] - } - } - } - }, - "example_json_request": [ - { - "id": "example:listnodes#1", - "method": "listnodes", - "params": { - "id": "02e29856dab8ddd9044c18486e4cab79ec717b490447af2d4831e290e48d57638a" - } - }, - { - "id": "example:listnodes#2", - "method": "listnodes", - "params": { - "id": null - } - } - ], - "example_json_response": [ - { - "nodes": [ - { - "nodeid": "02e29856dab8ddd9044c14586e4cab79ec717b490447af2d4831e290e48d58638a", - "alias": "some_alias", - "color": "68f442", - "last_timestamp": 1597213741, - "features": "02a2a1", - "addresses": [ - { - "type": "ipv4", - "address": "zzz.yy.xx.xx", - "port": 9735 - } - ] - } - ] - }, - { - "nodes": [ - { - "nodeid": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "alias": "SILENTARTIST-v23.11-415-gd120eba", - "color": "022d22", - "last_timestamp": 1708624765, - "features": "88a0000a8a5961", - "addresses": [] - }, - { - "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "alias": "JUNIORBEAM-v23.11-415-gd120eba", - "color": "0266e4", - "last_timestamp": 1708624765, - "features": "88a0000a8a5961", - "addresses": [] - }, - { - "nodeid": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "alias": "HOPPINGFIRE-v23.11-415-gd120eba", - "color": "035d2b", - "last_timestamp": 1708624765, - "features": "88a0000a8a5961", - "addresses": [] - }, - { - "nodeid": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", - "alias": "JUNIORFELONY-v23.11-415-gd120eba", - "color": "0382ce", - "last_timestamp": 1708624766, - "features": "88a0000a8a5961", - "addresses": [] - } - ] - } - ], - "errors": [ - "On failure, one of the following error codes may be returned:", - "", - "- -32602: Error in given parameters." - ], - "author": [ - "Vincenzo Palazzo <> wrote the initial version of this man page,", - "but many others did the hard work of actually implementing this rpc command." - ], - "see_also": [ - "lightning-listchannels(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-listoffers.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "listoffers", - "title": "Command for listing offers", - "warning": "experimental-offers only", - "description": [ - "The **listoffers** RPC command list all offers, or with `offer_id`, only the offer with that offer_id (if it exists)." - ], - "request": { - "required": [], - "properties": { - "offer_id": { - "type": "hash", - "description": [ - "Offer_id to get details for (if it exists)." - ] - }, - "active_only": { - "type": "boolean", - "description": [ - "If set and is true, only offers with `active` true are returned." - ] - } - } - }, - "response": { - "required": [ - "offers" - ], - "properties": { - "offers": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "offer_id", - "active", - "single_use", - "bolt12", - "used" - ], - "properties": { - "offer_id": { - "type": "hash", - "description": [ - "The id of this offer (merkle hash of non-signature fields)." - ] - }, - "active": { - "type": "boolean", - "description": [ - "Whether this can still be used." - ] - }, - "single_use": { - "type": "boolean", - "description": [ - "Whether this expires as soon as it's paid." - ] - }, - "bolt12": { - "type": "string", - "description": [ - "The bolt12 encoding of the offer." - ] - }, - "used": { - "type": "boolean", - "description": [ - "True if an associated invoice has been paid." - ] - }, - "label": { - "type": "string", - "description": [ - "The (optional) user-specified label." - ] - } - } - } - } - } - }, - "example_json_request": [ - { - "id": "example:listoffers#1", - "method": "listoffers", - "params": { - "active_only": true - } - }, - { - "id": "example:listoffers#2", - "method": "listoffers", - "params": [ - "f61cca153d1948dade19349792d9bcdc9cef687fd27db0b553a67979f55aae48" - ] - } - ], - "example_json_response": [ - { - "offers": [ - { - "offer_id": "053a5c566fbea2681a5ff9c05a913da23e45b95d09ef5bd25d7d408f23da7084", - "active": true, - "single_use": false, - "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqvqcdgq2z9pk7enxv4jjqen0wgs8yatnw3ujz83qkc6rvp4j28rt3dtrn32zkvdy7efhnlrpr5rp5geqxs783wtlj550qs8czzku4nk3pqp6m593qxgunzuqcwkmgqkmp6ty0wyvjcqdguv3pnpukedwn6cr87m89t74h3auyaeg89xkvgzpac70z3m9rn5xzu28c", - "used": false - }, - { - "offer_id": "3247d3597fec19e362ca683416a48a0f76a44c1600725a7ee1936548feadacca", - "active": true, - "single_use": false, - "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcxqd24x3qgqgqlgzs3gdhkven9v5sxvmmjype82um50ys3ug9kxsmqdvj3c6ut2cuu2s4nrf8k2dulccgaqcdzxgp583utjlu49rcyqt8hc3s797umxn3r9367rdqc577rma7key58fywkajxnuzyapge86hj2pg80rjrma40xdqrxnsnva5l3ce7hz4ua8wf755dees4y9vnq", - "used": true - } - ] - }, - { - "offers": [ - { - "offer_id": "f61cca153d1948dade19349792d9bcdc9cef687fd27db0b553a67979f55aae48", - "active": true, - "single_use": false, - "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqyqs5rn5v4ehggrxdaezqvtdwdshg93pqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq63s", - "used": false - } - ] - } - ], - "author": [ - "Rusty Russell <> is mainly responsible." - ], - "see_also": [ - "lightning-offer(7)", - "lightning-listoffers(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-listpays.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "listpays", - "title": "Command for querying payment status", - "description": [ - "The **listpay** RPC command gets the status of all *pay* commands, or a single one if either *bolt11* or *payment_hash* was specified." - ], - "request": { - "required": [], - "properties": { - "bolt11": { - "type": "string", - "description": [ - "Bolt11 string to get the payment details." - ] - }, - "payment_hash": { - "type": "hash", - "description": [ - "Payment hash to get the payment details." - ] - }, - "status": { - "type": "string", - "description": [ - "To filter the payment by status." - ], - "enum": [ - "pending", - "complete", - "failed" - ] - } - } - }, - "response": { - "required": [ - "pays" - ], - "properties": { - "pays": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "payment_hash", - "status", - "created_at" - ], - "properties": { - "payment_hash": { - "type": "hash", - "description": [ - "The hash of the *payment_preimage* which will prove payment." - ] - }, - "status": { - "type": "string", - "enum": [ - "pending", - "failed", - "complete" - ], - "description": [ - "Status of the payment." - ] - }, - "destination": { - "type": "pubkey", - "description": [ - "The final destination of the payment if known." - ] - }, - "created_at": { - "type": "u64", - "description": [ - "The UNIX timestamp showing when this payment was initiated." - ] - }, - "completed_at": { - "type": "u64", - "description": [ - "The UNIX timestamp showing when this payment was completed." - ] - }, - "label": { - "type": "string", - "description": [ - "The label, if given to sendpay." - ] - }, - "bolt11": { - "type": "string", - "description": [ - "The bolt11 string (if pay supplied one)." - ] - }, - "description": { - "type": "string", - "description": [ - "The description matching the bolt11 description hash (if pay supplied one)." - ] - }, - "bolt12": { - "type": "string", - "description": [ - "The bolt12 string (if supplied for pay: **experimental-offers** only)." - ] - } - }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "complete" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "amount_sent_msat", - "preimage" - ], - "properties": { - "payment_hash": {}, - "status": {}, - "destination": {}, - "created_at": {}, - "completed_at": {}, - "label": {}, - "bolt11": {}, - "description": {}, - "bolt12": {}, - "amount_msat": { - "type": "msat", - "description": [ - "The amount of millisatoshi we intended to send to the destination." - ] - }, - "amount_sent_msat": { - "type": "msat", - "description": [ - "The amount of millisatoshi we sent in order to pay (may include fees and not match amount_msat)." - ] - }, - "preimage": { - "type": "secret", - "description": [ - "Proof of payment." - ] - }, - "number_of_parts": { - "type": "u64", - "description": [ - "The number of parts for a successful payment (only if more than one)." - ] - } - } - } - }, - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "failed" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "amount_sent_msat" - ], - "properties": { - "payment_hash": {}, - "status": {}, - "destination": {}, - "created_at": {}, - "label": {}, - "bolt11": {}, - "description": {}, - "bolt12": {}, - "amount_sent_msat": {}, - "erroronion": { - "type": "hex", - "description": [ - "The error onion returned on failure, if any." - ] - } - } - } - } - ] - } - } - }, - "post_return_value_notes": [ - "The returned array is ordered by increasing **created_at** fields." - ] - }, - "example_json_request": [ - { - "id": "example:listpays#1", - "method": "listpays", - "params": { - "bolt11": "lnbcrt123n1pjmxp7qsp5hxu7u28y0nx4v689u3hwzdzse2w9yaylhheavf9dxvwtdup7pvespp5ha66gxse68j4n6755v7299dnmq4w34gp0znxu0xzahdc43zrg40qdq5v3jhxcmjd9c8g6t0dc6sxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgqk74dvqlvr92ayy5s7x0r0u9xywez6wu4h8pfta386cw6x7cdrvn8pz87kyg5c930aent423gm9ylpaw5p35k72f02hg0s9dulg4d8fqpgj7gpm", - "payment_hash": null, - "status": null - } - }, - { - "id": "example:listpays#2", - "method": "listpays", - "params": { - "bolt11": "lnbcrt123n1pjmxp7qsp5u84368dz7yhzcqm955h96wdqch7uarasun45cr0vs5d8t0cv5avqpp5r9p0dp92guaatrmhf302m0dyj4n79gk93qu2l5tagfxq3dedgfqsdq5v3jhxcmjd9c8g6t0dc6qxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgq46wu0fznfx27rcnyzhcttf8yqx3lwqs482yxlead0fyt8mefrrrj5m379fa5qukgquf9tnwsuj3nnfmwkzkfg6pyhzq6w8gauuh6m5cqgur64n", - "payment_hash": null, - "status": null - } - } - ], - "example_json_response": [ - { - "pays": [ - { - "bolt11": "lnbcrt123n1pjmxp7qsp5hxu7u28y0nx4v689u3hwzdzse2w9yaylhheavf9dxvwtdup7pvespp5ha66gxse68j4n6755v7299dnmq4w34gp0znxu0xzahdc43zrg40qdq5v3jhxcmjd9c8g6t0dc6sxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgqk74dvqlvr92ayy5s7x0r0u9xywez6wu4h8pfta386cw6x7cdrvn8pz87kyg5c930aent423gm9ylpaw5p35k72f02hg0s9dulg4d8fqpgj7gpm", - "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "payment_hash": "bf75a41a19d1e559ebd4a33ca295b3d82ae8d50178a66e3cc2eddb8ac443455e", - "status": "failed", - "created_at": 1706231854, - "amount_sent_msat": 0 - } - ] - }, - { - "pays": [ - { - "bolt11": "lnbcrt123n1pjmxp7qsp5u84368dz7yhzcqm955h96wdqch7uarasun45cr0vs5d8t0cv5avqpp5r9p0dp92guaatrmhf302m0dyj4n79gk93qu2l5tagfxq3dedgfqsdq5v3jhxcmjd9c8g6t0dc6qxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgq46wu0fznfx27rcnyzhcttf8yqx3lwqs482yxlead0fyt8mefrrrj5m379fa5qukgquf9tnwsuj3nnfmwkzkfg6pyhzq6w8gauuh6m5cqgur64n", - "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "payment_hash": "1942f684aa473bd58f774c5eadbda49567e2a2c58838afd17d424c08b72d4241", - "status": "complete", - "created_at": 1706231849, - "completed_at": 1706231854, - "preimage": "89ce412a2089cbcb72a73ce755337cf693859ea58f21ef0d1caf286a9b0f2a7c", - "amount_msat": 12300, - "amount_sent_msat": 12301 - } - ] - } - ], - "author": [ - "Rusty Russell <> is mainly responsible." - ], - "see_also": [ - "lightning-pay(7)", - "lightning-paystatus(7)", - "lightning-listsendpays(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-listpeerchannels.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "added": "v23.02", - "rpc": "listpeerchannels", - "title": "Command returning data on channels of connected lightning nodes", - "description": [ - "The **listpeerchannels** RPC command returns data on channels of the network, with the possibility to filter the channels by node id.", - "", - "If no *id* is supplied, then channel data on all lightning nodes that are connected, or not connected but have open channels with this node, are returned." - ], - "request": { - "required": [], - "properties": { - "id": { - "type": "pubkey", - "description": [ - "If supplied, limits the channels to just the peer with the given ID, if it exists." - ] - } - } - }, - "response": { - "required": [ - "channels" - ], - "properties": { - "channels": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "state", - "opener", - "features", - "peer_connected", - "peer_id" - ], - "properties": { - "peer_id": { - "type": "pubkey", - "description": [ - "Node Public key." - ] - }, - "peer_connected": { - "type": "boolean", - "description": [ - "A boolean flag that is set to true if the peer is online." - ] - }, - "reestablished": { - "type": "boolean", - "added": "v24.02", - "description": [ - "A boolean flag that is set to true if we have successfully exchanged reestablish messages with this connection." - ] - }, - "state": { - "type": "string", - "enum": [ - "OPENINGD", - "CHANNELD_AWAITING_LOCKIN", - "CHANNELD_NORMAL", - "CHANNELD_SHUTTING_DOWN", - "CLOSINGD_SIGEXCHANGE", - "CLOSINGD_COMPLETE", - "AWAITING_UNILATERAL", - "FUNDING_SPEND_SEEN", - "ONCHAIN", - "DUALOPEND_OPEN_INIT", - "DUALOPEND_AWAITING_LOCKIN", - "CHANNELD_AWAITING_SPLICE", - "DUALOPEND_OPEN_COMMITTED", - "DUALOPEND_OPEN_COMMIT_READY" - ], - "description": [ - "The channel state, in particular `CHANNELD_NORMAL` means the channel can be used normally." - ] - }, - "scratch_txid": { - "type": "txid", - "description": [ - "The txid we would use if we went onchain now." - ] - }, - "channel_type": { - "type": "object", - "description": [ - "Channel_type as negotiated with peer." - ], - "added": "v23.05", - "additionalProperties": false, - "required": [ - "bits", - "names" - ], - "properties": { - "bits": { - "type": "array", - "description": [ - "Each bit set in this channel_type." - ], - "items": { - "type": "u32", - "description": [ - "Bit number." - ] - } - }, - "names": { - "type": "array", - "description": [ - "Feature name for each bit set in this channel_type." - ], - "items": { - "type": "string", - "enum": [ - "static_remotekey/even", - "anchor_outputs/even", - "anchors_zero_fee_htlc_tx/even", - "scid_alias/even", - "zeroconf/even" - ], - "description": [ - "Name of feature bit." - ] - } - } - } - }, - "updates": { - "type": "object", - "added": "v24.02", - "description": [ - "Latest gossip updates sent/received." - ], - "additionalProperties": false, - "required": [ - "local" - ], - "properties": { - "local": { - "type": "object", - "description": [ - "Our gossip for channel." - ], - "additionalProperties": false, - "added": "v24.02", - "required": [ - "htlc_minimum_msat", - "htlc_maximum_msat", - "cltv_expiry_delta", - "fee_base_msat", - "fee_proportional_millionths" - ], - "properties": { - "htlc_minimum_msat": { - "type": "msat", - "added": "v24.02", - "description": [ - "Minimum msat amount we allow." - ] - }, - "htlc_maximum_msat": { - "type": "msat", - "added": "v24.02", - "description": [ - "Maximum msat amount we allow." - ] - }, - "cltv_expiry_delta": { - "type": "u32", - "added": "v24.02", - "description": [ - "Blocks delay required between incoming and outgoing HTLCs." - ] - }, - "fee_base_msat": { - "type": "msat", - "added": "v24.02", - "description": [ - "Amount we charge to use the channel." - ] - }, - "fee_proportional_millionths": { - "type": "u32", - "added": "v24.02", - "description": [ - "Amount we charge to use the channel in parts-per-million." - ] - } - } - }, - "remote": { - "type": "object", - "added": "v24.02", - "description": [ - "Peer's gossip for channel." - ], - "additionalProperties": false, - "required": [ - "htlc_minimum_msat", - "htlc_maximum_msat", - "cltv_expiry_delta", - "fee_base_msat", - "fee_proportional_millionths" - ], - "properties": { - "htlc_minimum_msat": { - "type": "msat", - "added": "v24.02", - "description": [ - "Minimum msat amount they allow." - ] - }, - "htlc_maximum_msat": { - "type": "msat", - "added": "v24.02", - "description": [ - "Maximum msat amount they allow." - ] - }, - "cltv_expiry_delta": { - "type": "u32", - "added": "v24.02", - "description": [ - "Blocks delay required between incoming and outgoing HTLCs." - ] - }, - "fee_base_msat": { - "type": "msat", - "added": "v24.02", - "description": [ - "Amount they charge to use the channel." - ] - }, - "fee_proportional_millionths": { - "type": "u32", - "added": "v24.02", - "description": [ - "Amount they charge to use the channel in parts-per-million." - ] - } - } - } - } - }, - "ignore_fee_limits": { - "type": "boolean", - "added": "v23.08", - "description": [ - "Set if we allow this peer to set fees to anything they want." - ] - }, - "lost_state": { - "type": "boolean", - "added": "v24.02", - "description": [ - "Set if we are fallen behind i.e. lost some channel state." - ] - }, - "feerate": { - "type": "object", - "description": [ - "Feerates for the current tx." - ], - "additionalProperties": false, - "required": [ - "perkw", - "perkb" - ], - "properties": { - "perkw": { - "type": "u32", - "description": [ - "Feerate per 1000 weight (i.e kSipa)." - ] - }, - "perkb": { - "type": "u32", - "description": [ - "Feerate per 1000 virtual bytes." - ] - } - } - }, - "owner": { - "type": "string", - "description": [ - "The current subdaemon controlling this connection." - ] - }, - "short_channel_id": { - "type": "short_channel_id", - "description": [ - "The short_channel_id (once locked in)." - ] - }, - "channel_id": { - "type": "hash", - "description": [ - "The full channel_id (funding txid Xored with output number)." - ] - }, - "funding_txid": { - "type": "txid", - "description": [ - "ID of the funding transaction." - ] - }, - "funding_outnum": { - "type": "u32", - "description": [ - "The 0-based output number of the funding transaction which opens the channel." - ] - }, - "initial_feerate": { - "type": "string", - "description": [ - "For inflight opens, the first feerate used to initiate the channel open." - ] - }, - "last_feerate": { - "type": "string", - "description": [ - "For inflight opens, the most recent feerate used on the channel open." - ] - }, - "next_feerate": { - "type": "string", - "description": [ - "For inflight opens, the next feerate we'll use for the channel open." - ] - }, - "next_fee_step": { - "type": "u32", - "description": [ - "For inflight opens, the next feerate step we'll use for the channel open." - ] - }, - "inflight": { - "type": "array", - "description": [ - "Current candidate funding transactions." - ], - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "funding_txid", - "funding_outnum", - "feerate", - "total_funding_msat", - "splice_amount", - "our_funding_msat" - ], - "properties": { - "funding_txid": { - "type": "txid", - "description": [ - "ID of the funding transaction." - ] - }, - "funding_outnum": { - "type": "u32", - "description": [ - "The 0-based output number of the funding transaction which opens the channel." - ] - }, - "feerate": { - "type": "string", - "description": [ - "The feerate for this funding transaction in per-1000-weight, with `kpw` appended." - ] - }, - "total_funding_msat": { - "type": "msat", - "description": [ - "Total amount in the channel." - ] - }, - "splice_amount": { - "type": "integer", - "added": "v23.08", - "description": [ - "The amouont of sats we're splicing in or out." - ] - }, - "our_funding_msat": { - "type": "msat", - "description": [ - "Amount we have in the channel." - ] - }, - "scratch_txid": { - "type": "txid", - "description": [ - "The commitment transaction txid we would use if we went onchain now." - ] - } - } - } - }, - "close_to": { - "type": "hex", - "description": [ - "ScriptPubkey which we have to close to if we mutual close." - ] - }, - "private": { - "type": "boolean", - "description": [ - "If True, we will not announce this channel." - ] - }, - "opener": { - "type": "string", - "enum": [ - "local", - "remote" - ], - "description": [ - "Who initiated the channel." - ] - }, - "closer": { - "type": "string", - "enum": [ - "local", - "remote" - ], - "description": [ - "Who initiated the channel close (only present if closing)." - ] - }, - "features": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "option_static_remotekey", - "option_anchor_outputs", - "option_anchors_zero_fee_htlc_tx", - "option_scid_alias", - "option_zeroconf" - ], - "description": [ - "BOLT #9 features which apply to this channel." - ] - } - }, - "funding": { - "type": "object", - "additionalProperties": false, - "required": [ - "local_funds_msat", - "remote_funds_msat" - ], - "properties": { - "pushed_msat": { - "type": "msat", - "description": [ - "Amount pushed from opener to peer." - ] - }, - "local_funds_msat": { - "type": "msat", - "description": [ - "Amount of channel we funded." - ] - }, - "remote_funds_msat": { - "type": "msat", - "description": [ - "Amount of channel they funded." - ] - }, - "fee_paid_msat": { - "type": "msat", - "description": [ - "Amount we paid peer at open." - ] - }, - "fee_rcvd_msat": { - "type": "msat", - "description": [ - "Amount we were paid by peer at open." - ] - } - } - }, - "to_us_msat": { - "type": "msat", - "description": [ - "How much of channel is owed to us." - ] - }, - "min_to_us_msat": { - "type": "msat", - "description": [ - "Least amount owed to us ever. If the peer were to successfully steal from us, this is the amount we would still retain." - ] - }, - "max_to_us_msat": { - "type": "msat", - "description": [ - "Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get." - ] - }, - "total_msat": { - "type": "msat", - "description": [ - "Total amount in the channel." - ] - }, - "fee_base_msat": { - "type": "msat", - "description": [ - "Amount we charge to use the channel." - ] - }, - "fee_proportional_millionths": { - "type": "u32", - "description": [ - "Amount we charge to use the channel in parts-per-million." - ] - }, - "dust_limit_msat": { - "type": "msat", - "description": [ - "Minimum amount for an output on the channel transactions." - ] - }, - "max_total_htlc_in_msat": { - "type": "msat", - "description": [ - "Max amount accept in a single payment." - ] - }, - "their_reserve_msat": { - "type": "msat", - "description": [ - "Minimum we insist they keep in channel. If they have less than this in the channel, they cannot send to us on that channel." - ], - "default": "1% of the total channel capacity" - }, - "our_reserve_msat": { - "type": "msat", - "description": [ - "Minimum they insist we keep in channel. If you have less than this in the channel, you cannot send out via this channel." - ] - }, - "spendable_msat": { - "type": "msat", - "description": [ - "An estimate of the total we could send through channel (can be wrong because adding HTLCs requires an increase in fees paid to onchain miners, and onchain fees change dynamically according to onchain activity)." - ] - }, - "receivable_msat": { - "type": "msat", - "description": [ - "An estimate of the total peer could send through channel." - ] - }, - "minimum_htlc_in_msat": { - "type": "msat", - "description": [ - "The minimum amount HTLC we accept." - ] - }, - "minimum_htlc_out_msat": { - "type": "msat", - "description": [ - "The minimum amount HTLC we will send." - ] - }, - "maximum_htlc_out_msat": { - "type": "msat", - "description": [ - "The maximum amount HTLC we will send." - ] - }, - "their_to_self_delay": { - "type": "u32", - "description": [ - "The number of blocks before they can take their funds if they unilateral close." - ] - }, - "our_to_self_delay": { - "type": "u32", - "description": [ - "The number of blocks before we can take our funds if we unilateral close." - ] - }, - "max_accepted_htlcs": { - "type": "u32", - "description": [ - "Maximum number of incoming HTLC we will accept at once." - ] - }, - "alias": { - "type": "object", - "required": [], - "properties": { - "local": { - "type": "short_channel_id", - "description": [ - "An alias assigned by this node to this channel, used for outgoing payments." - ] - }, - "remote": { - "type": "short_channel_id", - "description": [ - "An alias assigned by the remote node to this channel, usable in routehints and invoices." - ] - } - } - }, - "state_changes": { - "type": "array", - "description": [ - "Prior state changes." - ], - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "timestamp", - "old_state", - "new_state", - "cause", - "message" - ], - "properties": { - "timestamp": { - "type": "string", - "description": [ - "UTC timestamp of form YYYY-mm-ddTHH:MM:SS.%03dZ." - ] - }, - "old_state": { - "type": "string", - "enum": [ - "OPENINGD", - "CHANNELD_AWAITING_LOCKIN", - "CHANNELD_NORMAL", - "CHANNELD_SHUTTING_DOWN", - "CLOSINGD_SIGEXCHANGE", - "CLOSINGD_COMPLETE", - "AWAITING_UNILATERAL", - "FUNDING_SPEND_SEEN", - "ONCHAIN", - "DUALOPEND_OPEN_INIT", - "DUALOPEND_AWAITING_LOCKIN", - "DUALOPEND_OPEN_COMMITTED", - "DUALOPEND_OPEN_COMMIT_READY", - "CHANNELD_AWAITING_SPLICE" - ], - "description": [ - "Previous state." - ] - }, - "new_state": { - "type": "string", - "enum": [ - "OPENINGD", - "CHANNELD_AWAITING_LOCKIN", - "CHANNELD_NORMAL", - "CHANNELD_SHUTTING_DOWN", - "CLOSINGD_SIGEXCHANGE", - "CLOSINGD_COMPLETE", - "AWAITING_UNILATERAL", - "FUNDING_SPEND_SEEN", - "ONCHAIN", - "DUALOPEND_OPEN_INIT", - "DUALOPEND_AWAITING_LOCKIN", - "DUALOPEND_OPEN_COMMITTED", - "DUALOPEND_OPEN_COMMIT_READY", - "CHANNELD_AWAITING_SPLICE" - ], - "description": [ - "New state." - ] - }, - "cause": { - "type": "string", - "enum": [ - "unknown", - "local", - "user", - "remote", - "protocol", - "onchain" - ], - "description": [ - "What caused the change." - ] - }, - "message": { - "type": "string", - "description": [ - "Human-readable explanation." - ] - } - } - } - }, - "status": { - "type": "array", - "items": { - "type": "string", - "description": [ - "Billboard log of significant changes." - ] - } - }, - "in_payments_offered": { - "type": "u64", - "description": [ - "Number of incoming payment attempts." - ] - }, - "in_offered_msat": { - "type": "msat", - "description": [ - "Total amount of incoming payment attempts." - ] - }, - "in_payments_fulfilled": { - "type": "u64", - "description": [ - "Number of successful incoming payment attempts." - ] - }, - "in_fulfilled_msat": { - "type": "msat", - "description": [ - "Total amount of successful incoming payment attempts." - ] - }, - "out_payments_offered": { - "type": "u64", - "description": [ - "Number of outgoing payment attempts." - ] - }, - "out_offered_msat": { - "type": "msat", - "description": [ - "Total amount of outgoing payment attempts." - ] - }, - "out_payments_fulfilled": { - "type": "u64", - "description": [ - "Number of successful outgoing payment attempts." - ] - }, - "out_fulfilled_msat": { - "type": "msat", - "description": [ - "Total amount of successful outgoing payment attempts." - ] - }, - "last_stable_connection": { - "type": "u64", - "added": "v24.02", - "description": [ - "Last time we reestablished the open channel and stayed connected for 1 minute." - ] - }, - "htlcs": { - "type": "array", - "description": [ - "Current HTLCs in this channel." - ], - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "direction", - "id", - "amount_msat", - "expiry", - "payment_hash", - "state" - ], - "properties": { - "direction": { - "type": "string", - "added": "v23.02", - "enum": [ - "in", - "out" - ], - "description": [ - "Whether it came from peer, or is going to peer." - ] - }, - "id": { - "type": "u64", - "description": [ - "Unique ID for this htlc on this channel in this direction." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "Amount send/received for this HTLC." - ] - }, - "expiry": { - "type": "u32", - "description": [ - "Block this HTLC expires at (after which an `in` direction HTLC will be returned to the peer, an `out` returned to us). If this expiry is too close, lightningd(8) will automatically unilaterally close the channel in order to enforce the timeout onchain." - ] - }, - "payment_hash": { - "type": "hash", - "description": [ - "The hash of the payment_preimage which will prove payment." - ] - }, - "local_trimmed": { - "type": "boolean", - "enum": [ - true - ], - "description": [ - "If this is too small to enforce onchain; it doesn't appear in the commitment transaction and will not be enforced in a unilateral close. Generally true if the HTLC (after subtracting onchain fees) is below the `dust_limit_msat` for the channel." - ] - }, - "status": { - "type": "string", - "description": [ - "Set if this HTLC is currently waiting on a hook (and shows what plugin)." - ] - } - }, - "allOf": [ - { - "if": { - "properties": { - "direction": { - "enum": [ - "out" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "state" - ], - "properties": { - "direction": {}, - "id": {}, - "amount_msat": {}, - "msatoshi": {}, - "expiry": {}, - "payment_hash": {}, - "local_trimmed": {}, - "status": {}, - "alias": {}, - "peer_id": {}, - "peer_connected": {}, - "reestablished": {}, - "state": { - "type": "string", - "enum": [ - "SENT_ADD_HTLC", - "SENT_ADD_COMMIT", - "RCVD_ADD_REVOCATION", - "RCVD_ADD_ACK_COMMIT", - "SENT_ADD_ACK_REVOCATION", - "RCVD_REMOVE_HTLC", - "RCVD_REMOVE_COMMIT", - "SENT_REMOVE_REVOCATION", - "SENT_REMOVE_ACK_COMMIT", - "RCVD_REMOVE_ACK_REVOCATION" - ], - "description": [ - "Status of the HTLC." - ] - } - } - } - }, - { - "if": { - "properties": { - "direction": { - "enum": [ - "in" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "state" - ], - "properties": { - "direction": {}, - "id": {}, - "amount_msat": {}, - "msatoshi": {}, - "expiry": {}, - "payment_hash": {}, - "local_trimmed": {}, - "status": {}, - "peer_id": {}, - "peer_connected": {}, - "reestablished": {}, - "state": { - "type": "string", - "enum": [ - "RCVD_ADD_HTLC", - "RCVD_ADD_COMMIT", - "SENT_ADD_REVOCATION", - "SENT_ADD_ACK_COMMIT", - "RCVD_ADD_ACK_REVOCATION", - "SENT_REMOVE_HTLC", - "SENT_REMOVE_COMMIT", - "RCVD_REMOVE_REVOCATION", - "RCVD_REMOVE_ACK_COMMIT", - "SENT_REMOVE_ACK_REVOCATION" - ], - "description": [ - "Status of the HTLC." - ] - } - } - } - } - ] - } - } - }, - "allOf": [ - { - "if": { - "properties": { - "peer_connected": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "properties": { - "reestablished": { - "type": "boolean", - "description": [ - "True if we have successfully exchanged reestablish messages this connection." - ] - } - } - } - }, - { - "if": { - "required": [ - "close_to" - ] - }, - "then": { - "additionalProperties": false, - "required": [], - "properties": { - "state": {}, - "peer_id": {}, - "peer_connected": {}, - "reestablished": {}, - "scratch_txid": {}, - "channel_type": {}, - "feerate": {}, - "ignore_fee_limits": {}, - "lost_state": {}, - "owner": {}, - "short_channel_id": {}, - "channel_id": {}, - "updates": {}, - "funding_txid": {}, - "funding_outnum": {}, - "close_to": {}, - "private": {}, - "alias": {}, - "opener": {}, - "closer": {}, - "features": {}, - "funding": {}, - "to_us_msat": {}, - "min_to_us_msat": {}, - "max_to_us_msat": {}, - "total_msat": {}, - "fee_base_msat": {}, - "fee_proportional_millionths": {}, - "dust_limit_msat": {}, - "max_total_htlc_in_msat": {}, - "their_reserve_msat": {}, - "our_reserve_msat": {}, - "spendable_msat": {}, - "receivable_msat": {}, - "minimum_htlc_in_msat": {}, - "minimum_htlc_out_msat": {}, - "maximum_htlc_out_msat": {}, - "spendable_msatoshi": {}, - "receivable_msatoshi": {}, - "their_to_self_delay": {}, - "our_to_self_delay": {}, - "max_accepted_htlcs": {}, - "msatoshi_to_us": {}, - "msatoshi_to_us_min": {}, - "msatoshi_to_us_max": {}, - "msatoshi_total": {}, - "dust_limit_satoshis": {}, - "max_htlc_value_in_flight_msat": {}, - "our_channel_reserve_satoshis": {}, - "their_channel_reserve_satoshis": {}, - "spendable_satoshis": {}, - "receivable_satoshis": {}, - "htlc_minimum_msat": {}, - "state_changes": {}, - "status": {}, - "in_payments_offered": {}, - "in_offered_msat": {}, - "in_msatoshi_offered": {}, - "in_payments_fulfilled": {}, - "in_fulfilled_msat": {}, - "in_msatoshi_fulfilled": {}, - "out_payments_offered": {}, - "out_offered_msat": {}, - "out_msatoshi_offered": {}, - "out_payments_fulfilled": {}, - "out_fulfilled_msat": {}, - "out_msatoshi_fulfilled": {}, - "last_stable_connection": {}, - "htlcs": {}, - "initial_feerate": {}, - "last_feerate": {}, - "next_feerate": {}, - "inflight": {}, - "last_tx_fee_msat": {}, - "direction": {}, - "close_to_addr": { - "type": "string", - "description": [ - "The bitcoin address we will close to (present if close_to_addr is a standardized address)." - ] - } - } - } - }, - { - "if": { - "required": [ - "scratch_txid" - ] - }, - "then": { - "additionalProperties": false, - "required": [ - "last_tx_fee_msat" - ], - "properties": { - "state": {}, - "peer_id": {}, - "peer_connected": {}, - "reestablished": {}, - "alias": {}, - "scratch_txid": {}, - "channel_type": {}, - "feerate": {}, - "ignore_fee_limits": {}, - "lost_state": {}, - "owner": {}, - "short_channel_id": {}, - "channel_id": {}, - "updates": {}, - "funding_txid": {}, - "funding_outnum": {}, - "inflight": {}, - "close_to": {}, - "private": {}, - "opener": {}, - "closer": {}, - "features": {}, - "funding": {}, - "to_us_msat": {}, - "min_to_us_msat": {}, - "max_to_us_msat": {}, - "total_msat": {}, - "fee_base_msat": {}, - "fee_proportional_millionths": {}, - "dust_limit_msat": {}, - "max_total_htlc_in_msat": {}, - "their_reserve_msat": {}, - "our_reserve_msat": {}, - "spendable_msat": {}, - "receivable_msat": {}, - "minimum_htlc_in_msat": {}, - "minimum_htlc_out_msat": {}, - "maximum_htlc_out_msat": {}, - "spendable_msatoshi": {}, - "receivable_msatoshi": {}, - "their_to_self_delay": {}, - "our_to_self_delay": {}, - "max_accepted_htlcs": {}, - "msatoshi_to_us": {}, - "msatoshi_to_us_min": {}, - "msatoshi_to_us_max": {}, - "msatoshi_total": {}, - "dust_limit_satoshis": {}, - "max_htlc_value_in_flight_msat": {}, - "our_channel_reserve_satoshis": {}, - "their_channel_reserve_satoshis": {}, - "spendable_satoshis": {}, - "receivable_satoshis": {}, - "htlc_minimum_msat": {}, - "state_changes": {}, - "status": {}, - "in_payments_offered": {}, - "in_offered_msat": {}, - "in_msatoshi_offered": {}, - "in_payments_fulfilled": {}, - "in_fulfilled_msat": {}, - "in_msatoshi_fulfilled": {}, - "out_payments_offered": {}, - "out_offered_msat": {}, - "out_msatoshi_offered": {}, - "out_payments_fulfilled": {}, - "out_fulfilled_msat": {}, - "out_msatoshi_fulfilled": {}, - "last_stable_connection": {}, - "htlcs": {}, - "initial_feerate": {}, - "last_feerate": {}, - "next_feerate": {}, - "close_to_addr": {}, - "direction": {}, - "last_tx_fee_msat": { - "type": "msat", - "description": [ - "Fee attached to this the current tx." - ] - } - } - } - }, - { - "if": { - "required": [ - "short_channel_id" - ] - }, - "then": { - "additionalProperties": false, - "required": [ - "direction" - ], - "properties": { - "alias": {}, - "peer_id": {}, - "peer_connected": {}, - "reestablished": {}, - "state": {}, - "scratch_txid": {}, - "channel_type": {}, - "feerate": {}, - "ignore_fee_limits": {}, - "lost_state": {}, - "owner": {}, - "short_channel_id": {}, - "channel_id": {}, - "updates": {}, - "funding_txid": {}, - "funding_outnum": {}, - "inflight": {}, - "close_to": {}, - "private": {}, - "opener": {}, - "closer": {}, - "features": {}, - "funding": {}, - "to_us_msat": {}, - "min_to_us_msat": {}, - "max_to_us_msat": {}, - "total_msat": {}, - "fee_base_msat": {}, - "fee_proportional_millionths": {}, - "dust_limit_msat": {}, - "max_total_htlc_in_msat": {}, - "their_reserve_msat": {}, - "our_reserve_msat": {}, - "spendable_msat": {}, - "receivable_msat": {}, - "minimum_htlc_in_msat": {}, - "minimum_htlc_out_msat": {}, - "maximum_htlc_out_msat": {}, - "spendable_msatoshi": {}, - "receivable_msatoshi": {}, - "their_to_self_delay": {}, - "our_to_self_delay": {}, - "max_accepted_htlcs": {}, - "msatoshi_to_us": {}, - "msatoshi_to_us_min": {}, - "msatoshi_to_us_max": {}, - "msatoshi_total": {}, - "dust_limit_satoshis": {}, - "max_htlc_value_in_flight_msat": {}, - "our_channel_reserve_satoshis": {}, - "their_channel_reserve_satoshis": {}, - "spendable_satoshis": {}, - "receivable_satoshis": {}, - "htlc_minimum_msat": {}, - "state_changes": {}, - "status": {}, - "in_payments_offered": {}, - "in_offered_msat": {}, - "in_msatoshi_offered": {}, - "in_payments_fulfilled": {}, - "in_fulfilled_msat": {}, - "in_msatoshi_fulfilled": {}, - "out_payments_offered": {}, - "out_offered_msat": {}, - "out_msatoshi_offered": {}, - "out_payments_fulfilled": {}, - "out_fulfilled_msat": {}, - "out_msatoshi_fulfilled": {}, - "last_stable_connection": {}, - "htlcs": {}, - "initial_feerate": {}, - "last_feerate": {}, - "next_feerate": {}, - "close_to_addr": {}, - "last_tx_fee_msat": {}, - "direction": { - "type": "u32", - "added": "v23.02", - "description": [ - "0 if we're the lesser node_id, 1 if we're the greater (as used in BOLT #7 channel_update)." - ] - } - } - } - }, - { - "if": { - "required": [ - "inflight" - ] - }, - "then": { - "additionalProperties": false, - "required": [ - "initial_feerate", - "last_feerate", - "next_feerate" - ], - "properties": { - "state": {}, - "peer_id": {}, - "peer_connected": {}, - "reestablished": {}, - "scratch_txid": {}, - "channel_type": {}, - "feerate": {}, - "ignore_fee_limits": {}, - "lost_state": {}, - "owner": {}, - "alias": {}, - "short_channel_id": {}, - "channel_id": {}, - "updates": {}, - "funding_txid": {}, - "funding_outnum": {}, - "close_to": {}, - "private": {}, - "opener": {}, - "closer": {}, - "features": {}, - "funding": {}, - "to_us_msat": {}, - "min_to_us_msat": {}, - "max_to_us_msat": {}, - "total_msat": {}, - "fee_base_msat": {}, - "fee_proportional_millionths": {}, - "dust_limit_msat": {}, - "max_total_htlc_in_msat": {}, - "their_reserve_msat": {}, - "our_reserve_msat": {}, - "spendable_msat": {}, - "receivable_msat": {}, - "minimum_htlc_in_msat": {}, - "minimum_htlc_out_msat": {}, - "maximum_htlc_out_msat": {}, - "spendable_msatoshi": {}, - "receivable_msatoshi": {}, - "their_to_self_delay": {}, - "our_to_self_delay": {}, - "max_accepted_htlcs": {}, - "msatoshi_to_us": {}, - "msatoshi_to_us_min": {}, - "msatoshi_to_us_max": {}, - "msatoshi_total": {}, - "dust_limit_satoshis": {}, - "max_htlc_value_in_flight_msat": {}, - "our_channel_reserve_satoshis": {}, - "their_channel_reserve_satoshis": {}, - "spendable_satoshis": {}, - "receivable_satoshis": {}, - "htlc_minimum_msat": {}, - "state_changes": {}, - "status": {}, - "in_payments_offered": {}, - "in_offered_msat": {}, - "in_msatoshi_offered": {}, - "in_payments_fulfilled": {}, - "in_fulfilled_msat": {}, - "in_msatoshi_fulfilled": {}, - "out_payments_offered": {}, - "out_offered_msat": {}, - "out_msatoshi_offered": {}, - "out_payments_fulfilled": {}, - "out_fulfilled_msat": {}, - "out_msatoshi_fulfilled": {}, - "last_stable_connection": {}, - "htlcs": {}, - "inflight": {}, - "close_to_addr": {}, - "direction": {}, - "last_tx_fee_msat": {}, - "initial_feerate": { - "type": "string", - "description": [ - "The feerate for the initial funding transaction in per-1000-weight, with `kpw` appended." - ] - }, - "last_feerate": { - "type": "string", - "description": [ - "The feerate for the latest funding transaction in per-1000-weight, with `kpw` appended." - ] - }, - "next_feerate": { - "type": "string", - "description": [ - "The minimum feerate for the next funding transaction in per-1000-weight, with `kpw` appended." - ] - } - } - } - } - ] - } - } - }, - "post_return_value_notes": [ - "The *state* field values (and *old_state* / *new_state*) are worth describing further:", - "", - " * `OPENINGD`: The channel funding protocol with the peer is ongoing and both sides are negotiating parameters.", - " * `DUALOPEND_OPEN_INIT`: Like `OPENINGD`, but for v2 connections which are using collaborative opens.", - " * `DUALOPEND_OPEN_COMMIT_READY`: Like `OPENINGD`, but for v2 connections which are using collaborative opens. You're ready to send your commitment signed to your peer.", - " * `DUALOPEND_OPEN_COMMITTED`: Like `OPENINGD`, but for v2 connections which are using collaborative opens. You've gotten an initial signed commitment from your peer.", - " * `CHANNELD_AWAITING_LOCKIN` / `DUALOPEND_AWAITING_LOCKIN`: The peer and you have agreed on channel parameters and are just waiting for the channel funding transaction to be confirmed deeply (original and collaborative open protocols, respectively). Both you and the peer must acknowledge the channel funding transaction to be confirmed deeply before entering the next state. Also, you can increase the onchain fee for channels in `DUALOPEND_AWAITING_LOCKIN` using lightning-openchannel_bump(7).", - " * `CHANNELD_NORMAL`: The channel can be used for normal payments.", - " * `CHANNELD_SHUTTING_DOWN`: A mutual close was requested (by you or peer) and both of you are waiting for HTLCs in-flight to be either failed or succeeded. The channel can no longer be used for normal payments and forwarding. Mutual close will proceed only once all HTLCs in the channel have either been fulfilled or failed.", - " * `CLOSINGD_SIGEXCHANGE`: You and the peer are negotiating the mutual close onchain fee.", - " * `CLOSINGD_COMPLETE`: You and the peer have agreed on the mutual close onchain fee and are awaiting the mutual close getting confirmed deeply.", - " * `AWAITING_UNILATERAL`: You initiated a unilateral close, and are now waiting for the peer-selected unilateral close timeout to complete.", - " * `FUNDING_SPEND_SEEN`: You saw the funding transaction getting spent (usually the peer initiated a unilateral close) and will now determine what exactly happened (i.e. if it was a theft attempt).", - " * `ONCHAIN`: You saw the funding transaction getting spent and now know what happened (i.e. if it was a proper unilateral close by the peer, or a theft attempt)." - ] - }, - "errors": [ - "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", - "", - "- -32602: If the given parameters are wrong." - ], - "example_json_request": [ - { - "id": "example:listpeerchannels#1", - "method": "listpeerchannels", - "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" - } - }, - { - "id": "example:listpeerchannels#2", - "method": "listpeerchannels", - "params": { - "id": null - } - } - ], - "example_json_response": [ - { - "channels": [ - { - "peer_id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "peer_connected": true, - "channel_type": { - "bits": [ - 12 - ], - "names": [ - "static_remotekey/even" - ] - }, - "updates": { - "local": { - "htlc_minimum_msat": 0, - "htlc_maximum_msat": 990000000, - "cltv_expiry_delta": 6, - "fee_base_msat": 1, - "fee_proportional_millionths": 10 - } - }, - "state": "CHANNELD_AWAITING_LOCKIN", - "scratch_txid": "4e9c2866b9ae1f765b89ea7ec37428c900ea97f717f85f00e3db852cb6aea3a8", - "last_tx_fee_msat": 5430000, - "feerate": { - "perkw": 7500, - "perkb": 30000 - }, - "owner": "channeld", - "direction": 1, - "channel_id": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", - "funding_txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b", - "funding_outnum": 0, - "close_to_addr": "bcrt1pamt5tqzd49uyessr7437l2vllf20muqmzdauje8x8scjgpc0l0nqhyqcyp", - "close_to": "5120eed745804da9784cc203f563efa99ffa54fdf01b137bc964e63c3124070ffbe6", - "private": false, - "opener": "local", - "alias": { - "local": "5589251x14022525x17398" - }, - "features": [ - "option_static_remotekey" - ], - "funding": { - "local_funds_msat": 1000000000, - "remote_funds_msat": 0, - "pushed_msat": 0 - }, - "to_us_msat": 1000000000, - "min_to_us_msat": 1000000000, - "max_to_us_msat": 1000000000, - "total_msat": 1000000000, - "fee_base_msat": 1, - "fee_proportional_millionths": 10, - "dust_limit_msat": 546000, - "max_total_htlc_in_msat": 18446744073709552000, - "their_reserve_msat": 10000000, - "our_reserve_msat": 10000000, - "spendable_msat": 973980000, - "receivable_msat": 0, - "minimum_htlc_in_msat": 0, - "minimum_htlc_out_msat": 0, - "maximum_htlc_out_msat": 990000000, - "their_to_self_delay": 5, - "our_to_self_delay": 5, - "max_accepted_htlcs": 483, - "state_changes": [], - "status": [], - "in_payments_offered": 0, - "in_offered_msat": 0, - "in_payments_fulfilled": 0, - "in_fulfilled_msat": 0, - "out_payments_offered": 0, - "out_offered_msat": 0, - "out_payments_fulfilled": 0, - "out_fulfilled_msat": 0, - "htlcs": [] - } - ] - }, - { - "channels": [ - { - "peer_id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "peer_connected": true, - "reestablished": true, - "channel_type": { - "bits": [ - 12, - 22 - ], - "names": [ - "static_remotekey/even", - "anchors_zero_fee_htlc_tx/even" - ] - }, - "updates": { - "local": { - "htlc_minimum_msat": 0, - "htlc_maximum_msat": 990000000, - "cltv_expiry_delta": 6, - "fee_base_msat": 1, - "fee_proportional_millionths": 10 - }, - "remote": { - "htlc_minimum_msat": 0, - "htlc_maximum_msat": 990000000, - "cltv_expiry_delta": 6, - "fee_base_msat": 1, - "fee_proportional_millionths": 10 - } - }, - "state": "CHANNELD_NORMAL", - "scratch_txid": "ece66657d6203a4ea77807f566fd5b98a78b659f0cd59ce9200aa3bd6875ee25", - "last_tx_fee_msat": 4545000, - "lost_state": false, - "feerate": { - "perkw": 3750, - "perkb": 15000 - }, - "owner": "channeld", - "short_channel_id": "103x1x0", - "direction": 1, - "channel_id": "def5ef03e0d36ed65de814c0a8d6599a502fe1afb8e956529320bb350e876b5f", - "funding_txid": "5f6b870e35bb20935256e9b8afe12f509a59d6a8c014e85dd66ed3e003eff5de", - "funding_outnum": 0, - "close_to_addr": "bcrt1pamt5tqzd49uyessr7437l2vllf20muqmzdauje8x8scjgpc0l0nqhyqcyp", - "close_to": "5120eed745804da9784cc203f563efa99ffa54fdf01b137bc964e63c3124070ffbe6", - "private": false, - "opener": "local", - "alias": { - "local": "15447035x5589520x8959", - "remote": "6036590x13481428x5501" - }, - "features": [ - "option_static_remotekey", - "option_anchors_zero_fee_htlc_tx" - ], - "funding": { - "local_funds_msat": 1000000000, - "remote_funds_msat": 0, - "pushed_msat": 0 - }, - "to_us_msat": 1000000000, - "min_to_us_msat": 1000000000, - "max_to_us_msat": 1000000000, - "total_msat": 1000000000, - "fee_base_msat": 1, - "fee_proportional_millionths": 10, - "dust_limit_msat": 546000, - "max_total_htlc_in_msat": 18446744073709552000, - "their_reserve_msat": 10000000, - "our_reserve_msat": 10000000, - "spendable_msat": 978330000, - "receivable_msat": 0, - "minimum_htlc_in_msat": 0, - "minimum_htlc_out_msat": 0, - "maximum_htlc_out_msat": 990000000, - "their_to_self_delay": 5, - "our_to_self_delay": 5, - "max_accepted_htlcs": 483, - "state_changes": [ - { - "timestamp": "2024-02-22T17:48:57.127Z", - "old_state": "CHANNELD_AWAITING_LOCKIN", - "new_state": "CHANNELD_NORMAL", - "cause": "user", - "message": "Lockin complete" - } - ], - "status": [ - "CHANNELD_NORMAL:Channel ready for use." - ], - "in_payments_offered": 0, - "in_offered_msat": 0, - "in_payments_fulfilled": 0, - "in_fulfilled_msat": 0, - "out_payments_offered": 0, - "out_offered_msat": 0, - "out_payments_fulfilled": 0, - "out_fulfilled_msat": 0, - "htlcs": [] - } - ] - } - ], - "author": [ - "Michael Hawkins <>." - ], - "see_also": [ - "lightning-connect(7)", - "lightning-fundchannel_start(7)" - ], - "resources": [ - "Main web site: ", - "Lightning RFC site (BOLT #9): ", - "" - ] - }, - "lightning-listpeers.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "listpeers", - "title": "Command returning data on connected lightning nodes", - "description": [ - "The **listpeers** RPC command returns data on nodes that are connected or are not connected but have open channels with this node.", - "", - "Once a connection to another lightning node has been established, using the **connect** command, data on the node can be returned using **listpeers** and the *id* that was used with the **connect** command.", - "", - "If no *id* is supplied, then data on all lightning nodes that are connected, or not connected but have open channels with this node, are returned.", - "", - "If a channel is open with a node and the connection has been lost, then the node will still appear in the output of the command and the value of the *connected* attribute of the node will be \"false\".", - "", - "The channel will remain open for a set blocktime, after which if the connection has not been re-established, the channel will close and the node will no longer appear in the command output." - ], - "request": { - "required": [], - "properties": { - "id": { - "type": "pubkey", - "description": [ - "If supplied, limits the result to just the peer with the given ID, if it exists." - ] - }, - "level": { - "type": "string", - "description": [ - "Supplying level will show log entries related to that peer at the given log level." - ], - "enum": [ - "io", - "debug", - "info", - "unusual" - ] - } - } - }, - "response": { - "required": [ - "peers" - ], - "properties": { - "peers": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "id", - "connected", - "num_channels" - ], - "properties": { - "id": { - "type": "pubkey", - "description": [ - "The unique id of the peer." - ] - }, - "connected": { - "type": "boolean", - "description": [ - "Value showing the connection status." - ] - }, - "num_channels": { - "type": "u32", - "description": [ - "The number of channels the peer has with this node." - ], - "added": "v23.02" - }, - "log": { - "type": "array", - "description": [ - "If *level* is specified, logs for this peer." - ], - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "SKIPPED", - "BROKEN", - "UNUSUAL", - "INFO", - "DEBUG", - "IO_IN", - "IO_OUT" - ] - } - }, - "allOf": [ - { - "if": { - "properties": { - "type": { - "enum": [ - "SKIPPED" - ] - } - } - }, - "then": { - "type": "object", - "additionalProperties": false, - "required": [ - "num_skipped" - ], - "properties": { - "type": {}, - "num_skipped": { - "type": "u32", - "description": [ - "Number of deleted/omitted entries." - ] - } - } - } - }, - { - "if": { - "properties": { - "type": { - "enum": [ - "BROKEN", - "UNUSUAL", - "INFO", - "DEBUG" - ] - } - } - }, - "then": { - "type": "object", - "additionalProperties": false, - "required": [ - "time", - "source", - "log", - "node_id" - ], - "properties": { - "type": {}, - "time": { - "type": "string", - "description": [ - "UNIX timestamp with 9 decimal places." - ] - }, - "source": { - "type": "string", - "description": [ - "The particular logbook this was found in." - ] - }, - "log": { - "type": "string", - "description": [ - "The actual log message." - ] - }, - "node_id": { - "type": "pubkey", - "description": [ - "The peer this is associated with." - ] - } - } - } - }, - { - "if": { - "properties": { - "type": { - "enum": [ - "IO_IN", - "IO_OUT" - ] - } - } - }, - "then": { - "type": "object", - "additionalProperties": false, - "required": [ - "time", - "source", - "log", - "node_id", - "data" - ], - "properties": { - "type": {}, - "time": { - "type": "string", - "description": [ - "UNIX timestamp with 9 decimal places." - ] - }, - "source": { - "type": "string", - "description": [ - "The particular logbook this was found in." - ] - }, - "log": { - "type": "string", - "description": [ - "The actual log message." - ] - }, - "node_id": { - "type": "pubkey", - "description": [ - "The peer this is associated with." - ] - }, - "data": { - "type": "hex", - "description": [ - "The IO which occurred." - ] - } - } - } - } - ] - } - }, - "channels": { - "deprecated": [ - "v23.02", - "v24.02" - ], - "type": "array", - "description": [ - "Channels with this peer." - ], - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "state", - "opener", - "features" - ], - "properties": { - "state": { - "type": "string", - "enum": [ - "OPENINGD", - "CHANNELD_AWAITING_LOCKIN", - "CHANNELD_NORMAL", - "CHANNELD_SHUTTING_DOWN", - "CLOSINGD_SIGEXCHANGE", - "CLOSINGD_COMPLETE", - "AWAITING_UNILATERAL", - "FUNDING_SPEND_SEEN", - "ONCHAIN", - "DUALOPEND_OPEN_INIT", - "DUALOPEND_AWAITING_LOCKIN", - "DUALOPEND_OPEN_COMMITTED", - "DUALOPEND_OPEN_COMMIT_READY" - ], - "description": [ - "Current state of the channel:", - " * `OPENINGD`: The channel funding protocol with the peer is ongoing and both sides are negotiating parameters.", - " * `CHANNELD_AWAITING_LOCKIN`: The peer and you have agreed on channel parameters and are just waiting for the channel funding transaction to be confirmed deeply. Both you and the peer must acknowledge the channel funding transaction to be confirmed deeply before entering the next state.", - " * `CHANNELD_NORMAL`: The channel can be used for normal payments.", - " * `CHANNELD_SHUTTING_DOWN`: A mutual close was requested (by you or peer) and both of you are waiting for HTLCs in-flight to be either failed or succeeded. The channel can no longer be used for normal payments and forwarding. Mutual close will proceed only once all HTLCs in the channel have either been fulfilled or failed.", - " * `CLOSINGD_SIGEXCHANGE`: You and the peer are negotiating the mutual close onchain fee.", - " * `CLOSINGD_COMPLETE`: You and the peer have agreed on the mutual close onchain fee and are awaiting the mutual close getting confirmed deeply.", - " * `AWAITING_UNILATERAL`: You initiated a unilateral close, and are now waiting for the peer-selected unilateral close timeout to complete.", - " * `FUNDING_SPEND_SEEN`: You saw the funding transaction getting spent (usually the peer initiated a unilateral close) and will now determine what exactly happened (i.e. if it was a theft attempt).", - " * `ONCHAIN`: You saw the funding transaction getting spent and now know what happened (i.e. if it was a proper unilateral close by the peer, or a theft attempt).", - " * `CLOSED`: The channel closure has been confirmed deeply. The channel will eventually be removed from this array." - ] - }, - "scratch_txid": { - "type": "txid", - "description": [ - "The txid we would use if we went onchain now." - ] - }, - "feerate": { - "type": "object", - "description": [ - "Feerates for the current tx." - ], - "additionalProperties": false, - "required": [ - "perkw", - "perkb" - ], - "properties": { - "perkw": { - "type": "u32", - "description": [ - "Feerate per 1000 weight (i.e kSipa)." - ] - }, - "perkb": { - "type": "u32", - "description": [ - "Feerate per 1000 virtual bytes." - ] - } - } - }, - "owner": { - "type": "string", - "description": [ - "The current subdaemon controlling this connection." - ] - }, - "short_channel_id": { - "type": "short_channel_id", - "description": [ - "The short_channel_id (once locked in)." - ] - }, - "channel_id": { - "type": "hash", - "description": [ - "The full channel_id (funding txid Xored with output number)." - ] - }, - "funding_txid": { - "type": "txid", - "description": [ - "ID of the funding transaction." - ] - }, - "funding_outnum": { - "type": "u32", - "description": [ - "The 0-based output number of the funding transaction which opens the channel." - ] - }, - "initial_feerate": { - "type": "string", - "description": [ - "For inflight opens, the first feerate used to initiate the channel open." - ] - }, - "last_feerate": { - "type": "string", - "description": [ - "For inflight opens, the most recent feerate used on the channel open." - ] - }, - "next_feerate": { - "type": "string", - "description": [ - "For inflight opens, the next feerate we'll use for the channel open." - ] - }, - "next_fee_step": { - "type": "u32", - "description": [ - "For inflight opens, the next feerate step we'll use for the channel open." - ] - }, - "inflight": { - "type": "array", - "description": [ - "Current candidate funding transactions." - ], - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "funding_txid", - "funding_outnum", - "feerate", - "total_funding_msat", - "our_funding_msat", - "splice_amount", - "scratch_txid" - ], - "properties": { - "funding_txid": { - "type": "txid", - "description": [ - "ID of the funding transaction." - ] - }, - "funding_outnum": { - "type": "u32", - "description": [ - "The 0-based output number of the funding transaction which opens the channel." - ] - }, - "feerate": { - "type": "string", - "description": [ - "The feerate for this funding transaction in per-1000-weight, with `kpw` appended." - ] - }, - "total_funding_msat": { - "type": "msat", - "description": [ - "Total amount in the channel." - ] - }, - "our_funding_msat": { - "type": "msat", - "description": [ - "Amount we have in the channel." - ] - }, - "splice_amount": { - "type": "integer", - "added": "v23.08", - "description": [ - "The amouont of sats we're splicing in or out." - ] - }, - "scratch_txid": { - "type": "txid", - "description": [ - "The commitment transaction txid we would use if we went onchain now." - ] - } - } - } - }, - "close_to": { - "type": "hex", - "description": [ - "ScriptPubkey which we have to close to if we mutual close." - ] - }, - "private": { - "type": "boolean", - "description": [ - "If True, we will not announce this channel." - ] - }, - "opener": { - "type": "string", - "enum": [ - "local", - "remote" - ], - "description": [ - "Who initiated the channel." - ] - }, - "closer": { - "type": "string", - "enum": [ - "local", - "remote" - ], - "description": [ - "Who initiated the channel close (only present if closing)." - ] - }, - "features": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "option_static_remotekey", - "option_anchor_outputs", - "option_scid_alias", - "option_zeroconf" - ], - "description": [ - "BOLT #9 features which apply to this channel." - ] - } - }, - "funding": { - "type": "object", - "additionalProperties": false, - "required": [ - "local_funds_msat", - "remote_funds_msat" - ], - "properties": { - "pushed_msat": { - "type": "msat", - "description": [ - "Amount pushed from opener to peer." - ] - }, - "local_funds_msat": { - "type": "msat", - "description": [ - "Amount of channel we funded." - ] - }, - "remote_funds_msat": { - "type": "msat", - "description": [ - "Amount of channel they funded." - ] - }, - "fee_paid_msat": { - "type": "msat", - "description": [ - "Amount we paid peer at open." - ] - }, - "fee_rcvd_msat": { - "type": "msat", - "description": [ - "Amount we were paid by peer at open." - ] - } - } - }, - "to_us_msat": { - "type": "msat", - "description": [ - "How much of channel is owed to us." - ] - }, - "min_to_us_msat": { - "type": "msat", - "description": [ - "Least amount owed to us ever. If the peer were to successfully steal from us, this is the amount we would still retain." - ] - }, - "max_to_us_msat": { - "type": "msat", - "description": [ - "Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get." - ] - }, - "total_msat": { - "type": "msat", - "description": [ - "Total amount in the channel." - ] - }, - "fee_base_msat": { - "type": "msat", - "description": [ - "Amount we charge to use the channel." - ] - }, - "fee_proportional_millionths": { - "type": "u32", - "description": [ - "Amount we charge to use the channel in parts-per-million." - ] - }, - "dust_limit_msat": { - "type": "msat", - "description": [ - "Minimum amount for an output on the channel transactions." - ] - }, - "max_total_htlc_in_msat": { - "type": "msat", - "description": [ - "Max amount accept in a single payment." - ] - }, - "their_reserve_msat": { - "type": "msat", - "description": [ - "Minimum we insist they keep in channel. If they have less than this in the channel, they cannot send to us on that channel." - ], - "default": "1% of the total channel capacity" - }, - "our_reserve_msat": { - "type": "msat", - "description": [ - "Minimum they insist we keep in channel. If you have less than this in the channel, you cannot send out via this channel." - ] - }, - "spendable_msat": { - "type": "msat", - "description": [ - "An estimate of the total we could send through channel (can be wrong because adding HTLCs requires an increase in fees paid to onchain miners, and onchain fees change dynamically according to onchain activity)." - ] - }, - "receivable_msat": { - "type": "msat", - "description": [ - "An estimate of the total peer could send through channel." - ] - }, - "minimum_htlc_in_msat": { - "type": "msat", - "description": [ - "The minimum amount HTLC we accept." - ] - }, - "minimum_htlc_out_msat": { - "type": "msat", - "description": [ - "The minimum amount HTLC we will send." - ] - }, - "maximum_htlc_out_msat": { - "type": "msat", - "description": [ - "The maximum amount HTLC we will send." - ] - }, - "their_to_self_delay": { - "type": "u32", - "description": [ - "The number of blocks before they can take their funds if they unilateral close." - ] - }, - "our_to_self_delay": { - "type": "u32", - "description": [ - "The number of blocks before we can take our funds if we unilateral close." - ] - }, - "max_accepted_htlcs": { - "type": "u32", - "description": [ - "Maximum number of incoming HTLC we will accept at once." - ] - }, - "alias": { - "type": "object", - "required": [], - "properties": { - "local": { - "type": "short_channel_id", - "description": [ - "An alias assigned by this node to this channel, used for outgoing payments." - ] - }, - "remote": { - "type": "short_channel_id", - "description": [ - "An alias assigned by the remote node to this channel, usable in routehints and invoices." - ] - } - } - }, - "state_changes": { - "type": "array", - "description": [ - "Prior state changes." - ], - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "timestamp", - "old_state", - "new_state", - "cause", - "message" - ], - "properties": { - "timestamp": { - "type": "string", - "description": [ - "UTC timestamp of form YYYY-mm-ddTHH:MM:SS.%03dZ." - ] - }, - "old_state": { - "type": "string", - "enum": [ - "OPENINGD", - "CHANNELD_AWAITING_LOCKIN", - "CHANNELD_NORMAL", - "CHANNELD_SHUTTING_DOWN", - "CLOSINGD_SIGEXCHANGE", - "CLOSINGD_COMPLETE", - "AWAITING_UNILATERAL", - "FUNDING_SPEND_SEEN", - "ONCHAIN", - "DUALOPEND_OPEN_INIT", - "DUALOPEND_AWAITING_LOCKIN", - "DUALOPEND_OPEN_COMMITTED", - "DUALOPEND_OPEN_COMMIT_READY" - ], - "description": [ - "Previous state." - ] - }, - "new_state": { - "type": "string", - "enum": [ - "OPENINGD", - "CHANNELD_AWAITING_LOCKIN", - "CHANNELD_NORMAL", - "CHANNELD_SHUTTING_DOWN", - "CLOSINGD_SIGEXCHANGE", - "CLOSINGD_COMPLETE", - "AWAITING_UNILATERAL", - "FUNDING_SPEND_SEEN", - "ONCHAIN", - "DUALOPEND_OPEN_INIT", - "DUALOPEND_AWAITING_LOCKIN", - "DUALOPEND_OPEN_COMMITTED", - "DUALOPEND_OPEN_COMMIT_READY" - ], - "description": [ - "New state." - ] - }, - "cause": { - "type": "string", - "enum": [ - "unknown", - "local", - "user", - "remote", - "protocol", - "onchain" - ], - "description": [ - "What caused the change." - ] - }, - "message": { - "type": "string", - "description": [ - "Human-readable explanation." - ] - } - } - } - }, - "status": { - "type": "array", - "items": { - "type": "string", - "description": [ - "Billboard log of significant changes." - ] - } - }, - "in_payments_offered": { - "type": "u64", - "description": [ - "Number of incoming payment attempts." - ] - }, - "in_offered_msat": { - "type": "msat", - "description": [ - "Total amount of incoming payment attempts." - ] - }, - "in_payments_fulfilled": { - "type": "u64", - "description": [ - "Number of successful incoming payment attempts." - ] - }, - "in_fulfilled_msat": { - "type": "msat", - "description": [ - "Total amount of successful incoming payment attempts." - ] - }, - "out_payments_offered": { - "type": "u64", - "description": [ - "Number of outgoing payment attempts." - ] - }, - "out_offered_msat": { - "type": "msat", - "description": [ - "Total amount of outgoing payment attempts." - ] - }, - "out_payments_fulfilled": { - "type": "u64", - "description": [ - "Number of successful outgoing payment attempts." - ] - }, - "out_fulfilled_msat": { - "type": "msat", - "description": [ - "Total amount of successful outgoing payment attempts." - ] - }, - "htlcs": { - "type": "array", - "description": [ - "Current HTLCs in this channel." - ], - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "direction", - "id", - "amount_msat", - "expiry", - "payment_hash", - "state" - ], - "properties": { - "direction": { - "type": "string", - "enum": [ - "in", - "out" - ], - "description": [ - "Whether it came from peer, or is going to peer." - ] - }, - "id": { - "type": "u64", - "description": [ - "Unique ID for this htlc on this channel in this direction." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "Amount send/received for this HTLC." - ] - }, - "expiry": { - "type": "u32", - "description": [ - "Block this HTLC expires at (after which an `in` direction HTLC will be returned to the peer, an `out` returned to us). If this expiry is too close, lightningd(8) will automatically unilaterally close the channel in order to enforce the timeout onchain." - ] - }, - "payment_hash": { - "type": "hash", - "description": [ - "The hash of the payment_preimage which will prove payment." - ] - }, - "local_trimmed": { - "type": "boolean", - "enum": [ - true - ], - "description": [ - "If this is too small to enforce onchain; it doesn't appear in the commitment transaction and will not be enforced in a unilateral close. Generally true if the HTLC (after subtracting onchain fees) is below the `dust_limit_msat` for the channel." - ] - }, - "status": { - "type": "string", - "description": [ - "Set if this HTLC is currently waiting on a hook (and shows what plugin)." - ] - } - }, - "allOf": [ - { - "if": { - "properties": { - "direction": { - "enum": [ - "out" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "state" - ], - "properties": { - "direction": {}, - "id": {}, - "amount_msat": {}, - "msatoshi": {}, - "expiry": {}, - "payment_hash": {}, - "local_trimmed": {}, - "status": {}, - "alias": {}, - "state": { - "type": "string", - "enum": [ - "SENT_ADD_HTLC", - "SENT_ADD_COMMIT", - "RCVD_ADD_REVOCATION", - "RCVD_ADD_ACK_COMMIT", - "SENT_ADD_ACK_REVOCATION", - "RCVD_REMOVE_HTLC", - "RCVD_REMOVE_COMMIT", - "SENT_REMOVE_REVOCATION", - "SENT_REMOVE_ACK_COMMIT", - "RCVD_REMOVE_ACK_REVOCATION" - ], - "description": [ - "Status of the HTLC." - ] - } - } - } - }, - { - "if": { - "properties": { - "direction": { - "enum": [ - "in" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "state" - ], - "properties": { - "direction": {}, - "id": {}, - "amount_msat": {}, - "msatoshi": {}, - "expiry": {}, - "payment_hash": {}, - "local_trimmed": {}, - "status": {}, - "state": { - "type": "string", - "enum": [ - "RCVD_ADD_HTLC", - "RCVD_ADD_COMMIT", - "SENT_ADD_REVOCATION", - "SENT_ADD_ACK_COMMIT", - "RCVD_ADD_ACK_REVOCATION", - "SENT_REMOVE_HTLC", - "SENT_REMOVE_COMMIT", - "RCVD_REMOVE_REVOCATION", - "RCVD_REMOVE_ACK_COMMIT", - "SENT_REMOVE_ACK_REVOCATION" - ], - "description": [ - "Status of the HTLC." - ] - } - } - } - } - ] - } - } - }, - "allOf": [ - { - "if": { - "required": [ - "close_to" - ] - }, - "then": { - "additionalProperties": false, - "required": [], - "properties": { - "state": {}, - "scratch_txid": {}, - "feerate": {}, - "owner": {}, - "short_channel_id": {}, - "channel_id": {}, - "funding_txid": {}, - "funding_outnum": {}, - "close_to": {}, - "private": {}, - "alias": {}, - "opener": {}, - "closer": {}, - "features": {}, - "funding": {}, - "to_us_msat": {}, - "min_to_us_msat": {}, - "max_to_us_msat": {}, - "total_msat": {}, - "fee_base_msat": {}, - "fee_proportional_millionths": {}, - "dust_limit_msat": {}, - "max_total_htlc_in_msat": {}, - "their_reserve_msat": {}, - "our_reserve_msat": {}, - "spendable_msat": {}, - "receivable_msat": {}, - "minimum_htlc_in_msat": {}, - "minimum_htlc_out_msat": {}, - "maximum_htlc_out_msat": {}, - "spendable_msatoshi": {}, - "receivable_msatoshi": {}, - "their_to_self_delay": {}, - "our_to_self_delay": {}, - "max_accepted_htlcs": {}, - "msatoshi_to_us": {}, - "msatoshi_to_us_min": {}, - "msatoshi_to_us_max": {}, - "msatoshi_total": {}, - "dust_limit_satoshis": {}, - "max_htlc_value_in_flight_msat": {}, - "our_channel_reserve_satoshis": {}, - "their_channel_reserve_satoshis": {}, - "spendable_satoshis": {}, - "receivable_satoshis": {}, - "htlc_minimum_msat": {}, - "state_changes": {}, - "status": {}, - "in_payments_offered": {}, - "in_offered_msat": {}, - "in_msatoshi_offered": {}, - "in_payments_fulfilled": {}, - "in_fulfilled_msat": {}, - "in_msatoshi_fulfilled": {}, - "out_payments_offered": {}, - "out_offered_msat": {}, - "out_msatoshi_offered": {}, - "out_payments_fulfilled": {}, - "out_fulfilled_msat": {}, - "out_msatoshi_fulfilled": {}, - "htlcs": {}, - "initial_feerate": {}, - "last_feerate": {}, - "next_feerate": {}, - "inflight": {}, - "last_tx_fee_msat": {}, - "direction": {}, - "close_to_addr": { - "type": "string", - "description": [ - "The bitcoin address we will close to (present if close_to_addr is a standardized address)." - ] - } - } - } - }, - { - "if": { - "required": [ - "scratch_txid" - ] - }, - "then": { - "additionalProperties": false, - "required": [ - "last_tx_fee_msat" - ], - "properties": { - "state": {}, - "alias": {}, - "scratch_txid": {}, - "feerate": {}, - "owner": {}, - "short_channel_id": {}, - "channel_id": {}, - "funding_txid": {}, - "funding_outnum": {}, - "inflight": {}, - "close_to": {}, - "private": {}, - "opener": {}, - "closer": {}, - "features": {}, - "funding": {}, - "to_us_msat": {}, - "min_to_us_msat": {}, - "max_to_us_msat": {}, - "total_msat": {}, - "fee_base_msat": {}, - "fee_proportional_millionths": {}, - "dust_limit_msat": {}, - "max_total_htlc_in_msat": {}, - "their_reserve_msat": {}, - "our_reserve_msat": {}, - "spendable_msat": {}, - "receivable_msat": {}, - "minimum_htlc_in_msat": {}, - "minimum_htlc_out_msat": {}, - "maximum_htlc_out_msat": {}, - "spendable_msatoshi": {}, - "receivable_msatoshi": {}, - "their_to_self_delay": {}, - "our_to_self_delay": {}, - "max_accepted_htlcs": {}, - "msatoshi_to_us": {}, - "msatoshi_to_us_min": {}, - "msatoshi_to_us_max": {}, - "msatoshi_total": {}, - "dust_limit_satoshis": {}, - "max_htlc_value_in_flight_msat": {}, - "our_channel_reserve_satoshis": {}, - "their_channel_reserve_satoshis": {}, - "spendable_satoshis": {}, - "receivable_satoshis": {}, - "htlc_minimum_msat": {}, - "state_changes": {}, - "status": {}, - "in_payments_offered": {}, - "in_offered_msat": {}, - "in_msatoshi_offered": {}, - "in_payments_fulfilled": {}, - "in_fulfilled_msat": {}, - "in_msatoshi_fulfilled": {}, - "out_payments_offered": {}, - "out_offered_msat": {}, - "out_msatoshi_offered": {}, - "out_payments_fulfilled": {}, - "out_fulfilled_msat": {}, - "out_msatoshi_fulfilled": {}, - "htlcs": {}, - "initial_feerate": {}, - "last_feerate": {}, - "next_feerate": {}, - "close_to_addr": {}, - "direction": {}, - "last_tx_fee_msat": { - "type": "msat", - "description": [ - "Fee attached to this the current tx." - ] - } - } - } - }, - { - "if": { - "required": [ - "short_channel_id" - ] - }, - "then": { - "additionalProperties": false, - "required": [ - "direction" - ], - "properties": { - "alias": {}, - "state": {}, - "scratch_txid": {}, - "feerate": {}, - "owner": {}, - "short_channel_id": {}, - "channel_id": {}, - "funding_txid": {}, - "funding_outnum": {}, - "inflight": {}, - "close_to": {}, - "private": {}, - "opener": {}, - "closer": {}, - "features": {}, - "funding": {}, - "to_us_msat": {}, - "min_to_us_msat": {}, - "max_to_us_msat": {}, - "total_msat": {}, - "fee_base_msat": {}, - "fee_proportional_millionths": {}, - "dust_limit_msat": {}, - "max_total_htlc_in_msat": {}, - "their_reserve_msat": {}, - "our_reserve_msat": {}, - "spendable_msat": {}, - "receivable_msat": {}, - "minimum_htlc_in_msat": {}, - "minimum_htlc_out_msat": {}, - "maximum_htlc_out_msat": {}, - "spendable_msatoshi": {}, - "receivable_msatoshi": {}, - "their_to_self_delay": {}, - "our_to_self_delay": {}, - "max_accepted_htlcs": {}, - "msatoshi_to_us": {}, - "msatoshi_to_us_min": {}, - "msatoshi_to_us_max": {}, - "msatoshi_total": {}, - "dust_limit_satoshis": {}, - "max_htlc_value_in_flight_msat": {}, - "our_channel_reserve_satoshis": {}, - "their_channel_reserve_satoshis": {}, - "spendable_satoshis": {}, - "receivable_satoshis": {}, - "htlc_minimum_msat": {}, - "state_changes": {}, - "status": {}, - "in_payments_offered": {}, - "in_offered_msat": {}, - "in_msatoshi_offered": {}, - "in_payments_fulfilled": {}, - "in_fulfilled_msat": {}, - "in_msatoshi_fulfilled": {}, - "out_payments_offered": {}, - "out_offered_msat": {}, - "out_msatoshi_offered": {}, - "out_payments_fulfilled": {}, - "out_fulfilled_msat": {}, - "out_msatoshi_fulfilled": {}, - "htlcs": {}, - "initial_feerate": {}, - "last_feerate": {}, - "next_feerate": {}, - "close_to_addr": {}, - "last_tx_fee_msat": {}, - "direction": { - "type": "u32", - "description": [ - "0 if we're the lesser node_id, 1 if we're the greater (as used in BOLT #7 channel_update)." - ] - } - } - } - }, - { - "if": { - "required": [ - "inflight" - ] - }, - "then": { - "additionalProperties": false, - "required": [ - "initial_feerate", - "last_feerate", - "next_feerate" - ], - "properties": { - "state": {}, - "scratch_txid": {}, - "feerate": {}, - "owner": {}, - "alias": {}, - "short_channel_id": {}, - "channel_id": {}, - "funding_txid": {}, - "funding_outnum": {}, - "close_to": {}, - "private": {}, - "opener": {}, - "closer": {}, - "features": {}, - "funding": {}, - "to_us_msat": {}, - "min_to_us_msat": {}, - "max_to_us_msat": {}, - "total_msat": {}, - "fee_base_msat": {}, - "fee_proportional_millionths": {}, - "dust_limit_msat": {}, - "max_total_htlc_in_msat": {}, - "their_reserve_msat": {}, - "our_reserve_msat": {}, - "spendable_msat": {}, - "receivable_msat": {}, - "minimum_htlc_in_msat": {}, - "minimum_htlc_out_msat": {}, - "maximum_htlc_out_msat": {}, - "spendable_msatoshi": {}, - "receivable_msatoshi": {}, - "their_to_self_delay": {}, - "our_to_self_delay": {}, - "max_accepted_htlcs": {}, - "msatoshi_to_us": {}, - "msatoshi_to_us_min": {}, - "msatoshi_to_us_max": {}, - "msatoshi_total": {}, - "dust_limit_satoshis": {}, - "max_htlc_value_in_flight_msat": {}, - "our_channel_reserve_satoshis": {}, - "their_channel_reserve_satoshis": {}, - "spendable_satoshis": {}, - "receivable_satoshis": {}, - "htlc_minimum_msat": {}, - "state_changes": {}, - "status": {}, - "in_payments_offered": {}, - "in_offered_msat": {}, - "in_msatoshi_offered": {}, - "in_payments_fulfilled": {}, - "in_fulfilled_msat": {}, - "in_msatoshi_fulfilled": {}, - "out_payments_offered": {}, - "out_offered_msat": {}, - "out_msatoshi_offered": {}, - "out_payments_fulfilled": {}, - "out_fulfilled_msat": {}, - "out_msatoshi_fulfilled": {}, - "htlcs": {}, - "inflight": {}, - "close_to_addr": {}, - "direction": {}, - "last_tx_fee_msat": {}, - "initial_feerate": { - "type": "string", - "description": [ - "The feerate for the initial funding transaction in per-1000-weight, with `kpw` appended." - ] - }, - "last_feerate": { - "type": "string", - "description": [ - "The feerate for the latest funding transaction in per-1000-weight, with `kpw` appended." - ] - }, - "next_feerate": { - "type": "string", - "description": [ - "The minimum feerate for the next funding transaction in per-1000-weight, with `kpw` appended." - ] - } - } - } - } + "type": "string", + "description": [ + "Source of configuration setting." ] } } }, - "allOf": [ - { - "if": { - "additionalProperties": true, - "properties": { - "connected": { - "enum": [ - true - ] - } - } + "alias": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] }, - "then": { - "additionalProperties": false, - "required": [ - "netaddr", - "features" - ], - "properties": { - "id": {}, - "channels": {}, - "connected": {}, - "num_channels": {}, - "htlcs": {}, - "log": {}, - "netaddr": { - "type": "array", - "minItems": 1, - "maxItems": 1, - "description": [ - "A single entry array." - ], - "items": { - "type": "string", - "description": [ - "Address, e.g. 1.2.3.4:1234." - ] - } - }, - "remote_addr": { - "type": "string", - "description": [ - "The public IPv4/6 address the peer sees us from, e.g. 1.2.3.4:1234." - ] - }, - "features": { - "type": "hex", - "description": [ - "Bitmap of BOLT #9 features from peer's INIT message." - ] - } - } + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] } } - ] - } - } - } - }, - "errors": [ - "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", - "", - "- -32602: If the given parameters are wrong." - ], - "example_json_request": [ - { - "id": "example:listpeers#1", - "method": "listpeers", - "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "level": null - } - }, - { - "id": "example:listpeers#2", - "method": "listpeers", - "params": { - "id": null, - "level": null - } - } - ], - "example_json_response": [ - { - "peers": [ - { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "connected": true, - "num_channels": 1, - "netaddr": [ - "127.0.0.1:44619" - ], - "features": "08a0000a0a69a2" - } - ] - }, - { - "peers": [ - { - "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "connected": true, - "num_channels": 1, - "netaddr": [ - "127.0.0.1:48862" - ], - "features": "08a0000a0a69a2" - } - ] - } - ], - "author": [ - "Michael Hawkins <>." - ], - "see_also": [ - "lightning-connect(7)", - "lightning-fundchannel_start(7)", - "lightning-setchannel(7)" - ], - "resources": [ - "Main web site: ", - "Lightning RFC site (BOLT #9):", - "" - ] - }, - "lightning-listsendpays.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "listsendpays", - "title": "Low-level command for querying sendpay status", - "description": [ - "The **listsendpays** RPC command gets the status of all *sendpay* commands (which is also used by the *pay* command), or with *bolt11* or *payment_hash* limits results to that specific payment. You cannot specify both. It is possible to filter the payments also by *status*.", - "", - "Note that there may be more than one concurrent *sendpay* command per *pay*, so this command should be used with caution." - ], - "request": { - "required": [], - "properties": { - "bolt11": { - "type": "string", - "description": [ - "Bolt11 invoice." - ] - }, - "payment_hash": { - "type": "hash", - "description": [ - "The hash of the payment_preimage." - ] - }, - "status": { - "type": "string", - "enum": [ - "pending", - "complete", - "failed" - ], - "description": [ - "Whether the invoice has been paid, pending, or failed." - ] - }, - "index": { - "type": "string", - "added": "v23.11", - "enum": [ - "created", - "updated" - ], - "description": [ - "If neither bolt11 or payment_hash is specified, `index` controls ordering, by `created` (default) or `updated`." - ] - }, - "start": { - "type": "u64", - "added": "v23.11", - "description": [ - "If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)." - ] - }, - "limit": { - "type": "u32", - "added": "v23.11", - "description": [ - "If `index` is specified, `limit` can be used to specify the maximum number of entries to return." - ] - } - }, - "dependentUpon": { - "index": [ - "start", - "limit" - ] - } - }, - "response": { - "required": [ - "payments" - ], - "properties": { - "payments": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "id", - "created_index", - "payment_hash", - "status", - "groupid", - "created_at", - "amount_sent_msat" - ], - "properties": { - "created_index": { - "added": "v23.11", - "type": "u64", - "description": [ - "1-based index indicating order this payment was created in." - ] - }, - "id": { - "type": "u64", - "description": [ - "Old synonym for created_index." - ] - }, - "groupid": { - "type": "u64", - "description": [ - "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." - ] - }, - "partid": { - "type": "u64", - "description": [ - "Part number (for multiple parts to a single payment)." - ] - }, - "payment_hash": { - "type": "hash", - "description": [ - "The hash of the *payment_preimage* which will prove payment." - ] - }, - "updated_index": { - "added": "v23.11", - "type": "u64", - "description": [ - "1-based index indicating order this payment was changed (only present if it has changed since creation)." - ] - }, - "status": { - "type": "string", - "enum": [ - "pending", - "failed", - "complete" - ], - "description": [ - "Status of the payment." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "The amount delivered to destination (if known)." - ] - }, - "destination": { - "type": "pubkey", - "description": [ - "The final destination of the payment if known." - ] - }, - "created_at": { - "type": "u64", - "description": [ - "The UNIX timestamp showing when this payment was initiated." - ] - }, - "amount_sent_msat": { - "type": "msat", - "description": [ - "The amount sent." - ] - }, - "label": { - "type": "string", - "description": [ - "The label, if given to sendpay." - ] - }, - "bolt11": { - "type": "string", - "description": [ - "The bolt11 string (if pay supplied one)." - ] - }, - "description": { - "type": "string", - "description": [ - "The description matching the bolt11 description hash (if pay supplied one)." - ] - }, - "bolt12": { - "type": "string", - "description": [ - "The bolt12 string (if supplied for pay: **experimental-offers** only)." - ] + }, + "pid-file": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "ignore-fee-limits": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_bool", + "source" + ], + "properties": { + "value_bool": { + "type": "boolean", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "watchtime-blocks": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "max-locktime-blocks": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "funding-confirms": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "cltv-delta": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "cltv-final": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "commit-time": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "fee-base": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } } }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "complete" - ] - } - } + "rescan": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "integer", + "description": [ + "Field from config or cmdline, or default." + ] }, - "then": { - "additionalProperties": false, - "required": [ - "payment_preimage" + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "fee-per-satoshi": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "max-concurrent-htlcs": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "htlc-minimum-msat": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_msat", + "source" + ], + "properties": { + "value_msat": { + "type": "msat", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "htlc-maximum-msat": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_msat", + "source" + ], + "properties": { + "value_msat": { + "type": "msat", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "max-dust-htlc-exposure-msat": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_msat", + "source" + ], + "properties": { + "value_msat": { + "type": "msat", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "min-capacity-sat": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u64", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + }, + "dynamic": { + "type": "boolean", + "enum": [ + true ], - "properties": { - "id": {}, - "created_index": {}, - "updated_index": {}, - "partid": {}, - "groupid": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "destination": {}, - "created_at": {}, - "msatoshi_sent": {}, - "amount_sent_msat": {}, - "label": {}, - "bolt11": {}, - "description": {}, - "bolt12": {}, - "completed_at": { - "type": "u64", - "added": "pre-v0.10.1", - "description": [ - "The UNIX timestamp showing when this payment was completed." - ] - }, - "payment_preimage": { - "type": "secret", - "description": [ - "The proof of payment: SHA256 of this **payment_hash**." - ] - } - } + "description": [ + "Can this be set by setconfig()." + ] } - }, - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "failed" - ] - } + } + }, + "addr": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] } }, - "then": { - "additionalProperties": false, - "required": [], - "properties": { - "id": {}, - "created_index": {}, - "updated_index": {}, - "partid": {}, - "groupid": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "destination": {}, - "created_at": {}, - "completed_at": {}, - "msatoshi_sent": {}, - "amount_sent_msat": {}, - "label": {}, - "bolt11": {}, - "description": {}, - "bolt12": {}, - "erroronion": { - "type": "hex", - "description": [ - "The onion message returned." - ] - } + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] } } - }, - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "pending" - ] - } + } + }, + "announce-addr": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] } }, - "then": { - "additionalProperties": false, - "required": [], - "properties": { - "id": {}, - "created_index": {}, - "updated_index": {}, - "partid": {}, - "groupid": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "destination": {}, - "created_at": {}, - "msatoshi_sent": {}, - "amount_sent_msat": {}, - "label": {}, - "bolt11": {}, - "description": {}, - "bolt12": {} + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] } } } - ] - } - } - }, - "pre_return_value_notes": [ - "Note that the returned array is ordered by increasing *id*." - ] - }, - "example_json_request": [ - { - "id": "example:listsendpays#1", - "method": "listsendpays", - "params": { - "bolt11": null, - "payment_hash": null, - "status": null, - "index": null, - "start": null, - "limit": null - } - }, - { - "id": "example:listsendpays#2", - "method": "listsendpays", - "params": { - "bolt11": "lnbcrt1230n1pja03q9sp5xu9aypccf3n6vld2waxcysy47ct2wl5x5adtm7k8u30knqes22lspp5duw2v8csh0zh4xg9ql3amem98avlkc2ecre99tgmr2340amf9kmsdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqwh78s8wqg0kepspw0epcxmxteh5wu8n6ddlwdnyj758fqxpqk8ejf597x8ju3r32xqgae3yzjjz9e5s6l2vs5zxvkayhmemmx74wvyqqyqf8c9", - "payment_hash": null, - "status": null, - "index": null, - "start": null, - "limit": null - } - } - ], - "example_json_response": [ - { - "payments": [ - { - "created_index": 1, - "id": 1, - "payment_hash": "e3b43574acd074b0c4ba1b13b5155ff5f9c76742e643ed003e17301c5a2db149", - "groupid": 1, - "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "amount_msat": 20000, - "amount_sent_msat": 20000, - "created_at": 1706225269, - "status": "pending", - "bolt11": "lnbcrt200n1pjm9mn5sp5gq84lgga959m6gg4g0kj29ypwjaxxnm4cu5csymq8p6nqxv800mspp5uw6r2a9v6p6tp396rvfm292l7huuwe6zuep76qp7zucpck3dk9ysdpqf9grgmt62fmk5stswefh23n2tpykvcmzxqyjw5qcqp99qxpqysgqz8s496zmwed278jvp075zlhrnj0ncg45kcfw5s2lkhtxd3wc39f8wflp5gmd827dk470xpasfpx0azsfu0k8ttwae7620h8d050w28cqan776g" - }, - { - "created_index": 2, - "id": 2, - "payment_hash": "f55d92cfe019b5a015f5e5956e9255053cda14786171d5002feb12ae5254e5a5", - "groupid": 1, - "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "amount_msat": 30000, - "amount_sent_msat": 30000, - "created_at": 1706225269, - "status": "pending", - "bolt11": "lnbcrt300n1pjm9mn5sp5zqfkr93rp92mdyj6m8lzpcu90rfefcaqff8fxdd2sc5mace23ujspp574we9nlqrx66q904uk2kayj4q57d59rcv9ca2qp0avf2u5j5ukjsdpq29j55nfcgfcnsvzw2er57knhwcmhzwt0xqyjw5qcqp99qxpqysgq76p2jpnegtzlxmn0aqt6d3f89q4p6y5v3v2qz7t2mm6xt90nt324cq400tl82k28562aux8jxs57d603g7s0q4g3dapu9a7vln94j7spsut799" - } - ] - }, - { - "payments": [ - { - "created_index": 1, - "id": 1, - "payment_hash": "6f1ca61f10bbc57a990507e3dde7653f59fb6159c0f252ad1b1aa357f7692db7", - "groupid": 1, - "updated_index": 1, - "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "amount_msat": 123000, - "amount_sent_msat": 123000, - "created_at": 1708639237, - "completed_at": 1708639238, - "status": "complete", - "payment_preimage": "91f8366681fdfd309c048082fcde81a79116f85a7b2dd09aef1e34f5f7c3397b", - "bolt11": "lnbcrt1230n1pja03q9sp5xu9aypccf3n6vld2waxcysy47ct2wl5x5adtm7k8u30knqes22lspp5duw2v8csh0zh4xg9ql3amem98avlkc2ecre99tgmr2340amf9kmsdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqwh78s8wqg0kepspw0epcxmxteh5wu8n6ddlwdnyj758fqxpqk8ejf597x8ju3r32xqgae3yzjjz9e5s6l2vs5zxvkayhmemmx74wvyqqyqf8c9" - } - ] - } - ], - "author": [ - "Christian Decker <> is mainly responsible." - ], - "see_also": [ - "lightning-listpays(7)", - "lightning-sendpay(7)", - "lightning-listinvoice(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-listsqlschemas.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "added": "v23.02", - "rpc": "listsqlschemas", - "title": "Command to example lightning-sql schemas", - "description": [ - "This allows you to examine the schemas at runtime; while they are fully documented for the current release in lightning-sql(7), as fields are added or deprecated, you can use this command to determine what fields are present.", - "", - "If *table* is given, only that table is in the resulting list, otherwise all tables are listed." - ], - "request": { - "required": [], - "properties": { - "table": { - "type": "string" - } - } - }, - "response": { - "required": [ - "schemas" - ], - "properties": { - "schemas": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "tablename", - "columns" - ], - "properties": { - "tablename": { - "type": "string", - "description": [ - "The name of the table." - ] - }, - "columns": { - "type": "array", - "description": [ - "The columns, in database order." - ], - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "name", - "type" - ], - "properties": { - "name": { - "type": "string", - "description": [ - "The name of the column." - ] - }, - "type": { - "type": "string", - "enum": [ - "INTEGER", - "BLOB", - "TEXT", - "REAL" - ], - "description": [ - "The SQL type of the column." - ] - } + }, + "bind-addr": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] } - } - }, - "indices": { - "type": "array", - "description": [ - "Any index we created to speed lookups." - ], - "items": { + }, + "sources": { "type": "array", - "description": [ - "The columns for this index." - ], "items": { "type": "string", "description": [ - "The column name." + "Source of configuration setting." ] } } } - } - } - } - } - }, - "example_json_request": [ - { - "id": "example:listsqlschemas#1", - "method": "listsqlschemas", - "params": { - "table": "offers" - } - }, - { - "id": "example:listsqlschemas#2", - "method": "listsqlschemas", - "params": [ - "closedchannels" - ] - } - ], - "example_json_response": [ - { - "schemas": [ - { - "tablename": "offers", - "columns": [ - { - "name": "offer_id", - "type": "BLOB" - }, - { - "name": "active", - "type": "INTEGER" - }, - { - "name": "single_use", - "type": "INTEGER" - }, - { - "name": "bolt12", - "type": "TEXT" - }, - { - "name": "bolt12_unsigned", - "type": "TEXT" - }, - { - "name": "used", - "type": "INTEGER" - }, - { - "name": "label", - "type": "TEXT" + }, + "offline": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } } - ], - "indices": [ - [ - "offer_id" - ] - ] - } - ] - }, - { - "schemas": [ - { - "tablename": "closedchannels", - "columns": [ - { - "name": "rowid", - "type": "INTEGER" - }, - { - "name": "peer_id", - "type": "BLOB" - }, - { - "name": "channel_id", - "type": "BLOB" - }, - { - "name": "short_channel_id", - "type": "TEXT" - }, - { - "name": "alias_local", - "type": "TEXT" - }, - { - "name": "alias_remote", - "type": "TEXT" - }, - { - "name": "opener", - "type": "TEXT" - }, - { - "name": "closer", - "type": "TEXT" - }, - { - "name": "private", - "type": "INTEGER" - }, - { - "name": "total_local_commitments", - "type": "INTEGER" - }, - { - "name": "total_remote_commitments", - "type": "INTEGER" - }, - { - "name": "total_htlcs_sent", - "type": "INTEGER" - }, - { - "name": "funding_txid", - "type": "BLOB" - }, - { - "name": "funding_outnum", - "type": "INTEGER" - }, - { - "name": "leased", - "type": "INTEGER" - }, - { - "name": "funding_fee_paid_msat", - "type": "INTEGER" - }, - { - "name": "funding_fee_rcvd_msat", - "type": "INTEGER" - }, - { - "name": "funding_pushed_msat", - "type": "INTEGER" - }, - { - "name": "total_msat", - "type": "INTEGER" - }, - { - "name": "final_to_us_msat", - "type": "INTEGER" - }, - { - "name": "min_to_us_msat", - "type": "INTEGER" - }, - { - "name": "max_to_us_msat", - "type": "INTEGER" - }, - { - "name": "last_commitment_txid", - "type": "BLOB" - }, - { - "name": "last_commitment_fee_msat", - "type": "INTEGER" - }, - { - "name": "close_cause", - "type": "TEXT" + }, + "autolisten": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_bool", + "source" + ], + "properties": { + "value_bool": { + "type": "boolean", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } } - ] - } - ] - } - ], - "author": [ - "Rusty Russell <> is mainly responsible." - ], - "see_also": [ - "lightning-sql(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-listtransactions.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "listtransactions", - "title": "Command to get the list of transactions that was stored in the wallet.", - "description": [ - "The **listtransactions** command returns transactions tracked in the wallet. This includes deposits, withdrawals and transactions related to channels. A transaction may have multiple types, e.g., a transaction may both be a close and a deposit if it closes the channel and returns funds to the wallet." - ], - "request": { - "required": [], - "properties": {} - }, - "response": { - "required": [ - "transactions" - ], - "properties": { - "transactions": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "hash", - "rawtx", - "blockheight", - "txindex", - "locktime", - "version", - "inputs", - "outputs" - ], - "properties": { - "hash": { - "type": "txid", - "description": [ - "The transaction id." - ] - }, - "rawtx": { - "type": "hex", - "description": [ - "The raw transaction." - ] - }, - "blockheight": { - "type": "u32", - "description": [ - "The block height of this tx." - ] - }, - "txindex": { - "type": "u32", - "description": [ - "The transaction number within the block." - ] - }, - "locktime": { - "type": "u32", - "description": [ - "The nLocktime for this tx." - ] - }, - "version": { - "type": "u32", - "description": [ - "The nVersion for this tx." - ] - }, - "inputs": { - "type": "array", - "description": [ - "Each input, in order." - ], - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "txid", - "index", - "sequence" + }, + "proxy": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "disable-dns": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "announce-addr-discovered": { + "added": "v23.02", + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "enum": [ + "true", + "false", + "auto" ], - "properties": { - "txid": { - "type": "txid", - "description": [ - "The transaction id spent." - ] - }, - "index": { - "type": "u32", - "description": [ - "The output spent." - ] - }, - "sequence": { - "type": "u32", - "description": [ - "The nSequence value." - ] - } + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "announce-addr-discovered-port": { + "added": "v23.02", + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "encrypted-hsm": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "rpc-file-mode": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "log-level": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "log-prefix": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "log-file": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] + } + }, + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] } } - }, - "outputs": { - "type": "array", - "description": [ - "Each output, in order." - ], - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "index", - "amount_msat", - "scriptPubKey" - ], - "properties": { - "index": { - "type": "u32", - "description": [ - "The 0-based output number." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "The amount of the output." - ] - }, - "scriptPubKey": { - "type": "hex", - "description": [ - "The scriptPubKey." - ] - } + } + }, + "log-timestamps": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_bool", + "source" + ], + "properties": { + "value_bool": { + "type": "boolean", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "force-feerates": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "subdaemon": { + "type": "object", + "additionalProperties": false, + "required": [ + "values_str", + "sources" + ], + "properties": { + "values_str": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Field from config or cmdline." + ] + } + }, + "sources": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Source of configuration setting." + ] } } } - } - } - } - } - }, - "example_json_request": [ - { - "id": "example:listtransactions#1", - "method": "listtransactions", - "params": {} - } - ], - "errors": [ - "On failure, one of the following error codes may be returned:", - "", - "- -32602: Error in given parameters." - ], - "example_json_response": [ - { - "transactions": [ - { - "hash": "05985072bbe20747325e69a159fe08176cc1bbc96d25e8848edad2dddc1165d0", - "rawtx": "02000000027032912651fc25a3e0893acd5f9640598707e2dfef92143bb5a4020e335442800100000017160014a5f48b9aa3cb8ca6cc1040c11e386745bb4dc932ffffffffd229a4b4f78638ebcac10a68b0561585a5d6e4d3b769ad0a909e9b9afaeae24e00000000171600145c83da9b685f9142016c6f5eb5f98a45cfa6f686ffffffff01915a01000000000017a9143a4dfd59e781f9c3018e7d0a9b7a26d58f8d22bf8700000000", - "blockheight": 0, - "txindex": 0, - "locktime": 0, - "version": 2, - "inputs": [ - { - "txid": "804254330e02a4b53b1492efdfe207875940965fcd3a89e0a325fc5126913270", - "index": 1, - "sequence": 4294967295 - }, - { - "txid": "4ee2eafa9a9b9e900aad69b7d3e4d6a5851556b0680ac1caeb3886f7b4a429d2", - "index": 0, - "sequence": 4294967295 + }, + "fetchinvoice-noconnect": { + "type": "object", + "additionalProperties": false, + "required": [ + "set", + "source" + ], + "properties": { + "set": { + "type": "boolean", + "description": [ + "`true` if set in config or cmdline." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } } - ], - "outputs": [ - { - "index": 0, - "satoshis": "88721000msat", - "scriptPubKey": "a9143a4dfd59e781f9c3018e7d0a9b7a26d58f8d22bf87" + }, + "accept-htlc-tlv-types": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } } - ] - } - ] - } - ], - "author": [ - "Vincenzo Palazzo <> wrote the initial version of this man page,", - "but many others did the hard work of actually implementing this rpc command." - ], - "see_also": [ - "lightning-newaddr(7)", - "lightning-listfunds(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-makesecret.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "makesecret", - "title": "Command for deriving pseudorandom key from HSM", - "description": [ - "The **makesecret** RPC command derives a secret key from the HSM_secret." - ], - "request": { - "required": [], - "properties": { - "hex": { - "type": "hex", - "description": [ - "One of `hex` or `string` must be specified: `hex` can be any hex data." - ] - }, - "string": { - "type": "string", - "description": [ - "One of `hex` or `string` must be specified: `string` is a UTF-8 string interpreted literally." - ] - } - } - }, - "response": { - "required": [ - "secret" - ], - "properties": { - "secret": { - "type": "secret", - "description": [ - "The pseudorandom key derived from HSM_secret." - ] - } - } - }, - "errors": [ - "The following error codes may occur:", - "", - "- -1: Catchall nonspecific error." - ], - "example_json_request": [ - { - "id": "example:makesecret#1", - "method": "makesecret", - "params": [ - "73636220736563726574" - ] - }, - { - "id": "example:makesecret#2", - "method": "makesecret", - "params": [ - null, - "scb secret" - ] - } - ], - "example_json_response": [ - { - "secret": "a9a2e742405c28f059349132923a99337ae7f71168b7485496e3365f5bc664ed" - }, - { - "secret": "a9a2e742405c28f059349132923a99337ae7f71168b7485496e3365f5bc664ed" - } - ], - "author": [ - "Aditya <> is mainly responsible." - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-multifundchannel.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "multifundchannel", - "title": "Command for establishing many lightning channels", - "description": [ - "The **multifundchannel** RPC command opens multiple payment channels with nodes by committing a single funding transaction to the blockchain that is shared by all channels.", - "", - "If not already connected, **multifundchannel** will automatically attempt to connect; you may provide a *@host:port* hint appended to the node ID so that Core Lightning can learn how to connect to the node; see lightning-connect(7).", - "", - "Once the transaction is confirmed, normal channel operations may begin. Readiness is indicated by **listpeers** reporting a *state* of `CHANNELD_NORMAL` for the channel." - ], - "request": { - "required": [ - "destinations" - ], - "properties": { - "destinations": { - "type": "array", - "description": [ - "There must be at least one entry in *destinations*; it cannot be an empty array." - ], - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "amount" - ], - "properties": { - "id": { - "type": "string", - "description": [ - "Node ID, with an optional *@host:port* appended to it in a manner understood by **connect**; see lightning-connect(7). Each entry in the *destinations* array must have a unique node *id*. If not already connected, **multifundchannel** will automatically attempt to connect to the node." - ] - }, - "amount": { - "type": "msat", - "description": [ - "Amount in satoshis taken from the internal wallet to fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). The string *all* can be used to specify all available funds (or 16,777,215 satoshi if more is available and large channels were not negotiated with the peer). Otherwise it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The value cannot be less than the dust limit, currently 546 satoshi as of this writing, nor more than 16,777,215 satoshi (unless large channels were negotiated with the peer)." - ] - }, - "announce": { - "type": "boolean", - "description": [ - "Flag that indicates whether to announce the channel with this. If set to `False`, the channel is unpublished." - ], - "default": "`True`" - }, - "push_msat": { - "type": "msat", - "description": [ - "Amount of millisatoshis to outright give to the node. This is a gift to the peer, and you do not get a proof-of-payment out of this." - ] - }, - "close_to": { - "type": "string", - "description": [ - "Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script` Returns `close_to` set to closing script iff is negotiated." - ] - }, - "request_amt": { - "type": "msat", - "description": [ - "Amount of liquidity you'd like to lease from peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*." - ] - }, - "compact_lease": { - "type": "string", - "description": [ - "Compact representation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel to this destination." - ] - }, - "mindepth": { - "type": "u32", - "description": [ - "Number of confirmations before we consider the channel active." - ] - }, - "reserve": { - "type": "msat", - "description": [ - "Amount we want the peer to maintain on its side of the channel. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*." - ], - "default": "1% of the funding amount" + }, + "tor-service-password": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_str", + "source" + ], + "properties": { + "value_str": { + "type": "string", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "announce-addr-dns": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_bool", + "source" + ], + "properties": { + "value_bool": { + "type": "boolean", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "require-confirmed-inputs": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_bool", + "source" + ], + "properties": { + "value_bool": { + "type": "boolean", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "commit-fee": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u64", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } + } + }, + "commit-feerate-offset": { + "type": "object", + "additionalProperties": false, + "required": [ + "value_int", + "source" + ], + "properties": { + "value_int": { + "type": "u32", + "description": [ + "Field from config or cmdline, or default." + ] + }, + "source": { + "type": "string", + "description": [ + "Source of configuration setting." + ] + } } } } }, - "feerate": { - "type": "feerate", - "description": [ - "Feerate used for the opening transaction, and if *commitment_feerate* is not set, as initial feerate for commitment and HTLC transactions. See NOTES in lightning-feerates(7) for possible values." - ], - "default": "*normal*" - }, - "minconf": { - "type": "integer", - "description": [ - "Minimum number of confirmations that used outputs should have." + "# version": { + "deprecated": [ + "v23.08", + "v24.02" ], - "default": 1 - }, - "utxos": { - "type": "array", - "items": { - "type": "outpoint", - "description": [ - "Utxos to be used to fund the channel, as an array of `txid:vout`." - ] - } - }, - "minchannels": { - "type": "integer", - "description": [ - "Re-attempt funding as long as at least this many peers remain (must not be zero). The **multifundchannel** command will only fail if too many peers fail the funding process." - ] - }, - "commitment_feerate": { - "type": "feerate", - "description": [ - "Initial feerate for commitment and HTLC transactions. See *feerate* for valid values." - ] - } - } - }, - "response": { - "required": [ - "tx", - "txid", - "channel_ids" - ], - "properties": { - "tx": { - "type": "hex", - "description": [ - "The raw transaction which funded the channel." - ] - }, - "txid": { - "type": "txid", + "type": "string", "description": [ - "The txid of the transaction which funded the channel." + "Special field indicating the current version." ] }, - "channel_ids": { + "plugins": { "type": "array", + "deprecated": [ + "v23.08", + "v24.02" + ], "items": { "type": "object", "additionalProperties": false, "required": [ - "id", - "channel_id", - "channel_type", - "outnum" + "path", + "name" + ], + "description": [ + "`plugin` field from config or cmdline." ], "properties": { - "id": { - "type": "pubkey", - "description": [ - "The peer we opened the channel with." - ] - }, - "outnum": { - "type": "u32", + "path": { + "type": "string", "description": [ - "The 0-based output index showing which output funded the channel." + "Full path of the plugin." ] }, - "channel_id": { - "type": "hash", + "name": { + "type": "string", "description": [ - "The channel_id of the resulting channel." + "Short name of the plugin." ] }, - "channel_type": { + "options": { "type": "object", + "additionalProperties": true, + "required": [], "description": [ - "Channel_type as negotiated with peer." - ], - "added": "v24.02", - "additionalProperties": false, - "required": [ - "bits", - "names" + "Specific options set for this plugin." ], - "properties": { - "bits": { - "type": "array", - "description": [ - "Each bit set in this channel_type." - ], - "added": "v24.02", - "items": { - "type": "u32", - "description": [ - "Bit number." - ] - } - }, - "names": { - "type": "array", - "description": [ - "Feature name for each bit set in this channel_type." - ], - "added": "v24.02", - "items": { - "type": "string", - "enum": [ - "static_remotekey/even", - "anchor_outputs/even", - "anchors_zero_fee_htlc_tx/even", - "scid_alias/even", - "zeroconf/even" - ], - "description": [ - "Name of feature bit." - ] - } - } - } - }, - "close_to": { - "type": "hex", - "description": [ - "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`." - ] + "properties": {} } } } }, - "failed": { + "important-plugins": { "type": "array", - "description": [ - "Any peers we failed to open with (if *minchannels* was specified less than the number of destinations)." + "deprecated": [ + "v23.08", + "v24.02" ], "items": { "type": "object", "additionalProperties": false, "required": [ - "id", - "method", - "error" + "path", + "name" + ], + "description": [ + "`important-plugin` field from config or cmdline, or built-in." ], "properties": { - "id": { - "type": "pubkey", + "path": { + "type": "string", "description": [ - "The peer we failed to open the channel with." + "Full path of the plugin." ] }, - "method": { + "name": { "type": "string", - "enum": [ - "connect", - "openchannel_init", - "fundchannel_start", - "fundchannel_complete" - ], "description": [ - "What stage we failed at." + "Short name of the plugin." ] }, - "error": { + "options": { "type": "object", - "additionalProperties": false, - "required": [ - "code", - "message" + "additionalProperties": true, + "required": [], + "description": [ + "Specific options set for this plugin." ], - "properties": { - "code": { - "type": "integer", - "description": [ - "JSON error code from failing stage." - ] - }, - "message": { - "type": "string", - "description": [ - "Message from stage." - ] - }, - "data": { - "untyped": true, - "description": [ - "Additional error data." - ] - } - } + "properties": {} } } } - } - }, - "pre_return_value_notes": [ - "This command opens multiple channels with a single large transaction, thus only one transaction is returned.", - "", - "If *minchannels* was specified and is less than the number of destinations, then it is possible that one or more of the destinations do not have a channel even if **multifundchannel** succeeded." - ], - "post_return_value_notes": [ - "On failure, none of the channels are created." - ] - }, - "errors": [ - "The following error codes may occur:", - "", - "- -1: Catchall nonspecific error.", - "- 300: The maximum allowed funding amount is exceeded.", - "- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.", - "- 302: The output amount is too small, and would be considered dust.", - "- 303: Broadcasting of the funding transaction failed, the internal call to bitcoin-cli returned with an error.", - "- 313: The `min-emergency-msat` reserve not be preserved (and we have or are opening anchor channels).", - "", - "Failure may also occur if **lightningd** and the peer cannot agree on channel parameters (funding limits, channel reserves, fees, etc.). See lightning-fundchannel_start(7) and lightning-fundchannel_complete(7).", - "", - "There may be rare edge cases where a communications failure later in the channel funding process will cancel the funding locally, but the peer thinks the channel is already waiting for funding lockin. In that case, the next time we connect to the peer, our node will tell the peer to forget the channel, but some nodes (in particular, Core Lightning nodes) will disconnect when our node tells them to forget the channel. If you immediately **multifundchannel** with that peer, it could trigger this connect-forget-disconnect behavior, causing the second **multifundchannel** to fail as well due to disconnection. Doing a **connect** with the peers separately, and waiting for a few seconds, should help clear this hurdle; running **multifundchannel** a third time would also clear this." - ], - "example_usage": [ - "This example opens three channels at once, with amounts 200,000 sats, 3,000,000 sats and the final channel using all remaining funds (actually, capped at 16,777,215 sats because large-channels is not enabled):", - "", - "```shell", - "$ lightning-cli multifundchannel '[{\"id\":\"0201f42e167959c74d396ac57652fcea63c63940f78e8239cce5720df4d85ef857@127.0.0.1:7272\", \"amount\":\"200000sat\"}, {\"id\":\"0304a2468065535f9459567686e0f02b40f06e341d3eb2a62ec6763bcf2ccfd207@127.0.0.1:7373\", \"amount\":\"0.03btc\"}, {\"id\":\"0391f4c475050bb15871da5a72b1f3a1798de3d2e5fb4ffa262899b8d8e1f0b764@127.0.0.1:7474\", \"amount\":\"all\"}]'", - "{", - " \"tx\": \"02000000000101fbe3c68db87b72f82c3f5447b0bc032469c78e71f229ac99c230807ff378a9d80000000000fdffffff04400d0300000000002200202e9897ed5f9b237aa27fd5d02d24157cd452b0d3f0a5bb03d38ff73f9f8f384bffffff0000000000220020439d797ada249e1e12f8d27cabb7330de3c8de0456fb54892deb7b9c72b0ff7c1dc9b50400000000225120046e3966a2d5e43c1f1e0676161905782e1e7c00811485c618f5144f328f4e2bc0c62d0000000000220020e36fd5c03c3586c3763d8b4c9d8650f396ff1c8a460137fb09b60ee82536a3b20140ea4d564e91c919b50a2d32886f1d414de773491119beb1364b92f15d6d03e1810e5ddea89c265e42f2e96bb028dfb3aa0b5b30072ddcc78daad727503c53e37fa9010000\",", - " \"txid\": \"90dc53922b70628fc9e7804ad0b8cd0fb41f050d94ffa2db3b16e918c96c022a\",", - " \"channel_ids\": [", - " {", - " \"id\": \"0201f42e167959c74d396ac57652fcea63c63940f78e8239cce5720df4d85ef857\",", - " \"channel_id\": \"25c8253e66a860d17916cc0c21386e310eba9900030a68ec6ff6f59a8401a872\",", - " \"outnum\": 0", - " },", - " {", - " \"id\": \"0304a2468065535f9459567686e0f02b40f06e341d3eb2a62ec6763bcf2ccfd207\",", - " \"channel_id\": \"51749d724892a406896f6bf2e2f8c0b03399d0436691f294839897fa167e6521\",", - " \"outnum\": 3", - " },", - " {", - " \"id\": \"0391f4c475050bb15871da5a72b1f3a1798de3d2e5fb4ffa262899b8d8e1f0b764\",", - " \"channel_id\": \"7e1414e72c081f0754fa18c1657cedabe696aa9ffeaf0b936bfbe3a28f2829d1\",", - " \"outnum\": 1", - " }", - " ],", - " \"failed\": []", - "}", - "```" - ], - "example_json_request": [ - { - "id": "example:multifundchannel#1", - "method": "multifundchannel", - "params": { - "destinations": [ - { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59@localhost:41939", - "amount": 50000 - } + }, + "conf": { + "deprecated": [ + "v23.08", + "v24.02" ], - "feerate": "10000perkw", - "minconf": null, - "utxos": null, - "minchannels": null, - "commitment_feerate": "2000perkw" - } - }, - { - "id": "example:multifundchannel#2", - "method": "multifundchannel", - "params": { - "destinations": [ - { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59@localhost:44663", - "amount": 50000 - }, - { - "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d@localhost:34631", - "amount": 50000 - }, - { - "id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199@localhost:34617", - "amount": 50000 - } + "type": "string", + "description": [ + "`conf` field from cmdline, or default." + ] + }, + "lightning-dir": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`lightning-dir` field from config or cmdline, or default." + ] + }, + "network": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`network` field from config or cmdline, or default." + ] + }, + "allow-deprecated-apis": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`allow-deprecated-apis` field from config or cmdline, or default." + ] + }, + "rpc-file": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`rpc-file` field from config or cmdline, or default." + ] + }, + "disable-plugin": { + "deprecated": [ + "v23.08", + "v24.02" ], - "feerate": null, - "minconf": null, - "utxos": null, - "minchannels": 1 - } - } - ], - "example_json_response": [ - { - "tx": "0200000000010100a8ceb6f76c49c8c0c809ca359461540708a9a5ac56e56e6a7aaafb35f4d3850000000000fdffffff0250c30000000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd0623ff030000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a02473044022064763837f2cc84507eb1fc28c9e95d51174e1da4b8755da8e67fe21e37d0a8b402206295d0f19625f014819361a20572b936d81f6c5ba419e56997e882f3a7be094a012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000", - "txid": "ecba36e93bcf40542d43a05ef550bb0e4be51d766aa2ec8c5640a0d431ab0d06", - "channel_ids": [ - { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "channel_id": "060dab31d4a040568ceca26a761de54b0ebb50f55ea0432d5440cf3be936baec", - "channel_type": { - "bits": [ - 12 - ], - "names": [ - "static_remotekey/even" - ] - }, - "outnum": 0 - } - ], - "failed": [] - }, - { - "tx": "020000000001023041611dac05004825ab64781b4a33bf622380bf90196fae689196b1850a1f8f0000000000fdffffff5646519c565466c9588a88400ec71a39a2c0b6988beadb32491a13d9b89f85360100000000fdffffff0250c3000000000000220020181492c29a989f099fd2cf412c74b192dd095e81f4e4f6bec45bd1fbfdd2cfd983720000000000002251203e8a03f678bb7ca048baecc39788530560ea049816d604f72925e425288446c80140caa3b93c6667e4fe0026417cc87ae9dfd16d80018e7c6dcd6dfcee4d6cab7c7e84181baeb95ba25934ad1aa6b57f83c8287bf1b727123350b35549a3abe15b060140b3c6626b9b57081cc7eb5e4f518669764d265fb84316d8fb610e19ede13c5a370c1072861b909ec923acec980adb4a3e488ee3c6f9c49164bd4596945b52f62678000000", - "txid": "1fcc6d46200443ad21e3a1a1628b862bafd0d75c0b4454f5494957097bc7930d", - "channel_ids": [ - { - "id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", - "channel_id": "0d93c77b09574949f554440b5cd7d0af2b868b62a1a1e321ad430420466dcc1f", - "channel_type": { - "bits": [ - 12, - 22 - ], - "names": [ - "static_remotekey/even", - "anchors_zero_fee_htlc_tx/even" - ] - }, - "outnum": 0 - } - ], - "failed": [ - { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "method": "connect", - "error": { - "code": 401, - "message": "All addresses failed: 127.0.0.1:44663: Connection establishment: Connection refused. " - } - }, - { - "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "method": "connect", - "error": { - "code": 401, - "message": "All addresses failed: 127.0.0.1:34631: Connection establishment: Connection refused. " - } - } - ] - } - ], - "author": [ - "ZmnSCPxj <> is mainly responsible." - ], - "see_also": [ - "lightning-connect(7)", - "lightning-listfunds()", - "lightning-listpeers(7)", - "lightning-fundchannel(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-multiwithdraw.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "multiwithdraw", - "title": "Command for withdrawing to multiple addresses", - "description": [ - "The **multiwithdraw** RPC command sends funds from Core Lightning's internal wallet to the addresses specified in *outputs*." - ], - "request": { - "required": [ - "outputs" - ], - "properties": { - "outputs": { "type": "array", "items": { - "type": "outputdesc" - }, + "type": "string", + "description": [ + "`disable-plugin` field from config or cmdline." + ] + } + }, + "bookkeeper-dir": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`bookkeeper-dir` field from config or cmdline, or default." + ] + }, + "bookkeeper-db": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`bookkeeper-db` field from config or cmdline, or default." + ] + }, + "always-use-proxy": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`always-use-proxy` field from config or cmdline, or default." + ] + }, + "daemon": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`daemon` field from config or cmdline, or default." + ] + }, + "wallet": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", + "description": [ + "`wallet` field from config or cmdline default." + ] + }, + "large-channels": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", "description": [ - "An array containing objects of the form `{address: amount}`. The `amount` may be the string *all*, indicating that all onchain funds be sent to the specified address. Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*." + "`large-channels` field from config or cmdline, or default." ] }, - "feerate": { - "type": "feerate", - "description": [ - "Feerate used for the withdrawals. See NOTES in lightning-feerates(7) for possible values." + "experimental-dual-fund": { + "deprecated": [ + "v23.08", + "v24.02" ], - "default": "*normal*" + "type": "boolean", + "description": [ + "`experimental-dual-fund` field from config or cmdline, or default." + ] }, - "minconf": { - "type": "u32", + "experimental-splicing": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", "description": [ - "Minimum number of confirmations that used outputs should have." + "`experimental-splicing` field from config or cmdline, or default." + ] + }, + "experimental-onion-messages": { + "deprecated": [ + "v23.08", + "v24.02" ], - "default": 1 + "type": "boolean", + "description": [ + "`experimental-onion-messages` field from config or cmdline, or default." + ] }, - "utxos": { - "type": "array", - "items": { - "type": "outpoint", - "description": [ - "Utxos to be used to be withdrawn from, as an array of `txid:vout`. These must be drawn from the node's available UTXO set." - ] - } - } - } - }, - "response": { - "required": [ - "tx", - "txid" - ], - "properties": { - "tx": { - "type": "hex", + "experimental-offers": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", "description": [ - "The raw transaction which was sent." + "`experimental-offers` field from config or cmdline, or default." ] }, - "txid": { - "type": "txid", + "experimental-shutdown-wrong-funding": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", "description": [ - "The txid of the **tx**." + "`experimental-shutdown-wrong-funding` field from config or cmdline, or default." ] - } - } - }, - "example_json_request": [ - { - "id": "example:multiwithdraw#1", - "method": "multiwithdraw", - "params": { - "outputs": [ - { - "bcrt1qyusnugshkn6kh5vmdjpe8hylvxlxjy3ns0hmrs": "2222000msat" - }, - { - "bcrt1q6r4vvt7uack33qf9n05umfxy8h5s2rdcmq7ra3": "3333000msat" - } + }, + "experimental-websocket-port": { + "deprecated": [ + "v23.08", + "v24.02" ], - "feerate": null, - "minconf": null, - "utxos": null - } - }, - { - "id": "example:multiwithdraw#2", - "method": "multiwithdraw", - "params": { - "outputs": [ - { - "BCRT1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KYGT080": 1000 - }, - { - "bcrt1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qzf4jry": 1000 - }, - { - "bcrt1pw508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7k0ylj56": 1000 - }, - { - "BCRT1SW50QT2UWHA": 1000 - }, - { - "bcrt1zw508d6qejxtdg4y5r3zarvaryv2wuatf": 1000 - }, - { - "bcrt1qqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvseswlauz7": 1000 - }, - { - "bcrt1pqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvsesyga46z": 1000 - }, - { - "bcrt1p0xlxvlhemja6c4dqv22uapctqupfhlxm9h8z3k2e72q4k9hcz7vqc8gma6": 1000 - } + "type": "u16", + "description": [ + "`experimental-websocket-port` field from config or cmdline, or default." + ] + }, + "experimental-peer-storage": { + "deprecated": [ + "v23.08", + "v24.02" ], - "feerate": null, - "minconf": null, - "utxos": null - } - } - ], - "example_json_response": [ - { - "tx": "02000000000101b75863b811587b4c15bb94d9285c31d6369b8ff609e44de399936f8acb268f600000000000fdffffff03050d000000000000160014d0eac62fdcee2d1881259be9cda4c43de9050db8ae0800000000000016001427213e2217b4f56bd19b6c8393dc9f61be691233d4b5f5050000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a0247304402203a001463da125de5615ff1c18f9cd4a1d2a138c91d40189d350821ac8fb3ae4f02207a507eec27e15fe43476233cd9fe8b690ebd265073a58ed18ff79a1416886f18012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000", - "txid": "94e803b98257855569d35b675d65fb4fa0061a8b5f828992e2104a2882bb18bf" - }, - { - "tx": "02000000000101dc5a50dfbafc30697b930b44e763ff7a255475d17d975fa0e2003431312098cf0100000000fdffffff09e803000000000000225120000000c4a5cad46221b2a187905e5266362b99d5e91c6ce24d165dab93e86433e803000000000000046002751ee8030000000000002a5128751e76e8199196d454941c45d1b3a323f1433bd6751e76e8199196d454941c45d1b3a323f1433bd6e80300000000000022512079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f817983b939700000000002251200518e92cd94e0f62c06f126dff98b9abe79b7ed845a156d5245678e26554475de803000000000000160014751e76e8199196d454941c45d1b3a323f1433bd6e8030000000000002200201863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262e803000000000000125210751e76e8199196d454941c45d1b3a323e803000000000000220020000000c4a5cad46221b2a187905e5266362b99d5e91c6ce24d165dab93e8643301407f0d9bc098c5439ff611507b6a7d403047ed4e0b883f293db19d4e109d350a24f790acb55547384ff2a23fcfde0eba9af7cebc321c19cfc4817ecd47d50c2cd854000000", - "txid": "062383a7c9a19a2768939087a5c89826a4ea3531080f20cc06aa1cbf431be505" - } - ], - "errors": [ - "On failure, an error is reported and the withdrawal transaction is not created.", - "", - "- -1: Catchall nonspecific error.", - "- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.", - "- 302: The dust limit is not met." - ], - "author": [ - "ZmnSCPxj <> is mainly responsible." - ], - "see_also": [ - "lightning-listfunds(7)", - "lightning-fundchannel(7)", - "lightning-newaddr(7)", - "lightning-txprepare(7)", - "lightning-withdraw(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-newaddr.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "newaddr", - "title": "Command for generating a new address to be used by Core Lightning", - "description": [ - "The **newaddr** RPC command generates a new address which can subsequently be used to fund channels managed by the Core Lightning node.", - "", - "The funding transaction needs to be confirmed before funds can be used.", - "", - "To send an on-chain payment from the Core Lightning node wallet, use `withdraw`." - ], - "request": { - "required": [], - "properties": { - "addresstype": { - "type": "string", + "type": "boolean", + "added": "v23.02", "description": [ - "It specifies the type of address wanted; currently *bech32* (e.g. `tb1qu9j4lg5f9rgjyfhvfd905vw46eg39czmktxqgg` on bitcoin testnet or `bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej` on bitcoin mainnet), or *p2tr* taproot addresses. The special value *all* generates all known address types for the same underlying key." + "`experimental-peer-storage` field from config or cmdline, or default." + ] + }, + "experimental-quiesce": { + "type": "boolean", + "added": "v23.08", + "deprecated": [ + "v23.08", + "v24.02" ], - "default": "*bech32* address", - "enum": [ - "bech32", - "p2tr", - "all" + "description": [ + "`experimental-quiesce` field from config or cmdline, or default." ] - } - } - }, - "response": { - "required": [], - "properties": { - "p2tr": { + }, + "experimental-upgrade-protocol": { + "type": "boolean", "added": "v23.08", + "deprecated": [ + "v23.08", + "v24.02" + ], + "description": [ + "`experimental-upgrade-protocol` field from config or cmdline, or default." + ] + }, + "invoices-onchain-fallback": { + "type": "boolean", + "added": "v23.11", + "description": [ + "`invoices-onchain-fallback` field from config or cmdline, or default." + ] + }, + "database-upgrade": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", + "description": [ + "`database-upgrade` field from config or cmdline." + ] + }, + "rgb": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "hex", + "description": [ + "`rgb` field from config or cmdline, or default." + ], + "maxLength": 6, + "minLength": 6 + }, + "alias": { + "deprecated": [ + "v23.08", + "v24.02" + ], "type": "string", "description": [ - "The taproot address." + "`alias` field from config or cmdline, or default." ] }, - "bech32": { + "pid-file": { + "deprecated": [ + "v23.08", + "v24.02" + ], "type": "string", "description": [ - "The bech32 (native segwit) address." + "`pid-file` field from config or cmdline, or default." ] - } - } - }, - "errors": [ - "If an unrecognized address type is requested an error message will be returned." - ], - "example_json_request": [ - { - "id": "example:newaddr#1", - "method": "newaddr", - "params": { - "addresstype": null - } - }, - { - "id": "example:newaddr#2", - "method": "newaddr", - "params": { - "addresstype": "bech32" - } - } - ], - "example_json_response": [ - { - "bech32": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf" - }, - { - "bech32": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf" - } - ], - "author": [ - "Felix <> is mainly responsible." - ], - "see_also": [ - "lightning-listfunds(7)", - "lightning-fundchannel(7)", - "lightning-withdraw(7)", - "lightning-listtransactions(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-notifications.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "notifications", - "title": "Command to set up notifications.", - "description": [ - "The **notifications** the RPC command enabled notifications for this JSON-RPC connection. By default (and for backwards-compatibility) notifications are disabled.", - "", - "Various commands, especially complex and slow ones, offer notifications which indicate their progress." - ], - "request": { - "required": [ - "enable" - ], - "properties": { - "enable": { + }, + "ignore-fee-limits": { + "deprecated": [ + "v23.08", + "v24.02" + ], "type": "boolean", "description": [ - "Whether to enable or disable notifications." + "`ignore-fee-limits` field from config or cmdline, or default." ] - } - } - }, - "response": { - "properties": {}, - "post_return_value_notes": [ - "On success, if *enable* was *true*, notifications will be forwarded from then on." - ] - }, - "notifications": [ - "Notifications are JSON-RPC objects without an *id* field. *lightningd* sends notifications (once enabled with this *notifications* command) with a *params* *id* field indicating which command the notification refers to.", - "", - "Implementations should ignore notifications without an *id* parameter, or unknown *method*.", - "", - "Common *method*s include:", - " *message*: param *message*: a descriptional string indicating something which occurred relating to the command. Param *level* indicates the level, as per lightning-getlog(7): *info* and *debug* are typical.", - " *progress*: param *num* and *total*, where *num* starts at 0 and is always less than *total*. Optional param *stage* with fields *num* and *total*, indicating what stage we are progressing through." - ], - "errors": [ - "On failure, one of the following error codes may be returned:", - "", - "- -32602: Error in given parameters." - ], - "example_json_notifications": [ - { - "method": "message", - "params": { - "id": 1, - "message": "This is a test message", - "level": "DEBUG" - } - }, - { - "method": "progress", - "params": { - "id": 2, - "num": 0, - "total": 30, - "stage": { - "num": 0, - "total": 2 - } - } - } - ], - "example_json_request": [ - { - "id": "example:notifications#1", - "method": "notifications", - "params": { - "enable": true - } - }, - { - "id": "example:notifications#2", - "method": "notifications", - "params": { - "enable": false - } - } - ], - "example_json_response": [ - {}, - {} - ], - "author": [ - "Rusty Russell <> wrote the initial version of this man page." - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-offer.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "offer", - "title": "Command for accepting payments", - "warning": "experimental-offers only", - "description": [ - "The **offer** RPC command creates an offer (or returns an existing one), which is a precursor to creating one or more invoices. It automatically enables the processing of an incoming invoice_request, and issuing of invoices.", - "", - "Note that for making an offer to *pay* someone else, see lightning- invoicerequest(7)." - ], - "request": { - "required": [ - "amount", - "description" - ], - "properties": { - "amount": { - "oneOf": [ - { - "type": "msat_or_any" - }, - { - "type": "currency" - } + }, + "watchtime-blocks": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", + "description": [ + "`watchtime-blocks` field from config or cmdline, or default." + ] + }, + "max-locktime-blocks": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", + "description": [ + "`max-locktime-blocks` field from config or cmdline, or default." + ] + }, + "funding-confirms": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", + "description": [ + "`funding-confirms` field from config or cmdline, or default." + ] + }, + "cltv-delta": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", + "description": [ + "`cltv-delta` field from config or cmdline, or default." + ] + }, + "cltv-final": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", + "description": [ + "`cltv-final` field from config or cmdline, or default." + ] + }, + "commit-time": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", + "description": [ + "`commit-time` field from config or cmdline, or default." + ] + }, + "fee-base": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", + "description": [ + "`fee-base` field from config or cmdline, or default." + ] + }, + "rescan": { + "deprecated": [ + "v23.08", + "v24.02" ], + "type": "integer", "description": [ - "Can be the string `any`, which creates an offer that can be paid with any amount (e.g. a donation). Otherwise it can be a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. It can also have an ISO 4217 postfix (e.g. USD), in which case currency conversion will need to be done for the invoice itself. A plugin is needed which provides the `currencyconvert` API for this currency, otherwise the offer creation will fail." + "`rescan` field from config or cmdline, or default." ] }, - "description": { - "type": "string", + "fee-per-satoshi": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", "description": [ - "A short description of purpose of the offer, e.g. *coffee*. This value is encoded into the resulting offer and is viewable by anyone you expose this offer to. It must be UTF-8, and cannot use *\\u* JSON escape codes." + "`fee-per-satoshi` field from config or cmdline, or default." ] }, - "issuer": { - "type": "string", + "max-concurrent-htlcs": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u32", "description": [ - "Who is issuing this offer (i.e. you) if appropriate." + "`max-concurrent-htlcs` field from config or cmdline, or default." ] }, - "label": { - "type": "string", + "htlc-minimum-msat": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "msat", "description": [ - "An internal-use name for the offer, which can be any UTF-8 string. This is *NOT* encoded in the offer not sent to the issuer." + "`htlc-minimum-msat` field from config or cmdline, or default." ] }, - "quantity_max": { - "type": "u64", + "htlc-maximum-msat": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "msat", "description": [ - "Invoice can specify more than one of the items up (and including) this maximum: 0 is a special value meaning `no maximuim`. The *amount* for the invoice will need to be multiplied accordingly. This is encoded in the offer." + "`htlc-maximum-msat` field from config or cmdline, or default." ] }, - "absolute_expiry": { - "type": "u64", + "max-dust-htlc-exposure-msat": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "msat", "description": [ - "Time the offer is valid until,in seconds since the first day of 1970 UTC. If not set, the offer remains valid (though it can be deactivated by the issuer of course). This is encoded in the offer." + "`max-dust-htlc-exposure-mast` field from config or cmdline, or default." ] }, - "recurrence": { - "type": "string", + "min-capacity-sat": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "u64", "description": [ - "An invoice is expected at regular intervals. The argument is a positive number followed by one of `seconds`, `minutes`, `hours`, `days`, `weeks`, `months` or `years` (variants without the trailing `s` are also permitted). This is encoded in the offer. The semantics of recurrence is fairly predictable, but fully documented in BOLT 12. e.g. `4weeks`." + "`min-capacity-sat` field from config or cmdline, or default." ] }, - "recurrence_base": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "addr": { + "deprecated": [ + "v23.08", + "v24.02" ], + "type": "string", "description": [ - "Time in seconds since the first day of 1970 UTC, optionally with a `@` prefix. This indicates when the first period begins; without this, the recurrence periods start from the first invoice. The `@` prefix means that the invoice must start by paying the first period; otherwise it is permitted to start at any period. This is encoded in the offer. e.g. `@1609459200` indicates you must start paying on the 1st January 2021." + "`addr` field from config or cmdline (can be more than one)." ] }, - "recurrence_paywindow": { + "announce-addr": { + "deprecated": [ + "v23.08", + "v24.02" + ], "type": "string", "description": [ - "Argument of form `-time+time[%]`. The first time is the number of seconds before the start of a period in which an invoice and payment is valid, the second time is the number of seconds after the start of the period. For example *-604800+86400* means you can fetch an pay the invoice 4 weeks before the given period starts, and up to 1 day afterwards. The optional *%* indicates that the amount of the invoice will be scaled by the time remaining in the period. This is encoded in the offer." - ], - "default": "that payment is allowed during the current and previous periods" + "`announce-addr` field from config or cmdline (can be more than one)." + ] }, - "recurrence_limit": { - "type": "u32", + "bind-addr": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", "description": [ - "To indicate the maximum period which exists. eg. `12` means there are 13 periods, from 0 to 12 inclusive. This is encoded in the offer." + "`bind-addr` field from config or cmdline (can be more than one)." ] }, - "single_use": { + "offline": { + "deprecated": [ + "v23.08", + "v24.02" + ], "type": "boolean", "description": [ - "Indicates that the offer is only valid once; we may issue multiple invoices, but as soon as one is paid all other invoices will be expired (i.e. only one person can pay this offer)." + "`true` if `offline` was set in config or cmdline." + ] + }, + "autolisten": { + "deprecated": [ + "v23.08", + "v24.02" ], - "default": "False" - } - } - }, - "response": { - "required": [ - "offer_id", - "active", - "single_use", - "bolt12", - "used", - "created" - ], - "properties": { - "offer_id": { - "type": "hash", + "type": "boolean", "description": [ - "The id of this offer (merkle hash of non-signature fields)." + "`autolisten` field from config or cmdline, or default." ] }, - "active": { - "type": "boolean", - "enum": [ - true + "proxy": { + "deprecated": [ + "v23.08", + "v24.02" ], + "type": "string", "description": [ - "Whether this can still be used." + "`proxy` field from config or cmdline, or default." ] }, - "single_use": { + "disable-dns": { + "deprecated": [ + "v23.08", + "v24.02" + ], "type": "boolean", "description": [ - "Whether this expires as soon as it's paid (reflects the *single_use* parameter)." + "`true` if `disable-dns` was set in config or cmdline." ] }, - "bolt12": { + "announce-addr-discovered": { + "deprecated": [ + "v23.08", + "v24.02" + ], "type": "string", "description": [ - "The bolt12 encoding of the offer." - ] + "`true`/`false`/`auto` depending on how `announce-addr-discovered` was set in config or cmdline." + ], + "added": "v23.02" }, - "used": { + "announce-addr-discovered-port": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "integer", + "description": [ + "Sets the announced TCP port for dynamically discovered IPs." + ], + "added": "v23.02" + }, + "encrypted-hsm": { + "deprecated": [ + "v23.08", + "v24.02" + ], "type": "boolean", "description": [ - "True if an associated invoice has been paid." + "`true` if `encrypted-hsm` was set in config or cmdline." ] }, - "created": { - "type": "boolean", + "rpc-file-mode": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", "description": [ - "False if the offer already existed." + "`rpc-file-mode` field from config or cmdline, or default." ] }, - "label": { + "log-level": { + "deprecated": [ + "v23.08", + "v24.02" + ], "type": "string", "description": [ - "The (optional) user-specified label." + "`log-level` field from config or cmdline, or default." ] - } - } - }, - "errors": [ - "On failure, an error is returned and no offer is created. If the lightning process fails before responding, the caller should use lightning-listoffers(7) to query whether this offer was created or not.", - "", - "If the offer already existed, and is still active, that is returned; if it's not active then this call fails.", - "", - "- -1: Catchall nonspecific error.", - "- 1000: Offer with this offer_id already exists (but is not active)." - ], - "example_json_request": [ - { - "id": "example:offer#1", - "method": "offer", - "params": { - "amount": "1msat", - "description": "test for 1msat" - } - }, - { - "id": "example:offer#2", - "method": "offer", - "params": { - "amount": "100000sat", - "description": "quantity_max test", - "recurrence": "1week" - } - } - ], - "example_json_response": [ - { - "offer_id": "f61cca153d1948dade19349792d9bcdc9cef687fd27db0b553a67979f55aae48", - "active": true, - "single_use": false, - "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqyqs5rn5v4ehggrxdaezqvtdwdshg93pqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq63s", - "used": false, - "created": true - }, - { - "offer_id": "f7a501e51e2a90d032150b9100b1977c625f05cfda22469bdc81d8a20b1e303f", - "active": true, - "single_use": false, - "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqszltcgqpgghzatpde6xjaretakkz7pqw3jhxaqkyypxdeze35wncs2l2u4gfzyrpds00e6yakfrt6ctrw5n9qanzhqr2xq6qgqsw", - "used": false, - "created": true - } - ], - "author": [ - "Rusty Russell <> is mainly responsible." - ], - "see_also": [ - "lightning-listoffers(7)", - "lightning-disableoffer(7)", - "lightning-invoicerequest(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-openchannel_abort.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "openchannel_abort", - "title": "Command to abort a channel to a peer", - "description": [ - "`openchannel_init` is a low level RPC command which initiates a channel open with a specified peer. It uses the openchannel protocol which allows for interactive transaction construction." - ], - "request": { - "required": [ - "channel_id" - ], - "properties": { - "channel_id": { - "type": "hash", + }, + "log-prefix": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", "description": [ - "Channel id of the channel to be aborted." + "`log-prefix` field from config or cmdline, or default." ] - } - } - }, - "response": { - "required": [ - "channel_id", - "channel_canceled", - "reason" - ], - "properties": { - "channel_id": { - "type": "hash", + }, + "log-file": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", "description": [ - "The channel id of the aborted channel." + "`log-file` field from config or cmdline, or default." ] }, - "channel_canceled": { + "log-timestamps": { + "deprecated": [ + "v23.08", + "v24.02" + ], "type": "boolean", "description": [ - "Whether this is completely canceled (there may be remaining in-flight transactions)." + "`log-timestamps` field from config or cmdline, or default." ] }, - "reason": { + "force-feerates": { + "deprecated": [ + "v23.08", + "v24.02" + ], "type": "string", "description": [ - "Usually \"Abort requested\", but if it happened to fail at the same time it could be different." + "Force-feerate configuration setting, if any." ] - } - } - }, - "errors": [ - "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", - "", - "- -32602: If the given parameters are wrong.", - "- -1: Catchall nonspecific error.", - "- 305: Peer is not connected.", - "- 311: Unknown channel id.", - "- 312: Channel in an invalid state" - ], - "example_json_request": [ - { - "id": "example:openchannel_abort#1", - "method": "openchannel_abort", - "params": { - "channel_id": "aec3dfd0c7643a23b679cd2e493c053f8fdf621ff2624949f9582c4118b818c6" - } - } - ], - "example_json_response": [ - { - "channel_id": "aec3dfd0c7643a23b679cd2e493c053f8fdf621ff2624949f9582c4118b818c6", - "channel_canceled": true, - "reason": "Abort requested" - } - ], - "author": [ - "Lisa Neigut <> is mainly responsible." - ], - "see_also": [ - "lightning-openchannel_init(7)", - "lightning-openchannel_update(7)", - "lightning-openchannel_signed(7)", - "lightning-openchannel_bump(7)", - "lightning-fundchannel_start(7)", - "lightning-fundchannel_complete(7)", - "lightning-fundchannel(7)", - "lightning-fundpsbt(7)", - "lightning-utxopsbt(7)", - "lightning-multifundchannel(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-openchannel_bump.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "openchannel_bump", - "title": "Command to initiate a channel RBF", - "description": [ - "`openchannel_bump` is a RPC command which initiates a channel RBF (Replace-By-Fee) for the specified channel. It uses the openchannel protocol which allows for interactive transaction construction.", - "", - "Warning: bumping a leased channel will lose the lease." - ], - "request": { - "required": [ - "channel_id", - "amount", - "initialpsbt" - ], - "properties": { - "channel_id": { - "type": "hash", + }, + "subdaemon": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "string", "description": [ - "Id of the channel to RBF." + "`subdaemon` fields from config or cmdline if any (can be more than one)." ] }, - "amount": { - "type": "sat", + "fetchinvoice-noconnect": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", "description": [ - "Satoshi value that we will contribute to the channel. This value will be _added_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel." + "`fetchinvoice-noconnect` fields from config or cmdline, or default." ] }, - "initialpsbt": { + "accept-htlc-tlv-types": { + "deprecated": [ + "v23.08", + "v24.02" + ], "type": "string", "description": [ - "The funded, incomplete PSBT that specifies the UTXOs and change output for our channel contribution. It can be updated, see `openchannel_update`; *initialpsbt* must have at least one input. Must have the Non-Witness UTXO (PSBT_IN_NON_WITNESS_UTXO) set for every input. An error (code 309) will be returned if this requirement is not met." + "`accept-htlc-tlv-types` field from config or cmdline, or not present." ] }, - "funding_feerate": { - "type": "feerate", - "description": [ - "Feerate for the funding transaction." + "tor-service-password": { + "deprecated": [ + "v23.08", + "v24.02" ], - "default": "1/64th greater than the last feerate used for this channel" - } - } - }, - "response": { - "required": [ - "channel_id", - "channel_type", - "psbt", - "commitments_secured", - "funding_serial" - ], - "properties": { - "channel_id": { - "type": "hash", + "type": "string", "description": [ - "The channel id of the channel." + "`tor-service-password` field from config or cmdline, if any." ] }, - "channel_type": { - "type": "object", - "description": [ - "Channel_type as negotiated with peer." + "dev-allowdustreserve": { + "deprecated": [ + "v23.08", + "v24.02" ], - "added": "v24.02", - "additionalProperties": false, - "required": [ - "bits", - "names" + "type": "boolean", + "description": [ + "Whether we allow setting dust reserves." + ] + }, + "announce-addr-dns": { + "deprecated": [ + "v23.08", + "v24.02" ], - "properties": { - "bits": { - "type": "array", - "description": [ - "Each bit set in this channel_type." - ], - "added": "v24.02", - "items": { - "type": "u32", - "description": [ - "Bit number." - ] - } - }, - "names": { - "type": "array", - "description": [ - "Feature name for each bit set in this channel_type." - ], - "added": "v24.02", - "items": { - "type": "string", - "enum": [ - "static_remotekey/even", - "anchor_outputs/even", - "anchors_zero_fee_htlc_tx/even", - "scid_alias/even", - "zeroconf/even" - ], - "description": [ - "Name of feature bit." - ] - } - } - } + "type": "boolean", + "added": "v22.11.1", + "description": [ + "Whether we put DNS entries into node_announcement." + ] }, - "psbt": { - "type": "string", + "require-confirmed-inputs": { + "deprecated": [ + "v23.08", + "v24.02" + ], + "type": "boolean", "description": [ - "The (incomplete) PSBT of the RBF transaction." + "Request peers to only send confirmed inputs (dual-fund only)." ] }, - "commitments_secured": { + "developer": { + "added": "v23.08", "type": "boolean", - "enum": [ - false - ], "description": [ - "Whether the *psbt* is complete." + "Whether developer mode is enabled." ] }, - "funding_serial": { + "commit-fee": { + "deprecated": [ + "v23.08", + "v24.02" + ], "type": "u64", + "added": "v23.05", "description": [ - "The serial_id of the funding output in the *psbt*." + "The percentage of the 6-block fee estimate to use for commitment transactions." ] }, - "requires_confirmed_inputs": { - "type": "boolean", + "min-emergency-msat": { + "type": "msat", + "added": "v23.08", "description": [ - "Does peer require confirmed inputs in psbt?" + "Field from config or cmdline, or default." + ] + }, + "commit-feerate-offset": { + "type": "u32", + "added": "v23.11", + "description": [ + "Additional commitment feerate applied by channel owner." ] } }, - "post_return_value_notes": [ - "If the peer does not support `option_dual_fund`, this command will return an error.", + "pre_return_value_notes": [ + "The returned values reflect the current configuration, including showing default values (`dev-` options are not shown unless specified as *config* explicitly).", "", - "If the channel is not in a state that is eligible for RBF, this command will return an error." + "Note: as plugins can add options, not all configuration settings are listed here! The format of each entry is as follows:", + "", + "- **source** (string): source of configuration setting (`file`:`linenum`)", + "- **dynamic** (boolean, optional): true if this option is settable via setconfig", + "- **plugin** (string, optional): set if this is from a plugin", + "", + "Depending on the option type, exactly one of the following is present:", + "", + "- **set** (boolean, optional): for simple flag options", + "- **value_str** (string, optional): for string options", + "- **value_msat** (msat, optional): for msat options", + "- **value_int** (integer, optional): for integer options", + "- **value_bool** (boolean, optional): for boolean options" ] }, + "example_json_request": [ + { + "id": "example:listconfigs#1", + "method": "listconfigs", + "params": { + "config": "network" + } + }, + { + "id": "example:listconfigs#2", + "method": "listconfigs", + "params": { + "config": null + } + }, + { + "id": "example:listconfigs#3", + "method": "listconfigs", + "params": { + "config": "experimental-dual-fund" + } + } + ], "errors": [ - "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "On failure, one of the following error codes may be returned:", "", - "- -32602: If the given parameters are wrong.", - "- -1: Catchall nonspecific error.", - "- 300: The amount exceeded the maximum configured funding amount.", - "- 301: The provided PSBT cannot afford the funding amount.", - "- 305: Peer is not connected.", - "- 309: PSBT missing required fields", - "- 311: Unknown channel id.", - "- 312: Channel in an invalid state" + "- -32602: Error in given parameters or field with *config* name doesn't exist." + ], + "example_json_response": [ + { + "#version": "v0.9.0-1", + "lightning-dir": "/media/vincent/Maxtor/sanboxTestWrapperRPC/lightning_dir_dev", + "network": "testnet", + "allow-deprecated-apis": true, + "rpc-file": "lightning-rpc", + "plugins": [ + { + "path": "/home/vincent/Github/plugins/sauron/sauron.py", + "name": "sauron.py", + "options": { + "sauron-api-endpoint": "http://blockstream.info/testnet/api/", + "sauron-tor-proxy": "" + } + }, + { + "path": "/home/vincent/Github/reckless/reckless.py", + "name": "reckless.py" + } + ], + "important-plugins": [ + { + "path": "/home/vincent/Github/lightning/lightningd/../plugins/autoclean", + "name": "autoclean", + "options": { + "autocleaninvoice-cycle": null, + "autocleaninvoice-expired-by": null + } + }, + { + "path": "/home/vincent/Github/lightning/lightningd/../plugins/fundchannel", + "name": "fundchannel" + }, + { + "path": "/home/vincent/Github/lightning/lightningd/../plugins/keysend", + "name": "keysend" + }, + { + "path": "/home/vincent/Github/lightning/lightningd/../plugins/pay", + "name": "pay", + "options": { + "disable-mpp": false + } + } + ], + "important-plugin": "/home/vincent/Github/lightning/lightningd/../plugins/pay", + "plugin": "/home/vincent/Github/reckless/reckless.py", + "disable-plugin": [ + "bcli" + ], + "always-use-proxy": false, + "daemon": "false", + "wallet": "sqlite3:///media/vincent/Maxtor/sanboxTestWrapperRPC/lightning_dir_dev/testnet/lightningd.sqlite3", + "wumbo": true, + "rgb": "03ad98", + "alias": "BRUCEWAYN-TES-DEV", + "pid-file": "/media/vincent/Maxtor/sanboxTestWrapperRPC/lightning_dir_dev/lightningd-testne...", + "ignore-fee-limits": true, + "watchtime-blocks": 6, + "max-locktime-blocks": 2016, + "funding-confirms": 1, + "commit-fee-min": 0, + "commit-fee-max": 0, + "cltv-delta": 6, + "cltv-final": 10, + "commit-time": 10, + "fee-base": 1, + "rescan": 30, + "fee-per-satoshi": 10, + "max-concurrent-htlcs": 483, + "min-capacity-sat": 10000, + "addr": "autotor:127.0.0.1:9051", + "bind-addr": "127.0.0.1:9735", + "announce-addr": "fp463inc4w3lamhhduytrwdwq6q6uzugtaeapylqfc43agrdnnqsheyd.onion:9735", + "offline": "false", + "autolisten": true, + "proxy": "127.0.0.1:9050", + "disable-dns": "false", + "encrypted-hsm": false, + "rpc-file-mode": "0600", + "log-level": "DEBUG", + "log-prefix": "lightningd" + }, + { + "configs": { + "developer": { + "set": true, + "source": "cmdline" + }, + "lightning-dir": { + "value_str": "/tmp/ltests-giwf5tc7/test_plugin_start_1/lightning-1/", + "source": "cmdline" + }, + "network": { + "value_str": "regtest", + "source": "cmdline" + }, + "testnet": { + "set": false, + "source": "default" + }, + "signet": { + "set": false, + "source": "default" + }, + "mainnet": { + "set": false, + "source": "default" + }, + "regtest": { + "set": false, + "source": "default" + }, + "rpc-file": { + "value_str": "lightning-rpc", + "source": "default" + }, + "allow-deprecated-apis": { + "value_bool": false, + "source": "cmdline" + }, + "plugin": { + "values_str": [ + "~/lightning/target/debug/examples/cln-plugin-startup" + ], + "sources": [ + "cmdline" + ] + }, + "plugin-dir": { + "values_str": [], + "sources": [] + }, + "clear-plugins": { + "set": false, + "source": "default" + }, + "disable-plugin": { + "values_str": [], + "sources": [] + }, + "important-plugin": { + "values_str": [], + "sources": [] + }, + "always-use-proxy": { + "value_bool": false, + "source": "default" + }, + "daemon": { + "set": false, + "source": "default" + }, + "experimental-dual-fund": { + "set": false, + "source": "default" + }, + "experimental-splicing": { + "set": false, + "source": "default" + }, + "experimental-onion-messages": { + "set": false, + "source": "default" + }, + "experimental-offers": { + "set": false, + "source": "default" + }, + "experimental-shutdown-wrong-funding": { + "set": false, + "source": "default" + }, + "experimental-peer-storage": { + "set": false, + "source": "default" + }, + "experimental-quiesce": { + "set": false, + "source": "default" + }, + "experimental-anchors": { + "set": false, + "source": "default" + }, + "rgb": { + "value_str": "0266e4", + "source": "default" + }, + "alias": { + "value_str": "JUNIORBEAM-1-102-g7549e10-modded", + "source": "default" + }, + "pid-file": { + "value_str": "/tmp/ltests-giwf5tc7/test_plugin_start_1/lightning-1/lightningd-regtest.pid", + "source": "default" + }, + "ignore-fee-limits": { + "value_bool": false, + "source": "cmdline" + }, + "watchtime-blocks": { + "value_int": 5, + "source": "cmdline" + }, + "max-locktime-blocks": { + "value_int": 2016, + "source": "default" + }, + "funding-confirms": { + "value_int": 1, + "source": "default" + }, + "require-confirmed-inputs": { + "value_bool": false, + "source": "default" + }, + "cltv-delta": { + "value_int": 6, + "source": "cmdline" + }, + "cltv-final": { + "value_int": 5, + "source": "cmdline" + }, + "commit-time": { + "value_int": 10, + "source": "default" + }, + "fee-base": { + "value_int": 1, + "source": "default" + }, + "rescan": { + "value_int": 1, + "source": "cmdline" + }, + "fee-per-satoshi": { + "value_int": 10, + "source": "default" + }, + "htlc-minimum-msat": { + "value_msat": 0, + "source": "default" + }, + "htlc-maximum-msat": { + "value_msat": 18446744073709552000, + "source": "default" + }, + "max-concurrent-htlcs": { + "value_int": 483, + "source": "default" + }, + "max-dust-htlc-exposure-msat": { + "value_msat": 50000000, + "source": "default" + }, + "min-capacity-sat": { + "value_int": 10000, + "source": "default", + "dynamic": true + }, + "addr": { + "values_str": [ + "127.0.0.1:33157" + ], + "sources": [ + "cmdline" + ] + }, + "bind-addr": { + "values_str": [], + "sources": [] + }, + "announce-addr": { + "values_str": [], + "sources": [] + }, + "announce-addr-discovered": { + "value_str": "auto", + "source": "default" + }, + "announce-addr-discovered-port": { + "value_int": 19846, + "source": "default" + }, + "offline": { + "set": false, + "source": "default" + }, + "autolisten": { + "value_bool": false, + "source": "default" + }, + "accept-htlc-tlv-type": { + "values_int": [], + "sources": [] + }, + "disable-dns": { + "set": true, + "source": "cmdline" + }, + "encrypted-hsm": { + "set": false, + "source": "default" + }, + "rpc-file-mode": { + "value_str": "0600", + "source": "default" + }, + "commit-fee": { + "value_int": 100, + "source": "default" + }, + "commit-feerate-offset": { + "value_int": 5, + "source": "default" + }, + "min-emergency-msat": { + "value_msat": 25000000, + "source": "default" + }, + "subdaemon": { + "values_str": [], + "sources": [] + }, + "experimental-upgrade-protocol": { + "set": false, + "source": "default" + }, + "invoices-onchain-fallback": { + "set": false, + "source": "default" + }, + "log-level": { + "value_str": "debug", + "source": "cmdline" + }, + "log-timestamps": { + "value_bool": true, + "source": "default" + }, + "log-prefix": { + "value_str": "lightningd-1 ", + "source": "cmdline" + }, + "log-file": { + "values_str": [ + "-", + "/tmp/ltests-giwf5tc7/test_plugin_start_1/lightning-1/log" + ], + "sources": [ + "cmdline", + "cmdline" + ] + }, + "dev-no-plugin-checksum": { + "set": true, + "source": "cmdline" + }, + "dev-no-reconnect": { + "set": true, + "source": "cmdline" + }, + "dev-fail-on-subdaemon-fail": { + "set": true, + "source": "cmdline" + }, + "dev-bitcoind-poll": { + "value_int": 1, + "source": "cmdline" + }, + "dev-fast-gossip": { + "set": true, + "source": "cmdline" + }, + "renepay-debug-mcf": { + "set": false, + "source": "default", + "plugin": "~/lightning/plugins/cln-renepay" + }, + "renepay-debug-payflow": { + "set": false, + "source": "default", + "plugin": "~/lightning/plugins/cln-renepay" + }, + "test-option": { + "value_int": 31337, + "source": "cmdline", + "plugin": "~/lightning/target/debug/examples/cln-plugin-startup" + }, + "bitcoin-datadir": { + "value_str": "/tmp/ltests-giwf5tc7/test_plugin_start_1/lightning-1/", + "source": "cmdline", + "plugin": "~/lightning/plugins/bcli" + }, + "bitcoin-rpcuser": { + "value_str": "rpcuser", + "source": "cmdline", + "plugin": "~/lightning/plugins/bcli" + }, + "bitcoin-rpcpassword": { + "value_str": "rpcpass", + "source": "cmdline", + "plugin": "~/lightning/plugins/bcli" + }, + "bitcoin-rpcport": { + "value_int": 51309, + "source": "cmdline", + "plugin": "~/lightning/plugins/bcli" + }, + "disable-mpp": { + "set": false, + "source": "default", + "plugin": "~/lightning/plugins/pay" + } + } + }, + { + "configs": { + "experimental-dual-fund": { + "set": false, + "source": "default" + } + } + } ], "author": [ - "Lisa Neigut <> is mainly responsible." + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." ], "see_also": [ - "lightning-openchannel_init(7)", - "lightning-openchannel_update(7)", - "lightning-openchannel_signed(7)", - "lightning-openchannel_abort(7)", - "lightning-fundchannel_start(7)", - "lightning-fundchannel_complete(7)", - "lightning-fundchannel(7)", - "lightning-fundpsbt(7)", - "lightning-utxopsbt(7)", - "lightning-multifundchannel(7)" + "lightning-getinfo(7)", + "lightningd-config(5)" ], "resources": [ "Main web site: " ] }, - "lightning-openchannel_init.json": { + "lightning-listdatastore.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "openchannel_init", - "title": "Command to initiate a channel to a peer", + "rpc": "listdatastore", + "title": "Command for listing (plugin) data", "description": [ - "`openchannel_init` is a low level RPC command which initiates a channel open with a specified peer. It uses the openchannel protocol which allows for interactive transaction construction." + "The **listdatastore** RPC command allows plugins to fetch data which was stored in the Core Lightning database." ], "request": { - "required": [ - "id", - "amount", - "initialpsbt" - ], + "required": [], "properties": { - "id": { - "type": "pubkey", - "description": [ - "Node id of the remote peer." - ] - }, - "amount": { - "type": "sat", - "description": [ - "Satoshi value that we will contribute to the channel. This value will be _added_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel." - ] - }, - "initialpsbt": { - "type": "string", - "description": [ - "Funded, incomplete PSBT that specifies the UTXOs and change output for our channel contribution. It can be updated, see `openchannel_update`; *initialpsbt* must have at least one input. Must have the Non-Witness UTXO (PSBT_IN_NON_WITNESS_UTXO) set for every input. An error (code 309) will be returned if this requirement is not met." - ] - }, - "commitment_feerate": { - "type": "feerate", - "description": [ - "Feerate for commitment transactions for non-anchor channels: see **fundchannel**. For anchor channels, it is ignored." - ] - }, - "funding_feerate": { - "type": "feerate", - "description": [ - "Feerate for the funding transaction." - ], - "default": "'opening' feerate" - }, - "announce": { - "type": "boolean", - "description": [ - "Whether or not to announce this channel." - ] - }, - "close_to": { - "type": "string", - "description": [ - "Bitcoin address to which the channel funds should be sent on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`." - ] - }, - "request_amt": { - "type": "msat", - "description": [ - "An amount of liquidity you'd like to lease from the peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*." - ] - }, - "compact_lease": { - "type": "hex", - "description": [ - "A compact representation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel." + "key": { + "oneOf": [ + { + "type": "array", + "description": [ + "All immediate children of the *key* (or root children) are returned.", + " Using the first element of the key as the plugin name (e.g. `[ 'summary' ]`) is recommended.", + " An array of values to form a hierarchy (though a single value is treated as a one-element array)." + ], + "items": { + "type": "string" + } + }, + { + "type": "string" + } ] - }, - "channel_type": { - "type": "array", - "description": [ - "Each bit set in this channel_type." - ], - "items": { - "type": "u32", - "description": [ - "Bit number." - ] - } } } }, "response": { "required": [ - "channel_id", - "psbt", - "channel_type", - "commitments_secured", - "funding_serial" + "datastore" ], "properties": { - "channel_id": { - "type": "hash", - "description": [ - "The channel id of the channel." - ] - }, - "psbt": { - "type": "string", - "description": [ - "The (incomplete) PSBT of the funding transaction." - ] - }, - "channel_type": { - "type": "object", - "description": [ - "Channel_type as negotiated with peer." - ], - "added": "v24.02", - "additionalProperties": false, - "required": [ - "bits", - "names" - ], - "properties": { - "bits": { - "type": "array", - "description": [ - "Each bit set in this channel_type." - ], - "added": "v24.02", - "items": { - "type": "u32", + "datastore": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "key" + ], + "properties": { + "key": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Part of the key added to the datastore." + ] + } + }, + "generation": { + "type": "u64", "description": [ - "Bit number." + "The number of times this has been updated." ] - } - }, - "names": { - "type": "array", - "description": [ - "Feature name for each bit set in this channel_type." - ], - "added": "v24.02", - "items": { + }, + "hex": { + "type": "hex", + "description": [ + "The hex data from the datastore." + ] + }, + "string": { "type": "string", - "enum": [ - "static_remotekey/even", - "anchor_outputs/even", - "anchors_zero_fee_htlc_tx/even", - "scid_alias/even", - "zeroconf/even" - ], "description": [ - "Name of feature bit." + "The data as a string, if it's valid utf-8." ] } } } - }, - "commitments_secured": { - "type": "boolean", - "enum": [ - false - ], - "description": [ - "Whether the *psbt* is complete." - ] - }, - "funding_serial": { - "type": "u64", - "description": [ - "The serial_id of the funding output in the *psbt*." - ] - }, - "requires_confirmed_inputs": { - "type": "boolean", - "description": [ - "Does peer require confirmed inputs in psbt?" - ] } - }, - "post_return_value_notes": [ - "If the peer does not support `option_dual_fund`, this command will return an error.", - "", - "If you sent a *request_amt* and the peer supports `option_will_fund` and is interested in leasing you liquidity in this channel, returns their updated channel fee max (*channel_fee_proportional_basis*, *channel_fee_base_msat*), updated rate card for the lease fee (*lease_fee_proportional_basis*, *lease_fee_base_sat*) and their on-chain weight *weight_charge*, which will be added to the lease fee at a rate of *funding_feerate* * *weight_charge* / 1000." - ] + } }, + "errors": [ + "The following error codes may occur:", + "", + "- -32602: invalid parameters." + ], "example_json_request": [ { - "id": "example:openchannel_init#1", - "method": "openchannel_init", + "id": "example:listdatastore#1", + "method": "listdatastore", "params": { - "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "amount": 999000, - "initialpsbt": "cHNidP8BADMCAAAAAYbThUhSzYr7ph6Z434bdcW7eoirYOFMmUt2GXZ79sF/AQAAAAD9////AGYAAAAAAQDeAgAAAAABARVD4QKlmwy8SNcNypf1o9TzbIFZjj4dqVzHAL0SLDoTAAAAAAD9////AjOv9ikBAAAAFgAUXJGglH7At5HOVY4ZHp0+19kv655AQg8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgVIxRXqIykOOxm/6YPaFFx2Qh1618qlXPUhDiliVQ2KUCIHQcHniUTcm1XT8SyRE8ev52jm0uiIYum15XcR/tPh+NASEC3Pby7xL4+Ig/Z8TchQ0QT1upLGet3da8qjSjgHO9LOJlAAAAAQEfQEIPAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=", - "commitment_feerate": null, - "funding_feerate": null, - "announce": true, - "close_to": null, - "request_amt": null, - "channel_type": [ - 12, - 22 + "key": [ + "commando" ] } }, { - "id": "example:openchannel_init#2", - "method": "openchannel_init", + "id": "example:listdatastore#2", + "method": "listdatastore", "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "amount": 16777216, - "initialpsbt": "cHNidP8BADMCAAAAAQVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAAAAAAD9////AGYAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=", - "commitment_feerate": null, - "funding_feerate": null, - "announce": true, - "close_to": null, - "request_amt": null, - "channel_type": null + "key": "otherkey" } } ], "example_json_response": [ { - "channel_id": "53fa2b1ca0d8f21abeaaac0495ab9925cdfaf2ca8b04dbe4aeb061823e1ff2c8", - "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABARVD4QKlmwy8SNcNypf1o9TzbIFZjj4dqVzHAL0SLDoTAAAAAAD9////AjOv9ikBAAAAFgAUXJGglH7At5HOVY4ZHp0+19kv655AQg8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgVIxRXqIykOOxm/6YPaFFx2Qh1618qlXPUhDiliVQ2KUCIHQcHniUTcm1XT8SyRE8ev52jm0uiIYum15XcR/tPh+NASEC3Pby7xL4+Ig/Z8TchQ0QT1upLGet3da8qjSjgHO9LOJlAAAAAQEfQEIPAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIIbThUhSzYr7ph6Z434bdcW7eoirYOFMmUt2GXZ79sF/AQ8EAQAAAAEQBP3///8M/AlsaWdodG5pbmcBCMCDK/6LyRi8AAEDCFg+DwAAAAAAAQQiACDYM+8ZRsbTj0OCG/yzqLt2buFQn9LuMPDZqFFcgmCmfAz8CWxpZ2h0bmluZwEIchtFHfZ5FBgA", - "channel_type": { - "bits": [ - 12, - 22 - ], - "names": [ - "static_remotekey/even", - "anchors_zero_fee_htlc_tx/even" - ] - }, - "commitments_secured": false, - "funding_serial": 8222241539686471000, - "requires_confirmed_inputs": false + "datastore": [] }, { - "channel_id": "252d1b0a1e57895e84137f28cf19ab2c35847e284c112fefdecc7afeaa5c1de7", - "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCLR8RjOq9lmcAAEDCAAAAAEAAAAAAQQiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQz8CWxpZ2h0bmluZwEIZZtc7LD4y9YA", - "channel_type": { - "bits": [ - 12, - 22 - ], - "names": [ - "static_remotekey/even", - "anchors_zero_fee_htlc_tx/even" - ] - }, - "commitments_secured": false, - "funding_serial": 7321547790872006000, - "requires_confirmed_inputs": false - } - ], - "errors": [ - "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", - "", - "- -32602: If the given parameters are wrong.", - "- -1: Catchall nonspecific error.", - "- 300: The amount exceeded the maximum configured funding amount.", - "- 301: The provided PSBT cannot afford the funding amount.", - "- 304: Still syncing with bitcoin network", - "- 305: Peer is not connected.", - "- 306: Unknown peer id.", - "- 309: PSBT missing required fields", - "- 310: v2 channel open protocol not supported by peer", - "- 312: Channel in an invalid state" - ], - "author": [ - "Lisa Neigut <> is mainly responsible." - ], - "see_also": [ - "lightning-openchannel_update(7)", - "lightning-openchannel_signed(7)", - "lightning-openchannel_abort(7)", - "lightning-openchannel_bump(7)", - "lightning-fundchannel_start(7)", - "lightning-fundchannel_complete(7)", - "lightning-fundchannel(7)", - "lightning-fundpsbt(7)", - "lightning-utxopsbt(7)", - "lightning-multifundchannel(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-openchannel_signed.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "openchannel_signed", - "title": "Command to conclude a channel open", - "description": [ - "`openchannel_signed` is a low level RPC command which concludes a channel open with the specified peer. It uses the v2 openchannel protocol, which allows for interactive transaction construction.", - "", - "This command should be called after `openchannel_update` returns *commitments_secured* `true`.", - "", - "This command will broadcast the finalized funding transaction, if we receive valid signatures from the peer." - ], - "request": { - "required": [ - "channel_id", - "signed_psbt" - ], - "properties": { - "channel_id": { - "type": "hash", - "description": [ - "Id of the channel." - ] - }, - "signed_psbt": { - "type": "string", - "description": [ - "The PSBT returned from `openchannel_update` (where *commitments_secured* was true) with partial signatures or finalized witness stacks included for every input that we contributed to the PSBT." - ] - } - } - }, - "response": { - "required": [ - "channel_id", - "tx", - "txid" - ], - "properties": { - "channel_id": { - "type": "hash", - "description": [ - "The channel id of the channel." - ] - }, - "tx": { - "type": "hex", - "description": [ - "The funding transaction." - ] - }, - "txid": { - "type": "txid", - "description": [ - "The txid of the **tx**." - ] - } - } - }, - "errors": [ - "On error, the returned object will contain `code` and `message` properties, with `code` being one of the following:", - "", - "- -32602: If the given parameters are wrong.", - "- -1: Catchall nonspecific error.", - "- 303: Funding transaction broadcast failed.", - "- 305: Peer is not connected.", - "- 309: PSBT missing required fields.", - "- 311: Unknown channel id.", - "- 312: Channel in an invalid state" - ], - "author": [ - "Lisa Neigut <> is mainly responsible." - ], - "see_also": [ - "lightning-openchannel_init(7)", - "lightning-openchannel_update(7)", - "lightning-openchannel_abort(7)", - "lightning-openchannel_bump(7)", - "lightning-fundchannel_start(7)", - "lightning-fundchannel_complete(7)", - "lightning-fundchannel(7)", - "lightning-fundpsbt(7)", - "lightning-utxopsbt(7)", - "lightning-multifundchannel(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-openchannel_update.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "openchannel_update", - "title": "Command to update a collab channel open", - "description": [ - "`openchannel_update` is a low level RPC command which continues an open channel, as specified by *channel_id*. An updated *psbt* is passed in; any changes from the PSBT last returned (either from `openchannel_init` or a previous call to `openchannel_update`) will be communicated to the peer.", - "", - "Must be called after `openchannel_init` and before `openchannel_signed`.", - "", - "Must be called until *commitments_secured* is returned as true, at which point `openchannel_signed` should be called with a signed version of the PSBT returned by the last call to `openchannel_update`." - ], - "request": { - "required": [ - "channel_id", - "psbt" - ], - "properties": { - "channel_id": { - "type": "hash", - "description": [ - "Id of the channel." - ] - }, - "psbt": { - "type": "string", - "description": [ - "Updated PSBT to be sent to the peer. May be identical to the PSBT last returned by either `openchannel_init` or `openchannel_update`." - ] - } - } - }, - "response": { - "required": [ - "channel_id", - "psbt", - "commitments_secured", - "channel_type", - "funding_outnum" - ], - "properties": { - "channel_id": { - "type": "hash", - "description": [ - "The channel id of the channel." - ] - }, - "channel_type": { - "type": "object", - "description": [ - "Channel_type as negotiated with peer." - ], - "added": "v24.02", - "additionalProperties": false, - "required": [ - "bits", - "names" - ], - "properties": { - "bits": { - "type": "array", - "description": [ - "Each bit set in this channel_type." - ], - "added": "v24.02", - "items": { - "type": "u32", - "description": [ - "Bit number." - ] - } - }, - "names": { - "type": "array", - "description": [ - "Feature name for each bit set in this channel_type." - ], - "added": "v24.02", - "items": { - "type": "string", - "enum": [ - "static_remotekey/even", - "anchor_outputs/even", - "anchors_zero_fee_htlc_tx/even", - "scid_alias/even", - "zeroconf/even" - ], - "description": [ - "Name of feature bit." - ] - } - } + "datastore": [ + { + "key": [ + "otherkey" + ], + "generation": 0, + "hex": "6f7468657264617461", + "string": "otherdata" } - }, - "psbt": { + ] + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-datastore(7)", + "lightning-deldatastore(7)", + "lightning-datastoreusage(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-listforwards.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "listforwards", + "title": "Command showing all htlcs and their information", + "description": [ + "The **listforwards** RPC command displays all htlcs that have been attempted to be forwarded by the Core Lightning node." + ], + "request": { + "required": [], + "properties": { + "status": { "type": "string", "description": [ - "The PSBT of the funding transaction." + "If specified, then only the forwards with the given status are returned." + ], + "enum": [ + "offered", + "settled", + "local_failed", + "failed" ] }, - "commitments_secured": { - "type": "boolean", + "in_channel": { + "type": "short_channel_id", "description": [ - "Whether the *psbt* is complete (if true, sign *psbt* and call `openchannel_signed` to complete the channel open)." + "Only the matching forwards on the given inbound channel are returned." ] }, - "funding_outnum": { - "type": "u32", + "out_channel": { + "type": "short_channel_id", "description": [ - "The index of the funding output in the psbt." + "Only the matching forwards on the given outbount channel are returned." ] }, - "close_to": { - "type": "hex", + "index": { + "type": "string", + "added": "v23.11", + "enum": [ + "created", + "updated" + ], "description": [ - "Scriptpubkey which we have to close to if we mutual close." + "If neither *in_channel* nor *out_channel* is specified, it controls ordering." + ], + "default": "`created`" + }, + "start": { + "type": "u64", + "added": "v23.11", + "description": [ + "If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)." ] }, - "requires_confirmed_inputs": { - "type": "boolean", + "limit": { + "type": "u32", + "added": "v23.11", "description": [ - "Does peer require confirmed inputs in psbt?" + "If `index` is specified, `limit` can be used to specify the maximum number of entries to return." ] } }, - "allOf": [ - { - "if": { - "properties": { - "commitments_secured": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { + "dependentUpon": { + "index": [ + "start", + "limit" + ] + } + }, + "response": { + "required": [ + "forwards" + ], + "properties": { + "forwards": { + "type": "array", + "items": { + "type": "object", "additionalProperties": true, "required": [ - "channel_id", - "funding_outnum" + "created_index", + "in_channel", + "in_msat", + "status", + "received_time" ], "properties": { - "commitments_secured": {}, - "channel_id": { - "type": "hash", + "created_index": { + "added": "v23.11", + "type": "u64", "description": [ - "The derived channel id." + "1-based index indicating order this forward was created in." ] }, - "close_to": { - "type": "hex", + "in_channel": { + "type": "short_channel_id", "description": [ - "If a `close_to` address was provided to `openchannel_init` and the peer supports `option_upfront_shutdownscript`." + "The channel that received the HTLC." ] }, - "funding_outnum": { - "type": "u32", + "in_htlc_id": { + "type": "u64", "description": [ - "The index of the funding output for this channel in the funding transaction." + "The unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11)." + ] + }, + "in_msat": { + "type": "msat", + "description": [ + "The value of the incoming HTLC." + ] + }, + "status": { + "type": "string", + "enum": [ + "offered", + "settled", + "local_failed", + "failed" + ], + "description": [ + "Still ongoing, completed, failed locally, or failed after forwarding." + ] + }, + "received_time": { + "type": "number", + "description": [ + "The UNIX timestamp when this was received." + ] + }, + "out_channel": { + "type": "short_channel_id", + "description": [ + "The channel that the HTLC (trying to) forward to." + ] + }, + "out_htlc_id": { + "type": "u64", + "description": [ + "The unique HTLC id we gave this when sending (may be missing even if out_channel is present, for old forwards before v22.11)." + ] + }, + "updated_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this forward was changed (only present if it has changed since creation)." + ] + }, + "style": { + "type": "string", + "enum": [ + "legacy", + "tlv" + ], + "description": [ + "Either a legacy onion format or a modern tlv format." ] } - } - }, - "else": { - "additionalProperties": false, - "properties": { - "commitments_secured": {} - } + }, + "allOf": [ + { + "if": { + "required": [ + "out_msat" + ] + }, + "then": { + "additionalProperties": false, + "required": [ + "fee_msat", + "out_msat", + "out_channel" + ], + "properties": { + "created_index": {}, + "updated_index": {}, + "in_channel": {}, + "in_htlc_id": {}, + "in_msatoshi": {}, + "in_msat": {}, + "status": {}, + "style": {}, + "received_time": {}, + "resolved_time": {}, + "out_channel": {}, + "out_htlc_id": {}, + "failcode": {}, + "failreason": {}, + "fee_msat": { + "type": "msat", + "description": [ + "The amount this paid in fees." + ] + }, + "out_msat": { + "type": "msat", + "description": [ + "The amount we sent out the *out_channel*." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [], + "properties": { + "created_index": {}, + "updated_index": {}, + "in_channel": {}, + "in_htlc_id": {}, + "in_msatoshi": {}, + "in_msat": {}, + "status": {}, + "style": {}, + "received_time": {}, + "resolved_time": {}, + "failcode": {}, + "failreason": {}, + "out_channel": {} + } + } + }, + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "settled", + "failed" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "resolved_time" + ], + "properties": { + "created_index": {}, + "updated_index": {}, + "in_channel": {}, + "in_htlc_id": {}, + "in_msatoshi": {}, + "in_msat": {}, + "status": {}, + "style": {}, + "received_time": {}, + "out_channel": {}, + "out_htlc_id": {}, + "fee": {}, + "fee_msat": {}, + "out_msatoshi": {}, + "out_msat": {}, + "failcode": {}, + "failreason": {}, + "resolved_time": { + "type": "number", + "description": [ + "The UNIX timestamp when this was resolved." + ] + } + } + }, + "else": { + "additionalProperties": false, + "properties": { + "created_index": {}, + "updated_index": {}, + "in_channel": {}, + "in_htlc_id": {}, + "in_msatoshi": {}, + "in_msat": {}, + "status": {}, + "style": {}, + "received_time": {}, + "out_channel": {}, + "out_htlc_id": {}, + "fee": {}, + "fee_msat": {}, + "failcode": {}, + "failreason": {}, + "out_msatoshi": {}, + "out_msat": {} + } + } + }, + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "local_failed", + "failed" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [], + "properties": { + "created_index": {}, + "updated_index": {}, + "in_channel": {}, + "in_htlc_id": {}, + "in_msatoshi": {}, + "in_msat": {}, + "status": {}, + "style": {}, + "received_time": {}, + "out_channel": {}, + "out_htlc_id": {}, + "fee": {}, + "fee_msat": {}, + "out_msatoshi": {}, + "out_msat": {}, + "resolved_time": {}, + "failcode": { + "type": "u32", + "description": [ + "The numeric onion code returned." + ] + }, + "failreason": { + "type": "string", + "description": [ + "The name of the onion code returned." + ] + } + } + }, + "else": { + "additionalProperties": false, + "required": [], + "properties": { + "created_index": {}, + "updated_index": {}, + "in_channel": {}, + "in_htlc_id": {}, + "in_msatoshi": {}, + "in_msat": {}, + "status": {}, + "style": {}, + "received_time": {}, + "out_channel": {}, + "out_htlc_id": {}, + "fee": {}, + "fee_msat": {}, + "out_msatoshi": {}, + "out_msat": {}, + "resolved_time": {} + } + } + } + ] } } - ] + } }, - "errors": [ - "On error, the returned object will contain `code` and `message` properties,", - "with `code` being one of the following:", - "", - "- -32602: If the given parameters are wrong.", - "- -1: Catchall nonspecific error.", - "- 305: Peer is not connected.", - "- 309: PSBT missing required fields", - "- 311: Unknown channel id.", - "- 312: Channel in an invalid state" - ], "example_json_request": [ { - "id": "example:openchannel_update#1", - "method": "openchannel_update", + "id": "example:listforwards#1", + "method": "listforwards", "params": { - "channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e", - "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA" + "status": null, + "in_channel": null, + "out_channel": null, + "index": null, + "start": null, + "limit": null } }, { - "id": "example:openchannel_update#2", - "method": "openchannel_update", + "id": "example:listforwards#2", + "method": "listforwards", "params": { - "channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e", - "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA" + "in_channel": "0x1x2", + "out_channel": "0x2x3", + "status": "settled" } } ], "example_json_response": [ { - "channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e", - "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA", - "channel_type": { - "bits": [ - 12, - 22 - ], - "names": [ - "static_remotekey/even", - "anchors_zero_fee_htlc_tx/even" - ] - }, - "commitments_secured": true, - "funding_outnum": 0 - }, - { - "channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e", - "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA", - "channel_type": { - "bits": [ - 12, - 22 - ], - "names": [ - "static_remotekey/even", - "anchors_zero_fee_htlc_tx/even" - ] - }, - "commitments_secured": true, - "funding_outnum": 0, - "close_to": "5120eed745804da9784cc203f563efa99ffa54fdf01b137bc964e63c3124070ffbe6" + "forwards": [ + { + "created_index": 1, + "updated_index": 1, + "in_channel": "103x1x0", + "in_htlc_id": 0, + "out_channel": "104x1x0", + "out_htlc_id": 0, + "in_msat": 100001001, + "out_msat": 100000000, + "fee_msat": 1001, + "status": "settled", + "style": "tlv", + "received_time": 1706229285.5934534, + "resolved_time": 1706229288.830004 + }, + { + "created_index": 2, + "updated_index": 2, + "in_channel": "103x1x0", + "in_htlc_id": 1, + "out_channel": "105x1x0", + "out_htlc_id": 0, + "in_msat": 100001001, + "out_msat": 100000000, + "fee_msat": 1001, + "status": "failed", + "style": "tlv", + "received_time": 1706229290.0289993, + "resolved_time": 1706229292.9487684 + }, + { + "created_index": 3, + "updated_index": 3, + "in_channel": "103x1x0", + "in_htlc_id": 2, + "out_channel": "106x1x0", + "out_htlc_id": 0, + "in_msat": 100001000, + "out_msat": 99999999, + "fee_msat": 1001, + "status": "local_failed", + "failcode": 16392, + "failreason": "WIRE_PERMANENT_CHANNEL_FAILURE", + "style": "tlv", + "received_time": 1706229295.3175724 + } + ] + }, + { + "forwards": [] } ], "author": [ - "Lisa Neigut <> is mainly responsible." + "Rene Pickhardt <> is mainly responsible." ], "see_also": [ - "lightning-openchannel_init(7)", - "lightning-openchannel_signed(7)", - "lightning-openchannel_bump(7)", - "lightning-openchannel_abort(7)", - "lightning-fundchannel_start(7)", - "lightning-fundchannel_complete(7)", - "lightning-fundchannel(7)", - "lightning-fundpsbt(7)", - "lightning-utxopsbt(7)", - "lightning-multifundchannel(7)" + "lightning-autoclean-status(7)", + "lightning-getinfo(7)" ], "resources": [ "Main web site: " ] }, - "lightning-parsefeerate.json": { + "lightning-listfunds.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "parsefeerate", - "title": "Command for parsing a feerate string to a feerate", + "rpc": "listfunds", + "title": "Command showing all funds currently managed by the Core Lightning node", "description": [ - "The **parsefeerate** command returns the current feerate for any valid *feerate_str*. This is useful for finding the current feerate that a **fundpsbt** or **utxopsbt** command might use." + "The **listfunds** RPC command displays all funds available, either in unspent outputs (UTXOs) in the internal wallet or funds locked in currently open channels." ], "request": { - "required": [ - "feerate_str" - ], - "properties": { - "feerate_str": { - "type": "string", - "description": [ - "The feerate string to parse." - ] - } - } - }, - "response": { "required": [], "properties": { - "perkw": { - "type": "u32", + "spent": { + "type": "boolean", "description": [ - "Value of *feerate_str* in kilosipa." + "If True, then the *outputs* will include spent outputs in addition to the unspent ones." ], - "additionalProperties": false + "default": "False" } } }, - "example_json_request": [ - { - "id": "example:parsefeerate#1", - "method": "parsefeerate", - "params": [ - "unilateral_close" - ] - }, - { - "id": "example:parsefeerate#2", - "method": "parsefeerate", - "params": [ - "9999perkw" - ] - }, - { - "id": "example:parsefeerate#3", - "method": "parsefeerate", - "params": [ - 10000 - ] - }, - { - "id": "example:parsefeerate#4", - "method": "parsefeerate", - "params": [ - "urgent" - ] - } - ], - "example_json_response": [ - { - "perkw": 11000 - }, - { - "perkw": 9999 - }, - { - "perkw": 2500 - }, - { - "perkw": 11000 - } - ], - "errors": [ - "The **parsefeerate** command will error if the *feerate_str* format is not recognized.", - "", - "- -32602: If the given parameters are wrong." - ], - "trivia": [ - "In CLN we like to call the weight unit \"sipa\" in honor of Pieter Wuille, who uses the name \"sipa\" on IRC and elsewhere. Internally we call the *perkw* style as \"feerate per kilosipa\"." - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-pay.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "pay", - "title": "Command for sending a payment to a BOLT11 invoice", - "description": [ - "The **pay** RPC command attempts to find a route to the given destination, and send the funds it asks for. .", - "", - "The response will occur when the payment fails or succeeds. Once a payment has succeeded, calls to **pay** with the same *bolt11* will succeed immediately.", - "", - "When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name." - ], - "request": { + "response": { "required": [ - "bolt11" + "outputs", + "channels" ], "properties": { - "bolt11": { - "type": "string", - "description": [ - "Bolt11 invoice, if **experimental-offers** is enabled, it can actually be a bolt12 invoice, such as one received from lightningd-fetchinvoice(7). If it does not contain an amount, *amount_msat* is required, otherwise if it is specified it must be *null*." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "*amount_msat* is in millisatoshi precision; it can be a whole number, or a whole number with suffix *msat* or *sat*, or a three decimal point number with suffix *sat*, or an 1 to 11 decimal point number suffixed by *btc*." - ] - }, - "label": { - "type": "string", - "description": [ - "It is used to attach a label to payments, and is returned in lightning- listpays(7) and lightning-listsendpays(7)." - ] - }, - "riskfactor": { - "type": "number", - "description": [ - "The *riskfactor* is described in detail in lightning-getroute(7)." - ], - "default": "10" - }, - "maxfeepercent": { - "type": "number", - "description": [ - "Percentage of the amount that is to be paid." - ], - "default": "0.5" - }, - "retry_for": { - "type": "u16", - "description": [ - "Until *retry_for* seconds passes, the command will keep finding routes and retrying the payment." - ], - "default": "60 seconds" - }, - "maxdelay": { - "type": "u16", - "description": [ - "A payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case." - ] - }, - "exemptfee": { - "type": "msat", - "description": [ - "This option can be used for tiny payments which would be dominated by the fee leveraged by forwarding nodes. Setting `exemptfee` allows the `maxfeepercent` check to be skipped on fees that are smaller than `exemptfee`." - ], - "default": "5000 millisatoshi" - }, - "localinvreqid": { - "type": "hex", - "description": [ - "`localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7). This ensures that we only make a single payment for an offer, and that the offer is marked `used` once paid." - ] - }, - "exclude": { + "outputs": { "type": "array", - "description": [ - "*exclude* is a JSON array of short-channel-id/direction (e.g. [ '564334x877x1/0', '564195x1292x0/1' ]) or pubkey which should be excluded from consideration for routing." - ], - "default": "not to exclude any channels or nodes", "items": { - "oneOf": [ + "type": "object", + "additionalProperties": true, + "required": [ + "txid", + "output", + "amount_msat", + "scriptpubkey", + "status", + "reserved" + ], + "properties": { + "txid": { + "type": "txid", + "description": [ + "The ID of the spendable transaction." + ] + }, + "output": { + "type": "u32", + "description": [ + "The index within *txid*." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount of the output." + ] + }, + "scriptpubkey": { + "type": "hex", + "description": [ + "The scriptPubkey of the output." + ] + }, + "address": { + "type": "string", + "description": [ + "The bitcoin address of the output." + ] + }, + "redeemscript": { + "type": "hex", + "description": [ + "The redeemscript, only if it's p2sh-wrapped." + ] + }, + "status": { + "type": "string", + "enum": [ + "unconfirmed", + "confirmed", + "spent", + "immature" + ] + }, + "reserved": { + "type": "boolean", + "description": [ + "Whether this UTXO is currently reserved for an in-flight tx." + ] + } + }, + "allOf": [ { - "type": "short_channel_id_dir" + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "confirmed" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "blockheight" + ], + "properties": { + "txid": {}, + "output": {}, + "amount_msat": {}, + "scriptpubkey": {}, + "address": {}, + "value": {}, + "redeemscript": {}, + "status": {}, + "reserved": {}, + "reserved_to_block": {}, + "blockheight": { + "type": "u32", + "description": [ + "Block height where it was confirmed." + ] + } + } + } }, { - "type": "pubkey" + "if": { + "properties": { + "reserved": { + "type": "boolean", + "enum": [ + "true" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "reserved_to_block" + ], + "properties": { + "txid": {}, + "output": {}, + "amount_msat": {}, + "scriptpubkey": {}, + "address": {}, + "value": {}, + "redeemscript": {}, + "status": {}, + "blockheight": {}, + "reserved": {}, + "reserved_to_block": { + "type": "u32", + "description": [ + "Block height where reservation will expire." + ] + } + } + } } ] } }, - "maxfee": { - "type": "msat", - "description": [ - "*maxfee* overrides both *maxfeepercent* and *exemptfee* defaults (and if you specify *maxfee* you cannot specify either of those), and creates an absolute limit on what fee we will pay. This allows you to implement your own heuristics rather than the primitive ones used here." - ] - }, - "description": { - "type": "string", - "description": [ - "It is only required for bolt11 invoices which do not contain a description themselves, but contain a description hash: in this case *description* is required. *description* is then checked against the hash inside the invoice before it will be paid." - ] - } - } - }, - "response": { - "required": [ - "payment_preimage", - "payment_hash", - "created_at", - "parts", - "amount_msat", - "amount_sent_msat", - "status" - ], - "properties": { - "payment_preimage": { - "type": "secret", - "description": [ - "The proof of payment: SHA256 of this **payment_hash**." - ] - }, - "destination": { - "type": "pubkey", - "description": [ - "The final destination of the payment." - ] - }, - "payment_hash": { - "type": "hash", - "description": [ - "The hash of the *payment_preimage* which will prove payment." - ] - }, - "created_at": { - "type": "number", - "description": [ - "The UNIX timestamp showing when this payment was initiated." - ] - }, - "parts": { - "type": "u32", - "description": [ - "How many attempts this took." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "Amount the recipient received." - ] - }, - "amount_sent_msat": { - "type": "msat", - "description": [ - "Total amount we sent (including fees)." - ] - }, - "warning_partial_completion": { - "type": "string", - "description": [ - "Not all parts of a multi-part payment have completed." - ] - }, - "status": { - "type": "string", - "enum": [ - "complete", - "pending", - "failed" - ], - "description": [ - "Status of payment." - ] + "channels": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "peer_id", + "our_amount_msat", + "amount_msat", + "funding_txid", + "funding_output", + "connected", + "state", + "channel_id" + ], + "properties": { + "peer_id": { + "type": "pubkey", + "description": [ + "The peer with which the channel is opened." + ] + }, + "our_amount_msat": { + "type": "msat", + "description": [ + "Available satoshis on our node's end of the channel." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Total channel value." + ] + }, + "funding_txid": { + "type": "txid", + "description": [ + "Funding transaction id." + ] + }, + "funding_output": { + "type": "u32", + "description": [ + "The 0-based index of the output in the funding transaction." + ] + }, + "connected": { + "type": "boolean", + "description": [ + "Whether the channel peer is connected." + ] + }, + "state": { + "type": "string", + "enum": [ + "OPENINGD", + "CHANNELD_AWAITING_LOCKIN", + "CHANNELD_NORMAL", + "CHANNELD_SHUTTING_DOWN", + "CLOSINGD_SIGEXCHANGE", + "CLOSINGD_COMPLETE", + "AWAITING_UNILATERAL", + "FUNDING_SPEND_SEEN", + "ONCHAIN", + "DUALOPEND_OPEN_INIT", + "DUALOPEND_AWAITING_LOCKIN", + "DUALOPEND_OPEN_COMMITTED", + "DUALOPEND_OPEN_COMMIT_READY" + ], + "description": [ + "The channel state, in particular `CHANNELD_NORMAL` means the channel can be used normally." + ] + }, + "channel_id": { + "type": "hash", + "description": [ + "The full channel_id (funding txid Xored with output number)." + ], + "added": "v23.05" + } + }, + "allOf": [ + { + "if": { + "properties": { + "state": { + "type": "string", + "enum": [ + "CHANNELD_NORMAL" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "short_channel_id" + ], + "properties": { + "peer_id": {}, + "our_amount_msat": {}, + "channel_sat": {}, + "amount_msat": {}, + "channel_total_sat": {}, + "funding_txid": {}, + "funding_output": {}, + "connected": {}, + "state": {}, + "channel_id": {}, + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "Short channel id of channel." + ] + } + } + } + }, + { + "if": { + "properties": { + "state": { + "type": "string", + "enum": [ + "CHANNELD_SHUTTING_DOWN", + "CLOSINGD_SIGEXCHANGE", + "CLOSINGD_COMPLETE", + "AWAITING_UNILATERAL", + "FUNDING_SPEND_SEEN", + "ONCHAIN" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [], + "properties": { + "peer_id": {}, + "our_amount_msat": {}, + "channel_sat": {}, + "amount_msat": {}, + "channel_total_sat": {}, + "funding_txid": {}, + "funding_output": {}, + "connected": {}, + "state": {}, + "channel_id": {}, + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "Short channel id of channel (only if funding reached lockin depth before closing)." + ] + } + } + } + } + ] + } } - }, - "post_return_value_notes": [ - "You can monitor the progress and retries of a payment using the lightning-paystatus(7) command." - ] + } }, - "randomization": [ - "To protect user privacy, the payment algorithm performs some randomization.", - "", - "1: Route Randomization", - "", - "Route randomization means the payment algorithm does not always use the lowest-fee or shortest route. This prevents some highly-connected node from learning all of the user payments by reducing their fees below the network average.", - "", - "2: Shadow Route", - "", - "Shadow route means the payment algorithm will virtually extend the route by adding delays and fees along it, making it appear to intermediate nodes that the route is longer than it actually is. This prevents intermediate nodes from reliably guessing their distance from the payee.", - "", - "Route randomization will never exceed *maxfeepercent* of the payment. Route randomization and shadow routing will not take routes that would exceed *maxdelay*." - ], - "errors": [ - "The following error codes may occur:", - "", - "- -1: Catchall nonspecific error.", - "- 201: Already paid with this *hash* using different amount or destination.", - "- 203: Permanent failure at destination. The *data* field of the error will be routing failure object (except for self-payment, which currently returns the error directly from lightning-sendpay(7)).", - "- 205: Unable to find a route.", - "- 206: Route too expensive. Either the fee or the needed total locktime for the route exceeds your *maxfeepercent* or *maxdelay* settings, respectively. The *data* field of the error will indicate the actual *fee* as well as the *feepercent* percentage that the fee has of the destination payment amount. It will also indicate the actual *delay* along the route.", - "- 207: Invoice expired. Payment took too long before expiration, or already expired at the time you initiated payment. The *data* field of the error indicates *now* (the current time) and *expiry* (the invoice expiration) as UNIX epoch time in seconds.", - "- 210: Payment timed out without a payment in progress.", - "", - "Error codes 202 and 204 will only get reported at **sendpay**; in **pay** we will keep retrying if we would have gotten those errors.", - "", - "A routing failure object has the fields below:", - "", - "*erring_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on.", - "*erring_node*: The hex string of the pubkey id of the node that reported the error.", - "*erring_channel*: The short channel ID of the channel that has the error, or *0:0:0* if the destination node raised the error.", - "*failcode*: The failure code, as per BOLT #4.", - "*channel_update*: The hex string of the *channel_update* message received from the remote node. Only present if error is from the remote node and the *failcode* has the UPDATE bit set, as per BOLT #4.", - "", - "The *data* field of errors will include statistics *getroute_tries* and *sendpay_tries*. It will also contain a *failures* field with detailed data about routing errors." - ], "example_json_request": [ { - "id": "example:pay#1", - "method": "pay", + "id": "example:listfunds#1", + "method": "listfunds", "params": { - "bolt11": "lni1qqgxr7gha7gusyg83lsr8qcqg4axgq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqtypg3hgetnwsszycn0d36rzv3zypjx2umrwf5hqarfdahzcg8sn7jmpuyl423pvggzvmj9nrga83q474e2sjygxzmq7ln5fmvjxh4skxafx2pmx9wqx5v9qgqxyfhyvyg6pdvu4tcjvpp7kkal9rp57wj7xv4pl3ajku70rzy3pavzzqjz06c8s2vvmrpjlkcse0txx0gmc6jalqqxmeyjm75qcnfnqxwyt2sfsqnxu3vc68fug904w25y3zpskc8huazwmy34av93h2fjswe3tsp4rqpe8qlx9xssexfc0aguke3q6u0jgw2qmn008mzu04mkmqmjmhes3gcpqdqdnzl270s48vsp635rd4jm04snvgkcp65qlkgp8qztu2mdp7c5uqpj2rll3pzu56st537rct3v62gfqeamzthjuwkr0pkvsdnnffpn4sq9sz0lryaufktx0nfxlffum3yesqev5gwqqqqqqqqqqqqqqqzsqqqqqqqqqqqqr5jt9hav2gqqqqqq5szxtvwkyz5zq2000hlwvadejz366lqjt9sd2j4rf5tfd9rgmmyegt4dqd34cf6v4gqkfvppqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq633uzqn3n74ccym4wcvq20vsx7lmk450kprpvlrh4cukk8xy9ptjcef4rnhytnkyn4vnxxtd57yeaksze2s30y26cs6u3rjd9322eg9puk24q", - "amount_msat": null, - "label": null, - "riskfactor": null, - "maxfeepercent": null, - "retry_for": null, - "maxdelay": null, - "exemptfee": null, - "localinvreqid": null, - "exclude": null, - "maxfee": null, - "description": null + "spent": null } } ], "example_json_response": [ { - "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "payment_hash": "29ef7dfee675b990a3ad7c125960d54aa34d16969468dec9942ead03635c274c", - "created_at": 1706153504.76628, - "parts": 1, - "amount_msat": 100, - "amount_sent_msat": 100, - "payment_preimage": "6634c1b549c6615d234832f377e06d5a5ab088c40cebdc5cfb8c1262030abcad", - "status": "complete" + "outputs": [ + { + "txid": "0f184b101569bf777af3449fa266948a9d55768f97867e48416a2c92858dd1bc", + "output": 1, + "amount_msat": 1111111000, + "scriptpubkey": "001401fad90abcd66697e2592164722de4a95ebee165", + "address": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf", + "status": "confirmed", + "blockheight": 102, + "reserved": false + }, + { + "txid": "4bee7dc3a28f2434e9bb3e9aaab418dd276485a8705b0f787bf741d3f979ec3b", + "output": 1, + "amount_msat": 1111111000, + "scriptpubkey": "001401fad90abcd66697e2592164722de4a95ebee165", + "address": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf", + "status": "confirmed", + "blockheight": 102, + "reserved": false + } + ], + "channels": [] } ], "author": [ - "Rusty Russell <> is mainly responsible." + "Felix <> is mainly responsible." ], "see_also": [ - "lightning-listpays(7)", - "lightning-decodepay(7)", - "lightning-listinvoice(7)", - "lightning-delinvoice(7)", - "lightning-getroute(7)", - "lightning-invoice(7)" + "lightning-newaddr(7)", + "lightning-fundchannel(7)", + "lightning-withdraw(7)", + "lightning-listtransactions(7)" ], "resources": [ "Main web site: " ] }, - "lightning-ping.json": { + "lightning-listhtlcs.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "ping", - "title": "Command to check if a node is up.", + "rpc": "listhtlcs", + "title": "Command for querying HTLCs", "description": [ - "The **ping** command checks if the node with *id* is ready to talk. It currently only works for peers we have a channel with." + "The **listhtlcs** RPC command gets all HTLCs (which, generally, we remember for as long as a channel is open, even if they've completed long ago)." ], "request": { - "required": [ - "id" - ], + "required": [], "properties": { "id": { - "type": "pubkey", + "type": "string", "description": [ - "The pubkey of the node to ping." + "A short channel id (e.g. 1x2x3) or full 64-byte hex channel id, it will only list htlcs for that channel (which must be known)." ] - }, - "len": { - "type": "u16", - "description": [ - "The length of the ping." - ], - "default": "128" - }, - "pongbytes": { - "type": "u16", - "description": [ - "The length of the reply. A value of 65532 to 65535 means `don't reply`." - ], - "default": "128" } } }, "response": { "required": [ - "totlen" - ], - "properties": { - "totlen": { - "type": "u16", - "description": [ - "The answer length of the reply message (including header: 0 means no reply expected)." - ] - } - } - }, - "example_json_request": [ - { - "id": "example:ping#1", - "method": "ping", - "params": { - "len": 128, - "pongbytes": 128 - } - }, - { - "id": "example:ping#2", - "method": "ping", - "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "len": 1000, - "pongbytes": 65535 - } - } - ], - "errors": [ - "On failure, one of the following error codes may be returned:", - "", - "- -32602: Error in given parameters or we're already waiting for a ping response from peer." - ], - "example_json_response": [ - { - "totlen": 132 - }, - { - "totlen": 0 - } - ], - "author": [ - "Vincenzo Palazzo <> wrote the initial version of this man page,", - "but many others did the hard work of actually implementing this rpc command." - ], - "see_also": [ - "lightning-connect(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-plugin.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": true, - "rpc": "plugin", - "title": "Manage plugins with RPC", - "description": [ - "The **plugin** RPC command can be used to control dynamic plugins, i.e. plugins that declared themself 'dynamic' (in getmanifest)." - ], - "request": { - "required": [ - "subcommand" - ], - "oneOfMany": [ - [ - "plugin", - "directory" - ] + "htlcs" ], "properties": { - "subcommand": { - "type": "string", - "enum": [ - "start", - "stop", - "rescan", - "startdir", - "list" - ], - "description": [ - "Determines what action is taken:", - " - *subcommand* **start** takes a *path* to an executable as argument and starts it as plugin. *path* may be an absolute path or a path relative to the plugins directory (default *~/.lightning/plugins*). If the plugin is already running and the executable (checksum) has changed, the plugin is killed and restarted except if its an important (or builtin) plugin. If the plugin doesn't complete the 'getmanifest' and 'init' handshakes within 60 seconds, the command will timeout and kill the plugin. Additional *options* may be passed to the plugin, but requires all parameters to be passed as keyword=value pairs using the `-k|--keyword` option which is recommended. For example the following command starts the plugin helloworld.py (present in the plugin directory) with the option greeting set to 'A crazy':", - " ```shell.", - " lightning-cli -k plugin subcommand=start plugin=helloworld.py greeting='A crazy'.", - " ```.", - " - *subcommand* **stop** takes a plugin executable *path* or *name* as argument and stops the plugin. If the plugin subscribed to 'shutdown', it may take up to 30 seconds before this command returns. If the plugin is important and dynamic, this will shutdown `lightningd`.", - " - *subcommand* **startdir** starts all executables it can find in *directory* (excl. subdirectories) as plugins. Checksum and timeout behavior as in **start** applies.", - " - *subcommand* **rescan** starts all plugins in the default plugins directory (default *~/.lightning/plugins*) that are not already running. Checksum and timeout behavior as in **start** applies.", - " - *subcommand* **list** lists all running plugins (incl. non-dynamic)." - ] - }, - "plugin": { - "type": "string", - "description": [ - "*path* or *name* of a plugin executable to start or stop." - ] - }, - "directory": { - "type": "string", - "description": [ - "*path* of a directory containing plugins." - ] - }, - "options": { + "htlcs": { "type": "array", "items": { - "type": "string", - "description": [ - "*keyword=value* options passed to plugin, can be repeated." - ] - } - } - } - }, - "response": { - "required": [ - "command" - ], - "properties": { - "command": { - "type": "string", - "enum": [ - "start", - "stop", - "rescan", - "startdir", - "list" - ], - "description": [ - "The subcommand this is responding to." - ] - } - }, - "allOf": [ - { - "if": { - "properties": { - "command": { - "type": "string", - "enum": [ - "start", - "startdir", - "rescan", - "list" - ] - } - } - }, - "then": { + "type": "object", "additionalProperties": false, "required": [ - "command", - "plugins" + "short_channel_id", + "id", + "expiry", + "direction", + "amount_msat", + "payment_hash", + "state" ], "properties": { - "command": {}, - "plugins": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "name", - "active", - "dynamic" - ], - "properties": { - "name": { - "type": "string", - "description": [ - "Full pathname of the plugin." - ] - }, - "active": { - "type": "boolean", - "description": [ - "Status; plugin completed init and is operational, plugins are configured asynchronously." - ] - }, - "dynamic": { - "type": "boolean", - "description": [ - "Plugin can be stopped or started without restarting lightningd." - ] - } - } - } - } - } - } - }, - { - "if": { - "properties": { - "command": { + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "The channel that contains/contained the HTLC." + ] + }, + "id": { + "type": "u64", + "description": [ + "The unique, incrementing HTLC id the creator gave this." + ] + }, + "expiry": { + "type": "u32", + "description": [ + "The block number where this HTLC expires/expired." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The value of the HTLC." + ] + }, + "direction": { "type": "string", "enum": [ - "stop" + "out", + "in" + ], + "description": [ + "Out if we offered this to the peer, in if they offered it." ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "command", - "result" - ], - "properties": { - "command": {}, - "result": { + }, + "payment_hash": { + "type": "hash", + "description": [ + "Payment hash sought by HTLC." + ] + }, + "state": { "type": "string", + "enum": [ + "SENT_ADD_HTLC", + "SENT_ADD_COMMIT", + "RCVD_ADD_REVOCATION", + "RCVD_ADD_ACK_COMMIT", + "SENT_ADD_ACK_REVOCATION", + "RCVD_REMOVE_HTLC", + "RCVD_REMOVE_COMMIT", + "SENT_REMOVE_REVOCATION", + "SENT_REMOVE_ACK_COMMIT", + "RCVD_REMOVE_ACK_REVOCATION", + "RCVD_ADD_HTLC", + "RCVD_ADD_COMMIT", + "SENT_ADD_REVOCATION", + "SENT_ADD_ACK_COMMIT", + "RCVD_ADD_ACK_REVOCATION", + "SENT_REMOVE_HTLC", + "SENT_REMOVE_COMMIT", + "RCVD_REMOVE_REVOCATION", + "RCVD_REMOVE_ACK_COMMIT", + "SENT_REMOVE_ACK_REVOCATION" + ], "description": [ - "A message saying it successfully stopped." + "The first 10 states are for `in`, the next 10 are for `out`." ] } } } } - ] + } }, - "errors": [ - "On error, the reason why the action could not be taken upon the plugin is returned." - ], "example_json_request": [ { - "id": "example:plugin#1", - "method": "plugin", + "id": "example:listhtlcs#1", + "method": "listhtlcs", + "params": "{}" + }, + { + "id": "example:listhtlcs#2", + "method": "listhtlcs", "params": [ - "list" + "103x2x0" ] }, { - "id": "example:plugin#2", - "method": "plugin", - "params": { - "subcommand": "stop", - "plugin": "fail_htlcs.py" - } + "id": "example:listhtlcs#3", + "method": "listhtlcs", + "params": [ + "436c2658eb4f4689b42ff11b8b05f31ba09860d0df7168085e0796cdf40f85e0" + ] } ], "example_json_response": [ { - "command": "list", - "plugins": [ - { - "name": "~/lightning/plugins/autoclean", - "active": true, - "dynamic": false - }, - { - "name": "~/lightning/plugins/chanbackup", - "active": true, - "dynamic": false - }, - { - "name": "~/lightning/plugins/bcli", - "active": true, - "dynamic": false - }, - { - "name": "~/lightning/plugins/commando", - "active": true, - "dynamic": false - }, + "htlcs": [ { - "name": "~/lightning/plugins/funder", - "active": true, - "dynamic": true + "short_channel_id": "103x1x0", + "id": 0, + "expiry": 117, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "d2668e77c5a2220496e813de36f1fc09ba804b16af4c6bb38299d8a6eb8a5f10", + "state": "RCVD_REMOVE_ACK_REVOCATION" }, { - "name": "~/lightning/plugins/topology", - "active": true, - "dynamic": false + "short_channel_id": "103x1x0", + "id": 1, + "expiry": 117, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "286e08ac8f575f10508d751fcfc93871b4344271967c7b9e5eacb3f3573b8307", + "state": "RCVD_REMOVE_ACK_REVOCATION" }, { - "name": "~/lightning/plugins/keysend", - "active": true, - "dynamic": false + "short_channel_id": "103x1x0", + "id": 2, + "expiry": 135, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "3e4baa750ee3dfb934578f041ccb40b87432bf37ec65c9d7bce5ff28fecbd95f", + "state": "RCVD_REMOVE_ACK_REVOCATION" }, { - "name": "~/lightning/plugins/offers", - "active": true, - "dynamic": true - }, + "short_channel_id": "103x1x0", + "id": 3, + "expiry": 135, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "4c3ce32565dc10ef2bd230c32802ce2fe8b007208c0a90757aa289f75c994d49", + "state": "SENT_REMOVE_REVOCATION" + } + ] + }, + { + "htlcs": [ { - "name": "~/lightning/plugins/pay", - "active": true, - "dynamic": true + "short_channel_id": "103x2x0", + "id": 0, + "expiry": 117, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "12bb14b1d119e1ae0759e5ff6f1f6653e3fd8f71ea59411500d2871404a47a98", + "state": "RCVD_REMOVE_ACK_REVOCATION" }, { - "name": "~/lightning/plugins/txprepare", - "active": true, - "dynamic": true + "short_channel_id": "103x2x0", + "id": 1, + "expiry": 117, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "57d950209cc0b4fcc5e3027569232f96cf83ef85314c6b139a5713848d811a66", + "state": "RCVD_REMOVE_ACK_REVOCATION" }, { - "name": "~/lightning/plugins/cln-renepay", - "active": true, - "dynamic": true + "short_channel_id": "103x2x0", + "id": 2, + "expiry": 135, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "45ad4654715411a07a0ad6ec3f4bfaa918c90e3d1934b10b1c1c5846523ddd7f", + "state": "RCVD_REMOVE_ACK_REVOCATION" }, { - "name": "~/lightning/plugins/spenderp", - "active": true, - "dynamic": false - }, + "short_channel_id": "103x2x0", + "id": 3, + "expiry": 135, + "direction": "out", + "amount_msat": 100001001, + "payment_hash": "cc0dcd214aa71c62bfba711a0746da821f2cdba1770b11c225920bdde12c931e", + "state": "RCVD_REMOVE_ACK_REVOCATION" + } + ] + }, + { + "htlcs": [ { - "name": "~/lightning/plugins/sql", - "active": true, - "dynamic": true + "short_channel_id": "103x1x0", + "id": 0, + "expiry": 124, + "direction": "out", + "amount_msat": 1001, + "payment_hash": "2ab653668c8017ff2f36ac36678a8da04e11380bd9580a2926b170523b0c6e3b", + "state": "RCVD_REMOVE_ACK_REVOCATION" }, { - "name": "~/lightning/plugins/bookkeeper", - "active": true, - "dynamic": false + "short_channel_id": "103x1x0", + "id": 1, + "expiry": 124, + "direction": "out", + "amount_msat": 2001, + "payment_hash": "92f889cb2e48aa28e1e577228b907cdbcc371a2c018e9c8f60fa7036e232cf1d", + "state": "RCVD_REMOVE_ACK_REVOCATION" }, { - "name": "~/lightning/target/debug/examples/cln-plugin-startup", - "active": true, - "dynamic": false + "short_channel_id": "103x1x0", + "id": 2, + "expiry": 128, + "direction": "out", + "amount_msat": 4001, + "payment_hash": "14ef01c9fb12d7dcac288f48ce87b19a7d5c3d5779aaed1e4adcb5c5d0e9fa45", + "state": "RCVD_REMOVE_ACK_REVOCATION" } ] - }, - { - "command": "stop", - "result": "Successfully stopped fail_htlcs.py." } ], "author": [ - "Antoine Poinsot <> is mainly responsible." + "Rusty Russell <> is mainly responsible." ], "see_also": [ - "lightning-cli(1)", - "lightning-listconfigs(1)", - "[writing plugins][writing plugins]" + "lightning-listforwards(7)" ], "resources": [ - "Main web site: ", - "", - "[writing plugins]: PLUGINS.md" + "Main web site: " ] }, - "lightning-preapproveinvoice.json": { + "lightning-listinvoicerequests.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "added": "v23.02", - "rpc": "preapproveinvoice", - "title": "Ask the HSM to preapprove an invoice (low-level)", + "added": "v22.11", + "rpc": "listinvoicerequests", + "title": "Command for querying invoice_request status", "description": [ - "The **preapproveinvoice** RPC command submits the *bolt11* invoice to the HSM to check that it is approved for payment.", - "", - "Generally the **preapproveinvoice** request does not need to be made explicitly, it is automatically generated as part of a **pay** request.", - "", - "By default, the HSM will approve all **preapproveinvoice** requests.", - "", - "If a remote signer is being used it might decline an **preapproveinvoice** request because it would exceed velocity controls, is not covered by allowlist controls, was declined manually, or other reasons.", - "", - "If a remote signer declines a **preapproveinvoice** request a subsequent attempt to pay the invoice anyway will fail; the signer will refuse to sign the commitment." + "The **listinvoicerequests** RPC command gets the status of a specific `invoice_request`, if it exists, or the status of all `invoice_requests` if given no argument." ], "request": { - "required": [ - "bolt11" - ], + "required": [], "properties": { - "bolt11": { + "invreq_id": { "type": "string", "description": [ - "Bolt11 invoice to submit to the HSM to check." + "A specific invoice can be queried by providing the `invreq_id`, which is presented by lightning-invoicerequest(7), or can be calculated from a bolt12 invoice." + ] + }, + "active_only": { + "type": "boolean", + "description": [ + "If it is *True* then only active invoice requests are returned." ], - "added": "v23.02" + "default": "*False*" } } }, "response": { - "properties": {} + "required": [ + "invoicerequests" + ], + "properties": { + "invoicerequests": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "invreq_id", + "single_use", + "active", + "bolt12", + "used" + ], + "properties": { + "invreq_id": { + "type": "hash", + "description": [ + "The SHA256 hash of all invoice_request fields less than 160." + ] + }, + "active": { + "type": "boolean", + "description": [ + "Whether the invoice_request is currently active." + ] + }, + "single_use": { + "type": "boolean", + "description": [ + "Whether the invoice_request will become inactive after we pay an invoice for it." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string starting with lnr." + ] + }, + "used": { + "type": "boolean", + "description": [ + "Whether the invoice_request has already been used." + ] + }, + "label": { + "type": "string", + "description": [ + "The label provided when creating the invoice_request." + ] + } + } + } + } + } }, + "example_json_request": [ + { + "id": "example:listinvoicerequests#1", + "method": "listinvoicerequests", + "params": [ + "cf0b41d4eb248d975909deb9accf9722b1c86839de80ee8815ce907bbb700a1d" + ] + } + ], + "example_json_response": [ + { + "invoicerequests": [ + { + "invreq_id": "cf0b41d4eb248d975909deb9accf9722b1c86839de80ee8815ce907bbb700a1d", + "active": true, + "single_use": true, + "bolt12": "lnr1qqgx9ag7nmtns87htndlgcfndlq0wzstwd5k6urvv5s8getnw3gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02gzqta0pqpvzzqnxu3vc68fug904w25y3zpskc8huazwmy34av93h2fjswe3tsp4rrcyps5sf5jwnn2tr3ghn32mdta8jvax62pwzhna8sktmaezl3f4s3zy35gx6dfay7r8zn299uwr7ugpze74zft4m8q3fnk2sr0ljqpve3jq", + "used": false + } + ] + } + ], "author": [ - "Ken Sedgwick <> is mainly responsible." + "Rusty Russell <> is mainly responsible." ], "see_also": [ - "lightning-pay(7)" + "lightning-invoicerequests(7)", + "lightning-disableinvoicerequest(7)" ], "resources": [ "Main web site: " ] }, - "lightning-preapprovekeysend.json": { + "lightning-listinvoices.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "added": "v23.02", - "rpc": "preapprovekeysend", - "title": "Ask the HSM to preapprove a keysend payment (low-level)", + "rpc": "listinvoices", + "title": "Command for querying invoice status", "description": [ - "The **preapprovekeysend** RPC command submits the *destination*, *payment_hash*, and *amount_msat* parameters to the HSM to check that they are approved as a keysend payment.", - "", - "Generally the **preapprovekeysend** request does not need to be made explicitly, it is automatically generated as part of a **keysend** request.", - "", - "By default, the HSM will approve all **preapprovekeysend** requests.", - "", - "If a remote signer is being used it might decline an **preapprovekeysend** request because it would exceed velocity controls, is not covered by allowlist controls, was declined manually, or other reasons.", + "The **listinvoices** RPC command gets the status of a specific invoice, if it exists, or the status of all invoices if given no argument.", "", - "If a remote signer declines a **preapprovekeysend** request a subsequent attempt to pay the keysend anyway will fail; the signer will refuse to sign the commitment." + "Only one of the query parameters can be used from *label*, *invstring*, *payment_hash*, or *offer_id*." ], "request": { - "required": [ - "destination", - "payment_hash", - "amount_msat" - ], + "required": [], "properties": { - "destination": { - "type": "pubkey", - "description": [ - "It is a 33 byte, hex-encoded, node ID of the node that the payment should go to." + "label": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } ], - "added": "v23.02" + "description": [ + "A label used a the creation of the invoice to get a specific invoice." + ] + }, + "invstring": { + "type": "string", + "description": [ + "The string value to query a specific invoice." + ] }, "payment_hash": { "type": "hex", - "added": "v23.02", "description": [ - "It is the unique identifier of a payment." - ], - "maxLength": 64, - "minLength": 64 + "A payment_hash of the invoice to get the details of a specific invoice." + ] }, - "amount_msat": { - "type": "msat", + "offer_id": { + "type": "string", "description": [ - "The amount to send in millisatoshi precision; it can be a whole number, or a whole number with suffix `msat` or `sat`, or a three decimal point number with suffix `sat`, or an 1 to 11 decimal point number suffixed by `btc`." - ], - "added": "v23.02" - } - } - }, - "response": { - "properties": {} - }, - "author": [ - "Ken Sedgwick <> is mainly responsible." - ], - "see_also": [ - "lightning-keysend(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-recover.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "recover", - "title": "Reinitialize Your Node for Recovery", - "description": [ - "The **recover** RPC command wipes your node and restarts it with the `--recover` option. This is only permitted if the node is unused: no channels, no bitcoin addresses issued (you can use `check` to see if recovery is possible).", - "", - "*hsmsecret* is either a codex32 secret starting with \"cl1\" as returned by `hsmtool getcodexsecret`, or a raw 64 character hex string.", - "", - "NOTE: this command only currently works with the `sqlite3` database backend." - ], - "request": { - "required": [ - "hsmsecret" - ], - "properties": { - "hsmsecret": { + "A local `offer_id` the invoice was issued for a specific invoice details." + ] + }, + "index": { "type": "string", + "added": "v23.08", + "enum": [ + "created", + "updated" + ], "description": [ - "Either a codex32 secret starting with `cl1` as returned by `hsmtool getcodexsecret`, or a raw 64 character hex string." + "If neither *in_channel* nor *out_channel* is specified, it controls ordering." + ], + "default": "`created`" + }, + "start": { + "type": "u64", + "added": "v23.08", + "description": [ + "If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)." + ] + }, + "limit": { + "type": "u32", + "added": "v23.08", + "description": [ + "If `index` is specified, `limit` can be used to specify the maximum number of entries to return." ] } + }, + "dependentUpon": { + "index": [ + "start", + "limit" + ] } }, "response": { "required": [ - "result" + "invoices" ], "properties": { - "result": { - "type": "string", - "added": "v24.05", - "enum": [ - "Recovery restart in progress" - ] + "invoices": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "label", + "created_index", + "payment_hash", + "status", + "expires_at" + ], + "properties": { + "label": { + "type": "string", + "description": [ + "Unique label supplied at invoice creation." + ] + }, + "description": { + "type": "string", + "description": [ + "Description used in the invoice." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "unpaid", + "paid", + "expired" + ], + "description": [ + "Whether it's paid, unpaid or unpayable." + ] + }, + "expires_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when it will become / became unpayable." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount required to pay this invoice." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The BOLT11 string (always present unless *bolt12* is)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The BOLT12 string (always present unless *bolt11* is)." + ] + }, + "local_offer_id": { + "type": "hash", + "description": [ + "The *id* of our offer which created this invoice (**experimental-offers** only)." + ] + }, + "invreq_payer_note": { + "type": "string", + "description": [ + "The optional *invreq_payer_note* from invoice_request which created this invoice (**experimental-offers** only)." + ] + }, + "created_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was created in." + ] + }, + "updated_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was changed (only present if it has changed since creation)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "paid" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "pay_index", + "amount_received_msat", + "paid_at", + "payment_preimage" + ], + "properties": { + "label": {}, + "description": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "bolt11": {}, + "bolt12": {}, + "local_offer_id": {}, + "invreq_payer_note": {}, + "expires_at": {}, + "created_index": {}, + "updated_index": {}, + "pay_index": { + "type": "u64", + "description": [ + "Unique incrementing index for this payment." + ] + }, + "amount_received_msat": { + "type": "msat", + "description": [ + "The amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)." + ] + }, + "paid_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when it was paid." + ] + }, + "paid_outpoint": { + "type": "object", + "description": [ + "Outpoint this invoice was paid with." + ], + "added": "v23.11", + "additionalProperties": false, + "required": [ + "txid", + "outnum" + ], + "properties": { + "txid": { + "added": "v23.11", + "type": "txid", + "description": [ + "ID of the transaction that paid the invoice." + ] + }, + "outnum": { + "added": "v23.11", + "type": "u32", + "description": [ + "The 0-based output number of the transaction that paid the invoice." + ] + } + } + }, + "payment_preimage": { + "type": "secret", + "description": [ + "Proof of payment." + ] + } + } + }, + "else": { + "additionalProperties": false, + "properties": { + "label": {}, + "description": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "bolt11": {}, + "bolt12": {}, + "local_offer_id": {}, + "invreq_payer_note": {}, + "created_index": {}, + "updated_index": {}, + "expires_at": {} + } + } + } + ] + } } } }, "example_json_request": [ { - "id": "example:recover#1", - "method": "recover", - "params": { - "hsmsecret": "cl10leetsd35kw6r5de5kueedxgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqdeuq7xuh94k9g" - } - }, - { - "id": "example:recover#2", - "method": "recover", + "id": "example:listinvoices#1", + "method": "listinvoices", "params": { - "hsmsecret": "6c696768746e696e672d31000000000000000000000000000000000000000000" + "label": "xEoCR94SIz6UIRUEkxum", + "payment_hash": null, + "invstring": null, + "offer_id": null, + "index": null, + "start": null, + "limit": null } } ], "example_json_response": [ - {}, { - "result": "Recovery restart in progress" - } - ], - "author": [ - "Rusty Russell <> is mainly responsible." - ], - "see_also": [ - "lightning-hsmtool(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-recoverchannel.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "recoverchannel", - "title": "Command for recovering channels bundeled in an array in the form of *Static Backup*", - "description": [ - "The **recoverchannel** RPC command tries to force the peer (with whom you already had a channel) to close the channel and sweeps on-chain fund. This method is not spontaneous and depends on the peer, so use it in case of severe data loss.", - "", - "The *scb* parameter is an array containing minimum required info to reconnect and sweep funds. You can get the scb for already stored channels by using the RPC command 'staticbackup'." - ], - "request": { - "required": [ - "scb" - ], - "properties": { - "scb": { - "type": "array", - "description": [ - "SCB of the channels in an array." - ], - "items": { - "type": "hex" - } - } - } - }, - "response": { - "required": [ - "stubs" - ], - "properties": { - "stubs": { - "type": "array", - "items": { - "type": "string", + "invoices": [ + { + "label": "xEoCR94SIz6UIRUEkxum", + "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk", + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "amount_msat": 11000000, + "status": "unpaid", "description": [ - "Channel IDs of channels successfully inserted." - ] + "XEoCR94SIz6UIRUEkxum." + ], + "expires_at": 1706757730, + "created_index": 1 } - } - } - }, - "example_json_request": [ - { - "id": "example:recoverchannel#1", - "method": "recoverchannel", - "params": [ - [ - "0000000000000001c3a7b9d74a174497122bc52d74d6d69836acadc77e0429c6d8b68b48d5c9139a022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d5904017f0000019f0bc3a7b9d74a174497122bc52d74d6d69836acadc77e0429c6d8b68b48d5c9139a0000000000000000000186a000021000" - ] - ] - } - ], - "example_json_response": [ - { - "stubs": [ - "c3a7b9d74a174497122bc52d74d6d69836acadc77e0429c6d8b68b48d5c9139a" ] } ], "author": [ - "Aditya <> is mainly responsible." + "Rusty Russell <> is mainly responsible." ], "see_also": [ - "lightning-getsharedsecret(7)" + "lightning-waitinvoice(7)", + "lightning-delinvoice(7)", + "lightning-invoice(7)" ], "resources": [ "Main web site: " ] }, - "lightning-renepay.json": { + "lightning-listnodes.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "renepay", - "title": "Command for sending a payment to a BOLT11 invoice", - "added": "v23.08", + "rpc": "listnodes", + "title": "Command to get the list of nodes in the known network.", "description": [ - "**renepay** is a new payment plugin based on Pickhardt-Richter optimization method for Multi-Path-Payments. This implementation has not been thoroughly tested and it should be used with caution.", - "", - "The response will occur when the payment fails or succeeds. Once a payment has succeeded, calls to **renepay** with the same *invstring* will not lead to a new payment attempt, but instead it will succeed immediately.", - "", - "When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name." + "The **listnodes** command returns nodes the node has learned about via gossip messages, or a single one if the node *id* was specified." ], "request": { - "required": [ - "invstring" - ], + "required": [], "properties": { - "invstring": { - "type": "string", - "description": [ - "Bolt11 invoice which the RPC command attempts to pay. Currently, **renepay** supports bolt11 invoices only." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "If the *invstring* does not contain an amount, *amount_msat* is required, otherwise if it is specified it must be *null*. in millisatoshi precision; it can be a whole number, or a whole number with suffix *msat* or *sat*, or a three decimal point number with suffix *sat*, or an 1 to 11 decimal point number suffixed by *btc*." - ] - }, - "maxfee": { - "type": "msat", - "description": [ - "*maxfee* is a hard bound, in the sense that the command will never attempt a payment when the fees exceed that value." - ] - }, - "maxdelay": { - "type": "u32", - "description": [ - "Overrides the value of `max-locktime-blocks` for this payment. It serves to limit the locktime of funds in the payment HTLC measured in blocks." - ] - }, - "retry_for": { - "type": "u32", - "description": [ - "Measured in seconds specifies how much time it is allowed for the command to keep retrying the payment." - ], - "default": "60 seconds" - }, - "description": { - "type": "string", - "description": [ - "Only required for bolt11 invoices which do not contain a description themselves, but contain a description hash: in this case *description* is required. *description* is then checked against the hash inside the invoice before it will be paid." - ] - }, - "label": { - "type": "string", + "id": { + "type": "pubkey", "description": [ - "Used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7)." + "The public key of the node to list." ] - }, - "dev_use_shadow": { - "hidden": true, - "type": "boolean" } } }, "response": { "required": [ - "payment_preimage", - "payment_hash", - "created_at", - "parts", - "amount_msat", - "amount_sent_msat", - "status" + "nodes" ], "properties": { - "payment_preimage": { - "type": "secret", - "description": [ - "The proof of payment: SHA256 of this **payment_hash**." - ] - }, - "payment_hash": { - "type": "hash", - "description": [ - "The hash of the *payment_preimage* which will prove payment." - ] - }, - "created_at": { - "type": "number", - "description": [ - "The UNIX timestamp showing when this payment was initiated." - ] - }, - "parts": { - "type": "u32", - "description": [ - "How many attempts this took." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "Amount the recipient received." - ] - }, - "amount_sent_msat": { - "type": "msat", - "description": [ - "Total amount we sent (including fees)." - ] - }, - "status": { - "type": "string", - "enum": [ - "complete", - "pending", - "failed" - ], - "description": [ - "Status of payment." - ] - }, - "destination": { - "type": "pubkey", - "description": [ - "The final destination of the payment." - ] + "nodes": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "nodeid" + ], + "properties": { + "nodeid": { + "type": "pubkey", + "description": [ + "The public key of the node." + ] + }, + "last_timestamp": { + "type": "u32", + "description": [ + "A node_announcement has been received for this node (UNIX timestamp)." + ] + } + }, + "allOf": [ + { + "if": { + "required": [ + "last_timestamp" + ] + }, + "then": { + "additionalProperties": false, + "required": [ + "nodeid", + "last_timestamp", + "alias", + "color", + "features", + "addresses" + ], + "properties": { + "nodeid": {}, + "last_timestamp": {}, + "option_will_fund": {}, + "alias": { + "type": "string", + "description": [ + "The fun alias this node advertized." + ], + "maxLength": 32 + }, + "color": { + "type": "hex", + "description": [ + "The favorite RGB color this node advertized." + ], + "minLength": 6, + "maxLength": 6 + }, + "features": { + "type": "hex", + "description": [ + "BOLT #9 features bitmap this node advertized." + ] + }, + "addresses": { + "type": "array", + "description": [ + "The addresses this node advertized." + ], + "items": { + "type": "object", + "required": [ + "type", + "port" + ], + "additionalProperties": true, + "properties": { + "type": { + "type": "string", + "enum": [ + "dns", + "ipv4", + "ipv6", + "torv2", + "torv3" + ], + "description": [ + "Type of connection (until 23.08, `websocket` was also allowed)." + ] + }, + "port": { + "type": "u16", + "description": [ + "Port number." + ] + } + }, + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "dns", + "ipv4", + "ipv6", + "torv2", + "torv3" + ] + } + } + }, + "then": { + "required": [ + "type", + "address", + "port" + ], + "additionalProperties": false, + "properties": { + "type": {}, + "port": {}, + "address": { + "type": "string", + "description": [ + "Address in expected format for **type**." + ] + } + } + }, + "else": { + "required": [ + "type", + "port" + ], + "additionalProperties": false, + "properties": { + "type": {}, + "port": {} + } + } + } + } + } + }, + "else": { + "additionalProperties": false, + "properties": { + "nodeid": {} + } + } + }, + { + "if": { + "required": [ + "option_will_fund" + ] + }, + "then": { + "additionalProperties": true, + "required": [ + "option_will_fund" + ], + "properties": { + "option_will_fund": { + "type": "object", + "additionalProperties": false, + "required": [ + "lease_fee_base_msat", + "lease_fee_basis", + "funding_weight", + "channel_fee_max_base_msat", + "channel_fee_max_proportional_thousandths", + "compact_lease" + ], + "properties": { + "lease_fee_base_msat": { + "type": "msat", + "description": [ + "The fixed fee for a lease (whole number of satoshis)." + ] + }, + "lease_fee_basis": { + "type": "u32", + "description": [ + "The proportional fee in basis points (parts per 10,000) for a lease." + ] + }, + "funding_weight": { + "type": "u32", + "description": [ + "The onchain weight you'll have to pay for a lease." + ] + }, + "channel_fee_max_base_msat": { + "type": "msat", + "description": [ + "The maximum base routing fee this node will charge during the lease." + ] + }, + "channel_fee_max_proportional_thousandths": { + "type": "u32", + "description": [ + "The maximum proportional routing fee this node will charge during the lease (in thousandths, not millionths like channel_update)." + ] + }, + "compact_lease": { + "type": "hex", + "description": [ + "The lease as represented in the node_announcement." + ] + } + } + } + } + } + } + ] + } } - }, - "post_return_value_notes": [ - "You can monitor the progress and retries of a payment using the lightning-renepaystatus(7) command." - ] + } }, - "optimality": [ - "**renepay** is based on the work by Pickhardt-Richter's *Optimally Reliable & Cheap Payment Flows on the Lightning Network*. Which means the payment command will prefer routes that have a higher probability of success while keeping fees low.", - "", - "The algorithm records some partial knowledge of the state of the Network deduced from the responses obtained after evey payment attempt. This knowledge is kept through different payment requests, but decays with time to account for the dynamics of the Network (after 1 hour all previous knowledge will be erased). Knowledge from previous payment attempts increases the reliability for subsequent ones.", - "", - "Higher probabilities of success and lower fees cannot generally by optimized at once. Hence **renepay** combines the two in different amounts seeking solutions that satisfy *maxfee* bound and a target for 90% probability of success. *maxfee* is a hard bound, in the sense that the command will never attempt a payment when the fees exceed that value. While the probability target is not compulsory (but desirable), i.e. if the best route does not satisfy the 90% probability target it will be tried anyways.", - "", - "When *maxfee* and the 90% probability bounds are satified, the algorithm will optimize the fees to its lowest value." - ], - "randomization": [ - "To protect user privacy, the payment algorithm performs *shadow route* randomization. Which means the payment algorithm will virtually extend the route by adding delays and fees along it, making it appear to intermediate nodes that the route is longer than it actually is. This prevents intermediate nodes from reliably guessing their distance from the payee.", - "", - "Route randomization will never exceed *maxfee* of the payment. Route randomization and shadow routing will not take routes that would exceed *maxdelay*." - ], - "errors": [ - "The following error codes may occur:", - "", - "- -1: Catchall nonspecific error.", - "- 200: Other payment attempts are in progress.", - "- 203: Permanent failure at destination.", - "- 205: Unable to find a route.", - "- 206: Payment routes are too expensive.", - "- 207: Invoice expired. Payment took too long before expiration, or already expired at the time you initiated payment.", - "- 210: Payment timed out without a payment in progress.", - "- 212: Invoice is invalid." - ], "example_json_request": [ { - "id": "example:renepay#1", - "method": "renepay", + "id": "example:listnodes#1", + "method": "listnodes", "params": { - "invstring": "lnbcrt1230n1pjmxj9jsp5suc4cag0lv3wemllkvms56e6ll0w867cczqfttuu8cpfl089f9kspp56wvxtdh8fxg5r5y3kg3klxceakqaydskwzatga25v95da8nzkmwqdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqkmyhymt0j7hy38vzqxx465s4ys0fg78flnjqfx4clvdq9mrmgglpcnjrrnhtk7maa87pfvjez88hke8w97zvuecwswaf9gzyqlsthegpza67eu" + "id": "02e29856dab8ddd9044c18486e4cab79ec717b490447af2d4831e290e48d57638a" } }, { - "id": "example:renepay#2", - "method": "renepay", + "id": "example:listnodes#2", + "method": "listnodes", "params": { - "invstring": "lnbcrt1pja0f9asp50kzadmeyy78eymjvhnlk5dznl3g5k5x8agh52ewjtg0jclas4ylspp5crsutd9hg05lxyhzphdcuyng6z3knrsdae83mxwawa842gz3vj3sdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqr5yzhxmup4muyaz6x8u2dy4qyu9t5qzuf5k9xayvj5kg7tve60gjk4jrv2l76exnj2xkuzhtwky23pkkxedzy6p9yrsgyqdwj7dv5gsp4zcw6v", - "amount_msat": 548925 + "id": null } } ], "example_json_response": [ { - "payment_preimage": "0a3fd704b34f47d6e306dbac78141753be83848d3a19725c972abfc367dcc591", - "payment_hash": "d39865b6e7499141d091b2236f9b19ed81d2361670bab475546168de9e62b6dc", - "created_at": 1706248370.6267352, - "parts": 1, - "amount_msat": 123000, - "amount_sent_msat": 123000, - "status": "complete", - "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" + "nodes": [ + { + "nodeid": "02e29856dab8ddd9044c14586e4cab79ec717b490447af2d4831e290e48d58638a", + "alias": "some_alias", + "color": "68f442", + "last_timestamp": 1597213741, + "features": "02a2a1", + "addresses": [ + { + "type": "ipv4", + "address": "zzz.yy.xx.xx", + "port": 9735 + } + ] + } + ] }, { - "payment_preimage": "a635e92d024beebfc58519e6544888aa560ba3bcaba7e74924e4b8432eaa56f5", - "payment_hash": "c0e1c5b4b743e9f312e20ddb8e1268d0a3698e0dee4f1d99dd774f55205164a3", - "created_at": 1708631229.7841823, - "parts": 1, - "amount_msat": 548925, - "amount_sent_msat": 548925, - "status": "complete", - "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" + "nodes": [ + { + "nodeid": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "alias": "SILENTARTIST-v23.11-415-gd120eba", + "color": "022d22", + "last_timestamp": 1708624765, + "features": "88a0000a8a5961", + "addresses": [] + }, + { + "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "alias": "JUNIORBEAM-v23.11-415-gd120eba", + "color": "0266e4", + "last_timestamp": 1708624765, + "features": "88a0000a8a5961", + "addresses": [] + }, + { + "nodeid": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "alias": "HOPPINGFIRE-v23.11-415-gd120eba", + "color": "035d2b", + "last_timestamp": 1708624765, + "features": "88a0000a8a5961", + "addresses": [] + }, + { + "nodeid": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", + "alias": "JUNIORFELONY-v23.11-415-gd120eba", + "color": "0382ce", + "last_timestamp": 1708624766, + "features": "88a0000a8a5961", + "addresses": [] + } + ] } ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters." + ], "author": [ - "Eduardo Quintana-Miranda <> is mainly responsible." + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." ], "see_also": [ - "lightning-renepaystatus(7)", - "lightning-listpays(7)", - "lightning-invoice(7)" + "lightning-listchannels(7)" ], "resources": [ - "Main web site: ", - "", - "Pickhardt R. and Richter S., *Optimally Reliable & Cheap Payment Flows on the Lightning Network* " + "Main web site: " ] }, - "lightning-renepaystatus.json": { + "lightning-listoffers.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "renepaystatus", - "title": "Command for quering the status of previous renepay attempts", - "added": "v23.08", + "rpc": "listoffers", + "title": "Command for listing offers", + "warning": "experimental-offers only", "description": [ - "The **renepaystatus** RPC command queries the payment plugin **renepay** for the status of previous payment attempts.", - "", - "This command always succeeds." + "The **listoffers** RPC command list all offers, or with `offer_id`, only the offer with that offer_id (if it exists)." ], "request": { "required": [], "properties": { - "invstring": { - "type": "string", + "offer_id": { + "type": "hash", "description": [ - "If specified, the command will return a list of payment attempts whose invoice matches *invstring*, otherwise all payments with be listed." + "Offer_id to get details for (if it exists)." + ] + }, + "active_only": { + "type": "boolean", + "description": [ + "If set and is true, only offers with `active` true are returned." ] } } }, "response": { "required": [ - "paystatus" + "offers" ], "properties": { - "paystatus": { + "offers": { "type": "array", - "description": [ - "A list of payments attempted by renepay." - ], "items": { "type": "object", "additionalProperties": false, "required": [ - "bolt11", - "payment_hash", - "created_at", - "groupid", - "amount_msat", - "status", - "notes" + "offer_id", + "active", + "single_use", + "bolt12", + "used" ], "properties": { - "bolt11": { - "type": "string", - "description": [ - "Invoice string BOLT11." - ] - }, - "payment_preimage": { - "type": "secret", - "description": [ - "The proof of payment: SHA256 of this **payment_hash** (for completed payments only)." - ] - }, - "payment_hash": { + "offer_id": { "type": "hash", "description": [ - "The hash of the *payment_preimage* which will prove payment." - ] - }, - "created_at": { - "type": "number", - "description": [ - "The UNIX timestamp showing when this payment was initiated." + "The id of this offer (merkle hash of non-signature fields)." ] }, - "groupid": { - "type": "u32", + "active": { + "type": "boolean", "description": [ - "The id for this payment attempt." + "Whether this can still be used." ] }, - "parts": { - "type": "u32", + "single_use": { + "type": "boolean", "description": [ - "How many attempts this took." + "Whether this expires as soon as it's paid." ] }, - "amount_msat": { - "type": "msat", + "bolt12": { + "type": "string", "description": [ - "Amount the recipient received." + "The bolt12 encoding of the offer." ] }, - "amount_sent_msat": { - "type": "msat", + "used": { + "type": "boolean", "description": [ - "Total amount we sent including fees (for completed payments only)." + "True if an associated invoice has been paid." ] }, - "status": { + "label": { "type": "string", - "enum": [ - "complete", - "pending", - "failed" - ], "description": [ - "Status of payment." - ] - }, - "destination": { - "type": "pubkey", - "description": [ - "The final destination of the payment." + "The (optional) user-specified label." ] - }, - "notes": { - "type": "array", - "description": [ - "A list of messages for debugging purposes." - ], - "items": { - "type": "string", - "description": [ - "A message generated by renepay." - ] - } } } } } } }, + "example_json_request": [ + { + "id": "example:listoffers#1", + "method": "listoffers", + "params": { + "active_only": true + } + }, + { + "id": "example:listoffers#2", + "method": "listoffers", + "params": [ + "f61cca153d1948dade19349792d9bcdc9cef687fd27db0b553a67979f55aae48" + ] + } + ], + "example_json_response": [ + { + "offers": [ + { + "offer_id": "053a5c566fbea2681a5ff9c05a913da23e45b95d09ef5bd25d7d408f23da7084", + "active": true, + "single_use": false, + "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqvqcdgq2z9pk7enxv4jjqen0wgs8yatnw3ujz83qkc6rvp4j28rt3dtrn32zkvdy7efhnlrpr5rp5geqxs783wtlj550qs8czzku4nk3pqp6m593qxgunzuqcwkmgqkmp6ty0wyvjcqdguv3pnpukedwn6cr87m89t74h3auyaeg89xkvgzpac70z3m9rn5xzu28c", + "used": false + }, + { + "offer_id": "3247d3597fec19e362ca683416a48a0f76a44c1600725a7ee1936548feadacca", + "active": true, + "single_use": false, + "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcxqd24x3qgqgqlgzs3gdhkven9v5sxvmmjype82um50ys3ug9kxsmqdvj3c6ut2cuu2s4nrf8k2dulccgaqcdzxgp583utjlu49rcyqt8hc3s797umxn3r9367rdqc577rma7key58fywkajxnuzyapge86hj2pg80rjrma40xdqrxnsnva5l3ce7hz4ua8wf755dees4y9vnq", + "used": true + } + ] + }, + { + "offers": [ + { + "offer_id": "f61cca153d1948dade19349792d9bcdc9cef687fd27db0b553a67979f55aae48", + "active": true, + "single_use": false, + "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqyqs5rn5v4ehggrxdaezqvtdwdshg93pqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq63s", + "used": false + } + ] + } + ], "author": [ - "Eduardo Quintana-Miranda <> is mainly responsible." + "Rusty Russell <> is mainly responsible." ], "see_also": [ - "lightning-renepay(7)", - "lightning-listpays(7)" + "lightning-offer(7)", + "lightning-listoffers(7)" ], "resources": [ "Main web site: " ] }, - "lightning-reserveinputs.json": { + "lightning-listpays.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "reserveinputs", - "title": "Construct a transaction and reserve the UTXOs it spends", + "rpc": "listpays", + "title": "Command for querying payment status", "description": [ - "The **reserveinputs** RPC command places (or increases) reservations on any inputs specified in *psbt* which are known to lightningd. It will fail with an error if any of the inputs are known to be spent, and ignore inputs which are unknown.", - "", - "Normally the command will fail (with no reservations made) if an input is already reserved." + "The **listpay** RPC command gets the status of all *pay* commands, or a single one if either *bolt11* or *payment_hash* was specified." ], "request": { - "required": [ - "psbt" - ], + "required": [], "properties": { - "psbt": { + "bolt11": { "type": "string", "description": [ - "The PSBT to reserve inputs from." + "Bolt11 string to get the payment details." ] }, - "exclusive": { - "type": "boolean", + "payment_hash": { + "type": "hash", "description": [ - "If set to *False*, existing reservations are simply extended, rather than causing failure." + "Payment hash to get the payment details." ] }, - "reserve": { - "type": "u32", + "status": { + "type": "string", "description": [ - "The number of blocks to reserve. By default, reservations are for the next 72 blocks (approximately 6 hours)." + "To filter the payment by status." + ], + "enum": [ + "pending", + "complete", + "failed" ] } } }, "response": { "required": [ - "reservations" + "pays" ], "properties": { - "reservations": { + "pays": { "type": "array", "items": { "type": "object", - "additionalProperties": false, + "additionalProperties": true, "required": [ - "txid", - "vout", - "was_reserved", - "reserved", - "reserved_to_block" + "payment_hash", + "status", + "created_at" ], "properties": { - "txid": { - "type": "txid", + "payment_hash": { + "type": "hash", "description": [ - "The input transaction id." + "The hash of the *payment_preimage* which will prove payment." ] }, - "vout": { - "type": "u32", + "status": { + "type": "string", + "enum": [ + "pending", + "failed", + "complete" + ], "description": [ - "The input index output number which was reserved." + "Status of the payment." ] }, - "was_reserved": { - "type": "boolean", + "destination": { + "type": "pubkey", "description": [ - "Whether the input was already reserved." + "The final destination of the payment if known." ] }, - "reserved": { - "type": "boolean", - "enum": [ - true - ], + "created_at": { + "type": "u64", "description": [ - "Whether the input is now reserved." + "The UNIX timestamp showing when this payment was initiated." ] }, - "reserved_to_block": { - "type": "u32", + "completed_at": { + "type": "u64", "description": [ - "What blockheight the reservation will expire." + "The UNIX timestamp showing when this payment was completed." + ] + }, + "label": { + "type": "string", + "description": [ + "The label, if given to sendpay." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string (if pay supplied one)." + ] + }, + "description": { + "type": "string", + "description": [ + "The description matching the bolt11 description hash (if pay supplied one)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string (if supplied for pay: **experimental-offers** only)." ] } - } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "complete" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "amount_sent_msat", + "preimage" + ], + "properties": { + "payment_hash": {}, + "status": {}, + "destination": {}, + "created_at": {}, + "completed_at": {}, + "label": {}, + "bolt11": {}, + "description": {}, + "bolt12": {}, + "amount_msat": { + "type": "msat", + "description": [ + "The amount of millisatoshi we intended to send to the destination." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "The amount of millisatoshi we sent in order to pay (may include fees and not match amount_msat)." + ] + }, + "preimage": { + "type": "secret", + "description": [ + "Proof of payment." + ] + }, + "number_of_parts": { + "type": "u64", + "description": [ + "The number of parts for a successful payment (only if more than one)." + ] + } + } + } + }, + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "failed" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "amount_sent_msat" + ], + "properties": { + "payment_hash": {}, + "status": {}, + "destination": {}, + "created_at": {}, + "label": {}, + "bolt11": {}, + "description": {}, + "bolt12": {}, + "amount_sent_msat": {}, + "erroronion": { + "type": "hex", + "description": [ + "The error onion returned on failure, if any." + ] + } + } + } + } + ] } } - } + }, + "post_return_value_notes": [ + "The returned array is ordered by increasing **created_at** fields." + ] }, - "errors": [ - "On failure, an error is reported and no UTXOs are reserved.", - "", - "- -32602: Invalid parameter, such as specifying a spent/reserved input in *psbt*." - ], "example_json_request": [ { - "id": "example:reserveinputs#1", - "method": "reserveinputs", + "id": "example:listpays#1", + "method": "listpays", "params": { - "psbt": "cHNidP8BAFwCAAAAAkwJVUqB0xXTO7JZ3PnPdGnxoYfQxhU+xqXGFYXsyX0RAAAAAAD9////TAlVSoHTFdM7slnc+c90afGhh9DGFT7GpcYVhezJfREBAAAAAP3///8AAAAAAAAAAA==", - "exclusive": true, - "reserve": null + "bolt11": "lnbcrt123n1pjmxp7qsp5hxu7u28y0nx4v689u3hwzdzse2w9yaylhheavf9dxvwtdup7pvespp5ha66gxse68j4n6755v7299dnmq4w34gp0znxu0xzahdc43zrg40qdq5v3jhxcmjd9c8g6t0dc6sxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgqk74dvqlvr92ayy5s7x0r0u9xywez6wu4h8pfta386cw6x7cdrvn8pz87kyg5c930aent423gm9ylpaw5p35k72f02hg0s9dulg4d8fqpgj7gpm", + "payment_hash": null, + "status": null } }, { - "id": "example:reserveinputs#2", - "method": "reserveinputs", + "id": "example:listpays#2", + "method": "listpays", "params": { - "psbt": "cHNidP8BAP32AQIAAAAMgnW099dbh1uD153ih5eU5WhluynLxekXjAOjkEdNBg8BAAAAAP3///9FWKQt8C+1y4741+beFSqWAaj9DuvzHNpxvpxS+GB8lwEAAAAA/f///6E5TAGqktI29Oso6b9kZZoAFFGGvpJQUM8VO+3LMTlmAAAAAAD9////nSDT7hrkuoQtAV1yNnbpkJsB5ifKoM2zP+CcLPfis1gBAAAAAP3///+P1rW90UXfD0gIk58h3sXxxy3ZfJJLP0H1I4Jpzy/87QEAAAAA/f///w0UKZ/s9DnPpV+FJ8h2BEI7tl+qVxSGRFRv9FYw4girAQAAAAD9////EPNsUFrEOZyfjbqbh8rfHQ4C9RQECw12n3c1yhFqkzoAAAAAAP3///8QW9LEsSmuvSnvVzy+FDktM7ewQmZnIJI/TJMahLmSzwEAAAAA/f///+4edbWRHDdRJcMeHHElgSmb+nENPsz/g/0AmAEU6hXeAAAAAAD9////T15YLGmk7HBsrL+awdcxi3db3esp8AcCTS9XGrEnfoAAAAAAAP3///8q7xInvEk7J0Ir9cpKXqU2lArUskkYLrimIE0+Yb6a2QEAAAAA/f///8hBLKyMa2zRJqwNOk7DmsDIfG7IvJtQiJ+QnkkHl6atAAAAAAD9////AAAAAAAAAAAAAAAAAAAAAAAA", - "exclusive": false, - "reserve": null + "bolt11": "lnbcrt123n1pjmxp7qsp5u84368dz7yhzcqm955h96wdqch7uarasun45cr0vs5d8t0cv5avqpp5r9p0dp92guaatrmhf302m0dyj4n79gk93qu2l5tagfxq3dedgfqsdq5v3jhxcmjd9c8g6t0dc6qxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgq46wu0fznfx27rcnyzhcttf8yqx3lwqs482yxlead0fyt8mefrrrj5m379fa5qukgquf9tnwsuj3nnfmwkzkfg6pyhzq6w8gauuh6m5cqgur64n", + "payment_hash": null, + "status": null } } ], "example_json_response": [ { - "reservations": [ + "pays": [ { - "txid": "117dc9ec8515c6a5c63e15c6d087a1f16974cff9dc59b23bd315d3814a55094c", - "vout": 1, - "was_reserved": false, - "reserved": true, - "reserved_to_block": 175 + "bolt11": "lnbcrt123n1pjmxp7qsp5hxu7u28y0nx4v689u3hwzdzse2w9yaylhheavf9dxvwtdup7pvespp5ha66gxse68j4n6755v7299dnmq4w34gp0znxu0xzahdc43zrg40qdq5v3jhxcmjd9c8g6t0dc6sxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgqk74dvqlvr92ayy5s7x0r0u9xywez6wu4h8pfta386cw6x7cdrvn8pz87kyg5c930aent423gm9ylpaw5p35k72f02hg0s9dulg4d8fqpgj7gpm", + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "payment_hash": "bf75a41a19d1e559ebd4a33ca295b3d82ae8d50178a66e3cc2eddb8ac443455e", + "status": "failed", + "created_at": 1706231854, + "amount_sent_msat": 0 } ] }, { - "reservations": [ - { - "txid": "0f064d4790a3038c17e9c5cb29bb6568e5949787e29dd7835b875bd7f7b47582", - "vout": 1, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - }, - { - "txid": "977c60f8529cbe71da1cf3eb0efda801962a15dee6d7f88ecbb52ff02da45845", - "vout": 1, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - }, - { - "txid": "663931cbed3b15cf505092be865114009a6564bfe928ebf436d292aa014c39a1", - "vout": 0, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - }, - { - "txid": "58b3e2f72c9ce03fb3cda0ca27e6019b90e97636725d012d84bae41aeed3209d", - "vout": 1, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - }, - { - "txid": "edfc2fcf698223f5413f4b927cd92dc7f1c5de219f9308480fdf45d1bdb5d68f", - "vout": 1, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - }, - { - "txid": "ab08e23056f46f5444861457aa5fb63b420476c827855fa5cf39f4ec9f29140d", - "vout": 1, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - }, - { - "txid": "3a936a11ca35779f760d0b0414f5020e1ddfca879bba8d9f9c39c45a506cf310", - "vout": 0, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - }, - { - "txid": "cf92b9841a934c3f9220676642b0b7332d3914be3c57ef29bdae29b1c4d25b10", - "vout": 1, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - }, - { - "txid": "de15ea14019800fd83ffcc3e0d71fa9b298125711c1ec32551371c91b5751eee", - "vout": 0, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - }, - { - "txid": "807e27b11a572f4d0207f029ebdd5b778b31d7c19abfac6c70eca4692c585e4f", - "vout": 0, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - }, - { - "txid": "d99abe613e4d20a6b82e1849b2d40a9436a55e4acaf52b42273b49bc2712ef2a", - "vout": 1, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - }, + "pays": [ { - "txid": "ada69707499e909f88509bbcc86e7cc8c09ac34e3a0dac26d16c6b8cac2c41c8", - "vout": 0, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 + "bolt11": "lnbcrt123n1pjmxp7qsp5u84368dz7yhzcqm955h96wdqch7uarasun45cr0vs5d8t0cv5avqpp5r9p0dp92guaatrmhf302m0dyj4n79gk93qu2l5tagfxq3dedgfqsdq5v3jhxcmjd9c8g6t0dc6qxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgq46wu0fznfx27rcnyzhcttf8yqx3lwqs482yxlead0fyt8mefrrrj5m379fa5qukgquf9tnwsuj3nnfmwkzkfg6pyhzq6w8gauuh6m5cqgur64n", + "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "payment_hash": "1942f684aa473bd58f774c5eadbda49567e2a2c58838afd17d424c08b72d4241", + "status": "complete", + "created_at": 1706231849, + "completed_at": 1706231854, + "preimage": "89ce412a2089cbcb72a73ce755337cf693859ea58f21ef0d1caf286a9b0f2a7c", + "amount_msat": 12300, + "amount_sent_msat": 12301 } ] } ], "author": [ - "Lisa Neigut <> is mainly responsible." + "Rusty Russell <> is mainly responsible." ], "see_also": [ - "lightning-unreserveinputs(7)", - "lightning-signpsbt(7)", - "lightning-sendpsbt(7)" + "lightning-pay(7)", + "lightning-paystatus(7)", + "lightning-listsendpays(7)" ], "resources": [ "Main web site: " ] }, - "lightning-sendcustommsg.json": { + "lightning-listpeerchannels.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "added": "v0.10.1", - "rpc": "sendcustommsg", - "title": "Low-level interface to send protocol messages to peers", + "added": "v23.02", + "rpc": "listpeerchannels", + "title": "Command returning data on channels of connected lightning nodes", "description": [ - "The `sendcustommsg` RPC method allows the user to inject a custom message into the communication with the peer with the given `node_id`. This is intended as a low-level interface to implement custom protocol extensions on top, not for direct use by end-users.", + "The **listpeerchannels** RPC command returns data on channels of the network, with the possibility to filter the channels by node id.", "", - "On the receiving end a plugin may implement the `custommsg` plugin hook and get notified about incoming messages, and allow additional unknown even types in their getmanifest response." + "If no *id* is supplied, then channel data on all lightning nodes that are connected, or not connected but have open channels with this node, are returned." ], "request": { - "required": [ - "node_id", - "msg" - ], + "required": [], "properties": { - "node_id": { + "id": { "type": "pubkey", "description": [ - "The node specified by `node_id` must be a peer, i.e., it must have a direct connection with the node receiving the RPC call, and the connection must be established. For a method to send arbitrary messages over multiple hops, including hops that do not understand the custom message, see the `createonion` and `sendonion` RPC methods. Messages can only be injected if the connection is handled by `openingd` or `channeld`. Messages cannot be injected when the peer is handled by `onchaind` or `closingd` since these do not have a connection, or are synchronous daemons that do not handle spontaneous messages." - ] - }, - "msg": { - "type": "hex", - "description": [ - "Must be a hex encoded well-formed message, including the 2-byte type prefix, but excluding the length prefix which will be added by the RPC method. The message types may not be one of the internally handled types, since that may cause issues with the internal state tracking of Core Lightning. We do (as of *v23.11*) allow sending of even types, but note that peers (as per the spec) will disconnect on receiving unknown even types." - ] - } - } - }, - "response": { - "required": [ - "status" - ], - "properties": { - "status": { - "type": "string", - "description": [ - "Information about where message was queued." - ] - } - }, - "pre_return_value_notes": [ - "The method will validate the arguments and queue the message for delivery through the daemon that is currently handling the connection. Queuing provides best effort guarantees and the message may not be delivered if the connection is terminated while the message is queued. The RPC method will return as soon as the message is queued.", - "", - "If any of the above limitations is not respected the method returns an explicit error message stating the issue." - ] - }, - "example_json_request": [ - { - "id": "example:sendcustommsg#5", - "method": "sendcustommsg", - "params": { - "node_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "msg": "77770012" - } - } - ], - "example_json_response": [ - { - "status": "Message sent to connectd for delivery" - } - ], - "author": [ - "Christian Decker <> is mainly responsible." - ], - "see_also": [ - "lightning-createonion(7)", - "lightning-sendonion(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-sendinvoice.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "sendinvoice", - "title": "Command for send an invoice for an offer", - "warning": "experimental-offers only", - "description": [ - "The **sendinvoice** RPC command creates and sends an invoice to the issuer of an *invoice_request* for it to pay: lightning-invoicerequest(7).", - "", - "If **fetchinvoice-noconnect** is not specified in the configuation, it will connect to the destination in the (currently common!) case where it cannot find a route which supports `option_onion_messages`." - ], - "request": { - "required": [ - "invreq", - "label" - ], - "properties": { - "invreq": { - "type": "string", - "description": [ - "The bolt12 invoice_request string beginning with `lnr1`." - ] - }, - "label": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ], - "description": [ - "The unique label to use for this invoice." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "Required if the *offer* does not specify an amount at all, or specifies it in a different currency. Otherwise you may set it (e.g. to provide a tip)." - ], - "default": "the amount contained in the offer (multiplied by *quantity* if any)" - }, - "timeout": { - "type": "u32", - "description": [ - "Seconds to wait for the offering node to pay the invoice or return an error. This will also be the timeout on the invoice that is sent." - ], - "default": "90 seconds" - }, - "quantity": { - "type": "u64", - "description": [ - "Quantity is is required if the offer specifies quantity_max, otherwise it is not allowed." + "If supplied, limits the channels to just the peer with the given ID, if it exists." ] } } }, "response": { "required": [ - "label", - "description", - "payment_hash", - "status", - "created_index", - "expires_at" + "channels" ], "properties": { - "label": { - "type": "string", - "description": [ - "Unique label supplied at invoice creation." - ] - }, - "description": { - "type": "string", - "description": [ - "Description used in the invoice." - ] - }, - "payment_hash": { - "type": "hash", - "description": [ - "The hash of the *payment_preimage* which will prove payment." - ] - }, - "status": { - "type": "string", - "enum": [ - "unpaid", - "paid", - "expired" - ], - "description": [ - "Whether it's paid, unpaid or unpayable." - ] - }, - "expires_at": { - "type": "u64", - "description": [ - "UNIX timestamp of when it will become / became unpayable." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "The amount required to pay this invoice." - ] - }, - "bolt12": { - "type": "string", - "description": [ - "The BOLT12 string." - ] - }, - "created_index": { - "type": "u64", - "added": "v23.08", - "description": [ - "1-based index indicating order this invoice was created in." - ] - }, - "updated_index": { - "type": "u64", - "added": "v23.08", - "description": [ - "1-based index indicating order this invoice was changed (only present if it has changed since creation)." - ] - } - }, - "allOf": [ - { - "if": { + "channels": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "state", + "opener", + "features", + "peer_connected", + "peer_id" + ], "properties": { - "status": { + "peer_id": { + "type": "pubkey", + "description": [ + "Node Public key." + ] + }, + "peer_connected": { + "type": "boolean", + "description": [ + "A boolean flag that is set to true if the peer is online." + ] + }, + "reestablished": { + "type": "boolean", + "added": "v24.02", + "description": [ + "A boolean flag that is set to true if we have successfully exchanged reestablish messages with this connection." + ] + }, + "state": { + "type": "string", + "enum": [ + "OPENINGD", + "CHANNELD_AWAITING_LOCKIN", + "CHANNELD_NORMAL", + "CHANNELD_SHUTTING_DOWN", + "CLOSINGD_SIGEXCHANGE", + "CLOSINGD_COMPLETE", + "AWAITING_UNILATERAL", + "FUNDING_SPEND_SEEN", + "ONCHAIN", + "DUALOPEND_OPEN_INIT", + "DUALOPEND_AWAITING_LOCKIN", + "CHANNELD_AWAITING_SPLICE", + "DUALOPEND_OPEN_COMMITTED", + "DUALOPEND_OPEN_COMMIT_READY" + ], + "description": [ + "The channel state, in particular `CHANNELD_NORMAL` means the channel can be used normally." + ] + }, + "scratch_txid": { + "type": "txid", + "description": [ + "The txid we would use if we went onchain now." + ] + }, + "channel_type": { + "type": "object", + "description": [ + "Channel_type as negotiated with peer." + ], + "added": "v23.05", + "additionalProperties": false, + "required": [ + "bits", + "names" + ], + "properties": { + "bits": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + }, + "names": { + "type": "array", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "items": { + "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" + ], + "description": [ + "Name of feature bit." + ] + } + } + } + }, + "updates": { + "type": "object", + "added": "v24.02", + "description": [ + "Latest gossip updates sent/received." + ], + "additionalProperties": false, + "required": [ + "local" + ], + "properties": { + "local": { + "type": "object", + "description": [ + "Our gossip for channel." + ], + "additionalProperties": false, + "added": "v24.02", + "required": [ + "htlc_minimum_msat", + "htlc_maximum_msat", + "cltv_expiry_delta", + "fee_base_msat", + "fee_proportional_millionths" + ], + "properties": { + "htlc_minimum_msat": { + "type": "msat", + "added": "v24.02", + "description": [ + "Minimum msat amount we allow." + ] + }, + "htlc_maximum_msat": { + "type": "msat", + "added": "v24.02", + "description": [ + "Maximum msat amount we allow." + ] + }, + "cltv_expiry_delta": { + "type": "u32", + "added": "v24.02", + "description": [ + "Blocks delay required between incoming and outgoing HTLCs." + ] + }, + "fee_base_msat": { + "type": "msat", + "added": "v24.02", + "description": [ + "Amount we charge to use the channel." + ] + }, + "fee_proportional_millionths": { + "type": "u32", + "added": "v24.02", + "description": [ + "Amount we charge to use the channel in parts-per-million." + ] + } + } + }, + "remote": { + "type": "object", + "added": "v24.02", + "description": [ + "Peer's gossip for channel." + ], + "additionalProperties": false, + "required": [ + "htlc_minimum_msat", + "htlc_maximum_msat", + "cltv_expiry_delta", + "fee_base_msat", + "fee_proportional_millionths" + ], + "properties": { + "htlc_minimum_msat": { + "type": "msat", + "added": "v24.02", + "description": [ + "Minimum msat amount they allow." + ] + }, + "htlc_maximum_msat": { + "type": "msat", + "added": "v24.02", + "description": [ + "Maximum msat amount they allow." + ] + }, + "cltv_expiry_delta": { + "type": "u32", + "added": "v24.02", + "description": [ + "Blocks delay required between incoming and outgoing HTLCs." + ] + }, + "fee_base_msat": { + "type": "msat", + "added": "v24.02", + "description": [ + "Amount they charge to use the channel." + ] + }, + "fee_proportional_millionths": { + "type": "u32", + "added": "v24.02", + "description": [ + "Amount they charge to use the channel in parts-per-million." + ] + } + } + } + } + }, + "ignore_fee_limits": { + "type": "boolean", + "added": "v23.08", + "description": [ + "Set if we allow this peer to set fees to anything they want." + ] + }, + "lost_state": { + "type": "boolean", + "added": "v24.02", + "description": [ + "Set if we are fallen behind i.e. lost some channel state." + ] + }, + "feerate": { + "type": "object", + "description": [ + "Feerates for the current tx." + ], + "additionalProperties": false, + "required": [ + "perkw", + "perkb" + ], + "properties": { + "perkw": { + "type": "u32", + "description": [ + "Feerate per 1000 weight (i.e kSipa)." + ] + }, + "perkb": { + "type": "u32", + "description": [ + "Feerate per 1000 virtual bytes." + ] + } + } + }, + "owner": { "type": "string", - "enum": [ - "paid" + "description": [ + "The current subdaemon controlling this connection." ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "pay_index", - "amount_received_msat", - "paid_at", - "payment_preimage" - ], - "properties": { - "label": {}, - "description": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "bolt12": {}, - "expires_at": {}, - "created_index": {}, - "updated_index": {}, - "pay_index": { - "type": "u64", + }, + "short_channel_id": { + "type": "short_channel_id", "description": [ - "Unique incrementing index for this payment." + "The short_channel_id (once locked in)." ] }, - "amount_received_msat": { - "type": "msat", + "channel_id": { + "type": "hash", "description": [ - "The amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)." + "The full channel_id (funding txid Xored with output number)." ] }, - "paid_at": { - "type": "u64", + "funding_txid": { + "type": "txid", "description": [ - "UNIX timestamp of when it was paid." + "ID of the funding transaction." ] }, - "payment_preimage": { - "type": "secret", + "funding_outnum": { + "type": "u32", "description": [ - "Proof of payment." + "The 0-based output number of the funding transaction which opens the channel." ] - } - } - } - } - ] - }, - "errors": [ - "The following error codes may occur:", - "", - "- -1: Catchall nonspecific error.", - "- 1002: Offer has expired.", - "- 1003: Cannot find a route to the node making the offer.", - "- 1004: The node making the offer returned an error message.", - "- 1005: We timed out waiting for the invoice to be paid" - ], - "example_json_request": [ - { - "id": "example:sendinvoice#1", - "method": "sendinvoice", - "params": { - "invreq": "lnr1qqg804wzdsyn8g4mf2yc22k8xvjpjzstwd5k6urvv5s8getnw3gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02gqsykppqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4nuzqw5w7y7xqm2rushk5a5n3mcuvqel954raykd5nqa830nq9hpd4s4fcnxw266vp9d5c8f3m3w40hmm6gm8akxx3rsnr7d4usunv0x3q8q", - "label": "payme for real!" - } - } - ], - "example_json_response": [ - { - "label": "payme for real!", - "bolt12": "lni1qqg804wzdsyn8g4mf2yc22k8xvjpjzstwd5k6urvv5s8getnw3gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02gqsykppqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4ngycqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky96qmcmtl30xtt7jdakfyhzm8f0gny6f4d2ukx5gurem04z8lfd2wza5qs9pz6wp9vu7cm6n4wmmrz77y4w6z5xv4q93yudkdtkl5zmzdzuawzqqex7gd5v0x0r83pqj82udd542fl4krh50s0dkx47d0hd5wh77g52xxl75ccpkt35mc8n282wslju9ufyys2y8qqqqqqqqqqqqqqqpgqqqqqqqqqqqqp6f9jm7k9yqqqqqq2gpr96l99lfspt25zqnyfgu7hznmt2tzkjdt92d2wc3dsq7keph7w8gudjs46spfzqrlu4gqs9vppqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky9muzqpze8kk43g0wh4h8qlac5lswwesrvsaxcza2f5j90c2h3ts8yzmn9g4mxqe89fngrqny8nf52xxuxep6548etda8lp876jr0nnxgdkdq", - "payment_hash": "4c89473d714f6b52c56935655354ec45b007ad90dfce3a38d942ba8052200ffc", - "amount_msat": 2, - "status": "paid", - "pay_index": 1, - "amount_received_msat": 2, - "paid_at": 1708640865, - "payment_preimage": "305951ab02cb2ea5eb884dbfd8fb110b4e088ecb8338b3e84e8f9c70919c19bf", - "description": "simple test", - "expires_at": 1708640953, - "created_index": 2, - "updated_index": 1 - } - ], - "author": [ - "Rusty Russell <> is mainly responsible." - ], - "see_also": [ - "lightning-fetchinvoice(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-sendonion.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "sendonion", - "title": "Send a payment with a custom onion packet", - "description": [ - "The **sendonion** RPC command can be used to initiate a payment attempt with a custom onion packet. The onion packet is used to deliver instructions for hops along the route on how to behave. Normally these instructions are indications on where to forward a payment and what parameters to use, or contain details of the payment for the final hop. However, it is possible to add arbitrary information for hops in the custom onion, allowing for custom extensions that are not directly supported by Core Lightning.", - "", - "If the first element of *route* does not have \"channel\" set, a suitable channel (if any) will be chosen, otherwise that specific short-channel-id is used. The following is an example of a 3 hop onion:", - "", - "```json", - "[", - " \"298606954e9de3e9d938d18a74fed794c440e8eda82e52dc08600953c8acf9c4\",", - " \"2dc094de72adb03b90894192edf9f67919cb2691b37b1f7d4a2f4f31c108b087\",", - " \"a7b82b240dbd77a4ac8ea07709b1395d8c510c73c17b4b392bb1f0605d989c85\"", - "]", - "```" - ], - "request": { - "required": [ - "onion", - "first_hop", - "payment_hash" - ], - "properties": { - "onion": { - "type": "hex", - "description": [ - "Hex-encoded 1366 bytes long blob that was returned by either of the tools that can generate onions. It contains the payloads destined for each hop and some metadata. Please refer to [BOLT 04][bolt04] for further details. If is specific to the route that is being used and the *payment_hash* used to construct, and therefore cannot be reused for other payments or to attempt a separate route. The custom onion can generally be created using the `devtools/onion` CLI tool, or the **createonion** RPC command." - ] - }, - "first_hop": { - "type": "object", - "description": [ - "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*." - ], - "required": [ - "id", - "amount_msat", - "delay" - ], - "properties": { - "id": { - "type": "pubkey", - "description": [ - "Node id for the peer. Use any available channel available to this peer." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "The amount to add an HTLC for millisatoshis." - ] - }, - "delay": { - "type": "u16", - "description": [ - "The number of blocks delay of blocks on top of the current blockheight." - ] - } - } - }, - "payment_hash": { - "type": "hash", - "description": [ - "Specifies the 32 byte hex-encoded hash to use as a challenge to the HTLC that we are sending. It is specific to the onion and has to match the one the onion was created with." - ] - }, - "label": { - "type": "string", - "description": [ - "Can be used to provide a human readable reference to retrieve the payment at a later time." - ] - }, - "shared_secrets": { - "type": "array", - "description": [ - "A JSON list of 32 byte hex-encoded secrets that were used when creating the onion. Core Lightning can send a payment with a custom onion without the knowledge of these secrets, however it will not be able to parse an eventual error message since that is encrypted with the shared secrets used in the onion. If *shared_secrets* is provided Core Lightning will decrypt the error, act accordingly, e.g., add a `channel_update` included in the error to its network view, and set the details in *listsendpays* correctly. If it is not provided Core Lightning will store the encrypted onion, and expose it in *listsendpays* allowing the caller to decrypt it externally. If it is not provided the Core Lightning node does not know how long the route is, which channels or nodes are involved, and what an eventual error could have been. It can therefore be used for oblivious payments." - ], - "items": { - "type": "secret" - } - }, - "partid": { - "type": "u16", - "description": [ - "If provided and non-zero, allows for multiple parallel partial payments with the same *payment_hash*." - ] - }, - "bolt11": { - "type": "string", - "description": [ - "If provided, it will be returned in *waitsendpay* and *listsendpays* results." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "Used to annotate the payment, and is returned by *waitsendpay* and *listsendpays*." - ] - }, - "destination": { - "type": "pubkey", - "description": [ - "If provided, it will be returned in **listpays** result." - ] - }, - "localinvreqid": { - "type": "hash", - "description": [ - "`localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7)." - ] - }, - "groupid": { - "type": "u64", - "description": [ - "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." - ] - }, - "description": { - "added": "v0.11.0", - "type": "string", - "description": [ - "If provided, it will be returned in *waitsendpay* and *listsendpays* results." - ] - } - } - }, - "response": { - "required": [ - "created_index", - "id", - "payment_hash", - "status", - "created_at", - "amount_sent_msat" - ], - "properties": { - "created_index": { - "added": "v23.11", - "type": "u64", - "description": [ - "1-based index indicating order this payment was created in." - ] - }, - "id": { - "type": "u64", - "description": [ - "Old synonym for created_index." - ] - }, - "payment_hash": { - "type": "hash", - "description": [ - "The hash of the *payment_preimage* which will prove payment." - ] - }, - "status": { - "type": "string", - "enum": [ - "pending", - "complete" - ], - "description": [ - "Status of the payment (could be complete if already sent previously)." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "The amount delivered to destination (if known)." - ] - }, - "destination": { - "type": "pubkey", - "description": [ - "The final destination of the payment if known." - ] - }, - "created_at": { - "type": "u64", - "description": [ - "The UNIX timestamp showing when this payment was initiated." - ] - }, - "amount_sent_msat": { - "type": "msat", - "description": [ - "The amount sent." - ] - }, - "label": { - "type": "string", - "description": [ - "The label, if given to sendpay." - ] - }, - "bolt11": { - "type": "string", - "description": [ - "The bolt11 string (if supplied)." - ] - }, - "bolt12": { - "type": "string", - "description": [ - "The bolt12 string (if supplied: **experimental-offers** only)." - ] - }, - "partid": { - "type": "u64", - "description": [ - "The partid (if supplied) to sendonion/sendpay." - ] - } - }, - "allOf": [ - { - "if": { - "properties": { - "status": { + }, + "initial_feerate": { "type": "string", - "enum": [ - "complete" + "description": [ + "For inflight opens, the first feerate used to initiate the channel open." ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "payment_preimage" - ], - "properties": { - "created_index": {}, - "id": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "destination": {}, - "created_at": {}, - "groupid": {}, - "msatoshi_sent": {}, - "amount_sent_msat": {}, - "label": {}, - "bolt11": {}, - "bolt12": {}, - "partid": {}, - "updated_index": { - "added": "v23.11", - "type": "u64", + }, + "last_feerate": { + "type": "string", + "description": [ + "For inflight opens, the most recent feerate used on the channel open." + ] + }, + "next_feerate": { + "type": "string", + "description": [ + "For inflight opens, the next feerate we'll use for the channel open." + ] + }, + "next_fee_step": { + "type": "u32", + "description": [ + "For inflight opens, the next feerate step we'll use for the channel open." + ] + }, + "inflight": { + "type": "array", + "description": [ + "Current candidate funding transactions." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "funding_txid", + "funding_outnum", + "feerate", + "total_funding_msat", + "splice_amount", + "our_funding_msat" + ], + "properties": { + "funding_txid": { + "type": "txid", + "description": [ + "ID of the funding transaction." + ] + }, + "funding_outnum": { + "type": "u32", + "description": [ + "The 0-based output number of the funding transaction which opens the channel." + ] + }, + "feerate": { + "type": "string", + "description": [ + "The feerate for this funding transaction in per-1000-weight, with `kpw` appended." + ] + }, + "total_funding_msat": { + "type": "msat", + "description": [ + "Total amount in the channel." + ] + }, + "splice_amount": { + "type": "integer", + "added": "v23.08", + "description": [ + "The amouont of sats we're splicing in or out." + ] + }, + "our_funding_msat": { + "type": "msat", + "description": [ + "Amount we have in the channel." + ] + }, + "scratch_txid": { + "type": "txid", + "description": [ + "The commitment transaction txid we would use if we went onchain now." + ] + } + } + } + }, + "close_to": { + "type": "hex", "description": [ - "1-based index indicating order this payment was changed." + "ScriptPubkey which we have to close to if we mutual close." ] }, - "payment_preimage": { - "type": "secret", + "private": { + "type": "boolean", "description": [ - "The proof of payment: SHA256 of this **payment_hash**." + "If True, we will not announce this channel." ] - } - } - } - }, - { - "if": { - "properties": { - "status": { + }, + "opener": { "type": "string", "enum": [ - "pending" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [], - "properties": { - "created_index": {}, - "id": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "destination": {}, - "created_at": {}, - "groupid": {}, - "msatoshi_sent": {}, - "amount_sent_msat": {}, - "label": {}, - "bolt11": {}, - "bolt12": {}, - "partid": {}, - "message": { - "type": "string", - "description": [ - "Monitor status with listpays or waitsendpay." - ] - } - } - } - } - ] - }, - "errors": [ - "The following error codes may occur:", - "", - "- 202: an parseable onion", - "", - "the error details are decrypted and presented here, if *shared_secrets* was provided and an error was returned by one of the intermediate nodes" - ], - "example_json_request": [ - { - "id": "example:sendonion#1", - "method": "sendonion", - "params": { - "onion": "00034928294556b10308f9aeac7a240223d4d5f72097db1ef36a36b10cab937f2f205ed7218b47d4600eaf7fd390940bf9a6cdac99aafdb4783c468150eeeab9b57e56a06778d023ffb3bb84c7d8c2ad8868b61c28b566634af52c288ed6569583db66f5bd0edfb801c252f078020e1df6359af5969296b4698a71d17c5ca6e5ee4b64b7cce3ad0a1aa31e6be4d5fe3a31fa7a25259c640716020a9a248ca3ebb68eb823f8884b5df3710969f4c2ffb153779a923bab946ed43c1f6658d7f8e7e25303bb78ef4862fb550b8b1c79d522b035eedfda9ab70a61322522acf7233bb8ea2423958448fc8ac3d000835fda04bf661f1bf2ad2d091f506840bb2f10f82c0812149d99267a47824defe90877ed70db526b2200e18dccb92b17516de3778c055645728eadf4c74375aa0aae80a7773a536a908ca1e25c0fdca90e50ce0be05eeb973ec5e83ce3ab6b35818e021780428af81320a694483c1c15f64e685ba1fd3b1e1b926e6b4ec9eeeac8aca60c60e0f0f583e35e7f081dc6f4c64157e100c79c4c25101bed77cd9f93416f9a67d9f1916a782c498c38365af4a5fabb1b745fa840a054a06564c3f4b376aeb72cdd059d3794c82bbbf12a1f62234016a6912b384e7e4cebbd39ee4395aeff43c461e226d1e0151cce508a181a9c61275bf4b89e4556cf24df13b993dec96541555f8b9a699be9488568a11ac7f25849da62765472511ad74a6660c10e37f5fa13d4e4665ef7825ae1f2da4a86d5581912262de89b4b11a722fd127b31aa0d7fab8c679b07bf95e65cb80b2dacb5b90794399fb8f23823f68058431aa1c399b5baceccaf8521d004f45dba6ec1fddc54473343e9e67cd50cc3f2f3d8a5dab8a7ab9ae553dc3cd34e74b858da75975265f7c673a25e8d01a5130ab40eaba712b80c608cd0431b4b45ea0d81af595e21f24976608429127bf586f7507666500bc7245cf9266fa0bd0e58404c496e190c873cd143ace9048e9d5021c23967a24e09f2e54166e54b4ee8888dc1af535624e7ee8b426c1628175017a9e8a73eb1d0d49028a4f4d77897f3c08f1cd7bdee2b00f9bb9eadc49a69bf4f6c0cb2c95a16f03d7958f1b8f83cb40ae87ddf75f26050e2c2ed9f8f8523b3d389a50b217bda651dc21f095fe7d2d3851a0a6cf01051f3f3c6f1ad59ed46d44928d15a0e6e1bd4df4c99bdb82a05b0e781b69a73bc30fe579c8ac9fe8aeb6beb1c0f44def2775b7341af37e6ef58ceb34958b29d3e36112b78644612228761b8badc802f0b2b8fcaeb1db8f3a8db4afa2d7b4540a7c331db6f5141fa3909a513df875ff8a63f5b542d662781ca96a69e3b2925d6a63555b2c5825ffb2ad848d71122f54110e0d203000f3e9cc23b793c3540dfb8d881caedd25055a8f495e9e7a0391dbf9cbd9344f7df659ee8d3ce5ec16217ab83e1394ba991eb8ffd9a869f8ebb2e2428845e779979c57b5f8875f502728229a55ce87b3eba85c75264d30eaf7b373f6b09ba3086d9e98348d87b049468c2c30a6501cb2a3862f1703bbf29895e8b4262353eae720ed8ae678750011e2eb51f4800d3f4725fa873d7deec1c46f77a5f61c73dc938239e77f432bcc245c7b935413c51c0bc92bdaae144452aa95910909e46e500557961203f4e1483b9c09c124464907825e1ff74c87c58d6e2e91970baac9b89a554beca6df9acee16d77dd929d0caa7797e06f2c384c03fdedc89c697b9c34787a50cf399a8d7f195e79b347efc8267c474a477ce210f11049d432b280eaf3fccd451f6218d35c64cbd1006bcc54eeea8b856855c9aa92bc3adc6900a7c7a0eee09834c5a1f2da3d8ea9a478aea90c954952ad2a72d3856350ac3132d17e1e8116fa774066a22c857a827699c98285111a405e74685a3ae579ae78c545774f45491e4935bf4", - "first_hop": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "channel": "103x3x0", - "direction": 1, - "amount_msat": 1002, - "delay": 21, - "style": "tlv" - }, - "payment_hash": "f584c14bb23506acdd94cf3cea377f3cc5805f3cba5430bc3756ef83ede1a0dc", - "label": null, - "shared_secrets": null, - "partid": null, - "bolt11": null, - "amount_msat": null, - "destination": null - } - } - ], - "example_json_response": [ - { - "message": "Monitor status with listpays or waitsendpay", - "created_index": 1, - "id": 1, - "payment_hash": "f584c14bb23506acdd94cf3cea377f3cc5805f3cba5430bc3756ef83ede1a0dc", - "groupid": 1, - "amount_sent_msat": 1002, - "created_at": 1706315098, - "status": "pending" - } - ], - "author": [ - "Christian Decker <> is mainly responsible." - ], - "see_also": [ - "lightning-createonion(7)", - "lightning-sendpay(7)", - "lightning-listsendpays(7)" - ], - "resources": [ - "Main web site: ", - "", - "[bolt04]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md" - ] - }, - "lightning-sendonionmessage.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "sendonionmessage", - "title": "low-level command to send an onion message", - "warning": "experimental-onion-messages only", - "description": [ - "The **sendonionmessage** RPC command can be used to send a message via the lightning network. These are currently used by *offers* to request and receive invoices." - ], - "request": { - "required": [ - "first_id", - "blinding", - "hops" - ], - "properties": { - "first_id": { - "type": "pubkey", - "description": [ - "The (presumably well-known) public key of the start of the path." - ] - }, - "blinding": { - "type": "pubkey", - "description": [ - "Blinding factor for this path." - ] - }, - "hops": { - "type": "array", - "description": [ - "", - "" - ], - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "node", - "tlv" - ], - "properties": { - "node": { - "type": "pubkey", + "local", + "remote" + ], "description": [ - "Public key of the node." + "Who initiated the channel." ] }, - "tlv": { - "type": "u8", + "closer": { + "type": "string", + "enum": [ + "local", + "remote" + ], "description": [ - "Contains a hexadecimal TLV to include." + "Who initiated the channel close (only present if closing)." ] - } - } - } - } - } - }, - "response": { - "required": [], - "properties": {} - }, - "author": [ - "Rusty Russell <> is mainly responsible." - ], - "see_also": [ - "lightning-fetchinvoice(7)", - "lightning-offer(7)" - ], - "resources": [ - "Main web site: ", - "", - "[bolt04]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md" - ] - }, - "lightning-sendpay.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "sendpay", - "title": "Low-level command for sending a payment via a route", - "description": [ - "The **sendpay** RPC command attempts to send funds associated with the given *payment_hash*, along a route to the final destination in the route.", - "", - "Generally, a client would call lightning-getroute(7) to resolve a route, then use **sendpay** to send it. If it fails, it would call lightning-getroute(7) again to retry. If the route is empty, a payment-to-self is attempted.", - "", - "The response will occur when the payment is on its way to the destination. The **sendpay** RPC command does not wait for definite success or definite failure of the payment (except for already-succeeded payments, or to-self payments). Instead, use the **waitsendpay** RPC command to poll or wait for definite success or definite failure.", - "", - "Once a payment has succeeded, calls to **sendpay** with the same *payment_hash* but a different *amount_msat* or destination will fail; this prevents accidental multiple payments. Calls to **sendpay** with the same *payment_hash*, *amount_msat*, and destination as a previous successful payment (even if a different route or *partid*) will return immediately with success." - ], - "request": { - "required": [ - "route", - "payment_hash" - ], - "properties": { - "route": { - "type": "array", - "items": { - "type": "object", - "required": [ - "amount_msat", - "id", - "delay", - "channel" - ], - "properties": { - "id": { - "type": "pubkey", + }, + "features": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "option_static_remotekey", + "option_anchor_outputs", + "option_anchors_zero_fee_htlc_tx", + "option_scid_alias", + "option_zeroconf" + ], + "description": [ + "BOLT #9 features which apply to this channel." + ] + } + }, + "funding": { + "type": "object", + "additionalProperties": false, + "required": [ + "local_funds_msat", + "remote_funds_msat" + ], + "properties": { + "pushed_msat": { + "type": "msat", + "description": [ + "Amount pushed from opener to peer." + ] + }, + "local_funds_msat": { + "type": "msat", + "description": [ + "Amount of channel we funded." + ] + }, + "remote_funds_msat": { + "type": "msat", + "description": [ + "Amount of channel they funded." + ] + }, + "fee_paid_msat": { + "type": "msat", + "description": [ + "Amount we paid peer at open." + ] + }, + "fee_rcvd_msat": { + "type": "msat", + "description": [ + "Amount we were paid by peer at open." + ] + } + } + }, + "to_us_msat": { + "type": "msat", "description": [ - "The node at the end of this hop." + "How much of channel is owed to us." ] }, - "channel": { - "type": "short_channel_id", + "min_to_us_msat": { + "type": "msat", "description": [ - "The channel joining these nodes." + "Least amount owed to us ever. If the peer were to successfully steal from us, this is the amount we would still retain." ] }, - "delay": { - "type": "u32", + "max_to_us_msat": { + "type": "msat", "description": [ - "The total CLTV expected by the node at the end of this hop." + "Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get." ] }, - "amount_msat": { + "total_msat": { "type": "msat", "description": [ - "The amount expected by the node at the end of this hop." - ] - } - } - } - }, - "payment_hash": { - "type": "hash", - "description": [ - "The hash of the payment_preimage." - ] - }, - "label": { - "type": "string", - "description": [ - "The label provided when creating the invoice_request." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "Amount must be provided if *partid* is non-zero, or the payment is to-self, otherwise it must be equal to the final amount to the destination. it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*." - ], - "default": "in millisatoshi precision" - }, - "bolt11": { - "type": "string", - "description": [ - "Bolt11 invoice to pay. If provided, will be returned in *waitsendpay* and *listsendpays* results." - ] - }, - "payment_secret": { - "type": "secret", - "description": [ - "Value that the final recipient requires to accept the payment, as defined by the `payment_data` field in BOLT 4 and the `s` field in the BOLT 11 invoice format. It is required if *partid* is non-zero." - ] - }, - "partid": { - "type": "u64", - "description": [ - "Must not be provided for self-payments. If provided and non-zero, allows for multiple parallel partial payments with the same *payment_hash*. The *amount_msat* amount (which must be provided) for each **sendpay** with matching *payment_hash* must be equal, and **sendpay** will fail if there are differing values given." - ] - }, - "localinvreqid": { - "type": "hex", - "description": [ - "Indicates that this payment is being made for a local invoice_request. This ensures that we only send a payment for a single-use invoice_request once." - ] - }, - "groupid": { - "type": "u64", - "description": [ - "Allows you to attach a number which appears in **listsendpays** so payments can be identified as part of a logical group. The *pay* plugin uses this to identify one attempt at a MPP payment, for example." - ] - }, - "payment_metadata": { - "added": "v0.11.0", - "type": "hex", - "description": [ - "Placed in the final onion hop TLV." - ] - }, - "description": { - "added": "v0.11.0", - "type": "string", - "description": [ - "Description used in the invoice." - ] - } - } - }, - "response": { - "required": [ - "id", - "created_index", - "payment_hash", - "status", - "created_at", - "amount_sent_msat" - ], - "properties": { - "created_index": { - "added": "v23.11", - "type": "u64", - "description": [ - "1-based index indicating order this payment was created in." - ] - }, - "updated_index": { - "added": "v23.11", - "type": "u64", - "description": [ - "1-based index indicating order this payment was changed (only present if it has changed since creation)." - ] - }, - "id": { - "type": "u64", - "description": [ - "Old synonym for created_index." - ] - }, - "groupid": { - "type": "u64", - "description": [ - "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." - ] - }, - "payment_hash": { - "type": "hash", - "description": [ - "The hash of the *payment_preimage* which will prove payment." - ] - }, - "status": { - "type": "string", - "enum": [ - "pending", - "complete" - ], - "description": [ - "Status of the payment (could be complete if already sent previously)." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "The amount delivered to destination (if known)." - ] - }, - "destination": { - "type": "pubkey", - "description": [ - "The final destination of the payment if known." - ] - }, - "created_at": { - "type": "u64", - "description": [ - "The UNIX timestamp showing when this payment was initiated." - ] - }, - "completed_at": { - "type": "u64", - "description": [ - "The UNIX timestamp showing when this payment was completed." - ] - }, - "amount_sent_msat": { - "type": "msat", - "description": [ - "The amount sent." - ] - }, - "label": { - "type": "string", - "description": [ - "The *label*, if given to sendpay." - ] - }, - "partid": { - "type": "u64", - "description": [ - "The *partid*, if given to sendpay." - ] - }, - "bolt11": { - "type": "string", - "description": [ - "The bolt11 string (if supplied)." - ] - }, - "bolt12": { - "type": "string", - "description": [ - "The bolt12 string (if supplied: **experimental-offers** only)." - ] - } - }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "complete" + "Total amount in the channel." ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "payment_preimage" - ], - "properties": { - "id": {}, - "created_index": {}, - "updated_index": {}, - "groupid": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "destination": {}, - "created_at": {}, - "completed_at": {}, - "msatoshi_sent": {}, - "amount_sent_msat": {}, - "label": {}, - "partid": {}, - "bolt11": {}, - "bolt12": {}, - "payment_preimage": { - "type": "secret", + }, + "fee_base_msat": { + "type": "msat", "description": [ - "The proof of payment: SHA256 of this **payment_hash**." + "Amount we charge to use the channel." ] - } - } - } - }, - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "pending" + }, + "fee_proportional_millionths": { + "type": "u32", + "description": [ + "Amount we charge to use the channel in parts-per-million." ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "message" - ], - "properties": { - "id": {}, - "created_index": {}, - "updated_index": {}, - "groupid": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "destination": {}, - "created_at": {}, - "completed_at": {}, - "msatoshi_sent": {}, - "amount_sent_msat": {}, - "label": {}, - "partid": {}, - "bolt11": {}, - "bolt12": {}, - "message": { - "type": "string", + }, + "dust_limit_msat": { + "type": "msat", "description": [ - "Monitor status with listpays or waitsendpay." + "Minimum amount for an output on the channel transactions." ] - } - } - } - } - ] - }, - "errors": [ - "On error, if the error occurred from a node other than the final destination, the route table will be updated so that lightning-getroute(7) should return an alternate route (if any). An error from the final destination implies the payment should not be retried.", - "", - "- -1: Catchall nonspecific error.", - "- 201: Already paid with this *hash* using different amount or destination.", - "- 202: Unparseable onion reply. The *data* field of the error will have an *onionreply* field, a hex string representation of the raw onion reply.", - "- 203: Permanent failure at destination. The *data* field of the error will be routing failure object.", - "- 204: Failure along route; retry a different route. The *data* field of the error will be routing failure object.", - "- 212: *localinvreqid* refers to an invalid, or used, local invoice_request.", - "", - "A routing failure object has the fields below:", - "", - "*erring_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on.", - "*erring_node*: The hex string of the pubkey id of the node that reported the error.", - "*erring_channel*: The short channel ID of the channel that has the error, or *0:0:0* if the destination node raised the error. In addition *erring_direction* will indicate which direction of the channel caused the failure.", - "*failcode*: The failure code, as per BOLT #4.", - "*channel_update*: The hex string of the *channel_update* message received from the remote node. Only present if error is from the remote node and the *failcode* has the UPDATE bit set, as per BOLT #4." - ], - "example_json_request": [ - { - "id": "example:sendpay#1", - "method": "sendpay", - "params": { - "route": [ - { - "amount_msat": 11000000, - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "delay": 5, - "channel": "103x1x0" - } - ], - "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", - "label": null, - "amount_msat": null, - "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk", - "payment_secret": "82644944d3f70d42aad1d5f7b5d7a629e7afa30b529cc952a4c59fc0e3790ea2", - "partid": null, - "groupid": null, - "payment_metadata": null - } - }, - { - "id": "example:sendpay#2", - "method": "sendpay", - "params": { - "route": [ - { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "channel": "103x1x0", - "direction": 1, - "amount_msat": 4211, - "style": "tlv", - "delay": 24 - }, - { - "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "channel": "105x1x0", - "direction": 0, - "amount_msat": 3710, - "style": "tlv", - "delay": 16 - }, - { - "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "channel": "107x1x0", - "direction": 1, - "amount_msat": 3210, - "style": "tlv", - "delay": 8 - } - ], - "payment_hash": "bc747053329402620a26bdc187cd134cdb699130d85be499ecd24160aff04c5c", - "label": null, - "amount_msat": null, - "bolt11": null, - "payment_secret": "c36a2fe9aced78c06960e2f21b369ed03f0492c97e53ba3b662163bcdaf1d7fa", - "partid": null, - "groupid": null, - "payment_metadata": null - } - } - ], - "example_json_response": [ - { - "message": "Monitor status with listpays or waitsendpay", - "created_index": 1, - "id": 1, - "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", - "groupid": 1, - "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "amount_msat": 11000000, - "amount_sent_msat": 11000000, - "created_at": 1706152930, - "status": "pending", - "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk" - }, - { - "message": "Monitor status with listpays or waitsendpay", - "created_index": 2, - "id": 2, - "payment_hash": "bc747053329402620a26bdc187cd134cdb699130d85be499ecd24160aff04c5c", - "groupid": 1, - "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "amount_msat": 3210, - "amount_sent_msat": 4211, - "created_at": 1708624260, - "status": "pending" - } - ], - "author": [ - "Rusty Russell <> is mainly responsible." - ], - "see_also": [ - "lightning-listinvoice(7)", - "lightning-delinvoice(7)", - "lightning-getroute(7)", - "lightning-invoice(7)", - "lightning-pay(7)", - "lightning-waitsendpay(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-sendpsbt.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "sendpsbt", - "title": "Command to finalize, extract and send a partially signed bitcoin transaction (PSBT).", - "description": [ - "The **sendpsbt** is a low-level RPC command which sends a fully-signed PSBT." - ], - "request": { - "required": [ - "psbt" - ], - "properties": { - "psbt": { - "type": "string", - "description": [ - "The fully signed psbt to be sent." - ] - }, - "reserve": { - "type": "u32", - "description": [ - "Number of blocks to increase reservation of any of our inputs by." - ], - "default": "72" - } - } - }, - "response": { - "required": [ - "tx", - "txid" - ], - "properties": { - "tx": { - "type": "hex", - "description": [ - "The raw transaction which was sent." - ] - }, - "txid": { - "type": "txid", - "description": [ - "The txid of the **tx**." - ] - } - } - }, - "example_json_request": [ - { - "id": "example:sendpsbt#1", - "method": "sendpsbt", - "params": { - "psbt": "some_psbt" - } - }, - { - "id": "example:sendpsbt#2", - "method": "sendpsbt", - "params": { - "psbt": "cHNidP8BAM0CAAAABEV+dnFRINmyeHxi4Id0OrcuzI5au5/BlPtTfu7E2m3EAAAAAAD9////cv8oioDx+0NCEnjBSYtnwF0H4VR13j+bkyb5gOOQLUUBAAAAAP3///8ehOrKm7JEq6zflkp9+zmSwE1iPe1yh3KTXvk+om/legEAAAAA/f///2s31wNrI1UavMgjC1GyrOHNbxOm68KYa13WX/mGfmjcAQAAAAD9////AcEAPQAAAAAAFgAUyQltQ/QI6lJgICYsza18hRa5KoEAAAAAAAEAcQIAAAABTzfqjIqV1wPpqc/3/Cb+tMX5EDrLmnhb5BMNx3aB/hYAAAAAAP3///8CQEIPAAAAAAAWABR9CNmX36nN45+GhjqvD4LjLMMMg/+juSkBAAAAFgAUJB0adsMdjkacZWrLwyteqfOaTrRlAAAAAQEfQEIPAAAAAAAWABR9CNmX36nN45+GhjqvD4LjLMMMgyICA1p5u7tAbUvCjfBfpqhzKM+wKn4TdDvs3NHfz+BxwuAQRzBEAiBwFb9rA0nUVlIPGd2aaiRbJ+KH4MLM3Bu+f0JuXB/hwAIgT2rrIUG9gXBZoH9fcPjCnbbM1SR4GiLYGLeALB8yENoBIgYDWnm7u0BtS8KN8F+mqHMoz7AqfhN0O+zc0d/P4HHC4BAIfQjZlwAAAAAAAQBxAgAAAAGANpEFI+CgfALTim/MWsAa62g+EmFWrFrzBDBCmCB3MgAAAAAA/f///wKZKdgpAQAAABYAFB+xhfU1pgl9WIvDKzAHZp8UeNkzQEIPAAAAAAAWABQHHEnK0vQg88gF+fa5ilcmnLFBUGUAAAABAR9AQg8AAAAAABYAFAccScrS9CDzyAX59rmKVyacsUFQIgICXTcoCCnxhsuZXNzL8jirRWQBOTlzUTljJKNldd803f9HMEQCIDtx/kEoc4PHDDm4eX5SEOmuRGu7ShpEG7xKBbuD/NjiAiBYkIKod39dcBarCT7Dbchkuwx70tJhOxQSJi2EMioGrwEiBgJdNygIKfGGy5lc3MvyOKtFZAE5OXNROWMko2V13zTd/wgHHEnKAAAAAAABAHECAAAAAVHU7RCZylzRMdlMBJ2ba4XKxv0l7LdWVnPYS6mhkf60AAAAAAD9////Av5VbSkBAAAAFgAU0BhRKzRbIC6H+s6j86d6cMpTNNhAQg8AAAAAABYAFD1D0ia8wnAZreUtej3FKnrBvii4ZQAAAAEBH0BCDwAAAAAAFgAUPUPSJrzCcBmt5S16PcUqesG+KLgiAgKKWZFo08l968cbxm5icOzwVPMA2Igwm6BUcaSCF13ZMEcwRAIgNAeIVGvUj9MWM18am0dx3JtEf79iQMX7Rqz1tttes3ICIAtNCglUlvpSidAxc/xoiy9cA13bgimJx25G+eZXfYJeASIGAopZkWjTyX3rxxvGbmJw7PBU8wDYiDCboFRxpIIXXdkwCD1D0iYAAAAAAAEAcQIAAAABRX52cVEg2bJ4fGLgh3Q6ty7Mjlq7n8GU+1N+7sTabcQBAAAAAP3///8CMmGqKQEAAAAWABSxLq0p9YAKl+hX7pFc0K/X+PIWmUBCDwAAAAAAFgAUZhwjt5DdNJE3OvCx2L7Qh31c3iJlAAAAAQEfQEIPAAAAAAAWABRmHCO3kN00kTc68LHYvtCHfVzeIiICA/qclQheQrHlADzR9BgXjDDJbkrneVTKD8SMWIJv9OsORzBEAiBKABqNV7cF5DKhtd+m+ZEmWF21vBt2uBKnzeDuUFqvDwIgJc6+/6GQqIfz869kJpUFTAMYTeL2qWR6d28EQEOJgkMBIgYD+pyVCF5CseUAPNH0GBeMMMluSud5VMoPxIxYgm/06w4IZhwjtwAAAAAAAA==", - "reserve": null - } - } - ], - "errors": [ - "On failure, one of the following error codes may be returned:", - "", - "- -32602: Error in given parameters or some error happened during the command process." - ], - "example_json_response": [ - { - "txid": "05985072bbe20747325e69a159fe08176cc1bbc96d25e8848edad2dddc1165d0", - "tx": "02000000027032912651fc25a3e0893acd5f9640598707e2dfef92143bb5a4020e335442800100000017160014a5f48b9aa3cb8ca6cc1040c11e386745bb4dc932ffffffffd229a4b4f78638ebcac10a68b0561585a5d6e4d3b769ad0a909e9b9afaeae24e00000000171600145c83da9b685f9142016c6f5eb5f98a45cfa6f686ffffffff01915a01000000000017a9143a4dfd59e781f9c3018e7d0a9b7a26d58f8d22bf8700000000" - }, - { - "tx": "02000000000104457e76715120d9b2787c62e087743ab72ecc8e5abb9fc194fb537eeec4da6dc40000000000fdffffff72ff288a80f1fb43421278c1498b67c05d07e15475de3f9b9326f980e3902d450100000000fdffffff1e84eaca9bb244abacdf964a7dfb3992c04d623ded728772935ef93ea26fe57a0100000000fdffffff6b37d7036b23551abcc8230b51b2ace1cd6f13a6ebc2986b5dd65ff9867e68dc0100000000fdffffff01c1003d0000000000160014c9096d43f408ea526020262ccdad7c8516b92a810247304402207015bf6b0349d456520f19dd9a6a245b27e287e0c2ccdc1bbe7f426e5c1fe1c002204f6aeb2141bd817059a07f5f70f8c29db6ccd524781a22d818b7802c1f3210da0121035a79bbbb406d4bc28df05fa6a87328cfb02a7e13743becdcd1dfcfe071c2e0100247304402203b71fe41287383c70c39b8797e5210e9ae446bbb4a1a441bbc4a05bb83fcd8e20220589082a8777f5d7016ab093ec36dc864bb0c7bd2d2613b1412262d84322a06af0121025d37280829f186cb995cdccbf238ab45640139397351396324a36575df34ddff024730440220340788546bd48fd316335f1a9b4771dc9b447fbf6240c5fb46acf5b6db5eb37202200b4d0a095496fa5289d03173fc688b2f5c035ddb822989c76e46f9e6577d825e0121028a599168d3c97debc71bc66e6270ecf054f300d888309ba05471a482175dd9300247304402204a001a8d57b705e432a1b5dfa6f99126585db5bc1b76b812a7cde0ee505aaf0f022025cebeffa190a887f3f3af642695054c03184de2f6a9647a776f044043898243012103fa9c95085e42b1e5003cd1f418178c30c96e4ae77954ca0fc48c58826ff4eb0e00000000", - "txid": "43bb1c1bce6763ffe4d5df6b49f152f907f36f7849e55bb56075e2b256d17502" - } - ], - "author": [ - "Vincenzo Palazzo <> wrote the initial version of this man page,", - "but many others did the hard work of actually implementing this rpc command." - ], - "see_also": [ - "lightning-fundpsbt(7)", - "lightning-signpsbt(7)", - "lightning-listtransactions(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-setchannel.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "setchannel", - "title": "Command for configuring fees / htlc range advertized for a channel", - "description": [ - "The **setchannel** RPC command sets channel specific routing fees, and `htlc_minimum_msat` or `htlc_maximum_msat` as defined in BOLT #7. The channel has to be in normal or awaiting state. This can be checked by **listpeers** reporting a *state* of CHANNELD_NORMAL or CHANNELD_AWAITING_LOCKIN for the channel.", - "", - "These changes (for a public channel) will be broadcast to the rest of the network (though many nodes limit the rate of such changes they will accept: we allow 2 a day, with a few extra occasionally)." - ], - "request": { - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string", - "description": [ - "Should contain a scid (short channel ID), channel id or peerid (pubkey) of the channel to be modified. If *id* is set to `all`, the updates are applied to all channels in states CHANNELD_NORMAL CHANNELD_AWAITING_LOCKIN or DUALOPEND_AWAITING_LOCKIN. If *id* is a peerid, all channels with the +peer in those states are changed." - ] - }, - "feebase": { - "type": "msat", - "description": [ - "Value in millisatoshi that is added as base fee to any routed payment: if omitted, it is unchanged. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*." - ] - }, - "feeppm": { - "type": "u32", - "description": [ - "Value that is added proportionally per-millionths to any routed payment volume in satoshi. For example, if ppm is 1,000 and 1,000,000 satoshi is being routed through the channel, an proportional fee of 1,000 satoshi is added, resulting in a 0.1% fee." - ] - }, - "htlcmin": { - "type": "msat", - "description": [ - "Value that limits how small an HTLC we will forward: if omitted, it is unchanged. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. Note that the peer also enforces a minimum for the channel: setting it below that will simply set it to that value with a warning. Also note that *htlcmin* only applies to forwarded HTLCs: we can still send smaller payments ourselves." - ], - "default": "no lower limit" - }, - "htlcmax": { - "type": "msat", - "description": [ - "Value that limits how large an HTLC we will forward: if omitted, it is unchanged. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. Note that *htlcmax* only applies to forwarded HTLCs: we can still send larger payments ourselves." - ], - "default": "no effective limit" - }, - "enforcedelay": { - "type": "u32", - "description": [ - "Number of seconds to delay before enforcing the new fees/htlc max. This gives the network a chance to catch up with the new rates and avoids rejecting HTLCs before they do. This only has an effect if rates are increased (we always allow users to overpay fees) or *htlcmax* is decreased, and only applied to a single rate increase per channel (we don't remember an arbitrary number of prior feerates) and if the node is restarted the updated configuration is enforced immediately." - ], - "default": "600, which is ten minutes" - }, - "ignorefeelimits": { - "added": "v23.08", - "type": "boolean", - "description": [ - "If set to True means to allow the peer to set the commitment transaction fees (or closing transaction fees) to any value they want. This is dangerous: they could set an exorbitant fee (so HTLCs are unenforcable), or a tiny fee (so that commitment transactions cannot be relayed), but avoids channel breakage in case of feerate disagreements. (Note: the global `ignore_fee_limits` setting overrides this)." - ] - } - } - }, - "response": { - "required": [ - "channels" - ], - "properties": { - "channels": { - "type": "array", - "description": [ - "Channel(s) set, and their resulting configuration." - ], - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "peer_id", - "channel_id", - "fee_base_msat", - "fee_proportional_millionths", - "minimum_htlc_out_msat", - "maximum_htlc_out_msat", - "ignore_fee_limits" - ], - "properties": { - "peer_id": { - "type": "pubkey", + }, + "max_total_htlc_in_msat": { + "type": "msat", + "description": [ + "Max amount accept in a single payment." + ] + }, + "their_reserve_msat": { + "type": "msat", + "description": [ + "Minimum we insist they keep in channel. If they have less than this in the channel, they cannot send to us on that channel." + ], + "default": "1% of the total channel capacity" + }, + "our_reserve_msat": { + "type": "msat", + "description": [ + "Minimum they insist we keep in channel. If you have less than this in the channel, you cannot send out via this channel." + ] + }, + "spendable_msat": { + "type": "msat", + "description": [ + "An estimate of the total we could send through channel (can be wrong because adding HTLCs requires an increase in fees paid to onchain miners, and onchain fees change dynamically according to onchain activity)." + ] + }, + "receivable_msat": { + "type": "msat", + "description": [ + "An estimate of the total peer could send through channel." + ] + }, + "minimum_htlc_in_msat": { + "type": "msat", + "description": [ + "The minimum amount HTLC we accept." + ] + }, + "minimum_htlc_out_msat": { + "type": "msat", + "description": [ + "The minimum amount HTLC we will send." + ] + }, + "maximum_htlc_out_msat": { + "type": "msat", + "description": [ + "The maximum amount HTLC we will send." + ] + }, + "their_to_self_delay": { + "type": "u32", + "description": [ + "The number of blocks before they can take their funds if they unilateral close." + ] + }, + "our_to_self_delay": { + "type": "u32", + "description": [ + "The number of blocks before we can take our funds if we unilateral close." + ] + }, + "max_accepted_htlcs": { + "type": "u32", + "description": [ + "Maximum number of incoming HTLC we will accept at once." + ] + }, + "alias": { + "type": "object", + "required": [], + "properties": { + "local": { + "type": "short_channel_id", + "description": [ + "An alias assigned by this node to this channel, used for outgoing payments." + ] + }, + "remote": { + "type": "short_channel_id", + "description": [ + "An alias assigned by the remote node to this channel, usable in routehints and invoices." + ] + } + } + }, + "state_changes": { + "type": "array", + "description": [ + "Prior state changes." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "timestamp", + "old_state", + "new_state", + "cause", + "message" + ], + "properties": { + "timestamp": { + "type": "string", + "description": [ + "UTC timestamp of form YYYY-mm-ddTHH:MM:SS.%03dZ." + ] + }, + "old_state": { + "type": "string", + "enum": [ + "OPENINGD", + "CHANNELD_AWAITING_LOCKIN", + "CHANNELD_NORMAL", + "CHANNELD_SHUTTING_DOWN", + "CLOSINGD_SIGEXCHANGE", + "CLOSINGD_COMPLETE", + "AWAITING_UNILATERAL", + "FUNDING_SPEND_SEEN", + "ONCHAIN", + "DUALOPEND_OPEN_INIT", + "DUALOPEND_AWAITING_LOCKIN", + "DUALOPEND_OPEN_COMMITTED", + "DUALOPEND_OPEN_COMMIT_READY", + "CHANNELD_AWAITING_SPLICE" + ], + "description": [ + "Previous state." + ] + }, + "new_state": { + "type": "string", + "enum": [ + "OPENINGD", + "CHANNELD_AWAITING_LOCKIN", + "CHANNELD_NORMAL", + "CHANNELD_SHUTTING_DOWN", + "CLOSINGD_SIGEXCHANGE", + "CLOSINGD_COMPLETE", + "AWAITING_UNILATERAL", + "FUNDING_SPEND_SEEN", + "ONCHAIN", + "DUALOPEND_OPEN_INIT", + "DUALOPEND_AWAITING_LOCKIN", + "DUALOPEND_OPEN_COMMITTED", + "DUALOPEND_OPEN_COMMIT_READY", + "CHANNELD_AWAITING_SPLICE" + ], + "description": [ + "New state." + ] + }, + "cause": { + "type": "string", + "enum": [ + "unknown", + "local", + "user", + "remote", + "protocol", + "onchain" + ], + "description": [ + "What caused the change." + ] + }, + "message": { + "type": "string", + "description": [ + "Human-readable explanation." + ] + } + } + } + }, + "status": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Billboard log of significant changes." + ] + } + }, + "in_payments_offered": { + "type": "u64", "description": [ - "The node_id of the peer." + "Number of incoming payment attempts." ] }, - "channel_id": { - "type": "hash", + "in_offered_msat": { + "type": "msat", "description": [ - "The channel_id of the channel." + "Total amount of incoming payment attempts." ] }, - "short_channel_id": { - "type": "short_channel_id", + "in_payments_fulfilled": { + "type": "u64", "description": [ - "The short_channel_id (if locked in)." + "Number of successful incoming payment attempts." ] }, - "fee_base_msat": { + "in_fulfilled_msat": { "type": "msat", "description": [ - "The resulting feebase (this is the BOLT #7 name)." + "Total amount of successful incoming payment attempts." ] }, - "fee_proportional_millionths": { - "type": "u32", + "out_payments_offered": { + "type": "u64", "description": [ - "The resulting feeppm (this is the BOLT #7 name)." + "Number of outgoing payment attempts." ] }, - "ignore_fee_limits": { - "type": "boolean", - "added": "v23.08", + "out_offered_msat": { + "type": "msat", "description": [ - "If we are now allowing peer to set feerate on commitment transaction without restriction." + "Total amount of outgoing payment attempts." ] }, - "minimum_htlc_out_msat": { - "type": "msat", + "out_payments_fulfilled": { + "type": "u64", "description": [ - "The resulting htlcmin we will advertize (the BOLT #7 name is htlc_minimum_msat)." + "Number of successful outgoing payment attempts." ] }, - "warning_htlcmin_too_low": { - "type": "string", + "out_fulfilled_msat": { + "type": "msat", "description": [ - "The requested htlcmin was too low for this peer, so we set it to the minimum they will allow." + "Total amount of successful outgoing payment attempts." ] }, - "maximum_htlc_out_msat": { - "type": "msat", + "last_stable_connection": { + "type": "u64", + "added": "v24.02", "description": [ - "The resulting htlcmax we will advertize (the BOLT #7 name is htlc_maximum_msat)." + "Last time we reestablished the open channel and stayed connected for 1 minute." ] }, - "warning_htlcmax_too_high": { - "type": "string", - "description": [ - "The requested htlcmax was greater than the channel capacity, so we set it to the channel capacity." - ] + "htlcs": { + "type": "array", + "description": [ + "Current HTLCs in this channel." + ], + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "direction", + "id", + "amount_msat", + "expiry", + "payment_hash", + "state" + ], + "properties": { + "direction": { + "type": "string", + "added": "v23.02", + "enum": [ + "in", + "out" + ], + "description": [ + "Whether it came from peer, or is going to peer." + ] + }, + "id": { + "type": "u64", + "description": [ + "Unique ID for this htlc on this channel in this direction." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount send/received for this HTLC." + ] + }, + "expiry": { + "type": "u32", + "description": [ + "Block this HTLC expires at (after which an `in` direction HTLC will be returned to the peer, an `out` returned to us). If this expiry is too close, lightningd(8) will automatically unilaterally close the channel in order to enforce the timeout onchain." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the payment_preimage which will prove payment." + ] + }, + "local_trimmed": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "If this is too small to enforce onchain; it doesn't appear in the commitment transaction and will not be enforced in a unilateral close. Generally true if the HTLC (after subtracting onchain fees) is below the `dust_limit_msat` for the channel." + ] + }, + "status": { + "type": "string", + "description": [ + "Set if this HTLC is currently waiting on a hook (and shows what plugin)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "direction": { + "enum": [ + "out" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "state" + ], + "properties": { + "direction": {}, + "id": {}, + "amount_msat": {}, + "msatoshi": {}, + "expiry": {}, + "payment_hash": {}, + "local_trimmed": {}, + "status": {}, + "alias": {}, + "peer_id": {}, + "peer_connected": {}, + "reestablished": {}, + "state": { + "type": "string", + "enum": [ + "SENT_ADD_HTLC", + "SENT_ADD_COMMIT", + "RCVD_ADD_REVOCATION", + "RCVD_ADD_ACK_COMMIT", + "SENT_ADD_ACK_REVOCATION", + "RCVD_REMOVE_HTLC", + "RCVD_REMOVE_COMMIT", + "SENT_REMOVE_REVOCATION", + "SENT_REMOVE_ACK_COMMIT", + "RCVD_REMOVE_ACK_REVOCATION" + ], + "description": [ + "Status of the HTLC." + ] + } + } + } + }, + { + "if": { + "properties": { + "direction": { + "enum": [ + "in" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "state" + ], + "properties": { + "direction": {}, + "id": {}, + "amount_msat": {}, + "msatoshi": {}, + "expiry": {}, + "payment_hash": {}, + "local_trimmed": {}, + "status": {}, + "peer_id": {}, + "peer_connected": {}, + "reestablished": {}, + "state": { + "type": "string", + "enum": [ + "RCVD_ADD_HTLC", + "RCVD_ADD_COMMIT", + "SENT_ADD_REVOCATION", + "SENT_ADD_ACK_COMMIT", + "RCVD_ADD_ACK_REVOCATION", + "SENT_REMOVE_HTLC", + "SENT_REMOVE_COMMIT", + "RCVD_REMOVE_REVOCATION", + "RCVD_REMOVE_ACK_COMMIT", + "SENT_REMOVE_ACK_REVOCATION" + ], + "description": [ + "Status of the HTLC." + ] + } + } + } + } + ] + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "peer_connected": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { + "properties": { + "reestablished": { + "type": "boolean", + "description": [ + "True if we have successfully exchanged reestablish messages this connection." + ] + } + } + } + }, + { + "if": { + "required": [ + "close_to" + ] + }, + "then": { + "additionalProperties": false, + "required": [], + "properties": { + "state": {}, + "peer_id": {}, + "peer_connected": {}, + "reestablished": {}, + "scratch_txid": {}, + "channel_type": {}, + "feerate": {}, + "ignore_fee_limits": {}, + "lost_state": {}, + "owner": {}, + "short_channel_id": {}, + "channel_id": {}, + "updates": {}, + "funding_txid": {}, + "funding_outnum": {}, + "close_to": {}, + "private": {}, + "alias": {}, + "opener": {}, + "closer": {}, + "features": {}, + "funding": {}, + "to_us_msat": {}, + "min_to_us_msat": {}, + "max_to_us_msat": {}, + "total_msat": {}, + "fee_base_msat": {}, + "fee_proportional_millionths": {}, + "dust_limit_msat": {}, + "max_total_htlc_in_msat": {}, + "their_reserve_msat": {}, + "our_reserve_msat": {}, + "spendable_msat": {}, + "receivable_msat": {}, + "minimum_htlc_in_msat": {}, + "minimum_htlc_out_msat": {}, + "maximum_htlc_out_msat": {}, + "spendable_msatoshi": {}, + "receivable_msatoshi": {}, + "their_to_self_delay": {}, + "our_to_self_delay": {}, + "max_accepted_htlcs": {}, + "msatoshi_to_us": {}, + "msatoshi_to_us_min": {}, + "msatoshi_to_us_max": {}, + "msatoshi_total": {}, + "dust_limit_satoshis": {}, + "max_htlc_value_in_flight_msat": {}, + "our_channel_reserve_satoshis": {}, + "their_channel_reserve_satoshis": {}, + "spendable_satoshis": {}, + "receivable_satoshis": {}, + "htlc_minimum_msat": {}, + "state_changes": {}, + "status": {}, + "in_payments_offered": {}, + "in_offered_msat": {}, + "in_msatoshi_offered": {}, + "in_payments_fulfilled": {}, + "in_fulfilled_msat": {}, + "in_msatoshi_fulfilled": {}, + "out_payments_offered": {}, + "out_offered_msat": {}, + "out_msatoshi_offered": {}, + "out_payments_fulfilled": {}, + "out_fulfilled_msat": {}, + "out_msatoshi_fulfilled": {}, + "last_stable_connection": {}, + "htlcs": {}, + "initial_feerate": {}, + "last_feerate": {}, + "next_feerate": {}, + "inflight": {}, + "last_tx_fee_msat": {}, + "direction": {}, + "close_to_addr": { + "type": "string", + "description": [ + "The bitcoin address we will close to (present if close_to_addr is a standardized address)." + ] + } + } + } + }, + { + "if": { + "required": [ + "scratch_txid" + ] + }, + "then": { + "additionalProperties": false, + "required": [ + "last_tx_fee_msat" + ], + "properties": { + "state": {}, + "peer_id": {}, + "peer_connected": {}, + "reestablished": {}, + "alias": {}, + "scratch_txid": {}, + "channel_type": {}, + "feerate": {}, + "ignore_fee_limits": {}, + "lost_state": {}, + "owner": {}, + "short_channel_id": {}, + "channel_id": {}, + "updates": {}, + "funding_txid": {}, + "funding_outnum": {}, + "inflight": {}, + "close_to": {}, + "private": {}, + "opener": {}, + "closer": {}, + "features": {}, + "funding": {}, + "to_us_msat": {}, + "min_to_us_msat": {}, + "max_to_us_msat": {}, + "total_msat": {}, + "fee_base_msat": {}, + "fee_proportional_millionths": {}, + "dust_limit_msat": {}, + "max_total_htlc_in_msat": {}, + "their_reserve_msat": {}, + "our_reserve_msat": {}, + "spendable_msat": {}, + "receivable_msat": {}, + "minimum_htlc_in_msat": {}, + "minimum_htlc_out_msat": {}, + "maximum_htlc_out_msat": {}, + "spendable_msatoshi": {}, + "receivable_msatoshi": {}, + "their_to_self_delay": {}, + "our_to_self_delay": {}, + "max_accepted_htlcs": {}, + "msatoshi_to_us": {}, + "msatoshi_to_us_min": {}, + "msatoshi_to_us_max": {}, + "msatoshi_total": {}, + "dust_limit_satoshis": {}, + "max_htlc_value_in_flight_msat": {}, + "our_channel_reserve_satoshis": {}, + "their_channel_reserve_satoshis": {}, + "spendable_satoshis": {}, + "receivable_satoshis": {}, + "htlc_minimum_msat": {}, + "state_changes": {}, + "status": {}, + "in_payments_offered": {}, + "in_offered_msat": {}, + "in_msatoshi_offered": {}, + "in_payments_fulfilled": {}, + "in_fulfilled_msat": {}, + "in_msatoshi_fulfilled": {}, + "out_payments_offered": {}, + "out_offered_msat": {}, + "out_msatoshi_offered": {}, + "out_payments_fulfilled": {}, + "out_fulfilled_msat": {}, + "out_msatoshi_fulfilled": {}, + "last_stable_connection": {}, + "htlcs": {}, + "initial_feerate": {}, + "last_feerate": {}, + "next_feerate": {}, + "close_to_addr": {}, + "direction": {}, + "last_tx_fee_msat": { + "type": "msat", + "description": [ + "Fee attached to this the current tx." + ] + } + } + } + }, + { + "if": { + "required": [ + "short_channel_id" + ] + }, + "then": { + "additionalProperties": false, + "required": [ + "direction" + ], + "properties": { + "alias": {}, + "peer_id": {}, + "peer_connected": {}, + "reestablished": {}, + "state": {}, + "scratch_txid": {}, + "channel_type": {}, + "feerate": {}, + "ignore_fee_limits": {}, + "lost_state": {}, + "owner": {}, + "short_channel_id": {}, + "channel_id": {}, + "updates": {}, + "funding_txid": {}, + "funding_outnum": {}, + "inflight": {}, + "close_to": {}, + "private": {}, + "opener": {}, + "closer": {}, + "features": {}, + "funding": {}, + "to_us_msat": {}, + "min_to_us_msat": {}, + "max_to_us_msat": {}, + "total_msat": {}, + "fee_base_msat": {}, + "fee_proportional_millionths": {}, + "dust_limit_msat": {}, + "max_total_htlc_in_msat": {}, + "their_reserve_msat": {}, + "our_reserve_msat": {}, + "spendable_msat": {}, + "receivable_msat": {}, + "minimum_htlc_in_msat": {}, + "minimum_htlc_out_msat": {}, + "maximum_htlc_out_msat": {}, + "spendable_msatoshi": {}, + "receivable_msatoshi": {}, + "their_to_self_delay": {}, + "our_to_self_delay": {}, + "max_accepted_htlcs": {}, + "msatoshi_to_us": {}, + "msatoshi_to_us_min": {}, + "msatoshi_to_us_max": {}, + "msatoshi_total": {}, + "dust_limit_satoshis": {}, + "max_htlc_value_in_flight_msat": {}, + "our_channel_reserve_satoshis": {}, + "their_channel_reserve_satoshis": {}, + "spendable_satoshis": {}, + "receivable_satoshis": {}, + "htlc_minimum_msat": {}, + "state_changes": {}, + "status": {}, + "in_payments_offered": {}, + "in_offered_msat": {}, + "in_msatoshi_offered": {}, + "in_payments_fulfilled": {}, + "in_fulfilled_msat": {}, + "in_msatoshi_fulfilled": {}, + "out_payments_offered": {}, + "out_offered_msat": {}, + "out_msatoshi_offered": {}, + "out_payments_fulfilled": {}, + "out_fulfilled_msat": {}, + "out_msatoshi_fulfilled": {}, + "last_stable_connection": {}, + "htlcs": {}, + "initial_feerate": {}, + "last_feerate": {}, + "next_feerate": {}, + "close_to_addr": {}, + "last_tx_fee_msat": {}, + "direction": { + "type": "u32", + "added": "v23.02", + "description": [ + "0 if we're the lesser node_id, 1 if we're the greater (as used in BOLT #7 channel_update)." + ] + } + } + } + }, + { + "if": { + "required": [ + "inflight" + ] + }, + "then": { + "additionalProperties": false, + "required": [ + "initial_feerate", + "last_feerate", + "next_feerate" + ], + "properties": { + "state": {}, + "peer_id": {}, + "peer_connected": {}, + "reestablished": {}, + "scratch_txid": {}, + "channel_type": {}, + "feerate": {}, + "ignore_fee_limits": {}, + "lost_state": {}, + "owner": {}, + "alias": {}, + "short_channel_id": {}, + "channel_id": {}, + "updates": {}, + "funding_txid": {}, + "funding_outnum": {}, + "close_to": {}, + "private": {}, + "opener": {}, + "closer": {}, + "features": {}, + "funding": {}, + "to_us_msat": {}, + "min_to_us_msat": {}, + "max_to_us_msat": {}, + "total_msat": {}, + "fee_base_msat": {}, + "fee_proportional_millionths": {}, + "dust_limit_msat": {}, + "max_total_htlc_in_msat": {}, + "their_reserve_msat": {}, + "our_reserve_msat": {}, + "spendable_msat": {}, + "receivable_msat": {}, + "minimum_htlc_in_msat": {}, + "minimum_htlc_out_msat": {}, + "maximum_htlc_out_msat": {}, + "spendable_msatoshi": {}, + "receivable_msatoshi": {}, + "their_to_self_delay": {}, + "our_to_self_delay": {}, + "max_accepted_htlcs": {}, + "msatoshi_to_us": {}, + "msatoshi_to_us_min": {}, + "msatoshi_to_us_max": {}, + "msatoshi_total": {}, + "dust_limit_satoshis": {}, + "max_htlc_value_in_flight_msat": {}, + "our_channel_reserve_satoshis": {}, + "their_channel_reserve_satoshis": {}, + "spendable_satoshis": {}, + "receivable_satoshis": {}, + "htlc_minimum_msat": {}, + "state_changes": {}, + "status": {}, + "in_payments_offered": {}, + "in_offered_msat": {}, + "in_msatoshi_offered": {}, + "in_payments_fulfilled": {}, + "in_fulfilled_msat": {}, + "in_msatoshi_fulfilled": {}, + "out_payments_offered": {}, + "out_offered_msat": {}, + "out_msatoshi_offered": {}, + "out_payments_fulfilled": {}, + "out_fulfilled_msat": {}, + "out_msatoshi_fulfilled": {}, + "last_stable_connection": {}, + "htlcs": {}, + "inflight": {}, + "close_to_addr": {}, + "direction": {}, + "last_tx_fee_msat": {}, + "initial_feerate": { + "type": "string", + "description": [ + "The feerate for the initial funding transaction in per-1000-weight, with `kpw` appended." + ] + }, + "last_feerate": { + "type": "string", + "description": [ + "The feerate for the latest funding transaction in per-1000-weight, with `kpw` appended." + ] + }, + "next_feerate": { + "type": "string", + "description": [ + "The minimum feerate for the next funding transaction in per-1000-weight, with `kpw` appended." + ] + } + } + } } - } + ] } } - } + }, + "post_return_value_notes": [ + "The *state* field values (and *old_state* / *new_state*) are worth describing further:", + "", + " * `OPENINGD`: The channel funding protocol with the peer is ongoing and both sides are negotiating parameters.", + " * `DUALOPEND_OPEN_INIT`: Like `OPENINGD`, but for v2 connections which are using collaborative opens.", + " * `DUALOPEND_OPEN_COMMIT_READY`: Like `OPENINGD`, but for v2 connections which are using collaborative opens. You're ready to send your commitment signed to your peer.", + " * `DUALOPEND_OPEN_COMMITTED`: Like `OPENINGD`, but for v2 connections which are using collaborative opens. You've gotten an initial signed commitment from your peer.", + " * `CHANNELD_AWAITING_LOCKIN` / `DUALOPEND_AWAITING_LOCKIN`: The peer and you have agreed on channel parameters and are just waiting for the channel funding transaction to be confirmed deeply (original and collaborative open protocols, respectively). Both you and the peer must acknowledge the channel funding transaction to be confirmed deeply before entering the next state. Also, you can increase the onchain fee for channels in `DUALOPEND_AWAITING_LOCKIN` using lightning-openchannel_bump(7).", + " * `CHANNELD_NORMAL`: The channel can be used for normal payments.", + " * `CHANNELD_SHUTTING_DOWN`: A mutual close was requested (by you or peer) and both of you are waiting for HTLCs in-flight to be either failed or succeeded. The channel can no longer be used for normal payments and forwarding. Mutual close will proceed only once all HTLCs in the channel have either been fulfilled or failed.", + " * `CLOSINGD_SIGEXCHANGE`: You and the peer are negotiating the mutual close onchain fee.", + " * `CLOSINGD_COMPLETE`: You and the peer have agreed on the mutual close onchain fee and are awaiting the mutual close getting confirmed deeply.", + " * `AWAITING_UNILATERAL`: You initiated a unilateral close, and are now waiting for the peer-selected unilateral close timeout to complete.", + " * `FUNDING_SPEND_SEEN`: You saw the funding transaction getting spent (usually the peer initiated a unilateral close) and will now determine what exactly happened (i.e. if it was a theft attempt).", + " * `ONCHAIN`: You saw the funding transaction getting spent and now know what happened (i.e. if it was a proper unilateral close by the peer, or a theft attempt)." + ] }, "errors": [ - "The following error codes may occur:", + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", "", - "- -1: Channel is in incorrect state, i.e. Catchall nonspecific error.", - "- -32602: JSONRPC2_INVALID_PARAMS, i.e. Given id is not a channel ID or short channel ID." + "- -32602: If the given parameters are wrong." ], "example_json_request": [ { - "id": "example:setchannel#1", - "method": "setchannel", + "id": "example:listpeerchannels#1", + "method": "listpeerchannels", "params": { - "id": "103x1x0", - "feebase": null, - "feeppm": null, - "htlcmin": null, - "htlcmax": null, - "enforcedelay": null, - "ignorefeelimits": true + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" } }, { - "id": "example:setchannel#2", - "method": "setchannel", + "id": "example:listpeerchannels#2", + "method": "listpeerchannels", "params": { - "id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", - "feebase": 4000, - "feeppm": 300, - "htlcmin": null, - "htlcmax": null, - "enforcedelay": 0, - "ignorefeelimits": null + "id": null } } ], @@ -34920,1476 +20464,2326 @@ { "channels": [ { - "peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "channel_id": "90210d39d12a65d239ece267c5f48e0a82e7cb95724e658f6d99f370064faad1", - "short_channel_id": "103x1x0", + "peer_id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "peer_connected": true, + "channel_type": { + "bits": [ + 12 + ], + "names": [ + "static_remotekey/even" + ] + }, + "updates": { + "local": { + "htlc_minimum_msat": 0, + "htlc_maximum_msat": 990000000, + "cltv_expiry_delta": 6, + "fee_base_msat": 1, + "fee_proportional_millionths": 10 + } + }, + "state": "CHANNELD_AWAITING_LOCKIN", + "scratch_txid": "4e9c2866b9ae1f765b89ea7ec37428c900ea97f717f85f00e3db852cb6aea3a8", + "last_tx_fee_msat": 5430000, + "feerate": { + "perkw": 7500, + "perkb": 30000 + }, + "owner": "channeld", + "direction": 1, + "channel_id": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", + "funding_txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b", + "funding_outnum": 0, + "close_to_addr": "bcrt1pamt5tqzd49uyessr7437l2vllf20muqmzdauje8x8scjgpc0l0nqhyqcyp", + "close_to": "5120eed745804da9784cc203f563efa99ffa54fdf01b137bc964e63c3124070ffbe6", + "private": false, + "opener": "local", + "alias": { + "local": "5589251x14022525x17398" + }, + "features": [ + "option_static_remotekey" + ], + "funding": { + "local_funds_msat": 1000000000, + "remote_funds_msat": 0, + "pushed_msat": 0 + }, + "to_us_msat": 1000000000, + "min_to_us_msat": 1000000000, + "max_to_us_msat": 1000000000, + "total_msat": 1000000000, "fee_base_msat": 1, "fee_proportional_millionths": 10, + "dust_limit_msat": 546000, + "max_total_htlc_in_msat": 18446744073709552000, + "their_reserve_msat": 10000000, + "our_reserve_msat": 10000000, + "spendable_msat": 973980000, + "receivable_msat": 0, + "minimum_htlc_in_msat": 0, "minimum_htlc_out_msat": 0, "maximum_htlc_out_msat": 990000000, - "ignore_fee_limits": true + "their_to_self_delay": 5, + "our_to_self_delay": 5, + "max_accepted_htlcs": 483, + "state_changes": [], + "status": [], + "in_payments_offered": 0, + "in_offered_msat": 0, + "in_payments_fulfilled": 0, + "in_fulfilled_msat": 0, + "out_payments_offered": 0, + "out_offered_msat": 0, + "out_payments_fulfilled": 0, + "out_fulfilled_msat": 0, + "htlcs": [] } ] }, { "channels": [ { - "peer_id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", - "channel_id": "9c54c71bbbe59591cc3162e14fc4ff58c146f085c07d0f206ea679a8231d03ab", - "short_channel_id": "103x3x0", - "fee_base_msat": 4000, - "fee_proportional_millionths": 300, - "minimum_htlc_out_msat": 0, - "maximum_htlc_out_msat": 990000000, - "ignore_fee_limits": false - } - ] - } - ], - "author": [ - "Michael Schmoock <> is the author of this feature." - ], - "see_also": [ - "lightningd-config(5)", - "lightning-fundchannel(7)", - "lightning-listchannels(7)", - "lightning-listpeers(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-setconfig.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "added": "v23.08", - "rpc": "setconfig", - "title": "Dynamically change some config options", - "description": [ - "The **setconfig** RPC command allows you set the (dynamic) configuration option named by `config`: options which take a value (as separate from simple flag options) also need a `val` parameter.", - "", - "This new value will *also* be written at the end of the config file, for persistence across restarts (and any old value commented out).", - "", - "You can see what options are dynamically adjustable using lightning- listconfigs(7). Note that you can also adjust existing options for stopped plugins; they will have an effect when the plugin is restarted." - ], - "request": { - "required": [ - "config" - ], - "properties": { - "config": { - "type": "string", - "description": [ - "Name of the config variable which should be set to the value of the variable." - ] - }, - "val": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - }, - { - "type": "boolean" - } - ], - "description": [ - "Value of the config variable to be set or updated." - ] - } - } - }, - "response": { - "required": [ - "config" - ], - "properties": { - "config": { - "type": "object", - "description": [ - "Config settings after completion." - ], - "additionalProperties": false, - "required": [ - "config", - "source", - "dynamic" - ], - "properties": { - "config": { - "type": "string", - "description": [ - "Name of the config variable which was set." - ] - }, - "source": { - "type": "string", - "description": [ - "Source of configuration setting (`file`:`linenum`)." - ] - }, - "plugin": { - "type": "string", - "description": [ - "The plugin this configuration setting is for." - ] - }, - "dynamic": { - "type": "boolean", - "enum": [ - true + "peer_id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "peer_connected": true, + "reestablished": true, + "channel_type": { + "bits": [ + 12, + 22 ], - "description": [ - "Whether this option is settable via setconfig." + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" ] }, - "set": { - "type": "boolean", - "description": [ - "For simple flag options." - ] + "updates": { + "local": { + "htlc_minimum_msat": 0, + "htlc_maximum_msat": 990000000, + "cltv_expiry_delta": 6, + "fee_base_msat": 1, + "fee_proportional_millionths": 10 + }, + "remote": { + "htlc_minimum_msat": 0, + "htlc_maximum_msat": 990000000, + "cltv_expiry_delta": 6, + "fee_base_msat": 1, + "fee_proportional_millionths": 10 + } }, - "value_str": { - "type": "string", - "description": [ - "For string options." - ] + "state": "CHANNELD_NORMAL", + "scratch_txid": "ece66657d6203a4ea77807f566fd5b98a78b659f0cd59ce9200aa3bd6875ee25", + "last_tx_fee_msat": 4545000, + "lost_state": false, + "feerate": { + "perkw": 3750, + "perkb": 15000 }, - "value_msat": { - "type": "msat", - "description": [ - "For msat options." - ] + "owner": "channeld", + "short_channel_id": "103x1x0", + "direction": 1, + "channel_id": "def5ef03e0d36ed65de814c0a8d6599a502fe1afb8e956529320bb350e876b5f", + "funding_txid": "5f6b870e35bb20935256e9b8afe12f509a59d6a8c014e85dd66ed3e003eff5de", + "funding_outnum": 0, + "close_to_addr": "bcrt1pamt5tqzd49uyessr7437l2vllf20muqmzdauje8x8scjgpc0l0nqhyqcyp", + "close_to": "5120eed745804da9784cc203f563efa99ffa54fdf01b137bc964e63c3124070ffbe6", + "private": false, + "opener": "local", + "alias": { + "local": "15447035x5589520x8959", + "remote": "6036590x13481428x5501" }, - "value_int": { - "type": "integer", - "description": [ - "For integer options." - ] + "features": [ + "option_static_remotekey", + "option_anchors_zero_fee_htlc_tx" + ], + "funding": { + "local_funds_msat": 1000000000, + "remote_funds_msat": 0, + "pushed_msat": 0 }, - "value_bool": { - "type": "boolean", - "description": [ - "For boolean options." - ] - } + "to_us_msat": 1000000000, + "min_to_us_msat": 1000000000, + "max_to_us_msat": 1000000000, + "total_msat": 1000000000, + "fee_base_msat": 1, + "fee_proportional_millionths": 10, + "dust_limit_msat": 546000, + "max_total_htlc_in_msat": 18446744073709552000, + "their_reserve_msat": 10000000, + "our_reserve_msat": 10000000, + "spendable_msat": 978330000, + "receivable_msat": 0, + "minimum_htlc_in_msat": 0, + "minimum_htlc_out_msat": 0, + "maximum_htlc_out_msat": 990000000, + "their_to_self_delay": 5, + "our_to_self_delay": 5, + "max_accepted_htlcs": 483, + "state_changes": [ + { + "timestamp": "2024-02-22T17:48:57.127Z", + "old_state": "CHANNELD_AWAITING_LOCKIN", + "new_state": "CHANNELD_NORMAL", + "cause": "user", + "message": "Lockin complete" + } + ], + "status": [ + "CHANNELD_NORMAL:Channel ready for use." + ], + "in_payments_offered": 0, + "in_offered_msat": 0, + "in_payments_fulfilled": 0, + "in_fulfilled_msat": 0, + "out_payments_offered": 0, + "out_offered_msat": 0, + "out_payments_fulfilled": 0, + "out_fulfilled_msat": 0, + "htlcs": [] } - } - } - }, - "errors": [ - "The following error codes may occur:", - "", - "- -32602: JSONRPC2_INVALID_PARAMS, i.e. the parameter is not dynamic, or the val was invalid." - ], - "example_json_request": [ - { - "id": "example:setconfig#1", - "method": "setconfig", - "params": [ - "autoclean-paidinvoices-age", - 1 - ] - }, - { - "id": "example:setconfig#2", - "method": "setconfig", - "params": [ - "test-dynamic-config", - "changed" ] - }, - { - "id": "example:setconfig#3", - "method": "setconfig", - "params": { - "config": "min-capacity-sat", - "val": 500000 - } - } - ], - "example_json_response": [ - { - "config": { - "config": "autoclean-paidinvoices-age", - "value_int": 1, - "source": "/tmp/ltests-7u_8_rtu/test_autoclean_1/lightning-3/regtest/config:6", - "plugin": "~/lightning/plugins/autoclean", - "dynamic": true - } - }, - { - "config": { - "config": "test-dynamic-config", - "value_str": "changed", - "source": "/tmp/ltests-7u_8_rtu/test_dynamic_option_python_plugin_1/lightning-1/regtest/config:2", - "plugin": "~/lightning/tests/plugins/dynamic_option.py", - "dynamic": true - } - }, - { - "config": { - "config": "min-capacity-sat", - "value_int": 500000, - "source": "/tmp/ltests-nvfdbou2/test_setconfig_1/lightning-2/regtest/config:2", - "dynamic": true - } } ], "author": [ - "Rusty Russell <> is mainly responsible for this feature." + "Michael Hawkins <>." ], "see_also": [ - "lightningd-config(5)", - "lightning-listconfigs(7)" + "lightning-connect(7)", + "lightning-fundchannel_start(7)" ], "resources": [ - "Main web site: " + "Main web site: ", + "Lightning RFC site (BOLT #9): ", + "" ] }, - "lightning-setpsbtversion.json": { + "lightning-listpeers.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "setpsbtversion", - "title": "Command for setting PSBT version", + "rpc": "listpeers", + "title": "Command returning data on connected lightning nodes", "description": [ - "The **setpsbtversion** RPC command converts the provided PSBT to the given version, and returns the base64 result of the conversion. Returns an error if version is invalid." + "The **listpeers** RPC command returns data on nodes that are connected or are not connected but have open channels with this node.", + "", + "Once a connection to another lightning node has been established, using the **connect** command, data on the node can be returned using **listpeers** and the *id* that was used with the **connect** command.", + "", + "If no *id* is supplied, then data on all lightning nodes that are connected, or not connected but have open channels with this node, are returned.", + "", + "If a channel is open with a node and the connection has been lost, then the node will still appear in the output of the command and the value of the *connected* attribute of the node will be \"false\".", + "", + "The channel will remain open for a set blocktime, after which if the connection has not been re-established, the channel will close and the node will no longer appear in the command output." ], "request": { - "required": [ - "psbt", - "version" - ], + "required": [], "properties": { - "psbt": { - "type": "string", + "id": { + "type": "pubkey", "description": [ - "The PSBT to change versions." + "If supplied, limits the result to just the peer with the given ID, if it exists." ] }, - "version": { - "type": "u32", - "description": [ - "The version to set." - ] - } - } - }, - "response": { - "required": [ - "psbt" - ], - "properties": { - "psbt": { - "type": "string", - "description": [ - "A converted PSBT of the requested version." - ] - } - } - }, - "example_json_request": [ - { - "id": "example:setpsbtversion#1", - "method": "setpsbtversion", - "params": { - "psbt": "cHNidP8BAAoCAAAAAAAAAAAAAA==", - "version": "2" - } - }, - { - "id": "example:setpsbtversion#2", - "method": "setpsbtversion", - "params": [ - "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIJd6ICNAQALFOMhoUHuSVSuzcaUdkDKlk4K+A+DR9+4uAA==", - 0 - ] - } - ], - "errors": [ - "The following error codes may occur:", - "", - "- -32602: Parameter missed or malformed." - ], - "example_json_response": [ - { - "psbt": "cHNidP8BAgQCAAAAAQQBAAEFAQABBgEDAfsEAgAAAAA=" - }, - { - "psbt": "cHNidP8BADUCAAAAAAFAQg8AAAAAACJRIJd6ICNAQALFOMhoUHuSVSuzcaUdkDKlk4K+A+DR9+4ubwAAAAAA" - } - ], - "author": [ - "Gregory Sanders <> is mainly responsible." - ], - "see_also": [ - "lightning-fundpsbt(7)", - "lightning-utxopsbt(7)", - "lightning-signpsbt(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-showrunes.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "added": "v23.08", - "rpc": "showrunes", - "title": "Command to list previously generated runes", - "description": [ - "The **showrunes** RPC command either lists runes that we stored as we generate them (see lightning-createrune(7)) or decodes the rune given on the command line." - ], - "request": { - "required": [], - "properties": { - "rune": { + "level": { "type": "string", "description": [ - "If specified, only details of that rune will be returned." + "Supplying level will show log entries related to that peer at the given log level." + ], + "enum": [ + "io", + "debug", + "info", + "unusual" ] } } }, "response": { "required": [ - "runes" + "peers" ], "properties": { - "runes": { + "peers": { "type": "array", "items": { "type": "object", - "additionalProperties": false, + "additionalProperties": true, "required": [ - "rune", - "unique_id", - "restrictions", - "restrictions_as_english" + "id", + "connected", + "num_channels" ], "properties": { - "rune": { - "type": "string", + "id": { + "type": "pubkey", "description": [ - "Base64 encoded rune." + "The unique id of the peer." ] }, - "unique_id": { - "type": "string", + "connected": { + "type": "boolean", "description": [ - "Unique id assigned when the rune was generated; this is always a u64 for commando runes." + "Value showing the connection status." ] }, - "restrictions": { + "num_channels": { + "type": "u32", + "description": [ + "The number of channels the peer has with this node." + ], + "added": "v23.02" + }, + "log": { "type": "array", "description": [ - "The restrictions on what commands this rune can authorize." + "If *level* is specified, logs for this peer." ], "items": { "type": "object", - "additionalProperties": false, + "additionalProperties": true, "required": [ - "alternatives", - "english" + "type" ], "properties": { - "alternatives": { + "type": { + "type": "string", + "enum": [ + "SKIPPED", + "BROKEN", + "UNUSUAL", + "INFO", + "DEBUG", + "IO_IN", + "IO_OUT" + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "enum": [ + "SKIPPED" + ] + } + } + }, + "then": { + "type": "object", + "additionalProperties": false, + "required": [ + "num_skipped" + ], + "properties": { + "type": {}, + "num_skipped": { + "type": "u32", + "description": [ + "Number of deleted/omitted entries." + ] + } + } + } + }, + { + "if": { + "properties": { + "type": { + "enum": [ + "BROKEN", + "UNUSUAL", + "INFO", + "DEBUG" + ] + } + } + }, + "then": { + "type": "object", + "additionalProperties": false, + "required": [ + "time", + "source", + "log", + "node_id" + ], + "properties": { + "type": {}, + "time": { + "type": "string", + "description": [ + "UNIX timestamp with 9 decimal places." + ] + }, + "source": { + "type": "string", + "description": [ + "The particular logbook this was found in." + ] + }, + "log": { + "type": "string", + "description": [ + "The actual log message." + ] + }, + "node_id": { + "type": "pubkey", + "description": [ + "The peer this is associated with." + ] + } + } + } + }, + { + "if": { + "properties": { + "type": { + "enum": [ + "IO_IN", + "IO_OUT" + ] + } + } + }, + "then": { + "type": "object", + "additionalProperties": false, + "required": [ + "time", + "source", + "log", + "node_id", + "data" + ], + "properties": { + "type": {}, + "time": { + "type": "string", + "description": [ + "UNIX timestamp with 9 decimal places." + ] + }, + "source": { + "type": "string", + "description": [ + "The particular logbook this was found in." + ] + }, + "log": { + "type": "string", + "description": [ + "The actual log message." + ] + }, + "node_id": { + "type": "pubkey", + "description": [ + "The peer this is associated with." + ] + }, + "data": { + "type": "hex", + "description": [ + "The IO which occurred." + ] + } + } + } + } + ] + } + }, + "channels": { + "deprecated": [ + "v23.02", + "v24.02" + ], + "type": "array", + "description": [ + "Channels with this peer." + ], + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "state", + "opener", + "features" + ], + "properties": { + "state": { + "type": "string", + "enum": [ + "OPENINGD", + "CHANNELD_AWAITING_LOCKIN", + "CHANNELD_NORMAL", + "CHANNELD_SHUTTING_DOWN", + "CLOSINGD_SIGEXCHANGE", + "CLOSINGD_COMPLETE", + "AWAITING_UNILATERAL", + "FUNDING_SPEND_SEEN", + "ONCHAIN", + "DUALOPEND_OPEN_INIT", + "DUALOPEND_AWAITING_LOCKIN", + "DUALOPEND_OPEN_COMMITTED", + "DUALOPEND_OPEN_COMMIT_READY" + ], + "description": [ + "Current state of the channel:", + " * `OPENINGD`: The channel funding protocol with the peer is ongoing and both sides are negotiating parameters.", + " * `CHANNELD_AWAITING_LOCKIN`: The peer and you have agreed on channel parameters and are just waiting for the channel funding transaction to be confirmed deeply. Both you and the peer must acknowledge the channel funding transaction to be confirmed deeply before entering the next state.", + " * `CHANNELD_NORMAL`: The channel can be used for normal payments.", + " * `CHANNELD_SHUTTING_DOWN`: A mutual close was requested (by you or peer) and both of you are waiting for HTLCs in-flight to be either failed or succeeded. The channel can no longer be used for normal payments and forwarding. Mutual close will proceed only once all HTLCs in the channel have either been fulfilled or failed.", + " * `CLOSINGD_SIGEXCHANGE`: You and the peer are negotiating the mutual close onchain fee.", + " * `CLOSINGD_COMPLETE`: You and the peer have agreed on the mutual close onchain fee and are awaiting the mutual close getting confirmed deeply.", + " * `AWAITING_UNILATERAL`: You initiated a unilateral close, and are now waiting for the peer-selected unilateral close timeout to complete.", + " * `FUNDING_SPEND_SEEN`: You saw the funding transaction getting spent (usually the peer initiated a unilateral close) and will now determine what exactly happened (i.e. if it was a theft attempt).", + " * `ONCHAIN`: You saw the funding transaction getting spent and now know what happened (i.e. if it was a proper unilateral close by the peer, or a theft attempt).", + " * `CLOSED`: The channel closure has been confirmed deeply. The channel will eventually be removed from this array." + ] + }, + "scratch_txid": { + "type": "txid", + "description": [ + "The txid we would use if we went onchain now." + ] + }, + "feerate": { + "type": "object", + "description": [ + "Feerates for the current tx." + ], + "additionalProperties": false, + "required": [ + "perkw", + "perkb" + ], + "properties": { + "perkw": { + "type": "u32", + "description": [ + "Feerate per 1000 weight (i.e kSipa)." + ] + }, + "perkb": { + "type": "u32", + "description": [ + "Feerate per 1000 virtual bytes." + ] + } + } + }, + "owner": { + "type": "string", + "description": [ + "The current subdaemon controlling this connection." + ] + }, + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "The short_channel_id (once locked in)." + ] + }, + "channel_id": { + "type": "hash", + "description": [ + "The full channel_id (funding txid Xored with output number)." + ] + }, + "funding_txid": { + "type": "txid", + "description": [ + "ID of the funding transaction." + ] + }, + "funding_outnum": { + "type": "u32", + "description": [ + "The 0-based output number of the funding transaction which opens the channel." + ] + }, + "initial_feerate": { + "type": "string", + "description": [ + "For inflight opens, the first feerate used to initiate the channel open." + ] + }, + "last_feerate": { + "type": "string", + "description": [ + "For inflight opens, the most recent feerate used on the channel open." + ] + }, + "next_feerate": { + "type": "string", + "description": [ + "For inflight opens, the next feerate we'll use for the channel open." + ] + }, + "next_fee_step": { + "type": "u32", + "description": [ + "For inflight opens, the next feerate step we'll use for the channel open." + ] + }, + "inflight": { + "type": "array", + "description": [ + "Current candidate funding transactions." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "funding_txid", + "funding_outnum", + "feerate", + "total_funding_msat", + "our_funding_msat", + "splice_amount", + "scratch_txid" + ], + "properties": { + "funding_txid": { + "type": "txid", + "description": [ + "ID of the funding transaction." + ] + }, + "funding_outnum": { + "type": "u32", + "description": [ + "The 0-based output number of the funding transaction which opens the channel." + ] + }, + "feerate": { + "type": "string", + "description": [ + "The feerate for this funding transaction in per-1000-weight, with `kpw` appended." + ] + }, + "total_funding_msat": { + "type": "msat", + "description": [ + "Total amount in the channel." + ] + }, + "our_funding_msat": { + "type": "msat", + "description": [ + "Amount we have in the channel." + ] + }, + "splice_amount": { + "type": "integer", + "added": "v23.08", + "description": [ + "The amouont of sats we're splicing in or out." + ] + }, + "scratch_txid": { + "type": "txid", + "description": [ + "The commitment transaction txid we would use if we went onchain now." + ] + } + } + } + }, + "close_to": { + "type": "hex", + "description": [ + "ScriptPubkey which we have to close to if we mutual close." + ] + }, + "private": { + "type": "boolean", + "description": [ + "If True, we will not announce this channel." + ] + }, + "opener": { + "type": "string", + "enum": [ + "local", + "remote" + ], + "description": [ + "Who initiated the channel." + ] + }, + "closer": { + "type": "string", + "enum": [ + "local", + "remote" + ], + "description": [ + "Who initiated the channel close (only present if closing)." + ] + }, + "features": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "option_static_remotekey", + "option_anchor_outputs", + "option_scid_alias", + "option_zeroconf" + ], + "description": [ + "BOLT #9 features which apply to this channel." + ] + } + }, + "funding": { + "type": "object", + "additionalProperties": false, + "required": [ + "local_funds_msat", + "remote_funds_msat" + ], + "properties": { + "pushed_msat": { + "type": "msat", + "description": [ + "Amount pushed from opener to peer." + ] + }, + "local_funds_msat": { + "type": "msat", + "description": [ + "Amount of channel we funded." + ] + }, + "remote_funds_msat": { + "type": "msat", + "description": [ + "Amount of channel they funded." + ] + }, + "fee_paid_msat": { + "type": "msat", + "description": [ + "Amount we paid peer at open." + ] + }, + "fee_rcvd_msat": { + "type": "msat", + "description": [ + "Amount we were paid by peer at open." + ] + } + } + }, + "to_us_msat": { + "type": "msat", + "description": [ + "How much of channel is owed to us." + ] + }, + "min_to_us_msat": { + "type": "msat", + "description": [ + "Least amount owed to us ever. If the peer were to successfully steal from us, this is the amount we would still retain." + ] + }, + "max_to_us_msat": { + "type": "msat", + "description": [ + "Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get." + ] + }, + "total_msat": { + "type": "msat", + "description": [ + "Total amount in the channel." + ] + }, + "fee_base_msat": { + "type": "msat", + "description": [ + "Amount we charge to use the channel." + ] + }, + "fee_proportional_millionths": { + "type": "u32", + "description": [ + "Amount we charge to use the channel in parts-per-million." + ] + }, + "dust_limit_msat": { + "type": "msat", + "description": [ + "Minimum amount for an output on the channel transactions." + ] + }, + "max_total_htlc_in_msat": { + "type": "msat", + "description": [ + "Max amount accept in a single payment." + ] + }, + "their_reserve_msat": { + "type": "msat", + "description": [ + "Minimum we insist they keep in channel. If they have less than this in the channel, they cannot send to us on that channel." + ], + "default": "1% of the total channel capacity" + }, + "our_reserve_msat": { + "type": "msat", + "description": [ + "Minimum they insist we keep in channel. If you have less than this in the channel, you cannot send out via this channel." + ] + }, + "spendable_msat": { + "type": "msat", + "description": [ + "An estimate of the total we could send through channel (can be wrong because adding HTLCs requires an increase in fees paid to onchain miners, and onchain fees change dynamically according to onchain activity)." + ] + }, + "receivable_msat": { + "type": "msat", + "description": [ + "An estimate of the total peer could send through channel." + ] + }, + "minimum_htlc_in_msat": { + "type": "msat", + "description": [ + "The minimum amount HTLC we accept." + ] + }, + "minimum_htlc_out_msat": { + "type": "msat", + "description": [ + "The minimum amount HTLC we will send." + ] + }, + "maximum_htlc_out_msat": { + "type": "msat", + "description": [ + "The maximum amount HTLC we will send." + ] + }, + "their_to_self_delay": { + "type": "u32", + "description": [ + "The number of blocks before they can take their funds if they unilateral close." + ] + }, + "our_to_self_delay": { + "type": "u32", + "description": [ + "The number of blocks before we can take our funds if we unilateral close." + ] + }, + "max_accepted_htlcs": { + "type": "u32", + "description": [ + "Maximum number of incoming HTLC we will accept at once." + ] + }, + "alias": { + "type": "object", + "required": [], + "properties": { + "local": { + "type": "short_channel_id", + "description": [ + "An alias assigned by this node to this channel, used for outgoing payments." + ] + }, + "remote": { + "type": "short_channel_id", + "description": [ + "An alias assigned by the remote node to this channel, usable in routehints and invoices." + ] + } + } + }, + "state_changes": { + "type": "array", + "description": [ + "Prior state changes." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "timestamp", + "old_state", + "new_state", + "cause", + "message" + ], + "properties": { + "timestamp": { + "type": "string", + "description": [ + "UTC timestamp of form YYYY-mm-ddTHH:MM:SS.%03dZ." + ] + }, + "old_state": { + "type": "string", + "enum": [ + "OPENINGD", + "CHANNELD_AWAITING_LOCKIN", + "CHANNELD_NORMAL", + "CHANNELD_SHUTTING_DOWN", + "CLOSINGD_SIGEXCHANGE", + "CLOSINGD_COMPLETE", + "AWAITING_UNILATERAL", + "FUNDING_SPEND_SEEN", + "ONCHAIN", + "DUALOPEND_OPEN_INIT", + "DUALOPEND_AWAITING_LOCKIN", + "DUALOPEND_OPEN_COMMITTED", + "DUALOPEND_OPEN_COMMIT_READY" + ], + "description": [ + "Previous state." + ] + }, + "new_state": { + "type": "string", + "enum": [ + "OPENINGD", + "CHANNELD_AWAITING_LOCKIN", + "CHANNELD_NORMAL", + "CHANNELD_SHUTTING_DOWN", + "CLOSINGD_SIGEXCHANGE", + "CLOSINGD_COMPLETE", + "AWAITING_UNILATERAL", + "FUNDING_SPEND_SEEN", + "ONCHAIN", + "DUALOPEND_OPEN_INIT", + "DUALOPEND_AWAITING_LOCKIN", + "DUALOPEND_OPEN_COMMITTED", + "DUALOPEND_OPEN_COMMIT_READY" + ], + "description": [ + "New state." + ] + }, + "cause": { + "type": "string", + "enum": [ + "unknown", + "local", + "user", + "remote", + "protocol", + "onchain" + ], + "description": [ + "What caused the change." + ] + }, + "message": { + "type": "string", + "description": [ + "Human-readable explanation." + ] + } + } + } + }, + "status": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Billboard log of significant changes." + ] + } + }, + "in_payments_offered": { + "type": "u64", + "description": [ + "Number of incoming payment attempts." + ] + }, + "in_offered_msat": { + "type": "msat", + "description": [ + "Total amount of incoming payment attempts." + ] + }, + "in_payments_fulfilled": { + "type": "u64", + "description": [ + "Number of successful incoming payment attempts." + ] + }, + "in_fulfilled_msat": { + "type": "msat", + "description": [ + "Total amount of successful incoming payment attempts." + ] + }, + "out_payments_offered": { + "type": "u64", + "description": [ + "Number of outgoing payment attempts." + ] + }, + "out_offered_msat": { + "type": "msat", + "description": [ + "Total amount of outgoing payment attempts." + ] + }, + "out_payments_fulfilled": { + "type": "u64", + "description": [ + "Number of successful outgoing payment attempts." + ] + }, + "out_fulfilled_msat": { + "type": "msat", + "description": [ + "Total amount of successful outgoing payment attempts." + ] + }, + "htlcs": { "type": "array", + "description": [ + "Current HTLCs in this channel." + ], "items": { "type": "object", + "additionalProperties": true, + "required": [ + "direction", + "id", + "amount_msat", + "expiry", + "payment_hash", + "state" + ], + "properties": { + "direction": { + "type": "string", + "enum": [ + "in", + "out" + ], + "description": [ + "Whether it came from peer, or is going to peer." + ] + }, + "id": { + "type": "u64", + "description": [ + "Unique ID for this htlc on this channel in this direction." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount send/received for this HTLC." + ] + }, + "expiry": { + "type": "u32", + "description": [ + "Block this HTLC expires at (after which an `in` direction HTLC will be returned to the peer, an `out` returned to us). If this expiry is too close, lightningd(8) will automatically unilaterally close the channel in order to enforce the timeout onchain." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the payment_preimage which will prove payment." + ] + }, + "local_trimmed": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "If this is too small to enforce onchain; it doesn't appear in the commitment transaction and will not be enforced in a unilateral close. Generally true if the HTLC (after subtracting onchain fees) is below the `dust_limit_msat` for the channel." + ] + }, + "status": { + "type": "string", + "description": [ + "Set if this HTLC is currently waiting on a hook (and shows what plugin)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "direction": { + "enum": [ + "out" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "state" + ], + "properties": { + "direction": {}, + "id": {}, + "amount_msat": {}, + "msatoshi": {}, + "expiry": {}, + "payment_hash": {}, + "local_trimmed": {}, + "status": {}, + "alias": {}, + "state": { + "type": "string", + "enum": [ + "SENT_ADD_HTLC", + "SENT_ADD_COMMIT", + "RCVD_ADD_REVOCATION", + "RCVD_ADD_ACK_COMMIT", + "SENT_ADD_ACK_REVOCATION", + "RCVD_REMOVE_HTLC", + "RCVD_REMOVE_COMMIT", + "SENT_REMOVE_REVOCATION", + "SENT_REMOVE_ACK_COMMIT", + "RCVD_REMOVE_ACK_REVOCATION" + ], + "description": [ + "Status of the HTLC." + ] + } + } + } + }, + { + "if": { + "properties": { + "direction": { + "enum": [ + "in" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "state" + ], + "properties": { + "direction": {}, + "id": {}, + "amount_msat": {}, + "msatoshi": {}, + "expiry": {}, + "payment_hash": {}, + "local_trimmed": {}, + "status": {}, + "state": { + "type": "string", + "enum": [ + "RCVD_ADD_HTLC", + "RCVD_ADD_COMMIT", + "SENT_ADD_REVOCATION", + "SENT_ADD_ACK_COMMIT", + "RCVD_ADD_ACK_REVOCATION", + "SENT_REMOVE_HTLC", + "SENT_REMOVE_COMMIT", + "RCVD_REMOVE_REVOCATION", + "RCVD_REMOVE_ACK_COMMIT", + "SENT_REMOVE_ACK_REVOCATION" + ], + "description": [ + "Status of the HTLC." + ] + } + } + } + } + ] + } + } + }, + "allOf": [ + { + "if": { + "required": [ + "close_to" + ] + }, + "then": { + "additionalProperties": false, + "required": [], + "properties": { + "state": {}, + "scratch_txid": {}, + "feerate": {}, + "owner": {}, + "short_channel_id": {}, + "channel_id": {}, + "funding_txid": {}, + "funding_outnum": {}, + "close_to": {}, + "private": {}, + "alias": {}, + "opener": {}, + "closer": {}, + "features": {}, + "funding": {}, + "to_us_msat": {}, + "min_to_us_msat": {}, + "max_to_us_msat": {}, + "total_msat": {}, + "fee_base_msat": {}, + "fee_proportional_millionths": {}, + "dust_limit_msat": {}, + "max_total_htlc_in_msat": {}, + "their_reserve_msat": {}, + "our_reserve_msat": {}, + "spendable_msat": {}, + "receivable_msat": {}, + "minimum_htlc_in_msat": {}, + "minimum_htlc_out_msat": {}, + "maximum_htlc_out_msat": {}, + "spendable_msatoshi": {}, + "receivable_msatoshi": {}, + "their_to_self_delay": {}, + "our_to_self_delay": {}, + "max_accepted_htlcs": {}, + "msatoshi_to_us": {}, + "msatoshi_to_us_min": {}, + "msatoshi_to_us_max": {}, + "msatoshi_total": {}, + "dust_limit_satoshis": {}, + "max_htlc_value_in_flight_msat": {}, + "our_channel_reserve_satoshis": {}, + "their_channel_reserve_satoshis": {}, + "spendable_satoshis": {}, + "receivable_satoshis": {}, + "htlc_minimum_msat": {}, + "state_changes": {}, + "status": {}, + "in_payments_offered": {}, + "in_offered_msat": {}, + "in_msatoshi_offered": {}, + "in_payments_fulfilled": {}, + "in_fulfilled_msat": {}, + "in_msatoshi_fulfilled": {}, + "out_payments_offered": {}, + "out_offered_msat": {}, + "out_msatoshi_offered": {}, + "out_payments_fulfilled": {}, + "out_fulfilled_msat": {}, + "out_msatoshi_fulfilled": {}, + "htlcs": {}, + "initial_feerate": {}, + "last_feerate": {}, + "next_feerate": {}, + "inflight": {}, + "last_tx_fee_msat": {}, + "direction": {}, + "close_to_addr": { + "type": "string", + "description": [ + "The bitcoin address we will close to (present if close_to_addr is a standardized address)." + ] + } + } + } + }, + { + "if": { + "required": [ + "scratch_txid" + ] + }, + "then": { "additionalProperties": false, "required": [ - "fieldname", - "value", - "condition", - "english" + "last_tx_fee_msat" ], "properties": { - "fieldname": { - "type": "string", + "state": {}, + "alias": {}, + "scratch_txid": {}, + "feerate": {}, + "owner": {}, + "short_channel_id": {}, + "channel_id": {}, + "funding_txid": {}, + "funding_outnum": {}, + "inflight": {}, + "close_to": {}, + "private": {}, + "opener": {}, + "closer": {}, + "features": {}, + "funding": {}, + "to_us_msat": {}, + "min_to_us_msat": {}, + "max_to_us_msat": {}, + "total_msat": {}, + "fee_base_msat": {}, + "fee_proportional_millionths": {}, + "dust_limit_msat": {}, + "max_total_htlc_in_msat": {}, + "their_reserve_msat": {}, + "our_reserve_msat": {}, + "spendable_msat": {}, + "receivable_msat": {}, + "minimum_htlc_in_msat": {}, + "minimum_htlc_out_msat": {}, + "maximum_htlc_out_msat": {}, + "spendable_msatoshi": {}, + "receivable_msatoshi": {}, + "their_to_self_delay": {}, + "our_to_self_delay": {}, + "max_accepted_htlcs": {}, + "msatoshi_to_us": {}, + "msatoshi_to_us_min": {}, + "msatoshi_to_us_max": {}, + "msatoshi_total": {}, + "dust_limit_satoshis": {}, + "max_htlc_value_in_flight_msat": {}, + "our_channel_reserve_satoshis": {}, + "their_channel_reserve_satoshis": {}, + "spendable_satoshis": {}, + "receivable_satoshis": {}, + "htlc_minimum_msat": {}, + "state_changes": {}, + "status": {}, + "in_payments_offered": {}, + "in_offered_msat": {}, + "in_msatoshi_offered": {}, + "in_payments_fulfilled": {}, + "in_fulfilled_msat": {}, + "in_msatoshi_fulfilled": {}, + "out_payments_offered": {}, + "out_offered_msat": {}, + "out_msatoshi_offered": {}, + "out_payments_fulfilled": {}, + "out_fulfilled_msat": {}, + "out_msatoshi_fulfilled": {}, + "htlcs": {}, + "initial_feerate": {}, + "last_feerate": {}, + "next_feerate": {}, + "close_to_addr": {}, + "direction": {}, + "last_tx_fee_msat": { + "type": "msat", "description": [ - "The field this restriction applies to; see commando-rune(7)." + "Fee attached to this the current tx." ] - }, - "value": { + } + } + } + }, + { + "if": { + "required": [ + "short_channel_id" + ] + }, + "then": { + "additionalProperties": false, + "required": [ + "direction" + ], + "properties": { + "alias": {}, + "state": {}, + "scratch_txid": {}, + "feerate": {}, + "owner": {}, + "short_channel_id": {}, + "channel_id": {}, + "funding_txid": {}, + "funding_outnum": {}, + "inflight": {}, + "close_to": {}, + "private": {}, + "opener": {}, + "closer": {}, + "features": {}, + "funding": {}, + "to_us_msat": {}, + "min_to_us_msat": {}, + "max_to_us_msat": {}, + "total_msat": {}, + "fee_base_msat": {}, + "fee_proportional_millionths": {}, + "dust_limit_msat": {}, + "max_total_htlc_in_msat": {}, + "their_reserve_msat": {}, + "our_reserve_msat": {}, + "spendable_msat": {}, + "receivable_msat": {}, + "minimum_htlc_in_msat": {}, + "minimum_htlc_out_msat": {}, + "maximum_htlc_out_msat": {}, + "spendable_msatoshi": {}, + "receivable_msatoshi": {}, + "their_to_self_delay": {}, + "our_to_self_delay": {}, + "max_accepted_htlcs": {}, + "msatoshi_to_us": {}, + "msatoshi_to_us_min": {}, + "msatoshi_to_us_max": {}, + "msatoshi_total": {}, + "dust_limit_satoshis": {}, + "max_htlc_value_in_flight_msat": {}, + "our_channel_reserve_satoshis": {}, + "their_channel_reserve_satoshis": {}, + "spendable_satoshis": {}, + "receivable_satoshis": {}, + "htlc_minimum_msat": {}, + "state_changes": {}, + "status": {}, + "in_payments_offered": {}, + "in_offered_msat": {}, + "in_msatoshi_offered": {}, + "in_payments_fulfilled": {}, + "in_fulfilled_msat": {}, + "in_msatoshi_fulfilled": {}, + "out_payments_offered": {}, + "out_offered_msat": {}, + "out_msatoshi_offered": {}, + "out_payments_fulfilled": {}, + "out_fulfilled_msat": {}, + "out_msatoshi_fulfilled": {}, + "htlcs": {}, + "initial_feerate": {}, + "last_feerate": {}, + "next_feerate": {}, + "close_to_addr": {}, + "last_tx_fee_msat": {}, + "direction": { + "type": "u32", + "description": [ + "0 if we're the lesser node_id, 1 if we're the greater (as used in BOLT #7 channel_update)." + ] + } + } + } + }, + { + "if": { + "required": [ + "inflight" + ] + }, + "then": { + "additionalProperties": false, + "required": [ + "initial_feerate", + "last_feerate", + "next_feerate" + ], + "properties": { + "state": {}, + "scratch_txid": {}, + "feerate": {}, + "owner": {}, + "alias": {}, + "short_channel_id": {}, + "channel_id": {}, + "funding_txid": {}, + "funding_outnum": {}, + "close_to": {}, + "private": {}, + "opener": {}, + "closer": {}, + "features": {}, + "funding": {}, + "to_us_msat": {}, + "min_to_us_msat": {}, + "max_to_us_msat": {}, + "total_msat": {}, + "fee_base_msat": {}, + "fee_proportional_millionths": {}, + "dust_limit_msat": {}, + "max_total_htlc_in_msat": {}, + "their_reserve_msat": {}, + "our_reserve_msat": {}, + "spendable_msat": {}, + "receivable_msat": {}, + "minimum_htlc_in_msat": {}, + "minimum_htlc_out_msat": {}, + "maximum_htlc_out_msat": {}, + "spendable_msatoshi": {}, + "receivable_msatoshi": {}, + "their_to_self_delay": {}, + "our_to_self_delay": {}, + "max_accepted_htlcs": {}, + "msatoshi_to_us": {}, + "msatoshi_to_us_min": {}, + "msatoshi_to_us_max": {}, + "msatoshi_total": {}, + "dust_limit_satoshis": {}, + "max_htlc_value_in_flight_msat": {}, + "our_channel_reserve_satoshis": {}, + "their_channel_reserve_satoshis": {}, + "spendable_satoshis": {}, + "receivable_satoshis": {}, + "htlc_minimum_msat": {}, + "state_changes": {}, + "status": {}, + "in_payments_offered": {}, + "in_offered_msat": {}, + "in_msatoshi_offered": {}, + "in_payments_fulfilled": {}, + "in_fulfilled_msat": {}, + "in_msatoshi_fulfilled": {}, + "out_payments_offered": {}, + "out_offered_msat": {}, + "out_msatoshi_offered": {}, + "out_payments_fulfilled": {}, + "out_fulfilled_msat": {}, + "out_msatoshi_fulfilled": {}, + "htlcs": {}, + "inflight": {}, + "close_to_addr": {}, + "direction": {}, + "last_tx_fee_msat": {}, + "initial_feerate": { "type": "string", "description": [ - "The value accepted for this field." + "The feerate for the initial funding transaction in per-1000-weight, with `kpw` appended." ] }, - "condition": { + "last_feerate": { "type": "string", "description": [ - "The way to compare fieldname and value." + "The feerate for the latest funding transaction in per-1000-weight, with `kpw` appended." ] }, - "english": { + "next_feerate": { "type": "string", "description": [ - "English readable description of this alternative." + "The minimum feerate for the next funding transaction in per-1000-weight, with `kpw` appended." ] } } } + } + ] + } + } + }, + "allOf": [ + { + "if": { + "additionalProperties": true, + "properties": { + "connected": { + "enum": [ + true + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "netaddr", + "features" + ], + "properties": { + "id": {}, + "channels": {}, + "connected": {}, + "num_channels": {}, + "htlcs": {}, + "log": {}, + "netaddr": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "description": [ + "A single entry array." + ], + "items": { + "type": "string", + "description": [ + "Address, e.g. 1.2.3.4:1234." + ] + } }, - "english": { + "remote_addr": { "type": "string", "description": [ - "English readable summary of alternatives above." + "The public IPv4/6 address the peer sees us from, e.g. 1.2.3.4:1234." + ] + }, + "features": { + "type": "hex", + "description": [ + "Bitmap of BOLT #9 features from peer's INIT message." ] } } } - }, - "restrictions_as_english": { - "type": "string", - "description": [ - "English readable description of the restrictions array above." - ] - }, - "stored": { - "type": "boolean", - "enum": [ - false - ], - "description": [ - "This is false if the rune does not appear in our datastore (only possible when `rune` is specified)." - ] - }, - "blacklisted": { - "type": "boolean", - "enum": [ - true - ], - "description": [ - "The rune has been blacklisted; see commando-blacklist(7)." - ] - }, - "last_used": { - "type": "number", - "description": [ - "The last time this rune was successfully used." - ], - "added": "23.11" - }, - "our_rune": { - "type": "boolean", - "enum": [ - false - ], - "description": [ - "This is not a rune for this node (only possible when `rune` is specified)." - ] - } - } - } - } - } - }, - "example_json_request": [ - { - "id": "example:showrunes#1", - "method": "showrunes", - "params": "{}" - }, - { - "id": "example:showrunes#2", - "method": "showrunes", - "params": { - "rune": "Bl0V_vkVkGr4h356JbCMCcoDyyKE8djkoQ2156iPB509MCZwZXI9MTAwMDAwMDAwMG5zZWM=" - } - } - ], - "example_json_response": [ - { - "runes": [ - { - "rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==", - "unique_id": "0", - "restrictions": [], - "restrictions_as_english": "" - }, - { - "rune": "geZmO6U7yqpHn-moaX93FVMVWrDRfSNY4AXx9ypLcqg9MQ==", - "unique_id": "1", - "restrictions": [], - "restrictions_as_english": "" - }, - { - "rune": "Bl0V_vkVkGr4h356JbCMCcoDyyKE8djkoQ2156iPB509MCZwZXI9MTAwMDAwMDAwMG5zZWM=", - "unique_id": "2", - "restrictions": [ - { - "alternatives": [ - { - "fieldname": "per", - "value": "1000000000nsec", - "condition": "=", - "english": "per equal to 1000000000nsec" - } - ], - "english": "per equal to 1000000000nsec" - } - ], - "restrictions_as_english": "per equal to 1000000000nsec" - } - ] - }, - { - "runes": [ - { - "rune": "Bl0V_vkVkGr4h356JbCMCcoDyyKE8djkoQ2156iPB509MCZwZXI9MTAwMDAwMDAwMG5zZWM=", - "unique_id": "2", - "restrictions": [ - { - "alternatives": [ - { - "fieldname": "per", - "value": "1000000000nsec", - "condition": "=", - "english": "per equal to 1000000000nsec" - } - ], - "english": "per equal to 1000000000nsec" } - ], - "restrictions_as_english": "per equal to 1000000000nsec" - } - ] - } - ], - "author": [ - "Shahana Farooqui <> is mainly responsible." - ], - "see_also": [ - "lightning-commando-showrunes(7)", - "lightning-blacklistrune(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-signinvoice.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "added": "v23.02", - "rpc": "signinvoice", - "title": "Low-level invoice signing", - "description": [ - "The **signinvoice** RPC command signs an invoice. Unlike **createinvoice** it does not save the invoice into the database and thus does not require the preimage." - ], - "request": { - "required": [ - "invstring" - ], - "properties": { - "invstring": { - "type": "string", - "description": [ - "Bolt11 form, but the final signature is ignored. Minimal sanity checks are done." - ] - } - } - }, - "response": { - "required": [ - "bolt11" - ], - "properties": { - "bolt11": { - "type": "string", - "description": [ - "The bolt11 string." - ] - } - } - }, - "errors": [ - "The following error codes may occur:", - "", - "- -1: Catchall nonspecific error." - ], - "example_json_request": [ - { - "id": "example:signinvoice#1", - "method": "signinvoice", - "params": [ - "lnbcrt10n1pjmxt3lsp5jumuz2sv3ca68kzd92hp3wdtpx8ghnxur65fs6maw6dyxsleqd0spp5nadvvh7uzk2qzh8d9d7tsxr08l9uaz2vjeuuahqtufjv52d0eassdq8d9h8vvgxqyjw5qcqp99qxpqysgq4rrn702eum6c9ld9khlz39vdyd8zcwrav5ygqvu6w54aep6yarkyfrnk990yf5prpasgzmj52stektf6mzwdl5hc6qlsglt2a0pwp0spwww44w" - ] - } - ], - "example_json_response": [ - { - "bolt11": "lnbcrt10n1pjmxt3lsp5jumuz2sv3ca68kzd92hp3wdtpx8ghnxur65fs6maw6dyxsleqd0spp5nadvvh7uzk2qzh8d9d7tsxr08l9uaz2vjeuuahqtufjv52d0eassdq8d9h8vvgxqyjw5qcqp99qxpqysgq3nhrd72qe7wmc2hvwhaqnx05y6dzxh2tal02kw055er7uutkkrcreccm37ce6wv7ee8q70ktlr9fy3fd635hc2k98a4svd9c8v4cpjsppm2eee" - } - ], - "author": [ - "Carl Dong <> is mainly responsible." - ], - "see_also": [ - "lightning-createinvoice(7)", - "lightning-invoice(7)", - "lightning-listinvoices(7)", - "lightning-delinvoice(7)", - "lightning-getroute(7)", - "lightning-sendpay(7)", - "lightning-offer(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-signmessage.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "signmessage", - "title": "Command to create a signature from this node", - "description": [ - "The **signmessage** RPC command creates a digital signature of *message* using this node's secret key. A receiver who knows your node's *id* and the *message* can be sure that the resulting signature could only be created by something with access to this node's secret key." - ], - "request": { - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string", - "description": [ - "Less than 65536 characters long message to be signed by the node." - ] - } - } - }, - "response": { - "required": [ - "signature", - "recid", - "zbase" - ], - "properties": { - "signature": { - "type": "hex", - "description": [ - "The signature." - ], - "minLength": 128, - "maxLength": 128 - }, - "recid": { - "type": "hex", - "description": [ - "The recovery id (0, 1, 2 or 3)." - ], - "minLength": 2, - "maxLength": 2 - }, - "zbase": { - "type": "string", - "description": [ - "*signature* and *recid* encoded in a style compatible with **lnd**'s [SignMessageRequest](https://api.lightning.community/#grpc-request- signmessagerequest)." - ] - } - } - }, - "example_json_request": [ - { - "id": "example:signmessage#1", - "method": "signmessage", - "params": { - "message": "this is a test!" - } - }, - { - "id": "example:signmessage#2", - "method": "signmessage", - "params": { - "message": "message for you" - } - } - ], - "example_json_response": [ - { - "signature": "a2ec227012795f9d6b80a3f5ea98374c6d2886917517c05336799923fcf37caf08344c0431275e1a8189da01b444ae978007fe70f0cc9009f38cabe074ade87d", - "recid": "00", - "zbase": "d6tqaeuonjhi98mmont9m4wag7gg4krg1f4txonug3h31e9h6p6k6nbwjondnj46dkyausobstnk7fhyy998bhgc1yr98dfmhb4k54d7" - }, - { - "signature": "85843b010bc517b32eaafe70232e2c44bb5a354c74d2202390af1b272e4c6ac23ac3f97ea663d8b49116ad6c2d080515b43bcdf1ea4f38cdb18af0edf8209cd8", - "recid": "00", - "zbase": "d6naeqabbxntxc3qim98ye3qftnmsstijt4prebd1nztsj3qjticrqsd9f9kca6as1etpmmcfwrykfpw8xg9d41x8dg5dnzo7zhnb8ga" - } - ], - "author": [ - "Rusty Russell <> is mainly responsible." - ], - "see_also": [ - "lightning-checkmessage(7)" - ], - "resources": [ - "Main web site: ", - "", - "[SignMessageRequest](https://api.lightning.community/#grpc-request-signmessagerequest)" - ] - }, - "lightning-signpsbt.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "signpsbt", - "title": "Command to sign a wallet's inputs on a provided bitcoin transaction (PSBT).", - "description": [ - "**signpsbt** is a low-level RPC command which signs a PSBT as defined by BIP-174.", - "", - "By default, all known inputs are signed, and others ignored: with *signonly*, only those inputs are signed, and an error is returned if one of them cannot be signed.", - "", - "Note that the command will fail if there are no inputs to sign, or if the inputs to be signed were not previously reserved." - ], - "request": { - "required": [ - "psbt" - ], - "properties": { - "psbt": { - "type": "string", - "description": [ - "The psbt to be signed." - ] - }, - "signonly": { - "type": "array", - "description": [ - "Input numbers to sign." - ], - "items": { - "type": "u32" + ] } } } }, - "response": { - "required": [ - "signed_psbt" - ], - "properties": { - "signed_psbt": { - "type": "string", - "description": [ - "The fully signed PSBT." - ] - } - } - }, - "example_json_request": [ - { - "id": "example:signpsbt#1", - "method": "signpsbt", - "params": { - "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAAAAAAEQBAAAAAAM/AlsaWdodG5pbmcBCCvyYqqdIt0mAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oBDiBWd3IcNaQkoj1tzHyQkDblBa5oZQ4J1ZcztLfnMAOk3AEPBAEAAAABEAT9////DPwJbGlnaHRuaW5nAQg5j4QWOQoUFAABAwhOfA0AAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4M/AlsaWdodG5pbmcBCMbeD+3qn9/kAAEDCODIEAAAAAAAAQQiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQz8CWxpZ2h0bmluZwEI4upB+mjl6AIA", - "signonly": null - } - }, - { - "id": "example:signpsbt#2", - "method": "signpsbt", - "params": { - "psbt": "cHNidP8BAP1xAQIAAAAIFTef27H2GAJBzP4UZMeDePsDVkglO47/q4jqK18ibCYAAAAAAP3///+axwap6WKnEHvLjIJZX0ZeJ87cs7PKkXBfwvbGVmjpTQEAAAAA/f///wQ1cVzb9NR7nXadyRuhQBv+2iqhZkhvUA+sPo5z/SsSAQAAAAD9////lXQ788meUtSxhBX13mx2XhyM3Ddo30QtmNW0YuE2TDABAAAAAP3///8Kr4BwElAScx3bA5ZdavrHwh4Zh+rFNvkE/+7gu1WbngEAAAAA/f///3Uei7j3k/b5tnjFGvNZhe2iWz8O6FQjTEpM5XIoduNsAQAAAAD9////fm5Om4MojcnfZiTmrwb4b5Byw9emrjITi/nkEqTK9MsBAAAAAP3///8lwdpZqt3ILPRwhINY4PGvkg2CSw7agcMPSuFoHDDkIQAAAAAA/f///wGCAXoAAAAAABYAFMkJbUP0COpSYCAmLM2tfIUWuSqBAAAAAAABAHECAAAAAZVxzFxyEg7tiQTgRHwGleR8Srxw6taAGOoEpJK/Xj5sAAAAAAD9////AkBCDwAAAAAAFgAUKvGgVL/ThjWE/P1oORVXh/ObucYzr/YpAQAAABYAFKmkod5S53U4m5tKFApyeC35UbnbZwAAAAEBH0BCDwAAAAAAFgAUKvGgVL/ThjWE/P1oORVXh/ObucYAAQBxAgAAAAEVN5/bsfYYAkHM/hRkx4N4+wNWSCU7jv+riOorXyJsJgEAAAAA/f///wJmbOcpAQAAABYAFCCSJBD9wY/VwxnBcnFiu1tA6CGTQEIPAAAAAAAWABSjI8KCqaGX/BGOwJza8hyiuxuIcmcAAAABAR9AQg8AAAAAABYAFKMjwoKpoZf8EY7AnNryHKK7G4hyAAEAcQIAAAAB98EwKZMOHiyRYWyToae6Kce3gCwqUvnVXXHlB/ps9ocBAAAAAP3///8CmNuLKQEAAAAWABQ4roxw+phYHelaRr71DYB3FEy/30BCDwAAAAAAFgAUwSDtQiY7PVvBc7ww56Y72YIQdjllAAAAAQEfQEIPAAAAAAAWABTBIO1CJjs9W8FzvDDnpjvZghB2OQABAHECAAAAAZH/SvCXvDW7b8qb55CDC4M+jgZ61H/e8rZnAGaXp+Z+AAAAAAD9////Apkp2CkBAAAAFgAUc/Y+sIq3oYyEe40GkKJsXawkzwFAQg8AAAAAABYAFLdt1h5Bte8FKvIc2jJgiIwHC7mvZwAAAAEBH0BCDwAAAAAAFgAUt23WHkG17wUq8hzaMmCIjAcLua8AAQBxAgAAAAETC3wMCv9qK3lvVkVJu9b/v2VgMepZtnfngMp2xMXRnwAAAAAA/f///wJk0E4pAQAAABYAFEIsc4cBl+BTN33Kn80+YYfkMt+cQEIPAAAAAAAWABT2/7RIxKohhGbacpBz0BZNYcnfsGUAAAABAR9AQg8AAAAAABYAFPb/tEjEqiGEZtpykHPQFk1hyd+wAAEAcQIAAAABA8J/OnC+cuH79Z6wZmzwdAjhBDaPHavh3yvhr4odDXQBAAAAAP3///8CykowKQEAAAAWABTVHuO8cKOOX/JlmMU66on6Uc54mkBCDwAAAAAAFgAUunZMZryWMqCTiMuVWNF/cleg6dVnAAAAAQEfQEIPAAAAAAAWABS6dkxmvJYyoJOIy5VY0X9yV6Dp1QABAHECAAAAAfRxBaZZ3FfDGwxhZQLYCurN+7kJj0x6nzChg434dnjRAAAAAAD9////AszmyCkBAAAAFgAULSqRp54barF/7R9XOmsLDCVWdAFAQg8AAAAAABYAFNa5adNt/9rZhpGT9mPuSA39xzSIZQAAAAEBH0BCDwAAAAAAFgAU1rlp023/2tmGkZP2Y+5IDf3HNIgAAQBxAgAAAAEgk1JYyP4oIoPoYYcTPPDvZynVfXWINJnBEFBsLv0MtAAAAAAA/f///wJAQg8AAAAAABYAFGYcI7eQ3TSRNzrwsdi+0Id9XN4iMmGqKQEAAAAWABT5XKNwVIFsUKh26sqHFSlOLq5TFGUAAAABAR9AQg8AAAAAABYAFGYcI7eQ3TSRNzrwsdi+0Id9XN4iAAA=", - "signonly": [ - 7 - ] - } - } - ], "errors": [ - "On failure, one of the following error codes may be returned:", - "", - "- -32602: Error in given parameters, or there aren't wallet's inputs to sign, or we couldn't sign all of *signonly*, or inputs are not reserved." - ], - "example_json_response": [ - { - "signed_psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAAAAAAEQBAAAAAAM/AlsaWdodG5pbmcBCCvyYqqdIt0mAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oBDiBWd3IcNaQkoj1tzHyQkDblBa5oZQ4J1ZcztLfnMAOk3AEPBAEAAAABEAT9////ARNACI9TcWG+6uC9ElBFN3qhND7amsor/dtBhJ5ujEQAT/80548avrt7d7IJiOAaCNzzYLSXITdL2xjx6mhbBi9hTiEWkUUygSpECk12bHHNORk2lKNArhHgEuW6Gtnvum52ylMJAMLMqxcAAAAADPwJbGlnaHRuaW5nAQg5j4QWOQoUFAABAwhOfA0AAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4hB7nAxoROEqUxyWjlXFUHjsFtm/dr6SkP2H0cynK0g5oXCQDWuWnTBAAAAAz8CWxpZ2h0bmluZwEIxt4P7eqf3+QAAQMI4MgQAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQji6kH6aOXoAgA=" - }, - { - "signed_psbt": "cHNidP8BAP1xAQIAAAAIFTef27H2GAJBzP4UZMeDePsDVkglO47/q4jqK18ibCYAAAAAAP3///+axwap6WKnEHvLjIJZX0ZeJ87cs7PKkXBfwvbGVmjpTQEAAAAA/f///wQ1cVzb9NR7nXadyRuhQBv+2iqhZkhvUA+sPo5z/SsSAQAAAAD9////lXQ788meUtSxhBX13mx2XhyM3Ddo30QtmNW0YuE2TDABAAAAAP3///8Kr4BwElAScx3bA5ZdavrHwh4Zh+rFNvkE/+7gu1WbngEAAAAA/f///3Uei7j3k/b5tnjFGvNZhe2iWz8O6FQjTEpM5XIoduNsAQAAAAD9////fm5Om4MojcnfZiTmrwb4b5Byw9emrjITi/nkEqTK9MsBAAAAAP3///8lwdpZqt3ILPRwhINY4PGvkg2CSw7agcMPSuFoHDDkIQAAAAAA/f///wGCAXoAAAAAABYAFMkJbUP0COpSYCAmLM2tfIUWuSqBAAAAAAABAHECAAAAAZVxzFxyEg7tiQTgRHwGleR8Srxw6taAGOoEpJK/Xj5sAAAAAAD9////AkBCDwAAAAAAFgAUKvGgVL/ThjWE/P1oORVXh/ObucYzr/YpAQAAABYAFKmkod5S53U4m5tKFApyeC35UbnbZwAAAAEBH0BCDwAAAAAAFgAUKvGgVL/ThjWE/P1oORVXh/ObucYAAQBxAgAAAAEVN5/bsfYYAkHM/hRkx4N4+wNWSCU7jv+riOorXyJsJgEAAAAA/f///wJmbOcpAQAAABYAFCCSJBD9wY/VwxnBcnFiu1tA6CGTQEIPAAAAAAAWABSjI8KCqaGX/BGOwJza8hyiuxuIcmcAAAABAR9AQg8AAAAAABYAFKMjwoKpoZf8EY7AnNryHKK7G4hyAAEAcQIAAAAB98EwKZMOHiyRYWyToae6Kce3gCwqUvnVXXHlB/ps9ocBAAAAAP3///8CmNuLKQEAAAAWABQ4roxw+phYHelaRr71DYB3FEy/30BCDwAAAAAAFgAUwSDtQiY7PVvBc7ww56Y72YIQdjllAAAAAQEfQEIPAAAAAAAWABTBIO1CJjs9W8FzvDDnpjvZghB2OQABAHECAAAAAZH/SvCXvDW7b8qb55CDC4M+jgZ61H/e8rZnAGaXp+Z+AAAAAAD9////Apkp2CkBAAAAFgAUc/Y+sIq3oYyEe40GkKJsXawkzwFAQg8AAAAAABYAFLdt1h5Bte8FKvIc2jJgiIwHC7mvZwAAAAEBH0BCDwAAAAAAFgAUt23WHkG17wUq8hzaMmCIjAcLua8AAQBxAgAAAAETC3wMCv9qK3lvVkVJu9b/v2VgMepZtnfngMp2xMXRnwAAAAAA/f///wJk0E4pAQAAABYAFEIsc4cBl+BTN33Kn80+YYfkMt+cQEIPAAAAAAAWABT2/7RIxKohhGbacpBz0BZNYcnfsGUAAAABAR9AQg8AAAAAABYAFPb/tEjEqiGEZtpykHPQFk1hyd+wAAEAcQIAAAABA8J/OnC+cuH79Z6wZmzwdAjhBDaPHavh3yvhr4odDXQBAAAAAP3///8CykowKQEAAAAWABTVHuO8cKOOX/JlmMU66on6Uc54mkBCDwAAAAAAFgAUunZMZryWMqCTiMuVWNF/cleg6dVnAAAAAQEfQEIPAAAAAAAWABS6dkxmvJYyoJOIy5VY0X9yV6Dp1QABAHECAAAAAfRxBaZZ3FfDGwxhZQLYCurN+7kJj0x6nzChg434dnjRAAAAAAD9////AszmyCkBAAAAFgAULSqRp54barF/7R9XOmsLDCVWdAFAQg8AAAAAABYAFNa5adNt/9rZhpGT9mPuSA39xzSIZQAAAAEBH0BCDwAAAAAAFgAU1rlp023/2tmGkZP2Y+5IDf3HNIgAAQBxAgAAAAEgk1JYyP4oIoPoYYcTPPDvZynVfXWINJnBEFBsLv0MtAAAAAAA/f///wJAQg8AAAAAABYAFGYcI7eQ3TSRNzrwsdi+0Id9XN4iMmGqKQEAAAAWABT5XKNwVIFsUKh26sqHFSlOLq5TFGUAAAABAR9AQg8AAAAAABYAFGYcI7eQ3TSRNzrwsdi+0Id9XN4iIgID+pyVCF5CseUAPNH0GBeMMMluSud5VMoPxIxYgm/06w5HMEQCIG90DSr+fGNoWhCrgLbJG3Wt8PJNMWYqaa5MLWRwA0oTAiA9rsLEqqVhjV6wENfzzpudaE949uLlVqWgDjE/FSgKNAEiBgP6nJUIXkKx5QA80fQYF4wwyW5K53lUyg/EjFiCb/TrDghmHCO3AAAAAAAA" - } - ], - "author": [ - "Vincenzo Palazzo <> wrote the initial version of this man page,", - "but many others did the hard work of actually implementing this rpc command." - ], - "see_also": [ - "lightning-fundpsbt(7)", - "lightning-sendpsbt(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-splice_init.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "added": "v23.08", - "rpc": "splice_init", - "title": "Command to initiate a channel to a peer", - "warning": "experimental-splicing only", - "description": [ - "`splice_init` is a low level RPC command which initiates a channel splice for a given channel specified by `channel_id`." - ], - "request": { - "required": [ - "channel_id", - "relative_amount" - ], - "properties": { - "channel_id": { - "type": "hash", - "description": [ - "The channel id of the channel to be spliced." - ] - }, - "relative_amount": { - "type": "integer", - "description": [ - "A positive or negative amount of satoshis to add or subtract from the channel. Note you may need to add a double dash (--) after splice_init if using a negative *relative_amount* so it is not interpretted as a command modifier. For example: ```shell lightning-cli splice_init -- $CHANNEL_ID -100000 ```." - ] - }, - "initialpsbt": { - "type": "string", - "description": [ - "The (optional) base 64 encoded PSBT to begin with. If not specified, one will be generated automatically." - ] - }, - "feerate_per_kw": { - "type": "u32", - "description": [ - "The miner fee we promise our peer to pay for our side of the splice transaction. It is calculated by `feerate_per_kw` * our_bytes_in_splice_tx / 1000." - ] - }, - "force_feerate": { - "type": "boolean", - "description": [ - "By default splices will fail if the fee provided looks too high. This is to protect against accidentally setting your fee higher than intended. Set `force_feerate` to true to skip this saftey check." - ] - } - } - }, - "response": { - "required": [ - "psbt" - ], - "properties": { - "psbt": { - "type": "string", - "description": [ - "The (incomplete) PSBT of the splice transaction." - ] - } - } - }, - "example_usage": [ - "Here is an example set of splice commands that will splice in 100,000 sats to the first channel that comes out of `listpeerchannels`. The example assumes you already have at least one confirmed channel.", - "", - "```shell", - "RESULT=$(lightning-cli listpeerchannels)", - "CHANNEL_ID=$(echo $RESULT| jq -r \".channels[0].channel_id\")", - "echo $RESULT", - "", - "RESULT=$(lightning-cli fundpsbt -k satoshi=100000sat feerate=urgent startweight=800 excess_as_change=true)", - "INITIALPSBT=$(echo $RESULT | jq -r \".psbt\")", - "echo $RESULT", - "", - "RESULT=$(lightning-cli splice_init $CHANNEL_ID 100000 $INITIALPSBT)", - "PSBT=$(echo $RESULT | jq -r \".psbt\")", - "echo $RESULT", - "", - "RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT)", - "PSBT=$(echo $RESULT | jq -r \".psbt\")", - "echo $RESULT", - "", - "RESULT=$(lightning-cli signpsbt -k psbt=\"$PSBT\")", - "PSBT=$(echo $RESULT | jq -r \".signed_psbt\")", - "echo $RESULT", - "", - "lightning-cli splice_signed $CHANNEL_ID $PSBT", - "```", - "", - "Here is an example set of splice commands that will splice out 100,000 sats from first channel that comes out of `listpeerchannels`. The example assumes you already have at least one confirmed channel.", - "", - "```shell", - "RESULT=$(lightning-cli listpeerchannels)", - "CHANNEL_ID=$(echo $RESULT| jq -r \".channels[0].channel_id\")", - "echo $RESULT", - "", - "RESULT=$(lightning-cli addpsbtoutput 100000)", - "INITIALPSBT=$(echo $RESULT | jq -r \".psbt\")", - "echo $RESULT", - "", - "RESULT=$(lightning-cli splice_init -- $CHANNEL_ID -100500 $INITIALPSBT)", - "PSBT=$(echo $RESULT | jq -r \".psbt\")", - "echo $RESULT", - "", - "RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT)", - "PSBT=$(echo $RESULT | jq -r \".psbt\")", - "echo $RESULT", + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", "", - "lightning-cli splice_signed $CHANNEL_ID $PSBT", - "```" + "- -32602: If the given parameters are wrong." ], "example_json_request": [ { - "id": "example:splice_init#1", - "method": "splice_init", + "id": "example:listpeers#1", + "method": "listpeers", "params": { - "channel_id": "5677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc", - "relative_amount": 100000, - "initialpsbt": "cHNidP8BAF4CAAAAAVZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQAAAAD9////AU58DQAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5sAAAAAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==", - "feerate_per_kw": null + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "level": null } }, { - "id": "example:splice_init#2", - "method": "splice_init", - "params": { - "channel_id": "a40bb442dab0231b51d8f842d95aad548aa35e1d13c4cfcf2997344f805453a1", - "relative_amount": -105000, - "initialpsbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIoIYBAAAAAAABBCJRIHg2NV/cioLcTLAKdyxVVBUdBjhKTdZejT9orAhWa4S+AA==", - "feerate_per_kw": null + "id": "example:listpeers#2", + "method": "listpeers", + "params": { + "id": null, + "level": null } } ], "example_json_response": [ { - "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEFR1IhAjJCZt6EA7OrFXoJ8feE1YevYYMcmYwVG8whu3TCsjFLIQLjvTgAmGbJ2o7EqpnMTqnGwN1G3xXGHvDOHycSkXFOV1KuAQ4gVndyHDWkJKI9bcx8kJA25QWuaGUOCdWXM7S35zADpNwBDwQAAAAAARAEAAAAAAz8CWxpZ2h0bmluZwEIK/Jiqp0i3SYAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAQAAAAEQBP3///8M/AlsaWdodG5pbmcBCDmPhBY5ChQUAAEDCE58DQAAAAAAAQQiUSB4NjVf3IqC3EywCncsVVQVHQY4Sk3WXo0/aKwIVmuEvgz8CWxpZ2h0bmluZwEIxt4P7eqf3+QAAQMIAAAAAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQji6kH6aOXoAgA=" + "peers": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "connected": true, + "num_channels": 1, + "netaddr": [ + "127.0.0.1:44619" + ], + "features": "08a0000a0a69a2" + } + ] }, { - "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABARzi7RBt64yrfqRL2p+KiUw8cYtiKICRFHmp/4eCSemSAQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgTCjR9L+TfzP7pLJVVto5egTRbRNj/RaBhyrA3UW0aEcCIAJO5FZjXvdpRcGR949C4DnfHs3soklTjn/1upkia+TgASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M9mAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEFR1IhAjJCZt6EA7OrFXoJ8feE1YevYYMcmYwVG8whu3TCsjFLIQLjvTgAmGbJ2o7EqpnMTqnGwN1G3xXGHvDOHycSkXFOV1KuAQ4gpAu0QtqwIxtR2PhC2VqtVIqjXh0TxM/PKZc0T4BUU6EBDwQAAAAAARAEAAAAAAz8CWxpZ2h0bmluZwEIn2Ac8fyFEJwAAQMIAAAAAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQgu7JK9IpBWOAABAwighgEAAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4M/AlsaWdodG5pbmcBCOZ1GpRwbKfuAA==" + "peers": [ + { + "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "connected": true, + "num_channels": 1, + "netaddr": [ + "127.0.0.1:48862" + ], + "features": "08a0000a0a69a2" + } + ] } ], "author": [ - "Dusty <<@dusty_daemon>> is mainly responsible." + "Michael Hawkins <>." ], "see_also": [ - "lightning-splice_signed(7)", - "lightning-splice_update(7)" + "lightning-connect(7)", + "lightning-fundchannel_start(7)", + "lightning-setchannel(7)" ], "resources": [ - "Main web site: " + "Main web site: ", + "Lightning RFC site (BOLT #9):", + "" ] }, - "lightning-splice_signed.json": { + "lightning-listsendpays.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "added": "v23.08", - "rpc": "splice_signed", - "title": "Command to initiate a channel to a peer", - "warning": "experimental-splicing only", + "rpc": "listsendpays", + "title": "Low-level command for querying sendpay status", "description": [ - "`splice_signed` is a low level RPC command which finishes the active channel splice associated with `channel_id`.", + "The **listsendpays** RPC command gets the status of all *sendpay* commands (which is also used by the *pay* command), or with *bolt11* or *payment_hash* limits results to that specific payment. You cannot specify both. It is possible to filter the payments also by *status*.", "", - "The *psbt* must have all signatures attached to all inputs that you have added to it or it will fail." + "Note that there may be more than one concurrent *sendpay* command per *pay*, so this command should be used with caution." ], "request": { - "required": [ - "channel_id", - "psbt" - ], + "required": [], "properties": { - "channel_id": { - "type": "hash", - "description": [ - "The channel id of the channel to be spliced." - ] - }, - "psbt": { + "bolt11": { "type": "string", "description": [ - "The final version of the psbt to complete the splice with." + "Bolt11 invoice." ] }, - "sign_first": { - "type": "boolean", + "payment_hash": { + "type": "hash", "description": [ - "A flag that makes our node offer the final splice signature first (defaults to false). When false, the node will calculate who should sign first based off who is adding inputting the least sats to the splice as per spec." + "The hash of the payment_preimage." ] - } - } - }, - "response": { - "required": [ - "tx", - "txid" - ], - "properties": { - "tx": { - "type": "hex", + }, + "status": { + "type": "string", + "enum": [ + "pending", + "complete", + "failed" + ], "description": [ - "The hex representation of the final transaction that is published." + "Whether the invoice has been paid, pending, or failed." ] }, - "txid": { - "type": "txid", + "index": { + "type": "string", + "added": "v23.11", + "enum": [ + "created", + "updated" + ], "description": [ - "The txid is of the final transaction." + "If neither bolt11 or payment_hash is specified, `index` controls ordering, by `created` (default) or `updated`." ] - } - } - }, - "example_usage": [ - "In this example we funded the psbt from our lightning node, so we can use the lightning node to sign for its funds.", - "", - "```shell", - "RESULT=$(lightning-cli signpsbt $PSBT)", - "PSBT=$(echo $RESULT | jq -r \".signed_psbt\")", - "echo $RESULT", - "", - "lightning-cli splice_signed $CHANNEL_ID $PSBT", - "```", - "", - "Here is a full example set of splice commands that will splice in 100,000 sats to the first channel that comes out of `listpeerchannels`. The example assumes you already have at least one confirmed channel.", - "", - "```shell", - "RESULT=$(lightning-cli listpeerchannels)", - "CHANNEL_ID=$(echo $RESULT| jq -r \".channels[0].channel_id\")", - "echo $RESULT", - "", - "RESULT=$(lightning-cli fundpsbt -k satoshi=100000sat feerate=urgent startweight=800 excess_as_change=true)", - "INITIALPSBT=$(echo $RESULT | jq -r \".psbt\")", - "echo $RESULT", - "", - "RESULT=$(lightning-cli splice_init $CHANNEL_ID 100000 $INITIALPSBT)", - "PSBT=$(echo $RESULT | jq -r \".psbt\")", - "echo $RESULT", - "", - "RESULT={\"commitments_secured\":false}", - "while [[ $(echo $RESULT | jq -r \".commitments_secured\") == \"false\" ]]", - "do", - " RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT)", - " PSBT=$(echo $RESULT | jq -r \".psbt\")", - " echo $RESULT", - "done", - "", - "RESULT=$(lightning-cli signpsbt -k psbt=\"$PSBT\")", - "PSBT=$(echo $RESULT | jq -r \".signed_psbt\")", - "echo $RESULT", - "", - "lightning-cli splice_signed $CHANNEL_ID $PSBT", - "```" - ], - "example_json_request": [ - { - "id": "example:splice_signed#1", - "method": "splice_signed", - "params": { - "channel_id": "5677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc", - "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAAAAAAEQBAAAAAAM/AlsaWdodG5pbmcBCCvyYqqdIt0mAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oBDiBWd3IcNaQkoj1tzHyQkDblBa5oZQ4J1ZcztLfnMAOk3AEPBAEAAAABEAT9////ARNACI9TcWG+6uC9ElBFN3qhND7amsor/dtBhJ5ujEQAT/80548avrt7d7IJiOAaCNzzYLSXITdL2xjx6mhbBi9hTiEWkUUygSpECk12bHHNORk2lKNArhHgEuW6Gtnvum52ylMJAMLMqxcAAAAADPwJbGlnaHRuaW5nAQg5j4QWOQoUFAABAwhOfA0AAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4hB7nAxoROEqUxyWjlXFUHjsFtm/dr6SkP2H0cynK0g5oXCQDWuWnTBAAAAAz8CWxpZ2h0bmluZwEIxt4P7eqf3+QAAQMI4MgQAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQji6kH6aOXoAgA=" - } - } - ], - "example_json_response": [ - { - "tx": "020000000001025677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc0000000000000000005677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc0100000000fdffffff024e7c0d00000000002251207836355fdc8a82dc4cb00a772c5554151d06384a4dd65e8d3f68ac08566b84bee0c81000000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd0400473044022053269f3951a1fc942174ac0dde8462405a86c89b31b444890664ee9735872cff02204cd822c4456c15e90ad342b23e9bb252d383d4e17a8a04818c4919e4fd61efd80147304402205ac0787c79e74ebfa0eaf18964625c53eb672cc4bed2c65303bd9cc192dad6f902206c6c0cded47201dae0020f50a8998555e654d3420c64e801fc668238e3c1cdfa0147522102324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b2102e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5752ae0140088f537161beeae0bd125045377aa1343eda9aca2bfddb41849e6e8c44004fff34e78f1abebb7b77b20988e01a08dcf360b49721374bdb18f1ea685b062f614e6c000000", - "txid": "f00d5e230b401274c88d3e6205e2c6117028cb9878b7d2bc52b1441f0b589427" - } - ], - "author": [ - "Dusty <<@dusty_daemon>> is mainly responsible." - ], - "see_also": [ - "lightning-splice_init(7)", - "lightning-splice_update(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-splice_update.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "added": "v23.08", - "rpc": "splice_update", - "title": "Command to initiate a channel to a peer", - "warning": "experimental-splicing only", - "description": [ - "`splice_update` is a low level RPC command which updates the active channel splice associated with `channel_id`.", - "", - "`splice_update` must be called repeatidly until the result `commitments_secured` is `true`. Each time `splice_update` is called, it will return a new PSBT that may have changes. In the simplest case, you take the returned `psbt` and pass it back into `splice_update` for the incoming `psbt` field.", - "", - "For more complex use cases, you may modify the `psbt` both before calling `splice_update` and inbetween subsequent calls until `commitments_secured` is `true`. After which point you can no long make modifications to the PSBT (beyond signing, which comes later with `splice_signed`).", - "", - "Each `splice_update` result may include changes to the PSBT specified by your channel peer. You can review these changes between calls to `splice_update` to perform additional validation or strategy adjustment.", - "", - "Typically, `splice_update` will return `commitments_secured` true after one call but you should assume it will need multiple calls." - ], - "request": { - "required": [ - "channel_id", - "psbt" - ], - "properties": { - "channel_id": { - "type": "hash", + }, + "start": { + "type": "u64", + "added": "v23.11", "description": [ - "The channel id of the channel to be spliced." + "If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)." ] }, - "psbt": { - "type": "string", + "limit": { + "type": "u32", + "added": "v23.11", "description": [ - "The base 64 encoded PSBT returned from `splice_init` with any changes added by the user." + "If `index` is specified, `limit` can be used to specify the maximum number of entries to return." ] } + }, + "dependentUpon": { + "index": [ + "start", + "limit" + ] } }, "response": { "required": [ - "psbt", - "commitments_secured" + "payments" ], "properties": { - "psbt": { - "type": "string", - "description": [ - "The (incomplete) PSBT of the splice transaction." - ] - }, - "commitments_secured": { - "type": "boolean", - "description": [ - "Whether or not the commitments were secured." - ] - } - } - }, - "example_usage": [ - "Here is an example way to call `splice_update`", - "", - "```shell", - "RESULT={\"commitments_secured\":false}", - "while [[ $(echo $RESULT | jq -r \".commitments_secured\") == \"false\" ]]", - "do", - " RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT)", - " PSBT=$(echo $RESULT | jq -r \".psbt\")", - " echo $RESULT", - "done", - "```", - "", - "Before each call to `splice_update` you have the opportunity to make additional changes.", - "", - "Here is a full example set of splice commands that will splice in 100,000 sats to the first channel that comes out of `listpeerchannels`. The example assumes you already have at least one confirmed channel.", - "", - "```shell", - "RESULT=$(lightning-cli listpeerchannels)", - "CHANNEL_ID=$(echo $RESULT| jq -r \".channels[0].channel_id\")", - "echo $RESULT", - "", - "RESULT=$(lightning-cli fundpsbt -k satoshi=100000sat feerate=urgent startweight=800 excess_as_change=true)", - "INITIALPSBT=$(echo $RESULT | jq -r \".psbt\")", - "echo $RESULT", - "", - "RESULT=$(lightning-cli splice_init $CHANNEL_ID 100000 $INITIALPSBT)", - "PSBT=$(echo $RESULT | jq -r \".psbt\")", - "echo $RESULT", - "", - "RESULT={\"commitments_secured\":false}", - "while [[ $(echo $RESULT | jq -r \".commitments_secured\") == \"false\" ]]", - "do", - " RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT)", - " PSBT=$(echo $RESULT | jq -r \".psbt\")", - " echo $RESULT", - "done", - "", - "RESULT=$(lightning-cli signpsbt -k psbt=\"$PSBT\")", - "PSBT=$(echo $RESULT | jq -r \".signed_psbt\")", - "echo $RESULT", - "", - "lightning-cli splice_signed $CHANNEL_ID $PSBT", - "```" - ], + "payments": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "id", + "created_index", + "payment_hash", + "status", + "groupid", + "created_at", + "amount_sent_msat" + ], + "properties": { + "created_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was created in." + ] + }, + "id": { + "type": "u64", + "description": [ + "Old synonym for created_index." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." + ] + }, + "partid": { + "type": "u64", + "description": [ + "Part number (for multiple parts to a single payment)." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "updated_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was changed (only present if it has changed since creation)." + ] + }, + "status": { + "type": "string", + "enum": [ + "pending", + "failed", + "complete" + ], + "description": [ + "Status of the payment." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount delivered to destination (if known)." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment if known." + ] + }, + "created_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "The amount sent." + ] + }, + "label": { + "type": "string", + "description": [ + "The label, if given to sendpay." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string (if pay supplied one)." + ] + }, + "description": { + "type": "string", + "description": [ + "The description matching the bolt11 description hash (if pay supplied one)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string (if supplied for pay: **experimental-offers** only)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "complete" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "payment_preimage" + ], + "properties": { + "id": {}, + "created_index": {}, + "updated_index": {}, + "partid": {}, + "groupid": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "destination": {}, + "created_at": {}, + "msatoshi_sent": {}, + "amount_sent_msat": {}, + "label": {}, + "bolt11": {}, + "description": {}, + "bolt12": {}, + "completed_at": { + "type": "u64", + "added": "pre-v0.10.1", + "description": [ + "The UNIX timestamp showing when this payment was completed." + ] + }, + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash**." + ] + } + } + } + }, + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "failed" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [], + "properties": { + "id": {}, + "created_index": {}, + "updated_index": {}, + "partid": {}, + "groupid": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "destination": {}, + "created_at": {}, + "completed_at": {}, + "msatoshi_sent": {}, + "amount_sent_msat": {}, + "label": {}, + "bolt11": {}, + "description": {}, + "bolt12": {}, + "erroronion": { + "type": "hex", + "description": [ + "The onion message returned." + ] + } + } + } + }, + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "pending" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [], + "properties": { + "id": {}, + "created_index": {}, + "updated_index": {}, + "partid": {}, + "groupid": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "destination": {}, + "created_at": {}, + "msatoshi_sent": {}, + "amount_sent_msat": {}, + "label": {}, + "bolt11": {}, + "description": {}, + "bolt12": {} + } + } + } + ] + } + } + }, + "pre_return_value_notes": [ + "Note that the returned array is ordered by increasing *id*." + ] + }, "example_json_request": [ { - "id": "example:splice_update#1", - "method": "splice_update", + "id": "example:listsendpays#1", + "method": "listsendpays", "params": { - "channel_id": "5677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc", - "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEFR1IhAjJCZt6EA7OrFXoJ8feE1YevYYMcmYwVG8whu3TCsjFLIQLjvTgAmGbJ2o7EqpnMTqnGwN1G3xXGHvDOHycSkXFOV1KuAQ4gVndyHDWkJKI9bcx8kJA25QWuaGUOCdWXM7S35zADpNwBDwQAAAAAARAEAAAAAAz8CWxpZ2h0bmluZwEIK/Jiqp0i3SYAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAQAAAAEQBP3///8M/AlsaWdodG5pbmcBCDmPhBY5ChQUAAEDCE58DQAAAAAAAQQiUSB4NjVf3IqC3EywCncsVVQVHQY4Sk3WXo0/aKwIVmuEvgz8CWxpZ2h0bmluZwEIxt4P7eqf3+QAAQMIAAAAAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQji6kH6aOXoAgA=" + "bolt11": null, + "payment_hash": null, + "status": null, + "index": null, + "start": null, + "limit": null + } + }, + { + "id": "example:listsendpays#2", + "method": "listsendpays", + "params": { + "bolt11": "lnbcrt1230n1pja03q9sp5xu9aypccf3n6vld2waxcysy47ct2wl5x5adtm7k8u30knqes22lspp5duw2v8csh0zh4xg9ql3amem98avlkc2ecre99tgmr2340amf9kmsdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqwh78s8wqg0kepspw0epcxmxteh5wu8n6ddlwdnyj758fqxpqk8ejf597x8ju3r32xqgae3yzjjz9e5s6l2vs5zxvkayhmemmx74wvyqqyqf8c9", + "payment_hash": null, + "status": null, + "index": null, + "start": null, + "limit": null } } ], "example_json_response": [ { - "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAAAAAAEQBAAAAAAM/AlsaWdodG5pbmcBCCvyYqqdIt0mAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oBDiBWd3IcNaQkoj1tzHyQkDblBa5oZQ4J1ZcztLfnMAOk3AEPBAEAAAABEAT9////DPwJbGlnaHRuaW5nAQg5j4QWOQoUFAABAwhOfA0AAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4M/AlsaWdodG5pbmcBCMbeD+3qn9/kAAEDCODIEAAAAAAAAQQiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQz8CWxpZ2h0bmluZwEI4upB+mjl6AIA", - "commitments_secured": true + "payments": [ + { + "created_index": 1, + "id": 1, + "payment_hash": "e3b43574acd074b0c4ba1b13b5155ff5f9c76742e643ed003e17301c5a2db149", + "groupid": 1, + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount_msat": 20000, + "amount_sent_msat": 20000, + "created_at": 1706225269, + "status": "pending", + "bolt11": "lnbcrt200n1pjm9mn5sp5gq84lgga959m6gg4g0kj29ypwjaxxnm4cu5csymq8p6nqxv800mspp5uw6r2a9v6p6tp396rvfm292l7huuwe6zuep76qp7zucpck3dk9ysdpqf9grgmt62fmk5stswefh23n2tpykvcmzxqyjw5qcqp99qxpqysgqz8s496zmwed278jvp075zlhrnj0ncg45kcfw5s2lkhtxd3wc39f8wflp5gmd827dk470xpasfpx0azsfu0k8ttwae7620h8d050w28cqan776g" + }, + { + "created_index": 2, + "id": 2, + "payment_hash": "f55d92cfe019b5a015f5e5956e9255053cda14786171d5002feb12ae5254e5a5", + "groupid": 1, + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount_msat": 30000, + "amount_sent_msat": 30000, + "created_at": 1706225269, + "status": "pending", + "bolt11": "lnbcrt300n1pjm9mn5sp5zqfkr93rp92mdyj6m8lzpcu90rfefcaqff8fxdd2sc5mace23ujspp574we9nlqrx66q904uk2kayj4q57d59rcv9ca2qp0avf2u5j5ukjsdpq29j55nfcgfcnsvzw2er57knhwcmhzwt0xqyjw5qcqp99qxpqysgq76p2jpnegtzlxmn0aqt6d3f89q4p6y5v3v2qz7t2mm6xt90nt324cq400tl82k28562aux8jxs57d603g7s0q4g3dapu9a7vln94j7spsut799" + } + ] + }, + { + "payments": [ + { + "created_index": 1, + "id": 1, + "payment_hash": "6f1ca61f10bbc57a990507e3dde7653f59fb6159c0f252ad1b1aa357f7692db7", + "groupid": 1, + "updated_index": 1, + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount_msat": 123000, + "amount_sent_msat": 123000, + "created_at": 1708639237, + "completed_at": 1708639238, + "status": "complete", + "payment_preimage": "91f8366681fdfd309c048082fcde81a79116f85a7b2dd09aef1e34f5f7c3397b", + "bolt11": "lnbcrt1230n1pja03q9sp5xu9aypccf3n6vld2waxcysy47ct2wl5x5adtm7k8u30knqes22lspp5duw2v8csh0zh4xg9ql3amem98avlkc2ecre99tgmr2340amf9kmsdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqwh78s8wqg0kepspw0epcxmxteh5wu8n6ddlwdnyj758fqxpqk8ejf597x8ju3r32xqgae3yzjjz9e5s6l2vs5zxvkayhmemmx74wvyqqyqf8c9" + } + ] } ], "author": [ - "Dusty <<@dusty_daemon>> is mainly responsible." + "Christian Decker <> is mainly responsible." ], "see_also": [ - "lightning-splice_init(7)", - "lightning-splice_signed(7)" + "lightning-listpays(7)", + "lightning-sendpay(7)", + "lightning-listinvoice(7)" ], "resources": [ "Main web site: " ] }, - "lightning-sql.json": { + "lightning-listsqlschemas.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, "added": "v23.02", - "rpc": "sql", - "title": "Command to do complex queries on list commands", + "rpc": "listsqlschemas", + "title": "Command to example lightning-sql schemas", "description": [ - "The **sql** RPC command runs the given query across a sqlite3 database created from various list commands.", - "", - "When tables are accessed, it calls the below commands, so it's no faster than any other local access (though it goes to great length to cache `listnodes` and `listchannels`) which then processes the results.", + "This allows you to examine the schemas at runtime; while they are fully documented for the current release in lightning-sql(7), as fields are added or deprecated, you can use this command to determine what fields are present.", "", - "It is, however faster for remote access if the result of the query is much smaller than the list commands would be." + "If *table* is given, only that table is in the resulting list, otherwise all tables are listed." ], "request": { - "required": [ - "query" - ], + "required": [], "properties": { - "query": { - "type": "string", - "description": [ - "The standard sqlite3 query to run.", - "Note that queries like \"SELECT *\" are fragile, as columns will change across releases; see lightning-listsqlschemas(7)." - ] + "table": { + "type": "string" } } }, "response": { "required": [ - "rows" + "schemas" ], "properties": { - "rows": { + "schemas": { "type": "array", "items": { - "type": "array" + "type": "object", + "additionalProperties": false, + "required": [ + "tablename", + "columns" + ], + "properties": { + "tablename": { + "type": "string", + "description": [ + "The name of the table." + ] + }, + "columns": { + "type": "array", + "description": [ + "The columns, in database order." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "name", + "type" + ], + "properties": { + "name": { + "type": "string", + "description": [ + "The name of the column." + ] + }, + "type": { + "type": "string", + "enum": [ + "INTEGER", + "BLOB", + "TEXT", + "REAL" + ], + "description": [ + "The SQL type of the column." + ] + } + } + } + }, + "indices": { + "type": "array", + "description": [ + "Any index we created to speed lookups." + ], + "items": { + "type": "array", + "description": [ + "The columns for this index." + ], + "items": { + "type": "string", + "description": [ + "The column name." + ] + } + } + } + } } - }, - "warning_db_failure": { - "type": "string", - "description": [ - "A message if the database encounters an error partway through." - ] } - }, - "pre_return_value_notes": [ - "On success, an object containing **rows** is returned. It is an array. Each array entry contains an array of values, each an integer, real number, string or *null*, depending on the sqlite3 type.", - "", - "The object may contain **warning_db_failure** if the database fails partway through its operation." - ] + } }, - "treatment_of_types": [ - "The following types are supported in schemas, and this shows how they are presented in the database. This matters: a JSON boolean is represented as an integer in the database, so a query will return 0 or 1, not true or false.", - "", - "* *hex*. A hex string.", - " * JSON: a string", - " * sqlite3: BLOB", - "", - "* *hash*/*secret*/*pubkey*/*txid*: just like *hex*.", - "", - "* *msat*/*integer*/*u64*/*u32*/*u16*/*u8*. Normal numbers.", - " * JSON: an unsigned integer", - " * sqlite3: INTEGER", - "", - "* *boolean*. True or false.", - " * JSON: literal **true** or **false**", - " * sqlite3: INTEGER", - "", - "* *number*. A floating point number (used for times in some places).", - " * JSON: number", - " * sqlite3: REAL", - "", - "* *string*. Text.", - " * JSON: string", - " * sqlite3: TEXT", - "", - "* *short_channel_id*. A short-channel-id of form 1x2x3.", - " * JSON: string", - " * sqlite3: TEXT" - ], - "permitted_sqlite3_functions": [ - "Writing to the database is not permitted, and limits are placed on various other query parameters.", - "", - "Additionally, only the following functions are allowed:", - "", - "* abs", - "* avg", - "* coalesce", - "* count", - "* hex", - "* quote", - "* length", - "* like", - "* lower", - "* upper", - "* min", - "* max", - "* sum", - "* total" - ], - "tables": [ - "Note that the first column of every table is a unique integer called `rowid`: this is used for related tables to refer to specific rows in their parent. sqlite3 usually has this as an implicit column, but we make it explicit as the implicit version is not allowed to be used as a foreign key.", - "", - "The following tables are currently supported:\n- `bkpr_accountevents` (see lightning-bkpr-listaccountevents(7))\n - `account` (type `string`, sqltype `TEXT`)\n - `type` (type `string`, sqltype `TEXT`)\n - `tag` (type `string`, sqltype `TEXT`)\n - `credit_msat` (type `msat`, sqltype `INTEGER`)\n - `debit_msat` (type `msat`, sqltype `INTEGER`)\n - `currency` (type `string`, sqltype `TEXT`)\n - `timestamp` (type `u32`, sqltype `INTEGER`)\n - `outpoint` (type `string`, sqltype `TEXT`)\n - `blockheight` (type `u32`, sqltype `INTEGER`)\n - `origin` (type `string`, sqltype `TEXT`)\n - `payment_id` (type `hex`, sqltype `BLOB`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `description` (type `string`, sqltype `TEXT`)\n - `fees_msat` (type `msat`, sqltype `INTEGER`)\n - `is_rebalance` (type `boolean`, sqltype `INTEGER`)\n - `part_id` (type `u32`, sqltype `INTEGER`)\n\n- `bkpr_income` (see lightning-bkpr-listincome(7))\n - `account` (type `string`, sqltype `TEXT`)\n - `tag` (type `string`, sqltype `TEXT`)\n - `credit_msat` (type `msat`, sqltype `INTEGER`)\n - `debit_msat` (type `msat`, sqltype `INTEGER`)\n - `currency` (type `string`, sqltype `TEXT`)\n - `timestamp` (type `u32`, sqltype `INTEGER`)\n - `description` (type `string`, sqltype `TEXT`)\n - `outpoint` (type `string`, sqltype `TEXT`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `payment_id` (type `hex`, sqltype `BLOB`)\n\n- `channels` indexed by `short_channel_id` (see lightning-listchannels(7))\n - `source` (type `pubkey`, sqltype `BLOB`)\n - `destination` (type `pubkey`, sqltype `BLOB`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `direction` (type `u32`, sqltype `INTEGER`)\n - `public` (type `boolean`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `message_flags` (type `u8`, sqltype `INTEGER`)\n - `channel_flags` (type `u8`, sqltype `INTEGER`)\n - `active` (type `boolean`, sqltype `INTEGER`)\n - `last_update` (type `u32`, sqltype `INTEGER`)\n - `base_fee_millisatoshi` (type `u32`, sqltype `INTEGER`)\n - `fee_per_millionth` (type `u32`, sqltype `INTEGER`)\n - `delay` (type `u32`, sqltype `INTEGER`)\n - `htlc_minimum_msat` (type `msat`, sqltype `INTEGER`)\n - `htlc_maximum_msat` (type `msat`, sqltype `INTEGER`)\n - `features` (type `hex`, sqltype `BLOB`)\n\n- `closedchannels` (see lightning-listclosedchannels(7))\n - `peer_id` (type `pubkey`, sqltype `BLOB`)\n - `channel_id` (type `hash`, sqltype `BLOB`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `opener` (type `string`, sqltype `TEXT`)\n - `closer` (type `string`, sqltype `TEXT`)\n - `private` (type `boolean`, sqltype `INTEGER`)\n - related table `closedchannels_channel_type_bits`, from JSON object `channel_type`\n - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `bits` (type `u32`, sqltype `INTEGER`)\n - related table `closedchannels_channel_type_names`, from JSON object `channel_type`\n - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `names` (type `string`, sqltype `TEXT`)\n - `total_local_commitments` (type `u64`, sqltype `INTEGER`)\n - `total_remote_commitments` (type `u64`, sqltype `INTEGER`)\n - `total_htlcs_sent` (type `u64`, sqltype `INTEGER`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `leased` (type `boolean`, sqltype `INTEGER`)\n - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`)\n - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`)\n - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`)\n - `total_msat` (type `msat`, sqltype `INTEGER`)\n - `final_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `min_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `max_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `last_commitment_txid` (type `hash`, sqltype `BLOB`)\n - `last_commitment_fee_msat` (type `msat`, sqltype `INTEGER`)\n - `close_cause` (type `string`, sqltype `TEXT`)\n - `last_stable_connection` (type `u64`, sqltype `INTEGER`)\n\n- `forwards` indexed by `in_channel and in_htlc_id` (see lightning-listforwards(7))\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `in_channel` (type `short_channel_id`, sqltype `TEXT`)\n - `in_htlc_id` (type `u64`, sqltype `INTEGER`)\n - `in_msat` (type `msat`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `received_time` (type `number`, sqltype `REAL`)\n - `out_channel` (type `short_channel_id`, sqltype `TEXT`)\n - `out_htlc_id` (type `u64`, sqltype `INTEGER`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `style` (type `string`, sqltype `TEXT`)\n - `fee_msat` (type `msat`, sqltype `INTEGER`)\n - `out_msat` (type `msat`, sqltype `INTEGER`)\n - `resolved_time` (type `number`, sqltype `REAL`)\n - `failcode` (type `u32`, sqltype `INTEGER`)\n - `failreason` (type `string`, sqltype `TEXT`)\n\n- `htlcs` indexed by `short_channel_id and id` (see lightning-listhtlcs(7))\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `expiry` (type `u32`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `direction` (type `string`, sqltype `TEXT`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `state` (type `string`, sqltype `TEXT`)\n\n- `invoices` indexed by `payment_hash` (see lightning-listinvoices(7))\n - `label` (type `string`, sqltype `TEXT`)\n - `description` (type `string`, sqltype `TEXT`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `status` (type `string`, sqltype `TEXT`)\n - `expires_at` (type `u64`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `bolt11` (type `string`, sqltype `TEXT`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `local_offer_id` (type `hash`, sqltype `BLOB`)\n - `invreq_payer_note` (type `string`, sqltype `TEXT`)\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `pay_index` (type `u64`, sqltype `INTEGER`)\n - `amount_received_msat` (type `msat`, sqltype `INTEGER`)\n - `paid_at` (type `u64`, sqltype `INTEGER`)\n - `paid_outpoint_txid` (type `txid`, sqltype `BLOB`, from JSON object `paid_outpoint`)\n - `paid_outpoint_outnum` (type `u32`, sqltype `INTEGER`, from JSON object `paid_outpoint`)\n - `payment_preimage` (type `secret`, sqltype `BLOB`)\n\n- `nodes` indexed by `nodeid` (see lightning-listnodes(7))\n - `nodeid` (type `pubkey`, sqltype `BLOB`)\n - `last_timestamp` (type `u32`, sqltype `INTEGER`)\n - `alias` (type `string`, sqltype `TEXT`)\n - `color` (type `hex`, sqltype `BLOB`)\n - `features` (type `hex`, sqltype `BLOB`)\n - related table `nodes_addresses`\n - `row` (reference to `nodes.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `type` (type `string`, sqltype `TEXT`)\n - `port` (type `u16`, sqltype `INTEGER`)\n - `address` (type `string`, sqltype `TEXT`)\n - `option_will_fund_lease_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_lease_fee_basis` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_funding_weight` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_channel_fee_max_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_channel_fee_max_proportional_thousandths` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_compact_lease` (type `hex`, sqltype `BLOB`, from JSON object `option_will_fund`)\n\n- `offers` indexed by `offer_id` (see lightning-listoffers(7))\n - `offer_id` (type `hash`, sqltype `BLOB`)\n - `active` (type `boolean`, sqltype `INTEGER`)\n - `single_use` (type `boolean`, sqltype `INTEGER`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `used` (type `boolean`, sqltype `INTEGER`)\n - `label` (type `string`, sqltype `TEXT`)\n\n- `peerchannels` indexed by `peer_id` (see lightning-listpeerchannels(7))\n - `peer_id` (type `pubkey`, sqltype `BLOB`)\n - `peer_connected` (type `boolean`, sqltype `INTEGER`)\n - `reestablished` (type `boolean`, sqltype `INTEGER`)\n - `state` (type `string`, sqltype `TEXT`)\n - `scratch_txid` (type `txid`, sqltype `BLOB`)\n - related table `peerchannels_channel_type_bits`, from JSON object `channel_type`\n - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `bits` (type `u32`, sqltype `INTEGER`)\n - related table `peerchannels_channel_type_names`, from JSON object `channel_type`\n - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `names` (type `string`, sqltype `TEXT`)\n - `local_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `local`)\n - `local_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `local`)\n - `remote_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `remote`)\n - `ignore_fee_limits` (type `boolean`, sqltype `INTEGER`)\n - `lost_state` (type `boolean`, sqltype `INTEGER`)\n - `feerate_perkw` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`)\n - `feerate_perkb` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`)\n - `owner` (type `string`, sqltype `TEXT`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `channel_id` (type `hash`, sqltype `BLOB`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `initial_feerate` (type `string`, sqltype `TEXT`)\n - `last_feerate` (type `string`, sqltype `TEXT`)\n - `next_feerate` (type `string`, sqltype `TEXT`)\n - `next_fee_step` (type `u32`, sqltype `INTEGER`)\n - related table `peerchannels_inflight`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `feerate` (type `string`, sqltype `TEXT`)\n - `total_funding_msat` (type `msat`, sqltype `INTEGER`)\n - `splice_amount` (type `integer`, sqltype `INTEGER`)\n - `our_funding_msat` (type `msat`, sqltype `INTEGER`)\n - `scratch_txid` (type `txid`, sqltype `BLOB`)\n - `close_to` (type `hex`, sqltype `BLOB`)\n - `private` (type `boolean`, sqltype `INTEGER`)\n - `opener` (type `string`, sqltype `TEXT`)\n - `closer` (type `string`, sqltype `TEXT`)\n - related table `peerchannels_features`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `features` (type `string`, sqltype `TEXT`)\n - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_local_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_remote_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `min_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `max_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `total_msat` (type `msat`, sqltype `INTEGER`)\n - `fee_base_msat` (type `msat`, sqltype `INTEGER`)\n - `fee_proportional_millionths` (type `u32`, sqltype `INTEGER`)\n - `dust_limit_msat` (type `msat`, sqltype `INTEGER`)\n - `max_total_htlc_in_msat` (type `msat`, sqltype `INTEGER`)\n - `their_reserve_msat` (type `msat`, sqltype `INTEGER`)\n - `our_reserve_msat` (type `msat`, sqltype `INTEGER`)\n - `spendable_msat` (type `msat`, sqltype `INTEGER`)\n - `receivable_msat` (type `msat`, sqltype `INTEGER`)\n - `minimum_htlc_in_msat` (type `msat`, sqltype `INTEGER`)\n - `minimum_htlc_out_msat` (type `msat`, sqltype `INTEGER`)\n - `maximum_htlc_out_msat` (type `msat`, sqltype `INTEGER`)\n - `their_to_self_delay` (type `u32`, sqltype `INTEGER`)\n - `our_to_self_delay` (type `u32`, sqltype `INTEGER`)\n - `max_accepted_htlcs` (type `u32`, sqltype `INTEGER`)\n - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - related table `peerchannels_state_changes`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `timestamp` (type `string`, sqltype `TEXT`)\n - `old_state` (type `string`, sqltype `TEXT`)\n - `new_state` (type `string`, sqltype `TEXT`)\n - `cause` (type `string`, sqltype `TEXT`)\n - `message` (type `string`, sqltype `TEXT`)\n - related table `peerchannels_status`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `in_payments_offered` (type `u64`, sqltype `INTEGER`)\n - `in_offered_msat` (type `msat`, sqltype `INTEGER`)\n - `in_payments_fulfilled` (type `u64`, sqltype `INTEGER`)\n - `in_fulfilled_msat` (type `msat`, sqltype `INTEGER`)\n - `out_payments_offered` (type `u64`, sqltype `INTEGER`)\n - `out_offered_msat` (type `msat`, sqltype `INTEGER`)\n - `out_payments_fulfilled` (type `u64`, sqltype `INTEGER`)\n - `out_fulfilled_msat` (type `msat`, sqltype `INTEGER`)\n - `last_stable_connection` (type `u64`, sqltype `INTEGER`)\n - related table `peerchannels_htlcs`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `direction` (type `string`, sqltype `TEXT`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `expiry` (type `u32`, sqltype `INTEGER`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `local_trimmed` (type `boolean`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `state` (type `string`, sqltype `TEXT`)\n - `close_to_addr` (type `string`, sqltype `TEXT`)\n - `last_tx_fee_msat` (type `msat`, sqltype `INTEGER`)\n - `direction` (type `u32`, sqltype `INTEGER`)\n\n- `peers` indexed by `id` (see lightning-listpeers(7))\n - `id` (type `pubkey`, sqltype `BLOB`)\n - `connected` (type `boolean`, sqltype `INTEGER`)\n - `num_channels` (type `u32`, sqltype `INTEGER`)\n - related table `peers_netaddr`\n - `row` (reference to `peers.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `netaddr` (type `string`, sqltype `TEXT`)\n - `remote_addr` (type `string`, sqltype `TEXT`)\n - `features` (type `hex`, sqltype `BLOB`)\n\n- `sendpays` indexed by `payment_hash` (see lightning-listsendpays(7))\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `groupid` (type `u64`, sqltype `INTEGER`)\n - `partid` (type `u64`, sqltype `INTEGER`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `destination` (type `pubkey`, sqltype `BLOB`)\n - `created_at` (type `u64`, sqltype `INTEGER`)\n - `amount_sent_msat` (type `msat`, sqltype `INTEGER`)\n - `label` (type `string`, sqltype `TEXT`)\n - `bolt11` (type `string`, sqltype `TEXT`)\n - `description` (type `string`, sqltype `TEXT`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `completed_at` (type `u64`, sqltype `INTEGER`)\n - `payment_preimage` (type `secret`, sqltype `BLOB`)\n - `erroronion` (type `hex`, sqltype `BLOB`)\n\n- `transactions` indexed by `hash` (see lightning-listtransactions(7))\n - `hash` (type `txid`, sqltype `BLOB`)\n - `rawtx` (type `hex`, sqltype `BLOB`)\n - `blockheight` (type `u32`, sqltype `INTEGER`)\n - `txindex` (type `u32`, sqltype `INTEGER`)\n - `locktime` (type `u32`, sqltype `INTEGER`)\n - `version` (type `u32`, sqltype `INTEGER`)\n - related table `transactions_inputs`\n - `row` (reference to `transactions.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`)\n - `sequence` (type `u32`, sqltype `INTEGER`)\n - related table `transactions_outputs`\n - `row` (reference to `transactions.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `scriptPubKey` (type `hex`, sqltype `BLOB`)" - ], - "errors": [ - "On failure, an error is returned." - ], - "example_usage": [ - "Here are some example using lightning-cli. Note that you may need to use `-o` if you use queries which contain `=` (which make lightning-cli(1) default to keyword style):", - "", - "A simple peer selection query:", - "", - "```shell", - "$ lightning-cli sql \"SELECT id FROM peers\"", - "{", - " \"rows\": [", - " [", - " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\"", - " ]", - " ]", - "}", - "```", - "", - "A statement containing using `=` needs `-o`:", - "", - "```shell", - "$ lightning-cli sql -o \"SELECT node_id,last_timestamp FROM nodes WHERE last_timestamp>=1669578892\"", - "{", - " \"rows\": [", - " [", - " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\",", - " 1669601603", - " ]", - " ]", - "}", - "```", - "", - "If you want to compare a BLOB column, `x'hex'` or `X'hex'` are needed:", - "", - "```shell", - "$ lightning-cli sql -o \"SELECT nodeid FROM nodes WHERE nodeid != x'03c9d25b6c0ce4bde5ad97d7ab83f00ae8bd3800a98ccbee36f3c3205315147de1';\"", - "{", - " \"rows\": [", - " [", - " \"0214739d625944f8fdc0da9d2ef44dbd7af58443685e494117b51410c5c3ff973a\"", - " ],", - " [", - " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\"", - " ]", - " ]", - "}", - "$ lightning-cli sql -o \"SELECT nodeid FROM nodes WHERE nodeid IN (x'03c9d25b6c0ce4bde5ad97d7ab83f00ae8bd3800a98ccbee36f3c3205315147de1', x'02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00')\"", - "{", - " \"rows\": [", - " [", - " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\"", - " ],", - " [", - " \"03c9d25b6c0ce4bde5ad97d7ab83f00ae8bd3800a98ccbee36f3c3205315147de1\"", - " ]", - " ]", - "}", - "```", - "", - "Related tables are usually referenced by JOIN:", - "", - "```shell", - "$ lightning-cli sql -o \"SELECT nodeid, alias, nodes_addresses.type, nodes_addresses.port, nodes_addresses.address FROM nodes INNER JOIN nodes_addresses ON nodes_addresses.row = nodes.rowid\"", - "{", - " \"rows\": [", - " [", - " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\",", - " \"YELLOWWATCH-22.11rc2-31-gcd7593b\",", - " \"dns\",", - " 7272,", - " \"localhost\"", - " ],", - " [", - " \"0214739d625944f8fdc0da9d2ef44dbd7af58443685e494117b51410c5c3ff973a\",", - " \"HOPPINGSQUIRREL-1rc2-31-gcd7593b\",", - " \"dns\",", - " 7171,", - " \"localhost\"", - " ]", - " ]", - "}", - "```", - "", - "Simple function usage, in this case COUNT. Strings inside arrays need \", and ' to protect them from the shell:", - "", - "```shell", - "$ lightning-cli sql 'SELECT COUNT(*) FROM nodes\"", - "{", - " \"rows\": [", - " [", - " 3", - " ]", - " ]", - "}", - "```" - ], "example_json_request": [ { - "id": "example:sql#1", - "method": "sql", - "params": [ - "SELECT * FROM forwards;" - ] + "id": "example:listsqlschemas#1", + "method": "listsqlschemas", + "params": { + "table": "offers" + } }, { - "id": "example:sql#2", - "method": "sql", + "id": "example:listsqlschemas#2", + "method": "listsqlschemas", "params": [ - "SELECT * from peerchannels_features" + "closedchannels" ] } ], "example_json_response": [ { - "rows": [] + "schemas": [ + { + "tablename": "offers", + "columns": [ + { + "name": "offer_id", + "type": "BLOB" + }, + { + "name": "active", + "type": "INTEGER" + }, + { + "name": "single_use", + "type": "INTEGER" + }, + { + "name": "bolt12", + "type": "TEXT" + }, + { + "name": "bolt12_unsigned", + "type": "TEXT" + }, + { + "name": "used", + "type": "INTEGER" + }, + { + "name": "label", + "type": "TEXT" + } + ], + "indices": [ + [ + "offer_id" + ] + ] + } + ] }, { - "rows": [ - [ - 6, - 1, - 0, - "option_static_remotekey" - ], - [ - 7, - 1, - 1, - "option_anchors_zero_fee_htlc_tx" - ], - [ - 16, - 11, - 0, - "option_static_remotekey" - ], - [ - 17, - 11, - 1, - "option_anchors_zero_fee_htlc_tx" - ] + "schemas": [ + { + "tablename": "closedchannels", + "columns": [ + { + "name": "rowid", + "type": "INTEGER" + }, + { + "name": "peer_id", + "type": "BLOB" + }, + { + "name": "channel_id", + "type": "BLOB" + }, + { + "name": "short_channel_id", + "type": "TEXT" + }, + { + "name": "alias_local", + "type": "TEXT" + }, + { + "name": "alias_remote", + "type": "TEXT" + }, + { + "name": "opener", + "type": "TEXT" + }, + { + "name": "closer", + "type": "TEXT" + }, + { + "name": "private", + "type": "INTEGER" + }, + { + "name": "total_local_commitments", + "type": "INTEGER" + }, + { + "name": "total_remote_commitments", + "type": "INTEGER" + }, + { + "name": "total_htlcs_sent", + "type": "INTEGER" + }, + { + "name": "funding_txid", + "type": "BLOB" + }, + { + "name": "funding_outnum", + "type": "INTEGER" + }, + { + "name": "leased", + "type": "INTEGER" + }, + { + "name": "funding_fee_paid_msat", + "type": "INTEGER" + }, + { + "name": "funding_fee_rcvd_msat", + "type": "INTEGER" + }, + { + "name": "funding_pushed_msat", + "type": "INTEGER" + }, + { + "name": "total_msat", + "type": "INTEGER" + }, + { + "name": "final_to_us_msat", + "type": "INTEGER" + }, + { + "name": "min_to_us_msat", + "type": "INTEGER" + }, + { + "name": "max_to_us_msat", + "type": "INTEGER" + }, + { + "name": "last_commitment_txid", + "type": "BLOB" + }, + { + "name": "last_commitment_fee_msat", + "type": "INTEGER" + }, + { + "name": "close_cause", + "type": "TEXT" + } + ] + } ] } ], @@ -36397,24 +22791,20 @@ "Rusty Russell <> is mainly responsible." ], "see_also": [ - "lightning-listtransactions(7)", - "lightning-listchannels(7)", - "lightning-listpeers(7)", - "lightning-listnodes(7)", - "lightning-listforwards(7)" + "lightning-sql(7)" ], "resources": [ "Main web site: " ] }, - "lightning-staticbackup.json": { + "lightning-listtransactions.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "staticbackup", - "title": "Command for deriving getting SCB of all the existing channels", + "rpc": "listtransactions", + "title": "Command to get the list of transactions that was stored in the wallet.", "description": [ - "The **staticbackup** RPC command returns an object with SCB of all the channels in an array." + "The **listtransactions** command returns transactions tracked in the wallet. This includes deposits, withdrawals and transactions related to channels. A transaction may have multiple types, e.g., a transaction may both be a close and a deposit if it closes the channel and returns funds to the wallet." ], "request": { "required": [], @@ -36422,177 +22812,742 @@ }, "response": { "required": [ - "scb" + "transactions" ], "properties": { - "scb": { + "transactions": { "type": "array", "items": { - "type": "hex", - "description": [ - "SCB of a channel in TLV format." - ] + "type": "object", + "additionalProperties": false, + "required": [ + "hash", + "rawtx", + "blockheight", + "txindex", + "locktime", + "version", + "inputs", + "outputs" + ], + "properties": { + "hash": { + "type": "txid", + "description": [ + "The transaction id." + ] + }, + "rawtx": { + "type": "hex", + "description": [ + "The raw transaction." + ] + }, + "blockheight": { + "type": "u32", + "description": [ + "The block height of this tx." + ] + }, + "txindex": { + "type": "u32", + "description": [ + "The transaction number within the block." + ] + }, + "locktime": { + "type": "u32", + "description": [ + "The nLocktime for this tx." + ] + }, + "version": { + "type": "u32", + "description": [ + "The nVersion for this tx." + ] + }, + "inputs": { + "type": "array", + "description": [ + "Each input, in order." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "txid", + "index", + "sequence" + ], + "properties": { + "txid": { + "type": "txid", + "description": [ + "The transaction id spent." + ] + }, + "index": { + "type": "u32", + "description": [ + "The output spent." + ] + }, + "sequence": { + "type": "u32", + "description": [ + "The nSequence value." + ] + } + } + } + }, + "outputs": { + "type": "array", + "description": [ + "Each output, in order." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "index", + "amount_msat", + "scriptPubKey" + ], + "properties": { + "index": { + "type": "u32", + "description": [ + "The 0-based output number." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount of the output." + ] + }, + "scriptPubKey": { + "type": "hex", + "description": [ + "The scriptPubKey." + ] + } + } + } + } + } } } } }, "example_json_request": [ { - "id": "example:staticbackup#1", - "method": "staticbackup", - "params": "{}" + "id": "example:listtransactions#1", + "method": "listtransactions", + "params": {} } ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters." + ], "example_json_response": [ { - "scb": [ - "0000000000000001c707da9b230e1655b0a6c082b8daf4fa44d9d1f68163ed4d531d45cf453dc651022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d5900017f000001b2e3c707da9b230e1655b0a6c082b8daf4fa44d9d1f68163ed4d531d45cf453dc6510000000000000000000186a000021000" + "transactions": [ + { + "hash": "05985072bbe20747325e69a159fe08176cc1bbc96d25e8848edad2dddc1165d0", + "rawtx": "02000000027032912651fc25a3e0893acd5f9640598707e2dfef92143bb5a4020e335442800100000017160014a5f48b9aa3cb8ca6cc1040c11e386745bb4dc932ffffffffd229a4b4f78638ebcac10a68b0561585a5d6e4d3b769ad0a909e9b9afaeae24e00000000171600145c83da9b685f9142016c6f5eb5f98a45cfa6f686ffffffff01915a01000000000017a9143a4dfd59e781f9c3018e7d0a9b7a26d58f8d22bf8700000000", + "blockheight": 0, + "txindex": 0, + "locktime": 0, + "version": 2, + "inputs": [ + { + "txid": "804254330e02a4b53b1492efdfe207875940965fcd3a89e0a325fc5126913270", + "index": 1, + "sequence": 4294967295 + }, + { + "txid": "4ee2eafa9a9b9e900aad69b7d3e4d6a5851556b0680ac1caeb3886f7b4a429d2", + "index": 0, + "sequence": 4294967295 + } + ], + "outputs": [ + { + "index": 0, + "satoshis": "88721000msat", + "scriptPubKey": "a9143a4dfd59e781f9c3018e7d0a9b7a26d58f8d22bf87" + } + ] + } ] } ], "author": [ - "Aditya <> is mainly responsible." + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." ], "see_also": [ - "lightning-getsharedsecret(7)" + "lightning-newaddr(7)", + "lightning-listfunds(7)" ], "resources": [ "Main web site: " ] }, - "lightning-stop.json": { + "lightning-makesecret.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "stop", - "title": "Command to shutdown the Core Lightning node.", + "rpc": "makesecret", + "title": "Command for deriving pseudorandom key from HSM", "description": [ - "The **stop** is a RPC command to shut off the Core Lightning node." + "The **makesecret** RPC command derives a secret key from the HSM_secret." ], "request": { "required": [], - "properties": {} + "properties": { + "hex": { + "type": "hex", + "description": [ + "One of `hex` or `string` must be specified: `hex` can be any hex data." + ] + }, + "string": { + "type": "string", + "description": [ + "One of `hex` or `string` must be specified: `string` is a UTF-8 string interpreted literally." + ] + } + } }, "response": { "required": [ - "result" + "secret" ], "properties": { - "result": { - "type": "string", - "added": "v24.05", - "enum": [ - "Shutdown complete" + "secret": { + "type": "secret", + "description": [ + "The pseudorandom key derived from HSM_secret." ] } } }, + "errors": [ + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error." + ], "example_json_request": [ { - "id": "example:stop#1", - "method": "stop", - "params": {} + "id": "example:makesecret#1", + "method": "makesecret", + "params": [ + "73636220736563726574" + ] + }, + { + "id": "example:makesecret#2", + "method": "makesecret", + "params": [ + null, + "scb secret" + ] } ], "example_json_response": [ { - "result": "Shutdown complete" + "secret": "a9a2e742405c28f059349132923a99337ae7f71168b7485496e3365f5bc664ed" + }, + { + "secret": "a9a2e742405c28f059349132923a99337ae7f71168b7485496e3365f5bc664ed" } ], "author": [ - "Vincenzo Palazzo <> wrote the initial version of this man page,", - "but many others did the hard work of actually implementing this rpc command." + "Aditya <> is mainly responsible." ], "resources": [ "Main web site: " ] }, - "lightning-txdiscard.json": { + "lightning-multifundchannel.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "txdiscard", - "title": "Abandon a transaction from txprepare, release inputs", + "rpc": "multifundchannel", + "title": "Command for establishing many lightning channels", "description": [ - "The **txdiscard** RPC command releases inputs which were reserved for use of the *txid* from lightning-txprepare(7)." + "The **multifundchannel** RPC command opens multiple payment channels with nodes by committing a single funding transaction to the blockchain that is shared by all channels.", + "", + "If not already connected, **multifundchannel** will automatically attempt to connect; you may provide a *@host:port* hint appended to the node ID so that Core Lightning can learn how to connect to the node; see lightning-connect(7).", + "", + "Once the transaction is confirmed, normal channel operations may begin. Readiness is indicated by **listpeers** reporting a *state* of `CHANNELD_NORMAL` for the channel." ], "request": { "required": [ - "txid" + "destinations" ], "properties": { - "txid": { - "type": "txid", + "destinations": { + "type": "array", "description": [ - "The transaction id, inputs should be unreseverd from." + "There must be at least one entry in *destinations*; it cannot be an empty array." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "id", + "amount" + ], + "properties": { + "id": { + "type": "string", + "description": [ + "Node ID, with an optional *@host:port* appended to it in a manner understood by **connect**; see lightning-connect(7). Each entry in the *destinations* array must have a unique node *id*. If not already connected, **multifundchannel** will automatically attempt to connect to the node." + ] + }, + "amount": { + "type": "msat", + "description": [ + "Amount in satoshis taken from the internal wallet to fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). The string *all* can be used to specify all available funds (or 16,777,215 satoshi if more is available and large channels were not negotiated with the peer). Otherwise it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The value cannot be less than the dust limit, currently 546 satoshi as of this writing, nor more than 16,777,215 satoshi (unless large channels were negotiated with the peer)." + ] + }, + "announce": { + "type": "boolean", + "description": [ + "Flag that indicates whether to announce the channel with this. If set to `False`, the channel is unpublished." + ], + "default": "`True`" + }, + "push_msat": { + "type": "msat", + "description": [ + "Amount of millisatoshis to outright give to the node. This is a gift to the peer, and you do not get a proof-of-payment out of this." + ] + }, + "close_to": { + "type": "string", + "description": [ + "Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script` Returns `close_to` set to closing script iff is negotiated." + ] + }, + "request_amt": { + "type": "msat", + "description": [ + "Amount of liquidity you'd like to lease from peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*." + ] + }, + "compact_lease": { + "type": "string", + "description": [ + "Compact representation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel to this destination." + ] + }, + "mindepth": { + "type": "u32", + "description": [ + "Number of confirmations before we consider the channel active." + ] + }, + "reserve": { + "type": "msat", + "description": [ + "Amount we want the peer to maintain on its side of the channel. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*." + ], + "default": "1% of the funding amount" + } + } + } + }, + "feerate": { + "type": "feerate", + "description": [ + "Feerate used for the opening transaction, and if *commitment_feerate* is not set, as initial feerate for commitment and HTLC transactions. See NOTES in lightning-feerates(7) for possible values." + ], + "default": "*normal*" + }, + "minconf": { + "type": "integer", + "description": [ + "Minimum number of confirmations that used outputs should have." + ], + "default": 1 + }, + "utxos": { + "type": "array", + "items": { + "type": "outpoint", + "description": [ + "Utxos to be used to fund the channel, as an array of `txid:vout`." + ] + } + }, + "minchannels": { + "type": "integer", + "description": [ + "Re-attempt funding as long as at least this many peers remain (must not be zero). The **multifundchannel** command will only fail if too many peers fail the funding process." + ] + }, + "commitment_feerate": { + "type": "feerate", + "description": [ + "Initial feerate for commitment and HTLC transactions. See *feerate* for valid values." ] } } }, "response": { "required": [ - "unsigned_tx", - "txid" + "tx", + "txid", + "channel_ids" ], "properties": { - "unsigned_tx": { + "tx": { "type": "hex", "description": [ - "The unsigned transaction." + "The raw transaction which funded the channel." ] }, "txid": { "type": "txid", "description": [ - "The transaction id of *unsigned_tx*." + "The txid of the transaction which funded the channel." ] + }, + "channel_ids": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "id", + "channel_id", + "channel_type", + "outnum" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The peer we opened the channel with." + ] + }, + "outnum": { + "type": "u32", + "description": [ + "The 0-based output index showing which output funded the channel." + ] + }, + "channel_id": { + "type": "hash", + "description": [ + "The channel_id of the resulting channel." + ] + }, + "channel_type": { + "type": "object", + "description": [ + "Channel_type as negotiated with peer." + ], + "added": "v24.02", + "additionalProperties": false, + "required": [ + "bits", + "names" + ], + "properties": { + "bits": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + }, + "names": { + "type": "array", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" + ], + "description": [ + "Name of feature bit." + ] + } + } + } + }, + "close_to": { + "type": "hex", + "description": [ + "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`." + ] + } + } + } + }, + "failed": { + "type": "array", + "description": [ + "Any peers we failed to open with (if *minchannels* was specified less than the number of destinations)." + ], + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "id", + "method", + "error" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "The peer we failed to open the channel with." + ] + }, + "method": { + "type": "string", + "enum": [ + "connect", + "openchannel_init", + "fundchannel_start", + "fundchannel_complete" + ], + "description": [ + "What stage we failed at." + ] + }, + "error": { + "type": "object", + "additionalProperties": false, + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "integer", + "description": [ + "JSON error code from failing stage." + ] + }, + "message": { + "type": "string", + "description": [ + "Message from stage." + ] + }, + "data": { + "untyped": true, + "description": [ + "Additional error data." + ] + } + } + } + } + } } }, + "pre_return_value_notes": [ + "This command opens multiple channels with a single large transaction, thus only one transaction is returned.", + "", + "If *minchannels* was specified and is less than the number of destinations, then it is possible that one or more of the destinations do not have a channel even if **multifundchannel** succeeded." + ], "post_return_value_notes": [ - "If there is no matching *txid*, an error is reported. Note that this may happen due to incorrect usage, such as **txdiscard** or **txsend** already being called for *txid*." + "On failure, none of the channels are created." ] }, "errors": [ "The following error codes may occur:", "", - "- -1: An unknown *txid*." + "- -1: Catchall nonspecific error.", + "- 300: The maximum allowed funding amount is exceeded.", + "- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.", + "- 302: The output amount is too small, and would be considered dust.", + "- 303: Broadcasting of the funding transaction failed, the internal call to bitcoin-cli returned with an error.", + "- 313: The `min-emergency-msat` reserve not be preserved (and we have or are opening anchor channels).", + "", + "Failure may also occur if **lightningd** and the peer cannot agree on channel parameters (funding limits, channel reserves, fees, etc.). See lightning-fundchannel_start(7) and lightning-fundchannel_complete(7).", + "", + "There may be rare edge cases where a communications failure later in the channel funding process will cancel the funding locally, but the peer thinks the channel is already waiting for funding lockin. In that case, the next time we connect to the peer, our node will tell the peer to forget the channel, but some nodes (in particular, Core Lightning nodes) will disconnect when our node tells them to forget the channel. If you immediately **multifundchannel** with that peer, it could trigger this connect-forget-disconnect behavior, causing the second **multifundchannel** to fail as well due to disconnection. Doing a **connect** with the peers separately, and waiting for a few seconds, should help clear this hurdle; running **multifundchannel** a third time would also clear this." + ], + "example_usage": [ + "This example opens three channels at once, with amounts 200,000 sats, 3,000,000 sats and the final channel using all remaining funds (actually, capped at 16,777,215 sats because large-channels is not enabled):", + "", + "```shell", + "$ lightning-cli multifundchannel '[{\"id\":\"0201f42e167959c74d396ac57652fcea63c63940f78e8239cce5720df4d85ef857@127.0.0.1:7272\", \"amount\":\"200000sat\"}, {\"id\":\"0304a2468065535f9459567686e0f02b40f06e341d3eb2a62ec6763bcf2ccfd207@127.0.0.1:7373\", \"amount\":\"0.03btc\"}, {\"id\":\"0391f4c475050bb15871da5a72b1f3a1798de3d2e5fb4ffa262899b8d8e1f0b764@127.0.0.1:7474\", \"amount\":\"all\"}]'", + "{", + " \"tx\": \"02000000000101fbe3c68db87b72f82c3f5447b0bc032469c78e71f229ac99c230807ff378a9d80000000000fdffffff04400d0300000000002200202e9897ed5f9b237aa27fd5d02d24157cd452b0d3f0a5bb03d38ff73f9f8f384bffffff0000000000220020439d797ada249e1e12f8d27cabb7330de3c8de0456fb54892deb7b9c72b0ff7c1dc9b50400000000225120046e3966a2d5e43c1f1e0676161905782e1e7c00811485c618f5144f328f4e2bc0c62d0000000000220020e36fd5c03c3586c3763d8b4c9d8650f396ff1c8a460137fb09b60ee82536a3b20140ea4d564e91c919b50a2d32886f1d414de773491119beb1364b92f15d6d03e1810e5ddea89c265e42f2e96bb028dfb3aa0b5b30072ddcc78daad727503c53e37fa9010000\",", + " \"txid\": \"90dc53922b70628fc9e7804ad0b8cd0fb41f050d94ffa2db3b16e918c96c022a\",", + " \"channel_ids\": [", + " {", + " \"id\": \"0201f42e167959c74d396ac57652fcea63c63940f78e8239cce5720df4d85ef857\",", + " \"channel_id\": \"25c8253e66a860d17916cc0c21386e310eba9900030a68ec6ff6f59a8401a872\",", + " \"outnum\": 0", + " },", + " {", + " \"id\": \"0304a2468065535f9459567686e0f02b40f06e341d3eb2a62ec6763bcf2ccfd207\",", + " \"channel_id\": \"51749d724892a406896f6bf2e2f8c0b03399d0436691f294839897fa167e6521\",", + " \"outnum\": 3", + " },", + " {", + " \"id\": \"0391f4c475050bb15871da5a72b1f3a1798de3d2e5fb4ffa262899b8d8e1f0b764\",", + " \"channel_id\": \"7e1414e72c081f0754fa18c1657cedabe696aa9ffeaf0b936bfbe3a28f2829d1\",", + " \"outnum\": 1", + " }", + " ],", + " \"failed\": []", + "}", + "```" ], "example_json_request": [ { - "id": "example:txdiscard#1", - "method": "txdiscard", + "id": "example:multifundchannel#1", + "method": "multifundchannel", "params": { - "txid": "6e680cb76077f11c838cc7aee0c0aa360f9857f00856bb1614025a1af53739fc" + "destinations": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59@localhost:41939", + "amount": 50000 + } + ], + "feerate": "10000perkw", + "minconf": null, + "utxos": null, + "minchannels": null, + "commitment_feerate": "2000perkw" + } + }, + { + "id": "example:multifundchannel#2", + "method": "multifundchannel", + "params": { + "destinations": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59@localhost:44663", + "amount": 50000 + }, + { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d@localhost:34631", + "amount": 50000 + }, + { + "id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199@localhost:34617", + "amount": 50000 + } + ], + "feerate": null, + "minconf": null, + "utxos": null, + "minchannels": 1 } } ], "example_json_response": [ { - "unsigned_tx": "020000000142dc00d81359c3a551e170e3bf5262fa9cacc2eb2e283a10e579491cd86dce4b0000000000fdffffff02ffffff00000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd42839800000000002251207836355fdc8a82dc4cb00a772c5554151d06384a4dd65e8d3f68ac08566b84be66000000", - "txid": "6e680cb76077f11c838cc7aee0c0aa360f9857f00856bb1614025a1af53739fc" + "tx": "0200000000010100a8ceb6f76c49c8c0c809ca359461540708a9a5ac56e56e6a7aaafb35f4d3850000000000fdffffff0250c30000000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd0623ff030000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a02473044022064763837f2cc84507eb1fc28c9e95d51174e1da4b8755da8e67fe21e37d0a8b402206295d0f19625f014819361a20572b936d81f6c5ba419e56997e882f3a7be094a012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000", + "txid": "ecba36e93bcf40542d43a05ef550bb0e4be51d766aa2ec8c5640a0d431ab0d06", + "channel_ids": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "channel_id": "060dab31d4a040568ceca26a761de54b0ebb50f55ea0432d5440cf3be936baec", + "channel_type": { + "bits": [ + 12 + ], + "names": [ + "static_remotekey/even" + ] + }, + "outnum": 0 + } + ], + "failed": [] + }, + { + "tx": "020000000001023041611dac05004825ab64781b4a33bf622380bf90196fae689196b1850a1f8f0000000000fdffffff5646519c565466c9588a88400ec71a39a2c0b6988beadb32491a13d9b89f85360100000000fdffffff0250c3000000000000220020181492c29a989f099fd2cf412c74b192dd095e81f4e4f6bec45bd1fbfdd2cfd983720000000000002251203e8a03f678bb7ca048baecc39788530560ea049816d604f72925e425288446c80140caa3b93c6667e4fe0026417cc87ae9dfd16d80018e7c6dcd6dfcee4d6cab7c7e84181baeb95ba25934ad1aa6b57f83c8287bf1b727123350b35549a3abe15b060140b3c6626b9b57081cc7eb5e4f518669764d265fb84316d8fb610e19ede13c5a370c1072861b909ec923acec980adb4a3e488ee3c6f9c49164bd4596945b52f62678000000", + "txid": "1fcc6d46200443ad21e3a1a1628b862bafd0d75c0b4454f5494957097bc7930d", + "channel_ids": [ + { + "id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", + "channel_id": "0d93c77b09574949f554440b5cd7d0af2b868b62a1a1e321ad430420466dcc1f", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "outnum": 0 + } + ], + "failed": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "method": "connect", + "error": { + "code": 401, + "message": "All addresses failed: 127.0.0.1:44663: Connection establishment: Connection refused. " + } + }, + { + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "method": "connect", + "error": { + "code": 401, + "message": "All addresses failed: 127.0.0.1:34631: Connection establishment: Connection refused. " + } + } + ] } ], "author": [ - "Rusty Russell <> is mainly responsible." + "ZmnSCPxj <> is mainly responsible." ], "see_also": [ - "lightning-txprepare(7)", - "lightning-txsend(7)" + "lightning-connect(7)", + "lightning-listfunds()", + "lightning-listpeers(7)", + "lightning-fundchannel(7)" ], "resources": [ "Main web site: " ] }, - "lightning-txprepare.json": { + "lightning-multiwithdraw.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "txprepare", - "title": "Command to prepare to withdraw funds from the internal wallet", + "rpc": "multiwithdraw", + "title": "Command for withdrawing to multiple addresses", "description": [ - "The **txprepare** RPC command creates an unsigned transaction which spends funds from Core Lightning's internal wallet to the outputs specified in *outputs*.", - "", - "**txprepare** is similar to the first part of a **withdraw** command, but supports multiple outputs and uses *outputs* as parameter. The second part is provided by **txsend**." + "The **multiwithdraw** RPC command sends funds from Core Lightning's internal wallet to the addresses specified in *outputs*." ], "request": { "required": [ @@ -36601,80 +23556,69 @@ "properties": { "outputs": { "type": "array", - "description": [ - "Format is like: [{destination1: amount1}, {destination2: amount2}] or [{destination: *all*}]. It supports any number of **confirmed** outputs." - ], "items": { "type": "outputdesc" - } + }, + "description": [ + "An array containing objects of the form `{address: amount}`. The `amount` may be the string *all*, indicating that all onchain funds be sent to the specified address. Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*." + ] }, "feerate": { "type": "feerate", "description": [ - "Used for the transaction as initial feerate." + "Feerate used for the withdrawals. See NOTES in lightning-feerates(7) for possible values." ], "default": "*normal*" }, "minconf": { "type": "u32", "description": [ - "The minimum number of confirmations that used outputs should have." + "Minimum number of confirmations that used outputs should have." ], "default": 1 }, "utxos": { "type": "array", - "description": [ - "To be used to fund the transaction, as an array of `txid:vout`. These must be drawn from the node's available UTXO set." - ], "items": { - "type": "outpoint" + "type": "outpoint", + "description": [ + "Utxos to be used to be withdrawn from, as an array of `txid:vout`. These must be drawn from the node's available UTXO set." + ] } } } }, "response": { "required": [ - "psbt", - "unsigned_tx", + "tx", "txid" ], "properties": { - "psbt": { - "type": "string", - "description": [ - "The PSBT representing the unsigned transaction." - ] - }, - "unsigned_tx": { + "tx": { "type": "hex", "description": [ - "The unsigned transaction." + "The raw transaction which was sent." ] }, "txid": { "type": "txid", "description": [ - "The transaction id of *unsigned_tx*; you hand this to lightning-txsend(7) or lightning-txdiscard(7), as the inputs of this transaction are reserved." + "The txid of the **tx**." ] } } }, - "errors": [ - "On failure, an error is reported and the transaction is not created.", - "", - "- -1: Catchall nonspecific error.", - "- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.", - "- 302: The dust limit is not met." - ], "example_json_request": [ { - "id": "example:txprepare#1", - "method": "txprepare", + "id": "example:multiwithdraw#1", + "method": "multiwithdraw", "params": { "outputs": [ { - "bcrt1qtwxd8wg5eanumk86vfeujvp48hfkgannf77evggzct048wggsrxsum2pmm": 16777215 + "bcrt1qyusnugshkn6kh5vmdjpe8hylvxlxjy3ns0hmrs": "2222000msat" + }, + { + "bcrt1q6r4vvt7uack33qf9n05umfxy8h5s2rdcmq7ra3": "3333000msat" } ], "feerate": null, @@ -36683,12 +23627,33 @@ } }, { - "id": "example:txprepare#2", - "method": "txprepare", + "id": "example:multiwithdraw#2", + "method": "multiwithdraw", "params": { "outputs": [ { - "bcrt1qyhu7rxj3rrlcj84jtzp2mk9d89xm9v2rx4d4h8au830axugx6mmqsuplng": "100000sat" + "BCRT1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KYGT080": 1000 + }, + { + "bcrt1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qzf4jry": 1000 + }, + { + "bcrt1pw508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7k0ylj56": 1000 + }, + { + "BCRT1SW50QT2UWHA": 1000 + }, + { + "bcrt1zw508d6qejxtdg4y5r3zarvaryv2wuatf": 1000 + }, + { + "bcrt1qqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvseswlauz7": 1000 + }, + { + "bcrt1pqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvsesyga46z": 1000 + }, + { + "bcrt1p0xlxvlhemja6c4dqv22uapctqupfhlxm9h8z3k2e72q4k9hcz7vqc8gma6": 1000 } ], "feerate": null, @@ -36699,1472 +23664,1195 @@ ], "example_json_response": [ { - "unsigned_tx": "020000000142dc00d81359c3a551e170e3bf5262fa9cacc2eb2e283a10e579491cd86dce4b0000000000fdffffff02ffffff00000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd42839800000000002251207836355fdc8a82dc4cb00a772c5554151d06384a4dd65e8d3f68ac08566b84be66000000", - "txid": "6e680cb76077f11c838cc7aee0c0aa360f9857f00856bb1614025a1af53739fc", - "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABATRHoQ9tEMHRHpf06v5uTEdjdMk1rccIaA6MNGMipNQWAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFLnqitWTi465LGxeucwoSAj16NGbAkcwRAIgVtOsUaQaPgH86aW6e6qmJa1xVb8KWvc+HALGosqVVmQCIFi4JU8Gy+vl2a2/frY+71hitYIBB/tjsRP7fpgb8b9TASECHUIV5q1r2ownjOlAFPQASTlZxxNgBvi5O3hCRvajwdJlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIELcANgTWcOlUeFw479SYvqcrMLrLig6EOV5SRzYbc5LAQ8EAAAAAAEQBP3///8AAQMI////AAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAAEDCEKDmAAAAAAAAQQiUSB4NjVf3IqC3EywCncsVVQVHQY4Sk3WXo0/aKwIVmuEvgA=" + "tx": "02000000000101b75863b811587b4c15bb94d9285c31d6369b8ff609e44de399936f8acb268f600000000000fdffffff03050d000000000000160014d0eac62fdcee2d1881259be9cda4c43de9050db8ae0800000000000016001427213e2217b4f56bd19b6c8393dc9f61be691233d4b5f5050000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a0247304402203a001463da125de5615ff1c18f9cd4a1d2a138c91d40189d350821ac8fb3ae4f02207a507eec27e15fe43476233cd9fe8b690ebd265073a58ed18ff79a1416886f18012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000", + "txid": "94e803b98257855569d35b675d65fb4fa0061a8b5f828992e2104a2882bb18bf" }, { - "unsigned_tx": "0200000001a91077a134fb9fe4a8d13a482b718368bfd9ce3eff61ff7d96549480a1f97dca0100000000fdffffff02a08601000000000022002025f9e19a5118ff891eb25882add8ad394db2b143355b5b9fbc3c5fd37106d6f66173010000000000225120a2a01c7965289eee56b5cfcddb9856c70fa476c264d21f711c6a69af776ae40366000000", - "txid": "f11d436054607603e903fc69c4bd9b39ce97421341c7cf814ad025cb5bf59c1c", - "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABAYZ4QwAgPq6Os8kk073f5Yx4T9LXYfbOjAdkzMXfuBQdAAAAAAD9////AjPkAioBAAAAFgAUeOeqzyifepeJAMCl4vnnJ/TRptRADQMAAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgYBFwmqWCrVkxxZ0/tte3z4lIem0L7MkhXzGAOvBWa6YCIFx7H4zOzxjixlZMi0DYYbIEflDjYHJXLfN1wVcXYuekASEDgztw/3Rks6vKGYMXJ83VEvQcNIjg3rJW6KdxEh26uwplAAAAAQEfQA0DAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIKkQd6E0+5/kqNE6SCtxg2i/2c4+/2H/fZZUlICh+X3KAQ8EAQAAAAEQBP3///8AAQMIoIYBAAAAAAABBCIAICX54ZpRGP+JHrJYgq3YrTlNsrFDNVtbn7w8X9NxBtb2AAEDCGFzAQAAAAAAAQQiUSCioBx5ZSie7la1z83bmFbHD6R2wmTSH3Ecammvd2rkAwA=" + "tx": "02000000000101dc5a50dfbafc30697b930b44e763ff7a255475d17d975fa0e2003431312098cf0100000000fdffffff09e803000000000000225120000000c4a5cad46221b2a187905e5266362b99d5e91c6ce24d165dab93e86433e803000000000000046002751ee8030000000000002a5128751e76e8199196d454941c45d1b3a323f1433bd6751e76e8199196d454941c45d1b3a323f1433bd6e80300000000000022512079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f817983b939700000000002251200518e92cd94e0f62c06f126dff98b9abe79b7ed845a156d5245678e26554475de803000000000000160014751e76e8199196d454941c45d1b3a323f1433bd6e8030000000000002200201863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262e803000000000000125210751e76e8199196d454941c45d1b3a323e803000000000000220020000000c4a5cad46221b2a187905e5266362b99d5e91c6ce24d165dab93e8643301407f0d9bc098c5439ff611507b6a7d403047ed4e0b883f293db19d4e109d350a24f790acb55547384ff2a23fcfde0eba9af7cebc321c19cfc4817ecd47d50c2cd854000000", + "txid": "062383a7c9a19a2768939087a5c89826a4ea3531080f20cc06aa1cbf431be505" } ], + "errors": [ + "On failure, an error is reported and the withdrawal transaction is not created.", + "", + "- -1: Catchall nonspecific error.", + "- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.", + "- 302: The dust limit is not met." + ], "author": [ - "Rusty Russell <> is mainly responsible." + "ZmnSCPxj <> is mainly responsible." ], "see_also": [ - "lightning-withdraw(7)", - "lightning-txsend(7)", - "lightning-txdiscard(7)", - "lightning-feerates(7)" + "lightning-listfunds(7)", + "lightning-fundchannel(7)", + "lightning-newaddr(7)", + "lightning-txprepare(7)", + "lightning-withdraw(7)" ], "resources": [ "Main web site: " ] }, - "lightning-txsend.json": { + "lightning-newaddr.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "txsend", - "title": "Command to sign and send transaction from txprepare", + "rpc": "newaddr", + "title": "Command for generating a new address to be used by Core Lightning", "description": [ - "The **txsend** RPC command signs and broadcasts a transaction created by *txprepare* RPC command." + "The **newaddr** RPC command generates a new address which can subsequently be used to fund channels managed by the Core Lightning node.", + "", + "The funding transaction needs to be confirmed before funds can be used.", + "", + "To send an on-chain payment from the Core Lightning node wallet, use `withdraw`." ], "request": { - "required": [ - "txid" - ], + "required": [], "properties": { - "txid": { - "type": "txid", + "addresstype": { + "type": "string", "description": [ - "The transaction id of the transaction created by `txprepare` rpc command." + "It specifies the type of address wanted; currently *bech32* (e.g. `tb1qu9j4lg5f9rgjyfhvfd905vw46eg39czmktxqgg` on bitcoin testnet or `bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej` on bitcoin mainnet), or *p2tr* taproot addresses. The special value *all* generates all known address types for the same underlying key." + ], + "default": "*bech32* address", + "enum": [ + "bech32", + "p2tr", + "all" ] } } }, "response": { - "required": [ - "psbt", - "tx", - "txid" - ], + "required": [], "properties": { - "psbt": { + "p2tr": { + "added": "v23.08", "type": "string", "description": [ - "The completed PSBT representing the signed transaction." - ] - }, - "tx": { - "type": "hex", - "description": [ - "The fully signed transaction." + "The taproot address." ] }, - "txid": { - "type": "txid", - "description": [ - "The transaction id of *tx*." - ] - } - } - }, - "errors": [ - "On failure, an error is reported (from bitcoind), and the inputs from the transaction are unreserved.", - "", - "- -1: Catchall nonspecific error." - ], - "example_json_request": [ - { - "id": "example:txsend#1", - "method": "txsend", - "params": { - "txid": "c9f59ba6bda8e095bb43ecabfa37de8d5194e5c839b6b63be4e29bceaae483ce" - } - } - ], - "example_json_response": [ - { - "tx": "020000000142dc00d81359c3a551e170e3bf5262fa9cacc2eb2e283a10e579491cd86dce4b0000000000fdffffff020000000100000000220020b636f07026ea64952ece5b7620a9337d9ac2321c796a499260994d1b373667504183980000000000225120754a77b503fcba0fd80f0a1a8226ed6764ff9a9d9bb61b485d40d4c9f4be245966000000", - "txid": "c9f59ba6bda8e095bb43ecabfa37de8d5194e5c839b6b63be4e29bceaae483ce", - "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABATRHoQ9tEMHRHpf06v5uTEdjdMk1rccIaA6MNGMipNQWAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFLnqitWTi465LGxeucwoSAj16NGbAkcwRAIgVtOsUaQaPgH86aW6e6qmJa1xVb8KWvc+HALGosqVVmQCIFi4JU8Gy+vl2a2/frY+71hitYIBB/tjsRP7fpgb8b9TASECHUIV5q1r2ownjOlAFPQASTlZxxNgBvi5O3hCRvajwdJlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZSICA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPRzBEAiBp/HPhg1ObOXqTr5rIjUYLMspGLz+sk1pjD9pjRFzf3wIgWycOB/dQPzwZAK3OXYs269h8o85ucDpdVhH4AyX69a0BIgYD10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8IAfrZCgAAAAABDiBC3ADYE1nDpVHhcOO/UmL6nKzC6y4oOhDleUkc2G3OSwEPBAAAAAABEAT9////AAEDCAAAAAEAAAAAAQQiACC2NvBwJupklS7OW3YgqTN9msIyHHlqSZJgmU0bNzZnUAABAwhBg5gAAAAAAAEEIlEgdUp3tQP8ug/YDwoagibtZ2T/mp2bthtIXUDUyfS+JFkhBycqmiXx/+1S+rBKLMiK6rE1tTcjhWqPFIHCZBf4ipIuCQDVXEk5CwAAAAA=" - } - ], - "author": [ - "Rusty Russell <> is mainly responsible." - ], - "see_also": [ - "lightning-txprepare(7)", - "lightning-txdiscard(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "lightning-unreserveinputs.json": { - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "rpc": "unreserveinputs", - "title": "Release reserved UTXOs", - "description": [ - "The **unreserveinputs** RPC command releases (or reduces reservation) on UTXOs which were previously marked as reserved, generally by lightning-reserveinputs(7)." - ], - "request": { - "required": [ - "psbt" - ], - "properties": { - "psbt": { + "bech32": { "type": "string", "description": [ - "Inputs to unreserve are the inputs specified in the passed-in *psbt*." - ] - }, - "reserve": { - "type": "u32", - "description": [ - "The number of blocks to decrease reservation by." - ], - "default": 72 - } - } - }, - "response": { - "required": [ - "reservations" - ], - "properties": { - "reservations": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "txid", - "vout", - "was_reserved", - "reserved" - ], - "properties": { - "txid": { - "type": "txid", - "description": [ - "The transaction id." - ] - }, - "vout": { - "type": "u32", - "description": [ - "The output number which was reserved." - ] - }, - "was_reserved": { - "type": "boolean", - "description": [ - "Whether the input was already reserved (usually `true`)." - ] - }, - "reserved": { - "type": "boolean", - "description": [ - "Whether the input is now reserved (may still be `true` if it was reserved for a long time)." - ] - } - }, - "allOf": [ - { - "if": { - "additionalProperties": true, - "properties": { - "reserved": { - "enum": [ - true - ] - } - } - }, - "then": { - "required": [ - "reserved_to_block" - ], - "properties": { - "txid": {}, - "vout": {}, - "was_reserved": {}, - "reserved": {}, - "reserved_to_block": { - "type": "u32", - "description": [ - "What blockheight the reservation will expire." - ] - } - } - } - } - ] - } + "The bech32 (native segwit) address." + ] } } }, "errors": [ - "On failure, an error is reported and no UTXOs are unreserved.", - "", - "- -32602: Invalid parameter, i.e. an unparseable PSBT." + "If an unrecognized address type is requested an error message will be returned." ], "example_json_request": [ { - "id": "example:unreserveinputs#1", - "method": "unreserveinputs", + "id": "example:newaddr#1", + "method": "newaddr", "params": { - "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABAXyy20ynmOFyRbegGyApk50yNIAb4C+RKV5c2n5VKL3lAAAAAAD9////Akf0EAAAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WUs/fQpAQAAABYAFN9HebR4q6498ytdeRKjC64CkCOMAkcwRAIgSTJCpWVH1FLZYPdwFe7gZckxCtk+AxPp20KUVKqPIdUCIA3hkoUco68vffiwt6TrE3KgX09JE9m7PDUUgrHQANMRASEDBOBlCza/8qXE5q8uJ+OWsKscDERWfdA+LLCa/lwMH0BlAAAAAQEfR/QQAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZSICA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPRzBEAiBKjSasyN29ODqXSemEQCZfRIvbJP8thKRBrd4e+NLEMQIgMGNz3+DWDnLmjnIDCaVcC7BKxuycwvtJq1qlKFtTaXcBIgYD10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8IAfrZCgAAAAABDiAoXS6QUlCcOApG/j+hr4OhNt0tT4GvCzI6z16Hepi7OwEPBAAAAAABEAT9////AAEDCCN6CAAAAAAAAQQWABQfJ4Qjje0sa2yGBz++6jkM2hGRmAz8CWxpZ2h0bmluZwQCAAEAAQMIinkIAAAAAAABBCJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aIQeRRTKBKkQKTXZscc05GTaUo0CuEeAS5boa2e+6bnbKUwkAwsyrFwIAAAAA", - "reserve": 200 + "addresstype": null } }, { - "id": "example:unreserveinputs#2", - "method": "unreserveinputs", + "id": "example:newaddr#2", + "method": "newaddr", "params": { - "psbt": "cHNidP8BAF4CAAAAAVa79WPJoiYrzo/RgzIAn5HanoBFZo0vZvEjxPAVwLv4AAAAAAD9////AXzpHAAAAAAAIlEgBRjpLNlOD2LAbxJt/5i5q+ebfthFoVbVJFZ44mVUR11mAAAAAAEA3gIAAAAAAQENwcSElLyC0jcwUHiODBhtapHyzIdiwytOGiu/Raf4BwAAAAAA/f///wKAhB4AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFl82znKQEAAAAWABQyIWyAI6LDf6dJ58BDPdkh+PWUZwJHMEQCIGiJFhVi/d/Hz19Cz48uHTjhgBJ6WAlgl/bLVS7A6VtxAiAwlb7xYzIM4uopFvMnpOmGIOp3+upOPPF2F8VaB8U/HQEhA6BAjey7RADP4ifoh2VXhX7QXkh+sZqozv1EPuU5TxZmZQAAAAEBH4CEHgAAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WUAAA==", - "reserve": null + "addresstype": "bech32" } } ], "example_json_response": [ { - "reservations": [ - { - "txid": "3bbb987a875ecf3a320baf814f2ddd36a183afa13ffe460a389c5052902e5d28", - "vout": 0, - "was_reserved": true, - "reserved": false - } - ] + "bech32": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf" }, { - "reservations": [] + "bech32": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf" } ], "author": [ - "Lisa Neigut <> is mainly responsible." + "Felix <> is mainly responsible." ], "see_also": [ - "lightning-unreserveinputs(7)", - "lightning-signpsbt(7)", - "lightning-sendpsbt(7)" + "lightning-listfunds(7)", + "lightning-fundchannel(7)", + "lightning-withdraw(7)", + "lightning-listtransactions(7)" ], "resources": [ "Main web site: " ] }, - "lightning-upgradewallet.json": { + "lightning-notifications.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "upgradewallet", - "title": "Command to spend all P2SH-wrapped inputs into a Native Segwit output", + "rpc": "notifications", + "title": "Command to set up notifications.", "description": [ - "`upgradewallet` is a convenience RPC which will spend all p2sh-wrapped Segwit deposits in a wallet into a single Native Segwit P2WPKH address." + "The **notifications** the RPC command enabled notifications for this JSON-RPC connection. By default (and for backwards-compatibility) notifications are disabled.", + "", + "Various commands, especially complex and slow ones, offer notifications which indicate their progress." ], "request": { - "required": [], + "required": [ + "enable" + ], "properties": { - "feerate": { - "type": "feerate", - "description": [ - "Feerate for the upgrade transaction." - ], - "added": "v23.02", - "default": "*opening*" - }, - "reservedok": { + "enable": { "type": "boolean", "description": [ - "Tells the wallet to include all P2SH-wrapped inputs, including reserved ones." - ], - "added": "v23.02" + "Whether to enable or disable notifications." + ] } } }, "response": { - "required": [ - "upgraded_outs" - ], - "properties": { - "upgraded_outs": { - "type": "u64", - "description": [ - "Count of spent/upgraded UTXOs." - ], - "added": "v23.02" - }, - "psbt": { - "type": "string", - "description": [ - "The PSBT that was finalized and sent." - ], - "added": "v23.02" - }, - "tx": { - "type": "hex", - "description": [ - "The raw transaction which was sent." - ], - "added": "v23.02" - }, - "txid": { - "type": "txid", - "description": [ - "The txid of the **tx**." - ], - "added": "v23.02" - } - } + "properties": {}, + "post_return_value_notes": [ + "On success, if *enable* was *true*, notifications will be forwarded from then on." + ] }, - "example_usage": [ - "The caller is trying to buy a liquidity ad but the command keeps failing. They have funds in their wallet, but they're all P2SH-wrapped outputs.", + "notifications": [ + "Notifications are JSON-RPC objects without an *id* field. *lightningd* sends notifications (once enabled with this *notifications* command) with a *params* *id* field indicating which command the notification refers to.", "", - "The caller can call `upgradewallet` to convert their funds to native segwit outputs, which are valid for liquidity ad buys." + "Implementations should ignore notifications without an *id* parameter, or unknown *method*.", + "", + "Common *method*s include:", + " *message*: param *message*: a descriptional string indicating something which occurred relating to the command. Param *level* indicates the level, as per lightning-getlog(7): *info* and *debug* are typical.", + " *progress*: param *num* and *total*, where *num* starts at 0 and is always less than *total*. Optional param *stage* with fields *num* and *total*, indicating what stage we are progressing through." ], - "example_json_request": [ + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters." + ], + "example_json_notifications": [ { - "id": "example:upgradewallet#1", - "method": "upgradewallet", - "params": "{}" + "method": "message", + "params": { + "id": 1, + "message": "This is a test message", + "level": "DEBUG" + } }, { - "id": "example:upgradewallet#2", - "method": "upgradewallet", + "method": "progress", "params": { - "feerate": "urgent", - "reservedok": true + "id": 2, + "num": 0, + "total": 30, + "stage": { + "num": 0, + "total": 2 + } } } ], - "example_json_response": [ + "example_json_request": [ { - "upgraded_outs": 0 + "id": "example:notifications#1", + "method": "notifications", + "params": { + "enable": true + } }, { - "tx": "0200000001c08ce0a9ea1e00179ea603cb8619ec2a2df990ef931e1ccd87fa7a0e271ed8370100000000fdffffff013514310100000000225120888ab14b6e1655d1d00039b836d70b66e3351543ab6cd2f94166255f3d5e6cb5cf000000", - "txid": "de5f1d6f0b2f95cfe5cfbf8cc33bd3f279a8f800ee0efc27bbfafb2b6ead9560", - "psbt": "cHNidP8BAgQCAAAAAQMEzwAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDgAgAAAAABAZRZ0m0kaJA+ubJw1eYurGROu1BYc0i7l9xbyG06R6uZAQAAAAD9////AmQtPCgBAAAAF6kUnoGu9IUv0FGnzol3Lb/BNBNkOViHAC0xAQAAAAAXqRRlVyjzbP420BqlDTI2cERp+EpVQIcCRzBEAiBliJpjBsipwFgsLZMlzbESZ6hMTh+pgKQlXUIL0nLb3wIga/xwr/IJgEc7Ie6ApS4aVDr9xr1TZ3wj+8bRvI6WqScBIQPgYuc48PzUufScX6A6YOsdmJwn+bAQjLZ/g9jhQYduHM4AAAABASAALTEBAAAAABepFGVXKPNs/jbQGqUNMjZwRGn4SlVAhyICArnAxoROEqUxyWjlXFUHjsFtm/dr6SkP2H0cynK0g5oXRzBEAiBlTUNYfS5n5rGRVmoNb0z3AMGJjHijwpXROGIVxfoBnQIgeTx32KY3CcfYTYzXUIRQAMUQB7rlPWRptWMDD3UttkcBAQQWABTWuWnTbf/a2YaRk/Zj7kgN/cc0iCIGArnAxoROEqUxyWjlXFUHjsFtm/dr6SkP2H0cynK0g5oXCNa5adMAAAAAAQ4gwIzgqeoeABeepgPLhhnsKi35kO+THhzNh/p6Dice2DcBDwQBAAAAARAE/f///wABAwg1FDEBAAAAAAEEIlEgiIqxS24WVdHQADm4NtcLZuM1FUOrbNL5QWYlXz1ebLUhByjMj8l44gnxaV+ltWVQYdsaqyMRtSQXaUW/EBXvLUuJCQCftnv8BwAAAAA=", - "upgraded_outs": 1 + "id": "example:notifications#2", + "method": "notifications", + "params": { + "enable": false + } } ], - "author": [ - "Lisa Neigut <> is mainly responsible." + "example_json_response": [ + {}, + {} ], - "see_also": [ - "lightning-utxopsbt(7)", - "lightning-reserveinputs(7)", - "lightning-unreserveinputs(7)" + "author": [ + "Rusty Russell <> wrote the initial version of this man page." ], "resources": [ "Main web site: " ] }, - "lightning-utxopsbt.json": { + "lightning-offer.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "utxopsbt", - "title": "Command to populate PSBT inputs from given UTXOs", + "rpc": "offer", + "title": "Command for accepting payments", + "warning": "experimental-offers only", "description": [ - "*utxopsbt* is a low-level RPC command which creates a PSBT using unreserved inputs in the wallet, optionally reserving them as well.", + "The **offer** RPC command creates an offer (or returns an existing one), which is a precursor to creating one or more invoices. It automatically enables the processing of an incoming invoice_request, and issuing of invoices.", "", - "It deliberately mirrors the parameters and output of lightning-fundpsbt(7) except instead of an optional *minconf* parameter to select unreserved outputs from the wallet, it takes a compulsory list of outputs to use." + "Note that for making an offer to *pay* someone else, see lightning- invoicerequest(7)." ], "request": { "required": [ - "satoshi", - "feerate", - "startweight", - "utxos" + "amount", + "description" ], "properties": { - "satoshi": { - "type": "msat_or_all", + "amount": { + "oneOf": [ + { + "type": "msat_or_any" + }, + { + "type": "currency" + } + ], "description": [ - "The minimum satoshi value of the output(s) needed (or the string `all` meaning use all unreserved inputs). If a value, it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*." + "Can be the string `any`, which creates an offer that can be paid with any amount (e.g. a donation). Otherwise it can be a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. It can also have an ISO 4217 postfix (e.g. USD), in which case currency conversion will need to be done for the invoice itself. A plugin is needed which provides the `currencyconvert` API for this currency, otherwise the offer creation will fail." ] }, - "feerate": { - "type": "feerate", + "description": { + "type": "string", "description": [ - "Used for the transaction as initial feerate." - ], - "default": "*normal*" + "A short description of purpose of the offer, e.g. *coffee*. This value is encoded into the resulting offer and is viewable by anyone you expose this offer to. It must be UTF-8, and cannot use *\\u* JSON escape codes." + ] }, - "startweight": { - "type": "u32", + "issuer": { + "type": "string", "description": [ - "The weight of the transaction before *fundpsbt* has added any inputs." + "Who is issuing this offer (i.e. you) if appropriate." ] }, - "utxos": { - "type": "array", + "label": { + "type": "string", "description": [ - "An array of `txid:vout`, each of which must be reserved or available." - ], - "items": { - "type": "outpoint" - } + "An internal-use name for the offer, which can be any UTF-8 string. This is *NOT* encoded in the offer not sent to the issuer." + ] }, - "reserve": { - "type": "u32", + "quantity_max": { + "type": "u64", "description": [ - "If not zero, then *reserveinputs* is called (successfully, with *exclusive* true) on the returned PSBT for this number of blocks." - ], - "default": "72 blocks" + "Invoice can specify more than one of the items up (and including) this maximum: 0 is a special value meaning `no maximuim`. The *amount* for the invoice will need to be multiplied accordingly. This is encoded in the offer." + ] }, - "reservedok": { - "type": "boolean", + "absolute_expiry": { + "type": "u64", "description": [ - "If set to true, it will also fail if any of the *utxos* are already reserved." - ], - "default": "false" + "Time the offer is valid until,in seconds since the first day of 1970 UTC. If not set, the offer remains valid (though it can be deactivated by the issuer of course). This is encoded in the offer." + ] }, - "locktime": { - "type": "u32", + "recurrence": { + "type": "string", "description": [ - "If not set, it is set to a recent block height." + "An invoice is expected at regular intervals. The argument is a positive number followed by one of `seconds`, `minutes`, `hours`, `days`, `weeks`, `months` or `years` (variants without the trailing `s` are also permitted). This is encoded in the offer. The semantics of recurrence is fairly predictable, but fully documented in BOLT 12. e.g. `4weeks`." ] }, - "min_witness_weight": { - "type": "u32", + "recurrence_base": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], "description": [ - "Minimum weight to use for a UTXO's witness. If the actual witness weight is greater than the provided minimum, the actual witness weight will be used." + "Time in seconds since the first day of 1970 UTC, optionally with a `@` prefix. This indicates when the first period begins; without this, the recurrence periods start from the first invoice. The `@` prefix means that the invoice must start by paying the first period; otherwise it is permitted to start at any period. This is encoded in the offer. e.g. `@1609459200` indicates you must start paying on the 1st January 2021." ] }, - "excess_as_change": { - "type": "boolean", + "recurrence_paywindow": { + "type": "string", "description": [ - "Flag to add a change output for the excess sats." + "Argument of form `-time+time[%]`. The first time is the number of seconds before the start of a period in which an invoice and payment is valid, the second time is the number of seconds after the start of the period. For example *-604800+86400* means you can fetch an pay the invoice 4 weeks before the given period starts, and up to 1 day afterwards. The optional *%* indicates that the amount of the invoice will be scaled by the time remaining in the period. This is encoded in the offer." + ], + "default": "that payment is allowed during the current and previous periods" + }, + "recurrence_limit": { + "type": "u32", + "description": [ + "To indicate the maximum period which exists. eg. `12` means there are 13 periods, from 0 to 12 inclusive. This is encoded in the offer." ] }, - "opening_anchor_channel": { - "added": "v23.08", + "single_use": { "type": "boolean", "description": [ - "To signel that it needs emergency reserve for anchors so that we can lowball our commitment tx fees, and min-emergency-msat for reserving some sats for closing anchor channels." - ] + "Indicates that the offer is only valid once; we may issue multiple invoices, but as soon as one is paid all other invoices will be expired (i.e. only one person can pay this offer)." + ], + "default": "False" } } }, "response": { "required": [ - "psbt", - "feerate_per_kw", - "estimated_final_weight", - "excess_msat" + "offer_id", + "active", + "single_use", + "bolt12", + "used", + "created" ], "properties": { - "psbt": { - "type": "string", + "offer_id": { + "type": "hash", "description": [ - "Unsigned PSBT which fulfills the parameters given." + "The id of this offer (merkle hash of non-signature fields)." ] }, - "feerate_per_kw": { - "type": "u32", + "active": { + "type": "boolean", + "enum": [ + true + ], "description": [ - "The feerate used to create the PSBT, in satoshis-per-kiloweight." + "Whether this can still be used." ] }, - "estimated_final_weight": { - "type": "u32", + "single_use": { + "type": "boolean", "description": [ - "The estimated weight of the transaction once fully signed." + "Whether this expires as soon as it's paid (reflects the *single_use* parameter)." ] }, - "excess_msat": { - "type": "msat", + "bolt12": { + "type": "string", "description": [ - "The amount above *satoshi* which is available. This could be zero, or dust; it will be zero if *change_outnum* is also returned." + "The bolt12 encoding of the offer." ] }, - "change_outnum": { - "type": "u32", + "used": { + "type": "boolean", "description": [ - "The 0-based output number where change was placed (only if parameter *excess_as_change* was true and there was sufficient funds)." + "True if an associated invoice has been paid." ] }, - "reservations": { - "type": "array", + "created": { + "type": "boolean", "description": [ - "If *reserve* was true or a non-zero number, just as per lightning- reserveinputs(7)." - ], - "items": { - "type": "object", - "required": [ - "txid", - "vout", - "was_reserved", - "reserved", - "reserved_to_block" - ], - "additionalProperties": false, - "properties": { - "txid": { - "type": "txid", - "description": [ - "The txid of the transaction." - ] - }, - "vout": { - "type": "u32", - "description": [ - "The 0-based output number." - ] - }, - "was_reserved": { - "type": "boolean", - "description": [ - "Whether this output was previously reserved." - ] - }, - "reserved": { - "type": "boolean", - "enum": [ - true - ], - "description": [ - "Whether this output is now reserved." - ] - }, - "reserved_to_block": { - "type": "u32", - "description": [ - "The blockheight the reservation will expire." - ] - } - } - } + "False if the offer already existed." + ] + }, + "label": { + "type": "string", + "description": [ + "The (optional) user-specified label." + ] } - }, - "post_return_value_notes": [ - "On success, returns the *psbt* it created, containing the inputs, *feerate_per_kw* showing the exact numeric feerate it used, *estimated_final_weight* for the estimated weight of the transaction once fully signed, and *excess_msat* containing the amount above *satoshi* which is available. This could be zero, or dust. If *satoshi* was `all`, then *excess_msat* is the entire amount once fees are subtracted for the weights of the inputs and *startweight*.", - "", - "If *reserve* was *true* or a non-zero number, then a *reservations* array is returned, exactly like *reserveinputs*.", - "", - "If *excess_as_change* is true and the excess is enough to cover an additional output above the `dust_limit`, then an output is added to the PSBT for the excess amount. The *excess_msat* will be zero. A *change_outnum* will be returned with the index of the change output." - ] + } }, "errors": [ - "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "On failure, an error is returned and no offer is created. If the lightning process fails before responding, the caller should use lightning-listoffers(7) to query whether this offer was created or not.", + "", + "If the offer already existed, and is still active, that is returned; if it's not active then this call fails.", "", - "- -32602: If the given parameters are wrong.", "- -1: Catchall nonspecific error.", - "- 301: Insufficient UTXOs to meet *satoshi* value." + "- 1000: Offer with this offer_id already exists (but is not active)." ], "example_json_request": [ { - "id": "example:utxopsbt#1", - "method": "utxopsbt", + "id": "example:offer#1", + "method": "offer", "params": { - "satoshi": 0, - "feerate": "253perkw", - "startweight": 0, - "utxos": [ - "d82a99192fb333106ea8d08f5231ed45f2ed5b1ef9eb81b0fef8f9ea354d2637:1" - ], - "reserve": 0, - "reservedok": true, - "locktime": null, - "min_witness_weight": null, - "excess_as_change": false + "amount": "1msat", + "description": "test for 1msat" + } + }, + { + "id": "example:offer#2", + "method": "offer", + "params": { + "amount": "100000sat", + "description": "quantity_max test", + "recurrence": "1week" } + } + ], + "example_json_response": [ + { + "offer_id": "f61cca153d1948dade19349792d9bcdc9cef687fd27db0b553a67979f55aae48", + "active": true, + "single_use": false, + "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqyqs5rn5v4ehggrxdaezqvtdwdshg93pqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq63s", + "used": false, + "created": true }, { - "id": "example:utxopsbt#2", - "method": "utxopsbt", + "offer_id": "f7a501e51e2a90d032150b9100b1977c625f05cfda22469bdc81d8a20b1e303f", + "active": true, + "single_use": false, + "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqszltcgqpgghzatpde6xjaretakkz7pqw3jhxaqkyypxdeze35wncs2l2u4gfzyrpds00e6yakfrt6ctrw5n9qanzhqr2xq6qgqsw", + "used": false, + "created": true + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listoffers(7)", + "lightning-disableoffer(7)", + "lightning-invoicerequest(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-openchannel_abort.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "openchannel_abort", + "title": "Command to abort a channel to a peer", + "description": [ + "`openchannel_init` is a low level RPC command which initiates a channel open with a specified peer. It uses the openchannel protocol which allows for interactive transaction construction." + ], + "request": { + "required": [ + "channel_id" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "Channel id of the channel to be aborted." + ] + } + } + }, + "response": { + "required": [ + "channel_id", + "channel_canceled", + "reason" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "The channel id of the aborted channel." + ] + }, + "channel_canceled": { + "type": "boolean", + "description": [ + "Whether this is completely canceled (there may be remaining in-flight transactions)." + ] + }, + "reason": { + "type": "string", + "description": [ + "Usually \"Abort requested\", but if it happened to fail at the same time it could be different." + ] + } + } + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 305: Peer is not connected.", + "- 311: Unknown channel id.", + "- 312: Channel in an invalid state" + ], + "example_json_request": [ + { + "id": "example:openchannel_abort#1", + "method": "openchannel_abort", "params": { - "satoshi": 1000000, - "feerate": "7500perkw", - "startweight": 0, - "utxos": [ - "2fc3b9f8d4aed120f6d9a6f206f07c35ef4d518ec0305d1d974873d256e38ca7:1", - "2f669f6a605ee5c7ddd2abb753bc64b1a90bd1b7448264f5d78a7ca823c00a1b:1" - ], - "reserve": null, - "reservedok": true, - "locktime": null, - "min_witness_weight": null, - "excess_as_change": false + "channel_id": "aec3dfd0c7643a23b679cd2e493c053f8fdf621ff2624949f9582c4118b818c6" } } ], "example_json_response": [ { - "psbt": "cHNidP8BADMCAAAAATcmTTXq+fj+sIHr+R5b7fJF7TFSj9CobhAzsy8ZmSrYAQAAAAD9////AGYAAAAAAQDeAgAAAAABAWQACJva49ga8OCYXvPRWQRhoXndrJykwjgXbwT251dEAAAAAAD9////AiOI9ikBAAAAFgAU3gClv/YpAKRpfDuiFu6mIL2E4+5QaQ8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgUXIQFs7oRkorVThUn3sLj7WI7g8c8RHai4ChoCvIkWsCICp1CqHl4BlMJCKFHRWHXhhekaj0r1EFSNrh8UnvysQPASEDqHIAEdaH3H6pb3VJzbJNDG4lL8PTfsheL+h2p6baK3JlAAAAAQEfUGkPAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=", - "feerate_per_kw": 253, - "estimated_final_weight": 271, - "excess_msat": 1009932000 - }, - { - "psbt": "cHNidP8BAFwCAAAAAqeM41bSc0iXHV0wwI5RTe81fPAG8qbZ9iDRrtT4ucMvAQAAAAD9////GwrAI6h8itf1ZIJEt9ELqbFkvFO3q9Ldx+VeYGqfZi8BAAAAAP3///8AZgAAAAABAN4CAAAAAAEBEaK0TQ97IsrzuO1gLt+vYbvLBG90NrCOZp7SCgrRknYAAAAAAP3///8CM6/2KQEAAAAWABQ1B/KkIVbg7yFRcCEN/VOptfOX/EBCDwAAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WUCRzBEAiA1oI1us81XEa/DRlvcP2qnbWLsV5pZcRfvj9MLyT202gIgb7noMqHYWMmm7H7VNEfWa29jjtuV9yrrSc9ui11ECQ0BIQKhZOHR4gFKMu2EKKgZ/7qnhzq9PvhtnAW2sxPZ4c9RIWUAAAABAR9AQg8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAAEA3gIAAAAAAQGnjONW0nNIlx1dMMCOUU3vNXzwBvKm2fYg0a7U+LnDLwAAAAAA/f///wJmbOcpAQAAABYAFOwPo5eUrDF7UgZBFQLRHOeX6PiGQEIPAAAAAAAWABTCzKsXHCpb6dq1LsQbglhjAkxUZgJHMEQCICgjGlauGj2eiMS4MWUK6zAWqMe1OuidQR+Hy9ZgSTuzAiA8JTb9OrLqS3hiWtT+TQ/NBsKJ2hhHLDaKUUNdgi4OkAEhA9g3oH5ejmGIqUY2ZWxc8YWF2+T+XpE/6oC40Cx3+e97ZQAAAAEBH0BCDwAAAAAAFgAUwsyrFxwqW+natS7EG4JYYwJMVGYA", - "feerate_per_kw": 7500, - "estimated_final_weight": 542, - "excess_msat": 995935000, - "reservations": [ - { - "txid": "2fc3b9f8d4aed120f6d9a6f206f07c35ef4d518ec0305d1d974873d256e38ca7", - "vout": 1, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - }, - { - "txid": "2f669f6a605ee5c7ddd2abb753bc64b1a90bd1b7448264f5d78a7ca823c00a1b", - "vout": 1, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - } - ] + "channel_id": "aec3dfd0c7643a23b679cd2e493c053f8fdf621ff2624949f9582c4118b818c6", + "channel_canceled": true, + "reason": "Abort requested" } ], "author": [ - "Rusty Russell <> is mainly responsible." + "Lisa Neigut <> is mainly responsible." ], "see_also": [ - "lightning-fundpsbt(7)" + "lightning-openchannel_init(7)", + "lightning-openchannel_update(7)", + "lightning-openchannel_signed(7)", + "lightning-openchannel_bump(7)", + "lightning-fundchannel_start(7)", + "lightning-fundchannel_complete(7)", + "lightning-fundchannel(7)", + "lightning-fundpsbt(7)", + "lightning-utxopsbt(7)", + "lightning-multifundchannel(7)" ], "resources": [ "Main web site: " ] }, - "lightning-wait.json": { + "lightning-openchannel_bump.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "added": "v23.08", - "rpc": "wait", - "title": "Command to wait for creations, changes and deletions", + "rpc": "openchannel_bump", + "title": "Command to initiate a channel RBF", "description": [ - "The **wait** RPC command returns once the index given by *indexname* in *subsystem* reaches or exceeds *nextvalue*. All indexes start at 0, when no events have happened (**wait** with a *nextvalue* of 0 is a way of getting the current index, though naturally this is racy!)." + "`openchannel_bump` is a RPC command which initiates a channel RBF (Replace-By-Fee) for the specified channel. It uses the openchannel protocol which allows for interactive transaction construction.", + "", + "Warning: bumping a leased channel will lose the lease." ], "request": { "required": [ - "subsystem", - "indexname", - "nextvalue" + "channel_id", + "amount", + "initialpsbt" ], "properties": { - "subsystem": { - "type": "string", + "channel_id": { + "type": "hash", "description": [ - "The subsystem to get the next index value from.", - " `invoices`: corresponding to `listinvoices` (added in *v23.08*).", - " `sendpays`: corresponding to `listsendpays` (added in *v23.11*).", - " `forwards`: corresponding to `listforwards` (added in *v23.11*)." - ], - "enum": [ - "invoices", - "forwards", - "sendpays" + "Id of the channel to RBF." ] }, - "indexname": { - "type": "string", + "amount": { + "type": "sat", "description": [ - "The name of the index to get the next value for.", - " `created` is incremented by one for every new object.", - " `updated` is incremented by one every time an object is changed.", - " `deleted` is incremented by one every time an object is deleted." - ], - "enum": [ - "created", - "updated", - "deleted" + "Satoshi value that we will contribute to the channel. This value will be _added_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel." ] }, - "nextvalue": { - "type": "u64", + "initialpsbt": { + "type": "string", "description": [ - "The next value of the index." + "The funded, incomplete PSBT that specifies the UTXOs and change output for our channel contribution. It can be updated, see `openchannel_update`; *initialpsbt* must have at least one input. Must have the Non-Witness UTXO (PSBT_IN_NON_WITNESS_UTXO) set for every input. An error (code 309) will be returned if this requirement is not met." ] + }, + "funding_feerate": { + "type": "feerate", + "description": [ + "Feerate for the funding transaction." + ], + "default": "1/64th greater than the last feerate used for this channel" } } }, "response": { "required": [ - "subsystem" + "channel_id", + "channel_type", + "psbt", + "commitments_secured", + "funding_serial" ], "properties": { - "subsystem": { - "type": "string", - "enum": [ - "invoices", - "forwards", - "sendpays" - ] - }, - "created": { - "type": "u64", - "description": [ - "1-based index indicating order entry was created." - ] - }, - "updated": { - "type": "u64", + "channel_id": { + "type": "hash", "description": [ - "1-based index indicating order entry was updated." + "The channel id of the channel." ] }, - "deleted": { - "type": "u64", + "channel_type": { + "type": "object", "description": [ - "1-based index indicating order entry was deleted." - ] - }, - "details": {} - }, - "allOf": [ - { - "if": { - "additionalProperties": true, - "properties": { - "subsystem": { - "type": "string", - "enum": [ - "invoices" + "Channel_type as negotiated with peer." + ], + "added": "v24.02", + "additionalProperties": false, + "required": [ + "bits", + "names" + ], + "properties": { + "bits": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "u32", + "description": [ + "Bit number." ] } - } - }, - "then": { - "additionalProperties": false, - "properties": { - "subsystem": {}, - "created": {}, - "updated": {}, - "deleted": {}, - "details": { - "type": "object", - "additionalProperties": false, - "properties": { - "status": { - "type": "string", - "enum": [ - "unpaid", - "paid", - "expired" - ], - "description": [ - "Whether it's paid, unpaid or unpayable." - ] - }, - "label": { - "type": "string", - "description": [ - "Unique label supplied at invoice creation." - ] - }, - "description": { - "type": "string", - "description": [ - "Description used in the invoice." - ] - }, - "bolt11": { - "type": "string", - "description": [ - "The BOLT11 string." - ] - }, - "bolt12": { - "type": "string", - "description": [ - "The BOLT12 string." - ] - } - } - } - } - } - }, - { - "if": { - "additionalProperties": true, - "properties": { - "subsystem": { + }, + "names": { + "type": "array", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "added": "v24.02", + "items": { "type": "string", "enum": [ - "forwards" + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" + ], + "description": [ + "Name of feature bit." ] } } - }, - "then": { - "additionalProperties": false, - "properties": { - "subsystem": {}, - "created": {}, - "updated": {}, - "deleted": {}, - "details": { - "type": "object", - "additionalProperties": false, - "properties": { - "status": { - "type": "string", - "enum": [ - "offered", - "settled", - "failed", - "local_failed" - ], - "description": [ - "Still ongoing, completed, failed locally, or failed after forwarding." - ] - }, - "in_channel": { - "type": "short_channel_id", - "description": [ - "Unique label supplied at invoice creation." - ] - }, - "in_htlc_id": { - "type": "u64", - "description": [ - "The unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11)." - ] - }, - "in_msat": { - "type": "msat", - "description": [ - "The value of the incoming HTLC." - ] - }, - "out_channel": { - "type": "short_channel_id", - "description": [ - "The channel that the HTLC (trying to) forward to." - ] - } - } - } - } } }, - { - "if": { - "additionalProperties": true, - "properties": { - "subsystem": { - "type": "string", - "enum": [ - "sendpays" - ] - } - } - }, - "then": { - "additionalProperties": false, - "properties": { - "subsystem": {}, - "created": {}, - "updated": {}, - "deleted": {}, - "details": { - "type": "object", - "additionalProperties": false, - "properties": { - "status": { - "type": "string", - "enum": [ - "pending", - "failed", - "complete" - ], - "description": [ - "Status of the payment." - ] - }, - "partid": { - "type": "u64", - "description": [ - "Part number (for multiple parts to a single payment)." - ] - }, - "groupid": { - "type": "u64", - "description": [ - "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." - ] - }, - "payment_hash": { - "type": "hash", - "description": [ - "The hash of the *payment_preimage* which will prove payment." - ] - } - } - } - } - } + "psbt": { + "type": "string", + "description": [ + "The (incomplete) PSBT of the RBF transaction." + ] + }, + "commitments_secured": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "Whether the *psbt* is complete." + ] + }, + "funding_serial": { + "type": "u64", + "description": [ + "The serial_id of the funding output in the *psbt*." + ] + }, + "requires_confirmed_inputs": { + "type": "boolean", + "description": [ + "Does peer require confirmed inputs in psbt?" + ] } + }, + "post_return_value_notes": [ + "If the peer does not support `option_dual_fund`, this command will return an error.", + "", + "If the channel is not in a state that is eligible for RBF, this command will return an error." ] }, - "reliability": [ - "Indices can go forward by more than one; in particlar, if multiple objects were created and the one deleted, you could see this effect. Similarly, there are some places (e.g. invoice expiration) where we can update multiple entries at once.", - "", - "Indices only monotoncally increase." - ], - "usage": [ - "The **wait** RPC is used to track changes in the system. Consider tracking invoices being paid or expiring. The simplest (and inefficient method) would be:", - "1. Call `listinvoices` to get the current state of all invoices, and remember the highest `updated_index`. Say it was 5.", - "2. Call `wait invoices updated 6`.", - "3. When it returns, call `listinvoices` again to see what changed.", - "", - "This is obviously inefficient, so there are two optimizations:", - "1. Call `listinvoices` with `index=updated` and `start=6` to only see invoices with `updated_index` greater than or equal to 6.", - "2. `wait` itself may also return some limited subset of fields from the list command (it can't do this in all cases); for `invoices` this is `label` and `status`, allowing many callers to avoid the `listinvoices` call." - ], "errors": [ "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", "", - "- -32602: If the given parameters are wrong." - ], - "example_json_request": [ - { - "id": "example:wait#1", - "method": "wait", - "params": { - "subsystem": "invoices", - "indexname": "created", - "nextvalue": 1 - } - }, - { - "id": "example:wait#2", - "method": "wait", - "params": { - "subsystem": "invoices", - "indexname": "updated", - "nextvalue": 2 - } - }, - { - "id": "example:wait#3", - "method": "wait", - "params": { - "subsystem": "sendpays", - "indexname": "updated", - "nextvalue": 2 - } - } - ], - "example_json_response": [ - { - "subsystem": "invoices", - "created": 1, - "details": { - "status": "unpaid", - "label": "invlabel", - "bolt11": "lnbcrt420p1pjmxtevsp5d8c6gnaj8lyjy2qly783vklda9dfaqeyzyc37agxxp8h3uguv8pqpp5w6lhwxhqnuew4hle5h7qwjm27zz784mvsrzhmayhscy5t2hy5c4qdqvd9h8ver9wd3sxqyjw5qcqp99qxpqysgq09gxhjhwu9u3z6dlt5ln5f4g8zl78wz4pgh0am3kz54m9lllhqckf4gmhmt2ftrclq5x62zkqmggc7y0ju0ghdfwjz8hyd8l5cqvemgpyyhm6w" - } - }, - { - "subsystem": "invoices", - "updated": 2, - "details": { - "status": "expired" - } - }, - { - "subsystem": "sendpays", - "updated": 2, - "details": { - "status": "complete", - "partid": 0, - "groupid": 1, - "payment_hash": "220dcfcf43e1fab3ce30f70eb943c3ce962393f5a65ced52d749e324b443d19e" - } - } + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 300: The amount exceeded the maximum configured funding amount.", + "- 301: The provided PSBT cannot afford the funding amount.", + "- 305: Peer is not connected.", + "- 309: PSBT missing required fields", + "- 311: Unknown channel id.", + "- 312: Channel in an invalid state" ], "author": [ - "Rusty Russell <> is mainly responsible." + "Lisa Neigut <> is mainly responsible." ], "see_also": [ - "lightning-listinvoice(7)", - "lightning-listforwards(7)", - "lightning-listsendpays(7)" + "lightning-openchannel_init(7)", + "lightning-openchannel_update(7)", + "lightning-openchannel_signed(7)", + "lightning-openchannel_abort(7)", + "lightning-fundchannel_start(7)", + "lightning-fundchannel_complete(7)", + "lightning-fundchannel(7)", + "lightning-fundpsbt(7)", + "lightning-utxopsbt(7)", + "lightning-multifundchannel(7)" ], "resources": [ "Main web site: " ] }, - "lightning-waitanyinvoice.json": { + "lightning-openchannel_init.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "waitanyinvoice", - "title": "Command for waiting for payments", + "rpc": "openchannel_init", + "title": "Command to initiate a channel to a peer", "description": [ - "The **waitanyinvoice** RPC command waits until an invoice is paid, then returns a single entry as per **listinvoice**. It will not return for any invoices paid prior to or including the *lastpay_index*.", - "", - "This is usually called iteratively: once with no arguments, then repeatedly with the returned *pay_index* entry. This ensures that no paid invoice is missed. The *pay_index* is a monotonically-increasing number assigned to an invoice when it gets paid. The first valid *pay_index* is 1." + "`openchannel_init` is a low level RPC command which initiates a channel open with a specified peer. It uses the openchannel protocol which allows for interactive transaction construction." ], "request": { - "required": [], + "required": [ + "id", + "amount", + "initialpsbt" + ], "properties": { - "lastpay_index": { - "type": "u64", + "id": { + "type": "pubkey", "description": [ - "Ignores any invoices paid prior to or including this index. 0 is equivalent to not specifying and negative value is invalid." + "Node id of the remote peer." ] }, - "timeout": { - "type": "u64", - "description": [ - "If specified, wait at most that number of seconds, which must be an integer. If the specified *timeout* is reached, this command will return with an error. You can specify this to 0 so that **waitanyinvoice** will return immediately with an error if no pending invoice is available yet. If unspecified, this command will wait indefinitely." - ] - } - } - }, - "response": { - "required": [ - "label", - "description", - "payment_hash", - "status", - "created_index", - "expires_at" - ], - "properties": { - "label": { - "type": "string", + "amount": { + "type": "sat", "description": [ - "Unique label supplied at invoice creation." + "Satoshi value that we will contribute to the channel. This value will be _added_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel." ] }, - "description": { + "initialpsbt": { "type": "string", "description": [ - "Description used in the invoice." + "Funded, incomplete PSBT that specifies the UTXOs and change output for our channel contribution. It can be updated, see `openchannel_update`; *initialpsbt* must have at least one input. Must have the Non-Witness UTXO (PSBT_IN_NON_WITNESS_UTXO) set for every input. An error (code 309) will be returned if this requirement is not met." ] }, - "payment_hash": { - "type": "hash", + "commitment_feerate": { + "type": "feerate", "description": [ - "The hash of the *payment_preimage* which will prove payment." + "Feerate for commitment transactions for non-anchor channels: see **fundchannel**. For anchor channels, it is ignored." ] }, - "status": { - "type": "string", - "enum": [ - "paid", - "expired" + "funding_feerate": { + "type": "feerate", + "description": [ + "Feerate for the funding transaction." ], + "default": "'opening' feerate" + }, + "announce": { + "type": "boolean", "description": [ - "Whether it's paid or expired." + "Whether or not to announce this channel." ] }, - "expires_at": { - "type": "u64", + "close_to": { + "type": "string", "description": [ - "UNIX timestamp of when it will become / became unpayable." + "Bitcoin address to which the channel funds should be sent on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`." ] }, - "amount_msat": { + "request_amt": { "type": "msat", "description": [ - "The amount required to pay this invoice." + "An amount of liquidity you'd like to lease from the peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*." ] }, - "bolt11": { - "type": "string", + "compact_lease": { + "type": "hex", "description": [ - "The BOLT11 string (always present unless *bolt12* is)." + "A compact representation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel." ] }, - "bolt12": { - "type": "string", + "channel_type": { + "type": "array", "description": [ - "The BOLT12 string (always present unless *bolt11* is)." + "Each bit set in this channel_type." + ], + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + } + } + }, + "response": { + "required": [ + "channel_id", + "psbt", + "channel_type", + "commitments_secured", + "funding_serial" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "The channel id of the channel." ] }, - "created_index": { - "type": "u64", - "added": "v23.08", + "psbt": { + "type": "string", "description": [ - "1-based index indicating order this invoice was created in." + "The (incomplete) PSBT of the funding transaction." ] }, - "updated_index": { - "type": "u64", - "added": "v23.08", + "channel_type": { + "type": "object", "description": [ - "1-based index indicating order this invoice was changed (only present if it has changed since creation)." - ] - } - }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "paid" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "pay_index", - "amount_received_msat", - "paid_at", - "payment_preimage" - ], - "properties": { - "label": {}, - "description": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "bolt11": {}, - "bolt12": {}, - "expires_at": {}, - "created_index": {}, - "updated_index": {}, - "pay_index": { - "type": "u64", - "description": [ - "Unique incrementing index for this payment." - ] - }, - "amount_received_msat": { - "type": "msat", - "description": [ - "The amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)." - ] - }, - "paid_at": { - "type": "u64", + "Channel_type as negotiated with peer." + ], + "added": "v24.02", + "additionalProperties": false, + "required": [ + "bits", + "names" + ], + "properties": { + "bits": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "u32", "description": [ - "UNIX timestamp of when it was paid." + "Bit number." ] - }, - "paid_outpoint": { - "type": "object", - "description": [ - "Outpoint this invoice was paid with." - ], - "added": "v23.11", - "additionalProperties": false, - "required": [ - "txid", - "outnum" + } + }, + "names": { + "type": "array", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" ], - "properties": { - "txid": { - "added": "v23.11", - "type": "txid", - "description": [ - "ID of the transaction that paid the invoice." - ] - }, - "outnum": { - "added": "v23.11", - "type": "u32", - "description": [ - "The 0-based output number of the transaction that paid the invoice." - ] - } - } - }, - "payment_preimage": { - "type": "secret", "description": [ - "Proof of payment." + "Name of feature bit." ] } } - }, - "else": { - "additionalProperties": false, - "properties": { - "label": {}, - "description": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "bolt11": {}, - "bolt12": {}, - "created_index": {}, - "updated_index": {}, - "expires_at": {} - } } + }, + "commitments_secured": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "Whether the *psbt* is complete." + ] + }, + "funding_serial": { + "type": "u64", + "description": [ + "The serial_id of the funding output in the *psbt*." + ] + }, + "requires_confirmed_inputs": { + "type": "boolean", + "description": [ + "Does peer require confirmed inputs in psbt?" + ] } + }, + "post_return_value_notes": [ + "If the peer does not support `option_dual_fund`, this command will return an error.", + "", + "If you sent a *request_amt* and the peer supports `option_will_fund` and is interested in leasing you liquidity in this channel, returns their updated channel fee max (*channel_fee_proportional_basis*, *channel_fee_base_msat*), updated rate card for the lease fee (*lease_fee_proportional_basis*, *lease_fee_base_sat*) and their on-chain weight *weight_charge*, which will be added to the lease fee at a rate of *funding_feerate* * *weight_charge* / 1000." ] }, - "errors": [ - "The following error codes may occur:", - "", - "- 904: The *timeout* was reached without an invoice being paid." - ], "example_json_request": [ { - "id": "example:waitanyinvoice#1", - "method": "waitanyinvoice", + "id": "example:openchannel_init#1", + "method": "openchannel_init", "params": { - "lastpay_index": null, - "timeout": null + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "amount": 999000, + "initialpsbt": "cHNidP8BADMCAAAAAYbThUhSzYr7ph6Z434bdcW7eoirYOFMmUt2GXZ79sF/AQAAAAD9////AGYAAAAAAQDeAgAAAAABARVD4QKlmwy8SNcNypf1o9TzbIFZjj4dqVzHAL0SLDoTAAAAAAD9////AjOv9ikBAAAAFgAUXJGglH7At5HOVY4ZHp0+19kv655AQg8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgVIxRXqIykOOxm/6YPaFFx2Qh1618qlXPUhDiliVQ2KUCIHQcHniUTcm1XT8SyRE8ev52jm0uiIYum15XcR/tPh+NASEC3Pby7xL4+Ig/Z8TchQ0QT1upLGet3da8qjSjgHO9LOJlAAAAAQEfQEIPAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=", + "commitment_feerate": null, + "funding_feerate": null, + "announce": true, + "close_to": null, + "request_amt": null, + "channel_type": [ + 12, + 22 + ] } }, { - "id": "example:waitanyinvoice#2", - "method": "waitanyinvoice", + "id": "example:openchannel_init#2", + "method": "openchannel_init", "params": { - "lastpay_index": 3, - "timeout": 0 + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount": 16777216, + "initialpsbt": "cHNidP8BADMCAAAAAQVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAAAAAAD9////AGYAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=", + "commitment_feerate": null, + "funding_feerate": null, + "announce": true, + "close_to": null, + "request_amt": null, + "channel_type": null } } ], "example_json_response": [ { - "label": "inv1", - "bolt11": "lnbcrt10n1pjmxtsxsp56sn02x8lccjfsvunnhz5858zuyxztug9luy226w4qsmfm4r8pkcspp5gw5r0dw99yf3zqxrg24l8g9m9hun9cu06ldg4rga8s9t9kv8z45sdq8d9h8vvgxqyjw5qcqp99qxpqysgqv537uh2sx8ch640mf4t43t8qjtpg3z7gukgm07tlyq986m7nvsnxkapg37z4vsxtl4thfqzc64anqr83geygkc2xaftxgr97dltqfjqpe3mhja", - "payment_hash": "43a837b5c529131100c342abf3a0bb2df932e38fd7da8a8d1d3c0ab2d9871569", - "amount_msat": 1000, - "status": "paid", - "pay_index": 1, - "amount_received_msat": 1000, - "paid_at": 1706241546, - "payment_preimage": "a0c668998de14b975f33e1060b3efd7efc0bde784ac266ab667a1b2fddab3cd1", - "description": [ - "Inv1." - ], - "expires_at": 1706846342, - "created_index": 1, - "updated_index": 1 + "channel_id": "53fa2b1ca0d8f21abeaaac0495ab9925cdfaf2ca8b04dbe4aeb061823e1ff2c8", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABARVD4QKlmwy8SNcNypf1o9TzbIFZjj4dqVzHAL0SLDoTAAAAAAD9////AjOv9ikBAAAAFgAUXJGglH7At5HOVY4ZHp0+19kv655AQg8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgVIxRXqIykOOxm/6YPaFFx2Qh1618qlXPUhDiliVQ2KUCIHQcHniUTcm1XT8SyRE8ev52jm0uiIYum15XcR/tPh+NASEC3Pby7xL4+Ig/Z8TchQ0QT1upLGet3da8qjSjgHO9LOJlAAAAAQEfQEIPAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIIbThUhSzYr7ph6Z434bdcW7eoirYOFMmUt2GXZ79sF/AQ8EAQAAAAEQBP3///8M/AlsaWdodG5pbmcBCMCDK/6LyRi8AAEDCFg+DwAAAAAAAQQiACDYM+8ZRsbTj0OCG/yzqLt2buFQn9LuMPDZqFFcgmCmfAz8CWxpZ2h0bmluZwEIchtFHfZ5FBgA", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "commitments_secured": false, + "funding_serial": 8222241539686471000, + "requires_confirmed_inputs": false }, { - "label": "inv4", - "bolt11": "lnbcrt10n1pja0tkmsp57j4z9zwvdsyh57unh3da7aac5z20clfnrwy5nqm6wujaelduw23qpp580mdrwakz9xewc2vhvpucset9gjkgdvyhw7h9frcy2d6p2lwdw2qdq8d9h8vdqxqyjw5qcqp99qxpqysgqtgyzhtxs3p2dyk8wk9q028033303702d2hml4frmu38qe79mrkgzgxvyjmq2q4nhjgcuz3uhmlda3jnhf9w6mj8mj97pkgnda9l5kdcqsdgewf", - "payment_hash": "3bf6d1bbb6114d97614cbb03cc432b2a25643584bbbd72a478229ba0abee6b94", - "amount_msat": 1000, - "status": "paid", - "pay_index": 4, - "amount_received_msat": 1000, - "paid_at": 1708633825, - "payment_preimage": "77336a342dde76050c7ee7fc18599e407dfc1edad3c784ba68e9603004365b94", - "description": "inv4", - "expires_at": 1709238619, - "created_index": 4, - "updated_index": 4 + "channel_id": "252d1b0a1e57895e84137f28cf19ab2c35847e284c112fefdecc7afeaa5c1de7", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCLR8RjOq9lmcAAEDCAAAAAEAAAAAAQQiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQz8CWxpZ2h0bmluZwEIZZtc7LD4y9YA", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "commitments_secured": false, + "funding_serial": 7321547790872006000, + "requires_confirmed_inputs": false } ], + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 300: The amount exceeded the maximum configured funding amount.", + "- 301: The provided PSBT cannot afford the funding amount.", + "- 304: Still syncing with bitcoin network", + "- 305: Peer is not connected.", + "- 306: Unknown peer id.", + "- 309: PSBT missing required fields", + "- 310: v2 channel open protocol not supported by peer", + "- 312: Channel in an invalid state" + ], "author": [ - "Rusty Russell <> is mainly responsible." + "Lisa Neigut <> is mainly responsible." ], "see_also": [ - "lightning-waitinvoice(7)", - "lightning-listinvoice(7)", - "lightning-delinvoice(7)", - "lightning-invoice(7)" + "lightning-openchannel_update(7)", + "lightning-openchannel_signed(7)", + "lightning-openchannel_abort(7)", + "lightning-openchannel_bump(7)", + "lightning-fundchannel_start(7)", + "lightning-fundchannel_complete(7)", + "lightning-fundchannel(7)", + "lightning-fundpsbt(7)", + "lightning-utxopsbt(7)", + "lightning-multifundchannel(7)" ], "resources": [ "Main web site: " ] }, - "lightning-waitblockheight.json": { + "lightning-openchannel_signed.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "waitblockheight", - "title": "Command for waiting for blocks on the blockchain", + "rpc": "openchannel_signed", + "title": "Command to conclude a channel open", "description": [ - "The **waitblockheight** RPC command waits until the blockchain has reached the specified *blockheight*." + "`openchannel_signed` is a low level RPC command which concludes a channel open with the specified peer. It uses the v2 openchannel protocol, which allows for interactive transaction construction.", + "", + "This command should be called after `openchannel_update` returns *commitments_secured* `true`.", + "", + "This command will broadcast the finalized funding transaction, if we receive valid signatures from the peer." ], "request": { "required": [ - "blockheight" + "channel_id", + "signed_psbt" ], "properties": { - "blockheight": { - "type": "u32", + "channel_id": { + "type": "hash", "description": [ - "Current blockheight of the blockchain if the value is greater than this number. If it is a present or past block height, then the command returns immediately." + "Id of the channel." ] }, - "timeout": { - "type": "u32", + "signed_psbt": { + "type": "string", "description": [ - "Only wait up to specified seconds." - ], - "default": "60 seconds" + "The PSBT returned from `openchannel_update` (where *commitments_secured* was true) with partial signatures or finalized witness stacks included for every input that we contributed to the PSBT." + ] } } }, "response": { "required": [ - "blockheight" + "channel_id", + "tx", + "txid" ], "properties": { - "blockheight": { - "type": "u32", + "channel_id": { + "type": "hash", "description": [ - "The current block height (>= *blockheight* parameter)." + "The channel id of the channel." + ] + }, + "tx": { + "type": "hex", + "description": [ + "The funding transaction." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The txid of the **tx**." ] } - }, - "post_return_value_notes": [ - "If *timeout* seconds is reached without the specified blockheight being reached, this command will fail with a code of `2000`." - ] + } }, "errors": [ - "The following error codes may occur:", + "On error, the returned object will contain `code` and `message` properties, with `code` being one of the following:", "", - "- 2000: Timed out." - ], - "example_json_request": [ - { - "id": "example:waitblockheight#1", - "method": "waitblockheight", - "params": { - "blockheight": 99, - "timeout": null - } - }, - { - "id": "example:waitblockheight#2", - "method": "waitblockheight", - "params": { - "blockheight": 103, - "timeout": 600 - } - } - ], - "example_json_response": [ - { - "blockheight": 99 - }, - { - "blockheight": 103 - } + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 303: Funding transaction broadcast failed.", + "- 305: Peer is not connected.", + "- 309: PSBT missing required fields.", + "- 311: Unknown channel id.", + "- 312: Channel in an invalid state" ], "author": [ - "ZmnSCPxj <> is mainly responsible." + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-openchannel_init(7)", + "lightning-openchannel_update(7)", + "lightning-openchannel_abort(7)", + "lightning-openchannel_bump(7)", + "lightning-fundchannel_start(7)", + "lightning-fundchannel_complete(7)", + "lightning-fundchannel(7)", + "lightning-fundpsbt(7)", + "lightning-utxopsbt(7)", + "lightning-multifundchannel(7)" ], "resources": [ "Main web site: " ] }, - "lightning-waitinvoice.json": { + "lightning-openchannel_update.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "waitinvoice", - "title": "Command for waiting for specific payment", + "rpc": "openchannel_update", + "title": "Command to update a collab channel open", "description": [ - "The **waitinvoice** RPC command waits until a specific invoice is paid, then returns that single entry as per **listinvoice**." + "`openchannel_update` is a low level RPC command which continues an open channel, as specified by *channel_id*. An updated *psbt* is passed in; any changes from the PSBT last returned (either from `openchannel_init` or a previous call to `openchannel_update`) will be communicated to the peer.", + "", + "Must be called after `openchannel_init` and before `openchannel_signed`.", + "", + "Must be called until *commitments_secured* is returned as true, at which point `openchannel_signed` should be called with a signed version of the PSBT returned by the last call to `openchannel_update`." ], "request": { "required": [ - "label" + "channel_id", + "psbt" ], "properties": { - "label": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ], + "channel_id": { + "type": "hash", "description": [ - "Unique label of the invoice waiting to be paid." + "Id of the channel." + ] + }, + "psbt": { + "type": "string", + "description": [ + "Updated PSBT to be sent to the peer. May be identical to the PSBT last returned by either `openchannel_init` or `openchannel_update`." ] } } }, "response": { "required": [ - "label", - "description", - "payment_hash", - "status", - "created_index", - "expires_at" + "channel_id", + "psbt", + "commitments_secured", + "channel_type", + "funding_outnum" ], "properties": { - "label": { - "type": "string", - "description": [ - "Unique label supplied at invoice creation." - ] - }, - "description": { - "type": "string", - "description": [ - "Description used in the invoice." - ] - }, - "payment_hash": { + "channel_id": { "type": "hash", "description": [ - "The hash of the *payment_preimage* which will prove payment." - ] - }, - "status": { - "type": "string", - "enum": [ - "paid", - "expired" - ], - "description": [ - "Whether it's paid or expired." + "The channel id of the channel." ] }, - "expires_at": { - "type": "u64", + "channel_type": { + "type": "object", "description": [ - "UNIX timestamp of when it will become / became unpayable." - ] + "Channel_type as negotiated with peer." + ], + "added": "v24.02", + "additionalProperties": false, + "required": [ + "bits", + "names" + ], + "properties": { + "bits": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } + }, + "names": { + "type": "array", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" + ], + "description": [ + "Name of feature bit." + ] + } + } + } }, - "amount_msat": { - "type": "msat", + "psbt": { + "type": "string", "description": [ - "The amount required to pay this invoice." + "The PSBT of the funding transaction." ] }, - "bolt11": { - "type": "string", + "commitments_secured": { + "type": "boolean", "description": [ - "The BOLT11 string (always present unless *bolt12* is)." + "Whether the *psbt* is complete (if true, sign *psbt* and call `openchannel_signed` to complete the channel open)." ] }, - "bolt12": { - "type": "string", + "funding_outnum": { + "type": "u32", "description": [ - "The BOLT12 string (always present unless *bolt11* is)." + "The index of the funding output in the psbt." ] }, - "created_index": { - "type": "u64", - "added": "v23.08", + "close_to": { + "type": "hex", "description": [ - "1-based index indicating order this invoice was created in." + "Scriptpubkey which we have to close to if we mutual close." ] }, - "updated_index": { - "type": "u64", - "added": "v23.08", + "requires_confirmed_inputs": { + "type": "boolean", "description": [ - "1-based index indicating order this invoice was changed (only present if it has changed since creation)." + "Does peer require confirmed inputs in psbt?" ] } }, @@ -38172,84 +24860,38 @@ { "if": { "properties": { - "status": { - "type": "string", + "commitments_secured": { + "type": "boolean", "enum": [ - "paid" + true ] } } }, "then": { - "additionalProperties": false, + "additionalProperties": true, "required": [ - "pay_index", - "amount_received_msat", - "paid_at", - "payment_preimage" + "channel_id", + "funding_outnum" ], "properties": { - "label": {}, - "description": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "bolt11": {}, - "bolt12": {}, - "expires_at": {}, - "created_index": {}, - "updated_index": {}, - "pay_index": { - "type": "u64", - "description": [ - "Unique incrementing index for this payment." - ] - }, - "amount_received_msat": { - "type": "msat", + "commitments_secured": {}, + "channel_id": { + "type": "hash", "description": [ - "The amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)." + "The derived channel id." ] }, - "paid_at": { - "type": "u64", + "close_to": { + "type": "hex", "description": [ - "UNIX timestamp of when it was paid." + "If a `close_to` address was provided to `openchannel_init` and the peer supports `option_upfront_shutdownscript`." ] }, - "paid_outpoint": { - "type": "object", - "description": [ - "Outpoint this invoice was paid with." - ], - "added": "v23.11", - "additionalProperties": false, - "required": [ - "txid", - "outnum" - ], - "properties": { - "txid": { - "added": "v23.11", - "type": "txid", - "description": [ - "ID of the transaction that paid the invoice." - ] - }, - "outnum": { - "added": "v23.11", - "type": "u32", - "description": [ - "The 0-based output number of the transaction that paid the invoice." - ] - } - } - }, - "payment_preimage": { - "type": "secret", + "funding_outnum": { + "type": "u32", "description": [ - "Proof of payment." + "The index of the funding output for this channel in the funding transaction." ] } } @@ -38257,145 +24899,313 @@ "else": { "additionalProperties": false, "properties": { - "label": {}, - "description": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "bolt11": {}, - "bolt12": {}, - "created_index": {}, - "updated_index": {}, - "expires_at": {} + "commitments_secured": {} } } } ] }, "errors": [ - "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "On error, the returned object will contain `code` and `message` properties,", + "with `code` being one of the following:", "", "- -32602: If the given parameters are wrong.", - "- -1: If the invoice is deleted while unpaid, or the invoice does not exist.", - "- 903: If the invoice expires before being paid, or is already expired." + "- -1: Catchall nonspecific error.", + "- 305: Peer is not connected.", + "- 309: PSBT missing required fields", + "- 311: Unknown channel id.", + "- 312: Channel in an invalid state" ], "example_json_request": [ { - "id": "example:waitinvoice#1", - "method": "waitinvoice", + "id": "example:openchannel_update#1", + "method": "openchannel_update", "params": { - "label": "inv2" + "channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA" + } + }, + { + "id": "example:openchannel_update#2", + "method": "openchannel_update", + "params": { + "channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA" } } ], "example_json_response": [ { - "label": "inv2", - "bolt11": "lnbcrt10n1pjmxtwjsp5mzvdu6v8hqsf2tlj0nlyks23afqp7ejs444syjxf74p60ztmld8qpp5q4ayz5pys3t0yj0dmkmh7ctarkv9z434paz4u9rdwnj4f43thhaqdq8d9h8vvsxqyjw5qcqp99qxpqysgqn0055ttns6pafsxh6xuqce6e4vz8gtxlzqx0l9d9f5crmqx4jymh4zy9jdaszm0dj89sq39fvhpwcs626dt0n3gw8kassfdehp5sy3sq7fzy3w", - "payment_hash": "057a4150248456f249edddb77f617d1d985156350f455e146d74e554d62bbdfa", - "amount_msat": 1000, - "status": "paid", - "pay_index": 1, - "amount_received_msat": 1000, - "paid_at": 1706241494, - "payment_preimage": "34ccd37cc85e067cb376f9ea8c70d70469f58bf296f2566ed9ad4dfb70971a26", - "description": [ - "Inv2." - ], - "expires_at": 1706846290, - "created_index": 2, - "updated_index": 1 + "channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "commitments_secured": true, + "funding_outnum": 0 + }, + { + "channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA", + "channel_type": { + "bits": [ + 12, + 22 + ], + "names": [ + "static_remotekey/even", + "anchors_zero_fee_htlc_tx/even" + ] + }, + "commitments_secured": true, + "funding_outnum": 0, + "close_to": "5120eed745804da9784cc203f563efa99ffa54fdf01b137bc964e63c3124070ffbe6" } ], "author": [ - "Christian Decker <> is mainly responsible." + "Lisa Neigut <> is mainly responsible." ], "see_also": [ - "lightning-waitanyinvoice(7)", - "lightning-listinvoice(7)", - "lightning-delinvoice(7)", - "lightning-invoice(7)" + "lightning-openchannel_init(7)", + "lightning-openchannel_signed(7)", + "lightning-openchannel_bump(7)", + "lightning-openchannel_abort(7)", + "lightning-fundchannel_start(7)", + "lightning-fundchannel_complete(7)", + "lightning-fundchannel(7)", + "lightning-fundpsbt(7)", + "lightning-utxopsbt(7)", + "lightning-multifundchannel(7)" ], "resources": [ "Main web site: " ] }, - "lightning-waitsendpay.json": { + "lightning-parsefeerate.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "waitsendpay", - "title": "Command for sending a payment via a route", + "rpc": "parsefeerate", + "title": "Command for parsing a feerate string to a feerate", "description": [ - "The **waitsendpay** RPC command polls or waits for the status of an outgoing payment that was initiated by a previous **sendpay** invocation.", + "The **parsefeerate** command returns the current feerate for any valid *feerate_str*. This is useful for finding the current feerate that a **fundpsbt** or **utxopsbt** command might use." + ], + "request": { + "required": [ + "feerate_str" + ], + "properties": { + "feerate_str": { + "type": "string", + "description": [ + "The feerate string to parse." + ] + } + } + }, + "response": { + "required": [], + "properties": { + "perkw": { + "type": "u32", + "description": [ + "Value of *feerate_str* in kilosipa." + ], + "additionalProperties": false + } + } + }, + "example_json_request": [ + { + "id": "example:parsefeerate#1", + "method": "parsefeerate", + "params": [ + "unilateral_close" + ] + }, + { + "id": "example:parsefeerate#2", + "method": "parsefeerate", + "params": [ + "9999perkw" + ] + }, + { + "id": "example:parsefeerate#3", + "method": "parsefeerate", + "params": [ + 10000 + ] + }, + { + "id": "example:parsefeerate#4", + "method": "parsefeerate", + "params": [ + "urgent" + ] + } + ], + "example_json_response": [ + { + "perkw": 11000 + }, + { + "perkw": 9999 + }, + { + "perkw": 2500 + }, + { + "perkw": 11000 + } + ], + "errors": [ + "The **parsefeerate** command will error if the *feerate_str* format is not recognized.", "", - "If the payment completed with success, this command returns with success. Otherwise, if the payment completed with failure, this command returns an error." + "- -32602: If the given parameters are wrong." + ], + "trivia": [ + "In CLN we like to call the weight unit \"sipa\" in honor of Pieter Wuille, who uses the name \"sipa\" on IRC and elsewhere. Internally we call the *perkw* style as \"feerate per kilosipa\"." + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-pay.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "pay", + "title": "Command for sending a payment to a BOLT11 invoice", + "description": [ + "The **pay** RPC command attempts to find a route to the given destination, and send the funds it asks for. .", + "", + "The response will occur when the payment fails or succeeds. Once a payment has succeeded, calls to **pay** with the same *bolt11* will succeed immediately.", + "", + "When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name." ], "request": { "required": [ - "payment_hash" + "bolt11" ], "properties": { - "payment_hash": { - "type": "hash", + "bolt11": { + "type": "string", "description": [ - "The hash of the *payment_preimage*." + "Bolt11 invoice, if **experimental-offers** is enabled, it can actually be a bolt12 invoice, such as one received from lightningd-fetchinvoice(7). If it does not contain an amount, *amount_msat* is required, otherwise if it is specified it must be *null*." ] }, - "timeout": { - "type": "u32", + "amount_msat": { + "type": "msat", "description": [ - "A timeout in seconds, for this RPC command to return. If the *timeout* is provided and the given amount of time passes without the payment definitely succeeding or definitely failing, this command returns with a 200 error code (payment still in progress). If *timeout* is not provided this call will wait indefinitely. Indicating a *timeout* of 0 effectively makes this call a pollable query of the status of the payment." + "*amount_msat* is in millisatoshi precision; it can be a whole number, or a whole number with suffix *msat* or *sat*, or a three decimal point number with suffix *sat*, or an 1 to 11 decimal point number suffixed by *btc*." ] }, - "partid": { - "type": "u64", + "label": { + "type": "string", "description": [ - "Unique ID within this (multi-part) payment. It must match that of the **sendpay** command." + "It is used to attach a label to payments, and is returned in lightning- listpays(7) and lightning-listsendpays(7)." ] }, - "groupid": { - "type": "u64", + "riskfactor": { + "type": "number", + "description": [ + "The *riskfactor* is described in detail in lightning-getroute(7)." + ], + "default": "10" + }, + "maxfeepercent": { + "type": "number", + "description": [ + "Percentage of the amount that is to be paid." + ], + "default": "0.5" + }, + "retry_for": { + "type": "u16", + "description": [ + "Until *retry_for* seconds passes, the command will keep finding routes and retrying the payment." + ], + "default": "60 seconds" + }, + "maxdelay": { + "type": "u16", + "description": [ + "A payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case." + ] + }, + "exemptfee": { + "type": "msat", + "description": [ + "This option can be used for tiny payments which would be dominated by the fee leveraged by forwarding nodes. Setting `exemptfee` allows the `maxfeepercent` check to be skipped on fees that are smaller than `exemptfee`." + ], + "default": "5000 millisatoshi" + }, + "localinvreqid": { + "type": "hex", + "description": [ + "`localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7). This ensures that we only make a single payment for an offer, and that the offer is marked `used` once paid." + ] + }, + "exclude": { + "type": "array", + "description": [ + "*exclude* is a JSON array of short-channel-id/direction (e.g. [ '564334x877x1/0', '564195x1292x0/1' ]) or pubkey which should be excluded from consideration for routing." + ], + "default": "not to exclude any channels or nodes", + "items": { + "oneOf": [ + { + "type": "short_channel_id_dir" + }, + { + "type": "pubkey" + } + ] + } + }, + "maxfee": { + "type": "msat", + "description": [ + "*maxfee* overrides both *maxfeepercent* and *exemptfee* defaults (and if you specify *maxfee* you cannot specify either of those), and creates an absolute limit on what fee we will pay. This allows you to implement your own heuristics rather than the primitive ones used here." + ] + }, + "description": { + "type": "string", "description": [ - "Grouping key to disambiguate multiple attempts to pay the same payment_hash." + "It is only required for bolt11 invoices which do not contain a description themselves, but contain a description hash: in this case *description* is required. *description* is then checked against the hash inside the invoice before it will be paid." ] } - }, - "pairedWith": [ - [ - "partid", - "groupid" - ] - ] + } }, "response": { "required": [ - "id", - "created_index", + "payment_preimage", "payment_hash", - "status", "created_at", - "amount_sent_msat" + "parts", + "amount_msat", + "amount_sent_msat", + "status" ], "properties": { - "created_index": { - "added": "v23.11", - "type": "u64", - "description": [ - "1-based index indicating order this payment was created in." - ] - }, - "id": { - "type": "u64", + "payment_preimage": { + "type": "secret", "description": [ - "Old synonym for created_index." + "The proof of payment: SHA256 of this **payment_hash**." ] }, - "groupid": { - "type": "u64", + "destination": { + "type": "pubkey", "description": [ - "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." + "The final destination of the payment." ] }, "payment_hash": { @@ -38404,11089 +25214,6635 @@ "The hash of the *payment_preimage* which will prove payment." ] }, - "status": { - "type": "string", - "enum": [ - "complete" - ], - "description": [ - "Status of the payment." - ] - }, - "amount_msat": { - "type": "msat", - "description": [ - "The amount delivered to destination (if known)." - ] - }, - "destination": { - "type": "pubkey", - "description": [ - "The final destination of the payment if known." - ] - }, "created_at": { - "type": "u64", + "type": "number", "description": [ "The UNIX timestamp showing when this payment was initiated." ] }, - "updated_index": { - "added": "v23.11", - "type": "u64", + "parts": { + "type": "u32", "description": [ - "1-based index indicating order this payment was changed (only present if it has changed since creation)." + "How many attempts this took." ] }, - "completed_at": { - "type": "number", + "amount_msat": { + "type": "msat", "description": [ - "The UNIX timestamp showing when this payment was completed." + "Amount the recipient received." ] }, "amount_sent_msat": { "type": "msat", "description": [ - "The amount sent." - ] - }, - "label": { - "type": "string", - "description": [ - "The label, if given to sendpay." - ] - }, - "partid": { - "type": "u64", - "description": [ - "The *partid*, if given to sendpay." + "Total amount we sent (including fees)." ] }, - "bolt11": { + "warning_partial_completion": { "type": "string", "description": [ - "The bolt11 string (if pay supplied one)." + "Not all parts of a multi-part payment have completed." ] }, - "bolt12": { + "status": { "type": "string", + "enum": [ + "complete", + "pending", + "failed" + ], "description": [ - "The bolt12 string (if supplied for pay: **experimental-offers** only)." + "Status of payment." ] } }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "complete" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "payment_preimage" - ], - "properties": { - "id": {}, - "created_index": {}, - "updated_index": {}, - "groupid": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "destination": {}, - "created_at": {}, - "completed_at": {}, - "msatoshi_sent": {}, - "amount_sent_msat": {}, - "label": {}, - "partid": {}, - "bolt11": {}, - "bolt12": {}, - "payment_preimage": { - "type": "secret", - "description": [ - "The proof of payment: SHA256 of this **payment_hash**." - ] - } - } - } - } + "post_return_value_notes": [ + "You can monitor the progress and retries of a payment using the lightning-paystatus(7) command." ] }, + "randomization": [ + "To protect user privacy, the payment algorithm performs some randomization.", + "", + "1: Route Randomization", + "", + "Route randomization means the payment algorithm does not always use the lowest-fee or shortest route. This prevents some highly-connected node from learning all of the user payments by reducing their fees below the network average.", + "", + "2: Shadow Route", + "", + "Shadow route means the payment algorithm will virtually extend the route by adding delays and fees along it, making it appear to intermediate nodes that the route is longer than it actually is. This prevents intermediate nodes from reliably guessing their distance from the payee.", + "", + "Route randomization will never exceed *maxfeepercent* of the payment. Route randomization and shadow routing will not take routes that would exceed *maxdelay*." + ], "errors": [ - "On error, and even if the error occurred from a node other than the final destination, the route table will no longer be updated. Use the *exclude* parameter of the `getroute` command to ignore the failing route.", + "The following error codes may occur:", "", "- -1: Catchall nonspecific error.", - "- 200: Timed out before the payment could complete.", - "- 202: Unparseable onion reply. The *data* field of the error will have an *onionreply* field, a hex string representation of the raw onion reply.", - "- 203: Permanent failure at destination. The *data* field of the error will be routing failure object.", - "- 204: Failure along route; retry a different route. The *data* field of the error will be routing failure object.", - "- 208: A payment for *payment_hash* was never made and there is nothing to wait for.", - "- 209: The payment already failed, but the reason for failure was not stored. This should only occur when querying failed payments on very old databases.", + "- 201: Already paid with this *hash* using different amount or destination.", + "- 203: Permanent failure at destination. The *data* field of the error will be routing failure object (except for self-payment, which currently returns the error directly from lightning-sendpay(7)).", + "- 205: Unable to find a route.", + "- 206: Route too expensive. Either the fee or the needed total locktime for the route exceeds your *maxfeepercent* or *maxdelay* settings, respectively. The *data* field of the error will indicate the actual *fee* as well as the *feepercent* percentage that the fee has of the destination payment amount. It will also indicate the actual *delay* along the route.", + "- 207: Invoice expired. Payment took too long before expiration, or already expired at the time you initiated payment. The *data* field of the error indicates *now* (the current time) and *expiry* (the invoice expiration) as UNIX epoch time in seconds.", + "- 210: Payment timed out without a payment in progress.", + "", + "Error codes 202 and 204 will only get reported at **sendpay**; in **pay** we will keep retrying if we would have gotten those errors.", "", "A routing failure object has the fields below:", "", "*erring_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on.", "*erring_node*: The hex string of the pubkey id of the node that reported the error.", - "*erring_channel*: The short channel ID of the channel that has the error (or the final channel if the destination raised the error).", - "*erring_direction*: The direction of traversing the *erring_channel*:", + "*erring_channel*: The short channel ID of the channel that has the error, or *0:0:0* if the destination node raised the error.", "*failcode*: The failure code, as per BOLT #4.", - "*failcodename*: The human-readable name corresponding to *failcode*, if known." + "*channel_update*: The hex string of the *channel_update* message received from the remote node. Only present if error is from the remote node and the *failcode* has the UPDATE bit set, as per BOLT #4.", + "", + "The *data* field of errors will include statistics *getroute_tries* and *sendpay_tries*. It will also contain a *failures* field with detailed data about routing errors." ], "example_json_request": [ { - "id": "example:waitsendpay#1", - "method": "waitsendpay", + "id": "example:pay#1", + "method": "pay", "params": { - "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", - "timeout": null, - "partid": null, - "groupid": null + "bolt11": "lni1qqgxr7gha7gusyg83lsr8qcqg4axgq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqtypg3hgetnwsszycn0d36rzv3zypjx2umrwf5hqarfdahzcg8sn7jmpuyl423pvggzvmj9nrga83q474e2sjygxzmq7ln5fmvjxh4skxafx2pmx9wqx5v9qgqxyfhyvyg6pdvu4tcjvpp7kkal9rp57wj7xv4pl3ajku70rzy3pavzzqjz06c8s2vvmrpjlkcse0txx0gmc6jalqqxmeyjm75qcnfnqxwyt2sfsqnxu3vc68fug904w25y3zpskc8huazwmy34av93h2fjswe3tsp4rqpe8qlx9xssexfc0aguke3q6u0jgw2qmn008mzu04mkmqmjmhes3gcpqdqdnzl270s48vsp635rd4jm04snvgkcp65qlkgp8qztu2mdp7c5uqpj2rll3pzu56st537rct3v62gfqeamzthjuwkr0pkvsdnnffpn4sq9sz0lryaufktx0nfxlffum3yesqev5gwqqqqqqqqqqqqqqqzsqqqqqqqqqqqqr5jt9hav2gqqqqqq5szxtvwkyz5zq2000hlwvadejz366lqjt9sd2j4rf5tfd9rgmmyegt4dqd34cf6v4gqkfvppqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq633uzqn3n74ccym4wcvq20vsx7lmk450kprpvlrh4cukk8xy9ptjcef4rnhytnkyn4vnxxtd57yeaksze2s30y26cs6u3rjd9322eg9puk24q", + "amount_msat": null, + "label": null, + "riskfactor": null, + "maxfeepercent": null, + "retry_for": null, + "maxdelay": null, + "exemptfee": null, + "localinvreqid": null, + "exclude": null, + "maxfee": null, + "description": null } } ], "example_json_response": [ { - "created_index": 1, - "id": 1, - "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", - "groupid": 1, - "updated_index": 1, - "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "amount_msat": 11000000, - "amount_sent_msat": 11000000, - "created_at": 1706152930, - "completed_at": 1706152933, - "status": "complete", - "payment_preimage": "af7ba559629f719c04c43a82767fe3622790a539164d6270db07f765203e574b", - "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk" + "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "payment_hash": "29ef7dfee675b990a3ad7c125960d54aa34d16969468dec9942ead03635c274c", + "created_at": 1706153504.76628, + "parts": 1, + "amount_msat": 100, + "amount_sent_msat": 100, + "payment_preimage": "6634c1b549c6615d234832f377e06d5a5ab088c40cebdc5cfb8c1262030abcad", + "status": "complete" } ], "author": [ - "ZmnSCPxj <> is mainly responsible." + "Rusty Russell <> is mainly responsible." ], "see_also": [ - "lightning-sendpay(7)", - "lightning-pay(7)" + "lightning-listpays(7)", + "lightning-decodepay(7)", + "lightning-listinvoice(7)", + "lightning-delinvoice(7)", + "lightning-getroute(7)", + "lightning-invoice(7)" ], "resources": [ "Main web site: " ] }, - "lightning-withdraw.json": { + "lightning-ping.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "rpc": "withdraw", - "title": "Command for withdrawing funds from the internal wallet", + "rpc": "ping", + "title": "Command to check if a node is up.", "description": [ - "The **withdraw** RPC command sends funds from Core Lightning's internal wallet to the address specified in *destination*." + "The **ping** command checks if the node with *id* is ready to talk. It currently only works for peers we have a channel with." ], "request": { "required": [ - "destination", - "satoshi" + "id" ], "properties": { - "destination": { - "type": "string", - "description": [ - "Any Bitcoin accepted type, including bech32." - ] - }, - "satoshi": { - "type": "msat_or_all", + "id": { + "type": "pubkey", "description": [ - "The amount to be withdrawn from the internal wallet (expressed, as name suggests, in satoshi). The string *all* can be used to specify withdrawal of all available funds (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*." + "The pubkey of the node to ping." ] }, - "feerate": { - "type": "feerate", - "description": [ - "Used for the withdrawal as initial feerate." - ], - "default": "*normal*" - }, - "minconf": { + "len": { "type": "u16", "description": [ - "Minimum number of confirmations that used outputs should have." + "The length of the ping." ], - "default": 1 + "default": "128" }, - "utxos": { - "type": "array", + "pongbytes": { + "type": "u16", "description": [ - "Specifies the utxos to be used to be withdrawn from, as an array of `txid:vout`. These must be drawn from the node's available UTXO set." + "The length of the reply. A value of 65532 to 65535 means `don't reply`." ], - "items": { - "type": "outpoint" - } + "default": "128" } } }, "response": { "required": [ - "psbt", - "tx", - "txid" + "totlen" ], "properties": { - "tx": { - "type": "hex", - "description": [ - "The fully signed bitcoin transaction." - ] - }, - "txid": { - "type": "txid", - "description": [ - "The transaction id of *tx*." - ] - }, - "psbt": { - "type": "string", + "totlen": { + "type": "u16", "description": [ - "The PSBT representing the unsigned transaction." + "The answer length of the reply message (including header: 0 means no reply expected)." ] } } }, - "errors": [ - "On failure, an error is reported and the withdrawal transaction is not created.", - "", - "- -1: Catchall nonspecific error.", - "- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.", - "- 302: The dust limit is not met.", - "- 313: The `min-emergency-msat` reserve not be preserved (and we have anchor channels)." - ], "example_json_request": [ { - "id": "example:withdraw#1", - "method": "withdraw", + "id": "example:ping#1", + "method": "ping", "params": { - "destination": "bcrt1qjc7j2l5es4haw35c9jzm8dfm763ng5djp8f0s0", - "satoshi": 555555, - "feerate": null, - "minconf": null, - "utxos": null + "len": 128, + "pongbytes": 128 } }, { - "id": "example:withdraw#2", - "method": "withdraw", + "id": "example:ping#2", + "method": "ping", "params": { - "destination": "bcrt1q66ukn5mdllddnp53j0mx8mjgph7uwdygn0uy45", - "satoshi": "all", - "feerate": "20000perkb", - "minconf": 0, - "utxos": [ - "218390859cf94d869e33f69161f4187a98f691afe868c20811528f589e90a61f:1" - ] + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "len": 1000, + "pongbytes": 65535 } } ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters or we're already waiting for a ping response from peer." + ], "example_json_response": [ { - "tx": "0200000001ef28647baa13cc4c03b8a58c8bd08b69de434c22ff591eb68171ae992e3d816d0000000000fdffffff02237a080000000000160014963d257e99856fd746982c85b3b53bf6a33451b24d6808000000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a66000000", - "txid": "ccb97d7dc695cabb78b217c0b27d7d00d2941966199480e6443e0680d24d69eb", - "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABAWPCRda9hy4QKqUEmtb7gK7SAqzh1xBP8nZ7PCj+7+JDAAAAAAD9////Akf0EAAAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WUs/fQpAQAAABYAFOIj6yaI/g85utJBtkPPdK1X59cfAkcwRAIgH7J57HuUTpnCbDrDqE8W7ryuCXk+i/TszQ/NF55lWncCIDeN4y+EzIDP3l2XO5/wjk98krYqnzvEhrStk+0+fTowASEC6Ng5r5KTNIXBRRvjivsd8SKnHF59r/ViDj2+CLJVb75lAAAAAQEfR/QQAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZSICA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPRzBEAiBY0urYSHLnnXaAJH7yaGfvGmm+VuNCNIBhQaJU6iDNEgIgA7EASW+V00Su+lRQAE3Qbe4wavLq7l6Jn2vR+6Snyd0BIgYD10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8IAfrZCgAAAAABDiDvKGR7qhPMTAO4pYyL0Itp3kNMIv9ZHraBca6ZLj2BbQEPBAAAAAABEAT9////AAEDCCN6CAAAAAAAAQQWABSWPSV+mYVv10aYLIWztTv2ozRRsgz8CWxpZ2h0bmluZwQCAAEAAQMITWgIAAAAAAABBCJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aIQeRRTKBKkQKTXZscc05GTaUo0CuEeAS5boa2e+6bnbKUwkAwsyrFwIAAAAA" + "totlen": 132 }, { - "tx": "02000000011fa6909e588f521108c268e8af91f6987a18f46191f6339e864df99c859083210100000000fdffffff0158070f0000000000160014d6b969d36dffdad9869193f663ee480dfdc7348867000000", - "txid": "ad9a712a201214c68c39ca5be68c9d153d1cac91e540d88aa3207b241e23acf8", - "psbt": "cHNidP8BAgQCAAAAAQMEZwAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQD9ZQECAAAAAAEBVa+m1d1amChv4Dwq1rVoS4KSm0BUUnVa3fUYcB3dH9oAAAAAAP////8CECcAAAAAAAAiUSBXeaBg8gDUDo+HGkDrkWFMxb+m0KX4UuBTQAp/7/hhUOEPDwAAAAAAIlEg7tdFgE2peEzCA/Vj76mf+lT98BsTe8lk5jwxJAcP++YEAEcwRAIgPsWO/4IxeW6OclDdXVnwL99X7B18sRlxgFqyvUAzN7gCIGOQOq0wZ6bV+wdYQP+9sH8IkfmqWZbQRRDkZEgfcprMAUcwRAIgb5/dI4+uVhluQjSA2q/3oAGxZd4vYzQWexfmcRQML7ECIFfgRwCaHYdyu5/H5moOPlfQlLc2gPgB6bgtfNSfRA6jAUdSIQIyQmbehAOzqxV6CfH3hNWHr2GDHJmMFRvMIbt0wrIxSyEC4704AJhmydqOxKqZzE6pxsDdRt8Vxh7wzh8nEpFxTldSrgAAAAABASvhDw8AAAAAACJRIO7XRYBNqXhMwgP1Y++pn/pU/fAbE3vJZOY8MSQHD/vmAQ4gH6aQnliPUhEIwmjor5H2mHoY9GGR9jOehk35nIWQgyEBDwQBAAAAARAE/f///wETQL0MqyYsx9Z9q14BhByMgWLW4oJHOqED5qcZ3wyJ4eDuLYfNGq6Ck30dAqFzJL4VhZLSuv87zN/1AEDNMl2DmTohFl03KAgp8YbLmVzcy/I4q0VkATk5c1E5YySjZXXfNN3/CQAHHEnKAAAAAAAiAgK5wMaEThKlMclo5VxVB47BbZv3a+kpD9h9HMpytIOaFwjWuWnTBAAAAAEDCFgHDwAAAAAAAQQWABTWuWnTbf/a2YaRk/Zj7kgN/cc0iAz8CWxpZ2h0bmluZwQCAAEA" + "totlen": 0 } ], "author": [ - "Felix <> is mainly responsible." + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." ], "see_also": [ - "lightning-listfunds(7)", - "lightning-fundchannel(7)", - "lightning-newaddr(7)", - "lightning-txprepare(7)", - "lightning-feerates(7)" - ], - "resources": [ - "Main web site: " - ] - }, - "listchannels.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": { - "short_channel_id": { - "type": "short_channel_id", - "description": "if short_channel_id is a short channel id, then only known channels with a matching short_channel_id are returned. Otherwise, it must be null" - }, - "source": { - "type": "pubkey", - "description": "if source is a node id, then only channels leading from that node id are returned" - }, - "destination": { - "type": "pubkey", - "description": "if destination is a node id, then only channels leading to that node id are returned" - } - } - }, - "listchannels.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channels" - ], - "properties": { - "channels": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "source", - "destination", - "short_channel_id", - "direction", - "public", - "amount_msat", - "message_flags", - "channel_flags", - "active", - "last_update", - "base_fee_millisatoshi", - "fee_per_millionth", - "delay", - "htlc_minimum_msat", - "features" - ], - "properties": { - "source": { - "type": "pubkey", - "description": "the source node" - }, - "destination": { - "type": "pubkey", - "description": "the destination node" - }, - "short_channel_id": { - "type": "short_channel_id", - "description": "short channel id of channel" - }, - "direction": { - "type": "u32", - "description": "direction (0 if source < destination, 1 otherwise)." - }, - "public": { - "type": "boolean", - "description": "true if this is announced (from *v24.02*, being false is deprecated)" - }, - "amount_msat": { - "type": "msat", - "description": "the total capacity of this channel (always a whole number of satoshis)" - }, - "message_flags": { - "type": "u8", - "description": "as defined by BOLT #7" - }, - "channel_flags": { - "type": "u8", - "description": "as defined by BOLT #7" - }, - "active": { - "type": "boolean", - "description": "true unless source has disabled it (or (deprecated in *v24.02*) it's a local channel and the peer is disconnected or it's still opening or closing)" - }, - "last_update": { - "type": "u32", - "description": "UNIX timestamp on the last channel_update from *source*" - }, - "base_fee_millisatoshi": { - "type": "u32", - "description": "Base fee changed by *source* to use this channel" - }, - "fee_per_millionth": { - "type": "u32", - "description": "Proportional fee changed by *source* to use this channel, in parts-per-million" - }, - "delay": { - "type": "u32", - "description": "The number of blocks delay required by *source* to use this channel" - }, - "htlc_minimum_msat": { - "type": "msat", - "description": "The smallest payment *source* will allow via this channel" - }, - "satoshis": {}, - "htlc_maximum_msat": { - "type": "msat", - "description": "The largest payment *source* will allow via this channel" - }, - "features": { - "type": "hex", - "description": "BOLT #9 features bitmap for this channel" - } - } - } - } - } - }, - "listclosedchannels.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "added": "v23.05", - "properties": { - "id": { - "type": "pubkey", - "description": "if no *id* is supplied, then channel data on all historical channels are given. Supplying *id* will filter the results to only match channels to that peer. Note that prior to v23.05, old peers were forgotten" - } - } - }, - "listclosedchannels.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "added": "v23.05", - "required": [ - "closedchannels" - ], - "properties": { - "closedchannels": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "channel_id", - "opener", - "private", - "total_msat", - "total_local_commitments", - "total_remote_commitments", - "total_htlcs_sent", - "funding_txid", - "funding_outnum", - "leased", - "final_to_us_msat", - "min_to_us_msat", - "max_to_us_msat", - "close_cause" - ], - "properties": { - "peer_id": { - "type": "pubkey", - "description": "Peer public key (can be missing with pre-v23.05 closes!)" - }, - "channel_id": { - "type": "hash", - "description": "The full channel_id (funding txid Xored with output number)" - }, - "short_channel_id": { - "type": "short_channel_id", - "description": "The short_channel_id" - }, - "alias": { - "type": "object", - "required": [], - "properties": { - "local": { - "type": "short_channel_id", - "description": "An alias assigned by this node to this channel, used for outgoing payments" - }, - "remote": { - "type": "short_channel_id", - "description": "An alias assigned by the remote node to this channel, usable in routehints and invoices" - } - } - }, - "opener": { - "type": "string", - "enum": [ - "local", - "remote" - ], - "description": "Who initiated the channel" - }, - "closer": { - "type": "string", - "enum": [ - "local", - "remote" - ], - "description": "Who initiated the channel close (only present if closing)" - }, - "private": { - "type": "boolean", - "description": "if True, we will not announce this channel" - }, - "channel_type": { - "type": "object", - "description": "channel_type as negotiated with peer", - "additionalProperties": false, - "required": [ - "bits", - "names" - ], - "properties": { - "bits": { - "type": "array", - "description": "Each bit set in this channel_type", - "items": { - "type": "u32", - "description": "Bit number" - } - }, - "names": { - "type": "array", - "description": "Feature name for each bit set in this channel_type", - "items": { - "type": "string", - "enum": [ - "static_remotekey/even", - "anchor_outputs/even", - "anchors_zero_fee_htlc_tx/even", - "scid_alias/even", - "zeroconf/even" - ], - "description": "Name of feature bit" - } - } - } - }, - "total_local_commitments": { - "type": "u64", - "description": "Number of commitment transaction we made" - }, - "total_remote_commitments": { - "type": "u64", - "description": "Number of commitment transaction they made" - }, - "total_htlcs_sent": { - "type": "u64", - "description": "Number of HTLCs we ever sent" - }, - "funding_txid": { - "type": "txid", - "description": "ID of the funding transaction" - }, - "funding_outnum": { - "type": "u32", - "description": "The 0-based output number of the funding transaction which opens the channel" - }, - "leased": { - "type": "boolean", - "description": "Whether this channel was leased from `opener`" - }, - "funding_fee_paid_msat": { - "type": "msat", - "description": "How much we paid to lease the channel (iff `leased` is true and `opener` is local)" - }, - "funding_fee_rcvd_msat": { - "type": "msat", - "description": "How much they paid to lease the channel (iff `leased` is true and `opener` is remote)" - }, - "funding_pushed_msat": { - "type": "msat", - "description": "How much `opener` pushed immediate (if non-zero)" - }, - "total_msat": { - "type": "msat", - "description": "total amount in the channel" - }, - "final_to_us_msat": { - "type": "msat", - "description": "Our balance in final commitment transaction" - }, - "min_to_us_msat": { - "type": "msat", - "description": "Least amount owed to us ever. If the peer were to succesfully steal from us, this is the amount we would still retain." - }, - "max_to_us_msat": { - "type": "msat", - "description": "Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get." - }, - "last_commitment_txid": { - "type": "hash", - "description": "The final commitment tx's txid (or mutual close, if we accepted it). Not present for some very old, small channels pre-0.7.0." - }, - "last_commitment_fee_msat": { - "type": "msat", - "description": "The fee on `last_commitment_txid`" - }, - "close_cause": { - "type": "string", - "enum": [ - "unknown", - "local", - "user", - "remote", - "protocol", - "onchain" - ], - "description": "What caused the channel to close" - }, - "last_stable_connection": { - "type": "u64", - "added": "v24.02", - "description": "Last time we reestablished the open channel and stayed connected for 1 minute" - } - } - } - } - } + "lightning-connect(7)" + ], + "resources": [ + "Main web site: " + ] }, - "listconfigs.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-plugin.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "config": { - "type": "string", - "description": "configuration option name to restrict return" + "additionalProperties": true, + "rpc": "plugin", + "title": "Manage plugins with RPC", + "description": [ + "The **plugin** RPC command can be used to control dynamic plugins, i.e. plugins that declared themself 'dynamic' (in getmanifest)." + ], + "request": { + "required": [ + "subcommand" + ], + "oneOfMany": [ + [ + "plugin", + "directory" + ] + ], + "properties": { + "subcommand": { + "type": "string", + "enum": [ + "start", + "stop", + "rescan", + "startdir", + "list" + ], + "description": [ + "Determines what action is taken:", + " - *subcommand* **start** takes a *path* to an executable as argument and starts it as plugin. *path* may be an absolute path or a path relative to the plugins directory (default *~/.lightning/plugins*). If the plugin is already running and the executable (checksum) has changed, the plugin is killed and restarted except if its an important (or builtin) plugin. If the plugin doesn't complete the 'getmanifest' and 'init' handshakes within 60 seconds, the command will timeout and kill the plugin. Additional *options* may be passed to the plugin, but requires all parameters to be passed as keyword=value pairs using the `-k|--keyword` option which is recommended. For example the following command starts the plugin helloworld.py (present in the plugin directory) with the option greeting set to 'A crazy':", + " ```shell.", + " lightning-cli -k plugin subcommand=start plugin=helloworld.py greeting='A crazy'.", + " ```.", + " - *subcommand* **stop** takes a plugin executable *path* or *name* as argument and stops the plugin. If the plugin subscribed to 'shutdown', it may take up to 30 seconds before this command returns. If the plugin is important and dynamic, this will shutdown `lightningd`.", + " - *subcommand* **startdir** starts all executables it can find in *directory* (excl. subdirectories) as plugins. Checksum and timeout behavior as in **start** applies.", + " - *subcommand* **rescan** starts all plugins in the default plugins directory (default *~/.lightning/plugins*) that are not already running. Checksum and timeout behavior as in **start** applies.", + " - *subcommand* **list** lists all running plugins (incl. non-dynamic)." + ] + }, + "plugin": { + "type": "string", + "description": [ + "*path* or *name* of a plugin executable to start or stop." + ] + }, + "directory": { + "type": "string", + "description": [ + "*path* of a directory containing plugins." + ] + }, + "options": { + "type": "array", + "items": { + "type": "string", + "description": [ + "*keyword=value* options passed to plugin, can be repeated." + ] + } + } } - } - }, - "listconfigs.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "configs": { - "added": "v23.08", - "type": "object", - "comment": "Plugins can add fields to this, so we can't rule out additional properties :(", - "additionalProperties": true, - "required": [], - "properties": { - "conf": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": "field from cmdline" - }, - "source": { - "type": "string", - "enum": [ - "cmdline" - ], - "description": "source of configuration setting" - } - } - }, - "developer": { - "type": "object", - "added": "v23.08", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "clear-plugins": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "disable-mpp": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - }, - "plugin": { - "type": "string", - "description": "plugin which registered this configuration setting" - } - } - }, - "mainnet": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "regtest": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "signet": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "testnet": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "important-plugin": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": "field from config or cmdline" - } - }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": "source of configuration setting" - } - } - } - }, - "plugin": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": "field from config or cmdline" - } - }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": "source of configuration setting" - } - } - } - }, - "plugin-dir": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": "field from config or cmdline" - } - }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": "source of configuration setting" - } - } - } - }, - "lightning-dir": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "network": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default (can also be changed by `testnet`, `signet`, `regtest` options!)" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "allow-deprecated-apis": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_bool", - "source" - ], - "properties": { - "value_bool": { - "type": "boolean", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "rpc-file": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "disable-plugin": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": "field from config or cmdline" - } - }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": "source of configuration setting" - } - } - } - }, - "always-use-proxy": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_bool", - "source" - ], - "properties": { - "value_bool": { - "type": "boolean", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "daemon": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "wallet": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "large-channels": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "experimental-dual-fund": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "experimental-splicing": { - "added": "v23.08", - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "experimental-onion-messages": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "experimental-offers": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "experimental-shutdown-wrong-funding": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "experimental-websocket-port": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "experimental-peer-storage": { - "added": "v23.02", - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "experimental-anchors": { - "type": "object", - "added": "v23.08", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "database-upgrade": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_bool", - "source" - ], - "properties": { - "value_bool": { - "type": "boolean", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "rgb": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "hex", - "description": "field from config or cmdline, or default", - "maxLength": 6, - "minLength": 6 - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "alias": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "pid-file": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], + }, + "response": { + "required": [ + "command" + ], + "properties": { + "command": { + "type": "string", + "enum": [ + "start", + "stop", + "rescan", + "startdir", + "list" + ], + "description": [ + "The subcommand this is responding to." + ] + } + }, + "allOf": [ + { + "if": { "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" - }, - "source": { + "command": { "type": "string", - "description": "source of configuration setting" + "enum": [ + "start", + "startdir", + "rescan", + "list" + ] } } }, - "ignore-fee-limits": { - "type": "object", + "then": { "additionalProperties": false, "required": [ - "value_bool", - "source" + "command", + "plugins" ], "properties": { - "value_bool": { - "type": "boolean", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" + "command": {}, + "plugins": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "name", + "active", + "dynamic" + ], + "properties": { + "name": { + "type": "string", + "description": [ + "Full pathname of the plugin." + ] + }, + "active": { + "type": "boolean", + "description": [ + "Status; plugin completed init and is operational, plugins are configured asynchronously." + ] + }, + "dynamic": { + "type": "boolean", + "description": [ + "Plugin can be stopped or started without restarting lightningd." + ] + } + } + } } } - }, - "watchtime-blocks": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], + } + }, + { + "if": { "properties": { - "value_int": { - "type": "u32", - "description": "field from config or cmdline, or default" - }, - "source": { + "command": { "type": "string", - "description": "source of configuration setting" + "enum": [ + "stop" + ] } } }, - "max-locktime-blocks": { - "type": "object", + "then": { "additionalProperties": false, "required": [ - "value_int", - "source" + "command", + "result" ], "properties": { - "value_int": { - "type": "u32", - "description": "field from config or cmdline, or default" - }, - "source": { + "command": {}, + "result": { "type": "string", - "description": "source of configuration setting" + "description": [ + "A message saying it successfully stopped." + ] } } + } + } + ] + }, + "errors": [ + "On error, the reason why the action could not be taken upon the plugin is returned." + ], + "example_json_request": [ + { + "id": "example:plugin#1", + "method": "plugin", + "params": [ + "list" + ] + }, + { + "id": "example:plugin#2", + "method": "plugin", + "params": { + "subcommand": "stop", + "plugin": "fail_htlcs.py" + } + } + ], + "example_json_response": [ + { + "command": "list", + "plugins": [ + { + "name": "~/lightning/plugins/autoclean", + "active": true, + "dynamic": false }, - "funding-confirms": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } + { + "name": "~/lightning/plugins/chanbackup", + "active": true, + "dynamic": false }, - "cltv-delta": { + { + "name": "~/lightning/plugins/bcli", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/commando", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/funder", + "active": true, + "dynamic": true + }, + { + "name": "~/lightning/plugins/topology", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/keysend", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/offers", + "active": true, + "dynamic": true + }, + { + "name": "~/lightning/plugins/pay", + "active": true, + "dynamic": true + }, + { + "name": "~/lightning/plugins/txprepare", + "active": true, + "dynamic": true + }, + { + "name": "~/lightning/plugins/cln-renepay", + "active": true, + "dynamic": true + }, + { + "name": "~/lightning/plugins/spenderp", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/plugins/sql", + "active": true, + "dynamic": true + }, + { + "name": "~/lightning/plugins/bookkeeper", + "active": true, + "dynamic": false + }, + { + "name": "~/lightning/target/debug/examples/cln-plugin-startup", + "active": true, + "dynamic": false + } + ] + }, + { + "command": "stop", + "result": "Successfully stopped fail_htlcs.py." + } + ], + "author": [ + "Antoine Poinsot <> is mainly responsible." + ], + "see_also": [ + "lightning-cli(1)", + "lightning-listconfigs(1)", + "[writing plugins][writing plugins]" + ], + "resources": [ + "Main web site: ", + "", + "[writing plugins]: PLUGINS.md" + ] + }, + "lightning-preapproveinvoice.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.02", + "rpc": "preapproveinvoice", + "title": "Ask the HSM to preapprove an invoice (low-level)", + "description": [ + "The **preapproveinvoice** RPC command submits the *bolt11* invoice to the HSM to check that it is approved for payment.", + "", + "Generally the **preapproveinvoice** request does not need to be made explicitly, it is automatically generated as part of a **pay** request.", + "", + "By default, the HSM will approve all **preapproveinvoice** requests.", + "", + "If a remote signer is being used it might decline an **preapproveinvoice** request because it would exceed velocity controls, is not covered by allowlist controls, was declined manually, or other reasons.", + "", + "If a remote signer declines a **preapproveinvoice** request a subsequent attempt to pay the invoice anyway will fail; the signer will refuse to sign the commitment." + ], + "request": { + "required": [ + "bolt11" + ], + "properties": { + "bolt11": { + "type": "string", + "description": [ + "Bolt11 invoice to submit to the HSM to check." + ], + "added": "v23.02" + } + } + }, + "response": { + "properties": {} + }, + "author": [ + "Ken Sedgwick <> is mainly responsible." + ], + "see_also": [ + "lightning-pay(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-preapprovekeysend.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.02", + "rpc": "preapprovekeysend", + "title": "Ask the HSM to preapprove a keysend payment (low-level)", + "description": [ + "The **preapprovekeysend** RPC command submits the *destination*, *payment_hash*, and *amount_msat* parameters to the HSM to check that they are approved as a keysend payment.", + "", + "Generally the **preapprovekeysend** request does not need to be made explicitly, it is automatically generated as part of a **keysend** request.", + "", + "By default, the HSM will approve all **preapprovekeysend** requests.", + "", + "If a remote signer is being used it might decline an **preapprovekeysend** request because it would exceed velocity controls, is not covered by allowlist controls, was declined manually, or other reasons.", + "", + "If a remote signer declines a **preapprovekeysend** request a subsequent attempt to pay the keysend anyway will fail; the signer will refuse to sign the commitment." + ], + "request": { + "required": [ + "destination", + "payment_hash", + "amount_msat" + ], + "properties": { + "destination": { + "type": "pubkey", + "description": [ + "It is a 33 byte, hex-encoded, node ID of the node that the payment should go to." + ], + "added": "v23.02" + }, + "payment_hash": { + "type": "hex", + "added": "v23.02", + "description": [ + "It is the unique identifier of a payment." + ], + "maxLength": 64, + "minLength": 64 + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount to send in millisatoshi precision; it can be a whole number, or a whole number with suffix `msat` or `sat`, or a three decimal point number with suffix `sat`, or an 1 to 11 decimal point number suffixed by `btc`." + ], + "added": "v23.02" + } + } + }, + "response": { + "properties": {} + }, + "author": [ + "Ken Sedgwick <> is mainly responsible." + ], + "see_also": [ + "lightning-keysend(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-recover.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "recover", + "title": "Reinitialize Your Node for Recovery", + "description": [ + "The **recover** RPC command wipes your node and restarts it with the `--recover` option. This is only permitted if the node is unused: no channels, no bitcoin addresses issued (you can use `check` to see if recovery is possible).", + "", + "*hsmsecret* is either a codex32 secret starting with \"cl1\" as returned by `hsmtool getcodexsecret`, or a raw 64 character hex string.", + "", + "NOTE: this command only currently works with the `sqlite3` database backend." + ], + "request": { + "required": [ + "hsmsecret" + ], + "properties": { + "hsmsecret": { + "type": "string", + "description": [ + "Either a codex32 secret starting with `cl1` as returned by `hsmtool getcodexsecret`, or a raw 64 character hex string." + ] + } + } + }, + "response": { + "required": [ + "result" + ], + "properties": { + "result": { + "type": "string", + "added": "v24.05", + "enum": [ + "Recovery restart in progress" + ] + } + } + }, + "example_json_request": [ + { + "id": "example:recover#1", + "method": "recover", + "params": { + "hsmsecret": "cl10leetsd35kw6r5de5kueedxgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqdeuq7xuh94k9g" + } + }, + { + "id": "example:recover#2", + "method": "recover", + "params": { + "hsmsecret": "6c696768746e696e672d31000000000000000000000000000000000000000000" + } + } + ], + "example_json_response": [ + {}, + { + "result": "Recovery restart in progress" + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-hsmtool(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-recoverchannel.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "recoverchannel", + "title": "Command for recovering channels bundeled in an array in the form of *Static Backup*", + "description": [ + "The **recoverchannel** RPC command tries to force the peer (with whom you already had a channel) to close the channel and sweeps on-chain fund. This method is not spontaneous and depends on the peer, so use it in case of severe data loss.", + "", + "The *scb* parameter is an array containing minimum required info to reconnect and sweep funds. You can get the scb for already stored channels by using the RPC command 'staticbackup'." + ], + "request": { + "required": [ + "scb" + ], + "properties": { + "scb": { + "type": "array", + "description": [ + "SCB of the channels in an array." + ], + "items": { + "type": "hex" + } + } + } + }, + "response": { + "required": [ + "stubs" + ], + "properties": { + "stubs": { + "type": "array", + "items": { + "type": "string", + "description": [ + "Channel IDs of channels successfully inserted." + ] + } + } + } + }, + "example_json_request": [ + { + "id": "example:recoverchannel#1", + "method": "recoverchannel", + "params": [ + [ + "0000000000000001c3a7b9d74a174497122bc52d74d6d69836acadc77e0429c6d8b68b48d5c9139a022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d5904017f0000019f0bc3a7b9d74a174497122bc52d74d6d69836acadc77e0429c6d8b68b48d5c9139a0000000000000000000186a000021000" + ] + ] + } + ], + "example_json_response": [ + { + "stubs": [ + "c3a7b9d74a174497122bc52d74d6d69836acadc77e0429c6d8b68b48d5c9139a" + ] + } + ], + "author": [ + "Aditya <> is mainly responsible." + ], + "see_also": [ + "lightning-getsharedsecret(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-renepay.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "renepay", + "title": "Command for sending a payment to a BOLT11 invoice", + "added": "v23.08", + "description": [ + "**renepay** is a new payment plugin based on Pickhardt-Richter optimization method for Multi-Path-Payments. This implementation has not been thoroughly tested and it should be used with caution.", + "", + "The response will occur when the payment fails or succeeds. Once a payment has succeeded, calls to **renepay** with the same *invstring* will not lead to a new payment attempt, but instead it will succeed immediately.", + "", + "When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name." + ], + "request": { + "required": [ + "invstring" + ], + "properties": { + "invstring": { + "type": "string", + "description": [ + "Bolt11 invoice which the RPC command attempts to pay. Currently, **renepay** supports bolt11 invoices only." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "If the *invstring* does not contain an amount, *amount_msat* is required, otherwise if it is specified it must be *null*. in millisatoshi precision; it can be a whole number, or a whole number with suffix *msat* or *sat*, or a three decimal point number with suffix *sat*, or an 1 to 11 decimal point number suffixed by *btc*." + ] + }, + "maxfee": { + "type": "msat", + "description": [ + "*maxfee* is a hard bound, in the sense that the command will never attempt a payment when the fees exceed that value." + ] + }, + "maxdelay": { + "type": "u32", + "description": [ + "Overrides the value of `max-locktime-blocks` for this payment. It serves to limit the locktime of funds in the payment HTLC measured in blocks." + ] + }, + "retry_for": { + "type": "u32", + "description": [ + "Measured in seconds specifies how much time it is allowed for the command to keep retrying the payment." + ], + "default": "60 seconds" + }, + "description": { + "type": "string", + "description": [ + "Only required for bolt11 invoices which do not contain a description themselves, but contain a description hash: in this case *description* is required. *description* is then checked against the hash inside the invoice before it will be paid." + ] + }, + "label": { + "type": "string", + "description": [ + "Used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7)." + ] + }, + "dev_use_shadow": { + "hidden": true, + "type": "boolean" + } + } + }, + "response": { + "required": [ + "payment_preimage", + "payment_hash", + "created_at", + "parts", + "amount_msat", + "amount_sent_msat", + "status" + ], + "properties": { + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash**." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "created_at": { + "type": "number", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "parts": { + "type": "u32", + "description": [ + "How many attempts this took." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount the recipient received." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "Total amount we sent (including fees)." + ] + }, + "status": { + "type": "string", + "enum": [ + "complete", + "pending", + "failed" + ], + "description": [ + "Status of payment." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment." + ] + } + }, + "post_return_value_notes": [ + "You can monitor the progress and retries of a payment using the lightning-renepaystatus(7) command." + ] + }, + "optimality": [ + "**renepay** is based on the work by Pickhardt-Richter's *Optimally Reliable & Cheap Payment Flows on the Lightning Network*. Which means the payment command will prefer routes that have a higher probability of success while keeping fees low.", + "", + "The algorithm records some partial knowledge of the state of the Network deduced from the responses obtained after evey payment attempt. This knowledge is kept through different payment requests, but decays with time to account for the dynamics of the Network (after 1 hour all previous knowledge will be erased). Knowledge from previous payment attempts increases the reliability for subsequent ones.", + "", + "Higher probabilities of success and lower fees cannot generally by optimized at once. Hence **renepay** combines the two in different amounts seeking solutions that satisfy *maxfee* bound and a target for 90% probability of success. *maxfee* is a hard bound, in the sense that the command will never attempt a payment when the fees exceed that value. While the probability target is not compulsory (but desirable), i.e. if the best route does not satisfy the 90% probability target it will be tried anyways.", + "", + "When *maxfee* and the 90% probability bounds are satified, the algorithm will optimize the fees to its lowest value." + ], + "randomization": [ + "To protect user privacy, the payment algorithm performs *shadow route* randomization. Which means the payment algorithm will virtually extend the route by adding delays and fees along it, making it appear to intermediate nodes that the route is longer than it actually is. This prevents intermediate nodes from reliably guessing their distance from the payee.", + "", + "Route randomization will never exceed *maxfee* of the payment. Route randomization and shadow routing will not take routes that would exceed *maxdelay*." + ], + "errors": [ + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error.", + "- 200: Other payment attempts are in progress.", + "- 203: Permanent failure at destination.", + "- 205: Unable to find a route.", + "- 206: Payment routes are too expensive.", + "- 207: Invoice expired. Payment took too long before expiration, or already expired at the time you initiated payment.", + "- 210: Payment timed out without a payment in progress.", + "- 212: Invoice is invalid." + ], + "example_json_request": [ + { + "id": "example:renepay#1", + "method": "renepay", + "params": { + "invstring": "lnbcrt1230n1pjmxj9jsp5suc4cag0lv3wemllkvms56e6ll0w867cczqfttuu8cpfl089f9kspp56wvxtdh8fxg5r5y3kg3klxceakqaydskwzatga25v95da8nzkmwqdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqkmyhymt0j7hy38vzqxx465s4ys0fg78flnjqfx4clvdq9mrmgglpcnjrrnhtk7maa87pfvjez88hke8w97zvuecwswaf9gzyqlsthegpza67eu" + } + }, + { + "id": "example:renepay#2", + "method": "renepay", + "params": { + "invstring": "lnbcrt1pja0f9asp50kzadmeyy78eymjvhnlk5dznl3g5k5x8agh52ewjtg0jclas4ylspp5crsutd9hg05lxyhzphdcuyng6z3knrsdae83mxwawa842gz3vj3sdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqr5yzhxmup4muyaz6x8u2dy4qyu9t5qzuf5k9xayvj5kg7tve60gjk4jrv2l76exnj2xkuzhtwky23pkkxedzy6p9yrsgyqdwj7dv5gsp4zcw6v", + "amount_msat": 548925 + } + } + ], + "example_json_response": [ + { + "payment_preimage": "0a3fd704b34f47d6e306dbac78141753be83848d3a19725c972abfc367dcc591", + "payment_hash": "d39865b6e7499141d091b2236f9b19ed81d2361670bab475546168de9e62b6dc", + "created_at": 1706248370.6267352, + "parts": 1, + "amount_msat": 123000, + "amount_sent_msat": 123000, + "status": "complete", + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" + }, + { + "payment_preimage": "a635e92d024beebfc58519e6544888aa560ba3bcaba7e74924e4b8432eaa56f5", + "payment_hash": "c0e1c5b4b743e9f312e20ddb8e1268d0a3698e0dee4f1d99dd774f55205164a3", + "created_at": 1708631229.7841823, + "parts": 1, + "amount_msat": 548925, + "amount_sent_msat": 548925, + "status": "complete", + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" + } + ], + "author": [ + "Eduardo Quintana-Miranda <> is mainly responsible." + ], + "see_also": [ + "lightning-renepaystatus(7)", + "lightning-listpays(7)", + "lightning-invoice(7)" + ], + "resources": [ + "Main web site: ", + "", + "Pickhardt R. and Richter S., *Optimally Reliable & Cheap Payment Flows on the Lightning Network* " + ] + }, + "lightning-renepaystatus.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "renepaystatus", + "title": "Command for quering the status of previous renepay attempts", + "added": "v23.08", + "description": [ + "The **renepaystatus** RPC command queries the payment plugin **renepay** for the status of previous payment attempts.", + "", + "This command always succeeds." + ], + "request": { + "required": [], + "properties": { + "invstring": { + "type": "string", + "description": [ + "If specified, the command will return a list of payment attempts whose invoice matches *invstring*, otherwise all payments with be listed." + ] + } + } + }, + "response": { + "required": [ + "paystatus" + ], + "properties": { + "paystatus": { + "type": "array", + "description": [ + "A list of payments attempted by renepay." + ], + "items": { "type": "object", "additionalProperties": false, "required": [ - "value_int", - "source" + "bolt11", + "payment_hash", + "created_at", + "groupid", + "amount_msat", + "status", + "notes" ], "properties": { - "value_int": { - "type": "u32", - "description": "field from config or cmdline, or default" - }, - "source": { + "bolt11": { "type": "string", - "description": "source of configuration setting" - } - } - }, - "cltv-final": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": "field from config or cmdline, or default" + "description": [ + "Invoice string BOLT11." + ] }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "commit-time": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": "field from config or cmdline, or default" + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash** (for completed payments only)." + ] }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "fee-base": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": "field from config or cmdline, or default" + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "rescan": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "integer", - "description": "field from config or cmdline, or default" + "created_at": { + "type": "number", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "fee-per-satoshi": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { + "groupid": { "type": "u32", - "description": "field from config or cmdline, or default" + "description": [ + "The id for this payment attempt." + ] }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "max-concurrent-htlcs": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { + "parts": { "type": "u32", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "htlc-minimum-msat": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_msat", - "source" - ], - "properties": { - "value_msat": { - "type": "msat", - "description": "field from config or cmdline, or default" + "description": [ + "How many attempts this took." + ] }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "htlc-maximum-msat": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_msat", - "source" - ], - "properties": { - "value_msat": { + "amount_msat": { "type": "msat", - "description": "field from config or cmdline, or default" + "description": [ + "Amount the recipient received." + ] }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "max-dust-htlc-exposure-msat": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_msat", - "source" - ], - "properties": { - "value_msat": { + "amount_sent_msat": { "type": "msat", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "min-capacity-sat": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u64", - "description": "field from config or cmdline, or default" + "description": [ + "Total amount we sent including fees (for completed payments only)." + ] }, - "source": { + "status": { "type": "string", - "description": "source of configuration setting" - }, - "dynamic": { - "type": "boolean", "enum": [ - true + "complete", + "pending", + "failed" ], - "description": "Can this be set by setconfig()" - } - } - }, - "addr": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": "field from config or cmdline" - } - }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": "source of configuration setting" - } - } - } - }, - "announce-addr": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": "field from config or cmdline" - } + "description": [ + "Status of payment." + ] }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": "source of configuration setting" - } - } - } - }, - "bind-addr": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": "field from config or cmdline" - } + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment." + ] }, - "sources": { + "notes": { "type": "array", + "description": [ + "A list of messages for debugging purposes." + ], "items": { "type": "string", - "description": "source of configuration setting" + "description": [ + "A message generated by renepay." + ] } } } - }, - "offline": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "autolisten": { + } + } + } + }, + "author": [ + "Eduardo Quintana-Miranda <> is mainly responsible." + ], + "see_also": [ + "lightning-renepay(7)", + "lightning-listpays(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-reserveinputs.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "reserveinputs", + "title": "Construct a transaction and reserve the UTXOs it spends", + "description": [ + "The **reserveinputs** RPC command places (or increases) reservations on any inputs specified in *psbt* which are known to lightningd. It will fail with an error if any of the inputs are known to be spent, and ignore inputs which are unknown.", + "", + "Normally the command will fail (with no reservations made) if an input is already reserved." + ], + "request": { + "required": [ + "psbt" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "The PSBT to reserve inputs from." + ] + }, + "exclusive": { + "type": "boolean", + "description": [ + "If set to *False*, existing reservations are simply extended, rather than causing failure." + ] + }, + "reserve": { + "type": "u32", + "description": [ + "The number of blocks to reserve. By default, reservations are for the next 72 blocks (approximately 6 hours)." + ] + } + } + }, + "response": { + "required": [ + "reservations" + ], + "properties": { + "reservations": { + "type": "array", + "items": { "type": "object", "additionalProperties": false, "required": [ - "value_bool", - "source" + "txid", + "vout", + "was_reserved", + "reserved", + "reserved_to_block" ], "properties": { - "value_bool": { - "type": "boolean", - "description": "field from config or cmdline, or default" + "txid": { + "type": "txid", + "description": [ + "The input transaction id." + ] }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "proxy": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" + "vout": { + "type": "u32", + "description": [ + "The input index output number which was reserved." + ] }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "disable-dns": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { + "was_reserved": { "type": "boolean", - "description": "`true` if set in config or cmdline" + "description": [ + "Whether the input was already reserved." + ] }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "announce-addr-discovered": { - "added": "v23.02", - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", + "reserved": { + "type": "boolean", "enum": [ - "true", - "false", - "auto" + true ], - "description": "field from config or cmdline, or default" + "description": [ + "Whether the input is now reserved." + ] }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "announce-addr-discovered-port": { - "added": "v23.02", - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { + "reserved_to_block": { "type": "u32", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" + "description": [ + "What blockheight the reservation will expire." + ] } } + } + } + } + }, + "errors": [ + "On failure, an error is reported and no UTXOs are reserved.", + "", + "- -32602: Invalid parameter, such as specifying a spent/reserved input in *psbt*." + ], + "example_json_request": [ + { + "id": "example:reserveinputs#1", + "method": "reserveinputs", + "params": { + "psbt": "cHNidP8BAFwCAAAAAkwJVUqB0xXTO7JZ3PnPdGnxoYfQxhU+xqXGFYXsyX0RAAAAAAD9////TAlVSoHTFdM7slnc+c90afGhh9DGFT7GpcYVhezJfREBAAAAAP3///8AAAAAAAAAAA==", + "exclusive": true, + "reserve": null + } + }, + { + "id": "example:reserveinputs#2", + "method": "reserveinputs", + "params": { + "psbt": "cHNidP8BAP32AQIAAAAMgnW099dbh1uD153ih5eU5WhluynLxekXjAOjkEdNBg8BAAAAAP3///9FWKQt8C+1y4741+beFSqWAaj9DuvzHNpxvpxS+GB8lwEAAAAA/f///6E5TAGqktI29Oso6b9kZZoAFFGGvpJQUM8VO+3LMTlmAAAAAAD9////nSDT7hrkuoQtAV1yNnbpkJsB5ifKoM2zP+CcLPfis1gBAAAAAP3///+P1rW90UXfD0gIk58h3sXxxy3ZfJJLP0H1I4Jpzy/87QEAAAAA/f///w0UKZ/s9DnPpV+FJ8h2BEI7tl+qVxSGRFRv9FYw4girAQAAAAD9////EPNsUFrEOZyfjbqbh8rfHQ4C9RQECw12n3c1yhFqkzoAAAAAAP3///8QW9LEsSmuvSnvVzy+FDktM7ewQmZnIJI/TJMahLmSzwEAAAAA/f///+4edbWRHDdRJcMeHHElgSmb+nENPsz/g/0AmAEU6hXeAAAAAAD9////T15YLGmk7HBsrL+awdcxi3db3esp8AcCTS9XGrEnfoAAAAAAAP3///8q7xInvEk7J0Ir9cpKXqU2lArUskkYLrimIE0+Yb6a2QEAAAAA/f///8hBLKyMa2zRJqwNOk7DmsDIfG7IvJtQiJ+QnkkHl6atAAAAAAD9////AAAAAAAAAAAAAAAAAAAAAAAA", + "exclusive": false, + "reserve": null + } + } + ], + "example_json_response": [ + { + "reservations": [ + { + "txid": "117dc9ec8515c6a5c63e15c6d087a1f16974cff9dc59b23bd315d3814a55094c", + "vout": 1, + "was_reserved": false, + "reserved": true, + "reserved_to_block": 175 + } + ] + }, + { + "reservations": [ + { + "txid": "0f064d4790a3038c17e9c5cb29bb6568e5949787e29dd7835b875bd7f7b47582", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 }, - "encrypted-hsm": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } + { + "txid": "977c60f8529cbe71da1cf3eb0efda801962a15dee6d7f88ecbb52ff02da45845", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 }, - "rpc-file-mode": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } + { + "txid": "663931cbed3b15cf505092be865114009a6564bfe928ebf436d292aa014c39a1", + "vout": 0, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 }, - "log-level": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } + { + "txid": "58b3e2f72c9ce03fb3cda0ca27e6019b90e97636725d012d84bae41aeed3209d", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 }, - "log-prefix": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } + { + "txid": "edfc2fcf698223f5413f4b927cd92dc7f1c5de219f9308480fdf45d1bdb5d68f", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 }, - "log-file": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": "field from config or cmdline" - } - }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": "source of configuration setting" - } - } - } + { + "txid": "ab08e23056f46f5444861457aa5fb63b420476c827855fa5cf39f4ec9f29140d", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 }, - "log-timestamps": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_bool", - "source" - ], - "properties": { - "value_bool": { - "type": "boolean", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } + { + "txid": "3a936a11ca35779f760d0b0414f5020e1ddfca879bba8d9f9c39c45a506cf310", + "vout": 0, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 }, - "force-feerates": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" - }, - "source": { + { + "txid": "cf92b9841a934c3f9220676642b0b7332d3914be3c57ef29bdae29b1c4d25b10", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "de15ea14019800fd83ffcc3e0d71fa9b298125711c1ec32551371c91b5751eee", + "vout": 0, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "807e27b11a572f4d0207f029ebdd5b778b31d7c19abfac6c70eca4692c585e4f", + "vout": 0, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "d99abe613e4d20a6b82e1849b2d40a9436a55e4acaf52b42273b49bc2712ef2a", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + }, + { + "txid": "ada69707499e909f88509bbcc86e7cc8c09ac34e3a0dac26d16c6b8cac2c41c8", + "vout": 0, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 + } + ] + } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-unreserveinputs(7)", + "lightning-signpsbt(7)", + "lightning-sendpsbt(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-sendcustommsg.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v0.10.1", + "rpc": "sendcustommsg", + "title": "Low-level interface to send protocol messages to peers", + "description": [ + "The `sendcustommsg` RPC method allows the user to inject a custom message into the communication with the peer with the given `node_id`. This is intended as a low-level interface to implement custom protocol extensions on top, not for direct use by end-users.", + "", + "On the receiving end a plugin may implement the `custommsg` plugin hook and get notified about incoming messages, and allow additional unknown even types in their getmanifest response." + ], + "request": { + "required": [ + "node_id", + "msg" + ], + "properties": { + "node_id": { + "type": "pubkey", + "description": [ + "The node specified by `node_id` must be a peer, i.e., it must have a direct connection with the node receiving the RPC call, and the connection must be established. For a method to send arbitrary messages over multiple hops, including hops that do not understand the custom message, see the `createonion` and `sendonion` RPC methods. Messages can only be injected if the connection is handled by `openingd` or `channeld`. Messages cannot be injected when the peer is handled by `onchaind` or `closingd` since these do not have a connection, or are synchronous daemons that do not handle spontaneous messages." + ] + }, + "msg": { + "type": "hex", + "description": [ + "Must be a hex encoded well-formed message, including the 2-byte type prefix, but excluding the length prefix which will be added by the RPC method. The message types may not be one of the internally handled types, since that may cause issues with the internal state tracking of Core Lightning. We do (as of *v23.11*) allow sending of even types, but note that peers (as per the spec) will disconnect on receiving unknown even types." + ] + } + } + }, + "response": { + "required": [ + "status" + ], + "properties": { + "status": { + "type": "string", + "description": [ + "Information about where message was queued." + ] + } + }, + "pre_return_value_notes": [ + "The method will validate the arguments and queue the message for delivery through the daemon that is currently handling the connection. Queuing provides best effort guarantees and the message may not be delivered if the connection is terminated while the message is queued. The RPC method will return as soon as the message is queued.", + "", + "If any of the above limitations is not respected the method returns an explicit error message stating the issue." + ] + }, + "example_json_request": [ + { + "id": "example:sendcustommsg#5", + "method": "sendcustommsg", + "params": { + "node_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "msg": "77770012" + } + } + ], + "example_json_response": [ + { + "status": "Message sent to connectd for delivery" + } + ], + "author": [ + "Christian Decker <> is mainly responsible." + ], + "see_also": [ + "lightning-createonion(7)", + "lightning-sendonion(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-sendinvoice.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "sendinvoice", + "title": "Command for send an invoice for an offer", + "warning": "experimental-offers only", + "description": [ + "The **sendinvoice** RPC command creates and sends an invoice to the issuer of an *invoice_request* for it to pay: lightning-invoicerequest(7).", + "", + "If **fetchinvoice-noconnect** is not specified in the configuation, it will connect to the destination in the (currently common!) case where it cannot find a route which supports `option_onion_messages`." + ], + "request": { + "required": [ + "invreq", + "label" + ], + "properties": { + "invreq": { + "type": "string", + "description": [ + "The bolt12 invoice_request string beginning with `lnr1`." + ] + }, + "label": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "description": [ + "The unique label to use for this invoice." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Required if the *offer* does not specify an amount at all, or specifies it in a different currency. Otherwise you may set it (e.g. to provide a tip)." + ], + "default": "the amount contained in the offer (multiplied by *quantity* if any)" + }, + "timeout": { + "type": "u32", + "description": [ + "Seconds to wait for the offering node to pay the invoice or return an error. This will also be the timeout on the invoice that is sent." + ], + "default": "90 seconds" + }, + "quantity": { + "type": "u64", + "description": [ + "Quantity is is required if the offer specifies quantity_max, otherwise it is not allowed." + ] + } + } + }, + "response": { + "required": [ + "label", + "description", + "payment_hash", + "status", + "created_index", + "expires_at" + ], + "properties": { + "label": { + "type": "string", + "description": [ + "Unique label supplied at invoice creation." + ] + }, + "description": { + "type": "string", + "description": [ + "Description used in the invoice." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "unpaid", + "paid", + "expired" + ], + "description": [ + "Whether it's paid, unpaid or unpayable." + ] + }, + "expires_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when it will become / became unpayable." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount required to pay this invoice." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The BOLT12 string." + ] + }, + "created_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was created in." + ] + }, + "updated_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was changed (only present if it has changed since creation)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { "type": "string", - "description": "source of configuration setting" + "enum": [ + "paid" + ] } } }, - "subdaemon": { - "type": "object", + "then": { "additionalProperties": false, "required": [ - "values_str", - "sources" + "pay_index", + "amount_received_msat", + "paid_at", + "payment_preimage" ], "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": "field from config or cmdline" - } + "label": {}, + "description": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "bolt12": {}, + "expires_at": {}, + "created_index": {}, + "updated_index": {}, + "pay_index": { + "type": "u64", + "description": [ + "Unique incrementing index for this payment." + ] }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": "source of configuration setting" - } - } - } - }, - "fetchinvoice-noconnect": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" + "amount_received_msat": { + "type": "msat", + "description": [ + "The amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)." + ] }, - "source": { - "type": "string", - "description": "source of configuration setting" + "paid_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when it was paid." + ] + }, + "payment_preimage": { + "type": "secret", + "description": [ + "Proof of payment." + ] } } - }, - "accept-htlc-tlv-types": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], + } + } + ] + }, + "errors": [ + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error.", + "- 1002: Offer has expired.", + "- 1003: Cannot find a route to the node making the offer.", + "- 1004: The node making the offer returned an error message.", + "- 1005: We timed out waiting for the invoice to be paid" + ], + "example_json_request": [ + { + "id": "example:sendinvoice#1", + "method": "sendinvoice", + "params": { + "invreq": "lnr1qqg804wzdsyn8g4mf2yc22k8xvjpjzstwd5k6urvv5s8getnw3gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02gqsykppqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4nuzqw5w7y7xqm2rushk5a5n3mcuvqel954raykd5nqa830nq9hpd4s4fcnxw266vp9d5c8f3m3w40hmm6gm8akxx3rsnr7d4usunv0x3q8q", + "label": "payme for real!" + } + } + ], + "example_json_response": [ + { + "label": "payme for real!", + "bolt12": "lni1qqg804wzdsyn8g4mf2yc22k8xvjpjzstwd5k6urvv5s8getnw3gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02gqsykppqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4ngycqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky96qmcmtl30xtt7jdakfyhzm8f0gny6f4d2ukx5gurem04z8lfd2wza5qs9pz6wp9vu7cm6n4wmmrz77y4w6z5xv4q93yudkdtkl5zmzdzuawzqqex7gd5v0x0r83pqj82udd542fl4krh50s0dkx47d0hd5wh77g52xxl75ccpkt35mc8n282wslju9ufyys2y8qqqqqqqqqqqqqqqpgqqqqqqqqqqqqp6f9jm7k9yqqqqqq2gpr96l99lfspt25zqnyfgu7hznmt2tzkjdt92d2wc3dsq7keph7w8gudjs46spfzqrlu4gqs9vppqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky9muzqpze8kk43g0wh4h8qlac5lswwesrvsaxcza2f5j90c2h3ts8yzmn9g4mxqe89fngrqny8nf52xxuxep6548etda8lp876jr0nnxgdkdq", + "payment_hash": "4c89473d714f6b52c56935655354ec45b007ad90dfce3a38d942ba8052200ffc", + "amount_msat": 2, + "status": "paid", + "pay_index": 1, + "amount_received_msat": 2, + "paid_at": 1708640865, + "payment_preimage": "305951ab02cb2ea5eb884dbfd8fb110b4e088ecb8338b3e84e8f9c70919c19bf", + "description": "simple test", + "expires_at": 1708640953, + "created_index": 2, + "updated_index": 1 + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-fetchinvoice(7)" + ], + "resources": [ + "Main web site: " + ] + }, + "lightning-sendonion.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "sendonion", + "title": "Send a payment with a custom onion packet", + "description": [ + "The **sendonion** RPC command can be used to initiate a payment attempt with a custom onion packet. The onion packet is used to deliver instructions for hops along the route on how to behave. Normally these instructions are indications on where to forward a payment and what parameters to use, or contain details of the payment for the final hop. However, it is possible to add arbitrary information for hops in the custom onion, allowing for custom extensions that are not directly supported by Core Lightning.", + "", + "If the first element of *route* does not have \"channel\" set, a suitable channel (if any) will be chosen, otherwise that specific short-channel-id is used. The following is an example of a 3 hop onion:", + "", + "```json", + "[", + " \"298606954e9de3e9d938d18a74fed794c440e8eda82e52dc08600953c8acf9c4\",", + " \"2dc094de72adb03b90894192edf9f67919cb2691b37b1f7d4a2f4f31c108b087\",", + " \"a7b82b240dbd77a4ac8ea07709b1395d8c510c73c17b4b392bb1f0605d989c85\"", + "]", + "```" + ], + "request": { + "required": [ + "onion", + "first_hop", + "payment_hash" + ], + "properties": { + "onion": { + "type": "hex", + "description": [ + "Hex-encoded 1366 bytes long blob that was returned by either of the tools that can generate onions. It contains the payloads destined for each hop and some metadata. Please refer to [BOLT 04][bolt04] for further details. If is specific to the route that is being used and the *payment_hash* used to construct, and therefore cannot be reused for other payments or to attempt a separate route. The custom onion can generally be created using the `devtools/onion` CLI tool, or the **createonion** RPC command." + ] + }, + "first_hop": { + "type": "object", + "description": [ + "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*." + ], + "required": [ + "id", + "amount_msat", + "delay" + ], + "properties": { + "id": { + "type": "pubkey", + "description": [ + "Node id for the peer. Use any available channel available to this peer." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount to add an HTLC for millisatoshis." + ] + }, + "delay": { + "type": "u16", + "description": [ + "The number of blocks delay of blocks on top of the current blockheight." + ] + } + } + }, + "payment_hash": { + "type": "hash", + "description": [ + "Specifies the 32 byte hex-encoded hash to use as a challenge to the HTLC that we are sending. It is specific to the onion and has to match the one the onion was created with." + ] + }, + "label": { + "type": "string", + "description": [ + "Can be used to provide a human readable reference to retrieve the payment at a later time." + ] + }, + "shared_secrets": { + "type": "array", + "description": [ + "A JSON list of 32 byte hex-encoded secrets that were used when creating the onion. Core Lightning can send a payment with a custom onion without the knowledge of these secrets, however it will not be able to parse an eventual error message since that is encrypted with the shared secrets used in the onion. If *shared_secrets* is provided Core Lightning will decrypt the error, act accordingly, e.g., add a `channel_update` included in the error to its network view, and set the details in *listsendpays* correctly. If it is not provided Core Lightning will store the encrypted onion, and expose it in *listsendpays* allowing the caller to decrypt it externally. If it is not provided the Core Lightning node does not know how long the route is, which channels or nodes are involved, and what an eventual error could have been. It can therefore be used for oblivious payments." + ], + "items": { + "type": "secret" + } + }, + "partid": { + "type": "u16", + "description": [ + "If provided and non-zero, allows for multiple parallel partial payments with the same *payment_hash*." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "If provided, it will be returned in *waitsendpay* and *listsendpays* results." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Used to annotate the payment, and is returned by *waitsendpay* and *listsendpays*." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "If provided, it will be returned in **listpays** result." + ] + }, + "localinvreqid": { + "type": "hash", + "description": [ + "`localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7)." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." + ] + }, + "description": { + "added": "v0.11.0", + "type": "string", + "description": [ + "If provided, it will be returned in *waitsendpay* and *listsendpays* results." + ] + } + } + }, + "response": { + "required": [ + "created_index", + "id", + "payment_hash", + "status", + "created_at", + "amount_sent_msat" + ], + "properties": { + "created_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was created in." + ] + }, + "id": { + "type": "u64", + "description": [ + "Old synonym for created_index." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "pending", + "complete" + ], + "description": [ + "Status of the payment (could be complete if already sent previously)." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount delivered to destination (if known)." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment if known." + ] + }, + "created_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "The amount sent." + ] + }, + "label": { + "type": "string", + "description": [ + "The label, if given to sendpay." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string (if supplied)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string (if supplied: **experimental-offers** only)." + ] + }, + "partid": { + "type": "u64", + "description": [ + "The partid (if supplied) to sendonion/sendpay." + ] + } + }, + "allOf": [ + { + "if": { "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" - }, - "source": { + "status": { "type": "string", - "description": "source of configuration setting" + "enum": [ + "complete" + ] } } }, - "tor-service-password": { - "type": "object", + "then": { "additionalProperties": false, "required": [ - "value_str", - "source" + "payment_preimage" ], "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" + "created_index": {}, + "id": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "destination": {}, + "created_at": {}, + "groupid": {}, + "msatoshi_sent": {}, + "amount_sent_msat": {}, + "label": {}, + "bolt11": {}, + "bolt12": {}, + "partid": {}, + "updated_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was changed." + ] }, - "source": { - "type": "string", - "description": "source of configuration setting" + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash**." + ] } } - }, - "announce-addr-dns": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_bool", - "source" - ], + } + }, + { + "if": { "properties": { - "value_bool": { - "type": "boolean", - "description": "field from config or cmdline, or default" - }, - "source": { + "status": { "type": "string", - "description": "source of configuration setting" + "enum": [ + "pending" + ] } } }, - "require-confirmed-inputs": { - "type": "object", + "then": { "additionalProperties": false, - "required": [ - "value_bool", - "source" - ], + "required": [], "properties": { - "value_bool": { - "type": "boolean", - "description": "field from config or cmdline, or default" - }, - "source": { + "created_index": {}, + "id": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "destination": {}, + "created_at": {}, + "groupid": {}, + "msatoshi_sent": {}, + "amount_sent_msat": {}, + "label": {}, + "bolt11": {}, + "bolt12": {}, + "partid": {}, + "message": { "type": "string", - "description": "source of configuration setting" + "description": [ + "Monitor status with listpays or waitsendpay." + ] } } + } + } + ] + }, + "errors": [ + "The following error codes may occur:", + "", + "- 202: an parseable onion", + "", + "the error details are decrypted and presented here, if *shared_secrets* was provided and an error was returned by one of the intermediate nodes" + ], + "example_json_request": [ + { + "id": "example:sendonion#1", + "method": "sendonion", + "params": { + "onion": "00034928294556b10308f9aeac7a240223d4d5f72097db1ef36a36b10cab937f2f205ed7218b47d4600eaf7fd390940bf9a6cdac99aafdb4783c468150eeeab9b57e56a06778d023ffb3bb84c7d8c2ad8868b61c28b566634af52c288ed6569583db66f5bd0edfb801c252f078020e1df6359af5969296b4698a71d17c5ca6e5ee4b64b7cce3ad0a1aa31e6be4d5fe3a31fa7a25259c640716020a9a248ca3ebb68eb823f8884b5df3710969f4c2ffb153779a923bab946ed43c1f6658d7f8e7e25303bb78ef4862fb550b8b1c79d522b035eedfda9ab70a61322522acf7233bb8ea2423958448fc8ac3d000835fda04bf661f1bf2ad2d091f506840bb2f10f82c0812149d99267a47824defe90877ed70db526b2200e18dccb92b17516de3778c055645728eadf4c74375aa0aae80a7773a536a908ca1e25c0fdca90e50ce0be05eeb973ec5e83ce3ab6b35818e021780428af81320a694483c1c15f64e685ba1fd3b1e1b926e6b4ec9eeeac8aca60c60e0f0f583e35e7f081dc6f4c64157e100c79c4c25101bed77cd9f93416f9a67d9f1916a782c498c38365af4a5fabb1b745fa840a054a06564c3f4b376aeb72cdd059d3794c82bbbf12a1f62234016a6912b384e7e4cebbd39ee4395aeff43c461e226d1e0151cce508a181a9c61275bf4b89e4556cf24df13b993dec96541555f8b9a699be9488568a11ac7f25849da62765472511ad74a6660c10e37f5fa13d4e4665ef7825ae1f2da4a86d5581912262de89b4b11a722fd127b31aa0d7fab8c679b07bf95e65cb80b2dacb5b90794399fb8f23823f68058431aa1c399b5baceccaf8521d004f45dba6ec1fddc54473343e9e67cd50cc3f2f3d8a5dab8a7ab9ae553dc3cd34e74b858da75975265f7c673a25e8d01a5130ab40eaba712b80c608cd0431b4b45ea0d81af595e21f24976608429127bf586f7507666500bc7245cf9266fa0bd0e58404c496e190c873cd143ace9048e9d5021c23967a24e09f2e54166e54b4ee8888dc1af535624e7ee8b426c1628175017a9e8a73eb1d0d49028a4f4d77897f3c08f1cd7bdee2b00f9bb9eadc49a69bf4f6c0cb2c95a16f03d7958f1b8f83cb40ae87ddf75f26050e2c2ed9f8f8523b3d389a50b217bda651dc21f095fe7d2d3851a0a6cf01051f3f3c6f1ad59ed46d44928d15a0e6e1bd4df4c99bdb82a05b0e781b69a73bc30fe579c8ac9fe8aeb6beb1c0f44def2775b7341af37e6ef58ceb34958b29d3e36112b78644612228761b8badc802f0b2b8fcaeb1db8f3a8db4afa2d7b4540a7c331db6f5141fa3909a513df875ff8a63f5b542d662781ca96a69e3b2925d6a63555b2c5825ffb2ad848d71122f54110e0d203000f3e9cc23b793c3540dfb8d881caedd25055a8f495e9e7a0391dbf9cbd9344f7df659ee8d3ce5ec16217ab83e1394ba991eb8ffd9a869f8ebb2e2428845e779979c57b5f8875f502728229a55ce87b3eba85c75264d30eaf7b373f6b09ba3086d9e98348d87b049468c2c30a6501cb2a3862f1703bbf29895e8b4262353eae720ed8ae678750011e2eb51f4800d3f4725fa873d7deec1c46f77a5f61c73dc938239e77f432bcc245c7b935413c51c0bc92bdaae144452aa95910909e46e500557961203f4e1483b9c09c124464907825e1ff74c87c58d6e2e91970baac9b89a554beca6df9acee16d77dd929d0caa7797e06f2c384c03fdedc89c697b9c34787a50cf399a8d7f195e79b347efc8267c474a477ce210f11049d432b280eaf3fccd451f6218d35c64cbd1006bcc54eeea8b856855c9aa92bc3adc6900a7c7a0eee09834c5a1f2da3d8ea9a478aea90c954952ad2a72d3856350ac3132d17e1e8116fa774066a22c857a827699c98285111a405e74685a3ae579ae78c545774f45491e4935bf4", + "first_hop": { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "channel": "103x3x0", + "direction": 1, + "amount_msat": 1002, + "delay": 21, + "style": "tlv" }, - "commit-fee": { + "payment_hash": "f584c14bb23506acdd94cf3cea377f3cc5805f3cba5430bc3756ef83ede1a0dc", + "label": null, + "shared_secrets": null, + "partid": null, + "bolt11": null, + "amount_msat": null, + "destination": null + } + } + ], + "example_json_response": [ + { + "message": "Monitor status with listpays or waitsendpay", + "created_index": 1, + "id": 1, + "payment_hash": "f584c14bb23506acdd94cf3cea377f3cc5805f3cba5430bc3756ef83ede1a0dc", + "groupid": 1, + "amount_sent_msat": 1002, + "created_at": 1706315098, + "status": "pending" + } + ], + "author": [ + "Christian Decker <> is mainly responsible." + ], + "see_also": [ + "lightning-createonion(7)", + "lightning-sendpay(7)", + "lightning-listsendpays(7)" + ], + "resources": [ + "Main web site: ", + "", + "[bolt04]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md" + ] + }, + "lightning-sendonionmessage.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "sendonionmessage", + "title": "low-level command to send an onion message", + "warning": "experimental-onion-messages only", + "description": [ + "The **sendonionmessage** RPC command can be used to send a message via the lightning network. These are currently used by *offers* to request and receive invoices." + ], + "request": { + "required": [ + "first_id", + "blinding", + "hops" + ], + "properties": { + "first_id": { + "type": "pubkey", + "description": [ + "The (presumably well-known) public key of the start of the path." + ] + }, + "blinding": { + "type": "pubkey", + "description": [ + "Blinding factor for this path." + ] + }, + "hops": { + "type": "array", + "description": [ + "", + "" + ], + "items": { "type": "object", "additionalProperties": false, "required": [ - "value_int", - "source" + "node", + "tlv" ], "properties": { - "value_int": { - "type": "u64", - "description": "field from config or cmdline, or default" + "node": { + "type": "pubkey", + "description": [ + "Public key of the node." + ] }, - "source": { - "type": "string", - "description": "source of configuration setting" + "tlv": { + "type": "u8", + "description": [ + "Contains a hexadecimal TLV to include." + ] } } - }, - "commit-feerate-offset": { + } + } + } + }, + "response": { + "required": [], + "properties": {} + }, + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-fetchinvoice(7)", + "lightning-offer(7)" + ], + "resources": [ + "Main web site: ", + "", + "[bolt04]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md" + ] + }, + "lightning-sendpay.json": { + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "rpc": "sendpay", + "title": "Low-level command for sending a payment via a route", + "description": [ + "The **sendpay** RPC command attempts to send funds associated with the given *payment_hash*, along a route to the final destination in the route.", + "", + "Generally, a client would call lightning-getroute(7) to resolve a route, then use **sendpay** to send it. If it fails, it would call lightning-getroute(7) again to retry. If the route is empty, a payment-to-self is attempted.", + "", + "The response will occur when the payment is on its way to the destination. The **sendpay** RPC command does not wait for definite success or definite failure of the payment (except for already-succeeded payments, or to-self payments). Instead, use the **waitsendpay** RPC command to poll or wait for definite success or definite failure.", + "", + "Once a payment has succeeded, calls to **sendpay** with the same *payment_hash* but a different *amount_msat* or destination will fail; this prevents accidental multiple payments. Calls to **sendpay** with the same *payment_hash*, *amount_msat*, and destination as a previous successful payment (even if a different route or *partid*) will return immediately with success." + ], + "request": { + "required": [ + "route", + "payment_hash" + ], + "properties": { + "route": { + "type": "array", + "items": { "type": "object", - "additionalProperties": false, "required": [ - "value_int", - "source" + "amount_msat", + "id", + "delay", + "channel" ], "properties": { - "value_int": { + "id": { + "type": "pubkey", + "description": [ + "The node at the end of this hop." + ] + }, + "channel": { + "type": "short_channel_id", + "description": [ + "The channel joining these nodes." + ] + }, + "delay": { "type": "u32", - "description": "field from config or cmdline, or default" + "description": [ + "The total CLTV expected by the node at the end of this hop." + ] }, - "source": { - "type": "string", - "description": "source of configuration setting" + "amount_msat": { + "type": "msat", + "description": [ + "The amount expected by the node at the end of this hop." + ] } } } - } - }, - "# version": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "Special field indicating the current version" - }, - "plugins": { - "type": "array", - "deprecated": [ - "v23.08", - "v24.02" - ], - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "path", - "name" - ], - "description": "`plugin` field from config or cmdline", - "properties": { - "path": { - "type": "string", - "description": "Full path of the plugin" - }, - "name": { - "type": "string", - "description": "short name of the plugin" - }, - "options": { - "type": "object", - "additionalProperties": true, - "required": [], - "description": "Specific options set for this plugin", - "properties": {} - } - } - } - }, - "important-plugins": { - "type": "array", - "deprecated": [ - "v23.08", - "v24.02" - ], - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "path", - "name" - ], - "description": "`important-plugin` field from config or cmdline, or built-in", - "properties": { - "path": { - "type": "string", - "description": "Full path of the plugin" - }, - "name": { - "type": "string", - "description": "short name of the plugin" - }, - "options": { - "type": "object", - "additionalProperties": true, - "required": [], - "description": "Specific options set for this plugin", - "properties": {} - } - } - } - }, - "conf": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`conf` field from cmdline, or default" - }, - "lightning-dir": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`lightning-dir` field from config or cmdline, or default" - }, - "network": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`network` field from config or cmdline, or default" - }, - "allow-deprecated-apis": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`allow-deprecated-apis` field from config or cmdline, or default" - }, - "rpc-file": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`rpc-file` field from config or cmdline, or default" - }, - "disable-plugin": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "array", - "items": { + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the payment_preimage." + ] + }, + "label": { "type": "string", - "description": "`disable-plugin` field from config or cmdline" - } - }, - "bookkeeper-dir": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`bookkeeper-dir` field from config or cmdline, or default" - }, - "bookkeeper-db": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`bookkeeper-db` field from config or cmdline, or default" - }, - "always-use-proxy": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`always-use-proxy` field from config or cmdline, or default" - }, - "daemon": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`daemon` field from config or cmdline, or default" - }, - "wallet": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`wallet` field from config or cmdline default" - }, - "large-channels": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`large-channels` field from config or cmdline, or default" - }, - "experimental-dual-fund": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`experimental-dual-fund` field from config or cmdline, or default" - }, - "experimental-splicing": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`experimental-splicing` field from config or cmdline, or default" - }, - "experimental-onion-messages": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`experimental-onion-messages` field from config or cmdline, or default" - }, - "experimental-offers": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`experimental-offers` field from config or cmdline, or default" - }, - "experimental-shutdown-wrong-funding": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`experimental-shutdown-wrong-funding` field from config or cmdline, or default" - }, - "experimental-websocket-port": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u16", - "description": "`experimental-websocket-port` field from config or cmdline, or default" - }, - "experimental-peer-storage": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "added": "v23.02", - "description": "`experimental-peer-storage` field from config or cmdline, or default" - }, - "experimental-quiesce": { - "type": "boolean", - "added": "v23.08", - "deprecated": [ - "v23.08", - "v24.02" - ], - "description": "`experimental-quiesce` field from config or cmdline, or default" - }, - "experimental-upgrade-protocol": { - "type": "boolean", - "added": "v23.08", - "deprecated": [ - "v23.08", - "v24.02" - ], - "description": "`experimental-upgrade-protocol` field from config or cmdline, or default" - }, - "invoices-onchain-fallback": { - "type": "boolean", - "added": "v23.11", - "description": "`invoices-onchain-fallback` field from config or cmdline, or default" - }, - "database-upgrade": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`database-upgrade` field from config or cmdline" - }, - "rgb": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "hex", - "description": "`rgb` field from config or cmdline, or default", - "maxLength": 6, - "minLength": 6 - }, - "alias": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`alias` field from config or cmdline, or default" - }, - "pid-file": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`pid-file` field from config or cmdline, or default" - }, - "ignore-fee-limits": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`ignore-fee-limits` field from config or cmdline, or default" - }, - "watchtime-blocks": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": "`watchtime-blocks` field from config or cmdline, or default" - }, - "max-locktime-blocks": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": "`max-locktime-blocks` field from config or cmdline, or default" - }, - "funding-confirms": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": "`funding-confirms` field from config or cmdline, or default" - }, - "cltv-delta": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": "`cltv-delta` field from config or cmdline, or default" - }, - "cltv-final": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": "`cltv-final` field from config or cmdline, or default" - }, - "commit-time": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": "`commit-time` field from config or cmdline, or default" - }, - "fee-base": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": "`fee-base` field from config or cmdline, or default" - }, - "rescan": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "integer", - "description": "`rescan` field from config or cmdline, or default" - }, - "fee-per-satoshi": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": "`fee-per-satoshi` field from config or cmdline, or default" - }, - "max-concurrent-htlcs": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": "`max-concurrent-htlcs` field from config or cmdline, or default" - }, - "htlc-minimum-msat": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "msat", - "description": "`htlc-minimum-msat` field from config or cmdline, or default" - }, - "htlc-maximum-msat": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "msat", - "description": "`htlc-maximum-msat` field from config or cmdline, or default" - }, - "max-dust-htlc-exposure-msat": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "msat", - "description": "`max-dust-htlc-exposure-mast` field from config or cmdline, or default" - }, - "min-capacity-sat": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u64", - "description": "`min-capacity-sat` field from config or cmdline, or default" - }, - "addr": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`addr` field from config or cmdline (can be more than one)" - }, - "announce-addr": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`announce-addr` field from config or cmdline (can be more than one)" - }, - "bind-addr": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`bind-addr` field from config or cmdline (can be more than one)" - }, - "offline": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`true` if `offline` was set in config or cmdline" - }, - "autolisten": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`autolisten` field from config or cmdline, or default" - }, - "proxy": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`proxy` field from config or cmdline, or default" - }, - "disable-dns": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`true` if `disable-dns` was set in config or cmdline" - }, - "announce-addr-discovered": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`true`/`false`/`auto` depending on how `announce-addr-discovered` was set in config or cmdline", - "added": "v23.02" - }, - "announce-addr-discovered-port": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "integer", - "description": "Sets the announced TCP port for dynamically discovered IPs.", - "added": "v23.02" - }, - "encrypted-hsm": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`true` if `encrypted-hsm` was set in config or cmdline" - }, - "rpc-file-mode": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`rpc-file-mode` field from config or cmdline, or default" - }, - "log-level": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`log-level` field from config or cmdline, or default" - }, - "log-prefix": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`log-prefix` field from config or cmdline, or default" - }, - "log-file": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`log-file` field from config or cmdline, or default" - }, - "log-timestamps": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`log-timestamps` field from config or cmdline, or default" - }, - "force-feerates": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "force-feerate configuration setting, if any" - }, - "subdaemon": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`subdaemon` fields from config or cmdline if any (can be more than one)" - }, - "fetchinvoice-noconnect": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`fetchinvoice-noconnect` fields from config or cmdline, or default" - }, - "accept-htlc-tlv-types": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`accept-htlc-tlv-types` field from config or cmdline, or not present" - }, - "tor-service-password": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`tor-service-password` field from config or cmdline, if any" - }, - "dev-allowdustreserve": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "Whether we allow setting dust reserves" - }, - "announce-addr-dns": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "added": "v22.11.1", - "description": "Whether we put DNS entries into node_announcement" - }, - "require-confirmed-inputs": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "Request peers to only send confirmed inputs (dual-fund only)" - }, - "developer": { - "added": "v23.08", - "type": "boolean", - "description": "Whether developer mode is enabled" - }, - "commit-fee": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u64", - "added": "v23.05", - "description": "The percentage of the 6-block fee estimate to use for commitment transactions" - }, - "min-emergency-msat": { - "type": "msat", - "added": "v23.08", - "description": "field from config or cmdline, or default" - }, - "commit-feerate-offset": { - "type": "u32", - "added": "v23.11", - "description": "additional commitment feerate applied by channel owner" - } - } - }, - "listdatastore.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "key": { - "oneOf": [ - { - "type": "array", - "description": "all immediate children of the *key* (or root children) are returned.\t\tUsing the first element of the key as the plugin name (e.g. `[ 'summary' ]`) is recommended.\t\tAn array of values to form a hierarchy (though a single value is treated as a one-element array)", - "items": { - "type": "string" - } - }, - { - "type": "string" - } - ] - } - } - }, - "listdatastore.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "datastore" - ], - "properties": { - "datastore": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "key" + "description": [ + "The label provided when creating the invoice_request." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "Amount must be provided if *partid* is non-zero, or the payment is to-self, otherwise it must be equal to the final amount to the destination. it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*." ], - "properties": { - "key": { - "type": "array", - "items": { - "type": "string", - "description": "Part of the key added to the datastore" - } - }, - "generation": { - "type": "u64", - "description": "The number of times this has been updated" - }, - "hex": { - "type": "hex", - "description": "The hex data from the datastore" - }, - "string": { - "type": "string", - "description": "The data as a string, if it's valid utf-8" - } - } + "default": "in millisatoshi precision" + }, + "bolt11": { + "type": "string", + "description": [ + "Bolt11 invoice to pay. If provided, will be returned in *waitsendpay* and *listsendpays* results." + ] + }, + "payment_secret": { + "type": "secret", + "description": [ + "Value that the final recipient requires to accept the payment, as defined by the `payment_data` field in BOLT 4 and the `s` field in the BOLT 11 invoice format. It is required if *partid* is non-zero." + ] + }, + "partid": { + "type": "u64", + "description": [ + "Must not be provided for self-payments. If provided and non-zero, allows for multiple parallel partial payments with the same *payment_hash*. The *amount_msat* amount (which must be provided) for each **sendpay** with matching *payment_hash* must be equal, and **sendpay** will fail if there are differing values given." + ] + }, + "localinvreqid": { + "type": "hex", + "description": [ + "Indicates that this payment is being made for a local invoice_request. This ensures that we only send a payment for a single-use invoice_request once." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Allows you to attach a number which appears in **listsendpays** so payments can be identified as part of a logical group. The *pay* plugin uses this to identify one attempt at a MPP payment, for example." + ] + }, + "payment_metadata": { + "added": "v0.11.0", + "type": "hex", + "description": [ + "Placed in the final onion hop TLV." + ] + }, + "description": { + "added": "v0.11.0", + "type": "string", + "description": [ + "Description used in the invoice." + ] } } - } - }, - "listforwards.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "properties": { - "status": { - "type": "string", - "description": "if specified, then only the forwards with the given status are returned", - "enum": [ - "offered", - "settled", - "local_failed", - "failed" - ] - }, - "in_channel": { - "type": "short_channel_id", - "description": "only the matching forwards on the given inbound channel are returned" - }, - "out_channel": { - "type": "short_channel_id", - "description": "only the matching forwards on the given outbount channel are returned" - }, - "index": { - "type": "string", - "added": "v23.11", - "enum": [ - "created", - "updated" - ], - "description": "if neither *in_channel* nor *out_channel* is specified, it controls ordering. Defaults to `created`" - }, - "start": { - "type": "u64", - "added": "v23.11", - "description": "if `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)" - }, - "limit": { - "type": "u32", - "added": "v23.11", - "description": "if `index` is specified, `limit` can be used to specify the maximum number of entries to return" - } - } - }, - "listforwards.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "forwards" - ], - "properties": { - "forwards": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "created_index", - "in_channel", - "in_msat", - "status", - "received_time" + }, + "response": { + "required": [ + "id", + "created_index", + "payment_hash", + "status", + "created_at", + "amount_sent_msat" + ], + "properties": { + "created_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was created in." + ] + }, + "updated_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was changed (only present if it has changed since creation)." + ] + }, + "id": { + "type": "u64", + "description": [ + "Old synonym for created_index." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "pending", + "complete" ], - "properties": { - "created_index": { - "added": "v23.11", - "type": "u64", - "description": "1-based index indicating order this forward was created in" - }, - "in_channel": { - "type": "short_channel_id", - "description": "the channel that received the HTLC" - }, - "in_htlc_id": { - "type": "u64", - "description": "the unique HTLC id the sender gave this (not present if incoming channel was closed before ugprade to v22.11)" - }, - "in_msat": { - "type": "msat", - "description": "the value of the incoming HTLC" - }, - "status": { - "type": "string", - "enum": [ - "offered", - "settled", - "local_failed", - "failed" - ], - "description": "still ongoing, completed, failed locally, or failed after forwarding" - }, - "received_time": { - "type": "number", - "description": "the UNIX timestamp when this was received" - }, - "out_channel": { - "type": "short_channel_id", - "description": "the channel that the HTLC (trying to) forward to" - }, - "out_htlc_id": { - "type": "u64", - "description": "the unique HTLC id we gave this when sending (may be missing even if out_channel is present, for old forwards before v22.11)" - }, - "updated_index": { - "added": "v23.11", - "type": "u64", - "description": "1-based index indicating order this forward was changed (only present if it has changed since creation)" - }, - "style": { - "type": "string", - "enum": [ - "legacy", - "tlv" - ], - "description": "Either a legacy onion format or a modern tlv format" + "description": [ + "Status of the payment (could be complete if already sent previously)." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount delivered to destination (if known)." + ] + }, + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment if known." + ] + }, + "created_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "completed_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was completed." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "The amount sent." + ] + }, + "label": { + "type": "string", + "description": [ + "The *label*, if given to sendpay." + ] + }, + "partid": { + "type": "u64", + "description": [ + "The *partid*, if given to sendpay." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string (if supplied)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string (if supplied: **experimental-offers** only)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "complete" + ] + } } }, - "allOf": [ - { - "if": { - "required": [ - "out_msat" + "then": { + "additionalProperties": false, + "required": [ + "payment_preimage" + ], + "properties": { + "id": {}, + "created_index": {}, + "updated_index": {}, + "groupid": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "destination": {}, + "created_at": {}, + "completed_at": {}, + "msatoshi_sent": {}, + "amount_sent_msat": {}, + "label": {}, + "partid": {}, + "bolt11": {}, + "bolt12": {}, + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash**." ] - }, - "then": { - "additionalProperties": false, - "required": [ - "fee_msat", - "out_msat", - "out_channel" - ], - "properties": { - "created_index": {}, - "updated_index": {}, - "in_channel": {}, - "in_htlc_id": {}, - "in_msatoshi": {}, - "in_msat": {}, - "status": {}, - "style": {}, - "received_time": {}, - "resolved_time": {}, - "out_channel": {}, - "out_htlc_id": {}, - "failcode": {}, - "failreason": {}, - "fee_msat": { - "type": "msat", - "description": "the amount this paid in fees" - }, - "out_msat": { - "type": "msat", - "description": "the amount we sent out the *out_channel*" - } - } - }, - "else": { - "additionalProperties": false, - "required": [], - "properties": { - "created_index": {}, - "updated_index": {}, - "in_channel": {}, - "in_htlc_id": {}, - "in_msatoshi": {}, - "in_msat": {}, - "status": {}, - "style": {}, - "received_time": {}, - "resolved_time": {}, - "failcode": {}, - "failreason": {}, - "out_channel": {} - } - } - }, - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "settled", - "failed" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "resolved_time" - ], - "properties": { - "created_index": {}, - "updated_index": {}, - "in_channel": {}, - "in_htlc_id": {}, - "in_msatoshi": {}, - "in_msat": {}, - "status": {}, - "style": {}, - "received_time": {}, - "out_channel": {}, - "out_htlc_id": {}, - "fee": {}, - "fee_msat": {}, - "out_msatoshi": {}, - "out_msat": {}, - "failcode": {}, - "failreason": {}, - "resolved_time": { - "type": "number", - "description": "the UNIX timestamp when this was resolved" - } - } - }, - "else": { - "additionalProperties": false, - "properties": { - "created_index": {}, - "updated_index": {}, - "in_channel": {}, - "in_htlc_id": {}, - "in_msatoshi": {}, - "in_msat": {}, - "status": {}, - "style": {}, - "received_time": {}, - "out_channel": {}, - "out_htlc_id": {}, - "fee": {}, - "fee_msat": {}, - "failcode": {}, - "failreason": {}, - "out_msatoshi": {}, - "out_msat": {} - } - } - }, - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "local_failed", - "failed" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [], - "properties": { - "created_index": {}, - "updated_index": {}, - "in_channel": {}, - "in_htlc_id": {}, - "in_msatoshi": {}, - "in_msat": {}, - "status": {}, - "style": {}, - "received_time": {}, - "out_channel": {}, - "out_htlc_id": {}, - "fee": {}, - "fee_msat": {}, - "out_msatoshi": {}, - "out_msat": {}, - "resolved_time": {}, - "failcode": { - "type": "u32", - "description": "the numeric onion code returned" - }, - "failreason": { - "type": "string", - "description": "the name of the onion code returned" - } - } - }, - "else": { - "additionalProperties": false, - "required": [], - "properties": { - "created_index": {}, - "updated_index": {}, - "in_channel": {}, - "in_htlc_id": {}, - "in_msatoshi": {}, - "in_msat": {}, - "status": {}, - "style": {}, - "received_time": {}, - "out_channel": {}, - "out_htlc_id": {}, - "fee": {}, - "fee_msat": {}, - "out_msatoshi": {}, - "out_msat": {}, - "resolved_time": {} - } } } - ] - } - } - } - }, - "listfunds.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": { - "spent": { - "type": "boolean", - "description": "if True, then the *outputs* will include spent outputs in addition to the unspent ones. Default is False" - } - } - }, - "listfunds.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "outputs", - "channels" - ], - "properties": { - "outputs": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "txid", - "output", - "amount_msat", - "scriptpubkey", - "status", - "reserved" - ], - "properties": { - "txid": { - "type": "txid", - "description": "the ID of the spendable transaction" - }, - "output": { - "type": "u32", - "description": "the index within *txid*" - }, - "amount_msat": { - "type": "msat", - "description": "the amount of the output" - }, - "scriptpubkey": { - "type": "hex", - "description": "the scriptPubkey of the output" - }, - "address": { - "type": "string", - "description": "the bitcoin address of the output" - }, - "redeemscript": { - "type": "hex", - "description": "the redeemscript, only if it's p2sh-wrapped" - }, - "status": { - "type": "string", - "enum": [ - "unconfirmed", - "confirmed", - "spent", - "immature" - ] - }, - "reserved": { - "type": "boolean", - "description": "whether this UTXO is currently reserved for an in-flight tx" + } + }, + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "pending" + ] + } } }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "confirmed" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "blockheight" - ], - "properties": { - "txid": {}, - "output": {}, - "amount_msat": {}, - "scriptpubkey": {}, - "address": {}, - "value": {}, - "redeemscript": {}, - "status": {}, - "reserved": {}, - "reserved_to_block": {}, - "blockheight": { - "type": "u32", - "description": "Block height where it was confirmed" - } - } + "then": { + "additionalProperties": false, + "required": [ + "message" + ], + "properties": { + "id": {}, + "created_index": {}, + "updated_index": {}, + "groupid": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "destination": {}, + "created_at": {}, + "completed_at": {}, + "msatoshi_sent": {}, + "amount_sent_msat": {}, + "label": {}, + "partid": {}, + "bolt11": {}, + "bolt12": {}, + "message": { + "type": "string", + "description": [ + "Monitor status with listpays or waitsendpay." + ] } - }, + } + } + } + ] + }, + "errors": [ + "On error, if the error occurred from a node other than the final destination, the route table will be updated so that lightning-getroute(7) should return an alternate route (if any). An error from the final destination implies the payment should not be retried.", + "", + "- -1: Catchall nonspecific error.", + "- 201: Already paid with this *hash* using different amount or destination.", + "- 202: Unparseable onion reply. The *data* field of the error will have an *onionreply* field, a hex string representation of the raw onion reply.", + "- 203: Permanent failure at destination. The *data* field of the error will be routing failure object.", + "- 204: Failure along route; retry a different route. The *data* field of the error will be routing failure object.", + "- 212: *localinvreqid* refers to an invalid, or used, local invoice_request.", + "", + "A routing failure object has the fields below:", + "", + "*erring_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on.", + "*erring_node*: The hex string of the pubkey id of the node that reported the error.", + "*erring_channel*: The short channel ID of the channel that has the error, or *0:0:0* if the destination node raised the error. In addition *erring_direction* will indicate which direction of the channel caused the failure.", + "*failcode*: The failure code, as per BOLT #4.", + "*channel_update*: The hex string of the *channel_update* message received from the remote node. Only present if error is from the remote node and the *failcode* has the UPDATE bit set, as per BOLT #4." + ], + "example_json_request": [ + { + "id": "example:sendpay#1", + "method": "sendpay", + "params": { + "route": [ { - "if": { - "properties": { - "reserved": { - "type": "boolean", - "enum": [ - "true" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "reserved_to_block" - ], - "properties": { - "txid": {}, - "output": {}, - "amount_msat": {}, - "scriptpubkey": {}, - "address": {}, - "value": {}, - "redeemscript": {}, - "status": {}, - "blockheight": {}, - "reserved": {}, - "reserved_to_block": { - "type": "u32", - "description": "Block height where reservation will expire" - } - } - } + "amount_msat": 11000000, + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "delay": 5, + "channel": "103x1x0" } - ] + ], + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "label": null, + "amount_msat": null, + "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk", + "payment_secret": "82644944d3f70d42aad1d5f7b5d7a629e7afa30b529cc952a4c59fc0e3790ea2", + "partid": null, + "groupid": null, + "payment_metadata": null } }, - "channels": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "peer_id", - "our_amount_msat", - "amount_msat", - "funding_txid", - "funding_output", - "connected", - "state", - "channel_id" - ], - "properties": { - "peer_id": { - "type": "pubkey", - "description": "the peer with which the channel is opened" - }, - "our_amount_msat": { - "type": "msat", - "description": "available satoshis on our node's end of the channel" - }, - "amount_msat": { - "type": "msat", - "description": "total channel value" - }, - "funding_txid": { - "type": "txid", - "description": "funding transaction id" - }, - "funding_output": { - "type": "u32", - "description": "the 0-based index of the output in the funding transaction" - }, - "connected": { - "type": "boolean", - "description": "whether the channel peer is connected" - }, - "state": { - "type": "string", - "enum": [ - "OPENINGD", - "CHANNELD_AWAITING_LOCKIN", - "CHANNELD_NORMAL", - "CHANNELD_SHUTTING_DOWN", - "CLOSINGD_SIGEXCHANGE", - "CLOSINGD_COMPLETE", - "AWAITING_UNILATERAL", - "FUNDING_SPEND_SEEN", - "ONCHAIN", - "DUALOPEND_OPEN_INIT", - "DUALOPEND_AWAITING_LOCKIN", - "DUALOPEND_OPEN_COMMITTED", - "DUALOPEND_OPEN_COMMIT_READY" - ], - "description": "the channel state, in particular \"CHANNELD_NORMAL\" means the channel can be used normally" + { + "id": "example:sendpay#2", + "method": "sendpay", + "params": { + "route": [ + { + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "channel": "103x1x0", + "direction": 1, + "amount_msat": 4211, + "style": "tlv", + "delay": 24 }, - "channel_id": { - "type": "hash", - "description": "The full channel_id (funding txid Xored with output number)", - "added": "v23.05" - } - }, - "allOf": [ { - "if": { - "properties": { - "state": { - "type": "string", - "enum": [ - "CHANNELD_NORMAL" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "short_channel_id" - ], - "properties": { - "peer_id": {}, - "our_amount_msat": {}, - "channel_sat": {}, - "amount_msat": {}, - "channel_total_sat": {}, - "funding_txid": {}, - "funding_output": {}, - "connected": {}, - "state": {}, - "channel_id": {}, - "short_channel_id": { - "type": "short_channel_id", - "description": "short channel id of channel" - } - } - } + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "channel": "105x1x0", + "direction": 0, + "amount_msat": 3710, + "style": "tlv", + "delay": 16 }, { - "if": { - "properties": { - "state": { - "type": "string", - "enum": [ - "CHANNELD_SHUTTING_DOWN", - "CLOSINGD_SIGEXCHANGE", - "CLOSINGD_COMPLETE", - "AWAITING_UNILATERAL", - "FUNDING_SPEND_SEEN", - "ONCHAIN" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [], - "properties": { - "peer_id": {}, - "our_amount_msat": {}, - "channel_sat": {}, - "amount_msat": {}, - "channel_total_sat": {}, - "funding_txid": {}, - "funding_output": {}, - "connected": {}, - "state": {}, - "channel_id": {}, - "short_channel_id": { - "type": "short_channel_id", - "description": "short channel id of channel (only if funding reached lockin depth before closing)" - } - } - } + "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "channel": "107x1x0", + "direction": 1, + "amount_msat": 3210, + "style": "tlv", + "delay": 8 } - ] - } - } - } - }, - "listhtlcs.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "properties": { - "id": { - "type": "string", - "description": "a short channel id (e.g. 1x2x3) or full 64-byte hex channel id, it will only list htlcs for that channel (which must be known)" - } - } - }, - "listhtlcs.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "htlcs" - ], - "properties": { - "htlcs": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "short_channel_id", - "id", - "expiry", - "direction", - "amount_msat", - "payment_hash", - "state" ], - "properties": { - "short_channel_id": { - "type": "short_channel_id", - "description": "the channel that contains/contained the HTLC" - }, - "id": { - "type": "u64", - "description": "the unique, incrementing HTLC id the creator gave this" - }, - "expiry": { - "type": "u32", - "description": "the block number where this HTLC expires/expired" - }, - "amount_msat": { - "type": "msat", - "description": "the value of the HTLC" - }, - "direction": { - "type": "string", - "enum": [ - "out", - "in" - ], - "description": "out if we offered this to the peer, in if they offered it" - }, - "payment_hash": { - "type": "hash", - "description": "payment hash sought by HTLC" - }, - "state": { - "type": "string", - "enum": [ - "SENT_ADD_HTLC", - "SENT_ADD_COMMIT", - "RCVD_ADD_REVOCATION", - "RCVD_ADD_ACK_COMMIT", - "SENT_ADD_ACK_REVOCATION", - "RCVD_REMOVE_HTLC", - "RCVD_REMOVE_COMMIT", - "SENT_REMOVE_REVOCATION", - "SENT_REMOVE_ACK_COMMIT", - "RCVD_REMOVE_ACK_REVOCATION", - "RCVD_ADD_HTLC", - "RCVD_ADD_COMMIT", - "SENT_ADD_REVOCATION", - "SENT_ADD_ACK_COMMIT", - "RCVD_ADD_ACK_REVOCATION", - "SENT_REMOVE_HTLC", - "SENT_REMOVE_COMMIT", - "RCVD_REMOVE_REVOCATION", - "RCVD_REMOVE_ACK_COMMIT", - "SENT_REMOVE_ACK_REVOCATION" - ], - "description": "The first 10 states are for `in`, the next 10 are for `out`." - } - } + "payment_hash": "bc747053329402620a26bdc187cd134cdb699130d85be499ecd24160aff04c5c", + "label": null, + "amount_msat": null, + "bolt11": null, + "payment_secret": "c36a2fe9aced78c06960e2f21b369ed03f0492c97e53ba3b662163bcdaf1d7fa", + "partid": null, + "groupid": null, + "payment_metadata": null } } - } - }, - "listinvoicerequests.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "added": "v22.11", - "properties": { - "invreq_id": { - "type": "string", - "description": "a specific invoice can be queried by providing the `invreq_id`, which is presented by lightning-invoicerequest(7), or can be calculated from a bolt12 invoice" + ], + "example_json_response": [ + { + "message": "Monitor status with listpays or waitsendpay", + "created_index": 1, + "id": 1, + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "groupid": 1, + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount_msat": 11000000, + "amount_sent_msat": 11000000, + "created_at": 1706152930, + "status": "pending", + "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk" }, - "active_only": { - "type": "boolean", - "description": "if it is *True* then only active invoice requests are returned. Default is *False*" + { + "message": "Monitor status with listpays or waitsendpay", + "created_index": 2, + "id": 2, + "payment_hash": "bc747053329402620a26bdc187cd134cdb699130d85be499ecd24160aff04c5c", + "groupid": 1, + "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "amount_msat": 3210, + "amount_sent_msat": 4211, + "created_at": 1708624260, + "status": "pending" } - } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listinvoice(7)", + "lightning-delinvoice(7)", + "lightning-getroute(7)", + "lightning-invoice(7)", + "lightning-pay(7)", + "lightning-waitsendpay(7)" + ], + "resources": [ + "Main web site: " + ] }, - "listinvoicerequests.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-sendpsbt.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "invoicerequests" + "rpc": "sendpsbt", + "title": "Command to finalize, extract and send a partially signed bitcoin transaction (PSBT).", + "description": [ + "The **sendpsbt** is a low-level RPC command which sends a fully-signed PSBT." ], - "properties": { - "invoicerequests": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "invreq_id", - "single_use", - "active", - "bolt12", - "used" + "request": { + "required": [ + "psbt" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "The fully signed psbt to be sent." + ] + }, + "reserve": { + "type": "u32", + "description": [ + "Number of blocks to increase reservation of any of our inputs by." ], - "properties": { - "invreq_id": { - "type": "hash", - "description": "the SHA256 hash of all invoice_request fields less than 160" - }, - "active": { - "type": "boolean", - "description": "whether the invoice_request is currently active" - }, - "single_use": { - "type": "boolean", - "description": "whether the invoice_request will become inactive after we pay an invoice for it" - }, - "bolt12": { - "type": "string", - "description": "the bolt12 string starting with lnr" - }, - "used": { - "type": "boolean", - "description": "whether the invoice_request has already been used" - }, - "label": { - "type": "string", - "description": "the label provided when creating the invoice_request" - } - } + "default": "72" } } - } - }, - "listinvoices.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "label": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ], - "description": "a label used a the creation of the invoice to get a specific invoice" - }, - "invstring": { - "type": "string", - "description": "the string value to query a specific invoice" - }, - "payment_hash": { - "type": "hex", - "description": "a payment_hash of the invoice to get the details of a specific invoice" - }, - "offer_id": { - "type": "string", - "description": "a local `offer_id` the invoice was issued for a specific invoice details" - }, - "index": { - "type": "string", - "added": "v23.08", - "enum": [ - "created", - "updated" - ], - "description": "if neither *in_channel* nor *out_channel* is specified, it controls ordering. Defaults to `created`" + }, + "response": { + "required": [ + "tx", + "txid" + ], + "properties": { + "tx": { + "type": "hex", + "description": [ + "The raw transaction which was sent." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The txid of the **tx**." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:sendpsbt#1", + "method": "sendpsbt", + "params": { + "psbt": "some_psbt" + } }, - "start": { - "type": "u64", - "added": "v23.08", - "description": "if `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)" + { + "id": "example:sendpsbt#2", + "method": "sendpsbt", + "params": { + "psbt": "cHNidP8BAM0CAAAABEV+dnFRINmyeHxi4Id0OrcuzI5au5/BlPtTfu7E2m3EAAAAAAD9////cv8oioDx+0NCEnjBSYtnwF0H4VR13j+bkyb5gOOQLUUBAAAAAP3///8ehOrKm7JEq6zflkp9+zmSwE1iPe1yh3KTXvk+om/legEAAAAA/f///2s31wNrI1UavMgjC1GyrOHNbxOm68KYa13WX/mGfmjcAQAAAAD9////AcEAPQAAAAAAFgAUyQltQ/QI6lJgICYsza18hRa5KoEAAAAAAAEAcQIAAAABTzfqjIqV1wPpqc/3/Cb+tMX5EDrLmnhb5BMNx3aB/hYAAAAAAP3///8CQEIPAAAAAAAWABR9CNmX36nN45+GhjqvD4LjLMMMg/+juSkBAAAAFgAUJB0adsMdjkacZWrLwyteqfOaTrRlAAAAAQEfQEIPAAAAAAAWABR9CNmX36nN45+GhjqvD4LjLMMMgyICA1p5u7tAbUvCjfBfpqhzKM+wKn4TdDvs3NHfz+BxwuAQRzBEAiBwFb9rA0nUVlIPGd2aaiRbJ+KH4MLM3Bu+f0JuXB/hwAIgT2rrIUG9gXBZoH9fcPjCnbbM1SR4GiLYGLeALB8yENoBIgYDWnm7u0BtS8KN8F+mqHMoz7AqfhN0O+zc0d/P4HHC4BAIfQjZlwAAAAAAAQBxAgAAAAGANpEFI+CgfALTim/MWsAa62g+EmFWrFrzBDBCmCB3MgAAAAAA/f///wKZKdgpAQAAABYAFB+xhfU1pgl9WIvDKzAHZp8UeNkzQEIPAAAAAAAWABQHHEnK0vQg88gF+fa5ilcmnLFBUGUAAAABAR9AQg8AAAAAABYAFAccScrS9CDzyAX59rmKVyacsUFQIgICXTcoCCnxhsuZXNzL8jirRWQBOTlzUTljJKNldd803f9HMEQCIDtx/kEoc4PHDDm4eX5SEOmuRGu7ShpEG7xKBbuD/NjiAiBYkIKod39dcBarCT7Dbchkuwx70tJhOxQSJi2EMioGrwEiBgJdNygIKfGGy5lc3MvyOKtFZAE5OXNROWMko2V13zTd/wgHHEnKAAAAAAABAHECAAAAAVHU7RCZylzRMdlMBJ2ba4XKxv0l7LdWVnPYS6mhkf60AAAAAAD9////Av5VbSkBAAAAFgAU0BhRKzRbIC6H+s6j86d6cMpTNNhAQg8AAAAAABYAFD1D0ia8wnAZreUtej3FKnrBvii4ZQAAAAEBH0BCDwAAAAAAFgAUPUPSJrzCcBmt5S16PcUqesG+KLgiAgKKWZFo08l968cbxm5icOzwVPMA2Igwm6BUcaSCF13ZMEcwRAIgNAeIVGvUj9MWM18am0dx3JtEf79iQMX7Rqz1tttes3ICIAtNCglUlvpSidAxc/xoiy9cA13bgimJx25G+eZXfYJeASIGAopZkWjTyX3rxxvGbmJw7PBU8wDYiDCboFRxpIIXXdkwCD1D0iYAAAAAAAEAcQIAAAABRX52cVEg2bJ4fGLgh3Q6ty7Mjlq7n8GU+1N+7sTabcQBAAAAAP3///8CMmGqKQEAAAAWABSxLq0p9YAKl+hX7pFc0K/X+PIWmUBCDwAAAAAAFgAUZhwjt5DdNJE3OvCx2L7Qh31c3iJlAAAAAQEfQEIPAAAAAAAWABRmHCO3kN00kTc68LHYvtCHfVzeIiICA/qclQheQrHlADzR9BgXjDDJbkrneVTKD8SMWIJv9OsORzBEAiBKABqNV7cF5DKhtd+m+ZEmWF21vBt2uBKnzeDuUFqvDwIgJc6+/6GQqIfz869kJpUFTAMYTeL2qWR6d28EQEOJgkMBIgYD+pyVCF5CseUAPNH0GBeMMMluSud5VMoPxIxYgm/06w4IZhwjtwAAAAAAAA==", + "reserve": null + } + } + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters or some error happened during the command process." + ], + "example_json_response": [ + { + "txid": "05985072bbe20747325e69a159fe08176cc1bbc96d25e8848edad2dddc1165d0", + "tx": "02000000027032912651fc25a3e0893acd5f9640598707e2dfef92143bb5a4020e335442800100000017160014a5f48b9aa3cb8ca6cc1040c11e386745bb4dc932ffffffffd229a4b4f78638ebcac10a68b0561585a5d6e4d3b769ad0a909e9b9afaeae24e00000000171600145c83da9b685f9142016c6f5eb5f98a45cfa6f686ffffffff01915a01000000000017a9143a4dfd59e781f9c3018e7d0a9b7a26d58f8d22bf8700000000" }, - "limit": { - "type": "u32", - "added": "v23.08", - "description": "if `index` is specified, `limit` can be used to specify the maximum number of entries to return" + { + "tx": "02000000000104457e76715120d9b2787c62e087743ab72ecc8e5abb9fc194fb537eeec4da6dc40000000000fdffffff72ff288a80f1fb43421278c1498b67c05d07e15475de3f9b9326f980e3902d450100000000fdffffff1e84eaca9bb244abacdf964a7dfb3992c04d623ded728772935ef93ea26fe57a0100000000fdffffff6b37d7036b23551abcc8230b51b2ace1cd6f13a6ebc2986b5dd65ff9867e68dc0100000000fdffffff01c1003d0000000000160014c9096d43f408ea526020262ccdad7c8516b92a810247304402207015bf6b0349d456520f19dd9a6a245b27e287e0c2ccdc1bbe7f426e5c1fe1c002204f6aeb2141bd817059a07f5f70f8c29db6ccd524781a22d818b7802c1f3210da0121035a79bbbb406d4bc28df05fa6a87328cfb02a7e13743becdcd1dfcfe071c2e0100247304402203b71fe41287383c70c39b8797e5210e9ae446bbb4a1a441bbc4a05bb83fcd8e20220589082a8777f5d7016ab093ec36dc864bb0c7bd2d2613b1412262d84322a06af0121025d37280829f186cb995cdccbf238ab45640139397351396324a36575df34ddff024730440220340788546bd48fd316335f1a9b4771dc9b447fbf6240c5fb46acf5b6db5eb37202200b4d0a095496fa5289d03173fc688b2f5c035ddb822989c76e46f9e6577d825e0121028a599168d3c97debc71bc66e6270ecf054f300d888309ba05471a482175dd9300247304402204a001a8d57b705e432a1b5dfa6f99126585db5bc1b76b812a7cde0ee505aaf0f022025cebeffa190a887f3f3af642695054c03184de2f6a9647a776f044043898243012103fa9c95085e42b1e5003cd1f418178c30c96e4ae77954ca0fc48c58826ff4eb0e00000000", + "txid": "43bb1c1bce6763ffe4d5df6b49f152f907f36f7849e55bb56075e2b256d17502" } - } + ], + "author": [ + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." + ], + "see_also": [ + "lightning-fundpsbt(7)", + "lightning-signpsbt(7)", + "lightning-listtransactions(7)" + ], + "resources": [ + "Main web site: " + ] }, - "listinvoices.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-setchannel.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "invoices" + "rpc": "setchannel", + "title": "Command for configuring fees / htlc range advertized for a channel", + "description": [ + "The **setchannel** RPC command sets channel specific routing fees, and `htlc_minimum_msat` or `htlc_maximum_msat` as defined in BOLT #7. The channel has to be in normal or awaiting state. This can be checked by **listpeers** reporting a *state* of CHANNELD_NORMAL or CHANNELD_AWAITING_LOCKIN for the channel.", + "", + "These changes (for a public channel) will be broadcast to the rest of the network (though many nodes limit the rate of such changes they will accept: we allow 2 a day, with a few extra occasionally)." ], - "properties": { - "invoices": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "label", - "created_index", - "payment_hash", - "status", - "expires_at" + "request": { + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string", + "description": [ + "Should contain a scid (short channel ID), channel id or peerid (pubkey) of the channel to be modified. If *id* is set to `all`, the updates are applied to all channels in states CHANNELD_NORMAL CHANNELD_AWAITING_LOCKIN or DUALOPEND_AWAITING_LOCKIN. If *id* is a peerid, all channels with the +peer in those states are changed." + ] + }, + "feebase": { + "type": "msat", + "description": [ + "Value in millisatoshi that is added as base fee to any routed payment: if omitted, it is unchanged. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*." + ] + }, + "feeppm": { + "type": "u32", + "description": [ + "Value that is added proportionally per-millionths to any routed payment volume in satoshi. For example, if ppm is 1,000 and 1,000,000 satoshi is being routed through the channel, an proportional fee of 1,000 satoshi is added, resulting in a 0.1% fee." + ] + }, + "htlcmin": { + "type": "msat", + "description": [ + "Value that limits how small an HTLC we will forward: if omitted, it is unchanged. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. Note that the peer also enforces a minimum for the channel: setting it below that will simply set it to that value with a warning. Also note that *htlcmin* only applies to forwarded HTLCs: we can still send smaller payments ourselves." ], - "properties": { - "label": { - "type": "string", - "description": "unique label supplied at invoice creation" - }, - "description": { - "type": "string", - "description": "description used in the invoice" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "status": { - "type": "string", - "enum": [ - "unpaid", - "paid", - "expired" - ], - "description": "Whether it's paid, unpaid or unpayable" - }, - "expires_at": { - "type": "u64", - "description": "UNIX timestamp of when it will become / became unpayable" - }, - "amount_msat": { - "type": "msat", - "description": "the amount required to pay this invoice" - }, - "bolt11": { - "type": "string", - "description": "the BOLT11 string (always present unless *bolt12* is)" - }, - "bolt12": { - "type": "string", - "description": "the BOLT12 string (always present unless *bolt11* is)" - }, - "local_offer_id": { - "type": "hash", - "description": "the *id* of our offer which created this invoice (**experimental-offers** only)." - }, - "invreq_payer_note": { - "type": "string", - "description": "the optional *invreq_payer_note* from invoice_request which created this invoice (**experimental-offers** only)." - }, - "created_index": { - "type": "u64", - "added": "v23.08", - "description": "1-based index indicating order this invoice was created in" - }, - "updated_index": { - "type": "u64", - "added": "v23.08", - "description": "1-based index indicating order this invoice was changed (only present if it has changed since creation)" - } - }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "paid" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "pay_index", - "amount_received_msat", - "paid_at", - "payment_preimage" - ], - "properties": { - "label": {}, - "description": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "bolt11": {}, - "bolt12": {}, - "local_offer_id": {}, - "invreq_payer_note": {}, - "expires_at": {}, - "created_index": {}, - "updated_index": {}, - "pay_index": { - "type": "u64", - "description": "Unique incrementing index for this payment" - }, - "amount_received_msat": { - "type": "msat", - "description": "the amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)" - }, - "paid_at": { - "type": "u64", - "description": "UNIX timestamp of when it was paid" - }, - "paid_outpoint": { - "type": "object", - "description": "Outpoint this invoice was paid with", - "added": "v23.11", - "additionalProperties": false, - "required": [ - "txid", - "outnum" - ], - "properties": { - "txid": { - "added": "v23.11", - "type": "txid", - "description": "ID of the transaction that paid the invoice" - }, - "outnum": { - "added": "v23.11", - "type": "u32", - "description": "The 0-based output number of the transaction that paid the invoice" - } - } - }, - "payment_preimage": { - "type": "secret", - "description": "proof of payment" - } - } - }, - "else": { - "additionalProperties": false, - "properties": { - "label": {}, - "description": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "bolt11": {}, - "bolt12": {}, - "local_offer_id": {}, - "invreq_payer_note": {}, - "created_index": {}, - "updated_index": {}, - "expires_at": {} - } - } - } + "default": "no lower limit" + }, + "htlcmax": { + "type": "msat", + "description": [ + "Value that limits how large an HTLC we will forward: if omitted, it is unchanged. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. Note that *htlcmax* only applies to forwarded HTLCs: we can still send larger payments ourselves." + ], + "default": "no effective limit" + }, + "enforcedelay": { + "type": "u32", + "description": [ + "Number of seconds to delay before enforcing the new fees/htlc max. This gives the network a chance to catch up with the new rates and avoids rejecting HTLCs before they do. This only has an effect if rates are increased (we always allow users to overpay fees) or *htlcmax* is decreased, and only applied to a single rate increase per channel (we don't remember an arbitrary number of prior feerates) and if the node is restarted the updated configuration is enforced immediately." + ], + "default": "600, which is ten minutes" + }, + "ignorefeelimits": { + "added": "v23.08", + "type": "boolean", + "description": [ + "If set to True means to allow the peer to set the commitment transaction fees (or closing transaction fees) to any value they want. This is dangerous: they could set an exorbitant fee (so HTLCs are unenforcable), or a tiny fee (so that commitment transactions cannot be relayed), but avoids channel breakage in case of feerate disagreements. (Note: the global `ignore_fee_limits` setting overrides this)." ] } } - } - }, - "listnodes.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": { - "id": { - "type": "pubkey", - "description": "The public key of the node to list" - } - } - }, - "listnodes.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "nodes" - ], - "properties": { - "nodes": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "nodeid" + }, + "response": { + "required": [ + "channels" + ], + "properties": { + "channels": { + "type": "array", + "description": [ + "Channel(s) set, and their resulting configuration." ], - "properties": { - "nodeid": { - "type": "pubkey", - "description": "the public key of the node" - }, - "last_timestamp": { - "type": "u32", - "description": "A node_announcement has been received for this node (UNIX timestamp)" - } - }, - "allOf": [ - { - "if": { - "required": [ - "last_timestamp" + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "peer_id", + "channel_id", + "fee_base_msat", + "fee_proportional_millionths", + "minimum_htlc_out_msat", + "maximum_htlc_out_msat", + "ignore_fee_limits" + ], + "properties": { + "peer_id": { + "type": "pubkey", + "description": [ + "The node_id of the peer." ] }, - "then": { - "additionalProperties": false, - "required": [ - "nodeid", - "last_timestamp", - "alias", - "color", - "features", - "addresses" - ], - "properties": { - "nodeid": {}, - "last_timestamp": {}, - "option_will_fund": {}, - "alias": { - "type": "string", - "description": "The fun alias this node advertized", - "maxLength": 32 - }, - "color": { - "type": "hex", - "description": "The favorite RGB color this node advertized", - "minLength": 6, - "maxLength": 6 - }, - "features": { - "type": "hex", - "description": "BOLT #9 features bitmap this node advertized" - }, - "addresses": { - "type": "array", - "description": "The addresses this node advertized", - "items": { - "type": "object", - "required": [ - "type", - "port" - ], - "additionalProperties": true, - "properties": { - "type": { - "type": "string", - "enum": [ - "dns", - "ipv4", - "ipv6", - "torv2", - "torv3" - ], - "description": "Type of connection (until 23.08, `websocket` was also allowed)" - }, - "port": { - "type": "u16", - "description": "port number" - } - }, - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "dns", - "ipv4", - "ipv6", - "torv2", - "torv3" - ] - } - } - }, - "then": { - "required": [ - "type", - "address", - "port" - ], - "additionalProperties": false, - "properties": { - "type": {}, - "port": {}, - "address": { - "type": "string", - "description": "address in expected format for **type**" - } - } - }, - "else": { - "required": [ - "type", - "port" - ], - "additionalProperties": false, - "properties": { - "type": {}, - "port": {} - } - } - } - } - } + "channel_id": { + "type": "hash", + "description": [ + "The channel_id of the channel." + ] }, - "else": { - "additionalProperties": false, - "properties": { - "nodeid": {} - } - } - }, - { - "if": { - "required": [ - "option_will_fund" + "short_channel_id": { + "type": "short_channel_id", + "description": [ + "The short_channel_id (if locked in)." ] }, - "then": { - "additionalProperties": true, - "required": [ - "option_will_fund" - ], - "properties": { - "option_will_fund": { - "type": "object", - "additionalProperties": false, - "required": [ - "lease_fee_base_msat", - "lease_fee_basis", - "funding_weight", - "channel_fee_max_base_msat", - "channel_fee_max_proportional_thousandths", - "compact_lease" - ], - "properties": { - "lease_fee_base_msat": { - "type": "msat", - "description": "the fixed fee for a lease (whole number of satoshis)" - }, - "lease_fee_basis": { - "type": "u32", - "description": "the proportional fee in basis points (parts per 10,000) for a lease" - }, - "funding_weight": { - "type": "u32", - "description": "the onchain weight you'll have to pay for a lease" - }, - "channel_fee_max_base_msat": { - "type": "msat", - "description": "the maximum base routing fee this node will charge during the lease" - }, - "channel_fee_max_proportional_thousandths": { - "type": "u32", - "description": "the maximum proportional routing fee this node will charge during the lease (in thousandths, not millionths like channel_update)" - }, - "compact_lease": { - "type": "hex", - "description": "the lease as represented in the node_announcement" - } - } - } - } + "fee_base_msat": { + "type": "msat", + "description": [ + "The resulting feebase (this is the BOLT #7 name)." + ] + }, + "fee_proportional_millionths": { + "type": "u32", + "description": [ + "The resulting feeppm (this is the BOLT #7 name)." + ] + }, + "ignore_fee_limits": { + "type": "boolean", + "added": "v23.08", + "description": [ + "If we are now allowing peer to set feerate on commitment transaction without restriction." + ] + }, + "minimum_htlc_out_msat": { + "type": "msat", + "description": [ + "The resulting htlcmin we will advertize (the BOLT #7 name is htlc_minimum_msat)." + ] + }, + "warning_htlcmin_too_low": { + "type": "string", + "description": [ + "The requested htlcmin was too low for this peer, so we set it to the minimum they will allow." + ] + }, + "maximum_htlc_out_msat": { + "type": "msat", + "description": [ + "The resulting htlcmax we will advertize (the BOLT #7 name is htlc_maximum_msat)." + ] + }, + "warning_htlcmax_too_high": { + "type": "string", + "description": [ + "The requested htlcmax was greater than the channel capacity, so we set it to the channel capacity." + ] } } - ] + } } } - } - }, - "listoffers.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": { - "offer_id": { - "type": "hash", - "description": "Only return offers matching this ID" + }, + "errors": [ + "The following error codes may occur:", + "", + "- -1: Channel is in incorrect state, i.e. Catchall nonspecific error.", + "- -32602: JSONRPC2_INVALID_PARAMS, i.e. Given id is not a channel ID or short channel ID." + ], + "example_json_request": [ + { + "id": "example:setchannel#1", + "method": "setchannel", + "params": { + "id": "103x1x0", + "feebase": null, + "feeppm": null, + "htlcmin": null, + "htlcmax": null, + "enforcedelay": null, + "ignorefeelimits": true + } }, - "active_only": { - "type": "boolean", - "description": "f active_only is set and is true, only offers with active true are returned." + { + "id": "example:setchannel#2", + "method": "setchannel", + "params": { + "id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", + "feebase": 4000, + "feeppm": 300, + "htlcmin": null, + "htlcmax": null, + "enforcedelay": 0, + "ignorefeelimits": null + } } - } - }, - "listoffers.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "offers" ], - "properties": { - "offers": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "offer_id", - "active", - "single_use", - "bolt12", - "used" - ], - "properties": { - "offer_id": { - "type": "hash", - "description": "the id of this offer (merkle hash of non-signature fields)" - }, - "active": { - "type": "boolean", - "description": "whether this can still be used" - }, - "single_use": { - "type": "boolean", - "description": "whether this expires as soon as it's paid" - }, - "bolt12": { - "type": "string", - "description": "the bolt12 encoding of the offer" - }, - "used": { - "type": "boolean", - "description": "True if an associated invoice has been paid" - }, - "label": { - "type": "string", - "description": "the (optional) user-specified label" - } + "example_json_response": [ + { + "channels": [ + { + "peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "channel_id": "90210d39d12a65d239ece267c5f48e0a82e7cb95724e658f6d99f370064faad1", + "short_channel_id": "103x1x0", + "fee_base_msat": 1, + "fee_proportional_millionths": 10, + "minimum_htlc_out_msat": 0, + "maximum_htlc_out_msat": 990000000, + "ignore_fee_limits": true } - } - } - } - }, - "listpays.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": { - "bolt11": { - "type": "string", - "description": "bolt11 string to get the payment details" - }, - "payment_hash": { - "type": "hash", - "description": "payment hash to get the payment details" + ] }, - "status": { - "type": "string", - "description": "to filter the payment by status", - "enum": [ - "pending", - "complete", - "failed" + { + "channels": [ + { + "peer_id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", + "channel_id": "9c54c71bbbe59591cc3162e14fc4ff58c146f085c07d0f206ea679a8231d03ab", + "short_channel_id": "103x3x0", + "fee_base_msat": 4000, + "fee_proportional_millionths": 300, + "minimum_htlc_out_msat": 0, + "maximum_htlc_out_msat": 990000000, + "ignore_fee_limits": false + } ] } - } + ], + "author": [ + "Michael Schmoock <> is the author of this feature." + ], + "see_also": [ + "lightningd-config(5)", + "lightning-fundchannel(7)", + "lightning-listchannels(7)", + "lightning-listpeers(7)" + ], + "resources": [ + "Main web site: " + ] }, - "listpays.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-setconfig.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "pays" + "added": "v23.08", + "rpc": "setconfig", + "title": "Dynamically change some config options", + "description": [ + "The **setconfig** RPC command allows you set the (dynamic) configuration option named by `config`: options which take a value (as separate from simple flag options) also need a `val` parameter.", + "", + "This new value will *also* be written at the end of the config file, for persistence across restarts (and any old value commented out).", + "", + "You can see what options are dynamically adjustable using lightning- listconfigs(7). Note that you can also adjust existing options for stopped plugins; they will have an effect when the plugin is restarted." ], - "properties": { - "pays": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "payment_hash", - "status", - "created_at" - ], - "properties": { - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "status": { - "type": "string", - "enum": [ - "pending", - "failed", - "complete" - ], - "description": "status of the payment" - }, - "destination": { - "type": "pubkey", - "description": "the final destination of the payment if known" - }, - "created_at": { - "type": "u64", - "description": "the UNIX timestamp showing when this payment was initiated" - }, - "completed_at": { - "type": "u64", - "description": "the UNIX timestamp showing when this payment was completed" - }, - "label": { - "type": "string", - "description": "the label, if given to sendpay" - }, - "bolt11": { - "type": "string", - "description": "the bolt11 string (if pay supplied one)" - }, - "description": { - "type": "string", - "description": "the description matching the bolt11 description hash (if pay supplied one)" - }, - "bolt12": { - "type": "string", - "description": "the bolt12 string (if supplied for pay: **experimental-offers** only)." - } - }, - "allOf": [ + "request": { + "required": [ + "config" + ], + "properties": { + "config": { + "type": "string", + "description": [ + "Name of the config variable which should be set to the value of the variable." + ] + }, + "val": { + "oneOf": [ { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "complete" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "amount_sent_msat", - "preimage" - ], - "properties": { - "payment_hash": {}, - "status": {}, - "destination": {}, - "created_at": {}, - "completed_at": {}, - "label": {}, - "bolt11": {}, - "description": {}, - "bolt12": {}, - "amount_msat": { - "type": "msat", - "description": "The amount of millisatoshi we intended to send to the destination" - }, - "amount_sent_msat": { - "type": "msat", - "description": "The amount of millisatoshi we sent in order to pay (may include fees and not match amount_msat)" - }, - "preimage": { - "type": "secret", - "description": "proof of payment" - }, - "number_of_parts": { - "type": "u64", - "description": "the number of parts for a successful payment (only if more than one)." - } - } - } + "type": "string" }, { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "failed" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "amount_sent_msat" - ], - "properties": { - "payment_hash": {}, - "status": {}, - "destination": {}, - "created_at": {}, - "label": {}, - "bolt11": {}, - "description": {}, - "bolt12": {}, - "amount_sent_msat": {}, - "erroronion": { - "type": "hex", - "description": "the error onion returned on failure, if any." - } - } - } + "type": "integer" + }, + { + "type": "boolean" } + ], + "description": [ + "Value of the config variable to be set or updated." ] } } - } - }, - "listpeerchannels.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "added": "v23.02", - "properties": { - "id": { - "type": "pubkey", - "description": "If supplied, limits the channels to just the peer with the given ID, if it exists" - } - } - }, - "listpeerchannels.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "added": "v23.02", - "required": [ - "channels" - ], - "properties": { - "channels": { - "type": "array", - "items": { + }, + "response": { + "required": [ + "config" + ], + "properties": { + "config": { "type": "object", - "additionalProperties": true, + "description": [ + "Config settings after completion." + ], + "additionalProperties": false, "required": [ - "state", - "opener", - "features", - "peer_connected", - "peer_id" + "config", + "source", + "dynamic" ], "properties": { - "peer_id": { - "type": "pubkey", - "description": "Node Public key" - }, - "peer_connected": { - "type": "boolean", - "description": "A boolean flag that is set to true if the peer is online" - }, - "reestablished": {}, - "state": { - "type": "string", - "enum": [ - "OPENINGD", - "CHANNELD_AWAITING_LOCKIN", - "CHANNELD_NORMAL", - "CHANNELD_SHUTTING_DOWN", - "CLOSINGD_SIGEXCHANGE", - "CLOSINGD_COMPLETE", - "AWAITING_UNILATERAL", - "FUNDING_SPEND_SEEN", - "ONCHAIN", - "DUALOPEND_OPEN_INIT", - "DUALOPEND_AWAITING_LOCKIN", - "CHANNELD_AWAITING_SPLICE", - "DUALOPEND_OPEN_COMMITTED", - "DUALOPEND_OPEN_COMMIT_READY" - ], - "description": "the channel state, in particular \"CHANNELD_NORMAL\" means the channel can be used normally" - }, - "scratch_txid": { - "type": "txid", - "description": "The txid we would use if we went onchain now" - }, - "channel_type": { - "type": "object", - "description": "channel_type as negotiated with peer", - "added": "v23.05", - "additionalProperties": false, - "required": [ - "bits", - "names" - ], - "properties": { - "bits": { - "type": "array", - "description": "Each bit set in this channel_type", - "items": { - "type": "u32", - "description": "Bit number" - } - }, - "names": { - "type": "array", - "description": "Feature name for each bit set in this channel_type", - "items": { - "type": "string", - "enum": [ - "static_remotekey/even", - "anchor_outputs/even", - "anchors_zero_fee_htlc_tx/even", - "scid_alias/even", - "zeroconf/even" - ], - "description": "Name of feature bit" - } - } - } - }, - "updates": { - "type": "object", - "added": "v24.02", - "description": "Latest gossip updates sent/received", - "additionalProperties": false, - "required": [ - "local" - ], - "properties": { - "local": { - "type": "object", - "description": "Our gossip for channel", - "additionalProperties": false, - "added": "v24.02", - "required": [ - "htlc_minimum_msat", - "htlc_maximum_msat", - "cltv_expiry_delta", - "fee_base_msat", - "fee_proportional_millionths" - ], - "properties": { - "htlc_minimum_msat": { - "type": "msat", - "added": "v24.02", - "description": "Minimum msat amount we allow" - }, - "htlc_maximum_msat": { - "type": "msat", - "added": "v24.02", - "description": "Maximum msat amount we allow" - }, - "cltv_expiry_delta": { - "type": "u32", - "added": "v24.02", - "description": "Blocks delay required between incoming and outgoing HTLCs" - }, - "fee_base_msat": { - "type": "msat", - "added": "v24.02", - "description": "Amount we charge to use the channel" - }, - "fee_proportional_millionths": { - "type": "u32", - "added": "v24.02", - "description": "Amount we charge to use the channel in parts-per-million" - } - } - }, - "remote": { - "type": "object", - "added": "v24.02", - "description": "Peer's gossip for channel", - "additionalProperties": false, - "required": [ - "htlc_minimum_msat", - "htlc_maximum_msat", - "cltv_expiry_delta", - "fee_base_msat", - "fee_proportional_millionths" - ], - "properties": { - "htlc_minimum_msat": { - "type": "msat", - "added": "v24.02", - "description": "Minimum msat amount they allow" - }, - "htlc_maximum_msat": { - "type": "msat", - "added": "v24.02", - "description": "Maximum msat amount they allow" - }, - "cltv_expiry_delta": { - "type": "u32", - "added": "v24.02", - "description": "Blocks delay required between incoming and outgoing HTLCs" - }, - "fee_base_msat": { - "type": "msat", - "added": "v24.02", - "description": "Amount they charge to use the channel" - }, - "fee_proportional_millionths": { - "type": "u32", - "added": "v24.02", - "description": "Amount they charge to use the channel in parts-per-million" - } - } - } - } - }, - "ignore_fee_limits": { - "type": "boolean", - "added": "v23.08", - "description": "set if we allow this peer to set fees to anything they want" - }, - "lost_state": { - "type": "boolean", - "added": "v24.02", - "description": "set if we are fallen behind i.e. lost some channel state." - }, - "feerate": { - "type": "object", - "description": "Feerates for the current tx", - "additionalProperties": false, - "required": [ - "perkw", - "perkb" - ], - "properties": { - "perkw": { - "type": "u32", - "description": "Feerate per 1000 weight (i.e kSipa)" - }, - "perkb": { - "type": "u32", - "description": "Feerate per 1000 virtual bytes" - } - } - }, - "owner": { - "type": "string", - "description": "The current subdaemon controlling this connection" - }, - "short_channel_id": { - "type": "short_channel_id", - "description": "The short_channel_id (once locked in)" - }, - "channel_id": { - "type": "hash", - "description": "The full channel_id (funding txid Xored with output number)" - }, - "funding_txid": { - "type": "txid", - "description": "ID of the funding transaction" - }, - "funding_outnum": { - "type": "u32", - "description": "The 0-based output number of the funding transaction which opens the channel" - }, - "initial_feerate": { + "config": { "type": "string", - "description": "For inflight opens, the first feerate used to initiate the channel open" + "description": [ + "Name of the config variable which was set." + ] }, - "last_feerate": { + "source": { "type": "string", - "description": "For inflight opens, the most recent feerate used on the channel open" + "description": [ + "Source of configuration setting (`file`:`linenum`)." + ] }, - "next_feerate": { + "plugin": { "type": "string", - "description": "For inflight opens, the next feerate we'll use for the channel open" - }, - "next_fee_step": { - "type": "u32", - "description": "For inflight opens, the next feerate step we'll use for the channel open" - }, - "inflight": { - "type": "array", - "description": "Current candidate funding transactions", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "funding_txid", - "funding_outnum", - "feerate", - "total_funding_msat", - "splice_amount", - "our_funding_msat" - ], - "properties": { - "funding_txid": { - "type": "txid", - "description": "ID of the funding transaction" - }, - "funding_outnum": { - "type": "u32", - "description": "The 0-based output number of the funding transaction which opens the channel" - }, - "feerate": { - "type": "string", - "description": "The feerate for this funding transaction in per-1000-weight, with \"kpw\" appended" - }, - "total_funding_msat": { - "type": "msat", - "description": "total amount in the channel" - }, - "splice_amount": { - "type": "integer", - "added": "v23.08", - "description": "The amouont of sats we're splicing in or out" - }, - "our_funding_msat": { - "type": "msat", - "description": "amount we have in the channel" - }, - "scratch_txid": { - "type": "txid", - "description": "The commitment transaction txid we would use if we went onchain now" - } - } - } - }, - "close_to": { - "type": "hex", - "description": "scriptPubkey which we have to close to if we mutual close" + "description": [ + "The plugin this configuration setting is for." + ] }, - "private": { + "dynamic": { "type": "boolean", - "description": "if True, we will not announce this channel" - }, - "opener": { - "type": "string", "enum": [ - "local", - "remote" - ], - "description": "Who initiated the channel" - }, - "closer": { - "type": "string", - "enum": [ - "local", - "remote" - ], - "description": "Who initiated the channel close (only present if closing)" - }, - "features": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "option_static_remotekey", - "option_anchor_outputs", - "option_anchors_zero_fee_htlc_tx", - "option_scid_alias", - "option_zeroconf" - ], - "description": "BOLT #9 features which apply to this channel" - } - }, - "funding": { - "type": "object", - "additionalProperties": false, - "required": [ - "local_funds_msat", - "remote_funds_msat" + true ], - "properties": { - "pushed_msat": { - "type": "msat", - "description": "Amount pushed from opener to peer" - }, - "local_funds_msat": { - "type": "msat", - "description": "Amount of channel we funded" - }, - "remote_funds_msat": { - "type": "msat", - "description": "Amount of channel they funded" - }, - "fee_paid_msat": { - "type": "msat", - "description": "Amount we paid peer at open" - }, - "fee_rcvd_msat": { - "type": "msat", - "description": "Amount we were paid by peer at open" - } - } - }, - "to_us_msat": { - "type": "msat", - "description": "How much of channel is owed to us" - }, - "min_to_us_msat": { - "type": "msat", - "description": "Least amount owed to us ever. If the peer were to succesfully steal from us, this is the amount we would still retain." - }, - "max_to_us_msat": { - "type": "msat", - "description": "Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get." - }, - "total_msat": { - "type": "msat", - "description": "total amount in the channel" - }, - "fee_base_msat": { - "type": "msat", - "description": "amount we charge to use the channel" - }, - "fee_proportional_millionths": { - "type": "u32", - "description": "amount we charge to use the channel in parts-per-million" - }, - "dust_limit_msat": { - "type": "msat", - "description": "Minimum amount for an output on the channel transactions" - }, - "max_total_htlc_in_msat": { - "type": "msat", - "description": "Max amount accept in a single payment" - }, - "their_reserve_msat": { - "type": "msat", - "description": "Minimum we insist they keep in channel (default is 1% of the total channel capacity). If they have less than this in the channel, they cannot send to us on that channel" - }, - "our_reserve_msat": { - "type": "msat", - "description": "Minimum they insist we keep in channel. If you have less than this in the channel, you cannot send out via this channel." - }, - "spendable_msat": { - "type": "msat", - "description": "An estimate of the total we could send through channel (can be wrong because adding HTLCs requires an increase in fees paid to onchain miners, and onchain fees change dynamically according to onchain activity)" - }, - "receivable_msat": { - "type": "msat", - "description": "An estimate of the total peer could send through channel" - }, - "minimum_htlc_in_msat": { - "type": "msat", - "description": "The minimum amount HTLC we accept" - }, - "minimum_htlc_out_msat": { - "type": "msat", - "description": "The minimum amount HTLC we will send" - }, - "maximum_htlc_out_msat": { - "type": "msat", - "description": "The maximum amount HTLC we will send" - }, - "their_to_self_delay": { - "type": "u32", - "description": "The number of blocks before they can take their funds if they unilateral close" - }, - "our_to_self_delay": { - "type": "u32", - "description": "The number of blocks before we can take our funds if we unilateral close" - }, - "max_accepted_htlcs": { - "type": "u32", - "description": "Maximum number of incoming HTLC we will accept at once" - }, - "alias": { - "type": "object", - "required": [], - "properties": { - "local": { - "type": "short_channel_id", - "description": "An alias assigned by this node to this channel, used for outgoing payments" - }, - "remote": { - "type": "short_channel_id", - "description": "An alias assigned by the remote node to this channel, usable in routehints and invoices" - } - } - }, - "state_changes": { - "type": "array", - "description": "Prior state changes", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "timestamp", - "old_state", - "new_state", - "cause", - "message" - ], - "properties": { - "timestamp": { - "type": "string", - "description": "UTC timestamp of form YYYY-mm-ddTHH:MM:SS.%03dZ" - }, - "old_state": { - "type": "string", - "enum": [ - "OPENINGD", - "CHANNELD_AWAITING_LOCKIN", - "CHANNELD_NORMAL", - "CHANNELD_SHUTTING_DOWN", - "CLOSINGD_SIGEXCHANGE", - "CLOSINGD_COMPLETE", - "AWAITING_UNILATERAL", - "FUNDING_SPEND_SEEN", - "ONCHAIN", - "DUALOPEND_OPEN_INIT", - "DUALOPEND_AWAITING_LOCKIN", - "DUALOPEND_OPEN_COMMITTED", - "DUALOPEND_OPEN_COMMIT_READY", - "CHANNELD_AWAITING_SPLICE" - ], - "description": "Previous state" - }, - "new_state": { - "type": "string", - "enum": [ - "OPENINGD", - "CHANNELD_AWAITING_LOCKIN", - "CHANNELD_NORMAL", - "CHANNELD_SHUTTING_DOWN", - "CLOSINGD_SIGEXCHANGE", - "CLOSINGD_COMPLETE", - "AWAITING_UNILATERAL", - "FUNDING_SPEND_SEEN", - "ONCHAIN", - "DUALOPEND_OPEN_INIT", - "DUALOPEND_AWAITING_LOCKIN", - "DUALOPEND_OPEN_COMMITTED", - "DUALOPEND_OPEN_COMMIT_READY", - "CHANNELD_AWAITING_SPLICE" - ], - "description": "New state" - }, - "cause": { - "type": "string", - "enum": [ - "unknown", - "local", - "user", - "remote", - "protocol", - "onchain" - ], - "description": "What caused the change" - }, - "message": { - "type": "string", - "description": "Human-readable explanation" - } - } - } - }, - "status": { - "type": "array", - "items": { - "type": "string", - "description": "Billboard log of significant changes" - } - }, - "in_payments_offered": { - "type": "u64", - "description": "Number of incoming payment attempts" - }, - "in_offered_msat": { - "type": "msat", - "description": "Total amount of incoming payment attempts" - }, - "in_payments_fulfilled": { - "type": "u64", - "description": "Number of successful incoming payment attempts" - }, - "in_fulfilled_msat": { - "type": "msat", - "description": "Total amount of successful incoming payment attempts" - }, - "out_payments_offered": { - "type": "u64", - "description": "Number of outgoing payment attempts" + "description": [ + "Whether this option is settable via setconfig." + ] }, - "out_offered_msat": { - "type": "msat", - "description": "Total amount of outgoing payment attempts" + "set": { + "type": "boolean", + "description": [ + "For simple flag options." + ] }, - "out_payments_fulfilled": { - "type": "u64", - "description": "Number of successful outgoing payment attempts" + "value_str": { + "type": "string", + "description": [ + "For string options." + ] }, - "out_fulfilled_msat": { + "value_msat": { "type": "msat", - "description": "Total amount of successful outgoing payment attempts" - }, - "last_stable_connection": { - "type": "u64", - "added": "v24.02", - "description": "Last time we reestablished the open channel and stayed connected for 1 minute" - }, - "htlcs": { - "type": "array", - "description": "current HTLCs in this channel", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "direction", - "id", - "amount_msat", - "expiry", - "payment_hash", - "state" - ], - "properties": { - "direction": { - "type": "string", - "enum": [ - "in", - "out" - ], - "description": "Whether it came from peer, or is going to peer" - }, - "id": { - "type": "u64", - "description": "Unique ID for this htlc on this channel in this direction" - }, - "amount_msat": { - "type": "msat", - "description": "Amount send/received for this HTLC" - }, - "expiry": { - "type": "u32", - "description": "Block this HTLC expires at (after which an `in` direction HTLC will be returned to the peer, an `out` returned to us). If this expiry is too close, lightningd(8) will automatically unilaterally close the channel in order to enforce the timeout onchain." - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the payment_preimage which will prove payment" - }, - "local_trimmed": { - "type": "boolean", - "enum": [ - true - ], - "description": "If this is too small to enforce onchain; it doesn't appear in the commitment transaction and will not be enforced in a unilateral close. Generally true if the HTLC (after subtracting onchain fees) is below the `dust_limit_msat` for the channel." - }, - "status": { - "type": "string", - "description": "set if this HTLC is currently waiting on a hook (and shows what plugin)" - } - }, - "allOf": [ - { - "if": { - "properties": { - "direction": { - "enum": [ - "out" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "state" - ], - "properties": { - "direction": {}, - "id": {}, - "amount_msat": {}, - "msatoshi": {}, - "expiry": {}, - "payment_hash": {}, - "local_trimmed": {}, - "status": {}, - "alias": {}, - "peer_id": {}, - "peer_connected": {}, - "reestablished": {}, - "state": { - "type": "string", - "enum": [ - "SENT_ADD_HTLC", - "SENT_ADD_COMMIT", - "RCVD_ADD_REVOCATION", - "RCVD_ADD_ACK_COMMIT", - "SENT_ADD_ACK_REVOCATION", - "RCVD_REMOVE_HTLC", - "RCVD_REMOVE_COMMIT", - "SENT_REMOVE_REVOCATION", - "SENT_REMOVE_ACK_COMMIT", - "RCVD_REMOVE_ACK_REVOCATION" - ], - "description": "Status of the HTLC" - } - } - } - }, - { - "if": { - "properties": { - "direction": { - "enum": [ - "in" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "state" - ], - "properties": { - "direction": {}, - "id": {}, - "amount_msat": {}, - "msatoshi": {}, - "expiry": {}, - "payment_hash": {}, - "local_trimmed": {}, - "status": {}, - "peer_id": {}, - "peer_connected": {}, - "reestablished": {}, - "state": { - "type": "string", - "enum": [ - "RCVD_ADD_HTLC", - "RCVD_ADD_COMMIT", - "SENT_ADD_REVOCATION", - "SENT_ADD_ACK_COMMIT", - "RCVD_ADD_ACK_REVOCATION", - "SENT_REMOVE_HTLC", - "SENT_REMOVE_COMMIT", - "RCVD_REMOVE_REVOCATION", - "RCVD_REMOVE_ACK_COMMIT", - "SENT_REMOVE_ACK_REVOCATION" - ], - "description": "Status of the HTLC" - } - } - } - } - ] - } - } - }, - "allOf": [ - { - "if": { - "properties": { - "peer_connected": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "properties": { - "reestablished": { - "type": "boolean", - "description": "True if we have successfully exchanged reestablish messages this connection" - } - } - } - }, - { - "if": { - "required": [ - "close_to" - ] - }, - "then": { - "additionalProperties": false, - "required": [], - "properties": { - "state": {}, - "peer_id": {}, - "peer_connected": {}, - "reestablished": {}, - "scratch_txid": {}, - "channel_type": {}, - "feerate": {}, - "ignore_fee_limits": {}, - "lost_state": {}, - "owner": {}, - "short_channel_id": {}, - "channel_id": {}, - "updates": {}, - "funding_txid": {}, - "funding_outnum": {}, - "close_to": {}, - "private": {}, - "alias": {}, - "opener": {}, - "closer": {}, - "features": {}, - "funding": {}, - "to_us_msat": {}, - "min_to_us_msat": {}, - "max_to_us_msat": {}, - "total_msat": {}, - "fee_base_msat": {}, - "fee_proportional_millionths": {}, - "dust_limit_msat": {}, - "max_total_htlc_in_msat": {}, - "their_reserve_msat": {}, - "our_reserve_msat": {}, - "spendable_msat": {}, - "receivable_msat": {}, - "minimum_htlc_in_msat": {}, - "minimum_htlc_out_msat": {}, - "maximum_htlc_out_msat": {}, - "spendable_msatoshi": {}, - "receivable_msatoshi": {}, - "their_to_self_delay": {}, - "our_to_self_delay": {}, - "max_accepted_htlcs": {}, - "msatoshi_to_us": {}, - "msatoshi_to_us_min": {}, - "msatoshi_to_us_max": {}, - "msatoshi_total": {}, - "dust_limit_satoshis": {}, - "max_htlc_value_in_flight_msat": {}, - "our_channel_reserve_satoshis": {}, - "their_channel_reserve_satoshis": {}, - "spendable_satoshis": {}, - "receivable_satoshis": {}, - "htlc_minimum_msat": {}, - "state_changes": {}, - "status": {}, - "in_payments_offered": {}, - "in_offered_msat": {}, - "in_msatoshi_offered": {}, - "in_payments_fulfilled": {}, - "in_fulfilled_msat": {}, - "in_msatoshi_fulfilled": {}, - "out_payments_offered": {}, - "out_offered_msat": {}, - "out_msatoshi_offered": {}, - "out_payments_fulfilled": {}, - "out_fulfilled_msat": {}, - "out_msatoshi_fulfilled": {}, - "last_stable_connection": {}, - "htlcs": {}, - "initial_feerate": {}, - "last_feerate": {}, - "next_feerate": {}, - "inflight": {}, - "last_tx_fee_msat": {}, - "direction": {}, - "close_to_addr": { - "type": "string", - "description": "The bitcoin address we will close to (present if close_to_addr is a standardized address)" - } - } - } - }, - { - "if": { - "required": [ - "scratch_txid" - ] - }, - "then": { - "additionalProperties": false, - "required": [ - "last_tx_fee_msat" - ], - "properties": { - "state": {}, - "peer_id": {}, - "peer_connected": {}, - "reestablished": {}, - "alias": {}, - "scratch_txid": {}, - "channel_type": {}, - "feerate": {}, - "ignore_fee_limits": {}, - "lost_state": {}, - "owner": {}, - "short_channel_id": {}, - "channel_id": {}, - "updates": {}, - "funding_txid": {}, - "funding_outnum": {}, - "inflight": {}, - "close_to": {}, - "private": {}, - "opener": {}, - "closer": {}, - "features": {}, - "funding": {}, - "to_us_msat": {}, - "min_to_us_msat": {}, - "max_to_us_msat": {}, - "total_msat": {}, - "fee_base_msat": {}, - "fee_proportional_millionths": {}, - "dust_limit_msat": {}, - "max_total_htlc_in_msat": {}, - "their_reserve_msat": {}, - "our_reserve_msat": {}, - "spendable_msat": {}, - "receivable_msat": {}, - "minimum_htlc_in_msat": {}, - "minimum_htlc_out_msat": {}, - "maximum_htlc_out_msat": {}, - "spendable_msatoshi": {}, - "receivable_msatoshi": {}, - "their_to_self_delay": {}, - "our_to_self_delay": {}, - "max_accepted_htlcs": {}, - "msatoshi_to_us": {}, - "msatoshi_to_us_min": {}, - "msatoshi_to_us_max": {}, - "msatoshi_total": {}, - "dust_limit_satoshis": {}, - "max_htlc_value_in_flight_msat": {}, - "our_channel_reserve_satoshis": {}, - "their_channel_reserve_satoshis": {}, - "spendable_satoshis": {}, - "receivable_satoshis": {}, - "htlc_minimum_msat": {}, - "state_changes": {}, - "status": {}, - "in_payments_offered": {}, - "in_offered_msat": {}, - "in_msatoshi_offered": {}, - "in_payments_fulfilled": {}, - "in_fulfilled_msat": {}, - "in_msatoshi_fulfilled": {}, - "out_payments_offered": {}, - "out_offered_msat": {}, - "out_msatoshi_offered": {}, - "out_payments_fulfilled": {}, - "out_fulfilled_msat": {}, - "out_msatoshi_fulfilled": {}, - "last_stable_connection": {}, - "htlcs": {}, - "initial_feerate": {}, - "last_feerate": {}, - "next_feerate": {}, - "close_to_addr": {}, - "direction": {}, - "last_tx_fee_msat": { - "type": "msat", - "description": "fee attached to this the current tx" - } - } - } + "description": [ + "For msat options." + ] }, - { - "if": { - "required": [ - "short_channel_id" - ] - }, - "then": { - "additionalProperties": false, - "required": [ - "direction" - ], - "properties": { - "alias": {}, - "peer_id": {}, - "peer_connected": {}, - "reestablished": {}, - "state": {}, - "scratch_txid": {}, - "channel_type": {}, - "feerate": {}, - "ignore_fee_limits": {}, - "lost_state": {}, - "owner": {}, - "short_channel_id": {}, - "channel_id": {}, - "updates": {}, - "funding_txid": {}, - "funding_outnum": {}, - "inflight": {}, - "close_to": {}, - "private": {}, - "opener": {}, - "closer": {}, - "features": {}, - "funding": {}, - "to_us_msat": {}, - "min_to_us_msat": {}, - "max_to_us_msat": {}, - "total_msat": {}, - "fee_base_msat": {}, - "fee_proportional_millionths": {}, - "dust_limit_msat": {}, - "max_total_htlc_in_msat": {}, - "their_reserve_msat": {}, - "our_reserve_msat": {}, - "spendable_msat": {}, - "receivable_msat": {}, - "minimum_htlc_in_msat": {}, - "minimum_htlc_out_msat": {}, - "maximum_htlc_out_msat": {}, - "spendable_msatoshi": {}, - "receivable_msatoshi": {}, - "their_to_self_delay": {}, - "our_to_self_delay": {}, - "max_accepted_htlcs": {}, - "msatoshi_to_us": {}, - "msatoshi_to_us_min": {}, - "msatoshi_to_us_max": {}, - "msatoshi_total": {}, - "dust_limit_satoshis": {}, - "max_htlc_value_in_flight_msat": {}, - "our_channel_reserve_satoshis": {}, - "their_channel_reserve_satoshis": {}, - "spendable_satoshis": {}, - "receivable_satoshis": {}, - "htlc_minimum_msat": {}, - "state_changes": {}, - "status": {}, - "in_payments_offered": {}, - "in_offered_msat": {}, - "in_msatoshi_offered": {}, - "in_payments_fulfilled": {}, - "in_fulfilled_msat": {}, - "in_msatoshi_fulfilled": {}, - "out_payments_offered": {}, - "out_offered_msat": {}, - "out_msatoshi_offered": {}, - "out_payments_fulfilled": {}, - "out_fulfilled_msat": {}, - "out_msatoshi_fulfilled": {}, - "last_stable_connection": {}, - "htlcs": {}, - "initial_feerate": {}, - "last_feerate": {}, - "next_feerate": {}, - "close_to_addr": {}, - "last_tx_fee_msat": {}, - "direction": { - "type": "u32", - "description": "0 if we're the lesser node_id, 1 if we're the greater (as used in BOLT #7 channel_update)" - } - } - } + "value_int": { + "type": "integer", + "description": [ + "For integer options." + ] }, - { - "if": { - "required": [ - "inflight" - ] - }, - "then": { - "additionalProperties": false, - "required": [ - "initial_feerate", - "last_feerate", - "next_feerate" - ], - "properties": { - "state": {}, - "peer_id": {}, - "peer_connected": {}, - "reestablished": {}, - "scratch_txid": {}, - "channel_type": {}, - "feerate": {}, - "ignore_fee_limits": {}, - "lost_state": {}, - "owner": {}, - "alias": {}, - "short_channel_id": {}, - "channel_id": {}, - "updates": {}, - "funding_txid": {}, - "funding_outnum": {}, - "close_to": {}, - "private": {}, - "opener": {}, - "closer": {}, - "features": {}, - "funding": {}, - "to_us_msat": {}, - "min_to_us_msat": {}, - "max_to_us_msat": {}, - "total_msat": {}, - "fee_base_msat": {}, - "fee_proportional_millionths": {}, - "dust_limit_msat": {}, - "max_total_htlc_in_msat": {}, - "their_reserve_msat": {}, - "our_reserve_msat": {}, - "spendable_msat": {}, - "receivable_msat": {}, - "minimum_htlc_in_msat": {}, - "minimum_htlc_out_msat": {}, - "maximum_htlc_out_msat": {}, - "spendable_msatoshi": {}, - "receivable_msatoshi": {}, - "their_to_self_delay": {}, - "our_to_self_delay": {}, - "max_accepted_htlcs": {}, - "msatoshi_to_us": {}, - "msatoshi_to_us_min": {}, - "msatoshi_to_us_max": {}, - "msatoshi_total": {}, - "dust_limit_satoshis": {}, - "max_htlc_value_in_flight_msat": {}, - "our_channel_reserve_satoshis": {}, - "their_channel_reserve_satoshis": {}, - "spendable_satoshis": {}, - "receivable_satoshis": {}, - "htlc_minimum_msat": {}, - "state_changes": {}, - "status": {}, - "in_payments_offered": {}, - "in_offered_msat": {}, - "in_msatoshi_offered": {}, - "in_payments_fulfilled": {}, - "in_fulfilled_msat": {}, - "in_msatoshi_fulfilled": {}, - "out_payments_offered": {}, - "out_offered_msat": {}, - "out_msatoshi_offered": {}, - "out_payments_fulfilled": {}, - "out_fulfilled_msat": {}, - "out_msatoshi_fulfilled": {}, - "last_stable_connection": {}, - "htlcs": {}, - "inflight": {}, - "close_to_addr": {}, - "direction": {}, - "last_tx_fee_msat": {}, - "initial_feerate": { - "type": "string", - "description": "The feerate for the initial funding transaction in per-1000-weight, with \"kpw\" appended" - }, - "last_feerate": { - "type": "string", - "description": "The feerate for the latest funding transaction in per-1000-weight, with \"kpw\" appended" - }, - "next_feerate": { - "type": "string", - "description": "The minimum feerate for the next funding transaction in per-1000-weight, with \"kpw\" appended" - } - } - } + "value_bool": { + "type": "boolean", + "description": [ + "For boolean options." + ] } - ] + } + } + } + }, + "errors": [ + "The following error codes may occur:", + "", + "- -32602: JSONRPC2_INVALID_PARAMS, i.e. the parameter is not dynamic, or the val was invalid." + ], + "example_json_request": [ + { + "id": "example:setconfig#1", + "method": "setconfig", + "params": [ + "autoclean-paidinvoices-age", + 1 + ] + }, + { + "id": "example:setconfig#2", + "method": "setconfig", + "params": [ + "test-dynamic-config", + "changed" + ] + }, + { + "id": "example:setconfig#3", + "method": "setconfig", + "params": { + "config": "min-capacity-sat", + "val": 500000 + } + } + ], + "example_json_response": [ + { + "config": { + "config": "autoclean-paidinvoices-age", + "value_int": 1, + "source": "/tmp/ltests-7u_8_rtu/test_autoclean_1/lightning-3/regtest/config:6", + "plugin": "~/lightning/plugins/autoclean", + "dynamic": true + } + }, + { + "config": { + "config": "test-dynamic-config", + "value_str": "changed", + "source": "/tmp/ltests-7u_8_rtu/test_dynamic_option_python_plugin_1/lightning-1/regtest/config:2", + "plugin": "~/lightning/tests/plugins/dynamic_option.py", + "dynamic": true + } + }, + { + "config": { + "config": "min-capacity-sat", + "value_int": 500000, + "source": "/tmp/ltests-nvfdbou2/test_setconfig_1/lightning-2/regtest/config:2", + "dynamic": true } } - } + ], + "author": [ + "Rusty Russell <> is mainly responsible for this feature." + ], + "see_also": [ + "lightningd-config(5)", + "lightning-listconfigs(7)" + ], + "resources": [ + "Main web site: " + ] }, - "listpeers.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-setpsbtversion.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", - "required": [], "additionalProperties": false, - "properties": { - "id": { - "type": "pubkey", - "description": "if supplied, limits the result to just the peer with the given ID, if it exists" + "rpc": "setpsbtversion", + "title": "Command for setting PSBT version", + "description": [ + "The **setpsbtversion** RPC command converts the provided PSBT to the given version, and returns the base64 result of the conversion. Returns an error if version is invalid." + ], + "request": { + "required": [ + "psbt", + "version" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "The PSBT to change versions." + ] + }, + "version": { + "type": "u32", + "description": [ + "The version to set." + ] + } + } + }, + "response": { + "required": [ + "psbt" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "A converted PSBT of the requested version." + ] + } + } + }, + "example_json_request": [ + { + "id": "example:setpsbtversion#1", + "method": "setpsbtversion", + "params": { + "psbt": "cHNidP8BAAoCAAAAAAAAAAAAAA==", + "version": "2" + } }, - "level": { - "type": "string", - "description": "supplying level will show log entries related to that peer at the given log level", - "enum": [ - "io", - "debug", - "info", - "unusual" + { + "id": "example:setpsbtversion#2", + "method": "setpsbtversion", + "params": [ + "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIJd6ICNAQALFOMhoUHuSVSuzcaUdkDKlk4K+A+DR9+4uAA==", + 0 ] } - } + ], + "errors": [ + "The following error codes may occur:", + "", + "- -32602: Parameter missed or malformed." + ], + "example_json_response": [ + { + "psbt": "cHNidP8BAgQCAAAAAQQBAAEFAQABBgEDAfsEAgAAAAA=" + }, + { + "psbt": "cHNidP8BADUCAAAAAAFAQg8AAAAAACJRIJd6ICNAQALFOMhoUHuSVSuzcaUdkDKlk4K+A+DR9+4ubwAAAAAA" + } + ], + "author": [ + "Gregory Sanders <> is mainly responsible." + ], + "see_also": [ + "lightning-fundpsbt(7)", + "lightning-utxopsbt(7)", + "lightning-signpsbt(7)" + ], + "resources": [ + "Main web site: " + ] }, - "listpeers.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-showrunes.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "peers" + "added": "v23.08", + "rpc": "showrunes", + "title": "Command to list previously generated runes", + "description": [ + "The **showrunes** RPC command either lists runes that we stored as we generate them (see lightning-createrune(7)) or decodes the rune given on the command line." ], - "properties": { - "peers": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "id", - "connected", - "num_channels" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "the public key of the peer" - }, - "connected": { - "type": "boolean", - "description": "True if the peer is currently connected" - }, - "num_channels": { - "type": "u32", - "description": "The number of channels the peer has with this node", - "added": "v23.02" - }, - "log": { - "type": "array", - "description": "if *level* is specified, logs for this peer", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "SKIPPED", - "BROKEN", - "UNUSUAL", - "INFO", - "DEBUG", - "IO_IN", - "IO_OUT" - ] - } - }, - "allOf": [ - { - "if": { - "properties": { - "type": { - "enum": [ - "SKIPPED" - ] - } - } - }, - "then": { - "type": "object", - "additionalProperties": false, - "required": [ - "num_skipped" - ], - "properties": { - "type": {}, - "num_skipped": { - "type": "u32", - "description": "number of deleted/omitted entries" - } - } - } - }, - { - "if": { - "properties": { - "type": { - "enum": [ - "BROKEN", - "UNUSUAL", - "INFO", - "DEBUG" - ] - } - } - }, - "then": { - "type": "object", - "additionalProperties": false, - "required": [ - "time", - "source", - "log", - "node_id" - ], - "properties": { - "type": {}, - "time": { - "type": "string", - "description": "UNIX timestamp with 9 decimal places" - }, - "source": { - "type": "string", - "description": "The particular logbook this was found in" - }, - "log": { - "type": "string", - "description": "The actual log message" - }, - "node_id": { - "type": "pubkey", - "description": "The peer this is associated with" - } - } - } - }, - { - "if": { - "properties": { - "type": { - "enum": [ - "IO_IN", - "IO_OUT" - ] - } - } - }, - "then": { - "type": "object", - "additionalProperties": false, - "required": [ - "time", - "source", - "log", - "node_id", - "data" - ], - "properties": { - "type": {}, - "time": { - "type": "string", - "description": "UNIX timestamp with 9 decimal places" - }, - "source": { - "type": "string", - "description": "The particular logbook this was found in" - }, - "log": { - "type": "string", - "description": "The actual log message" - }, - "node_id": { - "type": "pubkey", - "description": "The peer this is associated with" - }, - "data": { - "type": "hex", - "description": "The IO which occurred" - } - } - } - } + "request": { + "required": [], + "properties": { + "rune": { + "type": "string", + "description": [ + "If specified, only details of that rune will be returned." + ] + } + } + }, + "response": { + "required": [ + "runes" + ], + "properties": { + "runes": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "rune", + "unique_id", + "restrictions", + "restrictions_as_english" + ], + "properties": { + "rune": { + "type": "string", + "description": [ + "Base64 encoded rune." ] - } - }, - "channels": { - "deprecated": [ - "v23.02", - "v24.02" - ], - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "state", - "opener", - "features" + }, + "unique_id": { + "type": "string", + "description": [ + "Unique id assigned when the rune was generated; this is always a u64 for commando runes." + ] + }, + "restrictions": { + "type": "array", + "description": [ + "The restrictions on what commands this rune can authorize." ], - "properties": { - "state": { - "type": "string", - "enum": [ - "OPENINGD", - "CHANNELD_AWAITING_LOCKIN", - "CHANNELD_NORMAL", - "CHANNELD_SHUTTING_DOWN", - "CLOSINGD_SIGEXCHANGE", - "CLOSINGD_COMPLETE", - "AWAITING_UNILATERAL", - "FUNDING_SPEND_SEEN", - "ONCHAIN", - "DUALOPEND_OPEN_INIT", - "DUALOPEND_AWAITING_LOCKIN", - "DUALOPEND_OPEN_COMMITTED", - "DUALOPEND_OPEN_COMMIT_READY" - ], - "description": "the channel state, in particular \"CHANNELD_NORMAL\" means the channel can be used normally" - }, - "scratch_txid": { - "type": "txid", - "description": "The txid we would use if we went onchain now" - }, - "feerate": { - "type": "object", - "description": "Feerates for the current tx", - "additionalProperties": false, - "required": [ - "perkw", - "perkb" - ], - "properties": { - "perkw": { - "type": "u32", - "description": "Feerate per 1000 weight (i.e kSipa)" - }, - "perkb": { - "type": "u32", - "description": "Feerate per 1000 virtual bytes" - } - } - }, - "owner": { - "type": "string", - "description": "The current subdaemon controlling this connection" - }, - "short_channel_id": { - "type": "short_channel_id", - "description": "The short_channel_id (once locked in)" - }, - "channel_id": { - "type": "hash", - "description": "The full channel_id", - "minLength": 64, - "maxLength": 64 - }, - "funding_txid": { - "type": "txid", - "description": "ID of the funding transaction" - }, - "funding_outnum": { - "type": "u32", - "description": "The 0-based output number of the funding transaction which opens the channel" - }, - "initial_feerate": { - "type": "string", - "description": "For inflight opens, the first feerate used to initiate the channel open" - }, - "last_feerate": { - "type": "string", - "description": "For inflight opens, the most recent feerate used on the channel open" - }, - "next_feerate": { - "type": "string", - "description": "For inflight opens, the next feerate we'll use for the channel open" - }, - "next_fee_step": { - "type": "u32", - "description": "For inflight opens, the next feerate step we'll use for the channel open" - }, - "inflight": { - "type": "array", - "description": "Current candidate funding transactions (only for dual-funding)", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "funding_txid", - "funding_outnum", - "feerate", - "total_funding_msat", - "our_funding_msat", - "splice_amount", - "scratch_txid" - ], - "properties": { - "funding_txid": { - "type": "txid", - "description": "ID of the funding transaction" - }, - "funding_outnum": { - "type": "u32", - "description": "The 0-based output number of the funding transaction which opens the channel" - }, - "feerate": { - "type": "string", - "description": "The feerate for this funding transaction in per-1000-weight, with \"kpw\" appended" - }, - "total_funding_msat": { - "type": "msat", - "description": "total amount in the channel" - }, - "our_funding_msat": { - "type": "msat", - "description": "amount we have in the channel" - }, - "splice_amount": { - "type": "integer", - "added": "v23.08", - "description": "The amouont of sats we're splicing in or out" - }, - "scratch_txid": { - "type": "txid", - "description": "The commitment transaction txid we would use if we went onchain now" - } - } - } - }, - "close_to": { - "type": "hex", - "description": "scriptPubkey which we have to close to if we mutual close" - }, - "private": { - "type": "boolean", - "description": "if True, we will not announce this channel" - }, - "opener": { - "type": "string", - "enum": [ - "local", - "remote" - ], - "description": "Who initiated the channel" - }, - "closer": { - "type": "string", - "enum": [ - "local", - "remote" - ], - "description": "Who initiated the channel close" - }, - "features": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "option_static_remotekey", - "option_anchor_outputs", - "option_scid_alias", - "option_zeroconf" - ], - "description": "BOLT #9 features which apply to this channel" - } - }, - "funding": { - "type": "object", - "additionalProperties": false, - "required": [ - "local_funds_msat", - "remote_funds_msat" - ], - "properties": { - "pushed_msat": { - "type": "msat", - "description": "Amount pushed from opener to peer" - }, - "local_funds_msat": { - "type": "msat", - "description": "Amount of channel we funded" - }, - "remote_funds_msat": { - "type": "msat", - "description": "Amount of channel they funded" - }, - "fee_paid_msat": { - "type": "msat", - "description": "Amount we paid peer at open" - }, - "fee_rcvd_msat": { - "type": "msat", - "description": "Amount we were paid by peer at open" - } - } - }, - "to_us_msat": { - "type": "msat", - "description": "how much of channel is owed to us" - }, - "min_to_us_msat": { - "type": "msat", - "description": "least amount owed to us ever" - }, - "max_to_us_msat": { - "type": "msat", - "description": "most amount owed to us ever" - }, - "total_msat": { - "type": "msat", - "description": "total amount in the channel" - }, - "fee_base_msat": { - "type": "msat", - "description": "amount we charge to use the channel" - }, - "fee_proportional_millionths": { - "type": "u32", - "description": "amount we charge to use the channel in parts-per-million" - }, - "dust_limit_msat": { - "type": "msat", - "description": "minimum amount for an output on the channel transactions" - }, - "max_total_htlc_in_msat": { - "type": "msat", - "description": "max amount accept in a single payment" - }, - "their_reserve_msat": { - "type": "msat", - "description": "minimum we insist they keep in channel" - }, - "our_reserve_msat": { - "type": "msat", - "description": "minimum they insist we keep in channel" - }, - "spendable_msat": { - "type": "msat", - "description": "total we could send through channel" - }, - "receivable_msat": { - "type": "msat", - "description": "total peer could send through channel" - }, - "minimum_htlc_in_msat": { - "type": "msat", - "description": "the minimum amount HTLC we accept" - }, - "minimum_htlc_out_msat": { - "type": "msat", - "description": "the minimum amount HTLC we will send" - }, - "maximum_htlc_out_msat": { - "type": "msat", - "description": "the maximum amount HTLC we will send" - }, - "their_to_self_delay": { - "type": "u32", - "description": "the number of blocks before they can take their funds if they unilateral close" - }, - "our_to_self_delay": { - "type": "u32", - "description": "the number of blocks before we can take our funds if we unilateral close" - }, - "max_accepted_htlcs": { - "type": "u32", - "description": "Maximum number of incoming HTLC we will accept at once" - }, - "alias": { - "type": "object", - "required": [], - "properties": { - "local": { - "type": "short_channel_id", - "description": "An alias assigned by this node to this channel, used for outgoing payments" - }, - "remote": { - "type": "short_channel_id", - "description": "An alias assigned by the remote node to this channel, usable in routehints and invoices" - } - } - }, - "state_changes": { - "type": "array", - "description": "Prior state changes", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "timestamp", - "old_state", - "new_state", - "cause", - "message" - ], - "properties": { - "timestamp": { - "type": "string", - "description": "UTC timestamp of form YYYY-mm-ddTHH:MM:SS.%03dZ" - }, - "old_state": { - "type": "string", - "enum": [ - "OPENINGD", - "CHANNELD_AWAITING_LOCKIN", - "CHANNELD_NORMAL", - "CHANNELD_SHUTTING_DOWN", - "CLOSINGD_SIGEXCHANGE", - "CLOSINGD_COMPLETE", - "AWAITING_UNILATERAL", - "FUNDING_SPEND_SEEN", - "ONCHAIN", - "DUALOPEND_OPEN_INIT", - "DUALOPEND_AWAITING_LOCKIN", - "DUALOPEND_OPEN_COMMITTED", - "DUALOPEND_OPEN_COMMIT_READY" - ], - "description": "Previous state" - }, - "new_state": { - "type": "string", - "enum": [ - "OPENINGD", - "CHANNELD_AWAITING_LOCKIN", - "CHANNELD_NORMAL", - "CHANNELD_SHUTTING_DOWN", - "CLOSINGD_SIGEXCHANGE", - "CLOSINGD_COMPLETE", - "AWAITING_UNILATERAL", - "FUNDING_SPEND_SEEN", - "ONCHAIN", - "DUALOPEND_OPEN_INIT", - "DUALOPEND_AWAITING_LOCKIN", - "DUALOPEND_OPEN_COMMITTED", - "DUALOPEND_OPEN_COMMIT_READY" - ], - "description": "New state" - }, - "cause": { - "type": "string", - "enum": [ - "unknown", - "local", - "user", - "remote", - "protocol", - "onchain" - ], - "description": "What caused the change" - }, - "message": { - "type": "string", - "description": "Human-readable explanation" - } - } - } - }, - "status": { - "type": "array", - "items": { - "type": "string", - "description": "Billboard log of significant changes" - } - }, - "in_payments_offered": { - "type": "u64", - "description": "Number of incoming payment attempts" - }, - "in_offered_msat": { - "type": "msat", - "description": "Total amount of incoming payment attempts" - }, - "in_payments_fulfilled": { - "type": "u64", - "description": "Number of successful incoming payment attempts" - }, - "in_fulfilled_msat": { - "type": "msat", - "description": "Total amount of successful incoming payment attempts" - }, - "out_payments_offered": { - "type": "u64", - "description": "Number of outgoing payment attempts" - }, - "out_offered_msat": { - "type": "msat", - "description": "Total amount of outgoing payment attempts" - }, - "out_payments_fulfilled": { - "type": "u64", - "description": "Number of successful outgoing payment attempts" - }, - "out_fulfilled_msat": { - "type": "msat", - "description": "Total amount of successful outgoing payment attempts" - }, - "htlcs": { - "type": "array", - "description": "current HTLCs in this channel", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "direction", - "id", - "amount_msat", - "expiry", - "payment_hash", - "state" - ], - "properties": { - "direction": { - "type": "string", - "enum": [ - "in", - "out" - ], - "description": "Whether it came from peer, or is going to peer" - }, - "id": { - "type": "u64", - "description": "Unique ID for this htlc on this channel in this direction" - }, - "amount_msat": { - "type": "msat", - "description": "Amount send/received for this HTLC" - }, - "expiry": { - "type": "u32", - "description": "Block this HTLC expires at" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the payment_preimage which will prove payment", - "maxLength": 64, - "minLength": 64 - }, - "local_trimmed": { - "type": "boolean", - "enum": [ - true - ], - "description": "if this is too small to enforce onchain" - }, - "status": { - "type": "string", - "description": "set if this HTLC is currently waiting on a hook (and shows what plugin)" - } - }, - "allOf": [ - { - "if": { - "properties": { - "direction": { - "enum": [ - "out" - ] - } - } + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "alternatives", + "english" + ], + "properties": { + "alternatives": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "fieldname", + "value", + "condition", + "english" + ], + "properties": { + "fieldname": { + "type": "string", + "description": [ + "The field this restriction applies to; see commando-rune(7)." + ] }, - "then": { - "additionalProperties": false, - "required": [ - "state" - ], - "properties": { - "direction": {}, - "id": {}, - "amount_msat": {}, - "msatoshi": {}, - "expiry": {}, - "payment_hash": {}, - "local_trimmed": {}, - "status": {}, - "alias": {}, - "state": { - "type": "string", - "enum": [ - "SENT_ADD_HTLC", - "SENT_ADD_COMMIT", - "RCVD_ADD_REVOCATION", - "RCVD_ADD_ACK_COMMIT", - "SENT_ADD_ACK_REVOCATION", - "RCVD_REMOVE_HTLC", - "RCVD_REMOVE_COMMIT", - "SENT_REMOVE_REVOCATION", - "SENT_REMOVE_ACK_COMMIT", - "RCVD_REMOVE_ACK_REVOCATION" - ], - "description": "Status of the HTLC" - } - } - } - }, - { - "if": { - "properties": { - "direction": { - "enum": [ - "in" - ] - } - } + "value": { + "type": "string", + "description": [ + "The value accepted for this field." + ] }, - "then": { - "additionalProperties": false, - "required": [ - "state" - ], - "properties": { - "direction": {}, - "id": {}, - "amount_msat": {}, - "msatoshi": {}, - "expiry": {}, - "payment_hash": {}, - "local_trimmed": {}, - "status": {}, - "state": { - "type": "string", - "enum": [ - "RCVD_ADD_HTLC", - "RCVD_ADD_COMMIT", - "SENT_ADD_REVOCATION", - "SENT_ADD_ACK_COMMIT", - "RCVD_ADD_ACK_REVOCATION", - "SENT_REMOVE_HTLC", - "SENT_REMOVE_COMMIT", - "RCVD_REMOVE_REVOCATION", - "RCVD_REMOVE_ACK_COMMIT", - "SENT_REMOVE_ACK_REVOCATION" - ], - "description": "Status of the HTLC" - } - } + "condition": { + "type": "string", + "description": [ + "The way to compare fieldname and value." + ] + }, + "english": { + "type": "string", + "description": [ + "English readable description of this alternative." + ] } } - ] - } - } - }, - "allOf": [ - { - "if": { - "required": [ - "close_to" - ] - }, - "then": { - "additionalProperties": false, - "required": [], - "properties": { - "state": {}, - "scratch_txid": {}, - "feerate": {}, - "owner": {}, - "short_channel_id": {}, - "channel_id": {}, - "funding_txid": {}, - "funding_outnum": {}, - "close_to": {}, - "private": {}, - "alias": {}, - "opener": {}, - "closer": {}, - "features": {}, - "funding": {}, - "to_us_msat": {}, - "min_to_us_msat": {}, - "max_to_us_msat": {}, - "total_msat": {}, - "fee_base_msat": {}, - "fee_proportional_millionths": {}, - "dust_limit_msat": {}, - "max_total_htlc_in_msat": {}, - "their_reserve_msat": {}, - "our_reserve_msat": {}, - "spendable_msat": {}, - "receivable_msat": {}, - "minimum_htlc_in_msat": {}, - "minimum_htlc_out_msat": {}, - "maximum_htlc_out_msat": {}, - "spendable_msatoshi": {}, - "receivable_msatoshi": {}, - "their_to_self_delay": {}, - "our_to_self_delay": {}, - "max_accepted_htlcs": {}, - "msatoshi_to_us": {}, - "msatoshi_to_us_min": {}, - "msatoshi_to_us_max": {}, - "msatoshi_total": {}, - "dust_limit_satoshis": {}, - "max_htlc_value_in_flight_msat": {}, - "our_channel_reserve_satoshis": {}, - "their_channel_reserve_satoshis": {}, - "spendable_satoshis": {}, - "receivable_satoshis": {}, - "htlc_minimum_msat": {}, - "state_changes": {}, - "status": {}, - "in_payments_offered": {}, - "in_offered_msat": {}, - "in_msatoshi_offered": {}, - "in_payments_fulfilled": {}, - "in_fulfilled_msat": {}, - "in_msatoshi_fulfilled": {}, - "out_payments_offered": {}, - "out_offered_msat": {}, - "out_msatoshi_offered": {}, - "out_payments_fulfilled": {}, - "out_fulfilled_msat": {}, - "out_msatoshi_fulfilled": {}, - "htlcs": {}, - "initial_feerate": {}, - "last_feerate": {}, - "next_feerate": {}, - "inflight": {}, - "last_tx_fee_msat": {}, - "direction": {}, - "close_to_addr": { - "type": "string", - "description": "The bitcoin address we will close to" - } - } - } - }, - { - "if": { - "required": [ - "scratch_txid" - ] - }, - "then": { - "additionalProperties": false, - "required": [ - "last_tx_fee_msat" - ], - "properties": { - "state": {}, - "alias": {}, - "scratch_txid": {}, - "feerate": {}, - "owner": {}, - "short_channel_id": {}, - "channel_id": {}, - "funding_txid": {}, - "funding_outnum": {}, - "inflight": {}, - "close_to": {}, - "private": {}, - "opener": {}, - "closer": {}, - "features": {}, - "funding": {}, - "to_us_msat": {}, - "min_to_us_msat": {}, - "max_to_us_msat": {}, - "total_msat": {}, - "fee_base_msat": {}, - "fee_proportional_millionths": {}, - "dust_limit_msat": {}, - "max_total_htlc_in_msat": {}, - "their_reserve_msat": {}, - "our_reserve_msat": {}, - "spendable_msat": {}, - "receivable_msat": {}, - "minimum_htlc_in_msat": {}, - "minimum_htlc_out_msat": {}, - "maximum_htlc_out_msat": {}, - "spendable_msatoshi": {}, - "receivable_msatoshi": {}, - "their_to_self_delay": {}, - "our_to_self_delay": {}, - "max_accepted_htlcs": {}, - "msatoshi_to_us": {}, - "msatoshi_to_us_min": {}, - "msatoshi_to_us_max": {}, - "msatoshi_total": {}, - "dust_limit_satoshis": {}, - "max_htlc_value_in_flight_msat": {}, - "our_channel_reserve_satoshis": {}, - "their_channel_reserve_satoshis": {}, - "spendable_satoshis": {}, - "receivable_satoshis": {}, - "htlc_minimum_msat": {}, - "state_changes": {}, - "status": {}, - "in_payments_offered": {}, - "in_offered_msat": {}, - "in_msatoshi_offered": {}, - "in_payments_fulfilled": {}, - "in_fulfilled_msat": {}, - "in_msatoshi_fulfilled": {}, - "out_payments_offered": {}, - "out_offered_msat": {}, - "out_msatoshi_offered": {}, - "out_payments_fulfilled": {}, - "out_fulfilled_msat": {}, - "out_msatoshi_fulfilled": {}, - "htlcs": {}, - "initial_feerate": {}, - "last_feerate": {}, - "next_feerate": {}, - "close_to_addr": {}, - "direction": {}, - "last_tx_fee_msat": { - "type": "msat", - "description": "fee attached to this the current tx" - } } - } - }, - { - "if": { - "required": [ - "short_channel_id" - ] }, - "then": { - "additionalProperties": false, - "required": [ - "direction" - ], - "properties": { - "alias": {}, - "state": {}, - "scratch_txid": {}, - "feerate": {}, - "owner": {}, - "short_channel_id": {}, - "channel_id": {}, - "funding_txid": {}, - "funding_outnum": {}, - "inflight": {}, - "close_to": {}, - "private": {}, - "opener": {}, - "closer": {}, - "features": {}, - "funding": {}, - "to_us_msat": {}, - "min_to_us_msat": {}, - "max_to_us_msat": {}, - "total_msat": {}, - "fee_base_msat": {}, - "fee_proportional_millionths": {}, - "dust_limit_msat": {}, - "max_total_htlc_in_msat": {}, - "their_reserve_msat": {}, - "our_reserve_msat": {}, - "spendable_msat": {}, - "receivable_msat": {}, - "minimum_htlc_in_msat": {}, - "minimum_htlc_out_msat": {}, - "maximum_htlc_out_msat": {}, - "spendable_msatoshi": {}, - "receivable_msatoshi": {}, - "their_to_self_delay": {}, - "our_to_self_delay": {}, - "max_accepted_htlcs": {}, - "msatoshi_to_us": {}, - "msatoshi_to_us_min": {}, - "msatoshi_to_us_max": {}, - "msatoshi_total": {}, - "dust_limit_satoshis": {}, - "max_htlc_value_in_flight_msat": {}, - "our_channel_reserve_satoshis": {}, - "their_channel_reserve_satoshis": {}, - "spendable_satoshis": {}, - "receivable_satoshis": {}, - "htlc_minimum_msat": {}, - "state_changes": {}, - "status": {}, - "in_payments_offered": {}, - "in_offered_msat": {}, - "in_msatoshi_offered": {}, - "in_payments_fulfilled": {}, - "in_fulfilled_msat": {}, - "in_msatoshi_fulfilled": {}, - "out_payments_offered": {}, - "out_offered_msat": {}, - "out_msatoshi_offered": {}, - "out_payments_fulfilled": {}, - "out_fulfilled_msat": {}, - "out_msatoshi_fulfilled": {}, - "htlcs": {}, - "initial_feerate": {}, - "last_feerate": {}, - "next_feerate": {}, - "close_to_addr": {}, - "last_tx_fee_msat": {}, - "direction": { - "type": "u32", - "description": "0 if we're the lesser node_id, 1 if we're the greater" - } - } - } - }, - { - "if": { - "required": [ - "inflight" + "english": { + "type": "string", + "description": [ + "English readable summary of alternatives above." ] - }, - "then": { - "additionalProperties": false, - "required": [ - "initial_feerate", - "last_feerate", - "next_feerate" - ], - "properties": { - "state": {}, - "scratch_txid": {}, - "feerate": {}, - "owner": {}, - "alias": {}, - "short_channel_id": {}, - "channel_id": {}, - "funding_txid": {}, - "funding_outnum": {}, - "close_to": {}, - "private": {}, - "opener": {}, - "closer": {}, - "features": {}, - "funding": {}, - "to_us_msat": {}, - "min_to_us_msat": {}, - "max_to_us_msat": {}, - "total_msat": {}, - "fee_base_msat": {}, - "fee_proportional_millionths": {}, - "dust_limit_msat": {}, - "max_total_htlc_in_msat": {}, - "their_reserve_msat": {}, - "our_reserve_msat": {}, - "spendable_msat": {}, - "receivable_msat": {}, - "minimum_htlc_in_msat": {}, - "minimum_htlc_out_msat": {}, - "maximum_htlc_out_msat": {}, - "spendable_msatoshi": {}, - "receivable_msatoshi": {}, - "their_to_self_delay": {}, - "our_to_self_delay": {}, - "max_accepted_htlcs": {}, - "msatoshi_to_us": {}, - "msatoshi_to_us_min": {}, - "msatoshi_to_us_max": {}, - "msatoshi_total": {}, - "dust_limit_satoshis": {}, - "max_htlc_value_in_flight_msat": {}, - "our_channel_reserve_satoshis": {}, - "their_channel_reserve_satoshis": {}, - "spendable_satoshis": {}, - "receivable_satoshis": {}, - "htlc_minimum_msat": {}, - "state_changes": {}, - "status": {}, - "in_payments_offered": {}, - "in_offered_msat": {}, - "in_msatoshi_offered": {}, - "in_payments_fulfilled": {}, - "in_fulfilled_msat": {}, - "in_msatoshi_fulfilled": {}, - "out_payments_offered": {}, - "out_offered_msat": {}, - "out_msatoshi_offered": {}, - "out_payments_fulfilled": {}, - "out_fulfilled_msat": {}, - "out_msatoshi_fulfilled": {}, - "htlcs": {}, - "inflight": {}, - "close_to_addr": {}, - "direction": {}, - "last_tx_fee_msat": {}, - "initial_feerate": { - "type": "string", - "description": "The feerate for the initial funding transaction in per-1000-weight, with \"kpw\" appended" - }, - "last_feerate": { - "type": "string", - "description": "The feerate for the latest funding transaction in per-1000-weight, with \"kpw\" appended" - }, - "next_feerate": { - "type": "string", - "description": "The minimum feerate for the next funding transaction in per-1000-weight, with \"kpw\" appended" - } - } } } - ] - } - } - }, - "allOf": [ - { - "if": { - "additionalProperties": true, - "properties": { - "connected": { - "enum": [ - true - ] - } } }, - "then": { - "additionalProperties": false, - "required": [ - "netaddr", - "features" + "restrictions_as_english": { + "type": "string", + "description": [ + "English readable description of the restrictions array above." + ] + }, + "stored": { + "type": "boolean", + "enum": [ + false ], - "properties": { - "id": {}, - "channels": {}, - "connected": {}, - "num_channels": {}, - "htlcs": {}, - "log": {}, - "netaddr": { - "type": "array", - "minItems": 1, - "maxItems": 1, - "description": "A single entry array", - "items": { - "type": "string", - "description": "address, e.g. 1.2.3.4:1234" - } - }, - "remote_addr": { - "type": "string", - "description": "The public IPv4/6 address the peer sees us from, e.g. 1.2.3.4:1234" - }, - "features": { - "type": "hex", - "description": "bitmap of BOLT #9 features from peer's INIT message" - } - } + "description": [ + "This is false if the rune does not appear in our datastore (only possible when `rune` is specified)." + ] + }, + "blacklisted": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "The rune has been blacklisted; see commando-blacklist(7)." + ] + }, + "last_used": { + "type": "number", + "description": [ + "The last time this rune was successfully used." + ], + "added": "23.11" + }, + "our_rune": { + "type": "boolean", + "enum": [ + false + ], + "description": [ + "This is not a rune for this node (only possible when `rune` is specified)." + ] } } - ] + } } } - } - }, - "listsendpays.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": { - "bolt11": { - "type": "string", - "description": "bolt11 invoice" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the payment_preimage" - }, - "status": { - "type": "string", - "enum": [ - "pending", - "complete", - "failed" - ], - "description": "Whether the invoice has been paid, pending, or failed" - }, - "index": { - "type": "string", - "added": "v23.11", - "enum": [ - "created", - "updated" - ], - "description": "if neither bolt11 or payment_hash is specified, `index` controls ordering, by `created` (default) or `updated`" - }, - "start": { - "type": "u64", - "added": "v23.11", - "description": "if `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)" + }, + "example_json_request": [ + { + "id": "example:showrunes#1", + "method": "showrunes", + "params": "{}" }, - "limit": { - "type": "u32", - "added": "v23.11", - "description": "if `index` is specified, `limit` can be used to specify the maximum number of entries to return" + { + "id": "example:showrunes#2", + "method": "showrunes", + "params": { + "rune": "Bl0V_vkVkGr4h356JbCMCcoDyyKE8djkoQ2156iPB509MCZwZXI9MTAwMDAwMDAwMG5zZWM=" + } } - } - }, - "listsendpays.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "payments" ], - "properties": { - "payments": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "id", - "created_index", - "payment_hash", - "status", - "groupid", - "created_at", - "amount_sent_msat" - ], - "properties": { - "created_index": { - "added": "v23.11", - "type": "u64", - "description": "1-based index indicating order this payment was created in" - }, - "id": { - "type": "u64", - "description": "old synonym for created_index" - }, - "groupid": { - "type": "u64", - "description": "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash" - }, - "partid": { - "type": "u64", - "description": "Part number (for multiple parts to a single payment)" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "updated_index": { - "added": "v23.11", - "type": "u64", - "description": "1-based index indicating order this payment was changed (only present if it has changed since creation)" - }, - "status": { - "type": "string", - "enum": [ - "pending", - "failed", - "complete" - ], - "description": "status of the payment" - }, - "amount_msat": { - "type": "msat", - "description": "The amount delivered to destination (if known)" - }, - "destination": { - "type": "pubkey", - "description": "the final destination of the payment if known" - }, - "created_at": { - "type": "u64", - "description": "the UNIX timestamp showing when this payment was initiated" - }, - "amount_sent_msat": { - "type": "msat", - "description": "The amount sent" - }, - "label": { - "type": "string", - "description": "the label, if given to sendpay" - }, - "bolt11": { - "type": "string", - "description": "the bolt11 string (if pay supplied one)" - }, - "description": { - "type": "string", - "description": "the description matching the bolt11 description hash (if pay supplied one)" - }, - "bolt12": { - "type": "string", - "description": "the bolt12 string (if supplied for pay: **experimental-offers** only)." - } + "example_json_response": [ + { + "runes": [ + { + "rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==", + "unique_id": "0", + "restrictions": [], + "restrictions_as_english": "" }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "complete" - ] + { + "rune": "geZmO6U7yqpHn-moaX93FVMVWrDRfSNY4AXx9ypLcqg9MQ==", + "unique_id": "1", + "restrictions": [], + "restrictions_as_english": "" + }, + { + "rune": "Bl0V_vkVkGr4h356JbCMCcoDyyKE8djkoQ2156iPB509MCZwZXI9MTAwMDAwMDAwMG5zZWM=", + "unique_id": "2", + "restrictions": [ + { + "alternatives": [ + { + "fieldname": "per", + "value": "1000000000nsec", + "condition": "=", + "english": "per equal to 1000000000nsec" } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "payment_preimage" ], - "properties": { - "id": {}, - "created_index": {}, - "updated_index": {}, - "partid": {}, - "groupid": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "destination": {}, - "created_at": {}, - "completed_at": {}, - "msatoshi_sent": {}, - "amount_sent_msat": {}, - "label": {}, - "bolt11": {}, - "description": {}, - "bolt12": {}, - "payment_preimage": { - "type": "secret", - "description": "the proof of payment: SHA256 of this **payment_hash**" - } - } - } - }, - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "failed" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [], - "properties": { - "id": {}, - "created_index": {}, - "updated_index": {}, - "partid": {}, - "groupid": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "destination": {}, - "created_at": {}, - "completed_at": {}, - "msatoshi_sent": {}, - "amount_sent_msat": {}, - "label": {}, - "bolt11": {}, - "description": {}, - "bolt12": {}, - "erroronion": { - "type": "hex", - "description": "the onion message returned" - } - } + "english": "per equal to 1000000000nsec" } - }, - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "pending" - ] + ], + "restrictions_as_english": "per equal to 1000000000nsec" + } + ] + }, + { + "runes": [ + { + "rune": "Bl0V_vkVkGr4h356JbCMCcoDyyKE8djkoQ2156iPB509MCZwZXI9MTAwMDAwMDAwMG5zZWM=", + "unique_id": "2", + "restrictions": [ + { + "alternatives": [ + { + "fieldname": "per", + "value": "1000000000nsec", + "condition": "=", + "english": "per equal to 1000000000nsec" } - } - }, - "then": { - "additionalProperties": false, - "required": [], - "properties": { - "id": {}, - "created_index": {}, - "updated_index": {}, - "partid": {}, - "groupid": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "destination": {}, - "created_at": {}, - "msatoshi_sent": {}, - "amount_sent_msat": {}, - "label": {}, - "bolt11": {}, - "description": {}, - "bolt12": {} - } + ], + "english": "per equal to 1000000000nsec" } - } - ] - } - } - } - }, - "listsqlschemas.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "added": "v23.02", - "properties": { - "table": { - "type": "string" + ], + "restrictions_as_english": "per equal to 1000000000nsec" + } + ] } - } + ], + "author": [ + "Shahana Farooqui <> is mainly responsible." + ], + "see_also": [ + "lightning-commando-showrunes(7)", + "lightning-blacklistrune(7)" + ], + "resources": [ + "Main web site: " + ] }, - "listsqlschemas.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-signinvoice.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "schemas" + "added": "v23.02", + "rpc": "signinvoice", + "title": "Low-level invoice signing", + "description": [ + "The **signinvoice** RPC command signs an invoice. Unlike **createinvoice** it does not save the invoice into the database and thus does not require the preimage." ], - "properties": { - "schemas": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "tablename", - "columns" - ], - "properties": { - "tablename": { - "type": "string", - "description": "the name of the table" - }, - "columns": { - "type": "array", - "description": "the columns, in database order", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "name", - "type" - ], - "properties": { - "name": { - "type": "string", - "description": "the name of the column" - }, - "type": { - "type": "string", - "enum": [ - "INTEGER", - "BLOB", - "TEXT", - "REAL" - ], - "description": "the SQL type of the column" - } - } - } - }, - "indices": { - "type": "array", - "description": "Any index we created to speed lookups", - "items": { - "type": "array", - "description": "The columns for this index", - "items": { - "type": "string", - "description": "The column name" - } - } - } - } + "request": { + "required": [ + "invstring" + ], + "properties": { + "invstring": { + "type": "string", + "description": [ + "Bolt11 form, but the final signature is ignored. Minimal sanity checks are done." + ] } } - } - }, - "listtransactions.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": {} + }, + "response": { + "required": [ + "bolt11" + ], + "properties": { + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string." + ] + } + } + }, + "errors": [ + "The following error codes may occur:", + "", + "- -1: Catchall nonspecific error." + ], + "example_json_request": [ + { + "id": "example:signinvoice#1", + "method": "signinvoice", + "params": [ + "lnbcrt10n1pjmxt3lsp5jumuz2sv3ca68kzd92hp3wdtpx8ghnxur65fs6maw6dyxsleqd0spp5nadvvh7uzk2qzh8d9d7tsxr08l9uaz2vjeuuahqtufjv52d0eassdq8d9h8vvgxqyjw5qcqp99qxpqysgq4rrn702eum6c9ld9khlz39vdyd8zcwrav5ygqvu6w54aep6yarkyfrnk990yf5prpasgzmj52stektf6mzwdl5hc6qlsglt2a0pwp0spwww44w" + ] + } + ], + "example_json_response": [ + { + "bolt11": "lnbcrt10n1pjmxt3lsp5jumuz2sv3ca68kzd92hp3wdtpx8ghnxur65fs6maw6dyxsleqd0spp5nadvvh7uzk2qzh8d9d7tsxr08l9uaz2vjeuuahqtufjv52d0eassdq8d9h8vvgxqyjw5qcqp99qxpqysgq3nhrd72qe7wmc2hvwhaqnx05y6dzxh2tal02kw055er7uutkkrcreccm37ce6wv7ee8q70ktlr9fy3fd635hc2k98a4svd9c8v4cpjsppm2eee" + } + ], + "author": [ + "Carl Dong <> is mainly responsible." + ], + "see_also": [ + "lightning-createinvoice(7)", + "lightning-invoice(7)", + "lightning-listinvoices(7)", + "lightning-delinvoice(7)", + "lightning-getroute(7)", + "lightning-sendpay(7)", + "lightning-offer(7)" + ], + "resources": [ + "Main web site: " + ] }, - "listtransactions.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-signmessage.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "transactions" + "rpc": "signmessage", + "title": "Command to create a signature from this node", + "description": [ + "The **signmessage** RPC command creates a digital signature of *message* using this node's secret key. A receiver who knows your node's *id* and the *message* can be sure that the resulting signature could only be created by something with access to this node's secret key." ], - "properties": { - "transactions": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "hash", - "rawtx", - "blockheight", - "txindex", - "locktime", - "version", - "inputs", - "outputs" - ], - "properties": { - "hash": { - "type": "txid", - "description": "the transaction id" - }, - "rawtx": { - "type": "hex", - "description": "the raw transaction" - }, - "blockheight": { - "type": "u32", - "description": "the block height of this tx" - }, - "txindex": { - "type": "u32", - "description": "the transaction number within the block" - }, - "locktime": { - "type": "u32", - "description": "The nLocktime for this tx" - }, - "version": { - "type": "u32", - "description": "The nVersion for this tx" - }, - "inputs": { - "type": "array", - "description": "Each input, in order", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "txid", - "index", - "sequence" - ], - "properties": { - "txid": { - "type": "txid", - "description": "the transaction id spent" - }, - "index": { - "type": "u32", - "description": "the output spent" - }, - "sequence": { - "type": "u32", - "description": "the nSequence value" - } - } - } - }, - "outputs": { - "type": "array", - "description": "Each output, in order", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "index", - "amount_msat", - "scriptPubKey" - ], - "properties": { - "index": { - "type": "u32", - "description": "the 0-based output number" - }, - "amount_msat": { - "type": "msat", - "description": "the amount of the output" - }, - "scriptPubKey": { - "type": "hex", - "description": "the scriptPubKey" - } - } - } - } - } + "request": { + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string", + "description": [ + "Less than 65536 characters long message to be signed by the node." + ] + } + } + }, + "response": { + "required": [ + "signature", + "recid", + "zbase" + ], + "properties": { + "signature": { + "type": "hex", + "description": [ + "The signature." + ], + "minLength": 128, + "maxLength": 128 + }, + "recid": { + "type": "hex", + "description": [ + "The recovery id (0, 1, 2 or 3)." + ], + "minLength": 2, + "maxLength": 2 + }, + "zbase": { + "type": "string", + "description": [ + "*signature* and *recid* encoded in a style compatible with **lnd**'s [SignMessageRequest](https://api.lightning.community/#grpc-request- signmessagerequest)." + ] } } - } - }, - "makesecret.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "hex": { - "type": "hex", - "description": "One of `hex` or `string` must be specified: `hex` can be any hex data" + }, + "example_json_request": [ + { + "id": "example:signmessage#1", + "method": "signmessage", + "params": { + "message": "this is a test!" + } }, - "string": { - "type": "string", - "description": "One of `hex` or `string` must be specified: `string` is a UTF-8 string interpreted literally" + { + "id": "example:signmessage#2", + "method": "signmessage", + "params": { + "message": "message for you" + } } - } - }, - "makesecret.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "secret" ], - "properties": { - "secret": { - "type": "secret", - "description": "the pseudorandom key derived from HSM_secret" + "example_json_response": [ + { + "signature": "a2ec227012795f9d6b80a3f5ea98374c6d2886917517c05336799923fcf37caf08344c0431275e1a8189da01b444ae978007fe70f0cc9009f38cabe074ade87d", + "recid": "00", + "zbase": "d6tqaeuonjhi98mmont9m4wag7gg4krg1f4txonug3h31e9h6p6k6nbwjondnj46dkyausobstnk7fhyy998bhgc1yr98dfmhb4k54d7" + }, + { + "signature": "85843b010bc517b32eaafe70232e2c44bb5a354c74d2202390af1b272e4c6ac23ac3f97ea663d8b49116ad6c2d080515b43bcdf1ea4f38cdb18af0edf8209cd8", + "recid": "00", + "zbase": "d6naeqabbxntxc3qim98ye3qftnmsstijt4prebd1nztsj3qjticrqsd9f9kca6as1etpmmcfwrykfpw8xg9d41x8dg5dnzo7zhnb8ga" } - } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-checkmessage(7)" + ], + "resources": [ + "Main web site: ", + "", + "[SignMessageRequest](https://api.lightning.community/#grpc-request-signmessagerequest)" + ] }, - "multifundchannel.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-signpsbt.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "destinations" - ], - "properties": { - "destinations": { - "type": "array", - "description": "there must be at least one entry in *destinations*; it cannot be an empty array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "amount" + "rpc": "signpsbt", + "title": "Command to sign a wallet's inputs on a provided bitcoin transaction (PSBT).", + "description": [ + "**signpsbt** is a low-level RPC command which signs a PSBT as defined by BIP-174.", + "", + "By default, all known inputs are signed, and others ignored: with *signonly*, only those inputs are signed, and an error is returned if one of them cannot be signed.", + "", + "Note that the command will fail if there are no inputs to sign, or if the inputs to be signed were not previously reserved." + ], + "request": { + "required": [ + "psbt" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "The psbt to be signed." + ] + }, + "signonly": { + "type": "array", + "description": [ + "Input numbers to sign." ], - "properties": { - "id": { - "type": "string", - "description": "node ID, with an optional *@host:port* appended to it in a manner understood by **connect**; see lightning-connect(7). Each entry in the *destinations* array must have a unique node *id*. If not already connected, **multifundchannel** will automatically attempt to connect to the node" - }, - "amount": { - "type": "msat", - "description": "amount in satoshis taken from the internal wallet to fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). The string *all* can be used to specify all available funds (or 16,777,215 satoshi if more is available and large channels were not negotiated with the peer). Otherwise it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The value cannot be less than the dust limit, currently 546 satoshi as of this writing, nor more than 16,777,215 satoshi (unless large channels were negotiated with the peer)" - }, - "announce": { - "type": "boolean", - "description": "flag that indicates whether to announce the channel with this, default `true`. If set to `false`, the channel is unpublished" - }, - "push_msat": { - "type": "msat", - "description": "amount of millisatoshis to outright give to the node. This is a gift to the peer, and you do not get a proof-of-payment out of this" - }, - "close_to": { - "type": "string", - "description": "bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script` Returns `close_to` set to closing script iff is negotiated" - }, - "request_amt": { - "type": "msat", - "description": "amount of liquidity you'd like to lease from peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*" - }, - "compact_lease": { - "type": "string", - "description": "compact represenation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel to this destination" - }, - "mindepth": { - "type": "u32", - "description": "number of confirmations before we consider the channel active" - }, - "reserve": { - "type": "msat", - "description": "amount we want the peer to maintain on its side of the channel. Default is 1% of the funding amount. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" - } + "items": { + "type": "u32" } } - }, - "feerate": { - "type": "feerate", - "description": "feerate used for the opening transaction, and if *commitment_feerate* is not set, as initial feerate for commitment and HTLC transactions. See NOTES in lightning-feerates(7) for possible values. The default is *normal*" - }, - "minconf": { - "type": "integer", - "description": "minimum number of confirmations that used outputs should have. Default is 1", - "default": 1 - }, - "utxos": { - "type": "array", - "items": { - "type": "outpoint", - "description": "utxos to be used to fund the channel, as an array of `txid:vout`" + } + }, + "response": { + "required": [ + "signed_psbt" + ], + "properties": { + "signed_psbt": { + "type": "string", + "description": [ + "The fully signed PSBT." + ] } - }, - "minchannels": { - "type": "integer", - "description": "re-attempt funding as long as at least this many peers remain (must not be zero). The **multifundchannel** command will only fail if too many peers fail the funding process" - }, - "commitment_feerate": { - "type": "feerate", - "description": "initial feerate for commitment and HTLC transactions. See *feerate* for valid values" } - } - }, - "multifundchannel.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "tx", - "txid", - "channel_ids" - ], - "properties": { - "tx": { - "type": "hex", - "description": "The raw transaction which funded the channel" - }, - "txid": { - "type": "txid", - "description": "The txid of the transaction which funded the channel" - }, - "channel_ids": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "channel_id", - "channel_type", - "outnum" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "The peer we opened the channel with" - }, - "outnum": { - "type": "u32", - "description": "The 0-based output index showing which output funded the channel" - }, - "channel_id": { - "type": "hex", - "description": "The channel_id of the resulting channel", - "minLength": 64, - "maxLength": 64 - }, - "channel_type": { - "type": "object", - "description": "channel_type as negotiated with peer", - "added": "v24.02", - "additionalProperties": false, - "required": [ - "bits", - "names" - ], - "properties": { - "bits": { - "type": "array", - "description": "Each bit set in this channel_type", - "added": "v24.02", - "items": { - "type": "u32", - "description": "Bit number" - } - }, - "names": { - "type": "array", - "description": "Feature name for each bit set in this channel_type", - "added": "v24.02", - "items": { - "type": "string", - "enum": [ - "static_remotekey/even", - "anchor_outputs/even", - "anchors_zero_fee_htlc_tx/even", - "scid_alias/even", - "zeroconf/even" - ], - "description": "Name of feature bit" - } - } - } - }, - "close_to": { - "type": "hex", - "description": "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`" - } - } + }, + "example_json_request": [ + { + "id": "example:signpsbt#1", + "method": "signpsbt", + "params": { + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAAAAAAEQBAAAAAAM/AlsaWdodG5pbmcBCCvyYqqdIt0mAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oBDiBWd3IcNaQkoj1tzHyQkDblBa5oZQ4J1ZcztLfnMAOk3AEPBAEAAAABEAT9////DPwJbGlnaHRuaW5nAQg5j4QWOQoUFAABAwhOfA0AAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4M/AlsaWdodG5pbmcBCMbeD+3qn9/kAAEDCODIEAAAAAAAAQQiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQz8CWxpZ2h0bmluZwEI4upB+mjl6AIA", + "signonly": null } }, - "failed": { - "type": "array", - "description": "any peers we failed to open with (if *minchannels* was specified less than the number of destinations)", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "method", - "error" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "The peer we failed to open the channel with" - }, - "method": { - "type": "string", - "enum": [ - "connect", - "openchannel_init", - "fundchannel_start", - "fundchannel_complete" - ], - "description": "What stage we failed at" - }, - "error": { - "type": "object", - "additionalProperties": false, - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "integer", - "description": "JSON error code from failing stage" - }, - "message": { - "type": "string", - "description": "Message from stage" - }, - "data": { - "untyped": true, - "description": "Additional error data" - } - } - } - } + { + "id": "example:signpsbt#2", + "method": "signpsbt", + "params": { + "psbt": "cHNidP8BAP1xAQIAAAAIFTef27H2GAJBzP4UZMeDePsDVkglO47/q4jqK18ibCYAAAAAAP3///+axwap6WKnEHvLjIJZX0ZeJ87cs7PKkXBfwvbGVmjpTQEAAAAA/f///wQ1cVzb9NR7nXadyRuhQBv+2iqhZkhvUA+sPo5z/SsSAQAAAAD9////lXQ788meUtSxhBX13mx2XhyM3Ddo30QtmNW0YuE2TDABAAAAAP3///8Kr4BwElAScx3bA5ZdavrHwh4Zh+rFNvkE/+7gu1WbngEAAAAA/f///3Uei7j3k/b5tnjFGvNZhe2iWz8O6FQjTEpM5XIoduNsAQAAAAD9////fm5Om4MojcnfZiTmrwb4b5Byw9emrjITi/nkEqTK9MsBAAAAAP3///8lwdpZqt3ILPRwhINY4PGvkg2CSw7agcMPSuFoHDDkIQAAAAAA/f///wGCAXoAAAAAABYAFMkJbUP0COpSYCAmLM2tfIUWuSqBAAAAAAABAHECAAAAAZVxzFxyEg7tiQTgRHwGleR8Srxw6taAGOoEpJK/Xj5sAAAAAAD9////AkBCDwAAAAAAFgAUKvGgVL/ThjWE/P1oORVXh/ObucYzr/YpAQAAABYAFKmkod5S53U4m5tKFApyeC35UbnbZwAAAAEBH0BCDwAAAAAAFgAUKvGgVL/ThjWE/P1oORVXh/ObucYAAQBxAgAAAAEVN5/bsfYYAkHM/hRkx4N4+wNWSCU7jv+riOorXyJsJgEAAAAA/f///wJmbOcpAQAAABYAFCCSJBD9wY/VwxnBcnFiu1tA6CGTQEIPAAAAAAAWABSjI8KCqaGX/BGOwJza8hyiuxuIcmcAAAABAR9AQg8AAAAAABYAFKMjwoKpoZf8EY7AnNryHKK7G4hyAAEAcQIAAAAB98EwKZMOHiyRYWyToae6Kce3gCwqUvnVXXHlB/ps9ocBAAAAAP3///8CmNuLKQEAAAAWABQ4roxw+phYHelaRr71DYB3FEy/30BCDwAAAAAAFgAUwSDtQiY7PVvBc7ww56Y72YIQdjllAAAAAQEfQEIPAAAAAAAWABTBIO1CJjs9W8FzvDDnpjvZghB2OQABAHECAAAAAZH/SvCXvDW7b8qb55CDC4M+jgZ61H/e8rZnAGaXp+Z+AAAAAAD9////Apkp2CkBAAAAFgAUc/Y+sIq3oYyEe40GkKJsXawkzwFAQg8AAAAAABYAFLdt1h5Bte8FKvIc2jJgiIwHC7mvZwAAAAEBH0BCDwAAAAAAFgAUt23WHkG17wUq8hzaMmCIjAcLua8AAQBxAgAAAAETC3wMCv9qK3lvVkVJu9b/v2VgMepZtnfngMp2xMXRnwAAAAAA/f///wJk0E4pAQAAABYAFEIsc4cBl+BTN33Kn80+YYfkMt+cQEIPAAAAAAAWABT2/7RIxKohhGbacpBz0BZNYcnfsGUAAAABAR9AQg8AAAAAABYAFPb/tEjEqiGEZtpykHPQFk1hyd+wAAEAcQIAAAABA8J/OnC+cuH79Z6wZmzwdAjhBDaPHavh3yvhr4odDXQBAAAAAP3///8CykowKQEAAAAWABTVHuO8cKOOX/JlmMU66on6Uc54mkBCDwAAAAAAFgAUunZMZryWMqCTiMuVWNF/cleg6dVnAAAAAQEfQEIPAAAAAAAWABS6dkxmvJYyoJOIy5VY0X9yV6Dp1QABAHECAAAAAfRxBaZZ3FfDGwxhZQLYCurN+7kJj0x6nzChg434dnjRAAAAAAD9////AszmyCkBAAAAFgAULSqRp54barF/7R9XOmsLDCVWdAFAQg8AAAAAABYAFNa5adNt/9rZhpGT9mPuSA39xzSIZQAAAAEBH0BCDwAAAAAAFgAU1rlp023/2tmGkZP2Y+5IDf3HNIgAAQBxAgAAAAEgk1JYyP4oIoPoYYcTPPDvZynVfXWINJnBEFBsLv0MtAAAAAAA/f///wJAQg8AAAAAABYAFGYcI7eQ3TSRNzrwsdi+0Id9XN4iMmGqKQEAAAAWABT5XKNwVIFsUKh26sqHFSlOLq5TFGUAAAABAR9AQg8AAAAAABYAFGYcI7eQ3TSRNzrwsdi+0Id9XN4iAAA=", + "signonly": [ + 7 + ] } } - } + ], + "errors": [ + "On failure, one of the following error codes may be returned:", + "", + "- -32602: Error in given parameters, or there aren't wallet's inputs to sign, or we couldn't sign all of *signonly*, or inputs are not reserved." + ], + "example_json_response": [ + { + "signed_psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAAAAAAEQBAAAAAAM/AlsaWdodG5pbmcBCCvyYqqdIt0mAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oBDiBWd3IcNaQkoj1tzHyQkDblBa5oZQ4J1ZcztLfnMAOk3AEPBAEAAAABEAT9////ARNACI9TcWG+6uC9ElBFN3qhND7amsor/dtBhJ5ujEQAT/80548avrt7d7IJiOAaCNzzYLSXITdL2xjx6mhbBi9hTiEWkUUygSpECk12bHHNORk2lKNArhHgEuW6Gtnvum52ylMJAMLMqxcAAAAADPwJbGlnaHRuaW5nAQg5j4QWOQoUFAABAwhOfA0AAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4hB7nAxoROEqUxyWjlXFUHjsFtm/dr6SkP2H0cynK0g5oXCQDWuWnTBAAAAAz8CWxpZ2h0bmluZwEIxt4P7eqf3+QAAQMI4MgQAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQji6kH6aOXoAgA=" + }, + { + "signed_psbt": "cHNidP8BAP1xAQIAAAAIFTef27H2GAJBzP4UZMeDePsDVkglO47/q4jqK18ibCYAAAAAAP3///+axwap6WKnEHvLjIJZX0ZeJ87cs7PKkXBfwvbGVmjpTQEAAAAA/f///wQ1cVzb9NR7nXadyRuhQBv+2iqhZkhvUA+sPo5z/SsSAQAAAAD9////lXQ788meUtSxhBX13mx2XhyM3Ddo30QtmNW0YuE2TDABAAAAAP3///8Kr4BwElAScx3bA5ZdavrHwh4Zh+rFNvkE/+7gu1WbngEAAAAA/f///3Uei7j3k/b5tnjFGvNZhe2iWz8O6FQjTEpM5XIoduNsAQAAAAD9////fm5Om4MojcnfZiTmrwb4b5Byw9emrjITi/nkEqTK9MsBAAAAAP3///8lwdpZqt3ILPRwhINY4PGvkg2CSw7agcMPSuFoHDDkIQAAAAAA/f///wGCAXoAAAAAABYAFMkJbUP0COpSYCAmLM2tfIUWuSqBAAAAAAABAHECAAAAAZVxzFxyEg7tiQTgRHwGleR8Srxw6taAGOoEpJK/Xj5sAAAAAAD9////AkBCDwAAAAAAFgAUKvGgVL/ThjWE/P1oORVXh/ObucYzr/YpAQAAABYAFKmkod5S53U4m5tKFApyeC35UbnbZwAAAAEBH0BCDwAAAAAAFgAUKvGgVL/ThjWE/P1oORVXh/ObucYAAQBxAgAAAAEVN5/bsfYYAkHM/hRkx4N4+wNWSCU7jv+riOorXyJsJgEAAAAA/f///wJmbOcpAQAAABYAFCCSJBD9wY/VwxnBcnFiu1tA6CGTQEIPAAAAAAAWABSjI8KCqaGX/BGOwJza8hyiuxuIcmcAAAABAR9AQg8AAAAAABYAFKMjwoKpoZf8EY7AnNryHKK7G4hyAAEAcQIAAAAB98EwKZMOHiyRYWyToae6Kce3gCwqUvnVXXHlB/ps9ocBAAAAAP3///8CmNuLKQEAAAAWABQ4roxw+phYHelaRr71DYB3FEy/30BCDwAAAAAAFgAUwSDtQiY7PVvBc7ww56Y72YIQdjllAAAAAQEfQEIPAAAAAAAWABTBIO1CJjs9W8FzvDDnpjvZghB2OQABAHECAAAAAZH/SvCXvDW7b8qb55CDC4M+jgZ61H/e8rZnAGaXp+Z+AAAAAAD9////Apkp2CkBAAAAFgAUc/Y+sIq3oYyEe40GkKJsXawkzwFAQg8AAAAAABYAFLdt1h5Bte8FKvIc2jJgiIwHC7mvZwAAAAEBH0BCDwAAAAAAFgAUt23WHkG17wUq8hzaMmCIjAcLua8AAQBxAgAAAAETC3wMCv9qK3lvVkVJu9b/v2VgMepZtnfngMp2xMXRnwAAAAAA/f///wJk0E4pAQAAABYAFEIsc4cBl+BTN33Kn80+YYfkMt+cQEIPAAAAAAAWABT2/7RIxKohhGbacpBz0BZNYcnfsGUAAAABAR9AQg8AAAAAABYAFPb/tEjEqiGEZtpykHPQFk1hyd+wAAEAcQIAAAABA8J/OnC+cuH79Z6wZmzwdAjhBDaPHavh3yvhr4odDXQBAAAAAP3///8CykowKQEAAAAWABTVHuO8cKOOX/JlmMU66on6Uc54mkBCDwAAAAAAFgAUunZMZryWMqCTiMuVWNF/cleg6dVnAAAAAQEfQEIPAAAAAAAWABS6dkxmvJYyoJOIy5VY0X9yV6Dp1QABAHECAAAAAfRxBaZZ3FfDGwxhZQLYCurN+7kJj0x6nzChg434dnjRAAAAAAD9////AszmyCkBAAAAFgAULSqRp54barF/7R9XOmsLDCVWdAFAQg8AAAAAABYAFNa5adNt/9rZhpGT9mPuSA39xzSIZQAAAAEBH0BCDwAAAAAAFgAU1rlp023/2tmGkZP2Y+5IDf3HNIgAAQBxAgAAAAEgk1JYyP4oIoPoYYcTPPDvZynVfXWINJnBEFBsLv0MtAAAAAAA/f///wJAQg8AAAAAABYAFGYcI7eQ3TSRNzrwsdi+0Id9XN4iMmGqKQEAAAAWABT5XKNwVIFsUKh26sqHFSlOLq5TFGUAAAABAR9AQg8AAAAAABYAFGYcI7eQ3TSRNzrwsdi+0Id9XN4iIgID+pyVCF5CseUAPNH0GBeMMMluSud5VMoPxIxYgm/06w5HMEQCIG90DSr+fGNoWhCrgLbJG3Wt8PJNMWYqaa5MLWRwA0oTAiA9rsLEqqVhjV6wENfzzpudaE949uLlVqWgDjE/FSgKNAEiBgP6nJUIXkKx5QA80fQYF4wwyW5K53lUyg/EjFiCb/TrDghmHCO3AAAAAAAA" + } + ], + "author": [ + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." + ], + "see_also": [ + "lightning-fundpsbt(7)", + "lightning-sendpsbt(7)" + ], + "resources": [ + "Main web site: " + ] }, - "multiwithdraw.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-splice_init.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "outputs" + "added": "v23.08", + "rpc": "splice_init", + "title": "Command to initiate a channel to a peer", + "warning": "experimental-splicing only", + "description": [ + "`splice_init` is a low level RPC command which initiates a channel splice for a given channel specified by `channel_id`." ], - "properties": { - "outputs": { - "type": "array", - "items": { - "type": "outputdesc" + "request": { + "required": [ + "channel_id", + "relative_amount" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "The channel id of the channel to be spliced." + ] }, - "description": "an array containing objects of the form `{address: amount}`. The `amount` may be the string *all*, indicating that all onchain funds be sent to the specified address. Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" - }, - "feerate": { - "type": "feerate", - "description": "feerate used for the withdrawals. See NOTES in lightning-feerates(7) for possible values. The default is *normal*" - }, - "minconf": { - "type": "u32", - "description": "minimum number of confirmations that used outputs should have. Default is 1", - "default": 1 - }, - "utxos": { - "type": "array", - "items": { - "type": "outpoint", - "description": "utxos to be used to be withdrawn from, as an array of `txid:vout`. These must be drawn from the node's available UTXO set" + "relative_amount": { + "type": "integer", + "description": [ + "A positive or negative amount of satoshis to add or subtract from the channel. Note you may need to add a double dash (--) after splice_init if using a negative *relative_amount* so it is not interpretted as a command modifier. For example: ```shell lightning-cli splice_init -- $CHANNEL_ID -100000 ```." + ] + }, + "initialpsbt": { + "type": "string", + "description": [ + "The (optional) base 64 encoded PSBT to begin with. If not specified, one will be generated automatically." + ] + }, + "feerate_per_kw": { + "type": "u32", + "description": [ + "The miner fee we promise our peer to pay for our side of the splice transaction. It is calculated by `feerate_per_kw` * our_bytes_in_splice_tx / 1000." + ] + }, + "force_feerate": { + "type": "boolean", + "description": [ + "By default splices will fail if the fee provided looks too high. This is to protect against accidentally setting your fee higher than intended. Set `force_feerate` to true to skip this saftey check." + ] } } - } - }, - "multiwithdraw.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "tx", - "txid" - ], - "properties": { - "tx": { - "type": "hex", - "description": "The raw transaction which was sent" - }, - "txid": { - "type": "txid", - "description": "The txid of the **tx**" + }, + "response": { + "required": [ + "psbt" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "The (incomplete) PSBT of the splice transaction." + ] + } } - } - }, - "newaddr.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": { - "addresstype": { - "type": "string", - "description": "it specifies the type of address wanted; currently *bech32* (e.g. `tb1qu9j4lg5f9rgjyfhvfd905vw46eg39czmktxqgg` on bitcoin testnet or `bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej` on bitcoin mainnet), or *p2tr* taproot addresses. The special value *all* generates all known address types for the same underlying key. Defaults to *bech32* address", - "enum": [ - "bech32", - "p2tr", - "all" - ] + }, + "example_usage": [ + "Here is an example set of splice commands that will splice in 100,000 sats to the first channel that comes out of `listpeerchannels`. The example assumes you already have at least one confirmed channel.", + "", + "```shell", + "RESULT=$(lightning-cli listpeerchannels)", + "CHANNEL_ID=$(echo $RESULT| jq -r \".channels[0].channel_id\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli fundpsbt -k satoshi=100000sat feerate=urgent startweight=800 excess_as_change=true)", + "INITIALPSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli splice_init $CHANNEL_ID 100000 $INITIALPSBT)", + "PSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT)", + "PSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli signpsbt -k psbt=\"$PSBT\")", + "PSBT=$(echo $RESULT | jq -r \".signed_psbt\")", + "echo $RESULT", + "", + "lightning-cli splice_signed $CHANNEL_ID $PSBT", + "```", + "", + "Here is an example set of splice commands that will splice out 100,000 sats from first channel that comes out of `listpeerchannels`. The example assumes you already have at least one confirmed channel.", + "", + "```shell", + "RESULT=$(lightning-cli listpeerchannels)", + "CHANNEL_ID=$(echo $RESULT| jq -r \".channels[0].channel_id\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli addpsbtoutput 100000)", + "INITIALPSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli splice_init -- $CHANNEL_ID -100500 $INITIALPSBT)", + "PSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT)", + "PSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "lightning-cli splice_signed $CHANNEL_ID $PSBT", + "```" + ], + "example_json_request": [ + { + "id": "example:splice_init#1", + "method": "splice_init", + "params": { + "channel_id": "5677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc", + "relative_amount": 100000, + "initialpsbt": "cHNidP8BAF4CAAAAAVZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQAAAAD9////AU58DQAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5sAAAAAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==", + "feerate_per_kw": null + } + }, + { + "id": "example:splice_init#2", + "method": "splice_init", + "params": { + "channel_id": "a40bb442dab0231b51d8f842d95aad548aa35e1d13c4cfcf2997344f805453a1", + "relative_amount": -105000, + "initialpsbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIoIYBAAAAAAABBCJRIHg2NV/cioLcTLAKdyxVVBUdBjhKTdZejT9orAhWa4S+AA==", + "feerate_per_kw": null + } } - } - }, - "newaddr.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "p2tr": { - "added": "v23.08", - "type": "string", - "description": "The taproot address" + ], + "example_json_response": [ + { + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEFR1IhAjJCZt6EA7OrFXoJ8feE1YevYYMcmYwVG8whu3TCsjFLIQLjvTgAmGbJ2o7EqpnMTqnGwN1G3xXGHvDOHycSkXFOV1KuAQ4gVndyHDWkJKI9bcx8kJA25QWuaGUOCdWXM7S35zADpNwBDwQAAAAAARAEAAAAAAz8CWxpZ2h0bmluZwEIK/Jiqp0i3SYAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAQAAAAEQBP3///8M/AlsaWdodG5pbmcBCDmPhBY5ChQUAAEDCE58DQAAAAAAAQQiUSB4NjVf3IqC3EywCncsVVQVHQY4Sk3WXo0/aKwIVmuEvgz8CWxpZ2h0bmluZwEIxt4P7eqf3+QAAQMIAAAAAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQji6kH6aOXoAgA=" }, - "bech32": { - "type": "string", - "description": "The bech32 (native segwit) address" + { + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABARzi7RBt64yrfqRL2p+KiUw8cYtiKICRFHmp/4eCSemSAQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgTCjR9L+TfzP7pLJVVto5egTRbRNj/RaBhyrA3UW0aEcCIAJO5FZjXvdpRcGR949C4DnfHs3soklTjn/1upkia+TgASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M9mAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEFR1IhAjJCZt6EA7OrFXoJ8feE1YevYYMcmYwVG8whu3TCsjFLIQLjvTgAmGbJ2o7EqpnMTqnGwN1G3xXGHvDOHycSkXFOV1KuAQ4gpAu0QtqwIxtR2PhC2VqtVIqjXh0TxM/PKZc0T4BUU6EBDwQAAAAAARAEAAAAAAz8CWxpZ2h0bmluZwEIn2Ac8fyFEJwAAQMIAAAAAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQgu7JK9IpBWOAABAwighgEAAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4M/AlsaWdodG5pbmcBCOZ1GpRwbKfuAA==" } - } + ], + "author": [ + "Dusty <<@dusty_daemon>> is mainly responsible." + ], + "see_also": [ + "lightning-splice_signed(7)", + "lightning-splice_update(7)" + ], + "resources": [ + "Main web site: " + ] }, - "notifications.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-splice_signed.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "enable" + "added": "v23.08", + "rpc": "splice_signed", + "title": "Command to initiate a channel to a peer", + "warning": "experimental-splicing only", + "description": [ + "`splice_signed` is a low level RPC command which finishes the active channel splice associated with `channel_id`.", + "", + "The *psbt* must have all signatures attached to all inputs that you have added to it or it will fail." ], - "properties": { - "enable": { - "type": "boolean", - "description": "whether to enable or disable notifications" + "request": { + "required": [ + "channel_id", + "psbt" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "The channel id of the channel to be spliced." + ] + }, + "psbt": { + "type": "string", + "description": [ + "The final version of the psbt to complete the splice with." + ] + }, + "sign_first": { + "type": "boolean", + "description": [ + "A flag that makes our node offer the final splice signature first (defaults to false). When false, the node will calculate who should sign first based off who is adding inputting the least sats to the splice as per spec." + ] + } } - } - }, - "notifications.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "properties": {} - }, - "offer.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "amount", - "description" - ], - "properties": { - "amount": { - "type": "string", - "description": "The amount parameter can be the string \"any\", which creates an offer that can be paid with any amount (e.g. a donation). Otherwise it can be a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in msat or sat, or a number with three decimal places ending in sat, or a number with 1 to 11 decimal places ending in btc. `amount` can also have an ISO 4217 postfix (i.e. USD), in which case currency conversion will need to be done for the invoice itself. A plugin is needed which provides the \"currencyconvert\" API for this currency, otherwise the offer creation will fail." - }, - "description": { - "type": "string", - "description": "a short description of purpose of the offer" - }, - "issuer": { - "type": "string", - "description": "who is issuing this offer" - }, - "label": { - "type": "string", - "description": "an internal-use name for the offer" - }, - "quantity_max": { - "type": "u64", - "description": "specifies the number of items up (and including) this maximum" - }, - "absolute_expiry": { - "type": "u64", - "description": "the time the offer is valid until, in seconds since the first day of 1970 UTC" - }, - "recurrence": { - "type": "string", - "description": "A recurrence period with unit (matches '[0-9]+(seconds|minutes|hours|days|weeks|months|years)' " - }, - "recurrence_base": { - "type": "string", - "description": "Time in seconds since the first day of 1970 UTC. If not prefixed with an '@' the offer will start in any period (no missed payments will be performed)" - }, - "recurrence_paywindow": { - "type": "string", - "description": "an optional argument of form '-time+time[%]'. The first time is the number of seconds before the start of a period in which an invoice and payment is valid, the second time is the number of seconds after the start of the period. For example -604800+86400 means you can fetch an pay the invoice 4 weeks before the given period starts, and up to 1 day afterwards. The optional % indicates that the amount of the invoice will be scaled by the time remaining in the period. If this is not specified, the default is that payment is allowed during the current and previous periods. This is encoded in the offer." - }, - "recurrence_limit": { - "type": "u64", - "description": "the maximum recurrence period which exists" - }, - "single_use": { - "type": "boolean", - "description": "indicates that the offer is only valid once" + }, + "response": { + "required": [ + "tx", + "txid" + ], + "properties": { + "tx": { + "type": "hex", + "description": [ + "The hex representation of the final transaction that is published." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The txid is of the final transaction." + ] + } } - } - }, - "offer.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "offer_id", - "active", - "single_use", - "bolt12", - "used", - "created" - ], - "properties": { - "offer_id": { - "type": "hash", - "description": "the id of this offer (merkle hash of non-signature fields)" - }, - "active": { - "type": "boolean", - "enum": [ - true - ], - "description": "whether this can still be used" - }, - "single_use": { - "type": "boolean", - "description": "whether this expires as soon as it's paid (reflects the *single_use* parameter)" - }, - "bolt12": { - "type": "string", - "description": "the bolt12 encoding of the offer" - }, - "used": { - "type": "boolean", - "description": "True if an associated invoice has been paid" - }, - "created": { - "type": "boolean", - "description": "false if the offer already existed" - }, - "label": { - "type": "string", - "description": "the (optional) user-specified label" + }, + "example_usage": [ + "In this example we funded the psbt from our lightning node, so we can use the lightning node to sign for its funds.", + "", + "```shell", + "RESULT=$(lightning-cli signpsbt $PSBT)", + "PSBT=$(echo $RESULT | jq -r \".signed_psbt\")", + "echo $RESULT", + "", + "lightning-cli splice_signed $CHANNEL_ID $PSBT", + "```", + "", + "Here is a full example set of splice commands that will splice in 100,000 sats to the first channel that comes out of `listpeerchannels`. The example assumes you already have at least one confirmed channel.", + "", + "```shell", + "RESULT=$(lightning-cli listpeerchannels)", + "CHANNEL_ID=$(echo $RESULT| jq -r \".channels[0].channel_id\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli fundpsbt -k satoshi=100000sat feerate=urgent startweight=800 excess_as_change=true)", + "INITIALPSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli splice_init $CHANNEL_ID 100000 $INITIALPSBT)", + "PSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT={\"commitments_secured\":false}", + "while [[ $(echo $RESULT | jq -r \".commitments_secured\") == \"false\" ]]", + "do", + " RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT)", + " PSBT=$(echo $RESULT | jq -r \".psbt\")", + " echo $RESULT", + "done", + "", + "RESULT=$(lightning-cli signpsbt -k psbt=\"$PSBT\")", + "PSBT=$(echo $RESULT | jq -r \".signed_psbt\")", + "echo $RESULT", + "", + "lightning-cli splice_signed $CHANNEL_ID $PSBT", + "```" + ], + "example_json_request": [ + { + "id": "example:splice_signed#1", + "method": "splice_signed", + "params": { + "channel_id": "5677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc", + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAAAAAAEQBAAAAAAM/AlsaWdodG5pbmcBCCvyYqqdIt0mAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oBDiBWd3IcNaQkoj1tzHyQkDblBa5oZQ4J1ZcztLfnMAOk3AEPBAEAAAABEAT9////ARNACI9TcWG+6uC9ElBFN3qhND7amsor/dtBhJ5ujEQAT/80548avrt7d7IJiOAaCNzzYLSXITdL2xjx6mhbBi9hTiEWkUUygSpECk12bHHNORk2lKNArhHgEuW6Gtnvum52ylMJAMLMqxcAAAAADPwJbGlnaHRuaW5nAQg5j4QWOQoUFAABAwhOfA0AAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4hB7nAxoROEqUxyWjlXFUHjsFtm/dr6SkP2H0cynK0g5oXCQDWuWnTBAAAAAz8CWxpZ2h0bmluZwEIxt4P7eqf3+QAAQMI4MgQAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQji6kH6aOXoAgA=" + } } - } - }, - "openchannel_abort.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channel_id" ], - "properties": { - "channel_id": { - "type": "hash", - "description": "channel id of the channel to be aborted" + "example_json_response": [ + { + "tx": "020000000001025677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc0000000000000000005677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc0100000000fdffffff024e7c0d00000000002251207836355fdc8a82dc4cb00a772c5554151d06384a4dd65e8d3f68ac08566b84bee0c81000000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd0400473044022053269f3951a1fc942174ac0dde8462405a86c89b31b444890664ee9735872cff02204cd822c4456c15e90ad342b23e9bb252d383d4e17a8a04818c4919e4fd61efd80147304402205ac0787c79e74ebfa0eaf18964625c53eb672cc4bed2c65303bd9cc192dad6f902206c6c0cded47201dae0020f50a8998555e654d3420c64e801fc668238e3c1cdfa0147522102324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b2102e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5752ae0140088f537161beeae0bd125045377aa1343eda9aca2bfddb41849e6e8c44004fff34e78f1abebb7b77b20988e01a08dcf360b49721374bdb18f1ea685b062f614e6c000000", + "txid": "f00d5e230b401274c88d3e6205e2c6117028cb9878b7d2bc52b1441f0b589427" } - } + ], + "author": [ + "Dusty <<@dusty_daemon>> is mainly responsible." + ], + "see_also": [ + "lightning-splice_init(7)", + "lightning-splice_update(7)" + ], + "resources": [ + "Main web site: " + ] }, - "openchannel_abort.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-splice_update.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "channel_id", - "channel_canceled", - "reason" - ], - "properties": { - "channel_id": { - "type": "hex", - "description": "the channel id of the aborted channel", - "maxLength": 64, - "minLength": 64 - }, - "channel_canceled": { - "type": "boolean", - "description": "whether this is completely canceled (there may be remaining in-flight transactions)" - }, - "reason": { - "type": "string", - "description": "usually \"Abort requested\", but if it happened to fail at the same time it could be different" + "added": "v23.08", + "rpc": "splice_update", + "title": "Command to initiate a channel to a peer", + "warning": "experimental-splicing only", + "description": [ + "`splice_update` is a low level RPC command which updates the active channel splice associated with `channel_id`.", + "", + "`splice_update` must be called repeatidly until the result `commitments_secured` is `true`. Each time `splice_update` is called, it will return a new PSBT that may have changes. In the simplest case, you take the returned `psbt` and pass it back into `splice_update` for the incoming `psbt` field.", + "", + "For more complex use cases, you may modify the `psbt` both before calling `splice_update` and inbetween subsequent calls until `commitments_secured` is `true`. After which point you can no long make modifications to the PSBT (beyond signing, which comes later with `splice_signed`).", + "", + "Each `splice_update` result may include changes to the PSBT specified by your channel peer. You can review these changes between calls to `splice_update` to perform additional validation or strategy adjustment.", + "", + "Typically, `splice_update` will return `commitments_secured` true after one call but you should assume it will need multiple calls." + ], + "request": { + "required": [ + "channel_id", + "psbt" + ], + "properties": { + "channel_id": { + "type": "hash", + "description": [ + "The channel id of the channel to be spliced." + ] + }, + "psbt": { + "type": "string", + "description": [ + "The base 64 encoded PSBT returned from `splice_init` with any changes added by the user." + ] + } } - } - }, - "openchannel_bump.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channel_id", - "amount", - "initialpsbt" - ], - "properties": { - "channel_id": { - "type": "hash", - "description": "id of the channel to RBF" - }, - "amount": { - "type": "sat", - "description": "satoshi value that we will contribute to the channel. This value will be _added_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel" - }, - "initialpsbt": { - "type": "string", - "description": "the funded, incomplete PSBT that specifies the UTXOs and change output for our channel contribution. It can be updated, see `openchannel_update`; *initialpsbt* must have at least one input. Must have the Non-Witness UTXO (PSBT_IN_NON_WITNESS_UTXO) set for every input. An error (code 309) will be returned if this requirement is not met" - }, - "funding_feerate": { - "type": "feerate", - "description": "feerate for the funding transaction. Defaults to 1/64th greater than the last feerate used for this channel" + }, + "response": { + "required": [ + "psbt", + "commitments_secured" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "The (incomplete) PSBT of the splice transaction." + ] + }, + "commitments_secured": { + "type": "boolean", + "description": [ + "Whether or not the commitments were secured." + ] + } } - } - }, - "openchannel_bump.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channel_id", - "channel_type", - "psbt", - "commitments_secured", - "funding_serial" - ], - "properties": { - "channel_id": { - "type": "hex", - "description": "the channel id of the channel", - "maxLength": 64, - "minLength": 64 - }, - "channel_type": { - "type": "object", - "description": "channel_type as negotiated with peer", - "added": "v24.02", - "additionalProperties": false, - "required": [ - "bits", - "names" - ], - "properties": { - "bits": { - "type": "array", - "description": "Each bit set in this channel_type", - "added": "v24.02", - "items": { - "type": "u32", - "description": "Bit number" - } - }, - "names": { - "type": "array", - "description": "Feature name for each bit set in this channel_type", - "added": "v24.02", - "items": { - "type": "string", - "enum": [ - "static_remotekey/even", - "anchor_outputs/even", - "anchors_zero_fee_htlc_tx/even", - "scid_alias/even", - "zeroconf/even" - ], - "description": "Name of feature bit" - } - } + }, + "example_usage": [ + "Here is an example way to call `splice_update`", + "", + "```shell", + "RESULT={\"commitments_secured\":false}", + "while [[ $(echo $RESULT | jq -r \".commitments_secured\") == \"false\" ]]", + "do", + " RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT)", + " PSBT=$(echo $RESULT | jq -r \".psbt\")", + " echo $RESULT", + "done", + "```", + "", + "Before each call to `splice_update` you have the opportunity to make additional changes.", + "", + "Here is a full example set of splice commands that will splice in 100,000 sats to the first channel that comes out of `listpeerchannels`. The example assumes you already have at least one confirmed channel.", + "", + "```shell", + "RESULT=$(lightning-cli listpeerchannels)", + "CHANNEL_ID=$(echo $RESULT| jq -r \".channels[0].channel_id\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli fundpsbt -k satoshi=100000sat feerate=urgent startweight=800 excess_as_change=true)", + "INITIALPSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT=$(lightning-cli splice_init $CHANNEL_ID 100000 $INITIALPSBT)", + "PSBT=$(echo $RESULT | jq -r \".psbt\")", + "echo $RESULT", + "", + "RESULT={\"commitments_secured\":false}", + "while [[ $(echo $RESULT | jq -r \".commitments_secured\") == \"false\" ]]", + "do", + " RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT)", + " PSBT=$(echo $RESULT | jq -r \".psbt\")", + " echo $RESULT", + "done", + "", + "RESULT=$(lightning-cli signpsbt -k psbt=\"$PSBT\")", + "PSBT=$(echo $RESULT | jq -r \".signed_psbt\")", + "echo $RESULT", + "", + "lightning-cli splice_signed $CHANNEL_ID $PSBT", + "```" + ], + "example_json_request": [ + { + "id": "example:splice_update#1", + "method": "splice_update", + "params": { + "channel_id": "5677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc", + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEFR1IhAjJCZt6EA7OrFXoJ8feE1YevYYMcmYwVG8whu3TCsjFLIQLjvTgAmGbJ2o7EqpnMTqnGwN1G3xXGHvDOHycSkXFOV1KuAQ4gVndyHDWkJKI9bcx8kJA25QWuaGUOCdWXM7S35zADpNwBDwQAAAAAARAEAAAAAAz8CWxpZ2h0bmluZwEIK/Jiqp0i3SYAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAQAAAAEQBP3///8M/AlsaWdodG5pbmcBCDmPhBY5ChQUAAEDCE58DQAAAAAAAQQiUSB4NjVf3IqC3EywCncsVVQVHQY4Sk3WXo0/aKwIVmuEvgz8CWxpZ2h0bmluZwEIxt4P7eqf3+QAAQMIAAAAAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQji6kH6aOXoAgA=" } - }, - "psbt": { - "type": "string", - "description": "the (incomplete) PSBT of the RBF transaction" - }, - "commitments_secured": { - "type": "boolean", - "enum": [ - false - ], - "description": "whether the *psbt* is complete" - }, - "funding_serial": { - "type": "u64", - "description": "the serial_id of the funding output in the *psbt*" - }, - "requires_confirmed_inputs": { - "type": "boolean", - "description": "Does peer require confirmed inputs in psbt?" } - } + ], + "example_json_response": [ + { + "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAAAAAAEQBAAAAAAM/AlsaWdodG5pbmcBCCvyYqqdIt0mAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oBDiBWd3IcNaQkoj1tzHyQkDblBa5oZQ4J1ZcztLfnMAOk3AEPBAEAAAABEAT9////DPwJbGlnaHRuaW5nAQg5j4QWOQoUFAABAwhOfA0AAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4M/AlsaWdodG5pbmcBCMbeD+3qn9/kAAEDCODIEAAAAAAAAQQiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQz8CWxpZ2h0bmluZwEI4upB+mjl6AIA", + "commitments_secured": true + } + ], + "author": [ + "Dusty <<@dusty_daemon>> is mainly responsible." + ], + "see_also": [ + "lightning-splice_init(7)", + "lightning-splice_signed(7)" + ], + "resources": [ + "Main web site: " + ] }, - "openchannel_init.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-sql.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "id", - "amount", - "initialpsbt" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "node id of the remote peer" - }, - "amount": { - "type": "sat", - "description": "satoshi value that we will contribute to the channel. This value will be _added_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel" - }, - "initialpsbt": { - "type": "string", - "description": "funded, incomplete PSBT that specifies the UTXOs and change output for our channel contribution. It can be updated, see `openchannel_update`; *initialpsbt* must have at least one input. Must have the Non-Witness UTXO (PSBT_IN_NON_WITNESS_UTXO) set for every input. An error (code 309) will be returned if this requirement is not met" - }, - "commitment_feerate": { - "type": "feerate", - "description": "feerate for commitment transactions for non-anchor channels: see **fundchannel**. For anchor channels, it is ignored" - }, - "funding_feerate": { - "type": "feerate", - "description": "feerate for the funding transaction. Defaults to 'opening' feerate" - }, - "announce": { - "type": "boolean", - "description": "whether or not to announce this channel" - }, - "close_to": { - "type": "string", - "description": "bitcoin address to which the channel funds should be sent on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`" - }, - "request_amt": { - "type": "msat", - "description": "an amount of liquidity you'd like to lease from the peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*" - }, - "compact_lease": { - "type": "hex", - "description": "a compact represenation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel" - }, - "channel_type": { - "type": "array", - "description": "Each bit set in this channel_type", - "items": { - "type": "u32", - "description": "Bit number" + "added": "v23.02", + "rpc": "sql", + "title": "Command to do complex queries on list commands", + "description": [ + "The **sql** RPC command runs the given query across a sqlite3 database created from various list commands.", + "", + "When tables are accessed, it calls the below commands, so it's no faster than any other local access (though it goes to great length to cache `listnodes` and `listchannels`) which then processes the results.", + "", + "It is, however faster for remote access if the result of the query is much smaller than the list commands would be." + ], + "request": { + "required": [ + "query" + ], + "properties": { + "query": { + "type": "string", + "description": [ + "The standard sqlite3 query to run.", + "Note that queries like \"SELECT *\" are fragile, as columns will change across releases; see lightning-listsqlschemas(7)." + ] } } - } - }, - "openchannel_init.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channel_id", - "psbt", - "channel_type", - "commitments_secured", - "funding_serial" - ], - "properties": { - "channel_id": { - "type": "hex", - "description": "the channel id of the channel", - "maxLength": 64, - "minLength": 64 - }, - "psbt": { - "type": "string", - "description": "the (incomplete) PSBT of the funding transaction" - }, - "channel_type": { - "type": "object", - "description": "channel_type as negotiated with peer", - "added": "v24.02", - "additionalProperties": false, - "required": [ - "bits", - "names" - ], - "properties": { - "bits": { - "type": "array", - "description": "Each bit set in this channel_type", - "added": "v24.02", - "items": { - "type": "u32", - "description": "Bit number" - } - }, - "names": { - "type": "array", - "description": "Feature name for each bit set in this channel_type", - "added": "v24.02", - "items": { - "type": "string", - "enum": [ - "static_remotekey/even", - "anchor_outputs/even", - "anchors_zero_fee_htlc_tx/even", - "scid_alias/even", - "zeroconf/even" - ], - "description": "Name of feature bit" - } + }, + "response": { + "required": [ + "rows" + ], + "properties": { + "rows": { + "type": "array", + "items": { + "type": "array" } + }, + "warning_db_failure": { + "type": "string", + "description": [ + "A message if the database encounters an error partway through." + ] } }, - "commitments_secured": { - "type": "boolean", - "enum": [ - false - ], - "description": "whether the *psbt* is complete" - }, - "funding_serial": { - "type": "u64", - "description": "the serial_id of the funding output in the *psbt*" - }, - "requires_confirmed_inputs": { - "type": "boolean", - "description": "Does peer require confirmed inputs in psbt?" - } - } - }, - "openchannel_signed.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channel_id", - "signed_psbt" - ], - "properties": { - "channel_id": { - "type": "hash", - "description": "id of the channel" - }, - "signed_psbt": { - "type": "string", - "description": "the PSBT returned from `openchannel_update` (where *commitments_secured* was true) with partial signatures or finalized witness stacks included for every input that we contributed to the PSBT" - } - } - }, - "openchannel_signed.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channel_id", - "tx", - "txid" - ], - "properties": { - "channel_id": { - "type": "hex", - "description": "the channel id of the channel", - "maxLength": 64, - "minLength": 64 - }, - "tx": { - "type": "hex", - "description": "the funding transaction" + "pre_return_value_notes": [ + "On success, an object containing **rows** is returned. It is an array. Each array entry contains an array of values, each an integer, real number, string or *null*, depending on the sqlite3 type.", + "", + "The object may contain **warning_db_failure** if the database fails partway through its operation." + ] + }, + "treatment_of_types": [ + "The following types are supported in schemas, and this shows how they are presented in the database. This matters: a JSON boolean is represented as an integer in the database, so a query will return 0 or 1, not true or false.", + "", + "* *hex*. A hex string.", + " * JSON: a string", + " * sqlite3: BLOB", + "", + "* *hash*/*secret*/*pubkey*/*txid*: just like *hex*.", + "", + "* *msat*/*integer*/*u64*/*u32*/*u16*/*u8*. Normal numbers.", + " * JSON: an unsigned integer", + " * sqlite3: INTEGER", + "", + "* *boolean*. True or false.", + " * JSON: literal **true** or **false**", + " * sqlite3: INTEGER", + "", + "* *number*. A floating point number (used for times in some places).", + " * JSON: number", + " * sqlite3: REAL", + "", + "* *string*. Text.", + " * JSON: string", + " * sqlite3: TEXT", + "", + "* *short_channel_id*. A short-channel-id of form 1x2x3.", + " * JSON: string", + " * sqlite3: TEXT" + ], + "permitted_sqlite3_functions": [ + "Writing to the database is not permitted, and limits are placed on various other query parameters.", + "", + "Additionally, only the following functions are allowed:", + "", + "* abs", + "* avg", + "* coalesce", + "* count", + "* hex", + "* quote", + "* length", + "* like", + "* lower", + "* upper", + "* min", + "* max", + "* sum", + "* total" + ], + "tables": [ + "Note that the first column of every table is a unique integer called `rowid`: this is used for related tables to refer to specific rows in their parent. sqlite3 usually has this as an implicit column, but we make it explicit as the implicit version is not allowed to be used as a foreign key.", + "", + "The following tables are currently supported:\n- `bkpr_accountevents` (see lightning-bkpr-listaccountevents(7))\n - `account` (type `string`, sqltype `TEXT`)\n - `type` (type `string`, sqltype `TEXT`)\n - `tag` (type `string`, sqltype `TEXT`)\n - `credit_msat` (type `msat`, sqltype `INTEGER`)\n - `debit_msat` (type `msat`, sqltype `INTEGER`)\n - `currency` (type `string`, sqltype `TEXT`)\n - `timestamp` (type `u32`, sqltype `INTEGER`)\n - `outpoint` (type `string`, sqltype `TEXT`)\n - `blockheight` (type `u32`, sqltype `INTEGER`)\n - `origin` (type `string`, sqltype `TEXT`)\n - `payment_id` (type `hex`, sqltype `BLOB`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `description` (type `string`, sqltype `TEXT`)\n - `fees_msat` (type `msat`, sqltype `INTEGER`)\n - `is_rebalance` (type `boolean`, sqltype `INTEGER`)\n - `part_id` (type `u32`, sqltype `INTEGER`)\n\n- `bkpr_income` (see lightning-bkpr-listincome(7))\n - `account` (type `string`, sqltype `TEXT`)\n - `tag` (type `string`, sqltype `TEXT`)\n - `credit_msat` (type `msat`, sqltype `INTEGER`)\n - `debit_msat` (type `msat`, sqltype `INTEGER`)\n - `currency` (type `string`, sqltype `TEXT`)\n - `timestamp` (type `u32`, sqltype `INTEGER`)\n - `description` (type `string`, sqltype `TEXT`)\n - `outpoint` (type `string`, sqltype `TEXT`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `payment_id` (type `hex`, sqltype `BLOB`)\n\n- `channels` indexed by `short_channel_id` (see lightning-listchannels(7))\n - `source` (type `pubkey`, sqltype `BLOB`)\n - `destination` (type `pubkey`, sqltype `BLOB`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `direction` (type `u32`, sqltype `INTEGER`)\n - `public` (type `boolean`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `message_flags` (type `u8`, sqltype `INTEGER`)\n - `channel_flags` (type `u8`, sqltype `INTEGER`)\n - `active` (type `boolean`, sqltype `INTEGER`)\n - `last_update` (type `u32`, sqltype `INTEGER`)\n - `base_fee_millisatoshi` (type `u32`, sqltype `INTEGER`)\n - `fee_per_millionth` (type `u32`, sqltype `INTEGER`)\n - `delay` (type `u32`, sqltype `INTEGER`)\n - `htlc_minimum_msat` (type `msat`, sqltype `INTEGER`)\n - `htlc_maximum_msat` (type `msat`, sqltype `INTEGER`)\n - `features` (type `hex`, sqltype `BLOB`)\n\n- `closedchannels` (see lightning-listclosedchannels(7))\n - `peer_id` (type `pubkey`, sqltype `BLOB`)\n - `channel_id` (type `hash`, sqltype `BLOB`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `opener` (type `string`, sqltype `TEXT`)\n - `closer` (type `string`, sqltype `TEXT`)\n - `private` (type `boolean`, sqltype `INTEGER`)\n - related table `closedchannels_channel_type_bits`, from JSON object `channel_type`\n - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `bits` (type `u32`, sqltype `INTEGER`)\n - related table `closedchannels_channel_type_names`, from JSON object `channel_type`\n - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `names` (type `string`, sqltype `TEXT`)\n - `total_local_commitments` (type `u64`, sqltype `INTEGER`)\n - `total_remote_commitments` (type `u64`, sqltype `INTEGER`)\n - `total_htlcs_sent` (type `u64`, sqltype `INTEGER`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `leased` (type `boolean`, sqltype `INTEGER`)\n - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`)\n - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`)\n - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`)\n - `total_msat` (type `msat`, sqltype `INTEGER`)\n - `final_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `min_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `max_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `last_commitment_txid` (type `hash`, sqltype `BLOB`)\n - `last_commitment_fee_msat` (type `msat`, sqltype `INTEGER`)\n - `close_cause` (type `string`, sqltype `TEXT`)\n - `last_stable_connection` (type `u64`, sqltype `INTEGER`)\n\n- `forwards` indexed by `in_channel and in_htlc_id` (see lightning-listforwards(7))\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `in_channel` (type `short_channel_id`, sqltype `TEXT`)\n - `in_htlc_id` (type `u64`, sqltype `INTEGER`)\n - `in_msat` (type `msat`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `received_time` (type `number`, sqltype `REAL`)\n - `out_channel` (type `short_channel_id`, sqltype `TEXT`)\n - `out_htlc_id` (type `u64`, sqltype `INTEGER`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `style` (type `string`, sqltype `TEXT`)\n - `fee_msat` (type `msat`, sqltype `INTEGER`)\n - `out_msat` (type `msat`, sqltype `INTEGER`)\n - `resolved_time` (type `number`, sqltype `REAL`)\n - `failcode` (type `u32`, sqltype `INTEGER`)\n - `failreason` (type `string`, sqltype `TEXT`)\n\n- `htlcs` indexed by `short_channel_id and id` (see lightning-listhtlcs(7))\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `expiry` (type `u32`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `direction` (type `string`, sqltype `TEXT`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `state` (type `string`, sqltype `TEXT`)\n\n- `invoices` indexed by `payment_hash` (see lightning-listinvoices(7))\n - `label` (type `string`, sqltype `TEXT`)\n - `description` (type `string`, sqltype `TEXT`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `status` (type `string`, sqltype `TEXT`)\n - `expires_at` (type `u64`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `bolt11` (type `string`, sqltype `TEXT`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `local_offer_id` (type `hash`, sqltype `BLOB`)\n - `invreq_payer_note` (type `string`, sqltype `TEXT`)\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `pay_index` (type `u64`, sqltype `INTEGER`)\n - `amount_received_msat` (type `msat`, sqltype `INTEGER`)\n - `paid_at` (type `u64`, sqltype `INTEGER`)\n - `paid_outpoint_txid` (type `txid`, sqltype `BLOB`, from JSON object `paid_outpoint`)\n - `paid_outpoint_outnum` (type `u32`, sqltype `INTEGER`, from JSON object `paid_outpoint`)\n - `payment_preimage` (type `secret`, sqltype `BLOB`)\n\n- `nodes` indexed by `nodeid` (see lightning-listnodes(7))\n - `nodeid` (type `pubkey`, sqltype `BLOB`)\n - `last_timestamp` (type `u32`, sqltype `INTEGER`)\n - `alias` (type `string`, sqltype `TEXT`)\n - `color` (type `hex`, sqltype `BLOB`)\n - `features` (type `hex`, sqltype `BLOB`)\n - related table `nodes_addresses`\n - `row` (reference to `nodes.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `type` (type `string`, sqltype `TEXT`)\n - `port` (type `u16`, sqltype `INTEGER`)\n - `address` (type `string`, sqltype `TEXT`)\n - `option_will_fund_lease_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_lease_fee_basis` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_funding_weight` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_channel_fee_max_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_channel_fee_max_proportional_thousandths` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_compact_lease` (type `hex`, sqltype `BLOB`, from JSON object `option_will_fund`)\n\n- `offers` indexed by `offer_id` (see lightning-listoffers(7))\n - `offer_id` (type `hash`, sqltype `BLOB`)\n - `active` (type `boolean`, sqltype `INTEGER`)\n - `single_use` (type `boolean`, sqltype `INTEGER`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `used` (type `boolean`, sqltype `INTEGER`)\n - `label` (type `string`, sqltype `TEXT`)\n\n- `peerchannels` indexed by `peer_id` (see lightning-listpeerchannels(7))\n - `peer_id` (type `pubkey`, sqltype `BLOB`)\n - `peer_connected` (type `boolean`, sqltype `INTEGER`)\n - `reestablished` (type `boolean`, sqltype `INTEGER`)\n - `state` (type `string`, sqltype `TEXT`)\n - `scratch_txid` (type `txid`, sqltype `BLOB`)\n - related table `peerchannels_channel_type_bits`, from JSON object `channel_type`\n - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `bits` (type `u32`, sqltype `INTEGER`)\n - related table `peerchannels_channel_type_names`, from JSON object `channel_type`\n - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `names` (type `string`, sqltype `TEXT`)\n - `local_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `local`)\n - `local_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `local`)\n - `remote_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `remote`)\n - `ignore_fee_limits` (type `boolean`, sqltype `INTEGER`)\n - `lost_state` (type `boolean`, sqltype `INTEGER`)\n - `feerate_perkw` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`)\n - `feerate_perkb` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`)\n - `owner` (type `string`, sqltype `TEXT`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `channel_id` (type `hash`, sqltype `BLOB`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `initial_feerate` (type `string`, sqltype `TEXT`)\n - `last_feerate` (type `string`, sqltype `TEXT`)\n - `next_feerate` (type `string`, sqltype `TEXT`)\n - `next_fee_step` (type `u32`, sqltype `INTEGER`)\n - related table `peerchannels_inflight`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `feerate` (type `string`, sqltype `TEXT`)\n - `total_funding_msat` (type `msat`, sqltype `INTEGER`)\n - `splice_amount` (type `integer`, sqltype `INTEGER`)\n - `our_funding_msat` (type `msat`, sqltype `INTEGER`)\n - `scratch_txid` (type `txid`, sqltype `BLOB`)\n - `close_to` (type `hex`, sqltype `BLOB`)\n - `private` (type `boolean`, sqltype `INTEGER`)\n - `opener` (type `string`, sqltype `TEXT`)\n - `closer` (type `string`, sqltype `TEXT`)\n - related table `peerchannels_features`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `features` (type `string`, sqltype `TEXT`)\n - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_local_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_remote_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `min_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `max_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `total_msat` (type `msat`, sqltype `INTEGER`)\n - `fee_base_msat` (type `msat`, sqltype `INTEGER`)\n - `fee_proportional_millionths` (type `u32`, sqltype `INTEGER`)\n - `dust_limit_msat` (type `msat`, sqltype `INTEGER`)\n - `max_total_htlc_in_msat` (type `msat`, sqltype `INTEGER`)\n - `their_reserve_msat` (type `msat`, sqltype `INTEGER`)\n - `our_reserve_msat` (type `msat`, sqltype `INTEGER`)\n - `spendable_msat` (type `msat`, sqltype `INTEGER`)\n - `receivable_msat` (type `msat`, sqltype `INTEGER`)\n - `minimum_htlc_in_msat` (type `msat`, sqltype `INTEGER`)\n - `minimum_htlc_out_msat` (type `msat`, sqltype `INTEGER`)\n - `maximum_htlc_out_msat` (type `msat`, sqltype `INTEGER`)\n - `their_to_self_delay` (type `u32`, sqltype `INTEGER`)\n - `our_to_self_delay` (type `u32`, sqltype `INTEGER`)\n - `max_accepted_htlcs` (type `u32`, sqltype `INTEGER`)\n - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - related table `peerchannels_state_changes`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `timestamp` (type `string`, sqltype `TEXT`)\n - `old_state` (type `string`, sqltype `TEXT`)\n - `new_state` (type `string`, sqltype `TEXT`)\n - `cause` (type `string`, sqltype `TEXT`)\n - `message` (type `string`, sqltype `TEXT`)\n - related table `peerchannels_status`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `in_payments_offered` (type `u64`, sqltype `INTEGER`)\n - `in_offered_msat` (type `msat`, sqltype `INTEGER`)\n - `in_payments_fulfilled` (type `u64`, sqltype `INTEGER`)\n - `in_fulfilled_msat` (type `msat`, sqltype `INTEGER`)\n - `out_payments_offered` (type `u64`, sqltype `INTEGER`)\n - `out_offered_msat` (type `msat`, sqltype `INTEGER`)\n - `out_payments_fulfilled` (type `u64`, sqltype `INTEGER`)\n - `out_fulfilled_msat` (type `msat`, sqltype `INTEGER`)\n - `last_stable_connection` (type `u64`, sqltype `INTEGER`)\n - related table `peerchannels_htlcs`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `direction` (type `string`, sqltype `TEXT`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `expiry` (type `u32`, sqltype `INTEGER`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `local_trimmed` (type `boolean`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `state` (type `string`, sqltype `TEXT`)\n - `close_to_addr` (type `string`, sqltype `TEXT`)\n - `last_tx_fee_msat` (type `msat`, sqltype `INTEGER`)\n - `direction` (type `u32`, sqltype `INTEGER`)\n\n- `peers` indexed by `id` (see lightning-listpeers(7))\n - `id` (type `pubkey`, sqltype `BLOB`)\n - `connected` (type `boolean`, sqltype `INTEGER`)\n - `num_channels` (type `u32`, sqltype `INTEGER`)\n - related table `peers_netaddr`\n - `row` (reference to `peers.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `netaddr` (type `string`, sqltype `TEXT`)\n - `remote_addr` (type `string`, sqltype `TEXT`)\n - `features` (type `hex`, sqltype `BLOB`)\n\n- `sendpays` indexed by `payment_hash` (see lightning-listsendpays(7))\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `groupid` (type `u64`, sqltype `INTEGER`)\n - `partid` (type `u64`, sqltype `INTEGER`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `destination` (type `pubkey`, sqltype `BLOB`)\n - `created_at` (type `u64`, sqltype `INTEGER`)\n - `amount_sent_msat` (type `msat`, sqltype `INTEGER`)\n - `label` (type `string`, sqltype `TEXT`)\n - `bolt11` (type `string`, sqltype `TEXT`)\n - `description` (type `string`, sqltype `TEXT`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `completed_at` (type `u64`, sqltype `INTEGER`)\n - `payment_preimage` (type `secret`, sqltype `BLOB`)\n - `erroronion` (type `hex`, sqltype `BLOB`)\n\n- `transactions` indexed by `hash` (see lightning-listtransactions(7))\n - `hash` (type `txid`, sqltype `BLOB`)\n - `rawtx` (type `hex`, sqltype `BLOB`)\n - `blockheight` (type `u32`, sqltype `INTEGER`)\n - `txindex` (type `u32`, sqltype `INTEGER`)\n - `locktime` (type `u32`, sqltype `INTEGER`)\n - `version` (type `u32`, sqltype `INTEGER`)\n - related table `transactions_inputs`\n - `row` (reference to `transactions.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`)\n - `sequence` (type `u32`, sqltype `INTEGER`)\n - related table `transactions_outputs`\n - `row` (reference to `transactions.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `scriptPubKey` (type `hex`, sqltype `BLOB`)" + ], + "errors": [ + "On failure, an error is returned." + ], + "example_usage": [ + "Here are some example using lightning-cli. Note that you may need to use `-o` if you use queries which contain `=` (which make lightning-cli(1) default to keyword style):", + "", + "A simple peer selection query:", + "", + "```shell", + "$ lightning-cli sql \"SELECT id FROM peers\"", + "{", + " \"rows\": [", + " [", + " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\"", + " ]", + " ]", + "}", + "```", + "", + "A statement containing using `=` needs `-o`:", + "", + "```shell", + "$ lightning-cli sql -o \"SELECT node_id,last_timestamp FROM nodes WHERE last_timestamp>=1669578892\"", + "{", + " \"rows\": [", + " [", + " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\",", + " 1669601603", + " ]", + " ]", + "}", + "```", + "", + "If you want to compare a BLOB column, `x'hex'` or `X'hex'` are needed:", + "", + "```shell", + "$ lightning-cli sql -o \"SELECT nodeid FROM nodes WHERE nodeid != x'03c9d25b6c0ce4bde5ad97d7ab83f00ae8bd3800a98ccbee36f3c3205315147de1';\"", + "{", + " \"rows\": [", + " [", + " \"0214739d625944f8fdc0da9d2ef44dbd7af58443685e494117b51410c5c3ff973a\"", + " ],", + " [", + " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\"", + " ]", + " ]", + "}", + "$ lightning-cli sql -o \"SELECT nodeid FROM nodes WHERE nodeid IN (x'03c9d25b6c0ce4bde5ad97d7ab83f00ae8bd3800a98ccbee36f3c3205315147de1', x'02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00')\"", + "{", + " \"rows\": [", + " [", + " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\"", + " ],", + " [", + " \"03c9d25b6c0ce4bde5ad97d7ab83f00ae8bd3800a98ccbee36f3c3205315147de1\"", + " ]", + " ]", + "}", + "```", + "", + "Related tables are usually referenced by JOIN:", + "", + "```shell", + "$ lightning-cli sql -o \"SELECT nodeid, alias, nodes_addresses.type, nodes_addresses.port, nodes_addresses.address FROM nodes INNER JOIN nodes_addresses ON nodes_addresses.row = nodes.rowid\"", + "{", + " \"rows\": [", + " [", + " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\",", + " \"YELLOWWATCH-22.11rc2-31-gcd7593b\",", + " \"dns\",", + " 7272,", + " \"localhost\"", + " ],", + " [", + " \"0214739d625944f8fdc0da9d2ef44dbd7af58443685e494117b51410c5c3ff973a\",", + " \"HOPPINGSQUIRREL-1rc2-31-gcd7593b\",", + " \"dns\",", + " 7171,", + " \"localhost\"", + " ]", + " ]", + "}", + "```", + "", + "Simple function usage, in this case COUNT. Strings inside arrays need \", and ' to protect them from the shell:", + "", + "```shell", + "$ lightning-cli sql 'SELECT COUNT(*) FROM nodes\"", + "{", + " \"rows\": [", + " [", + " 3", + " ]", + " ]", + "}", + "```" + ], + "example_json_request": [ + { + "id": "example:sql#1", + "method": "sql", + "params": [ + "SELECT * FROM forwards;" + ] }, - "txid": { - "type": "txid", - "description": "The txid of the **tx**" + { + "id": "example:sql#2", + "method": "sql", + "params": [ + "SELECT * from peerchannels_features" + ] } - } - }, - "openchannel_update.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channel_id", - "psbt" - ], - "properties": { - "channel_id": { - "type": "hash", - "description": "id of the channel" + ], + "example_json_response": [ + { + "rows": [] }, - "psbt": { - "type": "string", - "description": "updated PSBT to be sent to the peer. May be identical to the PSBT last returned by either `openchannel_init` or `openchannel_update`" + { + "rows": [ + [ + 6, + 1, + 0, + "option_static_remotekey" + ], + [ + 7, + 1, + 1, + "option_anchors_zero_fee_htlc_tx" + ], + [ + 16, + 11, + 0, + "option_static_remotekey" + ], + [ + 17, + 11, + 1, + "option_anchors_zero_fee_htlc_tx" + ] + ] } - } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listtransactions(7)", + "lightning-listchannels(7)", + "lightning-listpeers(7)", + "lightning-listnodes(7)", + "lightning-listforwards(7)" + ], + "resources": [ + "Main web site: " + ] }, - "openchannel_update.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-staticbackup.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "channel_id", - "psbt", - "commitments_secured", - "channel_type", - "funding_outnum" - ], - "properties": { - "channel_id": { - "type": "hex", - "description": "the channel id of the channel", - "maxLength": 64, - "minLength": 64 - }, - "channel_type": { - "type": "object", - "description": "channel_type as negotiated with peer", - "added": "v24.02", - "additionalProperties": false, - "required": [ - "bits", - "names" - ], - "properties": { - "bits": { - "type": "array", - "description": "Each bit set in this channel_type", - "added": "v24.02", - "items": { - "type": "u32", - "description": "Bit number" - } - }, - "names": { - "type": "array", - "description": "Feature name for each bit set in this channel_type", - "added": "v24.02", - "items": { - "type": "string", - "enum": [ - "static_remotekey/even", - "anchor_outputs/even", - "anchors_zero_fee_htlc_tx/even", - "scid_alias/even", - "zeroconf/even" - ], - "description": "Name of feature bit" - } + "rpc": "staticbackup", + "title": "Command for deriving getting SCB of all the existing channels", + "description": [ + "The **staticbackup** RPC command returns an object with SCB of all the channels in an array." + ], + "request": { + "required": [], + "properties": {} + }, + "response": { + "required": [ + "scb" + ], + "properties": { + "scb": { + "type": "array", + "items": { + "type": "hex", + "description": [ + "SCB of a channel in TLV format." + ] } } - }, - "psbt": { - "type": "string", - "description": "the PSBT of the funding transaction" - }, - "commitments_secured": { - "type": "boolean", - "description": "whether the *psbt* is complete (if true, sign *psbt* and call `openchannel_signed` to complete the channel open)" - }, - "funding_outnum": { - "type": "u32", - "description": "The index of the funding output in the psbt" - }, - "close_to": { - "type": "hex", - "description": "scriptPubkey which we have to close to if we mutual close" - }, - "requires_confirmed_inputs": { - "type": "boolean", - "description": "Does peer require confirmed inputs in psbt?" } - } - }, - "parsefeerate.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "feerate_str" + }, + "example_json_request": [ + { + "id": "example:staticbackup#1", + "method": "staticbackup", + "params": "{}" + } ], - "properties": { - "feerate_str": { - "type": "string", - "description": "The feerate string to parse" + "example_json_response": [ + { + "scb": [ + "0000000000000001c707da9b230e1655b0a6c082b8daf4fa44d9d1f68163ed4d531d45cf453dc651022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d5900017f000001b2e3c707da9b230e1655b0a6c082b8daf4fa44d9d1f68163ed4d531d45cf453dc6510000000000000000000186a000021000" + ] } - } - }, - "parsefeerate.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "perkw": { - "type": "u32", - "description": "Value of *feerate_str* in kilosipa", - "additionalProperties": false - } - } + ], + "author": [ + "Aditya <> is mainly responsible." + ], + "see_also": [ + "lightning-getsharedsecret(7)" + ], + "resources": [ + "Main web site: " + ] }, - "pay.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-stop.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "bolt11" + "rpc": "stop", + "title": "Command to shutdown the Core Lightning node.", + "description": [ + "The **stop** is a RPC command to shut off the Core Lightning node." ], - "properties": { - "bolt11": { - "type": "string", - "description": "bolt11 invoice, if **experimental-offers** is enabled, it can actually be a bolt12 invoice, such as one received from lightningd-fetchinvoice(7). If it does not contain an amount, *amount_msat* is required, otherwise if it is specified it must be *null*" - }, - "amount_msat": { - "type": "msat", - "description": "*amount_msat* is in millisatoshi precision; it can be a whole number, or a whole number with suffix *msat* or *sat*, or a three decimal point number with suffix *sat*, or an 1 to 11 decimal point number suffixed by *btc*" - }, - "label": { - "type": "string", - "description": "it is used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7)" - }, - "riskfactor": { - "type": "number", - "description": "the *riskfactor* is described in detail in lightning-getroute(7), and defaults to 10" - }, - "maxfeepercent": { - "type": "number", - "description": "percentage of the amount that is to be paid. Defaults to 0.5" - }, - "retry_for": { - "type": "u16", - "description": "until *retry_for* seconds passes, the command will keep finding routes and retrying the payment. Defaults to 60 seconds" - }, - "maxdelay": { - "type": "u16", - "description": "a payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case" - }, - "exemptfee": { - "type": "msat", - "description": "this option can be used for tiny payments which would be dominated by the fee leveraged by forwarding nodes. Setting `exemptfee` allows the `maxfeepercent` check to be skipped on fees that are smaller than `exemptfee`. Defaults to 5000 millisatoshi" - }, - "localinvreqid": { - "type": "hex", - "description": "`localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7). This ensures that we only make a single payment for an offer, and that the offer is marked `used` once paid" - }, - "exclude": { - "type": "array", - "description": "*exclude* is a JSON array of short-channel-id/direction (e.g. [ '564334x877x1/0', '564195x1292x0/1' ]) or pubkey which should be excluded from consideration for routing. The default is not to exclude any channels or nodes", - "items": { - "oneOf": [ - { - "type": "short_channel_id_dir" - }, - { - "type": "pubkey" - } + "request": { + "required": [], + "properties": {} + }, + "response": { + "required": [ + "result" + ], + "properties": { + "result": { + "type": "string", + "added": "v24.05", + "enum": [ + "Shutdown complete" ] } - }, - "maxfee": { - "type": "msat", - "description": "*maxfee* overrides both *maxfeepercent* and *exemptfee* defaults (and if you specify *maxfee* you cannot specify either of those), and creates an absolute limit on what fee we will pay. This allows you to implement your own heuristics rather than the primitive ones used here" - }, - "description": { - "type": "string", - "description": "it is only required for bolt11 invoices which do not contain a description themselves, but contain a description hash: in this case *description* is required. *description* is then checked against the hash inside the invoice before it will be paid" } - } - }, - "pay.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "payment_preimage", - "payment_hash", - "created_at", - "parts", - "amount_msat", - "amount_sent_msat", - "status" - ], - "properties": { - "payment_preimage": { - "type": "secret", - "description": "the proof of payment: SHA256 of this **payment_hash**" - }, - "destination": { - "type": "pubkey", - "description": "the final destination of the payment" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "created_at": { - "type": "number", - "description": "the UNIX timestamp showing when this payment was initiated" - }, - "parts": { - "type": "u32", - "description": "how many attempts this took" - }, - "amount_msat": { - "type": "msat", - "description": "Amount the recipient received" - }, - "amount_sent_msat": { - "type": "msat", - "description": "Total amount we sent (including fees)" - }, - "warning_partial_completion": { - "type": "string", - "description": "Not all parts of a multi-part payment have completed" - }, - "status": { - "type": "string", - "enum": [ - "complete", - "pending", - "failed" - ], - "description": "status of payment" + }, + "example_json_request": [ + { + "id": "example:stop#1", + "method": "stop", + "params": {} } - } - }, - "ping.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "id" ], - "additionalProperties": false, - "properties": { - "id": { - "type": "pubkey", - "description": "The pubkey of the node to ping" - }, - "len": { - "type": "u16", - "description": "the length of the ping. Defaults to 128" - }, - "pongbytes": { - "type": "u16", - "description": "the length of the reply. A value of 65532 to 65535 means `don't reply`. Defaults to 128" + "example_json_response": [ + { + "result": "Shutdown complete" } - } + ], + "author": [ + "Vincenzo Palazzo <> wrote the initial version of this man page,", + "but many others did the hard work of actually implementing this rpc command." + ], + "resources": [ + "Main web site: " + ] }, - "ping.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-txdiscard.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "totlen" + "rpc": "txdiscard", + "title": "Abandon a transaction from txprepare, release inputs", + "description": [ + "The **txdiscard** RPC command releases inputs which were reserved for use of the *txid* from lightning-txprepare(7)." + ], + "request": { + "required": [ + "txid" + ], + "properties": { + "txid": { + "type": "txid", + "description": [ + "The transaction id, inputs should be unreseverd from." + ] + } + } + }, + "response": { + "required": [ + "unsigned_tx", + "txid" + ], + "properties": { + "unsigned_tx": { + "type": "hex", + "description": [ + "The unsigned transaction." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The transaction id of *unsigned_tx*." + ] + } + }, + "post_return_value_notes": [ + "If there is no matching *txid*, an error is reported. Note that this may happen due to incorrect usage, such as **txdiscard** or **txsend** already being called for *txid*." + ] + }, + "errors": [ + "The following error codes may occur:", + "", + "- -1: An unknown *txid*." ], - "properties": { - "totlen": { - "type": "u16", - "description": "the answer length of the reply message (including header: 0 means no reply expected)" + "example_json_request": [ + { + "id": "example:txdiscard#1", + "method": "txdiscard", + "params": { + "txid": "6e680cb76077f11c838cc7aee0c0aa360f9857f00856bb1614025a1af53739fc" + } } - } - }, - "plugin.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": true, - "required": [ - "subcommand" ], - "properties": { - "subcommand": { - "type": "string", - "enum": [ - "start", - "stop", - "rescan", - "startdir", - "list" - ], - "description": "determines what action is taken" - }, - "plugin": { - "type": "string", - "description": "*path* or *name* of a plugin executable to start or stop" - }, - "directory": { - "type": "string", - "description": "*path* of a directory containing plugins" + "example_json_response": [ + { + "unsigned_tx": "020000000142dc00d81359c3a551e170e3bf5262fa9cacc2eb2e283a10e579491cd86dce4b0000000000fdffffff02ffffff00000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd42839800000000002251207836355fdc8a82dc4cb00a772c5554151d06384a4dd65e8d3f68ac08566b84be66000000", + "txid": "6e680cb76077f11c838cc7aee0c0aa360f9857f00856bb1614025a1af53739fc" } - } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-txprepare(7)", + "lightning-txsend(7)" + ], + "resources": [ + "Main web site: " + ] }, - "plugin.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-txprepare.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", - "additionalProperties": true, - "required": [ - "command" + "additionalProperties": false, + "rpc": "txprepare", + "title": "Command to prepare to withdraw funds from the internal wallet", + "description": [ + "The **txprepare** RPC command creates an unsigned transaction which spends funds from Core Lightning's internal wallet to the outputs specified in *outputs*.", + "", + "**txprepare** is similar to the first part of a **withdraw** command, but supports multiple outputs and uses *outputs* as parameter. The second part is provided by **txsend**." ], - "properties": { - "command": { - "type": "string", - "enum": [ - "start", - "stop", - "rescan", - "startdir", - "list" - ], - "description": "the subcommand this is responding to" + "request": { + "required": [ + "outputs" + ], + "properties": { + "outputs": { + "type": "array", + "description": [ + "Format is like: [{destination1: amount1}, {destination2: amount2}] or [{destination: *all*}]. It supports any number of **confirmed** outputs." + ], + "items": { + "type": "outputdesc" + } + }, + "feerate": { + "type": "feerate", + "description": [ + "Used for the transaction as initial feerate." + ], + "default": "*normal*" + }, + "minconf": { + "type": "u32", + "description": [ + "The minimum number of confirmations that used outputs should have." + ], + "default": 1 + }, + "utxos": { + "type": "array", + "description": [ + "To be used to fund the transaction, as an array of `txid:vout`. These must be drawn from the node's available UTXO set." + ], + "items": { + "type": "outpoint" + } + } + } + }, + "response": { + "required": [ + "psbt", + "unsigned_tx", + "txid" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "The PSBT representing the unsigned transaction." + ] + }, + "unsigned_tx": { + "type": "hex", + "description": [ + "The unsigned transaction." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The transaction id of *unsigned_tx*; you hand this to lightning-txsend(7) or lightning-txdiscard(7), as the inputs of this transaction are reserved." + ] + } } }, - "allOf": [ + "errors": [ + "On failure, an error is reported and the transaction is not created.", + "", + "- -1: Catchall nonspecific error.", + "- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.", + "- 302: The dust limit is not met." + ], + "example_json_request": [ { - "if": { - "properties": { - "command": { - "type": "string", - "enum": [ - "start", - "startdir", - "rescan", - "list" - ] + "id": "example:txprepare#1", + "method": "txprepare", + "params": { + "outputs": [ + { + "bcrt1qtwxd8wg5eanumk86vfeujvp48hfkgannf77evggzct048wggsrxsum2pmm": 16777215 } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "command", - "plugins" ], - "properties": { - "command": {}, - "plugins": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "name", - "active", - "dynamic" - ], - "properties": { - "name": { - "type": "string", - "description": "full pathname of the plugin" - }, - "active": { - "type": "boolean", - "description": "status; plugin completed init and is operational, plugins are configured asynchronously." - }, - "dynamic": { - "type": "boolean", - "description": "plugin can be stopped or started without restarting lightningd" - } - } - } - } - } + "feerate": null, + "minconf": null, + "utxos": null } }, { - "if": { - "properties": { - "command": { - "type": "string", - "enum": [ - "stop" - ] + "id": "example:txprepare#2", + "method": "txprepare", + "params": { + "outputs": [ + { + "bcrt1qyhu7rxj3rrlcj84jtzp2mk9d89xm9v2rx4d4h8au830axugx6mmqsuplng": "100000sat" } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "command", - "result" ], - "properties": { - "command": {}, - "result": { - "type": "string", - "description": "A message saying it successfully stopped" - } - } + "feerate": null, + "minconf": null, + "utxos": null } } - ] - }, - "preapproveinvoice.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "added": "v23.02", - "required": [ - "bolt11" ], - "properties": { - "bolt11": { - "type": "string", - "description": "bolt11 invoice to submit to the HSM to check", - "added": "v23.02" - } - } - }, - "preapproveinvoice.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "added": "v23.02", - "properties": {} - }, - "preapprovekeysend.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "added": "v23.02", - "required": [ - "destination", - "payment_hash", - "amount_msat" - ], - "properties": { - "destination": { - "type": "pubkey", - "description": "it is a 33 byte, hex-encoded, node ID of the node that the payment should go to", - "added": "v23.02" - }, - "payment_hash": { - "type": "hex", - "added": "v23.02", - "description": "it is the unique identifier of a payment", - "maxLength": 64, - "minLength": 64 + "example_json_response": [ + { + "unsigned_tx": "020000000142dc00d81359c3a551e170e3bf5262fa9cacc2eb2e283a10e579491cd86dce4b0000000000fdffffff02ffffff00000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd42839800000000002251207836355fdc8a82dc4cb00a772c5554151d06384a4dd65e8d3f68ac08566b84be66000000", + "txid": "6e680cb76077f11c838cc7aee0c0aa360f9857f00856bb1614025a1af53739fc", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABATRHoQ9tEMHRHpf06v5uTEdjdMk1rccIaA6MNGMipNQWAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFLnqitWTi465LGxeucwoSAj16NGbAkcwRAIgVtOsUaQaPgH86aW6e6qmJa1xVb8KWvc+HALGosqVVmQCIFi4JU8Gy+vl2a2/frY+71hitYIBB/tjsRP7fpgb8b9TASECHUIV5q1r2ownjOlAFPQASTlZxxNgBvi5O3hCRvajwdJlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIELcANgTWcOlUeFw479SYvqcrMLrLig6EOV5SRzYbc5LAQ8EAAAAAAEQBP3///8AAQMI////AAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAAEDCEKDmAAAAAAAAQQiUSB4NjVf3IqC3EywCncsVVQVHQY4Sk3WXo0/aKwIVmuEvgA=" }, - "amount_msat": { - "type": "msat", - "description": "the amount to send in millisatoshi precision; it can be a whole number, or a whole number with suffix `msat` or `sat`, or a three decimal point number with suffix `sat`, or an 1 to 11 decimal point number suffixed by `btc`", - "added": "v23.02" + { + "unsigned_tx": "0200000001a91077a134fb9fe4a8d13a482b718368bfd9ce3eff61ff7d96549480a1f97dca0100000000fdffffff02a08601000000000022002025f9e19a5118ff891eb25882add8ad394db2b143355b5b9fbc3c5fd37106d6f66173010000000000225120a2a01c7965289eee56b5cfcddb9856c70fa476c264d21f711c6a69af776ae40366000000", + "txid": "f11d436054607603e903fc69c4bd9b39ce97421341c7cf814ad025cb5bf59c1c", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABAYZ4QwAgPq6Os8kk073f5Yx4T9LXYfbOjAdkzMXfuBQdAAAAAAD9////AjPkAioBAAAAFgAUeOeqzyifepeJAMCl4vnnJ/TRptRADQMAAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgYBFwmqWCrVkxxZ0/tte3z4lIem0L7MkhXzGAOvBWa6YCIFx7H4zOzxjixlZMi0DYYbIEflDjYHJXLfN1wVcXYuekASEDgztw/3Rks6vKGYMXJ83VEvQcNIjg3rJW6KdxEh26uwplAAAAAQEfQA0DAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIKkQd6E0+5/kqNE6SCtxg2i/2c4+/2H/fZZUlICh+X3KAQ8EAQAAAAEQBP3///8AAQMIoIYBAAAAAAABBCIAICX54ZpRGP+JHrJYgq3YrTlNsrFDNVtbn7w8X9NxBtb2AAEDCGFzAQAAAAAAAQQiUSCioBx5ZSie7la1z83bmFbHD6R2wmTSH3Ecammvd2rkAwA=" } - } - }, - "preapprovekeysend.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "properties": {} - }, - "recover.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "hsmsecret" ], - "properties": { - "hsmsecret": { - "type": "string", - "description": "either a codex32 secret starting with `cl1` as returned by `hsmtool getcodexsecret`, or a raw 64 character hex string" - } - } - }, - "recover.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "result" - ], - "properties": { - "result": { - "type": "string", - "added": "v24.05", - "enum": [ - "Recovery restart in progress" - ] - } - } + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-withdraw(7)", + "lightning-txsend(7)", + "lightning-txdiscard(7)", + "lightning-feerates(7)" + ], + "resources": [ + "Main web site: " + ] }, - "recoverchannel.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-txsend.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "scb" + "rpc": "txsend", + "title": "Command to sign and send transaction from txprepare", + "description": [ + "The **txsend** RPC command signs and broadcasts a transaction created by *txprepare* RPC command." ], - "properties": { - "scb": { - "type": "array", - "description": "SCB of the channels in an array", - "items": { - "type": "hexstr" + "request": { + "required": [ + "txid" + ], + "properties": { + "txid": { + "type": "txid", + "description": [ + "The transaction id of the transaction created by `txprepare` rpc command." + ] } } - } - }, - "recoverchannel.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "stubs" - ], - "properties": { - "stubs": { - "type": "array", - "items": { + }, + "response": { + "required": [ + "psbt", + "tx", + "txid" + ], + "properties": { + "psbt": { "type": "string", - "description": "Channel IDs of channels successfully inserted." + "description": [ + "The completed PSBT representing the signed transaction." + ] + }, + "tx": { + "type": "hex", + "description": [ + "The fully signed transaction." + ] + }, + "txid": { + "type": "txid", + "description": [ + "The transaction id of *tx*." + ] } } - } - }, - "renepay.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "invstring" + }, + "errors": [ + "On failure, an error is reported (from bitcoind), and the inputs from the transaction are unreserved.", + "", + "- -1: Catchall nonspecific error." ], - "properties": { - "invstring": { - "type": "string", - "description": "bolt11 invoice which the RPC command attempts to pay. Currently, **renepay** supports bolt11 invoices only" - }, - "amount_msat": { - "type": "msat", - "description": "if the *invstring* does not contain an amount, *amount_msat* is required, otherwise if it is specified it must be *null*. in millisatoshi precision; it can be a whole number, or a whole number with suffix *msat* or *sat*, or a three decimal point number with suffix *sat*, or an 1 to 11 decimal point number suffixed by *btc*" - }, - "maxfee": { - "type": "msat", - "description": "*maxfee* is a hard bound, in the sense that the command will never attempt a payment when the fees exceed that value" - }, - "maxdelay": { - "type": "u32", - "description": "overrides the value of `max-locktime-blocks` for this payment. It serves to limit the locktime of funds in the payment HTLC measured in blocks" - }, - "retry_for": { - "type": "u32", - "description": "measured in seconds specifies how much time it is allowed for the command to keep retrying the payment. Defaults to 60 seconds" - }, - "description": { - "type": "string", - "description": "only required for bolt11 invoices which do not contain a description themselves, but contain a description hash: in this case *description* is required. *description* is then checked against the hash inside the invoice before it will be paid" - }, - "label": { - "type": "string", - "description": "used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7)" - }, - "dev_use_shadow": { - "hidden": true, - "type": "boolean" - } - } - }, - "renepay.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "added": "v23.08", - "type": "object", - "additionalProperties": false, - "required": [ - "payment_preimage", - "payment_hash", - "created_at", - "parts", - "amount_msat", - "amount_sent_msat", - "status" - ], - "properties": { - "payment_preimage": { - "type": "secret", - "description": "the proof of payment: SHA256 of this **payment_hash**" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "created_at": { - "type": "number", - "description": "the UNIX timestamp showing when this payment was initiated" - }, - "parts": { - "type": "u32", - "description": "how many attempts this took" - }, - "amount_msat": { - "type": "msat", - "description": "amount the recipient received" - }, - "amount_sent_msat": { - "type": "msat", - "description": "total amount we sent (including fees)" - }, - "status": { - "type": "string", - "enum": [ - "complete", - "pending", - "failed" - ], - "description": "status of payment" - }, - "destination": { - "type": "pubkey", - "description": "the final destination of the payment" - } - } - }, - "renepaystatus.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "invstring": { - "type": "string", - "description": "if specified, the command will return a list of payment attempts whose invoice matches *invstring*, otherwise all payments with be listed" - } - } - }, - "renepaystatus.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "added": "v23.08", - "type": "object", - "additionalProperties": false, - "required": [ - "paystatus" - ], - "properties": { - "paystatus": { - "type": "array", - "description": "a list of payments attempted by renepay", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "bolt11", - "payment_hash", - "created_at", - "groupid", - "amount_msat", - "status", - "notes" - ], - "properties": { - "bolt11": { - "type": "string", - "description": "invoice string BOLT11" - }, - "payment_preimage": { - "type": "secret", - "description": "the proof of payment: SHA256 of this **payment_hash** (for completed payments only)" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "created_at": { - "type": "number", - "description": "the UNIX timestamp showing when this payment was initiated" - }, - "groupid": { - "type": "u32", - "description": "the id for this payment attempt" - }, - "parts": { - "type": "u32", - "description": "how many attempts this took" - }, - "amount_msat": { - "type": "msat", - "description": "amount the recipient received" - }, - "amount_sent_msat": { - "type": "msat", - "description": "total amount we sent including fees (for completed payments only)" - }, - "status": { - "type": "string", - "enum": [ - "complete", - "pending", - "failed" - ], - "description": "status of payment" - }, - "destination": { - "type": "pubkey", - "description": "the final destination of the payment" - }, - "notes": { - "type": "array", - "description": "a list of messages for debugging purposes", - "items": { - "type": "string", - "description": "a message generated by renepay" - } - } - } + "example_json_request": [ + { + "id": "example:txsend#1", + "method": "txsend", + "params": { + "txid": "c9f59ba6bda8e095bb43ecabfa37de8d5194e5c839b6b63be4e29bceaae483ce" } } - } - }, - "reserveinputs.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt" ], - "properties": { - "psbt": { - "type": "string", - "description": "the PSBT to reserve inputs from" - }, - "exclusive": { - "type": "boolean", - "description": "If set to *False*, existing reservations are simply extended, rather than causing failure" - }, - "reserve": { - "type": "u32", - "description": "the number of blocks to reserve. By default, reservations are for the next 72 blocks (approximately 6 hours)" + "example_json_response": [ + { + "tx": "020000000142dc00d81359c3a551e170e3bf5262fa9cacc2eb2e283a10e579491cd86dce4b0000000000fdffffff020000000100000000220020b636f07026ea64952ece5b7620a9337d9ac2321c796a499260994d1b373667504183980000000000225120754a77b503fcba0fd80f0a1a8226ed6764ff9a9d9bb61b485d40d4c9f4be245966000000", + "txid": "c9f59ba6bda8e095bb43ecabfa37de8d5194e5c839b6b63be4e29bceaae483ce", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABATRHoQ9tEMHRHpf06v5uTEdjdMk1rccIaA6MNGMipNQWAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFLnqitWTi465LGxeucwoSAj16NGbAkcwRAIgVtOsUaQaPgH86aW6e6qmJa1xVb8KWvc+HALGosqVVmQCIFi4JU8Gy+vl2a2/frY+71hitYIBB/tjsRP7fpgb8b9TASECHUIV5q1r2ownjOlAFPQASTlZxxNgBvi5O3hCRvajwdJlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZSICA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPRzBEAiBp/HPhg1ObOXqTr5rIjUYLMspGLz+sk1pjD9pjRFzf3wIgWycOB/dQPzwZAK3OXYs269h8o85ucDpdVhH4AyX69a0BIgYD10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8IAfrZCgAAAAABDiBC3ADYE1nDpVHhcOO/UmL6nKzC6y4oOhDleUkc2G3OSwEPBAAAAAABEAT9////AAEDCAAAAAEAAAAAAQQiACC2NvBwJupklS7OW3YgqTN9msIyHHlqSZJgmU0bNzZnUAABAwhBg5gAAAAAAAEEIlEgdUp3tQP8ug/YDwoagibtZ2T/mp2bthtIXUDUyfS+JFkhBycqmiXx/+1S+rBKLMiK6rE1tTcjhWqPFIHCZBf4ipIuCQDVXEk5CwAAAAA=" } - } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-txprepare(7)", + "lightning-txdiscard(7)" + ], + "resources": [ + "Main web site: " + ] }, - "reserveinputs.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-unreserveinputs.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "reservations" + "rpc": "unreserveinputs", + "title": "Release reserved UTXOs", + "description": [ + "The **unreserveinputs** RPC command releases (or reduces reservation) on UTXOs which were previously marked as reserved, generally by lightning-reserveinputs(7)." ], - "properties": { - "reservations": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "txid", - "vout", - "was_reserved", - "reserved", - "reserved_to_block" + "request": { + "required": [ + "psbt" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "Inputs to unreserve are the inputs specified in the passed-in *psbt*." + ] + }, + "reserve": { + "type": "u32", + "description": [ + "The number of blocks to decrease reservation by." ], - "properties": { - "txid": { - "type": "txid", - "description": "the transaction id" - }, - "vout": { - "type": "u32", - "description": "the output number which was reserved" - }, - "was_reserved": { - "type": "boolean", - "description": "whether the input was already reserved" - }, - "reserved": { - "type": "boolean", - "enum": [ - true - ], - "description": "whether the input is now reserved" + "default": 72 + } + } + }, + "response": { + "required": [ + "reservations" + ], + "properties": { + "reservations": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "txid", + "vout", + "was_reserved", + "reserved" + ], + "properties": { + "txid": { + "type": "txid", + "description": [ + "The transaction id." + ] + }, + "vout": { + "type": "u32", + "description": [ + "The output number which was reserved." + ] + }, + "was_reserved": { + "type": "boolean", + "description": [ + "Whether the input was already reserved (usually `true`)." + ] + }, + "reserved": { + "type": "boolean", + "description": [ + "Whether the input is now reserved (may still be `true` if it was reserved for a long time)." + ] + } }, - "reserved_to_block": { - "type": "u32", - "description": "what blockheight the reservation will expire" - } + "allOf": [ + { + "if": { + "additionalProperties": true, + "properties": { + "reserved": { + "enum": [ + true + ] + } + } + }, + "then": { + "required": [ + "reserved_to_block" + ], + "properties": { + "txid": {}, + "vout": {}, + "was_reserved": {}, + "reserved": {}, + "reserved_to_block": { + "type": "u32", + "description": [ + "What blockheight the reservation will expire." + ] + } + } + } + } + ] } } } - } - }, - "sendcustommsg.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "node_id", - "msg" + }, + "errors": [ + "On failure, an error is reported and no UTXOs are unreserved.", + "", + "- -32602: Invalid parameter, i.e. an unparseable PSBT." ], - "added": "v0.10.1", - "additionalProperties": false, - "properties": { - "node_id": { - "type": "pubkey", - "description": "the node specified by `node_id` must be a peer, i.e., it must have a direct connection with the node receiving the RPC call, and the connection must be established. For a method to send arbitrary messages over multiple hops, including hops that do not understand the custom message, see the `createonion` and `sendonion` RPC methods. Messages can only be injected if the connection is handled by `openingd` or `channeld`. Messages cannot be injected when the peer is handled by `onchaind` or `closingd` since these do not have a connection, or are synchronous daemons that do not handle spontaneous messages" + "example_json_request": [ + { + "id": "example:unreserveinputs#1", + "method": "unreserveinputs", + "params": { + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABAXyy20ynmOFyRbegGyApk50yNIAb4C+RKV5c2n5VKL3lAAAAAAD9////Akf0EAAAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WUs/fQpAQAAABYAFN9HebR4q6498ytdeRKjC64CkCOMAkcwRAIgSTJCpWVH1FLZYPdwFe7gZckxCtk+AxPp20KUVKqPIdUCIA3hkoUco68vffiwt6TrE3KgX09JE9m7PDUUgrHQANMRASEDBOBlCza/8qXE5q8uJ+OWsKscDERWfdA+LLCa/lwMH0BlAAAAAQEfR/QQAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZSICA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPRzBEAiBKjSasyN29ODqXSemEQCZfRIvbJP8thKRBrd4e+NLEMQIgMGNz3+DWDnLmjnIDCaVcC7BKxuycwvtJq1qlKFtTaXcBIgYD10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8IAfrZCgAAAAABDiAoXS6QUlCcOApG/j+hr4OhNt0tT4GvCzI6z16Hepi7OwEPBAAAAAABEAT9////AAEDCCN6CAAAAAAAAQQWABQfJ4Qjje0sa2yGBz++6jkM2hGRmAz8CWxpZ2h0bmluZwQCAAEAAQMIinkIAAAAAAABBCJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aIQeRRTKBKkQKTXZscc05GTaUo0CuEeAS5boa2e+6bnbKUwkAwsyrFwIAAAAA", + "reserve": 200 + } }, - "msg": { - "type": "hex", - "description": "must be a hex encoded well-formed message, including the 2-byte type prefix, but excluding the length prefix which will be added by the RPC method. The message types may not be one of the internally handled types, since that may cause issues with the internal state tracking of Core Lightning. We do (as of *v23.11*) allow sending of even types, but note that peers (as per the spec) will disconnect on receiving unknown even types" + { + "id": "example:unreserveinputs#2", + "method": "unreserveinputs", + "params": { + "psbt": "cHNidP8BAF4CAAAAAVa79WPJoiYrzo/RgzIAn5HanoBFZo0vZvEjxPAVwLv4AAAAAAD9////AXzpHAAAAAAAIlEgBRjpLNlOD2LAbxJt/5i5q+ebfthFoVbVJFZ44mVUR11mAAAAAAEA3gIAAAAAAQENwcSElLyC0jcwUHiODBhtapHyzIdiwytOGiu/Raf4BwAAAAAA/f///wKAhB4AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFl82znKQEAAAAWABQyIWyAI6LDf6dJ58BDPdkh+PWUZwJHMEQCIGiJFhVi/d/Hz19Cz48uHTjhgBJ6WAlgl/bLVS7A6VtxAiAwlb7xYzIM4uopFvMnpOmGIOp3+upOPPF2F8VaB8U/HQEhA6BAjey7RADP4ifoh2VXhX7QXkh+sZqozv1EPuU5TxZmZQAAAAEBH4CEHgAAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WUAAA==", + "reserve": null + } } - } - }, - "sendcustommsg.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "status" ], - "properties": { - "status": { - "type": "string", - "description": "Information about where message was queued" - } - } - }, - "sendinvoice.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "invreq", - "label" - ], - "properties": { - "invreq": { - "type": "string", - "description": "the bolt12 invoice_request string beginning with `lnr1`" - }, - "label": { - "oneOf": [ - { - "type": "string" - }, + "example_json_response": [ + { + "reservations": [ { - "type": "integer" + "txid": "3bbb987a875ecf3a320baf814f2ddd36a183afa13ffe460a389c5052902e5d28", + "vout": 0, + "was_reserved": true, + "reserved": false } - ], - "description": "the unique label to use for this invoice" - }, - "amount_msat": { - "type": "msat", - "description": "required if the *offer* does not specify an amount at all, or specifies it in a different currency. Otherwise you may set it (e.g. to provide a tip), and if not it defaults to the amount contained in the offer (multiplied by *quantity* if any)" - }, - "timeout": { - "type": "u32", - "description": "seconds to wait for the offering node to pay the invoice or return an error, default 90 seconds. This will also be the timeout on the invoice that is sent" - }, - "quantity": { - "type": "u64", - "description": "quantity is is required if the offer specifies quantity_max, otherwise it is not allowed" - } - } - }, - "sendinvoice.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": true, - "required": [ - "label", - "description", - "payment_hash", - "status", - "created_index", - "expires_at" - ], - "properties": { - "label": { - "type": "string", - "description": "unique label supplied at invoice creation" - }, - "description": { - "type": "string", - "description": "description used in the invoice" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "status": { - "type": "string", - "enum": [ - "unpaid", - "paid", - "expired" - ], - "description": "Whether it's paid, unpaid or unpayable" - }, - "expires_at": { - "type": "u64", - "description": "UNIX timestamp of when it will become / became unpayable" - }, - "amount_msat": { - "type": "msat", - "description": "the amount required to pay this invoice" - }, - "bolt12": { - "type": "string", - "description": "the BOLT12 string" - }, - "created_index": { - "type": "u64", - "added": "v23.08", - "description": "1-based index indicating order this invoice was created in" + ] }, - "updated_index": { - "type": "u64", - "added": "v23.08", - "description": "1-based index indicating order this invoice was changed (only present if it has changed since creation)" - } - }, - "allOf": [ { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "paid" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "pay_index", - "amount_received_msat", - "paid_at", - "payment_preimage" - ], - "properties": { - "label": {}, - "description": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "bolt12": {}, - "expires_at": {}, - "created_index": {}, - "updated_index": {}, - "pay_index": { - "type": "u64", - "description": "Unique incrementing index for this payment" - }, - "amount_received_msat": { - "type": "msat", - "description": "the amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)" - }, - "paid_at": { - "type": "u64", - "description": "UNIX timestamp of when it was paid" - }, - "payment_preimage": { - "type": "secret", - "description": "proof of payment" - } - } - } + "reservations": [] } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-unreserveinputs(7)", + "lightning-signpsbt(7)", + "lightning-sendpsbt(7)" + ], + "resources": [ + "Main web site: " ] }, - "sendonion.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-upgradewallet.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "onion", - "first_hop", - "payment_hash" - ], - "properties": { - "onion": { - "type": "hex", - "description": "hex-encoded 1366 bytes long blob that was returned by either of the tools that can generate onions. It contains the payloads destined for each hop and some metadata. Please refer to [BOLT 04][bolt04] for further details. If is specific to the route that is being used and the *payment_hash* used to construct, and therefore cannot be reused for other payments or to attempt a separate route. The custom onion can generally be created using the `devtools/onion` CLI tool, or the **createonion** RPC command" - }, - "first_hop": { - "type": "object", - "description": "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*", - "required": [ - "id", - "amount_msat", - "delay" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "node id for the peer. Use any available channel available to this peer" - }, - "amount_msat": { - "type": "msat", - "description": "the amount to add an HTLC for millisatoshis" - }, - "delay": { - "type": "u16", - "description": "the number of blocks delay of blocks on top of the current blockheight" - } - } - }, - "payment_hash": { - "type": "hash", - "description": "specifies the 32 byte hex-encoded hash to use as a challenge to the HTLC that we are sending. It is specific to the onion and has to match the one the onion was created with" - }, - "label": { - "type": "string", - "description": "can be used to provide a human readable reference to retrieve the payment at a later time" - }, - "shared_secrets": { - "type": "array", - "description": "a JSON list of 32 byte hex-encoded secrets that were used when creating the onion. Core Lightning can send a payment with a custom onion without the knowledge of these secrets, however it will not be able to parse an eventual error message since that is encrypted with the shared secrets used in the onion. If *shared_secrets* is provided Core Lightning will decrypt the error, act accordingly, e.g., add a `channel_update` included in the error to its network view, and set the details in *listsendpays* correctly. If it is not provided Core Lightning will store the encrypted onion, and expose it in *listsendpays* allowing the caller to decrypt it externally. If it is not provided the Core Lightning node does not know how long the route is, which channels or nodes are involved, and what an eventual error could have been. It can therefore be used for oblivious payments", - "items": { - "type": "secret" + "rpc": "upgradewallet", + "title": "Command to spend all P2SH-wrapped inputs into a Native Segwit output", + "description": [ + "`upgradewallet` is a convenience RPC which will spend all p2sh-wrapped Segwit deposits in a wallet into a single Native Segwit P2WPKH address." + ], + "request": { + "required": [], + "properties": { + "feerate": { + "type": "feerate", + "description": [ + "Feerate for the upgrade transaction." + ], + "added": "v23.02", + "default": "*opening*" + }, + "reservedok": { + "type": "boolean", + "description": [ + "Tells the wallet to include all P2SH-wrapped inputs, including reserved ones." + ], + "added": "v23.02" } - }, - "partid": { - "type": "u16", - "description": "if provided and non-zero, allows for multiple parallel partial payments with the same *payment_hash*" - }, - "bolt11": { - "type": "string", - "description": "if provided, it will be returned in *waitsendpay* and *listsendpays* results" - }, - "amount_msat": { - "type": "msat", - "description": "used to annotate the payment, and is returned by *waitsendpay* and *listsendpays*" - }, - "destination": { - "type": "pubkey", - "description": "if provided, it will be returned in **listpays** result" - }, - "localinvreqid": { - "type": "hash", - "description": "`localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7)" - }, - "groupid": { - "type": "u64", - "description": "grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash" - }, - "description": { - "added": "v0.11.0", - "type": "string", - "description": "if provided, it will be returned in *waitsendpay* and *listsendpays* results" - } - } - }, - "sendonion.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": true, - "required": [ - "created_index", - "id", - "payment_hash", - "status", - "created_at", - "amount_sent_msat" - ], - "properties": { - "created_index": { - "added": "v23.11", - "type": "u64", - "description": "1-based index indicating order this payment was created in" - }, - "id": { - "type": "u64", - "description": "old synonym for created_index" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "status": { - "type": "string", - "enum": [ - "pending", - "complete" - ], - "description": "status of the payment (could be complete if already sent previously)" - }, - "amount_msat": { - "type": "msat", - "description": "The amount delivered to destination (if known)" - }, - "destination": { - "type": "pubkey", - "description": "the final destination of the payment if known" - }, - "created_at": { - "type": "u64", - "description": "the UNIX timestamp showing when this payment was initiated" - }, - "amount_sent_msat": { - "type": "msat", - "description": "The amount sent" - }, - "label": { - "type": "string", - "description": "the label, if given to sendpay" - }, - "bolt11": { - "type": "string", - "description": "the bolt11 string (if supplied)" - }, - "bolt12": { - "type": "string", - "description": "the bolt12 string (if supplied: **experimental-offers** only)." - }, - "partid": { - "type": "u64", - "description": "the partid (if supplied) to sendonion/sendpay" } }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "complete" - ] - } - } + "response": { + "required": [ + "upgraded_outs" + ], + "properties": { + "upgraded_outs": { + "type": "u64", + "description": [ + "Count of spent/upgraded UTXOs." + ], + "added": "v23.02" }, - "then": { - "additionalProperties": false, - "required": [ - "payment_preimage" + "psbt": { + "type": "string", + "description": [ + "The PSBT that was finalized and sent." ], - "properties": { - "created_index": {}, - "id": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "destination": {}, - "created_at": {}, - "groupid": {}, - "msatoshi_sent": {}, - "amount_sent_msat": {}, - "label": {}, - "bolt11": {}, - "bolt12": {}, - "partid": {}, - "updated_index": { - "added": "v23.11", - "type": "u64", - "description": "1-based index indicating order this payment was changed" - }, - "payment_preimage": { - "type": "secret", - "description": "the proof of payment: SHA256 of this **payment_hash**" - } - } + "added": "v23.02" + }, + "tx": { + "type": "hex", + "description": [ + "The raw transaction which was sent." + ], + "added": "v23.02" + }, + "txid": { + "type": "txid", + "description": [ + "The txid of the **tx**." + ], + "added": "v23.02" } + } + }, + "example_usage": [ + "The caller is trying to buy a liquidity ad but the command keeps failing. They have funds in their wallet, but they're all P2SH-wrapped outputs.", + "", + "The caller can call `upgradewallet` to convert their funds to native segwit outputs, which are valid for liquidity ad buys." + ], + "example_json_request": [ + { + "id": "example:upgradewallet#1", + "method": "upgradewallet", + "params": "{}" }, { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "pending" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [], - "properties": { - "created_index": {}, - "id": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "destination": {}, - "created_at": {}, - "groupid": {}, - "msatoshi_sent": {}, - "amount_sent_msat": {}, - "label": {}, - "bolt11": {}, - "bolt12": {}, - "partid": {}, - "message": { - "type": "string", - "description": "Monitor status with listpays or waitsendpay" - } - } + "id": "example:upgradewallet#2", + "method": "upgradewallet", + "params": { + "feerate": "urgent", + "reservedok": true } } - ] - }, - "sendonionmessage.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "first_id", - "blinding", - "hops" - ], - "properties": { - "first_id": { - "type": "pubkey", - "description": "the (presumably well-known) public key of the start of the path" - }, - "blinding": { - "type": "pubkey", - "description": "blinding factor for this path" + ], + "example_json_response": [ + { + "upgraded_outs": 0 }, - "hops": { - "type": "array", - "description": "", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "node", - "tlv" - ], - "properties": { - "node": { - "type": "pubkey", - "description": "public key of the node" - }, - "tlv": { - "type": "u8", - "description": "contains a hexadecimal TLV to include" - } - } - } + { + "tx": "0200000001c08ce0a9ea1e00179ea603cb8619ec2a2df990ef931e1ccd87fa7a0e271ed8370100000000fdffffff013514310100000000225120888ab14b6e1655d1d00039b836d70b66e3351543ab6cd2f94166255f3d5e6cb5cf000000", + "txid": "de5f1d6f0b2f95cfe5cfbf8cc33bd3f279a8f800ee0efc27bbfafb2b6ead9560", + "psbt": "cHNidP8BAgQCAAAAAQMEzwAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDgAgAAAAABAZRZ0m0kaJA+ubJw1eYurGROu1BYc0i7l9xbyG06R6uZAQAAAAD9////AmQtPCgBAAAAF6kUnoGu9IUv0FGnzol3Lb/BNBNkOViHAC0xAQAAAAAXqRRlVyjzbP420BqlDTI2cERp+EpVQIcCRzBEAiBliJpjBsipwFgsLZMlzbESZ6hMTh+pgKQlXUIL0nLb3wIga/xwr/IJgEc7Ie6ApS4aVDr9xr1TZ3wj+8bRvI6WqScBIQPgYuc48PzUufScX6A6YOsdmJwn+bAQjLZ/g9jhQYduHM4AAAABASAALTEBAAAAABepFGVXKPNs/jbQGqUNMjZwRGn4SlVAhyICArnAxoROEqUxyWjlXFUHjsFtm/dr6SkP2H0cynK0g5oXRzBEAiBlTUNYfS5n5rGRVmoNb0z3AMGJjHijwpXROGIVxfoBnQIgeTx32KY3CcfYTYzXUIRQAMUQB7rlPWRptWMDD3UttkcBAQQWABTWuWnTbf/a2YaRk/Zj7kgN/cc0iCIGArnAxoROEqUxyWjlXFUHjsFtm/dr6SkP2H0cynK0g5oXCNa5adMAAAAAAQ4gwIzgqeoeABeepgPLhhnsKi35kO+THhzNh/p6Dice2DcBDwQBAAAAARAE/f///wABAwg1FDEBAAAAAAEEIlEgiIqxS24WVdHQADm4NtcLZuM1FUOrbNL5QWYlXz1ebLUhByjMj8l44gnxaV+ltWVQYdsaqyMRtSQXaUW/EBXvLUuJCQCftnv8BwAAAAA=", + "upgraded_outs": 1 } - } - }, - "sendonionmessage.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": {} + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-utxopsbt(7)", + "lightning-reserveinputs(7)", + "lightning-unreserveinputs(7)" + ], + "resources": [ + "Main web site: " + ] }, - "sendpay.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-utxopsbt.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "route", - "payment_hash" - ], - "properties": { - "route": { - "type": "array", - "items": { - "type": "object", - "required": [ - "amount_msat", - "id", - "delay", - "channel" + "rpc": "utxopsbt", + "title": "Command to populate PSBT inputs from given UTXOs", + "description": [ + "*utxopsbt* is a low-level RPC command which creates a PSBT using unreserved inputs in the wallet, optionally reserving them as well.", + "", + "It deliberately mirrors the parameters and output of lightning-fundpsbt(7) except instead of an optional *minconf* parameter to select unreserved outputs from the wallet, it takes a compulsory list of outputs to use." + ], + "request": { + "required": [ + "satoshi", + "feerate", + "startweight", + "utxos" + ], + "properties": { + "satoshi": { + "type": "msat_or_all", + "description": [ + "The minimum satoshi value of the output(s) needed (or the string `all` meaning use all unreserved inputs). If a value, it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*." + ] + }, + "feerate": { + "type": "feerate", + "description": [ + "Used for the transaction as initial feerate." ], - "properties": { - "id": { - "type": "pubkey", - "description": "The node at the end of this hop" - }, - "channel": { - "type": "short_channel_id", - "description": "The channel joining these nodes" - }, - "delay": { - "type": "u32", - "description": "The total CLTV expected by the node at the end of this hop" - }, - "amount_msat": { - "type": "msat", - "description": "The amount expected by the node at the end of this hop" - } + "default": "*normal*" + }, + "startweight": { + "type": "u32", + "description": [ + "The weight of the transaction before *fundpsbt* has added any inputs." + ] + }, + "utxos": { + "type": "array", + "description": [ + "An array of `txid:vout`, each of which must be reserved or available." + ], + "items": { + "type": "outpoint" } - } - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the payment_preimage" - }, - "label": { - "type": "string", - "description": "the label provided when creating the invoice_request" - }, - "amount_msat": { - "type": "msat", - "description": "amount must be provided if *partid* is non-zero, or the payment is to-self, otherwise it must be equal to the final amount to the destination. By default it is in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*" - }, - "bolt11": { - "type": "string", - "description": "bolt11 invoice to pay. If provided, will be returned in *waitsendpay* and *listsendpays* results" - }, - "payment_secret": { - "type": "secret", - "description": "value that the final recipient requires to accept the payment, as defined by the `payment_data` field in BOLT 4 and the `s` field in the BOLT 11 invoice format. It is required if *partid* is non-zero" - }, - "partid": { - "type": "u64", - "description": "must not be provided for self-payments. If provided and non-zero, allows for multiple parallel partial payments with the same *payment_hash*. The *amount_msat* amount (which must be provided) for each **sendpay** with matching *payment_hash* must be equal, and **sendpay** will fail if there are differing values given" - }, - "localinvreqid": { - "type": "hex", - "description": "indicates that this payment is being made for a local invoice_request. This ensures that we only send a payment for a single-use invoice_request once" - }, - "groupid": { - "type": "u64", - "description": "allows you to attach a number which appears in **listsendpays** so payments can be identified as part of a logical group. The *pay* plugin uses this to identify one attempt at a MPP payment, for example" - }, - "payment_metadata": { - "added": "v0.11.0", - "type": "hex", - "description": "placed in the final onion hop TLV" - }, - "description": { - "added": "v0.11.0", - "type": "string", - "description": "description used in the invoice" - } - } - }, - "sendpay.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": true, - "required": [ - "id", - "created_index", - "payment_hash", - "status", - "created_at", - "amount_sent_msat" - ], - "properties": { - "created_index": { - "added": "v23.11", - "type": "u64", - "description": "1-based index indicating order this payment was created in" - }, - "updated_index": { - "added": "v23.11", - "type": "u64", - "description": "1-based index indicating order this payment was changed (only present if it has changed since creation)" - }, - "id": { - "type": "u64", - "description": "old synonym for created_index" - }, - "groupid": { - "type": "u64", - "description": "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "status": { - "type": "string", - "enum": [ - "pending", - "complete" - ], - "description": "status of the payment (could be complete if already sent previously)" - }, - "amount_msat": { - "type": "msat", - "description": "The amount delivered to destination (if known)" - }, - "destination": { - "type": "pubkey", - "description": "the final destination of the payment if known" - }, - "created_at": { - "type": "u64", - "description": "the UNIX timestamp showing when this payment was initiated" - }, - "completed_at": { - "type": "u64", - "description": "the UNIX timestamp showing when this payment was completed" - }, - "amount_sent_msat": { - "type": "msat", - "description": "The amount sent" - }, - "label": { - "type": "string", - "description": "the *label*, if given to sendpay" - }, - "partid": { - "type": "u64", - "description": "the *partid*, if given to sendpay" - }, - "bolt11": { - "type": "string", - "description": "the bolt11 string (if supplied)" - }, - "bolt12": { - "type": "string", - "description": "the bolt12 string (if supplied: **experimental-offers** only)." + }, + "reserve": { + "type": "u32", + "description": [ + "If not zero, then *reserveinputs* is called (successfully, with *exclusive* true) on the returned PSBT for this number of blocks." + ], + "default": "72 blocks" + }, + "reservedok": { + "type": "boolean", + "description": [ + "If set to true, it will also fail if any of the *utxos* are already reserved." + ], + "default": "false" + }, + "locktime": { + "type": "u32", + "description": [ + "If not set, it is set to a recent block height." + ] + }, + "min_witness_weight": { + "type": "u32", + "description": [ + "Minimum weight to use for a UTXO's witness. If the actual witness weight is greater than the provided minimum, the actual witness weight will be used." + ] + }, + "excess_as_change": { + "type": "boolean", + "description": [ + "Flag to add a change output for the excess sats." + ] + }, + "opening_anchor_channel": { + "added": "v23.08", + "type": "boolean", + "description": [ + "To signel that it needs emergency reserve for anchors so that we can lowball our commitment tx fees, and min-emergency-msat for reserving some sats for closing anchor channels." + ] + } } }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "complete" - ] - } - } + "response": { + "required": [ + "psbt", + "feerate_per_kw", + "estimated_final_weight", + "excess_msat" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "Unsigned PSBT which fulfills the parameters given." + ] }, - "then": { - "additionalProperties": false, - "required": [ - "payment_preimage" + "feerate_per_kw": { + "type": "u32", + "description": [ + "The feerate used to create the PSBT, in satoshis-per-kiloweight." + ] + }, + "estimated_final_weight": { + "type": "u32", + "description": [ + "The estimated weight of the transaction once fully signed." + ] + }, + "excess_msat": { + "type": "msat", + "description": [ + "The amount above *satoshi* which is available. This could be zero, or dust; it will be zero if *change_outnum* is also returned." + ] + }, + "change_outnum": { + "type": "u32", + "description": [ + "The 0-based output number where change was placed (only if parameter *excess_as_change* was true and there was sufficient funds)." + ] + }, + "reservations": { + "type": "array", + "description": [ + "If *reserve* was true or a non-zero number, just as per lightning- reserveinputs(7)." ], - "properties": { - "id": {}, - "created_index": {}, - "updated_index": {}, - "groupid": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "destination": {}, - "created_at": {}, - "completed_at": {}, - "msatoshi_sent": {}, - "amount_sent_msat": {}, - "label": {}, - "partid": {}, - "bolt11": {}, - "bolt12": {}, - "payment_preimage": { - "type": "secret", - "description": "the proof of payment: SHA256 of this **payment_hash**" + "items": { + "type": "object", + "required": [ + "txid", + "vout", + "was_reserved", + "reserved", + "reserved_to_block" + ], + "additionalProperties": false, + "properties": { + "txid": { + "type": "txid", + "description": [ + "The txid of the transaction." + ] + }, + "vout": { + "type": "u32", + "description": [ + "The 0-based output number." + ] + }, + "was_reserved": { + "type": "boolean", + "description": [ + "Whether this output was previously reserved." + ] + }, + "reserved": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Whether this output is now reserved." + ] + }, + "reserved_to_block": { + "type": "u32", + "description": [ + "The blockheight the reservation will expire." + ] + } } } } }, + "post_return_value_notes": [ + "On success, returns the *psbt* it created, containing the inputs, *feerate_per_kw* showing the exact numeric feerate it used, *estimated_final_weight* for the estimated weight of the transaction once fully signed, and *excess_msat* containing the amount above *satoshi* which is available. This could be zero, or dust. If *satoshi* was `all`, then *excess_msat* is the entire amount once fees are subtracted for the weights of the inputs and *startweight*.", + "", + "If *reserve* was *true* or a non-zero number, then a *reservations* array is returned, exactly like *reserveinputs*.", + "", + "If *excess_as_change* is true and the excess is enough to cover an additional output above the `dust_limit`, then an output is added to the PSBT for the excess amount. The *excess_msat* will be zero. A *change_outnum* will be returned with the index of the change output." + ] + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: Catchall nonspecific error.", + "- 301: Insufficient UTXOs to meet *satoshi* value." + ], + "example_json_request": [ { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "pending" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "message" + "id": "example:utxopsbt#1", + "method": "utxopsbt", + "params": { + "satoshi": 0, + "feerate": "253perkw", + "startweight": 0, + "utxos": [ + "d82a99192fb333106ea8d08f5231ed45f2ed5b1ef9eb81b0fef8f9ea354d2637:1" ], - "properties": { - "id": {}, - "created_index": {}, - "updated_index": {}, - "groupid": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "destination": {}, - "created_at": {}, - "completed_at": {}, - "msatoshi_sent": {}, - "amount_sent_msat": {}, - "label": {}, - "partid": {}, - "bolt11": {}, - "bolt12": {}, - "message": { - "type": "string", - "description": "Monitor status with listpays or waitsendpay" - } - } + "reserve": 0, + "reservedok": true, + "locktime": null, + "min_witness_weight": null, + "excess_as_change": false } - } - ] - }, - "sendpsbt.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt" - ], - "properties": { - "psbt": { - "type": "string", - "description": "the fully signed psbt to be sent" - }, - "reserve": { - "type": "u32", - "description": "number of blocks to increase reservation of any of our inputs by. Default is 72" - } - } - }, - "sendpsbt.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "tx", - "txid" - ], - "properties": { - "tx": { - "type": "hex", - "description": "The raw transaction which was sent" - }, - "txid": { - "type": "txid", - "description": "The txid of the **tx**" - } - } - }, - "setchannel.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string", - "description": "should contain a scid (short channel ID), channel id or peerid (pubkey) of the channel to be modified. If *id* is set to `all`, the updates are applied to all channels in states CHANNELD_NORMAL CHANNELD_AWAITING_LOCKIN or DUALOPEND_AWAITING_LOCKIN. If *id* is a peerid, all channels with the +peer in those states are changed" - }, - "feebase": { - "type": "msat", - "description": "value in millisatoshi that is added as base fee to any routed payment: if omitted, it is unchanged. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*" - }, - "feeppm": { - "type": "u32", - "description": "value that is added proportionally per-millionths to any routed payment volume in satoshi. For example, if ppm is 1,000 and 1,000,000 satoshi is being routed through the channel, an proportional fee of 1,000 satoshi is added, resulting in a 0.1% fee" - }, - "htlcmin": { - "type": "msat", - "description": "value that limits how small an HTLC we will forward: if omitted, it is unchanged (the default is no lower limit). It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. Note that the peer also enforces a minimum for the channel: setting it below that will simply set it to that value with a warning. Also note that *htlcmin* only applies to forwarded HTLCs: we can still send smaller payments ourselves" }, - "htlcmax": { - "type": "msat", - "description": "value that limits how large an HTLC we will forward: if omitted, it is unchanged (the default is no effective limit). It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. Note that *htlcmax* only applies to forwarded HTLCs: we can still send larger payments ourselves" - }, - "enforcedelay": { - "type": "u32", - "description": "number of seconds to delay before enforcing the new fees/htlc max (default 600, which is ten minutes). This gives the network a chance to catch up with the new rates and avoids rejecting HTLCs before they do. This only has an effect if rates are increased (we always allow users to overpay fees) or *htlcmax* is decreased, and only applied to a single rate increase per channel (we don't remember an arbitrary number of prior feerates) and if the node is restarted the updated configuration is enforced immediately" - }, - "ignorefeelimits": { - "added": "v23.08", - "type": "boolean", - "description": "if set to True means to allow the peer to set the commitment transaction fees (or closing transaction fees) to any value they want. This is dangerous: they could set an exorbitant fee (so HTLCs are unenforcable), or a tiny fee (so that commitment transactions cannot be relayed), but avoids channel breakage in case of feerate disagreements. (Note: the global `ignore_fee_limits` setting overrides this)" - } - } - }, - "setchannel.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channels" - ], - "properties": { - "channels": { - "type": "array", - "description": "channel(s) set, and their resulting configuration", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "peer_id", - "channel_id", - "fee_base_msat", - "fee_proportional_millionths", - "minimum_htlc_out_msat", - "maximum_htlc_out_msat", - "ignore_fee_limits" + { + "id": "example:utxopsbt#2", + "method": "utxopsbt", + "params": { + "satoshi": 1000000, + "feerate": "7500perkw", + "startweight": 0, + "utxos": [ + "2fc3b9f8d4aed120f6d9a6f206f07c35ef4d518ec0305d1d974873d256e38ca7:1", + "2f669f6a605ee5c7ddd2abb753bc64b1a90bd1b7448264f5d78a7ca823c00a1b:1" ], - "properties": { - "peer_id": { - "type": "pubkey", - "description": "The node_id of the peer" - }, - "channel_id": { - "type": "hex", - "description": "The channel_id of the channel", - "minLength": 64, - "maxLength": 64 - }, - "short_channel_id": { - "type": "short_channel_id", - "description": "the short_channel_id (if locked in)" - }, - "fee_base_msat": { - "type": "msat", - "description": "The resulting feebase (this is the BOLT #7 name)" - }, - "fee_proportional_millionths": { - "type": "u32", - "description": "The resulting feeppm (this is the BOLT #7 name)" - }, - "ignore_fee_limits": { - "type": "boolean", - "added": "v23.08", - "description": "If we are now allowing peer to set feerate on commitment transaction without restriction" - }, - "minimum_htlc_out_msat": { - "type": "msat", - "description": "The resulting htlcmin we will advertize (the BOLT #7 name is htlc_minimum_msat)" - }, - "warning_htlcmin_too_low": { - "type": "string", - "description": "The requested htlcmin was too low for this peer, so we set it to the minimum they will allow" - }, - "maximum_htlc_out_msat": { - "type": "msat", - "description": "The resulting htlcmax we will advertize (the BOLT #7 name is htlc_maximum_msat)" - }, - "warning_htlcmax_too_high": { - "type": "string", - "description": "The requested htlcmax was greater than the channel capacity, so we set it to the channel capacity" - } - } + "reserve": null, + "reservedok": true, + "locktime": null, + "min_witness_weight": null, + "excess_as_change": false } } - } - }, - "setconfig.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "config" ], - "added": "v23.08", - "properties": { - "config": { - "type": "string", - "description": "name of the config variable which should be set to the value of the variable" + "example_json_response": [ + { + "psbt": "cHNidP8BADMCAAAAATcmTTXq+fj+sIHr+R5b7fJF7TFSj9CobhAzsy8ZmSrYAQAAAAD9////AGYAAAAAAQDeAgAAAAABAWQACJva49ga8OCYXvPRWQRhoXndrJykwjgXbwT251dEAAAAAAD9////AiOI9ikBAAAAFgAU3gClv/YpAKRpfDuiFu6mIL2E4+5QaQ8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgUXIQFs7oRkorVThUn3sLj7WI7g8c8RHai4ChoCvIkWsCICp1CqHl4BlMJCKFHRWHXhhekaj0r1EFSNrh8UnvysQPASEDqHIAEdaH3H6pb3VJzbJNDG4lL8PTfsheL+h2p6baK3JlAAAAAQEfUGkPAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=", + "feerate_per_kw": 253, + "estimated_final_weight": 271, + "excess_msat": 1009932000 }, - "val": { - "oneOf": [ - { - "type": "string" - }, + { + "psbt": "cHNidP8BAFwCAAAAAqeM41bSc0iXHV0wwI5RTe81fPAG8qbZ9iDRrtT4ucMvAQAAAAD9////GwrAI6h8itf1ZIJEt9ELqbFkvFO3q9Ldx+VeYGqfZi8BAAAAAP3///8AZgAAAAABAN4CAAAAAAEBEaK0TQ97IsrzuO1gLt+vYbvLBG90NrCOZp7SCgrRknYAAAAAAP3///8CM6/2KQEAAAAWABQ1B/KkIVbg7yFRcCEN/VOptfOX/EBCDwAAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WUCRzBEAiA1oI1us81XEa/DRlvcP2qnbWLsV5pZcRfvj9MLyT202gIgb7noMqHYWMmm7H7VNEfWa29jjtuV9yrrSc9ui11ECQ0BIQKhZOHR4gFKMu2EKKgZ/7qnhzq9PvhtnAW2sxPZ4c9RIWUAAAABAR9AQg8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAAEA3gIAAAAAAQGnjONW0nNIlx1dMMCOUU3vNXzwBvKm2fYg0a7U+LnDLwAAAAAA/f///wJmbOcpAQAAABYAFOwPo5eUrDF7UgZBFQLRHOeX6PiGQEIPAAAAAAAWABTCzKsXHCpb6dq1LsQbglhjAkxUZgJHMEQCICgjGlauGj2eiMS4MWUK6zAWqMe1OuidQR+Hy9ZgSTuzAiA8JTb9OrLqS3hiWtT+TQ/NBsKJ2hhHLDaKUUNdgi4OkAEhA9g3oH5ejmGIqUY2ZWxc8YWF2+T+XpE/6oC40Cx3+e97ZQAAAAEBH0BCDwAAAAAAFgAUwsyrFxwqW+natS7EG4JYYwJMVGYA", + "feerate_per_kw": 7500, + "estimated_final_weight": 542, + "excess_msat": 995935000, + "reservations": [ { - "type": "integer" + "txid": "2fc3b9f8d4aed120f6d9a6f206f07c35ef4d518ec0305d1d974873d256e38ca7", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 }, { - "type": "boolean" - } - ], - "description": "value of the config variable to be set or updated" - } - } - }, - "setconfig.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "added": "v23.08", - "required": [ - "config" - ], - "properties": { - "config": { - "type": "object", - "description": "config settings after completion", - "additionalProperties": false, - "required": [ - "config", - "source", - "dynamic" - ], - "properties": { - "config": { - "type": "string", - "description": "name of the config variable which was set" - }, - "source": { - "type": "string", - "description": "source of configuration setting (`file`:`linenum`)" - }, - "plugin": { - "type": "string", - "description": "the plugin this configuration setting is for" - }, - "dynamic": { - "type": "boolean", - "enum": [ - true - ], - "description": "whether this option is settable via setconfig" - }, - "set": { - "type": "boolean", - "description": "for simple flag options" - }, - "value_str": { - "type": "string", - "description": "for string options" - }, - "value_msat": { - "type": "msat", - "description": "for msat options" - }, - "value_int": { - "type": "integer", - "description": "for integer options" - }, - "value_bool": { - "type": "boolean", - "description": "for boolean options" + "txid": "2f669f6a605ee5c7ddd2abb753bc64b1a90bd1b7448264f5d78a7ca823c00a1b", + "vout": 1, + "was_reserved": true, + "reserved": true, + "reserved_to_block": 246 } - } - } - } - }, - "setpsbtversion.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt", - "version" - ], - "properties": { - "psbt": { - "type": "string", - "description": "the PSBT to change versions" - }, - "version": { - "type": "u32", - "description": "the version to set" + ] } - } - }, - "setpsbtversion.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt" ], - "properties": { - "psbt": { - "type": "string", - "description": "a converted PSBT of the requested version" - } - } + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-fundpsbt(7)" + ], + "resources": [ + "Main web site: " + ] }, - "showrunes.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-wait.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [], "added": "v23.08", - "properties": { - "rune": { - "type": "string", - "description": "if specified, only details of that rune will be returned" - } - } - }, - "showrunes.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "runes" + "rpc": "wait", + "title": "Command to wait for creations, changes and deletions", + "description": [ + "The **wait** RPC command returns once the index given by *indexname* in *subsystem* reaches or exceeds *nextvalue*. All indexes start at 0, when no events have happened (**wait** with a *nextvalue* of 0 is a way of getting the current index, though naturally this is racy!)." ], - "properties": { - "runes": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "rune", - "unique_id", - "restrictions", - "restrictions_as_english" + "request": { + "required": [ + "subsystem", + "indexname", + "nextvalue" + ], + "properties": { + "subsystem": { + "type": "string", + "description": [ + "The subsystem to get the next index value from.", + " `invoices`: corresponding to `listinvoices` (added in *v23.08*).", + " `sendpays`: corresponding to `listsendpays` (added in *v23.11*).", + " `forwards`: corresponding to `listforwards` (added in *v23.11*)." ], - "properties": { - "rune": { - "type": "string", - "description": "Base64 encoded rune" - }, - "unique_id": { - "type": "string", - "description": "Unique id assigned when the rune was generated; this is always a u64 for commando runes" - }, - "restrictions": { - "type": "array", - "description": "The restrictions on what commands this rune can authorize", - "items": { + "enum": [ + "invoices", + "forwards", + "sendpays" + ] + }, + "indexname": { + "type": "string", + "description": [ + "The name of the index to get the next value for.", + " `created` is incremented by one for every new object.", + " `updated` is incremented by one every time an object is changed.", + " `deleted` is incremented by one every time an object is deleted." + ], + "enum": [ + "created", + "updated", + "deleted" + ] + }, + "nextvalue": { + "type": "u64", + "description": [ + "The next value of the index." + ] + } + } + }, + "response": { + "required": [ + "subsystem" + ], + "properties": { + "subsystem": { + "type": "string", + "enum": [ + "invoices", + "forwards", + "sendpays" + ] + }, + "created": { + "type": "u64", + "description": [ + "1-based index indicating order entry was created." + ] + }, + "updated": { + "type": "u64", + "description": [ + "1-based index indicating order entry was updated." + ] + }, + "deleted": { + "type": "u64", + "description": [ + "1-based index indicating order entry was deleted." + ] + }, + "details": {} + }, + "allOf": [ + { + "if": { + "additionalProperties": true, + "properties": { + "subsystem": { + "type": "string", + "enum": [ + "invoices" + ] + } + } + }, + "then": { + "additionalProperties": false, + "properties": { + "subsystem": {}, + "created": {}, + "updated": {}, + "deleted": {}, + "details": { + "type": "object", + "additionalProperties": false, + "properties": { + "status": { + "type": "string", + "enum": [ + "unpaid", + "paid", + "expired" + ], + "description": [ + "Whether it's paid, unpaid or unpayable." + ] + }, + "label": { + "type": "string", + "description": [ + "Unique label supplied at invoice creation." + ] + }, + "description": { + "type": "string", + "description": [ + "Description used in the invoice." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The BOLT11 string." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The BOLT12 string." + ] + } + } + } + } + } + }, + { + "if": { + "additionalProperties": true, + "properties": { + "subsystem": { + "type": "string", + "enum": [ + "forwards" + ] + } + } + }, + "then": { + "additionalProperties": false, + "properties": { + "subsystem": {}, + "created": {}, + "updated": {}, + "deleted": {}, + "details": { + "type": "object", + "additionalProperties": false, + "properties": { + "status": { + "type": "string", + "enum": [ + "offered", + "settled", + "failed", + "local_failed" + ], + "description": [ + "Still ongoing, completed, failed locally, or failed after forwarding." + ] + }, + "in_channel": { + "type": "short_channel_id", + "description": [ + "Unique label supplied at invoice creation." + ] + }, + "in_htlc_id": { + "type": "u64", + "description": [ + "The unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11)." + ] + }, + "in_msat": { + "type": "msat", + "description": [ + "The value of the incoming HTLC." + ] + }, + "out_channel": { + "type": "short_channel_id", + "description": [ + "The channel that the HTLC (trying to) forward to." + ] + } + } + } + } + } + }, + { + "if": { + "additionalProperties": true, + "properties": { + "subsystem": { + "type": "string", + "enum": [ + "sendpays" + ] + } + } + }, + "then": { + "additionalProperties": false, + "properties": { + "subsystem": {}, + "created": {}, + "updated": {}, + "deleted": {}, + "details": { "type": "object", "additionalProperties": false, - "required": [ - "alternatives", - "english" - ], "properties": { - "alternatives": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "fieldname", - "value", - "condition", - "english" - ], - "properties": { - "fieldname": { - "type": "string", - "description": "The field this restriction applies to; see commando-rune(7)" - }, - "value": { - "type": "string", - "description": "The value accepted for this field" - }, - "condition": { - "type": "string", - "description": "The way to compare fieldname and value" - }, - "english": { - "type": "string", - "description": "English readable description of this alternative" - } - } - } - }, - "english": { + "status": { "type": "string", - "description": "English readable summary of alternatives above" + "enum": [ + "pending", + "failed", + "complete" + ], + "description": [ + "Status of the payment." + ] + }, + "partid": { + "type": "u64", + "description": [ + "Part number (for multiple parts to a single payment)." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] } } } - }, - "restrictions_as_english": { - "type": "string", - "description": "English readable description of the restrictions array above" - }, - "stored": { - "type": "boolean", - "enum": [ - false - ], - "description": "This is false if the rune does not appear in our datastore (only possible when `rune` is specified)" - }, - "blacklisted": { - "type": "boolean", - "enum": [ - true - ], - "description": "The rune has been blacklisted; see commando-blacklist(7)" - }, - "last_used": { - "type": "number", - "description": "The last time this rune was successfully used", - "added": "23.11" - }, - "our_rune": { - "type": "boolean", - "enum": [ - false - ], - "description": "This is not a rune for this node (only possible when `rune` is specified)" } } } - } - } - }, - "signinvoice.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "added": "v23.02", - "required": [ - "invstring" + ] + }, + "reliability": [ + "Indices can go forward by more than one; in particlar, if multiple objects were created and the one deleted, you could see this effect. Similarly, there are some places (e.g. invoice expiration) where we can update multiple entries at once.", + "", + "Indices only monotoncally increase." ], - "properties": { - "invstring": { - "type": "string", - "description": "bolt11 form, but the final signature is ignored. Minimal sanity checks are done" - } - } - }, - "signinvoice.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "bolt11" + "usage": [ + "The **wait** RPC is used to track changes in the system. Consider tracking invoices being paid or expiring. The simplest (and inefficient method) would be:", + "1. Call `listinvoices` to get the current state of all invoices, and remember the highest `updated_index`. Say it was 5.", + "2. Call `wait invoices updated 6`.", + "3. When it returns, call `listinvoices` again to see what changed.", + "", + "This is obviously inefficient, so there are two optimizations:", + "1. Call `listinvoices` with `index=updated` and `start=6` to only see invoices with `updated_index` greater than or equal to 6.", + "2. `wait` itself may also return some limited subset of fields from the list command (it can't do this in all cases); for `invoices` this is `label` and `status`, allowing many callers to avoid the `listinvoices` call." ], - "properties": { - "bolt11": { - "type": "string", - "description": "the bolt11 string" - } - } - }, - "signmessage.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "message" + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong." ], - "additionalProperties": false, - "properties": { - "message": { - "type": "string", - "description": "less that 65536 characters long message to be signed by the node" - } - } - }, - "signmessage.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "signature", - "recid", - "zbase" - ], - "properties": { - "signature": { - "type": "hex", - "description": "The signature", - "minLength": 128, - "maxLength": 128 - }, - "recid": { - "type": "hex", - "description": "The recovery id (0, 1, 2 or 3)", - "minLength": 2, - "maxLength": 2 + "example_json_request": [ + { + "id": "example:wait#1", + "method": "wait", + "params": { + "subsystem": "invoices", + "indexname": "created", + "nextvalue": 1 + } }, - "zbase": { - "type": "string", - "description": "*signature* and *recid* encoded in a style compatible with **lnd**'s [SignMessageRequest](https://api.lightning.community/#grpc-request-signmessagerequest)" - } - } - }, - "signpsbt.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt" - ], - "properties": { - "psbt": { - "type": "string", - "description": "the psbt to be signed" + { + "id": "example:wait#2", + "method": "wait", + "params": { + "subsystem": "invoices", + "indexname": "updated", + "nextvalue": 2 + } }, - "signonly": { - "type": "array", - "description": "input numbers to sign", - "items": { - "type": "u32" + { + "id": "example:wait#3", + "method": "wait", + "params": { + "subsystem": "sendpays", + "indexname": "updated", + "nextvalue": 2 } } - } - }, - "signpsbt.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "signed_psbt" - ], - "properties": { - "signed_psbt": { - "type": "string", - "description": "The fully signed PSBT" - } - } - }, - "splice_init.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channel_id", - "relative_amount" ], - "added": "v23.08", - "properties": { - "channel_id": { - "type": "string", - "description": "the channel id of the channel to be spliced" - }, - "relative_amount": { - "type": "integer", - "description": "a positive or negative amount of satoshis to add or subtract from the channel" - }, - "initialpsbt": { - "type": "string", - "description": "the (optional) base 64 encoded PSBT to begin with. If not specified, one will be generated automatically" + "example_json_response": [ + { + "subsystem": "invoices", + "created": 1, + "details": { + "status": "unpaid", + "label": "invlabel", + "bolt11": "lnbcrt420p1pjmxtevsp5d8c6gnaj8lyjy2qly783vklda9dfaqeyzyc37agxxp8h3uguv8pqpp5w6lhwxhqnuew4hle5h7qwjm27zz784mvsrzhmayhscy5t2hy5c4qdqvd9h8ver9wd3sxqyjw5qcqp99qxpqysgq09gxhjhwu9u3z6dlt5ln5f4g8zl78wz4pgh0am3kz54m9lllhqckf4gmhmt2ftrclq5x62zkqmggc7y0ju0ghdfwjz8hyd8l5cqvemgpyyhm6w" + } }, - "feerate_per_kw": { - "type": "u32", - "description": "the miner fee we promise our peer to pay for our side of the splice transaction. It is calculated by `feerate_per_kw` * our_bytes_in_splice_tx / 1000" + { + "subsystem": "invoices", + "updated": 2, + "details": { + "status": "expired" + } }, - "force_feerate": { - "type": "boolean", - "description": "by default splices will fail if the fee provided looks too high. This is to protect against accidentally setting your fee higher than intended. Set `force_feerate` to true to skip this saftey check" + { + "subsystem": "sendpays", + "updated": 2, + "details": { + "status": "complete", + "partid": 0, + "groupid": 1, + "payment_hash": "220dcfcf43e1fab3ce30f70eb943c3ce962393f5a65ced52d749e324b443d19e" + } } - } - }, - "splice_init.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt" ], - "added": "v23.08", - "properties": { - "psbt": { - "type": "string", - "description": "the (incomplete) PSBT of the splice transaction" - } - } - }, - "splice_signed.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channel_id", - "psbt" + "author": [ + "Rusty Russell <> is mainly responsible." ], - "added": "v23.08", - "properties": { - "channel_id": { - "type": "string", - "description": "the channel id of the channel to be spliced" - }, - "psbt": { - "type": "string", - "description": "the final version of the psbt to complete the splice with" - }, - "sign_first": { - "type": "boolean", - "description": "a flag that makes our node offer the final splice signature first (defaults to false). When false, the node will calculate who should sign first based off who is adding inputting the least sats to the splice as per spec" - } - } - }, - "splice_signed.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "tx", - "txid" + "see_also": [ + "lightning-listinvoice(7)", + "lightning-listforwards(7)", + "lightning-listsendpays(7)" ], - "added": "v23.08", - "properties": { - "tx": { - "type": "hex", - "description": "The hex representation of the final transaction that is published" - }, - "txid": { - "type": "txid", - "description": "The txid is of the final transaction" - } - } + "resources": [ + "Main web site: " + ] }, - "splice_update.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-waitanyinvoice.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "channel_id", - "psbt" + "rpc": "waitanyinvoice", + "title": "Command for waiting for payments", + "description": [ + "The **waitanyinvoice** RPC command waits until an invoice is paid, then returns a single entry as per **listinvoice**. It will not return for any invoices paid prior to or including the *lastpay_index*.", + "", + "This is usually called iteratively: once with no arguments, then repeatedly with the returned *pay_index* entry. This ensures that no paid invoice is missed. The *pay_index* is a monotonically-increasing number assigned to an invoice when it gets paid. The first valid *pay_index* is 1." ], - "added": "v23.08", - "properties": { - "channel_id": { - "type": "string", - "description": "the channel id of the channel to be spliced" - }, - "psbt": { - "type": "string", - "description": "the base 64 encoded PSBT returned from `splice_init` with any changes added by the user" + "request": { + "required": [], + "properties": { + "lastpay_index": { + "type": "u64", + "description": [ + "Ignores any invoices paid prior to or including this index. 0 is equivalent to not specifying and negative value is invalid." + ] + }, + "timeout": { + "type": "u64", + "description": [ + "If specified, wait at most that number of seconds, which must be an integer. If the specified *timeout* is reached, this command will return with an error. You can specify this to 0 so that **waitanyinvoice** will return immediately with an error if no pending invoice is available yet. If unspecified, this command will wait indefinitely." + ] + } } - } - }, - "splice_update.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt", - "commitments_secured" - ], - "added": "v23.08", - "properties": { - "psbt": { - "type": "string", - "description": "the (incomplete) PSBT of the splice transaction" + }, + "response": { + "required": [ + "label", + "description", + "payment_hash", + "status", + "created_index", + "expires_at" + ], + "properties": { + "label": { + "type": "string", + "description": [ + "Unique label supplied at invoice creation." + ] + }, + "description": { + "type": "string", + "description": [ + "Description used in the invoice." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "paid", + "expired" + ], + "description": [ + "Whether it's paid or expired." + ] + }, + "expires_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when it will become / became unpayable." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount required to pay this invoice." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The BOLT11 string (always present unless *bolt12* is)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The BOLT12 string (always present unless *bolt11* is)." + ] + }, + "created_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was created in." + ] + }, + "updated_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was changed (only present if it has changed since creation)." + ] + } }, - "commitments_secured": { - "type": "boolean", - "description": "whether or not the commitments were secured" - } - } - }, - "sql.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "query" - ], - "added": "v23.02", - "properties": { - "query": { - "type": "string" - } - } - }, - "sql.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "rows" + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "paid" + ] + } + } + }, + "then": { + "additionalProperties": false, + "required": [ + "pay_index", + "amount_received_msat", + "paid_at", + "payment_preimage" + ], + "properties": { + "label": {}, + "description": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "bolt11": {}, + "bolt12": {}, + "expires_at": {}, + "created_index": {}, + "updated_index": {}, + "pay_index": { + "type": "u64", + "description": [ + "Unique incrementing index for this payment." + ] + }, + "amount_received_msat": { + "type": "msat", + "description": [ + "The amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)." + ] + }, + "paid_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when it was paid." + ] + }, + "paid_outpoint": { + "type": "object", + "description": [ + "Outpoint this invoice was paid with." + ], + "added": "v23.11", + "additionalProperties": false, + "required": [ + "txid", + "outnum" + ], + "properties": { + "txid": { + "added": "v23.11", + "type": "txid", + "description": [ + "ID of the transaction that paid the invoice." + ] + }, + "outnum": { + "added": "v23.11", + "type": "u32", + "description": [ + "The 0-based output number of the transaction that paid the invoice." + ] + } + } + }, + "payment_preimage": { + "type": "secret", + "description": [ + "Proof of payment." + ] + } + } + }, + "else": { + "additionalProperties": false, + "properties": { + "label": {}, + "description": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "bolt11": {}, + "bolt12": {}, + "created_index": {}, + "updated_index": {}, + "expires_at": {} + } + } + } + ] + }, + "errors": [ + "The following error codes may occur:", + "", + "- 904: The *timeout* was reached without an invoice being paid." ], - "properties": { - "rows": { - "type": "array", - "items": { - "type": "array" + "example_json_request": [ + { + "id": "example:waitanyinvoice#1", + "method": "waitanyinvoice", + "params": { + "lastpay_index": null, + "timeout": null } }, - "warning_db_failure": { - "type": "string", - "description": "A message if the database encounters an error partway through" - } - } - }, - "staticbackup.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": {} - }, - "staticbackup.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "scb" - ], - "properties": { - "scb": { - "type": "array", - "items": { - "type": "hex", - "description": "SCB of a channel in TLV format" + { + "id": "example:waitanyinvoice#2", + "method": "waitanyinvoice", + "params": { + "lastpay_index": 3, + "timeout": 0 } } - } - }, - "stop.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": {} - }, - "stop.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "result" - ], - "properties": { - "result": { - "type": "string", - "added": "v24.05", - "enum": [ - "Shutdown complete" - ] - } - } - }, - "txdiscard.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "txid" ], - "properties": { - "txid": { - "type": "txid", - "description": "the transaction id, inputs should be unreseverd from" - } - } - }, - "txdiscard.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "unsigned_tx", - "txid" - ], - "properties": { - "unsigned_tx": { - "type": "hex", - "description": "the unsigned transaction" + "example_json_response": [ + { + "label": "inv1", + "bolt11": "lnbcrt10n1pjmxtsxsp56sn02x8lccjfsvunnhz5858zuyxztug9luy226w4qsmfm4r8pkcspp5gw5r0dw99yf3zqxrg24l8g9m9hun9cu06ldg4rga8s9t9kv8z45sdq8d9h8vvgxqyjw5qcqp99qxpqysgqv537uh2sx8ch640mf4t43t8qjtpg3z7gukgm07tlyq986m7nvsnxkapg37z4vsxtl4thfqzc64anqr83geygkc2xaftxgr97dltqfjqpe3mhja", + "payment_hash": "43a837b5c529131100c342abf3a0bb2df932e38fd7da8a8d1d3c0ab2d9871569", + "amount_msat": 1000, + "status": "paid", + "pay_index": 1, + "amount_received_msat": 1000, + "paid_at": 1706241546, + "payment_preimage": "a0c668998de14b975f33e1060b3efd7efc0bde784ac266ab667a1b2fddab3cd1", + "description": [ + "Inv1." + ], + "expires_at": 1706846342, + "created_index": 1, + "updated_index": 1 }, - "txid": { - "type": "txid", - "description": "the transaction id of *unsigned_tx*" + { + "label": "inv4", + "bolt11": "lnbcrt10n1pja0tkmsp57j4z9zwvdsyh57unh3da7aac5z20clfnrwy5nqm6wujaelduw23qpp580mdrwakz9xewc2vhvpucset9gjkgdvyhw7h9frcy2d6p2lwdw2qdq8d9h8vdqxqyjw5qcqp99qxpqysgqtgyzhtxs3p2dyk8wk9q028033303702d2hml4frmu38qe79mrkgzgxvyjmq2q4nhjgcuz3uhmlda3jnhf9w6mj8mj97pkgnda9l5kdcqsdgewf", + "payment_hash": "3bf6d1bbb6114d97614cbb03cc432b2a25643584bbbd72a478229ba0abee6b94", + "amount_msat": 1000, + "status": "paid", + "pay_index": 4, + "amount_received_msat": 1000, + "paid_at": 1708633825, + "payment_preimage": "77336a342dde76050c7ee7fc18599e407dfc1edad3c784ba68e9603004365b94", + "description": "inv4", + "expires_at": 1709238619, + "created_index": 4, + "updated_index": 4 } - } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-waitinvoice(7)", + "lightning-listinvoice(7)", + "lightning-delinvoice(7)", + "lightning-invoice(7)" + ], + "resources": [ + "Main web site: " + ] }, - "txprepare.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-waitblockheight.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "outputs" + "rpc": "waitblockheight", + "title": "Command for waiting for blocks on the blockchain", + "description": [ + "The **waitblockheight** RPC command waits until the blockchain has reached the specified *blockheight*." ], - "properties": { - "outputs": { - "type": "array", - "description": "format is like: [{destination1: amount1}, {destination2: amount2}] or [{destination: *all*}]. It supports any number of **confirmed** outputs", - "items": { - "type": "outputdesc" - } - }, - "feerate": { - "type": "feerate", - "description": "used for the transaction as initial feerate. The default is *normal*" - }, - "minconf": { - "type": "u32", - "description": "the minimum number of confirmations that used outputs should have. Default is 1" - }, - "utxos": { - "type": "array", - "description": "to be used to fund the transaction, as an array of `txid:vout`. These must be drawn from the node's available UTXO set", - "items": { - "type": "outpoint" + "request": { + "required": [ + "blockheight" + ], + "properties": { + "blockheight": { + "type": "u32", + "description": [ + "Current blockheight of the blockchain if the value is greater than this number. If it is a present or past block height, then the command returns immediately." + ] + }, + "timeout": { + "type": "u32", + "description": [ + "Only wait up to specified seconds." + ], + "default": "60 seconds" } } - } - }, - "txprepare.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "psbt", - "unsigned_tx", - "txid" - ], - "properties": { - "psbt": { - "type": "string", - "description": "the PSBT representing the unsigned transaction" - }, - "unsigned_tx": { - "type": "hex", - "description": "the unsigned transaction" + }, + "response": { + "required": [ + "blockheight" + ], + "properties": { + "blockheight": { + "type": "u32", + "description": [ + "The current block height (>= *blockheight* parameter)." + ] + } }, - "txid": { - "type": "txid", - "description": "the transaction id of *unsigned_tx*; you hand this to lightning-txsend(7) or lightning-txdiscard(7), as the inputs of this transaction are reserved." - } - } - }, - "txsend.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "txid" + "post_return_value_notes": [ + "If *timeout* seconds is reached without the specified blockheight being reached, this command will fail with a code of `2000`." + ] + }, + "errors": [ + "The following error codes may occur:", + "", + "- 2000: Timed out." ], - "properties": { - "txid": { - "type": "txid", - "description": "The transaction id of the transaction created by **txprepare**" - } - } - }, - "txsend.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "psbt", - "tx", - "txid" - ], - "properties": { - "psbt": { - "type": "string", - "description": "the completed PSBT representing the signed transaction" - }, - "tx": { - "type": "hex", - "description": "the fully signed transaction" + "example_json_request": [ + { + "id": "example:waitblockheight#1", + "method": "waitblockheight", + "params": { + "blockheight": 99, + "timeout": null + } }, - "txid": { - "type": "txid", - "description": "the transaction id of *tx*" + { + "id": "example:waitblockheight#2", + "method": "waitblockheight", + "params": { + "blockheight": 103, + "timeout": 600 + } } - } - }, - "unreserveinputs.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt" ], - "properties": { - "psbt": { - "type": "string", - "description": "inputs to unreserve are the inputs specified in the passed-in *psbt*" + "example_json_response": [ + { + "blockheight": 99 }, - "reserve": { - "type": "u32", - "description": "the number of blocks to decrease reservation by; default is 72" + { + "blockheight": 103 } - } + ], + "author": [ + "ZmnSCPxj <> is mainly responsible." + ], + "resources": [ + "Main web site: " + ] }, - "unreserveinputs.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-waitinvoice.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "reservations" + "rpc": "waitinvoice", + "title": "Command for waiting for specific payment", + "description": [ + "The **waitinvoice** RPC command waits until a specific invoice is paid, then returns that single entry as per **listinvoice**." ], - "properties": { - "reservations": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "txid", - "vout", - "was_reserved", - "reserved" - ], - "properties": { - "txid": { - "type": "txid", - "description": "the transaction id" - }, - "vout": { - "type": "u32", - "description": "the output number which was reserved" - }, - "was_reserved": { - "type": "boolean", - "description": "whether the input was already reserved (usually `true`)" + "request": { + "required": [ + "label" + ], + "properties": { + "label": { + "oneOf": [ + { + "type": "string" }, - "reserved": { - "type": "boolean", - "description": "whether the input is now reserved (may still be `true` if it was reserved for a long time)" + { + "type": "integer" + } + ], + "description": [ + "Unique label of the invoice waiting to be paid." + ] + } + } + }, + "response": { + "required": [ + "label", + "description", + "payment_hash", + "status", + "created_index", + "expires_at" + ], + "properties": { + "label": { + "type": "string", + "description": [ + "Unique label supplied at invoice creation." + ] + }, + "description": { + "type": "string", + "description": [ + "Description used in the invoice." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "paid", + "expired" + ], + "description": [ + "Whether it's paid or expired." + ] + }, + "expires_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when it will become / became unpayable." + ] + }, + "amount_msat": { + "type": "msat", + "description": [ + "The amount required to pay this invoice." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The BOLT11 string (always present unless *bolt12* is)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The BOLT12 string (always present unless *bolt11* is)." + ] + }, + "created_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was created in." + ] + }, + "updated_index": { + "type": "u64", + "added": "v23.08", + "description": [ + "1-based index indicating order this invoice was changed (only present if it has changed since creation)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "paid" + ] + } } }, - "allOf": [ - { - "if": { - "additionalProperties": true, - "properties": { - "reserved": { - "enum": [ - true - ] - } - } + "then": { + "additionalProperties": false, + "required": [ + "pay_index", + "amount_received_msat", + "paid_at", + "payment_preimage" + ], + "properties": { + "label": {}, + "description": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "bolt11": {}, + "bolt12": {}, + "expires_at": {}, + "created_index": {}, + "updated_index": {}, + "pay_index": { + "type": "u64", + "description": [ + "Unique incrementing index for this payment." + ] }, - "then": { + "amount_received_msat": { + "type": "msat", + "description": [ + "The amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)." + ] + }, + "paid_at": { + "type": "u64", + "description": [ + "UNIX timestamp of when it was paid." + ] + }, + "paid_outpoint": { + "type": "object", + "description": [ + "Outpoint this invoice was paid with." + ], + "added": "v23.11", + "additionalProperties": false, "required": [ - "reserved_to_block" + "txid", + "outnum" ], "properties": { - "txid": {}, - "vout": {}, - "was_reserved": {}, - "reserved": {}, - "reserved_to_block": { + "txid": { + "added": "v23.11", + "type": "txid", + "description": [ + "ID of the transaction that paid the invoice." + ] + }, + "outnum": { + "added": "v23.11", "type": "u32", - "description": "what blockheight the reservation will expire" + "description": [ + "The 0-based output number of the transaction that paid the invoice." + ] } } + }, + "payment_preimage": { + "type": "secret", + "description": [ + "Proof of payment." + ] } } - ] - } - } - } - }, - "upgradewallet.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": { - "feerate": { - "type": "feerate", - "description": "Feerate for the upgrade transaction", - "added": "v23.02" - }, - "reservedok": { - "type": "boolean", - "description": "Include already reserved funds or not", - "added": "v23.02" - } - } - }, - "upgradewallet.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "upgraded_outs" - ], - "properties": { - "upgraded_outs": { - "type": "u64", - "description": "Count of spent/upgraded UTXOs", - "added": "v23.02" - }, - "psbt": { - "type": "string", - "description": "The PSBT that was finalized and sent", - "added": "v23.02" - }, - "tx": { - "type": "hex", - "description": "The raw transaction which was sent", - "added": "v23.02" - }, - "txid": { - "type": "txid", - "description": "The txid of the **tx**", - "added": "v23.02" - } - } - }, - "utxopsbt.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "satoshi", - "feerate", - "startweight", - "utxos" - ], - "properties": { - "satoshi": { - "type": "msat_or_all", - "description": "the minimum satoshi value of the output(s) needed (or the string `all` meaning use all unreserved inputs). If a value, it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" - }, - "feerate": { - "type": "feerate", - "description": "used for the transaction as initial feerate. The default is *normal*" - }, - "startweight": { - "type": "u32", - "description": "the weight of the transaction before *fundpsbt* has added any inputs" - }, - "utxos": { - "type": "array", - "description": "an array of `txid:vout`, each of which must be reserved or available", - "items": { - "type": "outpoint" - } - }, - "reserve": { - "type": "u32", - "description": "if not zero, then *reserveinputs* is called (successfully, with *exclusive* true) on the returned PSBT for this number of blocks. Defaults to 72 blocks if unspecified" - }, - "reservedok": { - "type": "boolean", - "description": "if set to true, it will also fail if any of the *utxos* are already reserved. Default is false" - }, - "locktime": { - "type": "u32", - "description": "if not set, it is set to a recent block height" - }, - "min_witness_weight": { - "type": "u32", - "description": "minimum weight to use for a UTXO's witness. If the actual witness weight is greater than the provided minimum, the actual witness weight will be used" - }, - "excess_as_change": { - "type": "boolean", - "description": "flag to add a change output for the excess sats" - }, - "opening_anchor_channel": { - "added": "v23.08", - "type": "boolean", - "description": "to signel that it needs emergency reserve for anchors so that we can lowball our commitment tx fees, and min-emergency-msat for reserving some sats for closing anchor channels" - } - } - }, - "utxopsbt.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt", - "feerate_per_kw", - "estimated_final_weight", - "excess_msat" - ], - "properties": { - "psbt": { - "type": "string", - "description": "Unsigned PSBT which fulfills the parameters given" - }, - "feerate_per_kw": { - "type": "u32", - "description": "The feerate used to create the PSBT, in satoshis-per-kiloweight" - }, - "estimated_final_weight": { - "type": "u32", - "description": "The estimated weight of the transaction once fully signed" - }, - "excess_msat": { - "type": "msat", - "description": "The amount above *satoshi* which is available. This could be zero, or dust; it will be zero if *change_outnum* is also returned" - }, - "change_outnum": { - "type": "u32", - "description": "The 0-based output number where change was placed (only if parameter *excess_as_change* was true and there was sufficient funds)" - }, - "reservations": { - "type": "array", - "description": "If *reserve* was true or a non-zero number, just as per lightning-reserveinputs(7)", - "items": { - "type": "object", - "required": [ - "txid", - "vout", - "was_reserved", - "reserved", - "reserved_to_block" - ], - "additionalProperties": false, - "properties": { - "txid": { - "type": "txid", - "description": "The txid of the transaction" - }, - "vout": { - "type": "u32", - "description": "The 0-based output number" - }, - "was_reserved": { - "type": "boolean", - "description": "Whether this output was previously reserved" - }, - "reserved": { - "type": "boolean", - "enum": [ - true - ], - "description": "Whether this output is now reserved" - }, - "reserved_to_block": { - "type": "u32", - "description": "The blockheight the reservation will expire" + }, + "else": { + "additionalProperties": false, + "properties": { + "label": {}, + "description": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "bolt11": {}, + "bolt12": {}, + "created_index": {}, + "updated_index": {}, + "expires_at": {} } } } + ] + }, + "errors": [ + "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:", + "", + "- -32602: If the given parameters are wrong.", + "- -1: If the invoice is deleted while unpaid, or the invoice does not exist.", + "- 903: If the invoice expires before being paid, or is already expired." + ], + "example_json_request": [ + { + "id": "example:waitinvoice#1", + "method": "waitinvoice", + "params": { + "label": "inv2" + } } - } - }, - "wait.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "added": "v23.08", - "additionalProperties": false, - "required": [ - "subsystem", - "indexname", - "nextvalue" - ], - "properties": { - "subsystem": { - "type": "string", - "description": "the subsystem to get the next index value from", - "enum": [ - "invoices", - "forwards", - "sendpays" - ] - }, - "indexname": { - "type": "string", - "description": "the name of the index to get the next value for", - "enum": [ - "created", - "updated", - "deleted" - ] - }, - "nextvalue": { - "type": "u64", - "description": "the next value of the index" + ], + "example_json_response": [ + { + "label": "inv2", + "bolt11": "lnbcrt10n1pjmxtwjsp5mzvdu6v8hqsf2tlj0nlyks23afqp7ejs444syjxf74p60ztmld8qpp5q4ayz5pys3t0yj0dmkmh7ctarkv9z434paz4u9rdwnj4f43thhaqdq8d9h8vvsxqyjw5qcqp99qxpqysgqn0055ttns6pafsxh6xuqce6e4vz8gtxlzqx0l9d9f5crmqx4jymh4zy9jdaszm0dj89sq39fvhpwcs626dt0n3gw8kassfdehp5sy3sq7fzy3w", + "payment_hash": "057a4150248456f249edddb77f617d1d985156350f455e146d74e554d62bbdfa", + "amount_msat": 1000, + "status": "paid", + "pay_index": 1, + "amount_received_msat": 1000, + "paid_at": 1706241494, + "payment_preimage": "34ccd37cc85e067cb376f9ea8c70d70469f58bf296f2566ed9ad4dfb70971a26", + "description": [ + "Inv2." + ], + "expires_at": 1706846290, + "created_index": 2, + "updated_index": 1 } - } + ], + "author": [ + "Christian Decker <> is mainly responsible." + ], + "see_also": [ + "lightning-waitanyinvoice(7)", + "lightning-listinvoice(7)", + "lightning-delinvoice(7)", + "lightning-invoice(7)" + ], + "resources": [ + "Main web site: " + ] }, - "wait.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-waitsendpay.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "subsystem" - ], - "properties": { - "subsystem": { - "type": "string", - "enum": [ - "invoices", - "forwards", - "sendpays" - ] - }, - "created": { - "type": "u64", - "description": "1-based index indicating order entry was created" - }, - "updated": { - "type": "u64", - "description": "1-based index indicating order entry was updated" - }, - "deleted": { - "type": "u64", - "description": "1-based index indicating order entry was deleted" + "rpc": "waitsendpay", + "title": "Command for sending a payment via a route", + "description": [ + "The **waitsendpay** RPC command polls or waits for the status of an outgoing payment that was initiated by a previous **sendpay** invocation.", + "", + "If the payment completed with success, this command returns with success. Otherwise, if the payment completed with failure, this command returns an error." + ], + "request": { + "required": [ + "payment_hash" + ], + "properties": { + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage*." + ] + }, + "timeout": { + "type": "u32", + "description": [ + "A timeout in seconds, for this RPC command to return. If the *timeout* is provided and the given amount of time passes without the payment definitely succeeding or definitely failing, this command returns with a 200 error code (payment still in progress). If *timeout* is not provided this call will wait indefinitely. Indicating a *timeout* of 0 effectively makes this call a pollable query of the status of the payment." + ] + }, + "partid": { + "type": "u64", + "description": [ + "Unique ID within this (multi-part) payment. It must match that of the **sendpay** command." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Grouping key to disambiguate multiple attempts to pay the same payment_hash." + ] + } }, - "details": {} + "pairedWith": [ + [ + "partid", + "groupid" + ] + ] }, - "allOf": [ - { - "if": { - "additionalProperties": true, - "properties": { - "subsystem": { - "type": "string", - "enum": [ - "invoices" - ] - } - } + "response": { + "required": [ + "id", + "created_index", + "payment_hash", + "status", + "created_at", + "amount_sent_msat" + ], + "properties": { + "created_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was created in." + ] + }, + "id": { + "type": "u64", + "description": [ + "Old synonym for created_index." + ] + }, + "groupid": { + "type": "u64", + "description": [ + "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." + ] + }, + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] + }, + "status": { + "type": "string", + "enum": [ + "complete" + ], + "description": [ + "Status of the payment." + ] }, - "then": { - "additionalProperties": false, - "properties": { - "subsystem": {}, - "created": {}, - "updated": {}, - "deleted": {}, - "details": { - "type": "object", - "additionalProperties": false, - "properties": { - "status": { - "type": "string", - "enum": [ - "unpaid", - "paid", - "expired" - ], - "description": "Whether it's paid, unpaid or unpayable" - }, - "label": { - "type": "string", - "description": "unique label supplied at invoice creation" - }, - "description": { - "type": "string", - "description": "description used in the invoice" - }, - "bolt11": { - "type": "string", - "description": "the BOLT11 string" - }, - "bolt12": { - "type": "string", - "description": "the BOLT12 string" - } - } - } - } - } - }, - { - "if": { - "additionalProperties": true, - "properties": { - "subsystem": { - "type": "string", - "enum": [ - "forwards" - ] - } - } + "amount_msat": { + "type": "msat", + "description": [ + "The amount delivered to destination (if known)." + ] }, - "then": { - "additionalProperties": false, - "properties": { - "subsystem": {}, - "created": {}, - "updated": {}, - "deleted": {}, - "details": { - "type": "object", - "additionalProperties": false, - "properties": { - "status": { - "type": "string", - "enum": [ - "offered", - "settled", - "failed", - "local_failed" - ], - "description": "still ongoing, completed, failed locally, or failed after forwarding" - }, - "in_channel": { - "type": "short_channel_id", - "description": "unique label supplied at invoice creation" - }, - "in_htlc_id": { - "type": "u64", - "description": "the unique HTLC id the sender gave this (not present if incoming channel was closed before ugprade to v22.11)" - }, - "in_msat": { - "type": "msat", - "description": "the value of the incoming HTLC" - }, - "out_channel": { - "type": "short_channel_id", - "description": "the channel that the HTLC (trying to) forward to" - } - } - } - } + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment if known." + ] + }, + "created_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] + }, + "updated_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was changed (only present if it has changed since creation)." + ] + }, + "completed_at": { + "type": "number", + "description": [ + "The UNIX timestamp showing when this payment was completed." + ] + }, + "amount_sent_msat": { + "type": "msat", + "description": [ + "The amount sent." + ] + }, + "label": { + "type": "string", + "description": [ + "The label, if given to sendpay." + ] + }, + "partid": { + "type": "u64", + "description": [ + "The *partid*, if given to sendpay." + ] + }, + "bolt11": { + "type": "string", + "description": [ + "The bolt11 string (if pay supplied one)." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The bolt12 string (if supplied for pay: **experimental-offers** only)." + ] } }, - { - "if": { - "additionalProperties": true, - "properties": { - "subsystem": { - "type": "string", - "enum": [ - "sendpays" - ] + "allOf": [ + { + "if": { + "properties": { + "status": { + "type": "string", + "enum": [ + "complete" + ] + } } - } - }, - "then": { - "additionalProperties": false, - "properties": { - "subsystem": {}, - "created": {}, - "updated": {}, - "deleted": {}, - "details": { - "type": "object", - "additionalProperties": false, - "properties": { - "status": { - "type": "string", - "enum": [ - "pending", - "failed", - "complete" - ], - "description": "status of the payment" - }, - "partid": { - "type": "u64", - "description": "Part number (for multiple parts to a single payment)" - }, - "groupid": { - "type": "u64", - "description": "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - } + }, + "then": { + "additionalProperties": false, + "required": [ + "payment_preimage" + ], + "properties": { + "id": {}, + "created_index": {}, + "updated_index": {}, + "groupid": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "destination": {}, + "created_at": {}, + "completed_at": {}, + "msatoshi_sent": {}, + "amount_sent_msat": {}, + "label": {}, + "partid": {}, + "bolt11": {}, + "bolt12": {}, + "payment_preimage": { + "type": "secret", + "description": [ + "The proof of payment: SHA256 of this **payment_hash**." + ] } } } } - } - ] - }, - "waitanyinvoice.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "lastpay_index": { - "type": "u64", - "description": "ignores any invoices paid prior to or including this index. 0 is equivalent to not specifying and negative value is invalid" - }, - "timeout": { - "type": "u64", - "description": "if specified, wait at most that number of seconds, which must be an integer. If the specified *timeout* is reached, this command will return with an error. You can specify this to 0 so that **waitanyinvoice** will return immediately with an error if no pending invoice is available yet. If unspecified, this command will wait indefinitely" - } - } - }, - "waitanyinvoice.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": true, - "required": [ - "label", - "description", - "payment_hash", - "status", - "created_index", - "expires_at" - ], - "properties": { - "label": { - "type": "string", - "description": "unique label supplied at invoice creation" - }, - "description": { - "type": "string", - "description": "description used in the invoice" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "status": { - "type": "string", - "enum": [ - "paid", - "expired" - ], - "description": "Whether it's paid or expired" - }, - "expires_at": { - "type": "u64", - "description": "UNIX timestamp of when it will become / became unpayable" - }, - "amount_msat": { - "type": "msat", - "description": "the amount required to pay this invoice" - }, - "bolt11": { - "type": "string", - "description": "the BOLT11 string (always present unless *bolt12* is)" - }, - "bolt12": { - "type": "string", - "description": "the BOLT12 string (always present unless *bolt11* is)" - }, - "created_index": { - "type": "u64", - "added": "v23.08", - "description": "1-based index indicating order this invoice was created in" - }, - "updated_index": { - "type": "u64", - "added": "v23.08", - "description": "1-based index indicating order this invoice was changed (only present if it has changed since creation)" - } + ] }, - "allOf": [ + "errors": [ + "On error, and even if the error occurred from a node other than the final destination, the route table will no longer be updated. Use the *exclude* parameter of the `getroute` command to ignore the failing route.", + "", + "- -1: Catchall nonspecific error.", + "- 200: Timed out before the payment could complete.", + "- 202: Unparseable onion reply. The *data* field of the error will have an *onionreply* field, a hex string representation of the raw onion reply.", + "- 203: Permanent failure at destination. The *data* field of the error will be routing failure object.", + "- 204: Failure along route; retry a different route. The *data* field of the error will be routing failure object.", + "- 208: A payment for *payment_hash* was never made and there is nothing to wait for.", + "- 209: The payment already failed, but the reason for failure was not stored. This should only occur when querying failed payments on very old databases.", + "", + "A routing failure object has the fields below:", + "", + "*erring_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on.", + "*erring_node*: The hex string of the pubkey id of the node that reported the error.", + "*erring_channel*: The short channel ID of the channel that has the error (or the final channel if the destination raised the error).", + "*erring_direction*: The direction of traversing the *erring_channel*:", + "*failcode*: The failure code, as per BOLT #4.", + "*failcodename*: The human-readable name corresponding to *failcode*, if known." + ], + "example_json_request": [ { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "paid" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "pay_index", - "amount_received_msat", - "paid_at", - "payment_preimage" - ], - "properties": { - "label": {}, - "description": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "bolt11": {}, - "bolt12": {}, - "expires_at": {}, - "created_index": {}, - "updated_index": {}, - "pay_index": { - "type": "u64", - "description": "Unique incrementing index for this payment" - }, - "amount_received_msat": { - "type": "msat", - "description": "the amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)" - }, - "paid_at": { - "type": "u64", - "description": "UNIX timestamp of when it was paid" - }, - "paid_outpoint": { - "type": "object", - "description": "Outpoint this invoice was paid with", - "added": "v23.11", - "additionalProperties": false, - "required": [ - "txid", - "outnum" - ], - "properties": { - "txid": { - "added": "v23.11", - "type": "txid", - "description": "ID of the transaction that paid the invoice" - }, - "outnum": { - "added": "v23.11", - "type": "u32", - "description": "The 0-based output number of the transaction that paid the invoice" - } - } - }, - "payment_preimage": { - "type": "secret", - "description": "proof of payment" - } - } - }, - "else": { - "additionalProperties": false, - "properties": { - "label": {}, - "description": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "bolt11": {}, - "bolt12": {}, - "created_index": {}, - "updated_index": {}, - "expires_at": {} - } + "id": "example:waitsendpay#1", + "method": "waitsendpay", + "params": { + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "timeout": null, + "partid": null, + "groupid": null } } - ] - }, - "waitblockheight.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "blockheight" ], - "properties": { - "blockheight": { - "type": "u32", - "description": "current blockheight of the blockchain if the value is greater than this number. If it is a present or past block height, then the command returns immediately" - }, - "timeout": { - "type": "u32", - "description": "only wait up to specified seconds. Defaults to 60 seconds" + "example_json_response": [ + { + "created_index": 1, + "id": 1, + "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", + "groupid": 1, + "updated_index": 1, + "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "amount_msat": 11000000, + "amount_sent_msat": 11000000, + "created_at": 1706152930, + "completed_at": 1706152933, + "status": "complete", + "payment_preimage": "af7ba559629f719c04c43a82767fe3622790a539164d6270db07f765203e574b", + "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk" } - } - }, - "waitblockheight.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "blockheight" ], - "properties": { - "blockheight": { - "type": "u32", - "description": "The current block height (>= *blockheight* parameter)" - } - } + "author": [ + "ZmnSCPxj <> is mainly responsible." + ], + "see_also": [ + "lightning-sendpay(7)", + "lightning-pay(7)" + ], + "resources": [ + "Main web site: " + ] }, - "waitinvoice.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-withdraw.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "label" + "rpc": "withdraw", + "title": "Command for withdrawing funds from the internal wallet", + "description": [ + "The **withdraw** RPC command sends funds from Core Lightning's internal wallet to the address specified in *destination*." ], - "properties": { - "label": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ], - "description": "unique label of the invoice waiting to be paid" - } - } - }, - "waitinvoice.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": true, - "required": [ - "label", - "description", - "payment_hash", - "status", - "created_index", - "expires_at" - ], - "properties": { - "label": { - "type": "string", - "description": "unique label supplied at invoice creation" - }, - "description": { - "type": "string", - "description": "description used in the invoice" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "status": { - "type": "string", - "enum": [ - "paid", - "expired" - ], - "description": "Whether it's paid or expired" - }, - "expires_at": { - "type": "u64", - "description": "UNIX timestamp of when it will become / became unpayable" - }, - "amount_msat": { - "type": "msat", - "description": "the amount required to pay this invoice" - }, - "bolt11": { - "type": "string", - "description": "the BOLT11 string (always present unless *bolt12* is)" - }, - "bolt12": { - "type": "string", - "description": "the BOLT12 string (always present unless *bolt11* is)" - }, - "created_index": { - "type": "u64", - "added": "v23.08", - "description": "1-based index indicating order this invoice was created in" - }, - "updated_index": { - "type": "u64", - "added": "v23.08", - "description": "1-based index indicating order this invoice was changed (only present if it has changed since creation)" - } - }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "paid" - ] - } - } + "request": { + "required": [ + "destination", + "satoshi" + ], + "properties": { + "destination": { + "type": "string", + "description": [ + "Any Bitcoin accepted type, including bech32." + ] }, - "then": { - "additionalProperties": false, - "required": [ - "pay_index", - "amount_received_msat", - "paid_at", - "payment_preimage" + "satoshi": { + "type": "msat_or_all", + "description": [ + "The amount to be withdrawn from the internal wallet (expressed, as name suggests, in satoshi). The string *all* can be used to specify withdrawal of all available funds (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*." + ] + }, + "feerate": { + "type": "feerate", + "description": [ + "Used for the withdrawal as initial feerate." ], - "properties": { - "label": {}, - "description": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "bolt11": {}, - "bolt12": {}, - "expires_at": {}, - "created_index": {}, - "updated_index": {}, - "pay_index": { - "type": "u64", - "description": "Unique incrementing index for this payment" - }, - "amount_received_msat": { - "type": "msat", - "description": "the amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)" - }, - "paid_at": { - "type": "u64", - "description": "UNIX timestamp of when it was paid" - }, - "paid_outpoint": { - "type": "object", - "description": "Outpoint this invoice was paid with", - "added": "v23.11", - "additionalProperties": false, - "required": [ - "txid", - "outnum" - ], - "properties": { - "txid": { - "added": "v23.11", - "type": "txid", - "description": "ID of the transaction that paid the invoice" - }, - "outnum": { - "added": "v23.11", - "type": "u32", - "description": "The 0-based output number of the transaction that paid the invoice" - } - } - }, - "payment_preimage": { - "type": "secret", - "description": "proof of payment" - } - } + "default": "*normal*" }, - "else": { - "additionalProperties": false, - "properties": { - "label": {}, - "description": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "bolt11": {}, - "bolt12": {}, - "created_index": {}, - "updated_index": {}, - "expires_at": {} + "minconf": { + "type": "u16", + "description": [ + "Minimum number of confirmations that used outputs should have." + ], + "default": 1 + }, + "utxos": { + "type": "array", + "description": [ + "Specifies the utxos to be used to be withdrawn from, as an array of `txid:vout`. These must be drawn from the node's available UTXO set." + ], + "items": { + "type": "outpoint" } } } - ] - }, - "waitsendpay.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "payment_hash" - ], - "properties": { - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage*" - }, - "timeout": { - "type": "u32", - "description": "a timeout in seconds, for this RPC command to return. If the *timeout* is provided and the given amount of time passes without the payment definitely succeeding or definitely failing, this command returns with a 200 error code (payment still in progress). If *timeout* is not provided this call will wait indefinitely. Indicating a *timeout* of 0 effectively makes this call a pollable query of the status of the payment" - }, - "partid": { - "type": "u64", - "description": "unique ID within this (multi-part) payment. It must match that of the **sendpay** command" - }, - "groupid": { - "type": "u64", - "description": "grouping key to disambiguate multiple attempts to pay the same payment_hash" - } - } - }, - "waitsendpay.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": true, - "required": [ - "id", - "created_index", - "payment_hash", - "status", - "created_at", - "amount_sent_msat" - ], - "properties": { - "created_index": { - "added": "v23.11", - "type": "u64", - "description": "1-based index indicating order this payment was created in" - }, - "id": { - "type": "u64", - "description": "old synonym for created_index" - }, - "groupid": { - "type": "u64", - "description": "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "status": { - "type": "string", - "enum": [ - "complete" - ], - "description": "status of the payment" - }, - "amount_msat": { - "type": "msat", - "description": "The amount delivered to destination (if known)" - }, - "destination": { - "type": "pubkey", - "description": "the final destination of the payment if known" - }, - "created_at": { - "type": "u64", - "description": "the UNIX timestamp showing when this payment was initiated" - }, - "updated_index": { - "added": "v23.11", - "type": "u64", - "description": "1-based index indicating order this payment was changed (only present if it has changed since creation)" - }, - "completed_at": { - "type": "number", - "description": "the UNIX timestamp showing when this payment was completed" - }, - "amount_sent_msat": { - "type": "msat", - "description": "The amount sent" - }, - "label": { - "type": "string", - "description": "the label, if given to sendpay" - }, - "partid": { - "type": "u64", - "description": "the *partid*, if given to sendpay" - }, - "bolt11": { - "type": "string", - "description": "the bolt11 string (if pay supplied one)" - }, - "bolt12": { - "type": "string", - "description": "the bolt12 string (if supplied for pay: **experimental-offers** only)." - } }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "complete" - ] - } - } + "response": { + "required": [ + "psbt", + "tx", + "txid" + ], + "properties": { + "tx": { + "type": "hex", + "description": [ + "The fully signed bitcoin transaction." + ] }, - "then": { - "additionalProperties": false, - "required": [ - "payment_preimage" - ], - "properties": { - "id": {}, - "created_index": {}, - "updated_index": {}, - "groupid": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "destination": {}, - "created_at": {}, - "completed_at": {}, - "msatoshi_sent": {}, - "amount_sent_msat": {}, - "label": {}, - "partid": {}, - "bolt11": {}, - "bolt12": {}, - "payment_preimage": { - "type": "secret", - "description": "the proof of payment: SHA256 of this **payment_hash**" - } - } + "txid": { + "type": "txid", + "description": [ + "The transaction id of *tx*." + ] + }, + "psbt": { + "type": "string", + "description": [ + "The PSBT representing the unsigned transaction." + ] } } - ] - }, - "withdraw.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "destination", - "satoshi" - ], - "properties": { - "destination": { - "type": "string", - "description": "any Bitcoin accepted type, including bech32" - }, - "satoshi": { - "type": "msat_or_all", - "description": "the amount to be withdrawn from the internal wallet (expressed, as name suggests, in satoshi). The string *all* can be used to specify withdrawal of all available funds (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" - }, - "feerate": { - "type": "feerate", - "description": "used for the withdrawal as initial feerate. The default is *normal*" - }, - "minconf": { - "type": "u16", - "description": "minimum number of confirmations that used outputs should have. Default is 1" + }, + "errors": [ + "On failure, an error is reported and the withdrawal transaction is not created.", + "", + "- -1: Catchall nonspecific error.", + "- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.", + "- 302: The dust limit is not met.", + "- 313: The `min-emergency-msat` reserve not be preserved (and we have anchor channels)." + ], + "example_json_request": [ + { + "id": "example:withdraw#1", + "method": "withdraw", + "params": { + "destination": "bcrt1qjc7j2l5es4haw35c9jzm8dfm763ng5djp8f0s0", + "satoshi": 555555, + "feerate": null, + "minconf": null, + "utxos": null + } }, - "utxos": { - "type": "array", - "description": "specifies the utxos to be used to be withdrawn from, as an array of `txid:vout`. These must be drawn from the node's available UTXO set", - "items": { - "type": "outpoint" + { + "id": "example:withdraw#2", + "method": "withdraw", + "params": { + "destination": "bcrt1q66ukn5mdllddnp53j0mx8mjgph7uwdygn0uy45", + "satoshi": "all", + "feerate": "20000perkb", + "minconf": 0, + "utxos": [ + "218390859cf94d869e33f69161f4187a98f691afe868c20811528f589e90a61f:1" + ] } } - } - }, - "withdraw.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "psbt", - "tx", - "txid" - ], - "properties": { - "tx": { - "type": "hex", - "description": "the fully signed bitcoin transaction" - }, - "txid": { - "type": "txid", - "description": "the transaction id of *tx*" + ], + "example_json_response": [ + { + "tx": "0200000001ef28647baa13cc4c03b8a58c8bd08b69de434c22ff591eb68171ae992e3d816d0000000000fdffffff02237a080000000000160014963d257e99856fd746982c85b3b53bf6a33451b24d6808000000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a66000000", + "txid": "ccb97d7dc695cabb78b217c0b27d7d00d2941966199480e6443e0680d24d69eb", + "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABAWPCRda9hy4QKqUEmtb7gK7SAqzh1xBP8nZ7PCj+7+JDAAAAAAD9////Akf0EAAAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WUs/fQpAQAAABYAFOIj6yaI/g85utJBtkPPdK1X59cfAkcwRAIgH7J57HuUTpnCbDrDqE8W7ryuCXk+i/TszQ/NF55lWncCIDeN4y+EzIDP3l2XO5/wjk98krYqnzvEhrStk+0+fTowASEC6Ng5r5KTNIXBRRvjivsd8SKnHF59r/ViDj2+CLJVb75lAAAAAQEfR/QQAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZSICA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPRzBEAiBY0urYSHLnnXaAJH7yaGfvGmm+VuNCNIBhQaJU6iDNEgIgA7EASW+V00Su+lRQAE3Qbe4wavLq7l6Jn2vR+6Snyd0BIgYD10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8IAfrZCgAAAAABDiDvKGR7qhPMTAO4pYyL0Itp3kNMIv9ZHraBca6ZLj2BbQEPBAAAAAABEAT9////AAEDCCN6CAAAAAAAAQQWABSWPSV+mYVv10aYLIWztTv2ozRRsgz8CWxpZ2h0bmluZwQCAAEAAQMITWgIAAAAAAABBCJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aIQeRRTKBKkQKTXZscc05GTaUo0CuEeAS5boa2e+6bnbKUwkAwsyrFwIAAAAA" }, - "psbt": { - "type": "string", - "description": "the PSBT representing the unsigned transaction" + { + "tx": "02000000011fa6909e588f521108c268e8af91f6987a18f46191f6339e864df99c859083210100000000fdffffff0158070f0000000000160014d6b969d36dffdad9869193f663ee480dfdc7348867000000", + "txid": "ad9a712a201214c68c39ca5be68c9d153d1cac91e540d88aa3207b241e23acf8", + "psbt": "cHNidP8BAgQCAAAAAQMEZwAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQD9ZQECAAAAAAEBVa+m1d1amChv4Dwq1rVoS4KSm0BUUnVa3fUYcB3dH9oAAAAAAP////8CECcAAAAAAAAiUSBXeaBg8gDUDo+HGkDrkWFMxb+m0KX4UuBTQAp/7/hhUOEPDwAAAAAAIlEg7tdFgE2peEzCA/Vj76mf+lT98BsTe8lk5jwxJAcP++YEAEcwRAIgPsWO/4IxeW6OclDdXVnwL99X7B18sRlxgFqyvUAzN7gCIGOQOq0wZ6bV+wdYQP+9sH8IkfmqWZbQRRDkZEgfcprMAUcwRAIgb5/dI4+uVhluQjSA2q/3oAGxZd4vYzQWexfmcRQML7ECIFfgRwCaHYdyu5/H5moOPlfQlLc2gPgB6bgtfNSfRA6jAUdSIQIyQmbehAOzqxV6CfH3hNWHr2GDHJmMFRvMIbt0wrIxSyEC4704AJhmydqOxKqZzE6pxsDdRt8Vxh7wzh8nEpFxTldSrgAAAAABASvhDw8AAAAAACJRIO7XRYBNqXhMwgP1Y++pn/pU/fAbE3vJZOY8MSQHD/vmAQ4gH6aQnliPUhEIwmjor5H2mHoY9GGR9jOehk35nIWQgyEBDwQBAAAAARAE/f///wETQL0MqyYsx9Z9q14BhByMgWLW4oJHOqED5qcZ3wyJ4eDuLYfNGq6Ck30dAqFzJL4VhZLSuv87zN/1AEDNMl2DmTohFl03KAgp8YbLmVzcy/I4q0VkATk5c1E5YySjZXXfNN3/CQAHHEnKAAAAAAAiAgK5wMaEThKlMclo5VxVB47BbZv3a+kpD9h9HMpytIOaFwjWuWnTBAAAAAEDCFgHDwAAAAAAAQQWABTWuWnTbf/a2YaRk/Zj7kgN/cc0iAz8CWxpZ2h0bmluZwQCAAEA" } - } + ], + "author": [ + "Felix <> is mainly responsible." + ], + "see_also": [ + "lightning-listfunds(7)", + "lightning-fundchannel(7)", + "lightning-newaddr(7)", + "lightning-txprepare(7)", + "lightning-feerates(7)" + ], + "resources": [ + "Main web site: " + ] } } \ No newline at end of file diff --git a/doc/schemas/addgossip.request.json b/doc/schemas/addgossip.request.json deleted file mode 100644 index 31ce283c1f39..000000000000 --- a/doc/schemas/addgossip.request.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "message" - ], - "properties": { - "message": { - "type": "hex", - "description": "The raw, hex-encoded, gossip message to add to the local gossip view" - } - } -} diff --git a/doc/schemas/addgossip.schema.json b/doc/schemas/addgossip.schema.json deleted file mode 100644 index 1aad2dcae935..000000000000 --- a/doc/schemas/addgossip.schema.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "properties": {} -} diff --git a/doc/schemas/addpsbtoutput.request.json b/doc/schemas/addpsbtoutput.request.json deleted file mode 100644 index 7f12b858d583..000000000000 --- a/doc/schemas/addpsbtoutput.request.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "satoshi" - ], - "added": "v23.11", - "properties": { - "satoshi": { - "type": "msat", - "description": "the satoshi value of the output. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" - }, - "initialpsbt": { - "type": "string", - "description": "base 64 encoded PSBT to add the output to. If not specified, one will be generated automatically" - }, - "locktime": { - "type": "u32", - "description": "if not set, it is set to a recent block height (if no initial psbt is specified)" - }, - "destination": { - "type": "string", - "description": "if it is not set, an internal address is generated" - } - } -} diff --git a/doc/schemas/addpsbtoutput.schema.json b/doc/schemas/addpsbtoutput.schema.json deleted file mode 100644 index 7c2a7aaae4c8..000000000000 --- a/doc/schemas/addpsbtoutput.schema.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt", - "estimated_added_weight", - "outnum" - ], - "added": "v23.11", - "properties": { - "psbt": { - "type": "string", - "description": "Unsigned PSBT which fulfills the parameters given" - }, - "estimated_added_weight": { - "type": "u32", - "description": "The estimated weight of the added output" - }, - "outnum": { - "type": "u32", - "description": "The 0-based number where the output was placed" - } - } -} diff --git a/doc/schemas/autoclean-once.request.json b/doc/schemas/autoclean-once.request.json deleted file mode 100644 index 59cb3bcc5e42..000000000000 --- a/doc/schemas/autoclean-once.request.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "subsystem", - "age" - ], - "properties": { - "subsystem": { - "type": "string", - "enum": [ - "succeededforwards", - "failedforwards", - "succeededpays", - "failedpays", - "paidinvoices", - "expiredinvoices" - ], - "description": "What subsystem to clean. Currently supported subsystems are:\t* `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`).\t* `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`).\t* `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`).\t* `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`).\t* `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`).\t* `paidinvoices`: invoices which were paid (`paid` in listinvoices `status)" - }, - "age": { - "type": "u64", - "description": "non-zero number in seconds. How many seconds old an entry must be to delete it" - } - } -} diff --git a/doc/schemas/autoclean-once.schema.json b/doc/schemas/autoclean-once.schema.json deleted file mode 100644 index 36e4969bff7c..000000000000 --- a/doc/schemas/autoclean-once.schema.json +++ /dev/null @@ -1,124 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": true, - "required": [ - "autoclean" - ], - "properties": { - "autoclean": { - "type": "object", - "additionalProperties": false, - "properties": { - "succeededforwards": { - "type": "object", - "additionalProperties": false, - "required": [ - "cleaned", - "uncleaned" - ], - "properties": { - "cleaned": { - "type": "u64", - "description": "total number of deletions done this run" - }, - "uncleaned": { - "type": "u64", - "description": "the total number of entries *not* deleted this run" - } - } - }, - "failedforwards": { - "type": "object", - "additionalProperties": false, - "required": [ - "cleaned", - "uncleaned" - ], - "properties": { - "cleaned": { - "type": "u64", - "description": "total number of deletions done this run" - }, - "uncleaned": { - "type": "u64", - "description": "the total number of entries *not* deleted this run" - } - } - }, - "succeededpays": { - "type": "object", - "additionalProperties": false, - "required": [ - "cleaned", - "uncleaned" - ], - "properties": { - "cleaned": { - "type": "u64", - "description": "total number of deletions done this run" - }, - "uncleaned": { - "type": "u64", - "description": "the total number of entries *not* deleted this run" - } - } - }, - "failedpays": { - "type": "object", - "additionalProperties": false, - "required": [ - "cleaned", - "uncleaned" - ], - "properties": { - "cleaned": { - "type": "u64", - "description": "total number of deletions done this run" - }, - "uncleaned": { - "type": "u64", - "description": "the total number of entries *not* deleted this run" - } - } - }, - "paidinvoices": { - "type": "object", - "additionalProperties": false, - "required": [ - "cleaned", - "uncleaned" - ], - "properties": { - "cleaned": { - "type": "u64", - "description": "total number of deletions done this run" - }, - "uncleaned": { - "type": "u64", - "description": "the total number of entries *not* deleted this run" - } - } - }, - "expiredinvoices": { - "type": "object", - "additionalProperties": false, - "required": [ - "cleaned", - "uncleaned" - ], - "properties": { - "cleaned": { - "type": "u64", - "description": "total number of deletions done this run" - }, - "uncleaned": { - "type": "u64", - "description": "the total number of entries *not* deleted this run" - } - } - } - } - } - } -} diff --git a/doc/schemas/autoclean-status.request.json b/doc/schemas/autoclean-status.request.json deleted file mode 100644 index 75054685b8e1..000000000000 --- a/doc/schemas/autoclean-status.request.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "subsystem": { - "type": "string", - "enum": [ - "succeededforwards", - "failedforwards", - "succeededpays", - "failedpays", - "paidinvoices", - "expiredinvoices" - ], - "description": "What subsystem to ask about. Currently supported subsystems are:\t* `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`).\t* `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`).\t* `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`).\t* `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`).\t* `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`).\t* `paidinvoices`: invoices which were paid (`paid` in listinvoices `status)" - } - } -} diff --git a/doc/schemas/autoclean-status.schema.json b/doc/schemas/autoclean-status.schema.json deleted file mode 100644 index bb5234f7b299..000000000000 --- a/doc/schemas/autoclean-status.schema.json +++ /dev/null @@ -1,346 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "autoclean" - ], - "properties": { - "autoclean": { - "type": "object", - "additionalProperties": false, - "properties": { - "succeededforwards": { - "type": "object", - "additionalProperties": true, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": { - "type": "boolean", - "description": "whether autocleaning is enabled for successful listforwards" - }, - "cleaned": { - "type": "u64", - "description": "total number of deletions done (ever)" - } - }, - "if": { - "properties": { - "enabled": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "enabled", - "age", - "cleaned" - ], - "properties": { - "enabled": {}, - "cleaned": {}, - "age": { - "type": "u64", - "description": "age (in seconds) to delete successful listforwards" - } - } - }, - "else": { - "additionalProperties": false, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": {}, - "cleaned": {} - } - } - }, - "failedforwards": { - "type": "object", - "additionalProperties": true, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": { - "type": "boolean", - "description": "whether autocleaning is enabled for failed listforwards" - }, - "cleaned": { - "type": "u64", - "description": "total number of deletions done (ever)" - } - }, - "if": { - "properties": { - "enabled": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "enabled", - "age", - "cleaned" - ], - "properties": { - "enabled": {}, - "cleaned": {}, - "age": { - "type": "u64", - "description": "age (in seconds) to delete failed listforwards" - } - } - }, - "else": { - "additionalProperties": false, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": {}, - "cleaned": {} - } - } - }, - "succeededpays": { - "type": "object", - "additionalProperties": true, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": { - "type": "boolean", - "description": "whether autocleaning is enabled for successful listpays/listsendpays" - }, - "cleaned": { - "type": "u64", - "description": "total number of deletions done (ever)" - } - }, - "if": { - "properties": { - "enabled": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "enabled", - "age", - "cleaned" - ], - "properties": { - "enabled": {}, - "cleaned": {}, - "age": { - "type": "u64", - "description": "age (in seconds) to delete successful listpays/listsendpays" - } - } - }, - "else": { - "additionalProperties": false, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": {}, - "cleaned": {} - } - } - }, - "failedpays": { - "type": "object", - "additionalProperties": true, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": { - "type": "boolean", - "description": "whether autocleaning is enabled for failed listpays/listsendpays" - }, - "cleaned": { - "type": "u64", - "description": "total number of deletions done (ever)" - } - }, - "if": { - "properties": { - "enabled": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "enabled", - "age", - "cleaned" - ], - "properties": { - "enabled": {}, - "cleaned": {}, - "age": { - "type": "u64", - "description": "age (in seconds) to delete failed listpays/listsendpays" - } - } - }, - "else": { - "additionalProperties": false, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": {}, - "cleaned": {} - } - } - }, - "paidinvoices": { - "type": "object", - "additionalProperties": true, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": { - "type": "boolean", - "description": "whether autocleaning is enabled for paid listinvoices" - }, - "cleaned": { - "type": "u64", - "description": "total number of deletions done (ever)" - } - }, - "if": { - "properties": { - "enabled": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "enabled", - "age", - "cleaned" - ], - "properties": { - "enabled": {}, - "cleaned": {}, - "age": { - "type": "u64", - "description": "age (in seconds) to paid listinvoices" - } - } - }, - "else": { - "additionalProperties": false, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": {}, - "cleaned": {} - } - } - }, - "expiredinvoices": { - "type": "object", - "additionalProperties": true, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": { - "type": "boolean", - "description": "whether autocleaning is enabled for expired (unpaid) listinvoices" - }, - "cleaned": { - "type": "u64", - "description": "total number of deletions done (ever)" - } - }, - "if": { - "properties": { - "enabled": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "enabled", - "age", - "cleaned" - ], - "properties": { - "enabled": {}, - "cleaned": {}, - "age": { - "type": "u64", - "description": "age (in seconds) to expired listinvoices" - } - } - }, - "else": { - "additionalProperties": false, - "required": [ - "enabled", - "cleaned" - ], - "properties": { - "enabled": {}, - "cleaned": {} - } - } - } - } - } - } -} diff --git a/doc/schemas/autocleaninvoice.request.json b/doc/schemas/autocleaninvoice.request.json deleted file mode 100644 index 229363d504ee..000000000000 --- a/doc/schemas/autocleaninvoice.request.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "expired_by": { - "type": "u64", - "description": "How long an invoice must be expired (seconds) before we delete it." - }, - "cycle_seconds": { - "type": "u64", - "description": "The interval (in seconds) between cleaning expired invoices" - } - } -} diff --git a/doc/schemas/autocleaninvoice.schema.json b/doc/schemas/autocleaninvoice.schema.json deleted file mode 100644 index f370eee56490..000000000000 --- a/doc/schemas/autocleaninvoice.schema.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": true, - "required": [ - "enabled" - ], - "properties": { - "enabled": { - "type": "boolean", - "description": "whether invoice autocleaning is active" - } - }, - "if": { - "properties": { - "enabled": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "expired_by", - "cycle_seconds" - ], - "properties": { - "enabled": {}, - "expired_by": { - "type": "u64", - "description": "how long an invoice must be expired (seconds) before we delete it" - }, - "cycle_seconds": { - "type": "u64", - "description": "how long an invoice must be expired (seconds) before we delete it" - } - } - }, - "else": { - "additionalProperties": false, - "properties": { - "enabled": {} - } - } -} diff --git a/doc/schemas/batching.request.json b/doc/schemas/batching.request.json deleted file mode 100644 index d4cd745ad1e7..000000000000 --- a/doc/schemas/batching.request.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "enable" - ], - "properties": { - "enable": { - "type": "boolean", - "description": "whether to enable or disable transaction batching. Defaults to *False*" - } - } -} diff --git a/doc/schemas/batching.schema.json b/doc/schemas/batching.schema.json deleted file mode 100644 index 1aad2dcae935..000000000000 --- a/doc/schemas/batching.schema.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "properties": {} -} diff --git a/doc/schemas/bkpr-channelsapy.request.json b/doc/schemas/bkpr-channelsapy.request.json deleted file mode 100644 index 7f272df97761..000000000000 --- a/doc/schemas/bkpr-channelsapy.request.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "start_time": { - "type": "u64", - "description": "UNIX timestamp (in seconds) to filter events after the provided timestamp. Defaults to zero" - }, - "end_time": { - "type": "u64", - "description": "UNIX timestamp (in seconds) to filter events up to and at the provided timestamp. Defaults to max-int" - } - } -} diff --git a/doc/schemas/bkpr-channelsapy.schema.json b/doc/schemas/bkpr-channelsapy.schema.json deleted file mode 100644 index d66161037d1e..000000000000 --- a/doc/schemas/bkpr-channelsapy.schema.json +++ /dev/null @@ -1,124 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channels_apy" - ], - "properties": { - "channels_apy": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "account", - "routed_out_msat", - "routed_in_msat", - "lease_fee_paid_msat", - "lease_fee_earned_msat", - "pushed_out_msat", - "pushed_in_msat", - "our_start_balance_msat", - "channel_start_balance_msat", - "fees_out_msat", - "utilization_out", - "utilization_in", - "apy_out", - "apy_in", - "apy_total" - ], - "properties": { - "account": { - "type": "string", - "description": "The account name. If the account is a channel, the channel_id. The 'net' entry is the rollup of all channel accounts" - }, - "routed_out_msat": { - "type": "msat", - "description": "Sats routed (outbound)" - }, - "routed_in_msat": { - "type": "msat", - "description": "Sats routed (inbound)" - }, - "lease_fee_paid_msat": { - "type": "msat", - "description": "Sats paid for leasing inbound (liquidity ads)" - }, - "lease_fee_earned_msat": { - "type": "msat", - "description": "Sats earned for leasing outbound (liquidity ads)" - }, - "pushed_out_msat": { - "type": "msat", - "description": "Sats pushed to peer at open" - }, - "pushed_in_msat": { - "type": "msat", - "description": "Sats pushed in from peer at open" - }, - "our_start_balance_msat": { - "type": "msat", - "description": "Starting balance in channel at funding. Note that if our start balance is zero, any _initial field will be omitted (can't divide by zero)" - }, - "channel_start_balance_msat": { - "type": "msat", - "description": "Total starting balance at funding" - }, - "fees_out_msat": { - "type": "msat", - "description": "Fees earned on routed outbound" - }, - "fees_in_msat": { - "type": "msat", - "description": "Fees earned on routed inbound" - }, - "utilization_out": { - "type": "string", - "description": "Sats routed outbound / total start balance" - }, - "utilization_out_initial": { - "type": "string", - "description": "Sats routed outbound / our start balance" - }, - "utilization_in": { - "type": "string", - "description": "Sats routed inbound / total start balance" - }, - "utilization_in_initial": { - "type": "string", - "description": "Sats routed inbound / our start balance" - }, - "apy_out": { - "type": "string", - "description": "Fees earned on outbound routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)" - }, - "apy_out_initial": { - "type": "string", - "description": "Fees earned on outbound routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)" - }, - "apy_in": { - "type": "string", - "description": "Fees earned on inbound routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)" - }, - "apy_in_initial": { - "type": "string", - "description": "Fees earned on inbound routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)" - }, - "apy_total": { - "type": "string", - "description": "Total fees earned on routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)" - }, - "apy_total_initial": { - "type": "string", - "description": "Total fees earned on routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)" - }, - "apy_lease": { - "type": "string", - "description": "Lease fees earned over total amount leased for the lease term, amortized to a year (APY). Only appears if channel was leased out by us" - } - } - } - } - } -} diff --git a/doc/schemas/bkpr-dumpincomecsv.request.json b/doc/schemas/bkpr-dumpincomecsv.request.json deleted file mode 100644 index af9f9492f85f..000000000000 --- a/doc/schemas/bkpr-dumpincomecsv.request.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "csv_format" - ], - "properties": { - "csv_format": { - "type": "string", - "description": "CSV format to use. See RETURN VALUE for options" - }, - "csv_file": { - "type": "string", - "description": "on-disk destination of the generated CSV file" - }, - "consolidate_fees": { - "type": "boolean", - "description": "if true, we emit a single, consolidated event for any onchain-fees for a txid and account. Otherwise, events for every update to the onchain fee calculation for this account and txid will be printed. Defaults to true. Note that this means that the events emitted are non-stable, i.e. calling **dumpincomecsv** twice may result in different onchain fee events being emitted, depending on how much information we've logged for that transaction" - }, - "start_time": { - "type": "u64", - "description": "UNIX timestamp (in seconds) that filters events after the provided timestamp. Defaults to zero" - }, - "end_time": { - "type": "u64", - "description": "UNIX timestamp (in seconds) that filters events up to and at the provided timestamp. Defaults to max-int" - } - } -} diff --git a/doc/schemas/bkpr-dumpincomecsv.schema.json b/doc/schemas/bkpr-dumpincomecsv.schema.json deleted file mode 100644 index fe3da41d536a..000000000000 --- a/doc/schemas/bkpr-dumpincomecsv.schema.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "unevaluatedProperties": false, - "required": [ - "csv_file", - "csv_format" - ], - "properties": { - "csv_file": { - "type": "string", - "description": "File that the csv was generated to" - }, - "csv_format": { - "type": "string", - "enum": [ - "cointracker", - "koinly", - "harmony", - "quickbooks" - ], - "description": "Format to print csv as" - } - } -} diff --git a/doc/schemas/bkpr-inspect.request.json b/doc/schemas/bkpr-inspect.request.json deleted file mode 100644 index 3cd8d6decb72..000000000000 --- a/doc/schemas/bkpr-inspect.request.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "account" - ], - "properties": { - "account": { - "type": "string", - "description": "channel account to inspect" - } - } -} diff --git a/doc/schemas/bkpr-inspect.schema.json b/doc/schemas/bkpr-inspect.schema.json deleted file mode 100644 index 24ab7504f200..000000000000 --- a/doc/schemas/bkpr-inspect.schema.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "txs" - ], - "properties": { - "txs": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "txid", - "fees_paid_msat", - "outputs" - ], - "properties": { - "txid": { - "type": "txid", - "description": "transaction id" - }, - "blockheight": { - "type": "u32", - "description": "Blockheight of transaction" - }, - "fees_paid_msat": { - "type": "msat", - "description": "Amount paid in sats for this tx" - }, - "outputs": { - "type": "array", - "items": { - "type": "object", - "required": [ - "account", - "outnum", - "output_value_msat", - "currency" - ], - "additionalProperties": false, - "properties": { - "account": { - "type": "string", - "description": "Account this output affected" - }, - "outnum": { - "type": "u32", - "description": "Index of output" - }, - "output_value_msat": { - "type": "msat", - "description": "Value of the output" - }, - "currency": { - "type": "string", - "description": "human-readable bech32 part for this coin type" - }, - "credit_msat": { - "type": "msat", - "description": "Amount credited to account" - }, - "debit_msat": { - "type": "msat", - "description": "Amount debited from account" - }, - "originating_account": { - "type": "string", - "description": "Account this output originated from" - }, - "output_tag": { - "type": "string", - "description": "Description of output creation event" - }, - "spend_tag": { - "type": "string", - "description": "Description of output spend event" - }, - "spending_txid": { - "type": "txid", - "description": "Transaction this output was spent in" - }, - "payment_id": { - "type": "hex", - "description": "lightning payment identifier. For an htlc, this will be the preimage." - } - }, - "allOf": [ - { - "if": { - "required": [ - "credit_msat" - ] - }, - "then": { - "required": [ - "output_tag" - ], - "additionalProperties": false, - "properties": { - "account": {}, - "outnum": {}, - "output_value_msat": {}, - "currency": {}, - "credit_msat": {}, - "originating_account": {}, - "debit_msat": {}, - "output_tag": {}, - "spend_tag": {}, - "spending_txid": {}, - "payment_id": {} - } - } - }, - { - "if": { - "required": [ - "spending_txid" - ] - }, - "then": { - "required": [ - "spend_tag", - "debit_msat" - ], - "additionalProperties": false, - "properties": { - "account": {}, - "outnum": {}, - "output_value_msat": {}, - "currency": {}, - "credit_msat": {}, - "originating_account": {}, - "debit_msat": {}, - "output_tag": {}, - "spend_tag": {}, - "spending_txid": {}, - "payment_id": {} - } - } - } - ] - } - } - } - } - } - } -} diff --git a/doc/schemas/bkpr-listaccountevents.request.json b/doc/schemas/bkpr-listaccountevents.request.json deleted file mode 100644 index c1a60465824a..000000000000 --- a/doc/schemas/bkpr-listaccountevents.request.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "account": { - "type": "string", - "description": "receive events for the specified account" - } - } -} diff --git a/doc/schemas/bkpr-listaccountevents.schema.json b/doc/schemas/bkpr-listaccountevents.schema.json deleted file mode 100644 index 45c98c0f3f37..000000000000 --- a/doc/schemas/bkpr-listaccountevents.schema.json +++ /dev/null @@ -1,188 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "events" - ], - "properties": { - "events": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "account", - "type", - "tag", - "credit_msat", - "debit_msat", - "currency", - "timestamp" - ], - "properties": { - "account": { - "type": "string", - "description": "The account name. If the account is a channel, the channel_id" - }, - "type": { - "type": "string", - "enum": [ - "onchain_fee", - "chain", - "channel" - ], - "description": "Coin movement type" - }, - "tag": { - "type": "string", - "description": "Description of movement" - }, - "credit_msat": { - "type": "msat", - "description": "Amount credited" - }, - "debit_msat": { - "type": "msat", - "description": "Amount debited" - }, - "currency": { - "type": "string", - "description": "human-readable bech32 part for this coin type" - }, - "timestamp": { - "type": "u32", - "description": "Timestamp this event was recorded by the node. For consolidated events such as onchain_fees, the most recent timestamp" - } - }, - "allOf": [ - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "chain" - ] - } - } - }, - "then": { - "properties": { - "account": {}, - "type": {}, - "tag": {}, - "credit_msat": {}, - "debit_msat": {}, - "currency": {}, - "timestamp": {}, - "outpoint": { - "type": "string", - "description": "The txid:outnum for this event" - }, - "blockheight": { - "type": "u32", - "description": "For chain events, blockheight this occured at" - }, - "origin": { - "type": "string", - "description": "The account this movement originated from" - }, - "payment_id": { - "type": "hex", - "description": "lightning payment identifier. For an htlc, this will be the preimage." - }, - "txid": { - "type": "txid", - "description": "The txid of the transaction that created this event" - }, - "description": { - "type": "string", - "description": "The description of this event" - } - }, - "required": [ - "outpoint", - "blockheight" - ], - "additionalProperties": false - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "onchain_fee" - ] - } - } - }, - "then": { - "properties": { - "account": {}, - "type": {}, - "tag": {}, - "credit_msat": {}, - "debit_msat": {}, - "currency": {}, - "timestamp": {}, - "description": {}, - "txid": { - "type": "txid", - "description": "The txid of the transaction that created this event" - } - }, - "required": [ - "txid" - ], - "additionalProperties": false - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "channel" - ] - } - } - }, - "then": { - "properties": { - "account": {}, - "type": {}, - "tag": {}, - "credit_msat": {}, - "debit_msat": {}, - "currency": {}, - "timestamp": {}, - "description": {}, - "fees_msat": { - "type": "msat", - "description": "Amount paid in fees" - }, - "is_rebalance": { - "type": "boolean", - "description": "Is this payment part of a rebalance" - }, - "payment_id": { - "type": "hex", - "description": "lightning payment identifier. For an htlc, this will be the preimage." - }, - "part_id": { - "type": "u32", - "description": "Counter for multi-part payments" - } - }, - "additionalProperties": false - } - } - ] - } - } - } -} diff --git a/doc/schemas/bkpr-listbalances.request.json b/doc/schemas/bkpr-listbalances.request.json deleted file mode 100644 index 65571ad4c703..000000000000 --- a/doc/schemas/bkpr-listbalances.request.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": {} -} diff --git a/doc/schemas/bkpr-listbalances.schema.json b/doc/schemas/bkpr-listbalances.schema.json deleted file mode 100644 index 85c4395522b7..000000000000 --- a/doc/schemas/bkpr-listbalances.schema.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "accounts" - ], - "properties": { - "accounts": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "account", - "balances" - ], - "properties": { - "account": { - "type": "string", - "description": "The account name. If the account is a channel, the channel_id" - }, - "balances": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "balance_msat", - "coin_type" - ], - "properties": { - "balance_msat": { - "type": "msat", - "description": "Current account balance" - }, - "coin_type": { - "type": "string", - "description": "coin type, same as HRP for bech32" - } - } - } - } - }, - "if": { - "required": [ - "peer_id" - ] - }, - "then": { - "required": [ - "account", - "balances", - "peer_id", - "we_opened", - "account_closed", - "account_resolved" - ], - "additionalProperties": false, - "properties": { - "account": {}, - "balances": {}, - "peer_id": { - "type": "pubkey", - "description": "Node id for the peer this account is with" - }, - "we_opened": { - "type": "boolean", - "description": "Did we initiate this account open (open the channel)" - }, - "account_closed": { - "type": "boolean", - "description": "" - }, - "account_resolved": { - "type": "boolean", - "description": "Has this channel been closed and all outputs resolved?" - }, - "resolved_at_block": { - "type": "u32", - "description": "Blockheight account resolved on chain" - } - } - }, - "else": { - "properties": { - "account": {}, - "balances": {} - }, - "additionalProperties": false - } - } - } - } -} diff --git a/doc/schemas/bkpr-listincome.request.json b/doc/schemas/bkpr-listincome.request.json deleted file mode 100644 index 5eb3146ffa15..000000000000 --- a/doc/schemas/bkpr-listincome.request.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "added": "pre-v0.10.1", - "required": [], - "additionalProperties": false, - "properties": { - "consolidate_fees": { - "type": "boolean", - "description": "if true, we emit a single, consolidated event for any onchain-fees for a txid and account. Otherwise, events for every update to the onchain fee calculation for this account and txid will be printed. Defaults to true. Note that this means that the events emitted are non-stable, i.e. calling **listincome** twice may result in different onchain fee events being emitted, depending on how much information we've logged for that transaction" - }, - "start_time": { - "type": "u32", - "description": "UNIX timestamp (in seconds) that filters events after the provided timestamp. Defaults to zero" - }, - "end_time": { - "type": "u32", - "description": "UNIX timestamp (in seconds) that filters events up to and at the provided timestamp. Defaults to max-int" - } - } -} diff --git a/doc/schemas/bkpr-listincome.schema.json b/doc/schemas/bkpr-listincome.schema.json deleted file mode 100644 index 147dc484c350..000000000000 --- a/doc/schemas/bkpr-listincome.schema.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "income_events" - ], - "properties": { - "income_events": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "account", - "tag", - "credit_msat", - "debit_msat", - "currency", - "timestamp" - ], - "properties": { - "account": { - "type": "string", - "description": "The account name. If the account is a channel, the channel_id" - }, - "tag": { - "type": "string", - "description": "Type of income event" - }, - "credit_msat": { - "type": "msat", - "description": "Amount earned (income)" - }, - "debit_msat": { - "type": "msat", - "description": "Amount spent (expenses)" - }, - "currency": { - "type": "string", - "description": "human-readable bech32 part for this coin type" - }, - "timestamp": { - "type": "u32", - "description": "Timestamp this event was recorded by the node. For consolidated events such as onchain_fees, the most recent timestamp" - }, - "description": { - "type": "string", - "description": "More information about this event. If a `invoice` type, typically the bolt11/bolt12 description" - }, - "outpoint": { - "type": "string", - "description": "The txid:outnum for this event, if applicable" - }, - "txid": { - "type": "txid", - "description": "The txid of the transaction that created this event, if applicable" - }, - "payment_id": { - "type": "hex", - "description": "lightning payment identifier. For an htlc, this will be the preimage." - } - } - } - } - } -} diff --git a/doc/schemas/blacklistrune.request.json b/doc/schemas/blacklistrune.request.json deleted file mode 100644 index e2d16b2ab3e5..000000000000 --- a/doc/schemas/blacklistrune.request.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "added": "v23.08", - "properties": { - "start": { - "type": "u64", - "description": "first rune unique id to blacklist" - }, - "end": { - "type": "u64", - "description": "final rune unique id to blacklist (defaults to start)" - } - } -} diff --git a/doc/schemas/blacklistrune.schema.json b/doc/schemas/blacklistrune.schema.json deleted file mode 100644 index 86fb093862b4..000000000000 --- a/doc/schemas/blacklistrune.schema.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "blacklist" - ], - "properties": { - "blacklist": { - "type": "array", - "description": "the resulting blacklist ranges after the command", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "start", - "end" - ], - "properties": { - "start": { - "type": "u64", - "description": "Unique id of first rune in this blacklist range" - }, - "end": { - "type": "u64", - "description": "Unique id of last rune in this blacklist range" - } - } - } - } - } -} diff --git a/doc/schemas/check.request.json b/doc/schemas/check.request.json deleted file mode 100644 index 82b1b5be47f0..000000000000 --- a/doc/schemas/check.request.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": true, - "required": [ - "command_to_check" - ], - "properties": { - "command_to_check": { - "type": "string", - "description": "name of the relevant command" - } - } -} diff --git a/doc/schemas/check.schema.json b/doc/schemas/check.schema.json deleted file mode 100644 index 5b4010afb3ba..000000000000 --- a/doc/schemas/check.schema.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "properties": { - "command_to_check": { - "type": "string", - "description": "the *command_to_check* argument" - } - }, - "required": [ - "command_to_check" - ] -} diff --git a/doc/schemas/checkmessage.request.json b/doc/schemas/checkmessage.request.json deleted file mode 100644 index 1648245f473d..000000000000 --- a/doc/schemas/checkmessage.request.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "message", - "zbase" - ], - "properties": { - "message": { - "type": "string", - "description": "Message to be checked against the signature" - }, - "zbase": { - "type": "string", - "description": "The Zbase32 encoded signature to verify" - }, - "pubkey": { - "type": "pubkey", - "description": "The Zbase32 encoded signature to verify" - } - } -} diff --git a/doc/schemas/checkmessage.schema.json b/doc/schemas/checkmessage.schema.json deleted file mode 100644 index 0bc52e7e667a..000000000000 --- a/doc/schemas/checkmessage.schema.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "verified", - "pubkey" - ], - "additionalProperties": false, - "properties": { - "verified": { - "type": "boolean", - "enum": [ - true - ], - "description": "whether the signature was valid" - }, - "pubkey": { - "type": "pubkey", - "description": "the *pubkey* parameter, or the pubkey found by looking for known nodes" - } - } -} diff --git a/doc/schemas/checkrune.request.json b/doc/schemas/checkrune.request.json deleted file mode 100644 index 83d0fa476027..000000000000 --- a/doc/schemas/checkrune.request.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "rune" - ], - "added": "v23.08", - "properties": { - "rune": { - "type": "string", - "description": "rune to check for authorization" - }, - "nodeid": { - "type": "string", - "description": "node id of requesting node *(required until v23.11)*" - }, - "method": { - "type": "string", - "description": "method for which rune needs to be validated *(required until v23.11)*" - }, - "params": { - "oneOf": [ - { - "type": "array", - "description": "array of positional parameters" - }, - { - "type": "object", - "description": "parameters for method" - } - ] - } - } -} diff --git a/doc/schemas/checkrune.schema.json b/doc/schemas/checkrune.schema.json deleted file mode 100644 index 3262c3bd3e0a..000000000000 --- a/doc/schemas/checkrune.schema.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "valid" - ], - "properties": { - "valid": { - "type": "boolean", - "description": "true if the rune is valid" - } - } -} diff --git a/doc/schemas/close.request.json b/doc/schemas/close.request.json deleted file mode 100644 index 5174f4e597cc..000000000000 --- a/doc/schemas/close.request.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string", - "description": "peer id, channel id or short_channel_id. If the given *id* is a peer ID (66 hex digits as a string), then it applies to the active channel of the direct peer corresponding to the given peer ID. If the given *id* is a channel ID (64 hex digits as a string, or the short channel ID *blockheight:txindex:outindex* form), then it applies to that channel" - }, - "unilateraltimeout": { - "type": "u32", - "description": "if it is not zero, the command will unilaterally close the channel when that number of seconds is reached. If *unilateraltimeout* is zero, then the command will wait indefinitely until the peer is online and can negotiate a mutual close. The default is 2 days (172800 seconds)" - }, - "destination": { - "type": "string", - "description": "any Bitcoin bech32 type. If it isn't specified, the default is a Core Lightning wallet address. If the peer hasn't offered the option_shutdown_anysegwit` feature, then taproot addresses (or other v1+ segwit) are not allowed. Tell your friends to upgrade!" - }, - "fee_negotiation_step": { - "type": "string", - "description": "it controls how closing fee negotiation is performed assuming the peer proposes a fee that is different than our estimate. (Note that modern peers use the quick-close protocol which does not allow negotiation: see *feerange* instead)\tOn every negotiation step we must give up some amount from our proposal towards the peer's proposal. This parameter can be an integer in which case it is interpreted as number of satoshis to step at a time. Or it can be an integer followed by `%` to designate a percentage of the interval to give up. A few examples, assuming the peer proposes a closing fee of 3000 satoshi and our estimate shows it must be 4000:\t- `10`: our next proposal will be 4000-10=3990.\t- `10%`: our next proposal will be 4000-(10% of (4000-3000))=3900.\t- '1': our next proposal will be 3999. This is the most extreme case when we insist on our fee as much as possible.\t- `100%`: our next proposal will be 3000. This is the most relaxed case when we quickly accept the peer's proposal.\tThe default is `50%`" - }, - "wrong_funding": { - "type": "outpoint", - "description": "it can only be specified if both sides have offered the `shutdown_wrong_funding` feature (enabled by the **experimental-shutdown-wrong-funding** option): it must be a transaction id followed by a colon then the output number. Instead of negotiating a shutdown to spend the expected funding transaction, the shutdown transaction will spend this output instead. This is only allowed if this peer opened the channel and the channel is unused: it can rescue openings which have been manually miscreated" - }, - "force_lease_closed": { - "type": "boolean", - "description": "if the channel has funds leased to the peer (option_will_fund), we prevent initiation of a mutual close unless this flag is passed in. Defaults to false" - }, - "feerange": { - "type": "array", - "items": { - "type": "feerate" - }, - "description": "an optional array [ *min*, *max* ], indicating the minimum and maximum feerates to offer: the peer will obey these if it supports the quick-close protocol. *slow* and *unilateral_close* are the defaults.\tNote that the maximum fee will be capped at the final commitment transaction fee (unless the experimental anchor-outputs option is negotiated)" - } - } -} diff --git a/doc/schemas/close.schema.json b/doc/schemas/close.schema.json deleted file mode 100644 index 8e547dae3dfb..000000000000 --- a/doc/schemas/close.schema.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "mutual", - "unilateral", - "unopened" - ], - "description": "Whether we successfully negotiated a mutual close, closed without them, or discarded not-yet-opened channel" - } - }, - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "mutual", - "unilateral" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "tx", - "txid" - ], - "properties": { - "type": {}, - "tx": { - "type": "hex", - "description": "the raw bitcoin transaction used to close the channel (if it was open)" - }, - "txid": { - "type": "txid", - "description": "the transaction id of the *tx* field" - } - } - }, - "else": { - "additionalProperties": false, - "properties": { - "type": {} - } - } -} diff --git a/doc/schemas/commando-blacklist.request.json b/doc/schemas/commando-blacklist.request.json deleted file mode 100644 index f4dce9d0c5bf..000000000000 --- a/doc/schemas/commando-blacklist.request.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "added": "v23.05", - "deprecated": [ - "v23.08", - "v24.08" - ], - "properties": { - "start": { - "type": "u64", - "description": "first rune unique id to blacklist" - }, - "end": { - "type": "u64", - "description": "final rune unique id to blacklist (defaults to start)" - } - } -} diff --git a/doc/schemas/commando-blacklist.schema.json b/doc/schemas/commando-blacklist.schema.json deleted file mode 100644 index 86fb093862b4..000000000000 --- a/doc/schemas/commando-blacklist.schema.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "blacklist" - ], - "properties": { - "blacklist": { - "type": "array", - "description": "the resulting blacklist ranges after the command", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "start", - "end" - ], - "properties": { - "start": { - "type": "u64", - "description": "Unique id of first rune in this blacklist range" - }, - "end": { - "type": "u64", - "description": "Unique id of last rune in this blacklist range" - } - } - } - } - } -} diff --git a/doc/schemas/commando-listrunes.request.json b/doc/schemas/commando-listrunes.request.json deleted file mode 100644 index 53fd197cfeb2..000000000000 --- a/doc/schemas/commando-listrunes.request.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "added": "v23.05", - "deprecated": [ - "v23.08", - "v24.05" - ], - "properties": { - "rune": { - "type": "string", - "description": "optional rune to list" - } - } -} diff --git a/doc/schemas/commando-listrunes.schema.json b/doc/schemas/commando-listrunes.schema.json deleted file mode 100644 index 0fa759100f1f..000000000000 --- a/doc/schemas/commando-listrunes.schema.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "runes" - ], - "properties": { - "runes": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "rune", - "unique_id", - "restrictions", - "restrictions_as_english" - ], - "properties": { - "rune": { - "type": "string", - "description": "Base64 encoded rune" - }, - "unique_id": { - "type": "string", - "description": "Unique id assigned when the rune was generated; this is always a u64 for commando runes" - }, - "restrictions": { - "type": "array", - "description": "The restrictions on what commands this rune can authorize", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "alternatives", - "english" - ], - "properties": { - "alternatives": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "fieldname", - "value", - "condition", - "english" - ], - "properties": { - "fieldname": { - "type": "string", - "description": "The field this restriction applies to; see commando-rune(7)" - }, - "value": { - "type": "string", - "description": "The value accepted for this field" - }, - "condition": { - "type": "string", - "description": "The way to compare fieldname and value" - }, - "english": { - "type": "string", - "description": "English readable description of this alternative" - } - } - } - }, - "english": { - "type": "string", - "description": "English readable summary of alternatives above" - } - } - } - }, - "restrictions_as_english": { - "type": "string", - "description": "English readable description of the restrictions array above" - }, - "stored": { - "type": "boolean", - "enum": [ - false - ], - "description": "This is false if the rune does not appear in our datastore (only possible when `rune` is specified)" - }, - "blacklisted": { - "type": "boolean", - "enum": [ - true - ], - "description": "The rune has been blacklisted; see commando-blacklist(7)" - }, - "last_used": { - "type": "number", - "description": "The last time this rune was successfully used", - "added": "23.11" - }, - "our_rune": { - "type": "boolean", - "enum": [ - false - ], - "description": "This is not a rune for this node (only possible when `rune` is specified)" - } - } - } - } - } -} diff --git a/doc/schemas/commando-rune.request.json b/doc/schemas/commando-rune.request.json deleted file mode 100644 index 0288cf9199ef..000000000000 --- a/doc/schemas/commando-rune.request.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "deprecated": [ - "v23.08", - "v23.05" - ], - "properties": { - "rune": { - "type": "string", - "description": "optional rune to add to" - }, - "restrictions": { - "oneOf": [ - { - "type": "array", - "description": "array of restrictions to add to rune", - "items": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "type": "string", - "enum": [ - "readonly" - ], - "description": "readonly string to indicate standard readonly restrictions" - } - ] - } - } -} diff --git a/doc/schemas/commando-rune.schema.json b/doc/schemas/commando-rune.schema.json deleted file mode 100644 index 2bb8483aa21e..000000000000 --- a/doc/schemas/commando-rune.schema.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "rune", - "unique_id" - ], - "properties": { - "rune": { - "type": "string", - "description": "the resulting rune" - }, - "unique_id": { - "type": "string", - "description": "the id of this rune: this is set at creation and cannot be changed (even as restrictions are added)" - }, - "warning_unrestricted_rune": { - "type": "string", - "description": "A warning shown when runes are created with powers that could drain your node" - } - } -} diff --git a/doc/schemas/commando.request.json b/doc/schemas/commando.request.json deleted file mode 100644 index 80da4b98a555..000000000000 --- a/doc/schemas/commando.request.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "peer_id", - "method" - ], - "properties": { - "peer_id": { - "type": "pubkey", - "description": "peer to command" - }, - "method": { - "type": "string", - "description": "method to invoke on peer" - }, - "params": { - "oneOf": [ - { - "type": "array", - "description": "array of positional parameters" - }, - { - "type": "object", - "description": "parameters for method" - } - ] - }, - "rune": { - "type": "string", - "description": "rune to authorize the command" - }, - "filter": { - "type": "object", - "additionalProperties": true, - "description": "filter to peer to apply to any successful result" - } - } -} diff --git a/doc/schemas/commando.schema.json b/doc/schemas/commando.schema.json deleted file mode 100644 index 7bcd21e0e70d..000000000000 --- a/doc/schemas/commando.schema.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": true, - "required": [], - "properties": { - "any": { - "description": "the return depends on the *method* invoked" - } - } -} diff --git a/doc/schemas/connect.request.json b/doc/schemas/connect.request.json deleted file mode 100644 index aae9fc1f5ccb..000000000000 --- a/doc/schemas/connect.request.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string", - "description": "the target node's public key. As a convenience, *id* may be of the form *id@host* or *id@host:port*. In this case, the *host* and *port* parameters must be omitted. This can fail if your C-lightning node is a fresh install that has not connected to any peers yet (your node has no gossip yet), or if the target *id* is a fresh install that has no channels yet (nobody will gossip about a node until it has one published channel)" - }, - "host": { - "type": "string", - "description": "the peer's hostname or IP address.\tIf *host* is not specified (or doesn't work), the connection will be attempted to an IP belonging to *id* obtained through gossip with other already connected peers.\tIf *host* begins with a `/` it is interpreted as a local path and the connection will be made to that local socket (see **bind-addr** in lightningd-config(5))" - }, - "port": { - "type": "u16", - "description": "the peer's port number. If not specified, the *port* depends on the current network:\t- bitcoin **mainnet**: 9735.\t- bitcoin **testnet**: 19735.\t- bitcoin **signet**: 39735.\t- bitcoin **regtest**: 19846" - } - } -} diff --git a/doc/schemas/connect.schema.json b/doc/schemas/connect.schema.json deleted file mode 100644 index 557292b652c5..000000000000 --- a/doc/schemas/connect.schema.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "features", - "direction", - "address" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "the peer we connected to" - }, - "features": { - "type": "hex", - "description": "BOLT 9 features bitmap offered by peer" - }, - "direction": { - "type": "string", - "enum": [ - "in", - "out" - ], - "description": "Whether they initiated connection or we did" - }, - "address": { - "type": "object", - "description": "Address information (mainly useful if **direction** is *out*)", - "additionalProperties": true, - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "local socket", - "ipv4", - "ipv6", - "torv2", - "torv3" - ], - "description": "Type of connection (*torv2*/*torv3* only if **direction** is *out*)" - } - }, - "allOf": [ - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "local socket" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "socket" - ], - "properties": { - "type": {}, - "socket": { - "type": "string", - "description": "socket filename" - } - } - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "ipv4", - "ipv6", - "torv2", - "torv3" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "address", - "port" - ], - "properties": { - "type": {}, - "address": { - "type": "string", - "description": "address in expected format for **type**" - }, - "port": { - "type": "u16", - "description": "port number" - } - } - } - } - ] - } - } -} diff --git a/doc/schemas/createinvoice.request.json b/doc/schemas/createinvoice.request.json deleted file mode 100644 index 67cd5fe8e52f..000000000000 --- a/doc/schemas/createinvoice.request.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "invstring", - "label", - "preimage" - ], - "properties": { - "invstring": { - "type": "string", - "description": "" - }, - "label": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ], - "description": "a unique string or number (which is treated as a string, so `01` is different from `1`); it is never revealed to other nodes on the lightning network, but it can be used to query the status of this invoice" - }, - "preimage": { - "type": "hex", - "description": "" - } - } -} diff --git a/doc/schemas/createinvoice.schema.json b/doc/schemas/createinvoice.schema.json deleted file mode 100644 index d01e8a39315f..000000000000 --- a/doc/schemas/createinvoice.schema.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "label", - "created_index", - "payment_hash", - "status", - "description", - "expires_at" - ], - "properties": { - "label": { - "type": "string", - "description": "the label for the invoice" - }, - "bolt11": { - "type": "string", - "description": "the bolt11 string (always present unless **bolt12** is)" - }, - "bolt12": { - "type": "string", - "description": "the bolt12 string instead of **bolt11** (**experimental-offers** only)" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "amount_msat": { - "type": "msat", - "description": "The amount of the invoice (if it has one)" - }, - "status": { - "type": "string", - "enum": [ - "paid", - "expired", - "unpaid" - ], - "description": "Whether it has been paid, or can no longer be paid" - }, - "description": { - "type": "string", - "description": "Description extracted from **bolt11** or **bolt12**" - }, - "expires_at": { - "type": "u64", - "description": "UNIX timestamp of when invoice expires (or expired)" - }, - "created_index": { - "type": "u64", - "added": "v23.08", - "description": "1-based index indicating order this invoice was created in" - }, - "pay_index": { - "type": "u64", - "description": "Incrementing id for when this was paid (**status** *paid* only)" - }, - "amount_received_msat": { - "type": "msat", - "description": "Amount actually received (**status** *paid* only)" - }, - "paid_at": { - "type": "u64", - "description": "UNIX timestamp of when invoice was paid (**status** *paid* only)" - }, - "paid_outpoint": { - "type": "object", - "description": "Outpoint this invoice was paid with (**status** *paid* only)", - "added": "v23.11", - "additionalProperties": false, - "required": [ - "txid", - "outnum" - ], - "properties": { - "txid": { - "added": "v23.11", - "type": "txid", - "description": "ID of the transaction that paid the invoice (**status** *paid* only)" - }, - "outnum": { - "added": "v23.11", - "type": "u32", - "description": "The 0-based output number of the transaction that paid the invoice (**status** *paid* only)" - } - } - }, - "payment_preimage": { - "type": "secret", - "description": "the proof of payment: SHA256 of this **payment_hash**" - }, - "local_offer_id": { - "type": "hex", - "description": "the *id* of our offer which created this invoice (**experimental-offers** only).", - "maxLength": 64, - "minLength": 64 - }, - "invreq_payer_note": { - "type": "string", - "description": "the optional *invreq_payer_note* from invoice_request which created this invoice (**experimental-offers** only)." - } - } -} diff --git a/doc/schemas/createonion.request.json b/doc/schemas/createonion.request.json deleted file mode 100644 index 1cf74cf0fa48..000000000000 --- a/doc/schemas/createonion.request.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "hops", - "assocdata" - ], - "properties": { - "hops": { - "type": "array", - "description": "a JSON list of dicts, each specifying a node and the payload destined for that node", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "pubkey", - "payload" - ], - "properties": { - "pubkey": { - "type": "pubkey", - "description": "node pubkey" - }, - "payload": { - "type": "hex", - "description": "payload to be sent to the node" - } - } - } - }, - "assocdata": { - "type": "hex", - "description": "the associated data that the onion should commit to. If the onion is to be used to send a payment later it MUST match the `payment_hash` of the payment in order to be valid" - }, - "session_key": { - "type": "secret", - "description": "can be used to specify a secret that is used to generate the shared secrets used to encrypt the onion for each hop. It should only be used for testing or if a specific shared secret is important. If not specified it will be securely generated internally, and the shared secrets will be returned" - }, - "onion_size": { - "type": "u16", - "description": "a size different from the default payment onion (1300 bytes). May be used for custom protocols like trampoline routing" - } - } -} diff --git a/doc/schemas/createonion.schema.json b/doc/schemas/createonion.schema.json deleted file mode 100644 index 852e83e36a88..000000000000 --- a/doc/schemas/createonion.schema.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "onion", - "shared_secrets" - ], - "properties": { - "onion": { - "type": "hex", - "description": "the onion packet (*onion_size* bytes)" - }, - "shared_secrets": { - "type": "array", - "description": "one shared secret for each node in the *hops* parameter", - "items": { - "type": "secret", - "description": "the shared secret with this hop" - } - } - } -} diff --git a/doc/schemas/createrune.request.json b/doc/schemas/createrune.request.json deleted file mode 100644 index 22057e8b8ea7..000000000000 --- a/doc/schemas/createrune.request.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "added": "v23.08", - "properties": { - "rune": { - "type": "string", - "description": "optional rune to add to" - }, - "restrictions": { - "oneOf": [ - { - "type": "array", - "description": "array of restrictions to add to rune", - "items": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "type": "string", - "enum": [ - "readonly" - ], - "description": "readonly string to indicate standard readonly restrictions" - } - ] - } - } -} diff --git a/doc/schemas/createrune.schema.json b/doc/schemas/createrune.schema.json deleted file mode 100644 index 2bb8483aa21e..000000000000 --- a/doc/schemas/createrune.schema.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "rune", - "unique_id" - ], - "properties": { - "rune": { - "type": "string", - "description": "the resulting rune" - }, - "unique_id": { - "type": "string", - "description": "the id of this rune: this is set at creation and cannot be changed (even as restrictions are added)" - }, - "warning_unrestricted_rune": { - "type": "string", - "description": "A warning shown when runes are created with powers that could drain your node" - } - } -} diff --git a/doc/schemas/datastore.request.json b/doc/schemas/datastore.request.json deleted file mode 100644 index a42c7ae2693a..000000000000 --- a/doc/schemas/datastore.request.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "key" - ], - "properties": { - "key": { - "description": "a key can either have children or a value, never both: parents are created and removed automatically", - "oneOf": [ - { - "type": "array", - "description": "an array of values to form a hierarchy (though a single value is treated as a one-element array). Using the first element of the key as the plugin name (e.g. `[ 'summary' ]`) is recommended", - "items": { - "type": "string" - } - }, - { - "type": "string" - } - ] - }, - "string": { - "type": "string", - "description": "data to be saved in string format" - }, - "hex": { - "type": "hex", - "description": "data to be saved in hex format" - }, - "mode": { - "type": "string", - "description": "\t- `must-create`: fails if it already exists.\t- `must-replace`: fails if it doesn't already exist.\t- `create-or-replace`: never fails.\t- `must-append`: must already exist, append this to what's already there.\t- `create-or-append`: append if anything is there, otherwise create.\tDefault is `must-create`", - "enum": [ - "must-create", - "must-replace", - "create-or-replace", - "must-append", - "create-or-append" - ] - }, - "generation": { - "type": "u64", - "description": "if specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with *mode* `must-replace` or `must-append`" - } - } -} diff --git a/doc/schemas/datastore.schema.json b/doc/schemas/datastore.schema.json deleted file mode 100644 index 92aa077041ab..000000000000 --- a/doc/schemas/datastore.schema.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "key" - ], - "properties": { - "key": { - "type": "array", - "items": { - "type": "string", - "description": "Part of the key added to the datastore" - } - }, - "generation": { - "type": "u64", - "description": "The number of times this has been updated" - }, - "hex": { - "type": "hex", - "description": "The hex data which has been added to the datastore" - }, - "string": { - "type": "string", - "description": "The data as a string, if it's valid utf-8" - } - } -} diff --git a/doc/schemas/datastoreusage.request.json b/doc/schemas/datastoreusage.request.json deleted file mode 100644 index b634bbfadad8..000000000000 --- a/doc/schemas/datastoreusage.request.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "added": "v23.11", - "properties": { - "key": { - "oneOf": [ - { - "type": "array", - "description": "key is an array of values (though a single value is treated as a one-element array). Used as the starting point to traverse the datastore", - "items": { - "type": "string" - } - }, - { - "type": "string" - } - ] - } - } -} diff --git a/doc/schemas/datastoreusage.schema.json b/doc/schemas/datastoreusage.schema.json deleted file mode 100644 index 19bcd3165a68..000000000000 --- a/doc/schemas/datastoreusage.schema.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "datastoreusage" - ], - "properties": { - "datastoreusage": { - "type": "object", - "additionalProperties": false, - "required": [ - "key", - "total_bytes" - ], - "properties": { - "key": { - "type": "string", - "description": "The key from which the database was traversed." - }, - "total_bytes": { - "type": "u64", - "description": "The total bytes that are stored under the *key*, including the all descendants data and the size of the keys themselves." - } - } - } - } -} diff --git a/doc/schemas/decode.request.json b/doc/schemas/decode.request.json deleted file mode 100644 index d3d0a54c7a20..000000000000 --- a/doc/schemas/decode.request.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "added": "v23.05", - "required": [ - "string" - ], - "properties": { - "string": { - "type": "string", - "description": "value to be decoded\t- a *bolt11* or *bolt12* string (optionally prefixed by `lightning:` or `LIGHTNING:`) as specified by the BOLT 11 and BOLT 12 specifications.\t- a *rune* as created by lightning-commando-rune(7).\t- an *emergency_recover* string generated by hsmtool like `lightning-hsmtool getemergencyrecover `. It holds `emergency.recover` contents and starts with `clnemerg1`" - } - } -} diff --git a/doc/schemas/decode.schema.json b/doc/schemas/decode.schema.json deleted file mode 100644 index 504f38dad6ff..000000000000 --- a/doc/schemas/decode.schema.json +++ /dev/null @@ -1,1548 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "type", - "valid" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 offer", - "bolt12 invoice", - "bolt12 invoice_request", - "bolt11 invoice", - "rune", - "emergency recover" - ], - "description": "what kind of object it decoded to" - }, - "valid": { - "type": "boolean", - "description": "if this is false, you *MUST* not use the result except for diagnostics!" - } - }, - "allOf": [ - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 offer" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "required": [ - "offer_id", - "offer_node_id", - "offer_description" - ], - "additionalProperties": false, - "properties": { - "type": {}, - "valid": {}, - "offer_id": { - "type": "hex", - "description": "the id we use to identify this offer", - "maxLength": 64, - "minLength": 64 - }, - "offer_chains": { - "type": "array", - "description": "which blockchains this offer is for (missing implies bitcoin mainnet only)", - "items": { - "type": "hash", - "description": "the genesis blockhash" - } - }, - "offer_metadata": { - "type": "hex", - "description": "any metadata the creater of the offer includes" - }, - "offer_currency": { - "type": "string", - "description": "ISO 4217 code of the currency (missing implies Bitcoin)", - "maxLength": 3, - "minLength": 3 - }, - "warning_unknown_offer_currency": { - "type": "string", - "description": "The currency code is unknown (so no `currency_minor_unit`)" - }, - "currency_minor_unit": { - "type": "u32", - "description": "the number of decimal places to apply to amount (if currency known)" - }, - "offer_amount": { - "type": "u64", - "description": "the amount in the `offer_currency` adjusted by `currency_minor_unit`, if any" - }, - "offer_amount_msat": { - "type": "msat", - "description": "the amount in bitcoin (if specified, and no `offer_currency`)" - }, - "offer_description": { - "type": "string", - "description": "the description of the purpose of the offer" - }, - "offer_issuer": { - "type": "string", - "description": "the description of the creator of the offer" - }, - "offer_features": { - "type": "hex", - "description": "the feature bits of the offer" - }, - "offer_absolute_expiry": { - "type": "u64", - "description": "UNIX timestamp of when this offer expires" - }, - "offer_quantity_max": { - "type": "u64", - "description": "the maximum quantity (or, if 0, means any quantity)" - }, - "offer_paths": { - "type": "array", - "description": "Paths to the destination", - "items": { - "type": "object", - "required": [ - "first_node_id", - "blinding", - "path" - ], - "additionalProperties": false, - "properties": { - "first_node_id": { - "type": "pubkey", - "description": "the (presumably well-known) public key of the start of the path" - }, - "blinding": { - "type": "pubkey", - "description": "blinding factor for this path" - }, - "path": { - "type": "array", - "description": "an individual path", - "items": { - "type": "object", - "required": [ - "blinded_node_id", - "encrypted_recipient_data" - ], - "additionalProperties": false, - "properties": { - "blinded_node_id": { - "type": "pubkey", - "description": "node_id of the hop" - }, - "encrypted_recipient_data": { - "type": "hex", - "description": "encrypted TLV entry for this hop" - } - } - } - } - } - } - }, - "offer_node_id": { - "type": "pubkey", - "description": "public key of the offering node" - }, - "offer_recurrence": { - "type": "object", - "description": "how often to this offer should be used", - "required": [ - "period", - "time_unit" - ], - "additionalProperties": false, - "properties": { - "time_unit": { - "type": "u32", - "description": "the BOLT12 time unit" - }, - "time_unit_name": { - "type": "string", - "description": "the name of `time_unit` (if valid)" - }, - "period": { - "type": "u32", - "description": "how many `time_unit` per payment period" - }, - "basetime": { - "type": "u64", - "description": "period starts at this UNIX timestamp" - }, - "start_any_period": { - "type": "boolean", - "description": "you can start at any period (only if `basetime` present)" - }, - "limit": { - "type": "u32", - "description": "maximum period number for recurrence" - }, - "paywindow": { - "type": "object", - "description": "when within a period will payment be accepted (default is prior and during the period)", - "required": [ - "seconds_before", - "seconds_after" - ], - "additionalProperties": false, - "properties": { - "seconds_before": { - "type": "u32", - "description": "seconds prior to period start" - }, - "seconds_after": { - "type": "u32", - "description": "seconds after to period start" - }, - "proportional_amount": { - "type": "boolean", - "enum": [ - true - ], - "description": "amount should be scaled if payed after period start" - } - } - } - } - }, - "unknown_offer_tlvs": { - "type": "array", - "description": "Any extra fields we didn't know how to parse", - "items": { - "type": "object", - "required": [ - "type", - "length", - "value" - ], - "additionalProperties": false, - "properties": { - "type": { - "type": "u64", - "description": "The type" - }, - "length": { - "type": "u64", - "description": "The length" - }, - "value": { - "type": "hex", - "description": "The value" - } - } - } - } - } - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 offer" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - false - ] - } - } - }, - "then": { - "required": [], - "additionalProperties": false, - "properties": { - "type": {}, - "valid": {}, - "offer_id": {}, - "node_id": {}, - "signature": {}, - "chains": {}, - "currency": {}, - "minor_unit": {}, - "warning_unknown_offer_currency": {}, - "amount": {}, - "amount_msat": {}, - "send_invoice": {}, - "description": {}, - "vendor": {}, - "features": {}, - "absolute_expiry": {}, - "paths": {}, - "quantity_max": {}, - "unknown_offer_tlvs": {}, - "recurrence": {}, - "warning_missing_offer_node_id": { - "type": "string", - "description": "`offer_node_id` is not present" - }, - "warning_invalid_offer_description": { - "type": "string", - "description": "`offer_description` is not valid UTF8" - }, - "warning_missing_offer_description": { - "type": "string", - "description": "`offer_description` is not present" - }, - "warning_invalid_offer_currency": { - "type": "string", - "description": "`offer_currency_code` is not valid UTF8" - }, - "warning_invalid_offer_issuer": { - "type": "string", - "description": "`offer_issuer` is not valid UTF8" - } - } - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 invoice_request" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "required": [ - "offer_node_id", - "offer_description", - "invreq_metadata", - "invreq_payer_id", - "signature" - ], - "additionalProperties": false, - "properties": { - "type": {}, - "valid": {}, - "offer_id": { - "type": "hex", - "description": "the id we use to identify this offer", - "maxLength": 64, - "minLength": 64 - }, - "offer_chains": { - "type": "array", - "description": "which blockchains this offer is for (missing implies bitcoin mainnet only)", - "items": { - "type": "hex", - "description": "the genesis blockhash", - "maxLength": 64, - "minLength": 64 - } - }, - "offer_metadata": { - "type": "hex", - "description": "any metadata the creator of the offer includes" - }, - "offer_currency": { - "type": "string", - "description": "ISO 4217 code of the currency (missing implies Bitcoin)", - "maxLength": 3, - "minLength": 3 - }, - "warning_unknown_offer_currency": { - "type": "string", - "description": "The currency code is unknown (so no `currency_minor_unit`)" - }, - "currency_minor_unit": { - "type": "u32", - "description": "the number of decimal places to apply to amount (if currency known)" - }, - "offer_amount": { - "type": "u64", - "description": "the amount in the `offer_currency` adjusted by `currency_minor_unit`, if any" - }, - "offer_amount_msat": { - "type": "msat", - "description": "the amount in bitcoin (if specified, and no `offer_currency`)" - }, - "offer_description": { - "type": "string", - "description": "the description of the purpose of the offer" - }, - "offer_issuer": { - "type": "string", - "description": "the description of the creator of the offer" - }, - "offer_features": { - "type": "hex", - "description": "the feature bits of the offer" - }, - "offer_absolute_expiry": { - "type": "u64", - "description": "UNIX timestamp of when this offer expires" - }, - "offer_quantity_max": { - "type": "u64", - "description": "the maximum quantity (or, if 0, means any quantity)" - }, - "offer_paths": { - "type": "array", - "description": "Paths to the destination", - "items": { - "type": "object", - "required": [ - "first_node_id", - "blinding", - "path" - ], - "additionalProperties": false, - "properties": { - "first_node_id": { - "type": "pubkey", - "description": "the (presumably well-known) public key of the start of the path" - }, - "blinding": { - "type": "pubkey", - "description": "blinding factor for this path" - }, - "path": { - "type": "array", - "description": "an individual path", - "items": { - "type": "object", - "required": [ - "blinded_node_id", - "encrypted_recipient_data" - ], - "additionalProperties": false, - "properties": { - "blinded_node_id": { - "type": "pubkey", - "description": "node_id of the hop" - }, - "encrypted_recipient_data": { - "type": "hex", - "description": "encrypted TLV entry for this hop" - } - } - } - } - } - } - }, - "offer_node_id": { - "type": "pubkey", - "description": "public key of the offering node" - }, - "offer_recurrence": { - "type": "object", - "description": "how often to this offer should be used", - "required": [ - "period", - "time_unit" - ], - "additionalProperties": false, - "properties": { - "time_unit": { - "type": "u32", - "description": "the BOLT12 time unit" - }, - "time_unit_name": { - "type": "string", - "description": "the name of `time_unit` (if valid)" - }, - "period": { - "type": "u32", - "description": "how many `time_unit` per payment period" - }, - "basetime": { - "type": "u64", - "description": "period starts at this UNIX timestamp" - }, - "start_any_period": { - "type": "boolean", - "description": "you can start at any period (only if `basetime` present)" - }, - "limit": { - "type": "u32", - "description": "maximum period number for recurrence" - }, - "paywindow": { - "type": "object", - "description": "when within a period will payment be accepted (default is prior and during the period)", - "required": [ - "seconds_before", - "seconds_after" - ], - "additionalProperties": false, - "properties": { - "seconds_before": { - "type": "u32", - "description": "seconds prior to period start" - }, - "seconds_after": { - "type": "u32", - "description": "seconds after to period start" - }, - "proportional_amount": { - "type": "boolean", - "enum": [ - true - ], - "description": "amount should be scaled if payed after period start" - } - } - } - } - }, - "invreq_metadata": { - "type": "hex", - "description": "the payer-provided blob to derive invreq_payer_id" - }, - "invreq_payer_id": { - "type": "hex", - "description": "the payer-provided key" - }, - "invreq_chain": { - "type": "hex", - "description": "which blockchain this offer is for (missing implies bitcoin mainnet only)", - "maxLength": 64, - "minLength": 64 - }, - "invreq_amount_msat": { - "type": "msat", - "description": "the amount the invoice should be for" - }, - "invreq_features": { - "type": "hex", - "description": "the feature bits of the invoice_request" - }, - "invreq_quantity": { - "type": "u64", - "description": "the number of items to invoice for" - }, - "invreq_payer_note": { - "type": "string", - "description": "a note attached by the payer" - }, - "invreq_recurrence_counter": { - "type": "u32", - "description": "which number request this is for the same invoice" - }, - "invreq_recurrence_start": { - "type": "u32", - "description": "when we're requesting to start an invoice at a non-zero period" - }, - "signature": { - "type": "bip340sig", - "description": "BIP-340 signature of the `invreq_payer_id` on this invoice_request" - }, - "unknown_invoice_request_tlvs": { - "type": "array", - "description": "Any extra fields we didn't know how to parse", - "items": { - "type": "object", - "required": [ - "type", - "length", - "value" - ], - "additionalProperties": false, - "properties": { - "type": { - "type": "u64", - "description": "The type" - }, - "length": { - "type": "u64", - "description": "The length" - }, - "value": { - "type": "hex", - "description": "The value" - } - } - } - } - } - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 invoice_request" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - false - ] - } - } - }, - "then": { - "required": [], - "additionalProperties": false, - "properties": { - "type": {}, - "valid": {}, - "offer_id": {}, - "offer_chains": {}, - "offer_metadata": {}, - "offer_currency": {}, - "warning_unknown_offer_currency": {}, - "currency_minor_unit": {}, - "offer_amount": {}, - "offer_amount_msat": {}, - "offer_description": {}, - "offer_issuer": {}, - "offer_features": {}, - "offer_absolute_expiry": {}, - "offer_quantity_max": {}, - "offer_paths": {}, - "offer_node_id": {}, - "offer_recurrence": {}, - "invreq_metadata": {}, - "invreq_payer_id": {}, - "invreq_chain": {}, - "invreq_amount_msat": {}, - "invreq_features": {}, - "invreq_quantity": {}, - "invreq_payer_note": {}, - "invreq_recurrence_counter": {}, - "invreq_recurrence_start": {}, - "warning_invalid_offer_description": { - "type": "string", - "description": "`offer_description` is not valid UTF8" - }, - "warning_missing_offer_description": { - "type": "string", - "description": "`offer_description` is not present" - }, - "warning_invalid_offer_currency": { - "type": "string", - "description": "`offer_currency_code` is not valid UTF8" - }, - "warning_invalid_offer_issuer": { - "type": "string", - "description": "`offer_issuer` is not valid UTF8" - }, - "warning_missing_invreq_metadata": { - "type": "string", - "description": "`invreq_metadata` is not present" - }, - "warning_missing_invreq_payer_id": { - "type": "string", - "description": "`invreq_payer_id` is not present" - }, - "warning_invalid_invreq_payer_note": { - "type": "string", - "description": "`invreq_payer_note` is not valid UTF8" - }, - "warning_missing_invoice_request_signature": { - "type": "string", - "description": "`signature` is not present" - }, - "warning_invalid_invoice_request_signature": { - "type": "string", - "description": "Incorrect `signature`" - } - } - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 invoice" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "required": [ - "offer_node_id", - "offer_description", - "invreq_metadata", - "invreq_payer_id", - "invoice_paths", - "invoice_created_at", - "invoice_payment_hash", - "invoice_amount_msat", - "signature" - ], - "additionalProperties": false, - "properties": { - "type": {}, - "valid": {}, - "offer_id": { - "type": "hex", - "description": "the id we use to identify this offer", - "maxLength": 64, - "minLength": 64 - }, - "offer_chains": { - "type": "array", - "description": "which blockchains this offer is for (missing implies bitcoin mainnet only)", - "items": { - "type": "hex", - "description": "the genesis blockhash", - "maxLength": 64, - "minLength": 64 - } - }, - "offer_metadata": { - "type": "hex", - "description": "any metadata the creator of the offer includes" - }, - "offer_currency": { - "type": "string", - "description": "ISO 4217 code of the currency (missing implies Bitcoin)", - "maxLength": 3, - "minLength": 3 - }, - "warning_unknown_offer_currency": { - "type": "string", - "description": "The currency code is unknown (so no `currency_minor_unit`)" - }, - "currency_minor_unit": { - "type": "u32", - "description": "the number of decimal places to apply to amount (if currency known)" - }, - "offer_amount": { - "type": "u64", - "description": "the amount in the `offer_currency` adjusted by `currency_minor_unit`, if any" - }, - "offer_amount_msat": { - "type": "msat", - "description": "the amount in bitcoin (if specified, and no `offer_currency`)" - }, - "offer_description": { - "type": "string", - "description": "the description of the purpose of the offer" - }, - "offer_issuer": { - "type": "string", - "description": "the description of the creator of the offer" - }, - "offer_features": { - "type": "hex", - "description": "the feature bits of the offer" - }, - "offer_absolute_expiry": { - "type": "u64", - "description": "UNIX timestamp of when this offer expires" - }, - "offer_quantity_max": { - "type": "u64", - "description": "the maximum quantity (or, if 0, means any quantity)" - }, - "offer_paths": { - "type": "array", - "description": "Paths to the destination", - "items": { - "type": "object", - "required": [ - "first_node_id", - "blinding", - "path" - ], - "additionalProperties": false, - "properties": { - "first_node_id": { - "type": "pubkey", - "description": "the (presumably well-known) public key of the start of the path" - }, - "blinding": { - "type": "pubkey", - "description": "blinding factor for this path" - }, - "path": { - "type": "array", - "description": "an individual path", - "items": { - "type": "object", - "required": [ - "blinded_node_id", - "encrypted_recipient_data" - ], - "additionalProperties": false, - "properties": { - "blinded_node_id": { - "type": "pubkey", - "description": "node_id of the hop" - }, - "encrypted_recipient_data": { - "type": "hex", - "description": "encrypted TLV entry for this hop" - } - } - } - } - } - } - }, - "offer_node_id": { - "type": "pubkey", - "description": "public key of the offering node" - }, - "offer_recurrence": { - "type": "object", - "description": "how often to this offer should be used", - "required": [ - "period", - "time_unit" - ], - "additionalProperties": false, - "properties": { - "time_unit": { - "type": "u32", - "description": "the BOLT12 time unit" - }, - "time_unit_name": { - "type": "string", - "description": "the name of `time_unit` (if valid)" - }, - "period": { - "type": "u32", - "description": "how many `time_unit` per payment period" - }, - "basetime": { - "type": "u64", - "description": "period starts at this UNIX timestamp" - }, - "start_any_period": { - "type": "boolean", - "description": "you can start at any period (only if `basetime` present)" - }, - "limit": { - "type": "u32", - "description": "maximum period number for recurrence" - }, - "paywindow": { - "type": "object", - "description": "when within a period will payment be accepted (default is prior and during the period)", - "required": [ - "seconds_before", - "seconds_after" - ], - "additionalProperties": false, - "properties": { - "seconds_before": { - "type": "u32", - "description": "seconds prior to period start" - }, - "seconds_after": { - "type": "u32", - "description": "seconds after to period start" - }, - "proportional_amount": { - "type": "boolean", - "enum": [ - true - ], - "description": "amount should be scaled if payed after period start" - } - } - } - } - }, - "invreq_metadata": { - "type": "hex", - "description": "the payer-provided blob to derive invreq_payer_id" - }, - "invreq_payer_id": { - "type": "hex", - "description": "the payer-provided key" - }, - "invreq_chain": { - "type": "hex", - "description": "which blockchain this offer is for (missing implies bitcoin mainnet only)", - "maxLength": 64, - "minLength": 64 - }, - "invreq_amount_msat": { - "type": "msat", - "description": "the amount the invoice should be for" - }, - "invreq_features": { - "type": "hex", - "description": "the feature bits of the invoice_request" - }, - "invreq_quantity": { - "type": "u64", - "description": "the number of items to invoice for" - }, - "invreq_payer_note": { - "type": "string", - "description": "a note attached by the payer" - }, - "invreq_recurrence_counter": { - "type": "u32", - "description": "which number request this is for the same invoice" - }, - "invreq_recurrence_start": { - "type": "u32", - "description": "when we're requesting to start an invoice at a non-zero period" - }, - "invoice_paths": { - "type": "array", - "description": "Paths to pay the destination", - "items": { - "type": "object", - "required": [ - "first_node_id", - "blinding", - "payinfo", - "path" - ], - "additionalProperties": false, - "properties": { - "first_node_id": { - "type": "pubkey", - "description": "the (presumably well-known) public key of the start of the path" - }, - "blinding": { - "type": "pubkey", - "description": "blinding factor for this path" - }, - "payinfo": { - "type": "object", - "required": [ - "fee_base_msat", - "fee_proportional_millionths", - "cltv_expiry_delta", - "features" - ], - "additionalProperties": false, - "properties": { - "fee_base_msat": { - "type": "msat", - "description": "basefee for path" - }, - "fee_proportional_millionths": { - "type": "u32", - "description": "proportional fee for path" - }, - "cltv_expiry_delta": { - "type": "u32", - "description": "CLTV delta for path" - }, - "features": { - "type": "hex", - "description": "features allowed for path" - } - } - }, - "path": { - "type": "array", - "description": "an individual path", - "items": { - "type": "object", - "required": [ - "blinded_node_id", - "encrypted_recipient_data" - ], - "additionalProperties": false, - "properties": { - "blinded_node_id": { - "type": "pubkey", - "description": "node_id of the hop" - }, - "encrypted_recipient_data": { - "type": "hex", - "description": "encrypted TLV entry for this hop" - } - } - } - } - } - } - }, - "invoice_created_at": { - "type": "u64", - "description": "the UNIX timestamp of invoice creation" - }, - "invoice_relative_expiry": { - "type": "u32", - "description": "the number of seconds after *invoice_created_at* when this expires" - }, - "invoice_payment_hash": { - "type": "hex", - "description": "the hash of the *payment_preimage*", - "maxLength": 64, - "minLength": 64 - }, - "invoice_amount_msat": { - "type": "msat", - "description": "the amount required to fulfill invoice" - }, - "invoice_fallbacks": { - "type": "array", - "description": "onchain addresses", - "items": { - "type": "object", - "required": [ - "version", - "hex" - ], - "additionalProperties": false, - "properties": { - "version": { - "type": "u8", - "description": "Segwit address version" - }, - "hex": { - "type": "hex", - "description": "Raw encoded segwit address" - }, - "address": { - "type": "string", - "description": "bech32 segwit address" - } - } - } - }, - "invoice_features": { - "type": "hex", - "description": "the feature bits of the invoice" - }, - "invoice_node_id": { - "type": "pubkey", - "description": "the id to pay (usually the same as offer_node_id)" - }, - "invoice_recurrence_basetime": { - "type": "u64", - "description": "the UNIX timestamp to base the invoice periods on" - }, - "signature": { - "type": "bip340sig", - "description": "BIP-340 signature of the `offer_node_id` on this invoice" - }, - "unknown_invoice_tlvs": { - "type": "array", - "description": "Any extra fields we didn't know how to parse", - "items": { - "type": "object", - "required": [ - "type", - "length", - "value" - ], - "additionalProperties": false, - "properties": { - "type": { - "type": "u64", - "description": "The type" - }, - "length": { - "type": "u64", - "description": "The length" - }, - "value": { - "type": "hex", - "description": "The value" - } - } - } - } - } - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 invoice" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - false - ] - } - } - }, - "then": { - "required": [], - "additionalProperties": false, - "properties": { - "type": {}, - "valid": {}, - "offer_id": {}, - "offer_chains": {}, - "offer_metadata": {}, - "offer_currency": {}, - "warning_unknown_offer_currency": {}, - "currency_minor_unit": {}, - "offer_amount": {}, - "offer_amount_msat": {}, - "offer_description": {}, - "offer_issuer": {}, - "offer_features": {}, - "offer_absolute_expiry": {}, - "offer_quantity_max": {}, - "offer_paths": {}, - "offer_node_id": {}, - "offer_recurrence": {}, - "invreq_metadata": {}, - "invreq_payer_id": {}, - "invreq_chain": {}, - "invreq_amount_msat": {}, - "invreq_features": {}, - "invreq_quantity": {}, - "invreq_payer_note": {}, - "invreq_node_id": {}, - "invreq_recurrence_counter": {}, - "invreq_recurrence_start": {}, - "warning_invalid_offer_description": { - "type": "string", - "description": "`offer_description` is not valid UTF8" - }, - "warning_missing_offer_description": { - "type": "string", - "description": "`offer_description` is not present" - }, - "warning_invalid_offer_currency": { - "type": "string", - "description": "`offer_currency_code` is not valid UTF8" - }, - "warning_invalid_offer_issuer": { - "type": "string", - "description": "`offer_issuer` is not valid UTF8" - }, - "warning_missing_invreq_metadata": { - "type": "string", - "description": "`invreq_metadata` is not present" - }, - "warning_invalid_invreq_payer_note": { - "type": "string", - "description": "`invreq_payer_note` is not valid UTF8" - }, - "warning_missing_invoice_paths": { - "type": "string", - "description": "`invoice_paths` is not present" - }, - "warning_missing_invoice_blindedpay": { - "type": "string", - "description": "`invoice_blindedpay` is not present" - }, - "warning_missing_invoice_created_at": { - "type": "string", - "description": "`invoice_created_at` is not present" - }, - "warning_missing_invoice_payment_hash": { - "type": "string", - "description": "`invoice_payment_hash` is not present" - }, - "warning_missing_invoice_amount": { - "type": "string", - "description": "`invoice_amount` is not present" - }, - "warning_missing_invoice_recurrence_basetime": { - "type": "string", - "description": "`invoice_recurrence_basetime` is not present" - }, - "warning_missing_invoice_node_id": { - "type": "string", - "description": "`invoice_node_id` is not present" - }, - "warning_missing_invoice_signature": { - "type": "string", - "description": "`signature` is not present" - }, - "warning_invalid_invoice_signature": { - "type": "string", - "description": "Incorrect `signature`" - }, - "fallbacks": { - "type": "array", - "items": { - "type": "object", - "required": [ - "version", - "hex" - ], - "properties": { - "version": {}, - "hex": {}, - "address": {}, - "warning_invoice_fallbacks_version_invalid": { - "type": "string", - "description": "`version` is > 16" - } - } - } - } - } - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt11 invoice" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "required": [ - "currency", - "created_at", - "expiry", - "payee", - "min_final_cltv_expiry", - "payment_hash", - "signature" - ], - "additionalProperties": false, - "properties": { - "type": {}, - "valid": {}, - "currency": { - "type": "string", - "description": "the BIP173 name for the currency" - }, - "created_at": { - "type": "u64", - "description": "the UNIX-style timestamp of the invoice" - }, - "expiry": { - "type": "u64", - "description": "the number of seconds this is valid after `created_at`" - }, - "payee": { - "type": "pubkey", - "description": "the public key of the recipient" - }, - "amount_msat": { - "type": "msat", - "description": "Amount the invoice asked for" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage*" - }, - "signature": { - "type": "signature", - "description": "signature of the *payee* on this invoice" - }, - "description": { - "type": "string", - "description": "the description of the purpose of the purchase" - }, - "description_hash": { - "type": "hash", - "description": "the hash of the description, in place of *description*" - }, - "min_final_cltv_expiry": { - "type": "u32", - "description": "the minimum CLTV delay for the final node" - }, - "payment_secret": { - "type": "secret", - "description": "the secret to hand to the payee node" - }, - "features": { - "type": "hex", - "description": "the features bitmap for this invoice" - }, - "payment_metadata": { - "type": "hex", - "description": "the payment_metadata to put in the payment" - }, - "fallbacks": { - "type": "array", - "description": "onchain addresses", - "items": { - "type": "object", - "required": [ - "type", - "hex" - ], - "additionalProperties": false, - "properties": { - "type": { - "type": "string", - "description": "the address type (if known)", - "enum": [ - "P2PKH", - "P2SH", - "P2WPKH", - "P2WSH", - "P2TR" - ] - }, - "addr": { - "type": "string", - "description": "the address in appropriate format for *type*" - }, - "hex": { - "type": "hex", - "description": "Raw encoded address" - } - } - } - }, - "routes": { - "type": "array", - "description": "Route hints to the *payee*", - "items": { - "type": "array", - "description": "hops in the route", - "items": { - "type": "object", - "required": [ - "pubkey", - "short_channel_id", - "fee_base_msat", - "fee_proportional_millionths", - "cltv_expiry_delta" - ], - "additionalProperties": false, - "properties": { - "pubkey": { - "type": "pubkey", - "description": "the public key of the node" - }, - "short_channel_id": { - "type": "short_channel_id", - "description": "a channel to the next peer" - }, - "fee_base_msat": { - "type": "msat", - "description": "the base fee for payments" - }, - "fee_proportional_millionths": { - "type": "u32", - "description": "the parts-per-million fee for payments" - }, - "cltv_expiry_delta": { - "type": "u32", - "description": "the CLTV delta across this hop" - } - } - } - } - }, - "extra": { - "type": "array", - "description": "Any extra fields we didn't know how to parse", - "items": { - "type": "object", - "required": [ - "tag", - "data" - ], - "additionalProperties": false, - "properties": { - "tag": { - "type": "string", - "description": "The bech32 letter which identifies this field", - "maxLength": 1, - "minLength": 1 - }, - "data": { - "type": "string", - "description": "The bech32 data for this field" - } - } - } - } - } - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "rune" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "required": [ - "string", - "restrictions", - "valid" - ], - "additionalProperties": false, - "properties": { - "unique_id": { - "type": "string", - "description": "unique id (always a numeric id on runes we create)" - }, - "version": { - "type": "string", - "description": "rune version, not currently set on runes we create" - }, - "valid": { - "type": "boolean", - "enum": [ - true - ] - }, - "type": {}, - "string": { - "type": "string", - "description": "the string encoding of the rune" - }, - "restrictions": { - "type": "array", - "description": "restrictions built into the rune: all must pass", - "items": { - "type": "object", - "required": [ - "alternatives", - "summary" - ], - "additionalProperties": false, - "properties": { - "alternatives": { - "type": "array", - "description": "each way restriction can be met: any can pass", - "items": { - "type": "string", - "description": "the alternative of form fieldname condition fieldname" - } - }, - "summary": { - "type": "string", - "description": "human-readable summary of this restriction" - } - } - } - } - } - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "rune" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - false - ] - } - } - }, - "then": { - "required": [ - "valid" - ], - "additionalProperties": false, - "properties": { - "valid": { - "type": "boolean", - "enum": [ - false - ] - }, - "type": {}, - "warning_rune_invalid_utf8": { - "type": "string", - "description": "the rune contains invalid UTF-8 strings" - }, - "hex": { - "type": "hex", - "description": "the raw rune in hex" - } - } - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "emergency recover" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "required": [ - "decrypted" - ], - "additionalProperties": false, - "properties": { - "type": {}, - "valid": {}, - "decrypted": { - "type": "hex", - "description": "The decrypted value of the provided bech32 of emergency.recover", - "added": "v23.11" - } - } - } - } - ] -} diff --git a/doc/schemas/decodepay.request.json b/doc/schemas/decodepay.request.json deleted file mode 100644 index d89d88afe009..000000000000 --- a/doc/schemas/decodepay.request.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "added": "v23.05", - "required": [ - "bolt11" - ], - "properties": { - "bolt11": { - "type": "string", - "description": "bolt11 invoice to decode" - }, - "description": { - "type": "string", - "description": "description of the invoice to decode" - } - } -} diff --git a/doc/schemas/decodepay.schema.json b/doc/schemas/decodepay.schema.json deleted file mode 100644 index 170f694200fd..000000000000 --- a/doc/schemas/decodepay.schema.json +++ /dev/null @@ -1,166 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "currency", - "created_at", - "expiry", - "payee", - "min_final_cltv_expiry", - "payment_hash", - "signature" - ], - "additionalProperties": false, - "properties": { - "currency": { - "type": "string", - "description": "the BIP173 name for the currency" - }, - "created_at": { - "type": "u64", - "description": "the UNIX-style timestamp of the invoice" - }, - "expiry": { - "type": "u64", - "description": "the number of seconds this is valid after *timestamp*" - }, - "payee": { - "type": "pubkey", - "description": "the public key of the recipient" - }, - "amount_msat": { - "type": "msat", - "description": "Amount the invoice asked for" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage*" - }, - "signature": { - "type": "signature", - "description": "signature of the *payee* on this invoice" - }, - "description": { - "type": "string", - "description": "the description of the purpose of the purchase" - }, - "description_hash": { - "type": "hash", - "description": "the hash of the description, in place of *description*" - }, - "min_final_cltv_expiry": { - "type": "u32", - "description": "the minimum CLTV delay for the final node" - }, - "payment_secret": { - "type": "hash", - "description": "the secret to hand to the payee node" - }, - "features": { - "type": "hex", - "description": "the features bitmap for this invoice" - }, - "payment_metadata": { - "type": "hex", - "description": "the payment_metadata to put in the payment" - }, - "fallbacks": { - "type": "array", - "description": "onchain addresses", - "items": { - "type": "object", - "required": [ - "type", - "hex" - ], - "additionalProperties": false, - "properties": { - "type": { - "type": "string", - "description": "the address type (if known)", - "enum": [ - "P2PKH", - "P2SH", - "P2WPKH", - "P2WSH", - "P2TR" - ] - }, - "addr": { - "type": "string", - "description": "the address in appropriate format for *type*" - }, - "hex": { - "type": "hex", - "description": "Raw encoded address" - } - } - } - }, - "routes": { - "type": "array", - "description": "Route hints to the *payee*", - "items": { - "type": "array", - "description": "hops in the route", - "items": { - "type": "object", - "required": [ - "pubkey", - "short_channel_id", - "fee_base_msat", - "fee_proportional_millionths", - "cltv_expiry_delta" - ], - "additionalProperties": false, - "properties": { - "pubkey": { - "type": "pubkey", - "description": "the public key of the node" - }, - "short_channel_id": { - "type": "short_channel_id", - "description": "a channel to the next peer" - }, - "fee_base_msat": { - "type": "msat", - "description": "the base fee for payments" - }, - "fee_proportional_millionths": { - "type": "u32", - "description": "the parts-per-million fee for payments" - }, - "cltv_expiry_delta": { - "type": "u32", - "description": "the CLTV delta across this hop" - } - } - } - } - }, - "extra": { - "type": "array", - "description": "Any extra fields we didn't know how to parse", - "items": { - "type": "object", - "required": [ - "tag", - "data" - ], - "additionalProperties": false, - "properties": { - "tag": { - "type": "string", - "description": "The bech32 letter which identifies this field", - "maxLength": 1, - "minLength": 1 - }, - "data": { - "type": "string", - "description": "The bech32 data for this field" - } - } - } - } - } -} diff --git a/doc/schemas/deldatastore.request.json b/doc/schemas/deldatastore.request.json deleted file mode 100644 index cff49d001d2d..000000000000 --- a/doc/schemas/deldatastore.request.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "key" - ], - "properties": { - "key": { - "oneOf": [ - { - "type": "array", - "description": "key is an array of values (though a single value is treated as a one-element array), to form a heirarchy. Using the first element of the key as the plugin name (e.g. [ 'summary' ]) is recommended. A key can either have children or a value, never both: parents are created and removed automatically", - "items": { - "type": "string" - } - }, - { - "type": "string" - } - ] - }, - "generation": { - "type": "u64", - "description": "If specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with mode “must-replace” or “must-append”" - } - } -} diff --git a/doc/schemas/deldatastore.schema.json b/doc/schemas/deldatastore.schema.json deleted file mode 100644 index c5a2875b6a44..000000000000 --- a/doc/schemas/deldatastore.schema.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "key" - ], - "properties": { - "key": { - "type": "array", - "items": { - "type": "string", - "description": "Part of the key added to the datastore" - } - }, - "generation": { - "type": "u64", - "description": "The number of times this has been updated" - }, - "hex": { - "type": "hex", - "description": "The hex data which has removed from the datastore" - }, - "string": { - "type": "string", - "description": "The data as a string, if it's valid utf-8" - } - } -} diff --git a/doc/schemas/delexpiredinvoice.request.json b/doc/schemas/delexpiredinvoice.request.json deleted file mode 100644 index ba9e9ec16bb0..000000000000 --- a/doc/schemas/delexpiredinvoice.request.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "maxexpirytime": { - "type": "u64", - "description": "invoice expiry time in seconds. If not specified then all expired invoices are deleted" - } - } -} diff --git a/doc/schemas/delexpiredinvoice.schema.json b/doc/schemas/delexpiredinvoice.schema.json deleted file mode 100644 index f99496c5ac84..000000000000 --- a/doc/schemas/delexpiredinvoice.schema.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": {} -} diff --git a/doc/schemas/delforward.request.json b/doc/schemas/delforward.request.json deleted file mode 100644 index 037e90f94874..000000000000 --- a/doc/schemas/delforward.request.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "in_channel", - "in_htlc_id", - "status" - ], - "properties": { - "in_channel": { - "type": "short_channel_id", - "description": "only the matching forwards on the given inbound channel are deleted.\tNote: for **listforwards** entries without an *in_htlc_id* entry (no longer created in v22.11, but can exist from older versions), a value of 18446744073709551615 can be used, but then it will delete *all* entries without *in_htlc_id* for this *in_channel* and *status*" - }, - "in_htlc_id": { - "type": "u64", - "description": "the unique HTLC id the sender gave this (not present if incoming channel was closed before ugprade to v22.11)" - }, - "status": { - "type": "string", - "description": "the status of the forward to delete. You cannot delete forwards which have status *offered* (i.e. are currently active)", - "enum": [ - "settled", - "local_failed", - "failed" - ] - } - } -} diff --git a/doc/schemas/delforward.schema.json b/doc/schemas/delforward.schema.json deleted file mode 100644 index 65571ad4c703..000000000000 --- a/doc/schemas/delforward.schema.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": {} -} diff --git a/doc/schemas/delinvoice.request.json b/doc/schemas/delinvoice.request.json deleted file mode 100644 index 0f2755a140af..000000000000 --- a/doc/schemas/delinvoice.request.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "label", - "status" - ], - "properties": { - "label": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "u64" - } - ], - "description": "label of the invoice to be deleted" - }, - "status": { - "type": "string", - "description": "label of the invoice to be deleted. The caller should be particularly aware of the error case caused by the *status* changing just before this command is invoked!", - "enum": [ - "paid", - "expired", - "unpaid" - ] - }, - "desconly": { - "type": "boolean", - "description": "if set to True, the invoice is not deleted, but has its description removed (this can save space with very large descriptions, as would be used with lightning-invoice(7) *deschashonly*" - } - } -} diff --git a/doc/schemas/delinvoice.schema.json b/doc/schemas/delinvoice.schema.json deleted file mode 100644 index 34bf29dd26c8..000000000000 --- a/doc/schemas/delinvoice.schema.json +++ /dev/null @@ -1,192 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "label", - "payment_hash", - "status", - "created_index", - "expires_at" - ], - "additionalProperties": true, - "properties": { - "label": { - "type": "string", - "description": "Unique label given at creation time" - }, - "bolt11": { - "type": "string", - "description": "BOLT11 string" - }, - "bolt12": { - "type": "string", - "description": "BOLT12 string" - }, - "amount_msat": { - "type": "msat", - "description": "the amount required to pay this invoice" - }, - "description": { - "type": "string", - "description": "description used in the invoice" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "created_index": { - "type": "u64", - "added": "v23.08", - "description": "1-based index indicating order this invoice was created in" - }, - "updated_index": { - "type": "u64", - "added": "v23.08", - "description": "1-based index indicating order this invoice was changed (only present if it has changed since creation)" - }, - "status": { - "type": "string", - "description": "State of invoice", - "enum": [ - "paid", - "expired", - "unpaid" - ] - }, - "expires_at": { - "type": "u64", - "description": "UNIX timestamp when invoice expires (or expired)" - } - }, - "allOf": [ - { - "if": { - "required": [ - "bolt12" - ] - }, - "then": { - "required": [], - "additionalProperties": false, - "properties": { - "label": {}, - "bolt12": {}, - "status": {}, - "expires_at": {}, - "msatoshi": {}, - "amount_msat": {}, - "description": {}, - "payment_hash": {}, - "pay_index": {}, - "created_index": {}, - "updated_index": {}, - "amount_received_msat": {}, - "paid_at": {}, - "payment_preimage": {}, - "local_offer_id": { - "type": "hex", - "description": "offer for which this invoice was created" - }, - "invreq_payer_note": { - "type": "string", - "description": "the optional *invreq_payer_note* from invoice_request which created this invoice" - } - } - }, - "else": { - "required": [ - "bolt11" - ], - "additionalProperties": false, - "properties": { - "label": {}, - "bolt11": {}, - "status": {}, - "expires_at": {}, - "msatoshi": {}, - "amount_msat": {}, - "description": {}, - "payment_hash": {}, - "pay_index": {}, - "created_index": {}, - "updated_index": {}, - "amount_received_msat": {}, - "msatoshi_received": {}, - "paid_at": {}, - "payment_preimage": {} - } - } - }, - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "paid" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "pay_index", - "amount_received_msat", - "paid_at", - "payment_preimage" - ], - "properties": { - "label": {}, - "bolt11": {}, - "bolt12": {}, - "status": {}, - "expires_at": {}, - "msatoshi": {}, - "amount_msat": {}, - "description": {}, - "payment_hash": {}, - "invreq_payer_note": {}, - "local_offer_id": {}, - "created_index": {}, - "updated_index": {}, - "pay_index": { - "type": "u64", - "description": "unique index for this invoice payment" - }, - "amount_received_msat": { - "type": "msat", - "description": "how much was actually received" - }, - "paid_at": { - "type": "u64", - "description": "UNIX timestamp of when payment was received" - }, - "payment_preimage": { - "type": "secret", - "description": "SHA256 of this is the *payment_hash* offered in the invoice" - } - } - }, - "else": { - "additionalProperties": false, - "properties": { - "label": {}, - "bolt11": {}, - "bolt12": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "description": {}, - "payment_hash": {}, - "expires_at": {}, - "created_index": {}, - "updated_index": {}, - "pay_index": {}, - "invreq_payer_note": {}, - "local_offer_id": {} - } - } - } - ] -} diff --git a/doc/schemas/delpay.request.json b/doc/schemas/delpay.request.json deleted file mode 100644 index 5cd3d2ebf29b..000000000000 --- a/doc/schemas/delpay.request.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "payment_hash", - "status" - ], - "additionalProperties": false, - "properties": { - "payment_hash": { - "type": "hash", - "description": "the unique identifier of a payment" - }, - "status": { - "type": "string", - "description": "expected status of the payment. Only deletes if the payment status matches. Deleting a `pending` payment will return an error", - "enum": [ - "complete", - "failed" - ] - }, - "partid": { - "type": "u64", - "description": "specific partid to delete (must be paired with *groupid*)" - }, - "groupid": { - "type": "u64", - "description": "specific groupid to delete (must be paired with *partid*)" - } - } -} diff --git a/doc/schemas/delpay.schema.json b/doc/schemas/delpay.schema.json deleted file mode 100644 index 64e6d445b6b7..000000000000 --- a/doc/schemas/delpay.schema.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "payments" - ], - "additionalProperties": false, - "properties": { - "payments": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "created_index", - "id", - "payment_hash", - "status", - "amount_sent_msat", - "created_at" - ], - "properties": { - "created_index": { - "added": "v23.11", - "type": "u64", - "description": "1-based index indicating order this payment was created in" - }, - "id": { - "type": "u64", - "description": "old synonym for created_index" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "status": { - "type": "string", - "enum": [ - "pending", - "failed", - "complete" - ], - "description": "status of the payment" - }, - "amount_sent_msat": { - "type": "msat", - "description": "the amount we actually sent, including fees" - }, - "partid": { - "type": "u64", - "description": "unique ID within this (multi-part) payment" - }, - "destination": { - "type": "pubkey", - "description": "the final destination of the payment if known" - }, - "amount_msat": { - "type": "msat", - "description": "the amount the destination received, if known" - }, - "created_at": { - "type": "u64", - "description": "the UNIX timestamp showing when this payment was initiated" - }, - "updated_index": { - "added": "v23.11", - "type": "u64", - "description": "1-based index indicating order this payment was changed (only present if it has changed since creation)" - }, - "completed_at": { - "type": "u64", - "description": "the UNIX timestamp showing when this payment was completed" - }, - "groupid": { - "type": "u64", - "description": "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash" - }, - "payment_preimage": { - "type": "secret", - "description": "proof of payment" - }, - "label": { - "type": "string", - "description": "the label, if given to sendpay" - }, - "bolt11": { - "type": "string", - "description": "the bolt11 string (if pay supplied one)" - }, - "bolt12": { - "type": "string", - "description": "the bolt12 string (if supplied for pay: **experimental-offers** only)." - }, - "erroronion": { - "type": "hex", - "description": "the error onion returned on failure, if any." - } - } - } - } - } -} diff --git a/doc/schemas/disableinvoicerequest.request.json b/doc/schemas/disableinvoicerequest.request.json deleted file mode 100644 index b7f80bb86ec1..000000000000 --- a/doc/schemas/disableinvoicerequest.request.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "added": "v22.11", - "required": [ - "invreq_id" - ], - "properties": { - "invreq_id": { - "type": "string", - "description": "a specific invoice can be disabled by providing the `invreq_id`, which is presented by lightning-invoicerequest(7)" - } - } -} diff --git a/doc/schemas/disableinvoicerequest.schema.json b/doc/schemas/disableinvoicerequest.schema.json deleted file mode 100644 index 713cb2efbed7..000000000000 --- a/doc/schemas/disableinvoicerequest.schema.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "invreq_id", - "single_use", - "active", - "bolt12", - "used" - ], - "added": "v22.11", - "properties": { - "invreq_id": { - "type": "hash", - "description": "the SHA256 hash of all invoice_request fields less than 160" - }, - "active": { - "type": "boolean", - "enum": [ - false - ], - "description": "whether the invoice_request is currently active" - }, - "single_use": { - "type": "boolean", - "description": "whether the invoice_request will become inactive after we pay an invoice for it" - }, - "bolt12": { - "type": "string", - "description": "the bolt12 string starting with lnr" - }, - "used": { - "type": "boolean", - "description": "whether the invoice_request has already been used" - }, - "label": { - "type": "string", - "description": "the label provided when creating the invoice_request" - } - } -} diff --git a/doc/schemas/disableoffer.request.json b/doc/schemas/disableoffer.request.json deleted file mode 100644 index 1cb8cb0e74d3..000000000000 --- a/doc/schemas/disableoffer.request.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "offer_id" - ], - "properties": { - "offer_id": { - "type": "hash", - "description": "the id we use to identify this offer" - } - } -} diff --git a/doc/schemas/disableoffer.schema.json b/doc/schemas/disableoffer.schema.json deleted file mode 100644 index 3c4a28446882..000000000000 --- a/doc/schemas/disableoffer.schema.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "offer_id", - "active", - "single_use", - "bolt12", - "used" - ], - "additionalProperties": false, - "properties": { - "offer_id": { - "type": "hash", - "description": "the merkle hash of the offer" - }, - "active": { - "type": "boolean", - "enum": [ - false - ], - "description": "Whether the offer can produce invoices/payments" - }, - "single_use": { - "type": "boolean", - "description": "Whether the offer is disabled after first successful use" - }, - "bolt12": { - "type": "string", - "description": "The bolt12 string representing this offer" - }, - "used": { - "type": "boolean", - "description": "Whether the offer has had an invoice paid / payment made" - }, - "label": { - "type": "string", - "description": "The label provided when offer was created" - } - } -} diff --git a/doc/schemas/disconnect.request.json b/doc/schemas/disconnect.request.json deleted file mode 100644 index 257d50c12a2e..000000000000 --- a/doc/schemas/disconnect.request.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "id" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "the public key of the peer to terminate the connection.\tIt can be discovered in the output of the listpeers command, which returns a set of peers:\t{\t\t'peers': [\t\t\t{\t\t\t'id': '0563aea81...',\t\t\t'connected': true,\t\t\t...\t\t}\t\t]\t}" - }, - "force": { - "type": "boolean", - "description": "if set to True, it will disconnect even with an active channel" - } - } -} diff --git a/doc/schemas/disconnect.schema.json b/doc/schemas/disconnect.schema.json deleted file mode 100644 index 1aad2dcae935..000000000000 --- a/doc/schemas/disconnect.schema.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "properties": {} -} diff --git a/doc/schemas/emergencyrecover.request.json b/doc/schemas/emergencyrecover.request.json deleted file mode 100644 index f99496c5ac84..000000000000 --- a/doc/schemas/emergencyrecover.request.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": {} -} diff --git a/doc/schemas/emergencyrecover.schema.json b/doc/schemas/emergencyrecover.schema.json deleted file mode 100644 index 440196651a97..000000000000 --- a/doc/schemas/emergencyrecover.schema.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "stubs" - ], - "properties": { - "stubs": { - "type": "array", - "items": { - "type": "hash", - "description": "Channel IDs of channels successfully inserted." - } - } - } -} diff --git a/doc/schemas/feerates.request.json b/doc/schemas/feerates.request.json deleted file mode 100644 index cd695a8b9cf1..000000000000 --- a/doc/schemas/feerates.request.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "style" - ], - "properties": { - "style": { - "type": "string", - "description": "\t*perkw* - provide feerate in units of satoshis per 1000 weight (e.g. the minimum fee is usually `253perkw`)\t*perkb* - provide feerate in units of satoshis per 1000 virtual bytes (eg. the minimum fee is usually `1000perkb`)", - "enum": [ - "perkb", - "perkw" - ] - } - } -} diff --git a/doc/schemas/feerates.schema.json b/doc/schemas/feerates.schema.json deleted file mode 100644 index 4c2f54f4f330..000000000000 --- a/doc/schemas/feerates.schema.json +++ /dev/null @@ -1,238 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "warning_missing_feerates": { - "type": "string", - "description": "Some fee estimates are missing" - }, - "perkb": { - "type": "object", - "description": "If *style* parameter was perkb", - "additionalProperties": false, - "required": [ - "min_acceptable", - "max_acceptable", - "floor", - "estimates" - ], - "properties": { - "min_acceptable": { - "type": "u32", - "description": "The smallest feerate that we allow peers to specify: half the 100-block estimate" - }, - "max_acceptable": { - "type": "u32", - "description": "The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet)." - }, - "floor": { - "type": "u32", - "added": "v23.05", - "description": "The smallest feerate that our backend tells us it will accept (i.e. minrelayfee or mempoolminfee)" - }, - "estimates": { - "type": "array", - "added": "v23.05", - "description": "Feerate estimates from plugin which we are using (usuallly bcli)", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "blockcount", - "feerate", - "smoothed_feerate" - ], - "properties": { - "blockcount": { - "type": "u32", - "added": "v23.05", - "description": "The number of blocks the feerate is expected to get a transaction in" - }, - "feerate": { - "type": "u32", - "added": "v23.05", - "description": "The feerate for this estimate, in given *style*" - }, - "smoothed_feerate": { - "type": "u32", - "added": "v23.05", - "description": "The feerate, smoothed over time (useful for coordinating with other nodes)" - } - } - } - }, - "opening": { - "type": "u32", - "description": "Default feerate for lightning-fundchannel(7) and lightning-withdraw(7)" - }, - "mutual_close": { - "type": "u32", - "description": "Feerate to aim for in cooperative shutdown. Note that since mutual close is a **negotiation**, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer." - }, - "unilateral_close": { - "type": "u32", - "description": "Feerate for commitment_transaction in a live channel which we originally funded" - }, - "unilateral_anchor_close": { - "type": "u32", - "added": "v23.08", - "description": "Feerate for commitment_transaction in a live channel which we originally funded (if anchor_outputs was negotiated)" - }, - "delayed_to_us": { - "type": "u32", - "deprecated": [ - "v23.05", - "v24.05" - ], - "description": "Feerate for returning unilateral close funds to our wallet" - }, - "htlc_resolution": { - "type": "u32", - "deprecated": [ - "v23.05", - "v24.05" - ], - "description": "Feerate for returning unilateral close HTLC outputs to our wallet" - }, - "penalty": { - "type": "u32", - "description": "Feerate to use when creating penalty tx for watchtowers" - } - } - }, - "perkw": { - "type": "object", - "description": "If *style* parameter was perkw", - "additionalProperties": false, - "required": [ - "min_acceptable", - "max_acceptable", - "floor", - "estimates" - ], - "properties": { - "min_acceptable": { - "type": "u32", - "description": "The smallest feerate that you can use, usually the minimum relayed feerate of the backend" - }, - "max_acceptable": { - "type": "u32", - "description": "The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet)." - }, - "floor": { - "type": "u32", - "added": "v23.05", - "description": "The smallest feerate that our backend tells us it will accept (i.e. minrelayfee or mempoolminfee)" - }, - "estimates": { - "type": "array", - "added": "v23.05", - "description": "Feerate estimates from plugin which we are using (usuallly bcli)", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "blockcount", - "feerate", - "smoothed_feerate" - ], - "properties": { - "blockcount": { - "type": "u32", - "added": "v23.05", - "description": "The number of blocks the feerate is expected to get a transaction in" - }, - "feerate": { - "type": "u32", - "added": "v23.05", - "description": "The feerate for this estimate, in given *style*" - }, - "smoothed_feerate": { - "type": "u32", - "added": "v23.05", - "description": "The feerate, smoothed over time (useful for coordinating with other nodes)" - } - } - } - }, - "opening": { - "type": "u32", - "description": "Default feerate for lightning-fundchannel(7) and lightning-withdraw(7)" - }, - "mutual_close": { - "type": "u32", - "description": "Feerate to aim for in cooperative shutdown. Note that since mutual close is a **negotiation**, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer." - }, - "unilateral_close": { - "type": "u32", - "description": "Feerate for commitment_transaction in a live channel which we originally funded (if anchor_outputs was not negotiated)" - }, - "unilateral_anchor_close": { - "type": "u32", - "added": "v23.08", - "description": "Feerate for commitment_transaction in a live channel which we originally funded (if anchor_outputs was negotiated)" - }, - "delayed_to_us": { - "type": "u32", - "deprecated": [ - "v23.05", - "v24.05" - ], - "description": "Feerate for returning unilateral close funds to our wallet" - }, - "htlc_resolution": { - "type": "u32", - "deprecated": [ - "v23.05", - "v24.05" - ], - "description": "Feerate for returning unilateral close HTLC outputs to our wallet" - }, - "penalty": { - "type": "u32", - "description": "Feerate to use when creating penalty tx for watchtowers" - } - } - }, - "onchain_fee_estimates": { - "type": "object", - "additionalProperties": false, - "required": [ - "opening_channel_satoshis", - "mutual_close_satoshis", - "unilateral_close_satoshis", - "htlc_timeout_satoshis", - "htlc_success_satoshis" - ], - "properties": { - "opening_channel_satoshis": { - "type": "u64", - "description": "Estimated cost of typical channel open" - }, - "mutual_close_satoshis": { - "type": "u64", - "description": "Estimated cost of typical channel close" - }, - "unilateral_close_satoshis": { - "type": "u64", - "description": "Estimated cost of typical unilateral close (without HTLCs). If anchors are supported, this assumes a channel with anchors." - }, - "unilateral_close_nonanchor_satoshis": { - "added": "v23.08", - "type": "u64", - "description": "Estimated cost of non-anchor typical unilateral close (without HTLCs)." - }, - "htlc_timeout_satoshis": { - "type": "u64", - "description": "Estimated cost of typical HTLC timeout transaction (non-anchors)" - }, - "htlc_success_satoshis": { - "type": "u64", - "description": "Estimated cost of typical HTLC fulfillment transaction (non-anchors)" - } - } - } - } -} diff --git a/doc/schemas/fetchinvoice.request.json b/doc/schemas/fetchinvoice.request.json deleted file mode 100644 index dbbfb8342cad..000000000000 --- a/doc/schemas/fetchinvoice.request.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "offer" - ], - "additionalProperties": false, - "properties": { - "offer": { - "type": "string", - "description": "offer string to get an actual invoice that can be paid" - }, - "amount_msat": { - "type": "msat", - "description": "required if the offer does not specify an amount at all, otherwise it is optional (but presumably if you set it to less than the offer, you will get an error from the issuer)" - }, - "quantity": { - "type": "u64", - "description": "required if the offer specifies quantity_max, otherwise it is not allowed" - }, - "recurrence_counter": { - "type": "u64", - "description": "required if the offer specifies recurrence, otherwise it is not allowed. recurrence_counter should first be set to 0, and incremented for each successive invoice in a given series" - }, - "recurrence_start": { - "type": "number", - "description": "required if the offer specifies recurrence_base with start_any_period set, otherwise it is not allowed. It indicates what period number to start at" - }, - "recurrence_label": { - "type": "string", - "description": "required if recurrence_counter is set, and otherwise is not allowed. It must be the same as prior fetchinvoice calls for the same recurrence, as it is used to link them together" - }, - "timeout": { - "type": "number", - "description": "if we don't get a reply before this we fail (default, 60 seconds)" - }, - "payer_note": { - "type": "string", - "description": "to ask the issuer to include in the fetched invoice" - } - } -} diff --git a/doc/schemas/fetchinvoice.schema.json b/doc/schemas/fetchinvoice.schema.json deleted file mode 100644 index 8c6d2365562e..000000000000 --- a/doc/schemas/fetchinvoice.schema.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "invoice", - "changes" - ], - "properties": { - "invoice": { - "type": "string", - "description": "The BOLT12 invoice we fetched" - }, - "changes": { - "type": "object", - "description": "Summary of changes from offer", - "additionalProperties": false, - "required": [], - "properties": { - "description_appended": { - "type": "string", - "description": "extra characters appended to the *description* field." - }, - "description": { - "type": "string", - "description": "a completely replaced *description* field" - }, - "vendor_removed": { - "type": "string", - "description": "The *vendor* from the offer, which is missing in the invoice" - }, - "vendor": { - "type": "string", - "description": "a completely replaced *vendor* field" - }, - "amount_msat": { - "type": "msat", - "description": "the amount, if different from the offer amount multiplied by any *quantity* (or the offer had no amount, or was not in BTC)." - } - } - }, - "next_period": { - "type": "object", - "description": "Only for recurring invoices if the next period is under the *recurrence_limit*", - "additionalProperties": false, - "required": [ - "counter", - "starttime", - "endtime", - "paywindow_start", - "paywindow_end" - ], - "properties": { - "counter": { - "type": "u64", - "description": "the index of the next period to fetchinvoice" - }, - "starttime": { - "type": "u64", - "description": "UNIX timestamp that the next period starts" - }, - "endtime": { - "type": "u64", - "description": "UNIX timestamp that the next period ends" - }, - "paywindow_start": { - "type": "u64", - "description": "UNIX timestamp of the earliest time that the next invoice can be fetched" - }, - "paywindow_end": { - "type": "u64", - "description": "UNIX timestamp of the latest time that the next invoice can be fetched" - } - } - } - } -} diff --git a/doc/schemas/fundchannel.request.json b/doc/schemas/fundchannel.request.json deleted file mode 100644 index 2c8d913e1f3c..000000000000 --- a/doc/schemas/fundchannel.request.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "amount" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "id is the peer id obtained from connect" - }, - "amount": { - "type": "msat_or_all", - "description": "the amount in satoshis taken from the internal wallet to fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). The string *all* can be used to specify all available funds (or 16777215 satoshi if more is available and large channels were not negotiated with the peer). Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The value cannot be less than the dust limit, currently set to 546, nor more than 16777215 satoshi (unless large channels were negotiated with the peer)" - }, - "feerate": { - "type": "feerate", - "description": "used for the opening transaction and (unless *option_anchors_zero_fee_htlc_tx* is negotiated), as initial feerate for commitment and HTLC transactions (see NOTES in lightning-feerates(7)). The default is *normal*" - }, - "announce": { - "type": "boolean", - "description": "whether to announce this channel or not. An unannounced channel is considered private. Defaults to *True*" - }, - "minconf": { - "type": "u32", - "description": "the minimum number of confirmations that used outputs should have. Default is 1" - }, - "push_msat": { - "type": "msat", - "description": "the amount of millisatoshis to push to the channel peer at open. Note that this is a gift to the peer -- these satoshis are added to the initial balance of the peer at channel start and are largely unrecoverable once pushed" - }, - "close_to": { - "type": "string", - "description": "a Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. Returns `close_to` set to closing script iff is negotiated" - }, - "request_amt": { - "type": "msat", - "description": "an amount of liquidity you'd like to lease from the peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*" - }, - "compact_lease": { - "type": "string", - "description": "a compact represenation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel" - }, - "utxos": { - "type": "array", - "description": "the utxos to be used to fund the channel, as an array of `txid:vout`", - "items": { - "type": "outpoint" - } - }, - "mindepth": { - "description": "Number of confirmations required before we consider the channel active", - "type": "u32" - }, - "reserve": { - "type": "msat", - "description": "the amount we want the peer to maintain on its side of the channel. Default is 1% of the funding amount. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" - }, - "channel_type": { - "added": "v24.02", - "type": "array", - "items": { - "type": "u32" - } - } - } -} diff --git a/doc/schemas/fundchannel.schema.json b/doc/schemas/fundchannel.schema.json deleted file mode 100644 index e62bf6a24811..000000000000 --- a/doc/schemas/fundchannel.schema.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "tx", - "txid", - "outnum", - "channel_type", - "channel_id" - ], - "properties": { - "tx": { - "type": "hex", - "description": "The raw transaction which funded the channel" - }, - "txid": { - "type": "txid", - "description": "The txid of the transaction which funded the channel" - }, - "outnum": { - "type": "u32", - "description": "The 0-based output index showing which output funded the channel" - }, - "channel_id": { - "type": "hex", - "description": "The channel_id of the resulting channel", - "minLength": 64, - "maxLength": 64 - }, - "channel_type": { - "type": "object", - "description": "channel_type as negotiated with peer", - "added": "v24.02", - "additionalProperties": false, - "required": [ - "bits", - "names" - ], - "properties": { - "bits": { - "type": "array", - "description": "Each bit set in this channel_type", - "added": "v24.02", - "items": { - "type": "u32", - "description": "Bit number" - } - }, - "names": { - "type": "array", - "description": "Feature name for each bit set in this channel_type", - "added": "v24.02", - "items": { - "type": "string", - "enum": [ - "static_remotekey/even", - "anchor_outputs/even", - "anchors_zero_fee_htlc_tx/even", - "scid_alias/even", - "zeroconf/even" - ], - "description": "Name of feature bit" - } - } - } - }, - "close_to": { - "type": "hex", - "description": "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`" - }, - "mindepth": { - "type": "u32", - "description": "Number of confirmations before we consider the channel active." - } - } -} diff --git a/doc/schemas/fundchannel_cancel.request.json b/doc/schemas/fundchannel_cancel.request.json deleted file mode 100644 index a5f65fad3e94..000000000000 --- a/doc/schemas/fundchannel_cancel.request.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "id" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "node id of the remote peer with which to cancel" - } - } -} diff --git a/doc/schemas/fundchannel_cancel.schema.json b/doc/schemas/fundchannel_cancel.schema.json deleted file mode 100644 index 2c507db3e20f..000000000000 --- a/doc/schemas/fundchannel_cancel.schema.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "cancelled" - ], - "properties": { - "cancelled": { - "type": "string", - "description": "A message indicating it was cancelled by RPC" - } - } -} diff --git a/doc/schemas/fundchannel_complete.request.json b/doc/schemas/fundchannel_complete.request.json deleted file mode 100644 index fd0bd96df51e..000000000000 --- a/doc/schemas/fundchannel_complete.request.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "psbt" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "node id of the remote peer" - }, - "psbt": { - "type": "string", - "description": "transaction to use for funding (does not need to be signed but must be otherwise complete)" - } - } -} diff --git a/doc/schemas/fundchannel_complete.schema.json b/doc/schemas/fundchannel_complete.schema.json deleted file mode 100644 index 3b3d0eefbaae..000000000000 --- a/doc/schemas/fundchannel_complete.schema.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channel_id", - "commitments_secured" - ], - "properties": { - "channel_id": { - "type": "hex", - "description": "The channel_id of the resulting channel", - "minLength": 64, - "maxLength": 64 - }, - "commitments_secured": { - "type": "boolean", - "enum": [ - true - ], - "description": "Indication that channel is safe to use" - } - } -} diff --git a/doc/schemas/fundchannel_start.request.json b/doc/schemas/fundchannel_start.request.json deleted file mode 100644 index 07cb74a0d266..000000000000 --- a/doc/schemas/fundchannel_start.request.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "amount" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "node id of the remote peer" - }, - "amount": { - "type": "sat", - "description": "satoshi value that the channel will be funded at. This value MUST be accurate, otherwise the negotiated commitment transactions will not encompass the correct channel value" - }, - "feerate": { - "type": "feerate", - "description": "feerate for subsequent commitment transactions: see **fundchannel**. Note that this is ignored for channels with *option_anchors_zero_fee_htlc_tx* (we always use a low commitment fee for these)" - }, - "announce": { - "type": "boolean", - "description": "whether or not to announce this channel" - }, - "close_to": { - "type": "string", - "description": "bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. Returns `close_to` set to closing script iff is negotiated" - }, - "push_msat": { - "type": "msat", - "description": "amount of millisatoshis to push to the channel peer at open. Note that this is a gift to the peer -- these satoshis are added to the initial balance of the peer at channel start and are largely unrecoverable once pushed" - }, - "mindepth": { - "type": "u32", - "description": "Number of confirmations required before we consider the channel active" - }, - "reserve": { - "type": "msat", - "description": "The amount we want the peer to maintain on its side" - }, - "channel_type": { - "type": "array", - "description": "Each bit set in this channel_type", - "items": { - "type": "u32", - "description": "Bit number" - } - } - } -} diff --git a/doc/schemas/fundchannel_start.schema.json b/doc/schemas/fundchannel_start.schema.json deleted file mode 100644 index 1ffe13be4190..000000000000 --- a/doc/schemas/fundchannel_start.schema.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "funding_address", - "scriptpubkey", - "channel_type", - "warning_usage" - ], - "properties": { - "funding_address": { - "type": "string", - "description": "The address to send funding to for the channel. DO NOT SEND COINS TO THIS ADDRESS YET." - }, - "scriptpubkey": { - "type": "hex", - "description": "The raw scriptPubkey for the address" - }, - "channel_type": { - "type": "object", - "description": "channel_type as negotiated with peer", - "added": "v24.02", - "additionalProperties": false, - "required": [ - "bits", - "names" - ], - "properties": { - "bits": { - "type": "array", - "added": "v24.02", - "description": "Each bit set in this channel_type", - "items": { - "type": "u32", - "description": "Bit number" - } - }, - "names": { - "type": "array", - "description": "Feature name for each bit set in this channel_type", - "added": "v24.02", - "items": { - "type": "string", - "enum": [ - "static_remotekey/even", - "anchor_outputs/even", - "anchors_zero_fee_htlc_tx/even", - "scid_alias/even", - "zeroconf/even" - ], - "description": "Name of feature bit" - } - } - } - }, - "close_to": { - "type": "hex", - "description": "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`" - }, - "warning_usage": { - "type": "string", - "description": "A warning not to prematurely broadcast the funding transaction (always present!)" - }, - "mindepth": { - "type": "u32", - "description": "Number of confirmations before we consider the channel active." - } - } -} diff --git a/doc/schemas/funderupdate.request.json b/doc/schemas/funderupdate.request.json deleted file mode 100644 index 702825807af5..000000000000 --- a/doc/schemas/funderupdate.request.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "policy": { - "type": "string", - "enum": [ - "match", - "available", - "fixed" - ], - "description": "funder plugin will use to decide how much captial to commit to a v2 open channel request.\n\tThere are three policy options, detailed below:\n\t* `match` -- Contribute *policy_mod* percent of their requested funds.\n\tValid *policy_mod* values are 0 to 200. If this is a channel lease\n\trequest, we match based on their requested funds. If it is not a\n\tchannel lease request (and *lease_only* is false), then we match\n\ttheir funding amount. Note: any lease match less than 100 will\n\tlikely fail, as clients will not accept a lease less than their request.\n\t* `available` -- Contribute *policy_mod* percent of our available\n\tnode wallet funds. Valid *policy_mod* values are 0 to 100.\n\t* `fixed` -- Contributes a fixed *policy_mod* sats to v2 channel open requests.\n\tDefault is fixed" - }, - "policy_mod": { - "type": "sat", - "description": "number or 'modification' to apply to the policy. Default is 0sats" - }, - "leases_only": { - "type": "boolean", - "description": "only contribute funds to `option_will_fund` requests which pay to lease funds. It will fund any v2 open request using *policy* even if it's they're not seeking to lease funds. Note that `option_will_fund` commits funds for 4032 blocks (~1mo). Must also set *lease_fee_base_msat*, *lease_fee_basis*, *funding_weight*, *channel_fee_max_base_msat*, and *channel_fee_max_proportional_thousandths* to advertise available channel leases. Defaults to *False*" - }, - "min_their_funding_msat": { - "type": "msat", - "description": "minimum funding sats that we require in order to activate our contribution policy to the v2 open. Defaults to 10k sats" - }, - "max_their_funding_msat": { - "type": "msat", - "description": "maximum funding sats that we will consider to activate our contribution policy to the v2 open. Any channel open above this will not be funded. Defaults to no max (`UINT_MAX`)" - }, - "per_channel_min_msat": { - "type": "msat", - "description": "minimum amount that we will contribute to a channel open. Defaults to 10k sats" - }, - "per_channel_max_msat": { - "type": "msat", - "description": "maximum amount that we will contribute to a channel open. Defaults to no max (`UINT_MAX`)" - }, - "reserve_tank_msat": { - "type": "msat", - "description": "amount of sats to leave available in the node wallet. Defaults to zero sats" - }, - "fuzz_percent": { - "type": "u32", - "description": "a percentage to fuzz the resulting contribution amount by. Valid values are 0 to 100. Note that turning this on with (match, 100) policy will randomly fail `option_will_fund` leases, as most clients expect an exact or greater match of their `requested_funds`. Defaults to 0% (no fuzz)" - }, - "fund_probability": { - "type": "u32", - "description": "the percent of v2 channel open requests to apply our policy to. Valid values are integers from 0 (fund 0% of all open requests) to 100 (fund every request). Useful for randomizing opens that receive funds. Useful for randomizing opens that receive funds. Defaults to 100" - }, - "lease_fee_base_msat": { - "type": "msat", - "description": "flat fee for a channel lease. Node will receive this much extra added to their channel balance, paid by the opening node. Defaults to 2k sats. Note that the minimum is 1sat" - }, - "lease_fee_basis": { - "type": "u32", - "description": "a basis fee that's calculated as 1/10k of the total requested funds the peer is asking for. Node will receive the total of *lease_fee_basis* times requested funds / 10k satoshis added to their channel balance, paid by the opening node. Default is 0.65% (65 basis points)" - }, - "funding_weight": { - "type": "u32", - "description": "to calculate the fee the peer will compensate your node for its contributing inputs to the funding transaction. The total fee is calculated as the `open_channel2`.`funding_feerate_perkw` times this *funding_weight* divided by 1000. Node will have this funding fee added to their channel balance, paid by the opening node. Default is 2 inputs + 1 P2WPKH output" - }, - "channel_fee_max_base_msat": { - "type": "msat", - "description": "a commitment to a maximum `channel_fee_base_msat` that your node will charge for routing payments over this leased channel during the lease duration. Default is 5k sats" - }, - "channel_fee_max_proportional_thousandths": { - "type": "u32", - "description": "a commitment to a maximum `channel_fee_proportional_millionths` that your node will charge for routing payments over this leased channel during the lease duration. Note that it's denominated in 'thousandths'. A setting of `1` is equal to 1k ppm; `5` is 5k ppm, etc. Default is 100 (100k ppm)" - }, - "compact_lease": { - "type": "hex", - "description": "a compact description of the channel lease params. When opening a channel, passed in to `fundchannel` to indicate the terms we expect from the peer" - } - } -} diff --git a/doc/schemas/funderupdate.schema.json b/doc/schemas/funderupdate.schema.json deleted file mode 100644 index 4bca1365220b..000000000000 --- a/doc/schemas/funderupdate.schema.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "summary", - "policy", - "policy_mod", - "leases_only", - "min_their_funding_msat", - "max_their_funding_msat", - "per_channel_min_msat", - "per_channel_max_msat", - "reserve_tank_msat", - "fuzz_percent", - "fund_probability" - ], - "properties": { - "summary": { - "type": "string", - "description": "Summary of the current funding policy e.g. (match 100)" - }, - "policy": { - "type": "string", - "enum": [ - "match", - "available", - "fixed" - ], - "description": "Policy funder plugin will use to decide how much captial to commit to a v2 open channel request" - }, - "policy_mod": { - "type": "u32", - "description": "The *policy_mod* is the number or 'modification' to apply to the policy." - }, - "leases_only": { - "type": "boolean", - "description": "Only contribute funds to `option_will_fund` lease requests." - }, - "min_their_funding_msat": { - "type": "msat", - "description": "The minimum funding sats that we require from peer to activate our funding policy." - }, - "max_their_funding_msat": { - "type": "msat", - "description": "The maximum funding sats that we'll allow from peer to activate our funding policy." - }, - "per_channel_min_msat": { - "type": "msat", - "description": "The minimum amount that we will fund a channel open with." - }, - "per_channel_max_msat": { - "type": "msat", - "description": "The maximum amount that we will fund a channel open with." - }, - "reserve_tank_msat": { - "type": "msat", - "description": "Amount of sats to leave available in the node wallet." - }, - "fuzz_percent": { - "type": "u32", - "description": "Percentage to fuzz our funding amount by." - }, - "fund_probability": { - "type": "u32", - "description": "Percent of opens to consider funding. 100 means we'll consider funding every requested open channel request." - }, - "lease_fee_base_msat": { - "type": "msat", - "description": "Flat fee to charge for a channel lease." - }, - "lease_fee_basis": { - "type": "u32", - "description": "Proportional fee to charge for a channel lease, calculated as 1/10,000th of requested funds." - }, - "funding_weight": { - "type": "u32", - "description": "Transaction weight the channel opener will pay us for a leased funding transaction." - }, - "channel_fee_max_base_msat": { - "type": "msat", - "description": "Maximum channel_fee_base_msat we'll charge for routing funds leased on this channel." - }, - "channel_fee_max_proportional_thousandths": { - "type": "u32", - "description": "Maximum channel_fee_proportional_millitionths we'll charge for routing funds leased on this channel, in thousandths." - }, - "compact_lease": { - "type": "hex", - "description": "Compact description of the channel lease parameters." - } - } -} diff --git a/doc/schemas/fundpsbt.request.json b/doc/schemas/fundpsbt.request.json deleted file mode 100644 index d1baebd68d42..000000000000 --- a/doc/schemas/fundpsbt.request.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "satoshi", - "feerate", - "startweight" - ], - "properties": { - "satoshi": { - "type": "msat_or_all", - "description": "the minimum satoshi value of the output(s) needed (or the string `all` meaning use all unreserved inputs). If a value, it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" - }, - "feerate": { - "type": "feerate", - "description": "used for the transaction as initial feerate. The default is *normal*" - }, - "startweight": { - "type": "u32", - "description": "the weight of the transaction before *fundpsbt* has added any inputs" - }, - "minconf": { - "type": "u32", - "description": "the minimum number of confirmations that used outputs should have. Default is 1" - }, - "reserve": { - "type": "u32", - "description": "if not zero, then *reserveinputs* is called (successfully, with *exclusive* true) on the returned PSBT for this number of blocks. Defaults to 72 blocks if unspecified" - }, - "locktime": { - "type": "u32", - "description": "the locktime of the transaction. if not set, it is set to a recent block height" - }, - "min_witness_weight": { - "type": "u32", - "description": "minimum weight to use for a UTXO's witness. If the actual witness weight is greater than the provided minimum, the actual witness weight will be used" - }, - "excess_as_change": { - "type": "boolean", - "description": "flag to add a change output for the excess sats" - }, - "nonwrapped": { - "added": "v23.02", - "type": "boolean", - "description": "to signal to filter out any p2sh-wrapped inputs from funding this PSBT" - }, - "opening_anchor_channel": { - "added": "v23.08", - "type": "boolean", - "description": "to signel that it needs emergency reserve for anchors so that we can lowball our commitment tx fees, and min-emergency-msat for reserving some sats for closing anchor channels" - } - } -} diff --git a/doc/schemas/fundpsbt.schema.json b/doc/schemas/fundpsbt.schema.json deleted file mode 100644 index 84f0969e77f9..000000000000 --- a/doc/schemas/fundpsbt.schema.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt", - "feerate_per_kw", - "estimated_final_weight", - "excess_msat" - ], - "properties": { - "psbt": { - "type": "string", - "description": "Unsigned PSBT which fulfills the parameters given" - }, - "feerate_per_kw": { - "type": "u32", - "description": "The feerate used to create the PSBT, in satoshis-per-kiloweight" - }, - "estimated_final_weight": { - "type": "u32", - "description": "The estimated weight of the transaction once fully signed" - }, - "excess_msat": { - "type": "msat", - "description": "The amount above *satoshi* which is available. This could be zero, or dust; it will be zero if *change_outnum* is also returned" - }, - "change_outnum": { - "type": "u32", - "description": "The 0-based output number where change was placed (only if parameter *excess_as_change* was true and there was sufficient funds)" - }, - "reservations": { - "type": "array", - "description": "If *reserve* was true or a non-zero number, just as per lightning-reserveinputs(7)", - "items": { - "type": "object", - "required": [ - "txid", - "vout", - "was_reserved", - "reserved", - "reserved_to_block" - ], - "additionalProperties": false, - "properties": { - "txid": { - "type": "txid", - "description": "The txid of the transaction" - }, - "vout": { - "type": "u32", - "description": "The 0-based output number" - }, - "was_reserved": { - "type": "boolean", - "enum": [ - false - ], - "description": "Whether this output was previously reserved" - }, - "reserved": { - "type": "boolean", - "enum": [ - true - ], - "description": "Whether this output is now reserved" - }, - "reserved_to_block": { - "type": "u32", - "description": "The blockheight the reservation will expire" - } - } - } - } - } -} diff --git a/doc/schemas/getinfo.request.json b/doc/schemas/getinfo.request.json deleted file mode 100644 index f99496c5ac84..000000000000 --- a/doc/schemas/getinfo.request.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": {} -} diff --git a/doc/schemas/getinfo.schema.json b/doc/schemas/getinfo.schema.json deleted file mode 100644 index ceba996f896f..000000000000 --- a/doc/schemas/getinfo.schema.json +++ /dev/null @@ -1,297 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "alias", - "color", - "num_peers", - "num_pending_channels", - "num_active_channels", - "num_inactive_channels", - "version", - "blockheight", - "network", - "fees_collected_msat", - "lightning-dir", - "address" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "The public key unique to this node" - }, - "alias": { - "type": "string", - "description": "The fun alias this node will advertize", - "maxLength": 32 - }, - "color": { - "type": "hex", - "description": "The favorite RGB color this node will advertize", - "minLength": 6, - "maxLength": 6 - }, - "num_peers": { - "type": "u32", - "description": "The total count of peers, connected or with channels" - }, - "num_pending_channels": { - "type": "u32", - "description": "The total count of channels being opened" - }, - "num_active_channels": { - "type": "u32", - "description": "The total count of channels in normal state" - }, - "num_inactive_channels": { - "type": "u32", - "description": "The total count of channels waiting for opening or closing transactions to be mined" - }, - "version": { - "type": "string", - "description": "Identifies what bugs you are running into" - }, - "lightning-dir": { - "type": "string", - "description": "Identifies where you can find the configuration and other related files" - }, - "our_features": { - "type": "object", - "description": "Our BOLT #9 feature bits (as hexstring) for various contexts", - "additionalProperties": true, - "required": [ - "init", - "node", - "channel", - "invoice" - ], - "properties": { - "init": { - "type": "hex", - "description": "features (incl. globalfeatures) in our init message, these also restrict what we offer in open_channel or accept in accept_channel" - }, - "node": { - "type": "hex", - "description": "features in our node_announcement message" - }, - "channel": { - "type": "hex", - "description": "negotiated channel features we (as channel initiator) publish in the channel_announcement message" - }, - "invoice": { - "type": "hex", - "description": "features in our BOLT11 invoices" - } - } - }, - "blockheight": { - "type": "u32", - "description": "The highest block height we've learned" - }, - "network": { - "type": "string", - "description": "represents the type of network on the node are working (e.g: `bitcoin`, `testnet`, or `regtest`)" - }, - "fees_collected_msat": { - "type": "msat", - "description": "Total routing fees collected by this node" - }, - "address": { - "type": "array", - "description": "The addresses we announce to the world", - "items": { - "type": "object", - "required": [ - "type", - "port" - ], - "additionalProperties": true, - "properties": { - "type": { - "type": "string", - "enum": [ - "dns", - "ipv4", - "ipv6", - "torv2", - "torv3" - ], - "description": "Type of connection (until 23.08, `websocket` was also allowed)" - }, - "port": { - "type": "u16", - "description": "port number" - } - }, - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "dns", - "ipv4", - "ipv6", - "torv2", - "torv3" - ] - } - } - }, - "then": { - "required": [ - "type", - "address", - "port" - ], - "additionalProperties": false, - "properties": { - "type": {}, - "port": {}, - "address": { - "type": "string", - "description": "address in expected format for **type**" - } - } - }, - "else": { - "required": [ - "type", - "port" - ], - "additionalProperties": false, - "properties": { - "type": {}, - "port": {} - } - } - } - }, - "binding": { - "type": "array", - "description": "The addresses we are listening on", - "items": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "*FIXME*": "The variant in connect.schema.json is more complete", - "enum": [ - "local socket", - "websocket", - "ipv4", - "ipv6", - "torv2", - "torv3" - ], - "description": "Type of connection" - }, - "address": { - "type": "string", - "description": "address in expected format for **type**" - }, - "port": { - "type": "u16", - "description": "port number" - } - }, - "allOf": [ - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "local socket" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "type", - "socket" - ], - "properties": { - "type": {}, - "socket": { - "type": "string", - "description": "socket filename" - } - } - }, - "else": { - "additionalProperties": false, - "required": [ - "type", - "address", - "port" - ], - "properties": { - "type": {}, - "address": {}, - "port": {}, - "subtype": {} - } - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "websocket" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "type", - "address", - "port", - "subtype" - ], - "properties": { - "type": {}, - "address": {}, - "port": {}, - "subtype": { - "type": "string", - "description": "type of address" - } - } - }, - "else": { - "additionalProperties": false, - "required": [ - "type" - ], - "properties": { - "type": {}, - "address": {}, - "port": {}, - "socket": {} - } - } - } - ] - } - }, - "warning_bitcoind_sync": { - "type": "string", - "description": "Bitcoind is not up-to-date with network." - }, - "warning_lightningd_sync": { - "type": "string", - "description": "Lightningd is still loading latest blocks from bitcoind." - } - } -} diff --git a/doc/schemas/getlog.request.json b/doc/schemas/getlog.request.json deleted file mode 100644 index a6fcfec8f4c2..000000000000 --- a/doc/schemas/getlog.request.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "level": { - "type": "string", - "enum": [ - "broken", - "unusual", - "info", - "debug", - "io" - ], - "description": "a string that represents the log level. The default is *info*" - } - } -} diff --git a/doc/schemas/getlog.schema.json b/doc/schemas/getlog.schema.json deleted file mode 100644 index b2ba62b7555d..000000000000 --- a/doc/schemas/getlog.schema.json +++ /dev/null @@ -1,163 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "created_at", - "bytes_used", - "bytes_max", - "log" - ], - "properties": { - "created_at": { - "type": "string", - "description": "UNIX timestamp with 9 decimal places, when logging was initialized" - }, - "bytes_used": { - "type": "u32", - "description": "The number of bytes used by logging records" - }, - "bytes_max": { - "type": "u32", - "description": "The bytes_used values at which records will be trimmed " - }, - "log": { - "type": "array", - "items": { - "type": "object", - "required": [ - "type" - ], - "additionalProperties": true, - "properties": { - "type": { - "type": "string", - "enum": [ - "SKIPPED", - "BROKEN", - "UNUSUAL", - "INFO", - "DEBUG", - "IO_IN", - "IO_OUT" - ] - } - }, - "allOf": [ - { - "if": { - "additionalProperties": true, - "properties": { - "type": { - "enum": [ - "SKIPPED" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "num_skipped" - ], - "properties": { - "type": {}, - "num_skipped": { - "type": "u32", - "description": "number of unprinted log entries (deleted or below *level* parameter)" - } - } - } - }, - { - "if": { - "additionalProperties": true, - "properties": { - "type": { - "enum": [ - "BROKEN", - "UNUSUAL", - "INFO", - "DEBUG" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "time", - "source", - "log" - ], - "properties": { - "type": {}, - "time": { - "type": "string", - "description": "UNIX timestamp with 9 decimal places after **created_at**" - }, - "source": { - "type": "string", - "description": "The particular logbook this was found in" - }, - "log": { - "type": "string", - "description": "The actual log message" - }, - "node_id": { - "type": "pubkey", - "description": "The peer this is associated with" - } - } - } - }, - { - "if": { - "additionalProperties": true, - "properties": { - "type": { - "enum": [ - "IO_IN", - "IO_OUT" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "time", - "source", - "log", - "data" - ], - "properties": { - "type": {}, - "time": { - "type": "string", - "description": "Seconds after **created_at**, with 9 decimal places" - }, - "source": { - "type": "string", - "description": "The particular logbook this was found in" - }, - "log": { - "type": "string", - "description": "The associated log message" - }, - "node_id": { - "type": "pubkey", - "description": "The peer this is associated with" - }, - "data": { - "type": "hex", - "description": "The IO which occurred" - } - } - } - } - ] - } - } - } -} diff --git a/doc/schemas/getroute.request.json b/doc/schemas/getroute.request.json deleted file mode 100644 index 79f51e07bc6a..000000000000 --- a/doc/schemas/getroute.request.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "id", - "amount_msat", - "riskfactor" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "node pubkey to find the best route for the payment" - }, - "amount_msat": { - "type": "msat", - "description": "amount to send. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. The 0 value is special: it ignores any *htlc_minimum_msat* setting on channels, and simply returns a possible route (if any) which is useful for simple probing" - }, - "riskfactor": { - "type": "u64", - "description": "a non-negative floating-point field controls this tradeoff; it is the annual cost of your funds being stuck (as a percentage).\tFor example, if you thought the convenience of keeping your funds liquid (not stuck) was worth 20% per annum interest, *riskfactor* would be 20.\tIf you didn't care about risk, *riskfactor* would be zero" - }, - "cltv": { - "type": "u32", - "description": "cltv-blocks to spare. Default is 9" - }, - "fromid": { - "type": "pubkey", - "description": "the node to start the route from. Default is this node" - }, - "fuzzpercent": { - "type": "u32", - "description": "used to distort fees to provide some randomization to the route generated, but it was not properly implemented and is ignored" - }, - "exclude": { - "type": "array", - "description": "a JSON array of short-channel-id/direction (e.g. ['564334x877x1/0', '564195x1292x0/1' ]) or node-id which should be excluded from consideration for routing. The default is not to exclude any channels or nodes. Note if the source or destination is excluded, the command result is undefined", - "items": { - "type": "string" - } - }, - "maxhops": { - "type": "u32", - "description": "the maximum number of channels to return. Default is 20" - } - } -} diff --git a/doc/schemas/getroute.schema.json b/doc/schemas/getroute.schema.json deleted file mode 100644 index 8faa690a1e99..000000000000 --- a/doc/schemas/getroute.schema.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "route" - ], - "properties": { - "route": { - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "direction", - "channel", - "amount_msat", - "delay", - "style" - ], - "additionalProperties": false, - "properties": { - "id": { - "type": "pubkey", - "description": "The node at the end of this hop" - }, - "channel": { - "type": "short_channel_id", - "description": "The channel joining these nodes" - }, - "direction": { - "type": "u32", - "description": "0 if this channel is traversed from lesser to greater **id**, otherwise 1" - }, - "amount_msat": { - "type": "msat", - "description": "The amount expected by the node at the end of this hop" - }, - "delay": { - "type": "u32", - "description": "The total CLTV expected by the node at the end of this hop" - }, - "style": { - "type": "string", - "description": "The features understood by the destination node", - "enum": [ - "tlv" - ] - } - } - } - } - } -} diff --git a/doc/schemas/help.request.json b/doc/schemas/help.request.json deleted file mode 100644 index 0c634d982549..000000000000 --- a/doc/schemas/help.request.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "command": { - "type": "string", - "description": "command to get information about" - } - } -} diff --git a/doc/schemas/help.schema.json b/doc/schemas/help.schema.json deleted file mode 100644 index df8777c0d28e..000000000000 --- a/doc/schemas/help.schema.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "help" - ], - "properties": { - "help": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "command", - "category", - "description", - "verbose" - ], - "properties": { - "command": { - "type": "string", - "description": "the command" - }, - "category": { - "type": "string", - "description": "the category for this command (useful for grouping)" - }, - "description": { - "type": "string", - "description": "a one-line description of the purpose of this command" - }, - "verbose": { - "type": "string", - "description": "a full description of this command (including whether it's deprecated)" - } - } - } - }, - "format-hint": {} - } -} diff --git a/doc/schemas/invoice.request.json b/doc/schemas/invoice.request.json deleted file mode 100644 index e7d5a948b46d..000000000000 --- a/doc/schemas/invoice.request.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "amount_msat", - "label", - "description" - ], - "properties": { - "amount_msat": { - "type": "msat_or_any", - "description": "the string `any`, which creates an invoice that can be paid with any amount. Otherwise it is a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*" - }, - "label": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ], - "description": "a unique string or number (which is treated as a string, so `01` is different from `1`); it is never revealed to other nodes on the lightning network, but it can be used to query the status of this invoice" - }, - "description": { - "type": "string", - "description": "a short description of purpose of payment, e.g. *1 cup of coffee*. This value is encoded into the BOLT11 invoice and is viewable by any node you send this invoice to (unless *deschashonly* is true as described below). It must be UTF-8, and cannot use *\\u* JSON escape codes" - }, - "expiry": { - "type": "u64", - "description": "the time the invoice is valid for, in seconds. If no value is provided the default of 604800 (1 week) is used" - }, - "fallbacks": { - "type": "array", - "description": "one or more fallback addresses to include in the invoice (in order from most-preferred to least): note that these arrays are not currently tracked to fulfill the invoice", - "items": { - "type": "string" - } - }, - "preimage": { - "type": "hex", - "description": "a 64-digit hex string to be used as payment preimage for the created invoice. By default, if unspecified, lightningd will generate a secure pseudorandom preimage seeded from an appropriate entropy source on your system. **IMPORTANT**: if you specify the *preimage*, you are responsible, to ensure appropriate care for generating using a secure pseudorandom generator seeded with sufficient entropy, and keeping the preimage secret. This parameter is an advanced feature intended for use with cutting-edge cryptographic protocols and should not be used unless explicitly needed" - }, - "exposeprivatechannels": { - "description": "if specified, it overrides the default route hint logic, which will use unpublished channels only if there are no published channels", - "oneOf": [ - { - "type": "boolean", - "description": "if *True* unpublished channels are always considered as a route hint candidate; if *False*, never" - }, - { - "type": "array", - "description": "array of short channel ids (or a remote alias), only those specific channels will be considered candidates, even if they are public or dead-ends", - "items": { - "type": "short_channel_id" - } - }, - { - "type": "short_channel_id", - "description": "if it is a short channel id (e.g. *1x1x3*), only this specific channel will be considered candidate, even if it is public or dead-end" - } - ] - }, - "cltv": { - "type": "u32", - "description": "if specified, sets the *min_final_cltv_expiry* for the invoice. Otherwise, it's set to the parameter **cltv-final**" - }, - "deschashonly": { - "type": "boolean", - "description": "if True, then the bolt11 returned contains a hash of the *description*, rather than the *description* itself: this allows much longer descriptions, but they must be communicated via some other mechanism. Defaults to False" - } - } -} diff --git a/doc/schemas/invoice.schema.json b/doc/schemas/invoice.schema.json deleted file mode 100644 index d9e073061852..000000000000 --- a/doc/schemas/invoice.schema.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "payment_hash", - "expires_at", - "created_index", - "bolt11", - "payment_secret" - ], - "properties": { - "bolt11": { - "type": "string", - "description": "the bolt11 string" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "payment_secret": { - "type": "secret", - "description": "the *payment_secret* to place in the onion" - }, - "expires_at": { - "type": "u64", - "description": "UNIX timestamp of when invoice expires" - }, - "created_index": { - "type": "u64", - "added": "v23.08", - "description": "1-based index indicating order this invoice was created in" - }, - "warning_capacity": { - "type": "string", - "description": "even using all possible channels, there's not enough incoming capacity to pay this invoice." - }, - "warning_offline": { - "type": "string", - "description": "there would be enough incoming capacity, but some channels are offline, so there isn't." - }, - "warning_deadends": { - "type": "string", - "description": "there would be enough incoming capacity, but some channels are dead-ends (no other public channels from those peers), so there isn't." - }, - "warning_private_unused": { - "type": "string", - "description": "there would be enough incoming capacity, but some channels are unannounced and *exposeprivatechannels* is *false*, so there isn't." - }, - "warning_mpp": { - "type": "string", - "description": "there is sufficient capacity, but not in a single channel, so the payer will have to use multi-part payments." - } - } -} diff --git a/doc/schemas/invoicerequest.request.json b/doc/schemas/invoicerequest.request.json deleted file mode 100644 index fbade5e2a5f0..000000000000 --- a/doc/schemas/invoicerequest.request.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "amount", - "description" - ], - "added": "v22.11", - "properties": { - "amount": { - "type": "msat", - "description": "a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*" - }, - "description": { - "type": "string", - "description": "a short description of purpose of the payment, e.g. *ATM withdrawl*. This value is encoded into the resulting `invoice_request` and is viewable by anyone you expose it to. It must be UTF-8, and cannot use *\\u* JSON escape codes" - }, - "issuer": { - "type": "string", - "description": "who is issuing it (i.e. you) if appropriate" - }, - "label": { - "type": "string", - "description": "an internal-use name for the offer, which can be any UTF-8 string" - }, - "absolute_expiry": { - "type": "u64", - "description": "the time the offer is valid until, in seconds since the first day of 1970 UTC. If not set, the `invoice_request` remains valid (though it can be deactivated by the issuer of course). This is encoded in the `invoice_request`" - }, - "single_use": { - "type": "boolean", - "description": "indicates that the `invoice_request` is only valid once; we may attempt multiple payments, but as soon as one is successful no more invoices are accepted (i.e. only one person can take the money). Defaults to True" - } - } -} diff --git a/doc/schemas/invoicerequest.schema.json b/doc/schemas/invoicerequest.schema.json deleted file mode 100644 index 378a95650c72..000000000000 --- a/doc/schemas/invoicerequest.schema.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "invreq_id", - "single_use", - "active", - "bolt12", - "used" - ], - "properties": { - "invreq_id": { - "type": "hash", - "description": "the SHA256 hash of all invoice_request fields less than 160" - }, - "active": { - "type": "boolean", - "enum": [ - true - ], - "description": "whether the invoice_request is currently active" - }, - "single_use": { - "type": "boolean", - "description": "whether the invoice_request will become inactive after we pay an invoice for it" - }, - "bolt12": { - "type": "string", - "description": "the bolt12 string starting with lnr" - }, - "used": { - "type": "boolean", - "enum": [ - false - ], - "description": "whether the invoice_request has already been used" - }, - "label": { - "type": "string", - "description": "the label provided when creating the invoice_request" - } - } -} diff --git a/doc/schemas/keysend.request.json b/doc/schemas/keysend.request.json deleted file mode 100644 index 66f37cb4b42c..000000000000 --- a/doc/schemas/keysend.request.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "destination", - "amount_msat" - ], - "properties": { - "destination": { - "type": "pubkey", - "description": "the 33 byte, hex-encoded, node ID of the node that the payment should go to" - }, - "amount_msat": { - "type": "msat", - "description": "a whole number, or a whole number with suffix `msat` or `sat`, or a three decimal point number with suffix `sat`, or an 1 to 11 decimal point number suffixed by `btc`" - }, - "label": { - "type": "string", - "description": "used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7)" - }, - "maxfeepercent": { - "type": "number", - "description": "limits the money paid in fees as percentage of the total amount that is to be transferred, and defaults to *0.5*" - }, - "retry_for": { - "type": "u32", - "description": "until *retry_for* seconds passes, the command will keep finding routes and retrying the payment. However, a payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case. Defaults to 60 seconds" - }, - "maxdelay": { - "type": "u32", - "description": "number of blocks the payment may be delayed" - }, - "exemptfee": { - "type": "msat", - "description": "used for tiny payments which would be dominated by the fee leveraged by forwarding nodes. Setting `exemptfee` allows the `maxfeepercent` check to be skipped on fees that are smaller than *exemptfee*. Defaults to 5000 millisatoshi" - }, - "routehints": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "scid", - "feebase", - "feeprop", - "expirydelta" - ], - "properties": { - "id": { - "type": "pubkey" - }, - "scid": { - "type": "short_channel_id" - }, - "feebase": { - "type": "msat" - }, - "feeprop": { - "type": "u32" - }, - "expirydelta": { - "type": "u16" - } - } - } - } - }, - "extratlvs": { - "type": "object", - "additionalProperties": true, - "required": [], - "description": "dictionary of additional fields to insert into the final tlv. The format is 'fieldnumber': 'hexstring'" - } - } -} diff --git a/doc/schemas/keysend.schema.json b/doc/schemas/keysend.schema.json deleted file mode 100644 index a2a3fc88b435..000000000000 --- a/doc/schemas/keysend.schema.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "payment_preimage", - "payment_hash", - "created_at", - "parts", - "amount_msat", - "amount_sent_msat", - "status" - ], - "properties": { - "payment_preimage": { - "type": "secret", - "description": "the proof of payment: SHA256 of this **payment_hash**" - }, - "destination": { - "type": "pubkey", - "description": "the final destination of the payment" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "created_at": { - "type": "number", - "description": "the UNIX timestamp showing when this payment was initiated" - }, - "parts": { - "type": "u32", - "description": "how many attempts this took" - }, - "amount_msat": { - "type": "msat", - "description": "Amount the recipient received" - }, - "amount_sent_msat": { - "type": "msat", - "description": "Total amount we sent (including fees)" - }, - "warning_partial_completion": { - "type": "string", - "description": "Not all parts of a multi-part payment have completed" - }, - "status": { - "type": "string", - "enum": [ - "complete" - ], - "description": "status of payment" - } - } -} diff --git a/doc/schemas/listchannels.request.json b/doc/schemas/listchannels.request.json deleted file mode 100644 index 2779b0298de4..000000000000 --- a/doc/schemas/listchannels.request.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": { - "short_channel_id": { - "type": "short_channel_id", - "description": "if short_channel_id is a short channel id, then only known channels with a matching short_channel_id are returned. Otherwise, it must be null" - }, - "source": { - "type": "pubkey", - "description": "if source is a node id, then only channels leading from that node id are returned" - }, - "destination": { - "type": "pubkey", - "description": "if destination is a node id, then only channels leading to that node id are returned" - } - } -} diff --git a/doc/schemas/listchannels.schema.json b/doc/schemas/listchannels.schema.json deleted file mode 100644 index bd3dd50de372..000000000000 --- a/doc/schemas/listchannels.schema.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channels" - ], - "properties": { - "channels": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "source", - "destination", - "short_channel_id", - "direction", - "public", - "amount_msat", - "message_flags", - "channel_flags", - "active", - "last_update", - "base_fee_millisatoshi", - "fee_per_millionth", - "delay", - "htlc_minimum_msat", - "features" - ], - "properties": { - "source": { - "type": "pubkey", - "description": "the source node" - }, - "destination": { - "type": "pubkey", - "description": "the destination node" - }, - "short_channel_id": { - "type": "short_channel_id", - "description": "short channel id of channel" - }, - "direction": { - "type": "u32", - "description": "direction (0 if source < destination, 1 otherwise)." - }, - "public": { - "type": "boolean", - "description": "true if this is announced (from *v24.02*, being false is deprecated)" - }, - "amount_msat": { - "type": "msat", - "description": "the total capacity of this channel (always a whole number of satoshis)" - }, - "message_flags": { - "type": "u8", - "description": "as defined by BOLT #7" - }, - "channel_flags": { - "type": "u8", - "description": "as defined by BOLT #7" - }, - "active": { - "type": "boolean", - "description": "true unless source has disabled it (or (deprecated in *v24.02*) it's a local channel and the peer is disconnected or it's still opening or closing)" - }, - "last_update": { - "type": "u32", - "description": "UNIX timestamp on the last channel_update from *source*" - }, - "base_fee_millisatoshi": { - "type": "u32", - "description": "Base fee changed by *source* to use this channel" - }, - "fee_per_millionth": { - "type": "u32", - "description": "Proportional fee changed by *source* to use this channel, in parts-per-million" - }, - "delay": { - "type": "u32", - "description": "The number of blocks delay required by *source* to use this channel" - }, - "htlc_minimum_msat": { - "type": "msat", - "description": "The smallest payment *source* will allow via this channel" - }, - "satoshis": {}, - "htlc_maximum_msat": { - "type": "msat", - "description": "The largest payment *source* will allow via this channel" - }, - "features": { - "type": "hex", - "description": "BOLT #9 features bitmap for this channel" - } - } - } - } - } -} diff --git a/doc/schemas/listclosedchannels.request.json b/doc/schemas/listclosedchannels.request.json deleted file mode 100644 index eb11e66565ad..000000000000 --- a/doc/schemas/listclosedchannels.request.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "added": "v23.05", - "properties": { - "id": { - "type": "pubkey", - "description": "if no *id* is supplied, then channel data on all historical channels are given. Supplying *id* will filter the results to only match channels to that peer. Note that prior to v23.05, old peers were forgotten" - } - } -} diff --git a/doc/schemas/listclosedchannels.schema.json b/doc/schemas/listclosedchannels.schema.json deleted file mode 100644 index 25bb800893c5..000000000000 --- a/doc/schemas/listclosedchannels.schema.json +++ /dev/null @@ -1,193 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "added": "v23.05", - "required": [ - "closedchannels" - ], - "properties": { - "closedchannels": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "channel_id", - "opener", - "private", - "total_msat", - "total_local_commitments", - "total_remote_commitments", - "total_htlcs_sent", - "funding_txid", - "funding_outnum", - "leased", - "final_to_us_msat", - "min_to_us_msat", - "max_to_us_msat", - "close_cause" - ], - "properties": { - "peer_id": { - "type": "pubkey", - "description": "Peer public key (can be missing with pre-v23.05 closes!)" - }, - "channel_id": { - "type": "hash", - "description": "The full channel_id (funding txid Xored with output number)" - }, - "short_channel_id": { - "type": "short_channel_id", - "description": "The short_channel_id" - }, - "alias": { - "type": "object", - "required": [], - "properties": { - "local": { - "type": "short_channel_id", - "description": "An alias assigned by this node to this channel, used for outgoing payments" - }, - "remote": { - "type": "short_channel_id", - "description": "An alias assigned by the remote node to this channel, usable in routehints and invoices" - } - } - }, - "opener": { - "type": "string", - "enum": [ - "local", - "remote" - ], - "description": "Who initiated the channel" - }, - "closer": { - "type": "string", - "enum": [ - "local", - "remote" - ], - "description": "Who initiated the channel close (only present if closing)" - }, - "private": { - "type": "boolean", - "description": "if True, we will not announce this channel" - }, - "channel_type": { - "type": "object", - "description": "channel_type as negotiated with peer", - "additionalProperties": false, - "required": [ - "bits", - "names" - ], - "properties": { - "bits": { - "type": "array", - "description": "Each bit set in this channel_type", - "items": { - "type": "u32", - "description": "Bit number" - } - }, - "names": { - "type": "array", - "description": "Feature name for each bit set in this channel_type", - "items": { - "type": "string", - "enum": [ - "static_remotekey/even", - "anchor_outputs/even", - "anchors_zero_fee_htlc_tx/even", - "scid_alias/even", - "zeroconf/even" - ], - "description": "Name of feature bit" - } - } - } - }, - "total_local_commitments": { - "type": "u64", - "description": "Number of commitment transaction we made" - }, - "total_remote_commitments": { - "type": "u64", - "description": "Number of commitment transaction they made" - }, - "total_htlcs_sent": { - "type": "u64", - "description": "Number of HTLCs we ever sent" - }, - "funding_txid": { - "type": "txid", - "description": "ID of the funding transaction" - }, - "funding_outnum": { - "type": "u32", - "description": "The 0-based output number of the funding transaction which opens the channel" - }, - "leased": { - "type": "boolean", - "description": "Whether this channel was leased from `opener`" - }, - "funding_fee_paid_msat": { - "type": "msat", - "description": "How much we paid to lease the channel (iff `leased` is true and `opener` is local)" - }, - "funding_fee_rcvd_msat": { - "type": "msat", - "description": "How much they paid to lease the channel (iff `leased` is true and `opener` is remote)" - }, - "funding_pushed_msat": { - "type": "msat", - "description": "How much `opener` pushed immediate (if non-zero)" - }, - "total_msat": { - "type": "msat", - "description": "total amount in the channel" - }, - "final_to_us_msat": { - "type": "msat", - "description": "Our balance in final commitment transaction" - }, - "min_to_us_msat": { - "type": "msat", - "description": "Least amount owed to us ever. If the peer were to succesfully steal from us, this is the amount we would still retain." - }, - "max_to_us_msat": { - "type": "msat", - "description": "Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get." - }, - "last_commitment_txid": { - "type": "hash", - "description": "The final commitment tx's txid (or mutual close, if we accepted it). Not present for some very old, small channels pre-0.7.0." - }, - "last_commitment_fee_msat": { - "type": "msat", - "description": "The fee on `last_commitment_txid`" - }, - "close_cause": { - "type": "string", - "enum": [ - "unknown", - "local", - "user", - "remote", - "protocol", - "onchain" - ], - "description": "What caused the channel to close" - }, - "last_stable_connection": { - "type": "u64", - "added": "v24.02", - "description": "Last time we reestablished the open channel and stayed connected for 1 minute" - } - } - } - } - } -} diff --git a/doc/schemas/listconfigs.request.json b/doc/schemas/listconfigs.request.json deleted file mode 100644 index 1bdf9677ecb5..000000000000 --- a/doc/schemas/listconfigs.request.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "config": { - "type": "string", - "description": "configuration option name to restrict return" - } - } -} diff --git a/doc/schemas/listconfigs.schema.json b/doc/schemas/listconfigs.schema.json deleted file mode 100644 index 2850d7b21808..000000000000 --- a/doc/schemas/listconfigs.schema.json +++ /dev/null @@ -1,1994 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "configs": { - "added": "v23.08", - "type": "object", - "comment": "Plugins can add fields to this, so we can't rule out additional properties :(", - "additionalProperties": true, - "required": [], - "properties": { - "conf": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": "field from cmdline" - }, - "source": { - "type": "string", - "enum": [ - "cmdline" - ], - "description": "source of configuration setting" - } - } - }, - "developer": { - "type": "object", - "added": "v23.08", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "clear-plugins": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "disable-mpp": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - }, - "plugin": { - "type": "string", - "description": "plugin which registered this configuration setting" - } - } - }, - "mainnet": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "regtest": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "signet": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "testnet": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "important-plugin": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": "field from config or cmdline" - } - }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": "source of configuration setting" - } - } - } - }, - "plugin": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": "field from config or cmdline" - } - }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": "source of configuration setting" - } - } - } - }, - "plugin-dir": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": "field from config or cmdline" - } - }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": "source of configuration setting" - } - } - } - }, - "lightning-dir": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "network": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default (can also be changed by `testnet`, `signet`, `regtest` options!)" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "allow-deprecated-apis": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_bool", - "source" - ], - "properties": { - "value_bool": { - "type": "boolean", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "rpc-file": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "disable-plugin": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": "field from config or cmdline" - } - }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": "source of configuration setting" - } - } - } - }, - "always-use-proxy": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_bool", - "source" - ], - "properties": { - "value_bool": { - "type": "boolean", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "daemon": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "wallet": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "large-channels": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "experimental-dual-fund": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "experimental-splicing": { - "added": "v23.08", - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "experimental-onion-messages": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "experimental-offers": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "experimental-shutdown-wrong-funding": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "experimental-websocket-port": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "experimental-peer-storage": { - "added": "v23.02", - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "experimental-anchors": { - "type": "object", - "added": "v23.08", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "database-upgrade": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_bool", - "source" - ], - "properties": { - "value_bool": { - "type": "boolean", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "rgb": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "hex", - "description": "field from config or cmdline, or default", - "maxLength": 6, - "minLength": 6 - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "alias": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "pid-file": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "ignore-fee-limits": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_bool", - "source" - ], - "properties": { - "value_bool": { - "type": "boolean", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "watchtime-blocks": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "max-locktime-blocks": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "funding-confirms": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "cltv-delta": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "cltv-final": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "commit-time": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "fee-base": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "rescan": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "integer", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "fee-per-satoshi": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "max-concurrent-htlcs": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "htlc-minimum-msat": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_msat", - "source" - ], - "properties": { - "value_msat": { - "type": "msat", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "htlc-maximum-msat": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_msat", - "source" - ], - "properties": { - "value_msat": { - "type": "msat", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "max-dust-htlc-exposure-msat": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_msat", - "source" - ], - "properties": { - "value_msat": { - "type": "msat", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "min-capacity-sat": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u64", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - }, - "dynamic": { - "type": "boolean", - "enum": [ - true - ], - "description": "Can this be set by setconfig()" - } - } - }, - "addr": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": "field from config or cmdline" - } - }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": "source of configuration setting" - } - } - } - }, - "announce-addr": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": "field from config or cmdline" - } - }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": "source of configuration setting" - } - } - } - }, - "bind-addr": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": "field from config or cmdline" - } - }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": "source of configuration setting" - } - } - } - }, - "offline": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "autolisten": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_bool", - "source" - ], - "properties": { - "value_bool": { - "type": "boolean", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "proxy": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "disable-dns": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "announce-addr-discovered": { - "added": "v23.02", - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "enum": [ - "true", - "false", - "auto" - ], - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "announce-addr-discovered-port": { - "added": "v23.02", - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "encrypted-hsm": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "rpc-file-mode": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "log-level": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "log-prefix": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "log-file": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": "field from config or cmdline" - } - }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": "source of configuration setting" - } - } - } - }, - "log-timestamps": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_bool", - "source" - ], - "properties": { - "value_bool": { - "type": "boolean", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "force-feerates": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "subdaemon": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { - "type": "array", - "items": { - "type": "string", - "description": "field from config or cmdline" - } - }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": "source of configuration setting" - } - } - } - }, - "fetchinvoice-noconnect": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "accept-htlc-tlv-types": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "tor-service-password": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" - ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "announce-addr-dns": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_bool", - "source" - ], - "properties": { - "value_bool": { - "type": "boolean", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "require-confirmed-inputs": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_bool", - "source" - ], - "properties": { - "value_bool": { - "type": "boolean", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "commit-fee": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u64", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "commit-feerate-offset": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { - "type": "u32", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - } - } - }, - "# version": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "Special field indicating the current version" - }, - "plugins": { - "type": "array", - "deprecated": [ - "v23.08", - "v24.02" - ], - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "path", - "name" - ], - "description": "`plugin` field from config or cmdline", - "properties": { - "path": { - "type": "string", - "description": "Full path of the plugin" - }, - "name": { - "type": "string", - "description": "short name of the plugin" - }, - "options": { - "type": "object", - "additionalProperties": true, - "required": [], - "description": "Specific options set for this plugin", - "properties": {} - } - } - } - }, - "important-plugins": { - "type": "array", - "deprecated": [ - "v23.08", - "v24.02" - ], - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "path", - "name" - ], - "description": "`important-plugin` field from config or cmdline, or built-in", - "properties": { - "path": { - "type": "string", - "description": "Full path of the plugin" - }, - "name": { - "type": "string", - "description": "short name of the plugin" - }, - "options": { - "type": "object", - "additionalProperties": true, - "required": [], - "description": "Specific options set for this plugin", - "properties": {} - } - } - } - }, - "conf": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`conf` field from cmdline, or default" - }, - "lightning-dir": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`lightning-dir` field from config or cmdline, or default" - }, - "network": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`network` field from config or cmdline, or default" - }, - "allow-deprecated-apis": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`allow-deprecated-apis` field from config or cmdline, or default" - }, - "rpc-file": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`rpc-file` field from config or cmdline, or default" - }, - "disable-plugin": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "array", - "items": { - "type": "string", - "description": "`disable-plugin` field from config or cmdline" - } - }, - "bookkeeper-dir": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`bookkeeper-dir` field from config or cmdline, or default" - }, - "bookkeeper-db": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`bookkeeper-db` field from config or cmdline, or default" - }, - "always-use-proxy": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`always-use-proxy` field from config or cmdline, or default" - }, - "daemon": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`daemon` field from config or cmdline, or default" - }, - "wallet": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`wallet` field from config or cmdline default" - }, - "large-channels": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`large-channels` field from config or cmdline, or default" - }, - "experimental-dual-fund": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`experimental-dual-fund` field from config or cmdline, or default" - }, - "experimental-splicing": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`experimental-splicing` field from config or cmdline, or default" - }, - "experimental-onion-messages": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`experimental-onion-messages` field from config or cmdline, or default" - }, - "experimental-offers": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`experimental-offers` field from config or cmdline, or default" - }, - "experimental-shutdown-wrong-funding": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`experimental-shutdown-wrong-funding` field from config or cmdline, or default" - }, - "experimental-websocket-port": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u16", - "description": "`experimental-websocket-port` field from config or cmdline, or default" - }, - "experimental-peer-storage": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "added": "v23.02", - "description": "`experimental-peer-storage` field from config or cmdline, or default" - }, - "experimental-quiesce": { - "type": "boolean", - "added": "v23.08", - "deprecated": [ - "v23.08", - "v24.02" - ], - "description": "`experimental-quiesce` field from config or cmdline, or default" - }, - "experimental-upgrade-protocol": { - "type": "boolean", - "added": "v23.08", - "deprecated": [ - "v23.08", - "v24.02" - ], - "description": "`experimental-upgrade-protocol` field from config or cmdline, or default" - }, - "invoices-onchain-fallback": { - "type": "boolean", - "added": "v23.11", - "description": "`invoices-onchain-fallback` field from config or cmdline, or default" - }, - "database-upgrade": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`database-upgrade` field from config or cmdline" - }, - "rgb": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "hex", - "description": "`rgb` field from config or cmdline, or default", - "maxLength": 6, - "minLength": 6 - }, - "alias": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`alias` field from config or cmdline, or default" - }, - "pid-file": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`pid-file` field from config or cmdline, or default" - }, - "ignore-fee-limits": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`ignore-fee-limits` field from config or cmdline, or default" - }, - "watchtime-blocks": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": "`watchtime-blocks` field from config or cmdline, or default" - }, - "max-locktime-blocks": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": "`max-locktime-blocks` field from config or cmdline, or default" - }, - "funding-confirms": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": "`funding-confirms` field from config or cmdline, or default" - }, - "cltv-delta": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": "`cltv-delta` field from config or cmdline, or default" - }, - "cltv-final": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": "`cltv-final` field from config or cmdline, or default" - }, - "commit-time": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": "`commit-time` field from config or cmdline, or default" - }, - "fee-base": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": "`fee-base` field from config or cmdline, or default" - }, - "rescan": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "integer", - "description": "`rescan` field from config or cmdline, or default" - }, - "fee-per-satoshi": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": "`fee-per-satoshi` field from config or cmdline, or default" - }, - "max-concurrent-htlcs": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u32", - "description": "`max-concurrent-htlcs` field from config or cmdline, or default" - }, - "htlc-minimum-msat": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "msat", - "description": "`htlc-minimum-msat` field from config or cmdline, or default" - }, - "htlc-maximum-msat": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "msat", - "description": "`htlc-maximum-msat` field from config or cmdline, or default" - }, - "max-dust-htlc-exposure-msat": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "msat", - "description": "`max-dust-htlc-exposure-mast` field from config or cmdline, or default" - }, - "min-capacity-sat": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u64", - "description": "`min-capacity-sat` field from config or cmdline, or default" - }, - "addr": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`addr` field from config or cmdline (can be more than one)" - }, - "announce-addr": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`announce-addr` field from config or cmdline (can be more than one)" - }, - "bind-addr": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`bind-addr` field from config or cmdline (can be more than one)" - }, - "offline": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`true` if `offline` was set in config or cmdline" - }, - "autolisten": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`autolisten` field from config or cmdline, or default" - }, - "proxy": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`proxy` field from config or cmdline, or default" - }, - "disable-dns": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`true` if `disable-dns` was set in config or cmdline" - }, - "announce-addr-discovered": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`true`/`false`/`auto` depending on how `announce-addr-discovered` was set in config or cmdline", - "added": "v23.02" - }, - "announce-addr-discovered-port": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "integer", - "description": "Sets the announced TCP port for dynamically discovered IPs.", - "added": "v23.02" - }, - "encrypted-hsm": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`true` if `encrypted-hsm` was set in config or cmdline" - }, - "rpc-file-mode": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`rpc-file-mode` field from config or cmdline, or default" - }, - "log-level": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`log-level` field from config or cmdline, or default" - }, - "log-prefix": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`log-prefix` field from config or cmdline, or default" - }, - "log-file": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`log-file` field from config or cmdline, or default" - }, - "log-timestamps": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`log-timestamps` field from config or cmdline, or default" - }, - "force-feerates": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "force-feerate configuration setting, if any" - }, - "subdaemon": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`subdaemon` fields from config or cmdline if any (can be more than one)" - }, - "fetchinvoice-noconnect": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "`fetchinvoice-noconnect` fields from config or cmdline, or default" - }, - "accept-htlc-tlv-types": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`accept-htlc-tlv-types` field from config or cmdline, or not present" - }, - "tor-service-password": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "string", - "description": "`tor-service-password` field from config or cmdline, if any" - }, - "dev-allowdustreserve": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "Whether we allow setting dust reserves" - }, - "announce-addr-dns": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "added": "v22.11.1", - "description": "Whether we put DNS entries into node_announcement" - }, - "require-confirmed-inputs": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "boolean", - "description": "Request peers to only send confirmed inputs (dual-fund only)" - }, - "developer": { - "added": "v23.08", - "type": "boolean", - "description": "Whether developer mode is enabled" - }, - "commit-fee": { - "deprecated": [ - "v23.08", - "v24.02" - ], - "type": "u64", - "added": "v23.05", - "description": "The percentage of the 6-block fee estimate to use for commitment transactions" - }, - "min-emergency-msat": { - "type": "msat", - "added": "v23.08", - "description": "field from config or cmdline, or default" - }, - "commit-feerate-offset": { - "type": "u32", - "added": "v23.11", - "description": "additional commitment feerate applied by channel owner" - } - } -} diff --git a/doc/schemas/listdatastore.request.json b/doc/schemas/listdatastore.request.json deleted file mode 100644 index 63ea73888b18..000000000000 --- a/doc/schemas/listdatastore.request.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "key": { - "oneOf": [ - { - "type": "array", - "description": "all immediate children of the *key* (or root children) are returned.\t\tUsing the first element of the key as the plugin name (e.g. `[ 'summary' ]`) is recommended.\t\tAn array of values to form a hierarchy (though a single value is treated as a one-element array)", - "items": { - "type": "string" - } - }, - { - "type": "string" - } - ] - } - } -} diff --git a/doc/schemas/listdatastore.schema.json b/doc/schemas/listdatastore.schema.json deleted file mode 100644 index a07f793de3b4..000000000000 --- a/doc/schemas/listdatastore.schema.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "datastore" - ], - "properties": { - "datastore": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "key" - ], - "properties": { - "key": { - "type": "array", - "items": { - "type": "string", - "description": "Part of the key added to the datastore" - } - }, - "generation": { - "type": "u64", - "description": "The number of times this has been updated" - }, - "hex": { - "type": "hex", - "description": "The hex data from the datastore" - }, - "string": { - "type": "string", - "description": "The data as a string, if it's valid utf-8" - } - } - } - } - } -} diff --git a/doc/schemas/listforwards.request.json b/doc/schemas/listforwards.request.json deleted file mode 100644 index 22c91902d2dc..000000000000 --- a/doc/schemas/listforwards.request.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "properties": { - "status": { - "type": "string", - "description": "if specified, then only the forwards with the given status are returned", - "enum": [ - "offered", - "settled", - "local_failed", - "failed" - ] - }, - "in_channel": { - "type": "short_channel_id", - "description": "only the matching forwards on the given inbound channel are returned" - }, - "out_channel": { - "type": "short_channel_id", - "description": "only the matching forwards on the given outbount channel are returned" - }, - "index": { - "type": "string", - "added": "v23.11", - "enum": [ - "created", - "updated" - ], - "description": "if neither *in_channel* nor *out_channel* is specified, it controls ordering. Defaults to `created`" - }, - "start": { - "type": "u64", - "added": "v23.11", - "description": "if `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)" - }, - "limit": { - "type": "u32", - "added": "v23.11", - "description": "if `index` is specified, `limit` can be used to specify the maximum number of entries to return" - } - } -} diff --git a/doc/schemas/listforwards.schema.json b/doc/schemas/listforwards.schema.json deleted file mode 100644 index a5b999054ff1..000000000000 --- a/doc/schemas/listforwards.schema.json +++ /dev/null @@ -1,267 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "forwards" - ], - "properties": { - "forwards": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "created_index", - "in_channel", - "in_msat", - "status", - "received_time" - ], - "properties": { - "created_index": { - "added": "v23.11", - "type": "u64", - "description": "1-based index indicating order this forward was created in" - }, - "in_channel": { - "type": "short_channel_id", - "description": "the channel that received the HTLC" - }, - "in_htlc_id": { - "type": "u64", - "description": "the unique HTLC id the sender gave this (not present if incoming channel was closed before ugprade to v22.11)" - }, - "in_msat": { - "type": "msat", - "description": "the value of the incoming HTLC" - }, - "status": { - "type": "string", - "enum": [ - "offered", - "settled", - "local_failed", - "failed" - ], - "description": "still ongoing, completed, failed locally, or failed after forwarding" - }, - "received_time": { - "type": "number", - "description": "the UNIX timestamp when this was received" - }, - "out_channel": { - "type": "short_channel_id", - "description": "the channel that the HTLC (trying to) forward to" - }, - "out_htlc_id": { - "type": "u64", - "description": "the unique HTLC id we gave this when sending (may be missing even if out_channel is present, for old forwards before v22.11)" - }, - "updated_index": { - "added": "v23.11", - "type": "u64", - "description": "1-based index indicating order this forward was changed (only present if it has changed since creation)" - }, - "style": { - "type": "string", - "enum": [ - "legacy", - "tlv" - ], - "description": "Either a legacy onion format or a modern tlv format" - } - }, - "allOf": [ - { - "if": { - "required": [ - "out_msat" - ] - }, - "then": { - "additionalProperties": false, - "required": [ - "fee_msat", - "out_msat", - "out_channel" - ], - "properties": { - "created_index": {}, - "updated_index": {}, - "in_channel": {}, - "in_htlc_id": {}, - "in_msatoshi": {}, - "in_msat": {}, - "status": {}, - "style": {}, - "received_time": {}, - "resolved_time": {}, - "out_channel": {}, - "out_htlc_id": {}, - "failcode": {}, - "failreason": {}, - "fee_msat": { - "type": "msat", - "description": "the amount this paid in fees" - }, - "out_msat": { - "type": "msat", - "description": "the amount we sent out the *out_channel*" - } - } - }, - "else": { - "additionalProperties": false, - "required": [], - "properties": { - "created_index": {}, - "updated_index": {}, - "in_channel": {}, - "in_htlc_id": {}, - "in_msatoshi": {}, - "in_msat": {}, - "status": {}, - "style": {}, - "received_time": {}, - "resolved_time": {}, - "failcode": {}, - "failreason": {}, - "out_channel": {} - } - } - }, - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "settled", - "failed" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "resolved_time" - ], - "properties": { - "created_index": {}, - "updated_index": {}, - "in_channel": {}, - "in_htlc_id": {}, - "in_msatoshi": {}, - "in_msat": {}, - "status": {}, - "style": {}, - "received_time": {}, - "out_channel": {}, - "out_htlc_id": {}, - "fee": {}, - "fee_msat": {}, - "out_msatoshi": {}, - "out_msat": {}, - "failcode": {}, - "failreason": {}, - "resolved_time": { - "type": "number", - "description": "the UNIX timestamp when this was resolved" - } - } - }, - "else": { - "additionalProperties": false, - "properties": { - "created_index": {}, - "updated_index": {}, - "in_channel": {}, - "in_htlc_id": {}, - "in_msatoshi": {}, - "in_msat": {}, - "status": {}, - "style": {}, - "received_time": {}, - "out_channel": {}, - "out_htlc_id": {}, - "fee": {}, - "fee_msat": {}, - "failcode": {}, - "failreason": {}, - "out_msatoshi": {}, - "out_msat": {} - } - } - }, - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "local_failed", - "failed" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [], - "properties": { - "created_index": {}, - "updated_index": {}, - "in_channel": {}, - "in_htlc_id": {}, - "in_msatoshi": {}, - "in_msat": {}, - "status": {}, - "style": {}, - "received_time": {}, - "out_channel": {}, - "out_htlc_id": {}, - "fee": {}, - "fee_msat": {}, - "out_msatoshi": {}, - "out_msat": {}, - "resolved_time": {}, - "failcode": { - "type": "u32", - "description": "the numeric onion code returned" - }, - "failreason": { - "type": "string", - "description": "the name of the onion code returned" - } - } - }, - "else": { - "additionalProperties": false, - "required": [], - "properties": { - "created_index": {}, - "updated_index": {}, - "in_channel": {}, - "in_htlc_id": {}, - "in_msatoshi": {}, - "in_msat": {}, - "status": {}, - "style": {}, - "received_time": {}, - "out_channel": {}, - "out_htlc_id": {}, - "fee": {}, - "fee_msat": {}, - "out_msatoshi": {}, - "out_msat": {}, - "resolved_time": {} - } - } - } - ] - } - } - } -} diff --git a/doc/schemas/listfunds.request.json b/doc/schemas/listfunds.request.json deleted file mode 100644 index cef1bb3128ee..000000000000 --- a/doc/schemas/listfunds.request.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": { - "spent": { - "type": "boolean", - "description": "if True, then the *outputs* will include spent outputs in addition to the unspent ones. Default is False" - } - } -} diff --git a/doc/schemas/listfunds.schema.json b/doc/schemas/listfunds.schema.json deleted file mode 100644 index c074e93dcd45..000000000000 --- a/doc/schemas/listfunds.schema.json +++ /dev/null @@ -1,275 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "outputs", - "channels" - ], - "properties": { - "outputs": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "txid", - "output", - "amount_msat", - "scriptpubkey", - "status", - "reserved" - ], - "properties": { - "txid": { - "type": "txid", - "description": "the ID of the spendable transaction" - }, - "output": { - "type": "u32", - "description": "the index within *txid*" - }, - "amount_msat": { - "type": "msat", - "description": "the amount of the output" - }, - "scriptpubkey": { - "type": "hex", - "description": "the scriptPubkey of the output" - }, - "address": { - "type": "string", - "description": "the bitcoin address of the output" - }, - "redeemscript": { - "type": "hex", - "description": "the redeemscript, only if it's p2sh-wrapped" - }, - "status": { - "type": "string", - "enum": [ - "unconfirmed", - "confirmed", - "spent", - "immature" - ] - }, - "reserved": { - "type": "boolean", - "description": "whether this UTXO is currently reserved for an in-flight tx" - } - }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "confirmed" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "blockheight" - ], - "properties": { - "txid": {}, - "output": {}, - "amount_msat": {}, - "scriptpubkey": {}, - "address": {}, - "value": {}, - "redeemscript": {}, - "status": {}, - "reserved": {}, - "reserved_to_block": {}, - "blockheight": { - "type": "u32", - "description": "Block height where it was confirmed" - } - } - } - }, - { - "if": { - "properties": { - "reserved": { - "type": "boolean", - "enum": [ - "true" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "reserved_to_block" - ], - "properties": { - "txid": {}, - "output": {}, - "amount_msat": {}, - "scriptpubkey": {}, - "address": {}, - "value": {}, - "redeemscript": {}, - "status": {}, - "blockheight": {}, - "reserved": {}, - "reserved_to_block": { - "type": "u32", - "description": "Block height where reservation will expire" - } - } - } - } - ] - } - }, - "channels": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "peer_id", - "our_amount_msat", - "amount_msat", - "funding_txid", - "funding_output", - "connected", - "state", - "channel_id" - ], - "properties": { - "peer_id": { - "type": "pubkey", - "description": "the peer with which the channel is opened" - }, - "our_amount_msat": { - "type": "msat", - "description": "available satoshis on our node's end of the channel" - }, - "amount_msat": { - "type": "msat", - "description": "total channel value" - }, - "funding_txid": { - "type": "txid", - "description": "funding transaction id" - }, - "funding_output": { - "type": "u32", - "description": "the 0-based index of the output in the funding transaction" - }, - "connected": { - "type": "boolean", - "description": "whether the channel peer is connected" - }, - "state": { - "type": "string", - "enum": [ - "OPENINGD", - "CHANNELD_AWAITING_LOCKIN", - "CHANNELD_NORMAL", - "CHANNELD_SHUTTING_DOWN", - "CLOSINGD_SIGEXCHANGE", - "CLOSINGD_COMPLETE", - "AWAITING_UNILATERAL", - "FUNDING_SPEND_SEEN", - "ONCHAIN", - "DUALOPEND_OPEN_INIT", - "DUALOPEND_AWAITING_LOCKIN", - "DUALOPEND_OPEN_COMMITTED", - "DUALOPEND_OPEN_COMMIT_READY" - ], - "description": "the channel state, in particular \"CHANNELD_NORMAL\" means the channel can be used normally" - }, - "channel_id": { - "type": "hash", - "description": "The full channel_id (funding txid Xored with output number)", - "added": "v23.05" - } - }, - "allOf": [ - { - "if": { - "properties": { - "state": { - "type": "string", - "enum": [ - "CHANNELD_NORMAL" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "short_channel_id" - ], - "properties": { - "peer_id": {}, - "our_amount_msat": {}, - "channel_sat": {}, - "amount_msat": {}, - "channel_total_sat": {}, - "funding_txid": {}, - "funding_output": {}, - "connected": {}, - "state": {}, - "channel_id": {}, - "short_channel_id": { - "type": "short_channel_id", - "description": "short channel id of channel" - } - } - } - }, - { - "if": { - "properties": { - "state": { - "type": "string", - "enum": [ - "CHANNELD_SHUTTING_DOWN", - "CLOSINGD_SIGEXCHANGE", - "CLOSINGD_COMPLETE", - "AWAITING_UNILATERAL", - "FUNDING_SPEND_SEEN", - "ONCHAIN" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [], - "properties": { - "peer_id": {}, - "our_amount_msat": {}, - "channel_sat": {}, - "amount_msat": {}, - "channel_total_sat": {}, - "funding_txid": {}, - "funding_output": {}, - "connected": {}, - "state": {}, - "channel_id": {}, - "short_channel_id": { - "type": "short_channel_id", - "description": "short channel id of channel (only if funding reached lockin depth before closing)" - } - } - } - } - ] - } - } - } -} diff --git a/doc/schemas/listhtlcs.request.json b/doc/schemas/listhtlcs.request.json deleted file mode 100644 index 764e3dbc064e..000000000000 --- a/doc/schemas/listhtlcs.request.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "properties": { - "id": { - "type": "string", - "description": "a short channel id (e.g. 1x2x3) or full 64-byte hex channel id, it will only list htlcs for that channel (which must be known)" - } - } -} diff --git a/doc/schemas/listhtlcs.schema.json b/doc/schemas/listhtlcs.schema.json deleted file mode 100644 index 8de6f5462a88..000000000000 --- a/doc/schemas/listhtlcs.schema.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "htlcs" - ], - "properties": { - "htlcs": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "short_channel_id", - "id", - "expiry", - "direction", - "amount_msat", - "payment_hash", - "state" - ], - "properties": { - "short_channel_id": { - "type": "short_channel_id", - "description": "the channel that contains/contained the HTLC" - }, - "id": { - "type": "u64", - "description": "the unique, incrementing HTLC id the creator gave this" - }, - "expiry": { - "type": "u32", - "description": "the block number where this HTLC expires/expired" - }, - "amount_msat": { - "type": "msat", - "description": "the value of the HTLC" - }, - "direction": { - "type": "string", - "enum": [ - "out", - "in" - ], - "description": "out if we offered this to the peer, in if they offered it" - }, - "payment_hash": { - "type": "hash", - "description": "payment hash sought by HTLC" - }, - "state": { - "type": "string", - "enum": [ - "SENT_ADD_HTLC", - "SENT_ADD_COMMIT", - "RCVD_ADD_REVOCATION", - "RCVD_ADD_ACK_COMMIT", - "SENT_ADD_ACK_REVOCATION", - "RCVD_REMOVE_HTLC", - "RCVD_REMOVE_COMMIT", - "SENT_REMOVE_REVOCATION", - "SENT_REMOVE_ACK_COMMIT", - "RCVD_REMOVE_ACK_REVOCATION", - "RCVD_ADD_HTLC", - "RCVD_ADD_COMMIT", - "SENT_ADD_REVOCATION", - "SENT_ADD_ACK_COMMIT", - "RCVD_ADD_ACK_REVOCATION", - "SENT_REMOVE_HTLC", - "SENT_REMOVE_COMMIT", - "RCVD_REMOVE_REVOCATION", - "RCVD_REMOVE_ACK_COMMIT", - "SENT_REMOVE_ACK_REVOCATION" - ], - "description": "The first 10 states are for `in`, the next 10 are for `out`." - } - } - } - } - } -} diff --git a/doc/schemas/listinvoicerequests.request.json b/doc/schemas/listinvoicerequests.request.json deleted file mode 100644 index 2b22dace5708..000000000000 --- a/doc/schemas/listinvoicerequests.request.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "added": "v22.11", - "properties": { - "invreq_id": { - "type": "string", - "description": "a specific invoice can be queried by providing the `invreq_id`, which is presented by lightning-invoicerequest(7), or can be calculated from a bolt12 invoice" - }, - "active_only": { - "type": "boolean", - "description": "if it is *True* then only active invoice requests are returned. Default is *False*" - } - } -} diff --git a/doc/schemas/listinvoicerequests.schema.json b/doc/schemas/listinvoicerequests.schema.json deleted file mode 100644 index a2472c30e1c6..000000000000 --- a/doc/schemas/listinvoicerequests.schema.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "invoicerequests" - ], - "properties": { - "invoicerequests": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "invreq_id", - "single_use", - "active", - "bolt12", - "used" - ], - "properties": { - "invreq_id": { - "type": "hash", - "description": "the SHA256 hash of all invoice_request fields less than 160" - }, - "active": { - "type": "boolean", - "description": "whether the invoice_request is currently active" - }, - "single_use": { - "type": "boolean", - "description": "whether the invoice_request will become inactive after we pay an invoice for it" - }, - "bolt12": { - "type": "string", - "description": "the bolt12 string starting with lnr" - }, - "used": { - "type": "boolean", - "description": "whether the invoice_request has already been used" - }, - "label": { - "type": "string", - "description": "the label provided when creating the invoice_request" - } - } - } - } - } -} diff --git a/doc/schemas/listinvoices.request.json b/doc/schemas/listinvoices.request.json deleted file mode 100644 index 31afccebfa48..000000000000 --- a/doc/schemas/listinvoices.request.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "label": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ], - "description": "a label used a the creation of the invoice to get a specific invoice" - }, - "invstring": { - "type": "string", - "description": "the string value to query a specific invoice" - }, - "payment_hash": { - "type": "hex", - "description": "a payment_hash of the invoice to get the details of a specific invoice" - }, - "offer_id": { - "type": "string", - "description": "a local `offer_id` the invoice was issued for a specific invoice details" - }, - "index": { - "type": "string", - "added": "v23.08", - "enum": [ - "created", - "updated" - ], - "description": "if neither *in_channel* nor *out_channel* is specified, it controls ordering. Defaults to `created`" - }, - "start": { - "type": "u64", - "added": "v23.08", - "description": "if `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)" - }, - "limit": { - "type": "u32", - "added": "v23.08", - "description": "if `index` is specified, `limit` can be used to specify the maximum number of entries to return" - } - } -} diff --git a/doc/schemas/listinvoices.schema.json b/doc/schemas/listinvoices.schema.json deleted file mode 100644 index 34b87d1812df..000000000000 --- a/doc/schemas/listinvoices.schema.json +++ /dev/null @@ -1,175 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "invoices" - ], - "properties": { - "invoices": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "label", - "created_index", - "payment_hash", - "status", - "expires_at" - ], - "properties": { - "label": { - "type": "string", - "description": "unique label supplied at invoice creation" - }, - "description": { - "type": "string", - "description": "description used in the invoice" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "status": { - "type": "string", - "enum": [ - "unpaid", - "paid", - "expired" - ], - "description": "Whether it's paid, unpaid or unpayable" - }, - "expires_at": { - "type": "u64", - "description": "UNIX timestamp of when it will become / became unpayable" - }, - "amount_msat": { - "type": "msat", - "description": "the amount required to pay this invoice" - }, - "bolt11": { - "type": "string", - "description": "the BOLT11 string (always present unless *bolt12* is)" - }, - "bolt12": { - "type": "string", - "description": "the BOLT12 string (always present unless *bolt11* is)" - }, - "local_offer_id": { - "type": "hash", - "description": "the *id* of our offer which created this invoice (**experimental-offers** only)." - }, - "invreq_payer_note": { - "type": "string", - "description": "the optional *invreq_payer_note* from invoice_request which created this invoice (**experimental-offers** only)." - }, - "created_index": { - "type": "u64", - "added": "v23.08", - "description": "1-based index indicating order this invoice was created in" - }, - "updated_index": { - "type": "u64", - "added": "v23.08", - "description": "1-based index indicating order this invoice was changed (only present if it has changed since creation)" - } - }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "paid" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "pay_index", - "amount_received_msat", - "paid_at", - "payment_preimage" - ], - "properties": { - "label": {}, - "description": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "bolt11": {}, - "bolt12": {}, - "local_offer_id": {}, - "invreq_payer_note": {}, - "expires_at": {}, - "created_index": {}, - "updated_index": {}, - "pay_index": { - "type": "u64", - "description": "Unique incrementing index for this payment" - }, - "amount_received_msat": { - "type": "msat", - "description": "the amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)" - }, - "paid_at": { - "type": "u64", - "description": "UNIX timestamp of when it was paid" - }, - "paid_outpoint": { - "type": "object", - "description": "Outpoint this invoice was paid with", - "added": "v23.11", - "additionalProperties": false, - "required": [ - "txid", - "outnum" - ], - "properties": { - "txid": { - "added": "v23.11", - "type": "txid", - "description": "ID of the transaction that paid the invoice" - }, - "outnum": { - "added": "v23.11", - "type": "u32", - "description": "The 0-based output number of the transaction that paid the invoice" - } - } - }, - "payment_preimage": { - "type": "secret", - "description": "proof of payment" - } - } - }, - "else": { - "additionalProperties": false, - "properties": { - "label": {}, - "description": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "bolt11": {}, - "bolt12": {}, - "local_offer_id": {}, - "invreq_payer_note": {}, - "created_index": {}, - "updated_index": {}, - "expires_at": {} - } - } - } - ] - } - } - } -} diff --git a/doc/schemas/listnodes.request.json b/doc/schemas/listnodes.request.json deleted file mode 100644 index 4ea8c6322d77..000000000000 --- a/doc/schemas/listnodes.request.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": { - "id": { - "type": "pubkey", - "description": "The public key of the node to list" - } - } -} diff --git a/doc/schemas/listnodes.schema.json b/doc/schemas/listnodes.schema.json deleted file mode 100644 index 38f848fa9c72..000000000000 --- a/doc/schemas/listnodes.schema.json +++ /dev/null @@ -1,199 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "nodes" - ], - "properties": { - "nodes": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "nodeid" - ], - "properties": { - "nodeid": { - "type": "pubkey", - "description": "the public key of the node" - }, - "last_timestamp": { - "type": "u32", - "description": "A node_announcement has been received for this node (UNIX timestamp)" - } - }, - "allOf": [ - { - "if": { - "required": [ - "last_timestamp" - ] - }, - "then": { - "additionalProperties": false, - "required": [ - "nodeid", - "last_timestamp", - "alias", - "color", - "features", - "addresses" - ], - "properties": { - "nodeid": {}, - "last_timestamp": {}, - "option_will_fund": {}, - "alias": { - "type": "string", - "description": "The fun alias this node advertized", - "maxLength": 32 - }, - "color": { - "type": "hex", - "description": "The favorite RGB color this node advertized", - "minLength": 6, - "maxLength": 6 - }, - "features": { - "type": "hex", - "description": "BOLT #9 features bitmap this node advertized" - }, - "addresses": { - "type": "array", - "description": "The addresses this node advertized", - "items": { - "type": "object", - "required": [ - "type", - "port" - ], - "additionalProperties": true, - "properties": { - "type": { - "type": "string", - "enum": [ - "dns", - "ipv4", - "ipv6", - "torv2", - "torv3" - ], - "description": "Type of connection (until 23.08, `websocket` was also allowed)" - }, - "port": { - "type": "u16", - "description": "port number" - } - }, - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "dns", - "ipv4", - "ipv6", - "torv2", - "torv3" - ] - } - } - }, - "then": { - "required": [ - "type", - "address", - "port" - ], - "additionalProperties": false, - "properties": { - "type": {}, - "port": {}, - "address": { - "type": "string", - "description": "address in expected format for **type**" - } - } - }, - "else": { - "required": [ - "type", - "port" - ], - "additionalProperties": false, - "properties": { - "type": {}, - "port": {} - } - } - } - } - } - }, - "else": { - "additionalProperties": false, - "properties": { - "nodeid": {} - } - } - }, - { - "if": { - "required": [ - "option_will_fund" - ] - }, - "then": { - "additionalProperties": true, - "required": [ - "option_will_fund" - ], - "properties": { - "option_will_fund": { - "type": "object", - "additionalProperties": false, - "required": [ - "lease_fee_base_msat", - "lease_fee_basis", - "funding_weight", - "channel_fee_max_base_msat", - "channel_fee_max_proportional_thousandths", - "compact_lease" - ], - "properties": { - "lease_fee_base_msat": { - "type": "msat", - "description": "the fixed fee for a lease (whole number of satoshis)" - }, - "lease_fee_basis": { - "type": "u32", - "description": "the proportional fee in basis points (parts per 10,000) for a lease" - }, - "funding_weight": { - "type": "u32", - "description": "the onchain weight you'll have to pay for a lease" - }, - "channel_fee_max_base_msat": { - "type": "msat", - "description": "the maximum base routing fee this node will charge during the lease" - }, - "channel_fee_max_proportional_thousandths": { - "type": "u32", - "description": "the maximum proportional routing fee this node will charge during the lease (in thousandths, not millionths like channel_update)" - }, - "compact_lease": { - "type": "hex", - "description": "the lease as represented in the node_announcement" - } - } - } - } - } - } - ] - } - } - } -} diff --git a/doc/schemas/listoffers.request.json b/doc/schemas/listoffers.request.json deleted file mode 100644 index 992820cbd72b..000000000000 --- a/doc/schemas/listoffers.request.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": { - "offer_id": { - "type": "hash", - "description": "Only return offers matching this ID" - }, - "active_only": { - "type": "boolean", - "description": "f active_only is set and is true, only offers with active true are returned." - } - } -} diff --git a/doc/schemas/listoffers.schema.json b/doc/schemas/listoffers.schema.json deleted file mode 100644 index 340bb927d00f..000000000000 --- a/doc/schemas/listoffers.schema.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "offers" - ], - "properties": { - "offers": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "offer_id", - "active", - "single_use", - "bolt12", - "used" - ], - "properties": { - "offer_id": { - "type": "hash", - "description": "the id of this offer (merkle hash of non-signature fields)" - }, - "active": { - "type": "boolean", - "description": "whether this can still be used" - }, - "single_use": { - "type": "boolean", - "description": "whether this expires as soon as it's paid" - }, - "bolt12": { - "type": "string", - "description": "the bolt12 encoding of the offer" - }, - "used": { - "type": "boolean", - "description": "True if an associated invoice has been paid" - }, - "label": { - "type": "string", - "description": "the (optional) user-specified label" - } - } - } - } - } -} diff --git a/doc/schemas/listpays.request.json b/doc/schemas/listpays.request.json deleted file mode 100644 index 50cdac247831..000000000000 --- a/doc/schemas/listpays.request.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": { - "bolt11": { - "type": "string", - "description": "bolt11 string to get the payment details" - }, - "payment_hash": { - "type": "hash", - "description": "payment hash to get the payment details" - }, - "status": { - "type": "string", - "description": "to filter the payment by status", - "enum": [ - "pending", - "complete", - "failed" - ] - } - } -} diff --git a/doc/schemas/listpays.schema.json b/doc/schemas/listpays.schema.json deleted file mode 100644 index b4aad0a33626..000000000000 --- a/doc/schemas/listpays.schema.json +++ /dev/null @@ -1,146 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "pays" - ], - "properties": { - "pays": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "payment_hash", - "status", - "created_at" - ], - "properties": { - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "status": { - "type": "string", - "enum": [ - "pending", - "failed", - "complete" - ], - "description": "status of the payment" - }, - "destination": { - "type": "pubkey", - "description": "the final destination of the payment if known" - }, - "created_at": { - "type": "u64", - "description": "the UNIX timestamp showing when this payment was initiated" - }, - "completed_at": { - "type": "u64", - "description": "the UNIX timestamp showing when this payment was completed" - }, - "label": { - "type": "string", - "description": "the label, if given to sendpay" - }, - "bolt11": { - "type": "string", - "description": "the bolt11 string (if pay supplied one)" - }, - "description": { - "type": "string", - "description": "the description matching the bolt11 description hash (if pay supplied one)" - }, - "bolt12": { - "type": "string", - "description": "the bolt12 string (if supplied for pay: **experimental-offers** only)." - } - }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "complete" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "amount_sent_msat", - "preimage" - ], - "properties": { - "payment_hash": {}, - "status": {}, - "destination": {}, - "created_at": {}, - "completed_at": {}, - "label": {}, - "bolt11": {}, - "description": {}, - "bolt12": {}, - "amount_msat": { - "type": "msat", - "description": "The amount of millisatoshi we intended to send to the destination" - }, - "amount_sent_msat": { - "type": "msat", - "description": "The amount of millisatoshi we sent in order to pay (may include fees and not match amount_msat)" - }, - "preimage": { - "type": "secret", - "description": "proof of payment" - }, - "number_of_parts": { - "type": "u64", - "description": "the number of parts for a successful payment (only if more than one)." - } - } - } - }, - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "failed" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "amount_sent_msat" - ], - "properties": { - "payment_hash": {}, - "status": {}, - "destination": {}, - "created_at": {}, - "label": {}, - "bolt11": {}, - "description": {}, - "bolt12": {}, - "amount_sent_msat": {}, - "erroronion": { - "type": "hex", - "description": "the error onion returned on failure, if any." - } - } - } - } - ] - } - } - } -} diff --git a/doc/schemas/listpeerchannels.request.json b/doc/schemas/listpeerchannels.request.json deleted file mode 100644 index ecd4b81063d9..000000000000 --- a/doc/schemas/listpeerchannels.request.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "added": "v23.02", - "properties": { - "id": { - "type": "pubkey", - "description": "If supplied, limits the channels to just the peer with the given ID, if it exists" - } - } -} diff --git a/doc/schemas/listpeerchannels.schema.json b/doc/schemas/listpeerchannels.schema.json deleted file mode 100644 index a19c5bb66834..000000000000 --- a/doc/schemas/listpeerchannels.schema.json +++ /dev/null @@ -1,1125 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "added": "v23.02", - "required": [ - "channels" - ], - "properties": { - "channels": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "state", - "opener", - "features", - "peer_connected", - "peer_id" - ], - "properties": { - "peer_id": { - "type": "pubkey", - "description": "Node Public key" - }, - "peer_connected": { - "type": "boolean", - "description": "A boolean flag that is set to true if the peer is online" - }, - "reestablished": {}, - "state": { - "type": "string", - "enum": [ - "OPENINGD", - "CHANNELD_AWAITING_LOCKIN", - "CHANNELD_NORMAL", - "CHANNELD_SHUTTING_DOWN", - "CLOSINGD_SIGEXCHANGE", - "CLOSINGD_COMPLETE", - "AWAITING_UNILATERAL", - "FUNDING_SPEND_SEEN", - "ONCHAIN", - "DUALOPEND_OPEN_INIT", - "DUALOPEND_AWAITING_LOCKIN", - "CHANNELD_AWAITING_SPLICE", - "DUALOPEND_OPEN_COMMITTED", - "DUALOPEND_OPEN_COMMIT_READY" - ], - "description": "the channel state, in particular \"CHANNELD_NORMAL\" means the channel can be used normally" - }, - "scratch_txid": { - "type": "txid", - "description": "The txid we would use if we went onchain now" - }, - "channel_type": { - "type": "object", - "description": "channel_type as negotiated with peer", - "added": "v23.05", - "additionalProperties": false, - "required": [ - "bits", - "names" - ], - "properties": { - "bits": { - "type": "array", - "description": "Each bit set in this channel_type", - "items": { - "type": "u32", - "description": "Bit number" - } - }, - "names": { - "type": "array", - "description": "Feature name for each bit set in this channel_type", - "items": { - "type": "string", - "enum": [ - "static_remotekey/even", - "anchor_outputs/even", - "anchors_zero_fee_htlc_tx/even", - "scid_alias/even", - "zeroconf/even" - ], - "description": "Name of feature bit" - } - } - } - }, - "updates": { - "type": "object", - "added": "v24.02", - "description": "Latest gossip updates sent/received", - "additionalProperties": false, - "required": [ - "local" - ], - "properties": { - "local": { - "type": "object", - "description": "Our gossip for channel", - "additionalProperties": false, - "added": "v24.02", - "required": [ - "htlc_minimum_msat", - "htlc_maximum_msat", - "cltv_expiry_delta", - "fee_base_msat", - "fee_proportional_millionths" - ], - "properties": { - "htlc_minimum_msat": { - "type": "msat", - "added": "v24.02", - "description": "Minimum msat amount we allow" - }, - "htlc_maximum_msat": { - "type": "msat", - "added": "v24.02", - "description": "Maximum msat amount we allow" - }, - "cltv_expiry_delta": { - "type": "u32", - "added": "v24.02", - "description": "Blocks delay required between incoming and outgoing HTLCs" - }, - "fee_base_msat": { - "type": "msat", - "added": "v24.02", - "description": "Amount we charge to use the channel" - }, - "fee_proportional_millionths": { - "type": "u32", - "added": "v24.02", - "description": "Amount we charge to use the channel in parts-per-million" - } - } - }, - "remote": { - "type": "object", - "added": "v24.02", - "description": "Peer's gossip for channel", - "additionalProperties": false, - "required": [ - "htlc_minimum_msat", - "htlc_maximum_msat", - "cltv_expiry_delta", - "fee_base_msat", - "fee_proportional_millionths" - ], - "properties": { - "htlc_minimum_msat": { - "type": "msat", - "added": "v24.02", - "description": "Minimum msat amount they allow" - }, - "htlc_maximum_msat": { - "type": "msat", - "added": "v24.02", - "description": "Maximum msat amount they allow" - }, - "cltv_expiry_delta": { - "type": "u32", - "added": "v24.02", - "description": "Blocks delay required between incoming and outgoing HTLCs" - }, - "fee_base_msat": { - "type": "msat", - "added": "v24.02", - "description": "Amount they charge to use the channel" - }, - "fee_proportional_millionths": { - "type": "u32", - "added": "v24.02", - "description": "Amount they charge to use the channel in parts-per-million" - } - } - } - } - }, - "ignore_fee_limits": { - "type": "boolean", - "added": "v23.08", - "description": "set if we allow this peer to set fees to anything they want" - }, - "lost_state": { - "type": "boolean", - "added": "v24.02", - "description": "set if we are fallen behind i.e. lost some channel state." - }, - "feerate": { - "type": "object", - "description": "Feerates for the current tx", - "additionalProperties": false, - "required": [ - "perkw", - "perkb" - ], - "properties": { - "perkw": { - "type": "u32", - "description": "Feerate per 1000 weight (i.e kSipa)" - }, - "perkb": { - "type": "u32", - "description": "Feerate per 1000 virtual bytes" - } - } - }, - "owner": { - "type": "string", - "description": "The current subdaemon controlling this connection" - }, - "short_channel_id": { - "type": "short_channel_id", - "description": "The short_channel_id (once locked in)" - }, - "channel_id": { - "type": "hash", - "description": "The full channel_id (funding txid Xored with output number)" - }, - "funding_txid": { - "type": "txid", - "description": "ID of the funding transaction" - }, - "funding_outnum": { - "type": "u32", - "description": "The 0-based output number of the funding transaction which opens the channel" - }, - "initial_feerate": { - "type": "string", - "description": "For inflight opens, the first feerate used to initiate the channel open" - }, - "last_feerate": { - "type": "string", - "description": "For inflight opens, the most recent feerate used on the channel open" - }, - "next_feerate": { - "type": "string", - "description": "For inflight opens, the next feerate we'll use for the channel open" - }, - "next_fee_step": { - "type": "u32", - "description": "For inflight opens, the next feerate step we'll use for the channel open" - }, - "inflight": { - "type": "array", - "description": "Current candidate funding transactions", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "funding_txid", - "funding_outnum", - "feerate", - "total_funding_msat", - "splice_amount", - "our_funding_msat" - ], - "properties": { - "funding_txid": { - "type": "txid", - "description": "ID of the funding transaction" - }, - "funding_outnum": { - "type": "u32", - "description": "The 0-based output number of the funding transaction which opens the channel" - }, - "feerate": { - "type": "string", - "description": "The feerate for this funding transaction in per-1000-weight, with \"kpw\" appended" - }, - "total_funding_msat": { - "type": "msat", - "description": "total amount in the channel" - }, - "splice_amount": { - "type": "integer", - "added": "v23.08", - "description": "The amouont of sats we're splicing in or out" - }, - "our_funding_msat": { - "type": "msat", - "description": "amount we have in the channel" - }, - "scratch_txid": { - "type": "txid", - "description": "The commitment transaction txid we would use if we went onchain now" - } - } - } - }, - "close_to": { - "type": "hex", - "description": "scriptPubkey which we have to close to if we mutual close" - }, - "private": { - "type": "boolean", - "description": "if True, we will not announce this channel" - }, - "opener": { - "type": "string", - "enum": [ - "local", - "remote" - ], - "description": "Who initiated the channel" - }, - "closer": { - "type": "string", - "enum": [ - "local", - "remote" - ], - "description": "Who initiated the channel close (only present if closing)" - }, - "features": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "option_static_remotekey", - "option_anchor_outputs", - "option_anchors_zero_fee_htlc_tx", - "option_scid_alias", - "option_zeroconf" - ], - "description": "BOLT #9 features which apply to this channel" - } - }, - "funding": { - "type": "object", - "additionalProperties": false, - "required": [ - "local_funds_msat", - "remote_funds_msat" - ], - "properties": { - "pushed_msat": { - "type": "msat", - "description": "Amount pushed from opener to peer" - }, - "local_funds_msat": { - "type": "msat", - "description": "Amount of channel we funded" - }, - "remote_funds_msat": { - "type": "msat", - "description": "Amount of channel they funded" - }, - "fee_paid_msat": { - "type": "msat", - "description": "Amount we paid peer at open" - }, - "fee_rcvd_msat": { - "type": "msat", - "description": "Amount we were paid by peer at open" - } - } - }, - "to_us_msat": { - "type": "msat", - "description": "How much of channel is owed to us" - }, - "min_to_us_msat": { - "type": "msat", - "description": "Least amount owed to us ever. If the peer were to succesfully steal from us, this is the amount we would still retain." - }, - "max_to_us_msat": { - "type": "msat", - "description": "Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get." - }, - "total_msat": { - "type": "msat", - "description": "total amount in the channel" - }, - "fee_base_msat": { - "type": "msat", - "description": "amount we charge to use the channel" - }, - "fee_proportional_millionths": { - "type": "u32", - "description": "amount we charge to use the channel in parts-per-million" - }, - "dust_limit_msat": { - "type": "msat", - "description": "Minimum amount for an output on the channel transactions" - }, - "max_total_htlc_in_msat": { - "type": "msat", - "description": "Max amount accept in a single payment" - }, - "their_reserve_msat": { - "type": "msat", - "description": "Minimum we insist they keep in channel (default is 1% of the total channel capacity). If they have less than this in the channel, they cannot send to us on that channel" - }, - "our_reserve_msat": { - "type": "msat", - "description": "Minimum they insist we keep in channel. If you have less than this in the channel, you cannot send out via this channel." - }, - "spendable_msat": { - "type": "msat", - "description": "An estimate of the total we could send through channel (can be wrong because adding HTLCs requires an increase in fees paid to onchain miners, and onchain fees change dynamically according to onchain activity)" - }, - "receivable_msat": { - "type": "msat", - "description": "An estimate of the total peer could send through channel" - }, - "minimum_htlc_in_msat": { - "type": "msat", - "description": "The minimum amount HTLC we accept" - }, - "minimum_htlc_out_msat": { - "type": "msat", - "description": "The minimum amount HTLC we will send" - }, - "maximum_htlc_out_msat": { - "type": "msat", - "description": "The maximum amount HTLC we will send" - }, - "their_to_self_delay": { - "type": "u32", - "description": "The number of blocks before they can take their funds if they unilateral close" - }, - "our_to_self_delay": { - "type": "u32", - "description": "The number of blocks before we can take our funds if we unilateral close" - }, - "max_accepted_htlcs": { - "type": "u32", - "description": "Maximum number of incoming HTLC we will accept at once" - }, - "alias": { - "type": "object", - "required": [], - "properties": { - "local": { - "type": "short_channel_id", - "description": "An alias assigned by this node to this channel, used for outgoing payments" - }, - "remote": { - "type": "short_channel_id", - "description": "An alias assigned by the remote node to this channel, usable in routehints and invoices" - } - } - }, - "state_changes": { - "type": "array", - "description": "Prior state changes", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "timestamp", - "old_state", - "new_state", - "cause", - "message" - ], - "properties": { - "timestamp": { - "type": "string", - "description": "UTC timestamp of form YYYY-mm-ddTHH:MM:SS.%03dZ" - }, - "old_state": { - "type": "string", - "enum": [ - "OPENINGD", - "CHANNELD_AWAITING_LOCKIN", - "CHANNELD_NORMAL", - "CHANNELD_SHUTTING_DOWN", - "CLOSINGD_SIGEXCHANGE", - "CLOSINGD_COMPLETE", - "AWAITING_UNILATERAL", - "FUNDING_SPEND_SEEN", - "ONCHAIN", - "DUALOPEND_OPEN_INIT", - "DUALOPEND_AWAITING_LOCKIN", - "DUALOPEND_OPEN_COMMITTED", - "DUALOPEND_OPEN_COMMIT_READY", - "CHANNELD_AWAITING_SPLICE" - ], - "description": "Previous state" - }, - "new_state": { - "type": "string", - "enum": [ - "OPENINGD", - "CHANNELD_AWAITING_LOCKIN", - "CHANNELD_NORMAL", - "CHANNELD_SHUTTING_DOWN", - "CLOSINGD_SIGEXCHANGE", - "CLOSINGD_COMPLETE", - "AWAITING_UNILATERAL", - "FUNDING_SPEND_SEEN", - "ONCHAIN", - "DUALOPEND_OPEN_INIT", - "DUALOPEND_AWAITING_LOCKIN", - "DUALOPEND_OPEN_COMMITTED", - "DUALOPEND_OPEN_COMMIT_READY", - "CHANNELD_AWAITING_SPLICE" - ], - "description": "New state" - }, - "cause": { - "type": "string", - "enum": [ - "unknown", - "local", - "user", - "remote", - "protocol", - "onchain" - ], - "description": "What caused the change" - }, - "message": { - "type": "string", - "description": "Human-readable explanation" - } - } - } - }, - "status": { - "type": "array", - "items": { - "type": "string", - "description": "Billboard log of significant changes" - } - }, - "in_payments_offered": { - "type": "u64", - "description": "Number of incoming payment attempts" - }, - "in_offered_msat": { - "type": "msat", - "description": "Total amount of incoming payment attempts" - }, - "in_payments_fulfilled": { - "type": "u64", - "description": "Number of successful incoming payment attempts" - }, - "in_fulfilled_msat": { - "type": "msat", - "description": "Total amount of successful incoming payment attempts" - }, - "out_payments_offered": { - "type": "u64", - "description": "Number of outgoing payment attempts" - }, - "out_offered_msat": { - "type": "msat", - "description": "Total amount of outgoing payment attempts" - }, - "out_payments_fulfilled": { - "type": "u64", - "description": "Number of successful outgoing payment attempts" - }, - "out_fulfilled_msat": { - "type": "msat", - "description": "Total amount of successful outgoing payment attempts" - }, - "last_stable_connection": { - "type": "u64", - "added": "v24.02", - "description": "Last time we reestablished the open channel and stayed connected for 1 minute" - }, - "htlcs": { - "type": "array", - "description": "current HTLCs in this channel", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "direction", - "id", - "amount_msat", - "expiry", - "payment_hash", - "state" - ], - "properties": { - "direction": { - "type": "string", - "enum": [ - "in", - "out" - ], - "description": "Whether it came from peer, or is going to peer" - }, - "id": { - "type": "u64", - "description": "Unique ID for this htlc on this channel in this direction" - }, - "amount_msat": { - "type": "msat", - "description": "Amount send/received for this HTLC" - }, - "expiry": { - "type": "u32", - "description": "Block this HTLC expires at (after which an `in` direction HTLC will be returned to the peer, an `out` returned to us). If this expiry is too close, lightningd(8) will automatically unilaterally close the channel in order to enforce the timeout onchain." - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the payment_preimage which will prove payment" - }, - "local_trimmed": { - "type": "boolean", - "enum": [ - true - ], - "description": "If this is too small to enforce onchain; it doesn't appear in the commitment transaction and will not be enforced in a unilateral close. Generally true if the HTLC (after subtracting onchain fees) is below the `dust_limit_msat` for the channel." - }, - "status": { - "type": "string", - "description": "set if this HTLC is currently waiting on a hook (and shows what plugin)" - } - }, - "allOf": [ - { - "if": { - "properties": { - "direction": { - "enum": [ - "out" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "state" - ], - "properties": { - "direction": {}, - "id": {}, - "amount_msat": {}, - "msatoshi": {}, - "expiry": {}, - "payment_hash": {}, - "local_trimmed": {}, - "status": {}, - "alias": {}, - "peer_id": {}, - "peer_connected": {}, - "reestablished": {}, - "state": { - "type": "string", - "enum": [ - "SENT_ADD_HTLC", - "SENT_ADD_COMMIT", - "RCVD_ADD_REVOCATION", - "RCVD_ADD_ACK_COMMIT", - "SENT_ADD_ACK_REVOCATION", - "RCVD_REMOVE_HTLC", - "RCVD_REMOVE_COMMIT", - "SENT_REMOVE_REVOCATION", - "SENT_REMOVE_ACK_COMMIT", - "RCVD_REMOVE_ACK_REVOCATION" - ], - "description": "Status of the HTLC" - } - } - } - }, - { - "if": { - "properties": { - "direction": { - "enum": [ - "in" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "state" - ], - "properties": { - "direction": {}, - "id": {}, - "amount_msat": {}, - "msatoshi": {}, - "expiry": {}, - "payment_hash": {}, - "local_trimmed": {}, - "status": {}, - "peer_id": {}, - "peer_connected": {}, - "reestablished": {}, - "state": { - "type": "string", - "enum": [ - "RCVD_ADD_HTLC", - "RCVD_ADD_COMMIT", - "SENT_ADD_REVOCATION", - "SENT_ADD_ACK_COMMIT", - "RCVD_ADD_ACK_REVOCATION", - "SENT_REMOVE_HTLC", - "SENT_REMOVE_COMMIT", - "RCVD_REMOVE_REVOCATION", - "RCVD_REMOVE_ACK_COMMIT", - "SENT_REMOVE_ACK_REVOCATION" - ], - "description": "Status of the HTLC" - } - } - } - } - ] - } - } - }, - "allOf": [ - { - "if": { - "properties": { - "peer_connected": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "properties": { - "reestablished": { - "type": "boolean", - "description": "True if we have successfully exchanged reestablish messages this connection" - } - } - } - }, - { - "if": { - "required": [ - "close_to" - ] - }, - "then": { - "additionalProperties": false, - "required": [], - "properties": { - "state": {}, - "peer_id": {}, - "peer_connected": {}, - "reestablished": {}, - "scratch_txid": {}, - "channel_type": {}, - "feerate": {}, - "ignore_fee_limits": {}, - "lost_state": {}, - "owner": {}, - "short_channel_id": {}, - "channel_id": {}, - "updates": {}, - "funding_txid": {}, - "funding_outnum": {}, - "close_to": {}, - "private": {}, - "alias": {}, - "opener": {}, - "closer": {}, - "features": {}, - "funding": {}, - "to_us_msat": {}, - "min_to_us_msat": {}, - "max_to_us_msat": {}, - "total_msat": {}, - "fee_base_msat": {}, - "fee_proportional_millionths": {}, - "dust_limit_msat": {}, - "max_total_htlc_in_msat": {}, - "their_reserve_msat": {}, - "our_reserve_msat": {}, - "spendable_msat": {}, - "receivable_msat": {}, - "minimum_htlc_in_msat": {}, - "minimum_htlc_out_msat": {}, - "maximum_htlc_out_msat": {}, - "spendable_msatoshi": {}, - "receivable_msatoshi": {}, - "their_to_self_delay": {}, - "our_to_self_delay": {}, - "max_accepted_htlcs": {}, - "msatoshi_to_us": {}, - "msatoshi_to_us_min": {}, - "msatoshi_to_us_max": {}, - "msatoshi_total": {}, - "dust_limit_satoshis": {}, - "max_htlc_value_in_flight_msat": {}, - "our_channel_reserve_satoshis": {}, - "their_channel_reserve_satoshis": {}, - "spendable_satoshis": {}, - "receivable_satoshis": {}, - "htlc_minimum_msat": {}, - "state_changes": {}, - "status": {}, - "in_payments_offered": {}, - "in_offered_msat": {}, - "in_msatoshi_offered": {}, - "in_payments_fulfilled": {}, - "in_fulfilled_msat": {}, - "in_msatoshi_fulfilled": {}, - "out_payments_offered": {}, - "out_offered_msat": {}, - "out_msatoshi_offered": {}, - "out_payments_fulfilled": {}, - "out_fulfilled_msat": {}, - "out_msatoshi_fulfilled": {}, - "last_stable_connection": {}, - "htlcs": {}, - "initial_feerate": {}, - "last_feerate": {}, - "next_feerate": {}, - "inflight": {}, - "last_tx_fee_msat": {}, - "direction": {}, - "close_to_addr": { - "type": "string", - "description": "The bitcoin address we will close to (present if close_to_addr is a standardized address)" - } - } - } - }, - { - "if": { - "required": [ - "scratch_txid" - ] - }, - "then": { - "additionalProperties": false, - "required": [ - "last_tx_fee_msat" - ], - "properties": { - "state": {}, - "peer_id": {}, - "peer_connected": {}, - "reestablished": {}, - "alias": {}, - "scratch_txid": {}, - "channel_type": {}, - "feerate": {}, - "ignore_fee_limits": {}, - "lost_state": {}, - "owner": {}, - "short_channel_id": {}, - "channel_id": {}, - "updates": {}, - "funding_txid": {}, - "funding_outnum": {}, - "inflight": {}, - "close_to": {}, - "private": {}, - "opener": {}, - "closer": {}, - "features": {}, - "funding": {}, - "to_us_msat": {}, - "min_to_us_msat": {}, - "max_to_us_msat": {}, - "total_msat": {}, - "fee_base_msat": {}, - "fee_proportional_millionths": {}, - "dust_limit_msat": {}, - "max_total_htlc_in_msat": {}, - "their_reserve_msat": {}, - "our_reserve_msat": {}, - "spendable_msat": {}, - "receivable_msat": {}, - "minimum_htlc_in_msat": {}, - "minimum_htlc_out_msat": {}, - "maximum_htlc_out_msat": {}, - "spendable_msatoshi": {}, - "receivable_msatoshi": {}, - "their_to_self_delay": {}, - "our_to_self_delay": {}, - "max_accepted_htlcs": {}, - "msatoshi_to_us": {}, - "msatoshi_to_us_min": {}, - "msatoshi_to_us_max": {}, - "msatoshi_total": {}, - "dust_limit_satoshis": {}, - "max_htlc_value_in_flight_msat": {}, - "our_channel_reserve_satoshis": {}, - "their_channel_reserve_satoshis": {}, - "spendable_satoshis": {}, - "receivable_satoshis": {}, - "htlc_minimum_msat": {}, - "state_changes": {}, - "status": {}, - "in_payments_offered": {}, - "in_offered_msat": {}, - "in_msatoshi_offered": {}, - "in_payments_fulfilled": {}, - "in_fulfilled_msat": {}, - "in_msatoshi_fulfilled": {}, - "out_payments_offered": {}, - "out_offered_msat": {}, - "out_msatoshi_offered": {}, - "out_payments_fulfilled": {}, - "out_fulfilled_msat": {}, - "out_msatoshi_fulfilled": {}, - "last_stable_connection": {}, - "htlcs": {}, - "initial_feerate": {}, - "last_feerate": {}, - "next_feerate": {}, - "close_to_addr": {}, - "direction": {}, - "last_tx_fee_msat": { - "type": "msat", - "description": "fee attached to this the current tx" - } - } - } - }, - { - "if": { - "required": [ - "short_channel_id" - ] - }, - "then": { - "additionalProperties": false, - "required": [ - "direction" - ], - "properties": { - "alias": {}, - "peer_id": {}, - "peer_connected": {}, - "reestablished": {}, - "state": {}, - "scratch_txid": {}, - "channel_type": {}, - "feerate": {}, - "ignore_fee_limits": {}, - "lost_state": {}, - "owner": {}, - "short_channel_id": {}, - "channel_id": {}, - "updates": {}, - "funding_txid": {}, - "funding_outnum": {}, - "inflight": {}, - "close_to": {}, - "private": {}, - "opener": {}, - "closer": {}, - "features": {}, - "funding": {}, - "to_us_msat": {}, - "min_to_us_msat": {}, - "max_to_us_msat": {}, - "total_msat": {}, - "fee_base_msat": {}, - "fee_proportional_millionths": {}, - "dust_limit_msat": {}, - "max_total_htlc_in_msat": {}, - "their_reserve_msat": {}, - "our_reserve_msat": {}, - "spendable_msat": {}, - "receivable_msat": {}, - "minimum_htlc_in_msat": {}, - "minimum_htlc_out_msat": {}, - "maximum_htlc_out_msat": {}, - "spendable_msatoshi": {}, - "receivable_msatoshi": {}, - "their_to_self_delay": {}, - "our_to_self_delay": {}, - "max_accepted_htlcs": {}, - "msatoshi_to_us": {}, - "msatoshi_to_us_min": {}, - "msatoshi_to_us_max": {}, - "msatoshi_total": {}, - "dust_limit_satoshis": {}, - "max_htlc_value_in_flight_msat": {}, - "our_channel_reserve_satoshis": {}, - "their_channel_reserve_satoshis": {}, - "spendable_satoshis": {}, - "receivable_satoshis": {}, - "htlc_minimum_msat": {}, - "state_changes": {}, - "status": {}, - "in_payments_offered": {}, - "in_offered_msat": {}, - "in_msatoshi_offered": {}, - "in_payments_fulfilled": {}, - "in_fulfilled_msat": {}, - "in_msatoshi_fulfilled": {}, - "out_payments_offered": {}, - "out_offered_msat": {}, - "out_msatoshi_offered": {}, - "out_payments_fulfilled": {}, - "out_fulfilled_msat": {}, - "out_msatoshi_fulfilled": {}, - "last_stable_connection": {}, - "htlcs": {}, - "initial_feerate": {}, - "last_feerate": {}, - "next_feerate": {}, - "close_to_addr": {}, - "last_tx_fee_msat": {}, - "direction": { - "type": "u32", - "description": "0 if we're the lesser node_id, 1 if we're the greater (as used in BOLT #7 channel_update)" - } - } - } - }, - { - "if": { - "required": [ - "inflight" - ] - }, - "then": { - "additionalProperties": false, - "required": [ - "initial_feerate", - "last_feerate", - "next_feerate" - ], - "properties": { - "state": {}, - "peer_id": {}, - "peer_connected": {}, - "reestablished": {}, - "scratch_txid": {}, - "channel_type": {}, - "feerate": {}, - "ignore_fee_limits": {}, - "lost_state": {}, - "owner": {}, - "alias": {}, - "short_channel_id": {}, - "channel_id": {}, - "updates": {}, - "funding_txid": {}, - "funding_outnum": {}, - "close_to": {}, - "private": {}, - "opener": {}, - "closer": {}, - "features": {}, - "funding": {}, - "to_us_msat": {}, - "min_to_us_msat": {}, - "max_to_us_msat": {}, - "total_msat": {}, - "fee_base_msat": {}, - "fee_proportional_millionths": {}, - "dust_limit_msat": {}, - "max_total_htlc_in_msat": {}, - "their_reserve_msat": {}, - "our_reserve_msat": {}, - "spendable_msat": {}, - "receivable_msat": {}, - "minimum_htlc_in_msat": {}, - "minimum_htlc_out_msat": {}, - "maximum_htlc_out_msat": {}, - "spendable_msatoshi": {}, - "receivable_msatoshi": {}, - "their_to_self_delay": {}, - "our_to_self_delay": {}, - "max_accepted_htlcs": {}, - "msatoshi_to_us": {}, - "msatoshi_to_us_min": {}, - "msatoshi_to_us_max": {}, - "msatoshi_total": {}, - "dust_limit_satoshis": {}, - "max_htlc_value_in_flight_msat": {}, - "our_channel_reserve_satoshis": {}, - "their_channel_reserve_satoshis": {}, - "spendable_satoshis": {}, - "receivable_satoshis": {}, - "htlc_minimum_msat": {}, - "state_changes": {}, - "status": {}, - "in_payments_offered": {}, - "in_offered_msat": {}, - "in_msatoshi_offered": {}, - "in_payments_fulfilled": {}, - "in_fulfilled_msat": {}, - "in_msatoshi_fulfilled": {}, - "out_payments_offered": {}, - "out_offered_msat": {}, - "out_msatoshi_offered": {}, - "out_payments_fulfilled": {}, - "out_fulfilled_msat": {}, - "out_msatoshi_fulfilled": {}, - "last_stable_connection": {}, - "htlcs": {}, - "inflight": {}, - "close_to_addr": {}, - "direction": {}, - "last_tx_fee_msat": {}, - "initial_feerate": { - "type": "string", - "description": "The feerate for the initial funding transaction in per-1000-weight, with \"kpw\" appended" - }, - "last_feerate": { - "type": "string", - "description": "The feerate for the latest funding transaction in per-1000-weight, with \"kpw\" appended" - }, - "next_feerate": { - "type": "string", - "description": "The minimum feerate for the next funding transaction in per-1000-weight, with \"kpw\" appended" - } - } - } - } - ] - } - } - } -} diff --git a/doc/schemas/listpeers.request.json b/doc/schemas/listpeers.request.json deleted file mode 100644 index 01f5bbe453cb..000000000000 --- a/doc/schemas/listpeers.request.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": { - "id": { - "type": "pubkey", - "description": "if supplied, limits the result to just the peer with the given ID, if it exists" - }, - "level": { - "type": "string", - "description": "supplying level will show log entries related to that peer at the given log level", - "enum": [ - "io", - "debug", - "info", - "unusual" - ] - } - } -} diff --git a/doc/schemas/listpeers.schema.json b/doc/schemas/listpeers.schema.json deleted file mode 100644 index e313c88b971b..000000000000 --- a/doc/schemas/listpeers.schema.json +++ /dev/null @@ -1,1134 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "peers" - ], - "properties": { - "peers": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "id", - "connected", - "num_channels" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "the public key of the peer" - }, - "connected": { - "type": "boolean", - "description": "True if the peer is currently connected" - }, - "num_channels": { - "type": "u32", - "description": "The number of channels the peer has with this node", - "added": "v23.02" - }, - "log": { - "type": "array", - "description": "if *level* is specified, logs for this peer", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "SKIPPED", - "BROKEN", - "UNUSUAL", - "INFO", - "DEBUG", - "IO_IN", - "IO_OUT" - ] - } - }, - "allOf": [ - { - "if": { - "properties": { - "type": { - "enum": [ - "SKIPPED" - ] - } - } - }, - "then": { - "type": "object", - "additionalProperties": false, - "required": [ - "num_skipped" - ], - "properties": { - "type": {}, - "num_skipped": { - "type": "u32", - "description": "number of deleted/omitted entries" - } - } - } - }, - { - "if": { - "properties": { - "type": { - "enum": [ - "BROKEN", - "UNUSUAL", - "INFO", - "DEBUG" - ] - } - } - }, - "then": { - "type": "object", - "additionalProperties": false, - "required": [ - "time", - "source", - "log", - "node_id" - ], - "properties": { - "type": {}, - "time": { - "type": "string", - "description": "UNIX timestamp with 9 decimal places" - }, - "source": { - "type": "string", - "description": "The particular logbook this was found in" - }, - "log": { - "type": "string", - "description": "The actual log message" - }, - "node_id": { - "type": "pubkey", - "description": "The peer this is associated with" - } - } - } - }, - { - "if": { - "properties": { - "type": { - "enum": [ - "IO_IN", - "IO_OUT" - ] - } - } - }, - "then": { - "type": "object", - "additionalProperties": false, - "required": [ - "time", - "source", - "log", - "node_id", - "data" - ], - "properties": { - "type": {}, - "time": { - "type": "string", - "description": "UNIX timestamp with 9 decimal places" - }, - "source": { - "type": "string", - "description": "The particular logbook this was found in" - }, - "log": { - "type": "string", - "description": "The actual log message" - }, - "node_id": { - "type": "pubkey", - "description": "The peer this is associated with" - }, - "data": { - "type": "hex", - "description": "The IO which occurred" - } - } - } - } - ] - } - }, - "channels": { - "deprecated": [ - "v23.02", - "v24.02" - ], - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "state", - "opener", - "features" - ], - "properties": { - "state": { - "type": "string", - "enum": [ - "OPENINGD", - "CHANNELD_AWAITING_LOCKIN", - "CHANNELD_NORMAL", - "CHANNELD_SHUTTING_DOWN", - "CLOSINGD_SIGEXCHANGE", - "CLOSINGD_COMPLETE", - "AWAITING_UNILATERAL", - "FUNDING_SPEND_SEEN", - "ONCHAIN", - "DUALOPEND_OPEN_INIT", - "DUALOPEND_AWAITING_LOCKIN", - "DUALOPEND_OPEN_COMMITTED", - "DUALOPEND_OPEN_COMMIT_READY" - ], - "description": "the channel state, in particular \"CHANNELD_NORMAL\" means the channel can be used normally" - }, - "scratch_txid": { - "type": "txid", - "description": "The txid we would use if we went onchain now" - }, - "feerate": { - "type": "object", - "description": "Feerates for the current tx", - "additionalProperties": false, - "required": [ - "perkw", - "perkb" - ], - "properties": { - "perkw": { - "type": "u32", - "description": "Feerate per 1000 weight (i.e kSipa)" - }, - "perkb": { - "type": "u32", - "description": "Feerate per 1000 virtual bytes" - } - } - }, - "owner": { - "type": "string", - "description": "The current subdaemon controlling this connection" - }, - "short_channel_id": { - "type": "short_channel_id", - "description": "The short_channel_id (once locked in)" - }, - "channel_id": { - "type": "hash", - "description": "The full channel_id", - "minLength": 64, - "maxLength": 64 - }, - "funding_txid": { - "type": "txid", - "description": "ID of the funding transaction" - }, - "funding_outnum": { - "type": "u32", - "description": "The 0-based output number of the funding transaction which opens the channel" - }, - "initial_feerate": { - "type": "string", - "description": "For inflight opens, the first feerate used to initiate the channel open" - }, - "last_feerate": { - "type": "string", - "description": "For inflight opens, the most recent feerate used on the channel open" - }, - "next_feerate": { - "type": "string", - "description": "For inflight opens, the next feerate we'll use for the channel open" - }, - "next_fee_step": { - "type": "u32", - "description": "For inflight opens, the next feerate step we'll use for the channel open" - }, - "inflight": { - "type": "array", - "description": "Current candidate funding transactions (only for dual-funding)", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "funding_txid", - "funding_outnum", - "feerate", - "total_funding_msat", - "our_funding_msat", - "splice_amount", - "scratch_txid" - ], - "properties": { - "funding_txid": { - "type": "txid", - "description": "ID of the funding transaction" - }, - "funding_outnum": { - "type": "u32", - "description": "The 0-based output number of the funding transaction which opens the channel" - }, - "feerate": { - "type": "string", - "description": "The feerate for this funding transaction in per-1000-weight, with \"kpw\" appended" - }, - "total_funding_msat": { - "type": "msat", - "description": "total amount in the channel" - }, - "our_funding_msat": { - "type": "msat", - "description": "amount we have in the channel" - }, - "splice_amount": { - "type": "integer", - "added": "v23.08", - "description": "The amouont of sats we're splicing in or out" - }, - "scratch_txid": { - "type": "txid", - "description": "The commitment transaction txid we would use if we went onchain now" - } - } - } - }, - "close_to": { - "type": "hex", - "description": "scriptPubkey which we have to close to if we mutual close" - }, - "private": { - "type": "boolean", - "description": "if True, we will not announce this channel" - }, - "opener": { - "type": "string", - "enum": [ - "local", - "remote" - ], - "description": "Who initiated the channel" - }, - "closer": { - "type": "string", - "enum": [ - "local", - "remote" - ], - "description": "Who initiated the channel close" - }, - "features": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "option_static_remotekey", - "option_anchor_outputs", - "option_scid_alias", - "option_zeroconf" - ], - "description": "BOLT #9 features which apply to this channel" - } - }, - "funding": { - "type": "object", - "additionalProperties": false, - "required": [ - "local_funds_msat", - "remote_funds_msat" - ], - "properties": { - "pushed_msat": { - "type": "msat", - "description": "Amount pushed from opener to peer" - }, - "local_funds_msat": { - "type": "msat", - "description": "Amount of channel we funded" - }, - "remote_funds_msat": { - "type": "msat", - "description": "Amount of channel they funded" - }, - "fee_paid_msat": { - "type": "msat", - "description": "Amount we paid peer at open" - }, - "fee_rcvd_msat": { - "type": "msat", - "description": "Amount we were paid by peer at open" - } - } - }, - "to_us_msat": { - "type": "msat", - "description": "how much of channel is owed to us" - }, - "min_to_us_msat": { - "type": "msat", - "description": "least amount owed to us ever" - }, - "max_to_us_msat": { - "type": "msat", - "description": "most amount owed to us ever" - }, - "total_msat": { - "type": "msat", - "description": "total amount in the channel" - }, - "fee_base_msat": { - "type": "msat", - "description": "amount we charge to use the channel" - }, - "fee_proportional_millionths": { - "type": "u32", - "description": "amount we charge to use the channel in parts-per-million" - }, - "dust_limit_msat": { - "type": "msat", - "description": "minimum amount for an output on the channel transactions" - }, - "max_total_htlc_in_msat": { - "type": "msat", - "description": "max amount accept in a single payment" - }, - "their_reserve_msat": { - "type": "msat", - "description": "minimum we insist they keep in channel" - }, - "our_reserve_msat": { - "type": "msat", - "description": "minimum they insist we keep in channel" - }, - "spendable_msat": { - "type": "msat", - "description": "total we could send through channel" - }, - "receivable_msat": { - "type": "msat", - "description": "total peer could send through channel" - }, - "minimum_htlc_in_msat": { - "type": "msat", - "description": "the minimum amount HTLC we accept" - }, - "minimum_htlc_out_msat": { - "type": "msat", - "description": "the minimum amount HTLC we will send" - }, - "maximum_htlc_out_msat": { - "type": "msat", - "description": "the maximum amount HTLC we will send" - }, - "their_to_self_delay": { - "type": "u32", - "description": "the number of blocks before they can take their funds if they unilateral close" - }, - "our_to_self_delay": { - "type": "u32", - "description": "the number of blocks before we can take our funds if we unilateral close" - }, - "max_accepted_htlcs": { - "type": "u32", - "description": "Maximum number of incoming HTLC we will accept at once" - }, - "alias": { - "type": "object", - "required": [], - "properties": { - "local": { - "type": "short_channel_id", - "description": "An alias assigned by this node to this channel, used for outgoing payments" - }, - "remote": { - "type": "short_channel_id", - "description": "An alias assigned by the remote node to this channel, usable in routehints and invoices" - } - } - }, - "state_changes": { - "type": "array", - "description": "Prior state changes", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "timestamp", - "old_state", - "new_state", - "cause", - "message" - ], - "properties": { - "timestamp": { - "type": "string", - "description": "UTC timestamp of form YYYY-mm-ddTHH:MM:SS.%03dZ" - }, - "old_state": { - "type": "string", - "enum": [ - "OPENINGD", - "CHANNELD_AWAITING_LOCKIN", - "CHANNELD_NORMAL", - "CHANNELD_SHUTTING_DOWN", - "CLOSINGD_SIGEXCHANGE", - "CLOSINGD_COMPLETE", - "AWAITING_UNILATERAL", - "FUNDING_SPEND_SEEN", - "ONCHAIN", - "DUALOPEND_OPEN_INIT", - "DUALOPEND_AWAITING_LOCKIN", - "DUALOPEND_OPEN_COMMITTED", - "DUALOPEND_OPEN_COMMIT_READY" - ], - "description": "Previous state" - }, - "new_state": { - "type": "string", - "enum": [ - "OPENINGD", - "CHANNELD_AWAITING_LOCKIN", - "CHANNELD_NORMAL", - "CHANNELD_SHUTTING_DOWN", - "CLOSINGD_SIGEXCHANGE", - "CLOSINGD_COMPLETE", - "AWAITING_UNILATERAL", - "FUNDING_SPEND_SEEN", - "ONCHAIN", - "DUALOPEND_OPEN_INIT", - "DUALOPEND_AWAITING_LOCKIN", - "DUALOPEND_OPEN_COMMITTED", - "DUALOPEND_OPEN_COMMIT_READY" - ], - "description": "New state" - }, - "cause": { - "type": "string", - "enum": [ - "unknown", - "local", - "user", - "remote", - "protocol", - "onchain" - ], - "description": "What caused the change" - }, - "message": { - "type": "string", - "description": "Human-readable explanation" - } - } - } - }, - "status": { - "type": "array", - "items": { - "type": "string", - "description": "Billboard log of significant changes" - } - }, - "in_payments_offered": { - "type": "u64", - "description": "Number of incoming payment attempts" - }, - "in_offered_msat": { - "type": "msat", - "description": "Total amount of incoming payment attempts" - }, - "in_payments_fulfilled": { - "type": "u64", - "description": "Number of successful incoming payment attempts" - }, - "in_fulfilled_msat": { - "type": "msat", - "description": "Total amount of successful incoming payment attempts" - }, - "out_payments_offered": { - "type": "u64", - "description": "Number of outgoing payment attempts" - }, - "out_offered_msat": { - "type": "msat", - "description": "Total amount of outgoing payment attempts" - }, - "out_payments_fulfilled": { - "type": "u64", - "description": "Number of successful outgoing payment attempts" - }, - "out_fulfilled_msat": { - "type": "msat", - "description": "Total amount of successful outgoing payment attempts" - }, - "htlcs": { - "type": "array", - "description": "current HTLCs in this channel", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "direction", - "id", - "amount_msat", - "expiry", - "payment_hash", - "state" - ], - "properties": { - "direction": { - "type": "string", - "enum": [ - "in", - "out" - ], - "description": "Whether it came from peer, or is going to peer" - }, - "id": { - "type": "u64", - "description": "Unique ID for this htlc on this channel in this direction" - }, - "amount_msat": { - "type": "msat", - "description": "Amount send/received for this HTLC" - }, - "expiry": { - "type": "u32", - "description": "Block this HTLC expires at" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the payment_preimage which will prove payment", - "maxLength": 64, - "minLength": 64 - }, - "local_trimmed": { - "type": "boolean", - "enum": [ - true - ], - "description": "if this is too small to enforce onchain" - }, - "status": { - "type": "string", - "description": "set if this HTLC is currently waiting on a hook (and shows what plugin)" - } - }, - "allOf": [ - { - "if": { - "properties": { - "direction": { - "enum": [ - "out" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "state" - ], - "properties": { - "direction": {}, - "id": {}, - "amount_msat": {}, - "msatoshi": {}, - "expiry": {}, - "payment_hash": {}, - "local_trimmed": {}, - "status": {}, - "alias": {}, - "state": { - "type": "string", - "enum": [ - "SENT_ADD_HTLC", - "SENT_ADD_COMMIT", - "RCVD_ADD_REVOCATION", - "RCVD_ADD_ACK_COMMIT", - "SENT_ADD_ACK_REVOCATION", - "RCVD_REMOVE_HTLC", - "RCVD_REMOVE_COMMIT", - "SENT_REMOVE_REVOCATION", - "SENT_REMOVE_ACK_COMMIT", - "RCVD_REMOVE_ACK_REVOCATION" - ], - "description": "Status of the HTLC" - } - } - } - }, - { - "if": { - "properties": { - "direction": { - "enum": [ - "in" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "state" - ], - "properties": { - "direction": {}, - "id": {}, - "amount_msat": {}, - "msatoshi": {}, - "expiry": {}, - "payment_hash": {}, - "local_trimmed": {}, - "status": {}, - "state": { - "type": "string", - "enum": [ - "RCVD_ADD_HTLC", - "RCVD_ADD_COMMIT", - "SENT_ADD_REVOCATION", - "SENT_ADD_ACK_COMMIT", - "RCVD_ADD_ACK_REVOCATION", - "SENT_REMOVE_HTLC", - "SENT_REMOVE_COMMIT", - "RCVD_REMOVE_REVOCATION", - "RCVD_REMOVE_ACK_COMMIT", - "SENT_REMOVE_ACK_REVOCATION" - ], - "description": "Status of the HTLC" - } - } - } - } - ] - } - } - }, - "allOf": [ - { - "if": { - "required": [ - "close_to" - ] - }, - "then": { - "additionalProperties": false, - "required": [], - "properties": { - "state": {}, - "scratch_txid": {}, - "feerate": {}, - "owner": {}, - "short_channel_id": {}, - "channel_id": {}, - "funding_txid": {}, - "funding_outnum": {}, - "close_to": {}, - "private": {}, - "alias": {}, - "opener": {}, - "closer": {}, - "features": {}, - "funding": {}, - "to_us_msat": {}, - "min_to_us_msat": {}, - "max_to_us_msat": {}, - "total_msat": {}, - "fee_base_msat": {}, - "fee_proportional_millionths": {}, - "dust_limit_msat": {}, - "max_total_htlc_in_msat": {}, - "their_reserve_msat": {}, - "our_reserve_msat": {}, - "spendable_msat": {}, - "receivable_msat": {}, - "minimum_htlc_in_msat": {}, - "minimum_htlc_out_msat": {}, - "maximum_htlc_out_msat": {}, - "spendable_msatoshi": {}, - "receivable_msatoshi": {}, - "their_to_self_delay": {}, - "our_to_self_delay": {}, - "max_accepted_htlcs": {}, - "msatoshi_to_us": {}, - "msatoshi_to_us_min": {}, - "msatoshi_to_us_max": {}, - "msatoshi_total": {}, - "dust_limit_satoshis": {}, - "max_htlc_value_in_flight_msat": {}, - "our_channel_reserve_satoshis": {}, - "their_channel_reserve_satoshis": {}, - "spendable_satoshis": {}, - "receivable_satoshis": {}, - "htlc_minimum_msat": {}, - "state_changes": {}, - "status": {}, - "in_payments_offered": {}, - "in_offered_msat": {}, - "in_msatoshi_offered": {}, - "in_payments_fulfilled": {}, - "in_fulfilled_msat": {}, - "in_msatoshi_fulfilled": {}, - "out_payments_offered": {}, - "out_offered_msat": {}, - "out_msatoshi_offered": {}, - "out_payments_fulfilled": {}, - "out_fulfilled_msat": {}, - "out_msatoshi_fulfilled": {}, - "htlcs": {}, - "initial_feerate": {}, - "last_feerate": {}, - "next_feerate": {}, - "inflight": {}, - "last_tx_fee_msat": {}, - "direction": {}, - "close_to_addr": { - "type": "string", - "description": "The bitcoin address we will close to" - } - } - } - }, - { - "if": { - "required": [ - "scratch_txid" - ] - }, - "then": { - "additionalProperties": false, - "required": [ - "last_tx_fee_msat" - ], - "properties": { - "state": {}, - "alias": {}, - "scratch_txid": {}, - "feerate": {}, - "owner": {}, - "short_channel_id": {}, - "channel_id": {}, - "funding_txid": {}, - "funding_outnum": {}, - "inflight": {}, - "close_to": {}, - "private": {}, - "opener": {}, - "closer": {}, - "features": {}, - "funding": {}, - "to_us_msat": {}, - "min_to_us_msat": {}, - "max_to_us_msat": {}, - "total_msat": {}, - "fee_base_msat": {}, - "fee_proportional_millionths": {}, - "dust_limit_msat": {}, - "max_total_htlc_in_msat": {}, - "their_reserve_msat": {}, - "our_reserve_msat": {}, - "spendable_msat": {}, - "receivable_msat": {}, - "minimum_htlc_in_msat": {}, - "minimum_htlc_out_msat": {}, - "maximum_htlc_out_msat": {}, - "spendable_msatoshi": {}, - "receivable_msatoshi": {}, - "their_to_self_delay": {}, - "our_to_self_delay": {}, - "max_accepted_htlcs": {}, - "msatoshi_to_us": {}, - "msatoshi_to_us_min": {}, - "msatoshi_to_us_max": {}, - "msatoshi_total": {}, - "dust_limit_satoshis": {}, - "max_htlc_value_in_flight_msat": {}, - "our_channel_reserve_satoshis": {}, - "their_channel_reserve_satoshis": {}, - "spendable_satoshis": {}, - "receivable_satoshis": {}, - "htlc_minimum_msat": {}, - "state_changes": {}, - "status": {}, - "in_payments_offered": {}, - "in_offered_msat": {}, - "in_msatoshi_offered": {}, - "in_payments_fulfilled": {}, - "in_fulfilled_msat": {}, - "in_msatoshi_fulfilled": {}, - "out_payments_offered": {}, - "out_offered_msat": {}, - "out_msatoshi_offered": {}, - "out_payments_fulfilled": {}, - "out_fulfilled_msat": {}, - "out_msatoshi_fulfilled": {}, - "htlcs": {}, - "initial_feerate": {}, - "last_feerate": {}, - "next_feerate": {}, - "close_to_addr": {}, - "direction": {}, - "last_tx_fee_msat": { - "type": "msat", - "description": "fee attached to this the current tx" - } - } - } - }, - { - "if": { - "required": [ - "short_channel_id" - ] - }, - "then": { - "additionalProperties": false, - "required": [ - "direction" - ], - "properties": { - "alias": {}, - "state": {}, - "scratch_txid": {}, - "feerate": {}, - "owner": {}, - "short_channel_id": {}, - "channel_id": {}, - "funding_txid": {}, - "funding_outnum": {}, - "inflight": {}, - "close_to": {}, - "private": {}, - "opener": {}, - "closer": {}, - "features": {}, - "funding": {}, - "to_us_msat": {}, - "min_to_us_msat": {}, - "max_to_us_msat": {}, - "total_msat": {}, - "fee_base_msat": {}, - "fee_proportional_millionths": {}, - "dust_limit_msat": {}, - "max_total_htlc_in_msat": {}, - "their_reserve_msat": {}, - "our_reserve_msat": {}, - "spendable_msat": {}, - "receivable_msat": {}, - "minimum_htlc_in_msat": {}, - "minimum_htlc_out_msat": {}, - "maximum_htlc_out_msat": {}, - "spendable_msatoshi": {}, - "receivable_msatoshi": {}, - "their_to_self_delay": {}, - "our_to_self_delay": {}, - "max_accepted_htlcs": {}, - "msatoshi_to_us": {}, - "msatoshi_to_us_min": {}, - "msatoshi_to_us_max": {}, - "msatoshi_total": {}, - "dust_limit_satoshis": {}, - "max_htlc_value_in_flight_msat": {}, - "our_channel_reserve_satoshis": {}, - "their_channel_reserve_satoshis": {}, - "spendable_satoshis": {}, - "receivable_satoshis": {}, - "htlc_minimum_msat": {}, - "state_changes": {}, - "status": {}, - "in_payments_offered": {}, - "in_offered_msat": {}, - "in_msatoshi_offered": {}, - "in_payments_fulfilled": {}, - "in_fulfilled_msat": {}, - "in_msatoshi_fulfilled": {}, - "out_payments_offered": {}, - "out_offered_msat": {}, - "out_msatoshi_offered": {}, - "out_payments_fulfilled": {}, - "out_fulfilled_msat": {}, - "out_msatoshi_fulfilled": {}, - "htlcs": {}, - "initial_feerate": {}, - "last_feerate": {}, - "next_feerate": {}, - "close_to_addr": {}, - "last_tx_fee_msat": {}, - "direction": { - "type": "u32", - "description": "0 if we're the lesser node_id, 1 if we're the greater" - } - } - } - }, - { - "if": { - "required": [ - "inflight" - ] - }, - "then": { - "additionalProperties": false, - "required": [ - "initial_feerate", - "last_feerate", - "next_feerate" - ], - "properties": { - "state": {}, - "scratch_txid": {}, - "feerate": {}, - "owner": {}, - "alias": {}, - "short_channel_id": {}, - "channel_id": {}, - "funding_txid": {}, - "funding_outnum": {}, - "close_to": {}, - "private": {}, - "opener": {}, - "closer": {}, - "features": {}, - "funding": {}, - "to_us_msat": {}, - "min_to_us_msat": {}, - "max_to_us_msat": {}, - "total_msat": {}, - "fee_base_msat": {}, - "fee_proportional_millionths": {}, - "dust_limit_msat": {}, - "max_total_htlc_in_msat": {}, - "their_reserve_msat": {}, - "our_reserve_msat": {}, - "spendable_msat": {}, - "receivable_msat": {}, - "minimum_htlc_in_msat": {}, - "minimum_htlc_out_msat": {}, - "maximum_htlc_out_msat": {}, - "spendable_msatoshi": {}, - "receivable_msatoshi": {}, - "their_to_self_delay": {}, - "our_to_self_delay": {}, - "max_accepted_htlcs": {}, - "msatoshi_to_us": {}, - "msatoshi_to_us_min": {}, - "msatoshi_to_us_max": {}, - "msatoshi_total": {}, - "dust_limit_satoshis": {}, - "max_htlc_value_in_flight_msat": {}, - "our_channel_reserve_satoshis": {}, - "their_channel_reserve_satoshis": {}, - "spendable_satoshis": {}, - "receivable_satoshis": {}, - "htlc_minimum_msat": {}, - "state_changes": {}, - "status": {}, - "in_payments_offered": {}, - "in_offered_msat": {}, - "in_msatoshi_offered": {}, - "in_payments_fulfilled": {}, - "in_fulfilled_msat": {}, - "in_msatoshi_fulfilled": {}, - "out_payments_offered": {}, - "out_offered_msat": {}, - "out_msatoshi_offered": {}, - "out_payments_fulfilled": {}, - "out_fulfilled_msat": {}, - "out_msatoshi_fulfilled": {}, - "htlcs": {}, - "inflight": {}, - "close_to_addr": {}, - "direction": {}, - "last_tx_fee_msat": {}, - "initial_feerate": { - "type": "string", - "description": "The feerate for the initial funding transaction in per-1000-weight, with \"kpw\" appended" - }, - "last_feerate": { - "type": "string", - "description": "The feerate for the latest funding transaction in per-1000-weight, with \"kpw\" appended" - }, - "next_feerate": { - "type": "string", - "description": "The minimum feerate for the next funding transaction in per-1000-weight, with \"kpw\" appended" - } - } - } - } - ] - } - } - }, - "allOf": [ - { - "if": { - "additionalProperties": true, - "properties": { - "connected": { - "enum": [ - true - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "netaddr", - "features" - ], - "properties": { - "id": {}, - "channels": {}, - "connected": {}, - "num_channels": {}, - "htlcs": {}, - "log": {}, - "netaddr": { - "type": "array", - "minItems": 1, - "maxItems": 1, - "description": "A single entry array", - "items": { - "type": "string", - "description": "address, e.g. 1.2.3.4:1234" - } - }, - "remote_addr": { - "type": "string", - "description": "The public IPv4/6 address the peer sees us from, e.g. 1.2.3.4:1234" - }, - "features": { - "type": "hex", - "description": "bitmap of BOLT #9 features from peer's INIT message" - } - } - } - } - ] - } - } - } -} diff --git a/doc/schemas/listsendpays.request.json b/doc/schemas/listsendpays.request.json deleted file mode 100644 index 701f6a76efd9..000000000000 --- a/doc/schemas/listsendpays.request.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": { - "bolt11": { - "type": "string", - "description": "bolt11 invoice" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the payment_preimage" - }, - "status": { - "type": "string", - "enum": [ - "pending", - "complete", - "failed" - ], - "description": "Whether the invoice has been paid, pending, or failed" - }, - "index": { - "type": "string", - "added": "v23.11", - "enum": [ - "created", - "updated" - ], - "description": "if neither bolt11 or payment_hash is specified, `index` controls ordering, by `created` (default) or `updated`" - }, - "start": { - "type": "u64", - "added": "v23.11", - "description": "if `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)" - }, - "limit": { - "type": "u32", - "added": "v23.11", - "description": "if `index` is specified, `limit` can be used to specify the maximum number of entries to return" - } - } -} diff --git a/doc/schemas/listsendpays.schema.json b/doc/schemas/listsendpays.schema.json deleted file mode 100644 index 5162829ce367..000000000000 --- a/doc/schemas/listsendpays.schema.json +++ /dev/null @@ -1,214 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "payments" - ], - "properties": { - "payments": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "id", - "created_index", - "payment_hash", - "status", - "groupid", - "created_at", - "amount_sent_msat" - ], - "properties": { - "created_index": { - "added": "v23.11", - "type": "u64", - "description": "1-based index indicating order this payment was created in" - }, - "id": { - "type": "u64", - "description": "old synonym for created_index" - }, - "groupid": { - "type": "u64", - "description": "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash" - }, - "partid": { - "type": "u64", - "description": "Part number (for multiple parts to a single payment)" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "updated_index": { - "added": "v23.11", - "type": "u64", - "description": "1-based index indicating order this payment was changed (only present if it has changed since creation)" - }, - "status": { - "type": "string", - "enum": [ - "pending", - "failed", - "complete" - ], - "description": "status of the payment" - }, - "amount_msat": { - "type": "msat", - "description": "The amount delivered to destination (if known)" - }, - "destination": { - "type": "pubkey", - "description": "the final destination of the payment if known" - }, - "created_at": { - "type": "u64", - "description": "the UNIX timestamp showing when this payment was initiated" - }, - "amount_sent_msat": { - "type": "msat", - "description": "The amount sent" - }, - "label": { - "type": "string", - "description": "the label, if given to sendpay" - }, - "bolt11": { - "type": "string", - "description": "the bolt11 string (if pay supplied one)" - }, - "description": { - "type": "string", - "description": "the description matching the bolt11 description hash (if pay supplied one)" - }, - "bolt12": { - "type": "string", - "description": "the bolt12 string (if supplied for pay: **experimental-offers** only)." - } - }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "complete" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "payment_preimage" - ], - "properties": { - "id": {}, - "created_index": {}, - "updated_index": {}, - "partid": {}, - "groupid": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "destination": {}, - "created_at": {}, - "completed_at": {}, - "msatoshi_sent": {}, - "amount_sent_msat": {}, - "label": {}, - "bolt11": {}, - "description": {}, - "bolt12": {}, - "payment_preimage": { - "type": "secret", - "description": "the proof of payment: SHA256 of this **payment_hash**" - } - } - } - }, - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "failed" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [], - "properties": { - "id": {}, - "created_index": {}, - "updated_index": {}, - "partid": {}, - "groupid": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "destination": {}, - "created_at": {}, - "completed_at": {}, - "msatoshi_sent": {}, - "amount_sent_msat": {}, - "label": {}, - "bolt11": {}, - "description": {}, - "bolt12": {}, - "erroronion": { - "type": "hex", - "description": "the onion message returned" - } - } - } - }, - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "pending" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [], - "properties": { - "id": {}, - "created_index": {}, - "updated_index": {}, - "partid": {}, - "groupid": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "destination": {}, - "created_at": {}, - "msatoshi_sent": {}, - "amount_sent_msat": {}, - "label": {}, - "bolt11": {}, - "description": {}, - "bolt12": {} - } - } - } - ] - } - } - } -} diff --git a/doc/schemas/listsqlschemas.request.json b/doc/schemas/listsqlschemas.request.json deleted file mode 100644 index a1b83e4d867e..000000000000 --- a/doc/schemas/listsqlschemas.request.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "added": "v23.02", - "properties": { - "table": { - "type": "string" - } - } -} diff --git a/doc/schemas/listsqlschemas.schema.json b/doc/schemas/listsqlschemas.schema.json deleted file mode 100644 index def50479caac..000000000000 --- a/doc/schemas/listsqlschemas.schema.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "schemas" - ], - "properties": { - "schemas": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "tablename", - "columns" - ], - "properties": { - "tablename": { - "type": "string", - "description": "the name of the table" - }, - "columns": { - "type": "array", - "description": "the columns, in database order", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "name", - "type" - ], - "properties": { - "name": { - "type": "string", - "description": "the name of the column" - }, - "type": { - "type": "string", - "enum": [ - "INTEGER", - "BLOB", - "TEXT", - "REAL" - ], - "description": "the SQL type of the column" - } - } - } - }, - "indices": { - "type": "array", - "description": "Any index we created to speed lookups", - "items": { - "type": "array", - "description": "The columns for this index", - "items": { - "type": "string", - "description": "The column name" - } - } - } - } - } - } - } -} diff --git a/doc/schemas/listtransactions.request.json b/doc/schemas/listtransactions.request.json deleted file mode 100644 index f99496c5ac84..000000000000 --- a/doc/schemas/listtransactions.request.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": {} -} diff --git a/doc/schemas/listtransactions.schema.json b/doc/schemas/listtransactions.schema.json deleted file mode 100644 index 067e139e17ad..000000000000 --- a/doc/schemas/listtransactions.schema.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "transactions" - ], - "properties": { - "transactions": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "hash", - "rawtx", - "blockheight", - "txindex", - "locktime", - "version", - "inputs", - "outputs" - ], - "properties": { - "hash": { - "type": "txid", - "description": "the transaction id" - }, - "rawtx": { - "type": "hex", - "description": "the raw transaction" - }, - "blockheight": { - "type": "u32", - "description": "the block height of this tx" - }, - "txindex": { - "type": "u32", - "description": "the transaction number within the block" - }, - "locktime": { - "type": "u32", - "description": "The nLocktime for this tx" - }, - "version": { - "type": "u32", - "description": "The nVersion for this tx" - }, - "inputs": { - "type": "array", - "description": "Each input, in order", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "txid", - "index", - "sequence" - ], - "properties": { - "txid": { - "type": "txid", - "description": "the transaction id spent" - }, - "index": { - "type": "u32", - "description": "the output spent" - }, - "sequence": { - "type": "u32", - "description": "the nSequence value" - } - } - } - }, - "outputs": { - "type": "array", - "description": "Each output, in order", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "index", - "amount_msat", - "scriptPubKey" - ], - "properties": { - "index": { - "type": "u32", - "description": "the 0-based output number" - }, - "amount_msat": { - "type": "msat", - "description": "the amount of the output" - }, - "scriptPubKey": { - "type": "hex", - "description": "the scriptPubKey" - } - } - } - } - } - } - } - } -} diff --git a/doc/schemas/makesecret.request.json b/doc/schemas/makesecret.request.json deleted file mode 100644 index 54d6fef91d11..000000000000 --- a/doc/schemas/makesecret.request.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "hex": { - "type": "hex", - "description": "One of `hex` or `string` must be specified: `hex` can be any hex data" - }, - "string": { - "type": "string", - "description": "One of `hex` or `string` must be specified: `string` is a UTF-8 string interpreted literally" - } - } -} diff --git a/doc/schemas/makesecret.schema.json b/doc/schemas/makesecret.schema.json deleted file mode 100644 index b9b8ff50808c..000000000000 --- a/doc/schemas/makesecret.schema.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "secret" - ], - "properties": { - "secret": { - "type": "secret", - "description": "the pseudorandom key derived from HSM_secret" - } - } -} diff --git a/doc/schemas/multifundchannel.request.json b/doc/schemas/multifundchannel.request.json deleted file mode 100644 index eda8445c4c4b..000000000000 --- a/doc/schemas/multifundchannel.request.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "destinations" - ], - "properties": { - "destinations": { - "type": "array", - "description": "there must be at least one entry in *destinations*; it cannot be an empty array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "amount" - ], - "properties": { - "id": { - "type": "string", - "description": "node ID, with an optional *@host:port* appended to it in a manner understood by **connect**; see lightning-connect(7). Each entry in the *destinations* array must have a unique node *id*. If not already connected, **multifundchannel** will automatically attempt to connect to the node" - }, - "amount": { - "type": "msat", - "description": "amount in satoshis taken from the internal wallet to fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). The string *all* can be used to specify all available funds (or 16,777,215 satoshi if more is available and large channels were not negotiated with the peer). Otherwise it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The value cannot be less than the dust limit, currently 546 satoshi as of this writing, nor more than 16,777,215 satoshi (unless large channels were negotiated with the peer)" - }, - "announce": { - "type": "boolean", - "description": "flag that indicates whether to announce the channel with this, default `true`. If set to `false`, the channel is unpublished" - }, - "push_msat": { - "type": "msat", - "description": "amount of millisatoshis to outright give to the node. This is a gift to the peer, and you do not get a proof-of-payment out of this" - }, - "close_to": { - "type": "string", - "description": "bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script` Returns `close_to` set to closing script iff is negotiated" - }, - "request_amt": { - "type": "msat", - "description": "amount of liquidity you'd like to lease from peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*" - }, - "compact_lease": { - "type": "string", - "description": "compact represenation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel to this destination" - }, - "mindepth": { - "type": "u32", - "description": "number of confirmations before we consider the channel active" - }, - "reserve": { - "type": "msat", - "description": "amount we want the peer to maintain on its side of the channel. Default is 1% of the funding amount. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" - } - } - } - }, - "feerate": { - "type": "feerate", - "description": "feerate used for the opening transaction, and if *commitment_feerate* is not set, as initial feerate for commitment and HTLC transactions. See NOTES in lightning-feerates(7) for possible values. The default is *normal*" - }, - "minconf": { - "type": "integer", - "description": "minimum number of confirmations that used outputs should have. Default is 1", - "default": 1 - }, - "utxos": { - "type": "array", - "items": { - "type": "outpoint", - "description": "utxos to be used to fund the channel, as an array of `txid:vout`" - } - }, - "minchannels": { - "type": "integer", - "description": "re-attempt funding as long as at least this many peers remain (must not be zero). The **multifundchannel** command will only fail if too many peers fail the funding process" - }, - "commitment_feerate": { - "type": "feerate", - "description": "initial feerate for commitment and HTLC transactions. See *feerate* for valid values" - } - } -} diff --git a/doc/schemas/multifundchannel.schema.json b/doc/schemas/multifundchannel.schema.json deleted file mode 100644 index 834afcf29de3..000000000000 --- a/doc/schemas/multifundchannel.schema.json +++ /dev/null @@ -1,141 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "tx", - "txid", - "channel_ids" - ], - "properties": { - "tx": { - "type": "hex", - "description": "The raw transaction which funded the channel" - }, - "txid": { - "type": "txid", - "description": "The txid of the transaction which funded the channel" - }, - "channel_ids": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "channel_id", - "channel_type", - "outnum" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "The peer we opened the channel with" - }, - "outnum": { - "type": "u32", - "description": "The 0-based output index showing which output funded the channel" - }, - "channel_id": { - "type": "hex", - "description": "The channel_id of the resulting channel", - "minLength": 64, - "maxLength": 64 - }, - "channel_type": { - "type": "object", - "description": "channel_type as negotiated with peer", - "added": "v24.02", - "additionalProperties": false, - "required": [ - "bits", - "names" - ], - "properties": { - "bits": { - "type": "array", - "description": "Each bit set in this channel_type", - "added": "v24.02", - "items": { - "type": "u32", - "description": "Bit number" - } - }, - "names": { - "type": "array", - "description": "Feature name for each bit set in this channel_type", - "added": "v24.02", - "items": { - "type": "string", - "enum": [ - "static_remotekey/even", - "anchor_outputs/even", - "anchors_zero_fee_htlc_tx/even", - "scid_alias/even", - "zeroconf/even" - ], - "description": "Name of feature bit" - } - } - } - }, - "close_to": { - "type": "hex", - "description": "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`" - } - } - } - }, - "failed": { - "type": "array", - "description": "any peers we failed to open with (if *minchannels* was specified less than the number of destinations)", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "method", - "error" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "The peer we failed to open the channel with" - }, - "method": { - "type": "string", - "enum": [ - "connect", - "openchannel_init", - "fundchannel_start", - "fundchannel_complete" - ], - "description": "What stage we failed at" - }, - "error": { - "type": "object", - "additionalProperties": false, - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "integer", - "description": "JSON error code from failing stage" - }, - "message": { - "type": "string", - "description": "Message from stage" - }, - "data": { - "untyped": true, - "description": "Additional error data" - } - } - } - } - } - } - } -} diff --git a/doc/schemas/multiwithdraw.request.json b/doc/schemas/multiwithdraw.request.json deleted file mode 100644 index 5085cbbb774d..000000000000 --- a/doc/schemas/multiwithdraw.request.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "outputs" - ], - "properties": { - "outputs": { - "type": "array", - "items": { - "type": "outputdesc" - }, - "description": "an array containing objects of the form `{address: amount}`. The `amount` may be the string *all*, indicating that all onchain funds be sent to the specified address. Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" - }, - "feerate": { - "type": "feerate", - "description": "feerate used for the withdrawals. See NOTES in lightning-feerates(7) for possible values. The default is *normal*" - }, - "minconf": { - "type": "u32", - "description": "minimum number of confirmations that used outputs should have. Default is 1", - "default": 1 - }, - "utxos": { - "type": "array", - "items": { - "type": "outpoint", - "description": "utxos to be used to be withdrawn from, as an array of `txid:vout`. These must be drawn from the node's available UTXO set" - } - } - } -} diff --git a/doc/schemas/multiwithdraw.schema.json b/doc/schemas/multiwithdraw.schema.json deleted file mode 100644 index d3c831d17544..000000000000 --- a/doc/schemas/multiwithdraw.schema.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "tx", - "txid" - ], - "properties": { - "tx": { - "type": "hex", - "description": "The raw transaction which was sent" - }, - "txid": { - "type": "txid", - "description": "The txid of the **tx**" - } - } -} diff --git a/doc/schemas/newaddr.request.json b/doc/schemas/newaddr.request.json deleted file mode 100644 index b5089932f144..000000000000 --- a/doc/schemas/newaddr.request.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": { - "addresstype": { - "type": "string", - "description": "it specifies the type of address wanted; currently *bech32* (e.g. `tb1qu9j4lg5f9rgjyfhvfd905vw46eg39czmktxqgg` on bitcoin testnet or `bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej` on bitcoin mainnet), or *p2tr* taproot addresses. The special value *all* generates all known address types for the same underlying key. Defaults to *bech32* address", - "enum": [ - "bech32", - "p2tr", - "all" - ] - } - } -} diff --git a/doc/schemas/newaddr.schema.json b/doc/schemas/newaddr.schema.json deleted file mode 100644 index ab4917b3a4e8..000000000000 --- a/doc/schemas/newaddr.schema.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "p2tr": { - "added": "v23.08", - "type": "string", - "description": "The taproot address" - }, - "bech32": { - "type": "string", - "description": "The bech32 (native segwit) address" - } - } -} diff --git a/doc/schemas/notifications.request.json b/doc/schemas/notifications.request.json deleted file mode 100644 index 3542605b2322..000000000000 --- a/doc/schemas/notifications.request.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "enable" - ], - "properties": { - "enable": { - "type": "boolean", - "description": "whether to enable or disable notifications" - } - } -} diff --git a/doc/schemas/notifications.schema.json b/doc/schemas/notifications.schema.json deleted file mode 100644 index 1aad2dcae935..000000000000 --- a/doc/schemas/notifications.schema.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "properties": {} -} diff --git a/doc/schemas/offer.request.json b/doc/schemas/offer.request.json deleted file mode 100644 index 1aeb206695ea..000000000000 --- a/doc/schemas/offer.request.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "amount", - "description" - ], - "properties": { - "amount": { - "type": "string", - "description": "The amount parameter can be the string \"any\", which creates an offer that can be paid with any amount (e.g. a donation). Otherwise it can be a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in msat or sat, or a number with three decimal places ending in sat, or a number with 1 to 11 decimal places ending in btc. `amount` can also have an ISO 4217 postfix (i.e. USD), in which case currency conversion will need to be done for the invoice itself. A plugin is needed which provides the \"currencyconvert\" API for this currency, otherwise the offer creation will fail." - }, - "description": { - "type": "string", - "description": "a short description of purpose of the offer" - }, - "issuer": { - "type": "string", - "description": "who is issuing this offer" - }, - "label": { - "type": "string", - "description": "an internal-use name for the offer" - }, - "quantity_max": { - "type": "u64", - "description": "specifies the number of items up (and including) this maximum" - }, - "absolute_expiry": { - "type": "u64", - "description": "the time the offer is valid until, in seconds since the first day of 1970 UTC" - }, - "recurrence": { - "type": "string", - "description": "A recurrence period with unit (matches '[0-9]+(seconds|minutes|hours|days|weeks|months|years)' " - }, - "recurrence_base": { - "type": "string", - "description": "Time in seconds since the first day of 1970 UTC. If not prefixed with an '@' the offer will start in any period (no missed payments will be performed)" - }, - "recurrence_paywindow": { - "type": "string", - "description": "an optional argument of form '-time+time[%]'. The first time is the number of seconds before the start of a period in which an invoice and payment is valid, the second time is the number of seconds after the start of the period. For example -604800+86400 means you can fetch an pay the invoice 4 weeks before the given period starts, and up to 1 day afterwards. The optional % indicates that the amount of the invoice will be scaled by the time remaining in the period. If this is not specified, the default is that payment is allowed during the current and previous periods. This is encoded in the offer." - }, - "recurrence_limit": { - "type": "u64", - "description": "the maximum recurrence period which exists" - }, - "single_use": { - "type": "boolean", - "description": "indicates that the offer is only valid once" - } - } -} diff --git a/doc/schemas/offer.schema.json b/doc/schemas/offer.schema.json deleted file mode 100644 index 671de38dc900..000000000000 --- a/doc/schemas/offer.schema.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "offer_id", - "active", - "single_use", - "bolt12", - "used", - "created" - ], - "properties": { - "offer_id": { - "type": "hash", - "description": "the id of this offer (merkle hash of non-signature fields)" - }, - "active": { - "type": "boolean", - "enum": [ - true - ], - "description": "whether this can still be used" - }, - "single_use": { - "type": "boolean", - "description": "whether this expires as soon as it's paid (reflects the *single_use* parameter)" - }, - "bolt12": { - "type": "string", - "description": "the bolt12 encoding of the offer" - }, - "used": { - "type": "boolean", - "description": "True if an associated invoice has been paid" - }, - "created": { - "type": "boolean", - "description": "false if the offer already existed" - }, - "label": { - "type": "string", - "description": "the (optional) user-specified label" - } - } -} diff --git a/doc/schemas/openchannel_abort.request.json b/doc/schemas/openchannel_abort.request.json deleted file mode 100644 index 574a44ef9417..000000000000 --- a/doc/schemas/openchannel_abort.request.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channel_id" - ], - "properties": { - "channel_id": { - "type": "hash", - "description": "channel id of the channel to be aborted" - } - } -} diff --git a/doc/schemas/openchannel_abort.schema.json b/doc/schemas/openchannel_abort.schema.json deleted file mode 100644 index 645f8fdb490f..000000000000 --- a/doc/schemas/openchannel_abort.schema.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channel_id", - "channel_canceled", - "reason" - ], - "properties": { - "channel_id": { - "type": "hex", - "description": "the channel id of the aborted channel", - "maxLength": 64, - "minLength": 64 - }, - "channel_canceled": { - "type": "boolean", - "description": "whether this is completely canceled (there may be remaining in-flight transactions)" - }, - "reason": { - "type": "string", - "description": "usually \"Abort requested\", but if it happened to fail at the same time it could be different" - } - } -} diff --git a/doc/schemas/openchannel_bump.request.json b/doc/schemas/openchannel_bump.request.json deleted file mode 100644 index 1d40501f6dd0..000000000000 --- a/doc/schemas/openchannel_bump.request.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channel_id", - "amount", - "initialpsbt" - ], - "properties": { - "channel_id": { - "type": "hash", - "description": "id of the channel to RBF" - }, - "amount": { - "type": "sat", - "description": "satoshi value that we will contribute to the channel. This value will be _added_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel" - }, - "initialpsbt": { - "type": "string", - "description": "the funded, incomplete PSBT that specifies the UTXOs and change output for our channel contribution. It can be updated, see `openchannel_update`; *initialpsbt* must have at least one input. Must have the Non-Witness UTXO (PSBT_IN_NON_WITNESS_UTXO) set for every input. An error (code 309) will be returned if this requirement is not met" - }, - "funding_feerate": { - "type": "feerate", - "description": "feerate for the funding transaction. Defaults to 1/64th greater than the last feerate used for this channel" - } - } -} diff --git a/doc/schemas/openchannel_bump.schema.json b/doc/schemas/openchannel_bump.schema.json deleted file mode 100644 index a6eb43f15dc2..000000000000 --- a/doc/schemas/openchannel_bump.schema.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channel_id", - "channel_type", - "psbt", - "commitments_secured", - "funding_serial" - ], - "properties": { - "channel_id": { - "type": "hex", - "description": "the channel id of the channel", - "maxLength": 64, - "minLength": 64 - }, - "channel_type": { - "type": "object", - "description": "channel_type as negotiated with peer", - "added": "v24.02", - "additionalProperties": false, - "required": [ - "bits", - "names" - ], - "properties": { - "bits": { - "type": "array", - "description": "Each bit set in this channel_type", - "added": "v24.02", - "items": { - "type": "u32", - "description": "Bit number" - } - }, - "names": { - "type": "array", - "description": "Feature name for each bit set in this channel_type", - "added": "v24.02", - "items": { - "type": "string", - "enum": [ - "static_remotekey/even", - "anchor_outputs/even", - "anchors_zero_fee_htlc_tx/even", - "scid_alias/even", - "zeroconf/even" - ], - "description": "Name of feature bit" - } - } - } - }, - "psbt": { - "type": "string", - "description": "the (incomplete) PSBT of the RBF transaction" - }, - "commitments_secured": { - "type": "boolean", - "enum": [ - false - ], - "description": "whether the *psbt* is complete" - }, - "funding_serial": { - "type": "u64", - "description": "the serial_id of the funding output in the *psbt*" - }, - "requires_confirmed_inputs": { - "type": "boolean", - "description": "Does peer require confirmed inputs in psbt?" - } - } -} diff --git a/doc/schemas/openchannel_init.request.json b/doc/schemas/openchannel_init.request.json deleted file mode 100644 index 56bc3916419e..000000000000 --- a/doc/schemas/openchannel_init.request.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "amount", - "initialpsbt" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "node id of the remote peer" - }, - "amount": { - "type": "sat", - "description": "satoshi value that we will contribute to the channel. This value will be _added_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel" - }, - "initialpsbt": { - "type": "string", - "description": "funded, incomplete PSBT that specifies the UTXOs and change output for our channel contribution. It can be updated, see `openchannel_update`; *initialpsbt* must have at least one input. Must have the Non-Witness UTXO (PSBT_IN_NON_WITNESS_UTXO) set for every input. An error (code 309) will be returned if this requirement is not met" - }, - "commitment_feerate": { - "type": "feerate", - "description": "feerate for commitment transactions for non-anchor channels: see **fundchannel**. For anchor channels, it is ignored" - }, - "funding_feerate": { - "type": "feerate", - "description": "feerate for the funding transaction. Defaults to 'opening' feerate" - }, - "announce": { - "type": "boolean", - "description": "whether or not to announce this channel" - }, - "close_to": { - "type": "string", - "description": "bitcoin address to which the channel funds should be sent on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`" - }, - "request_amt": { - "type": "msat", - "description": "an amount of liquidity you'd like to lease from the peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*" - }, - "compact_lease": { - "type": "hex", - "description": "a compact represenation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel" - }, - "channel_type": { - "type": "array", - "description": "Each bit set in this channel_type", - "items": { - "type": "u32", - "description": "Bit number" - } - } - } -} diff --git a/doc/schemas/openchannel_init.schema.json b/doc/schemas/openchannel_init.schema.json deleted file mode 100644 index 5d669da81e55..000000000000 --- a/doc/schemas/openchannel_init.schema.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channel_id", - "psbt", - "channel_type", - "commitments_secured", - "funding_serial" - ], - "properties": { - "channel_id": { - "type": "hex", - "description": "the channel id of the channel", - "maxLength": 64, - "minLength": 64 - }, - "psbt": { - "type": "string", - "description": "the (incomplete) PSBT of the funding transaction" - }, - "channel_type": { - "type": "object", - "description": "channel_type as negotiated with peer", - "added": "v24.02", - "additionalProperties": false, - "required": [ - "bits", - "names" - ], - "properties": { - "bits": { - "type": "array", - "description": "Each bit set in this channel_type", - "added": "v24.02", - "items": { - "type": "u32", - "description": "Bit number" - } - }, - "names": { - "type": "array", - "description": "Feature name for each bit set in this channel_type", - "added": "v24.02", - "items": { - "type": "string", - "enum": [ - "static_remotekey/even", - "anchor_outputs/even", - "anchors_zero_fee_htlc_tx/even", - "scid_alias/even", - "zeroconf/even" - ], - "description": "Name of feature bit" - } - } - } - }, - "commitments_secured": { - "type": "boolean", - "enum": [ - false - ], - "description": "whether the *psbt* is complete" - }, - "funding_serial": { - "type": "u64", - "description": "the serial_id of the funding output in the *psbt*" - }, - "requires_confirmed_inputs": { - "type": "boolean", - "description": "Does peer require confirmed inputs in psbt?" - } - } -} diff --git a/doc/schemas/openchannel_signed.request.json b/doc/schemas/openchannel_signed.request.json deleted file mode 100644 index 903639b22ca2..000000000000 --- a/doc/schemas/openchannel_signed.request.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channel_id", - "signed_psbt" - ], - "properties": { - "channel_id": { - "type": "hash", - "description": "id of the channel" - }, - "signed_psbt": { - "type": "string", - "description": "the PSBT returned from `openchannel_update` (where *commitments_secured* was true) with partial signatures or finalized witness stacks included for every input that we contributed to the PSBT" - } - } -} diff --git a/doc/schemas/openchannel_signed.schema.json b/doc/schemas/openchannel_signed.schema.json deleted file mode 100644 index 23b9a11d7e3f..000000000000 --- a/doc/schemas/openchannel_signed.schema.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channel_id", - "tx", - "txid" - ], - "properties": { - "channel_id": { - "type": "hex", - "description": "the channel id of the channel", - "maxLength": 64, - "minLength": 64 - }, - "tx": { - "type": "hex", - "description": "the funding transaction" - }, - "txid": { - "type": "txid", - "description": "The txid of the **tx**" - } - } -} diff --git a/doc/schemas/openchannel_update.request.json b/doc/schemas/openchannel_update.request.json deleted file mode 100644 index b32f52330ad6..000000000000 --- a/doc/schemas/openchannel_update.request.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channel_id", - "psbt" - ], - "properties": { - "channel_id": { - "type": "hash", - "description": "id of the channel" - }, - "psbt": { - "type": "string", - "description": "updated PSBT to be sent to the peer. May be identical to the PSBT last returned by either `openchannel_init` or `openchannel_update`" - } - } -} diff --git a/doc/schemas/openchannel_update.schema.json b/doc/schemas/openchannel_update.schema.json deleted file mode 100644 index 61018fb50b10..000000000000 --- a/doc/schemas/openchannel_update.schema.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channel_id", - "psbt", - "commitments_secured", - "channel_type", - "funding_outnum" - ], - "properties": { - "channel_id": { - "type": "hex", - "description": "the channel id of the channel", - "maxLength": 64, - "minLength": 64 - }, - "channel_type": { - "type": "object", - "description": "channel_type as negotiated with peer", - "added": "v24.02", - "additionalProperties": false, - "required": [ - "bits", - "names" - ], - "properties": { - "bits": { - "type": "array", - "description": "Each bit set in this channel_type", - "added": "v24.02", - "items": { - "type": "u32", - "description": "Bit number" - } - }, - "names": { - "type": "array", - "description": "Feature name for each bit set in this channel_type", - "added": "v24.02", - "items": { - "type": "string", - "enum": [ - "static_remotekey/even", - "anchor_outputs/even", - "anchors_zero_fee_htlc_tx/even", - "scid_alias/even", - "zeroconf/even" - ], - "description": "Name of feature bit" - } - } - } - }, - "psbt": { - "type": "string", - "description": "the PSBT of the funding transaction" - }, - "commitments_secured": { - "type": "boolean", - "description": "whether the *psbt* is complete (if true, sign *psbt* and call `openchannel_signed` to complete the channel open)" - }, - "funding_outnum": { - "type": "u32", - "description": "The index of the funding output in the psbt" - }, - "close_to": { - "type": "hex", - "description": "scriptPubkey which we have to close to if we mutual close" - }, - "requires_confirmed_inputs": { - "type": "boolean", - "description": "Does peer require confirmed inputs in psbt?" - } - } -} diff --git a/doc/schemas/parsefeerate.request.json b/doc/schemas/parsefeerate.request.json deleted file mode 100644 index 7646e2c5709e..000000000000 --- a/doc/schemas/parsefeerate.request.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "feerate_str" - ], - "properties": { - "feerate_str": { - "type": "string", - "description": "The feerate string to parse" - } - } -} diff --git a/doc/schemas/parsefeerate.schema.json b/doc/schemas/parsefeerate.schema.json deleted file mode 100644 index e431936b1eb5..000000000000 --- a/doc/schemas/parsefeerate.schema.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "perkw": { - "type": "u32", - "description": "Value of *feerate_str* in kilosipa", - "additionalProperties": false - } - } -} diff --git a/doc/schemas/pay.request.json b/doc/schemas/pay.request.json deleted file mode 100644 index 743d23ae5d7d..000000000000 --- a/doc/schemas/pay.request.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "bolt11" - ], - "properties": { - "bolt11": { - "type": "string", - "description": "bolt11 invoice, if **experimental-offers** is enabled, it can actually be a bolt12 invoice, such as one received from lightningd-fetchinvoice(7). If it does not contain an amount, *amount_msat* is required, otherwise if it is specified it must be *null*" - }, - "amount_msat": { - "type": "msat", - "description": "*amount_msat* is in millisatoshi precision; it can be a whole number, or a whole number with suffix *msat* or *sat*, or a three decimal point number with suffix *sat*, or an 1 to 11 decimal point number suffixed by *btc*" - }, - "label": { - "type": "string", - "description": "it is used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7)" - }, - "riskfactor": { - "type": "number", - "description": "the *riskfactor* is described in detail in lightning-getroute(7), and defaults to 10" - }, - "maxfeepercent": { - "type": "number", - "description": "percentage of the amount that is to be paid. Defaults to 0.5" - }, - "retry_for": { - "type": "u16", - "description": "until *retry_for* seconds passes, the command will keep finding routes and retrying the payment. Defaults to 60 seconds" - }, - "maxdelay": { - "type": "u16", - "description": "a payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case" - }, - "exemptfee": { - "type": "msat", - "description": "this option can be used for tiny payments which would be dominated by the fee leveraged by forwarding nodes. Setting `exemptfee` allows the `maxfeepercent` check to be skipped on fees that are smaller than `exemptfee`. Defaults to 5000 millisatoshi" - }, - "localinvreqid": { - "type": "hex", - "description": "`localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7). This ensures that we only make a single payment for an offer, and that the offer is marked `used` once paid" - }, - "exclude": { - "type": "array", - "description": "*exclude* is a JSON array of short-channel-id/direction (e.g. [ '564334x877x1/0', '564195x1292x0/1' ]) or pubkey which should be excluded from consideration for routing. The default is not to exclude any channels or nodes", - "items": { - "oneOf": [ - { - "type": "short_channel_id_dir" - }, - { - "type": "pubkey" - } - ] - } - }, - "maxfee": { - "type": "msat", - "description": "*maxfee* overrides both *maxfeepercent* and *exemptfee* defaults (and if you specify *maxfee* you cannot specify either of those), and creates an absolute limit on what fee we will pay. This allows you to implement your own heuristics rather than the primitive ones used here" - }, - "description": { - "type": "string", - "description": "it is only required for bolt11 invoices which do not contain a description themselves, but contain a description hash: in this case *description* is required. *description* is then checked against the hash inside the invoice before it will be paid" - } - } -} diff --git a/doc/schemas/pay.schema.json b/doc/schemas/pay.schema.json deleted file mode 100644 index 697622643032..000000000000 --- a/doc/schemas/pay.schema.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "payment_preimage", - "payment_hash", - "created_at", - "parts", - "amount_msat", - "amount_sent_msat", - "status" - ], - "properties": { - "payment_preimage": { - "type": "secret", - "description": "the proof of payment: SHA256 of this **payment_hash**" - }, - "destination": { - "type": "pubkey", - "description": "the final destination of the payment" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "created_at": { - "type": "number", - "description": "the UNIX timestamp showing when this payment was initiated" - }, - "parts": { - "type": "u32", - "description": "how many attempts this took" - }, - "amount_msat": { - "type": "msat", - "description": "Amount the recipient received" - }, - "amount_sent_msat": { - "type": "msat", - "description": "Total amount we sent (including fees)" - }, - "warning_partial_completion": { - "type": "string", - "description": "Not all parts of a multi-part payment have completed" - }, - "status": { - "type": "string", - "enum": [ - "complete", - "pending", - "failed" - ], - "description": "status of payment" - } - } -} diff --git a/doc/schemas/ping.request.json b/doc/schemas/ping.request.json deleted file mode 100644 index c5b2dae32470..000000000000 --- a/doc/schemas/ping.request.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "id" - ], - "additionalProperties": false, - "properties": { - "id": { - "type": "pubkey", - "description": "The pubkey of the node to ping" - }, - "len": { - "type": "u16", - "description": "the length of the ping. Defaults to 128" - }, - "pongbytes": { - "type": "u16", - "description": "the length of the reply. A value of 65532 to 65535 means `don't reply`. Defaults to 128" - } - } -} diff --git a/doc/schemas/ping.schema.json b/doc/schemas/ping.schema.json deleted file mode 100644 index 4ea5056a940b..000000000000 --- a/doc/schemas/ping.schema.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "totlen" - ], - "properties": { - "totlen": { - "type": "u16", - "description": "the answer length of the reply message (including header: 0 means no reply expected)" - } - } -} diff --git a/doc/schemas/plugin.request.json b/doc/schemas/plugin.request.json deleted file mode 100644 index c72dd08f9480..000000000000 --- a/doc/schemas/plugin.request.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": true, - "required": [ - "subcommand" - ], - "properties": { - "subcommand": { - "type": "string", - "enum": [ - "start", - "stop", - "rescan", - "startdir", - "list" - ], - "description": "determines what action is taken" - }, - "plugin": { - "type": "string", - "description": "*path* or *name* of a plugin executable to start or stop" - }, - "directory": { - "type": "string", - "description": "*path* of a directory containing plugins" - } - } -} diff --git a/doc/schemas/plugin.schema.json b/doc/schemas/plugin.schema.json deleted file mode 100644 index 345d285e6fa3..000000000000 --- a/doc/schemas/plugin.schema.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": true, - "required": [ - "command" - ], - "properties": { - "command": { - "type": "string", - "enum": [ - "start", - "stop", - "rescan", - "startdir", - "list" - ], - "description": "the subcommand this is responding to" - } - }, - "allOf": [ - { - "if": { - "properties": { - "command": { - "type": "string", - "enum": [ - "start", - "startdir", - "rescan", - "list" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "command", - "plugins" - ], - "properties": { - "command": {}, - "plugins": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "name", - "active", - "dynamic" - ], - "properties": { - "name": { - "type": "string", - "description": "full pathname of the plugin" - }, - "active": { - "type": "boolean", - "description": "status; plugin completed init and is operational, plugins are configured asynchronously." - }, - "dynamic": { - "type": "boolean", - "description": "plugin can be stopped or started without restarting lightningd" - } - } - } - } - } - } - }, - { - "if": { - "properties": { - "command": { - "type": "string", - "enum": [ - "stop" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "command", - "result" - ], - "properties": { - "command": {}, - "result": { - "type": "string", - "description": "A message saying it successfully stopped" - } - } - } - } - ] -} diff --git a/doc/schemas/preapproveinvoice.request.json b/doc/schemas/preapproveinvoice.request.json deleted file mode 100644 index 19625fc29eff..000000000000 --- a/doc/schemas/preapproveinvoice.request.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "added": "v23.02", - "required": [ - "bolt11" - ], - "properties": { - "bolt11": { - "type": "string", - "description": "bolt11 invoice to submit to the HSM to check", - "added": "v23.02" - } - } -} diff --git a/doc/schemas/preapproveinvoice.schema.json b/doc/schemas/preapproveinvoice.schema.json deleted file mode 100644 index c66ab0f77c31..000000000000 --- a/doc/schemas/preapproveinvoice.schema.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "added": "v23.02", - "properties": {} -} diff --git a/doc/schemas/preapprovekeysend.request.json b/doc/schemas/preapprovekeysend.request.json deleted file mode 100644 index ee2fc3a1d034..000000000000 --- a/doc/schemas/preapprovekeysend.request.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "added": "v23.02", - "required": [ - "destination", - "payment_hash", - "amount_msat" - ], - "properties": { - "destination": { - "type": "pubkey", - "description": "it is a 33 byte, hex-encoded, node ID of the node that the payment should go to", - "added": "v23.02" - }, - "payment_hash": { - "type": "hex", - "added": "v23.02", - "description": "it is the unique identifier of a payment", - "maxLength": 64, - "minLength": 64 - }, - "amount_msat": { - "type": "msat", - "description": "the amount to send in millisatoshi precision; it can be a whole number, or a whole number with suffix `msat` or `sat`, or a three decimal point number with suffix `sat`, or an 1 to 11 decimal point number suffixed by `btc`", - "added": "v23.02" - } - } -} diff --git a/doc/schemas/preapprovekeysend.schema.json b/doc/schemas/preapprovekeysend.schema.json deleted file mode 100644 index 1aad2dcae935..000000000000 --- a/doc/schemas/preapprovekeysend.schema.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "properties": {} -} diff --git a/doc/schemas/recover.request.json b/doc/schemas/recover.request.json deleted file mode 100644 index 2e983f6f3b93..000000000000 --- a/doc/schemas/recover.request.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "hsmsecret" - ], - "properties": { - "hsmsecret": { - "type": "string", - "description": "either a codex32 secret starting with `cl1` as returned by `hsmtool getcodexsecret`, or a raw 64 character hex string" - } - } -} diff --git a/doc/schemas/recover.schema.json b/doc/schemas/recover.schema.json deleted file mode 100644 index 0fb76afd57f0..000000000000 --- a/doc/schemas/recover.schema.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "result" - ], - "properties": { - "result": { - "type": "string", - "added": "v24.05", - "enum": [ - "Recovery restart in progress" - ] - } - } -} diff --git a/doc/schemas/recoverchannel.request.json b/doc/schemas/recoverchannel.request.json deleted file mode 100644 index 073828a5fc44..000000000000 --- a/doc/schemas/recoverchannel.request.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "scb" - ], - "properties": { - "scb": { - "type": "array", - "description": "SCB of the channels in an array", - "items": { - "type": "hexstr" - } - } - } -} diff --git a/doc/schemas/recoverchannel.schema.json b/doc/schemas/recoverchannel.schema.json deleted file mode 100644 index 127dfbc6bf43..000000000000 --- a/doc/schemas/recoverchannel.schema.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "stubs" - ], - "properties": { - "stubs": { - "type": "array", - "items": { - "type": "string", - "description": "Channel IDs of channels successfully inserted." - } - } - } -} diff --git a/doc/schemas/renepay.request.json b/doc/schemas/renepay.request.json deleted file mode 100644 index 91c1e266d018..000000000000 --- a/doc/schemas/renepay.request.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "invstring" - ], - "properties": { - "invstring": { - "type": "string", - "description": "bolt11 invoice which the RPC command attempts to pay. Currently, **renepay** supports bolt11 invoices only" - }, - "amount_msat": { - "type": "msat", - "description": "if the *invstring* does not contain an amount, *amount_msat* is required, otherwise if it is specified it must be *null*. in millisatoshi precision; it can be a whole number, or a whole number with suffix *msat* or *sat*, or a three decimal point number with suffix *sat*, or an 1 to 11 decimal point number suffixed by *btc*" - }, - "maxfee": { - "type": "msat", - "description": "*maxfee* is a hard bound, in the sense that the command will never attempt a payment when the fees exceed that value" - }, - "maxdelay": { - "type": "u32", - "description": "overrides the value of `max-locktime-blocks` for this payment. It serves to limit the locktime of funds in the payment HTLC measured in blocks" - }, - "retry_for": { - "type": "u32", - "description": "measured in seconds specifies how much time it is allowed for the command to keep retrying the payment. Defaults to 60 seconds" - }, - "description": { - "type": "string", - "description": "only required for bolt11 invoices which do not contain a description themselves, but contain a description hash: in this case *description* is required. *description* is then checked against the hash inside the invoice before it will be paid" - }, - "label": { - "type": "string", - "description": "used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7)" - }, - "dev_use_shadow": { - "hidden": true, - "type": "boolean" - } - } -} diff --git a/doc/schemas/renepay.schema.json b/doc/schemas/renepay.schema.json deleted file mode 100644 index 2700a5e92608..000000000000 --- a/doc/schemas/renepay.schema.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "added": "v23.08", - "type": "object", - "additionalProperties": false, - "required": [ - "payment_preimage", - "payment_hash", - "created_at", - "parts", - "amount_msat", - "amount_sent_msat", - "status" - ], - "properties": { - "payment_preimage": { - "type": "secret", - "description": "the proof of payment: SHA256 of this **payment_hash**" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "created_at": { - "type": "number", - "description": "the UNIX timestamp showing when this payment was initiated" - }, - "parts": { - "type": "u32", - "description": "how many attempts this took" - }, - "amount_msat": { - "type": "msat", - "description": "amount the recipient received" - }, - "amount_sent_msat": { - "type": "msat", - "description": "total amount we sent (including fees)" - }, - "status": { - "type": "string", - "enum": [ - "complete", - "pending", - "failed" - ], - "description": "status of payment" - }, - "destination": { - "type": "pubkey", - "description": "the final destination of the payment" - } - } -} diff --git a/doc/schemas/renepaystatus.request.json b/doc/schemas/renepaystatus.request.json deleted file mode 100644 index a332dd2c96bb..000000000000 --- a/doc/schemas/renepaystatus.request.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "invstring": { - "type": "string", - "description": "if specified, the command will return a list of payment attempts whose invoice matches *invstring*, otherwise all payments with be listed" - } - } -} diff --git a/doc/schemas/renepaystatus.schema.json b/doc/schemas/renepaystatus.schema.json deleted file mode 100644 index 03da45dc14d8..000000000000 --- a/doc/schemas/renepaystatus.schema.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "added": "v23.08", - "type": "object", - "additionalProperties": false, - "required": [ - "paystatus" - ], - "properties": { - "paystatus": { - "type": "array", - "description": "a list of payments attempted by renepay", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "bolt11", - "payment_hash", - "created_at", - "groupid", - "amount_msat", - "status", - "notes" - ], - "properties": { - "bolt11": { - "type": "string", - "description": "invoice string BOLT11" - }, - "payment_preimage": { - "type": "secret", - "description": "the proof of payment: SHA256 of this **payment_hash** (for completed payments only)" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "created_at": { - "type": "number", - "description": "the UNIX timestamp showing when this payment was initiated" - }, - "groupid": { - "type": "u32", - "description": "the id for this payment attempt" - }, - "parts": { - "type": "u32", - "description": "how many attempts this took" - }, - "amount_msat": { - "type": "msat", - "description": "amount the recipient received" - }, - "amount_sent_msat": { - "type": "msat", - "description": "total amount we sent including fees (for completed payments only)" - }, - "status": { - "type": "string", - "enum": [ - "complete", - "pending", - "failed" - ], - "description": "status of payment" - }, - "destination": { - "type": "pubkey", - "description": "the final destination of the payment" - }, - "notes": { - "type": "array", - "description": "a list of messages for debugging purposes", - "items": { - "type": "string", - "description": "a message generated by renepay" - } - } - } - } - } - } -} diff --git a/doc/schemas/reserveinputs.request.json b/doc/schemas/reserveinputs.request.json deleted file mode 100644 index b7eadaab7d36..000000000000 --- a/doc/schemas/reserveinputs.request.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt" - ], - "properties": { - "psbt": { - "type": "string", - "description": "the PSBT to reserve inputs from" - }, - "exclusive": { - "type": "boolean", - "description": "If set to *False*, existing reservations are simply extended, rather than causing failure" - }, - "reserve": { - "type": "u32", - "description": "the number of blocks to reserve. By default, reservations are for the next 72 blocks (approximately 6 hours)" - } - } -} diff --git a/doc/schemas/reserveinputs.schema.json b/doc/schemas/reserveinputs.schema.json deleted file mode 100644 index adfc66b9df76..000000000000 --- a/doc/schemas/reserveinputs.schema.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "reservations" - ], - "properties": { - "reservations": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "txid", - "vout", - "was_reserved", - "reserved", - "reserved_to_block" - ], - "properties": { - "txid": { - "type": "txid", - "description": "the transaction id" - }, - "vout": { - "type": "u32", - "description": "the output number which was reserved" - }, - "was_reserved": { - "type": "boolean", - "description": "whether the input was already reserved" - }, - "reserved": { - "type": "boolean", - "enum": [ - true - ], - "description": "whether the input is now reserved" - }, - "reserved_to_block": { - "type": "u32", - "description": "what blockheight the reservation will expire" - } - } - } - } - } -} diff --git a/doc/schemas/sendcustommsg.request.json b/doc/schemas/sendcustommsg.request.json deleted file mode 100644 index 6a3787debc0c..000000000000 --- a/doc/schemas/sendcustommsg.request.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "node_id", - "msg" - ], - "added": "v0.10.1", - "additionalProperties": false, - "properties": { - "node_id": { - "type": "pubkey", - "description": "the node specified by `node_id` must be a peer, i.e., it must have a direct connection with the node receiving the RPC call, and the connection must be established. For a method to send arbitrary messages over multiple hops, including hops that do not understand the custom message, see the `createonion` and `sendonion` RPC methods. Messages can only be injected if the connection is handled by `openingd` or `channeld`. Messages cannot be injected when the peer is handled by `onchaind` or `closingd` since these do not have a connection, or are synchronous daemons that do not handle spontaneous messages" - }, - "msg": { - "type": "hex", - "description": "must be a hex encoded well-formed message, including the 2-byte type prefix, but excluding the length prefix which will be added by the RPC method. The message types may not be one of the internally handled types, since that may cause issues with the internal state tracking of Core Lightning. We do (as of *v23.11*) allow sending of even types, but note that peers (as per the spec) will disconnect on receiving unknown even types" - } - } -} diff --git a/doc/schemas/sendcustommsg.schema.json b/doc/schemas/sendcustommsg.schema.json deleted file mode 100644 index 3c9db46a3ceb..000000000000 --- a/doc/schemas/sendcustommsg.schema.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "status" - ], - "properties": { - "status": { - "type": "string", - "description": "Information about where message was queued" - } - } -} diff --git a/doc/schemas/sendinvoice.request.json b/doc/schemas/sendinvoice.request.json deleted file mode 100644 index ea5f6a118c9a..000000000000 --- a/doc/schemas/sendinvoice.request.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "invreq", - "label" - ], - "properties": { - "invreq": { - "type": "string", - "description": "the bolt12 invoice_request string beginning with `lnr1`" - }, - "label": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ], - "description": "the unique label to use for this invoice" - }, - "amount_msat": { - "type": "msat", - "description": "required if the *offer* does not specify an amount at all, or specifies it in a different currency. Otherwise you may set it (e.g. to provide a tip), and if not it defaults to the amount contained in the offer (multiplied by *quantity* if any)" - }, - "timeout": { - "type": "u32", - "description": "seconds to wait for the offering node to pay the invoice or return an error, default 90 seconds. This will also be the timeout on the invoice that is sent" - }, - "quantity": { - "type": "u64", - "description": "quantity is is required if the offer specifies quantity_max, otherwise it is not allowed" - } - } -} diff --git a/doc/schemas/sendinvoice.schema.json b/doc/schemas/sendinvoice.schema.json deleted file mode 100644 index e303bbc058b7..000000000000 --- a/doc/schemas/sendinvoice.schema.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": true, - "required": [ - "label", - "description", - "payment_hash", - "status", - "created_index", - "expires_at" - ], - "properties": { - "label": { - "type": "string", - "description": "unique label supplied at invoice creation" - }, - "description": { - "type": "string", - "description": "description used in the invoice" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "status": { - "type": "string", - "enum": [ - "unpaid", - "paid", - "expired" - ], - "description": "Whether it's paid, unpaid or unpayable" - }, - "expires_at": { - "type": "u64", - "description": "UNIX timestamp of when it will become / became unpayable" - }, - "amount_msat": { - "type": "msat", - "description": "the amount required to pay this invoice" - }, - "bolt12": { - "type": "string", - "description": "the BOLT12 string" - }, - "created_index": { - "type": "u64", - "added": "v23.08", - "description": "1-based index indicating order this invoice was created in" - }, - "updated_index": { - "type": "u64", - "added": "v23.08", - "description": "1-based index indicating order this invoice was changed (only present if it has changed since creation)" - } - }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "paid" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "pay_index", - "amount_received_msat", - "paid_at", - "payment_preimage" - ], - "properties": { - "label": {}, - "description": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "bolt12": {}, - "expires_at": {}, - "created_index": {}, - "updated_index": {}, - "pay_index": { - "type": "u64", - "description": "Unique incrementing index for this payment" - }, - "amount_received_msat": { - "type": "msat", - "description": "the amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)" - }, - "paid_at": { - "type": "u64", - "description": "UNIX timestamp of when it was paid" - }, - "payment_preimage": { - "type": "secret", - "description": "proof of payment" - } - } - } - } - ] -} diff --git a/doc/schemas/sendonion.request.json b/doc/schemas/sendonion.request.json deleted file mode 100644 index 35e1c4d48fdf..000000000000 --- a/doc/schemas/sendonion.request.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "onion", - "first_hop", - "payment_hash" - ], - "properties": { - "onion": { - "type": "hex", - "description": "hex-encoded 1366 bytes long blob that was returned by either of the tools that can generate onions. It contains the payloads destined for each hop and some metadata. Please refer to [BOLT 04][bolt04] for further details. If is specific to the route that is being used and the *payment_hash* used to construct, and therefore cannot be reused for other payments or to attempt a separate route. The custom onion can generally be created using the `devtools/onion` CLI tool, or the **createonion** RPC command" - }, - "first_hop": { - "type": "object", - "description": "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*", - "required": [ - "id", - "amount_msat", - "delay" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "node id for the peer. Use any available channel available to this peer" - }, - "amount_msat": { - "type": "msat", - "description": "the amount to add an HTLC for millisatoshis" - }, - "delay": { - "type": "u16", - "description": "the number of blocks delay of blocks on top of the current blockheight" - } - } - }, - "payment_hash": { - "type": "hash", - "description": "specifies the 32 byte hex-encoded hash to use as a challenge to the HTLC that we are sending. It is specific to the onion and has to match the one the onion was created with" - }, - "label": { - "type": "string", - "description": "can be used to provide a human readable reference to retrieve the payment at a later time" - }, - "shared_secrets": { - "type": "array", - "description": "a JSON list of 32 byte hex-encoded secrets that were used when creating the onion. Core Lightning can send a payment with a custom onion without the knowledge of these secrets, however it will not be able to parse an eventual error message since that is encrypted with the shared secrets used in the onion. If *shared_secrets* is provided Core Lightning will decrypt the error, act accordingly, e.g., add a `channel_update` included in the error to its network view, and set the details in *listsendpays* correctly. If it is not provided Core Lightning will store the encrypted onion, and expose it in *listsendpays* allowing the caller to decrypt it externally. If it is not provided the Core Lightning node does not know how long the route is, which channels or nodes are involved, and what an eventual error could have been. It can therefore be used for oblivious payments", - "items": { - "type": "secret" - } - }, - "partid": { - "type": "u16", - "description": "if provided and non-zero, allows for multiple parallel partial payments with the same *payment_hash*" - }, - "bolt11": { - "type": "string", - "description": "if provided, it will be returned in *waitsendpay* and *listsendpays* results" - }, - "amount_msat": { - "type": "msat", - "description": "used to annotate the payment, and is returned by *waitsendpay* and *listsendpays*" - }, - "destination": { - "type": "pubkey", - "description": "if provided, it will be returned in **listpays** result" - }, - "localinvreqid": { - "type": "hash", - "description": "`localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7)" - }, - "groupid": { - "type": "u64", - "description": "grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash" - }, - "description": { - "added": "v0.11.0", - "type": "string", - "description": "if provided, it will be returned in *waitsendpay* and *listsendpays* results" - } - } -} diff --git a/doc/schemas/sendonion.schema.json b/doc/schemas/sendonion.schema.json deleted file mode 100644 index 1963a45e5fc8..000000000000 --- a/doc/schemas/sendonion.schema.json +++ /dev/null @@ -1,151 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": true, - "required": [ - "created_index", - "id", - "payment_hash", - "status", - "created_at", - "amount_sent_msat" - ], - "properties": { - "created_index": { - "added": "v23.11", - "type": "u64", - "description": "1-based index indicating order this payment was created in" - }, - "id": { - "type": "u64", - "description": "old synonym for created_index" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "status": { - "type": "string", - "enum": [ - "pending", - "complete" - ], - "description": "status of the payment (could be complete if already sent previously)" - }, - "amount_msat": { - "type": "msat", - "description": "The amount delivered to destination (if known)" - }, - "destination": { - "type": "pubkey", - "description": "the final destination of the payment if known" - }, - "created_at": { - "type": "u64", - "description": "the UNIX timestamp showing when this payment was initiated" - }, - "amount_sent_msat": { - "type": "msat", - "description": "The amount sent" - }, - "label": { - "type": "string", - "description": "the label, if given to sendpay" - }, - "bolt11": { - "type": "string", - "description": "the bolt11 string (if supplied)" - }, - "bolt12": { - "type": "string", - "description": "the bolt12 string (if supplied: **experimental-offers** only)." - }, - "partid": { - "type": "u64", - "description": "the partid (if supplied) to sendonion/sendpay" - } - }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "complete" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "payment_preimage" - ], - "properties": { - "created_index": {}, - "id": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "destination": {}, - "created_at": {}, - "groupid": {}, - "msatoshi_sent": {}, - "amount_sent_msat": {}, - "label": {}, - "bolt11": {}, - "bolt12": {}, - "partid": {}, - "updated_index": { - "added": "v23.11", - "type": "u64", - "description": "1-based index indicating order this payment was changed" - }, - "payment_preimage": { - "type": "secret", - "description": "the proof of payment: SHA256 of this **payment_hash**" - } - } - } - }, - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "pending" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [], - "properties": { - "created_index": {}, - "id": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "destination": {}, - "created_at": {}, - "groupid": {}, - "msatoshi_sent": {}, - "amount_sent_msat": {}, - "label": {}, - "bolt11": {}, - "bolt12": {}, - "partid": {}, - "message": { - "type": "string", - "description": "Monitor status with listpays or waitsendpay" - } - } - } - } - ] -} diff --git a/doc/schemas/sendonionmessage.request.json b/doc/schemas/sendonionmessage.request.json deleted file mode 100644 index 8498998c343d..000000000000 --- a/doc/schemas/sendonionmessage.request.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "first_id", - "blinding", - "hops" - ], - "properties": { - "first_id": { - "type": "pubkey", - "description": "the (presumably well-known) public key of the start of the path" - }, - "blinding": { - "type": "pubkey", - "description": "blinding factor for this path" - }, - "hops": { - "type": "array", - "description": "", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "node", - "tlv" - ], - "properties": { - "node": { - "type": "pubkey", - "description": "public key of the node" - }, - "tlv": { - "type": "u8", - "description": "contains a hexadecimal TLV to include" - } - } - } - } - } -} diff --git a/doc/schemas/sendonionmessage.schema.json b/doc/schemas/sendonionmessage.schema.json deleted file mode 100644 index 65571ad4c703..000000000000 --- a/doc/schemas/sendonionmessage.schema.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": {} -} diff --git a/doc/schemas/sendpay.request.json b/doc/schemas/sendpay.request.json deleted file mode 100644 index b0a9ce216fe1..000000000000 --- a/doc/schemas/sendpay.request.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "route", - "payment_hash" - ], - "properties": { - "route": { - "type": "array", - "items": { - "type": "object", - "required": [ - "amount_msat", - "id", - "delay", - "channel" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "The node at the end of this hop" - }, - "channel": { - "type": "short_channel_id", - "description": "The channel joining these nodes" - }, - "delay": { - "type": "u32", - "description": "The total CLTV expected by the node at the end of this hop" - }, - "amount_msat": { - "type": "msat", - "description": "The amount expected by the node at the end of this hop" - } - } - } - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the payment_preimage" - }, - "label": { - "type": "string", - "description": "the label provided when creating the invoice_request" - }, - "amount_msat": { - "type": "msat", - "description": "amount must be provided if *partid* is non-zero, or the payment is to-self, otherwise it must be equal to the final amount to the destination. By default it is in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*" - }, - "bolt11": { - "type": "string", - "description": "bolt11 invoice to pay. If provided, will be returned in *waitsendpay* and *listsendpays* results" - }, - "payment_secret": { - "type": "secret", - "description": "value that the final recipient requires to accept the payment, as defined by the `payment_data` field in BOLT 4 and the `s` field in the BOLT 11 invoice format. It is required if *partid* is non-zero" - }, - "partid": { - "type": "u64", - "description": "must not be provided for self-payments. If provided and non-zero, allows for multiple parallel partial payments with the same *payment_hash*. The *amount_msat* amount (which must be provided) for each **sendpay** with matching *payment_hash* must be equal, and **sendpay** will fail if there are differing values given" - }, - "localinvreqid": { - "type": "hex", - "description": "indicates that this payment is being made for a local invoice_request. This ensures that we only send a payment for a single-use invoice_request once" - }, - "groupid": { - "type": "u64", - "description": "allows you to attach a number which appears in **listsendpays** so payments can be identified as part of a logical group. The *pay* plugin uses this to identify one attempt at a MPP payment, for example" - }, - "payment_metadata": { - "added": "v0.11.0", - "type": "hex", - "description": "placed in the final onion hop TLV" - }, - "description": { - "added": "v0.11.0", - "type": "string", - "description": "description used in the invoice" - } - } -} diff --git a/doc/schemas/sendpay.schema.json b/doc/schemas/sendpay.schema.json deleted file mode 100644 index f1030c2aa38b..000000000000 --- a/doc/schemas/sendpay.schema.json +++ /dev/null @@ -1,165 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": true, - "required": [ - "id", - "created_index", - "payment_hash", - "status", - "created_at", - "amount_sent_msat" - ], - "properties": { - "created_index": { - "added": "v23.11", - "type": "u64", - "description": "1-based index indicating order this payment was created in" - }, - "updated_index": { - "added": "v23.11", - "type": "u64", - "description": "1-based index indicating order this payment was changed (only present if it has changed since creation)" - }, - "id": { - "type": "u64", - "description": "old synonym for created_index" - }, - "groupid": { - "type": "u64", - "description": "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "status": { - "type": "string", - "enum": [ - "pending", - "complete" - ], - "description": "status of the payment (could be complete if already sent previously)" - }, - "amount_msat": { - "type": "msat", - "description": "The amount delivered to destination (if known)" - }, - "destination": { - "type": "pubkey", - "description": "the final destination of the payment if known" - }, - "created_at": { - "type": "u64", - "description": "the UNIX timestamp showing when this payment was initiated" - }, - "completed_at": { - "type": "u64", - "description": "the UNIX timestamp showing when this payment was completed" - }, - "amount_sent_msat": { - "type": "msat", - "description": "The amount sent" - }, - "label": { - "type": "string", - "description": "the *label*, if given to sendpay" - }, - "partid": { - "type": "u64", - "description": "the *partid*, if given to sendpay" - }, - "bolt11": { - "type": "string", - "description": "the bolt11 string (if supplied)" - }, - "bolt12": { - "type": "string", - "description": "the bolt12 string (if supplied: **experimental-offers** only)." - } - }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "complete" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "payment_preimage" - ], - "properties": { - "id": {}, - "created_index": {}, - "updated_index": {}, - "groupid": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "destination": {}, - "created_at": {}, - "completed_at": {}, - "msatoshi_sent": {}, - "amount_sent_msat": {}, - "label": {}, - "partid": {}, - "bolt11": {}, - "bolt12": {}, - "payment_preimage": { - "type": "secret", - "description": "the proof of payment: SHA256 of this **payment_hash**" - } - } - } - }, - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "pending" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "message" - ], - "properties": { - "id": {}, - "created_index": {}, - "updated_index": {}, - "groupid": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "destination": {}, - "created_at": {}, - "completed_at": {}, - "msatoshi_sent": {}, - "amount_sent_msat": {}, - "label": {}, - "partid": {}, - "bolt11": {}, - "bolt12": {}, - "message": { - "type": "string", - "description": "Monitor status with listpays or waitsendpay" - } - } - } - } - ] -} diff --git a/doc/schemas/sendpsbt.request.json b/doc/schemas/sendpsbt.request.json deleted file mode 100644 index e8e2f9e8d5a0..000000000000 --- a/doc/schemas/sendpsbt.request.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt" - ], - "properties": { - "psbt": { - "type": "string", - "description": "the fully signed psbt to be sent" - }, - "reserve": { - "type": "u32", - "description": "number of blocks to increase reservation of any of our inputs by. Default is 72" - } - } -} diff --git a/doc/schemas/sendpsbt.schema.json b/doc/schemas/sendpsbt.schema.json deleted file mode 100644 index d3c831d17544..000000000000 --- a/doc/schemas/sendpsbt.schema.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "tx", - "txid" - ], - "properties": { - "tx": { - "type": "hex", - "description": "The raw transaction which was sent" - }, - "txid": { - "type": "txid", - "description": "The txid of the **tx**" - } - } -} diff --git a/doc/schemas/setchannel.request.json b/doc/schemas/setchannel.request.json deleted file mode 100644 index c0eaad9dc50c..000000000000 --- a/doc/schemas/setchannel.request.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string", - "description": "should contain a scid (short channel ID), channel id or peerid (pubkey) of the channel to be modified. If *id* is set to `all`, the updates are applied to all channels in states CHANNELD_NORMAL CHANNELD_AWAITING_LOCKIN or DUALOPEND_AWAITING_LOCKIN. If *id* is a peerid, all channels with the +peer in those states are changed" - }, - "feebase": { - "type": "msat", - "description": "value in millisatoshi that is added as base fee to any routed payment: if omitted, it is unchanged. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*" - }, - "feeppm": { - "type": "u32", - "description": "value that is added proportionally per-millionths to any routed payment volume in satoshi. For example, if ppm is 1,000 and 1,000,000 satoshi is being routed through the channel, an proportional fee of 1,000 satoshi is added, resulting in a 0.1% fee" - }, - "htlcmin": { - "type": "msat", - "description": "value that limits how small an HTLC we will forward: if omitted, it is unchanged (the default is no lower limit). It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. Note that the peer also enforces a minimum for the channel: setting it below that will simply set it to that value with a warning. Also note that *htlcmin* only applies to forwarded HTLCs: we can still send smaller payments ourselves" - }, - "htlcmax": { - "type": "msat", - "description": "value that limits how large an HTLC we will forward: if omitted, it is unchanged (the default is no effective limit). It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. Note that *htlcmax* only applies to forwarded HTLCs: we can still send larger payments ourselves" - }, - "enforcedelay": { - "type": "u32", - "description": "number of seconds to delay before enforcing the new fees/htlc max (default 600, which is ten minutes). This gives the network a chance to catch up with the new rates and avoids rejecting HTLCs before they do. This only has an effect if rates are increased (we always allow users to overpay fees) or *htlcmax* is decreased, and only applied to a single rate increase per channel (we don't remember an arbitrary number of prior feerates) and if the node is restarted the updated configuration is enforced immediately" - }, - "ignorefeelimits": { - "added": "v23.08", - "type": "boolean", - "description": "if set to True means to allow the peer to set the commitment transaction fees (or closing transaction fees) to any value they want. This is dangerous: they could set an exorbitant fee (so HTLCs are unenforcable), or a tiny fee (so that commitment transactions cannot be relayed), but avoids channel breakage in case of feerate disagreements. (Note: the global `ignore_fee_limits` setting overrides this)" - } - } -} diff --git a/doc/schemas/setchannel.schema.json b/doc/schemas/setchannel.schema.json deleted file mode 100644 index d4dd33cff990..000000000000 --- a/doc/schemas/setchannel.schema.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channels" - ], - "properties": { - "channels": { - "type": "array", - "description": "channel(s) set, and their resulting configuration", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "peer_id", - "channel_id", - "fee_base_msat", - "fee_proportional_millionths", - "minimum_htlc_out_msat", - "maximum_htlc_out_msat", - "ignore_fee_limits" - ], - "properties": { - "peer_id": { - "type": "pubkey", - "description": "The node_id of the peer" - }, - "channel_id": { - "type": "hex", - "description": "The channel_id of the channel", - "minLength": 64, - "maxLength": 64 - }, - "short_channel_id": { - "type": "short_channel_id", - "description": "the short_channel_id (if locked in)" - }, - "fee_base_msat": { - "type": "msat", - "description": "The resulting feebase (this is the BOLT #7 name)" - }, - "fee_proportional_millionths": { - "type": "u32", - "description": "The resulting feeppm (this is the BOLT #7 name)" - }, - "ignore_fee_limits": { - "type": "boolean", - "added": "v23.08", - "description": "If we are now allowing peer to set feerate on commitment transaction without restriction" - }, - "minimum_htlc_out_msat": { - "type": "msat", - "description": "The resulting htlcmin we will advertize (the BOLT #7 name is htlc_minimum_msat)" - }, - "warning_htlcmin_too_low": { - "type": "string", - "description": "The requested htlcmin was too low for this peer, so we set it to the minimum they will allow" - }, - "maximum_htlc_out_msat": { - "type": "msat", - "description": "The resulting htlcmax we will advertize (the BOLT #7 name is htlc_maximum_msat)" - }, - "warning_htlcmax_too_high": { - "type": "string", - "description": "The requested htlcmax was greater than the channel capacity, so we set it to the channel capacity" - } - } - } - } - } -} diff --git a/doc/schemas/setconfig.request.json b/doc/schemas/setconfig.request.json deleted file mode 100644 index f01feeeabdc2..000000000000 --- a/doc/schemas/setconfig.request.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "config" - ], - "added": "v23.08", - "properties": { - "config": { - "type": "string", - "description": "name of the config variable which should be set to the value of the variable" - }, - "val": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - }, - { - "type": "boolean" - } - ], - "description": "value of the config variable to be set or updated" - } - } -} diff --git a/doc/schemas/setconfig.schema.json b/doc/schemas/setconfig.schema.json deleted file mode 100644 index a4c09e32cb61..000000000000 --- a/doc/schemas/setconfig.schema.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "added": "v23.08", - "required": [ - "config" - ], - "properties": { - "config": { - "type": "object", - "description": "config settings after completion", - "additionalProperties": false, - "required": [ - "config", - "source", - "dynamic" - ], - "properties": { - "config": { - "type": "string", - "description": "name of the config variable which was set" - }, - "source": { - "type": "string", - "description": "source of configuration setting (`file`:`linenum`)" - }, - "plugin": { - "type": "string", - "description": "the plugin this configuration setting is for" - }, - "dynamic": { - "type": "boolean", - "enum": [ - true - ], - "description": "whether this option is settable via setconfig" - }, - "set": { - "type": "boolean", - "description": "for simple flag options" - }, - "value_str": { - "type": "string", - "description": "for string options" - }, - "value_msat": { - "type": "msat", - "description": "for msat options" - }, - "value_int": { - "type": "integer", - "description": "for integer options" - }, - "value_bool": { - "type": "boolean", - "description": "for boolean options" - } - } - } - } -} diff --git a/doc/schemas/setpsbtversion.request.json b/doc/schemas/setpsbtversion.request.json deleted file mode 100644 index c6abb424a22f..000000000000 --- a/doc/schemas/setpsbtversion.request.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt", - "version" - ], - "properties": { - "psbt": { - "type": "string", - "description": "the PSBT to change versions" - }, - "version": { - "type": "u32", - "description": "the version to set" - } - } -} diff --git a/doc/schemas/setpsbtversion.schema.json b/doc/schemas/setpsbtversion.schema.json deleted file mode 100644 index 4b6d442990dc..000000000000 --- a/doc/schemas/setpsbtversion.schema.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt" - ], - "properties": { - "psbt": { - "type": "string", - "description": "a converted PSBT of the requested version" - } - } -} diff --git a/doc/schemas/showrunes.request.json b/doc/schemas/showrunes.request.json deleted file mode 100644 index da2831ff7379..000000000000 --- a/doc/schemas/showrunes.request.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "added": "v23.08", - "properties": { - "rune": { - "type": "string", - "description": "if specified, only details of that rune will be returned" - } - } -} diff --git a/doc/schemas/showrunes.schema.json b/doc/schemas/showrunes.schema.json deleted file mode 100644 index 0fa759100f1f..000000000000 --- a/doc/schemas/showrunes.schema.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "runes" - ], - "properties": { - "runes": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "rune", - "unique_id", - "restrictions", - "restrictions_as_english" - ], - "properties": { - "rune": { - "type": "string", - "description": "Base64 encoded rune" - }, - "unique_id": { - "type": "string", - "description": "Unique id assigned when the rune was generated; this is always a u64 for commando runes" - }, - "restrictions": { - "type": "array", - "description": "The restrictions on what commands this rune can authorize", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "alternatives", - "english" - ], - "properties": { - "alternatives": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "fieldname", - "value", - "condition", - "english" - ], - "properties": { - "fieldname": { - "type": "string", - "description": "The field this restriction applies to; see commando-rune(7)" - }, - "value": { - "type": "string", - "description": "The value accepted for this field" - }, - "condition": { - "type": "string", - "description": "The way to compare fieldname and value" - }, - "english": { - "type": "string", - "description": "English readable description of this alternative" - } - } - } - }, - "english": { - "type": "string", - "description": "English readable summary of alternatives above" - } - } - } - }, - "restrictions_as_english": { - "type": "string", - "description": "English readable description of the restrictions array above" - }, - "stored": { - "type": "boolean", - "enum": [ - false - ], - "description": "This is false if the rune does not appear in our datastore (only possible when `rune` is specified)" - }, - "blacklisted": { - "type": "boolean", - "enum": [ - true - ], - "description": "The rune has been blacklisted; see commando-blacklist(7)" - }, - "last_used": { - "type": "number", - "description": "The last time this rune was successfully used", - "added": "23.11" - }, - "our_rune": { - "type": "boolean", - "enum": [ - false - ], - "description": "This is not a rune for this node (only possible when `rune` is specified)" - } - } - } - } - } -} diff --git a/doc/schemas/signinvoice.request.json b/doc/schemas/signinvoice.request.json deleted file mode 100644 index 13b948a45889..000000000000 --- a/doc/schemas/signinvoice.request.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "added": "v23.02", - "required": [ - "invstring" - ], - "properties": { - "invstring": { - "type": "string", - "description": "bolt11 form, but the final signature is ignored. Minimal sanity checks are done" - } - } -} diff --git a/doc/schemas/signinvoice.schema.json b/doc/schemas/signinvoice.schema.json deleted file mode 100644 index bf9be4741211..000000000000 --- a/doc/schemas/signinvoice.schema.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "bolt11" - ], - "properties": { - "bolt11": { - "type": "string", - "description": "the bolt11 string" - } - } -} diff --git a/doc/schemas/signmessage.request.json b/doc/schemas/signmessage.request.json deleted file mode 100644 index 9ff224c7f339..000000000000 --- a/doc/schemas/signmessage.request.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "message" - ], - "additionalProperties": false, - "properties": { - "message": { - "type": "string", - "description": "less that 65536 characters long message to be signed by the node" - } - } -} diff --git a/doc/schemas/signmessage.schema.json b/doc/schemas/signmessage.schema.json deleted file mode 100644 index 42eea4e774f4..000000000000 --- a/doc/schemas/signmessage.schema.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "signature", - "recid", - "zbase" - ], - "properties": { - "signature": { - "type": "hex", - "description": "The signature", - "minLength": 128, - "maxLength": 128 - }, - "recid": { - "type": "hex", - "description": "The recovery id (0, 1, 2 or 3)", - "minLength": 2, - "maxLength": 2 - }, - "zbase": { - "type": "string", - "description": "*signature* and *recid* encoded in a style compatible with **lnd**'s [SignMessageRequest](https://api.lightning.community/#grpc-request-signmessagerequest)" - } - } -} diff --git a/doc/schemas/signpsbt.request.json b/doc/schemas/signpsbt.request.json deleted file mode 100644 index 11cbe05e1778..000000000000 --- a/doc/schemas/signpsbt.request.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt" - ], - "properties": { - "psbt": { - "type": "string", - "description": "the psbt to be signed" - }, - "signonly": { - "type": "array", - "description": "input numbers to sign", - "items": { - "type": "u32" - } - } - } -} diff --git a/doc/schemas/signpsbt.schema.json b/doc/schemas/signpsbt.schema.json deleted file mode 100644 index 271f58c9bd78..000000000000 --- a/doc/schemas/signpsbt.schema.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "signed_psbt" - ], - "properties": { - "signed_psbt": { - "type": "string", - "description": "The fully signed PSBT" - } - } -} diff --git a/doc/schemas/splice_init.request.json b/doc/schemas/splice_init.request.json deleted file mode 100644 index 01573ac1090a..000000000000 --- a/doc/schemas/splice_init.request.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channel_id", - "relative_amount" - ], - "added": "v23.08", - "properties": { - "channel_id": { - "type": "string", - "description": "the channel id of the channel to be spliced" - }, - "relative_amount": { - "type": "integer", - "description": "a positive or negative amount of satoshis to add or subtract from the channel" - }, - "initialpsbt": { - "type": "string", - "description": "the (optional) base 64 encoded PSBT to begin with. If not specified, one will be generated automatically" - }, - "feerate_per_kw": { - "type": "u32", - "description": "the miner fee we promise our peer to pay for our side of the splice transaction. It is calculated by `feerate_per_kw` * our_bytes_in_splice_tx / 1000" - }, - "force_feerate": { - "type": "boolean", - "description": "by default splices will fail if the fee provided looks too high. This is to protect against accidentally setting your fee higher than intended. Set `force_feerate` to true to skip this saftey check" - } - } -} diff --git a/doc/schemas/splice_init.schema.json b/doc/schemas/splice_init.schema.json deleted file mode 100644 index 0551f7e8180b..000000000000 --- a/doc/schemas/splice_init.schema.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt" - ], - "added": "v23.08", - "properties": { - "psbt": { - "type": "string", - "description": "the (incomplete) PSBT of the splice transaction" - } - } -} diff --git a/doc/schemas/splice_signed.request.json b/doc/schemas/splice_signed.request.json deleted file mode 100644 index 8e6b8dec2515..000000000000 --- a/doc/schemas/splice_signed.request.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channel_id", - "psbt" - ], - "added": "v23.08", - "properties": { - "channel_id": { - "type": "string", - "description": "the channel id of the channel to be spliced" - }, - "psbt": { - "type": "string", - "description": "the final version of the psbt to complete the splice with" - }, - "sign_first": { - "type": "boolean", - "description": "a flag that makes our node offer the final splice signature first (defaults to false). When false, the node will calculate who should sign first based off who is adding inputting the least sats to the splice as per spec" - } - } -} diff --git a/doc/schemas/splice_signed.schema.json b/doc/schemas/splice_signed.schema.json deleted file mode 100644 index 0457c2d346d4..000000000000 --- a/doc/schemas/splice_signed.schema.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "tx", - "txid" - ], - "added": "v23.08", - "properties": { - "tx": { - "type": "hex", - "description": "The hex representation of the final transaction that is published" - }, - "txid": { - "type": "txid", - "description": "The txid is of the final transaction" - } - } -} diff --git a/doc/schemas/splice_update.request.json b/doc/schemas/splice_update.request.json deleted file mode 100644 index 1cdac8e25e39..000000000000 --- a/doc/schemas/splice_update.request.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "channel_id", - "psbt" - ], - "added": "v23.08", - "properties": { - "channel_id": { - "type": "string", - "description": "the channel id of the channel to be spliced" - }, - "psbt": { - "type": "string", - "description": "the base 64 encoded PSBT returned from `splice_init` with any changes added by the user" - } - } -} diff --git a/doc/schemas/splice_update.schema.json b/doc/schemas/splice_update.schema.json deleted file mode 100644 index 96e04edac6d1..000000000000 --- a/doc/schemas/splice_update.schema.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt", - "commitments_secured" - ], - "added": "v23.08", - "properties": { - "psbt": { - "type": "string", - "description": "the (incomplete) PSBT of the splice transaction" - }, - "commitments_secured": { - "type": "boolean", - "description": "whether or not the commitments were secured" - } - } -} diff --git a/doc/schemas/sql.request.json b/doc/schemas/sql.request.json deleted file mode 100644 index 97c6dd25eee7..000000000000 --- a/doc/schemas/sql.request.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "query" - ], - "added": "v23.02", - "properties": { - "query": { - "type": "string" - } - } -} diff --git a/doc/schemas/sql.schema.json b/doc/schemas/sql.schema.json deleted file mode 100644 index fe249edb5ef6..000000000000 --- a/doc/schemas/sql.schema.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "rows" - ], - "properties": { - "rows": { - "type": "array", - "items": { - "type": "array" - } - }, - "warning_db_failure": { - "type": "string", - "description": "A message if the database encounters an error partway through" - } - } -} diff --git a/doc/schemas/staticbackup.request.json b/doc/schemas/staticbackup.request.json deleted file mode 100644 index f99496c5ac84..000000000000 --- a/doc/schemas/staticbackup.request.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": {} -} diff --git a/doc/schemas/staticbackup.schema.json b/doc/schemas/staticbackup.schema.json deleted file mode 100644 index bc9daeb2e136..000000000000 --- a/doc/schemas/staticbackup.schema.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "scb" - ], - "properties": { - "scb": { - "type": "array", - "items": { - "type": "hex", - "description": "SCB of a channel in TLV format" - } - } - } -} diff --git a/doc/schemas/stop.request.json b/doc/schemas/stop.request.json deleted file mode 100644 index 65571ad4c703..000000000000 --- a/doc/schemas/stop.request.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": {} -} diff --git a/doc/schemas/stop.schema.json b/doc/schemas/stop.schema.json deleted file mode 100644 index 1facf249798a..000000000000 --- a/doc/schemas/stop.schema.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "result" - ], - "properties": { - "result": { - "type": "string", - "added": "v24.05", - "enum": [ - "Shutdown complete" - ] - } - } -} diff --git a/doc/schemas/txdiscard.request.json b/doc/schemas/txdiscard.request.json deleted file mode 100644 index 7a9e87538208..000000000000 --- a/doc/schemas/txdiscard.request.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "txid" - ], - "properties": { - "txid": { - "type": "txid", - "description": "the transaction id, inputs should be unreseverd from" - } - } -} diff --git a/doc/schemas/txdiscard.schema.json b/doc/schemas/txdiscard.schema.json deleted file mode 100644 index 956380618c6d..000000000000 --- a/doc/schemas/txdiscard.schema.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "unsigned_tx", - "txid" - ], - "properties": { - "unsigned_tx": { - "type": "hex", - "description": "the unsigned transaction" - }, - "txid": { - "type": "txid", - "description": "the transaction id of *unsigned_tx*" - } - } -} diff --git a/doc/schemas/txprepare.request.json b/doc/schemas/txprepare.request.json deleted file mode 100644 index da224d383ee4..000000000000 --- a/doc/schemas/txprepare.request.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "outputs" - ], - "properties": { - "outputs": { - "type": "array", - "description": "format is like: [{destination1: amount1}, {destination2: amount2}] or [{destination: *all*}]. It supports any number of **confirmed** outputs", - "items": { - "type": "outputdesc" - } - }, - "feerate": { - "type": "feerate", - "description": "used for the transaction as initial feerate. The default is *normal*" - }, - "minconf": { - "type": "u32", - "description": "the minimum number of confirmations that used outputs should have. Default is 1" - }, - "utxos": { - "type": "array", - "description": "to be used to fund the transaction, as an array of `txid:vout`. These must be drawn from the node's available UTXO set", - "items": { - "type": "outpoint" - } - } - } -} diff --git a/doc/schemas/txprepare.schema.json b/doc/schemas/txprepare.schema.json deleted file mode 100644 index 2377c322c123..000000000000 --- a/doc/schemas/txprepare.schema.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "psbt", - "unsigned_tx", - "txid" - ], - "properties": { - "psbt": { - "type": "string", - "description": "the PSBT representing the unsigned transaction" - }, - "unsigned_tx": { - "type": "hex", - "description": "the unsigned transaction" - }, - "txid": { - "type": "txid", - "description": "the transaction id of *unsigned_tx*; you hand this to lightning-txsend(7) or lightning-txdiscard(7), as the inputs of this transaction are reserved." - } - } -} diff --git a/doc/schemas/txsend.request.json b/doc/schemas/txsend.request.json deleted file mode 100644 index 18ef78478ffa..000000000000 --- a/doc/schemas/txsend.request.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "txid" - ], - "properties": { - "txid": { - "type": "txid", - "description": "The transaction id of the transaction created by **txprepare**" - } - } -} diff --git a/doc/schemas/txsend.schema.json b/doc/schemas/txsend.schema.json deleted file mode 100644 index e7a47f1ca164..000000000000 --- a/doc/schemas/txsend.schema.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "psbt", - "tx", - "txid" - ], - "properties": { - "psbt": { - "type": "string", - "description": "the completed PSBT representing the signed transaction" - }, - "tx": { - "type": "hex", - "description": "the fully signed transaction" - }, - "txid": { - "type": "txid", - "description": "the transaction id of *tx*" - } - } -} diff --git a/doc/schemas/unreserveinputs.request.json b/doc/schemas/unreserveinputs.request.json deleted file mode 100644 index c4f12479bbc8..000000000000 --- a/doc/schemas/unreserveinputs.request.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt" - ], - "properties": { - "psbt": { - "type": "string", - "description": "inputs to unreserve are the inputs specified in the passed-in *psbt*" - }, - "reserve": { - "type": "u32", - "description": "the number of blocks to decrease reservation by; default is 72" - } - } -} diff --git a/doc/schemas/unreserveinputs.schema.json b/doc/schemas/unreserveinputs.schema.json deleted file mode 100644 index 264f603a26cf..000000000000 --- a/doc/schemas/unreserveinputs.schema.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "reservations" - ], - "properties": { - "reservations": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "txid", - "vout", - "was_reserved", - "reserved" - ], - "properties": { - "txid": { - "type": "txid", - "description": "the transaction id" - }, - "vout": { - "type": "u32", - "description": "the output number which was reserved" - }, - "was_reserved": { - "type": "boolean", - "description": "whether the input was already reserved (usually `true`)" - }, - "reserved": { - "type": "boolean", - "description": "whether the input is now reserved (may still be `true` if it was reserved for a long time)" - } - }, - "allOf": [ - { - "if": { - "additionalProperties": true, - "properties": { - "reserved": { - "enum": [ - true - ] - } - } - }, - "then": { - "required": [ - "reserved_to_block" - ], - "properties": { - "txid": {}, - "vout": {}, - "was_reserved": {}, - "reserved": {}, - "reserved_to_block": { - "type": "u32", - "description": "what blockheight the reservation will expire" - } - } - } - } - ] - } - } - } -} diff --git a/doc/schemas/upgradewallet.request.json b/doc/schemas/upgradewallet.request.json deleted file mode 100644 index 60f58ec1763b..000000000000 --- a/doc/schemas/upgradewallet.request.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": { - "feerate": { - "type": "feerate", - "description": "Feerate for the upgrade transaction", - "added": "v23.02" - }, - "reservedok": { - "type": "boolean", - "description": "Include already reserved funds or not", - "added": "v23.02" - } - } -} diff --git a/doc/schemas/upgradewallet.schema.json b/doc/schemas/upgradewallet.schema.json deleted file mode 100644 index cd4a5c957c44..000000000000 --- a/doc/schemas/upgradewallet.schema.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "upgraded_outs" - ], - "properties": { - "upgraded_outs": { - "type": "u64", - "description": "Count of spent/upgraded UTXOs", - "added": "v23.02" - }, - "psbt": { - "type": "string", - "description": "The PSBT that was finalized and sent", - "added": "v23.02" - }, - "tx": { - "type": "hex", - "description": "The raw transaction which was sent", - "added": "v23.02" - }, - "txid": { - "type": "txid", - "description": "The txid of the **tx**", - "added": "v23.02" - } - } -} diff --git a/doc/schemas/utxopsbt.request.json b/doc/schemas/utxopsbt.request.json deleted file mode 100644 index db6f3d98c663..000000000000 --- a/doc/schemas/utxopsbt.request.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "satoshi", - "feerate", - "startweight", - "utxos" - ], - "properties": { - "satoshi": { - "type": "msat_or_all", - "description": "the minimum satoshi value of the output(s) needed (or the string `all` meaning use all unreserved inputs). If a value, it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" - }, - "feerate": { - "type": "feerate", - "description": "used for the transaction as initial feerate. The default is *normal*" - }, - "startweight": { - "type": "u32", - "description": "the weight of the transaction before *fundpsbt* has added any inputs" - }, - "utxos": { - "type": "array", - "description": "an array of `txid:vout`, each of which must be reserved or available", - "items": { - "type": "outpoint" - } - }, - "reserve": { - "type": "u32", - "description": "if not zero, then *reserveinputs* is called (successfully, with *exclusive* true) on the returned PSBT for this number of blocks. Defaults to 72 blocks if unspecified" - }, - "reservedok": { - "type": "boolean", - "description": "if set to true, it will also fail if any of the *utxos* are already reserved. Default is false" - }, - "locktime": { - "type": "u32", - "description": "if not set, it is set to a recent block height" - }, - "min_witness_weight": { - "type": "u32", - "description": "minimum weight to use for a UTXO's witness. If the actual witness weight is greater than the provided minimum, the actual witness weight will be used" - }, - "excess_as_change": { - "type": "boolean", - "description": "flag to add a change output for the excess sats" - }, - "opening_anchor_channel": { - "added": "v23.08", - "type": "boolean", - "description": "to signel that it needs emergency reserve for anchors so that we can lowball our commitment tx fees, and min-emergency-msat for reserving some sats for closing anchor channels" - } - } -} diff --git a/doc/schemas/utxopsbt.schema.json b/doc/schemas/utxopsbt.schema.json deleted file mode 100644 index d24ad03488f7..000000000000 --- a/doc/schemas/utxopsbt.schema.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt", - "feerate_per_kw", - "estimated_final_weight", - "excess_msat" - ], - "properties": { - "psbt": { - "type": "string", - "description": "Unsigned PSBT which fulfills the parameters given" - }, - "feerate_per_kw": { - "type": "u32", - "description": "The feerate used to create the PSBT, in satoshis-per-kiloweight" - }, - "estimated_final_weight": { - "type": "u32", - "description": "The estimated weight of the transaction once fully signed" - }, - "excess_msat": { - "type": "msat", - "description": "The amount above *satoshi* which is available. This could be zero, or dust; it will be zero if *change_outnum* is also returned" - }, - "change_outnum": { - "type": "u32", - "description": "The 0-based output number where change was placed (only if parameter *excess_as_change* was true and there was sufficient funds)" - }, - "reservations": { - "type": "array", - "description": "If *reserve* was true or a non-zero number, just as per lightning-reserveinputs(7)", - "items": { - "type": "object", - "required": [ - "txid", - "vout", - "was_reserved", - "reserved", - "reserved_to_block" - ], - "additionalProperties": false, - "properties": { - "txid": { - "type": "txid", - "description": "The txid of the transaction" - }, - "vout": { - "type": "u32", - "description": "The 0-based output number" - }, - "was_reserved": { - "type": "boolean", - "description": "Whether this output was previously reserved" - }, - "reserved": { - "type": "boolean", - "enum": [ - true - ], - "description": "Whether this output is now reserved" - }, - "reserved_to_block": { - "type": "u32", - "description": "The blockheight the reservation will expire" - } - } - } - } - } -} diff --git a/doc/schemas/wait.request.json b/doc/schemas/wait.request.json deleted file mode 100644 index e21c13d6095a..000000000000 --- a/doc/schemas/wait.request.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "added": "v23.08", - "additionalProperties": false, - "required": [ - "subsystem", - "indexname", - "nextvalue" - ], - "properties": { - "subsystem": { - "type": "string", - "description": "the subsystem to get the next index value from", - "enum": [ - "invoices", - "forwards", - "sendpays" - ] - }, - "indexname": { - "type": "string", - "description": "the name of the index to get the next value for", - "enum": [ - "created", - "updated", - "deleted" - ] - }, - "nextvalue": { - "type": "u64", - "description": "the next value of the index" - } - } -} diff --git a/doc/schemas/wait.schema.json b/doc/schemas/wait.schema.json deleted file mode 100644 index ce3238d0f941..000000000000 --- a/doc/schemas/wait.schema.json +++ /dev/null @@ -1,189 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "subsystem" - ], - "properties": { - "subsystem": { - "type": "string", - "enum": [ - "invoices", - "forwards", - "sendpays" - ] - }, - "created": { - "type": "u64", - "description": "1-based index indicating order entry was created" - }, - "updated": { - "type": "u64", - "description": "1-based index indicating order entry was updated" - }, - "deleted": { - "type": "u64", - "description": "1-based index indicating order entry was deleted" - }, - "details": {} - }, - "allOf": [ - { - "if": { - "additionalProperties": true, - "properties": { - "subsystem": { - "type": "string", - "enum": [ - "invoices" - ] - } - } - }, - "then": { - "additionalProperties": false, - "properties": { - "subsystem": {}, - "created": {}, - "updated": {}, - "deleted": {}, - "details": { - "type": "object", - "additionalProperties": false, - "properties": { - "status": { - "type": "string", - "enum": [ - "unpaid", - "paid", - "expired" - ], - "description": "Whether it's paid, unpaid or unpayable" - }, - "label": { - "type": "string", - "description": "unique label supplied at invoice creation" - }, - "description": { - "type": "string", - "description": "description used in the invoice" - }, - "bolt11": { - "type": "string", - "description": "the BOLT11 string" - }, - "bolt12": { - "type": "string", - "description": "the BOLT12 string" - } - } - } - } - } - }, - { - "if": { - "additionalProperties": true, - "properties": { - "subsystem": { - "type": "string", - "enum": [ - "forwards" - ] - } - } - }, - "then": { - "additionalProperties": false, - "properties": { - "subsystem": {}, - "created": {}, - "updated": {}, - "deleted": {}, - "details": { - "type": "object", - "additionalProperties": false, - "properties": { - "status": { - "type": "string", - "enum": [ - "offered", - "settled", - "failed", - "local_failed" - ], - "description": "still ongoing, completed, failed locally, or failed after forwarding" - }, - "in_channel": { - "type": "short_channel_id", - "description": "unique label supplied at invoice creation" - }, - "in_htlc_id": { - "type": "u64", - "description": "the unique HTLC id the sender gave this (not present if incoming channel was closed before ugprade to v22.11)" - }, - "in_msat": { - "type": "msat", - "description": "the value of the incoming HTLC" - }, - "out_channel": { - "type": "short_channel_id", - "description": "the channel that the HTLC (trying to) forward to" - } - } - } - } - } - }, - { - "if": { - "additionalProperties": true, - "properties": { - "subsystem": { - "type": "string", - "enum": [ - "sendpays" - ] - } - } - }, - "then": { - "additionalProperties": false, - "properties": { - "subsystem": {}, - "created": {}, - "updated": {}, - "deleted": {}, - "details": { - "type": "object", - "additionalProperties": false, - "properties": { - "status": { - "type": "string", - "enum": [ - "pending", - "failed", - "complete" - ], - "description": "status of the payment" - }, - "partid": { - "type": "u64", - "description": "Part number (for multiple parts to a single payment)" - }, - "groupid": { - "type": "u64", - "description": "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - } - } - } - } - } - } - ] -} diff --git a/doc/schemas/waitanyinvoice.request.json b/doc/schemas/waitanyinvoice.request.json deleted file mode 100644 index f39c0b8f3077..000000000000 --- a/doc/schemas/waitanyinvoice.request.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "lastpay_index": { - "type": "u64", - "description": "ignores any invoices paid prior to or including this index. 0 is equivalent to not specifying and negative value is invalid" - }, - "timeout": { - "type": "u64", - "description": "if specified, wait at most that number of seconds, which must be an integer. If the specified *timeout* is reached, this command will return with an error. You can specify this to 0 so that **waitanyinvoice** will return immediately with an error if no pending invoice is available yet. If unspecified, this command will wait indefinitely" - } - } -} diff --git a/doc/schemas/waitanyinvoice.schema.json b/doc/schemas/waitanyinvoice.schema.json deleted file mode 100644 index 89e7eb70b443..000000000000 --- a/doc/schemas/waitanyinvoice.schema.json +++ /dev/null @@ -1,151 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": true, - "required": [ - "label", - "description", - "payment_hash", - "status", - "created_index", - "expires_at" - ], - "properties": { - "label": { - "type": "string", - "description": "unique label supplied at invoice creation" - }, - "description": { - "type": "string", - "description": "description used in the invoice" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "status": { - "type": "string", - "enum": [ - "paid", - "expired" - ], - "description": "Whether it's paid or expired" - }, - "expires_at": { - "type": "u64", - "description": "UNIX timestamp of when it will become / became unpayable" - }, - "amount_msat": { - "type": "msat", - "description": "the amount required to pay this invoice" - }, - "bolt11": { - "type": "string", - "description": "the BOLT11 string (always present unless *bolt12* is)" - }, - "bolt12": { - "type": "string", - "description": "the BOLT12 string (always present unless *bolt11* is)" - }, - "created_index": { - "type": "u64", - "added": "v23.08", - "description": "1-based index indicating order this invoice was created in" - }, - "updated_index": { - "type": "u64", - "added": "v23.08", - "description": "1-based index indicating order this invoice was changed (only present if it has changed since creation)" - } - }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "paid" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "pay_index", - "amount_received_msat", - "paid_at", - "payment_preimage" - ], - "properties": { - "label": {}, - "description": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "bolt11": {}, - "bolt12": {}, - "expires_at": {}, - "created_index": {}, - "updated_index": {}, - "pay_index": { - "type": "u64", - "description": "Unique incrementing index for this payment" - }, - "amount_received_msat": { - "type": "msat", - "description": "the amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)" - }, - "paid_at": { - "type": "u64", - "description": "UNIX timestamp of when it was paid" - }, - "paid_outpoint": { - "type": "object", - "description": "Outpoint this invoice was paid with", - "added": "v23.11", - "additionalProperties": false, - "required": [ - "txid", - "outnum" - ], - "properties": { - "txid": { - "added": "v23.11", - "type": "txid", - "description": "ID of the transaction that paid the invoice" - }, - "outnum": { - "added": "v23.11", - "type": "u32", - "description": "The 0-based output number of the transaction that paid the invoice" - } - } - }, - "payment_preimage": { - "type": "secret", - "description": "proof of payment" - } - } - }, - "else": { - "additionalProperties": false, - "properties": { - "label": {}, - "description": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "bolt11": {}, - "bolt12": {}, - "created_index": {}, - "updated_index": {}, - "expires_at": {} - } - } - } - ] -} diff --git a/doc/schemas/waitblockheight.request.json b/doc/schemas/waitblockheight.request.json deleted file mode 100644 index 3e2a1b091643..000000000000 --- a/doc/schemas/waitblockheight.request.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "blockheight" - ], - "properties": { - "blockheight": { - "type": "u32", - "description": "current blockheight of the blockchain if the value is greater than this number. If it is a present or past block height, then the command returns immediately" - }, - "timeout": { - "type": "u32", - "description": "only wait up to specified seconds. Defaults to 60 seconds" - } - } -} diff --git a/doc/schemas/waitblockheight.schema.json b/doc/schemas/waitblockheight.schema.json deleted file mode 100644 index 71fd35ca3897..000000000000 --- a/doc/schemas/waitblockheight.schema.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "blockheight" - ], - "properties": { - "blockheight": { - "type": "u32", - "description": "The current block height (>= *blockheight* parameter)" - } - } -} diff --git a/doc/schemas/waitinvoice.request.json b/doc/schemas/waitinvoice.request.json deleted file mode 100644 index 84eb8084a7ef..000000000000 --- a/doc/schemas/waitinvoice.request.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "label" - ], - "properties": { - "label": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ], - "description": "unique label of the invoice waiting to be paid" - } - } -} diff --git a/doc/schemas/waitinvoice.schema.json b/doc/schemas/waitinvoice.schema.json deleted file mode 100644 index 89e7eb70b443..000000000000 --- a/doc/schemas/waitinvoice.schema.json +++ /dev/null @@ -1,151 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": true, - "required": [ - "label", - "description", - "payment_hash", - "status", - "created_index", - "expires_at" - ], - "properties": { - "label": { - "type": "string", - "description": "unique label supplied at invoice creation" - }, - "description": { - "type": "string", - "description": "description used in the invoice" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "status": { - "type": "string", - "enum": [ - "paid", - "expired" - ], - "description": "Whether it's paid or expired" - }, - "expires_at": { - "type": "u64", - "description": "UNIX timestamp of when it will become / became unpayable" - }, - "amount_msat": { - "type": "msat", - "description": "the amount required to pay this invoice" - }, - "bolt11": { - "type": "string", - "description": "the BOLT11 string (always present unless *bolt12* is)" - }, - "bolt12": { - "type": "string", - "description": "the BOLT12 string (always present unless *bolt11* is)" - }, - "created_index": { - "type": "u64", - "added": "v23.08", - "description": "1-based index indicating order this invoice was created in" - }, - "updated_index": { - "type": "u64", - "added": "v23.08", - "description": "1-based index indicating order this invoice was changed (only present if it has changed since creation)" - } - }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "paid" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "pay_index", - "amount_received_msat", - "paid_at", - "payment_preimage" - ], - "properties": { - "label": {}, - "description": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "bolt11": {}, - "bolt12": {}, - "expires_at": {}, - "created_index": {}, - "updated_index": {}, - "pay_index": { - "type": "u64", - "description": "Unique incrementing index for this payment" - }, - "amount_received_msat": { - "type": "msat", - "description": "the amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)" - }, - "paid_at": { - "type": "u64", - "description": "UNIX timestamp of when it was paid" - }, - "paid_outpoint": { - "type": "object", - "description": "Outpoint this invoice was paid with", - "added": "v23.11", - "additionalProperties": false, - "required": [ - "txid", - "outnum" - ], - "properties": { - "txid": { - "added": "v23.11", - "type": "txid", - "description": "ID of the transaction that paid the invoice" - }, - "outnum": { - "added": "v23.11", - "type": "u32", - "description": "The 0-based output number of the transaction that paid the invoice" - } - } - }, - "payment_preimage": { - "type": "secret", - "description": "proof of payment" - } - } - }, - "else": { - "additionalProperties": false, - "properties": { - "label": {}, - "description": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "bolt11": {}, - "bolt12": {}, - "created_index": {}, - "updated_index": {}, - "expires_at": {} - } - } - } - ] -} diff --git a/doc/schemas/waitsendpay.request.json b/doc/schemas/waitsendpay.request.json deleted file mode 100644 index 8add51b93046..000000000000 --- a/doc/schemas/waitsendpay.request.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "payment_hash" - ], - "properties": { - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage*" - }, - "timeout": { - "type": "u32", - "description": "a timeout in seconds, for this RPC command to return. If the *timeout* is provided and the given amount of time passes without the payment definitely succeeding or definitely failing, this command returns with a 200 error code (payment still in progress). If *timeout* is not provided this call will wait indefinitely. Indicating a *timeout* of 0 effectively makes this call a pollable query of the status of the payment" - }, - "partid": { - "type": "u64", - "description": "unique ID within this (multi-part) payment. It must match that of the **sendpay** command" - }, - "groupid": { - "type": "u64", - "description": "grouping key to disambiguate multiple attempts to pay the same payment_hash" - } - } -} diff --git a/doc/schemas/waitsendpay.schema.json b/doc/schemas/waitsendpay.schema.json deleted file mode 100644 index 1bf4f08caf7f..000000000000 --- a/doc/schemas/waitsendpay.schema.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": true, - "required": [ - "id", - "created_index", - "payment_hash", - "status", - "created_at", - "amount_sent_msat" - ], - "properties": { - "created_index": { - "added": "v23.11", - "type": "u64", - "description": "1-based index indicating order this payment was created in" - }, - "id": { - "type": "u64", - "description": "old synonym for created_index" - }, - "groupid": { - "type": "u64", - "description": "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash" - }, - "payment_hash": { - "type": "hash", - "description": "the hash of the *payment_preimage* which will prove payment" - }, - "status": { - "type": "string", - "enum": [ - "complete" - ], - "description": "status of the payment" - }, - "amount_msat": { - "type": "msat", - "description": "The amount delivered to destination (if known)" - }, - "destination": { - "type": "pubkey", - "description": "the final destination of the payment if known" - }, - "created_at": { - "type": "u64", - "description": "the UNIX timestamp showing when this payment was initiated" - }, - "updated_index": { - "added": "v23.11", - "type": "u64", - "description": "1-based index indicating order this payment was changed (only present if it has changed since creation)" - }, - "completed_at": { - "type": "number", - "description": "the UNIX timestamp showing when this payment was completed" - }, - "amount_sent_msat": { - "type": "msat", - "description": "The amount sent" - }, - "label": { - "type": "string", - "description": "the label, if given to sendpay" - }, - "partid": { - "type": "u64", - "description": "the *partid*, if given to sendpay" - }, - "bolt11": { - "type": "string", - "description": "the bolt11 string (if pay supplied one)" - }, - "bolt12": { - "type": "string", - "description": "the bolt12 string (if supplied for pay: **experimental-offers** only)." - } - }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "complete" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "payment_preimage" - ], - "properties": { - "id": {}, - "created_index": {}, - "updated_index": {}, - "groupid": {}, - "payment_hash": {}, - "status": {}, - "msatoshi": {}, - "amount_msat": {}, - "destination": {}, - "created_at": {}, - "completed_at": {}, - "msatoshi_sent": {}, - "amount_sent_msat": {}, - "label": {}, - "partid": {}, - "bolt11": {}, - "bolt12": {}, - "payment_preimage": { - "type": "secret", - "description": "the proof of payment: SHA256 of this **payment_hash**" - } - } - } - } - ] -} diff --git a/doc/schemas/withdraw.request.json b/doc/schemas/withdraw.request.json deleted file mode 100644 index 41311d7517f8..000000000000 --- a/doc/schemas/withdraw.request.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "destination", - "satoshi" - ], - "properties": { - "destination": { - "type": "string", - "description": "any Bitcoin accepted type, including bech32" - }, - "satoshi": { - "type": "msat_or_all", - "description": "the amount to be withdrawn from the internal wallet (expressed, as name suggests, in satoshi). The string *all* can be used to specify withdrawal of all available funds (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*" - }, - "feerate": { - "type": "feerate", - "description": "used for the withdrawal as initial feerate. The default is *normal*" - }, - "minconf": { - "type": "u16", - "description": "minimum number of confirmations that used outputs should have. Default is 1" - }, - "utxos": { - "type": "array", - "description": "specifies the utxos to be used to be withdrawn from, as an array of `txid:vout`. These must be drawn from the node's available UTXO set", - "items": { - "type": "outpoint" - } - } - } -} diff --git a/doc/schemas/withdraw.schema.json b/doc/schemas/withdraw.schema.json deleted file mode 100644 index 3249ccf042c2..000000000000 --- a/doc/schemas/withdraw.schema.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "psbt", - "tx", - "txid" - ], - "properties": { - "tx": { - "type": "hex", - "description": "the fully signed bitcoin transaction" - }, - "txid": { - "type": "txid", - "description": "the transaction id of *tx*" - }, - "psbt": { - "type": "string", - "description": "the PSBT representing the unsigned transaction" - } - } -} From e092bbbaaf1615c89c7782bdd0ca003fa7620338 Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Thu, 18 Jan 2024 11:07:45 -0800 Subject: [PATCH 14/16] doc: Schema generation instructions update --- .../code-generation.md | 18 +--- .../writing-json-schemas.md | 43 +++++---- doc/developers-guide/app-development/rest.md | 2 +- .../a-day-in-the-life-of-a-plugin.md | 45 +++++---- .../plugin-development/event-notifications.md | 4 +- doc/schemas/WRITING_SCHEMAS.md | 92 ------------------- 6 files changed, 59 insertions(+), 145 deletions(-) delete mode 100644 doc/schemas/WRITING_SCHEMAS.md diff --git a/doc/contribute-to-core-lightning/code-generation.md b/doc/contribute-to-core-lightning/code-generation.md index 5eba77849750..2af618109396 100644 --- a/doc/contribute-to-core-lightning/code-generation.md +++ b/doc/contribute-to-core-lightning/code-generation.md @@ -3,7 +3,7 @@ title: "Code Generation" slug: "code-generation" hidden: false createdAt: "2023-04-22T12:29:01.116Z" -updatedAt: "2023-04-22T12:44:47.814Z" +updatedAt: "2024-01-18T12:44:47.814Z" --- The CLN project has a multitude of interfaces, most of which are generated from an abstract schema: @@ -13,19 +13,11 @@ The CLN project has a multitude of interfaces, most of which are generated from 1. addition of FD passing semantics to allow establishing a new connection between daemons (communication uses [socketpair](https://man7.org/linux/man-pages/man2/socketpair.2.html), so no `connect`) 2. change the message length prefix from `u16` to `u32`, allowing for messages larger than 65Kb. The CSV files are with the respective sub-daemon and also use [generate-wire.py](https://github.com/ElementsProject/lightning/blob/master/tools/generate-wire.py) to generate encoding, decoding and printing functions -- We describe the JSON-RPC using [JSON Schema](https://json-schema.org/) in the [`doc/schemas`](https://github.com/ElementsProject/lightning/tree/master/doc/schemas) directory. Each method has a `.request.json` for the request message, and a `.schema.json` for the response (the mismatch is historical and will eventually be addressed). During tests the `pytest` target will verify responses, however the JSON-RPC methods are _not_ generated (yet?). We do generate various client stubs for languages, using the `msggen`][msggen] tool. More on the generated stubs and utilities below. +- We describe the JSON-RPC using [JSON Schema](https://json-schema.org/) in the [`doc/schemas`](https://github.com/ElementsProject/lightning/tree/master/doc/schemas) directory. Each method has a `lightning-*.json` for request and response. During tests the `pytest` target will verify responses, however the JSON-RPC methods are _not_ generated (yet?). We do generate various client stubs for languages, using the `msggen`[msggen] tool. More on the generated stubs and utilities below. ## Man pages -The manpages are partially generated from the JSON schemas using the [`fromschema`](https://github.com/ElementsProject/lightning/blob/master/tools/fromschema.py) tool. It reads the request schema and fills in the manpage between two markers: - -```markdown -[comment]: # (GENERATE-FROM-SCHEMA-START) -... -[comment]: # (GENERATE-FROM-SCHEMA-END) -``` - - +The manpages are generated from the JSON schemas using the [`fromschema`](https://github.com/ElementsProject/lightning/blob/master/tools/fromschema.py) tool. It reads the request and response schema from `lightning-*.json` and generates markdown contents and manpages: > 📘 > @@ -51,10 +43,6 @@ The manpages are partially generated from the JSON schemas using the [`fromschem } [/block] - - - - ### `cln-rpc` We use `msggen` to generate the Rust bindings crate [`cln-rpc`](https://github.com/ElementsProject/lightning/tree/master/cln-rpc). These bindings contain the stubs for the JSON-RPC methods, as well as types for the request and response structs. The [generator code](https://github.com/ElementsProject/lightning/blob/master/contrib/msggen/msggen/gen/rust.py) maps each abstract JSON-RPC type to a Rust type, minimizing size (e.g., binary data is hex-decoded). diff --git a/doc/contribute-to-core-lightning/coding-style-guidelines/writing-json-schemas.md b/doc/contribute-to-core-lightning/coding-style-guidelines/writing-json-schemas.md index c2d4609275d3..f46292f7caa8 100644 --- a/doc/contribute-to-core-lightning/coding-style-guidelines/writing-json-schemas.md +++ b/doc/contribute-to-core-lightning/coding-style-guidelines/writing-json-schemas.md @@ -3,36 +3,24 @@ title: "Writing JSON Schemas" slug: "writing-json-schemas" hidden: false createdAt: "2023-01-25T05:46:43.718Z" -updatedAt: "2023-01-30T15:36:28.523Z" +updatedAt: "2024-01-18T15:36:28.523Z" --- -A JSON Schema is a JSON file which defines what a structure should look like; in our case we use it in our testsuite to check that they match command responses, and also use it to generate our documentation. +A JSON Schema is a JSON file which defines what a structure should look like; in our case we use it in our testsuite to check that they match command requests and responses, and also use it to generate our documentation. Yes, schemas are horrible to write, but they're damn useful. We can only use a subset of the full [JSON Schema Specification](https://json-schema.org/), but if you find that limiting it's probably a sign that you should simplify your JSON output. ## Updating a Schema -If you add a field, you should add it to the schema, and you must add "added": "VERSION" (where VERSION is the next release version!). +If you add a field, you should add it to the field schema, and you must add "added": "VERSION" (where VERSION is the next release version!). -Similarly, if you deprecate a field, add "deprecated": "VERSION" (where VERSION is the next release version). They will be removed two versions later. +Similarly, if you deprecate a field, add "deprecated": "VERSION" (where VERSION is the next release version) to the field. They will be removed two versions later. ## How to Write a Schema -Name the schema doc/schemas/`command`.schema.json: the testsuite should pick it up and check all invocations of that command against it. +Name the schema doc/schemas/lightning-`command`.json: the testsuite should pick it up and check all invocations of that command against it. +The core lightning RPC commands use custom schema specification defined in [rpc-schema-draft](https://github.com/ElementsProject/lightning/doc/rpc-schema-draft.json). -I recommend copying an existing one to start. - -You will need to put the magic lines in the manual page so `make doc-all` will fill it in for you: - -```json -[comment]: # (GENERATE-FROM-SCHEMA-START) -[comment]: # (GENERATE-FROM-SCHEMA-END) -``` - - - -If something goes wrong, try tools/fromscheme.py doc/schemas/`command`.schema.json to see how far it got before it died. - -You should always use `"additionalProperties": false`, otherwise your schema might not be covering everything. Deprecated fields simply have `"deprecated": true` in their properties, so they are allowed by omitted from the documentation. +I recommend copying an existing one to start. If something goes wrong, try tools/fromscheme.py doc/schemas/lightning-`command`.json to see how far it got before it died. You should always list all fields which are _always_ present in `"required"`. @@ -57,6 +45,23 @@ To add conditional fields: 6. Inside the "then", use `"additionalProperties": false` and place empty `{}` for all the other possible properties. 7. If you haven't covered all the possibilties with `if` statements, add an `else` with `"additionalProperties": false` which simply mentions every allowable property. This ensures that the fields can _only_ be present when conditions are met. +### Exceptions in dynamic schema generation + +- If response (`RETURN VALUE`) should not be generated dynamically and you want it to be a custom text message instead. You can use `return_value_notes` to add custom text with empty `properties`. Examples: `setpsbtversion`, `commando`, `recover`. +- If only one of multiple request parameters can be provided then utilize `oneOfMany` + key with condition defining arrays. For example, `plugin` command defines it as + `"oneOfMany": [["plugin", "directory"]]` and it prints the parameter output as + `[*plugin|directory*]`. +- If request parameters are paired with other parameter and either all of them can be passed + to the command or none of them; then utilize `pairedWith` key with condition defining arrays. + For example, `delpay` command defines it as `"pairedWith": [["partid", "groupid"]]` + and it prints the parameter output as `[*partid* *groupid*]`. +- - If some of the optional request parameters are dependent upon other optional parameters, + use `dependentUpon` key where object key can be mapped with the array of dependent params. + For example, `listforwards` command has `start` and `limit` params dependent upon `index` and + it can be defined as `"dependentUpon": { "index": ["start", "limit"] }` in the json and it will + generate the markdown syntax as `[*index* [*start*] [*limit*]]`. + ### JSON Drinking Game! 1. Sip whenever you have an additional comma at the end of a sequence. diff --git a/doc/developers-guide/app-development/rest.md b/doc/developers-guide/app-development/rest.md index 8ea8d65df549..ac608f99e638 100644 --- a/doc/developers-guide/app-development/rest.md +++ b/doc/developers-guide/app-development/rest.md @@ -78,7 +78,7 @@ With the default configurations, the Swagger user interface will be available at The POST method requires `rune` header for authorization. - A new `rune` can be created via [createrune](https://docs.corelightning.org/reference/lightning-createrune) or the list of -existing runes can be retrieved with [listrunes](https://docs.corelightning.org/reference/lightning-commando-listrunes) command. +existing runes can be retrieved with [showrunes](https://docs.corelightning.org/reference/lightning-showrunes) command. Note: in version v23.08, a parameter `Nodeid` was required to be the id of the node we're talking to (see `id (pubkey)` received from [getinfo](https://docs.corelightning.org/reference/lightning-getinfo)). You can still send this for backwards compatibility, diff --git a/doc/developers-guide/plugin-development/a-day-in-the-life-of-a-plugin.md b/doc/developers-guide/plugin-development/a-day-in-the-life-of-a-plugin.md index efdfdb4c6624..df45bd0e6544 100644 --- a/doc/developers-guide/plugin-development/a-day-in-the-life-of-a-plugin.md +++ b/doc/developers-guide/plugin-development/a-day-in-the-life-of-a-plugin.md @@ -68,8 +68,15 @@ The `getmanifest` method is required for all plugins and will be called on start "disconnect" ], "hooks": [ - { "name": "openchannel", "before": ["another_plugin"] }, - { "name": "htlc_accepted" } + { + "name": "openchannel", + "before": [ + "another_plugin" + ] + }, + { + "name": "htlc_accepted" + } ], "featurebits": { "node": "D0000000", @@ -79,11 +86,12 @@ The `getmanifest` method is required for all plugins and will be called on start }, "notifications": [ { - "method": "mycustomnotification" + "method": "mycustomnotification" } ], "custommessages": [ - 11008, 11010 + 11008, + 11010 ], "nonnumericids": true, "dynamic": true @@ -129,6 +137,7 @@ Nota bene: if a `flag` type option is not set, it will not appear in the options Here's an example option set, as sent in response to `getmanifest` ```json +{ "options": [ { "name": "greeting", @@ -158,9 +167,10 @@ Here's an example option set, as sent in response to `getmanifest` "type": "int", "default": 0, "description": "Another number to add", - "multi": true + "multi": true } - ], + ] +} ``` #### Custom notifications @@ -175,9 +185,9 @@ When forwarding a custom notification `lightningd` will wrap the payload of the "method": "mycustomnotification", "params": { "key": "value", - "message": "Hello fellow plugin!" + "message": "Hello fellow plugin!" } -} +} ``` is delivered as @@ -194,7 +204,6 @@ is delivered as } } } - ``` The notification topic (`method` in the JSON-RPC message) must not match one of the internal events in order to prevent breaking subscribers that expect the existing notification format. Multiple plugins are allowed to emit notifications for the same topics, allowing things like metric aggregators where the aggregator subscribes to a common topic and other plugins publish metrics as notifications. @@ -207,7 +216,9 @@ The `init` method is required so that `lightningd` can pass back the filled comm { "options": { "greeting": "World", - "number": [0] + "number": [ + 0 + ] }, "configuration": { "lightning-dir": "/home/user/.lightning/testnet", @@ -215,15 +226,15 @@ The `init` method is required so that `lightningd` can pass back the filled comm "startup": true, "network": "testnet", "feature_set": { - "init": "02aaa2", - "node": "8000000002aaa2", - "channel": "", - "invoice": "028200" + "init": "02aaa2", + "node": "8000000002aaa2", + "channel": "", + "invoice": "028200" }, "proxy": { - "type": "ipv4", - "address": "127.0.0.1", - "port": 9050 + "type": "ipv4", + "address": "127.0.0.1", + "port": 9050 }, "torv3-enabled": true, "always_use_proxy": false diff --git a/doc/developers-guide/plugin-development/event-notifications.md b/doc/developers-guide/plugin-development/event-notifications.md index d85cf2f568da..3e24ee0c7ef9 100644 --- a/doc/developers-guide/plugin-development/event-notifications.md +++ b/doc/developers-guide/plugin-development/event-notifications.md @@ -177,11 +177,13 @@ A notification for topic `invoice_creation` is sent every time an invoice is cre "invoice_creation": { "label": "unique-label-for-invoice", "preimage": "0000000000000000000000000000000000000000000000000000000000000000", - "amount_msat": 10000 + "msat": 10000 } } ``` +Before version `23.11` the `msat` field was a string with msat-suffix, e.g: `"10000msat"`. + ### `warning` A notification for topic `warning` is sent every time a new `BROKEN`/`UNUSUAL` level(in plugins, we use `error`/`warn`) log generated, which means an unusual/borken thing happens, such as channel failed, message resolving failed... diff --git a/doc/schemas/WRITING_SCHEMAS.md b/doc/schemas/WRITING_SCHEMAS.md deleted file mode 100644 index aff29fcef60e..000000000000 --- a/doc/schemas/WRITING_SCHEMAS.md +++ /dev/null @@ -1,92 +0,0 @@ -# Writing JSON Schemas - -A JSON Schema is a JSON file which defines what a structure should -look like; in our case we use it in our testsuite to check that they -match command responses, and also use it to generate our -documentation. - -Yes, schemas are horrible to write, but they're damn useful. We can only -use a subset of the full [JSON Schema Specification](https://json-schema.org/), -but if you find that limiting it's probably a sign that you should simplify -your JSON output. - -## Updating a Schema - -If you add a field, you should add it to the schema, and you must add -"added": "VERSION" (where VERSION is the next release version!). - -Similarly, if you deprecate a field, add "deprecated": "VERSION" (where -VERSION is the next release version). They will be removed two versions -later. - -## How to Write a Schema - -Name the schema doc/schemas/`command`.schema.json: the testsuite should -pick it up and check all invocations of that command against it. - -I recommend copying an existing one to start. - -You will need to put the magic lines in the manual page so `make doc-all` -will fill it in for you: - -``` -[comment]: # (GENERATE-FROM-SCHEMA-START) -[comment]: # (GENERATE-FROM-SCHEMA-END) -``` - -If something goes wrong, try tools/fromscheme.py -doc/schemas/`command`.schema.json to see how far it got before it died. - -You should always use `"additionalProperties": false`, otherwise -your schema might not be covering everything. Deprecated fields -simply have `"deprecated": true` in their properties, so they -are allowed by omitted from the documentation. - -You should always list all fields which are *always* present in -`"required"`. - -We extend the basic types; see [fixtures.py][fixtures]. - -[fixtures]: https://github.com/ElementsProject/lightning/blob/master/contrib/pyln-testing/pyln/testing/fixtures.py - -In addition, before committing a new schema or a new version of it, make sure that it -is well formatted. If you don't want do it by hand, use `make fmt-schema` that uses -jq under the hood. - -### Using Conditional Fields - -Sometimes one field is only sometimes present; if you can, you should make -the schema know when it should (and should not!) be there. - -There are two kinds of conditional fields expressable: fields which -are only present if another field is present, or fields only present -if another field has certain values. - -To add conditional fields: - -1. Do *not* mention them in the main "properties" section. -2. Set `"additionalProperties": true` for the main "properties" section. -3. Add an `"allOf": [` array at the same height as `"properties"'`. Inside - this place one `if`/`then` for each conditional field. -4. If a field simply requires another field to be present, use the pattern - `"required": [ "field" ]` inside the "if". -5. If a field requires another field value, use the pattern - `"properties": { "field": { "enum": [ "val1", "val2" ] } }` inside - the "if". -6. Inside the "then", use `"additionalProperties": false` and place - empty `{}` for all the other possible properties. -7. If you haven't covered all the possibilties with `if` statements, - add an `else` with `"additionalProperties": false` which simply - mentions every allowable property. This ensures that the fields - can *only* be present when conditions are met. - -### JSON Drinking Game! - -1. Sip whenever you have an additional comma at the end of a sequence. -2. Sip whenever you omit a comma in a sequence because you cut & paste. -3. Skull whenever you wish JSON had comments. - -Good luck! -Rusty. - -[contrib/pyln-testing/pyln/testing/fixtures.py]: https://github.com/ElementsProject/lightning/tree/master/contrib/pyln-testing/pyln/testing/fixtures.py From 1916f90232da71e4326211c649d865a5afd304c5 Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Thu, 22 Feb 2024 21:45:08 -0800 Subject: [PATCH 15/16] docs: Updates script and fixed test to generate lightning-sql - Updated doc/Makefile for generating schemas/lightning-sql.json - Read the lightning-sql template from schemas/lightning-sql-template.json - Generate sql tables data and merge it with json object read from above template - Save final merged object in schemas/lightning-sql.json - Updated doc/Makefile to auto generate lightning-sql.7.md and lightning-sql.7 - Deleted schemas/lightning-sql.json and adding it into .gitignore - Added lightning-sql specific titles in the fromschema.py script - Fixed test_sql by changing the sequence for listpeerchannels `reestablished` field - Ignoring lightning-sql.json for msggen schema.json because it is auto generated by sql plugin and lightning-sql-template.json. --- .gitignore | 1 + contrib/msggen/msggen/schema.json | 5 +- contrib/msggen/msggen/utils/utils.py | 3 +- doc/Makefile | 11 +- doc/lightning-sql.7.md | 382 ++++++++++++++++++++++++ doc/schemas/lightning-sql-template.json | 265 ++++++++++++++++ doc/schemas/lightning-sql.json | 266 ----------------- tests/test_plugin.py | 6 +- tools/fromschema.py | 2 +- 9 files changed, 662 insertions(+), 279 deletions(-) create mode 100644 doc/schemas/lightning-sql-template.json delete mode 100644 doc/schemas/lightning-sql.json diff --git a/.gitignore b/.gitignore index 8d2e96ec68db..5f7cbef5a053 100644 --- a/.gitignore +++ b/.gitignore @@ -57,6 +57,7 @@ tests/plugins/test_selfdisable_after_getmanifest # Ignore generated files devtools/features +doc/schemas/lightning-sql.json doc/lightning*.[1578] doc/reckless*.[1578] *_sqlgen.[ch] diff --git a/contrib/msggen/msggen/schema.json b/contrib/msggen/msggen/schema.json index fe695da2eb6f..108dc6d7864d 100644 --- a/contrib/msggen/msggen/schema.json +++ b/contrib/msggen/msggen/schema.json @@ -29266,7 +29266,7 @@ "Main web site: " ] }, - "lightning-sql.json": { + "lightning-sql-template.json": { "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, @@ -29369,8 +29369,7 @@ ], "tables": [ "Note that the first column of every table is a unique integer called `rowid`: this is used for related tables to refer to specific rows in their parent. sqlite3 usually has this as an implicit column, but we make it explicit as the implicit version is not allowed to be used as a foreign key.", - "", - "The following tables are currently supported:\n- `bkpr_accountevents` (see lightning-bkpr-listaccountevents(7))\n - `account` (type `string`, sqltype `TEXT`)\n - `type` (type `string`, sqltype `TEXT`)\n - `tag` (type `string`, sqltype `TEXT`)\n - `credit_msat` (type `msat`, sqltype `INTEGER`)\n - `debit_msat` (type `msat`, sqltype `INTEGER`)\n - `currency` (type `string`, sqltype `TEXT`)\n - `timestamp` (type `u32`, sqltype `INTEGER`)\n - `outpoint` (type `string`, sqltype `TEXT`)\n - `blockheight` (type `u32`, sqltype `INTEGER`)\n - `origin` (type `string`, sqltype `TEXT`)\n - `payment_id` (type `hex`, sqltype `BLOB`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `description` (type `string`, sqltype `TEXT`)\n - `fees_msat` (type `msat`, sqltype `INTEGER`)\n - `is_rebalance` (type `boolean`, sqltype `INTEGER`)\n - `part_id` (type `u32`, sqltype `INTEGER`)\n\n- `bkpr_income` (see lightning-bkpr-listincome(7))\n - `account` (type `string`, sqltype `TEXT`)\n - `tag` (type `string`, sqltype `TEXT`)\n - `credit_msat` (type `msat`, sqltype `INTEGER`)\n - `debit_msat` (type `msat`, sqltype `INTEGER`)\n - `currency` (type `string`, sqltype `TEXT`)\n - `timestamp` (type `u32`, sqltype `INTEGER`)\n - `description` (type `string`, sqltype `TEXT`)\n - `outpoint` (type `string`, sqltype `TEXT`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `payment_id` (type `hex`, sqltype `BLOB`)\n\n- `channels` indexed by `short_channel_id` (see lightning-listchannels(7))\n - `source` (type `pubkey`, sqltype `BLOB`)\n - `destination` (type `pubkey`, sqltype `BLOB`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `direction` (type `u32`, sqltype `INTEGER`)\n - `public` (type `boolean`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `message_flags` (type `u8`, sqltype `INTEGER`)\n - `channel_flags` (type `u8`, sqltype `INTEGER`)\n - `active` (type `boolean`, sqltype `INTEGER`)\n - `last_update` (type `u32`, sqltype `INTEGER`)\n - `base_fee_millisatoshi` (type `u32`, sqltype `INTEGER`)\n - `fee_per_millionth` (type `u32`, sqltype `INTEGER`)\n - `delay` (type `u32`, sqltype `INTEGER`)\n - `htlc_minimum_msat` (type `msat`, sqltype `INTEGER`)\n - `htlc_maximum_msat` (type `msat`, sqltype `INTEGER`)\n - `features` (type `hex`, sqltype `BLOB`)\n\n- `closedchannels` (see lightning-listclosedchannels(7))\n - `peer_id` (type `pubkey`, sqltype `BLOB`)\n - `channel_id` (type `hash`, sqltype `BLOB`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `opener` (type `string`, sqltype `TEXT`)\n - `closer` (type `string`, sqltype `TEXT`)\n - `private` (type `boolean`, sqltype `INTEGER`)\n - related table `closedchannels_channel_type_bits`, from JSON object `channel_type`\n - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `bits` (type `u32`, sqltype `INTEGER`)\n - related table `closedchannels_channel_type_names`, from JSON object `channel_type`\n - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `names` (type `string`, sqltype `TEXT`)\n - `total_local_commitments` (type `u64`, sqltype `INTEGER`)\n - `total_remote_commitments` (type `u64`, sqltype `INTEGER`)\n - `total_htlcs_sent` (type `u64`, sqltype `INTEGER`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `leased` (type `boolean`, sqltype `INTEGER`)\n - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`)\n - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`)\n - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`)\n - `total_msat` (type `msat`, sqltype `INTEGER`)\n - `final_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `min_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `max_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `last_commitment_txid` (type `hash`, sqltype `BLOB`)\n - `last_commitment_fee_msat` (type `msat`, sqltype `INTEGER`)\n - `close_cause` (type `string`, sqltype `TEXT`)\n - `last_stable_connection` (type `u64`, sqltype `INTEGER`)\n\n- `forwards` indexed by `in_channel and in_htlc_id` (see lightning-listforwards(7))\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `in_channel` (type `short_channel_id`, sqltype `TEXT`)\n - `in_htlc_id` (type `u64`, sqltype `INTEGER`)\n - `in_msat` (type `msat`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `received_time` (type `number`, sqltype `REAL`)\n - `out_channel` (type `short_channel_id`, sqltype `TEXT`)\n - `out_htlc_id` (type `u64`, sqltype `INTEGER`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `style` (type `string`, sqltype `TEXT`)\n - `fee_msat` (type `msat`, sqltype `INTEGER`)\n - `out_msat` (type `msat`, sqltype `INTEGER`)\n - `resolved_time` (type `number`, sqltype `REAL`)\n - `failcode` (type `u32`, sqltype `INTEGER`)\n - `failreason` (type `string`, sqltype `TEXT`)\n\n- `htlcs` indexed by `short_channel_id and id` (see lightning-listhtlcs(7))\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `expiry` (type `u32`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `direction` (type `string`, sqltype `TEXT`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `state` (type `string`, sqltype `TEXT`)\n\n- `invoices` indexed by `payment_hash` (see lightning-listinvoices(7))\n - `label` (type `string`, sqltype `TEXT`)\n - `description` (type `string`, sqltype `TEXT`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `status` (type `string`, sqltype `TEXT`)\n - `expires_at` (type `u64`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `bolt11` (type `string`, sqltype `TEXT`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `local_offer_id` (type `hash`, sqltype `BLOB`)\n - `invreq_payer_note` (type `string`, sqltype `TEXT`)\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `pay_index` (type `u64`, sqltype `INTEGER`)\n - `amount_received_msat` (type `msat`, sqltype `INTEGER`)\n - `paid_at` (type `u64`, sqltype `INTEGER`)\n - `paid_outpoint_txid` (type `txid`, sqltype `BLOB`, from JSON object `paid_outpoint`)\n - `paid_outpoint_outnum` (type `u32`, sqltype `INTEGER`, from JSON object `paid_outpoint`)\n - `payment_preimage` (type `secret`, sqltype `BLOB`)\n\n- `nodes` indexed by `nodeid` (see lightning-listnodes(7))\n - `nodeid` (type `pubkey`, sqltype `BLOB`)\n - `last_timestamp` (type `u32`, sqltype `INTEGER`)\n - `alias` (type `string`, sqltype `TEXT`)\n - `color` (type `hex`, sqltype `BLOB`)\n - `features` (type `hex`, sqltype `BLOB`)\n - related table `nodes_addresses`\n - `row` (reference to `nodes.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `type` (type `string`, sqltype `TEXT`)\n - `port` (type `u16`, sqltype `INTEGER`)\n - `address` (type `string`, sqltype `TEXT`)\n - `option_will_fund_lease_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_lease_fee_basis` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_funding_weight` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_channel_fee_max_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_channel_fee_max_proportional_thousandths` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_compact_lease` (type `hex`, sqltype `BLOB`, from JSON object `option_will_fund`)\n\n- `offers` indexed by `offer_id` (see lightning-listoffers(7))\n - `offer_id` (type `hash`, sqltype `BLOB`)\n - `active` (type `boolean`, sqltype `INTEGER`)\n - `single_use` (type `boolean`, sqltype `INTEGER`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `used` (type `boolean`, sqltype `INTEGER`)\n - `label` (type `string`, sqltype `TEXT`)\n\n- `peerchannels` indexed by `peer_id` (see lightning-listpeerchannels(7))\n - `peer_id` (type `pubkey`, sqltype `BLOB`)\n - `peer_connected` (type `boolean`, sqltype `INTEGER`)\n - `reestablished` (type `boolean`, sqltype `INTEGER`)\n - `state` (type `string`, sqltype `TEXT`)\n - `scratch_txid` (type `txid`, sqltype `BLOB`)\n - related table `peerchannels_channel_type_bits`, from JSON object `channel_type`\n - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `bits` (type `u32`, sqltype `INTEGER`)\n - related table `peerchannels_channel_type_names`, from JSON object `channel_type`\n - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `names` (type `string`, sqltype `TEXT`)\n - `local_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `local`)\n - `local_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `local`)\n - `remote_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `remote`)\n - `ignore_fee_limits` (type `boolean`, sqltype `INTEGER`)\n - `lost_state` (type `boolean`, sqltype `INTEGER`)\n - `feerate_perkw` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`)\n - `feerate_perkb` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`)\n - `owner` (type `string`, sqltype `TEXT`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `channel_id` (type `hash`, sqltype `BLOB`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `initial_feerate` (type `string`, sqltype `TEXT`)\n - `last_feerate` (type `string`, sqltype `TEXT`)\n - `next_feerate` (type `string`, sqltype `TEXT`)\n - `next_fee_step` (type `u32`, sqltype `INTEGER`)\n - related table `peerchannels_inflight`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `feerate` (type `string`, sqltype `TEXT`)\n - `total_funding_msat` (type `msat`, sqltype `INTEGER`)\n - `splice_amount` (type `integer`, sqltype `INTEGER`)\n - `our_funding_msat` (type `msat`, sqltype `INTEGER`)\n - `scratch_txid` (type `txid`, sqltype `BLOB`)\n - `close_to` (type `hex`, sqltype `BLOB`)\n - `private` (type `boolean`, sqltype `INTEGER`)\n - `opener` (type `string`, sqltype `TEXT`)\n - `closer` (type `string`, sqltype `TEXT`)\n - related table `peerchannels_features`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `features` (type `string`, sqltype `TEXT`)\n - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_local_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_remote_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `min_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `max_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `total_msat` (type `msat`, sqltype `INTEGER`)\n - `fee_base_msat` (type `msat`, sqltype `INTEGER`)\n - `fee_proportional_millionths` (type `u32`, sqltype `INTEGER`)\n - `dust_limit_msat` (type `msat`, sqltype `INTEGER`)\n - `max_total_htlc_in_msat` (type `msat`, sqltype `INTEGER`)\n - `their_reserve_msat` (type `msat`, sqltype `INTEGER`)\n - `our_reserve_msat` (type `msat`, sqltype `INTEGER`)\n - `spendable_msat` (type `msat`, sqltype `INTEGER`)\n - `receivable_msat` (type `msat`, sqltype `INTEGER`)\n - `minimum_htlc_in_msat` (type `msat`, sqltype `INTEGER`)\n - `minimum_htlc_out_msat` (type `msat`, sqltype `INTEGER`)\n - `maximum_htlc_out_msat` (type `msat`, sqltype `INTEGER`)\n - `their_to_self_delay` (type `u32`, sqltype `INTEGER`)\n - `our_to_self_delay` (type `u32`, sqltype `INTEGER`)\n - `max_accepted_htlcs` (type `u32`, sqltype `INTEGER`)\n - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - related table `peerchannels_state_changes`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `timestamp` (type `string`, sqltype `TEXT`)\n - `old_state` (type `string`, sqltype `TEXT`)\n - `new_state` (type `string`, sqltype `TEXT`)\n - `cause` (type `string`, sqltype `TEXT`)\n - `message` (type `string`, sqltype `TEXT`)\n - related table `peerchannels_status`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `in_payments_offered` (type `u64`, sqltype `INTEGER`)\n - `in_offered_msat` (type `msat`, sqltype `INTEGER`)\n - `in_payments_fulfilled` (type `u64`, sqltype `INTEGER`)\n - `in_fulfilled_msat` (type `msat`, sqltype `INTEGER`)\n - `out_payments_offered` (type `u64`, sqltype `INTEGER`)\n - `out_offered_msat` (type `msat`, sqltype `INTEGER`)\n - `out_payments_fulfilled` (type `u64`, sqltype `INTEGER`)\n - `out_fulfilled_msat` (type `msat`, sqltype `INTEGER`)\n - `last_stable_connection` (type `u64`, sqltype `INTEGER`)\n - related table `peerchannels_htlcs`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `direction` (type `string`, sqltype `TEXT`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `expiry` (type `u32`, sqltype `INTEGER`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `local_trimmed` (type `boolean`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `state` (type `string`, sqltype `TEXT`)\n - `close_to_addr` (type `string`, sqltype `TEXT`)\n - `last_tx_fee_msat` (type `msat`, sqltype `INTEGER`)\n - `direction` (type `u32`, sqltype `INTEGER`)\n\n- `peers` indexed by `id` (see lightning-listpeers(7))\n - `id` (type `pubkey`, sqltype `BLOB`)\n - `connected` (type `boolean`, sqltype `INTEGER`)\n - `num_channels` (type `u32`, sqltype `INTEGER`)\n - related table `peers_netaddr`\n - `row` (reference to `peers.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `netaddr` (type `string`, sqltype `TEXT`)\n - `remote_addr` (type `string`, sqltype `TEXT`)\n - `features` (type `hex`, sqltype `BLOB`)\n\n- `sendpays` indexed by `payment_hash` (see lightning-listsendpays(7))\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `groupid` (type `u64`, sqltype `INTEGER`)\n - `partid` (type `u64`, sqltype `INTEGER`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `destination` (type `pubkey`, sqltype `BLOB`)\n - `created_at` (type `u64`, sqltype `INTEGER`)\n - `amount_sent_msat` (type `msat`, sqltype `INTEGER`)\n - `label` (type `string`, sqltype `TEXT`)\n - `bolt11` (type `string`, sqltype `TEXT`)\n - `description` (type `string`, sqltype `TEXT`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `completed_at` (type `u64`, sqltype `INTEGER`)\n - `payment_preimage` (type `secret`, sqltype `BLOB`)\n - `erroronion` (type `hex`, sqltype `BLOB`)\n\n- `transactions` indexed by `hash` (see lightning-listtransactions(7))\n - `hash` (type `txid`, sqltype `BLOB`)\n - `rawtx` (type `hex`, sqltype `BLOB`)\n - `blockheight` (type `u32`, sqltype `INTEGER`)\n - `txindex` (type `u32`, sqltype `INTEGER`)\n - `locktime` (type `u32`, sqltype `INTEGER`)\n - `version` (type `u32`, sqltype `INTEGER`)\n - related table `transactions_inputs`\n - `row` (reference to `transactions.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`)\n - `sequence` (type `u32`, sqltype `INTEGER`)\n - related table `transactions_outputs`\n - `row` (reference to `transactions.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `scriptPubKey` (type `hex`, sqltype `BLOB`)" + "" ], "errors": [ "On failure, an error is returned." diff --git a/contrib/msggen/msggen/utils/utils.py b/contrib/msggen/msggen/utils/utils.py index 484e51c7fa1a..4cdadccc5f49 100644 --- a/contrib/msggen/msggen/utils/utils.py +++ b/contrib/msggen/msggen/utils/utils.py @@ -12,7 +12,8 @@ def combine_schemas(schema_dir: Path, dest: Path): files = sorted(list(schema_dir.iterdir())) for f in files: - if not f.name.endswith(".json"): + # Ignore lightning-sql.json because it will be auto generated by sql plugin and lightning-sql-template.json + if not f.name.endswith(".json") or f.name == "lightning-sql.json": continue bundle[f.name] = json.load(f.open()) diff --git a/doc/Makefile b/doc/Makefile index 29a89d8aeffe..a3f58c32a3a2 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -141,12 +141,11 @@ MANPAGES := $(GENERATE_MARKDOWN) \ MARKDOWN_WITH_SCHEMA := $(GENERATE_MARKDOWN:=.md) -doc/schemas/lightning-sql.json: plugins/sql -# Delete the old tables schema and generate the new ones. - @if [ "$$(jq '[.tables[] | startswith("The following tables are currently supported:")]' doc/schemas/lightning-sql.json | jq 'any')" = "true" ]; then \ - jq 'del(.tables[] | select(startswith("The following tables are currently supported:")))' "$@" > "$@.tmp" && mv "$@.tmp" "$@"; \ - fi - @plugins/sql --print-docs | jq --arg sqldata "$$(awk '{printf "%s\n", $$0}')" '.tables += [$$sqldata]' "$@" > "$@.tmp" && mv "$@.tmp" "$@"; +# - Read the json template from schemas/lightning-sql-template.json +# - Generate the tables schema via plugins/sql +# - Merge both and generate final schemas/lightning-sql.json +doc/schemas/lightning-sql.json: doc/schemas/lightning-sql-template.json plugins/sql + @plugins/sql --print-docs | jq --arg sqldata "$$(awk '{printf "%s\n", $$0}')" '.tables += [$$sqldata]' $< > "$@.tmp" && mv "$@.tmp" "$@"; doc-all: $(MANPAGES) doc/index.rst diff --git a/doc/lightning-sql.7.md b/doc/lightning-sql.7.md index 1bb81e3de16b..4bb1d2f12d29 100644 --- a/doc/lightning-sql.7.md +++ b/doc/lightning-sql.7.md @@ -20,6 +20,388 @@ It is, however faster for remote access if the result of the query is much small - **query** (string): The standard sqlite3 query to run. Note that queries like "SELECT *" are fragile, as columns will change across releases; see lightning-listsqlschemas(7). +PERMITTED SQLITE3 FUNCTIONS +--------------------------- + +Writing to the database is not permitted, and limits are placed on various other query parameters. + +Additionally, only the following functions are allowed: + +* abs +* avg +* coalesce +* count +* hex +* quote +* length +* like +* lower +* upper +* min +* max +* sum +* total + +TREATMENT OF TYPES +------------------ + +The following types are supported in schemas, and this shows how they are presented in the database. This matters: a JSON boolean is represented as an integer in the database, so a query will return 0 or 1, not true or false. + +* *hex*. A hex string. + * JSON: a string + * sqlite3: BLOB + +* *hash*/*secret*/*pubkey*/*txid*: just like *hex*. + +* *msat*/*integer*/*u64*/*u32*/*u16*/*u8*. Normal numbers. + * JSON: an unsigned integer + * sqlite3: INTEGER + +* *boolean*. True or false. + * JSON: literal **true** or **false** + * sqlite3: INTEGER + +* *number*. A floating point number (used for times in some places). + * JSON: number + * sqlite3: REAL + +* *string*. Text. + * JSON: string + * sqlite3: TEXT + +* *short\_channel\_id*. A short-channel-id of form 1x2x3. + * JSON: string + * sqlite3: TEXT + +TABLES +------ + +Note that the first column of every table is a unique integer called `rowid`: this is used for related tables to refer to specific rows in their parent. sqlite3 usually has this as an implicit column, but we make it explicit as the implicit version is not allowed to be used as a foreign key. + +The following tables are currently supported: +- `bkpr_accountevents` (see lightning-bkpr-listaccountevents(7)) + - `account` (type `string`, sqltype `TEXT`) + - `type` (type `string`, sqltype `TEXT`) + - `tag` (type `string`, sqltype `TEXT`) + - `credit_msat` (type `msat`, sqltype `INTEGER`) + - `debit_msat` (type `msat`, sqltype `INTEGER`) + - `currency` (type `string`, sqltype `TEXT`) + - `timestamp` (type `u32`, sqltype `INTEGER`) + - `outpoint` (type `string`, sqltype `TEXT`) + - `blockheight` (type `u32`, sqltype `INTEGER`) + - `origin` (type `string`, sqltype `TEXT`) + - `payment_id` (type `hex`, sqltype `BLOB`) + - `txid` (type `txid`, sqltype `BLOB`) + - `description` (type `string`, sqltype `TEXT`) + - `fees_msat` (type `msat`, sqltype `INTEGER`) + - `is_rebalance` (type `boolean`, sqltype `INTEGER`) + - `part_id` (type `u32`, sqltype `INTEGER`) + +- `bkpr_income` (see lightning-bkpr-listincome(7)) + - `account` (type `string`, sqltype `TEXT`) + - `tag` (type `string`, sqltype `TEXT`) + - `credit_msat` (type `msat`, sqltype `INTEGER`) + - `debit_msat` (type `msat`, sqltype `INTEGER`) + - `currency` (type `string`, sqltype `TEXT`) + - `timestamp` (type `u32`, sqltype `INTEGER`) + - `description` (type `string`, sqltype `TEXT`) + - `outpoint` (type `string`, sqltype `TEXT`) + - `txid` (type `txid`, sqltype `BLOB`) + - `payment_id` (type `hex`, sqltype `BLOB`) + +- `channels` indexed by `short_channel_id` (see lightning-listchannels(7)) + - `source` (type `pubkey`, sqltype `BLOB`) + - `destination` (type `pubkey`, sqltype `BLOB`) + - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`) + - `direction` (type `u32`, sqltype `INTEGER`) + - `public` (type `boolean`, sqltype `INTEGER`) + - `amount_msat` (type `msat`, sqltype `INTEGER`) + - `message_flags` (type `u8`, sqltype `INTEGER`) + - `channel_flags` (type `u8`, sqltype `INTEGER`) + - `active` (type `boolean`, sqltype `INTEGER`) + - `last_update` (type `u32`, sqltype `INTEGER`) + - `base_fee_millisatoshi` (type `u32`, sqltype `INTEGER`) + - `fee_per_millionth` (type `u32`, sqltype `INTEGER`) + - `delay` (type `u32`, sqltype `INTEGER`) + - `htlc_minimum_msat` (type `msat`, sqltype `INTEGER`) + - `htlc_maximum_msat` (type `msat`, sqltype `INTEGER`) + - `features` (type `hex`, sqltype `BLOB`) + +- `closedchannels` (see lightning-listclosedchannels(7)) + - `peer_id` (type `pubkey`, sqltype `BLOB`) + - `channel_id` (type `hash`, sqltype `BLOB`) + - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`) + - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`) + - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`) + - `opener` (type `string`, sqltype `TEXT`) + - `closer` (type `string`, sqltype `TEXT`) + - `private` (type `boolean`, sqltype `INTEGER`) + - related table `closedchannels_channel_type_bits`, from JSON object `channel_type` + - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`) + - `arrindex` (index within array, sqltype `INTEGER`) + - `bits` (type `u32`, sqltype `INTEGER`) + - related table `closedchannels_channel_type_names`, from JSON object `channel_type` + - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`) + - `arrindex` (index within array, sqltype `INTEGER`) + - `names` (type `string`, sqltype `TEXT`) + - `total_local_commitments` (type `u64`, sqltype `INTEGER`) + - `total_remote_commitments` (type `u64`, sqltype `INTEGER`) + - `total_htlcs_sent` (type `u64`, sqltype `INTEGER`) + - `funding_txid` (type `txid`, sqltype `BLOB`) + - `funding_outnum` (type `u32`, sqltype `INTEGER`) + - `leased` (type `boolean`, sqltype `INTEGER`) + - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`) + - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`) + - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`) + - `total_msat` (type `msat`, sqltype `INTEGER`) + - `final_to_us_msat` (type `msat`, sqltype `INTEGER`) + - `min_to_us_msat` (type `msat`, sqltype `INTEGER`) + - `max_to_us_msat` (type `msat`, sqltype `INTEGER`) + - `last_commitment_txid` (type `hash`, sqltype `BLOB`) + - `last_commitment_fee_msat` (type `msat`, sqltype `INTEGER`) + - `close_cause` (type `string`, sqltype `TEXT`) + - `last_stable_connection` (type `u64`, sqltype `INTEGER`) + +- `forwards` indexed by `in_channel and in_htlc_id` (see lightning-listforwards(7)) + - `created_index` (type `u64`, sqltype `INTEGER`) + - `in_channel` (type `short_channel_id`, sqltype `TEXT`) + - `in_htlc_id` (type `u64`, sqltype `INTEGER`) + - `in_msat` (type `msat`, sqltype `INTEGER`) + - `status` (type `string`, sqltype `TEXT`) + - `received_time` (type `number`, sqltype `REAL`) + - `out_channel` (type `short_channel_id`, sqltype `TEXT`) + - `out_htlc_id` (type `u64`, sqltype `INTEGER`) + - `updated_index` (type `u64`, sqltype `INTEGER`) + - `style` (type `string`, sqltype `TEXT`) + - `fee_msat` (type `msat`, sqltype `INTEGER`) + - `out_msat` (type `msat`, sqltype `INTEGER`) + - `resolved_time` (type `number`, sqltype `REAL`) + - `failcode` (type `u32`, sqltype `INTEGER`) + - `failreason` (type `string`, sqltype `TEXT`) + +- `htlcs` indexed by `short_channel_id and id` (see lightning-listhtlcs(7)) + - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`) + - `id` (type `u64`, sqltype `INTEGER`) + - `expiry` (type `u32`, sqltype `INTEGER`) + - `amount_msat` (type `msat`, sqltype `INTEGER`) + - `direction` (type `string`, sqltype `TEXT`) + - `payment_hash` (type `hash`, sqltype `BLOB`) + - `state` (type `string`, sqltype `TEXT`) + +- `invoices` indexed by `payment_hash` (see lightning-listinvoices(7)) + - `label` (type `string`, sqltype `TEXT`) + - `description` (type `string`, sqltype `TEXT`) + - `payment_hash` (type `hash`, sqltype `BLOB`) + - `status` (type `string`, sqltype `TEXT`) + - `expires_at` (type `u64`, sqltype `INTEGER`) + - `amount_msat` (type `msat`, sqltype `INTEGER`) + - `bolt11` (type `string`, sqltype `TEXT`) + - `bolt12` (type `string`, sqltype `TEXT`) + - `local_offer_id` (type `hash`, sqltype `BLOB`) + - `invreq_payer_note` (type `string`, sqltype `TEXT`) + - `created_index` (type `u64`, sqltype `INTEGER`) + - `updated_index` (type `u64`, sqltype `INTEGER`) + - `pay_index` (type `u64`, sqltype `INTEGER`) + - `amount_received_msat` (type `msat`, sqltype `INTEGER`) + - `paid_at` (type `u64`, sqltype `INTEGER`) + - `paid_outpoint_txid` (type `txid`, sqltype `BLOB`, from JSON object `paid_outpoint`) + - `paid_outpoint_outnum` (type `u32`, sqltype `INTEGER`, from JSON object `paid_outpoint`) + - `payment_preimage` (type `secret`, sqltype `BLOB`) + +- `nodes` indexed by `nodeid` (see lightning-listnodes(7)) + - `nodeid` (type `pubkey`, sqltype `BLOB`) + - `last_timestamp` (type `u32`, sqltype `INTEGER`) + - `alias` (type `string`, sqltype `TEXT`) + - `color` (type `hex`, sqltype `BLOB`) + - `features` (type `hex`, sqltype `BLOB`) + - related table `nodes_addresses` + - `row` (reference to `nodes.rowid`, sqltype `INTEGER`) + - `arrindex` (index within array, sqltype `INTEGER`) + - `type` (type `string`, sqltype `TEXT`) + - `port` (type `u16`, sqltype `INTEGER`) + - `address` (type `string`, sqltype `TEXT`) + - `option_will_fund_lease_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`) + - `option_will_fund_lease_fee_basis` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`) + - `option_will_fund_funding_weight` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`) + - `option_will_fund_channel_fee_max_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`) + - `option_will_fund_channel_fee_max_proportional_thousandths` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`) + - `option_will_fund_compact_lease` (type `hex`, sqltype `BLOB`, from JSON object `option_will_fund`) + +- `offers` indexed by `offer_id` (see lightning-listoffers(7)) + - `offer_id` (type `hash`, sqltype `BLOB`) + - `active` (type `boolean`, sqltype `INTEGER`) + - `single_use` (type `boolean`, sqltype `INTEGER`) + - `bolt12` (type `string`, sqltype `TEXT`) + - `used` (type `boolean`, sqltype `INTEGER`) + - `label` (type `string`, sqltype `TEXT`) + +- `peerchannels` indexed by `peer_id` (see lightning-listpeerchannels(7)) + - `peer_id` (type `pubkey`, sqltype `BLOB`) + - `peer_connected` (type `boolean`, sqltype `INTEGER`) + - `reestablished` (type `boolean`, sqltype `INTEGER`) + - `state` (type `string`, sqltype `TEXT`) + - `scratch_txid` (type `txid`, sqltype `BLOB`) + - related table `peerchannels_channel_type_bits`, from JSON object `channel_type` + - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`) + - `arrindex` (index within array, sqltype `INTEGER`) + - `bits` (type `u32`, sqltype `INTEGER`) + - related table `peerchannels_channel_type_names`, from JSON object `channel_type` + - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`) + - `arrindex` (index within array, sqltype `INTEGER`) + - `names` (type `string`, sqltype `TEXT`) + - `local_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`) + - `local_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`) + - `local_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `local`) + - `local_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`) + - `local_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `local`) + - `remote_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`) + - `remote_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`) + - `remote_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `remote`) + - `remote_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`) + - `remote_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `remote`) + - `ignore_fee_limits` (type `boolean`, sqltype `INTEGER`) + - `lost_state` (type `boolean`, sqltype `INTEGER`) + - `feerate_perkw` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`) + - `feerate_perkb` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`) + - `owner` (type `string`, sqltype `TEXT`) + - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`) + - `channel_id` (type `hash`, sqltype `BLOB`) + - `funding_txid` (type `txid`, sqltype `BLOB`) + - `funding_outnum` (type `u32`, sqltype `INTEGER`) + - `initial_feerate` (type `string`, sqltype `TEXT`) + - `last_feerate` (type `string`, sqltype `TEXT`) + - `next_feerate` (type `string`, sqltype `TEXT`) + - `next_fee_step` (type `u32`, sqltype `INTEGER`) + - related table `peerchannels_inflight` + - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`) + - `arrindex` (index within array, sqltype `INTEGER`) + - `funding_txid` (type `txid`, sqltype `BLOB`) + - `funding_outnum` (type `u32`, sqltype `INTEGER`) + - `feerate` (type `string`, sqltype `TEXT`) + - `total_funding_msat` (type `msat`, sqltype `INTEGER`) + - `splice_amount` (type `integer`, sqltype `INTEGER`) + - `our_funding_msat` (type `msat`, sqltype `INTEGER`) + - `scratch_txid` (type `txid`, sqltype `BLOB`) + - `close_to` (type `hex`, sqltype `BLOB`) + - `private` (type `boolean`, sqltype `INTEGER`) + - `opener` (type `string`, sqltype `TEXT`) + - `closer` (type `string`, sqltype `TEXT`) + - related table `peerchannels_features` + - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`) + - `arrindex` (index within array, sqltype `INTEGER`) + - `features` (type `string`, sqltype `TEXT`) + - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`) + - `funding_local_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`) + - `funding_remote_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`) + - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`) + - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`) + - `to_us_msat` (type `msat`, sqltype `INTEGER`) + - `min_to_us_msat` (type `msat`, sqltype `INTEGER`) + - `max_to_us_msat` (type `msat`, sqltype `INTEGER`) + - `total_msat` (type `msat`, sqltype `INTEGER`) + - `fee_base_msat` (type `msat`, sqltype `INTEGER`) + - `fee_proportional_millionths` (type `u32`, sqltype `INTEGER`) + - `dust_limit_msat` (type `msat`, sqltype `INTEGER`) + - `max_total_htlc_in_msat` (type `msat`, sqltype `INTEGER`) + - `their_reserve_msat` (type `msat`, sqltype `INTEGER`) + - `our_reserve_msat` (type `msat`, sqltype `INTEGER`) + - `spendable_msat` (type `msat`, sqltype `INTEGER`) + - `receivable_msat` (type `msat`, sqltype `INTEGER`) + - `minimum_htlc_in_msat` (type `msat`, sqltype `INTEGER`) + - `minimum_htlc_out_msat` (type `msat`, sqltype `INTEGER`) + - `maximum_htlc_out_msat` (type `msat`, sqltype `INTEGER`) + - `their_to_self_delay` (type `u32`, sqltype `INTEGER`) + - `our_to_self_delay` (type `u32`, sqltype `INTEGER`) + - `max_accepted_htlcs` (type `u32`, sqltype `INTEGER`) + - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`) + - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`) + - related table `peerchannels_state_changes` + - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`) + - `arrindex` (index within array, sqltype `INTEGER`) + - `timestamp` (type `string`, sqltype `TEXT`) + - `old_state` (type `string`, sqltype `TEXT`) + - `new_state` (type `string`, sqltype `TEXT`) + - `cause` (type `string`, sqltype `TEXT`) + - `message` (type `string`, sqltype `TEXT`) + - related table `peerchannels_status` + - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`) + - `arrindex` (index within array, sqltype `INTEGER`) + - `status` (type `string`, sqltype `TEXT`) + - `in_payments_offered` (type `u64`, sqltype `INTEGER`) + - `in_offered_msat` (type `msat`, sqltype `INTEGER`) + - `in_payments_fulfilled` (type `u64`, sqltype `INTEGER`) + - `in_fulfilled_msat` (type `msat`, sqltype `INTEGER`) + - `out_payments_offered` (type `u64`, sqltype `INTEGER`) + - `out_offered_msat` (type `msat`, sqltype `INTEGER`) + - `out_payments_fulfilled` (type `u64`, sqltype `INTEGER`) + - `out_fulfilled_msat` (type `msat`, sqltype `INTEGER`) + - `last_stable_connection` (type `u64`, sqltype `INTEGER`) + - related table `peerchannels_htlcs` + - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`) + - `arrindex` (index within array, sqltype `INTEGER`) + - `direction` (type `string`, sqltype `TEXT`) + - `id` (type `u64`, sqltype `INTEGER`) + - `amount_msat` (type `msat`, sqltype `INTEGER`) + - `expiry` (type `u32`, sqltype `INTEGER`) + - `payment_hash` (type `hash`, sqltype `BLOB`) + - `local_trimmed` (type `boolean`, sqltype `INTEGER`) + - `status` (type `string`, sqltype `TEXT`) + - `state` (type `string`, sqltype `TEXT`) + - `close_to_addr` (type `string`, sqltype `TEXT`) + - `last_tx_fee_msat` (type `msat`, sqltype `INTEGER`) + - `direction` (type `u32`, sqltype `INTEGER`) + +- `peers` indexed by `id` (see lightning-listpeers(7)) + - `id` (type `pubkey`, sqltype `BLOB`) + - `connected` (type `boolean`, sqltype `INTEGER`) + - `num_channels` (type `u32`, sqltype `INTEGER`) + - related table `peers_netaddr` + - `row` (reference to `peers.rowid`, sqltype `INTEGER`) + - `arrindex` (index within array, sqltype `INTEGER`) + - `netaddr` (type `string`, sqltype `TEXT`) + - `remote_addr` (type `string`, sqltype `TEXT`) + - `features` (type `hex`, sqltype `BLOB`) + +- `sendpays` indexed by `payment_hash` (see lightning-listsendpays(7)) + - `created_index` (type `u64`, sqltype `INTEGER`) + - `id` (type `u64`, sqltype `INTEGER`) + - `groupid` (type `u64`, sqltype `INTEGER`) + - `partid` (type `u64`, sqltype `INTEGER`) + - `payment_hash` (type `hash`, sqltype `BLOB`) + - `updated_index` (type `u64`, sqltype `INTEGER`) + - `status` (type `string`, sqltype `TEXT`) + - `amount_msat` (type `msat`, sqltype `INTEGER`) + - `destination` (type `pubkey`, sqltype `BLOB`) + - `created_at` (type `u64`, sqltype `INTEGER`) + - `amount_sent_msat` (type `msat`, sqltype `INTEGER`) + - `label` (type `string`, sqltype `TEXT`) + - `bolt11` (type `string`, sqltype `TEXT`) + - `description` (type `string`, sqltype `TEXT`) + - `bolt12` (type `string`, sqltype `TEXT`) + - `completed_at` (type `u64`, sqltype `INTEGER`) + - `payment_preimage` (type `secret`, sqltype `BLOB`) + - `erroronion` (type `hex`, sqltype `BLOB`) + +- `transactions` indexed by `hash` (see lightning-listtransactions(7)) + - `hash` (type `txid`, sqltype `BLOB`) + - `rawtx` (type `hex`, sqltype `BLOB`) + - `blockheight` (type `u32`, sqltype `INTEGER`) + - `txindex` (type `u32`, sqltype `INTEGER`) + - `locktime` (type `u32`, sqltype `INTEGER`) + - `version` (type `u32`, sqltype `INTEGER`) + - related table `transactions_inputs` + - `row` (reference to `transactions.rowid`, sqltype `INTEGER`) + - `arrindex` (index within array, sqltype `INTEGER`) + - `txid` (type `txid`, sqltype `BLOB`) + - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`) + - `sequence` (type `u32`, sqltype `INTEGER`) + - related table `transactions_outputs` + - `row` (reference to `transactions.rowid`, sqltype `INTEGER`) + - `arrindex` (index within array, sqltype `INTEGER`) + - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`) + - `amount_msat` (type `msat`, sqltype `INTEGER`) + - `scriptPubKey` (type `hex`, sqltype `BLOB`) + EXAMPLE USAGE ------------- diff --git a/doc/schemas/lightning-sql-template.json b/doc/schemas/lightning-sql-template.json new file mode 100644 index 000000000000..7b9cd43e5edd --- /dev/null +++ b/doc/schemas/lightning-sql-template.json @@ -0,0 +1,265 @@ +{ + "$schema": "../rpc-schema-draft.json", + "type": "object", + "additionalProperties": false, + "added": "v23.02", + "rpc": "sql", + "title": "Command to do complex queries on list commands", + "description": [ + "The **sql** RPC command runs the given query across a sqlite3 database created from various list commands.", + "", + "When tables are accessed, it calls the below commands, so it's no faster than any other local access (though it goes to great length to cache `listnodes` and `listchannels`) which then processes the results.", + "", + "It is, however faster for remote access if the result of the query is much smaller than the list commands would be." + ], + "request": { + "required": [ + "query" + ], + "properties": { + "query": { + "type": "string", + "description": [ + "The standard sqlite3 query to run.", + "Note that queries like \"SELECT *\" are fragile, as columns will change across releases; see lightning-listsqlschemas(7)." + ] + } + } + }, + "response": { + "required": [ + "rows" + ], + "properties": { + "rows": { + "type": "array", + "items": { + "type": "array" + } + }, + "warning_db_failure": { + "type": "string", + "description": [ + "A message if the database encounters an error partway through." + ] + } + }, + "pre_return_value_notes": [ + "On success, an object containing **rows** is returned. It is an array. Each array entry contains an array of values, each an integer, real number, string or *null*, depending on the sqlite3 type.", + "", + "The object may contain **warning_db_failure** if the database fails partway through its operation." + ] + }, + "treatment_of_types": [ + "The following types are supported in schemas, and this shows how they are presented in the database. This matters: a JSON boolean is represented as an integer in the database, so a query will return 0 or 1, not true or false.", + "", + "* *hex*. A hex string.", + " * JSON: a string", + " * sqlite3: BLOB", + "", + "* *hash*/*secret*/*pubkey*/*txid*: just like *hex*.", + "", + "* *msat*/*integer*/*u64*/*u32*/*u16*/*u8*. Normal numbers.", + " * JSON: an unsigned integer", + " * sqlite3: INTEGER", + "", + "* *boolean*. True or false.", + " * JSON: literal **true** or **false**", + " * sqlite3: INTEGER", + "", + "* *number*. A floating point number (used for times in some places).", + " * JSON: number", + " * sqlite3: REAL", + "", + "* *string*. Text.", + " * JSON: string", + " * sqlite3: TEXT", + "", + "* *short_channel_id*. A short-channel-id of form 1x2x3.", + " * JSON: string", + " * sqlite3: TEXT" + ], + "permitted_sqlite3_functions": [ + "Writing to the database is not permitted, and limits are placed on various other query parameters.", + "", + "Additionally, only the following functions are allowed:", + "", + "* abs", + "* avg", + "* coalesce", + "* count", + "* hex", + "* quote", + "* length", + "* like", + "* lower", + "* upper", + "* min", + "* max", + "* sum", + "* total" + ], + "tables": [ + "Note that the first column of every table is a unique integer called `rowid`: this is used for related tables to refer to specific rows in their parent. sqlite3 usually has this as an implicit column, but we make it explicit as the implicit version is not allowed to be used as a foreign key.", + "" + ], + "errors": [ + "On failure, an error is returned." + ], + "example_usage": [ + "Here are some example using lightning-cli. Note that you may need to use `-o` if you use queries which contain `=` (which make lightning-cli(1) default to keyword style):", + "", + "A simple peer selection query:", + "", + "```shell", + "$ lightning-cli sql \"SELECT id FROM peers\"", + "{", + " \"rows\": [", + " [", + " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\"", + " ]", + " ]", + "}", + "```", + "", + "A statement containing using `=` needs `-o`:", + "", + "```shell", + "$ lightning-cli sql -o \"SELECT node_id,last_timestamp FROM nodes WHERE last_timestamp>=1669578892\"", + "{", + " \"rows\": [", + " [", + " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\",", + " 1669601603", + " ]", + " ]", + "}", + "```", + "", + "If you want to compare a BLOB column, `x'hex'` or `X'hex'` are needed:", + "", + "```shell", + "$ lightning-cli sql -o \"SELECT nodeid FROM nodes WHERE nodeid != x'03c9d25b6c0ce4bde5ad97d7ab83f00ae8bd3800a98ccbee36f3c3205315147de1';\"", + "{", + " \"rows\": [", + " [", + " \"0214739d625944f8fdc0da9d2ef44dbd7af58443685e494117b51410c5c3ff973a\"", + " ],", + " [", + " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\"", + " ]", + " ]", + "}", + "$ lightning-cli sql -o \"SELECT nodeid FROM nodes WHERE nodeid IN (x'03c9d25b6c0ce4bde5ad97d7ab83f00ae8bd3800a98ccbee36f3c3205315147de1', x'02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00')\"", + "{", + " \"rows\": [", + " [", + " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\"", + " ],", + " [", + " \"03c9d25b6c0ce4bde5ad97d7ab83f00ae8bd3800a98ccbee36f3c3205315147de1\"", + " ]", + " ]", + "}", + "```", + "", + "Related tables are usually referenced by JOIN:", + "", + "```shell", + "$ lightning-cli sql -o \"SELECT nodeid, alias, nodes_addresses.type, nodes_addresses.port, nodes_addresses.address FROM nodes INNER JOIN nodes_addresses ON nodes_addresses.row = nodes.rowid\"", + "{", + " \"rows\": [", + " [", + " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\",", + " \"YELLOWWATCH-22.11rc2-31-gcd7593b\",", + " \"dns\",", + " 7272,", + " \"localhost\"", + " ],", + " [", + " \"0214739d625944f8fdc0da9d2ef44dbd7af58443685e494117b51410c5c3ff973a\",", + " \"HOPPINGSQUIRREL-1rc2-31-gcd7593b\",", + " \"dns\",", + " 7171,", + " \"localhost\"", + " ]", + " ]", + "}", + "```", + "", + "Simple function usage, in this case COUNT. Strings inside arrays need \", and ' to protect them from the shell:", + "", + "```shell", + "$ lightning-cli sql 'SELECT COUNT(*) FROM nodes\"", + "{", + " \"rows\": [", + " [", + " 3", + " ]", + " ]", + "}", + "```" + ], + "example_json_request": [ + { + "id": "example:sql#1", + "method": "sql", + "params": [ + "SELECT * FROM forwards;" + ] + }, + { + "id": "example:sql#2", + "method": "sql", + "params": [ + "SELECT * from peerchannels_features" + ] + } + ], + "example_json_response": [ + { + "rows": [] + }, + { + "rows": [ + [ + 6, + 1, + 0, + "option_static_remotekey" + ], + [ + 7, + 1, + 1, + "option_anchors_zero_fee_htlc_tx" + ], + [ + 16, + 11, + 0, + "option_static_remotekey" + ], + [ + 17, + 11, + 1, + "option_anchors_zero_fee_htlc_tx" + ] + ] + } + ], + "author": [ + "Rusty Russell <> is mainly responsible." + ], + "see_also": [ + "lightning-listtransactions(7)", + "lightning-listchannels(7)", + "lightning-listpeers(7)", + "lightning-listnodes(7)", + "lightning-listforwards(7)" + ], + "resources": [ + "Main web site: " + ] +} diff --git a/doc/schemas/lightning-sql.json b/doc/schemas/lightning-sql.json deleted file mode 100644 index 63088cbbc668..000000000000 --- a/doc/schemas/lightning-sql.json +++ /dev/null @@ -1,266 +0,0 @@ -{ - "$schema": "../rpc-schema-draft.json", - "type": "object", - "additionalProperties": false, - "added": "v23.02", - "rpc": "sql", - "title": "Command to do complex queries on list commands", - "description": [ - "The **sql** RPC command runs the given query across a sqlite3 database created from various list commands.", - "", - "When tables are accessed, it calls the below commands, so it's no faster than any other local access (though it goes to great length to cache `listnodes` and `listchannels`) which then processes the results.", - "", - "It is, however faster for remote access if the result of the query is much smaller than the list commands would be." - ], - "request": { - "required": [ - "query" - ], - "properties": { - "query": { - "type": "string", - "description": [ - "The standard sqlite3 query to run.", - "Note that queries like \"SELECT *\" are fragile, as columns will change across releases; see lightning-listsqlschemas(7)." - ] - } - } - }, - "response": { - "required": [ - "rows" - ], - "properties": { - "rows": { - "type": "array", - "items": { - "type": "array" - } - }, - "warning_db_failure": { - "type": "string", - "description": [ - "A message if the database encounters an error partway through." - ] - } - }, - "pre_return_value_notes": [ - "On success, an object containing **rows** is returned. It is an array. Each array entry contains an array of values, each an integer, real number, string or *null*, depending on the sqlite3 type.", - "", - "The object may contain **warning_db_failure** if the database fails partway through its operation." - ] - }, - "treatment_of_types": [ - "The following types are supported in schemas, and this shows how they are presented in the database. This matters: a JSON boolean is represented as an integer in the database, so a query will return 0 or 1, not true or false.", - "", - "* *hex*. A hex string.", - " * JSON: a string", - " * sqlite3: BLOB", - "", - "* *hash*/*secret*/*pubkey*/*txid*: just like *hex*.", - "", - "* *msat*/*integer*/*u64*/*u32*/*u16*/*u8*. Normal numbers.", - " * JSON: an unsigned integer", - " * sqlite3: INTEGER", - "", - "* *boolean*. True or false.", - " * JSON: literal **true** or **false**", - " * sqlite3: INTEGER", - "", - "* *number*. A floating point number (used for times in some places).", - " * JSON: number", - " * sqlite3: REAL", - "", - "* *string*. Text.", - " * JSON: string", - " * sqlite3: TEXT", - "", - "* *short_channel_id*. A short-channel-id of form 1x2x3.", - " * JSON: string", - " * sqlite3: TEXT" - ], - "permitted_sqlite3_functions": [ - "Writing to the database is not permitted, and limits are placed on various other query parameters.", - "", - "Additionally, only the following functions are allowed:", - "", - "* abs", - "* avg", - "* coalesce", - "* count", - "* hex", - "* quote", - "* length", - "* like", - "* lower", - "* upper", - "* min", - "* max", - "* sum", - "* total" - ], - "tables": [ - "Note that the first column of every table is a unique integer called `rowid`: this is used for related tables to refer to specific rows in their parent. sqlite3 usually has this as an implicit column, but we make it explicit as the implicit version is not allowed to be used as a foreign key.", - "", - "The following tables are currently supported:\n- `bkpr_accountevents` (see lightning-bkpr-listaccountevents(7))\n - `account` (type `string`, sqltype `TEXT`)\n - `type` (type `string`, sqltype `TEXT`)\n - `tag` (type `string`, sqltype `TEXT`)\n - `credit_msat` (type `msat`, sqltype `INTEGER`)\n - `debit_msat` (type `msat`, sqltype `INTEGER`)\n - `currency` (type `string`, sqltype `TEXT`)\n - `timestamp` (type `u32`, sqltype `INTEGER`)\n - `outpoint` (type `string`, sqltype `TEXT`)\n - `blockheight` (type `u32`, sqltype `INTEGER`)\n - `origin` (type `string`, sqltype `TEXT`)\n - `payment_id` (type `hex`, sqltype `BLOB`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `description` (type `string`, sqltype `TEXT`)\n - `fees_msat` (type `msat`, sqltype `INTEGER`)\n - `is_rebalance` (type `boolean`, sqltype `INTEGER`)\n - `part_id` (type `u32`, sqltype `INTEGER`)\n\n- `bkpr_income` (see lightning-bkpr-listincome(7))\n - `account` (type `string`, sqltype `TEXT`)\n - `tag` (type `string`, sqltype `TEXT`)\n - `credit_msat` (type `msat`, sqltype `INTEGER`)\n - `debit_msat` (type `msat`, sqltype `INTEGER`)\n - `currency` (type `string`, sqltype `TEXT`)\n - `timestamp` (type `u32`, sqltype `INTEGER`)\n - `description` (type `string`, sqltype `TEXT`)\n - `outpoint` (type `string`, sqltype `TEXT`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `payment_id` (type `hex`, sqltype `BLOB`)\n\n- `channels` indexed by `short_channel_id` (see lightning-listchannels(7))\n - `source` (type `pubkey`, sqltype `BLOB`)\n - `destination` (type `pubkey`, sqltype `BLOB`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `direction` (type `u32`, sqltype `INTEGER`)\n - `public` (type `boolean`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `message_flags` (type `u8`, sqltype `INTEGER`)\n - `channel_flags` (type `u8`, sqltype `INTEGER`)\n - `active` (type `boolean`, sqltype `INTEGER`)\n - `last_update` (type `u32`, sqltype `INTEGER`)\n - `base_fee_millisatoshi` (type `u32`, sqltype `INTEGER`)\n - `fee_per_millionth` (type `u32`, sqltype `INTEGER`)\n - `delay` (type `u32`, sqltype `INTEGER`)\n - `htlc_minimum_msat` (type `msat`, sqltype `INTEGER`)\n - `htlc_maximum_msat` (type `msat`, sqltype `INTEGER`)\n - `features` (type `hex`, sqltype `BLOB`)\n\n- `closedchannels` (see lightning-listclosedchannels(7))\n - `peer_id` (type `pubkey`, sqltype `BLOB`)\n - `channel_id` (type `hash`, sqltype `BLOB`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `opener` (type `string`, sqltype `TEXT`)\n - `closer` (type `string`, sqltype `TEXT`)\n - `private` (type `boolean`, sqltype `INTEGER`)\n - related table `closedchannels_channel_type_bits`, from JSON object `channel_type`\n - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `bits` (type `u32`, sqltype `INTEGER`)\n - related table `closedchannels_channel_type_names`, from JSON object `channel_type`\n - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `names` (type `string`, sqltype `TEXT`)\n - `total_local_commitments` (type `u64`, sqltype `INTEGER`)\n - `total_remote_commitments` (type `u64`, sqltype `INTEGER`)\n - `total_htlcs_sent` (type `u64`, sqltype `INTEGER`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `leased` (type `boolean`, sqltype `INTEGER`)\n - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`)\n - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`)\n - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`)\n - `total_msat` (type `msat`, sqltype `INTEGER`)\n - `final_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `min_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `max_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `last_commitment_txid` (type `hash`, sqltype `BLOB`)\n - `last_commitment_fee_msat` (type `msat`, sqltype `INTEGER`)\n - `close_cause` (type `string`, sqltype `TEXT`)\n - `last_stable_connection` (type `u64`, sqltype `INTEGER`)\n\n- `forwards` indexed by `in_channel and in_htlc_id` (see lightning-listforwards(7))\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `in_channel` (type `short_channel_id`, sqltype `TEXT`)\n - `in_htlc_id` (type `u64`, sqltype `INTEGER`)\n - `in_msat` (type `msat`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `received_time` (type `number`, sqltype `REAL`)\n - `out_channel` (type `short_channel_id`, sqltype `TEXT`)\n - `out_htlc_id` (type `u64`, sqltype `INTEGER`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `style` (type `string`, sqltype `TEXT`)\n - `fee_msat` (type `msat`, sqltype `INTEGER`)\n - `out_msat` (type `msat`, sqltype `INTEGER`)\n - `resolved_time` (type `number`, sqltype `REAL`)\n - `failcode` (type `u32`, sqltype `INTEGER`)\n - `failreason` (type `string`, sqltype `TEXT`)\n\n- `htlcs` indexed by `short_channel_id and id` (see lightning-listhtlcs(7))\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `expiry` (type `u32`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `direction` (type `string`, sqltype `TEXT`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `state` (type `string`, sqltype `TEXT`)\n\n- `invoices` indexed by `payment_hash` (see lightning-listinvoices(7))\n - `label` (type `string`, sqltype `TEXT`)\n - `description` (type `string`, sqltype `TEXT`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `status` (type `string`, sqltype `TEXT`)\n - `expires_at` (type `u64`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `bolt11` (type `string`, sqltype `TEXT`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `local_offer_id` (type `hash`, sqltype `BLOB`)\n - `invreq_payer_note` (type `string`, sqltype `TEXT`)\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `pay_index` (type `u64`, sqltype `INTEGER`)\n - `amount_received_msat` (type `msat`, sqltype `INTEGER`)\n - `paid_at` (type `u64`, sqltype `INTEGER`)\n - `paid_outpoint_txid` (type `txid`, sqltype `BLOB`, from JSON object `paid_outpoint`)\n - `paid_outpoint_outnum` (type `u32`, sqltype `INTEGER`, from JSON object `paid_outpoint`)\n - `payment_preimage` (type `secret`, sqltype `BLOB`)\n\n- `nodes` indexed by `nodeid` (see lightning-listnodes(7))\n - `nodeid` (type `pubkey`, sqltype `BLOB`)\n - `last_timestamp` (type `u32`, sqltype `INTEGER`)\n - `alias` (type `string`, sqltype `TEXT`)\n - `color` (type `hex`, sqltype `BLOB`)\n - `features` (type `hex`, sqltype `BLOB`)\n - related table `nodes_addresses`\n - `row` (reference to `nodes.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `type` (type `string`, sqltype `TEXT`)\n - `port` (type `u16`, sqltype `INTEGER`)\n - `address` (type `string`, sqltype `TEXT`)\n - `option_will_fund_lease_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_lease_fee_basis` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_funding_weight` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_channel_fee_max_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_channel_fee_max_proportional_thousandths` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`)\n - `option_will_fund_compact_lease` (type `hex`, sqltype `BLOB`, from JSON object `option_will_fund`)\n\n- `offers` indexed by `offer_id` (see lightning-listoffers(7))\n - `offer_id` (type `hash`, sqltype `BLOB`)\n - `active` (type `boolean`, sqltype `INTEGER`)\n - `single_use` (type `boolean`, sqltype `INTEGER`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `used` (type `boolean`, sqltype `INTEGER`)\n - `label` (type `string`, sqltype `TEXT`)\n\n- `peerchannels` indexed by `peer_id` (see lightning-listpeerchannels(7))\n - `peer_id` (type `pubkey`, sqltype `BLOB`)\n - `peer_connected` (type `boolean`, sqltype `INTEGER`)\n - `reestablished` (type `boolean`, sqltype `INTEGER`)\n - `state` (type `string`, sqltype `TEXT`)\n - `scratch_txid` (type `txid`, sqltype `BLOB`)\n - related table `peerchannels_channel_type_bits`, from JSON object `channel_type`\n - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `bits` (type `u32`, sqltype `INTEGER`)\n - related table `peerchannels_channel_type_names`, from JSON object `channel_type`\n - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `names` (type `string`, sqltype `TEXT`)\n - `local_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `local`)\n - `local_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`)\n - `local_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `local`)\n - `remote_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`)\n - `remote_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `remote`)\n - `ignore_fee_limits` (type `boolean`, sqltype `INTEGER`)\n - `lost_state` (type `boolean`, sqltype `INTEGER`)\n - `feerate_perkw` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`)\n - `feerate_perkb` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`)\n - `owner` (type `string`, sqltype `TEXT`)\n - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)\n - `channel_id` (type `hash`, sqltype `BLOB`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `initial_feerate` (type `string`, sqltype `TEXT`)\n - `last_feerate` (type `string`, sqltype `TEXT`)\n - `next_feerate` (type `string`, sqltype `TEXT`)\n - `next_fee_step` (type `u32`, sqltype `INTEGER`)\n - related table `peerchannels_inflight`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `funding_txid` (type `txid`, sqltype `BLOB`)\n - `funding_outnum` (type `u32`, sqltype `INTEGER`)\n - `feerate` (type `string`, sqltype `TEXT`)\n - `total_funding_msat` (type `msat`, sqltype `INTEGER`)\n - `splice_amount` (type `integer`, sqltype `INTEGER`)\n - `our_funding_msat` (type `msat`, sqltype `INTEGER`)\n - `scratch_txid` (type `txid`, sqltype `BLOB`)\n - `close_to` (type `hex`, sqltype `BLOB`)\n - `private` (type `boolean`, sqltype `INTEGER`)\n - `opener` (type `string`, sqltype `TEXT`)\n - `closer` (type `string`, sqltype `TEXT`)\n - related table `peerchannels_features`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `features` (type `string`, sqltype `TEXT`)\n - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_local_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_remote_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`)\n - `to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `min_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `max_to_us_msat` (type `msat`, sqltype `INTEGER`)\n - `total_msat` (type `msat`, sqltype `INTEGER`)\n - `fee_base_msat` (type `msat`, sqltype `INTEGER`)\n - `fee_proportional_millionths` (type `u32`, sqltype `INTEGER`)\n - `dust_limit_msat` (type `msat`, sqltype `INTEGER`)\n - `max_total_htlc_in_msat` (type `msat`, sqltype `INTEGER`)\n - `their_reserve_msat` (type `msat`, sqltype `INTEGER`)\n - `our_reserve_msat` (type `msat`, sqltype `INTEGER`)\n - `spendable_msat` (type `msat`, sqltype `INTEGER`)\n - `receivable_msat` (type `msat`, sqltype `INTEGER`)\n - `minimum_htlc_in_msat` (type `msat`, sqltype `INTEGER`)\n - `minimum_htlc_out_msat` (type `msat`, sqltype `INTEGER`)\n - `maximum_htlc_out_msat` (type `msat`, sqltype `INTEGER`)\n - `their_to_self_delay` (type `u32`, sqltype `INTEGER`)\n - `our_to_self_delay` (type `u32`, sqltype `INTEGER`)\n - `max_accepted_htlcs` (type `u32`, sqltype `INTEGER`)\n - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`)\n - related table `peerchannels_state_changes`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `timestamp` (type `string`, sqltype `TEXT`)\n - `old_state` (type `string`, sqltype `TEXT`)\n - `new_state` (type `string`, sqltype `TEXT`)\n - `cause` (type `string`, sqltype `TEXT`)\n - `message` (type `string`, sqltype `TEXT`)\n - related table `peerchannels_status`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `in_payments_offered` (type `u64`, sqltype `INTEGER`)\n - `in_offered_msat` (type `msat`, sqltype `INTEGER`)\n - `in_payments_fulfilled` (type `u64`, sqltype `INTEGER`)\n - `in_fulfilled_msat` (type `msat`, sqltype `INTEGER`)\n - `out_payments_offered` (type `u64`, sqltype `INTEGER`)\n - `out_offered_msat` (type `msat`, sqltype `INTEGER`)\n - `out_payments_fulfilled` (type `u64`, sqltype `INTEGER`)\n - `out_fulfilled_msat` (type `msat`, sqltype `INTEGER`)\n - `last_stable_connection` (type `u64`, sqltype `INTEGER`)\n - related table `peerchannels_htlcs`\n - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `direction` (type `string`, sqltype `TEXT`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `expiry` (type `u32`, sqltype `INTEGER`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `local_trimmed` (type `boolean`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `state` (type `string`, sqltype `TEXT`)\n - `close_to_addr` (type `string`, sqltype `TEXT`)\n - `last_tx_fee_msat` (type `msat`, sqltype `INTEGER`)\n - `direction` (type `u32`, sqltype `INTEGER`)\n\n- `peers` indexed by `id` (see lightning-listpeers(7))\n - `id` (type `pubkey`, sqltype `BLOB`)\n - `connected` (type `boolean`, sqltype `INTEGER`)\n - `num_channels` (type `u32`, sqltype `INTEGER`)\n - related table `peers_netaddr`\n - `row` (reference to `peers.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `netaddr` (type `string`, sqltype `TEXT`)\n - `remote_addr` (type `string`, sqltype `TEXT`)\n - `features` (type `hex`, sqltype `BLOB`)\n\n- `sendpays` indexed by `payment_hash` (see lightning-listsendpays(7))\n - `created_index` (type `u64`, sqltype `INTEGER`)\n - `id` (type `u64`, sqltype `INTEGER`)\n - `groupid` (type `u64`, sqltype `INTEGER`)\n - `partid` (type `u64`, sqltype `INTEGER`)\n - `payment_hash` (type `hash`, sqltype `BLOB`)\n - `updated_index` (type `u64`, sqltype `INTEGER`)\n - `status` (type `string`, sqltype `TEXT`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `destination` (type `pubkey`, sqltype `BLOB`)\n - `created_at` (type `u64`, sqltype `INTEGER`)\n - `amount_sent_msat` (type `msat`, sqltype `INTEGER`)\n - `label` (type `string`, sqltype `TEXT`)\n - `bolt11` (type `string`, sqltype `TEXT`)\n - `description` (type `string`, sqltype `TEXT`)\n - `bolt12` (type `string`, sqltype `TEXT`)\n - `completed_at` (type `u64`, sqltype `INTEGER`)\n - `payment_preimage` (type `secret`, sqltype `BLOB`)\n - `erroronion` (type `hex`, sqltype `BLOB`)\n\n- `transactions` indexed by `hash` (see lightning-listtransactions(7))\n - `hash` (type `txid`, sqltype `BLOB`)\n - `rawtx` (type `hex`, sqltype `BLOB`)\n - `blockheight` (type `u32`, sqltype `INTEGER`)\n - `txindex` (type `u32`, sqltype `INTEGER`)\n - `locktime` (type `u32`, sqltype `INTEGER`)\n - `version` (type `u32`, sqltype `INTEGER`)\n - related table `transactions_inputs`\n - `row` (reference to `transactions.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `txid` (type `txid`, sqltype `BLOB`)\n - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`)\n - `sequence` (type `u32`, sqltype `INTEGER`)\n - related table `transactions_outputs`\n - `row` (reference to `transactions.rowid`, sqltype `INTEGER`)\n - `arrindex` (index within array, sqltype `INTEGER`)\n - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`)\n - `amount_msat` (type `msat`, sqltype `INTEGER`)\n - `scriptPubKey` (type `hex`, sqltype `BLOB`)" - ], - "errors": [ - "On failure, an error is returned." - ], - "example_usage": [ - "Here are some example using lightning-cli. Note that you may need to use `-o` if you use queries which contain `=` (which make lightning-cli(1) default to keyword style):", - "", - "A simple peer selection query:", - "", - "```shell", - "$ lightning-cli sql \"SELECT id FROM peers\"", - "{", - " \"rows\": [", - " [", - " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\"", - " ]", - " ]", - "}", - "```", - "", - "A statement containing using `=` needs `-o`:", - "", - "```shell", - "$ lightning-cli sql -o \"SELECT node_id,last_timestamp FROM nodes WHERE last_timestamp>=1669578892\"", - "{", - " \"rows\": [", - " [", - " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\",", - " 1669601603", - " ]", - " ]", - "}", - "```", - "", - "If you want to compare a BLOB column, `x'hex'` or `X'hex'` are needed:", - "", - "```shell", - "$ lightning-cli sql -o \"SELECT nodeid FROM nodes WHERE nodeid != x'03c9d25b6c0ce4bde5ad97d7ab83f00ae8bd3800a98ccbee36f3c3205315147de1';\"", - "{", - " \"rows\": [", - " [", - " \"0214739d625944f8fdc0da9d2ef44dbd7af58443685e494117b51410c5c3ff973a\"", - " ],", - " [", - " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\"", - " ]", - " ]", - "}", - "$ lightning-cli sql -o \"SELECT nodeid FROM nodes WHERE nodeid IN (x'03c9d25b6c0ce4bde5ad97d7ab83f00ae8bd3800a98ccbee36f3c3205315147de1', x'02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00')\"", - "{", - " \"rows\": [", - " [", - " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\"", - " ],", - " [", - " \"03c9d25b6c0ce4bde5ad97d7ab83f00ae8bd3800a98ccbee36f3c3205315147de1\"", - " ]", - " ]", - "}", - "```", - "", - "Related tables are usually referenced by JOIN:", - "", - "```shell", - "$ lightning-cli sql -o \"SELECT nodeid, alias, nodes_addresses.type, nodes_addresses.port, nodes_addresses.address FROM nodes INNER JOIN nodes_addresses ON nodes_addresses.row = nodes.rowid\"", - "{", - " \"rows\": [", - " [", - " \"02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00\",", - " \"YELLOWWATCH-22.11rc2-31-gcd7593b\",", - " \"dns\",", - " 7272,", - " \"localhost\"", - " ],", - " [", - " \"0214739d625944f8fdc0da9d2ef44dbd7af58443685e494117b51410c5c3ff973a\",", - " \"HOPPINGSQUIRREL-1rc2-31-gcd7593b\",", - " \"dns\",", - " 7171,", - " \"localhost\"", - " ]", - " ]", - "}", - "```", - "", - "Simple function usage, in this case COUNT. Strings inside arrays need \", and ' to protect them from the shell:", - "", - "```shell", - "$ lightning-cli sql 'SELECT COUNT(*) FROM nodes\"", - "{", - " \"rows\": [", - " [", - " 3", - " ]", - " ]", - "}", - "```" - ], - "example_json_request": [ - { - "id": "example:sql#1", - "method": "sql", - "params": [ - "SELECT * FROM forwards;" - ] - }, - { - "id": "example:sql#2", - "method": "sql", - "params": [ - "SELECT * from peerchannels_features" - ] - } - ], - "example_json_response": [ - { - "rows": [] - }, - { - "rows": [ - [ - 6, - 1, - 0, - "option_static_remotekey" - ], - [ - 7, - 1, - 1, - "option_anchors_zero_fee_htlc_tx" - ], - [ - 16, - 11, - 0, - "option_static_remotekey" - ], - [ - 17, - 11, - 1, - "option_anchors_zero_fee_htlc_tx" - ] - ] - } - ], - "author": [ - "Rusty Russell <> is mainly responsible." - ], - "see_also": [ - "lightning-listtransactions(7)", - "lightning-listchannels(7)", - "lightning-listpeers(7)", - "lightning-listnodes(7)", - "lightning-listforwards(7)" - ], - "resources": [ - "Main web site: " - ] -} diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 7082baea6aeb..ec82cfcc22d3 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -3714,6 +3714,8 @@ def test_sql(node_factory, bitcoind): 'type': 'string'}, {'name': 'bolt12', 'type': 'string'}, + {'name': 'completed_at', + 'type': 'u64'}, {'name': 'payment_preimage', 'type': 'secret'}, {'name': 'erroronion', @@ -3724,6 +3726,8 @@ def test_sql(node_factory, bitcoind): 'type': 'pubkey'}, {'name': 'peer_connected', 'type': 'boolean'}, + {'name': 'reestablished', + 'type': 'boolean'}, {'name': 'state', 'type': 'string'}, {'name': 'scratch_txid', @@ -3850,8 +3854,6 @@ def test_sql(node_factory, bitcoind): 'type': 'msat'}, {'name': 'last_stable_connection', 'type': 'u64'}, - {'name': 'reestablished', - 'type': 'boolean'}, {'name': 'close_to_addr', 'type': 'string'}, {'name': 'last_tx_fee_msat', diff --git a/tools/fromschema.py b/tools/fromschema.py index 90c5c3505ae3..f2c437641c03 100755 --- a/tools/fromschema.py +++ b/tools/fromschema.py @@ -7,7 +7,7 @@ import re # To maintain the sequence of the before return value (body) and after return value (footer) sections in the markdown file -BODY_KEY_SEQUENCE = ['reliability', 'usage', 'restriction_format', 'example_usage', 'example_json_request', 'notes', 'notifications', 'sharing_runes', 'riskfactor_effect_on_routing', 'recommended_riskfactor_values', 'optimality', 'randomization'] +BODY_KEY_SEQUENCE = ['reliability', 'usage', 'restriction_format', 'permitted_sqlite3_functions', 'treatment_of_types', 'tables', 'example_usage', 'example_json_request', 'notes', 'notifications', 'sharing_runes', 'riskfactor_effect_on_routing', 'recommended_riskfactor_values', 'optimality', 'randomization'] FOOTER_KEY_SEQUENCE = ['example_json_response', 'errors', 'example_json_notifications', 'trivia', 'author', 'see_also', 'resources'] From 85f70402f25aae0b01887b53df827277ad8e5795 Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Thu, 22 Feb 2024 21:49:54 -0800 Subject: [PATCH 16/16] doc: Delete markdowns as they will be generated by scripts now This PR will generate doc/lightning-*.md file for rpc commands. It will get the information from consolidated doc/schemas/lightning-*.json file and use it to generate markdown file for RPC commands. Changelog-Changed: Documentation: great documentation rewrite, all reference pages now generated from the fully-tested JSON schemas and include examples. --- .gitignore | 1 + contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py | 1 - .../pyln/grpc/primitives_pb2.py | 1 - doc/lightning-addgossip.7.md | 66 -- doc/lightning-addpsbtoutput.7.md | 111 --- doc/lightning-autoclean-once.7.md | 104 --- doc/lightning-autoclean-status.7.md | 141 --- doc/lightning-batching.7.md | 56 -- doc/lightning-bkpr-channelsapy.7.md | 121 --- doc/lightning-bkpr-dumpincomecsv.7.md | 65 -- doc/lightning-bkpr-inspect.7.md | 87 -- doc/lightning-bkpr-listaccountevents.7.md | 294 ------- doc/lightning-bkpr-listbalances.7.md | 77 -- doc/lightning-bkpr-listincome.7.md | 135 --- doc/lightning-blacklistrune.7.md | 107 --- doc/lightning-check.7.md | 97 -- doc/lightning-checkmessage.7.md | 87 -- doc/lightning-checkrune.7.md | 117 --- doc/lightning-close.7.md | 129 --- doc/lightning-commando-blacklist.7.md | 107 --- doc/lightning-commando-listrunes.7.md | 184 ---- doc/lightning-commando-rune.7.md | 269 ------ doc/lightning-commando.7.md | 159 ---- doc/lightning-connect.7.md | 117 --- doc/lightning-createinvoice.7.md | 68 -- doc/lightning-createonion.7.md | 186 ---- doc/lightning-createrune.7.md | 256 ------ doc/lightning-datastore.7.md | 147 ---- doc/lightning-datastoreusage.7.md | 98 --- doc/lightning-decode.7.md | 369 -------- doc/lightning-decodepay.7.md | 104 --- doc/lightning-deldatastore.7.md | 101 --- doc/lightning-delexpiredinvoice.7.md | 54 -- doc/lightning-delforward.7.md | 77 -- doc/lightning-delinvoice.7.md | 123 --- doc/lightning-delpay.7.md | 160 ---- doc/lightning-deprecations.7.md | 63 -- doc/lightning-disableinvoicerequest.7.md | 48 - doc/lightning-disableoffer.7.md | 72 -- doc/lightning-disconnect.7.md | 83 -- doc/lightning-emergencyrecover.7.md | 67 -- doc/lightning-feerates.7.md | 229 ----- doc/lightning-fetchinvoice.7.md | 118 --- doc/lightning-fundchannel.7.md | 166 ---- doc/lightning-fundchannel_cancel.7.md | 82 -- doc/lightning-fundchannel_complete.7.md | 75 -- doc/lightning-fundchannel_start.7.md | 130 --- doc/lightning-funderupdate.7.md | 147 ---- doc/lightning-fundpsbt.7.md | 169 ---- doc/lightning-getinfo.7.md | 136 --- doc/lightning-getlog.7.md | 95 -- doc/lightning-getroute.7.md | 353 -------- doc/lightning-help.7.md | 94 -- doc/lightning-invoice.7.md | 138 --- doc/lightning-invoicerequest.7.md | 85 -- doc/lightning-keysend.7.md | 202 ----- doc/lightning-listchannels.7.md | 139 --- doc/lightning-listclosedchannels.7.md | 75 -- doc/lightning-listconfigs.7.md | 829 ------------------ doc/lightning-listdatastore.7.md | 95 -- doc/lightning-listforwards.7.md | 147 ---- doc/lightning-listfunds.7.md | 109 --- doc/lightning-listhtlcs.7.md | 184 ---- doc/lightning-listinvoicerequests.7.md | 74 -- doc/lightning-listinvoices.7.md | 107 --- doc/lightning-listnodes.7.md | 145 --- doc/lightning-listoffers.7.md | 99 --- doc/lightning-listpays.7.md | 114 --- doc/lightning-listpeerchannels.7.md | 401 --------- doc/lightning-listpeers.7.md | 244 ------ doc/lightning-listsendpays.7.md | 148 ---- doc/lightning-listsqlschemas.7.md | 223 ----- doc/lightning-listtransactions.7.md | 103 --- doc/lightning-makesecret.7.md | 72 -- doc/lightning-multifundchannel.7.md | 237 ----- doc/lightning-multiwithdraw.7.md | 123 --- doc/lightning-newaddr.7.md | 78 -- doc/lightning-notifications.7.md | 103 --- doc/lightning-offer.7.md | 115 --- doc/lightning-openchannel_abort.7.md | 73 -- doc/lightning-openchannel_bump.7.md | 68 -- doc/lightning-openchannel_init.7.md | 154 ---- doc/lightning-openchannel_signed.7.md | 56 -- doc/lightning-openchannel_update.7.md | 130 --- doc/lightning-parsefeerate.7.md | 90 -- doc/lightning-pay.7.md | 146 --- doc/lightning-ping.7.md | 81 -- doc/lightning-plugin.7.md | 175 ---- doc/lightning-preapproveinvoice.7.md | 44 - doc/lightning-preapprovekeysend.7.md | 46 - doc/lightning-recover.7.md | 70 -- doc/lightning-recoverchannel.7.md | 66 -- doc/lightning-renepay.7.md | 138 --- doc/lightning-renepaystatus.7.md | 51 -- doc/lightning-reserveinputs.7.md | 180 ---- doc/lightning-sendcustommsg.7.md | 67 -- doc/lightning-sendinvoice.7.md | 106 --- doc/lightning-sendonion.7.md | 134 --- doc/lightning-sendonionmessage.7.md | 43 - doc/lightning-sendpay.7.md | 195 ---- doc/lightning-sendpsbt.7.md | 81 -- doc/lightning-setchannel.7.md | 128 --- doc/lightning-setconfig.7.md | 123 --- doc/lightning-setpsbtversion.7.md | 78 -- doc/lightning-showrunes.7.md | 131 --- doc/lightning-signinvoice.7.md | 67 -- doc/lightning-signmessage.7.md | 76 -- doc/lightning-signpsbt.7.md | 86 -- doc/lightning-splice_init.7.md | 133 --- doc/lightning-splice_signed.7.md | 112 --- doc/lightning-splice_update.7.md | 121 --- doc/lightning-sql.7.md | 591 ------------- doc/lightning-staticbackup.7.md | 57 -- doc/lightning-stop.7.md | 50 -- doc/lightning-txdiscard.7.md | 69 -- doc/lightning-txprepare.7.md | 104 --- doc/lightning-txsend.7.md | 69 -- doc/lightning-unreserveinputs.7.md | 91 -- doc/lightning-upgradewallet.7.md | 81 -- doc/lightning-utxopsbt.7.md | 148 ---- doc/lightning-wait.7.md | 163 ---- doc/lightning-waitanyinvoice.7.md | 124 --- doc/lightning-waitblockheight.7.md | 75 -- doc/lightning-waitinvoice.7.md | 101 --- doc/lightning-waitsendpay.7.md | 117 --- doc/lightning-withdraw.7.md | 99 --- 126 files changed, 1 insertion(+), 16079 deletions(-) delete mode 100644 doc/lightning-addgossip.7.md delete mode 100644 doc/lightning-addpsbtoutput.7.md delete mode 100644 doc/lightning-autoclean-once.7.md delete mode 100644 doc/lightning-autoclean-status.7.md delete mode 100644 doc/lightning-batching.7.md delete mode 100644 doc/lightning-bkpr-channelsapy.7.md delete mode 100644 doc/lightning-bkpr-dumpincomecsv.7.md delete mode 100644 doc/lightning-bkpr-inspect.7.md delete mode 100644 doc/lightning-bkpr-listaccountevents.7.md delete mode 100644 doc/lightning-bkpr-listbalances.7.md delete mode 100644 doc/lightning-bkpr-listincome.7.md delete mode 100644 doc/lightning-blacklistrune.7.md delete mode 100644 doc/lightning-check.7.md delete mode 100644 doc/lightning-checkmessage.7.md delete mode 100644 doc/lightning-checkrune.7.md delete mode 100644 doc/lightning-close.7.md delete mode 100644 doc/lightning-commando-blacklist.7.md delete mode 100644 doc/lightning-commando-listrunes.7.md delete mode 100644 doc/lightning-commando-rune.7.md delete mode 100644 doc/lightning-commando.7.md delete mode 100644 doc/lightning-connect.7.md delete mode 100644 doc/lightning-createinvoice.7.md delete mode 100644 doc/lightning-createonion.7.md delete mode 100644 doc/lightning-createrune.7.md delete mode 100644 doc/lightning-datastore.7.md delete mode 100644 doc/lightning-datastoreusage.7.md delete mode 100644 doc/lightning-decode.7.md delete mode 100644 doc/lightning-decodepay.7.md delete mode 100644 doc/lightning-deldatastore.7.md delete mode 100644 doc/lightning-delexpiredinvoice.7.md delete mode 100644 doc/lightning-delforward.7.md delete mode 100644 doc/lightning-delinvoice.7.md delete mode 100644 doc/lightning-delpay.7.md delete mode 100644 doc/lightning-deprecations.7.md delete mode 100644 doc/lightning-disableinvoicerequest.7.md delete mode 100644 doc/lightning-disableoffer.7.md delete mode 100644 doc/lightning-disconnect.7.md delete mode 100644 doc/lightning-emergencyrecover.7.md delete mode 100644 doc/lightning-feerates.7.md delete mode 100644 doc/lightning-fetchinvoice.7.md delete mode 100644 doc/lightning-fundchannel.7.md delete mode 100644 doc/lightning-fundchannel_cancel.7.md delete mode 100644 doc/lightning-fundchannel_complete.7.md delete mode 100644 doc/lightning-fundchannel_start.7.md delete mode 100644 doc/lightning-funderupdate.7.md delete mode 100644 doc/lightning-fundpsbt.7.md delete mode 100644 doc/lightning-getinfo.7.md delete mode 100644 doc/lightning-getlog.7.md delete mode 100644 doc/lightning-getroute.7.md delete mode 100644 doc/lightning-help.7.md delete mode 100644 doc/lightning-invoice.7.md delete mode 100644 doc/lightning-invoicerequest.7.md delete mode 100644 doc/lightning-keysend.7.md delete mode 100644 doc/lightning-listchannels.7.md delete mode 100644 doc/lightning-listclosedchannels.7.md delete mode 100644 doc/lightning-listconfigs.7.md delete mode 100644 doc/lightning-listdatastore.7.md delete mode 100644 doc/lightning-listforwards.7.md delete mode 100644 doc/lightning-listfunds.7.md delete mode 100644 doc/lightning-listhtlcs.7.md delete mode 100644 doc/lightning-listinvoicerequests.7.md delete mode 100644 doc/lightning-listinvoices.7.md delete mode 100644 doc/lightning-listnodes.7.md delete mode 100644 doc/lightning-listoffers.7.md delete mode 100644 doc/lightning-listpays.7.md delete mode 100644 doc/lightning-listpeerchannels.7.md delete mode 100644 doc/lightning-listpeers.7.md delete mode 100644 doc/lightning-listsendpays.7.md delete mode 100644 doc/lightning-listsqlschemas.7.md delete mode 100644 doc/lightning-listtransactions.7.md delete mode 100644 doc/lightning-makesecret.7.md delete mode 100644 doc/lightning-multifundchannel.7.md delete mode 100644 doc/lightning-multiwithdraw.7.md delete mode 100644 doc/lightning-newaddr.7.md delete mode 100644 doc/lightning-notifications.7.md delete mode 100644 doc/lightning-offer.7.md delete mode 100644 doc/lightning-openchannel_abort.7.md delete mode 100644 doc/lightning-openchannel_bump.7.md delete mode 100644 doc/lightning-openchannel_init.7.md delete mode 100644 doc/lightning-openchannel_signed.7.md delete mode 100644 doc/lightning-openchannel_update.7.md delete mode 100644 doc/lightning-parsefeerate.7.md delete mode 100644 doc/lightning-pay.7.md delete mode 100644 doc/lightning-ping.7.md delete mode 100644 doc/lightning-plugin.7.md delete mode 100644 doc/lightning-preapproveinvoice.7.md delete mode 100644 doc/lightning-preapprovekeysend.7.md delete mode 100644 doc/lightning-recover.7.md delete mode 100644 doc/lightning-recoverchannel.7.md delete mode 100644 doc/lightning-renepay.7.md delete mode 100644 doc/lightning-renepaystatus.7.md delete mode 100644 doc/lightning-reserveinputs.7.md delete mode 100644 doc/lightning-sendcustommsg.7.md delete mode 100644 doc/lightning-sendinvoice.7.md delete mode 100644 doc/lightning-sendonion.7.md delete mode 100644 doc/lightning-sendonionmessage.7.md delete mode 100644 doc/lightning-sendpay.7.md delete mode 100644 doc/lightning-sendpsbt.7.md delete mode 100644 doc/lightning-setchannel.7.md delete mode 100644 doc/lightning-setconfig.7.md delete mode 100644 doc/lightning-setpsbtversion.7.md delete mode 100644 doc/lightning-showrunes.7.md delete mode 100644 doc/lightning-signinvoice.7.md delete mode 100644 doc/lightning-signmessage.7.md delete mode 100644 doc/lightning-signpsbt.7.md delete mode 100644 doc/lightning-splice_init.7.md delete mode 100644 doc/lightning-splice_signed.7.md delete mode 100644 doc/lightning-splice_update.7.md delete mode 100644 doc/lightning-sql.7.md delete mode 100644 doc/lightning-staticbackup.7.md delete mode 100644 doc/lightning-stop.7.md delete mode 100644 doc/lightning-txdiscard.7.md delete mode 100644 doc/lightning-txprepare.7.md delete mode 100644 doc/lightning-txsend.7.md delete mode 100644 doc/lightning-unreserveinputs.7.md delete mode 100644 doc/lightning-upgradewallet.7.md delete mode 100644 doc/lightning-utxopsbt.7.md delete mode 100644 doc/lightning-wait.7.md delete mode 100644 doc/lightning-waitanyinvoice.7.md delete mode 100644 doc/lightning-waitblockheight.7.md delete mode 100644 doc/lightning-waitinvoice.7.md delete mode 100644 doc/lightning-waitsendpay.7.md delete mode 100644 doc/lightning-withdraw.7.md diff --git a/.gitignore b/.gitignore index 5f7cbef5a053..43c98466b366 100644 --- a/.gitignore +++ b/.gitignore @@ -58,6 +58,7 @@ tests/plugins/test_selfdisable_after_getmanifest # Ignore generated files devtools/features doc/schemas/lightning-sql.json +doc/lightning-*.7.md doc/lightning*.[1578] doc/reckless*.[1578] *_sqlgen.[ch] diff --git a/contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py b/contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py index 56fef2ed5e48..7b8e7f80c733 100644 --- a/contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py +++ b/contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py @@ -20,7 +20,6 @@ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'node_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - DESCRIPTOR._options = None _globals['_GETINFOREQUEST']._serialized_start=37 _globals['_GETINFOREQUEST']._serialized_end=53 diff --git a/contrib/pyln-grpc-proto/pyln/grpc/primitives_pb2.py b/contrib/pyln-grpc-proto/pyln/grpc/primitives_pb2.py index 72544a2af6ac..c0ce0d478484 100644 --- a/contrib/pyln-grpc-proto/pyln/grpc/primitives_pb2.py +++ b/contrib/pyln-grpc-proto/pyln/grpc/primitives_pb2.py @@ -19,7 +19,6 @@ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'primitives_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - DESCRIPTOR._options = None _globals['_CHANNELSIDE']._serialized_start=718 _globals['_CHANNELSIDE']._serialized_end=754 diff --git a/doc/lightning-addgossip.7.md b/doc/lightning-addgossip.7.md deleted file mode 100644 index 45652a4b5680..000000000000 --- a/doc/lightning-addgossip.7.md +++ /dev/null @@ -1,66 +0,0 @@ -lightning-addgossip -- Command for injecting a gossip message (low-level) -========================================================================= - -SYNOPSIS --------- - -**addgossip** *message* - -DESCRIPTION ------------ - -The **addgossip** RPC command injects a hex-encoded gossip message into the gossip daemon. It may return an error if it is malformed, or may update its internal state using the gossip message. - -Note that currently some paths will still silently reject the gossip: it is best effort. - -This is particularly used by plugins which may receive channel\_update messages within error replies. - -- **message** (hex): The raw, hex-encoded, gossip message to add to the local gossip view. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:addgossip#1", - "method": "addgossip", - "params": { - "message": "010078c3314666731e339c0b8434f7824797a084ed7ca3655991a672da068e2c44cb53b57b53a296c133bc879109a8931dc31e6913a4bda3d58559b99b95663e6d52775579447ef5526300e1bb89bc6af8557aa1c3810a91814eafad6d103f43182e17b16644cb38c1d58a8edd094303959a9f1f9d42ff6c32a21f9c118531f512c8679cabaccc6e39dbd95a4dac90e75a258893c3aa3f733d1b8890174d5ddea8003cadffe557773c54d2c07ca1d535c4bf85885f879ae466c16a516e8ffcfec1740e3f5c98ca9ce13f452e867befef5517f306ed6aa5119b79059bcc6f68f329986b665d16de7bc7df64e3537504c91eeabe0e59d3a2b68e4216ead2b0f6e3ef7c000006226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f0000670000010000022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d590266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c0351802e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5702324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b" - } -} -{ - "id": "example:addgossip#2", - "method": "addgossip", - "params": { - "message": "0102420526c8eb62ec6999bbee5f1de4841cab734374ec642b7deeb0259e76220bf82e97a241c907d5ff52019655f7f9a614c285bb35690f3a1a2b928d7b2349a79e06226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f000067000001000065b32a0e010100060000000000000000000000010000000a000000003b023380" - } -} -``` - -RETURN VALUE ------------- - -On success, an empty object is returned. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{} -{} -``` - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-pay(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-addpsbtoutput.7.md b/doc/lightning-addpsbtoutput.7.md deleted file mode 100644 index ee5c9bfd6c5e..000000000000 --- a/doc/lightning-addpsbtoutput.7.md +++ /dev/null @@ -1,111 +0,0 @@ -lightning-addpsbtoutput -- Command to populate PSBT outputs from the wallet -=========================================================================== - -SYNOPSIS --------- - -**addpsbtoutput** *satoshi* [*initialpsbt*] [*locktime*] [*destination*] - -DESCRIPTION ------------ - -Command *added* in v23.11. - -`addpsbtoutput` is a low-level RPC command which creates or modifies a PSBT by adding a single output of amount *satoshi*. - -This is used to receive funds into the on-chain wallet interactively using PSBTs. - -- **satoshi** (sat): The satoshi value of the output. It can be a whole number, a whole number ending in *sat*, or a number with 1 to 8 decimal places ending in *btc*. -- **initialpsbt** (string, optional): Base 64 encoded PSBT to add the output to. If not specified, one will be generated automatically. -- **locktime** (u32, optional): If not set, it is set to a recent block height (if no initial psbt is specified). -- **destination** (string, optional): If it is not set, an internal address is generated. - -EXAMPLE USAGE -------------- - -Here is a command to make a PSBT with a 100,000 sat output that leads to the on-chain wallet. - -```shell -lightning-cli addpsbtoutput 100000sat -``` - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:addpsbtoutput#1", - "method": "addpsbtoutput", - "params": { - "satoshi": 100000, - "initialpsbt": null, - "locktime": null, - "destination": null - } -} -{ - "id": "example:addpsbtoutput#2", - "method": "addpsbtoutput", - "params": { - "satoshi": 1000000, - "initialpsbt": null, - "locktime": 111, - "destination": null - } -} -{ - "id": "example:addpsbtoutput#3", - "method": "addpsbtoutput", - "params": { - "satoshi": 974343, - "initialpsbt": "cHNidP8BAF4CAAAAAfwbEpvpi6D14YV4VLnuVB47Y0uF41kXEyJRL4IusySSAQAAAAD9////ASICAAAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5nAAAAAAEA9gIAAAAAAQFEkxvLatohY6mw5gr5qG1aiArSrziFPR2YoqD21Hv+RAAAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNrz8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIEu1nfVRt9i+rFM219mwhMqdwJsqygWSWTFUS+cemdh6AiBG3Qo8g9J/aAMO2RHDsIBScscj6pTTIwZp7Gw8G3EOKAEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPZgAAAAEBK68/DwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==", - "locktime": null, - "destination": "bcrt1q9tc6q49l6wrrtp8ul45rj92hsleehwwxty32zu" - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **psbt** (string): Unsigned PSBT which fulfills the parameters given. -- **estimated\_added\_weight** (u32): The estimated weight of the added output. -- **outnum** (u32): The 0-based number where the output was placed. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIoIYBAAAAAAABBCJRIHg2NV/cioLcTLAKdyxVVBUdBjhKTdZejT9orAhWa4S+AA==", - "estimated_added_weight": 172, - "outnum": 0 -} -{ - "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIJd6ICNAQALFOMhoUHuSVSuzcaUdkDKlk4K+A+DR9+4uAA==", - "estimated_added_weight": 172, - "outnum": 0 -} -{ - "psbt": "cHNidP8BAH0CAAAAAfwbEpvpi6D14YV4VLnuVB47Y0uF41kXEyJRL4IusySSAQAAAAD9////AiICAAAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4H3g4AAAAAABYAFCrxoFS/04Y1hPz9aDkVV4fzm7nGZwAAAAABAPYCAAAAAAEBRJMby2raIWOpsOYK+ahtWogK0q84hT0dmKKg9tR7/kQAAAAAAP3///8CQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAza8/DwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oCRzBEAiBLtZ31UbfYvqxTNtfZsITKncCbKsoFklkxVEvnHpnYegIgRt0KPIPSf2gDDtkRw7CAUnLHI+qU0yMGaexsPBtxDigBIQPXRURck2JmXyLg2W6edm8nPzJg3qOcina/oF3SaE3cz2YAAAABASuvPw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAAAA", - "estimated_added_weight": 172, - "outnum": 1 -} -``` - -AUTHOR ------- - -Dusty <<@dusty\_daemon>> is mainly responsible. - -SEE ALSO --------- - -lightning-fundpsbt(7), lightning-utxopsbt(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-autoclean-once.7.md b/doc/lightning-autoclean-once.7.md deleted file mode 100644 index e363f9cd3a08..000000000000 --- a/doc/lightning-autoclean-once.7.md +++ /dev/null @@ -1,104 +0,0 @@ -lightning-autoclean-once -- A single deletion of old invoices/payments/forwards -=============================================================================== - -SYNOPSIS --------- - -**autoclean-once** *subsystem* *age* - -DESCRIPTION ------------ - -The **autoclean-once** RPC command tell the `autoclean` plugin to do a single sweep to delete old entries. This is a manual alternative (or addition) to the various `autoclean-...-age` parameters which cause autoclean to run once per hour: see lightningd-config(5). - -- **subsystem** (string) (one of "succeededforwards", "failedforwards", "succeededpays", "failedpays", "paidinvoices", "expiredinvoices"): What subsystem to clean. Currently supported subsystems are: - * `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`). - * `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`). - * `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`). - * `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`). - * `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`). - * `paidinvoices`: invoices which were paid (`paid` in listinvoices status). -- **age** (u64): Non-zero number in seconds. How many seconds old an entry must be to delete it. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:autoclean-once#1", - "method": "autoclean-once", - "params": [ - "failedpays", - 1 - ] -} -{ - "id": "example:autoclean-once#2", - "method": "autoclean-once", - "params": [ - "succeededpays", - 1 - ] -} -``` - -RETURN VALUE ------------- - -On success, an object containing **autoclean** is returned. It is an object containing: - -- **succeededforwards** (object, optional): - - **cleaned** (u64): Total number of deletions done this run. - - **uncleaned** (u64): The total number of entries *not* deleted this run. -- **failedforwards** (object, optional): - - **cleaned** (u64): Total number of deletions done this run. - - **uncleaned** (u64): The total number of entries *not* deleted this run. -- **succeededpays** (object, optional): - - **cleaned** (u64): Total number of deletions done this run. - - **uncleaned** (u64): The total number of entries *not* deleted this run. -- **failedpays** (object, optional): - - **cleaned** (u64): Total number of deletions done this run. - - **uncleaned** (u64): The total number of entries *not* deleted this run. -- **paidinvoices** (object, optional): - - **cleaned** (u64): Total number of deletions done this run. - - **uncleaned** (u64): The total number of entries *not* deleted this run. -- **expiredinvoices** (object, optional): - - **cleaned** (u64): Total number of deletions done this run. - - **uncleaned** (u64): The total number of entries *not* deleted this run. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "autoclean": { - "failedpays": { - "cleaned": 1, - "uncleaned": 1 - } - } -} -{ - "autoclean": { - "succeededpays": { - "cleaned": 1, - "uncleaned": 0 - } - } -} -``` - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightningd-config(5), lightning-autoclean-status(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-autoclean-status.7.md b/doc/lightning-autoclean-status.7.md deleted file mode 100644 index eef6806af018..000000000000 --- a/doc/lightning-autoclean-status.7.md +++ /dev/null @@ -1,141 +0,0 @@ -lightning-autoclean-status -- Examine auto-delete of old invoices/payments/forwards -=================================================================================== - -SYNOPSIS --------- - -**autoclean-status** [*subsystem*] - -DESCRIPTION ------------ - -The **autoclean-status** RPC command tells you about the status of the autclean plugin, optionally for only one subsystem. - -- **subsystem** (string, optional) (one of "succeededforwards", "failedforwards", "succeededpays", "failedpays", "paidinvoices", "expiredinvoices"): What subsystem to ask about. Currently supported subsystems are: - * `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`). - * `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`). - * `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`). - * `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`). - * `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`). - * `paidinvoices`: invoices which were paid (`paid` in listinvoices status). - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:autoclean-status#1", - "method": "autoclean-status", - "params": { - "subsystem": "expiredinvoices" - } -} -{ - "id": "example:autoclean-status#2", - "method": "autoclean-status", - "params": { - "subsystem": null - } -} -``` - -RETURN VALUE ------------- - -Note that the ages parameters are set by various `autoclean-...-age` parameters in your configuration: see lightningd-config(5). -On success, an object containing **autoclean** is returned. It is an object containing: - -- **succeededforwards** (object, optional): - - **enabled** (boolean): Whether autocleaning is enabled for successful listforwards. - - **cleaned** (u64): Total number of deletions done (ever). - - If **enabled** is *true*: - - **age** (u64): Age (in seconds) to delete successful listforwards. -- **failedforwards** (object, optional): - - **enabled** (boolean): Whether autocleaning is enabled for failed listforwards. - - **cleaned** (u64): Total number of deletions done (ever). - - If **enabled** is *true*: - - **age** (u64): Age (in seconds) to delete failed listforwards. -- **succeededpays** (object, optional): - - **enabled** (boolean): Whether autocleaning is enabled for successful listpays/listsendpays. - - **cleaned** (u64): Total number of deletions done (ever). - - If **enabled** is *true*: - - **age** (u64): Age (in seconds) to delete successful listpays/listsendpays. -- **failedpays** (object, optional): - - **enabled** (boolean): Whether autocleaning is enabled for failed listpays/listsendpays. - - **cleaned** (u64): Total number of deletions done (ever). - - If **enabled** is *true*: - - **age** (u64): Age (in seconds) to delete failed listpays/listsendpays. -- **paidinvoices** (object, optional): - - **enabled** (boolean): Whether autocleaning is enabled for paid listinvoices. - - **cleaned** (u64): Total number of deletions done (ever). - - If **enabled** is *true*: - - **age** (u64): Age (in seconds) to paid listinvoices. -- **expiredinvoices** (object, optional): - - **enabled** (boolean): Whether autocleaning is enabled for expired (unpaid) listinvoices. - - **cleaned** (u64): Total number of deletions done (ever). - - If **enabled** is *true*: - - **age** (u64): Age (in seconds) to expired listinvoices. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "autoclean": { - "expiredinvoices": { - "enabled": false, - "cleaned": 0 - } - } -} -{ - "autoclean": { - "succeededforwards": { - "enabled": false, - "cleaned": 0 - }, - "failedforwards": { - "enabled": false, - "cleaned": 0 - }, - "succeededpays": { - "enabled": false, - "cleaned": 0 - }, - "failedpays": { - "enabled": false, - "cleaned": 0 - }, - "paidinvoices": { - "enabled": false, - "cleaned": 0 - }, - "expiredinvoices": { - "enabled": true, - "age": 2, - "cleaned": 0 - } - } -} -``` - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightningd-config(5), lightning-listinvoices(7), lightning-listpays(7), lightning-listforwards(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-batching.7.md b/doc/lightning-batching.7.md deleted file mode 100644 index e4f39b126593..000000000000 --- a/doc/lightning-batching.7.md +++ /dev/null @@ -1,56 +0,0 @@ -lightning-batching -- Command to allow database batching. -========================================================= - -SYNOPSIS --------- - -**batching** *enable* - -DESCRIPTION ------------ - -The **batching** RPC command allows (but does not guarantee!) database commitments to be deferred when multiple commands are issued on this RPC connection. This is only useful if many commands are being given at once, in which case it can offer a performance improvement (the cost being that if there is a crash, it's unclear how many of the commands will have been persisted). - -- **enable** (boolean): Whether to enable or disable transaction batching. The default is False. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:batching#1", - "method": "batching", - "params": { - "enable": true - } -} -``` - -RETURN VALUE ------------- - -On success, an empty object is returned. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{} -``` - -ERRORS ------- - -On failure, one of the following error codes may be returned: - -- -32602: Error in given parameters. - -AUTHOR ------- - -Rusty Russell <> wrote the initial version of this man page. - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-bkpr-channelsapy.7.md b/doc/lightning-bkpr-channelsapy.7.md deleted file mode 100644 index b27e00a477ab..000000000000 --- a/doc/lightning-bkpr-channelsapy.7.md +++ /dev/null @@ -1,121 +0,0 @@ -lightning-bkpr-channelsapy -- Command to list stats on channel earnings -======================================================================= - -SYNOPSIS --------- - -**bkpr-channelsapy** [*start\_time*] [*end\_time*] - -DESCRIPTION ------------ - -The **bkpr-channelsapy** RPC command lists stats on routing income, leasing income, and various calculated APYs for channel routed funds. - -- **start\_time** (u64, optional): UNIX timestamp (in seconds) to filter events after the provided timestamp. The default is zero. -- **end\_time** (u64, optional): UNIX timestamp (in seconds) to filter events up to and at the provided timestamp. The default is max-int. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:bkpr-channelsapy#1", - "method": "bkpr-channelsapy", - "params": "{}" -} -``` - -RETURN VALUE ------------- - -On success, an object containing **channels\_apy** is returned. It is an array of objects, where each object contains: - -- **account** (string): The account name. If the account is a channel, the channel\_id. The 'net' entry is the rollup of all channel accounts. -- **routed\_out\_msat** (msat): Sats routed (outbound). -- **routed\_in\_msat** (msat): Sats routed (inbound). -- **lease\_fee\_paid\_msat** (msat): Sats paid for leasing inbound (liquidity ads). -- **lease\_fee\_earned\_msat** (msat): Sats earned for leasing outbound (liquidity ads). -- **pushed\_out\_msat** (msat): Sats pushed to peer at open. -- **pushed\_in\_msat** (msat): Sats pushed in from peer at open. -- **our\_start\_balance\_msat** (msat): Starting balance in channel at funding. Note that if our start balance is zero, any \_initial field will be omitted (can't divide by zero). -- **channel\_start\_balance\_msat** (msat): Total starting balance at funding. -- **fees\_out\_msat** (msat): Fees earned on routed outbound. -- **utilization\_out** (string): Sats routed outbound / total start balance. -- **utilization\_in** (string): Sats routed inbound / total start balance. -- **apy\_out** (string): Fees earned on outbound routed payments / total start balance for the length of time this channel has been open amortized to a year (APY). -- **apy\_in** (string): Fees earned on inbound routed payments / total start balance for the length of time this channel has been open amortized to a year (APY). -- **apy\_total** (string): Total fees earned on routed payments / total start balance for the length of time this channel has been open amortized to a year (APY). -- **fees\_in\_msat** (msat, optional): Fees earned on routed inbound. -- **utilization\_out\_initial** (string, optional): Sats routed outbound / our start balance. -- **utilization\_in\_initial** (string, optional): Sats routed inbound / our start balance. -- **apy\_out\_initial** (string, optional): Fees earned on outbound routed payments / our start balance for the length of time this channel has been open amortized to a year (APY). -- **apy\_in\_initial** (string, optional): Fees earned on inbound routed payments / our start balance for the length of time this channel has been open amortized to a year (APY). -- **apy\_total\_initial** (string, optional): Total fees earned on routed payments / our start balance for the length of time this channel has been open amortized to a year (APY). -- **apy\_lease** (string, optional): Lease fees earned over total amount leased for the lease term, amortized to a year (APY). Only appears if channel was leased out by us. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "channels_apy": [ - { - "account": "e41b2ec83e9139a9fd8f1d89b01e5d7df73099494e6b91504c39445e37485b0d", - "routed_out_msat": 1431440, - "routed_in_msat": 0, - "lease_fee_paid_msat": 0, - "lease_fee_earned_msat": 0, - "pushed_out_msat": 0, - "pushed_in_msat": 0, - "our_start_balance_msat": 1000000000, - "channel_start_balance_msat": 1000000000, - "fees_out_msat": 0, - "fees_in_msat": 0, - "utilization_out": "0.1431%", - "utilization_out_initial": "0.1431%", - "utilization_in": "0.0000%", - "apy_out": "0.0000%", - "apy_out_initial": "0.0000%", - "apy_in": "0.0000%", - "apy_total": "0.0000%", - "apy_total_initial": "0.0000%" - }, - { - "account": "net", - "routed_out_msat": 1431440, - "routed_in_msat": 0, - "lease_fee_paid_msat": 0, - "lease_fee_earned_msat": 0, - "pushed_out_msat": 0, - "pushed_in_msat": 0, - "our_start_balance_msat": 1000000000, - "channel_start_balance_msat": 1000000000, - "fees_out_msat": 0, - "fees_in_msat": 0, - "utilization_out": "0.1431%", - "utilization_out_initial": "0.1431%", - "utilization_in": "0.0000%", - "apy_out": "0.0000%", - "apy_out_initial": "0.0000%", - "apy_in": "0.0000%", - "apy_total": "0.0000%", - "apy_total_initial": "0.0000%" - } - ] -} -``` - -AUTHOR ------- - -Lisa Neigut <> is mainly responsible. - -SEE ALSO --------- - -lightning-bkpr-listincome(7), lightning-bkpr-listfunds(7), lightning-bkpr-listaccountevents(7), lightning-bkpr-dumpincomecsv(7), lightning-listpeers(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-bkpr-dumpincomecsv.7.md b/doc/lightning-bkpr-dumpincomecsv.7.md deleted file mode 100644 index ca3237641115..000000000000 --- a/doc/lightning-bkpr-dumpincomecsv.7.md +++ /dev/null @@ -1,65 +0,0 @@ -lightning-bkpr-dumpincomecsv -- Command to emit a CSV of income events -====================================================================== - -SYNOPSIS --------- - -**bkpr-dumpincomecsv** *csv\_format* [*csv\_file*] [*consolidate\_fees*] [*start\_time*] [*end\_time*] - -DESCRIPTION ------------ - -The **bkpr-dumpincomcsv** RPC command writes a CSV file to disk at *csv\_file* location. This is a formatted output of the **listincome** RPC command. - -- **csv\_format** (string): CSV format to use. See RETURN VALUE for options. -- **csv\_file** (string, optional): On-disk destination of the generated CSV file. -- **consolidate\_fees** (boolean, optional): If true, we emit a single, consolidated event for any onchain-fees for a txid and account. Otherwise, events for every update to the onchain fee calculation for this account and txid will be printed. Note that this means that the events emitted are non-stable, i.e. calling **dumpincomecsv** twice may result in different onchain fee events being emitted, depending on how much information we've logged for that transaction. The default is True. -- **start\_time** (u64, optional): UNIX timestamp (in seconds) that filters events after the provided timestamp. The default is zero. -- **end\_time** (u64, optional): UNIX timestamp (in seconds) that filters events up to and at the provided timestamp. The default is max-int. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:bkpr-dumpincomecsv#1", - "method": "bkpr-dumpincomecsv", - "params": [ - "koinly", - "koinly.csv" - ] -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **csv\_file** (string): File that the csv was generated to. -- **csv\_format** (string) (one of "cointracker", "koinly", "harmony", "quickbooks"): Format to print csv as. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "csv_file": "koinly.csv", - "csv_format": "koinly" -} -``` - -AUTHOR ------- - -Lisa Neigut <> is mainly responsible. - -SEE ALSO --------- - -lightning-bkpr-listincome(7), lightning-bkpr-listfunds(7), lightning-bkpr-listaccountevents(7), lightning-bkpr-channelsapy(7), lightning-listpeers(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-bkpr-inspect.7.md b/doc/lightning-bkpr-inspect.7.md deleted file mode 100644 index 8d12829c0b56..000000000000 --- a/doc/lightning-bkpr-inspect.7.md +++ /dev/null @@ -1,87 +0,0 @@ -lightning-bkpr-inspect -- Command to show onchain footprint of a channel -======================================================================== - -SYNOPSIS --------- - -**bkpr-inspect** *account* - -DESCRIPTION ------------ - -The **bkpr-inspect** RPC command lists all known on-chain transactions and associated events for the provided account. Useful for inspecting unilateral closes for a given channel account. Only valid for channel accounts. - -- **account** (string): Channel account to inspect. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:bkpr-inspect#1", - "method": "bkpr-inspect", - "params": [ - "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab" - ] -} -``` - -RETURN VALUE ------------- - -On success, an object containing **txs** is returned. It is an array of objects, where each object contains: - -- **txid** (txid): Transaction id. -- **fees\_paid\_msat** (msat): Amount paid in sats for this tx. -- **outputs** (array of objects): - - **account** (string): Account this output affected. - - **outnum** (u32): Index of output. - - **output\_value\_msat** (msat): Value of the output. - - **currency** (string): Human-readable bech32 part for this coin type. - - **credit\_msat** (msat, optional): Amount credited to account. - - **debit\_msat** (msat, optional): Amount debited from account. - - **originating\_account** (string, optional): Account this output originated from. - - **output\_tag** (string, optional): Description of output creation event. - - **spend\_tag** (string, optional): Description of output spend event. - - **spending\_txid** (txid, optional): Transaction this output was spent in. - - **payment\_id** (hex, optional): Lightning payment identifier. For an htlc, this will be the preimage. -- **blockheight** (u32, optional): Blockheight of transaction. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "txs": [ - { - "txid": "abb283035e569c190696d42a1208bb38ddc64b6377e88f2d6277c01eab7b0af3", - "fees_paid_msat": 0, - "outputs": [ - { - "account": "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab", - "outnum": 0, - "output_tag": "channel_proposed", - "output_value_msat": 996363000, - "credit_msat": 996363000, - "currency": "bcrt" - } - ] - } - ] -} -``` - -AUTHOR ------- - -Lisa Neigut <> is mainly responsible. - -SEE ALSO --------- - -lightning-listbalances(7), lightning-listfunds(7), lightning-listpeers(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-bkpr-listaccountevents.7.md b/doc/lightning-bkpr-listaccountevents.7.md deleted file mode 100644 index 6b2218c4dc05..000000000000 --- a/doc/lightning-bkpr-listaccountevents.7.md +++ /dev/null @@ -1,294 +0,0 @@ -lightning-bkpr-listaccountevents -- Command for listing recorded bookkeeping events -=================================================================================== - -SYNOPSIS --------- - -**bkpr-listaccountevents** [*account*] - -DESCRIPTION ------------ - -The **bkpr-listaccountevents** RPC command is a list of all bookkeeping events that have been recorded for this node. - -If the optional parameter **account** is set, we only emit events for the specified account, if exists. - -Note that the type **onchain\_fees** that are emitted are of opposite credit/debit than as they appear in **listincome**, as **listincome** shows all events from the perspective of the node, whereas **listaccountevents** just dumps the event data as we've got it. Onchain fees are updated/recorded as we get more information about input and output spends -- the total onchain fees that were recorded for a transaction for an account can be found by summing all onchain fee events and taking the difference between the **credit\_msat** and **debit\_msat** for these events. We do this so that successive calls to **listaccountevents** always produce the same list of events -- no previously emitted event will be subsequently updated, rather we add a new event to the list. - -- **account** (string, optional): Receive events for the specified account. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:bkpr-listaccountevents#1", - "method": "bkpr-listaccountevents", - "params": "{}" -} -{ - "id": "example:bkpr-listaccountevents#2", - "method": "bkpr-listaccountevents", - "params": [ - "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab" - ] -} -``` - -RETURN VALUE ------------- - -On success, an object containing **events** is returned. It is an array of objects, where each object contains: - -- **account** (string): The account name. If the account is a channel, the channel\_id. -- **type** (string) (one of "onchain\_fee", "chain", "channel"): Coin movement type. -- **tag** (string): Description of movement. -- **credit\_msat** (msat): Amount credited. -- **debit\_msat** (msat): Amount debited. -- **currency** (string): Human-readable bech32 part for this coin type. -- **timestamp** (u32): Timestamp this event was recorded by the node. For consolidated events such as onchain\_fees, the most recent timestamp. - -If **type** is "chain": - - **outpoint** (string): The txid:outnum for this event. - - **blockheight** (u32): For chain events, blockheight this occured at. - - **origin** (string, optional): The account this movement originated from. - - **payment\_id** (hex, optional): Lightning payment identifier. For an htlc, this will be the preimage. - - **txid** (txid, optional): The txid of the transaction that created this event. - - **description** (string, optional): The description of this event. - -If **type** is "onchain\_fee": - - **txid** (txid): The txid of the transaction that created this event. - -If **type** is "channel": - - **fees\_msat** (msat, optional): Amount paid in fees. - - **is\_rebalance** (boolean, optional): Is this payment part of a rebalance. - - **payment\_id** (hex, optional): Lightning payment identifier. For an htlc, this will be the preimage. - - **part\_id** (u32, optional): Counter for multi-part payments. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "events": [ - { - "account": "wallet", - "type": "channel", - "tag": "journal_entry", - "credit_msat": 0, - "debit_msat": 0, - "currency": "bcrt", - "timestamp": 1706152911, - "is_rebalance": false - }, - { - "account": "wallet", - "type": "chain", - "tag": "deposit", - "credit_msat": 2000000000, - "debit_msat": 0, - "currency": "bcrt", - "outpoint": "7e202b3b1016e8eb6f4e936215ed6b5bdc63c17e6ebb5e6bce2f98e6757ba44c:0", - "timestamp": 1706152914, - "blockheight": 102 - }, - { - "account": "wallet", - "type": "chain", - "tag": "withdrawal", - "credit_msat": 0, - "debit_msat": 2000000000, - "currency": "bcrt", - "outpoint": "7e202b3b1016e8eb6f4e936215ed6b5bdc63c17e6ebb5e6bce2f98e6757ba44c:0", - "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b", - "timestamp": 1706152921, - "blockheight": 103 - }, - { - "account": "wallet", - "type": "chain", - "tag": "deposit", - "credit_msat": 995073000, - "debit_msat": 0, - "currency": "bcrt", - "outpoint": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b:1", - "timestamp": 1706152921, - "blockheight": 103 - }, - { - "account": "wallet", - "type": "onchain_fee", - "tag": "onchain_fee", - "credit_msat": 1004927000, - "debit_msat": 0, - "currency": "bcrt", - "timestamp": 1706152921, - "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b" - }, - { - "account": "wallet", - "type": "onchain_fee", - "tag": "onchain_fee", - "credit_msat": 0, - "debit_msat": 1004927000, - "currency": "bcrt", - "timestamp": 1706152921, - "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b" - }, - { - "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", - "type": "chain", - "tag": "channel_open", - "credit_msat": 1000000000, - "debit_msat": 0, - "currency": "bcrt", - "outpoint": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b:0", - "timestamp": 1706152922, - "blockheight": 103 - }, - { - "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", - "type": "onchain_fee", - "tag": "onchain_fee", - "credit_msat": 4927000, - "debit_msat": 0, - "currency": "bcrt", - "timestamp": 1706152922, - "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b" - }, - { - "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", - "type": "channel", - "tag": "invoice", - "credit_msat": 0, - "debit_msat": 11000000, - "currency": "bcrt", - "payment_id": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", - "part_id": 0, - "timestamp": 1706152934, - "description": [ - "XEoCR94SIz6UIRUEkxum." - ], - "is_rebalance": false - }, - { - "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", - "type": "chain", - "tag": "channel_close", - "credit_msat": 0, - "debit_msat": 989000000, - "currency": "bcrt", - "outpoint": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b:0", - "txid": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998", - "timestamp": 1706152938, - "blockheight": 104 - }, - { - "account": "external", - "origin": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", - "type": "chain", - "tag": "to_them", - "credit_msat": 10899000, - "debit_msat": 0, - "currency": "bcrt", - "outpoint": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998:0", - "timestamp": 1706152938, - "blockheight": 104 - }, - { - "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", - "type": "onchain_fee", - "tag": "onchain_fee", - "credit_msat": 7967000, - "debit_msat": 0, - "currency": "bcrt", - "timestamp": 1706152938, - "txid": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998" - }, - { - "account": "wallet", - "type": "chain", - "tag": "deposit", - "credit_msat": 980912000, - "debit_msat": 0, - "currency": "bcrt", - "outpoint": "85477738281c1afd652c350025f1d28658fe541c83adc9a7d5276c30cf715a11:0", - "timestamp": 1706152941, - "blockheight": 109 - }, - { - "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", - "type": "chain", - "tag": "delayed_to_us", - "credit_msat": 981033000, - "debit_msat": 0, - "currency": "bcrt", - "outpoint": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998:1", - "timestamp": 1706152941, - "blockheight": 104 - }, - { - "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", - "type": "chain", - "tag": "to_wallet", - "credit_msat": 0, - "debit_msat": 981033000, - "currency": "bcrt", - "outpoint": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998:1", - "txid": "85477738281c1afd652c350025f1d28658fe541c83adc9a7d5276c30cf715a11", - "timestamp": 1706152941, - "blockheight": 109 - }, - { - "account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", - "type": "onchain_fee", - "tag": "onchain_fee", - "credit_msat": 121000, - "debit_msat": 0, - "currency": "bcrt", - "timestamp": 1706152941, - "txid": "85477738281c1afd652c350025f1d28658fe541c83adc9a7d5276c30cf715a11" - } - ] -} -{ - "events": [ - { - "account": "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab", - "type": "chain", - "tag": "channel_proposed", - "credit_msat": 996363000, - "debit_msat": 0, - "currency": "bcrt", - "outpoint": "abb283035e569c190696d42a1208bb38ddc64b6377e88f2d6277c01eab7b0af3:0", - "timestamp": 1706246949, - "blockheight": 0 - }, - { - "account": "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab", - "type": "channel", - "tag": "pushed", - "credit_msat": 0, - "debit_msat": 20000000, - "currency": "bcrt", - "timestamp": 1706246949, - "is_rebalance": false - } - ] -} -``` - -AUTHOR ------- - -Lisa Neigut <> is mainly responsible. - -SEE ALSO --------- - -lightning-bkpr-listincome(7), lightning-listfunds(7), lightning-bkpr-listbalances(7), lightning-bkpr-channelsapy(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-bkpr-listbalances.7.md b/doc/lightning-bkpr-listbalances.7.md deleted file mode 100644 index eeaf2a8508fa..000000000000 --- a/doc/lightning-bkpr-listbalances.7.md +++ /dev/null @@ -1,77 +0,0 @@ -lightning-bkpr-listbalances -- Command for listing current channel + wallet balances -==================================================================================== - -SYNOPSIS --------- - -**bkpr-listbalances** - -DESCRIPTION ------------ - -The **bkpr-listbalances** RPC command is a list of all current and historical account balances. An account is either the on-chain *wallet* or a channel balance. Any funds sent to an *external* account will not be accounted for here. - -Note that any channel that was recorded will be listed. Closed channel balances will be 0msat. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:bkpr-listbalances#1", - "method": "bkpr-listbalances", - "params": "{}" -} -``` - -RETURN VALUE ------------- - -On success, an object containing **accounts** is returned. It is an array of objects, where each object contains: - -- **account** (string): The account name. If the account is a channel, the channel\_id. -- **balances** (array of objects): - - **balance\_msat** (msat): Current account balance. - - **coin\_type** (string): Coin type, same as HRP for bech32. - -If **peer\_id** is present: - - **peer\_id** (pubkey): Node id for the peer this account is with. - - **we\_opened** (boolean): Did we initiate this account open (open the channel). - - **account\_closed** (boolean): - - - **account\_resolved** (boolean): Has this channel been closed and all outputs resolved? - - **resolved\_at\_block** (u32, optional): Blockheight account resolved on chain. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "accounts": [ - { - "account": "wallet", - "balances": [ - { - "balance_msat": 2222222000, - "coin_type": "bcrt" - } - ] - } - ] -} -``` - -AUTHOR ------- - -Lisa Neigut <> is mainly responsible. - -SEE ALSO --------- - -lightning-bkpr-listincome(7), lightning-listfunds(7), lightning-bkpr-listaccountevents(7), lightning-bkpr-channelsapy(7), lightning-listpeers(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-bkpr-listincome.7.md b/doc/lightning-bkpr-listincome.7.md deleted file mode 100644 index 1b282c806922..000000000000 --- a/doc/lightning-bkpr-listincome.7.md +++ /dev/null @@ -1,135 +0,0 @@ -lightning-bkpr-listincome -- Command for listing all income impacting events -============================================================================ - -SYNOPSIS --------- - -**bkpr-listincome** [*consolidate\_fees*] [*start\_time*] [*end\_time*] - -DESCRIPTION ------------ - -Command *added* in pre-v0.10.1. - -The **bkpr-listincome** RPC command is a list of all income impacting events that the bookkeeper plugin has recorded for this node. - -- **consolidate\_fees** (boolean, optional): If true, we emit a single, consolidated event for any onchain-fees for a txid and account. Otherwise, events for every update to the onchain fee calculation for this account and txid will be printed. Note that this means that the events emitted are non-stable, i.e. calling **listincome** twice may result in different onchain fee events being emitted, depending on how much information we've logged for that transaction. The default is True. -- **start\_time** (u32, optional): UNIX timestamp (in seconds) that filters events after the provided timestamp. The default is zero. -- **end\_time** (u32, optional): UNIX timestamp (in seconds) that filters events up to and at the provided timestamp. The default is max-int. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:bkpr-listincome#1", - "method": "bkpr-listincome", - "params": "{}" -} -{ - "id": "example:bkpr-listincome#2", - "method": "bkpr-listincome", - "params": { - "consolidate_fees": false - } -} -``` - -RETURN VALUE ------------- - -On success, an object containing **income\_events** is returned. It is an array of objects, where each object contains: - -- **account** (string): The account name. If the account is a channel, the channel\_id. -- **tag** (string): Type of income event. -- **credit\_msat** (msat): Amount earned (income). -- **debit\_msat** (msat): Amount spent (expenses). -- **currency** (string): Human-readable bech32 part for this coin type. -- **timestamp** (u32): Timestamp this event was recorded by the node. For consolidated events such as onchain\_fees, the most recent timestamp. -- **description** (string, optional): More information about this event. If a `invoice` type, typically the bolt11/bolt12 description. -- **outpoint** (string, optional): The txid:outnum for this event, if applicable. -- **txid** (txid, optional): The txid of the transaction that created this event, if applicable. -- **payment\_id** (hex, optional): Lightning payment identifier. For an htlc, this will be the preimage. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "income_events": [ - { - "account": "wallet", - "tag": "deposit", - "credit_msat": 1111111000, - "debit_msat": 0, - "currency": "bcrt", - "timestamp": 1706153060, - "outpoint": "6d813d2e99ae7181b61e59ff224c43de698bd08b8ca5b8034ccc13aa7b6428ef:0" - }, - { - "account": "wallet", - "tag": "deposit", - "credit_msat": 1111111000, - "debit_msat": 0, - "currency": "bcrt", - "timestamp": 1706153060, - "outpoint": "0bbbe965f76525af3876ae6f1520d91047d4be04cb4e46b7229120a60c5dc9c5:0" - } - ] -} -{ - "income_events": [ - { - "account": "wallet", - "tag": "deposit", - "credit_msat": 1111111000, - "debit_msat": 0, - "currency": "bcrt", - "timestamp": 1708624181, - "outpoint": "895b5eaad4544d24c99628883b4d84b2c6024d6a2da4c1de54098d985f280943:1" - }, - { - "account": "wallet", - "tag": "withdrawal", - "credit_msat": 0, - "debit_msat": 555555000, - "currency": "bcrt", - "timestamp": 1708624182, - "outpoint": "d28a2cba55da10700ddd7f1f23618160dafb3134650055654551d9b0382dcd71:0" - }, - { - "account": "wallet", - "tag": "onchain_fee", - "credit_msat": 0, - "debit_msat": 555556000, - "currency": "bcrt", - "timestamp": 1708624183, - "txid": "d28a2cba55da10700ddd7f1f23618160dafb3134650055654551d9b0382dcd71" - }, - { - "account": "wallet", - "tag": "onchain_fee", - "credit_msat": 554947000, - "debit_msat": 0, - "currency": "bcrt", - "timestamp": 1708624183, - "txid": "d28a2cba55da10700ddd7f1f23618160dafb3134650055654551d9b0382dcd71" - } - ] -} -``` - -AUTHOR ------- - -Lisa Neigut <> is mainly responsible. - -SEE ALSO --------- - -lightning-bkpr-listaccountevents(7), lightning-listfunds(7), lightning-bkpr-listbalances(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-blacklistrune.7.md b/doc/lightning-blacklistrune.7.md deleted file mode 100644 index 0836be99851f..000000000000 --- a/doc/lightning-blacklistrune.7.md +++ /dev/null @@ -1,107 +0,0 @@ -lightning-blacklistrune -- Command to prevent a rune from working -================================================================= - -SYNOPSIS --------- - -**blacklistrune** [*start* [*end*]] - -DESCRIPTION ------------ - -Command *added* in v23.08. - -The **blacklistrune** RPC command allows you to effectively revoke the rune you have created (and any runes derived from that rune with additional restictions). Attempting to use these runes will be resulted in a `Blacklisted rune` error message. - -Destroy a rune like in olden times with the **destroyrune** command. - -All runes created by lightning have a unique sequential id within them and can be blacklisted in ranges for efficiency. The command always returns the blacklisted ranges on success. If no parameters are specified, no changes have been made. If start specified without end, that single rune is blacklisted. If end is also specified, every rune from start till end inclusive is blacklisted. - -- **start** (u64, optional): First rune unique id to blacklist. -- **end** (u64, optional): Final rune unique id to blacklist (defaults to start). - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:blacklistrune#1", - "method": "blacklistrune", - "params": { - "start": 2 - } -} -{ - "id": "example:blacklistrune#2", - "method": "blacklistrune", - "params": { - "start": 5, - "end": 7 - } -} -{ - "id": "example:blacklistrune#3", - "method": "blacklistrune", - "params": { - "start": 3, - "end": 4 - } -} -``` - -RETURN VALUE ------------- - -On success, an object containing **blacklist** is returned. It is an array of objects, where each object contains: - -- **start** (u64): Unique id of first rune in this blacklist range. -- **end** (u64): Unique id of last rune in this blacklist range. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "blacklist": [ - { - "start": 2, - "end": 2 - } - ] -} -{ - "blacklist": [ - { - "start": 2, - "end": 2 - }, - { - "start": 5, - "end": 7 - } - ] -} -{ - "blacklist": [ - { - "start": 2, - "end": 7 - } - ] -} -``` - -AUTHOR ------- - -Shahana Farooqui <> is mainly responsible. - -SEE ALSO --------- - -lightning-commando-blacklist(7), lightning-showrunes(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-check.7.md b/doc/lightning-check.7.md deleted file mode 100644 index 5994f4a22e21..000000000000 --- a/doc/lightning-check.7.md +++ /dev/null @@ -1,97 +0,0 @@ -lightning-check -- Command for verifying parameters -=================================================== - -SYNOPSIS --------- - -**check** *command\_to\_check* - -DESCRIPTION ------------ - -The **check** RPC command verifies another command without actually making any changes. - -This is guaranteed to be safe, and will do all checks up to the point where something in the system would need to be altered (such as checking that channels are in the right state, peers connected, etc). - -It does not guarantee successful execution of the command in all cases. For example, a call to lightning-getroute(7) may still fail to find a route even if checking the parameters succeeds. - -- **command\_to\_check** (string): Name of the relevant command. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:check#1", - "method": "check", - "params": { - "command_to_check": "sendpay", - "route": [ - { - "amount_msat": 1011, - "msatoshi": 1011, - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "delay": 20, - "channel": "1x1x1" - }, - { - "amount_msat": 1000, - "msatoshi": 1000, - "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "delay": 10, - "channel": "2x2x2" - } - ], - "payment_hash": "0000000000000000000000000000000000000000000000000000000000000000" - } -} -{ - "id": "example:check#2", - "method": "check", - "params": { - "command_to_check": "dev", - "subcommand": "slowcmd", - "msec": 1000 - } -} -{ - "id": "example:check#3", - "method": "check", - "params": { - "command_to_check": "recover", - "hsmsecret": "6c696768746e696e672d31000000000000000000000000000000000000000000" - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **command\_to\_check** (string): The *command\_to\_check* argument. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "command_to_check": "sendpay" -} -{ - "command_to_check": "dev" -} -{ - "command_to_check": "recover" -} -``` - -AUTHOR ------- - -Mark Beckwith <> and Rusty Russell <> are mainly responsible. - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-checkmessage.7.md b/doc/lightning-checkmessage.7.md deleted file mode 100644 index dccefabb2231..000000000000 --- a/doc/lightning-checkmessage.7.md +++ /dev/null @@ -1,87 +0,0 @@ -lightning-checkmessage -- Command to check if a signature is from a node -======================================================================== - -SYNOPSIS --------- - -**checkmessage** *message* *zbase* [*pubkey*] - -DESCRIPTION ------------ - -The **checkmessage** RPC command is the counterpart to **signmessage**: given a node id (*pubkey*), signature (*zbase*) and a *message*, it verifies that the signature was generated by that node for that message (more technically: by someone who knows that node's secret). - -As a special case, if *pubkey* is not specified, we will try every known node key (as per *listnodes*), and verification succeeds if it matches for any one of them. Note: this is implemented far more efficiently than trying each one, so performance is not a concern. - -- **message** (string): Message to be checked against the signature. -- **zbase** (string): The Zbase32 encoded signature to verify. -- **pubkey** (pubkey, optional): The Zbase32 encoded signature to verify. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:checkmessage#1", - "method": "checkmessage", - "params": { - "message": "testcase to check new rpc error", - "zbase": "d66bqz3qsku5fxtqsi37j11pci47ydxa95iusphutggz9ezaxt56neh77kxe5hyr41kwgkncgiu94p9ecxiexgpgsz8daoq4tw8kj8yx", - "pubkey": "03be3b0e9992153b1d5a6e1623670b6c3663f72ce6cf2e0dd39c0a373a7de5a3b7" - } -} -{ - "id": "example:checkmessage#2", - "method": "checkmessage", - "params": { - "message": "this is a test!", - "zbase": "d6tqaeuonjhi98mmont9m4wag7gg4krg1f4txonug3h31e9h6p6k6nbwjondnj46dkyausobstnk7fhyy998bhgc1yr98dfmhb4k54d7", - "pubkey": null - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **verified** (boolean) (always *true*): Whether the signature was valid. -- **pubkey** (pubkey): The *pubkey* parameter, or the pubkey found by looking for known nodes. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "pubkey": "03be3b0e9992153b1d5a6e1623670b6c3663f72ce6cf2e0dd39c0a373a7de5a3b7", - "verified": true -} -{ - "pubkey": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "verified": true -} -``` - -ERRORS ------- - -On failure, an error is returned and core lightning exit with the following error code: - -- -32602: Parameter missed or malformed; -- 1301: *pubkey* not found in the graph. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-signmessage(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-checkrune.7.md b/doc/lightning-checkrune.7.md deleted file mode 100644 index ff050e8034ca..000000000000 --- a/doc/lightning-checkrune.7.md +++ /dev/null @@ -1,117 +0,0 @@ -lightning-checkrune -- Command to Validate Rune -=============================================== - -SYNOPSIS --------- - -**checkrune** *rune* [*nodeid*] [*method*] [*params*] - -DESCRIPTION ------------ - -Command *added* in v23.08. - -The **checkrune** RPC command checks the validity/authorization rights of specified rune for the given nodeid, method, and params. - -If successful, the rune "usage" counter (used for ratelimiting) is incremented. - -See lightning-createrune(7) for the fields in the rune which are checked. - -- **rune** (string): Rune to check for authorization. -- **nodeid** (string, optional): Node id of requesting node *(required until v23.11)*. -- **method** (string, optional): Method for which rune needs to be validated *(required until v23.11)*. -- **params** (one of, optional): - - (array): Array of positional parameters. - - (object): Parameters for method.: - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:checkrune#1", - "method": "checkrune", - "params": { - "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "rune": "617Obfct0oRBj_uqGFQxDk3XZ1sDFiC2Q5ltm5z1i_k9NSZtZXRob2Q9aW52b2ljZSZwbmFtZWRlc2NyaXB0aW9uPUB0aXBqYXJcfGpiNTVAc2VuZHNhdHMubG9s", - "method": "invoice", - "params": { - "amount_msat": "any", - "label": "lbl", - "description": [ - "@tipjar|jb55@sendsats.lol." - ] - } - } -} -{ - "id": "example:checkrune#2", - "method": "checkrune", - "params": { - "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==", - "method": "listpeers", - "params": {} - } -} -{ - "id": "example:checkrune#3", - "method": "checkrune", - "params": { - "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "rune": "617Obfct0oRBj_uqGFQxDk3XZ1sDFiC2Q5ltm5z1i_k9NSZtZXRob2Q9aW52b2ljZSZwbmFtZWRlc2NyaXB0aW9uPUB0aXBqYXJcfGpiNTVAc2VuZHNhdHMubG9s", - "method": "invoice", - "params": { - "amount_msat": "any", - "label": "lbl", - "description": "@tipjar|jb55@sendsats.lol" - } - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **valid** (boolean): True if the rune is valid. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "valid": true -} -{ - "valid": true -} -{ - "valid": true -} -``` - -ERRORS ------- - -The following error codes may occur: - -- 1501 (RUNE\_NOT\_AUTHORIZED): rune is not for this node (or perhaps completely invalid) -- 1502 (RUNE\_NOT\_PERMITTED): rune does not allow this usage (includes a detailed reason why) -- 1503 (RUNE\_BLACKLISTED): rune has been explicitly blacklisted. - -AUTHOR ------- - -Shahana Farooqui <> is mainly responsible for consolidating logic from commando. - -SEE ALSO --------- - -lightning-createrune(7), lightning-blacklistrune(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-close.7.md b/doc/lightning-close.7.md deleted file mode 100644 index d366c87780db..000000000000 --- a/doc/lightning-close.7.md +++ /dev/null @@ -1,129 +0,0 @@ -lightning-close -- Command for closing channels with direct peers -================================================================= - -SYNOPSIS --------- - -**close** *id* [*unilateraltimeout*] [*destination*] [*fee\_negotiation\_step*] [*wrong\_funding*] [*force\_lease\_closed*] [*feerange*] - -DESCRIPTION ------------ - -The **close** RPC command attempts to close the channel cooperatively with the peer, or unilaterally after *unilateraltimeout*, and the to-local output will be sent to the address specified in *destination*. - -The peer needs to be live and connected in order to negotiate a mutual close. The default of unilaterally closing after 48 hours is usually a reasonable indication that you can no longer contact the peer. - -- **id** (string): Peer id, channel id or short\_channel\_id. If the given *id* is a peer ID (66 hex digits as a string), then it applies to the active channel of the direct peer corresponding to the given peer ID. If the given *id* is a channel ID (64 hex digits as a string, or the short channel ID *blockheight:txindex:outindex* form), then it applies to that channel. -- **unilateraltimeout** (u32, optional): If it is not zero, the command will unilaterally close the channel when that number of seconds is reached. If *unilateraltimeout* is zero, then the command will wait indefinitely until the peer is online and can negotiate a mutual close. The default is 2 days (172800 seconds). -- **destination** (string, optional): Any Bitcoin bech32 type. If the peer hasn't offered the option\_shutdown\_anysegwit feature, then taproot addresses (or other v1+ segwit) are not allowed. Tell your friends to upgrade! The default is a Core Lightning wallet address. -- **fee\_negotiation\_step** (string, optional): It controls how closing fee negotiation is performed assuming the peer proposes a fee that is different than our estimate. (Note that modern peers use the quick-close protocol which does not allow negotiation: see *feerange* instead). - - On every negotiation step we must give up some amount from our proposal towards the peer's proposal. This parameter can be an integer in which case it is interpreted as number of satoshis to step at a time. Or it can be an integer followed by `%` to designate a percentage of the interval to give up. A few examples, assuming the peer proposes a closing fee of 3000 satoshi and our estimate shows it must be 4000: - * `10`: our next proposal will be 4000-10=3990. - * `10%`: our next proposal will be 4000-(10% of (4000-3000))=3900. - * '1': our next proposal will be 3999. This is the most extreme case when we insist on our fee as much as possible. - * `100%`: our next proposal will be 3000. This is the most relaxed case when we quickly accept the peer's proposal. The default is `50%`. -- **wrong\_funding** (outpoint, optional): It can only be specified if both sides have offered the `shutdown_wrong_funding` feature (enabled by the **experimental-shutdown-wrong-funding** option). It must be a transaction id followed by a colon then the output number. Instead of negotiating a shutdown to spend the expected funding transaction, the shutdown transaction will spend this output instead. This is only allowed if this peer opened the channel and the channel is unused: it can rescue openings which have been manually miscreated. -- **force\_lease\_closed** (boolean, optional): If the channel has funds leased to the peer (option\_will\_fund), we prevent initiation of a mutual close unless this flag is passed in. The default is False. -- **feerange** (array of feerates, optional): An optional array [ *min*, *max* ], indicating the minimum and maximum feerates to offer: the peer will obey these if it supports the quick-close protocol. *slow* and *unilateral\_close* are the defaults. Note that the maximum fee will be capped at the final commitment transaction fee (unless the experimental anchor-outputs option is negotiated).: - - (feerate, optional) - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:close#1", - "method": "close", - "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "unilateraltimeout": 1, - "destination": null, - "fee_negotiation_step": null, - "force_lease_closed": null, - "feerange": null - } -} -{ - "id": "example:close#2", - "method": "close", - "params": { - "id": "103x1x0", - "unilateraltimeout": null, - "destination": "bcrt1qeyyk6sl5pr49ycpqyckvmttus5ttj25pd0zpvg", - "fee_negotiation_step": null, - "force_lease_closed": null, - "feerange": null - } -} -{ - "id": "example:close#3", - "method": "close", - "params": [ - "107x1x0", - null, - "bcrt1qeyyk6sl5pr49ycpqyckvmttus5ttj25pd0zpvg" - ] -} -``` - -NOTES ------ - -Prior to 0.7.2, **close** took two parameters: *force* and *timeout*. *timeout* was the number of seconds before *force* took effect (default, 30), and *force* determined whether the result was a unilateral close or an RPC error (default). Even after the timeout, the channel would be closed if the peer reconnected. - -NOTIFICATIONS -------------- - -Notifications may be returned indicating what is going on, especially if the peer is offline and we are waiting. - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **type** (string) (one of "mutual", "unilateral", "unopened"): Whether we successfully negotiated a mutual close, closed without them, or discarded not-yet-opened channel. - -If **type** is "mutual" or "unilateral": - - **tx** (hex): The raw bitcoin transaction used to close the channel (if it was open). - - **txid** (txid): The transaction id of the *tx* field. - -A unilateral close may still occur at any time if the peer did not behave correctly during the close negotiation. - -Unilateral closes will return your funds after a delay. The delay will vary based on the peer *to\_self\_delay* setting, not your own setting. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "tx": "020000000001018d388ffcd216c92d25163a62096ce47d5c9bbd6270ced51c5a1484f89df33e5700000000009db0e28002a00f00000000000016001445503fa4b65ade3ffdb1a92057688456c9ffae1380130f0000000000220020be82765fdb17fd5568f2dd31c6cf1aabc620ef338995ec5d9a2f3e42f43ae4870400473044022058dcde893655f40fc8162a79596440ef3e304273f8d530401fc17bc92c58159b0220428900ca6537538ba237d569a4a09003d663a991aeb331a9f18dfe807ee78806014730440220111270eeed8b4b1a231d3ce6e0e0daad718623ad159a0fd3781fb18118a8fec70220539826ee7c76cad4116d1d8852329f80314b3434cf21c765d8004186451a4cd50147522102324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b2102e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5752ae9c3ed620", - "txid": "5d8d917dd7d39fe5a12f121457fc6d712b5e393ed4f16bc8f5976fc08cbbfecd", - "type": "unilateral" -} -{ - "tx": "0200000000010132cbce7d5f96b4003c3b5c0eab2a29fef90bb6abb833ff312fa122f31e8301810000000000ffffffff02a0860100000000002251205779a060f200d40e8f871a40eb91614cc5bfa6d0a5f852e053400a7feff8615005b10d0000000000160014c9096d43f408ea526020262ccdad7c8516b92a81040047304402207e171d056e81cf8ad2d5a613ecbaa212d5dcbd0bf713145d18911d2cbe9d858802206222911660a26d7ffddc2563ae6d41d6ffad9fbd2fc26cf40eab501a31153b9e0147304402204ae7cdc68dc7966eab73f16a1978643336333d54ae0b6f87bc11a2c19174a9710220601e5276aee0825466cc272c4eb7d353b393ef0dd230d303f46772790dee19190147522102324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b2102e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5752ae00000000", - "txid": "4a08e0508e2e39ea033fab5f77b318337f345550421799f6e0eb1b15a892eda4", - "type": "mutual" -} -{ - "tx": "02000000000101233b513665836d240423f45ffcd1fe19aeb08d62303fa5382ad3285f770683a60000000000ffffffff02a086010000000000225120b47216ab60a0fad97de0ba9b8b370d281dfe55f552d82034e2a8d054c2246e4405b10d0000000000160014c9096d43f408ea526020262ccdad7c8516b92a81040047304402207a9e3ca258861b33827d91514690a757e76730ba8c15dd222340bb13d993a1a502204d0ae329273b69abe62df1ffccce808d5f1a29101a8ee95dae99888376dbaef801473044022033c03f406db9f1c9d924cfd8f6ea42d0962f0ab02e3217aef518aea517ca5ba40220076e2af9d40c676316a2765a86f9efd481de3fc4465ceba33b0782c505ae3452014752210212284c004a3d24146e54b2a24db48f650370a08e1fe9abe8ff41f92b09cd50542102a3032ef980cc735579aa5295d927b9a1bdbafc459f2da14163dc9bd530e0a21152ae00000000", - "txid": "d44a1374a30c1a936d2d4fdbe73c0ffff42fec8c27c6cbaec2758b3042f61d08", - "type": "mutual" -} -``` - -AUTHOR ------- - -ZmnSCPxj <> is mainly responsible. - -SEE ALSO --------- - -lightning-disconnect(7), lightning-fundchannel(7), lightningd-config(5) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-commando-blacklist.7.md b/doc/lightning-commando-blacklist.7.md deleted file mode 100644 index 6b81eb0fc51f..000000000000 --- a/doc/lightning-commando-blacklist.7.md +++ /dev/null @@ -1,107 +0,0 @@ -lightning-commando-blacklist -- Command to prevent a rune from working -====================================================================== - -SYNOPSIS --------- - -**commando-blacklist** [*start* [*end*]] - -DESCRIPTION ------------ - -Command **deprecated in v23.08, removed after v24.08**. - -Command *added* in v23.05. - -The **commando-blacklist** RPC command allows you to effectively revoke the rune you have created (and any runes derived from that rune with additional restictions). Attempting to use these runes will be resulted in a `Blacklisted rune` error message. - -All runes created by commando have a unique sequential id within them and can be blacklisted in ranges for efficiency. The command always returns the blacklisted ranges on success. If no parameters are specified, no changes have been made. If start specified without end, that single rune is blacklisted. If end is also specified, every rune from start till end inclusive is blacklisted. - -- **start** (u64, optional): First rune unique id to blacklist. -- **end** (u64, optional): Final rune unique id to blacklist (defaults to start). - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:commando-blacklist#1", - "method": "commando-blacklist", - "params": { - "start": 2 - } -} -{ - "id": "example:commando-blacklist#2", - "method": "commando-blacklist", - "params": { - "start": 5, - "end": 7 - } -} -{ - "id": "example:commando-blacklist#3", - "method": "commando-blacklist", - "params": { - "start": 3, - "end": 4 - } -} -``` - -RETURN VALUE ------------- - -On success, an object containing **blacklist** is returned. It is an array of objects, where each object contains: - -- **start** (u64): Unique id of first rune in this blacklist range. -- **end** (u64): Unique id of last rune in this blacklist range. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "blacklist": [ - { - "start": 2, - "end": 2 - } - ] -} -{ - "blacklist": [ - { - "start": 2, - "end": 2 - }, - { - "start": 5, - "end": 7 - } - ] -} -{ - "blacklist": [ - { - "start": 2, - "end": 7 - } - ] -} -``` - -AUTHOR ------- - -Shahana Farooqui <> is mainly responsible. - -SEE ALSO --------- - -lightning-commando-listrunes(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-commando-listrunes.7.md b/doc/lightning-commando-listrunes.7.md deleted file mode 100644 index e656e3443cff..000000000000 --- a/doc/lightning-commando-listrunes.7.md +++ /dev/null @@ -1,184 +0,0 @@ -lightning-commando-listrunes -- Command to list previously generated runes -========================================================================== - -SYNOPSIS --------- - -**commando-listrunes** [*rune*] - -DESCRIPTION ------------ - -Command **deprecated in v23.08, removed after v24.05**. - -Command *added* in v23.05. - -The **commando-listrunes** RPC command either lists runes that we stored as we generate them (see lightning-commando-rune(7)) or decodes the rune given on the command line. - -NOTE: Runes generated prior to v23.05 were not stored, so will not appear in this list. - -- **rune** (string, optional): Optional rune to list. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:commando-listrunes#1", - "method": "commando-listrunes", - "params": "{}" -} -{ - "id": "example:commando-listrunes#2", - "method": "commando-listrunes", - "params": { - "rune": "Am3W_wI0PRn4qVNEsJ2iInHyFPQK8wfdqEXztm8-icQ9MA==" - } -} -{ - "id": "example:commando-listrunes#3", - "method": "commando-listrunes", - "params": { - "rune": "m_tyR0qqHUuLEbFJW6AhmBg-9npxVX2yKocQBFi9cvY9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJzJnBuYW1lbGV2ZWwhfHBuYW1lbGV2ZWwvaW8mcGFycjEhfHBhcnIxL2lv" - } -} -``` - -RETURN VALUE ------------- - -On success, an object containing **runes** is returned. It is an array of objects, where each object contains: - -- **rune** (string): Base64 encoded rune. -- **unique\_id** (string): Unique id assigned when the rune was generated; this is always a u64 for commando runes. -- **restrictions** (array of objects): The restrictions on what commands this rune can authorize.: - - **alternatives** (array of objects): - - **fieldname** (string): The field this restriction applies to; see commando-rune(7). - - **value** (string): The value accepted for this field. - - **condition** (string): The way to compare fieldname and value. - - **english** (string): English readable description of this alternative. - - **english** (string): English readable summary of alternatives above. -- **restrictions\_as\_english** (string): English readable description of the restrictions array above. -- **stored** (boolean, optional) (always *false*): This is false if the rune does not appear in our datastore (only possible when `rune` is specified). -- **blacklisted** (boolean, optional) (always *true*): The rune has been blacklisted; see commando-blacklist(7). -- **last\_used** (number, optional): The last time this rune was successfully used. *(added 23.11)* -- **our\_rune** (boolean, optional) (always *false*): This is not a rune for this node (only possible when `rune` is specified). - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "runes": [ - { - "rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==", - "unique_id": "0", - "restrictions": [], - "restrictions_as_english": "" - }, - { - "rune": "Am3W_wI0PRn4qVNEsJ2iInHyFPQK8wfdqEXztm8-icQ9MA==", - "stored": false, - "our_rune": false, - "unique_id": "1", - "restrictions": [], - "restrictions_as_english": "" - } - ] -} -{ - "runes": [ - { - "rune": "Am3W_wI0PRn4qVNEsJ2iInHyFPQK8wfdqEXztm8-icQ9MA==", - "stored": false, - "our_rune": false, - "unique_id": "1", - "restrictions": [], - "restrictions_as_english": "" - } - ] -} -{ - "runes": [ - { - "rune": "m_tyR0qqHUuLEbFJW6AhmBg-9npxVX2yKocQBFi9cvY9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJzJnBuYW1lbGV2ZWwhfHBuYW1lbGV2ZWwvaW8mcGFycjEhfHBhcnIxL2lv", - "stored": false, - "unique_id": "3", - "restrictions": [ - { - "alternatives": [ - { - "fieldname": "id", - "value": "022d223620a359a47ff7", - "condition": "^", - "english": "id starts with 022d223620a359a47ff7" - } - ], - "english": "id starts with 022d223620a359a47ff7" - }, - { - "alternatives": [ - { - "fieldname": "method", - "value": "listpeers", - "condition": "=", - "english": "method equal to listpeers" - } - ], - "english": "method equal to listpeers" - }, - { - "alternatives": [ - { - "fieldname": "pnamelevel", - "value": "", - "condition": "!", - "english": "pnamelevel is missing" - }, - { - "fieldname": "pnamelevel", - "value": "io", - "condition": "/", - "english": "pnamelevel unequal to io" - } - ], - "english": "pnamelevel is missing OR pnamelevel unequal to io" - }, - { - "alternatives": [ - { - "fieldname": "parr1", - "value": "", - "condition": "!", - "english": "parr1 is missing" - }, - { - "fieldname": "parr1", - "value": "io", - "condition": "/", - "english": "parr1 unequal to io" - } - ], - "english": "parr1 is missing OR parr1 unequal to io" - } - ], - "restrictions_as_english": "id starts with 022d223620a359a47ff7 AND method equal to listpeers AND pnamelevel is missing OR pnamelevel unequal to io AND parr1 is missing OR parr1 unequal to io" - } - ] -} -``` - -AUTHOR ------- - -Shahana Farooqui <> is mainly responsible. - -SEE ALSO --------- - -lightning-commando-rune(7), lightning-commando-blacklist(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-commando-rune.7.md b/doc/lightning-commando-rune.7.md deleted file mode 100644 index 599952fbc9f2..000000000000 --- a/doc/lightning-commando-rune.7.md +++ /dev/null @@ -1,269 +0,0 @@ -lightning-commando-rune -- Command to Authorize Remote Peer Access -================================================================== - -SYNOPSIS --------- - -**commando-rune** [*rune*] [*restrictions*] - -DESCRIPTION ------------ - -Command **deprecated in v23.08, removed after v23.05**. - -The **commando-rune** RPC command creates a base64 string called a *rune* which can be used to access commands on this node. Each *rune* contains a unique id (a number starting at 0), and can have restrictions inside it. Nobody can remove restrictions from a rune: if you try, the rune will be rejected. There is no limit on how many runes you can issue; the node simply decodes and checks them as they are received (we do store them for lightning-commando- listrunes(7) however). - -- **rune** (string, optional): If supplied, the restrictions are simple appended to that *rune* (it doesn't need to be a rune belonging to this node). If not supplied, a new *rune* is constructed, with a new unique id. -- **restrictions** (one of, optional): It can be the string `readonly`, or an array of restrictions. - Each restriction is an array of one or more alternatives, such as "method is listpeers", or "method is listpeers OR time is before 2023".: - - (array of arrays): Alternatives use a simple language to examine the command which is being run: - * time: the current UNIX time, e.g. "time<1656759180". - * id: the node\_id of the peer, e.g. "id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605". - * method: the command being run, e.g. "method=withdraw". - * per: how often the rune can be used, with suffix "sec" (default), "min", "hour", "day" or "msec", "usec" or "nsec". e.g. "per=5sec". - * rate: the rate limit, per minute, e.g. "rate=60" is equivalent to "per=1sec". - * pnum: the number of parameters. e.g. "pnum<2". - * pnameX: the parameter named X (with any punctuation like `_` removed). e.g. "pnamedestination=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T". - * parrN: the N'th parameter. e.g. "parr0=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T". - - (array of strings) - - (string, optional) - - (always "readonly"): A rune which allows most *get* and *list* commands, and the *summary* command. - -RESTRICTION FORMAT ------------------- - -Restrictions are one or more alternatives. Each alternative is *name* *operator* *value*. The valid names are shown above. - -Note that if a value contains `\`, it must be preceeded by another `\` to form valid JSON: -* `=`: passes if equal ie. identical. e.g. `method=withdraw` -* `/`: not equals, e.g. `method/withdraw` -* `^`: starts with, e.g. `id^024b9a1fa8e006f1e3937f` -* `$`: ends with, e.g. `id$381df1cc449605`. -* `~`: contains, e.g. `id~006f1e3937f65f66c40`. -* `<`: is a decimal integer, and is less than. e.g. `time<1656759180` -* `>`: is a decimal integer, and is greater than. e.g. `time>1656759180` -* `{`: preceeds in alphabetical order (or matches but is shorter), - e.g. `id{02ff`. -* `}`: follows in alphabetical order (or matches but is longer), - e.g. `id}02ff`. -* `#`: a comment, ignored, e.g. `dumb example#`. -* `!`: only passes if the *name* does *not* exist. e.g. `pnamedestination!`. -Every other operator except `#` fails if *name* does not exist! - -EXAMPLE USAGE -------------- - -This creates a fresh rune which can do anything: - -```shell -$ lightning-cli commando-rune -{ - "rune": "KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA==", - "unique_id": "0" -} -``` -We can add restrictions to that rune, like so: - -```shell -$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions=readonly -{ - "rune": "NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", - "unique_id": "0" -} -``` -The "readonly" restriction is a short-cut for two restrictions: - -1. `["method^list", "method^get", "method=summary"]`: You may call list, get or summary. -2. `["method/listdatastore"]`: But not listdatastore: that contains sensitive stuff! - -We can do the same manually, like so: - -```shell -$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions='[["method^list", "method^get", "method=summary"],["method/listdatastore"]]' -{ - "rune": "NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", - "unique_id": "0" -} -``` -Let's create a rune which lets a specific peer (024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605) run "listpeers" on themselves: - -```shell -$ lightning-cli commando-rune restrictions='[["id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605"],["method=listpeers"],["pnum=1"],["pnameid=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605","parr0=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605"]]' -{ - "rune": "FE8GHiGVvxcFqCQcClVRRiNE_XEeLYQzyG2jmqto4jM9MiZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDV8cGFycjA9MDI0YjlhMWZhOGUwMDZmMWUzOTM3ZjY1ZjY2YzQwOGU2ZGE4ZTFjYTcyOGVhNDMyMjJhNzM4MWRmMWNjNDQ5NjA1", - "unique_id": "2" -} -``` -This allows `listpeers` with 1 argument (`pnum=1`), which is either by name (`pnameid`), or position (`parr0`). We could shorten this in several ways: either allowing only positional or named parameters, or by testing the start of the parameters only. Here's an example which only checks the first 9 bytes of the `listpeers` parameter: - -```shell -$ lightning-cli commando-rune restrictions='[["id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605"],["method=listpeers"],["pnum=1"],["pnameid^024b9a1fa8e006f1e393", "parr0^024b9a1fa8e006f1e393"]' - { - "rune": "fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw==", - "unique_id": "3" -} -``` -Before we give this to our peer, let's add two more restrictions: that it only be usable for 24 hours from now (`time<`), and that it can only be used twice a minute (`rate=2`). `date +%s` can give us the current time in seconds: - -```shell -$ lightning-cli commando-rune rune=fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw== restrictions='[["time<'$(($(date +%s) + 24*60*60))'","rate=2"]]' -{ - "rune": "tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y", - "unique_id": "3" -} -``` -You can also use lightning-decode(7) to examine runes you have been given: - -```shell -$ lightning-cli decode tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y -{ - "type": "rune", - "unique_id": "3", - "string": "b54f912e33220e9636534a375b5a05a306abdfa4451a95a5a0f6d6f7e46e65da:=3&id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605&method=listpeers&pnum=1&pnameid^024b9a1fa8e006f1e393|parr0^024b9a1fa8e006f1e393&time<1656920538&rate=2", - "restrictions": [ - { - "alternatives": [ - "id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605" - ], - "summary": "id (of commanding peer) equal to '024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605'" - }, - { - "alternatives": [ - "method=listpeers" - ], - "summary": "method (of command) equal to 'listpeers'" - }, - { - "alternatives": [ - "pnum=1" - ], - "summary": "pnum (number of command parameters) equal to 1" - }, - { - "alternatives": [ - "pnameid^024b9a1fa8e006f1e393", - "parr0^024b9a1fa8e006f1e393" - ], - "summary": "pnameid (object parameter 'id') starts with '024b9a1fa8e006f1e393' OR parr0 (array parameter #0) starts with '024b9a1fa8e006f1e393'" - }, - { - "alternatives": [ - "time<1656920538" - ], - "summary": "time (in seconds since 1970) less than 1656920538 (approximately 19 hours 18 minutes from now)" - }, - { - "alternatives": [ - "rate=2" - ], - "summary": "rate (max per minute) equal to 2" - } - ], - "valid": true -} -``` - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:commando-rune#1", - "method": "commando-rune", - "params": "{}" -} -{ - "id": "example:commando-rune#2", - "method": "commando-rune", - "params": { - "restrictions": "readonly" - } -} -{ - "id": "example:commando-rune#3", - "method": "commando-rune", - "params": { - "restrictions": [ - [ - "id^022d223620a359a47ff7" - ], - [ - "method=listpeers" - ] - ] - } -} -{ - "id": "example:commando-rune#4", - "method": "commando-rune", - "params": { - "restrictions": [ - [ - "method=pay" - ], - [ - "pnameamountmsat<10000" - ] - ] - } -} -``` - -SHARING RUNES -------------- - -Because anyone can add a restriction to a rune, you can always turn a normal rune into a read-only rune, or restrict access for 30 minutes from the time you give it to someone. Adding restrictions before sharing runes is best practice. - -If a rune has a ratelimit, any derived rune will have the same id, and thus will compete for that ratelimit. You might want to consider adding a tighter ratelimit to a rune before sharing it, so you will keep the remainder. For example, if you rune has a limit of 60 times per minute, adding a limit of 5 times per minute and handing that rune out means you can still use your original rune 55 times per minute. - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **rune** (string): The resulting rune. -- **unique\_id** (string): The id of this rune: this is set at creation and cannot be changed (even as restrictions are added). - -The following warnings may also be returned: - -- **warning\_unrestricted\_rune**: A warning shown when runes are created with powers that could drain your node. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==", - "unique_id": "0", - "warning_unrestricted_rune": "WARNING: This rune has no restrictions! Anyone who has access to this rune could drain funds from your node. Be careful when giving this to apps that you don't trust. Consider using the restrictions parameter to only allow access to specific rpc methods." -} -{ - "rune": "zm0x_eLgHexaTvZn3Cz7gb_YlvrlYGDo_w4BYlR9SS09MSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", - "unique_id": "1" -} -{ - "rune": "YPojv9qgHPa3im0eiqRb-g8aRq76OasyfltGGqdFUOU9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJz", - "unique_id": "2" -} -{ - "rune": "b3hXuEM7Pqzk-C7HUw83xzvHOV7fmuGaWjdo-wHdfg89MCZtZXRob2Q9cGF5JnBuYW1lYW1vdW50bXNhdDwxMDAwMA==", - "unique_id": "3" -} -``` - -AUTHOR ------- - -Rusty Russell <> wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page. - -Christian Decker came up with the name "commando", which almost excuses his previous adoption of the name "Eltoo". - -SEE ALSO --------- - -lightning-commando(7), lightning-decode(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-commando.7.md b/doc/lightning-commando.7.md deleted file mode 100644 index a4735f1e6424..000000000000 --- a/doc/lightning-commando.7.md +++ /dev/null @@ -1,159 +0,0 @@ -lightning-commando -- Command to Send a Command to a Remote Peer -================================================================ - -SYNOPSIS --------- - -**commando** *peer\_id* *method* [*params*] [*rune*] [*filter*] - -DESCRIPTION ------------ - -The **commando** RPC command is a homage to bad 80s movies. It also sends a directly-connected *peer\_id* a custom message, containing a request to run *method* (with an optional dictionary of *params*); generally the peer will only allow you to run a command if it has provided you with a *rune* which allows it. - -- **peer\_id** (pubkey): Peer to command. -- **method** (string): Method to invoke on peer. -- **params** (one of, optional): - - (array): Array of positional parameters. - - (object): Parameters for method.: -- **rune** (string, optional): Rune to authorize the command. -- **filter** (object, optional): Filter to peer to apply to any successful result.: - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:commando#1", - "method": "commando", - "params": { - "peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "rune": "zm0x_eLgHexaTvZn3Cz7gb_YlvrlYGDo_w4BYlR9SS09MSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", - "method": "getinfo", - "params": {} - } -} -{ - "id": "example:commando#2", - "method": "commando", - "params": { - "peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "rune": "m_tyR0qqHUuLEbFJW6AhmBg-9npxVX2yKocQBFi9cvY9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJzJnBuYW1lbGV2ZWwhfHBuYW1lbGV2ZWwvaW8mcGFycjEhfHBhcnIxL2lv", - "method": "listpeers", - "params": [ - "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "broken" - ] - } -} -{ - "id": "example:commando#3", - "method": "commando", - "params": { - "peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "rune": "b3hXuEM7Pqzk-C7HUw83xzvHOV7fmuGaWjdo-wHdfg89MCZtZXRob2Q9cGF5JnBuYW1lYW1vdW50bXNhdDwxMDAwMA==", - "method": "pay", - "params": { - "bolt11": "lnbcrt1pja05v6sp5n6gnm380ckkrnhzvytz0hvym0vcf0mlrk586nlp72cq7e2hhhffspp5cwhuvl4jhlqep3st2703z89jp7j6wucm8ytlj7rk9ckk0mv7whysdq5v3jhxcmjd9c8g6t0dceqxqyjw5qcqp99qxpqysgq40udwjtktkry0yyq9408q5vtmj534h88j5nn562lamam0rtfqfu3093t2dhhc63qnqe5maa5jc9ad5pm08q2k2udvp6skw9f6ez9c9qptatlau", - "amount_msat": 9999 - } - } -} -``` - -RETURN VALUE ------------- - -On success, the return depends on the *method* invoked. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "alias": "JUNIORBEAM-v23.11-415-gd120eba", - "color": "0266e4", - "num_peers": 1, - "num_pending_channels": 0, - "num_active_channels": 0, - "num_inactive_channels": 0, - "address": [], - "binding": [ - { - "type": "ipv4", - "address": "127.0.0.1", - "port": 42513 - } - ], - "version": "v23.11-415-gd120eba", - "blockheight": 101, - "network": "regtest", - "fees_collected_msat": 0, - "lightning-dir": "/tmp/ltests-7u_8_rtu/test_commando_rune_1/lightning-1/regtest", - "our_features": { - "init": "08a0000a8a5961", - "node": "88a0000a8a5961", - "channel": "", - "invoice": "02000002024100" - } -} -{ - "peers": [ - { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "connected": true, - "num_channels": 0, - "netaddr": [ - "127.0.0.1:40119" - ], - "features": "08a0000a8a5961", - "log": [ - { - "type": "SKIPPED", - "num_skipped": 30 - } - ] - } - ] -} -{ - "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "payment_hash": "c3afc67eb2bfc190c60b579f111cb20fa5a7731b3917f978762e2d67ed9e75c9", - "created_at": 1708642714.8110592, - "parts": 1, - "amount_msat": 9999, - "amount_sent_msat": 9999, - "payment_preimage": "17632717785b1a833a296ba1831cb968602872e68881c2f324e06e87979296dc", - "status": "complete" -} -``` - -ERRORS ------- - -On failure, one of the following error codes may be returned: - -- -32600: Usually means peer is not connected -- 19535: the local commando plugin discovered an error. -- 19536: the remote commando plugin discovered an error. -- 19537: the remote commando plugin said we weren't authorized. - -It can also fail if the peer does not respond, in which case it will simply hang awaiting a response. - -AUTHOR ------- - -Rusty Russell <> wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page. - -Christian Decker came up with the name "commando", which almost excuses his previous adoption of the name "Eltoo". - -SEE ALSO --------- - -lightning-commando-rune(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-connect.7.md b/doc/lightning-connect.7.md deleted file mode 100644 index ff4613b9f203..000000000000 --- a/doc/lightning-connect.7.md +++ /dev/null @@ -1,117 +0,0 @@ -lightning-connect -- Command for connecting to another lightning node -===================================================================== - -SYNOPSIS --------- - -**connect** *id* [*host*] [*port*] - -DESCRIPTION ------------ - -The **connect** RPC command establishes a new connection with another node in the Lightning Network. - -Connecting to a node is just the first step in opening a channel with another node. Once the peer is connected a channel can be opened with lightning-fundchannel(7). - -If there are active channels with the peer, **connect** returns once all the subdaemons are in place to handle the channels, not just once it's connected. - -- **id** (string): The target node's public key. As a convenience, *id* may be of the form *id@host* or *id@host:port*. In this case, the *host* and *port* parameters must be omitted. This can fail if your C-lightning node is a fresh install that has not connected to any peers yet (your node has no gossip yet), or if the target *id* is a fresh install that has no channels yet (nobody will gossip about a node until it has one published channel). -- **host** (string, optional): The peer's hostname or IP address. If *host* is not specified (or doesn't work), the connection will be attempted to an IP belonging to *id* obtained through gossip with other already connected peers. If *host* begins with a `/` it is interpreted as a local path and the connection will be made to that local socket (see **bind-addr** in lightningd-config(5)). -- **port** (u16, optional): The peer's port number. If not specified, the *port* depends on the current network: - * bitcoin **mainnet**: 9735. - * bitcoin **testnet**: 19735. - * bitcoin **signet**: 39735. - * bitcoin **regtest**: 19846. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:connect#1", - "method": "connect", - "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "host": "localhost", - "port": 44619 - } -} -{ - "id": "example:connect#2", - "method": "connect", - "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "host": "127.0.0.1", - "port": 42839 - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **id** (pubkey): The peer we connected to. -- **features** (hex): BOLT 9 features bitmap offered by peer. -- **direction** (string) (one of "in", "out"): Whether they initiated connection or we did. -- **address** (object): Address information (mainly useful if **direction** is *out*).: - - **type** (string) (one of "local socket", "ipv4", "ipv6", "torv2", "torv3"): Type of connection (*torv2*/*torv3* only if **direction** is *out*). - - If **type** is "local socket": - - **socket** (string): Socket filename. - - If **type** is "ipv4", "ipv6", "torv2" or "torv3": - - **address** (string): Address in expected format for **type**. - - **port** (u16): Port number. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "features": "08a0000a0a69a2", - "direction": "out", - "address": { - "type": "ipv4", - "address": "127.0.0.1", - "port": 44619 - } -} -{ - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "features": "08a0000a8a5961", - "direction": "out", - "address": { - "type": "ipv4", - "address": "127.0.0.1", - "port": 42839 - } -} -``` - -ERRORS ------- - -On failure, one of the following errors will be returned: - -- 400: Unable to connect, no address known for peer -- 401: If some addresses are known but connecting to all of them failed, the message will contain details about the failures -- 402: If the peer disconnected while we were connecting -- -32602: If the given parameters are wrong - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. Felix <> is the original author of this manpage. - -SEE ALSO --------- - -lightning-fundchannel(7), lightning-listpeers(7), lightning-listchannels(7), lightning-disconnect(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-createinvoice.7.md b/doc/lightning-createinvoice.7.md deleted file mode 100644 index 2b80ccae88e9..000000000000 --- a/doc/lightning-createinvoice.7.md +++ /dev/null @@ -1,68 +0,0 @@ -lightning-createinvoice -- Low-level invoice creation -===================================================== - -SYNOPSIS --------- - -**createinvoice** *invstring* *label* *preimage* - -DESCRIPTION ------------ - -The **createinvoice** RPC command signs and saves an invoice into the database. - -- **invstring** (string): The bolt11 form, but the final signature is ignored. Minimal sanity checks are done. (Note: if **experimental-offers** is enabled, *invstring* can actually be an unsigned bolt12 invoice). -- **label** (one of): A unique string or number (which is treated as a string, so `01` is different from `1`); it is never revealed to other nodes on the lightning network, but it can be used to query the status of this invoice.: - - (string) - - (integer) -- **preimage** (hex): The preimage to supply upon successful payment of the invoice. - -RETURN VALUE ------------- - -(Note: the return format is the same as lightning-listinvoices(7)). -On success, an object is returned, containing: - -- **label** (string): The label for the invoice. -- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. -- **status** (string) (one of "paid", "expired", "unpaid"): Whether it has been paid, or can no longer be paid. -- **description** (string): Description extracted from **bolt11** or **bolt12**. -- **expires\_at** (u64): UNIX timestamp of when invoice expires (or expired). -- **created\_index** (u64): 1-based index indicating order this invoice was created in. *(added v23.08)* -- **bolt11** (string, optional): The bolt11 string (always present unless **bolt12** is). -- **bolt12** (string, optional): The bolt12 string instead of **bolt11** (**experimental-offers** only). -- **amount\_msat** (msat, optional): The amount of the invoice (if it has one). -- **pay\_index** (u64, optional): Incrementing id for when this was paid (**status** *paid* only). -- **amount\_received\_msat** (msat, optional): Amount actually received (**status** *paid* only). -- **paid\_at** (u64, optional): UNIX timestamp of when invoice was paid (**status** *paid* only). -- **paid\_outpoint** (object, optional): Outpoint this invoice was paid with (**status** *paid* only). *(added v23.11)*: - - **txid** (txid): ID of the transaction that paid the invoice (**status** *paid* only). *(added v23.11)* - - **outnum** (u32): The 0-based output number of the transaction that paid the invoice (**status** *paid* only). *(added v23.11)* -- **payment\_preimage** (secret, optional): The proof of payment: SHA256 of this **payment\_hash**. -- **local\_offer\_id** (hex, optional) (always 64 characters): The *id* of our offer which created this invoice (**experimental-offers** only). -- **invreq\_payer\_note** (string, optional): The optional *invreq\_payer\_note* from invoice\_request which created this invoice (**experimental-offers** only). - -ERRORS ------- - -On failure, an error is returned and no invoice is created. If the lightning process fails before responding, the caller should use lightning-listinvoices(7) to query whether this invoice was created or not. - -The following error codes may occur: - -- -1: Catchall nonspecific error. -- 900: An invoice with the given *label* already exists. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-invoice(7), lightning-listinvoices(7), lightning-delinvoice(7), lightning-getroute(7), lightning-sendpay(7), lightning-offer(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-createonion.7.md b/doc/lightning-createonion.7.md deleted file mode 100644 index 7ed75a9dea5c..000000000000 --- a/doc/lightning-createonion.7.md +++ /dev/null @@ -1,186 +0,0 @@ -lightning-createonion -- Low-level command to create a custom onion -=================================================================== - -SYNOPSIS --------- - -**createonion** *hops* *assocdata* [*session\_key*] [*onion\_size*] - -DESCRIPTION ------------ - -The **createonion** RPC command allows the caller to create a custom onion with custom payloads at each hop in the route. A custom onion can be used to implement protocol extensions that are not supported by Core Lightning directly. - -- **hops** (array of objects): A JSON list of dicts, each specifying a node and the payload destined for that node.: - - **pubkey** (pubkey): Node pubkey. - - **payload** (hex): Payload to be sent to the node. -- **assocdata** (hex): The associated data that the onion should commit to. If the onion is to be used to send a payment later it MUST match the `payment_hash` of the payment in order to be valid. -- **session\_key** (secret, optional): Can be used to specify a secret that is used to generate the shared secrets used to encrypt the onion for each hop. It should only be used for testing or if a specific shared secret is important. If not specified it will be securely generated internally, and the shared secrets will be returned. -- **onion\_size** (u16, optional): A size different from the default payment onion (1300 bytes). May be used for custom protocols like trampoline routing. - -EXAMPLE USAGE -------------- - -The following is an example of a 3 hop onion: - -```json -[ - { - "pubkey": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "payload": "11020203e904017b06080000670000010001" - }, { - "pubkey": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "payload": "11020203e804017506080000670000030001" - }, { - "pubkey": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", - "payload": "07020203e8040175" - } -] -``` - -The *hops* parameter is very similar to the result from `getroute` however it needs to be modified slightly. The following is the `getroute` response from which the above *hops* parameter was generated: - -```json -[ - { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "channel": "103x2x1", - "direction": 1, - "msatoshi": 1002, - "amount_msat": "1002msat", - "delay": 21, - }, { - "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "channel": "103x1x1", - "direction": 0, - "msatoshi": 1001, - "amount_msat": "1001msat", - "delay": 15, - }, { - "id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", - "channel": "103x3x1", - "direction": 0, - "msatoshi": 1000, - "amount_msat": "1000msat", - "delay": 9, - } -] -``` - - - Notice that the payload in the *hops* parameter is the hex-encoded TLV of the parameters in the `getroute` response, with length prepended as a `bigsize_t`. - - Except for the pubkey, the values are shifted left by one, i.e., the 1st payload in `createonion` corresponds to the 2nd set of values from `getroute`. - - The final payload is a copy of the last payload sans `channel` - -These rules are directly derived from the onion construction. Please refer BOLT 04 for details and rationale. - -The following example is the result of calling *createonion* with the above hops parameter: - - ```json - { - "onion": "0003f3f80d2142b953319336d2fe4097[...]6af33fcf4fb113bce01f56dd62248a9e5fcbbfba35c", - "shared_secrets": [ - "88ce98c73e4d9293ab1797b0a913fe9bca0213a566252047d01b8af6da871f3e", - "4474d296810e57bd460ef8b83d2e7d288321f8a99ff7686f87384699747bcfc4", - "2a862e4123e01799a732be487fbce297f7dc7cc1467e410f18369cfee476adc2" - ] - } -``` - -The `onion` corresponds to 1366 hex-encoded bytes. Each shared secret consists of 32 hex-encoded bytes. Both arguments can be passed on to **sendonion**. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:createonion#1", - "method": "createonion", - "params": { - "hops": [ - { - "pubkey": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "payload": "e4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - }, - { - "pubkey": "0324653eac434488002cc06bbfb7f10fe18991e35f9fe4302dbea6d2353dc0ab1c", - "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - }, - { - "pubkey": "027f31ebc5462c1fdce1b737ecff52d37d75dea43ce11c74d25aa297165faa2007", - "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - }, - { - "pubkey": "032c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991", - "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - }, - { - "pubkey": "02edabbd16b41c8371b92ef2f04c1185b4f03b6dcd52ba9b78d9d7c89c8f221145", - "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - } - ], - "assocdata": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", - "onion_size": 1301 - } -} -{ - "id": "example:createonion#2", - "method": "createonion", - "params": { - "hops": [ - { - "pubkey": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "payload": "0cfdb000084869207468657265" - } - ], - "assocdata": "36bf44cc8d80498b95eb05e36ae5811206d3a1d8b5c8d59bbcad035d386a4de8" - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **onion** (hex): The onion packet (*onion\_size* bytes). -- **shared\_secrets** (array of secrets): One shared secret for each node in the *hops* parameter.: - - (secret, optional): The shared secret with this hop. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "onion": "00034c3f9e11d92555260db3ee4ba0378a645d01c2556451f4289a1d9b43c7afa9a4f9ecc7010dafb26787bb583c514c3b3990d40c8168b1046659d7bc2512d2f1ee0afd2b87c42de2b70102b649634d211b38049593dbb6ed8ee8f93f0b9ff23cd9654c1341137711ce67751d40867cc90c290a9446be2b8a5a43641d4549505b13e807b4240b5b82ffaf22cb534cff01be46db3985ac83b7db465fbd86d4c8d472f60678946c71eca97dd5db732fe5a6d3765e5a5afad72f035207173e7eaaa0da4f0a4540472c7dd269a030428ae586a61b2a70a428055c3848427d2a2e8bd521aadbaf79d56ea39df63c059772e026d57f0b6844c1ab99e936beadf42aaa78193b05f7380e242258deeaa90db316a943d311ef4f2a08f422422c9da454f9666742ad61c6ae003bce83cf6243adf64a728ea50bdaf129ab2ac70e1988a117609cbefc01c884f86b2494349d1067f5cf17760cdab6ae076631693147e8712412d4f0b17cf288b394fd9e29419156ee629966553c2e7598631cbf7493820388eef1ae9f4d2f9da88872e8afbbedb3b46cd7c461cbe4c5491dc6f4a68bc244584bc79b1bb227c869fae16dab4b16412523c984d3ed2b872f63b95a62f66563d2b03c3d1b5fff0290411b293569ce8435b96b447be776b49395a8d94f48cb2f7699a38e8de58d6fff04075d226dcac07668512b6d2c20d4c49d03ad300a52769e4ebbacf97378633126958df1817effc12fd679723123df244fd9b5421f8a2aedb9a8b6fb4049e3a7cae3985059081239bea38351f0c90ed5a0ff45cc492e6ab353e4c13d22ff48912d6ecfda711edfb88dc0767ecfc5dddf8fb0e112a538aeee55c0f73b3b8afc4f40ef3588eabde5b95344a4525adf67841dd67b1db10da180fb346e0bd2958f095d011827063c42361964f8ac2c356d2ec1868a9498dcd6b5915a4df4601c58fcbeb688e14de61300f13183c154b3320cc8e80042a46f22d796f56ff1fdd7e28440c05f14b960c1d0a7c627b09295112bcb635b0e2447a9374fafc4a23ceaf9de4d10b29b2f6cabd7f0c7706cf0404452681d7372d559b644627b2695960deb3b4ae57028e0164b29d5ef9e701d3122b6a5715c502e1dca5252e8c215ed754b01a193041ad9751ed2fff1b55991e256edd6099a38004a367ad097c7caf953da302201263715517f6d32cff57969be994df42fd6cadb649e3c738be798f779aaf4c07cada6bf1e4115b74e2670baf4b1592c70b10a6c043b6606b428b3f79545dc8e9783c876e5402909858f9c604963c37fbc477137c8908e6cfa11ece18c8784a6f25428a5ee1e91d0095fe310d6a91139a7c5c6624bbfcaa15ee847a25b06f57332917f68526a6317f575792e9bcba8576a96bc5859b1f2a00fd8ab08a5ac4ab71833b0b711d1f120cbdb374bcedcdcbeba3806644f5082ec737a945221f5d99562fcbb02a43beeafb16ceecd4e35f06a04c9ff9f4f33725ab62cf22c36650280e4cfb9e150a2c4ebee7785108522e8ecb4682d2d751168e7597299346c3a5e885e36eda66b9a1112997111135767972d771b02c1a36c1d1fb1ce539ecfb98e9e1d8f8fdbf89aec28ad34ff5c00c1a4a8c59848dc8b64c0e65f6f10122e60b4adc1cfc602f49d6cfbdd54be6b0951d3f9cafe8cdd0428f9ce6994844e92d8b72d44edda623bad428b398f88643c3904bda16dd15e886ca4ef6ea7f1450744ac38ffce902569d2e9026bcedd6d0ee54aceabda22bf2de72cba89e6c274064619e32a1192cf2d78b56cf497f7785a6d599de9f8383d1f66f47fc385dc569ee1f08ddbbc7f1aeb0a0126fc4020d948dda10255f11e776db7a037059a40fde38a2ee0c0ce49c7f3df175881bf12371fa72fec3fba657107892a97efe41dcc18aeecd99f3e46c33cf42c2a0ba8b75cf000", - "shared_secrets": [ - "ccf2512684e2508cb4a842393757e6040b7d25e29d3a2031f29d00a000af6128", - "d4cec39fe6287d41165bf5c608b0c720a411208a83c64c805a012c86662a2e5a", - "91bc712ebd4a900e05830394ca8b1f1168777ecdd6996029d96ec8838b9903b9", - "93c373dcb14dc36ababa3e0c5c55869a667ca175e09913a98c3be67e6af97e16", - "b2642a5770a6b61ade071fdf69d3ea365cf48434fc2a2c399512778821a33e5c" - ] -} -{ - "onion": "0002cdce4bfaa9faa2c060afafe001b80bde07fc670e882c063a80b4738d5f78c9351825c6461cdfcd4fe4144d3b51f63da6351b28dd49c7bfdb0b4f7d8bda4ad0d99699eda39e551084c0a095746c358d1dc6d2eec8082f2aa2f69ae8f61b1f1437ae0ed673078fec6c0510a34058167ad1a34e819a3813d4cf27b2c4917a8c6ca3d70c3381a2a41b4c1b4540adf0e922e25f57d1cfc3064f29cfec4c17244160121975cab59b44c83b4a4905bf7ebfbd308de376334bf86d8aa92c674f7bcfec85680d73e9fee72642c98c603128e358c86e0bc88a60aaebc2637441a57261c61c6be145f00f2fc56164a6495f4b52d3172cb0ef52e91fa0d32a9ae2502d17433bda58d93fbc24a70ec6b5e740952a61404c7370eafe52599c7ee52e77b1cda87c46da98d2ff0d02fe09db5adcb2d2e9bcd083ef58392907b8a21681fa4ea1e4806b4676656457fea000fa504f9b4d159fe8b241266ac91dcc0351053c6dcc1493a6b02bed652cc8b92a8470c98924ebfde6ddc5cf7fd75f6e83a7350642053b70d4834179c30eb56d8c86656cda784daf3b6cd125779bec51099301e3f79f78d85d0454aef8bf5f9058491881b73e99b662b64080cd3eb16fd7f9d9640c18738736cfc15f391232b7df92f46ceb5abf08732ff833e9409ee541d7c926f7a0fe3e233d3eee4a63b65ab23b7c835b7cdd809ddfac8abb1df471fa66a54092815aa41e6fc1a026b86c5675d39c4e8c5c4b4acd48534165239f5634b9e828a7f9df94efcd2a39045efdee4d2f006a63ae828e6e90e3610c522085da6e0198141d6e501d83aba32057f4e59f9b7dfb0bf949c5ef91917cb54561d45a9e7ead049c57deb62d14ba6e18f5d7b0fb9f15e97bf5bd9f909f99c86c787357946654b87c489d34245d07fbb72119166e338b608a4178b452695235dd96bf7fd338e29a9f054ec1a63a442e12602d2329834297f6a197d8a377d608f402f0bcc936f45f33c8d2f9d40e5aef41816dd883add81ca20f1e0631457fe00aa2bd75c9165ffcd96c100c1db83a53aeee23d59f2a542ee3ba39ba62298ddfbd9ecfafd6b5d2121eb003ee23a2ebb8c6b6b687f42492c962510c5acf5231ff96635eba37354559ba39b042d9b6883cac662f418d7c62f9908b2a67964af5e5471804f7684e0d582b8bfec99816bb3442cca1d1fe4efd75d573ebf09fa9cad811063864fb14be4a7768ec2ddb118a77969e986c6584c4b20f8622941ca73d73562857d36e17a46a68d6e10147aaefff1ffb9809f0652a5f760148ed33550661b63c8176d5679e701c221d8a49d4062eb04010ea74cc1132fbeb8934c6e582ba2a16162b7e9171f95bce4ec3e339e70c781f95aaca406cd718b74397658fdefdd093486664be7ed13efa437012f1f57f9f1f4fb4eef7501ccf0e0ac4edc01fde138038c4dd65cb5c3291ad02a6728d6761b1afa35d49bd6ef117012bdd9bd6ee8a175620feb2249aa18d6175351b4bfc2b2b4fd57ff52f5969b109aa9b6cb2cde8f350917c0da2da1bc3d52eb0c7e6080b8f69c5783f2ed26feceb05ba4e7ed66676041d03d0acd3dd6343a85ac0b9c36f9640ddd0db884822f98dc42ea7911a6938dc14ba19d3d25a2b2f82794a2b5dd751dc856d7a9ccdb2d351a0b84e7030fa925ac949a37594f3aa2ba28ae5155b0aaac9c6820b8888d0b8a9db148513b9e3dbde68333ac30a0720289b6a0145d88629d49e76a6d3538330c5aececc9d54127b0a5a0e92d5a5a73beb71132c208b589cab61d53ed357c907929198c559426ae729b374a803dd3321a45ccca39efd39eddaba6e79a2f8911bdf74e18733dc7efc51132b5608d97fd2d0f22fa8961de04cdf6d0dbfbab21e362e7abaef3976f993088aa97ed3f1f4bcf3fffb012f583558bd2f15face9cba20b3e6754b70", - "shared_secrets": [ - "3f53c03f98eb83db88ff97c2c4004051ce23265ed2414a7aebf7a3e7078839ab" - ] -} -``` - -AUTHOR ------- - -Christian Decker <> is mainly responsible. - -SEE ALSO --------- - -lightning-sendonion(7), lightning-getroute(7) - -RESOURCES ---------- - -Main web site: - -[BOLT 04](https://github.com/lightning/bolts/blob/master/04-onion-routing.md) diff --git a/doc/lightning-createrune.7.md b/doc/lightning-createrune.7.md deleted file mode 100644 index bc3094e87063..000000000000 --- a/doc/lightning-createrune.7.md +++ /dev/null @@ -1,256 +0,0 @@ -lightning-createrune -- Command to Create/Update Rune for Authorizing Remote Peer Access -======================================================================================== - -SYNOPSIS --------- - -**createrune** [*rune*] [*restrictions*] - -DESCRIPTION ------------ - -Command *added* in v23.08. - -The **createrune** RPC command creates a base64 string called a *rune* which can be used to access commands on this node. Each *rune* contains a unique id (a number starting at 0), and can have restrictions inside it. Nobody can remove restrictions from a rune: if you try, the rune will be rejected. There is no limit on how many runes you can issue; the node simply decodes and checks them as they are received. - -Oh, I almost forgot. Runes can also be invoked like in ancient times with the **invokerune** command. Feel the magical powers of a rune by invoking it. - -- **rune** (string, optional): If supplied, the restrictions are simple appended to that *rune* (it doesn't need to be a rune belonging to this node). If not supplied, a new *rune* is constructed, with a new unique id. -- **restrictions** (one of, optional): It can be the string `readonly`, or an array of restrictions. - Each restriction is an array of one or more alternatives, such as "method is listpeers", or "method is listpeers OR time is before 2023".: - - (array of arrays): Alternatives use a simple language to examine the command which is being run: - * time: the current UNIX time, e.g. "time<1656759180". - * id: the node\_id of the peer, e.g. "id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605". - * method: the command being run, e.g. "method=withdraw". - * per: how often the rune can be used, with suffix "sec" (default), "min", "hour", "day" or "msec", "usec" or "nsec". e.g. "per=5sec". - * rate: the rate limit, per minute, e.g. "rate=60" is equivalent to "per=1sec". - * pnum: the number of parameters. e.g. "pnum<2". - * pnameX: the parameter named X (with any punctuation like `_` removed). e.g. "pnamedestination=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T". - * parrN: the N'th parameter. e.g. "parr0=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T". - - (array of strings) - - (string, optional) - - (always "readonly"): A rune which allows most *get* and *list* commands, and the *summary* command. - -RESTRICTION FORMAT ------------------- - -Restrictions are one or more alternatives. Each alternative is *name* *operator* *value*. The valid names are shown above. - -Note that if a value contains `\`, it must be preceeded by another `\` to form valid JSON: -* `=`: passes if equal ie. identical. e.g. `method=withdraw` -* `/`: not equals, e.g. `method/withdraw` -* `^`: starts with, e.g. `id^024b9a1fa8e006f1e3937f` -* `$`: ends with, e.g. `id$381df1cc449605`. -* `~`: contains, e.g. `id~006f1e3937f65f66c40`. -* `<`: is a decimal integer, and is less than. e.g. `time<1656759180` -* `>`: is a decimal integer, and is greater than. e.g. `time>1656759180` -* `{`: preceeds in alphabetical order (or matches but is shorter), - e.g. `id{02ff`. -* `}`: follows in alphabetical order (or matches but is longer), - e.g. `id}02ff`. -* `#`: a comment, ignored, e.g. `dumb example#`. -* `!`: only passes if the *name* does *not* exist. e.g. `pnamedestination!`. -Every other operator except `#` fails if *name* does not exist! - -EXAMPLE USAGE -------------- - -This creates a fresh rune which can do anything: - -```shell -$ lightning-cli commando-rune -{ - "rune": "KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA==", - "unique_id": "0" -} -``` -We can add restrictions to that rune, like so: - -```shell -$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions=readonly -{ - "rune": "NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", - "unique_id": "0" -} -``` -The "readonly" restriction is a short-cut for two restrictions: - -1. `["method^list", "method^get", "method=summary"]`: You may call list, get or summary. -2. `["method/listdatastore"]`: But not listdatastore: that contains sensitive stuff! - -We can do the same manually, like so: - -```shell -$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions='[["method^list", "method^get", "method=summary"],["method/listdatastore"]]' -{ - "rune": "NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", - "unique_id": "0" -} -``` -Let's create a rune which lets a specific peer (024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605) run "listpeers" on themselves: - -```shell -$ lightning-cli commando-rune restrictions='[["id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605"],["method=listpeers"],["pnum=1"],["pnameid=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605","parr0=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605"]]' -{ - "rune": "FE8GHiGVvxcFqCQcClVRRiNE_XEeLYQzyG2jmqto4jM9MiZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDV8cGFycjA9MDI0YjlhMWZhOGUwMDZmMWUzOTM3ZjY1ZjY2YzQwOGU2ZGE4ZTFjYTcyOGVhNDMyMjJhNzM4MWRmMWNjNDQ5NjA1", - "unique_id": "2" -} -``` -This allows `listpeers` with 1 argument (`pnum=1`), which is either by name (`pnameid`), or position (`parr0`). We could shorten this in several ways: either allowing only positional or named parameters, or by testing the start of the parameters only. Here's an example which only checks the first 9 bytes of the `listpeers` parameter: - -```shell -$ lightning-cli commando-rune restrictions='[["id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605"],["method=listpeers"],["pnum=1"],["pnameid^024b9a1fa8e006f1e393", "parr0^024b9a1fa8e006f1e393"]' - { - "rune": "fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw==", - "unique_id": "3" -} -``` -Before we give this to our peer, let's add two more restrictions: that it only be usable for 24 hours from now (`time<`), and that it can only be used twice a minute (`rate=2`). `date +%s` can give us the current time in seconds: - -```shell -$ lightning-cli commando-rune rune=fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw== restrictions='[["time<'$(($(date +%s) + 24*60*60))'","rate=2"]]' -{ - "rune": "tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y", - "unique_id": "3" -} -``` -You can also use lightning-decode(7) to examine runes you have been given: - -```shell -$ lightning-cli decode tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y -{ - "type": "rune", - "unique_id": "3", - "string": "b54f912e33220e9636534a375b5a05a306abdfa4451a95a5a0f6d6f7e46e65da:=3&id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605&method=listpeers&pnum=1&pnameid^024b9a1fa8e006f1e393|parr0^024b9a1fa8e006f1e393&time<1656920538&rate=2", - "restrictions": [ - { - "alternatives": [ - "id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605" - ], - "summary": "id (of commanding peer) equal to '024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605'" - }, - { - "alternatives": [ - "method=listpeers" - ], - "summary": "method (of command) equal to 'listpeers'" - }, - { - "alternatives": [ - "pnum=1" - ], - "summary": "pnum (number of command parameters) equal to 1" - }, - { - "alternatives": [ - "pnameid^024b9a1fa8e006f1e393", - "parr0^024b9a1fa8e006f1e393" - ], - "summary": "pnameid (object parameter 'id') starts with '024b9a1fa8e006f1e393' OR parr0 (array parameter #0) starts with '024b9a1fa8e006f1e393'" - }, - { - "alternatives": [ - "time<1656920538" - ], - "summary": "time (in seconds since 1970) less than 1656920538 (approximately 19 hours 18 minutes from now)" - }, - { - "alternatives": [ - "rate=2" - ], - "summary": "rate (max per minute) equal to 2" - } - ], - "valid": true -} -``` - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:createrune#1", - "method": "createrune", - "params": { - "restrictions": [ - [ - "method/getinfo" - ] - ] - } -} -{ - "id": "example:createrune#2", - "method": "createrune", - "params": { - "restrictions": "readonly" - } -} -{ - "id": "example:createrune#3", - "method": "createrune", - "params": [ - "enX0sTpHB8y1ktyTAF80CnEvGetG340Ne3AGItudBS49NCZwbnVtPTA=", - [ - [ - "rate=3" - ] - ] - ] -} -``` - -SHARING RUNES -------------- - -Because anyone can add a restriction to a rune, you can always turn a normal rune into a read-only rune, or restrict access for 30 minutes from the time you give it to someone. Adding restrictions before sharing runes is best practice. - -If a rune has a ratelimit, any derived rune will have the same id, and thus will compete for that ratelimit. You might want to consider adding a tighter ratelimit to a rune before sharing it, so you will keep the remainder. For example, if you rune has a limit of 60 times per minute, adding a limit of 5 times per minute and handing that rune out means you can still use your original rune 55 times per minute. - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **rune** (string): The resulting rune. -- **unique\_id** (string): The id of this rune: this is set at creation and cannot be changed (even as restrictions are added). - -The following warnings may also be returned: - -- **warning\_unrestricted\_rune**: A warning shown when runes are created with powers that could drain your node. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "rune": "S5f-BKt3rR-cvJmujdpDCUQm_XLahfB4iQuDlwqMJiQ9MCZtZXRob2QvZ2V0aW5mbw==", - "unique_id": "0" -} -{ - "rune": "oVkzoiQ67VCU1h_aRjPqCeWktGX54ARDsqqQgDL-uMs9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl", - "unique_id": "1" -} -{ - "rune": "_h2eKjoK7ITAF-JQ1S5oum9oMQesrz-t1FR9kDChRB49NCZwbnVtPTAmcmF0ZT0z", - "unique_id": "2" -} -``` - -AUTHOR ------- - -Rusty Russell <> wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page. - -Shahana Farooqui <> is mainly responsible for migrating commando-rune to createrune. - -SEE ALSO --------- - -lightning-commando-rune(7), lightning-checkrune(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-datastore.7.md b/doc/lightning-datastore.7.md deleted file mode 100644 index c9aef86f44d9..000000000000 --- a/doc/lightning-datastore.7.md +++ /dev/null @@ -1,147 +0,0 @@ -lightning-datastore -- Command for storing (plugin) data -======================================================== - -SYNOPSIS --------- - -**datastore** *key* [*string*] [*hex*] [*mode*] [*generation*] - -DESCRIPTION ------------ - -The **datastore** RPC command allows plugins to store data in the Core Lightning database, for later retrieval. - -- **key** (one of): A key can either have children or a value, never both: parents are created and removed automatically.: - - (array of strings): An array of values to form a hierarchy (though a single value is treated as a one-element array). Using the first element of the key as the plugin name (e.g. `[ 'summary' ]`) is recommended. - - (string, optional) - - (string) -- **string** (string, optional): Data to be saved in string format. -- **hex** (hex, optional): Data to be saved in hex format. -- **mode** (string, optional) (one of "must-create", "must-replace", "create-or-replace", "must-append", "create-or-append"): Write mode to determine how the record is updated: - * `must-create`: fails if it already exists. - * `must-replace`: fails if it doesn't already exist. - * `create-or-replace`: never fails. - * `must-append`: must already exist, append this to what's already there. - * `create-or-append`: append if anything is there, otherwise create. The default is `must-create`. -- **generation** (u64, optional): If specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with *mode* `must-replace` or `must-append`. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:datastore#1", - "method": "datastore", - "params": { - "key": [ - "test_libplugin", - "name" - ], - "string": "foobar", - "hex": null, - "mode": "must-replace", - "generation": null - } -} -{ - "id": "example:datastore#2", - "method": "datastore", - "params": { - "key": "somekey", - "string": null, - "hex": "61", - "mode": "create-or-append", - "generation": null - } -} -{ - "id": "example:datastore#3", - "method": "datastore", - "params": { - "key": [ - "a", - "d", - "e", - "f", - "g" - ], - "string": "somedatatostoreinthedatastore", - "hex": null, - "mode": null, - "generation": null - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **key** (array of strings): - - (string, optional): Part of the key added to the datastore. -- **generation** (u64, optional): The number of times this has been updated. -- **hex** (hex, optional): The hex data which has been added to the datastore. -- **string** (string, optional): The data as a string, if it's valid utf-8. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "key": [ - "test_libplugin", - "name" - ], - "generation": 1, - "hex": "666f6f626172", - "string": "foobar" -} -{ - "key": [ - "somekey" - ], - "generation": 3, - "hex": "736f6d6564617461", - "string": "somedata" -} -{ - "key": [ - "a", - "d", - "e", - "f", - "g" - ], - "generation": 0, - "hex": "736f6d6564617461746f73746f7265696e7468656461746173746f7265", - "string": "somedatatostoreinthedatastore" -} -``` - -ERRORS ------- - -The following error codes may occur: - -- 1202: The key already exists (and mode said it must not) -- 1203: The key does not exist (and mode said it must) -- 1204: The generation was wrong (and generation was specified) -- 1205: The key has children already. -- 1206: One of the parents already exists with a value. -- -32602: invalid parameters - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-listdatastore(7), lightning-deldatastore(7), lightning-datastoreusage(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-datastoreusage.7.md b/doc/lightning-datastoreusage.7.md deleted file mode 100644 index 5b76b40e9d2a..000000000000 --- a/doc/lightning-datastoreusage.7.md +++ /dev/null @@ -1,98 +0,0 @@ -lightning-datastoreusage -- Command for listing datastore usage info -==================================================================== - -SYNOPSIS --------- - -**datastoreusage** [*key*] - -DESCRIPTION ------------ - -Command *added* in v23.11. - -The **datastoreusage** RPC command allows the caller to fetch the total bytes that are stored under a certain *key* (or from the root), including the size of the *key*. - -All descendants of the *key* (or root) are taken into account. - -- **key** (one of, optional): - - (array of strings): Key is an array of values (though a single value is treated as a one-element array). Used as the starting point to traverse the datastore. - - (string, optional) - - (string) - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:datastoreusage#1", - "method": "datastoreusage", - "params": { - "key": null - } -} -{ - "id": "example:datastoreusage#2", - "method": "datastoreusage", - "params": { - "key": "a" - } -} -{ - "id": "example:datastoreusage#3", - "method": "datastoreusage", - "params": { - "key": [ - "a", - "thisissomelongkeythattriestostore46bytesofdata" - ] - } -} -``` - -RETURN VALUE ------------- - -On success, an object containing **datastoreusage** is returned. It is an object containing: - -- **key** (string): The key from which the database was traversed. *(added v23.11)* -- **total\_bytes** (u64): The total bytes that are stored under the *key*, including the all descendants data and the size of the keys themselves. *(added v23.11)* - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "datastoreusage": { - "key": "[]", - "total_bytes": 0 - } -} -{ - "datastoreusage": { - "key": "[a]", - "total_bytes": 32 - } -} -{ - "datastoreusage": { - "key": "[a,thisissomelongkeythattriestostore46bytesofdata]", - "total_bytes": 77 - } -} -``` - -AUTHOR ------- - -Peter Neuroth <> is mainly responsible. - -SEE ALSO --------- - -lightning-datastore(7), lightning-deldatastore(7), lightning-listdatastore(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-decode.7.md b/doc/lightning-decode.7.md deleted file mode 100644 index caedb6d458fc..000000000000 --- a/doc/lightning-decode.7.md +++ /dev/null @@ -1,369 +0,0 @@ -lightning-decode -- Command for decoding an invoice string (low-level) -====================================================================== - -SYNOPSIS --------- - -**decode** *string* - -DESCRIPTION ------------ - -Command *added* in v23.05. - -The **decode** RPC command checks and parses `bolt11`, `bolt12`, `rune` or `emergency_recover`. It may decode other formats in future. - -- **string** (string): Value to be decoded: - * a *bolt11* or *bolt12* string (optionally prefixed by `lightning:` or `LIGHTNING:`) as specified by the BOLT 11 and BOLT 12 specifications. - * a *rune* as created by lightning-commando-rune(7). - * an *emergency\_recover* string generated by hsmtool like `lightning-hsmtool getemergencyrecover `. It holds `emergency.recover` contents and starts with `clnemerg1`. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:decode#1", - "method": "decode", - "params": [ - "zm0x_eLgHexaTvZn3Cz7gb_YlvrlYGDo_w4BYlR9SS09MSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl" - ] -} -{ - "id": "example:decode#2", - "method": "decode", - "params": [ - "lnbcrt1m1pja0f2hsp5xyssdvdsu24dmmesrt6x84wfrm4mscsnzq7hl2suzeu90wy6g53qpp5zyyu3anwfsfl64pewe0tg7j28map2wwnhvaam5nt70rlwxa0cegqdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqgqqqqqqqlgqqqq86qqqc9qxpqysgq7u4f99u4kepagme27t5c3gdl7czlnjaw7kxryxgm87w2j02j3g94r2vrukhpgedhcdkcdec27m7jrl2lvcr6uh3rdv9lgpz0vc0zcfcqnugjdw" - ] -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **type** (string) (one of "bolt12 offer", "bolt12 invoice", "bolt12 invoice\_request", "bolt11 invoice", "rune", "emergency recover"): What kind of object it decoded to. -- **valid** (boolean): If this is false, you *MUST* not use the result except for diagnostics! - -If **type** is "bolt12 offer", and **valid** is *true*: - - **offer\_id** (hex) (always 64 characters): The id we use to identify this offer. - - **offer\_description** (string): The description of the purpose of the offer. - - **offer\_node\_id** (pubkey): Public key of the offering node. - - **offer\_chains** (array of hashs, optional): Which blockchains this offer is for (missing implies bitcoin mainnet only).: - - (hash, optional): The genesis blockhash. - - **offer\_metadata** (hex, optional): Any metadata the creator of the offer includes. - - **offer\_currency** (string, optional) (always 3 characters): ISO 4217 code of the currency (missing implies Bitcoin). - - **currency\_minor\_unit** (u32, optional): The number of decimal places to apply to amount (if currency known). - - **offer\_amount** (u64, optional): The amount in the `offer_currency` adjusted by `currency_minor_unit`, if any. - - **offer\_amount\_msat** (msat, optional): The amount in bitcoin (if specified, and no `offer_currency`). - - **offer\_issuer** (string, optional): The description of the creator of the offer. - - **offer\_features** (hex, optional): The feature bits of the offer. - - **offer\_absolute\_expiry** (u64, optional): UNIX timestamp of when this offer expires. - - **offer\_quantity\_max** (u64, optional): The maximum quantity (or, if 0, means any quantity). - - **offer\_paths** (array of objects, optional): Paths to the destination.: - - **first\_node\_id** (pubkey): The (presumably well-known) public key of the start of the path. - - **blinding** (pubkey): Blinding factor for this path. - - **path** (array of objects): An individual path.: - - **blinded\_node\_id** (pubkey): Node\_id of the hop. - - **encrypted\_recipient\_data** (hex): Encrypted TLV entry for this hop. - - **offer\_recurrence** (object, optional): How often to this offer should be used.: - - **time\_unit** (u32): The BOLT12 time unit. - - **period** (u32): How many `time_unit` per payment period. - - **time\_unit\_name** (string, optional): The name of `time_unit` (if valid). - - **basetime** (u64, optional): Period starts at this UNIX timestamp. - - **start\_any\_period** (u64, optional): You can start at any period (only if `basetime` present). - - **limit** (u32, optional): Maximum period number for recurrence. - - **paywindow** (object, optional): When within a period will payment be accepted. The default is prior and during the period.: - - **seconds\_before** (u32): Seconds prior to period start. - - **seconds\_after** (u32): Seconds after to period start. - - **proportional\_amount** (boolean, optional) (always *true*): Amount should be scaled if paid after period start. - - **unknown\_offer\_tlvs** (array of objects, optional): Any extra fields we didn't know how to parse.: - - **type** (u64): The type. - - **length** (u64): The length. - - **value** (hex): The value. - - the following warnings are possible: - - **warning\_unknown\_offer\_currency**: The currency code is unknown (so no `currency_minor_unit`). - -If **type** is "bolt12 offer", and **valid** is *false*: - - the following warnings are possible: - - **warning\_missing\_offer\_node\_id**: `offer_node_id` is not present. - - **warning\_invalid\_offer\_description**: `offer_description` is not valid UTF8. - - **warning\_missing\_offer\_description**: `offer_description` is not present. - - **warning\_invalid\_offer\_currency**: `offer_currency_code` is not valid UTF8. - - **warning\_invalid\_offer\_issuer**: `offer_issuer` is not valid UTF8. - -If **type** is "bolt12 invoice\_request", and **valid** is *true*: - - **offer\_description** (string): The description of the purpose of the offer. - - **offer\_node\_id** (pubkey): Public key of the offering node. - - **invreq\_metadata** (hex): The payer-provided blob to derive invreq\_payer\_id. - - **invreq\_payer\_id** (hex): The payer-provided key. - - **signature** (bip340sig): BIP-340 signature of the `invreq_payer_id` on this invoice\_request. - - **offer\_id** (hex, optional) (always 64 characters): The id we use to identify this offer. - - **offer\_chains** (array of hexs, optional): Which blockchains this offer is for (missing implies bitcoin mainnet only).: - - (hex, optional) (always 64 characters): The genesis blockhash. - - **offer\_metadata** (hex, optional): Any metadata the creator of the offer includes. - - **offer\_currency** (string, optional) (always 3 characters): ISO 4217 code of the currency (missing implies Bitcoin). - - **currency\_minor\_unit** (u32, optional): The number of decimal places to apply to amount (if currency known). - - **offer\_amount** (u64, optional): The amount in the `offer_currency` adjusted by `currency_minor_unit`, if any. - - **offer\_amount\_msat** (msat, optional): The amount in bitcoin (if specified, and no `offer_currency`). - - **offer\_issuer** (string, optional): The description of the creator of the offer. - - **offer\_features** (hex, optional): The feature bits of the offer. - - **offer\_absolute\_expiry** (u64, optional): UNIX timestamp of when this offer expires. - - **offer\_quantity\_max** (u64, optional): The maximum quantity (or, if 0, means any quantity). - - **offer\_paths** (array of objects, optional): Paths to the destination.: - - **first\_node\_id** (pubkey): The (presumably well-known) public key of the start of the path. - - **blinding** (pubkey): Blinding factor for this path. - - **path** (array of objects): An individual path.: - - **blinded\_node\_id** (pubkey): Node\_id of the hop. - - **encrypted\_recipient\_data** (hex): Encrypted TLV entry for this hop. - - **offer\_recurrence** (object, optional): How often to this offer should be used.: - - **time\_unit** (u32): The BOLT12 time unit. - - **period** (u32): How many `time_unit` per payment period. - - **time\_unit\_name** (string, optional): The name of `time_unit` (if valid). - - **basetime** (u64, optional): Period starts at this UNIX timestamp. - - **start\_any\_period** (u64, optional): You can start at any period (only if `basetime` present). - - **limit** (u32, optional): Maximum period number for recurrence. - - **paywindow** (object, optional): When within a period will payment be accepted. The default is prior and during the period.: - - **seconds\_before** (u32): Seconds prior to period start. - - **seconds\_after** (u32): Seconds after to period start. - - **proportional\_amount** (boolean, optional) (always *true*): Amount should be scaled if paid after period start. - - **invreq\_chain** (hex, optional) (always 64 characters): Which blockchain this offer is for (missing implies bitcoin mainnet only). - - **invreq\_amount\_msat** (msat, optional): The amount the invoice should be for. - - **invreq\_features** (hex, optional): The feature bits of the invoice\_request. - - **invreq\_quantity** (u64, optional): The number of items to invoice for. - - **invreq\_payer\_note** (string, optional): A note attached by the payer. - - **invreq\_recurrence\_counter** (u32, optional): Which number request this is for the same invoice. - - **invreq\_recurrence\_start** (u32, optional): When we're requesting to start an invoice at a non-zero period. - - **unknown\_invoice\_request\_tlvs** (array of objects, optional): Any extra fields we didn't know how to parse.: - - **type** (u64): The type. - - **length** (u64): The length. - - **value** (hex): The value. - - the following warnings are possible: - - **warning\_unknown\_offer\_currency**: The currency code is unknown (so no `currency_minor_unit`). - -If **type** is "bolt12 invoice\_request", and **valid** is *false*: - - the following warnings are possible: - - **warning\_invalid\_offer\_description**: `offer_description` is not valid UTF8. - - **warning\_missing\_offer\_description**: `offer_description` is not present. - - **warning\_invalid\_offer\_currency**: `offer_currency_code` is not valid UTF8. - - **warning\_invalid\_offer\_issuer**: `offer_issuer` is not valid UTF8. - - **warning\_missing\_invreq\_metadata**: `invreq_metadata` is not present. - - **warning\_missing\_invreq\_payer\_id**: `invreq_payer_id` is not present. - - **warning\_invalid\_invreq\_payer\_note**: `invreq_payer_note` is not valid UTF8. - - **warning\_missing\_invoice\_request\_signature**: `signature` is not present. - - **warning\_invalid\_invoice\_request\_signature**: Incorrect `signature`. - -If **type** is "bolt12 invoice", and **valid** is *true*: - - **offer\_description** (string): The description of the purpose of the offer. - - **offer\_node\_id** (pubkey): Public key of the offering node. - - **invreq\_metadata** (hex): The payer-provided blob to derive invreq\_payer\_id. - - **invreq\_payer\_id** (hex): The payer-provided key. - - **invoice\_paths** (array of objects): Paths to pay the destination.: - - **first\_node\_id** (pubkey): The (presumably well-known) public key of the start of the path. - - **blinding** (pubkey): Blinding factor for this path. - - **payinfo** (object): - - **fee\_base\_msat** (msat): Basefee for path. - - **fee\_proportional\_millionths** (u32): Proportional fee for path. - - **cltv\_expiry\_delta** (u32): CLTV delta for path. - - **features** (hex): Features allowed for path. - - **path** (array of objects): An individual path.: - - **blinded\_node\_id** (pubkey): Node\_id of the hop. - - **encrypted\_recipient\_data** (hex): Encrypted TLV entry for this hop. - - **invoice\_created\_at** (u64): The UNIX timestamp of invoice creation. - - **invoice\_payment\_hash** (hex) (always 64 characters): The hash of the *payment\_preimage*. - - **invoice\_amount\_msat** (msat): The amount required to fulfill invoice. - - **signature** (bip340sig): BIP-340 signature of the `offer_node_id` on this invoice. - - **offer\_id** (hex, optional) (always 64 characters): The id we use to identify this offer. - - **offer\_chains** (array of hexs, optional): Which blockchains this offer is for (missing implies bitcoin mainnet only).: - - (hex, optional) (always 64 characters): The genesis blockhash. - - **offer\_metadata** (hex, optional): Any metadata the creator of the offer includes. - - **offer\_currency** (string, optional) (always 3 characters): ISO 4217 code of the currency (missing implies Bitcoin). - - **currency\_minor\_unit** (u32, optional): The number of decimal places to apply to amount (if currency known). - - **offer\_amount** (u64, optional): The amount in the `offer_currency` adjusted by `currency_minor_unit`, if any. - - **offer\_amount\_msat** (msat, optional): The amount in bitcoin (if specified, and no `offer_currency`). - - **offer\_issuer** (string, optional): The description of the creator of the offer. - - **offer\_features** (hex, optional): The feature bits of the offer. - - **offer\_absolute\_expiry** (u64, optional): UNIX timestamp of when this offer expires. - - **offer\_quantity\_max** (u64, optional): The maximum quantity (or, if 0, means any quantity). - - **offer\_paths** (array of objects, optional): Paths to the destination.: - - **first\_node\_id** (pubkey): The (presumably well-known) public key of the start of the path. - - **blinding** (pubkey): Blinding factor for this path. - - **path** (array of objects): An individual path.: - - **blinded\_node\_id** (pubkey): Node\_id of the hop. - - **encrypted\_recipient\_data** (hex): Encrypted TLV entry for this hop. - - **offer\_recurrence** (object, optional): How often to this offer should be used.: - - **time\_unit** (u32): The BOLT12 time unit. - - **period** (u32): How many `time_unit` per payment period. - - **time\_unit\_name** (string, optional): The name of `time_unit` (if valid). - - **basetime** (u64, optional): Period starts at this UNIX timestamp. - - **start\_any\_period** (u64, optional): You can start at any period (only if `basetime` present). - - **limit** (u32, optional): Maximum period number for recurrence. - - **paywindow** (object, optional): When within a period will payment be accepted. The default is prior and during the period.: - - **seconds\_before** (u32): Seconds prior to period start. - - **seconds\_after** (u32): Seconds after to period start. - - **proportional\_amount** (boolean, optional) (always *true*): Amount should be scaled if paid after period start. - - **invreq\_chain** (hex, optional) (always 64 characters): Which blockchain this offer is for (missing implies bitcoin mainnet only). - - **invreq\_amount\_msat** (msat, optional): The amount the invoice should be for. - - **invreq\_features** (hex, optional): The feature bits of the invoice\_request. - - **invreq\_quantity** (u64, optional): The number of items to invoice for. - - **invreq\_payer\_note** (string, optional): A note attached by the payer. - - **invreq\_recurrence\_counter** (u32, optional): Which number request this is for the same invoice. - - **invreq\_recurrence\_start** (u32, optional): When we're requesting to start an invoice at a non-zero period. - - **invoice\_relative\_expiry** (u32, optional): The number of seconds after *invoice\_created\_at* when this expires. - - **invoice\_fallbacks** (array of objects, optional): Onchain addresses.: - - **version** (u8): Segwit address version. - - **hex** (hex): Raw encoded segwit address. - - **address** (string, optional): Bech32 segwit address. - - **invoice\_features** (hex, optional): The feature bits of the invoice. - - **invoice\_node\_id** (pubkey, optional): The id to pay (usually the same as offer\_node\_id). - - **invoice\_recurrence\_basetime** (u64, optional): The UNIX timestamp to base the invoice periods on. - - **unknown\_invoice\_tlvs** (array of objects, optional): Any extra fields we didn't know how to parse.: - - **type** (u64): The type. - - **length** (u64): The length. - - **value** (hex): The value. - - the following warnings are possible: - - **warning\_unknown\_offer\_currency**: The currency code is unknown (so no `currency_minor_unit`). - -If **type** is "bolt12 invoice", and **valid** is *false*: - - **fallbacks** (array of objects, optional): - - the following warnings are possible: - - **warning\_invoice\_fallbacks\_version\_invalid**: `version` is > 16. - - the following warnings are possible: - - **warning\_invalid\_offer\_description**: `offer_description` is not valid UTF8. - - **warning\_missing\_offer\_description**: `offer_description` is not present. - - **warning\_invalid\_offer\_currency**: `offer_currency_code` is not valid UTF8. - - **warning\_invalid\_offer\_issuer**: `offer_issuer` is not valid UTF8. - - **warning\_missing\_invreq\_metadata**: `invreq_metadata` is not present. - - **warning\_invalid\_invreq\_payer\_note**: `invreq_payer_note` is not valid UTF8. - - **warning\_missing\_invoice\_paths**: `invoice_paths` is not present. - - **warning\_missing\_invoice\_blindedpay**: `invoice_blindedpay` is not present. - - **warning\_missing\_invoice\_created\_at**: `invoice_created_at` is not present. - - **warning\_missing\_invoice\_payment\_hash**: `invoice_payment_hash` is not present. - - **warning\_missing\_invoice\_amount**: `invoice_amount` is not present. - - **warning\_missing\_invoice\_recurrence\_basetime**: `invoice_recurrence_basetime` is not present. - - **warning\_missing\_invoice\_node\_id**: `invoice_node_id` is not present. - - **warning\_missing\_invoice\_signature**: `signature` is not present. - - **warning\_invalid\_invoice\_signature**: Incorrect `signature`. - -If **type** is "bolt11 invoice", and **valid** is *true*: - - **currency** (string): The BIP173 name for the currency. - - **created\_at** (u64): The UNIX-style timestamp of the invoice. - - **expiry** (u64): The number of seconds this is valid after `created_at`. - - **payee** (pubkey): The public key of the recipient. - - **payment\_hash** (hash): The hash of the *payment\_preimage*. - - **signature** (signature): Signature of the *payee* on this invoice. - - **min\_final\_cltv\_expiry** (u32): The minimum CLTV delay for the final node. - - **amount\_msat** (msat, optional): Amount the invoice asked for. - - **description** (string, optional): The description of the purpose of the purchase. - - **description\_hash** (hash, optional): The hash of the description, in place of *description*. - - **payment\_secret** (secret, optional): The secret to hand to the payee node. - - **features** (hex, optional): The features bitmap for this invoice. - - **payment\_metadata** (hex, optional): The payment\_metadata to put in the payment. - - **fallbacks** (array of objects, optional): Onchain addresses.: - - **type** (string) (one of "P2PKH", "P2SH", "P2WPKH", "P2WSH", "P2TR"): The address type (if known). - - **hex** (hex): Raw encoded address. - - **addr** (string, optional): The address in appropriate format for *type*. - - **routes** (array of arrays, optional): Route hints to the *payee*.: - - (array of objects): Hops in the route. - - **pubkey** (pubkey): The public key of the node. - - **short\_channel\_id** (short\_channel\_id): A channel to the next peer. - - **fee\_base\_msat** (msat): The base fee for payments. - - **fee\_proportional\_millionths** (u32): The parts-per-million fee for payments. - - **cltv\_expiry\_delta** (u32): The CLTV delta across this hop. - - **extra** (array of objects, optional): Any extra fields we didn't know how to parse.: - - **tag** (string) (always 1 characters): The bech32 letter which identifies this field. - - **data** (string): The bech32 data for this field. - -If **type** is "rune", and **valid** is *true*: - - **valid** (boolean) (always *true*) - - **string** (string): The string encoding of the rune. - - **restrictions** (array of objects): Restrictions built into the rune: all must pass.: - - **alternatives** (array of strings): Each way restriction can be met: any can pass.: - - (string, optional): The alternative of form fieldname condition fieldname. - - **summary** (string): Human-readable summary of this restriction. - - **unique\_id** (string, optional): Unique id (always a numeric id on runes we create). - - **version** (string, optional): Rune version, not currently set on runes we create. - -If **type** is "rune", and **valid** is *false*: - - **valid** (boolean) (always *false*) - - **hex** (hex, optional): The raw rune in hex. - - the following warnings are possible: - - **warning\_rune\_invalid\_utf8**: The rune contains invalid UTF-8 strings. - -If **type** is "emergency recover", and **valid** is *true*: - - **decrypted** (hex): The decrypted value of the provided bech32 of emergency.recover. *(added v23.11)* - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "type": "rune", - "unique_id": "1", - "string": "ce6d31fde2e01dec5a4ef667dc2cfb81bfd896fae56060e8ff0e0162547d492d:=1&method^list|method^get|method=summary&method/listdatastore", - "restrictions": [ - { - "alternatives": [ - "method^list", - "method^get", - "method=summary" - ], - "summary": "method (of command) starts with 'list' OR method (of command) starts with 'get' OR method (of command) equal to 'summary'" - }, - { - "alternatives": [ - "method/listdatastore" - ], - "summary": "method (of command) unequal to 'listdatastore'" - } - ], - "valid": true -} -{ - "type": "bolt11 invoice", - "currency": "bcrt", - "created_at": 1708631383, - "expiry": 604800, - "payee": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "amount_msat": 100000000, - "description": "description", - "min_final_cltv_expiry": 5, - "payment_secret": "312106b1b0e2aaddef301af463d5c91eebb86213103d7faa1c167857b89a4522", - "features": "02024100", - "routes": [ - [ - { - "pubkey": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "short_channel_id": "103x1x0", - "fee_base_msat": 1000, - "fee_proportional_millionths": 1000, - "cltv_expiry_delta": 6 - } - ] - ], - "payment_hash": "1109c8f66e4c13fd5439765eb47a4a3efa1539d3bb3bddd26bf3c7f71bafc650", - "signature": "3045022100f72a929795b643d46f2af2e988a1bff605f9cbaef58c32191b3f9ca93d528a0b022051a983e5ae1465b7c36d86e70af6fd21fd5f6607ae5e236b0bf4044f661e2c27", - "valid": true -} -``` - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-pay(7), lightning-offer(7), lightning-fetchinvoice(7), lightning-sendinvoice(7), lightning-commando-rune(7) - -RESOURCES ---------- - -[BOLT #11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md) - -[BOLT #12](https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md) -(experimental, [bolt](https://github.com/lightning/bolts) #798) - -Main web site: diff --git a/doc/lightning-decodepay.7.md b/doc/lightning-decodepay.7.md deleted file mode 100644 index 31a5171419d4..000000000000 --- a/doc/lightning-decodepay.7.md +++ /dev/null @@ -1,104 +0,0 @@ -lightning-decodepay -- Command for decoding a bolt11 string (low-level) -======================================================================= - -SYNOPSIS --------- - -**decodepay** *bolt11* [*description*] - -DESCRIPTION ------------ - -Command *added* in v23.05. - -The **decodepay** RPC command checks and parses a *bolt11* string as specified by the BOLT 11 specification. - -- **bolt11** (string): Bolt11 invoice to decode. -- **description** (string, optional): Description of the invoice to decode. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:decodepay#1", - "method": "decodepay", - "params": { - "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk", - "description": null - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **currency** (string): The BIP173 name for the currency. -- **created\_at** (u64): The UNIX-style timestamp of the invoice. -- **expiry** (u64): The number of seconds this is valid after *timestamp*. -- **payee** (pubkey): The public key of the recipient. -- **payment\_hash** (hash): The hash of the *payment\_preimage*. -- **signature** (signature): Signature of the *payee* on this invoice. -- **min\_final\_cltv\_expiry** (u32): The minimum CLTV delay for the final node. -- **amount\_msat** (msat, optional): Amount the invoice asked for. -- **description** (string, optional): The description of the purpose of the purchase. -- **description\_hash** (hash, optional): The hash of the description, in place of *description*. -- **payment\_secret** (hash, optional): The secret to hand to the payee node. -- **features** (hex, optional): The features bitmap for this invoice. -- **payment\_metadata** (hex, optional): The payment\_metadata to put in the payment. -- **fallbacks** (array of objects, optional): Onchain addresses.: - - **type** (string) (one of "P2PKH", "P2SH", "P2WPKH", "P2WSH", "P2TR"): The address type (if known). - - **hex** (hex): Raw encoded address. - - **addr** (string, optional): The address in appropriate format for *type*. -- **routes** (array of arrays, optional): Route hints to the *payee*.: - - (array of objects): Hops in the route. - - **pubkey** (pubkey): The public key of the node. - - **short\_channel\_id** (short\_channel\_id): A channel to the next peer. - - **fee\_base\_msat** (msat): The base fee for payments. - - **fee\_proportional\_millionths** (u32): The parts-per-million fee for payments. - - **cltv\_expiry\_delta** (u32): The CLTV delta across this hop. -- **extra** (array of objects, optional): Any extra fields we didn't know how to parse.: - - **tag** (string) (always 1 characters): The bech32 letter which identifies this field. - - **data** (string): The bech32 data for this field. - -Technically, the *description* field is optional if a *description\_hash* field is given, but in this case **decodepay** will only succeed if the optional *description* field is passed and matches the *description\_hash*. In practice, these are currently unused. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "currency": "bcrt", - "created_at": 1706152930, - "expiry": 604800, - "payee": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "amount_msat": 11000000, - "description": [ - "XEoCR94SIz6UIRUEkxum." - ], - "min_final_cltv_expiry": 5, - "payment_secret": "82644944d3f70d42aad1d5f7b5d7a629e7afa30b529cc952a4c59fc0e3790ea2", - "features": "02024100", - "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", - "signature": "3045022100e3b7d8886eae1a7c9e55e1797aa0dcb77b8c5a19d56c657cad030e360c90682802203a35713acb098245e53a37faeac98754a29a7078db5ed6f2166f917e55b94484" -} -``` - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-pay(7), lightning-getroute(7), lightning-sendpay(7) - -RESOURCES ---------- - -[BOLT #11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md) - -Main web site: diff --git a/doc/lightning-deldatastore.7.md b/doc/lightning-deldatastore.7.md deleted file mode 100644 index c6b8c5f78f5c..000000000000 --- a/doc/lightning-deldatastore.7.md +++ /dev/null @@ -1,101 +0,0 @@ -lightning-deldatastore -- Command for removing (plugin) data -============================================================ - -SYNOPSIS --------- - -**deldatastore** *key* [*generation*] - -DESCRIPTION ------------ - -The **deldatastore** RPC command allows plugins to delete data it has stored in the Core Lightning database. - -The command fails if the *key* isn't present, or if *generation* is specified and the generation of the data does not exactly match. - -- **key** (one of): - - (array of strings): Key is an array of values (though a single value is treated as a one-element array), to form a heirarchy. Using the first element of the key as the plugin name (e.g. [ 'summary' ]) is recommended. A key can either have children or a value, never both: parents are created and removed automatically. - - (string, optional) - - (string) -- **generation** (u64, optional): If specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with mode `must-replace` or `must-append`. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:deldatastore#1", - "method": "deldatastore", - "params": { - "key": "otherkey", - "generation": 1 - } -} -{ - "id": "example:deldatastore#2", - "method": "deldatastore", - "params": { - "key": [ - "a" - ], - "generation": null - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **key** (array of strings): - - (string, optional): Part of the key added to the datastore. -- **generation** (u64, optional): The number of times this has been updated. -- **hex** (hex, optional): The hex data which has removed from the datastore. -- **string** (string, optional): The data as a string, if it's valid utf-8. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "key": [ - "otherkey" - ], - "generation": 1, - "hex": "6f746865726461746161", - "string": "otherdataa" -} -{ - "key": [ - "a" - ], - "generation": 0, - "hex": "6176616c", - "string": "aval" -} -``` - -ERRORS ------- - -The following error codes may occur: - -- 1200: the key does not exist -- 1201: the key does exist, but the generation is wrong -- -32602: invalid parameters - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-listdatastore(7), lightning-datastore(7), lightning-datastoreusage(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-delexpiredinvoice.7.md b/doc/lightning-delexpiredinvoice.7.md deleted file mode 100644 index c0b5083e950f..000000000000 --- a/doc/lightning-delexpiredinvoice.7.md +++ /dev/null @@ -1,54 +0,0 @@ -lightning-delexpiredinvoice -- Command for removing expired invoices -==================================================================== - -SYNOPSIS --------- - -**delexpiredinvoice** [*maxexpirytime*] - -DESCRIPTION ------------ - -The **delexpiredinvoice** RPC command removes all invoices that have expired on or before the given *maxexpirytime*. - -- **maxexpirytime** (u64, optional): Invoice expiry time in seconds. If not specified then all expired invoices are deleted. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:delexpiredinvoice#1", - "method": "delexpiredinvoice", - "params": { - "maxexpirytime": null - } -} -``` - -RETURN VALUE ------------- - -On success, an empty object is returned. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{} -``` - -AUTHOR ------- - -ZmnSCPxj <> is mainly responsible. - -SEE ALSO --------- - -lightning-delinvoice(7), lightning-autoclean-status(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-delforward.7.md b/doc/lightning-delforward.7.md deleted file mode 100644 index 4377a26878ed..000000000000 --- a/doc/lightning-delforward.7.md +++ /dev/null @@ -1,77 +0,0 @@ -lightning-delforward -- Command for removing a forwarding entry -=============================================================== - -SYNOPSIS --------- - -**delforward** *in\_channel* *in\_htlc\_id* *status* - -DESCRIPTION ------------ - -The **delforward** RPC command removes a single forward from **listforwards**, using the uniquely-identifying *in\_channel* and *in\_htlc\_id* (and, as a sanity check, the *status*) given by that command. - -This command is mainly used by the *autoclean* plugin (see lightningd- config(7)), As these database entries are only kept for your own analysis, removing them has no effect on the running of your node. - -- **in\_channel** (short\_channel\_id): Only the matching forwards on the given inbound channel are deleted. Note: for **listforwards** entries without an *in\_htlc\_id* entry (no longer created in v22.11, but can exist from older versions), a value of 18446744073709551615 can be used, but then it will delete *all* entries without *in\_htlc\_id* for this *in\_channel* and *status*. -- **in\_htlc\_id** (u64): The unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11). -- **status** (string) (one of "settled", "local\_failed", "failed"): The status of the forward to delete. You cannot delete forwards which have status *offered* (i.e. are currently active). - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:delforward#1", - "method": "delforward", - "params": { - "in_channel": "103x1x0", - "in_htlc_id": 2, - "status": "local_failed" - } -} -{ - "id": "example:delforward#2", - "method": "delforward", - "params": [ - "103x1x0", - 1, - "failed" - ] -} -``` - -RETURN VALUE ------------- - -On success, an empty object is returned. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{} -{} -``` - -ERRORS ------- - -The following errors may be reported: - -- 1401: The forward specified does not exist. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-autoclean(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-delinvoice.7.md b/doc/lightning-delinvoice.7.md deleted file mode 100644 index 953fdd7d4d39..000000000000 --- a/doc/lightning-delinvoice.7.md +++ /dev/null @@ -1,123 +0,0 @@ -lightning-delinvoice -- Command for removing an invoice (or just its description) -================================================================================= - -SYNOPSIS --------- - -**delinvoice** *label* *status* [*desconly*] - -DESCRIPTION ------------ - -The **delinvoice** RPC command removes an invoice with *status* as given in **listinvoices**, or with *desconly* set, removes its description. - -- **label** (one of): Label of the invoice to be deleted.: - - (string) - - (u64) -- **status** (string) (one of "paid", "expired", "unpaid"): Label of the invoice to be deleted. The caller should be particularly aware of the error case caused by the *status* changing just before this command is invoked! -- **desconly** (boolean, optional): If set to True, the invoice is not deleted, but has its description removed (this can save space with very large descriptions, as would be used with lightning-invoice(7) *deschashonly*. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:delinvoice#1", - "method": "delinvoice", - "params": { - "label": "invlabel2", - "status": "unpaid", - "desconly": true - } -} -{ - "id": "example:delinvoice#2", - "method": "delinvoice", - "params": { - "label": "keysend-1708640419.666098582", - "status": "paid", - "desconly": null - } -} -``` - -RETURN VALUE ------------- - -Note: The return is the same as an object from lightning-listinvoice(7). -On success, an object is returned, containing: - -- **label** (string): Unique label given at creation time. -- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. -- **created\_index** (u64): 1-based index indicating order this invoice was created in. *(added v23.08)* -- **status** (string) (one of "paid", "expired", "unpaid"): State of invoice. -- **expires\_at** (u64): UNIX timestamp when invoice expires (or expired). -- **bolt11** (string, optional): BOLT11 string. -- **bolt12** (string, optional): BOLT12 string. -- **amount\_msat** (msat, optional): The amount required to pay this invoice. -- **description** (string, optional): Description used in the invoice. -- **updated\_index** (u64, optional): 1-based index indicating order this invoice was changed (only present if it has changed since creation). *(added v23.08)* - -If **bolt12** is present: - - **local\_offer\_id** (hex, optional): Offer for which this invoice was created. - - **invreq\_payer\_note** (string, optional): The optional *invreq\_payer\_note* from invoice\_request which created this invoice. - -If **status** is "paid": - - **pay\_index** (u64): Unique index for this invoice payment. - - **amount\_received\_msat** (msat): How much was actually received. - - **paid\_at** (u64): UNIX timestamp of when payment was received. - - **payment\_preimage** (secret): SHA256 of this is the *payment\_hash* offered in the invoice. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "label": "invlabel2", - "bolt11": "lnbcrt420p1pja0tefsp5vvzg40t4g24l0eqk0jch7mc6jm3ec52ts8w8gwzpwtx9c8nv05rspp533e9csxurt7j9sn2cx7hsn6m00475qgrau8sux5r7djpdedwy2fshp5xqsmrtgfcwsnhxcxmf3tuc65kl6fxvqhvujfmxw2kpeh95yy2x8sxqyjw5qcqp99qxpqysgqgfjrz4q5zcq2lluxxg9h475mq2d3w0tpdstm5274zmhadjl8cqapylfskzk96apka5599a2flm90rmavsk7q8mhh87yle3sgh5vrlycq72fern", - "payment_hash": "8c725c40dc1afd22c26ac1bd784f5b7bebea0103ef0f0e1a83f36416e5ae2293", - "amount_msat": 42, - "status": "unpaid", - "expires_at": 1709238697, - "created_index": 3 -} -{ - "label": "keysend-1708640419.666098582", - "bolt11": "lnbcrt1pja0j9rsp5tg3zvj846gcdzw394njazq40s946sq2ur3hkl4xu4xudtjdtckxspp5fuunrfzsnyz2uxjmg2n95mqhghv4fpvv2kud3kvq4fkys3vmzu5sdqvddjhjum9dejqxqyjw5qcqp99qxpqysgqwt7r0gjlgt7zrfldc3um9myfc36acpqnsdn77c2m42facjtps30yufc5nsmwzhgexlj59f6xa5hess6e3tqrxynt9fejzj3rrshddtcqnappmj", - "payment_hash": "4f3931a4509904ae1a5b42a65a6c1745d954858c55b8d8d980aa6c48459b1729", - "status": "paid", - "pay_index": 1, - "amount_received_msat": 10000000, - "paid_at": 1708640419, - "payment_preimage": "b760af47f456a217e8dfda21a282f1f78c903487c1b21b3b318135f75aa3bf11", - "description": "keysend", - "expires_at": 1709245219, - "created_index": 1, - "updated_index": 1 -} -``` - -ERRORS ------- - -The following errors may be reported: - -- -1: Database error. -- 905: An invoice with that label does not exist. -- 906: The invoice *status* does not match the parameter. An error object will be returned as error *data*, containing *current\_status* and *expected\_status* fields. This is most likely due to the *status* of the invoice changing just before this command is invoked. -- 908: The invoice already has no description, and *desconly* was set. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-listinvoice(7), lightning-waitinvoice(7), lightning-invoice(7), lightning-delexpiredinvoice(7), lightning-autoclean-status(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-delpay.7.md b/doc/lightning-delpay.7.md deleted file mode 100644 index 87c8f8f55eb9..000000000000 --- a/doc/lightning-delpay.7.md +++ /dev/null @@ -1,160 +0,0 @@ -lightning-delpay -- Command for removing a completed or failed payment -====================================================================== - -SYNOPSIS --------- - -**delpay** *payment\_hash* *status* [*partid* *groupid*] - -DESCRIPTION ------------ - -The **delpay** RPC command deletes a payment with the given `payment_hash` if its status is either `complete` or `failed`. If *partid* and *groupid* are not specified, all payment parts with matchin status are deleted. - -- **payment\_hash** (hash): The unique identifier of a payment. -- **status** (string) (one of "complete", "failed"): Expected status of the payment. Only deletes if the payment status matches. Deleting a `pending` payment will return an error. -- **partid** (u64, optional): Specific partid to delete (must be paired with *groupid*). -- **groupid** (u64, optional): Specific groupid to delete (must be paired with *partid*). - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:delpay#1", - "method": "delpay", - "params": { - "payment_hash": "4fa2f1b001067ec06d7f95b8695b8acd9ef04c1b4d1110e3b94e1fa0687bb1e0", - "status": "complete" - } -} -{ - "id": "example:delpay#2", - "method": "delpay", - "params": [ - "c9d4547473d0d646f1fdd8ca7f01803e4d31ceab01df33c79456f9c24b04034e", - "failed" - ] -} -{ - "id": "example:delpay#3", - "method": "delpay", - "params": { - "payment_hash": "bbc35e0a46d1483292a4ff8d4daaceaab8c3c084dd835be4128785b52e469c64", - "status": "complete", - "groupid": 1, - "partid": 1 - } -} -``` - -RETURN VALUE ------------- - -The returned format is the same as lightning-listsendpays(7). If the payment is a multi-part payment (MPP) the command return a list of payments will be returned -- one payment object for each partid. -On success, an object containing **payments** is returned. It is an array of objects, where each object contains: - -- **created\_index** (u64): 1-based index indicating order this payment was created in. *(added v23.11)* -- **id** (u64): Old synonym for created\_index. -- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. -- **status** (string) (one of "pending", "failed", "complete"): Status of the payment. -- **amount\_sent\_msat** (msat): The amount we actually sent, including fees. -- **created\_at** (u64): The UNIX timestamp showing when this payment was initiated. -- **partid** (u64, optional): Unique ID within this (multi-part) payment. -- **destination** (pubkey, optional): The final destination of the payment if known. -- **amount\_msat** (msat, optional): The amount the destination received, if known. -- **updated\_index** (u64, optional): 1-based index indicating order this payment was changed (only present if it has changed since creation). *(added v23.11)* -- **completed\_at** (u64, optional): The UNIX timestamp showing when this payment was completed. -- **groupid** (u64, optional): Grouping key to disambiguate multiple attempts to pay an invoice or the same payment\_hash. -- **payment\_preimage** (secret, optional): Proof of payment. -- **label** (string, optional): The label, if given to sendpay. -- **bolt11** (string, optional): The bolt11 string (if pay supplied one). -- **bolt12** (string, optional): The bolt12 string (if supplied for pay: **experimental-offers** only). -- **erroronion** (hex, optional): The error onion returned on failure, if any. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "payments": [ - { - "id": 1, - "payment_hash": "8dfd6538eeb33811c9114a75f792a143728d7f05643f38c3d574d3097e8910c0", - "destination": "0219f8900ee78a89f050c24d8b69492954f9fdbabed753710845eb75d3a75a5880", - "msatoshi": 1000, - "amount_msat": "1000msat", - "msatoshi_sent": 1000, - "amount_sent_msat": "1000msat", - "created_at": 1596224858, - "status": "complete", - "payment_preimage": "35bd4e2b481a1a84a22215b5372672cf81460a671816960ddb206464359e1822", - "bolt11": "lntb10n1p0jga20pp53h7k2w8wkvuprjg3ff6l0y4pgdeg6lc9vsln3s74wnfsjl5fzrqqdqdw3jhxazldahx2xqyjw5qcqp2sp5wut5jnhr6n7jd5747ky2g5flmw7hgx9yjnqzu60ps2jf6f7tc0us9qy9qsqu2a0k37nckl62005p69xavlkydkvhnypk4dphffy4x09zltwh9437ad7xkl83tefdarzhu5t30ju5s56wlrg97qkx404pq3srfc425cq3ke9af" - } - ] -} -{ - "payments": [ - { - "created_index": 2, - "id": 2, - "payment_hash": "c9d4547473d0d646f1fdd8ca7f01803e4d31ceab01df33c79456f9c24b04034e", - "groupid": 1, - "updated_index": 2, - "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "amount_msat": 100000, - "amount_sent_msat": 100002, - "created_at": 1706316468, - "completed_at": 1706316471, - "status": "failed", - "bolt11": "lnbcrt1u1pjmg54nsp5ke626txv6wwwmqmpuy63t3jnu9hqxwj880zsfkkj7jjqagdaz2sqpp5e829garn6rtydu0amr987qvq8exnrn4tq80n83u52muuyjcyqd8qdq8v3jhxccxqyjw5qcqp99qxpqysgqalktfwy9svsamvvvrzzzzpdaa4rh7n6s5p7t9lx7qv0raz4vnm9knkh5ury3u5cmnhx2gms98nxkclm3833uhjrlnzmftc685vz2f0gpfnjy4y" - } - ] -} -{ - "payments": [ - { - "created_index": 3, - "id": 3, - "payment_hash": "bbc35e0a46d1483292a4ff8d4daaceaab8c3c084dd835be4128785b52e469c64", - "groupid": 1, - "updated_index": 3, - "partid": 1, - "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "amount_msat": 100000, - "amount_sent_msat": 102100, - "created_at": 1708641193, - "completed_at": 1708641194, - "status": "complete", - "payment_preimage": "a6ebb1cfbf69e76200f196f1eafd28a3d850633499c223a7eb7a7dba3b995286" - } - ] -} -``` - -ERRORS ------- - -On failure, an error is returned. If the lightning process fails before responding, the -caller should use lightning-listsentpays(7) or lightning-listpays(7) to query whether this payment was deleted or not. - -The following error codes may occur: - -- -32602: Parameter missed or malformed; -- 211: Payment status mismatch. Check the correct status via **paystatus**; -- 208: Payment with payment\_hash not found. - -AUTHOR ------- - -Vincenzo Palazzo <> is mainly responsible. - -SEE ALSO --------- - -lightning-listpays(7), lightning-listsendpays(7), lightning-paystatus(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-deprecations.7.md b/doc/lightning-deprecations.7.md deleted file mode 100644 index 9b55e86f422b..000000000000 --- a/doc/lightning-deprecations.7.md +++ /dev/null @@ -1,63 +0,0 @@ -lightning-deprecations -- Command to enable/disable deprecated APIs -=================================================================== - -SYNOPSIS --------- - -**deprecations** *enable* - -DESCRIPTION ------------ - -Command *added* in v24.02. - -The **deprecations** RPC command is used to override global config option `allow-deprecated-apis` for further RPC commands on this same connection. This can be useful for developer testing to ensure you don't accidentally rely on deprecated features. - -- **enable** (boolean): Flag to enable or disable deprecated APIs. Setting it to `false` will neither accept deprecated parameters or commands, nor output deprecated fields. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:deprecations#1", - "method": "deprecations", - "params": { - "enable": false - } -} -``` - -RETURN VALUE ------------- - -On success, an empty object is returned. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{} -``` - -ERRORS ------- - -On failure, one of the following error codes may be returned: - -- -32602: Error in given parameters. - -AUTHOR ------- - -Rusty Russell <> wrote the initial version of this man page. - -SEE ALSO --------- - -lightningd-config(5), lightning-notifications(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-disableinvoicerequest.7.md b/doc/lightning-disableinvoicerequest.7.md deleted file mode 100644 index 8d3f598f46ae..000000000000 --- a/doc/lightning-disableinvoicerequest.7.md +++ /dev/null @@ -1,48 +0,0 @@ -lightning-disableinvoicerequest -- Command for removing an invoice request -========================================================================== - -SYNOPSIS --------- - -**(WARNING: experimental-offers only)** - -**disableinvoicerequest** *invreq\_id* - -DESCRIPTION ------------ - -Command *added* in v22.11. - -The **disableinvoicerequest** RPC command disables an invoice\_request, so that no further invoices will be accepted (and thus, no further payments made).. - -We currently don't support deletion of invoice\_requests, so they are not forgotten entirely (there may be payments which refer to this invoice\_request). - -- **invreq\_id** (string): A specific invoice can be disabled by providing the `invreq_id`, which is presented by lightning-invoicerequest(7). - -RETURN VALUE ------------- - -Note: the returned object is the same format as **listinvoicerequest**. -On success, an object is returned, containing: - -- **invreq\_id** (hash): The SHA256 hash of all invoice\_request fields less than 160. -- **active** (boolean) (always *false*): Whether the invoice\_request is currently active. -- **single\_use** (boolean): Whether the invoice\_request will become inactive after we pay an invoice for it. -- **bolt12** (string): The bolt12 string starting with lnr. -- **used** (boolean): Whether the invoice\_request has already been used. -- **label** (string, optional): The label provided when creating the invoice\_request. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-invoicerequest(7), lightning-listinvoicerequest(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-disableoffer.7.md b/doc/lightning-disableoffer.7.md deleted file mode 100644 index d77e723f500d..000000000000 --- a/doc/lightning-disableoffer.7.md +++ /dev/null @@ -1,72 +0,0 @@ -lightning-disableoffer -- Command for removing an offer -======================================================= - -SYNOPSIS --------- - -**(WARNING: experimental-offers only)** - -**disableoffer** *offer\_id* - -DESCRIPTION ------------ - -The **disableoffer** RPC command disables an offer, so that no further invoices will be given out. - -We currently don't support deletion of offers, so offers are not forgotten entirely (there may be invoices which refer to this offer). - -- **offer\_id** (hash): The id we use to identify this offer. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:disableoffer#1", - "method": "disableoffer", - "params": { - "offer_id": "713a16ccd4eb10438bdcfbc2c8276be301020dd9d489c530773ba64f3b33307d" - } -} -``` - -RETURN VALUE ------------- - -Note: the returned object is the same format as **listoffers**. -On success, an object is returned, containing: - -- **offer\_id** (hash): The merkle hash of the offer. -- **active** (boolean) (always *false*): Whether the offer can produce invoices/payments. -- **single\_use** (boolean): Whether the offer is disabled after first successful use. -- **bolt12** (string): The bolt12 string representing this offer. -- **used** (boolean): Whether the offer has had an invoice paid / payment made. -- **label** (string, optional): The label provided when offer was created. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "offer_id": "053a5c566fbea2681a5ff9c05a913da23e45b95d09ef5bd25d7d408f23da7084", - "active": false, - "single_use": false, - "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqvqcdgq2z9pk7enxv4jjqen0wgs8yatnw3ujz83qkc6rvp4j28rt3dtrn32zkvdy7efhnlrpr5rp5geqxs783wtlj550qs8czzku4nk3pqp6m593qxgunzuqcwkmgqkmp6ty0wyvjcqdguv3pnpukedwn6cr87m89t74h3auyaeg89xkvgzpac70z3m9rn5xzu28c", - "used": false -} -``` - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-offer(7), lightning-listoffers(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-disconnect.7.md b/doc/lightning-disconnect.7.md deleted file mode 100644 index 4ca0407410e5..000000000000 --- a/doc/lightning-disconnect.7.md +++ /dev/null @@ -1,83 +0,0 @@ -lightning-disconnect -- Command for disconnecting from another lightning node -============================================================================= - -SYNOPSIS --------- - -**disconnect** *id* [*force*] - -DESCRIPTION ------------ - -The disconnect RPC command closes an existing connection to a peer, identified by *id*, in the Lightning Network, as long as it doesn't have an active channel. - -- **id** (pubkey): The public key of the peer to terminate the connection. It can be discovered in the output of the listpeers command, which returns a set of peers: - { - 'peers': - [ - { - 'id': '0563aea81...', - 'connected': true, - ... - } - ] - } -- **force** (boolean, optional): If set to True, it will disconnect even with an active channel. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:disconnect#1", - "method": "disconnect", - "params": { - "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "force": false - } -} -{ - "id": "example:disconnect#2", - "method": "disconnect", - "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "force": true - } -} -``` - -RETURN VALUE ------------- - -On success, an empty object is returned. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{} -{} -``` - -ERRORS ------- - -On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -- -32602: If the given parameters are wrong. -- -1: Catchall nonspecific error. - -AUTHOR ------- - -Michael Hawkins <>. - -SEE ALSO --------- - -lightning-connect(1), lightning-listpeers(1) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-emergencyrecover.7.md b/doc/lightning-emergencyrecover.7.md deleted file mode 100644 index 285c09e003da..000000000000 --- a/doc/lightning-emergencyrecover.7.md +++ /dev/null @@ -1,67 +0,0 @@ -lightning-emergencyrecover -- Command for recovering channels from the emergency.recovery file in the lightning directory -========================================================================================================================= - -SYNOPSIS --------- - -**emergencyrecover** - -DESCRIPTION ------------ - -The **emergencyrecover** RPC command fetches data from the emergency.recover file and tries to reconnect to the peer and force him to close the channel. The data in this file has enough information to reconnect and sweep the funds. - -This recovery method is not spontaneous and it depends on the peer, so it should be used as a last resort to recover the funds stored in a channel in case of severe data loss. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:emergencyrecover#1", - "method": "emergencyrecover", - "params": "{}" -} -{ - "id": "example:emergencyrecover#2", - "method": "emergencyrecover", - "params": "{}" -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **stubs** (array of hashs): - - (hash, optional): Channel IDs of channels successfully inserted. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "stubs": [] -} -{ - "stubs": [ - "c00734472f344fdadd0bf787de182e5cf144ccda5d731b0f7c75befd1f1eff52" - ] -} -``` - -AUTHOR ------- - -Aditya <> is mainly responsible. - -SEE ALSO --------- - -lightning-getsharedsecret(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-feerates.7.md b/doc/lightning-feerates.7.md deleted file mode 100644 index 774fe1abc879..000000000000 --- a/doc/lightning-feerates.7.md +++ /dev/null @@ -1,229 +0,0 @@ -lightning-feerates -- Command for querying recommended onchain feerates -======================================================================= - -SYNOPSIS --------- - -**feerates** *style* - -DESCRIPTION ------------ - -The **feerates** command returns the feerates that CLN will use. The feerates will be based on the recommended feerates from the backend. The backend may fail to provide estimates, but if it was able to provide estimates in the past, CLN will continue to use those for a while. CLN will also smoothen feerate estimations from the backend. - -Explorers often present fees in "sat/vB": 4 sat/vB is `4000perkb` or `1000perkw`. - -Bitcoin transactions have non-witness and witness bytes: - -* Non-witness bytes count as 4 weight, 1 virtual byte. All bytes other than SegWit witness count as non-witness bytes. * Witness bytes count as 1 weight, 0.25 virtual bytes. - -Thus, all *perkb* feerates will be exactly 4 times *perkw* feerates. - -To compute the fee for a transaction, multiply its weight or virtual bytes by the appropriate *perkw* or *perkw* feerate returned by this command, then divide by 1000. - -There is currently no way to change these feerates from the RPC. If you need custom control over onchain feerates, you will need to provide your own plugin that replaces the `bcli` plugin backend. For commands like lightning-withdraw(7) or lightning-fundchannel(7) you can provide a preferred feerate directly as a parameter, which will override the recommended feerates returned by **feerates**. - -- **style** (string) (one of "perkb", "perkw"): Fee rate style to use. This can be: - *perkw* - provide feerate in units of satoshis per 1000 weight (e.g. the minimum fee is usually `253perkw`). - *perkb* - provide feerate in units of satoshis per 1000 virtual bytes (eg. the minimum fee is usually `1000perkb`). - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:feerates#1", - "method": "feerates", - "params": { - "style": "perkw", - "urgent": null, - "normal": null, - "slow": null - } -} -{ - "id": "example:feerates#2", - "method": "feerates", - "params": { - "style": "perkb", - "urgent": null, - "normal": null, - "slow": null - } -} -``` - -NOTES ------ - -Many other commands have a *feerate* parameter. This can be: - -* One of the strings to use lightningd's internal estimates: - * *urgent* (next 6 blocks or so) - * *normal* (next 12 blocks or so) - * *slow* (next 100 blocks or so) - * *minimum* for the lowest value bitcoind will currently accept (added in v23.05) - -* A number, with an optional suffix: - * *blocks* means aim for confirmation in that many blocks (added in v23.05) - * *perkw* means the number is interpreted as satoshi-per-kilosipa (weight) - * *perkb* means it is interpreted bitcoind-style as satoshi-per-kilobyte. - -Omitting the suffix is equivalent to *perkb*. - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **perkb** (object, optional): If *style* parameter was perkb.: - - **min\_acceptable** (u32): The smallest feerate that we allow peers to specify: half the 100-block estimate. - - **max\_acceptable** (u32): The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet). - - **floor** (u32): The smallest feerate that our backend tells us it will accept (i.e. minrelayfee or mempoolminfee). *(added v23.05)* - - **estimates** (array of objects): Feerate estimates from plugin which we are using (usuallly bcli). *(added v23.05)*: - - **blockcount** (u32): The number of blocks the feerate is expected to get a transaction in. *(added v23.05)* - - **feerate** (u32): The feerate for this estimate, in given *style*. *(added v23.05)* - - **smoothed\_feerate** (u32): The feerate, smoothed over time (useful for coordinating with other nodes). *(added v23.05)* - - **opening** (u32, optional): Default feerate for lightning-fundchannel(7) and lightning-withdraw(7). - - **mutual\_close** (u32, optional): Feerate to aim for in cooperative shutdown. Note that since mutual close is a **negotiation**, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer. - - **unilateral\_close** (u32, optional): Feerate for commitment\_transaction in a live channel which we originally funded. - - **unilateral\_anchor\_close** (u32, optional): Feerate for commitment\_transaction in a live channel which we originally funded (if anchor\_outputs was negotiated). *(added v23.08)* - - **delayed\_to\_us** (u32, optional): Feerate for returning unilateral close funds to our wallet. **deprecated in v23.05, removed after v24.05** - - **htlc\_resolution** (u32, optional): Feerate for returning unilateral close HTLC outputs to our wallet. **deprecated in v23.05, removed after v24.05** - - **penalty** (u32, optional): Feerate to use when creating penalty tx for watchtowers. -- **perkw** (object, optional): If *style* parameter was perkw.: - - **min\_acceptable** (u32): The smallest feerate that you can use, usually the minimum relayed feerate of the backend. - - **max\_acceptable** (u32): The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet). - - **floor** (u32): The smallest feerate that our backend tells us it will accept (i.e. minrelayfee or mempoolminfee). *(added v23.05)* - - **estimates** (array of objects): Feerate estimates from plugin which we are using (usuallly bcli). *(added v23.05)*: - - **blockcount** (u32): The number of blocks the feerate is expected to get a transaction in. *(added v23.05)* - - **feerate** (u32): The feerate for this estimate, in given *style*. *(added v23.05)* - - **smoothed\_feerate** (u32): The feerate, smoothed over time (useful for coordinating with other nodes). *(added v23.05)* - - **opening** (u32, optional): Default feerate for lightning-fundchannel(7) and lightning-withdraw(7). - - **mutual\_close** (u32, optional): Feerate to aim for in cooperative shutdown. Note that since mutual close is a **negotiation**, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer. - - **unilateral\_close** (u32, optional): Feerate for commitment\_transaction in a live channel which we originally funded (if anchor\_outputs was not negotiated). - - **unilateral\_anchor\_close** (u32, optional): Feerate for commitment\_transaction in a live channel which we originally funded (if anchor\_outputs was negotiated). *(added v23.08)* - - **delayed\_to\_us** (u32, optional): Feerate for returning unilateral close funds to our wallet. **deprecated in v23.05, removed after v24.05** - - **htlc\_resolution** (u32, optional): Feerate for returning unilateral close HTLC outputs to our wallet. **deprecated in v23.05, removed after v24.05** - - **penalty** (u32, optional): Feerate to use when creating penalty tx for watchtowers. -- **onchain\_fee\_estimates** (object, optional): - - **opening\_channel\_satoshis** (u64): Estimated cost of typical channel open. - - **mutual\_close\_satoshis** (u64): Estimated cost of typical channel close. - - **unilateral\_close\_satoshis** (u64): Estimated cost of typical unilateral close (without HTLCs). If anchors are supported, this assumes a channel with anchors. - - **htlc\_timeout\_satoshis** (u64): Estimated cost of typical HTLC timeout transaction (non-anchors). - - **htlc\_success\_satoshis** (u64): Estimated cost of typical HTLC fulfillment transaction (non-anchors). - - **unilateral\_close\_nonanchor\_satoshis** (u64, optional): Estimated cost of non-anchor typical unilateral close (without HTLCs). *(added v23.08)* - -The following warnings may also be returned: - -- **warning\_missing\_feerates**: Some fee estimates are missing. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "perkw": { - "opening": 1000000, - "mutual_close": 26362, - "unilateral_close": 26362, - "unilateral_anchor_close": 1000000, - "penalty": 26362, - "min_acceptable": 3750, - "max_acceptable": 10000000, - "floor": 253, - "estimates": [ - { - "blockcount": 2, - "feerate": 1000000, - "smoothed_feerate": 26362 - }, - { - "blockcount": 6, - "feerate": 1000000, - "smoothed_feerate": 26362 - }, - { - "blockcount": 12, - "feerate": 1000000, - "smoothed_feerate": 26362 - }, - { - "blockcount": 100, - "feerate": 1000000, - "smoothed_feerate": 26362 - } - ] - }, - "onchain_fee_estimates": { - "opening_channel_satoshis": 702000, - "mutual_close_satoshis": 17741, - "unilateral_close_satoshis": 1112000, - "unilateral_close_nonanchor_satoshis": 15764, - "htlc_timeout_satoshis": 17478, - "htlc_success_satoshis": 18532 - } -} -{ - "perkb": { - "opening": 25000, - "mutual_close": 25000, - "unilateral_close": 44000, - "unilateral_anchor_close": 25000, - "penalty": 25000, - "min_acceptable": 12500, - "max_acceptable": 600000, - "floor": 1012, - "estimates": [ - { - "blockcount": 2, - "feerate": 60000, - "smoothed_feerate": 60000 - }, - { - "blockcount": 6, - "feerate": 44000, - "smoothed_feerate": 44000 - }, - { - "blockcount": 12, - "feerate": 25000, - "smoothed_feerate": 25000 - } - ] - }, - "onchain_fee_estimates": { - "opening_channel_satoshis": 4387, - "mutual_close_satoshis": 4206, - "unilateral_close_satoshis": 6578, - "unilateral_close_nonanchor_satoshis": 6578, - "htlc_timeout_satoshis": 7293, - "htlc_success_satoshis": 7733 - } -} -``` - -ERRORS ------- - -The **feerates** command will never error, however some fields may be missing in the result if feerate estimates for that kind of transaction are unavailable. - -TRIVIA ------- - -In C-lightning we like to call the weight unit "sipa" in honor of Pieter Wuille, who uses the name "sipa" on IRC and elsewhere. Internally we call the *perkw* style as "feerate per kilosipa". - -AUTHOR ------- - -ZmnSCPxj <> wrote the initial version of this manpage. - -SEE ALSO --------- - -lightning-parsefeerate(7), lightning-fundchannel(7), lightning-withdraw(7), lightning-txprepare(7), lightning-fundchannel\_start(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-fetchinvoice.7.md b/doc/lightning-fetchinvoice.7.md deleted file mode 100644 index ccd253c48c14..000000000000 --- a/doc/lightning-fetchinvoice.7.md +++ /dev/null @@ -1,118 +0,0 @@ -lightning-fetchinvoice -- Command for fetch an invoice for an offer -=================================================================== - -SYNOPSIS --------- - -**(WARNING: experimental-offers only)** - -**fetchinvoice** *offer* [*amount\_msat*] [*quantity*] [*recurrence\_counter*] [*recurrence\_start*] [*recurrence\_label*] [*timeout*] [*payer\_note*] - -DESCRIPTION ------------ - -The **fetchinvoice** RPC command contacts the issuer of an *offer* to get an actual invoice that can be paid. It highlights any changes between the offer and the returned invoice. - -If **fetchinvoice-noconnect** is not specified in the configuation, it will connect to the destination in the (currently common!) case where it cannot find a route which supports `option_onion_messages`. - -- **offer** (string): Offer string to get an actual invoice that can be paid. -- **amount\_msat** (msat, optional): Required if the offer does not specify an amount at all, otherwise it is optional (but presumably if you set it to less than the offer, you will get an error from the issuer). -- **quantity** (u64, optional): Required if the offer specifies quantity\_max, otherwise it is not allowed. -- **recurrence\_counter** (u64, optional): Required if the offer specifies recurrence, otherwise it is not allowed. recurrence\_counter should first be set to 0, and incremented for each successive invoice in a given series. -- **recurrence\_start** (number, optional): Required if the offer specifies recurrence\_base with start\_any\_period set, otherwise it is not allowed. It indicates what period number to start at. -- **recurrence\_label** (string, optional): Required if recurrence\_counter is set, and otherwise is not allowed. It must be the same as prior fetchinvoice calls for the same recurrence, as it is used to link them together. -- **timeout** (number, optional): If we don't get a reply before this we fail (default, 60 seconds). -- **payer\_note** (string, optional): To ask the issuer to include in the fetched invoice. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:fetchinvoice#1", - "method": "fetchinvoice", - "params": { - "offer": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqypq5zmnd9khqmr9yp6x2um5zcssxhftzxfdlwsnfcgw2sy8t5mxa0ytcdfat2nkdwqvpy9nnsa9mzza", - "payer_note": "Thanks for the fish!" - } -} -{ - "id": "example:fetchinvoice#2", - "method": "fetchinvoice", - "params": { - "offer": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqypq5zmnd9khqmr9yp6x2um5zcssxhftzxfdlwsnfcgw2sy8t5mxa0ytcdfat2nkdwqvpy9nnsa9mzza", - "amount_msat": 3 - } -} -{ - "id": "example:fetchinvoice#3", - "method": "fetchinvoice", - "params": { - "offer": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqypq5zmnd9khqmr9yp6x2um5zsqs593pqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4j", - "quantity": 2 - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **invoice** (string): The BOLT12 invoice we fetched. -- **changes** (object): Summary of changes from offer.: - - **description\_appended** (string, optional): Extra characters appended to the *description* field. - - **description** (string, optional): A completely replaced *description* field. - - **vendor\_removed** (string, optional): The *vendor* from the offer, which is missing in the invoice. - - **vendor** (string, optional): A completely replaced *vendor* field. - - **amount\_msat** (msat, optional): The amount, if different from the offer amount multiplied by any *quantity* (or the offer had no amount, or was not in BTC). -- **next\_period** (object, optional): Only for recurring invoices if the next period is under the *recurrence\_limit*.: - - **counter** (u64): The index of the next period to fetchinvoice. - - **starttime** (u64): UNIX timestamp that the next period starts. - - **endtime** (u64): UNIX timestamp that the next period ends. - - **paywindow\_start** (u64): UNIX timestamp of the earliest time that the next invoice can be fetched. - - **paywindow\_end** (u64): UNIX timestamp of the latest time that the next invoice can be fetched. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "invoice": "lni1qqgvcm9h7yakcmw4mzazspu8vfgpwq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqgzpg9hx6tdwpkx2gr5v4ehg93pqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky965pqqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy84sggren772kj8mau5jp86nc6fszx48rv7ep0quszyyls8rlld3sshjr94j9z5dpsku6mnypnx7u3qw35x2grxd9eksgdqnqp462c3jt0m5y6wzrj5pp6axehtez7r20265antsrqfpvuu8fwcshgr0tsv8e6829e8xmv7laz0kwhtlx6vtk8q3d6rtthdhtwvnn6j585szquc2t7us8kguxypzasg8ewkakgx2ny5ugks0f32x67sm9e5fms4asqrylajc2dqh8ag55mv5p5ghy3e2z8zwmllle8uu7jsxv5ke8d6rr5h7kthmz7ya0hxp4nt7elvw7vghcl6fgsuqqqqqqqqqqqqqqq9qqqqqqqqqqqqq8fykt06c5sqqqqqpfqyvhtunn4gyzy0lphn4wn6ctzlsajy46wscjcglf3hxcnvlaxqs3ydkhgaklsc42spq2czzq6a9vge9ha6zd8ppe2qsawnvm4u30p484d2we4cpsyskwwr5hvgthcyqyuen02ejwpa9cjjrttvp223yxsqkrwnlaszkhas84w0ape300ued4p75xu3cqtcg0cslsx9fvh7dhdqx565t6wa0alf6u2hug90j2hs", - "changes": {} -} -{ - "invoice": "lni1qqg0mfchkz0gkmn8zzu5zaxd0qvlzq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqgzpg9hx6tdwpkx2gr5v4ehg93pqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky965pqqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy84yqgrtqss8d4vgzd3286u9rk0zg9qr7a6z2xm6mjnz9pydztcn0j74tjvch0f5zvqxhftzxfdlwsnfcgw2sy8t5mxa0ytcdfat2nkdwqvpy9nnsa9mzzaqth4fzjqxxmsaxvc4v2urs6hsh6k0e564x00g68vuyp5w7yjedzxvqgr8ltzmj0n7ltxr0tz9rafn9zcy9jldjqfuf20w6gjmr7nj04d360sqvkdwprxn22dlp3xay9yq4nhrw2jm0c8t6r7japhdad6leawxyqzkg92tx8gqxp9f2d8j5k2axta0gr7yr9zrsqqqqqqqqqqqqqqq5qqqqqqqqqqqqqayjedltzjqqqqqq9yq3ja0jwj4qswt3kgs9mxq7gck66x60m5rndykpw3a7hf4ntlp9qe2vgwzzrvcwd2qypmqggrt543ryklhgf5uy89gzr46dnwhj9ux5744fmxhqxqjzeecwja3pwlqsxyjcdwur4hl4qf7nsjgg8euvy45lznufh5kydkwz6llsucuhvwp9ezeggaj3k057ge6ftvaffjkwn6j3y7faeuysrx3m2xccphu65sx", - "changes": {} -} -{ - "invoice": "lni1qqgd508mv9rpjg2ec8dr8qcslf2cjq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqgzpg9hx6tdwpkx2gr5v4ehg9qppgtzzq3dygmzpg6e53ll0aavg37gt3rvjg762vufygdqq4xprs0regcat9gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02cqsykppqfkyy6q8ry9pchxtuajh456hhcf7dxx733cx76etuv5ftfmfa2ymhgycqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jq6uhkeymz26zx7zgw4gdmw2vj9xqn4hu2sqxhp0pcgt87pf9chyfvqsywtejxjh603kx7am3zaf6d6xuumw30p8zmcdz7r95nn4lr92exk3qqe2x6xqwpdzh2zwq3vnyra8nfc6d7y6hegpkvc7p2nulj7hvhwl5hjfr23wn60mjftqspn7d4ejhrpsr5m2y8qqqqqqqqqqqqqqqpgqqqqqqqqqqqqp6f9jm7k9yqqqqqq2gpr96l9mt2pqxuyr0gqw92h0xz2y2uy5uxss4ujcac5jehj9ay2sxkapr80t5ha65qgykqssytfzxcs2xkdy0lml0tzy0jzugmyj8kjn8zfzrgq9fsgurc72x82e7pqxhl4u29cjluw5s8fwa9wtvh0qytr7vqk0vtndsz07mrrtmjw629m8mnqkjaf43kt889qeq2f7deu6t853lngpzclapt8nj0g528v9ay", - "changes": {} -} -``` - -ERRORS ------- - -The following error codes may occur: - -- -1: Catchall nonspecific error. -- 1002: Offer has expired. -- 1003: Cannot find a route to the node making the offer. -- 1004: The node making the offer returned an error message. -- 1005: We timed out trying to fetch an invoice. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-sendinvoice(7), lightning-pay(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-fundchannel.7.md b/doc/lightning-fundchannel.7.md deleted file mode 100644 index 79097f2c62e8..000000000000 --- a/doc/lightning-fundchannel.7.md +++ /dev/null @@ -1,166 +0,0 @@ -lightning-fundchannel -- Command for establishing a lightning channel -===================================================================== - -SYNOPSIS --------- - -**fundchannel** *id* *amount* [*feerate*] [*announce*] [*minconf*] [*push\_msat*] [*close\_to*] [*request\_amt*] [*compact\_lease*] [*utxos*] [*mindepth*] [*reserve*] [*channel\_type*] - -DESCRIPTION ------------ - -The **fundchannel** RPC command opens a payment channel with a peer by committing a funding transaction to the blockchain as defined in BOLT #2. - -If not already connected, **fundchannel** will automatically attempt to connect if Core Lightning knows a way to contact the node (either from normal gossip, or from a previous **connect** call). - -This auto-connection can fail if Core Lightning does not know how to contact the target node; see lightning-connect(7). - -Once the transaction is confirmed, normal channel operations may begin. Readiness is indicated by **listpeers** reporting a *state* of `CHANNELD_NORMAL` for the channel. - -- **id** (pubkey): Id is the peer id obtained from connect. -- **amount** (msat\_or\_all): The amount in satoshis taken from the internal wallet to fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency- msat` as change). The string *all* can be used to specify all available funds (or 16777215 satoshi if more is available and large channels were not negotiated with the peer). Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The value cannot be less than the dust limit, currently set to 546, nor more than 16777215 satoshi (unless large channels were negotiated with the peer). -- **feerate** (feerate, optional): Used for the opening transaction and (unless *option\_anchors\_zero\_fee\_htlc\_tx* is negotiated), as initial feerate for commitment and HTLC transactions (see NOTES in lightning-feerates(7)). The default is *normal*. -- **announce** (boolean, optional): Whether to announce this channel or not. An unannounced channel is considered private. The default is True. -- **minconf** (u32, optional): The minimum number of confirmations that used outputs should have. The default is 1. -- **push\_msat** (msat, optional): The amount of millisatoshis to push to the channel peer at open. Note that this is a gift to the peer -- these satoshis are added to the initial balance of the peer at channel start and are largely unrecoverable once pushed. -- **close\_to** (string, optional): A Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. Returns `close_to` set to closing script iff is negotiated. -- **request\_amt** (msat, optional): An amount of liquidity you'd like to lease from the peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact\_lease*. -- **compact\_lease** (string, optional): A compact representation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel. -- **utxos** (array of outpoints, optional): The utxos to be used to fund the channel, as an array of `txid:vout`.: - - (outpoint, optional) -- **mindepth** (u32, optional): Number of confirmations required before we consider the channel active. -- **reserve** (msat, optional): The amount we want the peer to maintain on its side of the channel. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The default is 1% of the funding amount. -- **channel\_type** (array of u32s, optional) *(added v24.02)*: - - (u32, optional): Represents the explicit channel type to request. There is currently no sanity checking on this value so if you use strange values and your channel breaks, you get to keep both pieces. BOLT 2 defines the following value types: - `` - The currently defined basic types are: - - no features (no bits set). - - `option_static_remotekey` (bit 12). - - `option_anchor_outputs` and `option_static_remotekey` (bits 20 and 12). - - `option_anchors_zero_fee_htlc_tx` and `option_static_remotekey` (bits 22 and 12). - - Each basic type has the following variations allowed: - - `option_scid_alias` (bit 46). - - `option_zeroconf` (bit 50). - `` - -EXAMPLE USAGE -------------- - -This example shows how to use lightning-cli to open new channel with peer 03f...fc1 from one whole utxo bcc1...39c:0 (you can use **listfunds** command to get txid and vout): - -```shell -lightning-cli -k fundchannel id=03f...fc1 amount=all feerate=normal utxos='["bcc1...39c:0"]' -``` - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:fundchannel#1", - "method": "fundchannel", - "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "amount": 1000000, - "feerate": null, - "announce": true, - "minconf": null, - "utxos": null, - "push_msat": null, - "close_to": null, - "request_amt": null, - "compact_lease": null, - "mindepth": null, - "reserve": null - } -} -{ - "id": "example:fundchannel#2", - "method": "fundchannel", - "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "amount": 10000000, - "feerate": null, - "announce": true, - "minconf": null, - "utxos": null, - "push_msat": 1000000000, - "close_to": null, - "request_amt": null, - "compact_lease": null, - "mindepth": null, - "reserve": null, - "channel_type": null - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **tx** (hex): The raw transaction which funded the channel. -- **txid** (txid): The txid of the transaction which funded the channel. -- **outnum** (u32): The 0-based output index showing which output funded the channel. -- **channel\_id** (hash): The channel\_id of the resulting channel. -- **channel\_type** (object): Channel\_type as negotiated with peer. *(added v24.02)*: - - **bits** (array of u32s): Each bit set in this channel\_type. *(added v24.02)*: - - (u32, optional): Bit number. - - **names** (array of strings): Feature name for each bit set in this channel\_type. *(added v24.02)*: - - (string, optional) (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even"): Name of feature bit. -- **close\_to** (hex, optional): The raw scriptPubkey which mutual close will go to; only present if *close\_to* parameter was specified and peer supports `option_upfront_shutdown_script`. -- **mindepth** (u32, optional): Number of confirmations before we consider the channel active. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "tx": "020000000001014ca47b75e6982fce6b5ebb6e7ec163dc5b6bed1562934e6febe816103b2b207e0000000000fdffffff0240420f00000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd012f0f000000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a02473044022058fc4d51c8254d37b266d3db3f8fda7420882b6ec9226d66b8c0139f2707c09602205798d8ce23d4c692a7384362a2e0afd9703f062239a786d7a1840a28d3a1152e012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000", - "txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b", - "channel_id": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", - "outnum": 0 -} -{ - "tx": "0200000000010141cfa0e9957c7c6d0bb5069d92937f9545e6e6ee9b4650f47f509d5ea65df4690100000000fdffffff0280969800000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd4118530b0000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a0247304402206488c7dfbc4180781ed0d5ca7ff2c8ce134480c349d03978765053a393229d9a022066c75dee1f19b410ea1c7756d0cb2c097e52b13f4d9bbd033efa4ed95d817e14012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000", - "txid": "6aa1231b6356777468a55aea1f49dad6415592aef6c1e652f8a64357c7235301", - "channel_id": "015323c75743a6f852e6c1f6ae925541d6da491fea5aa568747756631b23a16a", - "channel_type": { - "bits": [ - 12, - 22 - ], - "names": [ - "static_remotekey/even", - "anchors_zero_fee_htlc_tx/even" - ] - }, - "outnum": 0 -} -``` - -ERRORS ------- - -The following error codes may occur: - -- -1: Catchall nonspecific error. -- 300: The maximum allowed funding amount is exceeded. -- 301: There are not enough funds in the internal wallet (including fees) to create the transaction. -- 302: The output amount is too small, and would be considered dust. -- 303: Broadcasting of the funding transaction failed, the internal call to bitcoin-cli returned with an error. -- 313: The `min-emergency-msat` reserve not be preserved (and we have or are opening anchor channels). - -Failure may also occur if **lightningd** and the peer cannot agree on channel parameters (funding limits, channel reserves, fees, etc.). - -SEE ALSO --------- - -lightning-connect(7), lightning-listfunds(), lightning-listpeers(7), lightning-feerates(7), lightning-multifundchannel(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-fundchannel_cancel.7.md b/doc/lightning-fundchannel_cancel.7.md deleted file mode 100644 index 260f0b16658a..000000000000 --- a/doc/lightning-fundchannel_cancel.7.md +++ /dev/null @@ -1,82 +0,0 @@ -lightning-fundchannel\_cancel -- Command for completing channel establishment -============================================================================= - -SYNOPSIS --------- - -**fundchannel\_cancel** *id* - -DESCRIPTION ------------ - -`fundchannel_cancel` is a lower level RPC command. It allows channel opener to cancel a channel before funding broadcast with a connected peer. - -Note that the funding transaction MUST NOT be broadcast before `fundchannel_cancel`. Broadcasting transaction before `fundchannel_cancel` WILL lead to unrecoverable loss of funds. - -If `fundchannel_cancel` is called after `fundchannel_complete`, the remote peer may disconnect when command succeeds. In this case, user need to connect to remote peer again before opening channel. - -- **id** (pubkey): Node id of the remote peer with which to cancel. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:fundchannel_cancel#1", - "method": "fundchannel_cancel", - "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" - } -} -{ - "id": "example:fundchannel_cancel#2", - "method": "fundchannel_cancel", - "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **cancelled** (string): A message indicating it was cancelled by RPC. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "cancelled": "Channel open canceled by RPC" -} -{ - "cancelled": "Channel open canceled by RPC(after fundchannel_complete)" -} -``` - -ERRORS ------- - -On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -- -32602: If the given parameters are wrong. -- 306: Unknown peer id. -- 307: No channel currently being funded that can be cancelled. -- 308: It is unsafe to cancel the channel: the funding transaction has been broadcast, or there are HTLCs already in the channel, or the peer was the initiator and not us. - -AUTHOR ------- - -Lisa Neigut <> is mainly responsible. - -SEE ALSO --------- - -lightning-connect(7), lightning-fundchannel(7), lightning-multifundchannel(7), lightning-fundchannel\_start(7), lightning-fundchannel\_complete(7), lightning-openchannel\_init(7), lightning-openchannel\_update(7), lightning-openchannel\_signed(7), lightning-openchannel\_abort(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-fundchannel_complete.7.md b/doc/lightning-fundchannel_complete.7.md deleted file mode 100644 index 08bd27b3a5f3..000000000000 --- a/doc/lightning-fundchannel_complete.7.md +++ /dev/null @@ -1,75 +0,0 @@ -lightning-fundchannel\_complete -- Command for completing channel establishment -=============================================================================== - -SYNOPSIS --------- - -**fundchannel\_complete** *id* *psbt* - -DESCRIPTION ------------ - -`fundchannel_complete` is a lower level RPC command. It allows a user to complete an initiated channel establishment with a connected peer. - -Note that the funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed, as the commitment transactions for this channel are not secured until this command successfully completes. Broadcasting transaction before can lead to unrecoverable loss of funds. - -- **id** (pubkey): Node id of the remote peer. -- **psbt** (string): Transaction to use for funding (does not need to be signed but must be otherwise complete). - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:fundchannel_complete#1", - "method": "fundchannel_complete", - "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "psbt": "cHNidP8BAIkCAAAAASYd4TeOHEIzrUbbELM2DK0IX09WaXqWsJFlLD455MPPAAAAAAD9////Av///wAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM1c8QUpAQAAACJRIH8AZYBKMKON4/oVmJVsVt6zy/+PkBPzziE+LtkuFvWXAAAAAAABAIMCAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////wJRAP////8CAPIFKgEAAAAWABQ5FIjuMd8ar9WFRV9eGNLF+3RMcAAAAAAAAAAAJmokqiGp7eL2HD9x0d79P6mZ36NpU3VcaQaJeZlitIvr2DaXToz5AAAAAAEBHwDyBSoBAAAAFgAUORSI7jHfGq/VhUVfXhjSxft0THAiBgMegIxEPDa2OseVTaV6ANtSwQuoj/j2an7X/Is2EekvWBhhFDNgVAAAgAEAAIAAAACAAAAAAAAAAAAAAAEFIEm9AFgqUlJwbPFtyt3a9dzvb+nAGZiQ3CT1CImhjBFpIQdJvQBYKlJScGzxbcrd2vXc72/pwBmYkNwk9QiJoYwRaRkAYRQzYFYAAIABAACAAAAAgAEAAAAAAAAAAA==" - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **channel\_id** (hash): The channel\_id of the resulting channel. -- **commitments\_secured** (boolean) (always *true*): Indication that channel is safe to use. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "channel_id": "049217e5035a4a60449c6382c445b5c105bd63588d66137ad0511c57a16db6d9", - "commitments_secured": true -} -``` - -ERRORS ------- - -On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -- -32602: If the given parameters are wrong. -- -1: Catchall nonspecific error. -- 305: Peer is not connected. -- 306: Unknown peer id. -- 309: PSBT does not have a unique, correct output to fund the channel. - -AUTHOR ------- - -Lisa Neigut <> is mainly responsible. - -SEE ALSO --------- - -lightning-connect(7), lightning-fundchannel(7), lightning-multifundchannel(7), lightning-fundchannel\_start(7), lightning-fundchannel\_cancel(7), lightning-openchannel\_init(7), lightning-openchannel\_update(7), lightning-openchannel\_signed(7), lightning-openchannel\_bump(7), lightning-openchannel\_abort(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-fundchannel_start.7.md b/doc/lightning-fundchannel_start.7.md deleted file mode 100644 index 770be9337aaf..000000000000 --- a/doc/lightning-fundchannel_start.7.md +++ /dev/null @@ -1,130 +0,0 @@ -lightning-fundchannel\_start -- Command for initiating channel establishment for a lightning channel -==================================================================================================== - -SYNOPSIS --------- - -**fundchannel\_start** *id* *amount* [*feerate* *announce* *close\_to* *push\_msat* *channel\_type* *mindepth* *reserve*] - -DESCRIPTION ------------ - -`fundchannel_start` is a lower level RPC command. It allows a user to initiate channel establishment with a connected peer. - -Note that the funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`, as the commitment transactions for this channel are not secured until the complete command succeeds. Broadcasting transaction before that can lead to unrecoverable loss of funds. - -- **id** (pubkey): The peer id obtained from connect. -- **amount** (sat): Satoshi value that the channel will be funded at. This value MUST be accurate, otherwise the negotiated commitment transactions will not encompass the correct channel value. -- **feerate** (feerate, optional): Feerate for subsequent commitment transactions: see **fundchannel**. Note that this is ignored for channels with *option\_anchors\_zero\_fee\_htlc\_tx* (we always use a low commitment fee for these). -- **announce** (boolean, optional): Whether or not to announce this channel. -- **close\_to** (string, optional): Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. Returns `close_to` set to closing script iff is negotiated. -- **push\_msat** (msat, optional): Amount of millisatoshis to push to the channel peer at open. Note that this is a gift to the peer -- these satoshis are added to the initial balance of the peer at channel start and are largely unrecoverable once pushed. -- **mindepth** (u32, optional): Number of confirmations required before we consider the channel active. -- **reserve** (msat, optional): The amount we want the peer to maintain on its side. -- **channel\_type** (array of u32s, optional): Each bit set in this channel\_type.: - - (u32, optional): Bit number. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:fundchannel_start#1", - "method": "fundchannel_start", - "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "amount": 16777216, - "feerate": null, - "announce": true, - "close_to": null, - "mindepth": null - } -} -{ - "id": "example:fundchannel_start#2", - "method": "fundchannel_start", - "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "amount": "100000sat", - "feerate": null, - "announce": true, - "close_to": null, - "mindepth": null, - "channel_type": null - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **funding\_address** (string): The address to send funding to for the channel. DO NOT SEND COINS TO THIS ADDRESS YET. -- **scriptpubkey** (hex): The raw scriptPubkey for the address. -- **channel\_type** (object, optional): Channel\_type as negotiated with peer. *(added v24.02)*: - - **bits** (array of u32s): Each bit set in this channel\_type. *(added v24.02)*: - - (u32, optional): Bit number. - - **names** (array of strings): Feature name for each bit set in this channel\_type. *(added v24.02)*: - - (string, optional) (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even"): Name of feature bit. -- **close\_to** (hex, optional): The raw scriptPubkey which mutual close will go to; only present if *close\_to* parameter was specified and peer supports `option_upfront_shutdown_script`. -- **mindepth** (u32, optional): Number of confirmations before we consider the channel active. - -The following warnings may also be returned: - -- **warning\_usage**: A warning not to prematurely broadcast the funding transaction (always present!). - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "funding_address": "bcrt1qtwxd8wg5eanumk86vfeujvp48hfkgannf77evggzct048wggsrxsum2pmm", - "scriptpubkey": "00205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd", - "warning_usage": "The funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`" -} -{ - "funding_address": "bcrt1qtwxd8wg5eanumk86vfeujvp48hfkgannf77evggzct048wggsrxsum2pmm", - "scriptpubkey": "00205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd", - "channel_type": { - "bits": [ - 12, - 22 - ], - "names": [ - "static_remotekey/even", - "anchors_zero_fee_htlc_tx/even" - ] - }, - "warning_usage": "The funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`" -} -``` - -ERRORS ------- - -On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -- -32602: If the given parameters are wrong. -- -1: Catchall nonspecific error. -- 300: The amount exceeded the maximum configured funding amount. -- 301: The provided `push_msat` is greater than the provided `amount`. -- 304: Still syncing with bitcoin network -- 305: Peer is not connected. -- 306: Unknown peer id. -- 312: Peer negotiated `option_dual_fund`, must use `openchannel_init` not `fundchannel_start`. (Only if ``experimental-dual-fund is enabled) - -AUTHOR ------- - -Lisa Neigut <> is mainly responsible. - -SEE ALSO --------- - -lightning-connect(7), lightning-fundchannel(7), lightning-multifundchannel(7), lightning-fundchannel\_complete(7), lightning-fundchannel\_cancel(7), lightning-openchannel\_init(7), lightning-openchannel\_update(7), lightning-openchannel\_signed(7), lightning-openchannel\_bump(7), lightning-openchannel\_abort(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-funderupdate.7.md b/doc/lightning-funderupdate.7.md deleted file mode 100644 index 520ee7c592b8..000000000000 --- a/doc/lightning-funderupdate.7.md +++ /dev/null @@ -1,147 +0,0 @@ -lightning-funderupdate -- Command for adjusting node funding v2 channels -======================================================================== - -SYNOPSIS --------- - -**funderupdate** [*policy*] [*policy\_mod*] [*leases\_only*] [*min\_their\_funding\_msat*] [*max\_their\_funding\_msat*] [*per\_channel\_min\_msat*] [*per\_channel\_max\_msat*] [*reserve\_tank\_msat*] [*fuzz\_percent*] [*fund\_probability*] [*lease\_fee\_base\_msat*] [*lease\_fee\_basis*] [*funding\_weight*] [*channel\_fee\_max\_base\_msat*] [*channel\_fee\_max\_proportional\_thousandths*] [*compact\_lease*] - -DESCRIPTION ------------ - -NOTE: Must have --experimental-dual-fund enabled for these settings to take effect. - -For channel open requests using dual funding. - -Note: to maximize channel leases, best policy setting is (match, 100). - -Setting any of the 5 options from *lease\_fee\_base\_msat*, *lease\_fee\_basis*, *funding\_weight*, *channel\_fee\_max\_base\_msat* and, *channel\_fee\_max\_proportional\_thousandths* will activate channel leases for this node, and advertise these values via the lightning gossip network. If any one is set, the other values will be the default. - -- **policy** (string, optional) (one of "match", "available", "fixed"): Funder plugin will use to decide how much capital to commit to a v2 open channel request. - There are three policy options, detailed below: - * `match` -- Contribute *policy\_mod* percent of their requested funds. Valid *policy\_mod* values are 0 to 200. If this is a channel lease request, we match based on their requested funds. If it is not a channel lease request (and *lease\_only* is false), then we match their funding amount. Note: any lease match less than 100 will likely fail, as clients will not accept a lease less than their request. - * `available` -- Contribute *policy\_mod* percent of our available node wallet funds. Valid *policy\_mod* values are 0 to 100. - * `fixed` -- Contributes a fixed *policy\_mod* sats to v2 channel open requests. The default is fixed. -- **policy\_mod** (sat, optional): Number or 'modification' to apply to the policy. The default is 0sats. -- **leases\_only** (boolean, optional): Only contribute funds to `option_will_fund` requests which pay to lease funds. It will fund any v2 open request using *policy* even if it's they're not seeking to lease funds. Note that `option_will_fund` commits funds for 4032 blocks (~1mo). Must also set *lease\_fee\_base\_msat*, *lease\_fee\_basis*, *funding\_weight*, *channel\_fee\_max\_base\_msat*, and *channel\_fee\_max\_proportional\_thousandths* to advertise available channel leases. The default is False. -- **min\_their\_funding\_msat** (msat, optional): Minimum funding sats that we require in order to activate our contribution policy to the v2 open. The default is 10k sats. -- **max\_their\_funding\_msat** (msat, optional): Maximum funding sats that we will consider to activate our contribution policy to the v2 open. Any channel open above this will not be funded. The default is no max (`UINT_MAX`). -- **per\_channel\_min\_msat** (msat, optional): Minimum amount that we will contribute to a channel open. The default is 10k sats. -- **per\_channel\_max\_msat** (msat, optional): Maximum amount that we will contribute to a channel open. The default is no max (`UINT_MAX`). -- **reserve\_tank\_msat** (msat, optional): Amount of sats to leave available in the node wallet. The default is zero sats. -- **fuzz\_percent** (u32, optional): A percentage to fuzz the resulting contribution amount by. Valid values are 0 to 100. Note that turning this on with (match, 100) policy will randomly fail `option_will_fund` leases, as most clients expect an exact or greater match of their `requested_funds`. The default is 0% (no fuzz). -- **fund\_probability** (u32, optional): The percent of v2 channel open requests to apply our policy to. Valid values are integers from 0 (fund 0% of all open requests) to 100 (fund every request). Useful for randomizing opens that receive funds. Useful for randomizing opens that receive funds. The default is 100. -- **lease\_fee\_base\_msat** (msat, optional): Flat fee for a channel lease. Node will receive this much extra added to their channel balance, paid by the opening node. Note that the minimum is 1sat. The default is 2k sats. -- **lease\_fee\_basis** (u32, optional): A basis fee that's calculated as 1/10k of the total requested funds the peer is asking for. Node will receive the total of *lease\_fee\_basis* times requested funds / 10k satoshis added to their channel balance, paid by the opening node. The default is 0.65% (65 basis points). -- **funding\_weight** (u32, optional): To calculate the fee the peer will compensate your node for its contributing inputs to the funding transaction. The total fee is calculated as the `open_channel2`.`funding_feerate_perkw` times this *funding\_weight* divided by 1000. Node will have this funding fee added to their channel balance, paid by the opening node. The default is 2 inputs + 1 P2WPKH output. -- **channel\_fee\_max\_base\_msat** (msat, optional): A commitment to a maximum `channel_fee_base_msat` that your node will charge for routing payments over this leased channel during the lease duration. The default is 5k sats. -- **channel\_fee\_max\_proportional\_thousandths** (u32, optional): A commitment to a maximum `channel_fee_proportional_millionths` that your node will charge for routing payments over this leased channel during the lease duration. Note that it's denominated in 'thousandths'. A setting of `1` is equal to 1k ppm; `5` is 5k ppm, etc. The default is 100 (100k ppm). -- **compact\_lease** (hex, optional): A compact description of the channel lease params. When opening a channel, passed in to `fundchannel` to indicate the terms we expect from the peer. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:funderupdate#1", - "method": "funderupdate", - "params": "{}" -} -{ - "id": "example:funderupdate#2", - "method": "funderupdate", - "params": { - "policy": "fixed", - "policy_mod": "50000sat", - "min_their_funding_msat": 1000, - "per_channel_min_msat": "1000sat", - "per_channel_max_msat": "500000sat", - "fund_probability": 100, - "fuzz_percent": 0, - "leases_only": false - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **summary** (string): Summary of the current funding policy e.g. (match 100). -- **policy** (string) (one of "match", "available", "fixed"): Policy funder plugin will use to decide how much capital to commit to a v2 open channel request. -- **policy\_mod** (u32): The *policy\_mod* is the number or 'modification' to apply to the policy. -- **leases\_only** (boolean): Only contribute funds to `option_will_fund` lease requests. -- **min\_their\_funding\_msat** (msat): The minimum funding sats that we require from peer to activate our funding policy. -- **max\_their\_funding\_msat** (msat): The maximum funding sats that we'll allow from peer to activate our funding policy. -- **per\_channel\_min\_msat** (msat): The minimum amount that we will fund a channel open with. -- **per\_channel\_max\_msat** (msat): The maximum amount that we will fund a channel open with. -- **reserve\_tank\_msat** (msat): Amount of sats to leave available in the node wallet. -- **fuzz\_percent** (u32): Percentage to fuzz our funding amount by. -- **fund\_probability** (u32): Percent of opens to consider funding. 100 means we'll consider funding every requested open channel request. -- **lease\_fee\_base\_msat** (msat, optional): Flat fee to charge for a channel lease. -- **lease\_fee\_basis** (u32, optional): Proportional fee to charge for a channel lease, calculated as 1/10,000th of requested funds. -- **funding\_weight** (u32, optional): Transaction weight the channel opener will pay us for a leased funding transaction. -- **channel\_fee\_max\_base\_msat** (msat, optional): Maximum channel\_fee\_base\_msat we'll charge for routing funds leased on this channel. -- **channel\_fee\_max\_proportional\_thousandths** (u32, optional): Maximum channel\_fee\_proportional\_millitionths we'll charge for routing funds leased on this channel, in thousandths. -- **compact\_lease** (hex, optional): Compact description of the channel lease parameters. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "summary": "match (100%)", - "policy": "match", - "policy_mod": 100, - "leases_only": true, - "min_their_funding_msat": 10000000, - "max_their_funding_msat": 4294967295000, - "per_channel_min_msat": 10000000, - "per_channel_max_msat": 4294967295000, - "reserve_tank_msat": 0, - "fuzz_percent": 0, - "fund_probability": 100, - "lease_fee_base_msat": 100000, - "lease_fee_basis": 100, - "funding_weight": 666, - "channel_fee_max_base_msat": 5000000, - "channel_fee_max_proportional_thousandths": 100, - "compact_lease": "029a00640064000000644c4b40" -} -{ - "summary": "fixed (50000sat)", - "policy": "fixed", - "policy_mod": 50000, - "leases_only": false, - "min_their_funding_msat": 1000, - "max_their_funding_msat": 4294967295000, - "per_channel_min_msat": 1000000, - "per_channel_max_msat": 500000000, - "reserve_tank_msat": 0, - "fuzz_percent": 0, - "fund_probability": 100 -} -``` - -ERRORS ------- - -The following error code may occur: - -- -32602: If the given parameters are invalid. - -AUTHOR ------- - -Lisa Neigut <> is mainly responsible. - -SEE ALSO --------- - -lightning-fundchannel(7), lightning-listfunds(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-fundpsbt.7.md b/doc/lightning-fundpsbt.7.md deleted file mode 100644 index 78139ea348d8..000000000000 --- a/doc/lightning-fundpsbt.7.md +++ /dev/null @@ -1,169 +0,0 @@ -lightning-fundpsbt -- Command to populate PSBT inputs from the wallet -===================================================================== - -SYNOPSIS --------- - -**fundpsbt** *satoshi* *feerate* *startweight* [*minconf*] [*reserve*] [*locktime*] [*min\_witness\_weight*] [*excess\_as\_change*] [*nonwrapped*] [*opening\_anchor\_channel*] - -DESCRIPTION ------------ - -`fundpsbt` is a low-level RPC command which creates a PSBT using unreserved inputs in the wallet, optionally reserving them as well. - -- **satoshi** (msat\_or\_all): The minimum satoshi value of the output(s) needed (or the string `all` meaning use all unreserved inputs). If a value, it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. -- **feerate** (feerate): Used for the transaction as initial feerate. The default is *normal*. -- **startweight** (u32): The weight of the transaction before *fundpsbt* has added any inputs. -- **minconf** (u32, optional): The minimum number of confirmations that used outputs should have. The default is 1. -- **reserve** (u32, optional): If not zero, then *reserveinputs* is called (successfully, with *exclusive* true) on the returned PSBT for this number of blocks. The default is 72 blocks. -- **locktime** (u32, optional): The locktime of the transaction. if not set, it is set to a recent block height. -- **min\_witness\_weight** (u32, optional): Minimum weight to use for a UTXO's witness. If the actual witness weight is greater than the provided minimum, the actual witness weight will be used. -- **excess\_as\_change** (boolean, optional): Flag to add a change output for the excess sats. -- **nonwrapped** (boolean, optional): To signal to filter out any p2sh-wrapped inputs from funding this PSBT. *(added v23.02)* -- **opening\_anchor\_channel** (boolean, optional): To signel that it needs emergency reserve for anchors so that we can lowball our commitment tx fees, and min-emergency-msat for reserving some sats for closing anchor channels. *(added v23.08)* - -EXAMPLE USAGE -------------- - -Let's assume the caller is trying to produce a 100,000 satoshi output. - -First, the caller estimates the weight of the core (typically 42) and known outputs of the transaction (typically (9 + scriptlen) * 4). For a simple P2WPKH it's a 22 byte scriptpubkey, so that's 124 weight. - -It calls "*fundpsbt* 100000sat slow 166", which succeeds, and returns the *psbt* and *feerate\_per\_kw* it used, the *estimated\_final\_weight* and any *excess\_msat*. - -If *excess\_msat* is greater than the cost of adding a change output, the caller adds a change output randomly to position 0 or 1 in the PSBT. Say *feerate\_per\_kw* is 253, and the change output is a P2WPKH (weight 124), the cost is around 31 sats. With the dust limit disallowing payments below 546 satoshis, we would only create a change output if *excess\_msat* was greater or equal to 31 + 546. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:fundpsbt#1", - "method": "fundpsbt", - "params": { - "satoshi": 16777216, - "feerate": "253perkw", - "startweight": 250, - "minconf": null, - "reserve": 0, - "locktime": null, - "min_witness_weight": null, - "excess_as_change": false - } -} -{ - "id": "example:fundpsbt#2", - "method": "fundpsbt", - "params": { - "satoshi": "all", - "feerate": "1000perkw", - "startweight": 1000, - "minconf": null, - "reserve": null, - "locktime": null, - "min_witness_weight": null, - "excess_as_change": false - } -} -{ - "id": "example:fundpsbt#3", - "method": "fundpsbt", - "params": { - "satoshi": "109000sat", - "feerate": "slow", - "startweight": 166, - "minconf": null, - "reserve": null, - "locktime": null, - "min_witness_weight": null, - "excess_as_change": true - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **psbt** (string): Unsigned PSBT which fulfills the parameters given. -- **feerate\_per\_kw** (u32): The feerate used to create the PSBT, in satoshis-per-kiloweight. -- **estimated\_final\_weight** (u32): The estimated weight of the transaction once fully signed. -- **excess\_msat** (msat): The amount above *satoshi* which is available. This could be zero, or dust; it will be zero if *change\_outnum* is also returned. -- **change\_outnum** (u32, optional): The 0-based output number where change was placed (only if parameter *excess\_as\_change* was true and there was sufficient funds). -- **reservations** (array of objects, optional): If *reserve* was true or a non-zero number, just as per lightning- reserveinputs(7).: - - **txid** (txid): The txid of the transaction. - - **vout** (u32): The 0-based output number. - - **was\_reserved** (boolean) (always *false*): Whether this output was previously reserved. - - **reserved** (boolean) (always *true*): Whether this output is now reserved. - - **reserved\_to\_block** (u32): The blockheight the reservation will expire. - -If *excess\_as\_change* is true and the excess is enough to cover an additional output above the `dust_limit`, then an output is added to the PSBT for the excess amount. The *excess\_msat* will be zero. A *change\_outnum* will be returned with the index of the change output. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "psbt": "cHNidP8BADMCAAAAAWzmSFzhTtXBnQewytc32WaMwJSunScwsYndBNdU80JqAAAAAAD9////AGYAAAAAAQDeAgAAAAABAU1MpIJeOOzqAYVkZaytJCmzUadBVltKar8kWtzKSVeYAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFD8W5uBNZAxN6n1jqU62dxWQbyGAAkcwRAIgUK+vMOeWiDPiJM8fpgKCjjwXog4yfWPvtKES1ZZPaM8CIB3cgouGpV6Gc7nEvAu28Mg9tkAWt/Xl5FDOseEyeZqHASECTwjR0I3gLHdSW7jRmnVXdm0+MgJ1hihnqEfXYeFWA/NlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=", - "feerate_per_kw": 253, - "estimated_final_weight": 521, - "excess_msat": 9999869000 -} -{ - "psbt": "cHNidP8BAF4CAAAAAfwbEpvpi6D14YV4VLnuVB47Y0uF41kXEyJRL4IusySSAQAAAAD9////ASICAAAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5nAAAAAAEA9gIAAAAAAQFEkxvLatohY6mw5gr5qG1aiArSrziFPR2YoqD21Hv+RAAAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNrz8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIEu1nfVRt9i+rFM219mwhMqdwJsqygWSWTFUS+cemdh6AiBG3Qo8g9J/aAMO2RHDsIBScscj6pTTIwZp7Gw8G3EOKAEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPZgAAAAEBK68/DwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==", - "feerate_per_kw": 1000, - "estimated_final_weight": 1443, - "excess_msat": 997354000, - "change_outnum": 0, - "reservations": [ - { - "txid": "9224b32e822f5122131759e3854b633b1e54eeb9547885e1f5a08be99b121bfc", - "vout": 1, - "was_reserved": false, - "reserved": true, - "reserved_to_block": 175 - } - ] -} -{ - "psbt": "cHNidP8BAF4CAAAAAbEf44mT/BPDxLkUjKy1byWksyLyuM6hbe8shzEbbXhGAQAAAAD9////AU58DQAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5sAAAAAAEA9gIAAAAAAQEV9Sj1wfHqO/ECZeHp/u7cFL5eRaa1Vu4hXWbwH72pxgEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIGILT3DrcNn6/WKOhsxxKq7lDWq47dV0IjRhj0bYHs4yAiApzODtmrz7ifK32G81A2XbBxWboFk2vN4T3ng/hYmb1wEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPZgAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==", - "feerate_per_kw": 3750, - "estimated_final_weight": 609, - "excess_msat": 0, - "change_outnum": 0, - "reservations": [ - { - "txid": "46786d1b31872cef6da1ceb8f222b3a4256fb5ac8c14b9c4c313fc9389e31fb1", - "vout": 1, - "was_reserved": false, - "reserved": true, - "reserved_to_block": 180 - } - ] -} -``` - -ERRORS ------- - -On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -- -32602: If the given parameters are wrong. -- -1: Catchall nonspecific error. -- 301: Insufficient UTXOs to meet *satoshi* value. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-utxopsbt(7), lightning-reserveinputs(7), lightning-unreserveinputs(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-getinfo.7.md b/doc/lightning-getinfo.7.md deleted file mode 100644 index 8f17e688ea57..000000000000 --- a/doc/lightning-getinfo.7.md +++ /dev/null @@ -1,136 +0,0 @@ -lightning-getinfo -- Command to receive all information about the Core Lightning node. -====================================================================================== - -SYNOPSIS --------- - -**getinfo** - -DESCRIPTION ------------ - -The **getinfo** gives a summary of the current running node. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:getinfo#1", - "method": "getinfo", - "params": {} -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **id** (pubkey): The public key unique to this node. -- **alias** (string) (up to 32 characters): The fun alias this node will advertize. -- **color** (hex) (always 6 characters): The favorite RGB color this node will advertize. -- **num\_peers** (u32): The total count of peers, connected or with channels. -- **num\_pending\_channels** (u32): The total count of channels being opened. -- **num\_active\_channels** (u32): The total count of channels in normal state. -- **num\_inactive\_channels** (u32): The total count of channels waiting for opening or closing transactions to be mined. -- **version** (string): Identifies what bugs you are running into. -- **lightning-dir** (string): Identifies where you can find the configuration and other related files. -- **blockheight** (u32): The highest block height we've learned. -- **network** (string): Represents the type of network on the node are working (e.g: `bitcoin`, `testnet`, or `regtest`). -- **fees\_collected\_msat** (msat): Total routing fees collected by this node. -- **address** (array of objects): The addresses we announce to the world.: - - **type** (string) (one of "dns", "ipv4", "ipv6", "torv2", "torv3"): Type of connection (until 23.08, `websocket` was also allowed). - - **port** (u16): Port number. - - If **type** is "dns", "ipv4", "ipv6", "torv2" or "torv3": - - **address** (string): Address in expected format for **type**. -- **our\_features** (object, optional): Our BOLT #9 feature bits (as hexstring) for various contexts.: - - **init** (hex): Features (incl. globalfeatures) in our init message, these also restrict what we offer in open\_channel or accept in accept\_channel. - - **node** (hex): Features in our node\_announcement message. - - **channel** (hex): Negotiated channel features we (as channel initiator) publish in the channel\_announcement message. - - **invoice** (hex): Features in our BOLT11 invoices. -- **binding** (array of objects, optional): The addresses we are listening on.: - - **type** (string) (one of "local socket", "websocket", "ipv4", "ipv6", "torv2", "torv3"): Type of connection. - - **address** (string, optional): Address in expected format for **type**. - - **port** (u16, optional): Port number. - - If **type** is "local socket": - - **socket** (string): Socket filename. - - If **type** is "websocket": - - **subtype** (string): Type of address. - -The following warnings may also be returned: - -- **warning\_bitcoind\_sync**: Bitcoind is not up-to-date with network. -- **warning\_lightningd\_sync**: Lightningd is still loading latest blocks from bitcoind. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "id": "02bf811f7571754f0b51e6d41a8885f5561041a7b14fac093e4cffb95749de1a8d", - "alias": "SLICKERGOPHER", - "color": "02bf81", - "num_peers": 0, - "num_pending_channels": 0, - "num_active_channels": 0, - "num_inactive_channels": 0, - "address": [ - { - "type": "torv3", - "address": "fp463inc4w3lamhhduytrwdwq6q6uzugtaeapylqfc43agrdnnqsheyd.onion", - "port": 9736 - }, - { - "type": "torv3", - "address": "ifnntp5ak4homxrti2fp6ckyllaqcike447ilqfrgdw64ayrmkyashid.onion", - "port": 9736 - } - ], - "binding": [ - { - "type": "ipv4", - "address": "127.0.0.1", - "port": 9736 - } - ], - "version": "v0.10.2", - "blockheight": 724302, - "network": "bitcoin", - "msatoshi_fees_collected": 0, - "fees_collected_msat": "0msat", - "lightning-dir": "/media/vincent/Maxtor/C-lightning/node/bitcoin", - "our_features": { - "init": "8828226aa2", - "node": "80008828226aa2", - "channel": "", - "invoice": "20024200" - } -} -``` - -ERRORS ------- - -On failure, one of the following error codes may be returned: - -- -32602: Error in given parameters or some error happened during the command process. - -AUTHOR ------- - -Vincenzo Palazzo <> wrote the initial version of this man page, -but many others did the hard work of actually implementing this rpc command. - -SEE ALSO --------- - -lightning-connect(7), lightning-fundchannel(7), lightning-listconfigs(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-getlog.7.md b/doc/lightning-getlog.7.md deleted file mode 100644 index 2d1ab7f76032..000000000000 --- a/doc/lightning-getlog.7.md +++ /dev/null @@ -1,95 +0,0 @@ -lightning-getlog -- Command to show logs. -========================================= - -SYNOPSIS --------- - -**getlog** [*level*] - -DESCRIPTION ------------ - -The **getlog** the RPC command to show logs, with optional log *level*. - -- **level** (string, optional) (one of "broken", "unusual", "info", "debug", "io"): A string that represents the log level. The default is *info*. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:getlog#1", - "method": "getlog", - "params": { - "level": "debug" - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **created\_at** (string): UNIX timestamp with 9 decimal places, when logging was initialized. -- **bytes\_used** (u32): The number of bytes used by logging records. -- **bytes\_max** (u32): The bytes\_used values at which records will be trimmed . -- **log** (array of objects): - - **type** (string) (one of "SKIPPED", "BROKEN", "UNUSUAL", "INFO", "DEBUG", "IO\_IN", "IO\_OUT") - - If **type** is "SKIPPED": - - **num\_skipped** (u32): Number of unprinted log entries (deleted or below *level* parameter). - - If **type** is "BROKEN", "UNUSUAL", "INFO" or "DEBUG": - - **time** (string): UNIX timestamp with 9 decimal places after **created\_at**. - - **source** (string): The particular logbook this was found in. - - **log** (string): The actual log message. - - **node\_id** (pubkey, optional): The peer this is associated with. - - If **type** is "IO\_IN" or "IO\_OUT": - - **time** (string): Seconds after **created\_at**, with 9 decimal places. - - **source** (string): The particular logbook this was found in. - - **log** (string): The associated log message. - - **data** (hex): The IO which occurred. - - **node\_id** (pubkey, optional): The peer this is associated with. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "created_at": "1598192543.820753463", - "bytes_used": 89285843, - "bytes_max": 104857600, - "log": [ - { - "type": "SKIPPED", - "num_skipped": 45 - }, - { - "type": "INFO", - "time": "0.453627568", - "source": "plugin-autopilot.py", - "log": "RPCmethod'autopilot-run-once'doesnothaveadocstring." - } - ] -} -``` - -ERRORS ------- - -On failure, one of the following error codes may be returned: - -- -32602: Error in given parameters. - -AUTHOR ------- - -Vincenzo Palazzo <> wrote the initial version of this man page, -but many others did the hard work of actually implementing this rpc command. - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-getroute.7.md b/doc/lightning-getroute.7.md deleted file mode 100644 index 0d8c493b6f40..000000000000 --- a/doc/lightning-getroute.7.md +++ /dev/null @@ -1,353 +0,0 @@ -lightning-getroute -- Command for routing a payment (low-level) -=============================================================== - -SYNOPSIS --------- - -**getroute** *id* *amount\_msat* *riskfactor* [*cltv*] [*fromid*] [*fuzzpercent*] [*exclude*] [*maxhops*] - -DESCRIPTION ------------ - -The **getroute** RPC command attempts to find the best route for the payment of *amount\_msat* to lightning node *id*, such that the payment will arrive at *id* with *cltv*. - -There are two considerations for how good a route is: how low the fees are, and how long your payment will get stuck in a delayed output if a node goes down during the process. . - -- **id** (pubkey): Node pubkey to find the best route for the payment. -- **amount\_msat** (msat): Amount to send. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. The 0 value is special: it ignores any *htlc\_minimum\_msat* setting on channels, and simply returns a possible route (if any) which is useful for simple probing. -- **riskfactor** (u64): A non-negative floating-point field controls this tradeoff; it is the annual cost of your funds being stuck (as a percentage). For example, if you thought the convenience of keeping your funds liquid (not stuck) was worth 20% per annum interest, *riskfactor* would be 20. If you didn't care about risk, *riskfactor* would be zero. -- **cltv** (u32, optional): Cltv-blocks to spare. The default is 9. -- **fromid** (pubkey, optional): The node to start the route from. The default is this node. -- **fuzzpercent** (u32, optional): Used to distort fees to provide some randomization to the route generated, but it was not properly implemented and is ignored. -- **exclude** (array of strings, optional): A JSON array of short-channel-id/direction (e.g. ['564334x877x1/0', '564195x1292x0/1' ]) or node-id which should be excluded from consideration for routing. Note if the source or destination is excluded, the command result is undefined. The default is not to exclude any channels or nodes.: - - (string, optional) -- **maxhops** (u32, optional): The maximum number of channels to return. The default is 20. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:getroute#1", - "method": "getroute", - "params": { - "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "amount_msat": 50000000, - "riskfactor": 1, - "cltv": 9, - "fromid": null, - "fuzzpercent": null, - "exclude": null, - "maxhops": null - } -} -{ - "id": "example:getroute#2", - "method": "getroute", - "params": { - "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "amount_msat": "50000sat", - "riskfactor": 10 - } -} -``` - -RISKFACTOR EFFECT ON ROUTING ----------------------------- - -The risk factor is treated as if it were an additional fee on the route, for the purposes of comparing routes. - -The formula used is the following approximation: - - risk-fee = amount x blocks-timeout x per-block-cost - -We are given a *riskfactor* expressed as a percentage. There are 52596 blocks per year, thus *per-block-cost* is *riskfactor* divided by 5,259,600. - -The final result is: - - risk-fee = amount x blocks-timeout x riskfactor / 5259600 - -Here are the risk fees in millisatoshis, using various parameters. I assume a channel charges the default of 1000 millisatoshis plus 1 part-per-million. Common to\_self\_delay values on the network at 14 and 144 blocks. - - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Amount (msat)RiskfactorDelayRisk FeeRoute fee

10,000

1

14

0

1001

10,000

10

14

0

1001

10,000

100

14

2

1001

10,000

1000

14

26

1001

1,000,000

1

14

2

1001

1,000,000

10

14

26

1001

1,000,000

100

14

266

1001

1,000,000

1000

14

2661

1001

100,000,000

1

14

266

1100

100,000,000

10

14

2661

1100

100,000,000

100

14

26617

1100

100,000,000

1000

14

266179

1100

10,000

1

144

0

1001

10,000

10

144

2

1001

10,000

100

144

27

1001

10,000

1000

144

273

1001

1,000,000

1

144

27

1001

1,000,000

10

144

273

1001

1,000,000

100

144

2737

1001

1,000,000

1000

144

27378

1001

100,000,000

1

144

2737

1100

100,000,000

10

144

27378

1100

100,000,000

100

144

273785

1100

100,000,000

1000

144

2737850

1100

- -RECOMMENDED RISKFACTOR VALUES ------------------------------ - -The default *fuzz* factor is 5%, so as you can see from the table above, that tends to overwhelm the effect of *riskfactor* less than about 5. - -1 is a conservative value for a stable lightning network with very few failures. - -1000 is an aggressive value for trying to minimize timeouts at all costs. - -The default for lightning-pay(7) is 10, which starts to become a major factor for larger amounts, and is basically ignored for tiny ones. - -RETURN VALUE ------------- - -On success, an object containing **route** is returned. It is an array of objects, where each object contains: - -- **id** (pubkey): The node at the end of this hop. -- **channel** (short\_channel\_id): The channel joining these nodes. -- **direction** (u32): 0 if this channel is traversed from lesser to greater **id**, otherwise 1. -- **amount\_msat** (msat): The amount expected by the node at the end of this hop. -- **delay** (u32): The total CLTV expected by the node at the end of this hop. -- **style** (string) (always "tlv"): The features understood by the destination node. - -The final *id* will be the destination *id* given in the input. The difference between the first *amount\_msat* minus the *amount\_msat* given in the input is the fee (assuming the first hop is free). The first *delay* is the very worst case timeout for the payment failure, in blocks. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "route": [ - { - "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "channel": "103x3x0", - "direction": 1, - "amount_msat": 50001002, - "delay": 21, - "style": "tlv" - }, - { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "channel": "103x1x0", - "direction": 1, - "amount_msat": 50000501, - "delay": 15, - "style": "tlv" - }, - { - "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "channel": "103x2x0", - "direction": 0, - "amount_msat": 50000000, - "delay": 9, - "style": "tlv" - } - ] -} -{ - "route": [ - { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "channel": "103x2x0", - "direction": 1, - "amount_msat": 50051000, - "delay": 15, - "style": "tlv" - }, - { - "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "channel": "103x1x0", - "direction": 0, - "amount_msat": 50000000, - "delay": 9, - "style": "tlv" - } - ] -} -``` - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-pay(7), lightning-sendpay(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-help.7.md b/doc/lightning-help.7.md deleted file mode 100644 index 981fb518dfa8..000000000000 --- a/doc/lightning-help.7.md +++ /dev/null @@ -1,94 +0,0 @@ -lightning-help -- Command to return all information about RPC commands. -======================================================================= - -SYNOPSIS --------- - -**help** [*command*] - -DESCRIPTION ------------ - -The **help** is a RPC command which is possible consult all information about the RPC commands, or a specific command if *command* is given. - -Note that the lightning-cli(1) tool will prefer to list a man page when a specific *command* is specified, and will only return the JSON if the man page is not found. - -- **command** (string, optional): Command to get information about. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:help#1", - "method": "help", - "params": { - "command": "pay" - } -} -{ - "id": "example:help#2", - "method": "help", - "params": { - "command": "dev" - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **help** (array of objects): - - **command** (string): The command. - - **category** (string): The category for this command (useful for grouping). - - **description** (string): A one-line description of the purpose of this command. - - **verbose** (string): A full description of this command (including whether it's deprecated). -- **format-hint** (string, optional) (always "simple"): Prints the help in human-readable flat form. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "help": [ - { - "command": "pay bolt11 [amount_msat] [label] [riskfactor] [maxfeepercent] [retry_for] [maxdelay] [exemptfee] [localinvreqid] [exclude] [maxfee] [description] [dev_use_shadow]", - "category": "plugin", - "description": "Send payment specified by {bolt11}", - "verbose": "Attempt to pay the {bolt11} invoice." - } - ], - "format-hint": "simple" -} -{ - "help": [ - { - "command": "dev subcommand=crash|rhash|slowcmd", - "category": "developer", - "description": "Developer command test multiplexer", - "verbose": "dev rhash {secret}\n\tShow SHA256 of {secret}\ndev crash\n\tCrash lightningd by calling fatal()\ndev slowcmd {msec}\n\tTorture test for slow commands, optional {msec}\n" - } - ], - "format-hint": "simple" -} -``` - -ERRORS ------- - -On failure, one of the following error codes may be returned: - -- -32602: Error in given parameters. - -AUTHOR ------- - -Vincenzo Palazzo <> wrote the initial version of this man page, -but many others did the hard work of actually implementing this rpc command. - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-invoice.7.md b/doc/lightning-invoice.7.md deleted file mode 100644 index ce92d6e25163..000000000000 --- a/doc/lightning-invoice.7.md +++ /dev/null @@ -1,138 +0,0 @@ -lightning-invoice -- Command for accepting payments -=================================================== - -SYNOPSIS --------- - -**invoice** *amount\_msat* *label* *description* [*expiry*] [*fallbacks*] [*preimage*] [*exposeprivatechannels*] [*cltv*] [*deschashonly*] - -DESCRIPTION ------------ - -The **invoice** RPC command creates the expectation of a payment of a given amount of milli-satoshi: it returns a unique token which another lightning daemon can use to pay this invoice. This token includes a *route hint* description of an incoming channel with capacity to pay the invoice, if any exists. - -- **amount\_msat** (msat\_or\_any): The string `any`, which creates an invoice that can be paid with any amount. Otherwise it is a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. -- **label** (one of): A unique string or number (which is treated as a string, so `01` is different from `1`); it is never revealed to other nodes on the lightning network, but it can be used to query the status of this invoice.: - - (string) - - (integer) -- **description** (string): A short description of purpose of payment, e.g. *1 cup of coffee*. This value is encoded into the BOLT11 invoice and is viewable by any node you send this invoice to (unless *deschashonly* is true as described below). It must be UTF-8, and cannot use *\u* JSON escape codes. -- **expiry** (u64, optional): The time the invoice is valid for, in seconds. If no value is provided the default of 604800 (1 week) is used. -- **fallbacks** (array of strings, optional): One or more fallback addresses to include in the invoice (in order from most- preferred to least): note that these arrays are not currently tracked to fulfill the invoice.: - - (string, optional) -- **preimage** (hex, optional): A 64-digit hex string to be used as payment preimage for the created invoice. By default, if unspecified, lightningd will generate a secure pseudorandom preimage seeded from an appropriate entropy source on your system. **IMPORTANT**: if you specify the *preimage*, you are responsible, to ensure appropriate care for generating using a secure pseudorandom generator seeded with sufficient entropy, and keeping the preimage secret. This parameter is an advanced feature intended for use with cutting-edge cryptographic protocols and should not be used unless explicitly needed. -- **exposeprivatechannels** (one of, optional): If specified, it overrides the default route hint logic, which will use unpublished channels only if there are no published channels.: - - (boolean): If *True* unpublished channels are always considered as a route hint candidate; if *False*, never. - - (array of short\_channel\_ids): Array of short channel ids (or a remote alias), only those specific channels will be considered candidates, even if they are public or dead-ends. - - (short\_channel\_id, optional) - - (short\_channel\_id): If it is a short channel id (e.g. *1x1x3*), only this specific channel will be considered candidate, even if it is public or dead-end. -- **cltv** (u32, optional): If specified, sets the *min\_final\_cltv\_expiry* for the invoice. Otherwise, it's set to the parameter **cltv-final**. -- **deschashonly** (boolean, optional): If True, then the bolt11 returned contains a hash of the *description*, rather than the *description* itself: this allows much longer descriptions, but they must be communicated via some other mechanism. The default is False. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:invoice#1", - "method": "invoice", - "params": { - "amount_msat": 11000000, - "label": "xEoCR94SIz6UIRUEkxum", - "description": [ - "XEoCR94SIz6UIRUEkxum." - ], - "expiry": null, - "fallbacks": null, - "preimage": null, - "exposeprivatechannels": null, - "cltv": null, - "deschashonly": null - } -} -{ - "id": "example:invoice#2", - "method": "invoice", - "params": { - "amount_msat": 100, - "label": "8", - "description": "inv", - "expiry": null, - "fallbacks": null, - "preimage": null, - "exposeprivatechannels": null, - "cltv": null, - "deschashonly": null - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **bolt11** (string): The bolt11 string. -- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. -- **payment\_secret** (secret): The *payment\_secret* to place in the onion. -- **expires\_at** (u64): UNIX timestamp of when invoice expires. -- **created\_index** (u64): 1-based index indicating order this invoice was created in. *(added v23.08)* - -The following warnings may also be returned: - -- **warning\_capacity**: Even using all possible channels, there's not enough incoming capacity to pay this invoice. -- **warning\_offline**: There would be enough incoming capacity, but some channels are offline, so there isn't. -- **warning\_deadends**: There would be enough incoming capacity, but some channels are dead-ends (no other public channels from those peers), so there isn't. -- **warning\_private\_unused**: There would be enough incoming capacity, but some channels are unannounced and *exposeprivatechannels* is *false*, so there isn't. -- **warning\_mpp**: There is sufficient capacity, but not in a single channel, so the payer will have to use multi-part payments. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", - "expires_at": 1706757730, - "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk", - "payment_secret": "82644944d3f70d42aad1d5f7b5d7a629e7afa30b529cc952a4c59fc0e3790ea2", - "created_index": 1, - "warning_deadends": "Insufficient incoming capacity, once dead-end peers were excluded" -} -{ - "payment_hash": "f59ae0204dfe8e913207ea36646255b9d2c7c8229e8693d30547fc622eddb6b4", - "expires_at": 1709229182, - "bolt11": "lnbcrt1n1pja0z07sp5n8fk890nrq7zlcue0lgu7cduaaz765u5rg0kcud4amphuppu8wxspp57kdwqgzdl68fzvs8agmxgcj4h8fv0jpzn6rf85c9gl7xytkak66qdq9d9h8vxqyjw5qcqp99qxpqysgqrneaxh0plvjft457yv3q92rak57a6xw33m6phr0mrsy69sudzgez3adkzdsgwzy32z5usjpxm4rjgcg70h047wf0pgc4l9gyaj2h9ssqcrtv32", - "payment_secret": "99d36395f3183c2fe3997fd1cf61bcef45ed53941a1f6c71b5eec37e043c3b8d", - "created_index": 9, - "warning_capacity": "Insufficient incoming channel capacity to pay invoice" -} -``` - -ERRORS ------- - -On failure, an error is returned and no invoice is created. If the -lightning process fails before responding, the caller should use -lightning-listinvoices(7) to query whether this invoice was created or -not. - -The following error codes may occur: - -- -1: Catchall nonspecific error. -- 900: An invoice with the given *label* already exists. -- 901: An invoice with the given *preimage* already exists. -- 902: None of the specified *exposeprivatechannels* were usable. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-listinvoices(7), lightning-delinvoice(7), lightning-pay(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-invoicerequest.7.md b/doc/lightning-invoicerequest.7.md deleted file mode 100644 index 069f6128979b..000000000000 --- a/doc/lightning-invoicerequest.7.md +++ /dev/null @@ -1,85 +0,0 @@ -lightning-invoicerequest -- Command for offering payments -========================================================= - -SYNOPSIS --------- - -**(WARNING: experimental-offers only)** - -**invoicerequest** *amount* *description* [*issuer*] [*label*] [*absolute\_expiry*] [*single\_use*] - -DESCRIPTION ------------ - -Command *added* in v22.11. - -The **invoicerequest** RPC command creates an `invoice_request` to send payments: it automatically enables the processing of an incoming invoice, and payment of it. The reader of the resulting `invoice_request` can use lightning-sendinvoice(7) to collect their payment. - -- **amount** (msat): A positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. -- **description** (string): A short description of purpose of the payment, e.g. *ATM withdrawl*. This value is encoded into the resulting `invoice_request` and is viewable by anyone you expose it to. It must be UTF-8, and cannot use *\u* JSON escape codes. -- **issuer** (string, optional): Who is issuing it (i.e. you) if appropriate. -- **label** (string, optional): An internal-use name for the offer, which can be any UTF-8 string. -- **absolute\_expiry** (u64, optional): The time the offer is valid until, in seconds since the first day of 1970 UTC. If not set, the `invoice_request` remains valid (though it can be deactivated by the issuer of course). This is encoded in the `invoice_request`. -- **single\_use** (boolean, optional): Indicates that the `invoice_request` is only valid once; we may attempt multiple payments, but as soon as one is successful no more invoices are accepted (i.e. only one person can take the money). The default is True. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:invoicerequest#1", - "method": "invoicerequest", - "params": { - "amount": "10000sat", - "description": "simple test", - "issuer": "clightning test suite" - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **invreq\_id** (hash): The SHA256 hash of all invoice\_request fields less than 160. -- **active** (boolean) (always *true*): Whether the invoice\_request is currently active. -- **single\_use** (boolean): Whether the invoice\_request will become inactive after we pay an invoice for it. -- **bolt12** (string): The bolt12 string starting with lnr. -- **used** (boolean) (always *false*): Whether the invoice\_request has already been used. -- **label** (string, optional): The label provided when creating the invoice\_request. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "invreq_id": "715484ead84bcdae5b33e3015c686fa1bdd4ae9ade3c4729b58257a98cfcd9b5", - "active": true, - "single_use": true, - "bolt12": "lnr1qqgteyhfyp40c79a5y3gfe33nxfs6zstwd5k6urvv5s8getnwsfp2cmvd9nksarwd9hxwgr5v4ehggrnw45hge2syqrzymjxzydqkkw24ufxqslttwlj3s608f0rx2slc7etw0833zgs75srnztgqkppqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq633uzq99smfawuu6pz0zh9jl6dl8v25u3kzes975x2j9tr0qp0ux0tlzcxjrgehxh9luz5vwjpk92tys9f9zlm038krcz4uqfxgelwf43tgfc", - "used": false -} -``` - -ERRORS ------- - -On failure, an error is returned and no `invoice_request` is created. If the lightning process fails before responding, the caller should use lightning-listinvoicerequests(7) to query whether it was created or not. - -- -1: Catchall nonspecific error. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-listinvoicerequests(7), lightning-disableinvoicerequest(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-keysend.7.md b/doc/lightning-keysend.7.md deleted file mode 100644 index 1f16abb9b403..000000000000 --- a/doc/lightning-keysend.7.md +++ /dev/null @@ -1,202 +0,0 @@ -lightning-keysend -- Send funds to a node without an invoice -============================================================ - -SYNOPSIS --------- - -**keysend** *destination* *amount\_msat* [*label*] [*maxfeepercent*] [*retry\_for*] [*maxdelay*] [*exemptfee*] [*routehints*] [*extratlvs*] - -DESCRIPTION ------------ - -The **keysend** RPC command attempts to find a route to the given destination, and send the specified amount to it. Unlike the `pay` RPC command the `keysend` command does not require an invoice, instead it uses the `destination` node ID, and `amount` to find a route to the specified node. - -In order for the destination to be able to claim the payment, the `payment_key` is randomly generated by the sender and included in the encrypted payload for the destination. As a consequence there is not proof-of-payment, like there is with an invoice where the `payment_key` is generated on the destination, and the only way sender could have it is by sending a payment. Please ensure that this matches your use-case when using `keysend`. - -When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name. - -- **destination** (pubkey): The 33 byte, hex-encoded, node ID of the node that the payment should go to. -- **amount\_msat** (msat): A whole number, or a whole number with suffix `msat` or `sat`, or a three decimal point number with suffix `sat`, or an 1 to 11 decimal point number suffixed by `btc`. -- **label** (string, optional): Used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7). -- **maxfeepercent** (number, optional): Limits the money paid in fees as percentage of the total amount that is to be transferred. The default is 0.5. -- **retry\_for** (u32, optional): Until *retry\_for* seconds passes, the command will keep finding routes and retrying the payment. However, a payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case. The default is 60 seconds. -- **maxdelay** (u32, optional): Number of blocks the payment may be delayed. -- **exemptfee** (msat, optional): Used for tiny payments which would be dominated by the fee leveraged by forwarding nodes. Setting `exemptfee` allows the `maxfeepercent` check to be skipped on fees that are smaller than *exemptfee*. The default is 5000 millisatoshi. -- **routehints** (array of arrays, optional): - - (array of objects) - - **id** (pubkey) - - **scid** (short\_channel\_id) - - **feebase** (msat) - - **feeprop** (u32) - - **expirydelta** (u16) -- **extratlvs** (object, optional): Dictionary of additional fields to insert into the final tlv. The format is 'fieldnumber': 'hexstring'.: - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:keysend#1", - "method": "keysend", - "params": { - "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "amount_msat": 10000, - "label": null, - "maxfeepercent": null, - "retry_for": null, - "maxdelay": null, - "exemptfee": null, - "extratlvs": null - } -} -{ - "id": "example:keysend#2", - "method": "keysend", - "params": { - "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "amount_msat": 10000000, - "label": null, - "maxfeepercent": null, - "retry_for": null, - "maxdelay": null, - "exemptfee": null, - "extratlvs": { - "133773310": "68656c6c6f776f726c64", - "133773312": "66696c7465726d65" - } - } -} -{ - "id": "example:keysend#3", - "method": "keysend", - "params": { - "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "amount_msat": 10000, - "routehints": [ - [ - { - "scid": "4615051x2233541x57738", - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "feebase": 1, - "feeprop": 10, - "expirydelta": 9 - } - ], - [ - { - "scid": "1x2x3", - "id": "020202020202020202020202020202020202020202020202020202020202020202", - "feebase": 1, - "feeprop": 1, - "expirydelta": 9 - } - ] - ] - } -} -``` - -RANDOMIZATION -------------- - -To protect user privacy, the payment algorithm performs some randomization. - -1: Route Randomization - -Route randomization means the payment algorithm does not always use the lowest-fee or shortest route. This prevents some highly-connected node from learning all of the user payments by reducing their fees below the network average. - -2: Shadow Route - -Shadow route means the payment algorithm will virtually extend the route by adding delays and fees along it, making it appear to intermediate nodes that the route is longer than it actually is. This prevents intermediate nodes from reliably guessing their distance from the payee. - -Route randomization will never exceed *maxfeepercent* of the payment. Route randomization and shadow routing will not take routes that would exceed *maxdelay*. - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **payment\_preimage** (secret): The proof of payment: SHA256 of this **payment\_hash**. -- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. -- **created\_at** (number): The UNIX timestamp showing when this payment was initiated. -- **parts** (u32): How many attempts this took. -- **amount\_msat** (msat): Amount the recipient received. -- **amount\_sent\_msat** (msat): Total amount we sent (including fees). -- **status** (string) (always "complete"): Status of payment. -- **destination** (pubkey, optional): The final destination of the payment. - -The following warnings may also be returned: - -- **warning\_partial\_completion**: Not all parts of a multi-part payment have completed. - -You can monitor the progress and retries of a payment using the lightning-paystatus(7) command. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "payment_hash": "b6f88603008a9f7dd84b1b94c7b972c8efbaf0b86c8d3c04512955992da9028e", - "created_at": 1706315742.6861734, - "parts": 1, - "amount_msat": 10000, - "amount_sent_msat": 10001, - "payment_preimage": "7178cf708e34dce816fc35aa692a65e1f85b92ae03bbc8ae6543302511823174", - "status": "complete" -} -{ - "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "payment_hash": "e8474eea8d5673e8407ef5f4924e58479b51a68afd136384683d5d6a97c9520d", - "created_at": 1708640424.1810749, - "parts": 1, - "amount_msat": 10000000, - "amount_sent_msat": 10000000, - "payment_preimage": "40e47272ea7da20c57a2381d81a5513ec03bd8ead9d51fbd2a91ec76d3f4bcbf", - "status": "complete" -} -{ - "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "payment_hash": "56e12e6f45120bef7385c9bf307319eaa6a1b9160cdb3e62a3f492abf5bfa4bc", - "created_at": 1708640437.2895157, - "parts": 1, - "amount_msat": 10000, - "amount_sent_msat": 10001, - "payment_preimage": "682870b8f96e2aed1c86694dbb2c3e64cd396b9bba9fafd824d90eb0bd371b85", - "status": "complete" -} -``` - -ERRORS ------- - -The following error codes may occur: - -- -1: Catchall nonspecific error. -- 203: Permanent failure at destination. The *data* field of the error will be routing failure object. -- 205: Unable to find a route. -- 206: Route too expensive. Either the fee or the needed total locktime for the route exceeds your *maxfeepercent* or *maxdelay* settings, respectively. The *data* field of the error will indicate the actual *fee* as well as the *feepercent* percentage that the fee has of the destination payment amount. It will also indicate the actual *delay* along the route. -- 210: Payment timed out without a payment in progress. - -A routing failure object has the fields below: - -*erring\_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on. -*erring\_node*: The hex string of the pubkey id of the node that reported the error. -*erring\_channel*: The short channel ID of the channel that has the error, or *0:0:0* if the destination node raised the error. -*failcode*: The failure code, as per BOLT #4. -*channel\_update*: The hex string of the *channel\_update* message received from the remote node. Only present if error is from the remote node and the *failcode* has the `UPDATE` bit set, as per BOLT #4. - -AUTHOR ------- - -Christian Decker <> is mainly responsible. - -SEE ALSO --------- - -lightning-listpays(7), lightning-decodepay(7), lightning-listinvoice(7), lightning-delinvoice(7), lightning-getroute(7), lightning-invoice(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-listchannels.7.md b/doc/lightning-listchannels.7.md deleted file mode 100644 index ab1ee903dc40..000000000000 --- a/doc/lightning-listchannels.7.md +++ /dev/null @@ -1,139 +0,0 @@ -lightning-listchannels -- Command to query active lightning channels in the entire network -========================================================================================== - -SYNOPSIS --------- - -**listchannels** [*short\_channel\_id*] [*source*] [*destination*] - -DESCRIPTION ------------ - -The **listchannels** RPC command returns data on channels that are known to the node. Because channels may be bidirectional, up to 2 objects will be returned for each channel (one for each direction). - -Only one of *short\_channel\_id*, *source* or *destination* can be supplied. If nothing is supplied, data on all lightning channels known to this node, are returned. These can be local channels or public channels broadcast on the gossip network. - -- **short\_channel\_id** (short\_channel\_id, optional): If short\_channel\_id is a short channel id, then only known channels with a matching short\_channel\_id are returned. Otherwise, it must be null. -- **source** (pubkey, optional): If source is a node id, then only channels leading from that node id are returned. -- **destination** (pubkey, optional): If destination is a node id, then only channels leading to that node id are returned. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:listchannels#1", - "method": "listchannels", - "params": { - "short_channel_id": "103x1x0", - "source": null, - "destination": null - } -} -{ - "id": "example:listchannels#2", - "method": "listchannels", - "params": { - "short_channel_id": null, - "source": null, - "destination": null - } -} -``` - -RETURN VALUE ------------- - -On success, an object containing **channels** is returned. It is an array of objects, where each object contains: - -- **source** (pubkey): The source node. -- **destination** (pubkey): The destination node. -- **short\_channel\_id** (short\_channel\_id): Short channel id of channel. -- **direction** (u32): Direction (0 if source < destination, 1 otherwise). -- **public** (boolean): True if this is announced (from *v24.02*, being false is deprecated). -- **amount\_msat** (msat): The total capacity of this channel (always a whole number of satoshis). -- **message\_flags** (u8): As defined by BOLT #7. -- **channel\_flags** (u8): As defined by BOLT #7. -- **active** (boolean): True unless source has disabled it (or (deprecated in *v24.02*) it's a local channel and the peer is disconnected or it's still opening or closing). -- **last\_update** (u32): UNIX timestamp on the last channel\_update from *source*. -- **base\_fee\_millisatoshi** (u32): Base fee changed by *source* to use this channel. -- **fee\_per\_millionth** (u32): Proportional fee changed by *source* to use this channel, in parts-per-million. -- **delay** (u32): The number of blocks delay required by *source* to use this channel. -- **htlc\_minimum\_msat** (msat): The smallest payment *source* will allow via this channel. -- **features** (hex): BOLT #9 features bitmap for this channel. -- **htlc\_maximum\_msat** (msat, optional): The largest payment *source* will allow via this channel. - -If one of *short\_channel\_id*, *source* or *destination* is supplied and no matching channels are found, a 'channels' object with an empty list is returned. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "channels": [] -} -{ - "channels": [ - { - "source": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "short_channel_id": "103x1x0", - "direction": 0, - "public": true, - "amount_msat": 1000000000, - "message_flags": 1, - "channel_flags": 0, - "active": true, - "last_update": 1706153393, - "base_fee_millisatoshi": 1, - "fee_per_millionth": 10, - "delay": 6, - "htlc_minimum_msat": 0, - "htlc_maximum_msat": 990000000, - "features": "" - }, - { - "source": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "short_channel_id": "103x1x0", - "direction": 1, - "public": true, - "amount_msat": 1000000000, - "message_flags": 1, - "channel_flags": 1, - "active": true, - "last_update": 1706153393, - "base_fee_millisatoshi": 1, - "fee_per_millionth": 10, - "delay": 6, - "htlc_minimum_msat": 0, - "htlc_maximum_msat": 990000000, - "features": "" - } - ] -} -``` - -ERRORS ------- - -On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -- -32602: If the given parameters are wrong. - -AUTHOR ------- - -Michael Hawkins <>. - -SEE ALSO --------- - -lightning-fundchannel(7), lightning-listnodes(7) - -RESOURCES ---------- - -Main web site: - -BOLT #7: diff --git a/doc/lightning-listclosedchannels.7.md b/doc/lightning-listclosedchannels.7.md deleted file mode 100644 index 324edb4595d6..000000000000 --- a/doc/lightning-listclosedchannels.7.md +++ /dev/null @@ -1,75 +0,0 @@ -lightning-listclosedchannels -- Get data on our closed historical channels -========================================================================== - -SYNOPSIS --------- - -**listclosedchannels** [*id*] - -DESCRIPTION ------------ - -Command *added* in v23.05. - -The **listclosedchannels** RPC command returns data on channels which are otherwise forgotten (more than 100 blocks after they're completely resolved onchain). - -- **id** (pubkey, optional): If no *id* is supplied, then channel data on all historical channels are given. Supplying *id* will filter the results to only match channels to that peer. Note that prior to v23.05, old peers were forgotten. - -RETURN VALUE ------------- - -On success, an object containing **closedchannels** is returned. It is an array of objects, where each object contains: - -- **channel\_id** (hash): The full channel\_id (funding txid Xored with output number). -- **opener** (string) (one of "local", "remote"): Who initiated the channel. -- **private** (boolean): If True, we will not announce this channel. -- **total\_local\_commitments** (u64): Number of commitment transaction we made. -- **total\_remote\_commitments** (u64): Number of commitment transaction they made. -- **total\_htlcs\_sent** (u64): Number of HTLCs we ever sent. -- **funding\_txid** (txid): ID of the funding transaction. -- **funding\_outnum** (u32): The 0-based output number of the funding transaction which opens the channel. -- **leased** (boolean): Whether this channel was leased from `opener`. -- **total\_msat** (msat): Total amount in the channel. -- **final\_to\_us\_msat** (msat): Our balance in final commitment transaction. -- **min\_to\_us\_msat** (msat): Least amount owed to us ever. If the peer were to successfully steal from us, this is the amount we would still retain. -- **max\_to\_us\_msat** (msat): Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get. -- **close\_cause** (string) (one of "unknown", "local", "user", "remote", "protocol", "onchain"): What caused the channel to close. -- **peer\_id** (pubkey, optional): Peer public key (can be missing with pre-v23.05 closes!). -- **short\_channel\_id** (short\_channel\_id, optional): The short\_channel\_id. -- **alias** (object, optional): - - **local** (short\_channel\_id, optional): An alias assigned by this node to this channel, used for outgoing payments. - - **remote** (short\_channel\_id, optional): An alias assigned by the remote node to this channel, usable in routehints and invoices. -- **closer** (string, optional) (one of "local", "remote"): Who initiated the channel close (only present if closing). -- **channel\_type** (object, optional): Channel\_type as negotiated with peer.: - - **bits** (array of u32s): Each bit set in this channel\_type.: - - (u32, optional): Bit number. - - **names** (array of strings): Feature name for each bit set in this channel\_type.: - - (string, optional) (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even"): Name of feature bit. -- **funding\_fee\_paid\_msat** (msat, optional): How much we paid to lease the channel (iff `leased` is true and `opener` is local). -- **funding\_fee\_rcvd\_msat** (msat, optional): How much they paid to lease the channel (iff `leased` is true and `opener` is remote). -- **funding\_pushed\_msat** (msat, optional): How much `opener` pushed immediate (if non-zero). -- **last\_commitment\_txid** (hash, optional): The final commitment tx's txid (or mutual close, if we accepted it). Not present for some very old, small channels pre-0.7.0. -- **last\_commitment\_fee\_msat** (msat, optional): The fee on `last_commitment_txid`. -- **last\_stable\_connection** (u64, optional): Last time we reestablished the open channel and stayed connected for 1 minute. *(added v24.02)* - -ERRORS ------- - -On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -- -32602: If the given parameters are wrong. - -AUTHOR ------- - -Rusty Russell <>. - -SEE ALSO --------- - -lightning-listpeerchannels(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-listconfigs.7.md b/doc/lightning-listconfigs.7.md deleted file mode 100644 index 14c59bae34a8..000000000000 --- a/doc/lightning-listconfigs.7.md +++ /dev/null @@ -1,829 +0,0 @@ -lightning-listconfigs -- Command to list all configuration options. -=================================================================== - -SYNOPSIS --------- - -**listconfigs** [*config*] - -DESCRIPTION ------------ - -The **listconfigs** RPC command to list all configuration options, or with *config* only one. - -- **config** (string, optional): Configuration option name to restrict return. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:listconfigs#1", - "method": "listconfigs", - "params": { - "config": "network" - } -} -{ - "id": "example:listconfigs#2", - "method": "listconfigs", - "params": { - "config": null - } -} -{ - "id": "example:listconfigs#3", - "method": "listconfigs", - "params": { - "config": "experimental-dual-fund" - } -} -``` - -RETURN VALUE ------------- - -The returned values reflect the current configuration, including showing default values (`dev-` options are not shown unless specified as *config* explicitly). - -Note: as plugins can add options, not all configuration settings are listed here! The format of each entry is as follows: - -- **source** (string): source of configuration setting (`file`:`linenum`) -- **dynamic** (boolean, optional): true if this option is settable via setconfig -- **plugin** (string, optional): set if this is from a plugin - -Depending on the option type, exactly one of the following is present: - -- **set** (boolean, optional): for simple flag options -- **value\_str** (string, optional): for string options -- **value\_msat** (msat, optional): for msat options -- **value\_int** (integer, optional): for integer options -- **value\_bool** (boolean, optional): for boolean options -On success, an object is returned, containing: - -- **configs** (object, optional) *(added v23.08)*: - - **conf** (object, optional): - - **value\_str** (string): Field from cmdline. - - **source** (string) (always "cmdline"): Source of configuration setting. - - **developer** (object, optional) *(added v23.08)*: - - **set** (boolean): `true` if set in config or cmdline. - - **source** (string): Source of configuration setting. - - **clear-plugins** (object, optional): - - **set** (boolean): `true` if set in config or cmdline. - - **source** (string): Source of configuration setting. - - **disable-mpp** (object, optional): - - **set** (boolean): `true` if set in config or cmdline. - - **source** (string): Source of configuration setting. - - **plugin** (string, optional): Plugin which registered this configuration setting. - - **mainnet** (object, optional): - - **set** (boolean): `true` if set in config or cmdline. - - **source** (string): Source of configuration setting. - - **regtest** (object, optional): - - **set** (boolean): `true` if set in config or cmdline. - - **source** (string): Source of configuration setting. - - **signet** (object, optional): - - **set** (boolean): `true` if set in config or cmdline. - - **source** (string): Source of configuration setting. - - **testnet** (object, optional): - - **set** (boolean): `true` if set in config or cmdline. - - **source** (string): Source of configuration setting. - - **important-plugin** (object, optional): - - **values\_str** (array of strings): - - (string, optional): Field from config or cmdline. - - **sources** (array of strings): - - (string, optional): Source of configuration setting. - - **plugin** (object, optional): - - **values\_str** (array of strings): - - (string, optional): Field from config or cmdline. - - **sources** (array of strings): - - (string, optional): Source of configuration setting. - - **plugin-dir** (object, optional): - - **values\_str** (array of strings): - - (string, optional): Field from config or cmdline. - - **sources** (array of strings): - - (string, optional): Source of configuration setting. - - **lightning-dir** (object, optional): - - **value\_str** (string): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **network** (object, optional): - - **value\_str** (string): Field from config or cmdline, or default (can also be changed by `testnet`, `signet`, `regtest` options!). - - **source** (string): Source of configuration setting. - - **allow-deprecated-apis** (object, optional): - - **value\_bool** (boolean): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **rpc-file** (object, optional): - - **value\_str** (string): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **disable-plugin** (object, optional): - - **values\_str** (array of strings): - - (string, optional): Field from config or cmdline. - - **sources** (array of strings): - - (string, optional): Source of configuration setting. - - **always-use-proxy** (object, optional): - - **value\_bool** (boolean): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **daemon** (object, optional): - - **set** (boolean): `true` if set in config or cmdline. - - **source** (string): Source of configuration setting. - - **wallet** (object, optional): - - **value\_str** (string): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **large-channels** (object, optional): - - **set** (boolean): `true` if set in config or cmdline. - - **source** (string): Source of configuration setting. - - **experimental-dual-fund** (object, optional): - - **set** (boolean): `true` if set in config or cmdline. - - **source** (string): Source of configuration setting. - - **experimental-splicing** (object, optional) *(added v23.08)*: - - **set** (boolean): `true` if set in config or cmdline. - - **source** (string): Source of configuration setting. - - **experimental-onion-messages** (object, optional): - - **set** (boolean): `true` if set in config or cmdline. - - **source** (string): Source of configuration setting. - - **experimental-offers** (object, optional): - - **set** (boolean): `true` if set in config or cmdline. - - **source** (string): Source of configuration setting. - - **experimental-shutdown-wrong-funding** (object, optional): - - **set** (boolean): `true` if set in config or cmdline. - - **source** (string): Source of configuration setting. - - **experimental-websocket-port** (object, optional): - - **value\_int** (u32): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **experimental-peer-storage** (object, optional) *(added v23.02)*: - - **set** (boolean): `true` if set in config or cmdline. - - **source** (string): Source of configuration setting. - - **experimental-anchors** (object, optional) *(added v23.08)*: - - **set** (boolean): `true` if set in config or cmdline. - - **source** (string): Source of configuration setting. - - **database-upgrade** (object, optional): - - **value\_bool** (boolean): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **rgb** (object, optional): - - **value\_str** (hex) (always 6 characters): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **alias** (object, optional): - - **value\_str** (string): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **pid-file** (object, optional): - - **value\_str** (string): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **ignore-fee-limits** (object, optional): - - **value\_bool** (boolean): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **watchtime-blocks** (object, optional): - - **value\_int** (u32): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **max-locktime-blocks** (object, optional): - - **value\_int** (u32): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **funding-confirms** (object, optional): - - **value\_int** (u32): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **cltv-delta** (object, optional): - - **value\_int** (u32): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **cltv-final** (object, optional): - - **value\_int** (u32): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **commit-time** (object, optional): - - **value\_int** (u32): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **fee-base** (object, optional): - - **value\_int** (u32): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **rescan** (object, optional): - - **value\_int** (integer): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **fee-per-satoshi** (object, optional): - - **value\_int** (u32): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **max-concurrent-htlcs** (object, optional): - - **value\_int** (u32): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **htlc-minimum-msat** (object, optional): - - **value\_msat** (msat): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **htlc-maximum-msat** (object, optional): - - **value\_msat** (msat): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **max-dust-htlc-exposure-msat** (object, optional): - - **value\_msat** (msat): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **min-capacity-sat** (object, optional): - - **value\_int** (u64): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **dynamic** (boolean, optional) (always *true*): Can this be set by setconfig(). - - **addr** (object, optional): - - **values\_str** (array of strings): - - (string, optional): Field from config or cmdline. - - **sources** (array of strings): - - (string, optional): Source of configuration setting. - - **announce-addr** (object, optional): - - **values\_str** (array of strings): - - (string, optional): Field from config or cmdline. - - **sources** (array of strings): - - (string, optional): Source of configuration setting. - - **bind-addr** (object, optional): - - **values\_str** (array of strings): - - (string, optional): Field from config or cmdline. - - **sources** (array of strings): - - (string, optional): Source of configuration setting. - - **offline** (object, optional): - - **set** (boolean): `true` if set in config or cmdline. - - **source** (string): Source of configuration setting. - - **autolisten** (object, optional): - - **value\_bool** (boolean): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **proxy** (object, optional): - - **value\_str** (string): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **disable-dns** (object, optional): - - **set** (boolean): `true` if set in config or cmdline. - - **source** (string): Source of configuration setting. - - **announce-addr-discovered** (object, optional) *(added v23.02)*: - - **value\_str** (string) (one of "true", "false", "auto"): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **announce-addr-discovered-port** (object, optional) *(added v23.02)*: - - **value\_int** (u32): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **encrypted-hsm** (object, optional): - - **set** (boolean): `true` if set in config or cmdline. - - **source** (string): Source of configuration setting. - - **rpc-file-mode** (object, optional): - - **value\_str** (string): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **log-level** (object, optional): - - **value\_str** (string): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **log-prefix** (object, optional): - - **value\_str** (string): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **log-file** (object, optional): - - **values\_str** (array of strings): - - (string, optional): Field from config or cmdline. - - **sources** (array of strings): - - (string, optional): Source of configuration setting. - - **log-timestamps** (object, optional): - - **value\_bool** (boolean): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **force-feerates** (object, optional): - - **value\_str** (string): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **subdaemon** (object, optional): - - **values\_str** (array of strings): - - (string, optional): Field from config or cmdline. - - **sources** (array of strings): - - (string, optional): Source of configuration setting. - - **fetchinvoice-noconnect** (object, optional): - - **set** (boolean): `true` if set in config or cmdline. - - **source** (string): Source of configuration setting. - - **accept-htlc-tlv-types** (object, optional): - - **value\_str** (string): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **tor-service-password** (object, optional): - - **value\_str** (string): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **announce-addr-dns** (object, optional): - - **value\_bool** (boolean): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **require-confirmed-inputs** (object, optional): - - **value\_bool** (boolean): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **commit-fee** (object, optional): - - **value\_int** (u64): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. - - **commit-feerate-offset** (object, optional): - - **value\_int** (u32): Field from config or cmdline, or default. - - **source** (string): Source of configuration setting. -- **# version** (string, optional): Special field indicating the current version. **deprecated in v23.08, removed after v24.02** -- **plugins** (array of objects, optional) **deprecated in v23.08, removed after v24.02**: - - **path** (string): Full path of the plugin. - - **name** (string): Short name of the plugin. - - **options** (object, optional): Specific options set for this plugin.: -- **important-plugins** (array of objects, optional) **deprecated in v23.08, removed after v24.02**: - - **path** (string): Full path of the plugin. - - **name** (string): Short name of the plugin. - - **options** (object, optional): Specific options set for this plugin.: -- **conf** (string, optional): `conf` field from cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **lightning-dir** (string, optional): `lightning-dir` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **network** (string, optional): `network` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **allow-deprecated-apis** (boolean, optional): `allow-deprecated-apis` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **rpc-file** (string, optional): `rpc-file` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **disable-plugin** (array of strings, optional) **deprecated in v23.08, removed after v24.02**: - - (string, optional): `disable-plugin` field from config or cmdline. -- **bookkeeper-dir** (string, optional): `bookkeeper-dir` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **bookkeeper-db** (string, optional): `bookkeeper-db` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **always-use-proxy** (boolean, optional): `always-use-proxy` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **daemon** (boolean, optional): `daemon` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **wallet** (string, optional): `wallet` field from config or cmdline default. **deprecated in v23.08, removed after v24.02** -- **large-channels** (boolean, optional): `large-channels` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **experimental-dual-fund** (boolean, optional): `experimental-dual-fund` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **experimental-splicing** (boolean, optional): `experimental-splicing` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **experimental-onion-messages** (boolean, optional): `experimental-onion-messages` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **experimental-offers** (boolean, optional): `experimental-offers` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **experimental-shutdown-wrong-funding** (boolean, optional): `experimental-shutdown-wrong-funding` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **experimental-websocket-port** (u16, optional): `experimental-websocket-port` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **experimental-peer-storage** (boolean, optional): `experimental-peer-storage` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** *(added v23.02)* -- **experimental-quiesce** (boolean, optional): `experimental-quiesce` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** *(added v23.08)* -- **experimental-upgrade-protocol** (boolean, optional): `experimental-upgrade-protocol` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** *(added v23.08)* -- **invoices-onchain-fallback** (boolean, optional): `invoices-onchain-fallback` field from config or cmdline, or default. *(added v23.11)* -- **database-upgrade** (boolean, optional): `database-upgrade` field from config or cmdline. **deprecated in v23.08, removed after v24.02** -- **rgb** (hex, optional) (always 6 characters): `rgb` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **alias** (string, optional): `alias` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **pid-file** (string, optional): `pid-file` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **ignore-fee-limits** (boolean, optional): `ignore-fee-limits` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **watchtime-blocks** (u32, optional): `watchtime-blocks` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **max-locktime-blocks** (u32, optional): `max-locktime-blocks` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **funding-confirms** (u32, optional): `funding-confirms` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **cltv-delta** (u32, optional): `cltv-delta` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **cltv-final** (u32, optional): `cltv-final` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **commit-time** (u32, optional): `commit-time` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **fee-base** (u32, optional): `fee-base` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **rescan** (integer, optional): `rescan` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **fee-per-satoshi** (u32, optional): `fee-per-satoshi` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **max-concurrent-htlcs** (u32, optional): `max-concurrent-htlcs` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **htlc-minimum-msat** (msat, optional): `htlc-minimum-msat` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **htlc-maximum-msat** (msat, optional): `htlc-maximum-msat` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **max-dust-htlc-exposure-msat** (msat, optional): `max-dust-htlc-exposure-mast` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **min-capacity-sat** (u64, optional): `min-capacity-sat` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **addr** (string, optional): `addr` field from config or cmdline (can be more than one). **deprecated in v23.08, removed after v24.02** -- **announce-addr** (string, optional): `announce-addr` field from config or cmdline (can be more than one). **deprecated in v23.08, removed after v24.02** -- **bind-addr** (string, optional): `bind-addr` field from config or cmdline (can be more than one). **deprecated in v23.08, removed after v24.02** -- **offline** (boolean, optional): `true` if `offline` was set in config or cmdline. **deprecated in v23.08, removed after v24.02** -- **autolisten** (boolean, optional): `autolisten` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **proxy** (string, optional): `proxy` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **disable-dns** (boolean, optional): `true` if `disable-dns` was set in config or cmdline. **deprecated in v23.08, removed after v24.02** -- **announce-addr-discovered** (string, optional): `true`/`false`/`auto` depending on how `announce-addr-discovered` was set in config or cmdline. **deprecated in v23.08, removed after v24.02** *(added v23.02)* -- **announce-addr-discovered-port** (integer, optional): Sets the announced TCP port for dynamically discovered IPs. **deprecated in v23.08, removed after v24.02** *(added v23.02)* -- **encrypted-hsm** (boolean, optional): `true` if `encrypted-hsm` was set in config or cmdline. **deprecated in v23.08, removed after v24.02** -- **rpc-file-mode** (string, optional): `rpc-file-mode` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **log-level** (string, optional): `log-level` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **log-prefix** (string, optional): `log-prefix` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **log-file** (string, optional): `log-file` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **log-timestamps** (boolean, optional): `log-timestamps` field from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **force-feerates** (string, optional): Force-feerate configuration setting, if any. **deprecated in v23.08, removed after v24.02** -- **subdaemon** (string, optional): `subdaemon` fields from config or cmdline if any (can be more than one). **deprecated in v23.08, removed after v24.02** -- **fetchinvoice-noconnect** (boolean, optional): `fetchinvoice-noconnect` fields from config or cmdline, or default. **deprecated in v23.08, removed after v24.02** -- **accept-htlc-tlv-types** (string, optional): `accept-htlc-tlv-types` field from config or cmdline, or not present. **deprecated in v23.08, removed after v24.02** -- **tor-service-password** (string, optional): `tor-service-password` field from config or cmdline, if any. **deprecated in v23.08, removed after v24.02** -- **dev-allowdustreserve** (boolean, optional): Whether we allow setting dust reserves. **deprecated in v23.08, removed after v24.02** -- **announce-addr-dns** (boolean, optional): Whether we put DNS entries into node\_announcement. **deprecated in v23.08, removed after v24.02** *(added v22.11.1)* -- **require-confirmed-inputs** (boolean, optional): Request peers to only send confirmed inputs (dual-fund only). **deprecated in v23.08, removed after v24.02** -- **developer** (boolean, optional): Whether developer mode is enabled. *(added v23.08)* -- **commit-fee** (u64, optional): The percentage of the 6-block fee estimate to use for commitment transactions. **deprecated in v23.08, removed after v24.02** *(added v23.05)* -- **min-emergency-msat** (msat, optional): Field from config or cmdline, or default. *(added v23.08)* -- **commit-feerate-offset** (u32, optional): Additional commitment feerate applied by channel owner. *(added v23.11)* - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "#version": "v0.9.0-1", - "lightning-dir": "/media/vincent/Maxtor/sanboxTestWrapperRPC/lightning_dir_dev", - "network": "testnet", - "allow-deprecated-apis": true, - "rpc-file": "lightning-rpc", - "plugins": [ - { - "path": "/home/vincent/Github/plugins/sauron/sauron.py", - "name": "sauron.py", - "options": { - "sauron-api-endpoint": "http://blockstream.info/testnet/api/", - "sauron-tor-proxy": "" - } - }, - { - "path": "/home/vincent/Github/reckless/reckless.py", - "name": "reckless.py" - } - ], - "important-plugins": [ - { - "path": "/home/vincent/Github/lightning/lightningd/../plugins/autoclean", - "name": "autoclean", - "options": { - "autocleaninvoice-cycle": null, - "autocleaninvoice-expired-by": null - } - }, - { - "path": "/home/vincent/Github/lightning/lightningd/../plugins/fundchannel", - "name": "fundchannel" - }, - { - "path": "/home/vincent/Github/lightning/lightningd/../plugins/keysend", - "name": "keysend" - }, - { - "path": "/home/vincent/Github/lightning/lightningd/../plugins/pay", - "name": "pay", - "options": { - "disable-mpp": false - } - } - ], - "important-plugin": "/home/vincent/Github/lightning/lightningd/../plugins/pay", - "plugin": "/home/vincent/Github/reckless/reckless.py", - "disable-plugin": [ - "bcli" - ], - "always-use-proxy": false, - "daemon": "false", - "wallet": "sqlite3:///media/vincent/Maxtor/sanboxTestWrapperRPC/lightning_dir_dev/testnet/lightningd.sqlite3", - "wumbo": true, - "rgb": "03ad98", - "alias": "BRUCEWAYN-TES-DEV", - "pid-file": "/media/vincent/Maxtor/sanboxTestWrapperRPC/lightning_dir_dev/lightningd-testne...", - "ignore-fee-limits": true, - "watchtime-blocks": 6, - "max-locktime-blocks": 2016, - "funding-confirms": 1, - "commit-fee-min": 0, - "commit-fee-max": 0, - "cltv-delta": 6, - "cltv-final": 10, - "commit-time": 10, - "fee-base": 1, - "rescan": 30, - "fee-per-satoshi": 10, - "max-concurrent-htlcs": 483, - "min-capacity-sat": 10000, - "addr": "autotor:127.0.0.1:9051", - "bind-addr": "127.0.0.1:9735", - "announce-addr": "fp463inc4w3lamhhduytrwdwq6q6uzugtaeapylqfc43agrdnnqsheyd.onion:9735", - "offline": "false", - "autolisten": true, - "proxy": "127.0.0.1:9050", - "disable-dns": "false", - "encrypted-hsm": false, - "rpc-file-mode": "0600", - "log-level": "DEBUG", - "log-prefix": "lightningd" -} -{ - "configs": { - "developer": { - "set": true, - "source": "cmdline" - }, - "lightning-dir": { - "value_str": "/tmp/ltests-giwf5tc7/test_plugin_start_1/lightning-1/", - "source": "cmdline" - }, - "network": { - "value_str": "regtest", - "source": "cmdline" - }, - "testnet": { - "set": false, - "source": "default" - }, - "signet": { - "set": false, - "source": "default" - }, - "mainnet": { - "set": false, - "source": "default" - }, - "regtest": { - "set": false, - "source": "default" - }, - "rpc-file": { - "value_str": "lightning-rpc", - "source": "default" - }, - "allow-deprecated-apis": { - "value_bool": false, - "source": "cmdline" - }, - "plugin": { - "values_str": [ - "~/lightning/target/debug/examples/cln-plugin-startup" - ], - "sources": [ - "cmdline" - ] - }, - "plugin-dir": { - "values_str": [], - "sources": [] - }, - "clear-plugins": { - "set": false, - "source": "default" - }, - "disable-plugin": { - "values_str": [], - "sources": [] - }, - "important-plugin": { - "values_str": [], - "sources": [] - }, - "always-use-proxy": { - "value_bool": false, - "source": "default" - }, - "daemon": { - "set": false, - "source": "default" - }, - "experimental-dual-fund": { - "set": false, - "source": "default" - }, - "experimental-splicing": { - "set": false, - "source": "default" - }, - "experimental-onion-messages": { - "set": false, - "source": "default" - }, - "experimental-offers": { - "set": false, - "source": "default" - }, - "experimental-shutdown-wrong-funding": { - "set": false, - "source": "default" - }, - "experimental-peer-storage": { - "set": false, - "source": "default" - }, - "experimental-quiesce": { - "set": false, - "source": "default" - }, - "experimental-anchors": { - "set": false, - "source": "default" - }, - "rgb": { - "value_str": "0266e4", - "source": "default" - }, - "alias": { - "value_str": "JUNIORBEAM-1-102-g7549e10-modded", - "source": "default" - }, - "pid-file": { - "value_str": "/tmp/ltests-giwf5tc7/test_plugin_start_1/lightning-1/lightningd-regtest.pid", - "source": "default" - }, - "ignore-fee-limits": { - "value_bool": false, - "source": "cmdline" - }, - "watchtime-blocks": { - "value_int": 5, - "source": "cmdline" - }, - "max-locktime-blocks": { - "value_int": 2016, - "source": "default" - }, - "funding-confirms": { - "value_int": 1, - "source": "default" - }, - "require-confirmed-inputs": { - "value_bool": false, - "source": "default" - }, - "cltv-delta": { - "value_int": 6, - "source": "cmdline" - }, - "cltv-final": { - "value_int": 5, - "source": "cmdline" - }, - "commit-time": { - "value_int": 10, - "source": "default" - }, - "fee-base": { - "value_int": 1, - "source": "default" - }, - "rescan": { - "value_int": 1, - "source": "cmdline" - }, - "fee-per-satoshi": { - "value_int": 10, - "source": "default" - }, - "htlc-minimum-msat": { - "value_msat": 0, - "source": "default" - }, - "htlc-maximum-msat": { - "value_msat": 18446744073709552000, - "source": "default" - }, - "max-concurrent-htlcs": { - "value_int": 483, - "source": "default" - }, - "max-dust-htlc-exposure-msat": { - "value_msat": 50000000, - "source": "default" - }, - "min-capacity-sat": { - "value_int": 10000, - "source": "default", - "dynamic": true - }, - "addr": { - "values_str": [ - "127.0.0.1:33157" - ], - "sources": [ - "cmdline" - ] - }, - "bind-addr": { - "values_str": [], - "sources": [] - }, - "announce-addr": { - "values_str": [], - "sources": [] - }, - "announce-addr-discovered": { - "value_str": "auto", - "source": "default" - }, - "announce-addr-discovered-port": { - "value_int": 19846, - "source": "default" - }, - "offline": { - "set": false, - "source": "default" - }, - "autolisten": { - "value_bool": false, - "source": "default" - }, - "accept-htlc-tlv-type": { - "values_int": [], - "sources": [] - }, - "disable-dns": { - "set": true, - "source": "cmdline" - }, - "encrypted-hsm": { - "set": false, - "source": "default" - }, - "rpc-file-mode": { - "value_str": "0600", - "source": "default" - }, - "commit-fee": { - "value_int": 100, - "source": "default" - }, - "commit-feerate-offset": { - "value_int": 5, - "source": "default" - }, - "min-emergency-msat": { - "value_msat": 25000000, - "source": "default" - }, - "subdaemon": { - "values_str": [], - "sources": [] - }, - "experimental-upgrade-protocol": { - "set": false, - "source": "default" - }, - "invoices-onchain-fallback": { - "set": false, - "source": "default" - }, - "log-level": { - "value_str": "debug", - "source": "cmdline" - }, - "log-timestamps": { - "value_bool": true, - "source": "default" - }, - "log-prefix": { - "value_str": "lightningd-1 ", - "source": "cmdline" - }, - "log-file": { - "values_str": [ - "-", - "/tmp/ltests-giwf5tc7/test_plugin_start_1/lightning-1/log" - ], - "sources": [ - "cmdline", - "cmdline" - ] - }, - "dev-no-plugin-checksum": { - "set": true, - "source": "cmdline" - }, - "dev-no-reconnect": { - "set": true, - "source": "cmdline" - }, - "dev-fail-on-subdaemon-fail": { - "set": true, - "source": "cmdline" - }, - "dev-bitcoind-poll": { - "value_int": 1, - "source": "cmdline" - }, - "dev-fast-gossip": { - "set": true, - "source": "cmdline" - }, - "renepay-debug-mcf": { - "set": false, - "source": "default", - "plugin": "~/lightning/plugins/cln-renepay" - }, - "renepay-debug-payflow": { - "set": false, - "source": "default", - "plugin": "~/lightning/plugins/cln-renepay" - }, - "test-option": { - "value_int": 31337, - "source": "cmdline", - "plugin": "~/lightning/target/debug/examples/cln-plugin-startup" - }, - "bitcoin-datadir": { - "value_str": "/tmp/ltests-giwf5tc7/test_plugin_start_1/lightning-1/", - "source": "cmdline", - "plugin": "~/lightning/plugins/bcli" - }, - "bitcoin-rpcuser": { - "value_str": "rpcuser", - "source": "cmdline", - "plugin": "~/lightning/plugins/bcli" - }, - "bitcoin-rpcpassword": { - "value_str": "rpcpass", - "source": "cmdline", - "plugin": "~/lightning/plugins/bcli" - }, - "bitcoin-rpcport": { - "value_int": 51309, - "source": "cmdline", - "plugin": "~/lightning/plugins/bcli" - }, - "disable-mpp": { - "set": false, - "source": "default", - "plugin": "~/lightning/plugins/pay" - } - } -} -{ - "configs": { - "experimental-dual-fund": { - "set": false, - "source": "default" - } - } -} -``` - -ERRORS ------- - -On failure, one of the following error codes may be returned: - -- -32602: Error in given parameters or field with *config* name doesn't exist. - -AUTHOR ------- - -Vincenzo Palazzo <> wrote the initial version of this man page, -but many others did the hard work of actually implementing this rpc command. - -SEE ALSO --------- - -lightning-getinfo(7), lightningd-config(5) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-listdatastore.7.md b/doc/lightning-listdatastore.7.md deleted file mode 100644 index 7e115feeff9b..000000000000 --- a/doc/lightning-listdatastore.7.md +++ /dev/null @@ -1,95 +0,0 @@ -lightning-listdatastore -- Command for listing (plugin) data -============================================================ - -SYNOPSIS --------- - -**listdatastore** [*key*] - -DESCRIPTION ------------ - -The **listdatastore** RPC command allows plugins to fetch data which was stored in the Core Lightning database. - -- **key** (one of, optional): - - (array of strings): All immediate children of the *key* (or root children) are returned. - Using the first element of the key as the plugin name (e.g. `[ 'summary' ]`) is recommended. - An array of values to form a hierarchy (though a single value is treated as a one-element array). - - (string, optional) - - (string) - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:listdatastore#1", - "method": "listdatastore", - "params": { - "key": [ - "commando" - ] - } -} -{ - "id": "example:listdatastore#2", - "method": "listdatastore", - "params": { - "key": "otherkey" - } -} -``` - -RETURN VALUE ------------- - -On success, an object containing **datastore** is returned. It is an array of objects, where each object contains: - -- **key** (array of strings): - - (string, optional): Part of the key added to the datastore. -- **generation** (u64, optional): The number of times this has been updated. -- **hex** (hex, optional): The hex data from the datastore. -- **string** (string, optional): The data as a string, if it's valid utf-8. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "datastore": [] -} -{ - "datastore": [ - { - "key": [ - "otherkey" - ], - "generation": 0, - "hex": "6f7468657264617461", - "string": "otherdata" - } - ] -} -``` - -ERRORS ------- - -The following error codes may occur: - -- -32602: invalid parameters. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-datastore(7), lightning-deldatastore(7), lightning-datastoreusage(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-listforwards.7.md b/doc/lightning-listforwards.7.md deleted file mode 100644 index 262ac726461e..000000000000 --- a/doc/lightning-listforwards.7.md +++ /dev/null @@ -1,147 +0,0 @@ -lightning-listforwards -- Command showing all htlcs and their information -========================================================================= - -SYNOPSIS --------- - -**listforwards** [*status*] [*in\_channel*] [*out\_channel*] [*index* [*start*] [*limit*]] - -DESCRIPTION ------------ - -The **listforwards** RPC command displays all htlcs that have been attempted to be forwarded by the Core Lightning node. - -- **status** (string, optional) (one of "offered", "settled", "local\_failed", "failed"): If specified, then only the forwards with the given status are returned. -- **in\_channel** (short\_channel\_id, optional): Only the matching forwards on the given inbound channel are returned. -- **out\_channel** (short\_channel\_id, optional): Only the matching forwards on the given outbount channel are returned. -- **index** (string, optional) (one of "created", "updated"): If neither *in\_channel* nor *out\_channel* is specified, it controls ordering. The default is `created`. *(added v23.11)* -- **start** (u64, optional): If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7). *(added v23.11)* -- **limit** (u32, optional): If `index` is specified, `limit` can be used to specify the maximum number of entries to return. *(added v23.11)* - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:listforwards#1", - "method": "listforwards", - "params": { - "status": null, - "in_channel": null, - "out_channel": null, - "index": null, - "start": null, - "limit": null - } -} -{ - "id": "example:listforwards#2", - "method": "listforwards", - "params": { - "in_channel": "0x1x2", - "out_channel": "0x2x3", - "status": "settled" - } -} -``` - -RETURN VALUE ------------- - -On success, an object containing **forwards** is returned. It is an array of objects, where each object contains: - -- **created\_index** (u64): 1-based index indicating order this forward was created in. *(added v23.11)* -- **in\_channel** (short\_channel\_id): The channel that received the HTLC. -- **in\_msat** (msat): The value of the incoming HTLC. -- **status** (string) (one of "offered", "settled", "local\_failed", "failed"): Still ongoing, completed, failed locally, or failed after forwarding. -- **received\_time** (number): The UNIX timestamp when this was received. -- **in\_htlc\_id** (u64, optional): The unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11). -- **out\_channel** (short\_channel\_id, optional): The channel that the HTLC (trying to) forward to. -- **out\_htlc\_id** (u64, optional): The unique HTLC id we gave this when sending (may be missing even if out\_channel is present, for old forwards before v22.11). -- **updated\_index** (u64, optional): 1-based index indicating order this forward was changed (only present if it has changed since creation). *(added v23.11)* -- **style** (string, optional) (one of "legacy", "tlv"): Either a legacy onion format or a modern tlv format. - -If **out\_msat** is present: - - **fee\_msat** (msat): The amount this paid in fees. - - **out\_msat** (msat): The amount we sent out the *out\_channel*. - -If **status** is "settled" or "failed": - - **resolved\_time** (number): The UNIX timestamp when this was resolved. - -If **status** is "local\_failed" or "failed": - - **failcode** (u32, optional): The numeric onion code returned. - - **failreason** (string, optional): The name of the onion code returned. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "forwards": [ - { - "created_index": 1, - "updated_index": 1, - "in_channel": "103x1x0", - "in_htlc_id": 0, - "out_channel": "104x1x0", - "out_htlc_id": 0, - "in_msat": 100001001, - "out_msat": 100000000, - "fee_msat": 1001, - "status": "settled", - "style": "tlv", - "received_time": 1706229285.5934534, - "resolved_time": 1706229288.830004 - }, - { - "created_index": 2, - "updated_index": 2, - "in_channel": "103x1x0", - "in_htlc_id": 1, - "out_channel": "105x1x0", - "out_htlc_id": 0, - "in_msat": 100001001, - "out_msat": 100000000, - "fee_msat": 1001, - "status": "failed", - "style": "tlv", - "received_time": 1706229290.0289993, - "resolved_time": 1706229292.9487684 - }, - { - "created_index": 3, - "updated_index": 3, - "in_channel": "103x1x0", - "in_htlc_id": 2, - "out_channel": "106x1x0", - "out_htlc_id": 0, - "in_msat": 100001000, - "out_msat": 99999999, - "fee_msat": 1001, - "status": "local_failed", - "failcode": 16392, - "failreason": "WIRE_PERMANENT_CHANNEL_FAILURE", - "style": "tlv", - "received_time": 1706229295.3175724 - } - ] -} -{ - "forwards": [] -} -``` - -AUTHOR ------- - -Rene Pickhardt <> is mainly responsible. - -SEE ALSO --------- - -lightning-autoclean-status(7), lightning-getinfo(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-listfunds.7.md b/doc/lightning-listfunds.7.md deleted file mode 100644 index 6ee0d1804ab7..000000000000 --- a/doc/lightning-listfunds.7.md +++ /dev/null @@ -1,109 +0,0 @@ -lightning-listfunds -- Command showing all funds currently managed by the Core Lightning node -============================================================================================= - -SYNOPSIS --------- - -**listfunds** [*spent*] - -DESCRIPTION ------------ - -The **listfunds** RPC command displays all funds available, either in unspent outputs (UTXOs) in the internal wallet or funds locked in currently open channels. - -- **spent** (boolean, optional): If True, then the *outputs* will include spent outputs in addition to the unspent ones. The default is False. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:listfunds#1", - "method": "listfunds", - "params": { - "spent": null - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **outputs** (array of objects): - - **txid** (txid): The ID of the spendable transaction. - - **output** (u32): The index within *txid*. - - **amount\_msat** (msat): The amount of the output. - - **scriptpubkey** (hex): The scriptPubkey of the output. - - **status** (string) (one of "unconfirmed", "confirmed", "spent", "immature") - - **reserved** (boolean): Whether this UTXO is currently reserved for an in-flight tx. - - **address** (string, optional): The bitcoin address of the output. - - **redeemscript** (hex, optional): The redeemscript, only if it's p2sh-wrapped. - - If **status** is "confirmed": - - **blockheight** (u32): Block height where it was confirmed. - - If **reserved** is "true": - - **reserved\_to\_block** (u32): Block height where reservation will expire. -- **channels** (array of objects): - - **peer\_id** (pubkey): The peer with which the channel is opened. - - **our\_amount\_msat** (msat): Available satoshis on our node's end of the channel. - - **amount\_msat** (msat): Total channel value. - - **funding\_txid** (txid): Funding transaction id. - - **funding\_output** (u32): The 0-based index of the output in the funding transaction. - - **connected** (boolean): Whether the channel peer is connected. - - **state** (string) (one of "OPENINGD", "CHANNELD\_AWAITING\_LOCKIN", "CHANNELD\_NORMAL", "CHANNELD\_SHUTTING\_DOWN", "CLOSINGD\_SIGEXCHANGE", "CLOSINGD\_COMPLETE", "AWAITING\_UNILATERAL", "FUNDING\_SPEND\_SEEN", "ONCHAIN", "DUALOPEND\_OPEN\_INIT", "DUALOPEND\_AWAITING\_LOCKIN", "DUALOPEND\_OPEN\_COMMITTED", "DUALOPEND\_OPEN\_COMMIT\_READY"): The channel state, in particular `CHANNELD_NORMAL` means the channel can be used normally. - - **channel\_id** (hash): The full channel\_id (funding txid Xored with output number). *(added v23.05)* - - If **state** is "CHANNELD\_NORMAL": - - **short\_channel\_id** (short\_channel\_id): Short channel id of channel. - - If **state** is "CHANNELD\_SHUTTING\_DOWN", "CLOSINGD\_SIGEXCHANGE", "CLOSINGD\_COMPLETE", "AWAITING\_UNILATERAL", "FUNDING\_SPEND\_SEEN" or "ONCHAIN": - - **short\_channel\_id** (short\_channel\_id, optional): Short channel id of channel (only if funding reached lockin depth before closing). - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "outputs": [ - { - "txid": "0f184b101569bf777af3449fa266948a9d55768f97867e48416a2c92858dd1bc", - "output": 1, - "amount_msat": 1111111000, - "scriptpubkey": "001401fad90abcd66697e2592164722de4a95ebee165", - "address": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf", - "status": "confirmed", - "blockheight": 102, - "reserved": false - }, - { - "txid": "4bee7dc3a28f2434e9bb3e9aaab418dd276485a8705b0f787bf741d3f979ec3b", - "output": 1, - "amount_msat": 1111111000, - "scriptpubkey": "001401fad90abcd66697e2592164722de4a95ebee165", - "address": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf", - "status": "confirmed", - "blockheight": 102, - "reserved": false - } - ], - "channels": [] -} -``` - -AUTHOR ------- - -Felix <> is mainly responsible. - -SEE ALSO --------- - -lightning-newaddr(7), lightning-fundchannel(7), lightning-withdraw(7), lightning-listtransactions(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-listhtlcs.7.md b/doc/lightning-listhtlcs.7.md deleted file mode 100644 index 5ef3ccf03e4a..000000000000 --- a/doc/lightning-listhtlcs.7.md +++ /dev/null @@ -1,184 +0,0 @@ -lightning-listhtlcs -- Command for querying HTLCs -================================================= - -SYNOPSIS --------- - -**listhtlcs** [*id*] - -DESCRIPTION ------------ - -The **listhtlcs** RPC command gets all HTLCs (which, generally, we remember for as long as a channel is open, even if they've completed long ago). - -- **id** (string, optional): A short channel id (e.g. 1x2x3) or full 64-byte hex channel id, it will only list htlcs for that channel (which must be known). - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:listhtlcs#1", - "method": "listhtlcs", - "params": "{}" -} -{ - "id": "example:listhtlcs#2", - "method": "listhtlcs", - "params": [ - "103x2x0" - ] -} -{ - "id": "example:listhtlcs#3", - "method": "listhtlcs", - "params": [ - "436c2658eb4f4689b42ff11b8b05f31ba09860d0df7168085e0796cdf40f85e0" - ] -} -``` - -RETURN VALUE ------------- - -On success, an object containing **htlcs** is returned. It is an array of objects, where each object contains: - -- **short\_channel\_id** (short\_channel\_id): The channel that contains/contained the HTLC. -- **id** (u64): The unique, incrementing HTLC id the creator gave this. -- **expiry** (u32): The block number where this HTLC expires/expired. -- **amount\_msat** (msat): The value of the HTLC. -- **direction** (string) (one of "out", "in"): Out if we offered this to the peer, in if they offered it. -- **payment\_hash** (hash): Payment hash sought by HTLC. -- **state** (string) (one of "SENT\_ADD\_HTLC", "SENT\_ADD\_COMMIT", "RCVD\_ADD\_REVOCATION", "RCVD\_ADD\_ACK\_COMMIT", "SENT\_ADD\_ACK\_REVOCATION", "RCVD\_REMOVE\_HTLC", "RCVD\_REMOVE\_COMMIT", "SENT\_REMOVE\_REVOCATION", "SENT\_REMOVE\_ACK\_COMMIT", "RCVD\_REMOVE\_ACK\_REVOCATION", "RCVD\_ADD\_HTLC", "RCVD\_ADD\_COMMIT", "SENT\_ADD\_REVOCATION", "SENT\_ADD\_ACK\_COMMIT", "RCVD\_ADD\_ACK\_REVOCATION", "SENT\_REMOVE\_HTLC", "SENT\_REMOVE\_COMMIT", "RCVD\_REMOVE\_REVOCATION", "RCVD\_REMOVE\_ACK\_COMMIT", "SENT\_REMOVE\_ACK\_REVOCATION"): The first 10 states are for `in`, the next 10 are for `out`. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "htlcs": [ - { - "short_channel_id": "103x1x0", - "id": 0, - "expiry": 117, - "direction": "out", - "amount_msat": 100001001, - "payment_hash": "d2668e77c5a2220496e813de36f1fc09ba804b16af4c6bb38299d8a6eb8a5f10", - "state": "RCVD_REMOVE_ACK_REVOCATION" - }, - { - "short_channel_id": "103x1x0", - "id": 1, - "expiry": 117, - "direction": "out", - "amount_msat": 100001001, - "payment_hash": "286e08ac8f575f10508d751fcfc93871b4344271967c7b9e5eacb3f3573b8307", - "state": "RCVD_REMOVE_ACK_REVOCATION" - }, - { - "short_channel_id": "103x1x0", - "id": 2, - "expiry": 135, - "direction": "out", - "amount_msat": 100001001, - "payment_hash": "3e4baa750ee3dfb934578f041ccb40b87432bf37ec65c9d7bce5ff28fecbd95f", - "state": "RCVD_REMOVE_ACK_REVOCATION" - }, - { - "short_channel_id": "103x1x0", - "id": 3, - "expiry": 135, - "direction": "out", - "amount_msat": 100001001, - "payment_hash": "4c3ce32565dc10ef2bd230c32802ce2fe8b007208c0a90757aa289f75c994d49", - "state": "SENT_REMOVE_REVOCATION" - } - ] -} -{ - "htlcs": [ - { - "short_channel_id": "103x2x0", - "id": 0, - "expiry": 117, - "direction": "out", - "amount_msat": 100001001, - "payment_hash": "12bb14b1d119e1ae0759e5ff6f1f6653e3fd8f71ea59411500d2871404a47a98", - "state": "RCVD_REMOVE_ACK_REVOCATION" - }, - { - "short_channel_id": "103x2x0", - "id": 1, - "expiry": 117, - "direction": "out", - "amount_msat": 100001001, - "payment_hash": "57d950209cc0b4fcc5e3027569232f96cf83ef85314c6b139a5713848d811a66", - "state": "RCVD_REMOVE_ACK_REVOCATION" - }, - { - "short_channel_id": "103x2x0", - "id": 2, - "expiry": 135, - "direction": "out", - "amount_msat": 100001001, - "payment_hash": "45ad4654715411a07a0ad6ec3f4bfaa918c90e3d1934b10b1c1c5846523ddd7f", - "state": "RCVD_REMOVE_ACK_REVOCATION" - }, - { - "short_channel_id": "103x2x0", - "id": 3, - "expiry": 135, - "direction": "out", - "amount_msat": 100001001, - "payment_hash": "cc0dcd214aa71c62bfba711a0746da821f2cdba1770b11c225920bdde12c931e", - "state": "RCVD_REMOVE_ACK_REVOCATION" - } - ] -} -{ - "htlcs": [ - { - "short_channel_id": "103x1x0", - "id": 0, - "expiry": 124, - "direction": "out", - "amount_msat": 1001, - "payment_hash": "2ab653668c8017ff2f36ac36678a8da04e11380bd9580a2926b170523b0c6e3b", - "state": "RCVD_REMOVE_ACK_REVOCATION" - }, - { - "short_channel_id": "103x1x0", - "id": 1, - "expiry": 124, - "direction": "out", - "amount_msat": 2001, - "payment_hash": "92f889cb2e48aa28e1e577228b907cdbcc371a2c018e9c8f60fa7036e232cf1d", - "state": "RCVD_REMOVE_ACK_REVOCATION" - }, - { - "short_channel_id": "103x1x0", - "id": 2, - "expiry": 128, - "direction": "out", - "amount_msat": 4001, - "payment_hash": "14ef01c9fb12d7dcac288f48ce87b19a7d5c3d5779aaed1e4adcb5c5d0e9fa45", - "state": "RCVD_REMOVE_ACK_REVOCATION" - } - ] -} -``` - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-listforwards(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-listinvoicerequests.7.md b/doc/lightning-listinvoicerequests.7.md deleted file mode 100644 index 8ff6a1b9e68a..000000000000 --- a/doc/lightning-listinvoicerequests.7.md +++ /dev/null @@ -1,74 +0,0 @@ -lightning-listinvoicerequests -- Command for querying invoice\_request status -============================================================================= - -SYNOPSIS --------- - -**listinvoicerequests** [*invreq\_id*] [*active\_only*] - -DESCRIPTION ------------ - -Command *added* in v22.11. - -The **listinvoicerequests** RPC command gets the status of a specific `invoice_request`, if it exists, or the status of all `invoice_requests` if given no argument. - -- **invreq\_id** (string, optional): A specific invoice can be queried by providing the `invreq_id`, which is presented by lightning-invoicerequest(7), or can be calculated from a bolt12 invoice. -- **active\_only** (boolean, optional): If it is *True* then only active invoice requests are returned. The default is *False*. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:listinvoicerequests#1", - "method": "listinvoicerequests", - "params": [ - "cf0b41d4eb248d975909deb9accf9722b1c86839de80ee8815ce907bbb700a1d" - ] -} -``` - -RETURN VALUE ------------- - -On success, an object containing **invoicerequests** is returned. It is an array of objects, where each object contains: - -- **invreq\_id** (hash): The SHA256 hash of all invoice\_request fields less than 160. -- **active** (boolean): Whether the invoice\_request is currently active. -- **single\_use** (boolean): Whether the invoice\_request will become inactive after we pay an invoice for it. -- **bolt12** (string): The bolt12 string starting with lnr. -- **used** (boolean): Whether the invoice\_request has already been used. -- **label** (string, optional): The label provided when creating the invoice\_request. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "invoicerequests": [ - { - "invreq_id": "cf0b41d4eb248d975909deb9accf9722b1c86839de80ee8815ce907bbb700a1d", - "active": true, - "single_use": true, - "bolt12": "lnr1qqgx9ag7nmtns87htndlgcfndlq0wzstwd5k6urvv5s8getnw3gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02gzqta0pqpvzzqnxu3vc68fug904w25y3zpskc8huazwmy34av93h2fjswe3tsp4rrcyps5sf5jwnn2tr3ghn32mdta8jvax62pwzhna8sktmaezl3f4s3zy35gx6dfay7r8zn299uwr7ugpze74zft4m8q3fnk2sr0ljqpve3jq", - "used": false - } - ] -} -``` - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-invoicerequests(7), lightning-disableinvoicerequest(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-listinvoices.7.md b/doc/lightning-listinvoices.7.md deleted file mode 100644 index f1793b33c549..000000000000 --- a/doc/lightning-listinvoices.7.md +++ /dev/null @@ -1,107 +0,0 @@ -lightning-listinvoices -- Command for querying invoice status -============================================================= - -SYNOPSIS --------- - -**listinvoices** [*label*] [*invstring*] [*payment\_hash*] [*offer\_id*] [*index* [*start*] [*limit*]] - -DESCRIPTION ------------ - -The **listinvoices** RPC command gets the status of a specific invoice, if it exists, or the status of all invoices if given no argument. - -Only one of the query parameters can be used from *label*, *invstring*, *payment\_hash*, or *offer\_id*. - -- **label** (one of, optional): A label used a the creation of the invoice to get a specific invoice.: - - (string) - - (integer) -- **invstring** (string, optional): The string value to query a specific invoice. -- **payment\_hash** (hex, optional): A payment\_hash of the invoice to get the details of a specific invoice. -- **offer\_id** (string, optional): A local `offer_id` the invoice was issued for a specific invoice details. -- **index** (string, optional) (one of "created", "updated"): If neither *in\_channel* nor *out\_channel* is specified, it controls ordering. The default is `created`. *(added v23.08)* -- **start** (u64, optional): If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7). *(added v23.08)* -- **limit** (u32, optional): If `index` is specified, `limit` can be used to specify the maximum number of entries to return. *(added v23.08)* - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:listinvoices#1", - "method": "listinvoices", - "params": { - "label": "xEoCR94SIz6UIRUEkxum", - "payment_hash": null, - "invstring": null, - "offer_id": null, - "index": null, - "start": null, - "limit": null - } -} -``` - -RETURN VALUE ------------- - -On success, an object containing **invoices** is returned. It is an array of objects, where each object contains: - -- **label** (string): Unique label supplied at invoice creation. -- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. -- **status** (string) (one of "unpaid", "paid", "expired"): Whether it's paid, unpaid or unpayable. -- **expires\_at** (u64): UNIX timestamp of when it will become / became unpayable. -- **created\_index** (u64): 1-based index indicating order this invoice was created in. *(added v23.08)* -- **description** (string, optional): Description used in the invoice. -- **amount\_msat** (msat, optional): The amount required to pay this invoice. -- **bolt11** (string, optional): The BOLT11 string (always present unless *bolt12* is). -- **bolt12** (string, optional): The BOLT12 string (always present unless *bolt11* is). -- **local\_offer\_id** (hash, optional): The *id* of our offer which created this invoice (**experimental-offers** only). -- **invreq\_payer\_note** (string, optional): The optional *invreq\_payer\_note* from invoice\_request which created this invoice (**experimental-offers** only). -- **updated\_index** (u64, optional): 1-based index indicating order this invoice was changed (only present if it has changed since creation). *(added v23.08)* - -If **status** is "paid": - - **pay\_index** (u64): Unique incrementing index for this payment. - - **amount\_received\_msat** (msat): The amount actually received (could be slightly greater than *amount\_msat*, since clients may overpay). - - **paid\_at** (u64): UNIX timestamp of when it was paid. - - **payment\_preimage** (secret): Proof of payment. - - **paid\_outpoint** (object, optional): Outpoint this invoice was paid with. *(added v23.11)*: - - **txid** (txid): ID of the transaction that paid the invoice. *(added v23.11)* - - **outnum** (u32): The 0-based output number of the transaction that paid the invoice. *(added v23.11)* - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "invoices": [ - { - "label": "xEoCR94SIz6UIRUEkxum", - "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk", - "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", - "amount_msat": 11000000, - "status": "unpaid", - "description": [ - "XEoCR94SIz6UIRUEkxum." - ], - "expires_at": 1706757730, - "created_index": 1 - } - ] -} -``` - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-waitinvoice(7), lightning-delinvoice(7), lightning-invoice(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-listnodes.7.md b/doc/lightning-listnodes.7.md deleted file mode 100644 index bce9fbb0cf50..000000000000 --- a/doc/lightning-listnodes.7.md +++ /dev/null @@ -1,145 +0,0 @@ -lightning-listnodes -- Command to get the list of nodes in the known network. -============================================================================= - -SYNOPSIS --------- - -**listnodes** [*id*] - -DESCRIPTION ------------ - -The **listnodes** command returns nodes the node has learned about via gossip messages, or a single one if the node *id* was specified. - -- **id** (pubkey, optional): The public key of the node to list. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:listnodes#1", - "method": "listnodes", - "params": { - "id": "02e29856dab8ddd9044c18486e4cab79ec717b490447af2d4831e290e48d57638a" - } -} -{ - "id": "example:listnodes#2", - "method": "listnodes", - "params": { - "id": null - } -} -``` - -RETURN VALUE ------------- - -On success, an object containing **nodes** is returned. It is an array of objects, where each object contains: - -- **nodeid** (pubkey): The public key of the node. -- **last\_timestamp** (u32, optional): A node\_announcement has been received for this node (UNIX timestamp). - -If **last\_timestamp** is present: - - **alias** (string) (up to 32 characters): The fun alias this node advertized. - - **color** (hex) (always 6 characters): The favorite RGB color this node advertized. - - **features** (hex): BOLT #9 features bitmap this node advertized. - - **addresses** (array of objects): The addresses this node advertized.: - - **type** (string) (one of "dns", "ipv4", "ipv6", "torv2", "torv3"): Type of connection (until 23.08, `websocket` was also allowed). - - **port** (u16): Port number. - - If **type** is "dns", "ipv4", "ipv6", "torv2" or "torv3": - - **address** (string): Address in expected format for **type**. - -If **option\_will\_fund** is present: - - **option\_will\_fund** (object): - - **lease\_fee\_base\_msat** (msat): The fixed fee for a lease (whole number of satoshis). - - **lease\_fee\_basis** (u32): The proportional fee in basis points (parts per 10,000) for a lease. - - **funding\_weight** (u32): The onchain weight you'll have to pay for a lease. - - **channel\_fee\_max\_base\_msat** (msat): The maximum base routing fee this node will charge during the lease. - - **channel\_fee\_max\_proportional\_thousandths** (u32): The maximum proportional routing fee this node will charge during the lease (in thousandths, not millionths like channel\_update). - - **compact\_lease** (hex): The lease as represented in the node\_announcement. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "nodes": [ - { - "nodeid": "02e29856dab8ddd9044c14586e4cab79ec717b490447af2d4831e290e48d58638a", - "alias": "some_alias", - "color": "68f442", - "last_timestamp": 1597213741, - "features": "02a2a1", - "addresses": [ - { - "type": "ipv4", - "address": "zzz.yy.xx.xx", - "port": 9735 - } - ] - } - ] -} -{ - "nodes": [ - { - "nodeid": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "alias": "SILENTARTIST-v23.11-415-gd120eba", - "color": "022d22", - "last_timestamp": 1708624765, - "features": "88a0000a8a5961", - "addresses": [] - }, - { - "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "alias": "JUNIORBEAM-v23.11-415-gd120eba", - "color": "0266e4", - "last_timestamp": 1708624765, - "features": "88a0000a8a5961", - "addresses": [] - }, - { - "nodeid": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "alias": "HOPPINGFIRE-v23.11-415-gd120eba", - "color": "035d2b", - "last_timestamp": 1708624765, - "features": "88a0000a8a5961", - "addresses": [] - }, - { - "nodeid": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", - "alias": "JUNIORFELONY-v23.11-415-gd120eba", - "color": "0382ce", - "last_timestamp": 1708624766, - "features": "88a0000a8a5961", - "addresses": [] - } - ] -} -``` - -ERRORS ------- - -On failure, one of the following error codes may be returned: - -- -32602: Error in given parameters. - -AUTHOR ------- - -Vincenzo Palazzo <> wrote the initial version of this man page, -but many others did the hard work of actually implementing this rpc command. - -SEE ALSO --------- - -lightning-listchannels(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-listoffers.7.md b/doc/lightning-listoffers.7.md deleted file mode 100644 index cc6f2504106c..000000000000 --- a/doc/lightning-listoffers.7.md +++ /dev/null @@ -1,99 +0,0 @@ -lightning-listoffers -- Command for listing offers -================================================== - -SYNOPSIS --------- - -**(WARNING: experimental-offers only)** - -**listoffers** [*offer\_id*] [*active\_only*] - -DESCRIPTION ------------ - -The **listoffers** RPC command list all offers, or with `offer_id`, only the offer with that offer\_id (if it exists). - -- **offer\_id** (hash, optional): Offer\_id to get details for (if it exists). -- **active\_only** (boolean, optional): If set and is true, only offers with `active` true are returned. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:listoffers#1", - "method": "listoffers", - "params": { - "active_only": true - } -} -{ - "id": "example:listoffers#2", - "method": "listoffers", - "params": [ - "f61cca153d1948dade19349792d9bcdc9cef687fd27db0b553a67979f55aae48" - ] -} -``` - -RETURN VALUE ------------- - -On success, an object containing **offers** is returned. It is an array of objects, where each object contains: - -- **offer\_id** (hash): The id of this offer (merkle hash of non-signature fields). -- **active** (boolean): Whether this can still be used. -- **single\_use** (boolean): Whether this expires as soon as it's paid. -- **bolt12** (string): The bolt12 encoding of the offer. -- **used** (boolean): True if an associated invoice has been paid. -- **label** (string, optional): The (optional) user-specified label. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "offers": [ - { - "offer_id": "053a5c566fbea2681a5ff9c05a913da23e45b95d09ef5bd25d7d408f23da7084", - "active": true, - "single_use": false, - "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqvqcdgq2z9pk7enxv4jjqen0wgs8yatnw3ujz83qkc6rvp4j28rt3dtrn32zkvdy7efhnlrpr5rp5geqxs783wtlj550qs8czzku4nk3pqp6m593qxgunzuqcwkmgqkmp6ty0wyvjcqdguv3pnpukedwn6cr87m89t74h3auyaeg89xkvgzpac70z3m9rn5xzu28c", - "used": false - }, - { - "offer_id": "3247d3597fec19e362ca683416a48a0f76a44c1600725a7ee1936548feadacca", - "active": true, - "single_use": false, - "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcxqd24x3qgqgqlgzs3gdhkven9v5sxvmmjype82um50ys3ug9kxsmqdvj3c6ut2cuu2s4nrf8k2dulccgaqcdzxgp583utjlu49rcyqt8hc3s797umxn3r9367rdqc577rma7key58fywkajxnuzyapge86hj2pg80rjrma40xdqrxnsnva5l3ce7hz4ua8wf755dees4y9vnq", - "used": true - } - ] -} -{ - "offers": [ - { - "offer_id": "f61cca153d1948dade19349792d9bcdc9cef687fd27db0b553a67979f55aae48", - "active": true, - "single_use": false, - "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqyqs5rn5v4ehggrxdaezqvtdwdshg93pqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq63s", - "used": false - } - ] -} -``` - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-offer(7), lightning-listoffers(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-listpays.7.md b/doc/lightning-listpays.7.md deleted file mode 100644 index d8ec7efd77d2..000000000000 --- a/doc/lightning-listpays.7.md +++ /dev/null @@ -1,114 +0,0 @@ -lightning-listpays -- Command for querying payment status -========================================================= - -SYNOPSIS --------- - -**listpays** [*bolt11*] [*payment\_hash*] [*status*] - -DESCRIPTION ------------ - -The **listpay** RPC command gets the status of all *pay* commands, or a single one if either *bolt11* or *payment\_hash* was specified. - -- **bolt11** (string, optional): Bolt11 string to get the payment details. -- **payment\_hash** (hash, optional): Payment hash to get the payment details. -- **status** (string, optional) (one of "pending", "complete", "failed"): To filter the payment by status. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:listpays#1", - "method": "listpays", - "params": { - "bolt11": "lnbcrt123n1pjmxp7qsp5hxu7u28y0nx4v689u3hwzdzse2w9yaylhheavf9dxvwtdup7pvespp5ha66gxse68j4n6755v7299dnmq4w34gp0znxu0xzahdc43zrg40qdq5v3jhxcmjd9c8g6t0dc6sxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgqk74dvqlvr92ayy5s7x0r0u9xywez6wu4h8pfta386cw6x7cdrvn8pz87kyg5c930aent423gm9ylpaw5p35k72f02hg0s9dulg4d8fqpgj7gpm", - "payment_hash": null, - "status": null - } -} -{ - "id": "example:listpays#2", - "method": "listpays", - "params": { - "bolt11": "lnbcrt123n1pjmxp7qsp5u84368dz7yhzcqm955h96wdqch7uarasun45cr0vs5d8t0cv5avqpp5r9p0dp92guaatrmhf302m0dyj4n79gk93qu2l5tagfxq3dedgfqsdq5v3jhxcmjd9c8g6t0dc6qxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgq46wu0fznfx27rcnyzhcttf8yqx3lwqs482yxlead0fyt8mefrrrj5m379fa5qukgquf9tnwsuj3nnfmwkzkfg6pyhzq6w8gauuh6m5cqgur64n", - "payment_hash": null, - "status": null - } -} -``` - -RETURN VALUE ------------- - -On success, an object containing **pays** is returned. It is an array of objects, where each object contains: - -- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. -- **status** (string) (one of "pending", "failed", "complete"): Status of the payment. -- **created\_at** (u64): The UNIX timestamp showing when this payment was initiated. -- **destination** (pubkey, optional): The final destination of the payment if known. -- **completed\_at** (u64, optional): The UNIX timestamp showing when this payment was completed. -- **label** (string, optional): The label, if given to sendpay. -- **bolt11** (string, optional): The bolt11 string (if pay supplied one). -- **description** (string, optional): The description matching the bolt11 description hash (if pay supplied one). -- **bolt12** (string, optional): The bolt12 string (if supplied for pay: **experimental-offers** only). - -If **status** is "complete": - - **amount\_sent\_msat** (msat): The amount of millisatoshi we sent in order to pay (may include fees and not match amount\_msat). - - **preimage** (secret): Proof of payment. - - **amount\_msat** (msat, optional): The amount of millisatoshi we intended to send to the destination. - - **number\_of\_parts** (u64, optional): The number of parts for a successful payment (only if more than one). - -If **status** is "failed": - - **erroronion** (hex, optional): The error onion returned on failure, if any. - -The returned array is ordered by increasing **created\_at** fields. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "pays": [ - { - "bolt11": "lnbcrt123n1pjmxp7qsp5hxu7u28y0nx4v689u3hwzdzse2w9yaylhheavf9dxvwtdup7pvespp5ha66gxse68j4n6755v7299dnmq4w34gp0znxu0xzahdc43zrg40qdq5v3jhxcmjd9c8g6t0dc6sxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgqk74dvqlvr92ayy5s7x0r0u9xywez6wu4h8pfta386cw6x7cdrvn8pz87kyg5c930aent423gm9ylpaw5p35k72f02hg0s9dulg4d8fqpgj7gpm", - "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "payment_hash": "bf75a41a19d1e559ebd4a33ca295b3d82ae8d50178a66e3cc2eddb8ac443455e", - "status": "failed", - "created_at": 1706231854, - "amount_sent_msat": 0 - } - ] -} -{ - "pays": [ - { - "bolt11": "lnbcrt123n1pjmxp7qsp5u84368dz7yhzcqm955h96wdqch7uarasun45cr0vs5d8t0cv5avqpp5r9p0dp92guaatrmhf302m0dyj4n79gk93qu2l5tagfxq3dedgfqsdq5v3jhxcmjd9c8g6t0dc6qxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgq46wu0fznfx27rcnyzhcttf8yqx3lwqs482yxlead0fyt8mefrrrj5m379fa5qukgquf9tnwsuj3nnfmwkzkfg6pyhzq6w8gauuh6m5cqgur64n", - "destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "payment_hash": "1942f684aa473bd58f774c5eadbda49567e2a2c58838afd17d424c08b72d4241", - "status": "complete", - "created_at": 1706231849, - "completed_at": 1706231854, - "preimage": "89ce412a2089cbcb72a73ce755337cf693859ea58f21ef0d1caf286a9b0f2a7c", - "amount_msat": 12300, - "amount_sent_msat": 12301 - } - ] -} -``` - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-pay(7), lightning-paystatus(7), lightning-listsendpays(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-listpeerchannels.7.md b/doc/lightning-listpeerchannels.7.md deleted file mode 100644 index 6a2c0014d1eb..000000000000 --- a/doc/lightning-listpeerchannels.7.md +++ /dev/null @@ -1,401 +0,0 @@ -lightning-listpeerchannels -- Command returning data on channels of connected lightning nodes -============================================================================================= - -SYNOPSIS --------- - -**listpeerchannels** [*id*] - -DESCRIPTION ------------ - -Command *added* in v23.02. - -The **listpeerchannels** RPC command returns data on channels of the network, with the possibility to filter the channels by node id. - -If no *id* is supplied, then channel data on all lightning nodes that are connected, or not connected but have open channels with this node, are returned. - -- **id** (pubkey, optional): If supplied, limits the channels to just the peer with the given ID, if it exists. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:listpeerchannels#1", - "method": "listpeerchannels", - "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" - } -} -{ - "id": "example:listpeerchannels#2", - "method": "listpeerchannels", - "params": { - "id": null - } -} -``` - -RETURN VALUE ------------- - -On success, an object containing **channels** is returned. It is an array of objects, where each object contains: - -- **peer\_id** (pubkey): Node Public key. -- **peer\_connected** (boolean): A boolean flag that is set to true if the peer is online. -- **state** (string) (one of "OPENINGD", "CHANNELD\_AWAITING\_LOCKIN", "CHANNELD\_NORMAL", "CHANNELD\_SHUTTING\_DOWN", "CLOSINGD\_SIGEXCHANGE", "CLOSINGD\_COMPLETE", "AWAITING\_UNILATERAL", "FUNDING\_SPEND\_SEEN", "ONCHAIN", "DUALOPEND\_OPEN\_INIT", "DUALOPEND\_AWAITING\_LOCKIN", "CHANNELD\_AWAITING\_SPLICE", "DUALOPEND\_OPEN\_COMMITTED", "DUALOPEND\_OPEN\_COMMIT\_READY"): The channel state, in particular `CHANNELD_NORMAL` means the channel can be used normally. -- **opener** (string) (one of "local", "remote"): Who initiated the channel. -- **features** (array of strings): - - (string, optional) (one of "option\_static\_remotekey", "option\_anchor\_outputs", "option\_anchors\_zero\_fee\_htlc\_tx", "option\_scid\_alias", "option\_zeroconf"): BOLT #9 features which apply to this channel. -- **reestablished** (boolean, optional): A boolean flag that is set to true if we have successfully exchanged reestablish messages with this connection. *(added v24.02)* -- **scratch\_txid** (txid, optional): The txid we would use if we went onchain now. -- **channel\_type** (object, optional): Channel\_type as negotiated with peer. *(added v23.05)*: - - **bits** (array of u32s): Each bit set in this channel\_type.: - - (u32, optional): Bit number. - - **names** (array of strings): Feature name for each bit set in this channel\_type.: - - (string, optional) (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even"): Name of feature bit. -- **updates** (object, optional): Latest gossip updates sent/received. *(added v24.02)*: - - **local** (object): Our gossip for channel. *(added v24.02)*: - - **htlc\_minimum\_msat** (msat): Minimum msat amount we allow. *(added v24.02)* - - **htlc\_maximum\_msat** (msat): Maximum msat amount we allow. *(added v24.02)* - - **cltv\_expiry\_delta** (u32): Blocks delay required between incoming and outgoing HTLCs. *(added v24.02)* - - **fee\_base\_msat** (msat): Amount we charge to use the channel. *(added v24.02)* - - **fee\_proportional\_millionths** (u32): Amount we charge to use the channel in parts-per-million. *(added v24.02)* - - **remote** (object, optional): Peer's gossip for channel. *(added v24.02)*: - - **htlc\_minimum\_msat** (msat): Minimum msat amount they allow. *(added v24.02)* - - **htlc\_maximum\_msat** (msat): Maximum msat amount they allow. *(added v24.02)* - - **cltv\_expiry\_delta** (u32): Blocks delay required between incoming and outgoing HTLCs. *(added v24.02)* - - **fee\_base\_msat** (msat): Amount they charge to use the channel. *(added v24.02)* - - **fee\_proportional\_millionths** (u32): Amount they charge to use the channel in parts-per-million. *(added v24.02)* -- **ignore\_fee\_limits** (boolean, optional): Set if we allow this peer to set fees to anything they want. *(added v23.08)* -- **lost\_state** (boolean, optional): Set if we are fallen behind i.e. lost some channel state. *(added v24.02)* -- **feerate** (object, optional): Feerates for the current tx.: - - **perkw** (u32): Feerate per 1000 weight (i.e kSipa). - - **perkb** (u32): Feerate per 1000 virtual bytes. -- **owner** (string, optional): The current subdaemon controlling this connection. -- **short\_channel\_id** (short\_channel\_id, optional): The short\_channel\_id (once locked in). -- **channel\_id** (hash, optional): The full channel\_id (funding txid Xored with output number). -- **funding\_txid** (txid, optional): ID of the funding transaction. -- **funding\_outnum** (u32, optional): The 0-based output number of the funding transaction which opens the channel. -- **initial\_feerate** (string, optional): For inflight opens, the first feerate used to initiate the channel open. -- **last\_feerate** (string, optional): For inflight opens, the most recent feerate used on the channel open. -- **next\_feerate** (string, optional): For inflight opens, the next feerate we'll use for the channel open. -- **next\_fee\_step** (u32, optional): For inflight opens, the next feerate step we'll use for the channel open. -- **inflight** (array of objects, optional): Current candidate funding transactions.: - - **funding\_txid** (txid): ID of the funding transaction. - - **funding\_outnum** (u32): The 0-based output number of the funding transaction which opens the channel. - - **feerate** (string): The feerate for this funding transaction in per-1000-weight, with `kpw` appended. - - **total\_funding\_msat** (msat): Total amount in the channel. - - **splice\_amount** (integer): The amouont of sats we're splicing in or out. *(added v23.08)* - - **our\_funding\_msat** (msat): Amount we have in the channel. - - **scratch\_txid** (txid, optional): The commitment transaction txid we would use if we went onchain now. -- **close\_to** (hex, optional): ScriptPubkey which we have to close to if we mutual close. -- **private** (boolean, optional): If True, we will not announce this channel. -- **closer** (string, optional) (one of "local", "remote"): Who initiated the channel close (only present if closing). -- **funding** (object, optional): - - **local\_funds\_msat** (msat): Amount of channel we funded. - - **remote\_funds\_msat** (msat): Amount of channel they funded. - - **pushed\_msat** (msat, optional): Amount pushed from opener to peer. - - **fee\_paid\_msat** (msat, optional): Amount we paid peer at open. - - **fee\_rcvd\_msat** (msat, optional): Amount we were paid by peer at open. -- **to\_us\_msat** (msat, optional): How much of channel is owed to us. -- **min\_to\_us\_msat** (msat, optional): Least amount owed to us ever. If the peer were to successfully steal from us, this is the amount we would still retain. -- **max\_to\_us\_msat** (msat, optional): Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get. -- **total\_msat** (msat, optional): Total amount in the channel. -- **fee\_base\_msat** (msat, optional): Amount we charge to use the channel. -- **fee\_proportional\_millionths** (u32, optional): Amount we charge to use the channel in parts-per-million. -- **dust\_limit\_msat** (msat, optional): Minimum amount for an output on the channel transactions. -- **max\_total\_htlc\_in\_msat** (msat, optional): Max amount accept in a single payment. -- **their\_reserve\_msat** (msat, optional): Minimum we insist they keep in channel. If they have less than this in the channel, they cannot send to us on that channel. The default is 1% of the total channel capacity. -- **our\_reserve\_msat** (msat, optional): Minimum they insist we keep in channel. If you have less than this in the channel, you cannot send out via this channel. -- **spendable\_msat** (msat, optional): An estimate of the total we could send through channel (can be wrong because adding HTLCs requires an increase in fees paid to onchain miners, and onchain fees change dynamically according to onchain activity). -- **receivable\_msat** (msat, optional): An estimate of the total peer could send through channel. -- **minimum\_htlc\_in\_msat** (msat, optional): The minimum amount HTLC we accept. -- **minimum\_htlc\_out\_msat** (msat, optional): The minimum amount HTLC we will send. -- **maximum\_htlc\_out\_msat** (msat, optional): The maximum amount HTLC we will send. -- **their\_to\_self\_delay** (u32, optional): The number of blocks before they can take their funds if they unilateral close. -- **our\_to\_self\_delay** (u32, optional): The number of blocks before we can take our funds if we unilateral close. -- **max\_accepted\_htlcs** (u32, optional): Maximum number of incoming HTLC we will accept at once. -- **alias** (object, optional): - - **local** (short\_channel\_id, optional): An alias assigned by this node to this channel, used for outgoing payments. - - **remote** (short\_channel\_id, optional): An alias assigned by the remote node to this channel, usable in routehints and invoices. -- **state\_changes** (array of objects, optional): Prior state changes.: - - **timestamp** (string): UTC timestamp of form YYYY-mm-ddTHH:MM:SS.%03dZ. - - **old\_state** (string) (one of "OPENINGD", "CHANNELD\_AWAITING\_LOCKIN", "CHANNELD\_NORMAL", "CHANNELD\_SHUTTING\_DOWN", "CLOSINGD\_SIGEXCHANGE", "CLOSINGD\_COMPLETE", "AWAITING\_UNILATERAL", "FUNDING\_SPEND\_SEEN", "ONCHAIN", "DUALOPEND\_OPEN\_INIT", "DUALOPEND\_AWAITING\_LOCKIN", "DUALOPEND\_OPEN\_COMMITTED", "DUALOPEND\_OPEN\_COMMIT\_READY", "CHANNELD\_AWAITING\_SPLICE"): Previous state. - - **new\_state** (string) (one of "OPENINGD", "CHANNELD\_AWAITING\_LOCKIN", "CHANNELD\_NORMAL", "CHANNELD\_SHUTTING\_DOWN", "CLOSINGD\_SIGEXCHANGE", "CLOSINGD\_COMPLETE", "AWAITING\_UNILATERAL", "FUNDING\_SPEND\_SEEN", "ONCHAIN", "DUALOPEND\_OPEN\_INIT", "DUALOPEND\_AWAITING\_LOCKIN", "DUALOPEND\_OPEN\_COMMITTED", "DUALOPEND\_OPEN\_COMMIT\_READY", "CHANNELD\_AWAITING\_SPLICE"): New state. - - **cause** (string) (one of "unknown", "local", "user", "remote", "protocol", "onchain"): What caused the change. - - **message** (string): Human-readable explanation. -- **status** (array of strings, optional): - - (string, optional): Billboard log of significant changes. -- **in\_payments\_offered** (u64, optional): Number of incoming payment attempts. -- **in\_offered\_msat** (msat, optional): Total amount of incoming payment attempts. -- **in\_payments\_fulfilled** (u64, optional): Number of successful incoming payment attempts. -- **in\_fulfilled\_msat** (msat, optional): Total amount of successful incoming payment attempts. -- **out\_payments\_offered** (u64, optional): Number of outgoing payment attempts. -- **out\_offered\_msat** (msat, optional): Total amount of outgoing payment attempts. -- **out\_payments\_fulfilled** (u64, optional): Number of successful outgoing payment attempts. -- **out\_fulfilled\_msat** (msat, optional): Total amount of successful outgoing payment attempts. -- **last\_stable\_connection** (u64, optional): Last time we reestablished the open channel and stayed connected for 1 minute. *(added v24.02)* -- **htlcs** (array of objects, optional): Current HTLCs in this channel.: - - **direction** (string) (one of "in", "out"): Whether it came from peer, or is going to peer. *(added v23.02)* - - **id** (u64): Unique ID for this htlc on this channel in this direction. - - **amount\_msat** (msat): Amount send/received for this HTLC. - - **expiry** (u32): Block this HTLC expires at (after which an `in` direction HTLC will be returned to the peer, an `out` returned to us). If this expiry is too close, lightningd(8) will automatically unilaterally close the channel in order to enforce the timeout onchain. - - **payment\_hash** (hash): The hash of the payment\_preimage which will prove payment. - - **local\_trimmed** (boolean, optional) (always *true*): If this is too small to enforce onchain; it doesn't appear in the commitment transaction and will not be enforced in a unilateral close. Generally true if the HTLC (after subtracting onchain fees) is below the `dust_limit_msat` for the channel. - - **status** (string, optional): Set if this HTLC is currently waiting on a hook (and shows what plugin). - - If **direction** is "out": - - **state** (string) (one of "SENT\_ADD\_HTLC", "SENT\_ADD\_COMMIT", "RCVD\_ADD\_REVOCATION", "RCVD\_ADD\_ACK\_COMMIT", "SENT\_ADD\_ACK\_REVOCATION", "RCVD\_REMOVE\_HTLC", "RCVD\_REMOVE\_COMMIT", "SENT\_REMOVE\_REVOCATION", "SENT\_REMOVE\_ACK\_COMMIT", "RCVD\_REMOVE\_ACK\_REVOCATION"): Status of the HTLC. - - If **direction** is "in": - - **state** (string) (one of "RCVD\_ADD\_HTLC", "RCVD\_ADD\_COMMIT", "SENT\_ADD\_REVOCATION", "SENT\_ADD\_ACK\_COMMIT", "RCVD\_ADD\_ACK\_REVOCATION", "SENT\_REMOVE\_HTLC", "SENT\_REMOVE\_COMMIT", "RCVD\_REMOVE\_REVOCATION", "RCVD\_REMOVE\_ACK\_COMMIT", "SENT\_REMOVE\_ACK\_REVOCATION"): Status of the HTLC. - -If **peer\_connected** is *true*: - - **reestablished** (boolean, optional): True if we have successfully exchanged reestablish messages this connection. - -If **close\_to** is present: - - **close\_to\_addr** (string, optional): The bitcoin address we will close to (present if close\_to\_addr is a standardized address). - -If **scratch\_txid** is present: - - **last\_tx\_fee\_msat** (msat): Fee attached to this the current tx. - -If **short\_channel\_id** is present: - - **direction** (u32): 0 if we're the lesser node\_id, 1 if we're the greater (as used in BOLT #7 channel\_update). *(added v23.02)* - -If **inflight** is present: - - **initial\_feerate** (string): The feerate for the initial funding transaction in per-1000-weight, with `kpw` appended. - - **last\_feerate** (string): The feerate for the latest funding transaction in per-1000-weight, with `kpw` appended. - - **next\_feerate** (string): The minimum feerate for the next funding transaction in per-1000-weight, with `kpw` appended. - -The *state* field values (and *old\_state* / *new\_state*) are worth describing further: - - * `OPENINGD`: The channel funding protocol with the peer is ongoing and both sides are negotiating parameters. - * `DUALOPEND_OPEN_INIT`: Like `OPENINGD`, but for v2 connections which are using collaborative opens. - * `DUALOPEND_OPEN_COMMIT_READY`: Like `OPENINGD`, but for v2 connections which are using collaborative opens. You're ready to send your commitment signed to your peer. - * `DUALOPEND_OPEN_COMMITTED`: Like `OPENINGD`, but for v2 connections which are using collaborative opens. You've gotten an initial signed commitment from your peer. - * `CHANNELD_AWAITING_LOCKIN` / `DUALOPEND_AWAITING_LOCKIN`: The peer and you have agreed on channel parameters and are just waiting for the channel funding transaction to be confirmed deeply (original and collaborative open protocols, respectively). Both you and the peer must acknowledge the channel funding transaction to be confirmed deeply before entering the next state. Also, you can increase the onchain fee for channels in `DUALOPEND_AWAITING_LOCKIN` using lightning-openchannel\_bump(7). - * `CHANNELD_NORMAL`: The channel can be used for normal payments. - * `CHANNELD_SHUTTING_DOWN`: A mutual close was requested (by you or peer) and both of you are waiting for HTLCs in-flight to be either failed or succeeded. The channel can no longer be used for normal payments and forwarding. Mutual close will proceed only once all HTLCs in the channel have either been fulfilled or failed. - * `CLOSINGD_SIGEXCHANGE`: You and the peer are negotiating the mutual close onchain fee. - * `CLOSINGD_COMPLETE`: You and the peer have agreed on the mutual close onchain fee and are awaiting the mutual close getting confirmed deeply. - * `AWAITING_UNILATERAL`: You initiated a unilateral close, and are now waiting for the peer-selected unilateral close timeout to complete. - * `FUNDING_SPEND_SEEN`: You saw the funding transaction getting spent (usually the peer initiated a unilateral close) and will now determine what exactly happened (i.e. if it was a theft attempt). - * `ONCHAIN`: You saw the funding transaction getting spent and now know what happened (i.e. if it was a proper unilateral close by the peer, or a theft attempt). - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "channels": [ - { - "peer_id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "peer_connected": true, - "channel_type": { - "bits": [ - 12 - ], - "names": [ - "static_remotekey/even" - ] - }, - "updates": { - "local": { - "htlc_minimum_msat": 0, - "htlc_maximum_msat": 990000000, - "cltv_expiry_delta": 6, - "fee_base_msat": 1, - "fee_proportional_millionths": 10 - } - }, - "state": "CHANNELD_AWAITING_LOCKIN", - "scratch_txid": "4e9c2866b9ae1f765b89ea7ec37428c900ea97f717f85f00e3db852cb6aea3a8", - "last_tx_fee_msat": 5430000, - "feerate": { - "perkw": 7500, - "perkb": 30000 - }, - "owner": "channeld", - "direction": 1, - "channel_id": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c", - "funding_txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b", - "funding_outnum": 0, - "close_to_addr": "bcrt1pamt5tqzd49uyessr7437l2vllf20muqmzdauje8x8scjgpc0l0nqhyqcyp", - "close_to": "5120eed745804da9784cc203f563efa99ffa54fdf01b137bc964e63c3124070ffbe6", - "private": false, - "opener": "local", - "alias": { - "local": "5589251x14022525x17398" - }, - "features": [ - "option_static_remotekey" - ], - "funding": { - "local_funds_msat": 1000000000, - "remote_funds_msat": 0, - "pushed_msat": 0 - }, - "to_us_msat": 1000000000, - "min_to_us_msat": 1000000000, - "max_to_us_msat": 1000000000, - "total_msat": 1000000000, - "fee_base_msat": 1, - "fee_proportional_millionths": 10, - "dust_limit_msat": 546000, - "max_total_htlc_in_msat": 18446744073709552000, - "their_reserve_msat": 10000000, - "our_reserve_msat": 10000000, - "spendable_msat": 973980000, - "receivable_msat": 0, - "minimum_htlc_in_msat": 0, - "minimum_htlc_out_msat": 0, - "maximum_htlc_out_msat": 990000000, - "their_to_self_delay": 5, - "our_to_self_delay": 5, - "max_accepted_htlcs": 483, - "state_changes": [], - "status": [], - "in_payments_offered": 0, - "in_offered_msat": 0, - "in_payments_fulfilled": 0, - "in_fulfilled_msat": 0, - "out_payments_offered": 0, - "out_offered_msat": 0, - "out_payments_fulfilled": 0, - "out_fulfilled_msat": 0, - "htlcs": [] - } - ] -} -{ - "channels": [ - { - "peer_id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "peer_connected": true, - "reestablished": true, - "channel_type": { - "bits": [ - 12, - 22 - ], - "names": [ - "static_remotekey/even", - "anchors_zero_fee_htlc_tx/even" - ] - }, - "updates": { - "local": { - "htlc_minimum_msat": 0, - "htlc_maximum_msat": 990000000, - "cltv_expiry_delta": 6, - "fee_base_msat": 1, - "fee_proportional_millionths": 10 - }, - "remote": { - "htlc_minimum_msat": 0, - "htlc_maximum_msat": 990000000, - "cltv_expiry_delta": 6, - "fee_base_msat": 1, - "fee_proportional_millionths": 10 - } - }, - "state": "CHANNELD_NORMAL", - "scratch_txid": "ece66657d6203a4ea77807f566fd5b98a78b659f0cd59ce9200aa3bd6875ee25", - "last_tx_fee_msat": 4545000, - "lost_state": false, - "feerate": { - "perkw": 3750, - "perkb": 15000 - }, - "owner": "channeld", - "short_channel_id": "103x1x0", - "direction": 1, - "channel_id": "def5ef03e0d36ed65de814c0a8d6599a502fe1afb8e956529320bb350e876b5f", - "funding_txid": "5f6b870e35bb20935256e9b8afe12f509a59d6a8c014e85dd66ed3e003eff5de", - "funding_outnum": 0, - "close_to_addr": "bcrt1pamt5tqzd49uyessr7437l2vllf20muqmzdauje8x8scjgpc0l0nqhyqcyp", - "close_to": "5120eed745804da9784cc203f563efa99ffa54fdf01b137bc964e63c3124070ffbe6", - "private": false, - "opener": "local", - "alias": { - "local": "15447035x5589520x8959", - "remote": "6036590x13481428x5501" - }, - "features": [ - "option_static_remotekey", - "option_anchors_zero_fee_htlc_tx" - ], - "funding": { - "local_funds_msat": 1000000000, - "remote_funds_msat": 0, - "pushed_msat": 0 - }, - "to_us_msat": 1000000000, - "min_to_us_msat": 1000000000, - "max_to_us_msat": 1000000000, - "total_msat": 1000000000, - "fee_base_msat": 1, - "fee_proportional_millionths": 10, - "dust_limit_msat": 546000, - "max_total_htlc_in_msat": 18446744073709552000, - "their_reserve_msat": 10000000, - "our_reserve_msat": 10000000, - "spendable_msat": 978330000, - "receivable_msat": 0, - "minimum_htlc_in_msat": 0, - "minimum_htlc_out_msat": 0, - "maximum_htlc_out_msat": 990000000, - "their_to_self_delay": 5, - "our_to_self_delay": 5, - "max_accepted_htlcs": 483, - "state_changes": [ - { - "timestamp": "2024-02-22T17:48:57.127Z", - "old_state": "CHANNELD_AWAITING_LOCKIN", - "new_state": "CHANNELD_NORMAL", - "cause": "user", - "message": "Lockin complete" - } - ], - "status": [ - "CHANNELD_NORMAL:Channel ready for use." - ], - "in_payments_offered": 0, - "in_offered_msat": 0, - "in_payments_fulfilled": 0, - "in_fulfilled_msat": 0, - "out_payments_offered": 0, - "out_offered_msat": 0, - "out_payments_fulfilled": 0, - "out_fulfilled_msat": 0, - "htlcs": [] - } - ] -} -``` - -ERRORS ------- - -On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -- -32602: If the given parameters are wrong. - -AUTHOR ------- - -Michael Hawkins <>. - -SEE ALSO --------- - -lightning-connect(7), lightning-fundchannel\_start(7) - -RESOURCES ---------- - -Main web site: -Lightning RFC site (BOLT #9): - diff --git a/doc/lightning-listpeers.7.md b/doc/lightning-listpeers.7.md deleted file mode 100644 index a115abdfa0d9..000000000000 --- a/doc/lightning-listpeers.7.md +++ /dev/null @@ -1,244 +0,0 @@ -lightning-listpeers -- Command returning data on connected lightning nodes -========================================================================== - -SYNOPSIS --------- - -**listpeers** [*id*] [*level*] - -DESCRIPTION ------------ - -The **listpeers** RPC command returns data on nodes that are connected or are not connected but have open channels with this node. - -Once a connection to another lightning node has been established, using the **connect** command, data on the node can be returned using **listpeers** and the *id* that was used with the **connect** command. - -If no *id* is supplied, then data on all lightning nodes that are connected, or not connected but have open channels with this node, are returned. - -If a channel is open with a node and the connection has been lost, then the node will still appear in the output of the command and the value of the *connected* attribute of the node will be "false". - -The channel will remain open for a set blocktime, after which if the connection has not been re-established, the channel will close and the node will no longer appear in the command output. - -- **id** (pubkey, optional): If supplied, limits the result to just the peer with the given ID, if it exists. -- **level** (string, optional) (one of "io", "debug", "info", "unusual"): Supplying level will show log entries related to that peer at the given log level. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:listpeers#1", - "method": "listpeers", - "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "level": null - } -} -{ - "id": "example:listpeers#2", - "method": "listpeers", - "params": { - "id": null, - "level": null - } -} -``` - -RETURN VALUE ------------- - -On success, an object containing **peers** is returned. It is an array of objects, where each object contains: - -- **id** (pubkey): The unique id of the peer. -- **connected** (boolean): Value showing the connection status. -- **num\_channels** (u32): The number of channels the peer has with this node. *(added v23.02)* -- **log** (array of objects, optional): If *level* is specified, logs for this peer.: - - **type** (string) (one of "SKIPPED", "BROKEN", "UNUSUAL", "INFO", "DEBUG", "IO\_IN", "IO\_OUT") - - If **type** is "SKIPPED": - - **num\_skipped** (u32): Number of deleted/omitted entries. - - If **type** is "BROKEN", "UNUSUAL", "INFO" or "DEBUG": - - **time** (string): UNIX timestamp with 9 decimal places. - - **source** (string): The particular logbook this was found in. - - **log** (string): The actual log message. - - **node\_id** (pubkey): The peer this is associated with. - - If **type** is "IO\_IN" or "IO\_OUT": - - **time** (string): UNIX timestamp with 9 decimal places. - - **source** (string): The particular logbook this was found in. - - **log** (string): The actual log message. - - **node\_id** (pubkey): The peer this is associated with. - - **data** (hex): The IO which occurred. -- **channels** (array of objects, optional): Channels with this peer. **deprecated in v23.02, removed after v24.02**: - - **state** (string) (one of "OPENINGD", "CHANNELD\_AWAITING\_LOCKIN", "CHANNELD\_NORMAL", "CHANNELD\_SHUTTING\_DOWN", "CLOSINGD\_SIGEXCHANGE", "CLOSINGD\_COMPLETE", "AWAITING\_UNILATERAL", "FUNDING\_SPEND\_SEEN", "ONCHAIN", "DUALOPEND\_OPEN\_INIT", "DUALOPEND\_AWAITING\_LOCKIN", "DUALOPEND\_OPEN\_COMMITTED", "DUALOPEND\_OPEN\_COMMIT\_READY"): Current state of the channel: - * `OPENINGD`: The channel funding protocol with the peer is ongoing and both sides are negotiating parameters. - * `CHANNELD_AWAITING_LOCKIN`: The peer and you have agreed on channel parameters and are just waiting for the channel funding transaction to be confirmed deeply. Both you and the peer must acknowledge the channel funding transaction to be confirmed deeply before entering the next state. - * `CHANNELD_NORMAL`: The channel can be used for normal payments. - * `CHANNELD_SHUTTING_DOWN`: A mutual close was requested (by you or peer) and both of you are waiting for HTLCs in-flight to be either failed or succeeded. The channel can no longer be used for normal payments and forwarding. Mutual close will proceed only once all HTLCs in the channel have either been fulfilled or failed. - * `CLOSINGD_SIGEXCHANGE`: You and the peer are negotiating the mutual close onchain fee. - * `CLOSINGD_COMPLETE`: You and the peer have agreed on the mutual close onchain fee and are awaiting the mutual close getting confirmed deeply. - * `AWAITING_UNILATERAL`: You initiated a unilateral close, and are now waiting for the peer-selected unilateral close timeout to complete. - * `FUNDING_SPEND_SEEN`: You saw the funding transaction getting spent (usually the peer initiated a unilateral close) and will now determine what exactly happened (i.e. if it was a theft attempt). - * `ONCHAIN`: You saw the funding transaction getting spent and now know what happened (i.e. if it was a proper unilateral close by the peer, or a theft attempt). - * `CLOSED`: The channel closure has been confirmed deeply. The channel will eventually be removed from this array. - - **opener** (string) (one of "local", "remote"): Who initiated the channel. - - **features** (array of strings): - - (string, optional) (one of "option\_static\_remotekey", "option\_anchor\_outputs", "option\_scid\_alias", "option\_zeroconf"): BOLT #9 features which apply to this channel. - - **scratch\_txid** (txid, optional): The txid we would use if we went onchain now. - - **feerate** (object, optional): Feerates for the current tx.: - - **perkw** (u32): Feerate per 1000 weight (i.e kSipa). - - **perkb** (u32): Feerate per 1000 virtual bytes. - - **owner** (string, optional): The current subdaemon controlling this connection. - - **short\_channel\_id** (short\_channel\_id, optional): The short\_channel\_id (once locked in). - - **channel\_id** (hash, optional): The full channel\_id (funding txid Xored with output number). - - **funding\_txid** (txid, optional): ID of the funding transaction. - - **funding\_outnum** (u32, optional): The 0-based output number of the funding transaction which opens the channel. - - **initial\_feerate** (string, optional): For inflight opens, the first feerate used to initiate the channel open. - - **last\_feerate** (string, optional): For inflight opens, the most recent feerate used on the channel open. - - **next\_feerate** (string, optional): For inflight opens, the next feerate we'll use for the channel open. - - **next\_fee\_step** (u32, optional): For inflight opens, the next feerate step we'll use for the channel open. - - **inflight** (array of objects, optional): Current candidate funding transactions.: - - **funding\_txid** (txid): ID of the funding transaction. - - **funding\_outnum** (u32): The 0-based output number of the funding transaction which opens the channel. - - **feerate** (string): The feerate for this funding transaction in per-1000-weight, with `kpw` appended. - - **total\_funding\_msat** (msat): Total amount in the channel. - - **our\_funding\_msat** (msat): Amount we have in the channel. - - **splice\_amount** (integer): The amouont of sats we're splicing in or out. *(added v23.08)* - - **scratch\_txid** (txid): The commitment transaction txid we would use if we went onchain now. - - **close\_to** (hex, optional): ScriptPubkey which we have to close to if we mutual close. - - **private** (boolean, optional): If True, we will not announce this channel. - - **closer** (string, optional) (one of "local", "remote"): Who initiated the channel close (only present if closing). - - **funding** (object, optional): - - **local\_funds\_msat** (msat): Amount of channel we funded. - - **remote\_funds\_msat** (msat): Amount of channel they funded. - - **pushed\_msat** (msat, optional): Amount pushed from opener to peer. - - **fee\_paid\_msat** (msat, optional): Amount we paid peer at open. - - **fee\_rcvd\_msat** (msat, optional): Amount we were paid by peer at open. - - **to\_us\_msat** (msat, optional): How much of channel is owed to us. - - **min\_to\_us\_msat** (msat, optional): Least amount owed to us ever. If the peer were to successfully steal from us, this is the amount we would still retain. - - **max\_to\_us\_msat** (msat, optional): Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get. - - **total\_msat** (msat, optional): Total amount in the channel. - - **fee\_base\_msat** (msat, optional): Amount we charge to use the channel. - - **fee\_proportional\_millionths** (u32, optional): Amount we charge to use the channel in parts-per-million. - - **dust\_limit\_msat** (msat, optional): Minimum amount for an output on the channel transactions. - - **max\_total\_htlc\_in\_msat** (msat, optional): Max amount accept in a single payment. - - **their\_reserve\_msat** (msat, optional): Minimum we insist they keep in channel. If they have less than this in the channel, they cannot send to us on that channel. The default is 1% of the total channel capacity. - - **our\_reserve\_msat** (msat, optional): Minimum they insist we keep in channel. If you have less than this in the channel, you cannot send out via this channel. - - **spendable\_msat** (msat, optional): An estimate of the total we could send through channel (can be wrong because adding HTLCs requires an increase in fees paid to onchain miners, and onchain fees change dynamically according to onchain activity). - - **receivable\_msat** (msat, optional): An estimate of the total peer could send through channel. - - **minimum\_htlc\_in\_msat** (msat, optional): The minimum amount HTLC we accept. - - **minimum\_htlc\_out\_msat** (msat, optional): The minimum amount HTLC we will send. - - **maximum\_htlc\_out\_msat** (msat, optional): The maximum amount HTLC we will send. - - **their\_to\_self\_delay** (u32, optional): The number of blocks before they can take their funds if they unilateral close. - - **our\_to\_self\_delay** (u32, optional): The number of blocks before we can take our funds if we unilateral close. - - **max\_accepted\_htlcs** (u32, optional): Maximum number of incoming HTLC we will accept at once. - - **alias** (object, optional): - - **local** (short\_channel\_id, optional): An alias assigned by this node to this channel, used for outgoing payments. - - **remote** (short\_channel\_id, optional): An alias assigned by the remote node to this channel, usable in routehints and invoices. - - **state\_changes** (array of objects, optional): Prior state changes.: - - **timestamp** (string): UTC timestamp of form YYYY-mm-ddTHH:MM:SS.%03dZ. - - **old\_state** (string) (one of "OPENINGD", "CHANNELD\_AWAITING\_LOCKIN", "CHANNELD\_NORMAL", "CHANNELD\_SHUTTING\_DOWN", "CLOSINGD\_SIGEXCHANGE", "CLOSINGD\_COMPLETE", "AWAITING\_UNILATERAL", "FUNDING\_SPEND\_SEEN", "ONCHAIN", "DUALOPEND\_OPEN\_INIT", "DUALOPEND\_AWAITING\_LOCKIN", "DUALOPEND\_OPEN\_COMMITTED", "DUALOPEND\_OPEN\_COMMIT\_READY"): Previous state. - - **new\_state** (string) (one of "OPENINGD", "CHANNELD\_AWAITING\_LOCKIN", "CHANNELD\_NORMAL", "CHANNELD\_SHUTTING\_DOWN", "CLOSINGD\_SIGEXCHANGE", "CLOSINGD\_COMPLETE", "AWAITING\_UNILATERAL", "FUNDING\_SPEND\_SEEN", "ONCHAIN", "DUALOPEND\_OPEN\_INIT", "DUALOPEND\_AWAITING\_LOCKIN", "DUALOPEND\_OPEN\_COMMITTED", "DUALOPEND\_OPEN\_COMMIT\_READY"): New state. - - **cause** (string) (one of "unknown", "local", "user", "remote", "protocol", "onchain"): What caused the change. - - **message** (string): Human-readable explanation. - - **status** (array of strings, optional): - - (string, optional): Billboard log of significant changes. - - **in\_payments\_offered** (u64, optional): Number of incoming payment attempts. - - **in\_offered\_msat** (msat, optional): Total amount of incoming payment attempts. - - **in\_payments\_fulfilled** (u64, optional): Number of successful incoming payment attempts. - - **in\_fulfilled\_msat** (msat, optional): Total amount of successful incoming payment attempts. - - **out\_payments\_offered** (u64, optional): Number of outgoing payment attempts. - - **out\_offered\_msat** (msat, optional): Total amount of outgoing payment attempts. - - **out\_payments\_fulfilled** (u64, optional): Number of successful outgoing payment attempts. - - **out\_fulfilled\_msat** (msat, optional): Total amount of successful outgoing payment attempts. - - **htlcs** (array of objects, optional): Current HTLCs in this channel.: - - **direction** (string) (one of "in", "out"): Whether it came from peer, or is going to peer. - - **id** (u64): Unique ID for this htlc on this channel in this direction. - - **amount\_msat** (msat): Amount send/received for this HTLC. - - **expiry** (u32): Block this HTLC expires at (after which an `in` direction HTLC will be returned to the peer, an `out` returned to us). If this expiry is too close, lightningd(8) will automatically unilaterally close the channel in order to enforce the timeout onchain. - - **payment\_hash** (hash): The hash of the payment\_preimage which will prove payment. - - **local\_trimmed** (boolean, optional) (always *true*): If this is too small to enforce onchain; it doesn't appear in the commitment transaction and will not be enforced in a unilateral close. Generally true if the HTLC (after subtracting onchain fees) is below the `dust_limit_msat` for the channel. - - **status** (string, optional): Set if this HTLC is currently waiting on a hook (and shows what plugin). - - If **direction** is "out": - - **state** (string) (one of "SENT\_ADD\_HTLC", "SENT\_ADD\_COMMIT", "RCVD\_ADD\_REVOCATION", "RCVD\_ADD\_ACK\_COMMIT", "SENT\_ADD\_ACK\_REVOCATION", "RCVD\_REMOVE\_HTLC", "RCVD\_REMOVE\_COMMIT", "SENT\_REMOVE\_REVOCATION", "SENT\_REMOVE\_ACK\_COMMIT", "RCVD\_REMOVE\_ACK\_REVOCATION"): Status of the HTLC. - - If **direction** is "in": - - **state** (string) (one of "RCVD\_ADD\_HTLC", "RCVD\_ADD\_COMMIT", "SENT\_ADD\_REVOCATION", "SENT\_ADD\_ACK\_COMMIT", "RCVD\_ADD\_ACK\_REVOCATION", "SENT\_REMOVE\_HTLC", "SENT\_REMOVE\_COMMIT", "RCVD\_REMOVE\_REVOCATION", "RCVD\_REMOVE\_ACK\_COMMIT", "SENT\_REMOVE\_ACK\_REVOCATION"): Status of the HTLC. - - If **close\_to** is present: - - **close\_to\_addr** (string, optional): The bitcoin address we will close to (present if close\_to\_addr is a standardized address). - - If **scratch\_txid** is present: - - **last\_tx\_fee\_msat** (msat): Fee attached to this the current tx. - - If **short\_channel\_id** is present: - - **direction** (u32): 0 if we're the lesser node\_id, 1 if we're the greater (as used in BOLT #7 channel\_update). - - If **inflight** is present: - - **initial\_feerate** (string): The feerate for the initial funding transaction in per-1000-weight, with `kpw` appended. - - **last\_feerate** (string): The feerate for the latest funding transaction in per-1000-weight, with `kpw` appended. - - **next\_feerate** (string): The minimum feerate for the next funding transaction in per-1000-weight, with `kpw` appended. - -If **connected** is *true*: - - **netaddr** (array of strings): A single entry array.: - - (string, optional): Address, e.g. 1.2.3.4:1234. - - **features** (hex): Bitmap of BOLT #9 features from peer's INIT message. - - **remote\_addr** (string, optional): The public IPv4/6 address the peer sees us from, e.g. 1.2.3.4:1234. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "peers": [ - { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "connected": true, - "num_channels": 1, - "netaddr": [ - "127.0.0.1:44619" - ], - "features": "08a0000a0a69a2" - } - ] -} -{ - "peers": [ - { - "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "connected": true, - "num_channels": 1, - "netaddr": [ - "127.0.0.1:48862" - ], - "features": "08a0000a0a69a2" - } - ] -} -``` - -ERRORS ------- - -On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -- -32602: If the given parameters are wrong. - -AUTHOR ------- - -Michael Hawkins <>. - -SEE ALSO --------- - -lightning-connect(7), lightning-fundchannel\_start(7), lightning-setchannel(7) - -RESOURCES ---------- - -Main web site: -Lightning RFC site (BOLT #9): - diff --git a/doc/lightning-listsendpays.7.md b/doc/lightning-listsendpays.7.md deleted file mode 100644 index d61e14a0f888..000000000000 --- a/doc/lightning-listsendpays.7.md +++ /dev/null @@ -1,148 +0,0 @@ -lightning-listsendpays -- Low-level command for querying sendpay status -======================================================================= - -SYNOPSIS --------- - -**listsendpays** [*bolt11*] [*payment\_hash*] [*status*] [*index* [*start*] [*limit*]] - -DESCRIPTION ------------ - -The **listsendpays** RPC command gets the status of all *sendpay* commands (which is also used by the *pay* command), or with *bolt11* or *payment\_hash* limits results to that specific payment. You cannot specify both. It is possible to filter the payments also by *status*. - -Note that there may be more than one concurrent *sendpay* command per *pay*, so this command should be used with caution. - -- **bolt11** (string, optional): Bolt11 invoice. -- **payment\_hash** (hash, optional): The hash of the payment\_preimage. -- **status** (string, optional) (one of "pending", "complete", "failed"): Whether the invoice has been paid, pending, or failed. -- **index** (string, optional) (one of "created", "updated"): If neither bolt11 or payment\_hash is specified, `index` controls ordering, by `created` (default) or `updated`. *(added v23.11)* -- **start** (u64, optional): If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7). *(added v23.11)* -- **limit** (u32, optional): If `index` is specified, `limit` can be used to specify the maximum number of entries to return. *(added v23.11)* - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:listsendpays#1", - "method": "listsendpays", - "params": { - "bolt11": null, - "payment_hash": null, - "status": null, - "index": null, - "start": null, - "limit": null - } -} -{ - "id": "example:listsendpays#2", - "method": "listsendpays", - "params": { - "bolt11": "lnbcrt1230n1pja03q9sp5xu9aypccf3n6vld2waxcysy47ct2wl5x5adtm7k8u30knqes22lspp5duw2v8csh0zh4xg9ql3amem98avlkc2ecre99tgmr2340amf9kmsdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqwh78s8wqg0kepspw0epcxmxteh5wu8n6ddlwdnyj758fqxpqk8ejf597x8ju3r32xqgae3yzjjz9e5s6l2vs5zxvkayhmemmx74wvyqqyqf8c9", - "payment_hash": null, - "status": null, - "index": null, - "start": null, - "limit": null - } -} -``` - -RETURN VALUE ------------- - -Note that the returned array is ordered by increasing *id*. -On success, an object containing **payments** is returned. It is an array of objects, where each object contains: - -- **created\_index** (u64): 1-based index indicating order this payment was created in. *(added v23.11)* -- **id** (u64): Old synonym for created\_index. -- **groupid** (u64): Grouping key to disambiguate multiple attempts to pay an invoice or the same payment\_hash. -- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. -- **status** (string) (one of "pending", "failed", "complete"): Status of the payment. -- **created\_at** (u64): The UNIX timestamp showing when this payment was initiated. -- **amount\_sent\_msat** (msat): The amount sent. -- **partid** (u64, optional): Part number (for multiple parts to a single payment). -- **updated\_index** (u64, optional): 1-based index indicating order this payment was changed (only present if it has changed since creation). *(added v23.11)* -- **amount\_msat** (msat, optional): The amount delivered to destination (if known). -- **destination** (pubkey, optional): The final destination of the payment if known. -- **label** (string, optional): The label, if given to sendpay. -- **bolt11** (string, optional): The bolt11 string (if pay supplied one). -- **description** (string, optional): The description matching the bolt11 description hash (if pay supplied one). -- **bolt12** (string, optional): The bolt12 string (if supplied for pay: **experimental-offers** only). - -If **status** is "complete": - - **payment\_preimage** (secret): The proof of payment: SHA256 of this **payment\_hash**. - - **completed\_at** (u64, optional): The UNIX timestamp showing when this payment was completed. *(added pre-v0.10.1)* - -If **status** is "failed": - - **erroronion** (hex, optional): The onion message returned. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "payments": [ - { - "created_index": 1, - "id": 1, - "payment_hash": "e3b43574acd074b0c4ba1b13b5155ff5f9c76742e643ed003e17301c5a2db149", - "groupid": 1, - "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "amount_msat": 20000, - "amount_sent_msat": 20000, - "created_at": 1706225269, - "status": "pending", - "bolt11": "lnbcrt200n1pjm9mn5sp5gq84lgga959m6gg4g0kj29ypwjaxxnm4cu5csymq8p6nqxv800mspp5uw6r2a9v6p6tp396rvfm292l7huuwe6zuep76qp7zucpck3dk9ysdpqf9grgmt62fmk5stswefh23n2tpykvcmzxqyjw5qcqp99qxpqysgqz8s496zmwed278jvp075zlhrnj0ncg45kcfw5s2lkhtxd3wc39f8wflp5gmd827dk470xpasfpx0azsfu0k8ttwae7620h8d050w28cqan776g" - }, - { - "created_index": 2, - "id": 2, - "payment_hash": "f55d92cfe019b5a015f5e5956e9255053cda14786171d5002feb12ae5254e5a5", - "groupid": 1, - "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "amount_msat": 30000, - "amount_sent_msat": 30000, - "created_at": 1706225269, - "status": "pending", - "bolt11": "lnbcrt300n1pjm9mn5sp5zqfkr93rp92mdyj6m8lzpcu90rfefcaqff8fxdd2sc5mace23ujspp574we9nlqrx66q904uk2kayj4q57d59rcv9ca2qp0avf2u5j5ukjsdpq29j55nfcgfcnsvzw2er57knhwcmhzwt0xqyjw5qcqp99qxpqysgq76p2jpnegtzlxmn0aqt6d3f89q4p6y5v3v2qz7t2mm6xt90nt324cq400tl82k28562aux8jxs57d603g7s0q4g3dapu9a7vln94j7spsut799" - } - ] -} -{ - "payments": [ - { - "created_index": 1, - "id": 1, - "payment_hash": "6f1ca61f10bbc57a990507e3dde7653f59fb6159c0f252ad1b1aa357f7692db7", - "groupid": 1, - "updated_index": 1, - "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "amount_msat": 123000, - "amount_sent_msat": 123000, - "created_at": 1708639237, - "completed_at": 1708639238, - "status": "complete", - "payment_preimage": "91f8366681fdfd309c048082fcde81a79116f85a7b2dd09aef1e34f5f7c3397b", - "bolt11": "lnbcrt1230n1pja03q9sp5xu9aypccf3n6vld2waxcysy47ct2wl5x5adtm7k8u30knqes22lspp5duw2v8csh0zh4xg9ql3amem98avlkc2ecre99tgmr2340amf9kmsdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqwh78s8wqg0kepspw0epcxmxteh5wu8n6ddlwdnyj758fqxpqk8ejf597x8ju3r32xqgae3yzjjz9e5s6l2vs5zxvkayhmemmx74wvyqqyqf8c9" - } - ] -} -``` - -AUTHOR ------- - -Christian Decker <> is mainly responsible. - -SEE ALSO --------- - -lightning-listpays(7), lightning-sendpay(7), lightning-listinvoice(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-listsqlschemas.7.md b/doc/lightning-listsqlschemas.7.md deleted file mode 100644 index c554b6ff8553..000000000000 --- a/doc/lightning-listsqlschemas.7.md +++ /dev/null @@ -1,223 +0,0 @@ -lightning-listsqlschemas -- Command to example lightning-sql schemas -==================================================================== - -SYNOPSIS --------- - -**listsqlschemas** [*table*] - -DESCRIPTION ------------ - -Command *added* in v23.02. - -This allows you to examine the schemas at runtime; while they are fully documented for the current release in lightning-sql(7), as fields are added or deprecated, you can use this command to determine what fields are present. - -If *table* is given, only that table is in the resulting list, otherwise all tables are listed. - -- **table** (string, optional) - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:listsqlschemas#1", - "method": "listsqlschemas", - "params": { - "table": "offers" - } -} -{ - "id": "example:listsqlschemas#2", - "method": "listsqlschemas", - "params": [ - "closedchannels" - ] -} -``` - -RETURN VALUE ------------- - -On success, an object containing **schemas** is returned. It is an array of objects, where each object contains: - -- **tablename** (string): The name of the table. -- **columns** (array of objects): The columns, in database order.: - - **name** (string): The name of the column. - - **type** (string) (one of "INTEGER", "BLOB", "TEXT", "REAL"): The SQL type of the column. -- **indices** (array of arrays, optional): Any index we created to speed lookups.: - - (array of strings): The columns for this index. - - (string, optional): The column name. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "schemas": [ - { - "tablename": "offers", - "columns": [ - { - "name": "offer_id", - "type": "BLOB" - }, - { - "name": "active", - "type": "INTEGER" - }, - { - "name": "single_use", - "type": "INTEGER" - }, - { - "name": "bolt12", - "type": "TEXT" - }, - { - "name": "bolt12_unsigned", - "type": "TEXT" - }, - { - "name": "used", - "type": "INTEGER" - }, - { - "name": "label", - "type": "TEXT" - } - ], - "indices": [ - [ - "offer_id" - ] - ] - } - ] -} -{ - "schemas": [ - { - "tablename": "closedchannels", - "columns": [ - { - "name": "rowid", - "type": "INTEGER" - }, - { - "name": "peer_id", - "type": "BLOB" - }, - { - "name": "channel_id", - "type": "BLOB" - }, - { - "name": "short_channel_id", - "type": "TEXT" - }, - { - "name": "alias_local", - "type": "TEXT" - }, - { - "name": "alias_remote", - "type": "TEXT" - }, - { - "name": "opener", - "type": "TEXT" - }, - { - "name": "closer", - "type": "TEXT" - }, - { - "name": "private", - "type": "INTEGER" - }, - { - "name": "total_local_commitments", - "type": "INTEGER" - }, - { - "name": "total_remote_commitments", - "type": "INTEGER" - }, - { - "name": "total_htlcs_sent", - "type": "INTEGER" - }, - { - "name": "funding_txid", - "type": "BLOB" - }, - { - "name": "funding_outnum", - "type": "INTEGER" - }, - { - "name": "leased", - "type": "INTEGER" - }, - { - "name": "funding_fee_paid_msat", - "type": "INTEGER" - }, - { - "name": "funding_fee_rcvd_msat", - "type": "INTEGER" - }, - { - "name": "funding_pushed_msat", - "type": "INTEGER" - }, - { - "name": "total_msat", - "type": "INTEGER" - }, - { - "name": "final_to_us_msat", - "type": "INTEGER" - }, - { - "name": "min_to_us_msat", - "type": "INTEGER" - }, - { - "name": "max_to_us_msat", - "type": "INTEGER" - }, - { - "name": "last_commitment_txid", - "type": "BLOB" - }, - { - "name": "last_commitment_fee_msat", - "type": "INTEGER" - }, - { - "name": "close_cause", - "type": "TEXT" - } - ] - } - ] -} -``` - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-sql(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-listtransactions.7.md b/doc/lightning-listtransactions.7.md deleted file mode 100644 index a6859362739f..000000000000 --- a/doc/lightning-listtransactions.7.md +++ /dev/null @@ -1,103 +0,0 @@ -lightning-listtransactions -- Command to get the list of transactions that was stored in the wallet. -==================================================================================================== - -SYNOPSIS --------- - -**listtransactions** - -DESCRIPTION ------------ - -The **listtransactions** command returns transactions tracked in the wallet. This includes deposits, withdrawals and transactions related to channels. A transaction may have multiple types, e.g., a transaction may both be a close and a deposit if it closes the channel and returns funds to the wallet. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:listtransactions#1", - "method": "listtransactions", - "params": {} -} -``` - -RETURN VALUE ------------- - -On success, an object containing **transactions** is returned. It is an array of objects, where each object contains: - -- **hash** (txid): The transaction id. -- **rawtx** (hex): The raw transaction. -- **blockheight** (u32): The block height of this tx. -- **txindex** (u32): The transaction number within the block. -- **locktime** (u32): The nLocktime for this tx. -- **version** (u32): The nVersion for this tx. -- **inputs** (array of objects): Each input, in order.: - - **txid** (txid): The transaction id spent. - - **index** (u32): The output spent. - - **sequence** (u32): The nSequence value. -- **outputs** (array of objects): Each output, in order.: - - **index** (u32): The 0-based output number. - - **amount\_msat** (msat): The amount of the output. - - **scriptPubKey** (hex): The scriptPubKey. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "transactions": [ - { - "hash": "05985072bbe20747325e69a159fe08176cc1bbc96d25e8848edad2dddc1165d0", - "rawtx": "02000000027032912651fc25a3e0893acd5f9640598707e2dfef92143bb5a4020e335442800100000017160014a5f48b9aa3cb8ca6cc1040c11e386745bb4dc932ffffffffd229a4b4f78638ebcac10a68b0561585a5d6e4d3b769ad0a909e9b9afaeae24e00000000171600145c83da9b685f9142016c6f5eb5f98a45cfa6f686ffffffff01915a01000000000017a9143a4dfd59e781f9c3018e7d0a9b7a26d58f8d22bf8700000000", - "blockheight": 0, - "txindex": 0, - "locktime": 0, - "version": 2, - "inputs": [ - { - "txid": "804254330e02a4b53b1492efdfe207875940965fcd3a89e0a325fc5126913270", - "index": 1, - "sequence": 4294967295 - }, - { - "txid": "4ee2eafa9a9b9e900aad69b7d3e4d6a5851556b0680ac1caeb3886f7b4a429d2", - "index": 0, - "sequence": 4294967295 - } - ], - "outputs": [ - { - "index": 0, - "satoshis": "88721000msat", - "scriptPubKey": "a9143a4dfd59e781f9c3018e7d0a9b7a26d58f8d22bf87" - } - ] - } - ] -} -``` - -ERRORS ------- - -On failure, one of the following error codes may be returned: - -- -32602: Error in given parameters. - -AUTHOR ------- - -Vincenzo Palazzo <> wrote the initial version of this man page, -but many others did the hard work of actually implementing this rpc command. - -SEE ALSO --------- - -lightning-newaddr(7), lightning-listfunds(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-makesecret.7.md b/doc/lightning-makesecret.7.md deleted file mode 100644 index 645999514d54..000000000000 --- a/doc/lightning-makesecret.7.md +++ /dev/null @@ -1,72 +0,0 @@ -lightning-makesecret -- Command for deriving pseudorandom key from HSM -====================================================================== - -SYNOPSIS --------- - -**makesecret** [*hex*] [*string*] - -DESCRIPTION ------------ - -The **makesecret** RPC command derives a secret key from the HSM\_secret. - -- **hex** (hex, optional): One of `hex` or `string` must be specified: `hex` can be any hex data. -- **string** (string, optional): One of `hex` or `string` must be specified: `string` is a UTF-8 string interpreted literally. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:makesecret#1", - "method": "makesecret", - "params": [ - "73636220736563726574" - ] -} -{ - "id": "example:makesecret#2", - "method": "makesecret", - "params": [ - null, - "scb secret" - ] -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **secret** (secret): The pseudorandom key derived from HSM\_secret. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "secret": "a9a2e742405c28f059349132923a99337ae7f71168b7485496e3365f5bc664ed" -} -{ - "secret": "a9a2e742405c28f059349132923a99337ae7f71168b7485496e3365f5bc664ed" -} -``` - -ERRORS ------- - -The following error codes may occur: - -- -1: Catchall nonspecific error. - -AUTHOR ------- - -Aditya <> is mainly responsible. - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-multifundchannel.7.md b/doc/lightning-multifundchannel.7.md deleted file mode 100644 index 5d4803f2f35b..000000000000 --- a/doc/lightning-multifundchannel.7.md +++ /dev/null @@ -1,237 +0,0 @@ -lightning-multifundchannel -- Command for establishing many lightning channels -============================================================================== - -SYNOPSIS --------- - -**multifundchannel** *destinations* [*feerate*] [*minconf*] [*utxos*] [*minchannels*] [*commitment\_feerate*] - -DESCRIPTION ------------ - -The **multifundchannel** RPC command opens multiple payment channels with nodes by committing a single funding transaction to the blockchain that is shared by all channels. - -If not already connected, **multifundchannel** will automatically attempt to connect; you may provide a *@host:port* hint appended to the node ID so that Core Lightning can learn how to connect to the node; see lightning-connect(7). - -Once the transaction is confirmed, normal channel operations may begin. Readiness is indicated by **listpeers** reporting a *state* of `CHANNELD_NORMAL` for the channel. - -- **destinations** (array of objects): There must be at least one entry in *destinations*; it cannot be an empty array.: - - **id** (string): Node ID, with an optional *@host:port* appended to it in a manner understood by **connect**; see lightning-connect(7). Each entry in the *destinations* array must have a unique node *id*. If not already connected, **multifundchannel** will automatically attempt to connect to the node. - - **amount** (msat): Amount in satoshis taken from the internal wallet to fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). The string *all* can be used to specify all available funds (or 16,777,215 satoshi if more is available and large channels were not negotiated with the peer). Otherwise it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The value cannot be less than the dust limit, currently 546 satoshi as of this writing, nor more than 16,777,215 satoshi (unless large channels were negotiated with the peer). - - **announce** (boolean, optional): Flag that indicates whether to announce the channel with this. If set to `False`, the channel is unpublished. The default is `True`. - - **push\_msat** (msat, optional): Amount of millisatoshis to outright give to the node. This is a gift to the peer, and you do not get a proof-of-payment out of this. - - **close\_to** (string, optional): Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script` Returns `close_to` set to closing script iff is negotiated. - - **request\_amt** (msat, optional): Amount of liquidity you'd like to lease from peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact\_lease*. - - **compact\_lease** (string, optional): Compact representation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel to this destination. - - **mindepth** (u32, optional): Number of confirmations before we consider the channel active. - - **reserve** (msat, optional): Amount we want the peer to maintain on its side of the channel. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The default is 1% of the funding amount. -- **feerate** (feerate, optional): Feerate used for the opening transaction, and if *commitment\_feerate* is not set, as initial feerate for commitment and HTLC transactions. See NOTES in lightning-feerates(7) for possible values. The default is *normal*. -- **minconf** (integer, optional): Minimum number of confirmations that used outputs should have. The default is 1. -- **utxos** (array of outpoints, optional): - - (outpoint, optional): Utxos to be used to fund the channel, as an array of `txid:vout`. -- **minchannels** (integer, optional): Re-attempt funding as long as at least this many peers remain (must not be zero). The **multifundchannel** command will only fail if too many peers fail the funding process. -- **commitment\_feerate** (feerate, optional): Initial feerate for commitment and HTLC transactions. See *feerate* for valid values. - -EXAMPLE USAGE -------------- - -This example opens three channels at once, with amounts 200,000 sats, 3,000,000 sats and the final channel using all remaining funds (actually, capped at 16,777,215 sats because large-channels is not enabled): - -```shell -$ lightning-cli multifundchannel '[{"id":"0201f42e167959c74d396ac57652fcea63c63940f78e8239cce5720df4d85ef857@127.0.0.1:7272", "amount":"200000sat"}, {"id":"0304a2468065535f9459567686e0f02b40f06e341d3eb2a62ec6763bcf2ccfd207@127.0.0.1:7373", "amount":"0.03btc"}, {"id":"0391f4c475050bb15871da5a72b1f3a1798de3d2e5fb4ffa262899b8d8e1f0b764@127.0.0.1:7474", "amount":"all"}]' -{ - "tx": "02000000000101fbe3c68db87b72f82c3f5447b0bc032469c78e71f229ac99c230807ff378a9d80000000000fdffffff04400d0300000000002200202e9897ed5f9b237aa27fd5d02d24157cd452b0d3f0a5bb03d38ff73f9f8f384bffffff0000000000220020439d797ada249e1e12f8d27cabb7330de3c8de0456fb54892deb7b9c72b0ff7c1dc9b50400000000225120046e3966a2d5e43c1f1e0676161905782e1e7c00811485c618f5144f328f4e2bc0c62d0000000000220020e36fd5c03c3586c3763d8b4c9d8650f396ff1c8a460137fb09b60ee82536a3b20140ea4d564e91c919b50a2d32886f1d414de773491119beb1364b92f15d6d03e1810e5ddea89c265e42f2e96bb028dfb3aa0b5b30072ddcc78daad727503c53e37fa9010000", - "txid": "90dc53922b70628fc9e7804ad0b8cd0fb41f050d94ffa2db3b16e918c96c022a", - "channel_ids": [ - { - "id": "0201f42e167959c74d396ac57652fcea63c63940f78e8239cce5720df4d85ef857", - "channel_id": "25c8253e66a860d17916cc0c21386e310eba9900030a68ec6ff6f59a8401a872", - "outnum": 0 - }, - { - "id": "0304a2468065535f9459567686e0f02b40f06e341d3eb2a62ec6763bcf2ccfd207", - "channel_id": "51749d724892a406896f6bf2e2f8c0b03399d0436691f294839897fa167e6521", - "outnum": 3 - }, - { - "id": "0391f4c475050bb15871da5a72b1f3a1798de3d2e5fb4ffa262899b8d8e1f0b764", - "channel_id": "7e1414e72c081f0754fa18c1657cedabe696aa9ffeaf0b936bfbe3a28f2829d1", - "outnum": 1 - } - ], - "failed": [] -} -``` - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:multifundchannel#1", - "method": "multifundchannel", - "params": { - "destinations": [ - { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59@localhost:41939", - "amount": 50000 - } - ], - "feerate": "10000perkw", - "minconf": null, - "utxos": null, - "minchannels": null, - "commitment_feerate": "2000perkw" - } -} -{ - "id": "example:multifundchannel#2", - "method": "multifundchannel", - "params": { - "destinations": [ - { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59@localhost:44663", - "amount": 50000 - }, - { - "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d@localhost:34631", - "amount": 50000 - }, - { - "id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199@localhost:34617", - "amount": 50000 - } - ], - "feerate": null, - "minconf": null, - "utxos": null, - "minchannels": 1 - } -} -``` - -RETURN VALUE ------------- - -This command opens multiple channels with a single large transaction, thus only one transaction is returned. - -If *minchannels* was specified and is less than the number of destinations, then it is possible that one or more of the destinations do not have a channel even if **multifundchannel** succeeded. -On success, an object is returned, containing: - -- **tx** (hex): The raw transaction which funded the channel. -- **txid** (txid): The txid of the transaction which funded the channel. -- **channel\_ids** (array of objects): - - **id** (pubkey): The peer we opened the channel with. - - **outnum** (u32): The 0-based output index showing which output funded the channel. - - **channel\_id** (hash): The channel\_id of the resulting channel. - - **channel\_type** (object): Channel\_type as negotiated with peer. *(added v24.02)*: - - **bits** (array of u32s): Each bit set in this channel\_type. *(added v24.02)*: - - (u32, optional): Bit number. - - **names** (array of strings): Feature name for each bit set in this channel\_type. *(added v24.02)*: - - (string, optional) (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even"): Name of feature bit. - - **close\_to** (hex, optional): The raw scriptPubkey which mutual close will go to; only present if *close\_to* parameter was specified and peer supports `option_upfront_shutdown_script`. -- **failed** (array of objects, optional): Any peers we failed to open with (if *minchannels* was specified less than the number of destinations).: - - **id** (pubkey): The peer we failed to open the channel with. - - **method** (string) (one of "connect", "openchannel\_init", "fundchannel\_start", "fundchannel\_complete"): What stage we failed at. - - **error** (object): - - **code** (integer): JSON error code from failing stage. - - **message** (string): Message from stage. - - **data**: Additional error data. - -On failure, none of the channels are created. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "tx": "0200000000010100a8ceb6f76c49c8c0c809ca359461540708a9a5ac56e56e6a7aaafb35f4d3850000000000fdffffff0250c30000000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd0623ff030000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a02473044022064763837f2cc84507eb1fc28c9e95d51174e1da4b8755da8e67fe21e37d0a8b402206295d0f19625f014819361a20572b936d81f6c5ba419e56997e882f3a7be094a012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000", - "txid": "ecba36e93bcf40542d43a05ef550bb0e4be51d766aa2ec8c5640a0d431ab0d06", - "channel_ids": [ - { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "channel_id": "060dab31d4a040568ceca26a761de54b0ebb50f55ea0432d5440cf3be936baec", - "channel_type": { - "bits": [ - 12 - ], - "names": [ - "static_remotekey/even" - ] - }, - "outnum": 0 - } - ], - "failed": [] -} -{ - "tx": "020000000001023041611dac05004825ab64781b4a33bf622380bf90196fae689196b1850a1f8f0000000000fdffffff5646519c565466c9588a88400ec71a39a2c0b6988beadb32491a13d9b89f85360100000000fdffffff0250c3000000000000220020181492c29a989f099fd2cf412c74b192dd095e81f4e4f6bec45bd1fbfdd2cfd983720000000000002251203e8a03f678bb7ca048baecc39788530560ea049816d604f72925e425288446c80140caa3b93c6667e4fe0026417cc87ae9dfd16d80018e7c6dcd6dfcee4d6cab7c7e84181baeb95ba25934ad1aa6b57f83c8287bf1b727123350b35549a3abe15b060140b3c6626b9b57081cc7eb5e4f518669764d265fb84316d8fb610e19ede13c5a370c1072861b909ec923acec980adb4a3e488ee3c6f9c49164bd4596945b52f62678000000", - "txid": "1fcc6d46200443ad21e3a1a1628b862bafd0d75c0b4454f5494957097bc7930d", - "channel_ids": [ - { - "id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", - "channel_id": "0d93c77b09574949f554440b5cd7d0af2b868b62a1a1e321ad430420466dcc1f", - "channel_type": { - "bits": [ - 12, - 22 - ], - "names": [ - "static_remotekey/even", - "anchors_zero_fee_htlc_tx/even" - ] - }, - "outnum": 0 - } - ], - "failed": [ - { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "method": "connect", - "error": { - "code": 401, - "message": "All addresses failed: 127.0.0.1:44663: Connection establishment: Connection refused. " - } - }, - { - "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "method": "connect", - "error": { - "code": 401, - "message": "All addresses failed: 127.0.0.1:34631: Connection establishment: Connection refused. " - } - } - ] -} -``` - -ERRORS ------- - -The following error codes may occur: - -- -1: Catchall nonspecific error. -- 300: The maximum allowed funding amount is exceeded. -- 301: There are not enough funds in the internal wallet (including fees) to create the transaction. -- 302: The output amount is too small, and would be considered dust. -- 303: Broadcasting of the funding transaction failed, the internal call to bitcoin-cli returned with an error. -- 313: The `min-emergency-msat` reserve not be preserved (and we have or are opening anchor channels). - -Failure may also occur if **lightningd** and the peer cannot agree on channel parameters (funding limits, channel reserves, fees, etc.). See lightning-fundchannel\_start(7) and lightning-fundchannel\_complete(7). - -There may be rare edge cases where a communications failure later in the channel funding process will cancel the funding locally, but the peer thinks the channel is already waiting for funding lockin. In that case, the next time we connect to the peer, our node will tell the peer to forget the channel, but some nodes (in particular, Core Lightning nodes) will disconnect when our node tells them to forget the channel. If you immediately **multifundchannel** with that peer, it could trigger this connect-forget-disconnect behavior, causing the second **multifundchannel** to fail as well due to disconnection. Doing a **connect** with the peers separately, and waiting for a few seconds, should help clear this hurdle; running **multifundchannel** a third time would also clear this. - -AUTHOR ------- - -ZmnSCPxj <> is mainly responsible. - -SEE ALSO --------- - -lightning-connect(7), lightning-listfunds(), lightning-listpeers(7), lightning-fundchannel(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-multiwithdraw.7.md b/doc/lightning-multiwithdraw.7.md deleted file mode 100644 index 5b32fb2d97b5..000000000000 --- a/doc/lightning-multiwithdraw.7.md +++ /dev/null @@ -1,123 +0,0 @@ -lightning-multiwithdraw -- Command for withdrawing to multiple addresses -======================================================================== - -SYNOPSIS --------- - -**multiwithdraw** *outputs* [*feerate*] [*minconf*] [*utxos*] - -DESCRIPTION ------------ - -The **multiwithdraw** RPC command sends funds from Core Lightning's internal wallet to the addresses specified in *outputs*. - -- **outputs** (array of outputdescs): An array containing objects of the form `{address: amount}`. The `amount` may be the string *all*, indicating that all onchain funds be sent to the specified address. Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*.: - - (outputdesc, optional) -- **feerate** (feerate, optional): Feerate used for the withdrawals. See NOTES in lightning-feerates(7) for possible values. The default is *normal*. -- **minconf** (u32, optional): Minimum number of confirmations that used outputs should have. The default is 1. -- **utxos** (array of outpoints, optional): - - (outpoint, optional): Utxos to be used to be withdrawn from, as an array of `txid:vout`. These must be drawn from the node's available UTXO set. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:multiwithdraw#1", - "method": "multiwithdraw", - "params": { - "outputs": [ - { - "bcrt1qyusnugshkn6kh5vmdjpe8hylvxlxjy3ns0hmrs": "2222000msat" - }, - { - "bcrt1q6r4vvt7uack33qf9n05umfxy8h5s2rdcmq7ra3": "3333000msat" - } - ], - "feerate": null, - "minconf": null, - "utxos": null - } -} -{ - "id": "example:multiwithdraw#2", - "method": "multiwithdraw", - "params": { - "outputs": [ - { - "BCRT1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KYGT080": 1000 - }, - { - "bcrt1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qzf4jry": 1000 - }, - { - "bcrt1pw508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7k0ylj56": 1000 - }, - { - "BCRT1SW50QT2UWHA": 1000 - }, - { - "bcrt1zw508d6qejxtdg4y5r3zarvaryv2wuatf": 1000 - }, - { - "bcrt1qqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvseswlauz7": 1000 - }, - { - "bcrt1pqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvsesyga46z": 1000 - }, - { - "bcrt1p0xlxvlhemja6c4dqv22uapctqupfhlxm9h8z3k2e72q4k9hcz7vqc8gma6": 1000 - } - ], - "feerate": null, - "minconf": null, - "utxos": null - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **tx** (hex): The raw transaction which was sent. -- **txid** (txid): The txid of the **tx**. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "tx": "02000000000101b75863b811587b4c15bb94d9285c31d6369b8ff609e44de399936f8acb268f600000000000fdffffff03050d000000000000160014d0eac62fdcee2d1881259be9cda4c43de9050db8ae0800000000000016001427213e2217b4f56bd19b6c8393dc9f61be691233d4b5f5050000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a0247304402203a001463da125de5615ff1c18f9cd4a1d2a138c91d40189d350821ac8fb3ae4f02207a507eec27e15fe43476233cd9fe8b690ebd265073a58ed18ff79a1416886f18012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000", - "txid": "94e803b98257855569d35b675d65fb4fa0061a8b5f828992e2104a2882bb18bf" -} -{ - "tx": "02000000000101dc5a50dfbafc30697b930b44e763ff7a255475d17d975fa0e2003431312098cf0100000000fdffffff09e803000000000000225120000000c4a5cad46221b2a187905e5266362b99d5e91c6ce24d165dab93e86433e803000000000000046002751ee8030000000000002a5128751e76e8199196d454941c45d1b3a323f1433bd6751e76e8199196d454941c45d1b3a323f1433bd6e80300000000000022512079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f817983b939700000000002251200518e92cd94e0f62c06f126dff98b9abe79b7ed845a156d5245678e26554475de803000000000000160014751e76e8199196d454941c45d1b3a323f1433bd6e8030000000000002200201863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262e803000000000000125210751e76e8199196d454941c45d1b3a323e803000000000000220020000000c4a5cad46221b2a187905e5266362b99d5e91c6ce24d165dab93e8643301407f0d9bc098c5439ff611507b6a7d403047ed4e0b883f293db19d4e109d350a24f790acb55547384ff2a23fcfde0eba9af7cebc321c19cfc4817ecd47d50c2cd854000000", - "txid": "062383a7c9a19a2768939087a5c89826a4ea3531080f20cc06aa1cbf431be505" -} -``` - -ERRORS ------- - -On failure, an error is reported and the withdrawal transaction is not created. - -- -1: Catchall nonspecific error. -- 301: There are not enough funds in the internal wallet (including fees) to create the transaction. -- 302: The dust limit is not met. - -AUTHOR ------- - -ZmnSCPxj <> is mainly responsible. - -SEE ALSO --------- - -lightning-listfunds(7), lightning-fundchannel(7), lightning-newaddr(7), lightning-txprepare(7), lightning-withdraw(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-newaddr.7.md b/doc/lightning-newaddr.7.md deleted file mode 100644 index e57d3be8d6f1..000000000000 --- a/doc/lightning-newaddr.7.md +++ /dev/null @@ -1,78 +0,0 @@ -lightning-newaddr -- Command for generating a new address to be used by Core Lightning -====================================================================================== - -SYNOPSIS --------- - -**newaddr** [*addresstype*] - -DESCRIPTION ------------ - -The **newaddr** RPC command generates a new address which can subsequently be used to fund channels managed by the Core Lightning node. - -The funding transaction needs to be confirmed before funds can be used. - -To send an on-chain payment from the Core Lightning node wallet, use `withdraw`. - -- **addresstype** (string, optional) (one of "bech32", "p2tr", "all"): It specifies the type of address wanted; currently *bech32* (e.g. `tb1qu9j4lg5f9rgjyfhvfd905vw46eg39czmktxqgg` on bitcoin testnet or `bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej` on bitcoin mainnet), or *p2tr* taproot addresses. The special value *all* generates all known address types for the same underlying key. The default is *bech32* address. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:newaddr#1", - "method": "newaddr", - "params": { - "addresstype": null - } -} -{ - "id": "example:newaddr#2", - "method": "newaddr", - "params": { - "addresstype": "bech32" - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **p2tr** (string, optional): The taproot address. *(added v23.08)* -- **bech32** (string, optional): The bech32 (native segwit) address. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "bech32": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf" -} -{ - "bech32": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf" -} -``` - -ERRORS ------- - -If an unrecognized address type is requested an error message will be returned. - -AUTHOR ------- - -Felix <> is mainly responsible. - -SEE ALSO --------- - -lightning-listfunds(7), lightning-fundchannel(7), lightning-withdraw(7), lightning-listtransactions(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-notifications.7.md b/doc/lightning-notifications.7.md deleted file mode 100644 index cdb3b4c4eb6a..000000000000 --- a/doc/lightning-notifications.7.md +++ /dev/null @@ -1,103 +0,0 @@ -lightning-notifications -- Command to set up notifications. -=========================================================== - -SYNOPSIS --------- - -**notifications** *enable* - -DESCRIPTION ------------ - -The **notifications** the RPC command enabled notifications for this JSON-RPC connection. By default (and for backwards-compatibility) notifications are disabled. - -Various commands, especially complex and slow ones, offer notifications which indicate their progress. - -- **enable** (boolean): Whether to enable or disable notifications. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:notifications#1", - "method": "notifications", - "params": { - "enable": true - } -} -{ - "id": "example:notifications#2", - "method": "notifications", - "params": { - "enable": false - } -} -``` - -NOTIFICATIONS -------------- - -Notifications are JSON-RPC objects without an *id* field. *lightningd* sends notifications (once enabled with this *notifications* command) with a *params* *id* field indicating which command the notification refers to. - -Implementations should ignore notifications without an *id* parameter, or unknown *method*. - -Common *method*s include: - *message*: param *message*: a descriptional string indicating something which occurred relating to the command. Param *level* indicates the level, as per lightning-getlog(7): *info* and *debug* are typical. - *progress*: param *num* and *total*, where *num* starts at 0 and is always less than *total*. Optional param *stage* with fields *num* and *total*, indicating what stage we are progressing through. - -RETURN VALUE ------------- - -On success, if *enable* was *true*, notifications will be forwarded from then on. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{} -{} -``` - -ERRORS ------- - -On failure, one of the following error codes may be returned: - -- -32602: Error in given parameters. - -EXAMPLE JSON NOTIFICATIONS --------------------------- - -```json -{ - "method": "message", - "params": { - "id": 1, - "message": "This is a test message", - "level": "DEBUG" - } -} -{ - "method": "progress", - "params": { - "id": 2, - "num": 0, - "total": 30, - "stage": { - "num": 0, - "total": 2 - } - } -} -``` - -AUTHOR ------- - -Rusty Russell <> wrote the initial version of this man page. - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-offer.7.md b/doc/lightning-offer.7.md deleted file mode 100644 index f9a828a4b45e..000000000000 --- a/doc/lightning-offer.7.md +++ /dev/null @@ -1,115 +0,0 @@ -lightning-offer -- Command for accepting payments -================================================= - -SYNOPSIS --------- - -**(WARNING: experimental-offers only)** - -**offer** *amount* *description* [*issuer*] [*label*] [*quantity\_max*] [*absolute\_expiry*] [*recurrence*] [*recurrence\_base*] [*recurrence\_paywindow*] [*recurrence\_limit*] [*single\_use*] - -DESCRIPTION ------------ - -The **offer** RPC command creates an offer (or returns an existing one), which is a precursor to creating one or more invoices. It automatically enables the processing of an incoming invoice\_request, and issuing of invoices. - -Note that for making an offer to *pay* someone else, see lightning- invoicerequest(7). - -- **amount** (one of): Can be the string `any`, which creates an offer that can be paid with any amount (e.g. a donation). Otherwise it can be a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. It can also have an ISO 4217 postfix (e.g. USD), in which case currency conversion will need to be done for the invoice itself. A plugin is needed which provides the `currencyconvert` API for this currency, otherwise the offer creation will fail.: - - (msat\_or\_any) - - (currency) -- **description** (string): A short description of purpose of the offer, e.g. *coffee*. This value is encoded into the resulting offer and is viewable by anyone you expose this offer to. It must be UTF-8, and cannot use *\u* JSON escape codes. -- **issuer** (string, optional): Who is issuing this offer (i.e. you) if appropriate. -- **label** (string, optional): An internal-use name for the offer, which can be any UTF-8 string. This is *NOT* encoded in the offer not sent to the issuer. -- **quantity\_max** (u64, optional): Invoice can specify more than one of the items up (and including) this maximum: 0 is a special value meaning `no maximuim`. The *amount* for the invoice will need to be multiplied accordingly. This is encoded in the offer. -- **absolute\_expiry** (u64, optional): Time the offer is valid until,in seconds since the first day of 1970 UTC. If not set, the offer remains valid (though it can be deactivated by the issuer of course). This is encoded in the offer. -- **recurrence** (string, optional): An invoice is expected at regular intervals. The argument is a positive number followed by one of `seconds`, `minutes`, `hours`, `days`, `weeks`, `months` or `years` (variants without the trailing `s` are also permitted). This is encoded in the offer. The semantics of recurrence is fairly predictable, but fully documented in BOLT 12. e.g. `4weeks`. -- **recurrence\_base** (one of, optional): Time in seconds since the first day of 1970 UTC, optionally with a `@` prefix. This indicates when the first period begins; without this, the recurrence periods start from the first invoice. The `@` prefix means that the invoice must start by paying the first period; otherwise it is permitted to start at any period. This is encoded in the offer. e.g. `@1609459200` indicates you must start paying on the 1st January 2021.: - - (string) - - (integer) -- **recurrence\_paywindow** (string, optional): Argument of form `-time+time[%]`. The first time is the number of seconds before the start of a period in which an invoice and payment is valid, the second time is the number of seconds after the start of the period. For example *-604800+86400* means you can fetch an pay the invoice 4 weeks before the given period starts, and up to 1 day afterwards. The optional *%* indicates that the amount of the invoice will be scaled by the time remaining in the period. This is encoded in the offer. The default is that payment is allowed during the current and previous periods. -- **recurrence\_limit** (u32, optional): To indicate the maximum period which exists. eg. `12` means there are 13 periods, from 0 to 12 inclusive. This is encoded in the offer. -- **single\_use** (boolean, optional): Indicates that the offer is only valid once; we may issue multiple invoices, but as soon as one is paid all other invoices will be expired (i.e. only one person can pay this offer). The default is False. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:offer#1", - "method": "offer", - "params": { - "amount": "1msat", - "description": "test for 1msat" - } -} -{ - "id": "example:offer#2", - "method": "offer", - "params": { - "amount": "100000sat", - "description": "quantity_max test", - "recurrence": "1week" - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **offer\_id** (hash): The id of this offer (merkle hash of non-signature fields). -- **active** (boolean) (always *true*): Whether this can still be used. -- **single\_use** (boolean): Whether this expires as soon as it's paid (reflects the *single\_use* parameter). -- **bolt12** (string): The bolt12 encoding of the offer. -- **used** (boolean): True if an associated invoice has been paid. -- **created** (boolean): False if the offer already existed. -- **label** (string, optional): The (optional) user-specified label. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "offer_id": "f61cca153d1948dade19349792d9bcdc9cef687fd27db0b553a67979f55aae48", - "active": true, - "single_use": false, - "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqyqs5rn5v4ehggrxdaezqvtdwdshg93pqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq63s", - "used": false, - "created": true -} -{ - "offer_id": "f7a501e51e2a90d032150b9100b1977c625f05cfda22469bdc81d8a20b1e303f", - "active": true, - "single_use": false, - "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqszltcgqpgghzatpde6xjaretakkz7pqw3jhxaqkyypxdeze35wncs2l2u4gfzyrpds00e6yakfrt6ctrw5n9qanzhqr2xq6qgqsw", - "used": false, - "created": true -} -``` - -ERRORS ------- - -On failure, an error is returned and no offer is created. If the lightning process fails before responding, the caller should use lightning-listoffers(7) to query whether this offer was created or not. - -If the offer already existed, and is still active, that is returned; if it's not active then this call fails. - -- -1: Catchall nonspecific error. -- 1000: Offer with this offer\_id already exists (but is not active). - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-listoffers(7), lightning-disableoffer(7), lightning-invoicerequest(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-openchannel_abort.7.md b/doc/lightning-openchannel_abort.7.md deleted file mode 100644 index fd846296c227..000000000000 --- a/doc/lightning-openchannel_abort.7.md +++ /dev/null @@ -1,73 +0,0 @@ -lightning-openchannel\_abort -- Command to abort a channel to a peer -==================================================================== - -SYNOPSIS --------- - -**openchannel\_abort** *channel\_id* - -DESCRIPTION ------------ - -`openchannel_init` is a low level RPC command which initiates a channel open with a specified peer. It uses the openchannel protocol which allows for interactive transaction construction. - -- **channel\_id** (hash): Channel id of the channel to be aborted. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:openchannel_abort#1", - "method": "openchannel_abort", - "params": { - "channel_id": "aec3dfd0c7643a23b679cd2e493c053f8fdf621ff2624949f9582c4118b818c6" - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **channel\_id** (hash): The channel id of the aborted channel. -- **channel\_canceled** (boolean): Whether this is completely canceled (there may be remaining in-flight transactions). -- **reason** (string): Usually "Abort requested", but if it happened to fail at the same time it could be different. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "channel_id": "aec3dfd0c7643a23b679cd2e493c053f8fdf621ff2624949f9582c4118b818c6", - "channel_canceled": true, - "reason": "Abort requested" -} -``` - -ERRORS ------- - -On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -- -32602: If the given parameters are wrong. -- -1: Catchall nonspecific error. -- 305: Peer is not connected. -- 311: Unknown channel id. -- 312: Channel in an invalid state - -AUTHOR ------- - -Lisa Neigut <> is mainly responsible. - -SEE ALSO --------- - -lightning-openchannel\_init(7), lightning-openchannel\_update(7), lightning-openchannel\_signed(7), lightning-openchannel\_bump(7), lightning-fundchannel\_start(7), lightning-fundchannel\_complete(7), lightning-fundchannel(7), lightning-fundpsbt(7), lightning-utxopsbt(7), lightning-multifundchannel(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-openchannel_bump.7.md b/doc/lightning-openchannel_bump.7.md deleted file mode 100644 index 2f24777b81fe..000000000000 --- a/doc/lightning-openchannel_bump.7.md +++ /dev/null @@ -1,68 +0,0 @@ -lightning-openchannel\_bump -- Command to initiate a channel RBF -================================================================ - -SYNOPSIS --------- - -**openchannel\_bump** *channel\_id* *amount* *initialpsbt* [*funding\_feerate*] - -DESCRIPTION ------------ - -`openchannel_bump` is a RPC command which initiates a channel RBF (Replace-By-Fee) for the specified channel. It uses the openchannel protocol which allows for interactive transaction construction. - -Warning: bumping a leased channel will lose the lease. - -- **channel\_id** (hash): Id of the channel to RBF. -- **amount** (sat): Satoshi value that we will contribute to the channel. This value will be \_added\_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel. -- **initialpsbt** (string): The funded, incomplete PSBT that specifies the UTXOs and change output for our channel contribution. It can be updated, see `openchannel_update`; *initialpsbt* must have at least one input. Must have the Non-Witness UTXO (PSBT\_IN\_NON\_WITNESS\_UTXO) set for every input. An error (code 309) will be returned if this requirement is not met. -- **funding\_feerate** (feerate, optional): Feerate for the funding transaction. The default is 1/64th greater than the last feerate used for this channel. - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **channel\_id** (hash): The channel id of the channel. -- **channel\_type** (object): Channel\_type as negotiated with peer. *(added v24.02)*: - - **bits** (array of u32s): Each bit set in this channel\_type. *(added v24.02)*: - - (u32, optional): Bit number. - - **names** (array of strings): Feature name for each bit set in this channel\_type. *(added v24.02)*: - - (string, optional) (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even"): Name of feature bit. -- **psbt** (string): The (incomplete) PSBT of the RBF transaction. -- **commitments\_secured** (boolean) (always *false*): Whether the *psbt* is complete. -- **funding\_serial** (u64): The serial\_id of the funding output in the *psbt*. -- **requires\_confirmed\_inputs** (boolean, optional): Does peer require confirmed inputs in psbt? - -If the peer does not support `option_dual_fund`, this command will return an error. - -If the channel is not in a state that is eligible for RBF, this command will return an error. - -ERRORS ------- - -On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -- -32602: If the given parameters are wrong. -- -1: Catchall nonspecific error. -- 300: The amount exceeded the maximum configured funding amount. -- 301: The provided PSBT cannot afford the funding amount. -- 305: Peer is not connected. -- 309: PSBT missing required fields -- 311: Unknown channel id. -- 312: Channel in an invalid state - -AUTHOR ------- - -Lisa Neigut <> is mainly responsible. - -SEE ALSO --------- - -lightning-openchannel\_init(7), lightning-openchannel\_update(7), lightning-openchannel\_signed(7), lightning-openchannel\_abort(7), lightning-fundchannel\_start(7), lightning-fundchannel\_complete(7), lightning-fundchannel(7), lightning-fundpsbt(7), lightning-utxopsbt(7), lightning-multifundchannel(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-openchannel_init.7.md b/doc/lightning-openchannel_init.7.md deleted file mode 100644 index 8403cb09a175..000000000000 --- a/doc/lightning-openchannel_init.7.md +++ /dev/null @@ -1,154 +0,0 @@ -lightning-openchannel\_init -- Command to initiate a channel to a peer -====================================================================== - -SYNOPSIS --------- - -**openchannel\_init** *id* *amount* *initialpsbt* [*commitment\_feerate*] [*funding\_feerate*] [*announce*] [*close\_to*] [*request\_amt*] [*compact\_lease*] [*channel\_type*] - -DESCRIPTION ------------ - -`openchannel_init` is a low level RPC command which initiates a channel open with a specified peer. It uses the openchannel protocol which allows for interactive transaction construction. - -- **id** (pubkey): Node id of the remote peer. -- **amount** (sat): Satoshi value that we will contribute to the channel. This value will be \_added\_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel. -- **initialpsbt** (string): Funded, incomplete PSBT that specifies the UTXOs and change output for our channel contribution. It can be updated, see `openchannel_update`; *initialpsbt* must have at least one input. Must have the Non-Witness UTXO (PSBT\_IN\_NON\_WITNESS\_UTXO) set for every input. An error (code 309) will be returned if this requirement is not met. -- **commitment\_feerate** (feerate, optional): Feerate for commitment transactions for non-anchor channels: see **fundchannel**. For anchor channels, it is ignored. -- **funding\_feerate** (feerate, optional): Feerate for the funding transaction. The default is 'opening' feerate. -- **announce** (boolean, optional): Whether or not to announce this channel. -- **close\_to** (string, optional): Bitcoin address to which the channel funds should be sent on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. -- **request\_amt** (msat, optional): An amount of liquidity you'd like to lease from the peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact\_lease*. -- **compact\_lease** (hex, optional): A compact representation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel. -- **channel\_type** (array of u32s, optional): Each bit set in this channel\_type.: - - (u32, optional): Bit number. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:openchannel_init#1", - "method": "openchannel_init", - "params": { - "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "amount": 999000, - "initialpsbt": "cHNidP8BADMCAAAAAYbThUhSzYr7ph6Z434bdcW7eoirYOFMmUt2GXZ79sF/AQAAAAD9////AGYAAAAAAQDeAgAAAAABARVD4QKlmwy8SNcNypf1o9TzbIFZjj4dqVzHAL0SLDoTAAAAAAD9////AjOv9ikBAAAAFgAUXJGglH7At5HOVY4ZHp0+19kv655AQg8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgVIxRXqIykOOxm/6YPaFFx2Qh1618qlXPUhDiliVQ2KUCIHQcHniUTcm1XT8SyRE8ev52jm0uiIYum15XcR/tPh+NASEC3Pby7xL4+Ig/Z8TchQ0QT1upLGet3da8qjSjgHO9LOJlAAAAAQEfQEIPAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=", - "commitment_feerate": null, - "funding_feerate": null, - "announce": true, - "close_to": null, - "request_amt": null, - "channel_type": [ - 12, - 22 - ] - } -} -{ - "id": "example:openchannel_init#2", - "method": "openchannel_init", - "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "amount": 16777216, - "initialpsbt": "cHNidP8BADMCAAAAAQVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAAAAAAD9////AGYAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=", - "commitment_feerate": null, - "funding_feerate": null, - "announce": true, - "close_to": null, - "request_amt": null, - "channel_type": null - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **channel\_id** (hash): The channel id of the channel. -- **psbt** (string): The (incomplete) PSBT of the funding transaction. -- **channel\_type** (object): Channel\_type as negotiated with peer. *(added v24.02)*: - - **bits** (array of u32s): Each bit set in this channel\_type. *(added v24.02)*: - - (u32, optional): Bit number. - - **names** (array of strings): Feature name for each bit set in this channel\_type. *(added v24.02)*: - - (string, optional) (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even"): Name of feature bit. -- **commitments\_secured** (boolean) (always *false*): Whether the *psbt* is complete. -- **funding\_serial** (u64): The serial\_id of the funding output in the *psbt*. -- **requires\_confirmed\_inputs** (boolean, optional): Does peer require confirmed inputs in psbt? - -If the peer does not support `option_dual_fund`, this command will return an error. - -If you sent a *request\_amt* and the peer supports `option_will_fund` and is interested in leasing you liquidity in this channel, returns their updated channel fee max (*channel\_fee\_proportional\_basis*, *channel\_fee\_base\_msat*), updated rate card for the lease fee (*lease\_fee\_proportional\_basis*, *lease\_fee\_base\_sat*) and their on-chain weight *weight\_charge*, which will be added to the lease fee at a rate of *funding\_feerate* * *weight\_charge* / 1000. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "channel_id": "53fa2b1ca0d8f21abeaaac0495ab9925cdfaf2ca8b04dbe4aeb061823e1ff2c8", - "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABARVD4QKlmwy8SNcNypf1o9TzbIFZjj4dqVzHAL0SLDoTAAAAAAD9////AjOv9ikBAAAAFgAUXJGglH7At5HOVY4ZHp0+19kv655AQg8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgVIxRXqIykOOxm/6YPaFFx2Qh1618qlXPUhDiliVQ2KUCIHQcHniUTcm1XT8SyRE8ev52jm0uiIYum15XcR/tPh+NASEC3Pby7xL4+Ig/Z8TchQ0QT1upLGet3da8qjSjgHO9LOJlAAAAAQEfQEIPAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIIbThUhSzYr7ph6Z434bdcW7eoirYOFMmUt2GXZ79sF/AQ8EAQAAAAEQBP3///8M/AlsaWdodG5pbmcBCMCDK/6LyRi8AAEDCFg+DwAAAAAAAQQiACDYM+8ZRsbTj0OCG/yzqLt2buFQn9LuMPDZqFFcgmCmfAz8CWxpZ2h0bmluZwEIchtFHfZ5FBgA", - "channel_type": { - "bits": [ - 12, - 22 - ], - "names": [ - "static_remotekey/even", - "anchors_zero_fee_htlc_tx/even" - ] - }, - "commitments_secured": false, - "funding_serial": 8222241539686471000, - "requires_confirmed_inputs": false -} -{ - "channel_id": "252d1b0a1e57895e84137f28cf19ab2c35847e284c112fefdecc7afeaa5c1de7", - "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCLR8RjOq9lmcAAEDCAAAAAEAAAAAAQQiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQz8CWxpZ2h0bmluZwEIZZtc7LD4y9YA", - "channel_type": { - "bits": [ - 12, - 22 - ], - "names": [ - "static_remotekey/even", - "anchors_zero_fee_htlc_tx/even" - ] - }, - "commitments_secured": false, - "funding_serial": 7321547790872006000, - "requires_confirmed_inputs": false -} -``` - -ERRORS ------- - -On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -- -32602: If the given parameters are wrong. -- -1: Catchall nonspecific error. -- 300: The amount exceeded the maximum configured funding amount. -- 301: The provided PSBT cannot afford the funding amount. -- 304: Still syncing with bitcoin network -- 305: Peer is not connected. -- 306: Unknown peer id. -- 309: PSBT missing required fields -- 310: v2 channel open protocol not supported by peer -- 312: Channel in an invalid state - -AUTHOR ------- - -Lisa Neigut <> is mainly responsible. - -SEE ALSO --------- - -lightning-openchannel\_update(7), lightning-openchannel\_signed(7), lightning-openchannel\_abort(7), lightning-openchannel\_bump(7), lightning-fundchannel\_start(7), lightning-fundchannel\_complete(7), lightning-fundchannel(7), lightning-fundpsbt(7), lightning-utxopsbt(7), lightning-multifundchannel(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-openchannel_signed.7.md b/doc/lightning-openchannel_signed.7.md deleted file mode 100644 index abb3b90f5510..000000000000 --- a/doc/lightning-openchannel_signed.7.md +++ /dev/null @@ -1,56 +0,0 @@ -lightning-openchannel\_signed -- Command to conclude a channel open -=================================================================== - -SYNOPSIS --------- - -**openchannel\_signed** *channel\_id* *signed\_psbt* - -DESCRIPTION ------------ - -`openchannel_signed` is a low level RPC command which concludes a channel open with the specified peer. It uses the v2 openchannel protocol, which allows for interactive transaction construction. - -This command should be called after `openchannel_update` returns *commitments\_secured* `true`. - -This command will broadcast the finalized funding transaction, if we receive valid signatures from the peer. - -- **channel\_id** (hash): Id of the channel. -- **signed\_psbt** (string): The PSBT returned from `openchannel_update` (where *commitments\_secured* was true) with partial signatures or finalized witness stacks included for every input that we contributed to the PSBT. - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **channel\_id** (hash): The channel id of the channel. -- **tx** (hex): The funding transaction. -- **txid** (txid): The txid of the **tx**. - -ERRORS ------- - -On error, the returned object will contain `code` and `message` properties, with `code` being one of the following: - -- -32602: If the given parameters are wrong. -- -1: Catchall nonspecific error. -- 303: Funding transaction broadcast failed. -- 305: Peer is not connected. -- 309: PSBT missing required fields. -- 311: Unknown channel id. -- 312: Channel in an invalid state - -AUTHOR ------- - -Lisa Neigut <> is mainly responsible. - -SEE ALSO --------- - -lightning-openchannel\_init(7), lightning-openchannel\_update(7), lightning-openchannel\_abort(7), lightning-openchannel\_bump(7), lightning-fundchannel\_start(7), lightning-fundchannel\_complete(7), lightning-fundchannel(7), lightning-fundpsbt(7), lightning-utxopsbt(7), lightning-multifundchannel(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-openchannel_update.7.md b/doc/lightning-openchannel_update.7.md deleted file mode 100644 index 3f951c2df4a2..000000000000 --- a/doc/lightning-openchannel_update.7.md +++ /dev/null @@ -1,130 +0,0 @@ -lightning-openchannel\_update -- Command to update a collab channel open -======================================================================== - -SYNOPSIS --------- - -**openchannel\_update** *channel\_id* *psbt* - -DESCRIPTION ------------ - -`openchannel_update` is a low level RPC command which continues an open channel, as specified by *channel\_id*. An updated *psbt* is passed in; any changes from the PSBT last returned (either from `openchannel_init` or a previous call to `openchannel_update`) will be communicated to the peer. - -Must be called after `openchannel_init` and before `openchannel_signed`. - -Must be called until *commitments\_secured* is returned as true, at which point `openchannel_signed` should be called with a signed version of the PSBT returned by the last call to `openchannel_update`. - -- **channel\_id** (hash): Id of the channel. -- **psbt** (string): Updated PSBT to be sent to the peer. May be identical to the PSBT last returned by either `openchannel_init` or `openchannel_update`. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:openchannel_update#1", - "method": "openchannel_update", - "params": { - "channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e", - "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA" - } -} -{ - "id": "example:openchannel_update#2", - "method": "openchannel_update", - "params": { - "channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e", - "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA" - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **channel\_id** (hash): The channel id of the channel. -- **channel\_type** (object): Channel\_type as negotiated with peer. *(added v24.02)*: - - **bits** (array of u32s): Each bit set in this channel\_type. *(added v24.02)*: - - (u32, optional): Bit number. - - **names** (array of strings): Feature name for each bit set in this channel\_type. *(added v24.02)*: - - (string, optional) (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even"): Name of feature bit. -- **psbt** (string): The PSBT of the funding transaction. -- **commitments\_secured** (boolean): Whether the *psbt* is complete (if true, sign *psbt* and call `openchannel_signed` to complete the channel open). -- **funding\_outnum** (u32): The index of the funding output in the psbt. -- **close\_to** (hex, optional): Scriptpubkey which we have to close to if we mutual close. -- **requires\_confirmed\_inputs** (boolean, optional): Does peer require confirmed inputs in psbt? - -If **commitments\_secured** is *true*: - - **channel\_id** (hash): The derived channel id. - - **funding\_outnum** (u32): The index of the funding output for this channel in the funding transaction. - - **close\_to** (hex, optional): If a `close_to` address was provided to `openchannel_init` and the peer supports `option_upfront_shutdownscript`. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e", - "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA", - "channel_type": { - "bits": [ - 12, - 22 - ], - "names": [ - "static_remotekey/even", - "anchors_zero_fee_htlc_tx/even" - ] - }, - "commitments_secured": true, - "funding_outnum": 0 -} -{ - "channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e", - "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA", - "channel_type": { - "bits": [ - 12, - 22 - ], - "names": [ - "static_remotekey/even", - "anchors_zero_fee_htlc_tx/even" - ] - }, - "commitments_secured": true, - "funding_outnum": 0, - "close_to": "5120eed745804da9784cc203f563efa99ffa54fdf01b137bc964e63c3124070ffbe6" -} -``` - -ERRORS ------- - -On error, the returned object will contain `code` and `message` properties, -with `code` being one of the following: - -- -32602: If the given parameters are wrong. -- -1: Catchall nonspecific error. -- 305: Peer is not connected. -- 309: PSBT missing required fields -- 311: Unknown channel id. -- 312: Channel in an invalid state - -AUTHOR ------- - -Lisa Neigut <> is mainly responsible. - -SEE ALSO --------- - -lightning-openchannel\_init(7), lightning-openchannel\_signed(7), lightning-openchannel\_bump(7), lightning-openchannel\_abort(7), lightning-fundchannel\_start(7), lightning-fundchannel\_complete(7), lightning-fundchannel(7), lightning-fundpsbt(7), lightning-utxopsbt(7), lightning-multifundchannel(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-parsefeerate.7.md b/doc/lightning-parsefeerate.7.md deleted file mode 100644 index edd871516abb..000000000000 --- a/doc/lightning-parsefeerate.7.md +++ /dev/null @@ -1,90 +0,0 @@ -lightning-parsefeerate -- Command for parsing a feerate string to a feerate -=========================================================================== - -SYNOPSIS --------- - -**parsefeerate** *feerate\_str* - -DESCRIPTION ------------ - -The **parsefeerate** command returns the current feerate for any valid *feerate\_str*. This is useful for finding the current feerate that a **fundpsbt** or **utxopsbt** command might use. - -- **feerate\_str** (string): The feerate string to parse. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:parsefeerate#1", - "method": "parsefeerate", - "params": [ - "unilateral_close" - ] -} -{ - "id": "example:parsefeerate#2", - "method": "parsefeerate", - "params": [ - "9999perkw" - ] -} -{ - "id": "example:parsefeerate#3", - "method": "parsefeerate", - "params": [ - 10000 - ] -} -{ - "id": "example:parsefeerate#4", - "method": "parsefeerate", - "params": [ - "urgent" - ] -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **perkw** (u32, optional): Value of *feerate\_str* in kilosipa. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "perkw": 11000 -} -{ - "perkw": 9999 -} -{ - "perkw": 2500 -} -{ - "perkw": 11000 -} -``` - -ERRORS ------- - -The **parsefeerate** command will error if the *feerate\_str* format is not recognized. - -- -32602: If the given parameters are wrong. - -TRIVIA ------- - -In CLN we like to call the weight unit "sipa" in honor of Pieter Wuille, who uses the name "sipa" on IRC and elsewhere. Internally we call the *perkw* style as "feerate per kilosipa". - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-pay.7.md b/doc/lightning-pay.7.md deleted file mode 100644 index 4d49e10fb8cc..000000000000 --- a/doc/lightning-pay.7.md +++ /dev/null @@ -1,146 +0,0 @@ -lightning-pay -- Command for sending a payment to a BOLT11 invoice -================================================================== - -SYNOPSIS --------- - -**pay** *bolt11* [*amount\_msat*] [*label*] [*riskfactor*] [*maxfeepercent*] [*retry\_for*] [*maxdelay*] [*exemptfee*] [*localinvreqid*] [*exclude*] [*maxfee*] [*description*] - -DESCRIPTION ------------ - -The **pay** RPC command attempts to find a route to the given destination, and send the funds it asks for. . - -The response will occur when the payment fails or succeeds. Once a payment has succeeded, calls to **pay** with the same *bolt11* will succeed immediately. - -When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name. - -- **bolt11** (string): Bolt11 invoice, if **experimental-offers** is enabled, it can actually be a bolt12 invoice, such as one received from lightningd-fetchinvoice(7). If it does not contain an amount, *amount\_msat* is required, otherwise if it is specified it must be *null*. -- **amount\_msat** (msat, optional): *amount\_msat* is in millisatoshi precision; it can be a whole number, or a whole number with suffix *msat* or *sat*, or a three decimal point number with suffix *sat*, or an 1 to 11 decimal point number suffixed by *btc*. -- **label** (string, optional): It is used to attach a label to payments, and is returned in lightning- listpays(7) and lightning-listsendpays(7). -- **riskfactor** (number, optional): The *riskfactor* is described in detail in lightning-getroute(7). The default is 10. -- **maxfeepercent** (number, optional): Percentage of the amount that is to be paid. The default is 0.5. -- **retry\_for** (u16, optional): Until *retry\_for* seconds passes, the command will keep finding routes and retrying the payment. The default is 60 seconds. -- **maxdelay** (u16, optional): A payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case. -- **exemptfee** (msat, optional): This option can be used for tiny payments which would be dominated by the fee leveraged by forwarding nodes. Setting `exemptfee` allows the `maxfeepercent` check to be skipped on fees that are smaller than `exemptfee`. The default is 5000 millisatoshi. -- **localinvreqid** (hex, optional): `localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7). This ensures that we only make a single payment for an offer, and that the offer is marked `used` once paid. -- **exclude** (array, optional): *exclude* is a JSON array of short-channel-id/direction (e.g. [ '564334x877x1/0', '564195x1292x0/1' ]) or pubkey which should be excluded from consideration for routing. The default is not to exclude any channels or nodes.: - - (short\_channel\_id\_dir) - - (pubkey) -- **maxfee** (msat, optional): *maxfee* overrides both *maxfeepercent* and *exemptfee* defaults (and if you specify *maxfee* you cannot specify either of those), and creates an absolute limit on what fee we will pay. This allows you to implement your own heuristics rather than the primitive ones used here. -- **description** (string, optional): It is only required for bolt11 invoices which do not contain a description themselves, but contain a description hash: in this case *description* is required. *description* is then checked against the hash inside the invoice before it will be paid. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:pay#1", - "method": "pay", - "params": { - "bolt11": "lni1qqgxr7gha7gusyg83lsr8qcqg4axgq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqtypg3hgetnwsszycn0d36rzv3zypjx2umrwf5hqarfdahzcg8sn7jmpuyl423pvggzvmj9nrga83q474e2sjygxzmq7ln5fmvjxh4skxafx2pmx9wqx5v9qgqxyfhyvyg6pdvu4tcjvpp7kkal9rp57wj7xv4pl3ajku70rzy3pavzzqjz06c8s2vvmrpjlkcse0txx0gmc6jalqqxmeyjm75qcnfnqxwyt2sfsqnxu3vc68fug904w25y3zpskc8huazwmy34av93h2fjswe3tsp4rqpe8qlx9xssexfc0aguke3q6u0jgw2qmn008mzu04mkmqmjmhes3gcpqdqdnzl270s48vsp635rd4jm04snvgkcp65qlkgp8qztu2mdp7c5uqpj2rll3pzu56st537rct3v62gfqeamzthjuwkr0pkvsdnnffpn4sq9sz0lryaufktx0nfxlffum3yesqev5gwqqqqqqqqqqqqqqqzsqqqqqqqqqqqqr5jt9hav2gqqqqqq5szxtvwkyz5zq2000hlwvadejz366lqjt9sd2j4rf5tfd9rgmmyegt4dqd34cf6v4gqkfvppqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq633uzqn3n74ccym4wcvq20vsx7lmk450kprpvlrh4cukk8xy9ptjcef4rnhytnkyn4vnxxtd57yeaksze2s30y26cs6u3rjd9322eg9puk24q", - "amount_msat": null, - "label": null, - "riskfactor": null, - "maxfeepercent": null, - "retry_for": null, - "maxdelay": null, - "exemptfee": null, - "localinvreqid": null, - "exclude": null, - "maxfee": null, - "description": null - } -} -``` - -RANDOMIZATION -------------- - -To protect user privacy, the payment algorithm performs some randomization. - -1: Route Randomization - -Route randomization means the payment algorithm does not always use the lowest-fee or shortest route. This prevents some highly-connected node from learning all of the user payments by reducing their fees below the network average. - -2: Shadow Route - -Shadow route means the payment algorithm will virtually extend the route by adding delays and fees along it, making it appear to intermediate nodes that the route is longer than it actually is. This prevents intermediate nodes from reliably guessing their distance from the payee. - -Route randomization will never exceed *maxfeepercent* of the payment. Route randomization and shadow routing will not take routes that would exceed *maxdelay*. - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **payment\_preimage** (secret): The proof of payment: SHA256 of this **payment\_hash**. -- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. -- **created\_at** (number): The UNIX timestamp showing when this payment was initiated. -- **parts** (u32): How many attempts this took. -- **amount\_msat** (msat): Amount the recipient received. -- **amount\_sent\_msat** (msat): Total amount we sent (including fees). -- **status** (string) (one of "complete", "pending", "failed"): Status of payment. -- **destination** (pubkey, optional): The final destination of the payment. - -The following warnings may also be returned: - -- **warning\_partial\_completion**: Not all parts of a multi-part payment have completed. - -You can monitor the progress and retries of a payment using the lightning-paystatus(7) command. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "payment_hash": "29ef7dfee675b990a3ad7c125960d54aa34d16969468dec9942ead03635c274c", - "created_at": 1706153504.76628, - "parts": 1, - "amount_msat": 100, - "amount_sent_msat": 100, - "payment_preimage": "6634c1b549c6615d234832f377e06d5a5ab088c40cebdc5cfb8c1262030abcad", - "status": "complete" -} -``` - -ERRORS ------- - -The following error codes may occur: - -- -1: Catchall nonspecific error. -- 201: Already paid with this *hash* using different amount or destination. -- 203: Permanent failure at destination. The *data* field of the error will be routing failure object (except for self-payment, which currently returns the error directly from lightning-sendpay(7)). -- 205: Unable to find a route. -- 206: Route too expensive. Either the fee or the needed total locktime for the route exceeds your *maxfeepercent* or *maxdelay* settings, respectively. The *data* field of the error will indicate the actual *fee* as well as the *feepercent* percentage that the fee has of the destination payment amount. It will also indicate the actual *delay* along the route. -- 207: Invoice expired. Payment took too long before expiration, or already expired at the time you initiated payment. The *data* field of the error indicates *now* (the current time) and *expiry* (the invoice expiration) as UNIX epoch time in seconds. -- 210: Payment timed out without a payment in progress. - -Error codes 202 and 204 will only get reported at **sendpay**; in **pay** we will keep retrying if we would have gotten those errors. - -A routing failure object has the fields below: - -*erring\_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on. -*erring\_node*: The hex string of the pubkey id of the node that reported the error. -*erring\_channel*: The short channel ID of the channel that has the error, or *0:0:0* if the destination node raised the error. -*failcode*: The failure code, as per BOLT #4. -*channel\_update*: The hex string of the *channel\_update* message received from the remote node. Only present if error is from the remote node and the *failcode* has the UPDATE bit set, as per BOLT #4. - -The *data* field of errors will include statistics *getroute\_tries* and *sendpay\_tries*. It will also contain a *failures* field with detailed data about routing errors. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-listpays(7), lightning-decodepay(7), lightning-listinvoice(7), lightning-delinvoice(7), lightning-getroute(7), lightning-invoice(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-ping.7.md b/doc/lightning-ping.7.md deleted file mode 100644 index b4fc84ce5ee1..000000000000 --- a/doc/lightning-ping.7.md +++ /dev/null @@ -1,81 +0,0 @@ -lightning-ping -- Command to check if a node is up. -=================================================== - -SYNOPSIS --------- - -**ping** *id* [*len*] [*pongbytes*] - -DESCRIPTION ------------ - -The **ping** command checks if the node with *id* is ready to talk. It currently only works for peers we have a channel with. - -- **id** (pubkey): The pubkey of the node to ping. -- **len** (u16, optional): The length of the ping. The default is 128. -- **pongbytes** (u16, optional): The length of the reply. A value of 65532 to 65535 means `don't reply`. The default is 128. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:ping#1", - "method": "ping", - "params": { - "len": 128, - "pongbytes": 128 - } -} -{ - "id": "example:ping#2", - "method": "ping", - "params": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "len": 1000, - "pongbytes": 65535 - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **totlen** (u16): The answer length of the reply message (including header: 0 means no reply expected). - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "totlen": 132 -} -{ - "totlen": 0 -} -``` - -ERRORS ------- - -On failure, one of the following error codes may be returned: - -- -32602: Error in given parameters or we're already waiting for a ping response from peer. - -AUTHOR ------- - -Vincenzo Palazzo <> wrote the initial version of this man page, -but many others did the hard work of actually implementing this rpc command. - -SEE ALSO --------- - -lightning-connect(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-plugin.7.md b/doc/lightning-plugin.7.md deleted file mode 100644 index 373399a659cf..000000000000 --- a/doc/lightning-plugin.7.md +++ /dev/null @@ -1,175 +0,0 @@ -lightning-plugin -- Manage plugins with RPC -=========================================== - -SYNOPSIS --------- - -**plugin** *subcommand* [*plugin|directory*] [*options*] ... - -DESCRIPTION ------------ - -The **plugin** RPC command can be used to control dynamic plugins, i.e. plugins that declared themself 'dynamic' (in getmanifest). - -- **subcommand** (string) (one of "start", "stop", "rescan", "startdir", "list"): Determines what action is taken: - - *subcommand* **start** takes a *path* to an executable as argument and starts it as plugin. *path* may be an absolute path or a path relative to the plugins directory (default *~/.lightning/plugins*). If the plugin is already running and the executable (checksum) has changed, the plugin is killed and restarted except if its an important (or builtin) plugin. If the plugin doesn't complete the 'getmanifest' and 'init' handshakes within 60 seconds, the command will timeout and kill the plugin. Additional *options* may be passed to the plugin, but requires all parameters to be passed as keyword=value pairs using the `-k|--keyword` option which is recommended. For example the following command starts the plugin helloworld.py (present in the plugin directory) with the option greeting set to 'A crazy': - ``shell. - lightning-cli -k plugin subcommand=start plugin=helloworld.py greeting='A crazy'. - ``. - - *subcommand* **stop** takes a plugin executable *path* or *name* as argument and stops the plugin. If the plugin subscribed to 'shutdown', it may take up to 30 seconds before this command returns. If the plugin is important and dynamic, this will shutdown `lightningd`. - - *subcommand* **startdir** starts all executables it can find in *directory* (excl. subdirectories) as plugins. Checksum and timeout behavior as in **start** applies. - - *subcommand* **rescan** starts all plugins in the default plugins directory (default *~/.lightning/plugins*) that are not already running. Checksum and timeout behavior as in **start** applies. - - *subcommand* **list** lists all running plugins (incl. non-dynamic). -- **plugin** (string, optional): *path* or *name* of a plugin executable to start or stop. -- **directory** (string, optional): *path* of a directory containing plugins. -- **options** (array of strings, optional): - - (string, optional): *keyword=value* options passed to plugin, can be repeated. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:plugin#1", - "method": "plugin", - "params": [ - "list" - ] -} -{ - "id": "example:plugin#2", - "method": "plugin", - "params": { - "subcommand": "stop", - "plugin": "fail_htlcs.py" - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **command** (string) (one of "start", "stop", "rescan", "startdir", "list"): The subcommand this is responding to. - -If **command** is "start", "startdir", "rescan" or "list": - - **plugins** (array of objects): - - **name** (string): Full pathname of the plugin. - - **active** (boolean): Status; plugin completed init and is operational, plugins are configured asynchronously. - - **dynamic** (boolean): Plugin can be stopped or started without restarting lightningd. - -If **command** is "stop": - - **result** (string): A message saying it successfully stopped. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "command": "list", - "plugins": [ - { - "name": "~/lightning/plugins/autoclean", - "active": true, - "dynamic": false - }, - { - "name": "~/lightning/plugins/chanbackup", - "active": true, - "dynamic": false - }, - { - "name": "~/lightning/plugins/bcli", - "active": true, - "dynamic": false - }, - { - "name": "~/lightning/plugins/commando", - "active": true, - "dynamic": false - }, - { - "name": "~/lightning/plugins/funder", - "active": true, - "dynamic": true - }, - { - "name": "~/lightning/plugins/topology", - "active": true, - "dynamic": false - }, - { - "name": "~/lightning/plugins/keysend", - "active": true, - "dynamic": false - }, - { - "name": "~/lightning/plugins/offers", - "active": true, - "dynamic": true - }, - { - "name": "~/lightning/plugins/pay", - "active": true, - "dynamic": true - }, - { - "name": "~/lightning/plugins/txprepare", - "active": true, - "dynamic": true - }, - { - "name": "~/lightning/plugins/cln-renepay", - "active": true, - "dynamic": true - }, - { - "name": "~/lightning/plugins/spenderp", - "active": true, - "dynamic": false - }, - { - "name": "~/lightning/plugins/sql", - "active": true, - "dynamic": true - }, - { - "name": "~/lightning/plugins/bookkeeper", - "active": true, - "dynamic": false - }, - { - "name": "~/lightning/target/debug/examples/cln-plugin-startup", - "active": true, - "dynamic": false - } - ] -} -{ - "command": "stop", - "result": "Successfully stopped fail_htlcs.py." -} -``` - -ERRORS ------- - -On error, the reason why the action could not be taken upon the plugin is returned. - -AUTHOR ------- - -Antoine Poinsot <> is mainly responsible. - -SEE ALSO --------- - -lightning-cli(1), lightning-listconfigs(1), [writing plugins][writing plugins] - -RESOURCES ---------- - -Main web site: - -[writing plugins]: PLUGINS.md diff --git a/doc/lightning-preapproveinvoice.7.md b/doc/lightning-preapproveinvoice.7.md deleted file mode 100644 index 00da015fb04b..000000000000 --- a/doc/lightning-preapproveinvoice.7.md +++ /dev/null @@ -1,44 +0,0 @@ -lightning-preapproveinvoice -- Ask the HSM to preapprove an invoice (low-level) -=============================================================================== - -SYNOPSIS --------- - -**preapproveinvoice** *bolt11* - -DESCRIPTION ------------ - -Command *added* in v23.02. - -The **preapproveinvoice** RPC command submits the *bolt11* invoice to the HSM to check that it is approved for payment. - -Generally the **preapproveinvoice** request does not need to be made explicitly, it is automatically generated as part of a **pay** request. - -By default, the HSM will approve all **preapproveinvoice** requests. - -If a remote signer is being used it might decline an **preapproveinvoice** request because it would exceed velocity controls, is not covered by allowlist controls, was declined manually, or other reasons. - -If a remote signer declines a **preapproveinvoice** request a subsequent attempt to pay the invoice anyway will fail; the signer will refuse to sign the commitment. - -- **bolt11** (string): Bolt11 invoice to submit to the HSM to check. *(added v23.02)* - -RETURN VALUE ------------- - -On success, an empty object is returned. - -AUTHOR ------- - -Ken Sedgwick <> is mainly responsible. - -SEE ALSO --------- - -lightning-pay(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-preapprovekeysend.7.md b/doc/lightning-preapprovekeysend.7.md deleted file mode 100644 index 94032239d2f2..000000000000 --- a/doc/lightning-preapprovekeysend.7.md +++ /dev/null @@ -1,46 +0,0 @@ -lightning-preapprovekeysend -- Ask the HSM to preapprove a keysend payment (low-level) -====================================================================================== - -SYNOPSIS --------- - -**preapprovekeysend** *destination* *payment\_hash* *amount\_msat* - -DESCRIPTION ------------ - -Command *added* in v23.02. - -The **preapprovekeysend** RPC command submits the *destination*, *payment\_hash*, and *amount\_msat* parameters to the HSM to check that they are approved as a keysend payment. - -Generally the **preapprovekeysend** request does not need to be made explicitly, it is automatically generated as part of a **keysend** request. - -By default, the HSM will approve all **preapprovekeysend** requests. - -If a remote signer is being used it might decline an **preapprovekeysend** request because it would exceed velocity controls, is not covered by allowlist controls, was declined manually, or other reasons. - -If a remote signer declines a **preapprovekeysend** request a subsequent attempt to pay the keysend anyway will fail; the signer will refuse to sign the commitment. - -- **destination** (pubkey): It is a 33 byte, hex-encoded, node ID of the node that the payment should go to. *(added v23.02)* -- **payment\_hash** (hex) (always 64 characters): It is the unique identifier of a payment. *(added v23.02)* -- **amount\_msat** (msat): The amount to send in millisatoshi precision; it can be a whole number, or a whole number with suffix `msat` or `sat`, or a three decimal point number with suffix `sat`, or an 1 to 11 decimal point number suffixed by `btc`. *(added v23.02)* - -RETURN VALUE ------------- - -On success, an empty object is returned. - -AUTHOR ------- - -Ken Sedgwick <> is mainly responsible. - -SEE ALSO --------- - -lightning-keysend(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-recover.7.md b/doc/lightning-recover.7.md deleted file mode 100644 index 900a6323fcf2..000000000000 --- a/doc/lightning-recover.7.md +++ /dev/null @@ -1,70 +0,0 @@ -lightning-recover -- Reinitialize Your Node for Recovery -======================================================== - -SYNOPSIS --------- - -**recover** *hsmsecret* - -DESCRIPTION ------------ - -The **recover** RPC command wipes your node and restarts it with the `--recover` option. This is only permitted if the node is unused: no channels, no bitcoin addresses issued (you can use `check` to see if recovery is possible). - -*hsmsecret* is either a codex32 secret starting with "cl1" as returned by `hsmtool getcodexsecret`, or a raw 64 character hex string. - -NOTE: this command only currently works with the `sqlite3` database backend. - -- **hsmsecret** (string): Either a codex32 secret starting with `cl1` as returned by `hsmtool getcodexsecret`, or a raw 64 character hex string. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:recover#1", - "method": "recover", - "params": { - "hsmsecret": "cl10leetsd35kw6r5de5kueedxgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqdeuq7xuh94k9g" - } -} -{ - "id": "example:recover#2", - "method": "recover", - "params": { - "hsmsecret": "6c696768746e696e672d31000000000000000000000000000000000000000000" - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **result** (string) (always "Recovery restart in progress") *(added v24.05)* - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{} -{ - "result": "Recovery restart in progress" -} -``` - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-hsmtool(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-recoverchannel.7.md b/doc/lightning-recoverchannel.7.md deleted file mode 100644 index 80c514ed4de1..000000000000 --- a/doc/lightning-recoverchannel.7.md +++ /dev/null @@ -1,66 +0,0 @@ -lightning-recoverchannel -- Command for recovering channels bundeled in an array in the form of *Static Backup* -=============================================================================================================== - -SYNOPSIS --------- - -**recoverchannel** *scb* - -DESCRIPTION ------------ - -The **recoverchannel** RPC command tries to force the peer (with whom you already had a channel) to close the channel and sweeps on-chain fund. This method is not spontaneous and depends on the peer, so use it in case of severe data loss. - -The *scb* parameter is an array containing minimum required info to reconnect and sweep funds. You can get the scb for already stored channels by using the RPC command 'staticbackup'. - -- **scb** (array of hexs): SCB of the channels in an array.: - - (hex, optional) - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:recoverchannel#1", - "method": "recoverchannel", - "params": [ - [ - "0000000000000001c3a7b9d74a174497122bc52d74d6d69836acadc77e0429c6d8b68b48d5c9139a022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d5904017f0000019f0bc3a7b9d74a174497122bc52d74d6d69836acadc77e0429c6d8b68b48d5c9139a0000000000000000000186a000021000" - ] - ] -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **stubs** (array of strings): - - (string, optional): Channel IDs of channels successfully inserted. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "stubs": [ - "c3a7b9d74a174497122bc52d74d6d69836acadc77e0429c6d8b68b48d5c9139a" - ] -} -``` - -AUTHOR ------- - -Aditya <> is mainly responsible. - -SEE ALSO --------- - -lightning-getsharedsecret(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-renepay.7.md b/doc/lightning-renepay.7.md deleted file mode 100644 index 04e02de0310c..000000000000 --- a/doc/lightning-renepay.7.md +++ /dev/null @@ -1,138 +0,0 @@ -lightning-renepay -- Command for sending a payment to a BOLT11 invoice -====================================================================== - -SYNOPSIS --------- - -**renepay** *invstring* [*amount\_msat*] [*maxfee*] [*maxdelay*] [*retry\_for*] [*description*] [*label*] - -DESCRIPTION ------------ - -Command *added* in v23.08. - -**renepay** is a new payment plugin based on Pickhardt-Richter optimization method for Multi-Path-Payments. This implementation has not been thoroughly tested and it should be used with caution. - -The response will occur when the payment fails or succeeds. Once a payment has succeeded, calls to **renepay** with the same *invstring* will not lead to a new payment attempt, but instead it will succeed immediately. - -When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name. - -- **invstring** (string): Bolt11 invoice which the RPC command attempts to pay. Currently, **renepay** supports bolt11 invoices only. -- **amount\_msat** (msat, optional): If the *invstring* does not contain an amount, *amount\_msat* is required, otherwise if it is specified it must be *null*. in millisatoshi precision; it can be a whole number, or a whole number with suffix *msat* or *sat*, or a three decimal point number with suffix *sat*, or an 1 to 11 decimal point number suffixed by *btc*. -- **maxfee** (msat, optional): *maxfee* is a hard bound, in the sense that the command will never attempt a payment when the fees exceed that value. -- **maxdelay** (u32, optional): Overrides the value of `max-locktime-blocks` for this payment. It serves to limit the locktime of funds in the payment HTLC measured in blocks. -- **retry\_for** (u32, optional): Measured in seconds specifies how much time it is allowed for the command to keep retrying the payment. The default is 60 seconds. -- **description** (string, optional): Only required for bolt11 invoices which do not contain a description themselves, but contain a description hash: in this case *description* is required. *description* is then checked against the hash inside the invoice before it will be paid. -- **label** (string, optional): Used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7). - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:renepay#1", - "method": "renepay", - "params": { - "invstring": "lnbcrt1230n1pjmxj9jsp5suc4cag0lv3wemllkvms56e6ll0w867cczqfttuu8cpfl089f9kspp56wvxtdh8fxg5r5y3kg3klxceakqaydskwzatga25v95da8nzkmwqdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqkmyhymt0j7hy38vzqxx465s4ys0fg78flnjqfx4clvdq9mrmgglpcnjrrnhtk7maa87pfvjez88hke8w97zvuecwswaf9gzyqlsthegpza67eu" - } -} -{ - "id": "example:renepay#2", - "method": "renepay", - "params": { - "invstring": "lnbcrt1pja0f9asp50kzadmeyy78eymjvhnlk5dznl3g5k5x8agh52ewjtg0jclas4ylspp5crsutd9hg05lxyhzphdcuyng6z3knrsdae83mxwawa842gz3vj3sdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqr5yzhxmup4muyaz6x8u2dy4qyu9t5qzuf5k9xayvj5kg7tve60gjk4jrv2l76exnj2xkuzhtwky23pkkxedzy6p9yrsgyqdwj7dv5gsp4zcw6v", - "amount_msat": 548925 - } -} -``` - -OPTIMALITY ----------- - -**renepay** is based on the work by Pickhardt-Richter's *Optimally Reliable & Cheap Payment Flows on the Lightning Network*. Which means the payment command will prefer routes that have a higher probability of success while keeping fees low. - -The algorithm records some partial knowledge of the state of the Network deduced from the responses obtained after evey payment attempt. This knowledge is kept through different payment requests, but decays with time to account for the dynamics of the Network (after 1 hour all previous knowledge will be erased). Knowledge from previous payment attempts increases the reliability for subsequent ones. - -Higher probabilities of success and lower fees cannot generally by optimized at once. Hence **renepay** combines the two in different amounts seeking solutions that satisfy *maxfee* bound and a target for 90% probability of success. *maxfee* is a hard bound, in the sense that the command will never attempt a payment when the fees exceed that value. While the probability target is not compulsory (but desirable), i.e. if the best route does not satisfy the 90% probability target it will be tried anyways. - -When *maxfee* and the 90% probability bounds are satified, the algorithm will optimize the fees to its lowest value. - -RANDOMIZATION -------------- - -To protect user privacy, the payment algorithm performs *shadow route* randomization. Which means the payment algorithm will virtually extend the route by adding delays and fees along it, making it appear to intermediate nodes that the route is longer than it actually is. This prevents intermediate nodes from reliably guessing their distance from the payee. - -Route randomization will never exceed *maxfee* of the payment. Route randomization and shadow routing will not take routes that would exceed *maxdelay*. - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **payment\_preimage** (secret): The proof of payment: SHA256 of this **payment\_hash**. -- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. -- **created\_at** (number): The UNIX timestamp showing when this payment was initiated. -- **parts** (u32): How many attempts this took. -- **amount\_msat** (msat): Amount the recipient received. -- **amount\_sent\_msat** (msat): Total amount we sent (including fees). -- **status** (string) (one of "complete", "pending", "failed"): Status of payment. -- **destination** (pubkey, optional): The final destination of the payment. - -You can monitor the progress and retries of a payment using the lightning-renepaystatus(7) command. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "payment_preimage": "0a3fd704b34f47d6e306dbac78141753be83848d3a19725c972abfc367dcc591", - "payment_hash": "d39865b6e7499141d091b2236f9b19ed81d2361670bab475546168de9e62b6dc", - "created_at": 1706248370.6267352, - "parts": 1, - "amount_msat": 123000, - "amount_sent_msat": 123000, - "status": "complete", - "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" -} -{ - "payment_preimage": "a635e92d024beebfc58519e6544888aa560ba3bcaba7e74924e4b8432eaa56f5", - "payment_hash": "c0e1c5b4b743e9f312e20ddb8e1268d0a3698e0dee4f1d99dd774f55205164a3", - "created_at": 1708631229.7841823, - "parts": 1, - "amount_msat": 548925, - "amount_sent_msat": 548925, - "status": "complete", - "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59" -} -``` - -ERRORS ------- - -The following error codes may occur: - -- -1: Catchall nonspecific error. -- 200: Other payment attempts are in progress. -- 203: Permanent failure at destination. -- 205: Unable to find a route. -- 206: Payment routes are too expensive. -- 207: Invoice expired. Payment took too long before expiration, or already expired at the time you initiated payment. -- 210: Payment timed out without a payment in progress. -- 212: Invoice is invalid. - -AUTHOR ------- - -Eduardo Quintana-Miranda <> is mainly responsible. - -SEE ALSO --------- - -lightning-renepaystatus(7), lightning-listpays(7), lightning-invoice(7) - -RESOURCES ---------- - -Main web site: - -Pickhardt R. and Richter S., *Optimally Reliable & Cheap Payment Flows on the Lightning Network* diff --git a/doc/lightning-renepaystatus.7.md b/doc/lightning-renepaystatus.7.md deleted file mode 100644 index a02a4a27f8b7..000000000000 --- a/doc/lightning-renepaystatus.7.md +++ /dev/null @@ -1,51 +0,0 @@ -lightning-renepaystatus -- Command for quering the status of previous renepay attempts -====================================================================================== - -SYNOPSIS --------- - -**renepaystatus** [*invstring*] - -DESCRIPTION ------------ - -Command *added* in v23.08. - -The **renepaystatus** RPC command queries the payment plugin **renepay** for the status of previous payment attempts. - -This command always succeeds. - -- **invstring** (string, optional): If specified, the command will return a list of payment attempts whose invoice matches *invstring*, otherwise all payments with be listed. - -RETURN VALUE ------------- - -On success, an object containing **paystatus** is returned. It is an array of objects, where each object contains: - -- **bolt11** (string): Invoice string BOLT11. -- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. -- **created\_at** (number): The UNIX timestamp showing when this payment was initiated. -- **groupid** (u32): The id for this payment attempt. -- **amount\_msat** (msat): Amount the recipient received. -- **status** (string) (one of "complete", "pending", "failed"): Status of payment. -- **notes** (array of strings): A list of messages for debugging purposes.: - - (string, optional): A message generated by renepay. -- **payment\_preimage** (secret, optional): The proof of payment: SHA256 of this **payment\_hash** (for completed payments only). -- **parts** (u32, optional): How many attempts this took. -- **amount\_sent\_msat** (msat, optional): Total amount we sent including fees (for completed payments only). -- **destination** (pubkey, optional): The final destination of the payment. - -AUTHOR ------- - -Eduardo Quintana-Miranda <> is mainly responsible. - -SEE ALSO --------- - -lightning-renepay(7), lightning-listpays(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-reserveinputs.7.md b/doc/lightning-reserveinputs.7.md deleted file mode 100644 index 25fb87c2ddf4..000000000000 --- a/doc/lightning-reserveinputs.7.md +++ /dev/null @@ -1,180 +0,0 @@ -lightning-reserveinputs -- Construct a transaction and reserve the UTXOs it spends -================================================================================== - -SYNOPSIS --------- - -**reserveinputs** *psbt* [*exclusive*] [*reserve*] - -DESCRIPTION ------------ - -The **reserveinputs** RPC command places (or increases) reservations on any inputs specified in *psbt* which are known to lightningd. It will fail with an error if any of the inputs are known to be spent, and ignore inputs which are unknown. - -Normally the command will fail (with no reservations made) if an input is already reserved. - -- **psbt** (string): The PSBT to reserve inputs from. -- **exclusive** (boolean, optional): If set to *False*, existing reservations are simply extended, rather than causing failure. -- **reserve** (u32, optional): The number of blocks to reserve. By default, reservations are for the next 72 blocks (approximately 6 hours). - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:reserveinputs#1", - "method": "reserveinputs", - "params": { - "psbt": "cHNidP8BAFwCAAAAAkwJVUqB0xXTO7JZ3PnPdGnxoYfQxhU+xqXGFYXsyX0RAAAAAAD9////TAlVSoHTFdM7slnc+c90afGhh9DGFT7GpcYVhezJfREBAAAAAP3///8AAAAAAAAAAA==", - "exclusive": true, - "reserve": null - } -} -{ - "id": "example:reserveinputs#2", - "method": "reserveinputs", - "params": { - "psbt": "cHNidP8BAP32AQIAAAAMgnW099dbh1uD153ih5eU5WhluynLxekXjAOjkEdNBg8BAAAAAP3///9FWKQt8C+1y4741+beFSqWAaj9DuvzHNpxvpxS+GB8lwEAAAAA/f///6E5TAGqktI29Oso6b9kZZoAFFGGvpJQUM8VO+3LMTlmAAAAAAD9////nSDT7hrkuoQtAV1yNnbpkJsB5ifKoM2zP+CcLPfis1gBAAAAAP3///+P1rW90UXfD0gIk58h3sXxxy3ZfJJLP0H1I4Jpzy/87QEAAAAA/f///w0UKZ/s9DnPpV+FJ8h2BEI7tl+qVxSGRFRv9FYw4girAQAAAAD9////EPNsUFrEOZyfjbqbh8rfHQ4C9RQECw12n3c1yhFqkzoAAAAAAP3///8QW9LEsSmuvSnvVzy+FDktM7ewQmZnIJI/TJMahLmSzwEAAAAA/f///+4edbWRHDdRJcMeHHElgSmb+nENPsz/g/0AmAEU6hXeAAAAAAD9////T15YLGmk7HBsrL+awdcxi3db3esp8AcCTS9XGrEnfoAAAAAAAP3///8q7xInvEk7J0Ir9cpKXqU2lArUskkYLrimIE0+Yb6a2QEAAAAA/f///8hBLKyMa2zRJqwNOk7DmsDIfG7IvJtQiJ+QnkkHl6atAAAAAAD9////AAAAAAAAAAAAAAAAAAAAAAAA", - "exclusive": false, - "reserve": null - } -} -``` - -RETURN VALUE ------------- - -On success, an object containing **reservations** is returned. It is an array of objects, where each object contains: - -- **txid** (txid): The input transaction id. -- **vout** (u32): The input index output number which was reserved. -- **was\_reserved** (boolean): Whether the input was already reserved. -- **reserved** (boolean) (always *true*): Whether the input is now reserved. -- **reserved\_to\_block** (u32): What blockheight the reservation will expire. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "reservations": [ - { - "txid": "117dc9ec8515c6a5c63e15c6d087a1f16974cff9dc59b23bd315d3814a55094c", - "vout": 1, - "was_reserved": false, - "reserved": true, - "reserved_to_block": 175 - } - ] -} -{ - "reservations": [ - { - "txid": "0f064d4790a3038c17e9c5cb29bb6568e5949787e29dd7835b875bd7f7b47582", - "vout": 1, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - }, - { - "txid": "977c60f8529cbe71da1cf3eb0efda801962a15dee6d7f88ecbb52ff02da45845", - "vout": 1, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - }, - { - "txid": "663931cbed3b15cf505092be865114009a6564bfe928ebf436d292aa014c39a1", - "vout": 0, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - }, - { - "txid": "58b3e2f72c9ce03fb3cda0ca27e6019b90e97636725d012d84bae41aeed3209d", - "vout": 1, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - }, - { - "txid": "edfc2fcf698223f5413f4b927cd92dc7f1c5de219f9308480fdf45d1bdb5d68f", - "vout": 1, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - }, - { - "txid": "ab08e23056f46f5444861457aa5fb63b420476c827855fa5cf39f4ec9f29140d", - "vout": 1, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - }, - { - "txid": "3a936a11ca35779f760d0b0414f5020e1ddfca879bba8d9f9c39c45a506cf310", - "vout": 0, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - }, - { - "txid": "cf92b9841a934c3f9220676642b0b7332d3914be3c57ef29bdae29b1c4d25b10", - "vout": 1, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - }, - { - "txid": "de15ea14019800fd83ffcc3e0d71fa9b298125711c1ec32551371c91b5751eee", - "vout": 0, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - }, - { - "txid": "807e27b11a572f4d0207f029ebdd5b778b31d7c19abfac6c70eca4692c585e4f", - "vout": 0, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - }, - { - "txid": "d99abe613e4d20a6b82e1849b2d40a9436a55e4acaf52b42273b49bc2712ef2a", - "vout": 1, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - }, - { - "txid": "ada69707499e909f88509bbcc86e7cc8c09ac34e3a0dac26d16c6b8cac2c41c8", - "vout": 0, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - } - ] -} -``` - -ERRORS ------- - -On failure, an error is reported and no UTXOs are reserved. - -- -32602: Invalid parameter, such as specifying a spent/reserved input in *psbt*. - -AUTHOR ------- - -Lisa Neigut <> is mainly responsible. - -SEE ALSO --------- - -lightning-unreserveinputs(7), lightning-signpsbt(7), lightning-sendpsbt(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-sendcustommsg.7.md b/doc/lightning-sendcustommsg.7.md deleted file mode 100644 index 303cab980679..000000000000 --- a/doc/lightning-sendcustommsg.7.md +++ /dev/null @@ -1,67 +0,0 @@ -lightning-sendcustommsg -- Low-level interface to send protocol messages to peers -================================================================================= - -SYNOPSIS --------- - -**sendcustommsg** *node\_id* *msg* - -DESCRIPTION ------------ - -Command *added* in v0.10.1. - -The `sendcustommsg` RPC method allows the user to inject a custom message into the communication with the peer with the given `node_id`. This is intended as a low-level interface to implement custom protocol extensions on top, not for direct use by end-users. - -On the receiving end a plugin may implement the `custommsg` plugin hook and get notified about incoming messages, and allow additional unknown even types in their getmanifest response. - -- **node\_id** (pubkey): The node specified by `node_id` must be a peer, i.e., it must have a direct connection with the node receiving the RPC call, and the connection must be established. For a method to send arbitrary messages over multiple hops, including hops that do not understand the custom message, see the `createonion` and `sendonion` RPC methods. Messages can only be injected if the connection is handled by `openingd` or `channeld`. Messages cannot be injected when the peer is handled by `onchaind` or `closingd` since these do not have a connection, or are synchronous daemons that do not handle spontaneous messages. -- **msg** (hex): Must be a hex encoded well-formed message, including the 2-byte type prefix, but excluding the length prefix which will be added by the RPC method. The message types may not be one of the internally handled types, since that may cause issues with the internal state tracking of Core Lightning. We do (as of *v23.11*) allow sending of even types, but note that peers (as per the spec) will disconnect on receiving unknown even types. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:sendcustommsg#5", - "method": "sendcustommsg", - "params": { - "node_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "msg": "77770012" - } -} -``` - -RETURN VALUE ------------- - -The method will validate the arguments and queue the message for delivery through the daemon that is currently handling the connection. Queuing provides best effort guarantees and the message may not be delivered if the connection is terminated while the message is queued. The RPC method will return as soon as the message is queued. - -If any of the above limitations is not respected the method returns an explicit error message stating the issue. -On success, an object is returned, containing: - -- **status** (string): Information about where message was queued. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "status": "Message sent to connectd for delivery" -} -``` - -AUTHOR ------- - -Christian Decker <> is mainly responsible. - -SEE ALSO --------- - -lightning-createonion(7), lightning-sendonion(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-sendinvoice.7.md b/doc/lightning-sendinvoice.7.md deleted file mode 100644 index bd79ddb8c077..000000000000 --- a/doc/lightning-sendinvoice.7.md +++ /dev/null @@ -1,106 +0,0 @@ -lightning-sendinvoice -- Command for send an invoice for an offer -================================================================= - -SYNOPSIS --------- - -**(WARNING: experimental-offers only)** - -**sendinvoice** *invreq* *label* [*amount\_msat*] [*timeout*] [*quantity*] - -DESCRIPTION ------------ - -The **sendinvoice** RPC command creates and sends an invoice to the issuer of an *invoice\_request* for it to pay: lightning-invoicerequest(7). - -If **fetchinvoice-noconnect** is not specified in the configuation, it will connect to the destination in the (currently common!) case where it cannot find a route which supports `option_onion_messages`. - -- **invreq** (string): The bolt12 invoice\_request string beginning with `lnr1`. -- **label** (one of): The unique label to use for this invoice.: - - (string) - - (integer) -- **amount\_msat** (msat, optional): Required if the *offer* does not specify an amount at all, or specifies it in a different currency. Otherwise you may set it (e.g. to provide a tip). The default is the amount contained in the offer (multiplied by *quantity* if any). -- **timeout** (u32, optional): Seconds to wait for the offering node to pay the invoice or return an error. This will also be the timeout on the invoice that is sent. The default is 90 seconds. -- **quantity** (u64, optional): Quantity is is required if the offer specifies quantity\_max, otherwise it is not allowed. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:sendinvoice#1", - "method": "sendinvoice", - "params": { - "invreq": "lnr1qqg804wzdsyn8g4mf2yc22k8xvjpjzstwd5k6urvv5s8getnw3gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02gqsykppqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4nuzqw5w7y7xqm2rushk5a5n3mcuvqel954raykd5nqa830nq9hpd4s4fcnxw266vp9d5c8f3m3w40hmm6gm8akxx3rsnr7d4usunv0x3q8q", - "label": "payme for real!" - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **label** (string): Unique label supplied at invoice creation. -- **description** (string): Description used in the invoice. -- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. -- **status** (string) (one of "unpaid", "paid", "expired"): Whether it's paid, unpaid or unpayable. -- **expires\_at** (u64): UNIX timestamp of when it will become / became unpayable. -- **created\_index** (u64): 1-based index indicating order this invoice was created in. *(added v23.08)* -- **amount\_msat** (msat, optional): The amount required to pay this invoice. -- **bolt12** (string, optional): The BOLT12 string. -- **updated\_index** (u64, optional): 1-based index indicating order this invoice was changed (only present if it has changed since creation). *(added v23.08)* - -If **status** is "paid": - - **pay\_index** (u64): Unique incrementing index for this payment. - - **amount\_received\_msat** (msat): The amount actually received (could be slightly greater than *amount\_msat*, since clients may overpay). - - **paid\_at** (u64): UNIX timestamp of when it was paid. - - **payment\_preimage** (secret): Proof of payment. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "label": "payme for real!", - "bolt12": "lni1qqg804wzdsyn8g4mf2yc22k8xvjpjzstwd5k6urvv5s8getnw3gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02gqsykppqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4ngycqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky96qmcmtl30xtt7jdakfyhzm8f0gny6f4d2ukx5gurem04z8lfd2wza5qs9pz6wp9vu7cm6n4wmmrz77y4w6z5xv4q93yudkdtkl5zmzdzuawzqqex7gd5v0x0r83pqj82udd542fl4krh50s0dkx47d0hd5wh77g52xxl75ccpkt35mc8n282wslju9ufyys2y8qqqqqqqqqqqqqqqpgqqqqqqqqqqqqp6f9jm7k9yqqqqqq2gpr96l99lfspt25zqnyfgu7hznmt2tzkjdt92d2wc3dsq7keph7w8gudjs46spfzqrlu4gqs9vppqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky9muzqpze8kk43g0wh4h8qlac5lswwesrvsaxcza2f5j90c2h3ts8yzmn9g4mxqe89fngrqny8nf52xxuxep6548etda8lp876jr0nnxgdkdq", - "payment_hash": "4c89473d714f6b52c56935655354ec45b007ad90dfce3a38d942ba8052200ffc", - "amount_msat": 2, - "status": "paid", - "pay_index": 1, - "amount_received_msat": 2, - "paid_at": 1708640865, - "payment_preimage": "305951ab02cb2ea5eb884dbfd8fb110b4e088ecb8338b3e84e8f9c70919c19bf", - "description": "simple test", - "expires_at": 1708640953, - "created_index": 2, - "updated_index": 1 -} -``` - -ERRORS ------- - -The following error codes may occur: - -- -1: Catchall nonspecific error. -- 1002: Offer has expired. -- 1003: Cannot find a route to the node making the offer. -- 1004: The node making the offer returned an error message. -- 1005: We timed out waiting for the invoice to be paid - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-fetchinvoice(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-sendonion.7.md b/doc/lightning-sendonion.7.md deleted file mode 100644 index c5bc5b5ae93d..000000000000 --- a/doc/lightning-sendonion.7.md +++ /dev/null @@ -1,134 +0,0 @@ -lightning-sendonion -- Send a payment with a custom onion packet -================================================================ - -SYNOPSIS --------- - -**sendonion** *onion* *first\_hop* *payment\_hash* [*label*] [*shared\_secrets*] [*partid*] [*bolt11*] [*amount\_msat*] [*destination*] [*localinvreqid*] [*groupid*] [*description*] - -DESCRIPTION ------------ - -The **sendonion** RPC command can be used to initiate a payment attempt with a custom onion packet. The onion packet is used to deliver instructions for hops along the route on how to behave. Normally these instructions are indications on where to forward a payment and what parameters to use, or contain details of the payment for the final hop. However, it is possible to add arbitrary information for hops in the custom onion, allowing for custom extensions that are not directly supported by Core Lightning. - -If the first element of *route* does not have "channel" set, a suitable channel (if any) will be chosen, otherwise that specific short-channel-id is used. The following is an example of a 3 hop onion: - -```json -[ - "298606954e9de3e9d938d18a74fed794c440e8eda82e52dc08600953c8acf9c4", - "2dc094de72adb03b90894192edf9f67919cb2691b37b1f7d4a2f4f31c108b087", - "a7b82b240dbd77a4ac8ea07709b1395d8c510c73c17b4b392bb1f0605d989c85" -] -``` - -- **onion** (hex): Hex-encoded 1366 bytes long blob that was returned by either of the tools that can generate onions. It contains the payloads destined for each hop and some metadata. Please refer to [BOLT 04][bolt04] for further details. If is specific to the route that is being used and the *payment\_hash* used to construct, and therefore cannot be reused for other payments or to attempt a separate route. The custom onion can generally be created using the `devtools/onion` CLI tool, or the **createonion** RPC command. -- **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*.: - - **id** (pubkey): Node id for the peer. Use any available channel available to this peer. - - **amount\_msat** (msat): The amount to add an HTLC for millisatoshis. - - **delay** (u16): The number of blocks delay of blocks on top of the current blockheight. -- **payment\_hash** (hash): Specifies the 32 byte hex-encoded hash to use as a challenge to the HTLC that we are sending. It is specific to the onion and has to match the one the onion was created with. -- **label** (string, optional): Can be used to provide a human readable reference to retrieve the payment at a later time. -- **shared\_secrets** (array of secrets, optional): A JSON list of 32 byte hex-encoded secrets that were used when creating the onion. Core Lightning can send a payment with a custom onion without the knowledge of these secrets, however it will not be able to parse an eventual error message since that is encrypted with the shared secrets used in the onion. If *shared\_secrets* is provided Core Lightning will decrypt the error, act accordingly, e.g., add a `channel_update` included in the error to its network view, and set the details in *listsendpays* correctly. If it is not provided Core Lightning will store the encrypted onion, and expose it in *listsendpays* allowing the caller to decrypt it externally. If it is not provided the Core Lightning node does not know how long the route is, which channels or nodes are involved, and what an eventual error could have been. It can therefore be used for oblivious payments.: - - (secret, optional) -- **partid** (u16, optional): If provided and non-zero, allows for multiple parallel partial payments with the same *payment\_hash*. -- **bolt11** (string, optional): If provided, it will be returned in *waitsendpay* and *listsendpays* results. -- **amount\_msat** (msat, optional): Used to annotate the payment, and is returned by *waitsendpay* and *listsendpays*. -- **destination** (pubkey, optional): If provided, it will be returned in **listpays** result. -- **localinvreqid** (hash, optional): `localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7). -- **groupid** (u64, optional): Grouping key to disambiguate multiple attempts to pay an invoice or the same payment\_hash. -- **description** (string, optional): If provided, it will be returned in *waitsendpay* and *listsendpays* results. *(added v0.11.0)* - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:sendonion#1", - "method": "sendonion", - "params": { - "onion": "00034928294556b10308f9aeac7a240223d4d5f72097db1ef36a36b10cab937f2f205ed7218b47d4600eaf7fd390940bf9a6cdac99aafdb4783c468150eeeab9b57e56a06778d023ffb3bb84c7d8c2ad8868b61c28b566634af52c288ed6569583db66f5bd0edfb801c252f078020e1df6359af5969296b4698a71d17c5ca6e5ee4b64b7cce3ad0a1aa31e6be4d5fe3a31fa7a25259c640716020a9a248ca3ebb68eb823f8884b5df3710969f4c2ffb153779a923bab946ed43c1f6658d7f8e7e25303bb78ef4862fb550b8b1c79d522b035eedfda9ab70a61322522acf7233bb8ea2423958448fc8ac3d000835fda04bf661f1bf2ad2d091f506840bb2f10f82c0812149d99267a47824defe90877ed70db526b2200e18dccb92b17516de3778c055645728eadf4c74375aa0aae80a7773a536a908ca1e25c0fdca90e50ce0be05eeb973ec5e83ce3ab6b35818e021780428af81320a694483c1c15f64e685ba1fd3b1e1b926e6b4ec9eeeac8aca60c60e0f0f583e35e7f081dc6f4c64157e100c79c4c25101bed77cd9f93416f9a67d9f1916a782c498c38365af4a5fabb1b745fa840a054a06564c3f4b376aeb72cdd059d3794c82bbbf12a1f62234016a6912b384e7e4cebbd39ee4395aeff43c461e226d1e0151cce508a181a9c61275bf4b89e4556cf24df13b993dec96541555f8b9a699be9488568a11ac7f25849da62765472511ad74a6660c10e37f5fa13d4e4665ef7825ae1f2da4a86d5581912262de89b4b11a722fd127b31aa0d7fab8c679b07bf95e65cb80b2dacb5b90794399fb8f23823f68058431aa1c399b5baceccaf8521d004f45dba6ec1fddc54473343e9e67cd50cc3f2f3d8a5dab8a7ab9ae553dc3cd34e74b858da75975265f7c673a25e8d01a5130ab40eaba712b80c608cd0431b4b45ea0d81af595e21f24976608429127bf586f7507666500bc7245cf9266fa0bd0e58404c496e190c873cd143ace9048e9d5021c23967a24e09f2e54166e54b4ee8888dc1af535624e7ee8b426c1628175017a9e8a73eb1d0d49028a4f4d77897f3c08f1cd7bdee2b00f9bb9eadc49a69bf4f6c0cb2c95a16f03d7958f1b8f83cb40ae87ddf75f26050e2c2ed9f8f8523b3d389a50b217bda651dc21f095fe7d2d3851a0a6cf01051f3f3c6f1ad59ed46d44928d15a0e6e1bd4df4c99bdb82a05b0e781b69a73bc30fe579c8ac9fe8aeb6beb1c0f44def2775b7341af37e6ef58ceb34958b29d3e36112b78644612228761b8badc802f0b2b8fcaeb1db8f3a8db4afa2d7b4540a7c331db6f5141fa3909a513df875ff8a63f5b542d662781ca96a69e3b2925d6a63555b2c5825ffb2ad848d71122f54110e0d203000f3e9cc23b793c3540dfb8d881caedd25055a8f495e9e7a0391dbf9cbd9344f7df659ee8d3ce5ec16217ab83e1394ba991eb8ffd9a869f8ebb2e2428845e779979c57b5f8875f502728229a55ce87b3eba85c75264d30eaf7b373f6b09ba3086d9e98348d87b049468c2c30a6501cb2a3862f1703bbf29895e8b4262353eae720ed8ae678750011e2eb51f4800d3f4725fa873d7deec1c46f77a5f61c73dc938239e77f432bcc245c7b935413c51c0bc92bdaae144452aa95910909e46e500557961203f4e1483b9c09c124464907825e1ff74c87c58d6e2e91970baac9b89a554beca6df9acee16d77dd929d0caa7797e06f2c384c03fdedc89c697b9c34787a50cf399a8d7f195e79b347efc8267c474a477ce210f11049d432b280eaf3fccd451f6218d35c64cbd1006bcc54eeea8b856855c9aa92bc3adc6900a7c7a0eee09834c5a1f2da3d8ea9a478aea90c954952ad2a72d3856350ac3132d17e1e8116fa774066a22c857a827699c98285111a405e74685a3ae579ae78c545774f45491e4935bf4", - "first_hop": { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "channel": "103x3x0", - "direction": 1, - "amount_msat": 1002, - "delay": 21, - "style": "tlv" - }, - "payment_hash": "f584c14bb23506acdd94cf3cea377f3cc5805f3cba5430bc3756ef83ede1a0dc", - "label": null, - "shared_secrets": null, - "partid": null, - "bolt11": null, - "amount_msat": null, - "destination": null - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **created\_index** (u64): 1-based index indicating order this payment was created in. *(added v23.11)* -- **id** (u64): Old synonym for created\_index. -- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. -- **status** (string) (one of "pending", "complete"): Status of the payment (could be complete if already sent previously). -- **created\_at** (u64): The UNIX timestamp showing when this payment was initiated. -- **amount\_sent\_msat** (msat): The amount sent. -- **amount\_msat** (msat, optional): The amount delivered to destination (if known). -- **destination** (pubkey, optional): The final destination of the payment if known. -- **label** (string, optional): The label, if given to sendpay. -- **bolt11** (string, optional): The bolt11 string (if supplied). -- **bolt12** (string, optional): The bolt12 string (if supplied: **experimental-offers** only). -- **partid** (u64, optional): The partid (if supplied) to sendonion/sendpay. - -If **status** is "complete": - - **payment\_preimage** (secret): The proof of payment: SHA256 of this **payment\_hash**. - - **updated\_index** (u64, optional): 1-based index indicating order this payment was changed. *(added v23.11)* - -If **status** is "pending": - - **message** (string, optional): Monitor status with listpays or waitsendpay. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "message": "Monitor status with listpays or waitsendpay", - "created_index": 1, - "id": 1, - "payment_hash": "f584c14bb23506acdd94cf3cea377f3cc5805f3cba5430bc3756ef83ede1a0dc", - "groupid": 1, - "amount_sent_msat": 1002, - "created_at": 1706315098, - "status": "pending" -} -``` - -ERRORS ------- - -The following error codes may occur: - -- 202: an parseable onion - -the error details are decrypted and presented here, if *shared\_secrets* was provided and an error was returned by one of the intermediate nodes - -AUTHOR ------- - -Christian Decker <> is mainly responsible. - -SEE ALSO --------- - -lightning-createonion(7), lightning-sendpay(7), lightning-listsendpays(7) - -RESOURCES ---------- - -Main web site: - -[bolt04]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md diff --git a/doc/lightning-sendonionmessage.7.md b/doc/lightning-sendonionmessage.7.md deleted file mode 100644 index af5fb7fc61af..000000000000 --- a/doc/lightning-sendonionmessage.7.md +++ /dev/null @@ -1,43 +0,0 @@ -lightning-sendonionmessage -- low-level command to send an onion message -======================================================================== - -SYNOPSIS --------- - -**(WARNING: experimental-onion-messages only)** - -**sendonionmessage** *first\_id* *blinding* *hops* - -DESCRIPTION ------------ - -The **sendonionmessage** RPC command can be used to send a message via the lightning network. These are currently used by *offers* to request and receive invoices. - -- **first\_id** (pubkey): The (presumably well-known) public key of the start of the path. -- **blinding** (pubkey): Blinding factor for this path. -- **hops** (array of objects): - : - - **node** (pubkey): Public key of the node. - - **tlv** (u8): Contains a hexadecimal TLV to include. - -RETURN VALUE ------------- - -On success, an empty object is returned. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-fetchinvoice(7), lightning-offer(7) - -RESOURCES ---------- - -Main web site: - -[bolt04]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md diff --git a/doc/lightning-sendpay.7.md b/doc/lightning-sendpay.7.md deleted file mode 100644 index eb6306c00597..000000000000 --- a/doc/lightning-sendpay.7.md +++ /dev/null @@ -1,195 +0,0 @@ -lightning-sendpay -- Low-level command for sending a payment via a route -======================================================================== - -SYNOPSIS --------- - -**sendpay** *route* *payment\_hash* [*label*] [*amount\_msat*] [*bolt11*] [*payment\_secret*] [*partid*] [*localinvreqid*] [*groupid*] [*payment\_metadata*] [*description*] - -DESCRIPTION ------------ - -The **sendpay** RPC command attempts to send funds associated with the given *payment\_hash*, along a route to the final destination in the route. - -Generally, a client would call lightning-getroute(7) to resolve a route, then use **sendpay** to send it. If it fails, it would call lightning-getroute(7) again to retry. If the route is empty, a payment-to-self is attempted. - -The response will occur when the payment is on its way to the destination. The **sendpay** RPC command does not wait for definite success or definite failure of the payment (except for already-succeeded payments, or to-self payments). Instead, use the **waitsendpay** RPC command to poll or wait for definite success or definite failure. - -Once a payment has succeeded, calls to **sendpay** with the same *payment\_hash* but a different *amount\_msat* or destination will fail; this prevents accidental multiple payments. Calls to **sendpay** with the same *payment\_hash*, *amount\_msat*, and destination as a previous successful payment (even if a different route or *partid*) will return immediately with success. - -- **route** (array of objects): - - **id** (pubkey): The node at the end of this hop. - - **channel** (short\_channel\_id): The channel joining these nodes. - - **delay** (u32): The total CLTV expected by the node at the end of this hop. - - **amount\_msat** (msat): The amount expected by the node at the end of this hop. -- **payment\_hash** (hash): The hash of the payment\_preimage. -- **label** (string, optional): The label provided when creating the invoice\_request. -- **amount\_msat** (msat, optional): Amount must be provided if *partid* is non-zero, or the payment is to-self, otherwise it must be equal to the final amount to the destination. it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. The default is in millisatoshi precision. -- **bolt11** (string, optional): Bolt11 invoice to pay. If provided, will be returned in *waitsendpay* and *listsendpays* results. -- **payment\_secret** (secret, optional): Value that the final recipient requires to accept the payment, as defined by the `payment_data` field in BOLT 4 and the `s` field in the BOLT 11 invoice format. It is required if *partid* is non-zero. -- **partid** (u64, optional): Must not be provided for self-payments. If provided and non-zero, allows for multiple parallel partial payments with the same *payment\_hash*. The *amount\_msat* amount (which must be provided) for each **sendpay** with matching *payment\_hash* must be equal, and **sendpay** will fail if there are differing values given. -- **localinvreqid** (hex, optional): Indicates that this payment is being made for a local invoice\_request. This ensures that we only send a payment for a single-use invoice\_request once. -- **groupid** (u64, optional): Allows you to attach a number which appears in **listsendpays** so payments can be identified as part of a logical group. The *pay* plugin uses this to identify one attempt at a MPP payment, for example. -- **payment\_metadata** (hex, optional): Placed in the final onion hop TLV. *(added v0.11.0)* -- **description** (string, optional): Description used in the invoice. *(added v0.11.0)* - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:sendpay#1", - "method": "sendpay", - "params": { - "route": [ - { - "amount_msat": 11000000, - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "delay": 5, - "channel": "103x1x0" - } - ], - "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", - "label": null, - "amount_msat": null, - "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk", - "payment_secret": "82644944d3f70d42aad1d5f7b5d7a629e7afa30b529cc952a4c59fc0e3790ea2", - "partid": null, - "groupid": null, - "payment_metadata": null - } -} -{ - "id": "example:sendpay#2", - "method": "sendpay", - "params": { - "route": [ - { - "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "channel": "103x1x0", - "direction": 1, - "amount_msat": 4211, - "style": "tlv", - "delay": 24 - }, - { - "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", - "channel": "105x1x0", - "direction": 0, - "amount_msat": 3710, - "style": "tlv", - "delay": 16 - }, - { - "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "channel": "107x1x0", - "direction": 1, - "amount_msat": 3210, - "style": "tlv", - "delay": 8 - } - ], - "payment_hash": "bc747053329402620a26bdc187cd134cdb699130d85be499ecd24160aff04c5c", - "label": null, - "amount_msat": null, - "bolt11": null, - "payment_secret": "c36a2fe9aced78c06960e2f21b369ed03f0492c97e53ba3b662163bcdaf1d7fa", - "partid": null, - "groupid": null, - "payment_metadata": null - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **created\_index** (u64): 1-based index indicating order this payment was created in. *(added v23.11)* -- **id** (u64): Old synonym for created\_index. -- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. -- **status** (string) (one of "pending", "complete"): Status of the payment (could be complete if already sent previously). -- **created\_at** (u64): The UNIX timestamp showing when this payment was initiated. -- **amount\_sent\_msat** (msat): The amount sent. -- **updated\_index** (u64, optional): 1-based index indicating order this payment was changed (only present if it has changed since creation). *(added v23.11)* -- **groupid** (u64, optional): Grouping key to disambiguate multiple attempts to pay an invoice or the same payment\_hash. -- **amount\_msat** (msat, optional): The amount delivered to destination (if known). -- **destination** (pubkey, optional): The final destination of the payment if known. -- **completed\_at** (u64, optional): The UNIX timestamp showing when this payment was completed. -- **label** (string, optional): The *label*, if given to sendpay. -- **partid** (u64, optional): The *partid*, if given to sendpay. -- **bolt11** (string, optional): The bolt11 string (if supplied). -- **bolt12** (string, optional): The bolt12 string (if supplied: **experimental-offers** only). - -If **status** is "complete": - - **payment\_preimage** (secret): The proof of payment: SHA256 of this **payment\_hash**. - -If **status** is "pending": - - **message** (string): Monitor status with listpays or waitsendpay. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "message": "Monitor status with listpays or waitsendpay", - "created_index": 1, - "id": 1, - "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", - "groupid": 1, - "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "amount_msat": 11000000, - "amount_sent_msat": 11000000, - "created_at": 1706152930, - "status": "pending", - "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk" -} -{ - "message": "Monitor status with listpays or waitsendpay", - "created_index": 2, - "id": 2, - "payment_hash": "bc747053329402620a26bdc187cd134cdb699130d85be499ecd24160aff04c5c", - "groupid": 1, - "destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "amount_msat": 3210, - "amount_sent_msat": 4211, - "created_at": 1708624260, - "status": "pending" -} -``` - -ERRORS ------- - -On error, if the error occurred from a node other than the final destination, the route table will be updated so that lightning-getroute(7) should return an alternate route (if any). An error from the final destination implies the payment should not be retried. - -- -1: Catchall nonspecific error. -- 201: Already paid with this *hash* using different amount or destination. -- 202: Unparseable onion reply. The *data* field of the error will have an *onionreply* field, a hex string representation of the raw onion reply. -- 203: Permanent failure at destination. The *data* field of the error will be routing failure object. -- 204: Failure along route; retry a different route. The *data* field of the error will be routing failure object. -- 212: *localinvreqid* refers to an invalid, or used, local invoice\_request. - -A routing failure object has the fields below: - -*erring\_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on. -*erring\_node*: The hex string of the pubkey id of the node that reported the error. -*erring\_channel*: The short channel ID of the channel that has the error, or *0:0:0* if the destination node raised the error. In addition *erring\_direction* will indicate which direction of the channel caused the failure. -*failcode*: The failure code, as per BOLT #4. -*channel\_update*: The hex string of the *channel\_update* message received from the remote node. Only present if error is from the remote node and the *failcode* has the UPDATE bit set, as per BOLT #4. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-listinvoice(7), lightning-delinvoice(7), lightning-getroute(7), lightning-invoice(7), lightning-pay(7), lightning-waitsendpay(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-sendpsbt.7.md b/doc/lightning-sendpsbt.7.md deleted file mode 100644 index 60fb5726ad00..000000000000 --- a/doc/lightning-sendpsbt.7.md +++ /dev/null @@ -1,81 +0,0 @@ -lightning-sendpsbt -- Command to finalize, extract and send a partially signed bitcoin transaction (PSBT). -========================================================================================================== - -SYNOPSIS --------- - -**sendpsbt** *psbt* [*reserve*] - -DESCRIPTION ------------ - -The **sendpsbt** is a low-level RPC command which sends a fully-signed PSBT. - -- **psbt** (string): The fully signed psbt to be sent. -- **reserve** (u32, optional): Number of blocks to increase reservation of any of our inputs by. The default is 72. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:sendpsbt#1", - "method": "sendpsbt", - "params": { - "psbt": "some_psbt" - } -} -{ - "id": "example:sendpsbt#2", - "method": "sendpsbt", - "params": { - "psbt": "cHNidP8BAM0CAAAABEV+dnFRINmyeHxi4Id0OrcuzI5au5/BlPtTfu7E2m3EAAAAAAD9////cv8oioDx+0NCEnjBSYtnwF0H4VR13j+bkyb5gOOQLUUBAAAAAP3///8ehOrKm7JEq6zflkp9+zmSwE1iPe1yh3KTXvk+om/legEAAAAA/f///2s31wNrI1UavMgjC1GyrOHNbxOm68KYa13WX/mGfmjcAQAAAAD9////AcEAPQAAAAAAFgAUyQltQ/QI6lJgICYsza18hRa5KoEAAAAAAAEAcQIAAAABTzfqjIqV1wPpqc/3/Cb+tMX5EDrLmnhb5BMNx3aB/hYAAAAAAP3///8CQEIPAAAAAAAWABR9CNmX36nN45+GhjqvD4LjLMMMg/+juSkBAAAAFgAUJB0adsMdjkacZWrLwyteqfOaTrRlAAAAAQEfQEIPAAAAAAAWABR9CNmX36nN45+GhjqvD4LjLMMMgyICA1p5u7tAbUvCjfBfpqhzKM+wKn4TdDvs3NHfz+BxwuAQRzBEAiBwFb9rA0nUVlIPGd2aaiRbJ+KH4MLM3Bu+f0JuXB/hwAIgT2rrIUG9gXBZoH9fcPjCnbbM1SR4GiLYGLeALB8yENoBIgYDWnm7u0BtS8KN8F+mqHMoz7AqfhN0O+zc0d/P4HHC4BAIfQjZlwAAAAAAAQBxAgAAAAGANpEFI+CgfALTim/MWsAa62g+EmFWrFrzBDBCmCB3MgAAAAAA/f///wKZKdgpAQAAABYAFB+xhfU1pgl9WIvDKzAHZp8UeNkzQEIPAAAAAAAWABQHHEnK0vQg88gF+fa5ilcmnLFBUGUAAAABAR9AQg8AAAAAABYAFAccScrS9CDzyAX59rmKVyacsUFQIgICXTcoCCnxhsuZXNzL8jirRWQBOTlzUTljJKNldd803f9HMEQCIDtx/kEoc4PHDDm4eX5SEOmuRGu7ShpEG7xKBbuD/NjiAiBYkIKod39dcBarCT7Dbchkuwx70tJhOxQSJi2EMioGrwEiBgJdNygIKfGGy5lc3MvyOKtFZAE5OXNROWMko2V13zTd/wgHHEnKAAAAAAABAHECAAAAAVHU7RCZylzRMdlMBJ2ba4XKxv0l7LdWVnPYS6mhkf60AAAAAAD9////Av5VbSkBAAAAFgAU0BhRKzRbIC6H+s6j86d6cMpTNNhAQg8AAAAAABYAFD1D0ia8wnAZreUtej3FKnrBvii4ZQAAAAEBH0BCDwAAAAAAFgAUPUPSJrzCcBmt5S16PcUqesG+KLgiAgKKWZFo08l968cbxm5icOzwVPMA2Igwm6BUcaSCF13ZMEcwRAIgNAeIVGvUj9MWM18am0dx3JtEf79iQMX7Rqz1tttes3ICIAtNCglUlvpSidAxc/xoiy9cA13bgimJx25G+eZXfYJeASIGAopZkWjTyX3rxxvGbmJw7PBU8wDYiDCboFRxpIIXXdkwCD1D0iYAAAAAAAEAcQIAAAABRX52cVEg2bJ4fGLgh3Q6ty7Mjlq7n8GU+1N+7sTabcQBAAAAAP3///8CMmGqKQEAAAAWABSxLq0p9YAKl+hX7pFc0K/X+PIWmUBCDwAAAAAAFgAUZhwjt5DdNJE3OvCx2L7Qh31c3iJlAAAAAQEfQEIPAAAAAAAWABRmHCO3kN00kTc68LHYvtCHfVzeIiICA/qclQheQrHlADzR9BgXjDDJbkrneVTKD8SMWIJv9OsORzBEAiBKABqNV7cF5DKhtd+m+ZEmWF21vBt2uBKnzeDuUFqvDwIgJc6+/6GQqIfz869kJpUFTAMYTeL2qWR6d28EQEOJgkMBIgYD+pyVCF5CseUAPNH0GBeMMMluSud5VMoPxIxYgm/06w4IZhwjtwAAAAAAAA==", - "reserve": null - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **tx** (hex): The raw transaction which was sent. -- **txid** (txid): The txid of the **tx**. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "txid": "05985072bbe20747325e69a159fe08176cc1bbc96d25e8848edad2dddc1165d0", - "tx": "02000000027032912651fc25a3e0893acd5f9640598707e2dfef92143bb5a4020e335442800100000017160014a5f48b9aa3cb8ca6cc1040c11e386745bb4dc932ffffffffd229a4b4f78638ebcac10a68b0561585a5d6e4d3b769ad0a909e9b9afaeae24e00000000171600145c83da9b685f9142016c6f5eb5f98a45cfa6f686ffffffff01915a01000000000017a9143a4dfd59e781f9c3018e7d0a9b7a26d58f8d22bf8700000000" -} -{ - "tx": "02000000000104457e76715120d9b2787c62e087743ab72ecc8e5abb9fc194fb537eeec4da6dc40000000000fdffffff72ff288a80f1fb43421278c1498b67c05d07e15475de3f9b9326f980e3902d450100000000fdffffff1e84eaca9bb244abacdf964a7dfb3992c04d623ded728772935ef93ea26fe57a0100000000fdffffff6b37d7036b23551abcc8230b51b2ace1cd6f13a6ebc2986b5dd65ff9867e68dc0100000000fdffffff01c1003d0000000000160014c9096d43f408ea526020262ccdad7c8516b92a810247304402207015bf6b0349d456520f19dd9a6a245b27e287e0c2ccdc1bbe7f426e5c1fe1c002204f6aeb2141bd817059a07f5f70f8c29db6ccd524781a22d818b7802c1f3210da0121035a79bbbb406d4bc28df05fa6a87328cfb02a7e13743becdcd1dfcfe071c2e0100247304402203b71fe41287383c70c39b8797e5210e9ae446bbb4a1a441bbc4a05bb83fcd8e20220589082a8777f5d7016ab093ec36dc864bb0c7bd2d2613b1412262d84322a06af0121025d37280829f186cb995cdccbf238ab45640139397351396324a36575df34ddff024730440220340788546bd48fd316335f1a9b4771dc9b447fbf6240c5fb46acf5b6db5eb37202200b4d0a095496fa5289d03173fc688b2f5c035ddb822989c76e46f9e6577d825e0121028a599168d3c97debc71bc66e6270ecf054f300d888309ba05471a482175dd9300247304402204a001a8d57b705e432a1b5dfa6f99126585db5bc1b76b812a7cde0ee505aaf0f022025cebeffa190a887f3f3af642695054c03184de2f6a9647a776f044043898243012103fa9c95085e42b1e5003cd1f418178c30c96e4ae77954ca0fc48c58826ff4eb0e00000000", - "txid": "43bb1c1bce6763ffe4d5df6b49f152f907f36f7849e55bb56075e2b256d17502" -} -``` - -ERRORS ------- - -On failure, one of the following error codes may be returned: - -- -32602: Error in given parameters or some error happened during the command process. - -AUTHOR ------- - -Vincenzo Palazzo <> wrote the initial version of this man page, -but many others did the hard work of actually implementing this rpc command. - -SEE ALSO --------- - -lightning-fundpsbt(7), lightning-signpsbt(7), lightning-listtransactions(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-setchannel.7.md b/doc/lightning-setchannel.7.md deleted file mode 100644 index 78acb95c4bab..000000000000 --- a/doc/lightning-setchannel.7.md +++ /dev/null @@ -1,128 +0,0 @@ -lightning-setchannel -- Command for configuring fees / htlc range advertized for a channel -========================================================================================== - -SYNOPSIS --------- - -**setchannel** *id* [*feebase*] [*feeppm*] [*htlcmin*] [*htlcmax*] [*enforcedelay*] [*ignorefeelimits*] - -DESCRIPTION ------------ - -The **setchannel** RPC command sets channel specific routing fees, and `htlc_minimum_msat` or `htlc_maximum_msat` as defined in BOLT #7. The channel has to be in normal or awaiting state. This can be checked by **listpeers** reporting a *state* of CHANNELD\_NORMAL or CHANNELD\_AWAITING\_LOCKIN for the channel. - -These changes (for a public channel) will be broadcast to the rest of the network (though many nodes limit the rate of such changes they will accept: we allow 2 a day, with a few extra occasionally). - -- **id** (string): Should contain a scid (short channel ID), channel id or peerid (pubkey) of the channel to be modified. If *id* is set to `all`, the updates are applied to all channels in states CHANNELD\_NORMAL CHANNELD\_AWAITING\_LOCKIN or DUALOPEND\_AWAITING\_LOCKIN. If *id* is a peerid, all channels with the +peer in those states are changed. -- **feebase** (msat, optional): Value in millisatoshi that is added as base fee to any routed payment: if omitted, it is unchanged. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. -- **feeppm** (u32, optional): Value that is added proportionally per-millionths to any routed payment volume in satoshi. For example, if ppm is 1,000 and 1,000,000 satoshi is being routed through the channel, an proportional fee of 1,000 satoshi is added, resulting in a 0.1% fee. -- **htlcmin** (msat, optional): Value that limits how small an HTLC we will forward: if omitted, it is unchanged. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. Note that the peer also enforces a minimum for the channel: setting it below that will simply set it to that value with a warning. Also note that *htlcmin* only applies to forwarded HTLCs: we can still send smaller payments ourselves. The default is no lower limit. -- **htlcmax** (msat, optional): Value that limits how large an HTLC we will forward: if omitted, it is unchanged. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. Note that *htlcmax* only applies to forwarded HTLCs: we can still send larger payments ourselves. The default is no effective limit. -- **enforcedelay** (u32, optional): Number of seconds to delay before enforcing the new fees/htlc max. This gives the network a chance to catch up with the new rates and avoids rejecting HTLCs before they do. This only has an effect if rates are increased (we always allow users to overpay fees) or *htlcmax* is decreased, and only applied to a single rate increase per channel (we don't remember an arbitrary number of prior feerates) and if the node is restarted the updated configuration is enforced immediately. The default is 600, which is ten minutes. -- **ignorefeelimits** (boolean, optional): If set to True means to allow the peer to set the commitment transaction fees (or closing transaction fees) to any value they want. This is dangerous: they could set an exorbitant fee (so HTLCs are unenforcable), or a tiny fee (so that commitment transactions cannot be relayed), but avoids channel breakage in case of feerate disagreements. (Note: the global `ignore_fee_limits` setting overrides this). *(added v23.08)* - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:setchannel#1", - "method": "setchannel", - "params": { - "id": "103x1x0", - "feebase": null, - "feeppm": null, - "htlcmin": null, - "htlcmax": null, - "enforcedelay": null, - "ignorefeelimits": true - } -} -{ - "id": "example:setchannel#2", - "method": "setchannel", - "params": { - "id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", - "feebase": 4000, - "feeppm": 300, - "htlcmin": null, - "htlcmax": null, - "enforcedelay": 0, - "ignorefeelimits": null - } -} -``` - -RETURN VALUE ------------- - -On success, an object containing **channels** is returned. It is an array of objects, where each object contains: - -- **peer\_id** (pubkey): The node\_id of the peer. -- **channel\_id** (hash): The channel\_id of the channel. -- **fee\_base\_msat** (msat): The resulting feebase (this is the BOLT #7 name). -- **fee\_proportional\_millionths** (u32): The resulting feeppm (this is the BOLT #7 name). -- **ignore\_fee\_limits** (boolean): If we are now allowing peer to set feerate on commitment transaction without restriction. *(added v23.08)* -- **minimum\_htlc\_out\_msat** (msat): The resulting htlcmin we will advertize (the BOLT #7 name is htlc\_minimum\_msat). -- **maximum\_htlc\_out\_msat** (msat): The resulting htlcmax we will advertize (the BOLT #7 name is htlc\_maximum\_msat). -- **short\_channel\_id** (short\_channel\_id, optional): The short\_channel\_id (if locked in). -- the following warnings are possible: - - **warning\_htlcmin\_too\_low**: The requested htlcmin was too low for this peer, so we set it to the minimum they will allow. - - **warning\_htlcmax\_too\_high**: The requested htlcmax was greater than the channel capacity, so we set it to the channel capacity. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "channels": [ - { - "peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", - "channel_id": "90210d39d12a65d239ece267c5f48e0a82e7cb95724e658f6d99f370064faad1", - "short_channel_id": "103x1x0", - "fee_base_msat": 1, - "fee_proportional_millionths": 10, - "minimum_htlc_out_msat": 0, - "maximum_htlc_out_msat": 990000000, - "ignore_fee_limits": true - } - ] -} -{ - "channels": [ - { - "peer_id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", - "channel_id": "9c54c71bbbe59591cc3162e14fc4ff58c146f085c07d0f206ea679a8231d03ab", - "short_channel_id": "103x3x0", - "fee_base_msat": 4000, - "fee_proportional_millionths": 300, - "minimum_htlc_out_msat": 0, - "maximum_htlc_out_msat": 990000000, - "ignore_fee_limits": false - } - ] -} -``` - -ERRORS ------- - -The following error codes may occur: - -- -1: Channel is in incorrect state, i.e. Catchall nonspecific error. -- -32602: JSONRPC2\_INVALID\_PARAMS, i.e. Given id is not a channel ID or short channel ID. - -AUTHOR ------- - -Michael Schmoock <> is the author of this feature. - -SEE ALSO --------- - -lightningd-config(5), lightning-fundchannel(7), lightning-listchannels(7), lightning-listpeers(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-setconfig.7.md b/doc/lightning-setconfig.7.md deleted file mode 100644 index bfda1701e0c0..000000000000 --- a/doc/lightning-setconfig.7.md +++ /dev/null @@ -1,123 +0,0 @@ -lightning-setconfig -- Dynamically change some config options -============================================================= - -SYNOPSIS --------- - -**setconfig** *config* [*val*] - -DESCRIPTION ------------ - -Command *added* in v23.08. - -The **setconfig** RPC command allows you set the (dynamic) configuration option named by `config`: options which take a value (as separate from simple flag options) also need a `val` parameter. - -This new value will *also* be written at the end of the config file, for persistence across restarts (and any old value commented out). - -You can see what options are dynamically adjustable using lightning- listconfigs(7). Note that you can also adjust existing options for stopped plugins; they will have an effect when the plugin is restarted. - -- **config** (string): Name of the config variable which should be set to the value of the variable. -- **val** (one of, optional): Value of the config variable to be set or updated.: - - (string) - - (integer) - - (boolean) - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:setconfig#1", - "method": "setconfig", - "params": [ - "autoclean-paidinvoices-age", - 1 - ] -} -{ - "id": "example:setconfig#2", - "method": "setconfig", - "params": [ - "test-dynamic-config", - "changed" - ] -} -{ - "id": "example:setconfig#3", - "method": "setconfig", - "params": { - "config": "min-capacity-sat", - "val": 500000 - } -} -``` - -RETURN VALUE ------------- - -On success, an object containing **config** is returned. It is an object containing: - -- **config** (string): Name of the config variable which was set. -- **source** (string): Source of configuration setting (`file`:`linenum`). -- **dynamic** (boolean) (always *true*): Whether this option is settable via setconfig. -- **plugin** (string, optional): The plugin this configuration setting is for. -- **set** (boolean, optional): For simple flag options. -- **value\_str** (string, optional): For string options. -- **value\_msat** (msat, optional): For msat options. -- **value\_int** (integer, optional): For integer options. -- **value\_bool** (boolean, optional): For boolean options. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "config": { - "config": "autoclean-paidinvoices-age", - "value_int": 1, - "source": "/tmp/ltests-7u_8_rtu/test_autoclean_1/lightning-3/regtest/config:6", - "plugin": "~/lightning/plugins/autoclean", - "dynamic": true - } -} -{ - "config": { - "config": "test-dynamic-config", - "value_str": "changed", - "source": "/tmp/ltests-7u_8_rtu/test_dynamic_option_python_plugin_1/lightning-1/regtest/config:2", - "plugin": "~/lightning/tests/plugins/dynamic_option.py", - "dynamic": true - } -} -{ - "config": { - "config": "min-capacity-sat", - "value_int": 500000, - "source": "/tmp/ltests-nvfdbou2/test_setconfig_1/lightning-2/regtest/config:2", - "dynamic": true - } -} -``` - -ERRORS ------- - -The following error codes may occur: - -- -32602: JSONRPC2\_INVALID\_PARAMS, i.e. the parameter is not dynamic, or the val was invalid. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible for this feature. - -SEE ALSO --------- - -lightningd-config(5), lightning-listconfigs(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-setpsbtversion.7.md b/doc/lightning-setpsbtversion.7.md deleted file mode 100644 index 653aa4987206..000000000000 --- a/doc/lightning-setpsbtversion.7.md +++ /dev/null @@ -1,78 +0,0 @@ -lightning-setpsbtversion -- Command for setting PSBT version -============================================================ - -SYNOPSIS --------- - -**setpsbtversion** *psbt* *version* - -DESCRIPTION ------------ - -The **setpsbtversion** RPC command converts the provided PSBT to the given version, and returns the base64 result of the conversion. Returns an error if version is invalid. - -- **psbt** (string): The PSBT to change versions. -- **version** (u32): The version to set. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:setpsbtversion#1", - "method": "setpsbtversion", - "params": { - "psbt": "cHNidP8BAAoCAAAAAAAAAAAAAA==", - "version": "2" - } -} -{ - "id": "example:setpsbtversion#2", - "method": "setpsbtversion", - "params": [ - "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIJd6ICNAQALFOMhoUHuSVSuzcaUdkDKlk4K+A+DR9+4uAA==", - 0 - ] -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **psbt** (string): A converted PSBT of the requested version. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "psbt": "cHNidP8BAgQCAAAAAQQBAAEFAQABBgEDAfsEAgAAAAA=" -} -{ - "psbt": "cHNidP8BADUCAAAAAAFAQg8AAAAAACJRIJd6ICNAQALFOMhoUHuSVSuzcaUdkDKlk4K+A+DR9+4ubwAAAAAA" -} -``` - -ERRORS ------- - -The following error codes may occur: - -- -32602: Parameter missed or malformed. - -AUTHOR ------- - -Gregory Sanders <> is mainly responsible. - -SEE ALSO --------- - -lightning-fundpsbt(7), lightning-utxopsbt(7), lightning-signpsbt(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-showrunes.7.md b/doc/lightning-showrunes.7.md deleted file mode 100644 index bc1bf3208c1b..000000000000 --- a/doc/lightning-showrunes.7.md +++ /dev/null @@ -1,131 +0,0 @@ -lightning-showrunes -- Command to list previously generated runes -================================================================= - -SYNOPSIS --------- - -**showrunes** [*rune*] - -DESCRIPTION ------------ - -Command *added* in v23.08. - -The **showrunes** RPC command either lists runes that we stored as we generate them (see lightning-createrune(7)) or decodes the rune given on the command line. - -- **rune** (string, optional): If specified, only details of that rune will be returned. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:showrunes#1", - "method": "showrunes", - "params": "{}" -} -{ - "id": "example:showrunes#2", - "method": "showrunes", - "params": { - "rune": "Bl0V_vkVkGr4h356JbCMCcoDyyKE8djkoQ2156iPB509MCZwZXI9MTAwMDAwMDAwMG5zZWM=" - } -} -``` - -RETURN VALUE ------------- - -On success, an object containing **runes** is returned. It is an array of objects, where each object contains: - -- **rune** (string): Base64 encoded rune. -- **unique\_id** (string): Unique id assigned when the rune was generated; this is always a u64 for commando runes. -- **restrictions** (array of objects): The restrictions on what commands this rune can authorize.: - - **alternatives** (array of objects): - - **fieldname** (string): The field this restriction applies to; see commando-rune(7). - - **value** (string): The value accepted for this field. - - **condition** (string): The way to compare fieldname and value. - - **english** (string): English readable description of this alternative. - - **english** (string): English readable summary of alternatives above. -- **restrictions\_as\_english** (string): English readable description of the restrictions array above. -- **stored** (boolean, optional) (always *false*): This is false if the rune does not appear in our datastore (only possible when `rune` is specified). -- **blacklisted** (boolean, optional) (always *true*): The rune has been blacklisted; see commando-blacklist(7). -- **last\_used** (number, optional): The last time this rune was successfully used. *(added 23.11)* -- **our\_rune** (boolean, optional) (always *false*): This is not a rune for this node (only possible when `rune` is specified). - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "runes": [ - { - "rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==", - "unique_id": "0", - "restrictions": [], - "restrictions_as_english": "" - }, - { - "rune": "geZmO6U7yqpHn-moaX93FVMVWrDRfSNY4AXx9ypLcqg9MQ==", - "unique_id": "1", - "restrictions": [], - "restrictions_as_english": "" - }, - { - "rune": "Bl0V_vkVkGr4h356JbCMCcoDyyKE8djkoQ2156iPB509MCZwZXI9MTAwMDAwMDAwMG5zZWM=", - "unique_id": "2", - "restrictions": [ - { - "alternatives": [ - { - "fieldname": "per", - "value": "1000000000nsec", - "condition": "=", - "english": "per equal to 1000000000nsec" - } - ], - "english": "per equal to 1000000000nsec" - } - ], - "restrictions_as_english": "per equal to 1000000000nsec" - } - ] -} -{ - "runes": [ - { - "rune": "Bl0V_vkVkGr4h356JbCMCcoDyyKE8djkoQ2156iPB509MCZwZXI9MTAwMDAwMDAwMG5zZWM=", - "unique_id": "2", - "restrictions": [ - { - "alternatives": [ - { - "fieldname": "per", - "value": "1000000000nsec", - "condition": "=", - "english": "per equal to 1000000000nsec" - } - ], - "english": "per equal to 1000000000nsec" - } - ], - "restrictions_as_english": "per equal to 1000000000nsec" - } - ] -} -``` - -AUTHOR ------- - -Shahana Farooqui <> is mainly responsible. - -SEE ALSO --------- - -lightning-commando-showrunes(7), lightning-blacklistrune(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-signinvoice.7.md b/doc/lightning-signinvoice.7.md deleted file mode 100644 index 54e57547fb91..000000000000 --- a/doc/lightning-signinvoice.7.md +++ /dev/null @@ -1,67 +0,0 @@ -lightning-signinvoice -- Low-level invoice signing -================================================== - -SYNOPSIS --------- - -**signinvoice** *invstring* - -DESCRIPTION ------------ - -Command *added* in v23.02. - -The **signinvoice** RPC command signs an invoice. Unlike **createinvoice** it does not save the invoice into the database and thus does not require the preimage. - -- **invstring** (string): Bolt11 form, but the final signature is ignored. Minimal sanity checks are done. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:signinvoice#1", - "method": "signinvoice", - "params": [ - "lnbcrt10n1pjmxt3lsp5jumuz2sv3ca68kzd92hp3wdtpx8ghnxur65fs6maw6dyxsleqd0spp5nadvvh7uzk2qzh8d9d7tsxr08l9uaz2vjeuuahqtufjv52d0eassdq8d9h8vvgxqyjw5qcqp99qxpqysgq4rrn702eum6c9ld9khlz39vdyd8zcwrav5ygqvu6w54aep6yarkyfrnk990yf5prpasgzmj52stektf6mzwdl5hc6qlsglt2a0pwp0spwww44w" - ] -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **bolt11** (string): The bolt11 string. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "bolt11": "lnbcrt10n1pjmxt3lsp5jumuz2sv3ca68kzd92hp3wdtpx8ghnxur65fs6maw6dyxsleqd0spp5nadvvh7uzk2qzh8d9d7tsxr08l9uaz2vjeuuahqtufjv52d0eassdq8d9h8vvgxqyjw5qcqp99qxpqysgq3nhrd72qe7wmc2hvwhaqnx05y6dzxh2tal02kw055er7uutkkrcreccm37ce6wv7ee8q70ktlr9fy3fd635hc2k98a4svd9c8v4cpjsppm2eee" -} -``` - -ERRORS ------- - -The following error codes may occur: - -- -1: Catchall nonspecific error. - -AUTHOR ------- - -Carl Dong <> is mainly responsible. - -SEE ALSO --------- - -lightning-createinvoice(7), lightning-invoice(7), lightning-listinvoices(7), lightning-delinvoice(7), lightning-getroute(7), lightning-sendpay(7), lightning-offer(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-signmessage.7.md b/doc/lightning-signmessage.7.md deleted file mode 100644 index af5835083035..000000000000 --- a/doc/lightning-signmessage.7.md +++ /dev/null @@ -1,76 +0,0 @@ -lightning-signmessage -- Command to create a signature from this node -===================================================================== - -SYNOPSIS --------- - -**signmessage** *message* - -DESCRIPTION ------------ - -The **signmessage** RPC command creates a digital signature of *message* using this node's secret key. A receiver who knows your node's *id* and the *message* can be sure that the resulting signature could only be created by something with access to this node's secret key. - -- **message** (string): Less than 65536 characters long message to be signed by the node. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:signmessage#1", - "method": "signmessage", - "params": { - "message": "this is a test!" - } -} -{ - "id": "example:signmessage#2", - "method": "signmessage", - "params": { - "message": "message for you" - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **signature** (hex) (always 128 characters): The signature. -- **recid** (hex) (always 2 characters): The recovery id (0, 1, 2 or 3). -- **zbase** (string): *signature* and *recid* encoded in a style compatible with **lnd**'s [SignMessageRequest](https://api.lightning.community/#grpc-request- signmessagerequest). - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "signature": "a2ec227012795f9d6b80a3f5ea98374c6d2886917517c05336799923fcf37caf08344c0431275e1a8189da01b444ae978007fe70f0cc9009f38cabe074ade87d", - "recid": "00", - "zbase": "d6tqaeuonjhi98mmont9m4wag7gg4krg1f4txonug3h31e9h6p6k6nbwjondnj46dkyausobstnk7fhyy998bhgc1yr98dfmhb4k54d7" -} -{ - "signature": "85843b010bc517b32eaafe70232e2c44bb5a354c74d2202390af1b272e4c6ac23ac3f97ea663d8b49116ad6c2d080515b43bcdf1ea4f38cdb18af0edf8209cd8", - "recid": "00", - "zbase": "d6naeqabbxntxc3qim98ye3qftnmsstijt4prebd1nztsj3qjticrqsd9f9kca6as1etpmmcfwrykfpw8xg9d41x8dg5dnzo7zhnb8ga" -} -``` - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-checkmessage(7) - -RESOURCES ---------- - -Main web site: - -[SignMessageRequest](https://api.lightning.community/#grpc-request-signmessagerequest) diff --git a/doc/lightning-signpsbt.7.md b/doc/lightning-signpsbt.7.md deleted file mode 100644 index e55b4da29973..000000000000 --- a/doc/lightning-signpsbt.7.md +++ /dev/null @@ -1,86 +0,0 @@ -lightning-signpsbt -- Command to sign a wallet's inputs on a provided bitcoin transaction (PSBT). -================================================================================================= - -SYNOPSIS --------- - -**signpsbt** *psbt* [*signonly*] - -DESCRIPTION ------------ - -**signpsbt** is a low-level RPC command which signs a PSBT as defined by BIP-174. - -By default, all known inputs are signed, and others ignored: with *signonly*, only those inputs are signed, and an error is returned if one of them cannot be signed. - -Note that the command will fail if there are no inputs to sign, or if the inputs to be signed were not previously reserved. - -- **psbt** (string): The psbt to be signed. -- **signonly** (array of u32s, optional): Input numbers to sign.: - - (u32, optional) - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:signpsbt#1", - "method": "signpsbt", - "params": { - "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAAAAAAEQBAAAAAAM/AlsaWdodG5pbmcBCCvyYqqdIt0mAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oBDiBWd3IcNaQkoj1tzHyQkDblBa5oZQ4J1ZcztLfnMAOk3AEPBAEAAAABEAT9////DPwJbGlnaHRuaW5nAQg5j4QWOQoUFAABAwhOfA0AAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4M/AlsaWdodG5pbmcBCMbeD+3qn9/kAAEDCODIEAAAAAAAAQQiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQz8CWxpZ2h0bmluZwEI4upB+mjl6AIA", - "signonly": null - } -} -{ - "id": "example:signpsbt#2", - "method": "signpsbt", - "params": { - "psbt": "cHNidP8BAP1xAQIAAAAIFTef27H2GAJBzP4UZMeDePsDVkglO47/q4jqK18ibCYAAAAAAP3///+axwap6WKnEHvLjIJZX0ZeJ87cs7PKkXBfwvbGVmjpTQEAAAAA/f///wQ1cVzb9NR7nXadyRuhQBv+2iqhZkhvUA+sPo5z/SsSAQAAAAD9////lXQ788meUtSxhBX13mx2XhyM3Ddo30QtmNW0YuE2TDABAAAAAP3///8Kr4BwElAScx3bA5ZdavrHwh4Zh+rFNvkE/+7gu1WbngEAAAAA/f///3Uei7j3k/b5tnjFGvNZhe2iWz8O6FQjTEpM5XIoduNsAQAAAAD9////fm5Om4MojcnfZiTmrwb4b5Byw9emrjITi/nkEqTK9MsBAAAAAP3///8lwdpZqt3ILPRwhINY4PGvkg2CSw7agcMPSuFoHDDkIQAAAAAA/f///wGCAXoAAAAAABYAFMkJbUP0COpSYCAmLM2tfIUWuSqBAAAAAAABAHECAAAAAZVxzFxyEg7tiQTgRHwGleR8Srxw6taAGOoEpJK/Xj5sAAAAAAD9////AkBCDwAAAAAAFgAUKvGgVL/ThjWE/P1oORVXh/ObucYzr/YpAQAAABYAFKmkod5S53U4m5tKFApyeC35UbnbZwAAAAEBH0BCDwAAAAAAFgAUKvGgVL/ThjWE/P1oORVXh/ObucYAAQBxAgAAAAEVN5/bsfYYAkHM/hRkx4N4+wNWSCU7jv+riOorXyJsJgEAAAAA/f///wJmbOcpAQAAABYAFCCSJBD9wY/VwxnBcnFiu1tA6CGTQEIPAAAAAAAWABSjI8KCqaGX/BGOwJza8hyiuxuIcmcAAAABAR9AQg8AAAAAABYAFKMjwoKpoZf8EY7AnNryHKK7G4hyAAEAcQIAAAAB98EwKZMOHiyRYWyToae6Kce3gCwqUvnVXXHlB/ps9ocBAAAAAP3///8CmNuLKQEAAAAWABQ4roxw+phYHelaRr71DYB3FEy/30BCDwAAAAAAFgAUwSDtQiY7PVvBc7ww56Y72YIQdjllAAAAAQEfQEIPAAAAAAAWABTBIO1CJjs9W8FzvDDnpjvZghB2OQABAHECAAAAAZH/SvCXvDW7b8qb55CDC4M+jgZ61H/e8rZnAGaXp+Z+AAAAAAD9////Apkp2CkBAAAAFgAUc/Y+sIq3oYyEe40GkKJsXawkzwFAQg8AAAAAABYAFLdt1h5Bte8FKvIc2jJgiIwHC7mvZwAAAAEBH0BCDwAAAAAAFgAUt23WHkG17wUq8hzaMmCIjAcLua8AAQBxAgAAAAETC3wMCv9qK3lvVkVJu9b/v2VgMepZtnfngMp2xMXRnwAAAAAA/f///wJk0E4pAQAAABYAFEIsc4cBl+BTN33Kn80+YYfkMt+cQEIPAAAAAAAWABT2/7RIxKohhGbacpBz0BZNYcnfsGUAAAABAR9AQg8AAAAAABYAFPb/tEjEqiGEZtpykHPQFk1hyd+wAAEAcQIAAAABA8J/OnC+cuH79Z6wZmzwdAjhBDaPHavh3yvhr4odDXQBAAAAAP3///8CykowKQEAAAAWABTVHuO8cKOOX/JlmMU66on6Uc54mkBCDwAAAAAAFgAUunZMZryWMqCTiMuVWNF/cleg6dVnAAAAAQEfQEIPAAAAAAAWABS6dkxmvJYyoJOIy5VY0X9yV6Dp1QABAHECAAAAAfRxBaZZ3FfDGwxhZQLYCurN+7kJj0x6nzChg434dnjRAAAAAAD9////AszmyCkBAAAAFgAULSqRp54barF/7R9XOmsLDCVWdAFAQg8AAAAAABYAFNa5adNt/9rZhpGT9mPuSA39xzSIZQAAAAEBH0BCDwAAAAAAFgAU1rlp023/2tmGkZP2Y+5IDf3HNIgAAQBxAgAAAAEgk1JYyP4oIoPoYYcTPPDvZynVfXWINJnBEFBsLv0MtAAAAAAA/f///wJAQg8AAAAAABYAFGYcI7eQ3TSRNzrwsdi+0Id9XN4iMmGqKQEAAAAWABT5XKNwVIFsUKh26sqHFSlOLq5TFGUAAAABAR9AQg8AAAAAABYAFGYcI7eQ3TSRNzrwsdi+0Id9XN4iAAA=", - "signonly": [ - 7 - ] - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **signed\_psbt** (string): The fully signed PSBT. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "signed_psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAAAAAAEQBAAAAAAM/AlsaWdodG5pbmcBCCvyYqqdIt0mAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oBDiBWd3IcNaQkoj1tzHyQkDblBa5oZQ4J1ZcztLfnMAOk3AEPBAEAAAABEAT9////ARNACI9TcWG+6uC9ElBFN3qhND7amsor/dtBhJ5ujEQAT/80548avrt7d7IJiOAaCNzzYLSXITdL2xjx6mhbBi9hTiEWkUUygSpECk12bHHNORk2lKNArhHgEuW6Gtnvum52ylMJAMLMqxcAAAAADPwJbGlnaHRuaW5nAQg5j4QWOQoUFAABAwhOfA0AAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4hB7nAxoROEqUxyWjlXFUHjsFtm/dr6SkP2H0cynK0g5oXCQDWuWnTBAAAAAz8CWxpZ2h0bmluZwEIxt4P7eqf3+QAAQMI4MgQAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQji6kH6aOXoAgA=" -} -{ - "signed_psbt": "cHNidP8BAP1xAQIAAAAIFTef27H2GAJBzP4UZMeDePsDVkglO47/q4jqK18ibCYAAAAAAP3///+axwap6WKnEHvLjIJZX0ZeJ87cs7PKkXBfwvbGVmjpTQEAAAAA/f///wQ1cVzb9NR7nXadyRuhQBv+2iqhZkhvUA+sPo5z/SsSAQAAAAD9////lXQ788meUtSxhBX13mx2XhyM3Ddo30QtmNW0YuE2TDABAAAAAP3///8Kr4BwElAScx3bA5ZdavrHwh4Zh+rFNvkE/+7gu1WbngEAAAAA/f///3Uei7j3k/b5tnjFGvNZhe2iWz8O6FQjTEpM5XIoduNsAQAAAAD9////fm5Om4MojcnfZiTmrwb4b5Byw9emrjITi/nkEqTK9MsBAAAAAP3///8lwdpZqt3ILPRwhINY4PGvkg2CSw7agcMPSuFoHDDkIQAAAAAA/f///wGCAXoAAAAAABYAFMkJbUP0COpSYCAmLM2tfIUWuSqBAAAAAAABAHECAAAAAZVxzFxyEg7tiQTgRHwGleR8Srxw6taAGOoEpJK/Xj5sAAAAAAD9////AkBCDwAAAAAAFgAUKvGgVL/ThjWE/P1oORVXh/ObucYzr/YpAQAAABYAFKmkod5S53U4m5tKFApyeC35UbnbZwAAAAEBH0BCDwAAAAAAFgAUKvGgVL/ThjWE/P1oORVXh/ObucYAAQBxAgAAAAEVN5/bsfYYAkHM/hRkx4N4+wNWSCU7jv+riOorXyJsJgEAAAAA/f///wJmbOcpAQAAABYAFCCSJBD9wY/VwxnBcnFiu1tA6CGTQEIPAAAAAAAWABSjI8KCqaGX/BGOwJza8hyiuxuIcmcAAAABAR9AQg8AAAAAABYAFKMjwoKpoZf8EY7AnNryHKK7G4hyAAEAcQIAAAAB98EwKZMOHiyRYWyToae6Kce3gCwqUvnVXXHlB/ps9ocBAAAAAP3///8CmNuLKQEAAAAWABQ4roxw+phYHelaRr71DYB3FEy/30BCDwAAAAAAFgAUwSDtQiY7PVvBc7ww56Y72YIQdjllAAAAAQEfQEIPAAAAAAAWABTBIO1CJjs9W8FzvDDnpjvZghB2OQABAHECAAAAAZH/SvCXvDW7b8qb55CDC4M+jgZ61H/e8rZnAGaXp+Z+AAAAAAD9////Apkp2CkBAAAAFgAUc/Y+sIq3oYyEe40GkKJsXawkzwFAQg8AAAAAABYAFLdt1h5Bte8FKvIc2jJgiIwHC7mvZwAAAAEBH0BCDwAAAAAAFgAUt23WHkG17wUq8hzaMmCIjAcLua8AAQBxAgAAAAETC3wMCv9qK3lvVkVJu9b/v2VgMepZtnfngMp2xMXRnwAAAAAA/f///wJk0E4pAQAAABYAFEIsc4cBl+BTN33Kn80+YYfkMt+cQEIPAAAAAAAWABT2/7RIxKohhGbacpBz0BZNYcnfsGUAAAABAR9AQg8AAAAAABYAFPb/tEjEqiGEZtpykHPQFk1hyd+wAAEAcQIAAAABA8J/OnC+cuH79Z6wZmzwdAjhBDaPHavh3yvhr4odDXQBAAAAAP3///8CykowKQEAAAAWABTVHuO8cKOOX/JlmMU66on6Uc54mkBCDwAAAAAAFgAUunZMZryWMqCTiMuVWNF/cleg6dVnAAAAAQEfQEIPAAAAAAAWABS6dkxmvJYyoJOIy5VY0X9yV6Dp1QABAHECAAAAAfRxBaZZ3FfDGwxhZQLYCurN+7kJj0x6nzChg434dnjRAAAAAAD9////AszmyCkBAAAAFgAULSqRp54barF/7R9XOmsLDCVWdAFAQg8AAAAAABYAFNa5adNt/9rZhpGT9mPuSA39xzSIZQAAAAEBH0BCDwAAAAAAFgAU1rlp023/2tmGkZP2Y+5IDf3HNIgAAQBxAgAAAAEgk1JYyP4oIoPoYYcTPPDvZynVfXWINJnBEFBsLv0MtAAAAAAA/f///wJAQg8AAAAAABYAFGYcI7eQ3TSRNzrwsdi+0Id9XN4iMmGqKQEAAAAWABT5XKNwVIFsUKh26sqHFSlOLq5TFGUAAAABAR9AQg8AAAAAABYAFGYcI7eQ3TSRNzrwsdi+0Id9XN4iIgID+pyVCF5CseUAPNH0GBeMMMluSud5VMoPxIxYgm/06w5HMEQCIG90DSr+fGNoWhCrgLbJG3Wt8PJNMWYqaa5MLWRwA0oTAiA9rsLEqqVhjV6wENfzzpudaE949uLlVqWgDjE/FSgKNAEiBgP6nJUIXkKx5QA80fQYF4wwyW5K53lUyg/EjFiCb/TrDghmHCO3AAAAAAAA" -} -``` - -ERRORS ------- - -On failure, one of the following error codes may be returned: - -- -32602: Error in given parameters, or there aren't wallet's inputs to sign, or we couldn't sign all of *signonly*, or inputs are not reserved. - -AUTHOR ------- - -Vincenzo Palazzo <> wrote the initial version of this man page, -but many others did the hard work of actually implementing this rpc command. - -SEE ALSO --------- - -lightning-fundpsbt(7), lightning-sendpsbt(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-splice_init.7.md b/doc/lightning-splice_init.7.md deleted file mode 100644 index 5dc42f00b1c9..000000000000 --- a/doc/lightning-splice_init.7.md +++ /dev/null @@ -1,133 +0,0 @@ -lightning-splice\_init -- Command to initiate a channel to a peer -================================================================= - -SYNOPSIS --------- - -**(WARNING: experimental-splicing only)** - -**splice\_init** *channel\_id* *relative\_amount* [*initialpsbt*] [*feerate\_per\_kw*] [*force\_feerate*] - -DESCRIPTION ------------ - -Command *added* in v23.08. - -`splice_init` is a low level RPC command which initiates a channel splice for a given channel specified by `channel_id`. - -- **channel\_id** (hash): The channel id of the channel to be spliced. -- **relative\_amount** (integer): A positive or negative amount of satoshis to add or subtract from the channel. Note you may need to add a double dash (--) after splice\_init if using a negative *relative\_amount* so it is not interpretted as a command modifier. For example: ```shell lightning-cli splice_init -- $CHANNEL_ID -100000 ```. -- **initialpsbt** (string, optional): The (optional) base 64 encoded PSBT to begin with. If not specified, one will be generated automatically. -- **feerate\_per\_kw** (u32, optional): The miner fee we promise our peer to pay for our side of the splice transaction. It is calculated by `feerate_per_kw` * our\_bytes\_in\_splice\_tx / 1000. -- **force\_feerate** (boolean, optional): By default splices will fail if the fee provided looks too high. This is to protect against accidentally setting your fee higher than intended. Set `force_feerate` to true to skip this saftey check. - -EXAMPLE USAGE -------------- - -Here is an example set of splice commands that will splice in 100,000 sats to the first channel that comes out of `listpeerchannels`. The example assumes you already have at least one confirmed channel. - -```shell -RESULT=$(lightning-cli listpeerchannels) -CHANNEL_ID=$(echo $RESULT| jq -r ".channels[0].channel_id") -echo $RESULT - -RESULT=$(lightning-cli fundpsbt -k satoshi=100000sat feerate=urgent startweight=800 excess_as_change=true) -INITIALPSBT=$(echo $RESULT | jq -r ".psbt") -echo $RESULT - -RESULT=$(lightning-cli splice_init $CHANNEL_ID 100000 $INITIALPSBT) -PSBT=$(echo $RESULT | jq -r ".psbt") -echo $RESULT - -RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT) -PSBT=$(echo $RESULT | jq -r ".psbt") -echo $RESULT - -RESULT=$(lightning-cli signpsbt -k psbt="$PSBT") -PSBT=$(echo $RESULT | jq -r ".signed_psbt") -echo $RESULT - -lightning-cli splice_signed $CHANNEL_ID $PSBT -``` - -Here is an example set of splice commands that will splice out 100,000 sats from first channel that comes out of `listpeerchannels`. The example assumes you already have at least one confirmed channel. - -```shell -RESULT=$(lightning-cli listpeerchannels) -CHANNEL_ID=$(echo $RESULT| jq -r ".channels[0].channel_id") -echo $RESULT - -RESULT=$(lightning-cli addpsbtoutput 100000) -INITIALPSBT=$(echo $RESULT | jq -r ".psbt") -echo $RESULT - -RESULT=$(lightning-cli splice_init -- $CHANNEL_ID -100500 $INITIALPSBT) -PSBT=$(echo $RESULT | jq -r ".psbt") -echo $RESULT - -RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT) -PSBT=$(echo $RESULT | jq -r ".psbt") -echo $RESULT - -lightning-cli splice_signed $CHANNEL_ID $PSBT -``` - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:splice_init#1", - "method": "splice_init", - "params": { - "channel_id": "5677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc", - "relative_amount": 100000, - "initialpsbt": "cHNidP8BAF4CAAAAAVZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQAAAAD9////AU58DQAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5sAAAAAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==", - "feerate_per_kw": null - } -} -{ - "id": "example:splice_init#2", - "method": "splice_init", - "params": { - "channel_id": "a40bb442dab0231b51d8f842d95aad548aa35e1d13c4cfcf2997344f805453a1", - "relative_amount": -105000, - "initialpsbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIoIYBAAAAAAABBCJRIHg2NV/cioLcTLAKdyxVVBUdBjhKTdZejT9orAhWa4S+AA==", - "feerate_per_kw": null - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **psbt** (string): The (incomplete) PSBT of the splice transaction. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEFR1IhAjJCZt6EA7OrFXoJ8feE1YevYYMcmYwVG8whu3TCsjFLIQLjvTgAmGbJ2o7EqpnMTqnGwN1G3xXGHvDOHycSkXFOV1KuAQ4gVndyHDWkJKI9bcx8kJA25QWuaGUOCdWXM7S35zADpNwBDwQAAAAAARAEAAAAAAz8CWxpZ2h0bmluZwEIK/Jiqp0i3SYAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAQAAAAEQBP3///8M/AlsaWdodG5pbmcBCDmPhBY5ChQUAAEDCE58DQAAAAAAAQQiUSB4NjVf3IqC3EywCncsVVQVHQY4Sk3WXo0/aKwIVmuEvgz8CWxpZ2h0bmluZwEIxt4P7eqf3+QAAQMIAAAAAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQji6kH6aOXoAgA=" -} -{ - "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABARzi7RBt64yrfqRL2p+KiUw8cYtiKICRFHmp/4eCSemSAQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgTCjR9L+TfzP7pLJVVto5egTRbRNj/RaBhyrA3UW0aEcCIAJO5FZjXvdpRcGR949C4DnfHs3soklTjn/1upkia+TgASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M9mAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEFR1IhAjJCZt6EA7OrFXoJ8feE1YevYYMcmYwVG8whu3TCsjFLIQLjvTgAmGbJ2o7EqpnMTqnGwN1G3xXGHvDOHycSkXFOV1KuAQ4gpAu0QtqwIxtR2PhC2VqtVIqjXh0TxM/PKZc0T4BUU6EBDwQAAAAAARAEAAAAAAz8CWxpZ2h0bmluZwEIn2Ac8fyFEJwAAQMIAAAAAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQgu7JK9IpBWOAABAwighgEAAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4M/AlsaWdodG5pbmcBCOZ1GpRwbKfuAA==" -} -``` - -AUTHOR ------- - -Dusty <<@dusty\_daemon>> is mainly responsible. - -SEE ALSO --------- - -lightning-splice\_signed(7), lightning-splice\_update(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-splice_signed.7.md b/doc/lightning-splice_signed.7.md deleted file mode 100644 index 7283d6508834..000000000000 --- a/doc/lightning-splice_signed.7.md +++ /dev/null @@ -1,112 +0,0 @@ -lightning-splice\_signed -- Command to initiate a channel to a peer -=================================================================== - -SYNOPSIS --------- - -**(WARNING: experimental-splicing only)** - -**splice\_signed** *channel\_id* *psbt* [*sign\_first*] - -DESCRIPTION ------------ - -Command *added* in v23.08. - -`splice_signed` is a low level RPC command which finishes the active channel splice associated with `channel_id`. - -The *psbt* must have all signatures attached to all inputs that you have added to it or it will fail. - -- **channel\_id** (hash): The channel id of the channel to be spliced. -- **psbt** (string): The final version of the psbt to complete the splice with. -- **sign\_first** (boolean, optional): A flag that makes our node offer the final splice signature first (defaults to false). When false, the node will calculate who should sign first based off who is adding inputting the least sats to the splice as per spec. - -EXAMPLE USAGE -------------- - -In this example we funded the psbt from our lightning node, so we can use the lightning node to sign for its funds. - -```shell -RESULT=$(lightning-cli signpsbt $PSBT) -PSBT=$(echo $RESULT | jq -r ".signed_psbt") -echo $RESULT - -lightning-cli splice_signed $CHANNEL_ID $PSBT -``` - -Here is a full example set of splice commands that will splice in 100,000 sats to the first channel that comes out of `listpeerchannels`. The example assumes you already have at least one confirmed channel. - -```shell -RESULT=$(lightning-cli listpeerchannels) -CHANNEL_ID=$(echo $RESULT| jq -r ".channels[0].channel_id") -echo $RESULT - -RESULT=$(lightning-cli fundpsbt -k satoshi=100000sat feerate=urgent startweight=800 excess_as_change=true) -INITIALPSBT=$(echo $RESULT | jq -r ".psbt") -echo $RESULT - -RESULT=$(lightning-cli splice_init $CHANNEL_ID 100000 $INITIALPSBT) -PSBT=$(echo $RESULT | jq -r ".psbt") -echo $RESULT - -RESULT={"commitments_secured":false} -while [[ $(echo $RESULT | jq -r ".commitments_secured") == "false" ]] -do - RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT) - PSBT=$(echo $RESULT | jq -r ".psbt") - echo $RESULT -done - -RESULT=$(lightning-cli signpsbt -k psbt="$PSBT") -PSBT=$(echo $RESULT | jq -r ".signed_psbt") -echo $RESULT - -lightning-cli splice_signed $CHANNEL_ID $PSBT -``` - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:splice_signed#1", - "method": "splice_signed", - "params": { - "channel_id": "5677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc", - "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAAAAAAEQBAAAAAAM/AlsaWdodG5pbmcBCCvyYqqdIt0mAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oBDiBWd3IcNaQkoj1tzHyQkDblBa5oZQ4J1ZcztLfnMAOk3AEPBAEAAAABEAT9////ARNACI9TcWG+6uC9ElBFN3qhND7amsor/dtBhJ5ujEQAT/80548avrt7d7IJiOAaCNzzYLSXITdL2xjx6mhbBi9hTiEWkUUygSpECk12bHHNORk2lKNArhHgEuW6Gtnvum52ylMJAMLMqxcAAAAADPwJbGlnaHRuaW5nAQg5j4QWOQoUFAABAwhOfA0AAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4hB7nAxoROEqUxyWjlXFUHjsFtm/dr6SkP2H0cynK0g5oXCQDWuWnTBAAAAAz8CWxpZ2h0bmluZwEIxt4P7eqf3+QAAQMI4MgQAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQji6kH6aOXoAgA=" - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **tx** (hex): The hex representation of the final transaction that is published. -- **txid** (txid): The txid is of the final transaction. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "tx": "020000000001025677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc0000000000000000005677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc0100000000fdffffff024e7c0d00000000002251207836355fdc8a82dc4cb00a772c5554151d06384a4dd65e8d3f68ac08566b84bee0c81000000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd0400473044022053269f3951a1fc942174ac0dde8462405a86c89b31b444890664ee9735872cff02204cd822c4456c15e90ad342b23e9bb252d383d4e17a8a04818c4919e4fd61efd80147304402205ac0787c79e74ebfa0eaf18964625c53eb672cc4bed2c65303bd9cc192dad6f902206c6c0cded47201dae0020f50a8998555e654d3420c64e801fc668238e3c1cdfa0147522102324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b2102e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5752ae0140088f537161beeae0bd125045377aa1343eda9aca2bfddb41849e6e8c44004fff34e78f1abebb7b77b20988e01a08dcf360b49721374bdb18f1ea685b062f614e6c000000", - "txid": "f00d5e230b401274c88d3e6205e2c6117028cb9878b7d2bc52b1441f0b589427" -} -``` - -AUTHOR ------- - -Dusty <<@dusty\_daemon>> is mainly responsible. - -SEE ALSO --------- - -lightning-splice\_init(7), lightning-splice\_update(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-splice_update.7.md b/doc/lightning-splice_update.7.md deleted file mode 100644 index aabc8fdc17c3..000000000000 --- a/doc/lightning-splice_update.7.md +++ /dev/null @@ -1,121 +0,0 @@ -lightning-splice\_update -- Command to initiate a channel to a peer -=================================================================== - -SYNOPSIS --------- - -**(WARNING: experimental-splicing only)** - -**splice\_update** *channel\_id* *psbt* - -DESCRIPTION ------------ - -Command *added* in v23.08. - -`splice_update` is a low level RPC command which updates the active channel splice associated with `channel_id`. - -`splice_update` must be called repeatidly until the result `commitments_secured` is `true`. Each time `splice_update` is called, it will return a new PSBT that may have changes. In the simplest case, you take the returned `psbt` and pass it back into `splice_update` for the incoming `psbt` field. - -For more complex use cases, you may modify the `psbt` both before calling `splice_update` and inbetween subsequent calls until `commitments_secured` is `true`. After which point you can no long make modifications to the PSBT (beyond signing, which comes later with `splice_signed`). - -Each `splice_update` result may include changes to the PSBT specified by your channel peer. You can review these changes between calls to `splice_update` to perform additional validation or strategy adjustment. - -Typically, `splice_update` will return `commitments_secured` true after one call but you should assume it will need multiple calls. - -- **channel\_id** (hash): The channel id of the channel to be spliced. -- **psbt** (string): The base 64 encoded PSBT returned from `splice_init` with any changes added by the user. - -EXAMPLE USAGE -------------- - -Here is an example way to call `splice_update` - -```shell -RESULT={"commitments_secured":false} -while [[ $(echo $RESULT | jq -r ".commitments_secured") == "false" ]] -do - RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT) - PSBT=$(echo $RESULT | jq -r ".psbt") - echo $RESULT -done -``` - -Before each call to `splice_update` you have the opportunity to make additional changes. - -Here is a full example set of splice commands that will splice in 100,000 sats to the first channel that comes out of `listpeerchannels`. The example assumes you already have at least one confirmed channel. - -```shell -RESULT=$(lightning-cli listpeerchannels) -CHANNEL_ID=$(echo $RESULT| jq -r ".channels[0].channel_id") -echo $RESULT - -RESULT=$(lightning-cli fundpsbt -k satoshi=100000sat feerate=urgent startweight=800 excess_as_change=true) -INITIALPSBT=$(echo $RESULT | jq -r ".psbt") -echo $RESULT - -RESULT=$(lightning-cli splice_init $CHANNEL_ID 100000 $INITIALPSBT) -PSBT=$(echo $RESULT | jq -r ".psbt") -echo $RESULT - -RESULT={"commitments_secured":false} -while [[ $(echo $RESULT | jq -r ".commitments_secured") == "false" ]] -do - RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT) - PSBT=$(echo $RESULT | jq -r ".psbt") - echo $RESULT -done - -RESULT=$(lightning-cli signpsbt -k psbt="$PSBT") -PSBT=$(echo $RESULT | jq -r ".signed_psbt") -echo $RESULT - -lightning-cli splice_signed $CHANNEL_ID $PSBT -``` - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:splice_update#1", - "method": "splice_update", - "params": { - "channel_id": "5677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc", - "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEFR1IhAjJCZt6EA7OrFXoJ8feE1YevYYMcmYwVG8whu3TCsjFLIQLjvTgAmGbJ2o7EqpnMTqnGwN1G3xXGHvDOHycSkXFOV1KuAQ4gVndyHDWkJKI9bcx8kJA25QWuaGUOCdWXM7S35zADpNwBDwQAAAAAARAEAAAAAAz8CWxpZ2h0bmluZwEIK/Jiqp0i3SYAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAQAAAAEQBP3///8M/AlsaWdodG5pbmcBCDmPhBY5ChQUAAEDCE58DQAAAAAAAQQiUSB4NjVf3IqC3EywCncsVVQVHQY4Sk3WXo0/aKwIVmuEvgz8CWxpZ2h0bmluZwEIxt4P7eqf3+QAAQMIAAAAAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQji6kH6aOXoAgA=" - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **psbt** (string): The (incomplete) PSBT of the splice transaction. -- **commitments\_secured** (boolean): Whether or not the commitments were secured. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAAAAAAEQBAAAAAAM/AlsaWdodG5pbmcBCCvyYqqdIt0mAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oBDiBWd3IcNaQkoj1tzHyQkDblBa5oZQ4J1ZcztLfnMAOk3AEPBAEAAAABEAT9////DPwJbGlnaHRuaW5nAQg5j4QWOQoUFAABAwhOfA0AAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4M/AlsaWdodG5pbmcBCMbeD+3qn9/kAAEDCODIEAAAAAAAAQQiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQz8CWxpZ2h0bmluZwEI4upB+mjl6AIA", - "commitments_secured": true -} -``` - -AUTHOR ------- - -Dusty <<@dusty\_daemon>> is mainly responsible. - -SEE ALSO --------- - -lightning-splice\_init(7), lightning-splice\_signed(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-sql.7.md b/doc/lightning-sql.7.md deleted file mode 100644 index 4bb1d2f12d29..000000000000 --- a/doc/lightning-sql.7.md +++ /dev/null @@ -1,591 +0,0 @@ -lightning-sql -- Command to do complex queries on list commands -=============================================================== - -SYNOPSIS --------- - -**sql** *query* - -DESCRIPTION ------------ - -Command *added* in v23.02. - -The **sql** RPC command runs the given query across a sqlite3 database created from various list commands. - -When tables are accessed, it calls the below commands, so it's no faster than any other local access (though it goes to great length to cache `listnodes` and `listchannels`) which then processes the results. - -It is, however faster for remote access if the result of the query is much smaller than the list commands would be. - -- **query** (string): The standard sqlite3 query to run. - Note that queries like "SELECT *" are fragile, as columns will change across releases; see lightning-listsqlschemas(7). - -PERMITTED SQLITE3 FUNCTIONS ---------------------------- - -Writing to the database is not permitted, and limits are placed on various other query parameters. - -Additionally, only the following functions are allowed: - -* abs -* avg -* coalesce -* count -* hex -* quote -* length -* like -* lower -* upper -* min -* max -* sum -* total - -TREATMENT OF TYPES ------------------- - -The following types are supported in schemas, and this shows how they are presented in the database. This matters: a JSON boolean is represented as an integer in the database, so a query will return 0 or 1, not true or false. - -* *hex*. A hex string. - * JSON: a string - * sqlite3: BLOB - -* *hash*/*secret*/*pubkey*/*txid*: just like *hex*. - -* *msat*/*integer*/*u64*/*u32*/*u16*/*u8*. Normal numbers. - * JSON: an unsigned integer - * sqlite3: INTEGER - -* *boolean*. True or false. - * JSON: literal **true** or **false** - * sqlite3: INTEGER - -* *number*. A floating point number (used for times in some places). - * JSON: number - * sqlite3: REAL - -* *string*. Text. - * JSON: string - * sqlite3: TEXT - -* *short\_channel\_id*. A short-channel-id of form 1x2x3. - * JSON: string - * sqlite3: TEXT - -TABLES ------- - -Note that the first column of every table is a unique integer called `rowid`: this is used for related tables to refer to specific rows in their parent. sqlite3 usually has this as an implicit column, but we make it explicit as the implicit version is not allowed to be used as a foreign key. - -The following tables are currently supported: -- `bkpr_accountevents` (see lightning-bkpr-listaccountevents(7)) - - `account` (type `string`, sqltype `TEXT`) - - `type` (type `string`, sqltype `TEXT`) - - `tag` (type `string`, sqltype `TEXT`) - - `credit_msat` (type `msat`, sqltype `INTEGER`) - - `debit_msat` (type `msat`, sqltype `INTEGER`) - - `currency` (type `string`, sqltype `TEXT`) - - `timestamp` (type `u32`, sqltype `INTEGER`) - - `outpoint` (type `string`, sqltype `TEXT`) - - `blockheight` (type `u32`, sqltype `INTEGER`) - - `origin` (type `string`, sqltype `TEXT`) - - `payment_id` (type `hex`, sqltype `BLOB`) - - `txid` (type `txid`, sqltype `BLOB`) - - `description` (type `string`, sqltype `TEXT`) - - `fees_msat` (type `msat`, sqltype `INTEGER`) - - `is_rebalance` (type `boolean`, sqltype `INTEGER`) - - `part_id` (type `u32`, sqltype `INTEGER`) - -- `bkpr_income` (see lightning-bkpr-listincome(7)) - - `account` (type `string`, sqltype `TEXT`) - - `tag` (type `string`, sqltype `TEXT`) - - `credit_msat` (type `msat`, sqltype `INTEGER`) - - `debit_msat` (type `msat`, sqltype `INTEGER`) - - `currency` (type `string`, sqltype `TEXT`) - - `timestamp` (type `u32`, sqltype `INTEGER`) - - `description` (type `string`, sqltype `TEXT`) - - `outpoint` (type `string`, sqltype `TEXT`) - - `txid` (type `txid`, sqltype `BLOB`) - - `payment_id` (type `hex`, sqltype `BLOB`) - -- `channels` indexed by `short_channel_id` (see lightning-listchannels(7)) - - `source` (type `pubkey`, sqltype `BLOB`) - - `destination` (type `pubkey`, sqltype `BLOB`) - - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`) - - `direction` (type `u32`, sqltype `INTEGER`) - - `public` (type `boolean`, sqltype `INTEGER`) - - `amount_msat` (type `msat`, sqltype `INTEGER`) - - `message_flags` (type `u8`, sqltype `INTEGER`) - - `channel_flags` (type `u8`, sqltype `INTEGER`) - - `active` (type `boolean`, sqltype `INTEGER`) - - `last_update` (type `u32`, sqltype `INTEGER`) - - `base_fee_millisatoshi` (type `u32`, sqltype `INTEGER`) - - `fee_per_millionth` (type `u32`, sqltype `INTEGER`) - - `delay` (type `u32`, sqltype `INTEGER`) - - `htlc_minimum_msat` (type `msat`, sqltype `INTEGER`) - - `htlc_maximum_msat` (type `msat`, sqltype `INTEGER`) - - `features` (type `hex`, sqltype `BLOB`) - -- `closedchannels` (see lightning-listclosedchannels(7)) - - `peer_id` (type `pubkey`, sqltype `BLOB`) - - `channel_id` (type `hash`, sqltype `BLOB`) - - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`) - - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`) - - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`) - - `opener` (type `string`, sqltype `TEXT`) - - `closer` (type `string`, sqltype `TEXT`) - - `private` (type `boolean`, sqltype `INTEGER`) - - related table `closedchannels_channel_type_bits`, from JSON object `channel_type` - - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `bits` (type `u32`, sqltype `INTEGER`) - - related table `closedchannels_channel_type_names`, from JSON object `channel_type` - - `row` (reference to `closedchannels_channel_type.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `names` (type `string`, sqltype `TEXT`) - - `total_local_commitments` (type `u64`, sqltype `INTEGER`) - - `total_remote_commitments` (type `u64`, sqltype `INTEGER`) - - `total_htlcs_sent` (type `u64`, sqltype `INTEGER`) - - `funding_txid` (type `txid`, sqltype `BLOB`) - - `funding_outnum` (type `u32`, sqltype `INTEGER`) - - `leased` (type `boolean`, sqltype `INTEGER`) - - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`) - - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`) - - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`) - - `total_msat` (type `msat`, sqltype `INTEGER`) - - `final_to_us_msat` (type `msat`, sqltype `INTEGER`) - - `min_to_us_msat` (type `msat`, sqltype `INTEGER`) - - `max_to_us_msat` (type `msat`, sqltype `INTEGER`) - - `last_commitment_txid` (type `hash`, sqltype `BLOB`) - - `last_commitment_fee_msat` (type `msat`, sqltype `INTEGER`) - - `close_cause` (type `string`, sqltype `TEXT`) - - `last_stable_connection` (type `u64`, sqltype `INTEGER`) - -- `forwards` indexed by `in_channel and in_htlc_id` (see lightning-listforwards(7)) - - `created_index` (type `u64`, sqltype `INTEGER`) - - `in_channel` (type `short_channel_id`, sqltype `TEXT`) - - `in_htlc_id` (type `u64`, sqltype `INTEGER`) - - `in_msat` (type `msat`, sqltype `INTEGER`) - - `status` (type `string`, sqltype `TEXT`) - - `received_time` (type `number`, sqltype `REAL`) - - `out_channel` (type `short_channel_id`, sqltype `TEXT`) - - `out_htlc_id` (type `u64`, sqltype `INTEGER`) - - `updated_index` (type `u64`, sqltype `INTEGER`) - - `style` (type `string`, sqltype `TEXT`) - - `fee_msat` (type `msat`, sqltype `INTEGER`) - - `out_msat` (type `msat`, sqltype `INTEGER`) - - `resolved_time` (type `number`, sqltype `REAL`) - - `failcode` (type `u32`, sqltype `INTEGER`) - - `failreason` (type `string`, sqltype `TEXT`) - -- `htlcs` indexed by `short_channel_id and id` (see lightning-listhtlcs(7)) - - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`) - - `id` (type `u64`, sqltype `INTEGER`) - - `expiry` (type `u32`, sqltype `INTEGER`) - - `amount_msat` (type `msat`, sqltype `INTEGER`) - - `direction` (type `string`, sqltype `TEXT`) - - `payment_hash` (type `hash`, sqltype `BLOB`) - - `state` (type `string`, sqltype `TEXT`) - -- `invoices` indexed by `payment_hash` (see lightning-listinvoices(7)) - - `label` (type `string`, sqltype `TEXT`) - - `description` (type `string`, sqltype `TEXT`) - - `payment_hash` (type `hash`, sqltype `BLOB`) - - `status` (type `string`, sqltype `TEXT`) - - `expires_at` (type `u64`, sqltype `INTEGER`) - - `amount_msat` (type `msat`, sqltype `INTEGER`) - - `bolt11` (type `string`, sqltype `TEXT`) - - `bolt12` (type `string`, sqltype `TEXT`) - - `local_offer_id` (type `hash`, sqltype `BLOB`) - - `invreq_payer_note` (type `string`, sqltype `TEXT`) - - `created_index` (type `u64`, sqltype `INTEGER`) - - `updated_index` (type `u64`, sqltype `INTEGER`) - - `pay_index` (type `u64`, sqltype `INTEGER`) - - `amount_received_msat` (type `msat`, sqltype `INTEGER`) - - `paid_at` (type `u64`, sqltype `INTEGER`) - - `paid_outpoint_txid` (type `txid`, sqltype `BLOB`, from JSON object `paid_outpoint`) - - `paid_outpoint_outnum` (type `u32`, sqltype `INTEGER`, from JSON object `paid_outpoint`) - - `payment_preimage` (type `secret`, sqltype `BLOB`) - -- `nodes` indexed by `nodeid` (see lightning-listnodes(7)) - - `nodeid` (type `pubkey`, sqltype `BLOB`) - - `last_timestamp` (type `u32`, sqltype `INTEGER`) - - `alias` (type `string`, sqltype `TEXT`) - - `color` (type `hex`, sqltype `BLOB`) - - `features` (type `hex`, sqltype `BLOB`) - - related table `nodes_addresses` - - `row` (reference to `nodes.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `type` (type `string`, sqltype `TEXT`) - - `port` (type `u16`, sqltype `INTEGER`) - - `address` (type `string`, sqltype `TEXT`) - - `option_will_fund_lease_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`) - - `option_will_fund_lease_fee_basis` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`) - - `option_will_fund_funding_weight` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`) - - `option_will_fund_channel_fee_max_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `option_will_fund`) - - `option_will_fund_channel_fee_max_proportional_thousandths` (type `u32`, sqltype `INTEGER`, from JSON object `option_will_fund`) - - `option_will_fund_compact_lease` (type `hex`, sqltype `BLOB`, from JSON object `option_will_fund`) - -- `offers` indexed by `offer_id` (see lightning-listoffers(7)) - - `offer_id` (type `hash`, sqltype `BLOB`) - - `active` (type `boolean`, sqltype `INTEGER`) - - `single_use` (type `boolean`, sqltype `INTEGER`) - - `bolt12` (type `string`, sqltype `TEXT`) - - `used` (type `boolean`, sqltype `INTEGER`) - - `label` (type `string`, sqltype `TEXT`) - -- `peerchannels` indexed by `peer_id` (see lightning-listpeerchannels(7)) - - `peer_id` (type `pubkey`, sqltype `BLOB`) - - `peer_connected` (type `boolean`, sqltype `INTEGER`) - - `reestablished` (type `boolean`, sqltype `INTEGER`) - - `state` (type `string`, sqltype `TEXT`) - - `scratch_txid` (type `txid`, sqltype `BLOB`) - - related table `peerchannels_channel_type_bits`, from JSON object `channel_type` - - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `bits` (type `u32`, sqltype `INTEGER`) - - related table `peerchannels_channel_type_names`, from JSON object `channel_type` - - `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `names` (type `string`, sqltype `TEXT`) - - `local_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`) - - `local_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`) - - `local_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `local`) - - `local_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `local`) - - `local_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `local`) - - `remote_htlc_minimum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`) - - `remote_htlc_maximum_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`) - - `remote_cltv_expiry_delta` (type `u32`, sqltype `INTEGER`, from JSON object `remote`) - - `remote_fee_base_msat` (type `msat`, sqltype `INTEGER`, from JSON object `remote`) - - `remote_fee_proportional_millionths` (type `u32`, sqltype `INTEGER`, from JSON object `remote`) - - `ignore_fee_limits` (type `boolean`, sqltype `INTEGER`) - - `lost_state` (type `boolean`, sqltype `INTEGER`) - - `feerate_perkw` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`) - - `feerate_perkb` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`) - - `owner` (type `string`, sqltype `TEXT`) - - `short_channel_id` (type `short_channel_id`, sqltype `TEXT`) - - `channel_id` (type `hash`, sqltype `BLOB`) - - `funding_txid` (type `txid`, sqltype `BLOB`) - - `funding_outnum` (type `u32`, sqltype `INTEGER`) - - `initial_feerate` (type `string`, sqltype `TEXT`) - - `last_feerate` (type `string`, sqltype `TEXT`) - - `next_feerate` (type `string`, sqltype `TEXT`) - - `next_fee_step` (type `u32`, sqltype `INTEGER`) - - related table `peerchannels_inflight` - - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `funding_txid` (type `txid`, sqltype `BLOB`) - - `funding_outnum` (type `u32`, sqltype `INTEGER`) - - `feerate` (type `string`, sqltype `TEXT`) - - `total_funding_msat` (type `msat`, sqltype `INTEGER`) - - `splice_amount` (type `integer`, sqltype `INTEGER`) - - `our_funding_msat` (type `msat`, sqltype `INTEGER`) - - `scratch_txid` (type `txid`, sqltype `BLOB`) - - `close_to` (type `hex`, sqltype `BLOB`) - - `private` (type `boolean`, sqltype `INTEGER`) - - `opener` (type `string`, sqltype `TEXT`) - - `closer` (type `string`, sqltype `TEXT`) - - related table `peerchannels_features` - - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `features` (type `string`, sqltype `TEXT`) - - `funding_pushed_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`) - - `funding_local_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`) - - `funding_remote_funds_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`) - - `funding_fee_paid_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`) - - `funding_fee_rcvd_msat` (type `msat`, sqltype `INTEGER`, from JSON object `funding`) - - `to_us_msat` (type `msat`, sqltype `INTEGER`) - - `min_to_us_msat` (type `msat`, sqltype `INTEGER`) - - `max_to_us_msat` (type `msat`, sqltype `INTEGER`) - - `total_msat` (type `msat`, sqltype `INTEGER`) - - `fee_base_msat` (type `msat`, sqltype `INTEGER`) - - `fee_proportional_millionths` (type `u32`, sqltype `INTEGER`) - - `dust_limit_msat` (type `msat`, sqltype `INTEGER`) - - `max_total_htlc_in_msat` (type `msat`, sqltype `INTEGER`) - - `their_reserve_msat` (type `msat`, sqltype `INTEGER`) - - `our_reserve_msat` (type `msat`, sqltype `INTEGER`) - - `spendable_msat` (type `msat`, sqltype `INTEGER`) - - `receivable_msat` (type `msat`, sqltype `INTEGER`) - - `minimum_htlc_in_msat` (type `msat`, sqltype `INTEGER`) - - `minimum_htlc_out_msat` (type `msat`, sqltype `INTEGER`) - - `maximum_htlc_out_msat` (type `msat`, sqltype `INTEGER`) - - `their_to_self_delay` (type `u32`, sqltype `INTEGER`) - - `our_to_self_delay` (type `u32`, sqltype `INTEGER`) - - `max_accepted_htlcs` (type `u32`, sqltype `INTEGER`) - - `alias_local` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`) - - `alias_remote` (type `short_channel_id`, sqltype `TEXT`, from JSON object `alias`) - - related table `peerchannels_state_changes` - - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `timestamp` (type `string`, sqltype `TEXT`) - - `old_state` (type `string`, sqltype `TEXT`) - - `new_state` (type `string`, sqltype `TEXT`) - - `cause` (type `string`, sqltype `TEXT`) - - `message` (type `string`, sqltype `TEXT`) - - related table `peerchannels_status` - - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `status` (type `string`, sqltype `TEXT`) - - `in_payments_offered` (type `u64`, sqltype `INTEGER`) - - `in_offered_msat` (type `msat`, sqltype `INTEGER`) - - `in_payments_fulfilled` (type `u64`, sqltype `INTEGER`) - - `in_fulfilled_msat` (type `msat`, sqltype `INTEGER`) - - `out_payments_offered` (type `u64`, sqltype `INTEGER`) - - `out_offered_msat` (type `msat`, sqltype `INTEGER`) - - `out_payments_fulfilled` (type `u64`, sqltype `INTEGER`) - - `out_fulfilled_msat` (type `msat`, sqltype `INTEGER`) - - `last_stable_connection` (type `u64`, sqltype `INTEGER`) - - related table `peerchannels_htlcs` - - `row` (reference to `peerchannels.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `direction` (type `string`, sqltype `TEXT`) - - `id` (type `u64`, sqltype `INTEGER`) - - `amount_msat` (type `msat`, sqltype `INTEGER`) - - `expiry` (type `u32`, sqltype `INTEGER`) - - `payment_hash` (type `hash`, sqltype `BLOB`) - - `local_trimmed` (type `boolean`, sqltype `INTEGER`) - - `status` (type `string`, sqltype `TEXT`) - - `state` (type `string`, sqltype `TEXT`) - - `close_to_addr` (type `string`, sqltype `TEXT`) - - `last_tx_fee_msat` (type `msat`, sqltype `INTEGER`) - - `direction` (type `u32`, sqltype `INTEGER`) - -- `peers` indexed by `id` (see lightning-listpeers(7)) - - `id` (type `pubkey`, sqltype `BLOB`) - - `connected` (type `boolean`, sqltype `INTEGER`) - - `num_channels` (type `u32`, sqltype `INTEGER`) - - related table `peers_netaddr` - - `row` (reference to `peers.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `netaddr` (type `string`, sqltype `TEXT`) - - `remote_addr` (type `string`, sqltype `TEXT`) - - `features` (type `hex`, sqltype `BLOB`) - -- `sendpays` indexed by `payment_hash` (see lightning-listsendpays(7)) - - `created_index` (type `u64`, sqltype `INTEGER`) - - `id` (type `u64`, sqltype `INTEGER`) - - `groupid` (type `u64`, sqltype `INTEGER`) - - `partid` (type `u64`, sqltype `INTEGER`) - - `payment_hash` (type `hash`, sqltype `BLOB`) - - `updated_index` (type `u64`, sqltype `INTEGER`) - - `status` (type `string`, sqltype `TEXT`) - - `amount_msat` (type `msat`, sqltype `INTEGER`) - - `destination` (type `pubkey`, sqltype `BLOB`) - - `created_at` (type `u64`, sqltype `INTEGER`) - - `amount_sent_msat` (type `msat`, sqltype `INTEGER`) - - `label` (type `string`, sqltype `TEXT`) - - `bolt11` (type `string`, sqltype `TEXT`) - - `description` (type `string`, sqltype `TEXT`) - - `bolt12` (type `string`, sqltype `TEXT`) - - `completed_at` (type `u64`, sqltype `INTEGER`) - - `payment_preimage` (type `secret`, sqltype `BLOB`) - - `erroronion` (type `hex`, sqltype `BLOB`) - -- `transactions` indexed by `hash` (see lightning-listtransactions(7)) - - `hash` (type `txid`, sqltype `BLOB`) - - `rawtx` (type `hex`, sqltype `BLOB`) - - `blockheight` (type `u32`, sqltype `INTEGER`) - - `txindex` (type `u32`, sqltype `INTEGER`) - - `locktime` (type `u32`, sqltype `INTEGER`) - - `version` (type `u32`, sqltype `INTEGER`) - - related table `transactions_inputs` - - `row` (reference to `transactions.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `txid` (type `txid`, sqltype `BLOB`) - - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`) - - `sequence` (type `u32`, sqltype `INTEGER`) - - related table `transactions_outputs` - - `row` (reference to `transactions.rowid`, sqltype `INTEGER`) - - `arrindex` (index within array, sqltype `INTEGER`) - - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`) - - `amount_msat` (type `msat`, sqltype `INTEGER`) - - `scriptPubKey` (type `hex`, sqltype `BLOB`) - -EXAMPLE USAGE -------------- - -Here are some example using lightning-cli. Note that you may need to use `-o` if you use queries which contain `=` (which make lightning-cli(1) default to keyword style): - -A simple peer selection query: - -```shell -$ lightning-cli sql "SELECT id FROM peers" -{ - "rows": [ - [ - "02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00" - ] - ] -} -``` - -A statement containing using `=` needs `-o`: - -```shell -$ lightning-cli sql -o "SELECT node_id,last_timestamp FROM nodes WHERE last_timestamp>=1669578892" -{ - "rows": [ - [ - "02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00", - 1669601603 - ] - ] -} -``` - -If you want to compare a BLOB column, `x'hex'` or `X'hex'` are needed: - -```shell -$ lightning-cli sql -o "SELECT nodeid FROM nodes WHERE nodeid != x'03c9d25b6c0ce4bde5ad97d7ab83f00ae8bd3800a98ccbee36f3c3205315147de1';" -{ - "rows": [ - [ - "0214739d625944f8fdc0da9d2ef44dbd7af58443685e494117b51410c5c3ff973a" - ], - [ - "02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00" - ] - ] -} -$ lightning-cli sql -o "SELECT nodeid FROM nodes WHERE nodeid IN (x'03c9d25b6c0ce4bde5ad97d7ab83f00ae8bd3800a98ccbee36f3c3205315147de1', x'02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00')" -{ - "rows": [ - [ - "02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00" - ], - [ - "03c9d25b6c0ce4bde5ad97d7ab83f00ae8bd3800a98ccbee36f3c3205315147de1" - ] - ] -} -``` - -Related tables are usually referenced by JOIN: - -```shell -$ lightning-cli sql -o "SELECT nodeid, alias, nodes_addresses.type, nodes_addresses.port, nodes_addresses.address FROM nodes INNER JOIN nodes_addresses ON nodes_addresses.row = nodes.rowid" -{ - "rows": [ - [ - "02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00", - "YELLOWWATCH-22.11rc2-31-gcd7593b", - "dns", - 7272, - "localhost" - ], - [ - "0214739d625944f8fdc0da9d2ef44dbd7af58443685e494117b51410c5c3ff973a", - "HOPPINGSQUIRREL-1rc2-31-gcd7593b", - "dns", - 7171, - "localhost" - ] - ] -} -``` - -Simple function usage, in this case COUNT. Strings inside arrays need ", and ' to protect them from the shell: - -```shell -$ lightning-cli sql 'SELECT COUNT(*) FROM nodes" -{ - "rows": [ - [ - 3 - ] - ] -} -``` - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:sql#1", - "method": "sql", - "params": [ - "SELECT * FROM forwards;" - ] -} -{ - "id": "example:sql#2", - "method": "sql", - "params": [ - "SELECT * from peerchannels_features" - ] -} -``` - -RETURN VALUE ------------- - -On success, an object containing **rows** is returned. It is an array. Each array entry contains an array of values, each an integer, real number, string or *null*, depending on the sqlite3 type. - -The object may contain **warning\_db\_failure** if the database fails partway through its operation. -On success, an object is returned, containing: - -- **rows** (array of arrays): - - (array) - -The following warnings may also be returned: - -- **warning\_db\_failure**: A message if the database encounters an error partway through. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "rows": [] -} -{ - "rows": [ - [ - 6, - 1, - 0, - "option_static_remotekey" - ], - [ - 7, - 1, - 1, - "option_anchors_zero_fee_htlc_tx" - ], - [ - 16, - 11, - 0, - "option_static_remotekey" - ], - [ - 17, - 11, - 1, - "option_anchors_zero_fee_htlc_tx" - ] - ] -} -``` - -ERRORS ------- - -On failure, an error is returned. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-listtransactions(7), lightning-listchannels(7), lightning-listpeers(7), lightning-listnodes(7), lightning-listforwards(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-staticbackup.7.md b/doc/lightning-staticbackup.7.md deleted file mode 100644 index a390f4364f35..000000000000 --- a/doc/lightning-staticbackup.7.md +++ /dev/null @@ -1,57 +0,0 @@ -lightning-staticbackup -- Command for deriving getting SCB of all the existing channels -======================================================================================= - -SYNOPSIS --------- - -**staticbackup** - -DESCRIPTION ------------ - -The **staticbackup** RPC command returns an object with SCB of all the channels in an array. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:staticbackup#1", - "method": "staticbackup", - "params": "{}" -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **scb** (array of hexs): - - (hex, optional): SCB of a channel in TLV format. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "scb": [ - "0000000000000001c707da9b230e1655b0a6c082b8daf4fa44d9d1f68163ed4d531d45cf453dc651022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d5900017f000001b2e3c707da9b230e1655b0a6c082b8daf4fa44d9d1f68163ed4d531d45cf453dc6510000000000000000000186a000021000" - ] -} -``` - -AUTHOR ------- - -Aditya <> is mainly responsible. - -SEE ALSO --------- - -lightning-getsharedsecret(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-stop.7.md b/doc/lightning-stop.7.md deleted file mode 100644 index 1ef9ba31e9fd..000000000000 --- a/doc/lightning-stop.7.md +++ /dev/null @@ -1,50 +0,0 @@ -lightning-stop -- Command to shutdown the Core Lightning node. -============================================================== - -SYNOPSIS --------- - -**stop** - -DESCRIPTION ------------ - -The **stop** is a RPC command to shut off the Core Lightning node. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:stop#1", - "method": "stop", - "params": {} -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **result** (string) (always "Shutdown complete") *(added v24.05)* - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "result": "Shutdown complete" -} -``` - -AUTHOR ------- - -Vincenzo Palazzo <> wrote the initial version of this man page, -but many others did the hard work of actually implementing this rpc command. - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-txdiscard.7.md b/doc/lightning-txdiscard.7.md deleted file mode 100644 index 2e71b65a2b70..000000000000 --- a/doc/lightning-txdiscard.7.md +++ /dev/null @@ -1,69 +0,0 @@ -lightning-txdiscard -- Abandon a transaction from txprepare, release inputs -=========================================================================== - -SYNOPSIS --------- - -**txdiscard** *txid* - -DESCRIPTION ------------ - -The **txdiscard** RPC command releases inputs which were reserved for use of the *txid* from lightning-txprepare(7). - -- **txid** (txid): The transaction id, inputs should be unreseverd from. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:txdiscard#1", - "method": "txdiscard", - "params": { - "txid": "6e680cb76077f11c838cc7aee0c0aa360f9857f00856bb1614025a1af53739fc" - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **unsigned\_tx** (hex): The unsigned transaction. -- **txid** (txid): The transaction id of *unsigned\_tx*. - -If there is no matching *txid*, an error is reported. Note that this may happen due to incorrect usage, such as **txdiscard** or **txsend** already being called for *txid*. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "unsigned_tx": "020000000142dc00d81359c3a551e170e3bf5262fa9cacc2eb2e283a10e579491cd86dce4b0000000000fdffffff02ffffff00000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd42839800000000002251207836355fdc8a82dc4cb00a772c5554151d06384a4dd65e8d3f68ac08566b84be66000000", - "txid": "6e680cb76077f11c838cc7aee0c0aa360f9857f00856bb1614025a1af53739fc" -} -``` - -ERRORS ------- - -The following error codes may occur: - -- -1: An unknown *txid*. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-txprepare(7), lightning-txsend(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-txprepare.7.md b/doc/lightning-txprepare.7.md deleted file mode 100644 index 01f6ed2c5c15..000000000000 --- a/doc/lightning-txprepare.7.md +++ /dev/null @@ -1,104 +0,0 @@ -lightning-txprepare -- Command to prepare to withdraw funds from the internal wallet -==================================================================================== - -SYNOPSIS --------- - -**txprepare** *outputs* [*feerate*] [*minconf*] [*utxos*] - -DESCRIPTION ------------ - -The **txprepare** RPC command creates an unsigned transaction which spends funds from Core Lightning's internal wallet to the outputs specified in *outputs*. - -**txprepare** is similar to the first part of a **withdraw** command, but supports multiple outputs and uses *outputs* as parameter. The second part is provided by **txsend**. - -- **outputs** (array of outputdescs): Format is like: [{destination1: amount1}, {destination2: amount2}] or [{destination: *all*}]. It supports any number of **confirmed** outputs.: - - (outputdesc, optional) -- **feerate** (feerate, optional): Used for the transaction as initial feerate. The default is *normal*. -- **minconf** (u32, optional): The minimum number of confirmations that used outputs should have. The default is 1. -- **utxos** (array of outpoints, optional): To be used to fund the transaction, as an array of `txid:vout`. These must be drawn from the node's available UTXO set.: - - (outpoint, optional) - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:txprepare#1", - "method": "txprepare", - "params": { - "outputs": [ - { - "bcrt1qtwxd8wg5eanumk86vfeujvp48hfkgannf77evggzct048wggsrxsum2pmm": 16777215 - } - ], - "feerate": null, - "minconf": null, - "utxos": null - } -} -{ - "id": "example:txprepare#2", - "method": "txprepare", - "params": { - "outputs": [ - { - "bcrt1qyhu7rxj3rrlcj84jtzp2mk9d89xm9v2rx4d4h8au830axugx6mmqsuplng": "100000sat" - } - ], - "feerate": null, - "minconf": null, - "utxos": null - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **psbt** (string): The PSBT representing the unsigned transaction. -- **unsigned\_tx** (hex): The unsigned transaction. -- **txid** (txid): The transaction id of *unsigned\_tx*; you hand this to lightning-txsend(7) or lightning-txdiscard(7), as the inputs of this transaction are reserved. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "unsigned_tx": "020000000142dc00d81359c3a551e170e3bf5262fa9cacc2eb2e283a10e579491cd86dce4b0000000000fdffffff02ffffff00000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd42839800000000002251207836355fdc8a82dc4cb00a772c5554151d06384a4dd65e8d3f68ac08566b84be66000000", - "txid": "6e680cb76077f11c838cc7aee0c0aa360f9857f00856bb1614025a1af53739fc", - "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABATRHoQ9tEMHRHpf06v5uTEdjdMk1rccIaA6MNGMipNQWAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFLnqitWTi465LGxeucwoSAj16NGbAkcwRAIgVtOsUaQaPgH86aW6e6qmJa1xVb8KWvc+HALGosqVVmQCIFi4JU8Gy+vl2a2/frY+71hitYIBB/tjsRP7fpgb8b9TASECHUIV5q1r2ownjOlAFPQASTlZxxNgBvi5O3hCRvajwdJlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIELcANgTWcOlUeFw479SYvqcrMLrLig6EOV5SRzYbc5LAQ8EAAAAAAEQBP3///8AAQMI////AAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAAEDCEKDmAAAAAAAAQQiUSB4NjVf3IqC3EywCncsVVQVHQY4Sk3WXo0/aKwIVmuEvgA=" -} -{ - "unsigned_tx": "0200000001a91077a134fb9fe4a8d13a482b718368bfd9ce3eff61ff7d96549480a1f97dca0100000000fdffffff02a08601000000000022002025f9e19a5118ff891eb25882add8ad394db2b143355b5b9fbc3c5fd37106d6f66173010000000000225120a2a01c7965289eee56b5cfcddb9856c70fa476c264d21f711c6a69af776ae40366000000", - "txid": "f11d436054607603e903fc69c4bd9b39ce97421341c7cf814ad025cb5bf59c1c", - "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABAYZ4QwAgPq6Os8kk073f5Yx4T9LXYfbOjAdkzMXfuBQdAAAAAAD9////AjPkAioBAAAAFgAUeOeqzyifepeJAMCl4vnnJ/TRptRADQMAAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgYBFwmqWCrVkxxZ0/tte3z4lIem0L7MkhXzGAOvBWa6YCIFx7H4zOzxjixlZMi0DYYbIEflDjYHJXLfN1wVcXYuekASEDgztw/3Rks6vKGYMXJ83VEvQcNIjg3rJW6KdxEh26uwplAAAAAQEfQA0DAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIKkQd6E0+5/kqNE6SCtxg2i/2c4+/2H/fZZUlICh+X3KAQ8EAQAAAAEQBP3///8AAQMIoIYBAAAAAAABBCIAICX54ZpRGP+JHrJYgq3YrTlNsrFDNVtbn7w8X9NxBtb2AAEDCGFzAQAAAAAAAQQiUSCioBx5ZSie7la1z83bmFbHD6R2wmTSH3Ecammvd2rkAwA=" -} -``` - -ERRORS ------- - -On failure, an error is reported and the transaction is not created. - -- -1: Catchall nonspecific error. -- 301: There are not enough funds in the internal wallet (including fees) to create the transaction. -- 302: The dust limit is not met. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-withdraw(7), lightning-txsend(7), lightning-txdiscard(7), lightning-feerates(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-txsend.7.md b/doc/lightning-txsend.7.md deleted file mode 100644 index 6321605cf913..000000000000 --- a/doc/lightning-txsend.7.md +++ /dev/null @@ -1,69 +0,0 @@ -lightning-txsend -- Command to sign and send transaction from txprepare -======================================================================= - -SYNOPSIS --------- - -**txsend** *txid* - -DESCRIPTION ------------ - -The **txsend** RPC command signs and broadcasts a transaction created by *txprepare* RPC command. - -- **txid** (txid): The transaction id of the transaction created by `txprepare` rpc command. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:txsend#1", - "method": "txsend", - "params": { - "txid": "c9f59ba6bda8e095bb43ecabfa37de8d5194e5c839b6b63be4e29bceaae483ce" - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **psbt** (string): The completed PSBT representing the signed transaction. -- **tx** (hex): The fully signed transaction. -- **txid** (txid): The transaction id of *tx*. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "tx": "020000000142dc00d81359c3a551e170e3bf5262fa9cacc2eb2e283a10e579491cd86dce4b0000000000fdffffff020000000100000000220020b636f07026ea64952ece5b7620a9337d9ac2321c796a499260994d1b373667504183980000000000225120754a77b503fcba0fd80f0a1a8226ed6764ff9a9d9bb61b485d40d4c9f4be245966000000", - "txid": "c9f59ba6bda8e095bb43ecabfa37de8d5194e5c839b6b63be4e29bceaae483ce", - "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABATRHoQ9tEMHRHpf06v5uTEdjdMk1rccIaA6MNGMipNQWAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFLnqitWTi465LGxeucwoSAj16NGbAkcwRAIgVtOsUaQaPgH86aW6e6qmJa1xVb8KWvc+HALGosqVVmQCIFi4JU8Gy+vl2a2/frY+71hitYIBB/tjsRP7fpgb8b9TASECHUIV5q1r2ownjOlAFPQASTlZxxNgBvi5O3hCRvajwdJlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZSICA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPRzBEAiBp/HPhg1ObOXqTr5rIjUYLMspGLz+sk1pjD9pjRFzf3wIgWycOB/dQPzwZAK3OXYs269h8o85ucDpdVhH4AyX69a0BIgYD10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8IAfrZCgAAAAABDiBC3ADYE1nDpVHhcOO/UmL6nKzC6y4oOhDleUkc2G3OSwEPBAAAAAABEAT9////AAEDCAAAAAEAAAAAAQQiACC2NvBwJupklS7OW3YgqTN9msIyHHlqSZJgmU0bNzZnUAABAwhBg5gAAAAAAAEEIlEgdUp3tQP8ug/YDwoagibtZ2T/mp2bthtIXUDUyfS+JFkhBycqmiXx/+1S+rBKLMiK6rE1tTcjhWqPFIHCZBf4ipIuCQDVXEk5CwAAAAA=" -} -``` - -ERRORS ------- - -On failure, an error is reported (from bitcoind), and the inputs from the transaction are unreserved. - -- -1: Catchall nonspecific error. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-txprepare(7), lightning-txdiscard(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-unreserveinputs.7.md b/doc/lightning-unreserveinputs.7.md deleted file mode 100644 index a3eccdd6337c..000000000000 --- a/doc/lightning-unreserveinputs.7.md +++ /dev/null @@ -1,91 +0,0 @@ -lightning-unreserveinputs -- Release reserved UTXOs -=================================================== - -SYNOPSIS --------- - -**unreserveinputs** *psbt* [*reserve*] - -DESCRIPTION ------------ - -The **unreserveinputs** RPC command releases (or reduces reservation) on UTXOs which were previously marked as reserved, generally by lightning-reserveinputs(7). - -- **psbt** (string): Inputs to unreserve are the inputs specified in the passed-in *psbt*. -- **reserve** (u32, optional): The number of blocks to decrease reservation by. The default is 72. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:unreserveinputs#1", - "method": "unreserveinputs", - "params": { - "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABAXyy20ynmOFyRbegGyApk50yNIAb4C+RKV5c2n5VKL3lAAAAAAD9////Akf0EAAAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WUs/fQpAQAAABYAFN9HebR4q6498ytdeRKjC64CkCOMAkcwRAIgSTJCpWVH1FLZYPdwFe7gZckxCtk+AxPp20KUVKqPIdUCIA3hkoUco68vffiwt6TrE3KgX09JE9m7PDUUgrHQANMRASEDBOBlCza/8qXE5q8uJ+OWsKscDERWfdA+LLCa/lwMH0BlAAAAAQEfR/QQAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZSICA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPRzBEAiBKjSasyN29ODqXSemEQCZfRIvbJP8thKRBrd4e+NLEMQIgMGNz3+DWDnLmjnIDCaVcC7BKxuycwvtJq1qlKFtTaXcBIgYD10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8IAfrZCgAAAAABDiAoXS6QUlCcOApG/j+hr4OhNt0tT4GvCzI6z16Hepi7OwEPBAAAAAABEAT9////AAEDCCN6CAAAAAAAAQQWABQfJ4Qjje0sa2yGBz++6jkM2hGRmAz8CWxpZ2h0bmluZwQCAAEAAQMIinkIAAAAAAABBCJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aIQeRRTKBKkQKTXZscc05GTaUo0CuEeAS5boa2e+6bnbKUwkAwsyrFwIAAAAA", - "reserve": 200 - } -} -{ - "id": "example:unreserveinputs#2", - "method": "unreserveinputs", - "params": { - "psbt": "cHNidP8BAF4CAAAAAVa79WPJoiYrzo/RgzIAn5HanoBFZo0vZvEjxPAVwLv4AAAAAAD9////AXzpHAAAAAAAIlEgBRjpLNlOD2LAbxJt/5i5q+ebfthFoVbVJFZ44mVUR11mAAAAAAEA3gIAAAAAAQENwcSElLyC0jcwUHiODBhtapHyzIdiwytOGiu/Raf4BwAAAAAA/f///wKAhB4AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFl82znKQEAAAAWABQyIWyAI6LDf6dJ58BDPdkh+PWUZwJHMEQCIGiJFhVi/d/Hz19Cz48uHTjhgBJ6WAlgl/bLVS7A6VtxAiAwlb7xYzIM4uopFvMnpOmGIOp3+upOPPF2F8VaB8U/HQEhA6BAjey7RADP4ifoh2VXhX7QXkh+sZqozv1EPuU5TxZmZQAAAAEBH4CEHgAAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WUAAA==", - "reserve": null - } -} -``` - -RETURN VALUE ------------- - -On success, an object containing **reservations** is returned. It is an array of objects, where each object contains: - -- **txid** (txid): The transaction id. -- **vout** (u32): The output number which was reserved. -- **was\_reserved** (boolean): Whether the input was already reserved (usually `true`). -- **reserved** (boolean): Whether the input is now reserved (may still be `true` if it was reserved for a long time). - -If **reserved** is *true*: - - **reserved\_to\_block** (u32): What blockheight the reservation will expire. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "reservations": [ - { - "txid": "3bbb987a875ecf3a320baf814f2ddd36a183afa13ffe460a389c5052902e5d28", - "vout": 0, - "was_reserved": true, - "reserved": false - } - ] -} -{ - "reservations": [] -} -``` - -ERRORS ------- - -On failure, an error is reported and no UTXOs are unreserved. - -- -32602: Invalid parameter, i.e. an unparseable PSBT. - -AUTHOR ------- - -Lisa Neigut <> is mainly responsible. - -SEE ALSO --------- - -lightning-unreserveinputs(7), lightning-signpsbt(7), lightning-sendpsbt(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-upgradewallet.7.md b/doc/lightning-upgradewallet.7.md deleted file mode 100644 index fb99cd40ea62..000000000000 --- a/doc/lightning-upgradewallet.7.md +++ /dev/null @@ -1,81 +0,0 @@ -lightning-upgradewallet -- Command to spend all P2SH-wrapped inputs into a Native Segwit output -=============================================================================================== - -SYNOPSIS --------- - -**upgradewallet** [*feerate*] [*reservedok*] - -DESCRIPTION ------------ - -`upgradewallet` is a convenience RPC which will spend all p2sh-wrapped Segwit deposits in a wallet into a single Native Segwit P2WPKH address. - -- **feerate** (feerate, optional): Feerate for the upgrade transaction. The default is *opening*. *(added v23.02)* -- **reservedok** (boolean, optional): Tells the wallet to include all P2SH-wrapped inputs, including reserved ones. *(added v23.02)* - -EXAMPLE USAGE -------------- - -The caller is trying to buy a liquidity ad but the command keeps failing. They have funds in their wallet, but they're all P2SH-wrapped outputs. - -The caller can call `upgradewallet` to convert their funds to native segwit outputs, which are valid for liquidity ad buys. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:upgradewallet#1", - "method": "upgradewallet", - "params": "{}" -} -{ - "id": "example:upgradewallet#2", - "method": "upgradewallet", - "params": { - "feerate": "urgent", - "reservedok": true - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **upgraded\_outs** (u64): Count of spent/upgraded UTXOs. *(added v23.02)* -- **psbt** (string, optional): The PSBT that was finalized and sent. *(added v23.02)* -- **tx** (hex, optional): The raw transaction which was sent. *(added v23.02)* -- **txid** (txid, optional): The txid of the **tx**. *(added v23.02)* - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "upgraded_outs": 0 -} -{ - "tx": "0200000001c08ce0a9ea1e00179ea603cb8619ec2a2df990ef931e1ccd87fa7a0e271ed8370100000000fdffffff013514310100000000225120888ab14b6e1655d1d00039b836d70b66e3351543ab6cd2f94166255f3d5e6cb5cf000000", - "txid": "de5f1d6f0b2f95cfe5cfbf8cc33bd3f279a8f800ee0efc27bbfafb2b6ead9560", - "psbt": "cHNidP8BAgQCAAAAAQMEzwAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDgAgAAAAABAZRZ0m0kaJA+ubJw1eYurGROu1BYc0i7l9xbyG06R6uZAQAAAAD9////AmQtPCgBAAAAF6kUnoGu9IUv0FGnzol3Lb/BNBNkOViHAC0xAQAAAAAXqRRlVyjzbP420BqlDTI2cERp+EpVQIcCRzBEAiBliJpjBsipwFgsLZMlzbESZ6hMTh+pgKQlXUIL0nLb3wIga/xwr/IJgEc7Ie6ApS4aVDr9xr1TZ3wj+8bRvI6WqScBIQPgYuc48PzUufScX6A6YOsdmJwn+bAQjLZ/g9jhQYduHM4AAAABASAALTEBAAAAABepFGVXKPNs/jbQGqUNMjZwRGn4SlVAhyICArnAxoROEqUxyWjlXFUHjsFtm/dr6SkP2H0cynK0g5oXRzBEAiBlTUNYfS5n5rGRVmoNb0z3AMGJjHijwpXROGIVxfoBnQIgeTx32KY3CcfYTYzXUIRQAMUQB7rlPWRptWMDD3UttkcBAQQWABTWuWnTbf/a2YaRk/Zj7kgN/cc0iCIGArnAxoROEqUxyWjlXFUHjsFtm/dr6SkP2H0cynK0g5oXCNa5adMAAAAAAQ4gwIzgqeoeABeepgPLhhnsKi35kO+THhzNh/p6Dice2DcBDwQBAAAAARAE/f///wABAwg1FDEBAAAAAAEEIlEgiIqxS24WVdHQADm4NtcLZuM1FUOrbNL5QWYlXz1ebLUhByjMj8l44gnxaV+ltWVQYdsaqyMRtSQXaUW/EBXvLUuJCQCftnv8BwAAAAA=", - "upgraded_outs": 1 -} -``` - -AUTHOR ------- - -Lisa Neigut <> is mainly responsible. - -SEE ALSO --------- - -lightning-utxopsbt(7), lightning-reserveinputs(7), lightning-unreserveinputs(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-utxopsbt.7.md b/doc/lightning-utxopsbt.7.md deleted file mode 100644 index f5f705f7ded1..000000000000 --- a/doc/lightning-utxopsbt.7.md +++ /dev/null @@ -1,148 +0,0 @@ -lightning-utxopsbt -- Command to populate PSBT inputs from given UTXOs -====================================================================== - -SYNOPSIS --------- - -**utxopsbt** *satoshi* *feerate* *startweight* *utxos* [*reserve*] [*reservedok*] [*locktime*] [*min\_witness\_weight*] [*excess\_as\_change*] [*opening\_anchor\_channel*] - -DESCRIPTION ------------ - -*utxopsbt* is a low-level RPC command which creates a PSBT using unreserved inputs in the wallet, optionally reserving them as well. - -It deliberately mirrors the parameters and output of lightning-fundpsbt(7) except instead of an optional *minconf* parameter to select unreserved outputs from the wallet, it takes a compulsory list of outputs to use. - -- **satoshi** (msat\_or\_all): The minimum satoshi value of the output(s) needed (or the string `all` meaning use all unreserved inputs). If a value, it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. -- **feerate** (feerate): Used for the transaction as initial feerate. The default is *normal*. -- **startweight** (u32): The weight of the transaction before *fundpsbt* has added any inputs. -- **utxos** (array of outpoints): An array of `txid:vout`, each of which must be reserved or available.: - - (outpoint, optional) -- **reserve** (u32, optional): If not zero, then *reserveinputs* is called (successfully, with *exclusive* true) on the returned PSBT for this number of blocks. The default is 72 blocks. -- **reservedok** (boolean, optional): If set to true, it will also fail if any of the *utxos* are already reserved. The default is false. -- **locktime** (u32, optional): If not set, it is set to a recent block height. -- **min\_witness\_weight** (u32, optional): Minimum weight to use for a UTXO's witness. If the actual witness weight is greater than the provided minimum, the actual witness weight will be used. -- **excess\_as\_change** (boolean, optional): Flag to add a change output for the excess sats. -- **opening\_anchor\_channel** (boolean, optional): To signel that it needs emergency reserve for anchors so that we can lowball our commitment tx fees, and min-emergency-msat for reserving some sats for closing anchor channels. *(added v23.08)* - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:utxopsbt#1", - "method": "utxopsbt", - "params": { - "satoshi": 0, - "feerate": "253perkw", - "startweight": 0, - "utxos": [ - "d82a99192fb333106ea8d08f5231ed45f2ed5b1ef9eb81b0fef8f9ea354d2637:1" - ], - "reserve": 0, - "reservedok": true, - "locktime": null, - "min_witness_weight": null, - "excess_as_change": false - } -} -{ - "id": "example:utxopsbt#2", - "method": "utxopsbt", - "params": { - "satoshi": 1000000, - "feerate": "7500perkw", - "startweight": 0, - "utxos": [ - "2fc3b9f8d4aed120f6d9a6f206f07c35ef4d518ec0305d1d974873d256e38ca7:1", - "2f669f6a605ee5c7ddd2abb753bc64b1a90bd1b7448264f5d78a7ca823c00a1b:1" - ], - "reserve": null, - "reservedok": true, - "locktime": null, - "min_witness_weight": null, - "excess_as_change": false - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **psbt** (string): Unsigned PSBT which fulfills the parameters given. -- **feerate\_per\_kw** (u32): The feerate used to create the PSBT, in satoshis-per-kiloweight. -- **estimated\_final\_weight** (u32): The estimated weight of the transaction once fully signed. -- **excess\_msat** (msat): The amount above *satoshi* which is available. This could be zero, or dust; it will be zero if *change\_outnum* is also returned. -- **change\_outnum** (u32, optional): The 0-based output number where change was placed (only if parameter *excess\_as\_change* was true and there was sufficient funds). -- **reservations** (array of objects, optional): If *reserve* was true or a non-zero number, just as per lightning- reserveinputs(7).: - - **txid** (txid): The txid of the transaction. - - **vout** (u32): The 0-based output number. - - **was\_reserved** (boolean): Whether this output was previously reserved. - - **reserved** (boolean) (always *true*): Whether this output is now reserved. - - **reserved\_to\_block** (u32): The blockheight the reservation will expire. - -On success, returns the *psbt* it created, containing the inputs, *feerate\_per\_kw* showing the exact numeric feerate it used, *estimated\_final\_weight* for the estimated weight of the transaction once fully signed, and *excess\_msat* containing the amount above *satoshi* which is available. This could be zero, or dust. If *satoshi* was `all`, then *excess\_msat* is the entire amount once fees are subtracted for the weights of the inputs and *startweight*. - -If *reserve* was *true* or a non-zero number, then a *reservations* array is returned, exactly like *reserveinputs*. - -If *excess\_as\_change* is true and the excess is enough to cover an additional output above the `dust_limit`, then an output is added to the PSBT for the excess amount. The *excess\_msat* will be zero. A *change\_outnum* will be returned with the index of the change output. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "psbt": "cHNidP8BADMCAAAAATcmTTXq+fj+sIHr+R5b7fJF7TFSj9CobhAzsy8ZmSrYAQAAAAD9////AGYAAAAAAQDeAgAAAAABAWQACJva49ga8OCYXvPRWQRhoXndrJykwjgXbwT251dEAAAAAAD9////AiOI9ikBAAAAFgAU3gClv/YpAKRpfDuiFu6mIL2E4+5QaQ8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgUXIQFs7oRkorVThUn3sLj7WI7g8c8RHai4ChoCvIkWsCICp1CqHl4BlMJCKFHRWHXhhekaj0r1EFSNrh8UnvysQPASEDqHIAEdaH3H6pb3VJzbJNDG4lL8PTfsheL+h2p6baK3JlAAAAAQEfUGkPAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=", - "feerate_per_kw": 253, - "estimated_final_weight": 271, - "excess_msat": 1009932000 -} -{ - "psbt": "cHNidP8BAFwCAAAAAqeM41bSc0iXHV0wwI5RTe81fPAG8qbZ9iDRrtT4ucMvAQAAAAD9////GwrAI6h8itf1ZIJEt9ELqbFkvFO3q9Ldx+VeYGqfZi8BAAAAAP3///8AZgAAAAABAN4CAAAAAAEBEaK0TQ97IsrzuO1gLt+vYbvLBG90NrCOZp7SCgrRknYAAAAAAP3///8CM6/2KQEAAAAWABQ1B/KkIVbg7yFRcCEN/VOptfOX/EBCDwAAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WUCRzBEAiA1oI1us81XEa/DRlvcP2qnbWLsV5pZcRfvj9MLyT202gIgb7noMqHYWMmm7H7VNEfWa29jjtuV9yrrSc9ui11ECQ0BIQKhZOHR4gFKMu2EKKgZ/7qnhzq9PvhtnAW2sxPZ4c9RIWUAAAABAR9AQg8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAAEA3gIAAAAAAQGnjONW0nNIlx1dMMCOUU3vNXzwBvKm2fYg0a7U+LnDLwAAAAAA/f///wJmbOcpAQAAABYAFOwPo5eUrDF7UgZBFQLRHOeX6PiGQEIPAAAAAAAWABTCzKsXHCpb6dq1LsQbglhjAkxUZgJHMEQCICgjGlauGj2eiMS4MWUK6zAWqMe1OuidQR+Hy9ZgSTuzAiA8JTb9OrLqS3hiWtT+TQ/NBsKJ2hhHLDaKUUNdgi4OkAEhA9g3oH5ejmGIqUY2ZWxc8YWF2+T+XpE/6oC40Cx3+e97ZQAAAAEBH0BCDwAAAAAAFgAUwsyrFxwqW+natS7EG4JYYwJMVGYA", - "feerate_per_kw": 7500, - "estimated_final_weight": 542, - "excess_msat": 995935000, - "reservations": [ - { - "txid": "2fc3b9f8d4aed120f6d9a6f206f07c35ef4d518ec0305d1d974873d256e38ca7", - "vout": 1, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - }, - { - "txid": "2f669f6a605ee5c7ddd2abb753bc64b1a90bd1b7448264f5d78a7ca823c00a1b", - "vout": 1, - "was_reserved": true, - "reserved": true, - "reserved_to_block": 246 - } - ] -} -``` - -ERRORS ------- - -On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -- -32602: If the given parameters are wrong. -- -1: Catchall nonspecific error. -- 301: Insufficient UTXOs to meet *satoshi* value. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-fundpsbt(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-wait.7.md b/doc/lightning-wait.7.md deleted file mode 100644 index 79bb02a40af5..000000000000 --- a/doc/lightning-wait.7.md +++ /dev/null @@ -1,163 +0,0 @@ -lightning-wait -- Command to wait for creations, changes and deletions -====================================================================== - -SYNOPSIS --------- - -**wait** *subsystem* *indexname* *nextvalue* - -DESCRIPTION ------------ - -Command *added* in v23.08. - -The **wait** RPC command returns once the index given by *indexname* in *subsystem* reaches or exceeds *nextvalue*. All indexes start at 0, when no events have happened (**wait** with a *nextvalue* of 0 is a way of getting the current index, though naturally this is racy!). - -- **subsystem** (string) (one of "invoices", "forwards", "sendpays"): The subsystem to get the next index value from. - `invoices`: corresponding to `listinvoices` (added in *v23.08*). - `sendpays`: corresponding to `listsendpays` (added in *v23.11*). - `forwards`: corresponding to `listforwards` (added in *v23.11*). -- **indexname** (string) (one of "created", "updated", "deleted"): The name of the index to get the next value for. - `created` is incremented by one for every new object. - `updated` is incremented by one every time an object is changed. - `deleted` is incremented by one every time an object is deleted. -- **nextvalue** (u64): The next value of the index. - -RELIABILITY ------------ - -Indices can go forward by more than one; in particlar, if multiple objects were created and the one deleted, you could see this effect. Similarly, there are some places (e.g. invoice expiration) where we can update multiple entries at once. - -Indices only monotoncally increase. - -USAGE ------ - -The **wait** RPC is used to track changes in the system. Consider tracking invoices being paid or expiring. The simplest (and inefficient method) would be: -1. Call `listinvoices` to get the current state of all invoices, and remember the highest `updated_index`. Say it was 5. -2. Call `wait invoices updated 6`. -3. When it returns, call `listinvoices` again to see what changed. - -This is obviously inefficient, so there are two optimizations: -1. Call `listinvoices` with `index=updated` and `start=6` to only see invoices with `updated_index` greater than or equal to 6. -2. `wait` itself may also return some limited subset of fields from the list command (it can't do this in all cases); for `invoices` this is `label` and `status`, allowing many callers to avoid the `listinvoices` call. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:wait#1", - "method": "wait", - "params": { - "subsystem": "invoices", - "indexname": "created", - "nextvalue": 1 - } -} -{ - "id": "example:wait#2", - "method": "wait", - "params": { - "subsystem": "invoices", - "indexname": "updated", - "nextvalue": 2 - } -} -{ - "id": "example:wait#3", - "method": "wait", - "params": { - "subsystem": "sendpays", - "indexname": "updated", - "nextvalue": 2 - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **subsystem** (string) (one of "invoices", "forwards", "sendpays") -- **created** (u64, optional): 1-based index indicating order entry was created. -- **updated** (u64, optional): 1-based index indicating order entry was updated. -- **deleted** (u64, optional): 1-based index indicating order entry was deleted. - -If **subsystem** is "invoices": - - **details** (object, optional): - - **status** (string, optional) (one of "unpaid", "paid", "expired"): Whether it's paid, unpaid or unpayable. - - **label** (string, optional): Unique label supplied at invoice creation. - - **description** (string, optional): Description used in the invoice. - - **bolt11** (string, optional): The BOLT11 string. - - **bolt12** (string, optional): The BOLT12 string. - -If **subsystem** is "forwards": - - **details** (object, optional): - - **status** (string, optional) (one of "offered", "settled", "failed", "local\_failed"): Still ongoing, completed, failed locally, or failed after forwarding. - - **in\_channel** (short\_channel\_id, optional): Unique label supplied at invoice creation. - - **in\_htlc\_id** (u64, optional): The unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11). - - **in\_msat** (msat, optional): The value of the incoming HTLC. - - **out\_channel** (short\_channel\_id, optional): The channel that the HTLC (trying to) forward to. - -If **subsystem** is "sendpays": - - **details** (object, optional): - - **status** (string, optional) (one of "pending", "failed", "complete"): Status of the payment. - - **partid** (u64, optional): Part number (for multiple parts to a single payment). - - **groupid** (u64, optional): Grouping key to disambiguate multiple attempts to pay an invoice or the same payment\_hash. - - **payment\_hash** (hash, optional): The hash of the *payment\_preimage* which will prove payment. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "subsystem": "invoices", - "created": 1, - "details": { - "status": "unpaid", - "label": "invlabel", - "bolt11": "lnbcrt420p1pjmxtevsp5d8c6gnaj8lyjy2qly783vklda9dfaqeyzyc37agxxp8h3uguv8pqpp5w6lhwxhqnuew4hle5h7qwjm27zz784mvsrzhmayhscy5t2hy5c4qdqvd9h8ver9wd3sxqyjw5qcqp99qxpqysgq09gxhjhwu9u3z6dlt5ln5f4g8zl78wz4pgh0am3kz54m9lllhqckf4gmhmt2ftrclq5x62zkqmggc7y0ju0ghdfwjz8hyd8l5cqvemgpyyhm6w" - } -} -{ - "subsystem": "invoices", - "updated": 2, - "details": { - "status": "expired" - } -} -{ - "subsystem": "sendpays", - "updated": 2, - "details": { - "status": "complete", - "partid": 0, - "groupid": 1, - "payment_hash": "220dcfcf43e1fab3ce30f70eb943c3ce962393f5a65ced52d749e324b443d19e" - } -} -``` - -ERRORS ------- - -On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -- -32602: If the given parameters are wrong. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-listinvoice(7), lightning-listforwards(7), lightning-listsendpays(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-waitanyinvoice.7.md b/doc/lightning-waitanyinvoice.7.md deleted file mode 100644 index 826af9f34a85..000000000000 --- a/doc/lightning-waitanyinvoice.7.md +++ /dev/null @@ -1,124 +0,0 @@ -lightning-waitanyinvoice -- Command for waiting for payments -============================================================ - -SYNOPSIS --------- - -**waitanyinvoice** [*lastpay\_index*] [*timeout*] - -DESCRIPTION ------------ - -The **waitanyinvoice** RPC command waits until an invoice is paid, then returns a single entry as per **listinvoice**. It will not return for any invoices paid prior to or including the *lastpay\_index*. - -This is usually called iteratively: once with no arguments, then repeatedly with the returned *pay\_index* entry. This ensures that no paid invoice is missed. The *pay\_index* is a monotonically-increasing number assigned to an invoice when it gets paid. The first valid *pay\_index* is 1. - -- **lastpay\_index** (u64, optional): Ignores any invoices paid prior to or including this index. 0 is equivalent to not specifying and negative value is invalid. -- **timeout** (u64, optional): If specified, wait at most that number of seconds, which must be an integer. If the specified *timeout* is reached, this command will return with an error. You can specify this to 0 so that **waitanyinvoice** will return immediately with an error if no pending invoice is available yet. If unspecified, this command will wait indefinitely. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:waitanyinvoice#1", - "method": "waitanyinvoice", - "params": { - "lastpay_index": null, - "timeout": null - } -} -{ - "id": "example:waitanyinvoice#2", - "method": "waitanyinvoice", - "params": { - "lastpay_index": 3, - "timeout": 0 - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **label** (string): Unique label supplied at invoice creation. -- **description** (string): Description used in the invoice. -- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. -- **status** (string) (one of "paid", "expired"): Whether it's paid or expired. -- **expires\_at** (u64): UNIX timestamp of when it will become / became unpayable. -- **created\_index** (u64): 1-based index indicating order this invoice was created in. *(added v23.08)* -- **amount\_msat** (msat, optional): The amount required to pay this invoice. -- **bolt11** (string, optional): The BOLT11 string (always present unless *bolt12* is). -- **bolt12** (string, optional): The BOLT12 string (always present unless *bolt11* is). -- **updated\_index** (u64, optional): 1-based index indicating order this invoice was changed (only present if it has changed since creation). *(added v23.08)* - -If **status** is "paid": - - **pay\_index** (u64): Unique incrementing index for this payment. - - **amount\_received\_msat** (msat): The amount actually received (could be slightly greater than *amount\_msat*, since clients may overpay). - - **paid\_at** (u64): UNIX timestamp of when it was paid. - - **payment\_preimage** (secret): Proof of payment. - - **paid\_outpoint** (object, optional): Outpoint this invoice was paid with. *(added v23.11)*: - - **txid** (txid): ID of the transaction that paid the invoice. *(added v23.11)* - - **outnum** (u32): The 0-based output number of the transaction that paid the invoice. *(added v23.11)* - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "label": "inv1", - "bolt11": "lnbcrt10n1pjmxtsxsp56sn02x8lccjfsvunnhz5858zuyxztug9luy226w4qsmfm4r8pkcspp5gw5r0dw99yf3zqxrg24l8g9m9hun9cu06ldg4rga8s9t9kv8z45sdq8d9h8vvgxqyjw5qcqp99qxpqysgqv537uh2sx8ch640mf4t43t8qjtpg3z7gukgm07tlyq986m7nvsnxkapg37z4vsxtl4thfqzc64anqr83geygkc2xaftxgr97dltqfjqpe3mhja", - "payment_hash": "43a837b5c529131100c342abf3a0bb2df932e38fd7da8a8d1d3c0ab2d9871569", - "amount_msat": 1000, - "status": "paid", - "pay_index": 1, - "amount_received_msat": 1000, - "paid_at": 1706241546, - "payment_preimage": "a0c668998de14b975f33e1060b3efd7efc0bde784ac266ab667a1b2fddab3cd1", - "description": [ - "Inv1." - ], - "expires_at": 1706846342, - "created_index": 1, - "updated_index": 1 -} -{ - "label": "inv4", - "bolt11": "lnbcrt10n1pja0tkmsp57j4z9zwvdsyh57unh3da7aac5z20clfnrwy5nqm6wujaelduw23qpp580mdrwakz9xewc2vhvpucset9gjkgdvyhw7h9frcy2d6p2lwdw2qdq8d9h8vdqxqyjw5qcqp99qxpqysgqtgyzhtxs3p2dyk8wk9q028033303702d2hml4frmu38qe79mrkgzgxvyjmq2q4nhjgcuz3uhmlda3jnhf9w6mj8mj97pkgnda9l5kdcqsdgewf", - "payment_hash": "3bf6d1bbb6114d97614cbb03cc432b2a25643584bbbd72a478229ba0abee6b94", - "amount_msat": 1000, - "status": "paid", - "pay_index": 4, - "amount_received_msat": 1000, - "paid_at": 1708633825, - "payment_preimage": "77336a342dde76050c7ee7fc18599e407dfc1edad3c784ba68e9603004365b94", - "description": "inv4", - "expires_at": 1709238619, - "created_index": 4, - "updated_index": 4 -} -``` - -ERRORS ------- - -The following error codes may occur: - -- 904: The *timeout* was reached without an invoice being paid. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-waitinvoice(7), lightning-listinvoice(7), lightning-delinvoice(7), lightning-invoice(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-waitblockheight.7.md b/doc/lightning-waitblockheight.7.md deleted file mode 100644 index 31236ab7f976..000000000000 --- a/doc/lightning-waitblockheight.7.md +++ /dev/null @@ -1,75 +0,0 @@ -lightning-waitblockheight -- Command for waiting for blocks on the blockchain -============================================================================= - -SYNOPSIS --------- - -**waitblockheight** *blockheight* [*timeout*] - -DESCRIPTION ------------ - -The **waitblockheight** RPC command waits until the blockchain has reached the specified *blockheight*. - -- **blockheight** (u32): Current blockheight of the blockchain if the value is greater than this number. If it is a present or past block height, then the command returns immediately. -- **timeout** (u32, optional): Only wait up to specified seconds. The default is 60 seconds. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:waitblockheight#1", - "method": "waitblockheight", - "params": { - "blockheight": 99, - "timeout": null - } -} -{ - "id": "example:waitblockheight#2", - "method": "waitblockheight", - "params": { - "blockheight": 103, - "timeout": 600 - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **blockheight** (u32): The current block height (>= *blockheight* parameter). - -If *timeout* seconds is reached without the specified blockheight being reached, this command will fail with a code of `2000`. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "blockheight": 99 -} -{ - "blockheight": 103 -} -``` - -ERRORS ------- - -The following error codes may occur: - -- 2000: Timed out. - -AUTHOR ------- - -ZmnSCPxj <> is mainly responsible. - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-waitinvoice.7.md b/doc/lightning-waitinvoice.7.md deleted file mode 100644 index f9364d93243f..000000000000 --- a/doc/lightning-waitinvoice.7.md +++ /dev/null @@ -1,101 +0,0 @@ -lightning-waitinvoice -- Command for waiting for specific payment -================================================================= - -SYNOPSIS --------- - -**waitinvoice** *label* - -DESCRIPTION ------------ - -The **waitinvoice** RPC command waits until a specific invoice is paid, then returns that single entry as per **listinvoice**. - -- **label** (one of): Unique label of the invoice waiting to be paid.: - - (string) - - (integer) - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:waitinvoice#1", - "method": "waitinvoice", - "params": { - "label": "inv2" - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **label** (string): Unique label supplied at invoice creation. -- **description** (string): Description used in the invoice. -- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. -- **status** (string) (one of "paid", "expired"): Whether it's paid or expired. -- **expires\_at** (u64): UNIX timestamp of when it will become / became unpayable. -- **created\_index** (u64): 1-based index indicating order this invoice was created in. *(added v23.08)* -- **amount\_msat** (msat, optional): The amount required to pay this invoice. -- **bolt11** (string, optional): The BOLT11 string (always present unless *bolt12* is). -- **bolt12** (string, optional): The BOLT12 string (always present unless *bolt11* is). -- **updated\_index** (u64, optional): 1-based index indicating order this invoice was changed (only present if it has changed since creation). *(added v23.08)* - -If **status** is "paid": - - **pay\_index** (u64): Unique incrementing index for this payment. - - **amount\_received\_msat** (msat): The amount actually received (could be slightly greater than *amount\_msat*, since clients may overpay). - - **paid\_at** (u64): UNIX timestamp of when it was paid. - - **payment\_preimage** (secret): Proof of payment. - - **paid\_outpoint** (object, optional): Outpoint this invoice was paid with. *(added v23.11)*: - - **txid** (txid): ID of the transaction that paid the invoice. *(added v23.11)* - - **outnum** (u32): The 0-based output number of the transaction that paid the invoice. *(added v23.11)* - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "label": "inv2", - "bolt11": "lnbcrt10n1pjmxtwjsp5mzvdu6v8hqsf2tlj0nlyks23afqp7ejs444syjxf74p60ztmld8qpp5q4ayz5pys3t0yj0dmkmh7ctarkv9z434paz4u9rdwnj4f43thhaqdq8d9h8vvsxqyjw5qcqp99qxpqysgqn0055ttns6pafsxh6xuqce6e4vz8gtxlzqx0l9d9f5crmqx4jymh4zy9jdaszm0dj89sq39fvhpwcs626dt0n3gw8kassfdehp5sy3sq7fzy3w", - "payment_hash": "057a4150248456f249edddb77f617d1d985156350f455e146d74e554d62bbdfa", - "amount_msat": 1000, - "status": "paid", - "pay_index": 1, - "amount_received_msat": 1000, - "paid_at": 1706241494, - "payment_preimage": "34ccd37cc85e067cb376f9ea8c70d70469f58bf296f2566ed9ad4dfb70971a26", - "description": [ - "Inv2." - ], - "expires_at": 1706846290, - "created_index": 2, - "updated_index": 1 -} -``` - -ERRORS ------- - -On error the returned object will contain `code` and `message` properties, with `code` being one of the following: - -- -32602: If the given parameters are wrong. -- -1: If the invoice is deleted while unpaid, or the invoice does not exist. -- 903: If the invoice expires before being paid, or is already expired. - -AUTHOR ------- - -Christian Decker <> is mainly responsible. - -SEE ALSO --------- - -lightning-waitanyinvoice(7), lightning-listinvoice(7), lightning-delinvoice(7), lightning-invoice(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-waitsendpay.7.md b/doc/lightning-waitsendpay.7.md deleted file mode 100644 index c2ae24b75a1f..000000000000 --- a/doc/lightning-waitsendpay.7.md +++ /dev/null @@ -1,117 +0,0 @@ -lightning-waitsendpay -- Command for sending a payment via a route -================================================================== - -SYNOPSIS --------- - -**waitsendpay** *payment\_hash* [*timeout*] [*partid* *groupid*] - -DESCRIPTION ------------ - -The **waitsendpay** RPC command polls or waits for the status of an outgoing payment that was initiated by a previous **sendpay** invocation. - -If the payment completed with success, this command returns with success. Otherwise, if the payment completed with failure, this command returns an error. - -- **payment\_hash** (hash): The hash of the *payment\_preimage*. -- **timeout** (u32, optional): A timeout in seconds, for this RPC command to return. If the *timeout* is provided and the given amount of time passes without the payment definitely succeeding or definitely failing, this command returns with a 200 error code (payment still in progress). If *timeout* is not provided this call will wait indefinitely. Indicating a *timeout* of 0 effectively makes this call a pollable query of the status of the payment. -- **partid** (u64, optional): Unique ID within this (multi-part) payment. It must match that of the **sendpay** command. -- **groupid** (u64, optional): Grouping key to disambiguate multiple attempts to pay the same payment\_hash. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:waitsendpay#1", - "method": "waitsendpay", - "params": { - "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", - "timeout": null, - "partid": null, - "groupid": null - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **created\_index** (u64): 1-based index indicating order this payment was created in. *(added v23.11)* -- **id** (u64): Old synonym for created\_index. -- **payment\_hash** (hash): The hash of the *payment\_preimage* which will prove payment. -- **status** (string) (always "complete"): Status of the payment. -- **created\_at** (u64): The UNIX timestamp showing when this payment was initiated. -- **amount\_sent\_msat** (msat): The amount sent. -- **groupid** (u64, optional): Grouping key to disambiguate multiple attempts to pay an invoice or the same payment\_hash. -- **amount\_msat** (msat, optional): The amount delivered to destination (if known). -- **destination** (pubkey, optional): The final destination of the payment if known. -- **updated\_index** (u64, optional): 1-based index indicating order this payment was changed (only present if it has changed since creation). *(added v23.11)* -- **completed\_at** (number, optional): The UNIX timestamp showing when this payment was completed. -- **label** (string, optional): The label, if given to sendpay. -- **partid** (u64, optional): The *partid*, if given to sendpay. -- **bolt11** (string, optional): The bolt11 string (if pay supplied one). -- **bolt12** (string, optional): The bolt12 string (if supplied for pay: **experimental-offers** only). - -If **status** is "complete": - - **payment\_preimage** (secret): The proof of payment: SHA256 of this **payment\_hash**. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "created_index": 1, - "id": 1, - "payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a", - "groupid": 1, - "updated_index": 1, - "destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", - "amount_msat": 11000000, - "amount_sent_msat": 11000000, - "created_at": 1706152930, - "completed_at": 1706152933, - "status": "complete", - "payment_preimage": "af7ba559629f719c04c43a82767fe3622790a539164d6270db07f765203e574b", - "bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk" -} -``` - -ERRORS ------- - -On error, and even if the error occurred from a node other than the final destination, the route table will no longer be updated. Use the *exclude* parameter of the `getroute` command to ignore the failing route. - -- -1: Catchall nonspecific error. -- 200: Timed out before the payment could complete. -- 202: Unparseable onion reply. The *data* field of the error will have an *onionreply* field, a hex string representation of the raw onion reply. -- 203: Permanent failure at destination. The *data* field of the error will be routing failure object. -- 204: Failure along route; retry a different route. The *data* field of the error will be routing failure object. -- 208: A payment for *payment\_hash* was never made and there is nothing to wait for. -- 209: The payment already failed, but the reason for failure was not stored. This should only occur when querying failed payments on very old databases. - -A routing failure object has the fields below: - -*erring\_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on. -*erring\_node*: The hex string of the pubkey id of the node that reported the error. -*erring\_channel*: The short channel ID of the channel that has the error (or the final channel if the destination raised the error). -*erring\_direction*: The direction of traversing the *erring\_channel*: -*failcode*: The failure code, as per BOLT #4. -*failcodename*: The human-readable name corresponding to *failcode*, if known. - -AUTHOR ------- - -ZmnSCPxj <> is mainly responsible. - -SEE ALSO --------- - -lightning-sendpay(7), lightning-pay(7) - -RESOURCES ---------- - -Main web site: diff --git a/doc/lightning-withdraw.7.md b/doc/lightning-withdraw.7.md deleted file mode 100644 index a22ab6d88257..000000000000 --- a/doc/lightning-withdraw.7.md +++ /dev/null @@ -1,99 +0,0 @@ -lightning-withdraw -- Command for withdrawing funds from the internal wallet -============================================================================ - -SYNOPSIS --------- - -**withdraw** *destination* *satoshi* [*feerate*] [*minconf*] [*utxos*] - -DESCRIPTION ------------ - -The **withdraw** RPC command sends funds from Core Lightning's internal wallet to the address specified in *destination*. - -- **destination** (string): Any Bitcoin accepted type, including bech32. -- **satoshi** (msat\_or\_all): The amount to be withdrawn from the internal wallet (expressed, as name suggests, in satoshi). The string *all* can be used to specify withdrawal of all available funds (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. -- **feerate** (feerate, optional): Used for the withdrawal as initial feerate. The default is *normal*. -- **minconf** (u16, optional): Minimum number of confirmations that used outputs should have. The default is 1. -- **utxos** (array of outpoints, optional): Specifies the utxos to be used to be withdrawn from, as an array of `txid:vout`. These must be drawn from the node's available UTXO set.: - - (outpoint, optional) - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": "example:withdraw#1", - "method": "withdraw", - "params": { - "destination": "bcrt1qjc7j2l5es4haw35c9jzm8dfm763ng5djp8f0s0", - "satoshi": 555555, - "feerate": null, - "minconf": null, - "utxos": null - } -} -{ - "id": "example:withdraw#2", - "method": "withdraw", - "params": { - "destination": "bcrt1q66ukn5mdllddnp53j0mx8mjgph7uwdygn0uy45", - "satoshi": "all", - "feerate": "20000perkb", - "minconf": 0, - "utxos": [ - "218390859cf94d869e33f69161f4187a98f691afe868c20811528f589e90a61f:1" - ] - } -} -``` - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **tx** (hex): The fully signed bitcoin transaction. -- **txid** (txid): The transaction id of *tx*. -- **psbt** (string): The PSBT representing the unsigned transaction. - -EXAMPLE JSON RESPONSE ---------------------- - -```json -{ - "tx": "0200000001ef28647baa13cc4c03b8a58c8bd08b69de434c22ff591eb68171ae992e3d816d0000000000fdffffff02237a080000000000160014963d257e99856fd746982c85b3b53bf6a33451b24d6808000000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a66000000", - "txid": "ccb97d7dc695cabb78b217c0b27d7d00d2941966199480e6443e0680d24d69eb", - "psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQDeAgAAAAABAWPCRda9hy4QKqUEmtb7gK7SAqzh1xBP8nZ7PCj+7+JDAAAAAAD9////Akf0EAAAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WUs/fQpAQAAABYAFOIj6yaI/g85utJBtkPPdK1X59cfAkcwRAIgH7J57HuUTpnCbDrDqE8W7ryuCXk+i/TszQ/NF55lWncCIDeN4y+EzIDP3l2XO5/wjk98krYqnzvEhrStk+0+fTowASEC6Ng5r5KTNIXBRRvjivsd8SKnHF59r/ViDj2+CLJVb75lAAAAAQEfR/QQAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZSICA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPRzBEAiBY0urYSHLnnXaAJH7yaGfvGmm+VuNCNIBhQaJU6iDNEgIgA7EASW+V00Su+lRQAE3Qbe4wavLq7l6Jn2vR+6Snyd0BIgYD10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8IAfrZCgAAAAABDiDvKGR7qhPMTAO4pYyL0Itp3kNMIv9ZHraBca6ZLj2BbQEPBAAAAAABEAT9////AAEDCCN6CAAAAAAAAQQWABSWPSV+mYVv10aYLIWztTv2ozRRsgz8CWxpZ2h0bmluZwQCAAEAAQMITWgIAAAAAAABBCJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aIQeRRTKBKkQKTXZscc05GTaUo0CuEeAS5boa2e+6bnbKUwkAwsyrFwIAAAAA" -} -{ - "tx": "02000000011fa6909e588f521108c268e8af91f6987a18f46191f6339e864df99c859083210100000000fdffffff0158070f0000000000160014d6b969d36dffdad9869193f663ee480dfdc7348867000000", - "txid": "ad9a712a201214c68c39ca5be68c9d153d1cac91e540d88aa3207b241e23acf8", - "psbt": "cHNidP8BAgQCAAAAAQMEZwAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQD9ZQECAAAAAAEBVa+m1d1amChv4Dwq1rVoS4KSm0BUUnVa3fUYcB3dH9oAAAAAAP////8CECcAAAAAAAAiUSBXeaBg8gDUDo+HGkDrkWFMxb+m0KX4UuBTQAp/7/hhUOEPDwAAAAAAIlEg7tdFgE2peEzCA/Vj76mf+lT98BsTe8lk5jwxJAcP++YEAEcwRAIgPsWO/4IxeW6OclDdXVnwL99X7B18sRlxgFqyvUAzN7gCIGOQOq0wZ6bV+wdYQP+9sH8IkfmqWZbQRRDkZEgfcprMAUcwRAIgb5/dI4+uVhluQjSA2q/3oAGxZd4vYzQWexfmcRQML7ECIFfgRwCaHYdyu5/H5moOPlfQlLc2gPgB6bgtfNSfRA6jAUdSIQIyQmbehAOzqxV6CfH3hNWHr2GDHJmMFRvMIbt0wrIxSyEC4704AJhmydqOxKqZzE6pxsDdRt8Vxh7wzh8nEpFxTldSrgAAAAABASvhDw8AAAAAACJRIO7XRYBNqXhMwgP1Y++pn/pU/fAbE3vJZOY8MSQHD/vmAQ4gH6aQnliPUhEIwmjor5H2mHoY9GGR9jOehk35nIWQgyEBDwQBAAAAARAE/f///wETQL0MqyYsx9Z9q14BhByMgWLW4oJHOqED5qcZ3wyJ4eDuLYfNGq6Ck30dAqFzJL4VhZLSuv87zN/1AEDNMl2DmTohFl03KAgp8YbLmVzcy/I4q0VkATk5c1E5YySjZXXfNN3/CQAHHEnKAAAAAAAiAgK5wMaEThKlMclo5VxVB47BbZv3a+kpD9h9HMpytIOaFwjWuWnTBAAAAAEDCFgHDwAAAAAAAQQWABTWuWnTbf/a2YaRk/Zj7kgN/cc0iAz8CWxpZ2h0bmluZwQCAAEA" -} -``` - -ERRORS ------- - -On failure, an error is reported and the withdrawal transaction is not created. - -- -1: Catchall nonspecific error. -- 301: There are not enough funds in the internal wallet (including fees) to create the transaction. -- 302: The dust limit is not met. -- 313: The `min-emergency-msat` reserve not be preserved (and we have anchor channels). - -AUTHOR ------- - -Felix <> is mainly responsible. - -SEE ALSO --------- - -lightning-listfunds(7), lightning-fundchannel(7), lightning-newaddr(7), lightning-txprepare(7), lightning-feerates(7) - -RESOURCES ---------- - -Main web site: