diff --git a/.gitignore b/.gitignore index 8d2e96ec68db..43c98466b366 100644 --- a/.gitignore +++ b/.gitignore @@ -57,6 +57,8 @@ 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/.msggen.json b/.msggen.json index c6265fc81be4..e90db8050c3e 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 @@ -334,6 +340,9 @@ "complete": 1, "pending": 0 }, + "StopResult": { + "Shutdown complete": 0 + }, "WaitIndexname": { "created": 0, "deleted": 2, @@ -490,6 +499,9 @@ "DatastoreUsage.datastoreusage.key": 1, "DatastoreUsage.datastoreusage.total_bytes": 2 }, + "DatastoreusageRequest": { + "DatastoreUsage.key": 1 + }, "DatastoreusageResponse": { "DatastoreUsage.datastoreusage": 1 }, @@ -1206,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, @@ -1406,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, @@ -1563,6 +1577,7 @@ "SendonionRequest": { "SendOnion.amount_msat": 12, "SendOnion.bolt11": 7, + "SendOnion.description": 14, "SendOnion.destination": 9, "SendOnion.first_hop": 2, "SendOnion.groupid": 11, @@ -1595,6 +1610,7 @@ "SendpayRequest": { "SendPay.amount_msat": 10, "SendPay.bolt11": 5, + "SendPay.description": 13, "SendPay.groupid": 9, "SendPay.label": 3, "SendPay.localinvreqid": 11, @@ -1602,6 +1618,7 @@ "SendPay.msatoshi": 4, "SendPay.partid": 7, "SendPay.payment_hash": 2, + "SendPay.payment_metadata": 12, "SendPay.payment_secret": 6, "SendPay.route[]": 1 }, @@ -1687,6 +1704,9 @@ "StaticbackupResponse": { "StaticBackup.scb[]": 1 }, + "StopResponse": { + "Stop.result": 1 + }, "TxdiscardRequest": { "TxDiscard.txid": 1 }, @@ -2198,6 +2218,10 @@ "added": "v23.11", "deprecated": false }, + "DatastoreUsage.key": { + "added": "v23.11", + "deprecated": false + }, "Decode": { "added": "v23.05", "deprecated": null @@ -4678,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 @@ -5226,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 @@ -5658,6 +5690,10 @@ "added": "v23.11", "deprecated": false }, + "SendOnion.description": { + "added": "v0.11.0", + "deprecated": false + }, "SendOnion.destination": { "added": "pre-v0.10.1", "deprecated": false @@ -5758,6 +5794,10 @@ "added": "v23.11", "deprecated": false }, + "SendPay.description": { + "added": "v0.11.0", + "deprecated": false + }, "SendPay.destination": { "added": "pre-v0.10.1", "deprecated": false @@ -5790,6 +5830,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 @@ -5982,6 +6026,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/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/cln-grpc/proto/node.proto b/cln-grpc/proto/node.proto index b8dba61dd5c7..1f923bfe6d52 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 { @@ -543,6 +552,7 @@ message DatastoreResponse { } message DatastoreusageRequest { + repeated string key = 1; } message DatastoreusageResponse { @@ -625,8 +635,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 +734,7 @@ message SendonionRequest { optional bytes destination = 9; optional bytes localinvreqid = 13; optional uint64 groupid = 11; + optional string description = 14; } message SendonionResponse { @@ -801,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; } @@ -1011,7 +1023,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 +1095,7 @@ message FundpsbtReservations { message SendpsbtRequest { string psbt = 1; - optional bool reserve = 2; + optional uint32 reserve = 2; } message SendpsbtResponse { @@ -1101,7 +1113,7 @@ message SignpsbtResponse { } message UtxopsbtRequest { - Amount satoshi = 1; + AmountOrAll satoshi = 1; Feerate feerate = 2; uint32 startweight = 3; repeated Outpoint utxos = 4; @@ -1190,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; @@ -1829,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; } @@ -1951,6 +1964,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..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 @@ -1825,6 +1827,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), } } } @@ -1896,7 +1899,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), } } } @@ -1914,10 +1917,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 } } } @@ -1933,9 +1936,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? } } } @@ -2037,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 } } } @@ -2100,8 +2107,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 @@ -2164,6 +2171,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? } } } @@ -2265,7 +2273,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[] @@ -2314,7 +2322,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? } } } @@ -2334,7 +2342,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[] @@ -2550,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? } } @@ -2692,7 +2700,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()), } } } @@ -2710,10 +2718,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 } } } @@ -2728,9 +2736,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? } } } @@ -2830,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 } } } @@ -2891,8 +2902,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? @@ -2952,6 +2963,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? } } } @@ -3052,7 +3064,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 @@ -3100,7 +3112,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? } } } @@ -3119,7 +3131,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 @@ -3329,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 4dd6f404e0a3..e9a02ba35534 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 { @@ -471,6 +512,7 @@ pub mod requests { "createinvoice" } } + /// ['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")] @@ -543,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 { @@ -642,6 +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!'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum DelinvoiceStatus { #[serde(rename = "paid")] @@ -703,8 +748,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 +802,7 @@ pub mod requests { "listdatastore" } } + /// ['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")] @@ -848,6 +894,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 +915,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 +948,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")] @@ -1123,6 +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.'] #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub enum NewaddrAddresstype { #[serde(rename = "bech32")] @@ -1181,8 +1232,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 +1337,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 +1383,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 +1606,7 @@ pub mod requests { "disconnect" } } + /// ['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")] @@ -1722,6 +1773,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 +1810,7 @@ pub mod requests { } } + /// ['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")] @@ -1844,6 +1897,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")] @@ -1945,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, } @@ -2118,6 +2172,7 @@ pub mod requests { "waitblockheight" } } + /// ['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")] @@ -2150,6 +2205,7 @@ pub mod requests { } } + /// ['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")] @@ -2345,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")] @@ -2396,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")] @@ -2560,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")] @@ -2671,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")] @@ -2938,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")] @@ -3101,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")] @@ -3156,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")] @@ -3185,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")] @@ -3259,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")] @@ -3444,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")] @@ -3571,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")] @@ -3663,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")] @@ -3733,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")] @@ -3794,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, @@ -3858,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")] @@ -3918,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")] @@ -4000,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")] @@ -4078,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")] @@ -4156,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")] @@ -4261,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")] @@ -4463,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")] @@ -4624,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")] @@ -4680,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, @@ -4810,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")] @@ -4911,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")] @@ -5006,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")] @@ -5414,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")] @@ -5434,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")] @@ -5486,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")] @@ -5523,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")] @@ -5620,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")] @@ -5699,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")] @@ -5815,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, @@ -5951,8 +6011,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/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/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 cacad7b088c2..108dc6d7864d 100644 --- a/contrib/msggen/msggen/schema.json +++ b/contrib/msggen/msggen/schema.json @@ -1,16818 +1,31847 @@ { - "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" - }, - "locktime": { - "type": "u32" + "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 + } }, - "initialpsbt": { - "type": "string", - "description": "the (optional) base 64 encoded PSBT to begin with. If not specified, one will be generated automatically" + { + "id": "example:addpsbtoutput#2", + "method": "addpsbtoutput", + "params": { + "satoshi": 1000000, + "initialpsbt": null, + "locktime": 111, + "destination": null + } }, - "destination": { - "type": "string" + { + "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" - }, - "age": { - "type": "u64", - "description": "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" - } - } - }, - "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": { + }, + "response": { + "required": [ + "autoclean" + ], + "properties": { + "autoclean": { + "type": "object", + "additionalProperties": false, + "properties": { + "succeededforwards": { + "type": "object", + "additionalProperties": false, + "required": [ + "cleaned", + "uncleaned" + ], "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": { + "failedforwards": { + "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": { + "succeededpays": { + "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": { + "failedpays": { + "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": { + "paidinvoices": { + "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": { + "expiredinvoices": { + "type": "object", "additionalProperties": false, "required": [ - "enabled", - "age", - "cleaned" + "cleaned", + "uncleaned" ], "properties": { - "enabled": {}, - "cleaned": {}, - "age": { + "cleaned": { "type": "u64", - "description": "age (in seconds) to delete successful listpays/listsendpays" + "description": [ + "Total number of deletions done this run." + ] + }, + "uncleaned": { + "type": "u64", + "description": [ + "The total number of entries *not* deleted this run." + ] } } - }, - "else": { - "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", "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 + "description": [ + "Whether autocleaning is enabled for successful listforwards." ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "enabled", - "age", - "cleaned" - ], - "properties": { - "enabled": {}, - "cleaned": {}, - "age": { + }, + "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)." ] } - } - }, - "then": { - "additionalProperties": false, + }, + "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", - "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" + "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 + } } - } - }, - "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" - } - }, - "if": { - "properties": { - "enabled": { - "type": "boolean", - "enum": [ - true - ] + "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 + } } } - }, - "then": { - "additionalProperties": false, - "required": [ - "expired_by", - "cycle_seconds" - ], + ], + "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": { - "enabled": {}, "expired_by": { "type": "u64", - "description": "how long an invoice must be expired (seconds) before we delete it" + "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" + "description": [ + "The interval (in seconds) between cleaning expired invoices." + ] } } }, - "else": { - "additionalProperties": false, + "response": { + "required": [ + "enabled" + ], "properties": { - "enabled": {} + "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 + } } - } - }, - "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" + "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: " + ] }, - "batching.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-batching.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "properties": {} + "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: " + ] }, - "bkpr-channelsapy.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-bkpr-channelsapy.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "channels_apy" + "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." ], - "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" + "request": { + "required": [], + "properties": { + "start_time": { + "type": "u64", + "description": [ + "UNIX timestamp (in seconds) to filter events after the provided timestamp." ], - "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" + "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." + ] + } } } } } - } - }, - "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" + }, + "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: " + ] }, - "bkpr-inspect.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-bkpr-dumpincomecsv.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "txs" + "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": { - "txs": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "txid", - "fees_paid_msat", - "outputs" + "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." ], - "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": {} - } - } - } - ] - } - } - } + "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: " + ] }, - "bkpr-listaccountevents.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-bkpr-inspect.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "events" + "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": { - "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" - ] - } - } + "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." + ] }, - "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" - ] - } - } + "blockheight": { + "type": "u32", + "description": [ + "Blockheight of transaction." + ] }, - "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" - ] - } - } + "fees_paid_msat": { + "type": "msat", + "description": [ + "Amount paid in sats for this tx." + ] }, - "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." + "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." + ] + } }, - "part_id": { - "type": "u32", - "description": "Counter for multi-part payments" - } - }, - "additionalProperties": false + "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: " + ] }, - "bkpr-listbalances.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-bkpr-listaccountevents.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "accounts" + "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": { - "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": { + "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", - "balances", - "peer_id", - "we_opened", - "account_closed", - "account_resolved" + "type", + "tag", + "credit_msat", + "debit_msat", + "currency", + "timestamp" ], - "additionalProperties": false, "properties": { - "account": {}, - "balances": {}, - "peer_id": { - "type": "pubkey", - "description": "Node id for the peer this account is with" + "account": { + "type": "string", + "description": [ + "The account name. If the account is a channel, the channel_id." + ] }, - "we_opened": { - "type": "boolean", - "description": "Did we initiate this account open (open the channel)" + "type": { + "type": "string", + "enum": [ + "onchain_fee", + "chain", + "channel" + ], + "description": [ + "Coin movement type." + ] }, - "account_closed": { - "type": "boolean", - "description": "" + "tag": { + "type": "string", + "description": [ + "Description of movement." + ] }, - "account_resolved": { - "type": "boolean", - "description": "Has this channel been closed and all outputs resolved?" + "credit_msat": { + "type": "msat", + "description": [ + "Amount credited." + ] }, - "resolved_at_block": { + "debit_msat": { + "type": "msat", + "description": [ + "Amount debited." + ] + }, + "currency": { + "type": "string", + "description": [ + "Human-readable bech32 part for this coin type." + ] + }, + "timestamp": { "type": "u32", - "description": "Blockheight account resolved on chain" + "description": [ + "Timestamp this event was recorded by the node. For consolidated events such as onchain_fees, the most recent timestamp." + ] } - } - }, - "else": { - "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": "A brief description about consolidate_fees" - }, - "start_time": { - "type": "u32", - "description": "Filters the events after the time" - }, - "end_time": { - "type": "u32", - "description": "Filters the events up to the timestamp" - } - } - }, - "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." - } + "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 + } + } + ] } } } - } - }, - "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: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" + } + ] }, - "end": { - "type": "u64", - "description": "final rune unique id to blacklist (defaults to start)" + { + "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: " + ] }, - "blacklistrune.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-bkpr-listbalances.json": { + "$schema": "../rpc-schema-draft.json", "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" + "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." + ] + } + } + } + } }, - "end": { - "type": "u64", - "description": "Unique id of last rune in this blacklist range" + "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 } } } } - } - }, - "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" - } }, - "required": [ - "command_to_check" - ] - }, - "checkmessage.request.json": { - "$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." - } - } - }, - "checkmessage.schema.json": { - "$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" + "example_json_request": [ + { + "id": "example:bkpr-listbalances#1", + "method": "bkpr-listbalances", + "params": "{}" } - } - }, - "checkrune.request.json": { - "$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" - }, + "example_json_response": [ + { + "accounts": [ { - "type": "object", - "description": "parameters for method" + "account": "wallet", + "balances": [ + { + "balance_msat": 2222222000, + "coin_type": "bcrt" + } + ] } ] } - } - }, - "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-listfunds(7)", + "lightning-bkpr-listaccountevents(7)", + "lightning-bkpr-channelsapy(7)", + "lightning-listpeers(7)" + ], + "resources": [ + "Main web site: " + ] }, - "close.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-bkpr-listincome.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "id" + "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." ], - "properties": { - "id": { - "type": "string", - "description": "peer id, channel id or short_channel_id" - }, - "unilateraltimeout": { - "type": "u32", - "description": "" - }, - "destination": { - "type": "string", - "description": "" - }, - "fee_negotiation_step": { - "type": "string", - "description": "" - }, - "wrong_funding": { - "type": "outpoint", - "description": "" - }, - "force_lease_closed": { - "type": "boolean", - "description": "" - }, - "feerange": { - "type": "array", - "items": { - "type": "feerate" - }, - "description": "" - } - } - }, - "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": [], "properties": { - "type": { - "type": "string", - "enum": [ - "mutual", - "unilateral" - ] + "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" } } }, - "then": { - "additionalProperties": false, + "response": { "required": [ - "tx", - "txid" + "income_events" ], "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" + "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." + ] + } + } + } } } }, - "else": { - "additionalProperties": false, - "properties": { - "type": {} + "example_json_request": [ + { + "id": "example:bkpr-listincome#1", + "method": "bkpr-listincome", + "params": "{}" + }, + { + "id": "example:bkpr-listincome#2", + "method": "bkpr-listincome", + "params": { + "consolidate_fees": false + } } - } - }, - "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" + "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" + } + ] }, - "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" - } + { + "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" } - } + ] } - } - }, - "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-listaccountevents(7)", + "lightning-listfunds(7)", + "lightning-bkpr-listbalances(7)" + ], + "resources": [ + "Main web site: " + ] }, - "commando-listrunes.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-blacklistrune.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "runes" + "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." ], - "properties": { - "runes": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "rune", - "unique_id", - "restrictions", - "restrictions_as_english" + "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." ], - "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" - } - } + "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." + ] } - }, - "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)" } } } } - } - }, - "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" + }, + "example_json_request": [ + { + "id": "example:blacklistrune#1", + "method": "blacklistrune", + "params": { + "start": 2 + } }, - "restrictions": { - "oneOf": [ - { - "type": "array", - "description": "array of restrictions to add to rune", - "items": { - "type": "array", - "items": { - "type": "string" - } - } - }, + { + "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": [ { - "type": "string", - "enum": [ - "readonly" - ], - "description": "readonly string to indicate standard readonly restrictions." + "start": 2, + "end": 2 } ] - } - } - }, - "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": [ + { + "blacklist": [ { - "type": "array", - "description": "array of positional parameters" + "start": 2, + "end": 2 }, { - "type": "object", - "description": "parameters for method" + "start": 5, + "end": 7 } ] }, - "rune": { - "type": "string", - "description": "rune to authorize the command" - }, - "filter": { - "type": "object", - "additionalProperties": true, - "description": "filter to peer to apply to any successful result" + { + "blacklist": [ + { + "start": 2, + "end": 7 + } + ] } - } + ], + "author": [ + "Shahana Farooqui <> is mainly responsible." + ], + "see_also": [ + "lightning-commando-blacklist(7)", + "lightning-showrunes(7)" + ], + "resources": [ + "Main web site: " + ] }, - "connect.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-check.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "id" + "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." ], - "properties": { - "id": { - "type": "string", - "description": "" - }, - "host": { - "type": "string", - "description": "The hostname of the node." - }, - "port": { - "type": "u16", - "description": "Port to try connecting to" + "request": { + "required": [ + "command_to_check" + ], + "properties": { + "command_to_check": { + "type": "string", + "description": [ + "Name of the relevant command." + ] + } } - } - }, - "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" + }, + "response": { + "properties": { + "command_to_check": { + "type": "string", + "description": [ + "The *command_to_check* argument." + ] + } }, - "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" - ] - } - } + "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" }, - "then": { - "additionalProperties": false, - "required": [ - "address", - "port" - ], - "properties": { - "type": {}, - "address": { - "type": "string", - "description": "address in expected format for **type**" - }, - "port": { - "type": "u16", - "description": "port number" - } - } + { + "amount_msat": 1000, + "msatoshi": 1000, + "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", + "delay": 10, + "channel": "2x2x2" } - } - ] - } - } - }, - "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": { - "type": "string", - "description": "" - }, - "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)" + ], + "payment_hash": "0000000000000000000000000000000000000000000000000000000000000000" + } }, - "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)" - } + { + "id": "example:check#2", + "method": "check", + "params": { + "command_to_check": "dev", + "subcommand": "slowcmd", + "msec": 1000 } }, - "payment_preimage": { - "type": "secret", - "description": "the proof of payment: SHA256 of this **payment_hash**" + { + "id": "example:check#3", + "method": "check", + "params": { + "command_to_check": "recover", + "hsmsecret": "6c696768746e696e672d31000000000000000000000000000000000000000000" + } + } + ], + "example_json_response": [ + { + "command_to_check": "sendpay" }, - "local_offer_id": { - "type": "hex", - "description": "the *id* of our offer which created this invoice (**experimental-offers** only).", - "maxLength": 64, - "minLength": 64 + { + "command_to_check": "dev" }, - "invreq_payer_note": { - "type": "string", - "description": "the optional *invreq_payer_note* from invoice_request which created this invoice (**experimental-offers** only)." + { + "command_to_check": "recover" } - } + ], + "author": [ + "Mark Beckwith <> and Rusty Russell <> are mainly responsible." + ], + "resources": [ + "Main web site: " + ] }, - "createonion.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-checkmessage.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "hops", - "assocdata" - ], - "properties": { - "hops": { - "type": "array", - "description": "", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "pubkey", - "payload" + "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 ], - "properties": { - "pubkey": { - "type": "pubkey" - }, - "payload": { - "type": "hex" - } - } + "description": [ + "Whether the signature was valid." + ] + }, + "pubkey": { + "type": "pubkey", + "description": [ + "The *pubkey* parameter, or the pubkey found by looking for known nodes." + ] } - }, - "assocdata": { - "type": "hex", - "description": "" - }, - "session_key": { - "type": "secret" - }, - "onion_size": { - "type": "u16" } - } - }, - "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)" + }, + "example_json_request": [ + { + "id": "example:checkmessage#1", + "method": "checkmessage", + "params": { + "message": "testcase to check new rpc error", + "zbase": "d66bqz3qsku5fxtqsi37j11pci47ydxa95iusphutggz9ezaxt56neh77kxe5hyr41kwgkncgiu94p9ecxiexgpgsz8daoq4tw8kj8yx", + "pubkey": "03be3b0e9992153b1d5a6e1623670b6c3663f72ce6cf2e0dd39c0a373a7de5a3b7" + } }, - "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" + { + "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: " + ] }, - "createrune.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-checkrune.json": { + "$schema": "../rpc-schema-draft.json", "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": { + "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", - "items": { - "type": "string" - } + "description": [ + "Array of positional parameters." + ] + }, + { + "type": "object", + "description": [ + "Parameters for method." + ] } - }, - { - "type": "string", - "enum": [ - "readonly" - ], - "description": "readonly string to indicate standard readonly restrictions." - } - ] + ] + } } - } - }, - "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" + }, + "response": { + "required": [ + "valid" + ], + "properties": { + "valid": { + "type": "boolean", + "description": [ + "True if the rune is valid." + ] + } } - } - }, - "datastore.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "key" + }, + "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." ], - "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" + "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." + ] } - ] - }, - "string": { - "type": "string", - "description": "" - }, - "hex": { - "type": "hex", - "description": "" + } }, - "mode": { - "type": "string", - "enum": [ - "must-create", - "must-replace", - "create-or-replace", - "must-append", - "create-or-append" - ], - "description": "" + { + "id": "example:checkrune#2", + "method": "checkrune", + "params": { + "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518", + "rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==", + "method": "listpeers", + "params": {} + } }, - "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." + { + "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" + } + } } - } - }, - "datastore.schema.json": { - "$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" + "example_json_response": [ + { + "valid": true }, - "hex": { - "type": "hex", - "description": "The hex data which has been added to the datastore" + { + "valid": true }, - "string": { - "type": "string", - "description": "The data as a string, if it's valid utf-8" + { + "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: " + ] }, - "datastoreusage.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-close.json": { + "$schema": "../rpc-schema-draft.json", "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." + "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." + ] + } + } }, - "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." + "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: " + ] }, - "decode.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-commando-blacklist.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, "added": "v23.05", - "required": [ - "string" + "deprecated": [ + "v23.08", + "v24.08" ], - "properties": { - "string": { - "type": "string" - } - } - }, - "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" + "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)." + ] + } }, - "valid": { - "type": "boolean", - "description": "if this is false, you *MUST* not use the result except for diagnostics!" + "dependentUpon": { + "start": [ + "end" + ] } }, - "allOf": [ - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 offer" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "required": [ - "offer_id", - "offer_node_id", - "offer_description" + "response": { + "required": [ + "blacklist" + ], + "properties": { + "blacklist": { + "type": "array", + "description": [ + "The resulting blacklist ranges after the command." ], - "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" - } - } + "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 + } }, { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 offer" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - false - ] - } + "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 } - }, - "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" - } + ] + }, + { + "blacklist": [ + { + "start": 2, + "end": 2 + }, + { + "start": 5, + "end": 7 } - } + ] }, { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 invoice_request" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - true - ] - } + "blacklist": [ + { + "start": 2, + "end": 7 } - }, - "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" + ] + } + ], + "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." ], - "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": { + "items": { "type": "object", - "description": "when within a period will payment be accepted (default is prior and during the period)", + "additionalProperties": false, "required": [ - "seconds_before", - "seconds_after" + "alternatives", + "english" ], - "additionalProperties": false, "properties": { - "seconds_before": { - "type": "u32", - "description": "seconds prior to period start" - }, - "seconds_after": { - "type": "u32", - "description": "seconds after to period start" + "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." + ] + } + } + } }, - "proportional_amount": { - "type": "boolean", - "enum": [ - true - ], - "description": "amount should be scaled if payed after period start" + "english": { + "type": "string", + "description": [ + "English readable summary of alternatives above." + ] } } } - } - }, - "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" + }, + "restrictions_as_english": { + "type": "string", + "description": [ + "English readable description of the restrictions array above." + ] + }, + "stored": { + "type": "boolean", + "enum": [ + false ], - "additionalProperties": false, - "properties": { - "type": { - "type": "u64", - "description": "The type" - }, - "length": { - "type": "u64", - "description": "The length" - }, - "value": { - "type": "hex", - "description": "The value" - } - } + "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": "{}" }, { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 invoice_request" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - false - ] - } + "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." + ] }, - "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" + "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" + } + } }, - "warning_invalid_invoice_request_signature": { + { "type": "string", - "description": "Incorrect `signature`" + "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" } }, { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 invoice" + "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." ] }, - "valid": { - "type": "boolean", - "enum": [ - true + { + "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." + ] }, - "then": { + "address": { + "type": "object", + "description": [ + "Address information (mainly useful if **direction** is *out*)." + ], + "additionalProperties": true, "required": [ - "offer_node_id", - "offer_description", - "invreq_metadata", - "invreq_payer_id", - "invoice_paths", - "invoice_created_at", - "invoice_payment_hash", - "invoice_amount_msat", - "signature" + "type" ], - "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": { "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" + "enum": [ + "local socket", + "ipv4", + "ipv6", + "torv2", + "torv3" ], - "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" - } + "description": [ + "Type of connection (*torv2*/*torv3* only if **direction** is *out*)." + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "local socket" + ] } } - } - }, - "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", + }, + "then": { + "additionalProperties": false, "required": [ - "first_node_id", - "blinding", - "payinfo", - "path" + "socket" ], - "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" - } - } - } + "type": {}, + "socket": { + "type": "string", + "description": [ + "Socket filename." + ] } } } }, - "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, + { + "if": { "properties": { - "version": { - "type": "u8", - "description": "Segwit address version" - }, - "hex": { - "type": "hex", - "description": "Raw encoded segwit address" - }, - "address": { + "type": { "type": "string", - "description": "bech32 segwit address" + "enum": [ + "ipv4", + "ipv6", + "torv2", + "torv3" + ] } } - } - }, - "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", + }, + "then": { + "additionalProperties": false, "required": [ - "type", - "length", - "value" + "address", + "port" ], - "additionalProperties": false, "properties": { - "type": { - "type": "u64", - "description": "The type" - }, - "length": { - "type": "u64", - "description": "The length" + "type": {}, + "address": { + "type": "string", + "description": [ + "Address in expected format for **type**." + ] }, - "value": { - "type": "hex", - "description": "The value" + "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 } }, { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "bolt12 invoice" - ] + "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" }, - "valid": { - "type": "boolean", - "enum": [ - false - ] + { + "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." + ] }, - "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" - } - } - } - } - } + "preimage": { + "type": "hex", + "description": [ + "The preimage to supply upon successful payment of the invoice." + ] } - }, - { - "if": { + } + }, + "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": { - "type": { - "type": "string", - "enum": [ - "bolt11 invoice" + "txid": { + "added": "v23.11", + "type": "txid", + "description": [ + "ID of the transaction that paid the invoice (**status** *paid* only)." ] }, - "valid": { - "type": "boolean", - "enum": [ - true + "outnum": { + "added": "v23.11", + "type": "u32", + "description": [ + "The 0-based output number of the transaction that paid the invoice (**status** *paid* only)." ] } } }, - "then": { - "required": [ - "currency", - "created_at", - "expiry", - "payee", - "min_final_cltv_expiry", - "payment_hash", - "signature" + "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)." ], - "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" + "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" }, - "payment_secret": { - "type": "secret", - "description": "the secret to hand to the payee node" + { + "pubkey": "0324653eac434488002cc06bbfb7f10fe18991e35f9fe4302dbea6d2353dc0ab1c", + "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" }, - "features": { - "type": "hex", - "description": "the features bitmap for this invoice" + { + "pubkey": "027f31ebc5462c1fdce1b737ecff52d37d75dea43ce11c74d25aa297165faa2007", + "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" }, - "payment_metadata": { - "type": "hex", - "description": "the payment_metadata to put in the payment" + { + "pubkey": "032c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991", + "payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" }, - "fallbacks": { + { + "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": "onchain addresses", + "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": "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" - } + "type": "array", + "items": { + "type": "string" } } }, - "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 + "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." + ] }, - "then": { - "required": [ - "string", - "restrictions", - "valid" + "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." ], - "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": { + "oneOf": [ + { "type": "array", - "description": "restrictions built into the rune: all must pass", + "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": "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" - } - } + "type": "string" } - } - } - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "rune" - ] }, - "valid": { - "type": "boolean", - "enum": [ - false - ] + { + "type": "string" } - } + ] }, - "then": { - "required": [ - "valid" + "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." ], - "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" - } + "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 } }, { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "emergency recover" - ] - }, - "valid": { - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "then": { - "required": [ - "decrypted" + "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" ], - "additionalProperties": false, - "properties": { - "type": {}, - "valid": {}, - "decrypted": { - "type": "hex", - "description": "The decrypted value of the provided bech32 of emergency.recover", - "added": "v23.11" - } - } + "string": "somedatatostoreinthedatastore", + "hex": null, + "mode": null, + "generation": null } } - ] - }, - "decodepay.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "added": "v23.05", - "required": [ - "bolt11" ], - "properties": { - "bolt11": { - "type": "string" + "example_json_response": [ + { + "key": [ + "test_libplugin", + "name" + ], + "generation": 1, + "hex": "666f6f626172", + "string": "foobar" }, - "description": { - "type": "string" + { + "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: " + ] }, - "decodepay.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-datastoreusage.json": { + "$schema": "../rpc-schema-draft.json", "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" + "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" } - } + ] } - }, - "extra": { - "type": "array", - "description": "Any extra fields we didn't know how to parse", - "items": { + } + }, + "response": { + "required": [ + "datastoreusage" + ], + "properties": { + "datastoreusage": { "type": "object", + "additionalProperties": false, "required": [ - "tag", - "data" + "key", + "total_bytes" ], - "additionalProperties": false, "properties": { - "tag": { + "key": { "type": "string", - "description": "The bech32 letter which identifies this field", - "maxLength": 1, - "minLength": 1 + "added": "v23.11", + "description": [ + "The key from which the database was traversed." + ] }, - "data": { - "type": "string", - "description": "The bech32 data for this field" + "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." + ] } } } } - } - }, - "deldatastore.request.json": { - "$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 \u201cmust-replace\u201d or \u201cmust-append\u201d." - } - } - }, - "deldatastore.schema.json": { - "$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" + }, + "example_json_request": [ + { + "id": "example:datastoreusage#1", + "method": "datastoreusage", + "params": { + "key": null } }, - "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" - } - } - }, - "delexpiredinvoice.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "maxexpirytime": { - "type": "u64", - "description": "" - } - } - }, - "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": [], - "properties": { - "in_channel": { - "type": "short_channel_id" - }, - "in_htlc_id": { - "type": "u64" - }, - "status": { - "type": "string", - "enum": [ - "settled", - "local_failed", - "failed" - ] - } - } - }, - "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": [ - { - "type": "string", - "description": "" - }, - { - "type": "integer", - "description": "" - } - ] - }, - "status": { - "type": "string", - "enum": [ - "paid", - "expired", - "unpaid" - ] + { + "id": "example:datastoreusage#2", + "method": "datastoreusage", + "params": { + "key": "a" + } }, - "desconly": { - "type": "boolean" + { + "id": "example:datastoreusage#3", + "method": "datastoreusage", + "params": { + "key": [ + "a", + "thisissomelongkeythattriestostore46bytesofdata" + ] + } } - } - }, - "delinvoice.schema.json": { - "$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" - ] + "example_json_response": [ + { + "datastoreusage": { + "key": "[]", + "total_bytes": 0 + } }, - "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": {} - } + "datastoreusage": { + "key": "[a]", + "total_bytes": 32 } }, { - "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": {} - } + "datastoreusage": { + "key": "[a,thisissomelongkeythattriestostore46bytesofdata]", + "total_bytes": 77 } } - ] - }, - "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 hash of the *payment_preimage* which will prove payment" - }, - "status": { - "type": "string", - "enum": [ - "complete", - "failed" - ] - }, - "partid": { - "type": "u64" - }, - "groupid": { - "type": "u64" - } - } - }, - "delpay.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "payments" + "author": [ + "Peter Neuroth <> is mainly responsible." ], - "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, - "required": [ - "invreq_id" + "see_also": [ + "lightning-datastore(7)", + "lightning-deldatastore(7)", + "lightning-listdatastore(7)" ], - "properties": { - "invreq_id": { - "type": "string", - "description": "" - } - } + "resources": [ + "Main web site: " + ] }, - "disableinvoicerequest.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-decode.json": { + "$schema": "../rpc-schema-draft.json", "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" - } - } - }, - "disableoffer.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "offer_id", - "active", - "single_use", - "bolt12", - "used" + "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." ], - "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" - } - } - }, - "disconnect.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "id" - ], - "properties": { - "id": { - "type": "pubkey" - }, - "force": { - "type": "boolean" - } - } - }, - "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": {} - }, - "emergencyrecover.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "stubs" - ], - "properties": { - "stubs": { - "type": "array", - "items": { + "request": { + "required": [ + "string" + ], + "properties": { + "string": { "type": "string", - "description": "Channel IDs of channels successfully inserted." + "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`." + ] } } - } - }, - "feerates.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "style" - ], - "properties": { - "style": { - "type": "string", - "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" + }, + "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!" + ] + } }, - "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)" - } + "allOf": [ + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt12 offer" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + true + ] } } }, - "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" + "then": { + "required": [ + "offer_id", + "offer_node_id", + "offer_description" ], - "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)" + "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." + ] + } + } } } } - }, - "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)" - } - } - } - } - }, - "fetchinvoice.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "offer" - ], - "additionalProperties": false, - "properties": { - "offer": { - "type": "string", - "description": "" - }, - "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)." - }, - "quantity": { - "type": "u64", - "description": "quantity is is 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." - }, - "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." - }, - "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." - }, - "timeout": { - "type": "number", - "description": "timeout is an optional timeout; 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." - } - } - }, - "fetchinvoice.schema.json": { - "$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" } - } - } - } - }, - "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" - }, - "feerate": { - "type": "feerate" - }, - "announce": { - "type": "boolean" - }, - "minconf": { - "type": "u32" - }, - "push_msat": { - "type": "msat" - }, - "close_to": { - "type": "string" - }, - "request_amt": { - "type": "msat" - }, - "compact_lease": { - "type": "string" - }, - "utxos": { - "type": "array", - "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" - }, - "channel_type": { - "added": "v24.02", - "type": "array", - "items": { - "type": "u32" - } - } - } - }, - "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" + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt12 offer" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + false + ] + } } }, - "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": { + "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." + ] + } } } - } - }, - "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" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "the 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" - ], - "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": "id is the 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)" - } - } - }, - "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 - }, - "commitments_secured": { - "type": "boolean", - "enum": [ - true - ], - "description": "Indication that channel is safe to use" - } - } - }, - "fundchannel_start.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 that the channel will be funded." - }, - "feerate": { - "type": "feerate", - "description": "Sets the feerate for the subsequent commitment transaction." - }, - "announce": { - "type": "boolean", - "description": "Whether or not to announce the channel." - }, - "close_to": { - "type": "string", - "description": "A bitcoin address to which the channel funds should be sent to on close." - }, - "push_msat": { - "type": "msat", - "description": "The amount of millisatoshis to push to the channel at open. This is a gift to the peer." - }, - "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" - } - } - } - }, - "fundchannel_start.schema.json": { - "$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." - } - } - }, - "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" - }, - "feerate": { - "type": "feerate" - }, - "startweight": { - "type": "u32" - }, - "minconf": { - "type": "u32" - }, - "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)." - }, - "locktime": { - "type": "u32" - }, - "min_witness_weight": { - "type": "u32" - }, - "excess_as_change": { - "type": "boolean" - }, - "nonwrapped": { - "added": "v23.02", - "type": "boolean" - }, - "opening_anchor_channel": { - "added": "v23.08", - "type": "boolean" - } - } - }, - "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" - }, - "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" - } - } - } - } - } - }, - "getinfo.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": {} - }, - "getinfo.schema.json": { - "$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" - ] - } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt12 invoice_request" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + true + ] + } } }, "then": { "required": [ - "type", - "address", - "port" - ], - "additionalProperties": false, - "properties": { - "type": {}, - "port": {}, - "address": { - "type": "string", - "description": "address in expected format for **type**" - } - } - }, - "else": { - "required": [ - "type", - "port" + "offer_node_id", + "offer_description", + "invreq_metadata", + "invreq_payer_id", + "signature" ], "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" - ] - } - } + "valid": {}, + "offer_id": { + "type": "hex", + "description": [ + "The id we use to identify this offer." + ], + "maxLength": 64, + "minLength": 64 }, - "then": { - "additionalProperties": false, - "required": [ - "type", - "socket" + "offer_chains": { + "type": "array", + "description": [ + "Which blockchains this offer is for (missing implies bitcoin mainnet only)." ], - "properties": { - "type": {}, - "socket": { - "type": "string", - "description": "socket filename" - } + "items": { + "type": "hex", + "description": [ + "The genesis blockhash." + ], + "maxLength": 64, + "minLength": 64 } }, - "else": { - "additionalProperties": false, - "required": [ - "type", - "address", - "port" + "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)." ], - "properties": { - "type": {}, - "address": {}, - "port": {}, - "subtype": {} - } - } - }, - { - "if": { - "properties": { - "type": { - "type": "string", - "enum": [ - "websocket" - ] + "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." + ] + } + } + } + } } } }, - "then": { - "additionalProperties": false, + "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": [ - "type", - "address", - "port", - "subtype" + "period", + "time_unit" ], + "additionalProperties": false, "properties": { - "type": {}, - "address": {}, - "port": {}, - "subtype": { + "time_unit": { + "type": "u32", + "description": [ + "The BOLT12 time unit." + ] + }, + "time_unit_name": { "type": "string", - "description": "type of address" + "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." + ] + } + } } } }, - "else": { - "additionalProperties": false, - "required": [ - "type" - ], - "properties": { - "type": {}, - "address": {}, - "port": {}, - "socket": {} + "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." + ] + } + } } } } - ] - } - }, - "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." - } - } - }, - "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" - }, - "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" - ] + } + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt12 invoice_request" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + false + ] + } } }, - "allOf": [ - { - "if": { - "additionalProperties": true, - "properties": { - "type": { - "enum": [ - "SKIPPED" - ] - } - } + "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." + ] }, - "then": { - "additionalProperties": false, - "required": [ - "num_skipped" + "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." ], - "properties": { - "type": {}, - "num_skipped": { - "type": "u32", - "description": "number of unprinted log entries (deleted or below *level* parameter)" - } + "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 } - } - }, - { - "if": { - "additionalProperties": true, - "properties": { - "type": { - "enum": [ - "BROKEN", - "UNUSUAL", - "INFO", - "DEBUG" - ] + }, + "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." + ] + } + } + } + } } } }, - "then": { - "additionalProperties": false, + "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": [ - "time", - "source", - "log" + "period", + "time_unit" ], + "additionalProperties": false, "properties": { - "type": {}, - "time": { - "type": "string", - "description": "UNIX timestamp with 9 decimal places after **created_at**" + "time_unit": { + "type": "u32", + "description": [ + "The BOLT12 time unit." + ] }, - "source": { + "time_unit_name": { "type": "string", - "description": "The particular logbook this was found in" + "description": [ + "The name of `time_unit` (if valid)." + ] }, - "log": { - "type": "string", - "description": "The actual log message" + "period": { + "type": "u32", + "description": [ + "How many `time_unit` per payment period." + ] }, - "node_id": { - "type": "pubkey", - "description": "The peer this is associated with" - } - } - } - }, - { - "if": { - "additionalProperties": true, - "properties": { - "type": { - "enum": [ - "IO_IN", - "IO_OUT" + "basetime": { + "type": "u64", + "description": [ + "Period starts at this UNIX timestamp." ] - } - } - }, - "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" + "start_any_period": { + "type": "u64", + "description": [ + "You can start at any period (only if `basetime` present)." + ] }, - "node_id": { - "type": "pubkey", - "description": "The peer this is associated with" + "limit": { + "type": "u32", + "description": [ + "Maximum period number for recurrence." + ] }, - "data": { - "type": "hex", - "description": "The IO which occurred" + "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." + ] + } } } } } - ] - } - } - } - }, - "getroute.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "id", - "amount_msat", - "riskfactor" - ], - "properties": { - "id": { - "type": "pubkey", - "description": "" - }, - "amount_msat": { - "type": "msat", - "description": "" - }, - "riskfactor": { - "type": "u64", - "description": "" - }, - "cltv": { - "type": "u32", - "description": "" - }, - "fromid": { - "type": "pubkey", - "description": "" - }, - "fuzzpercent": { - "type": "u32", - "description": "" - }, - "exclude": { - "type": "array", - "description": "", - "items": { - "type": "string" - } - }, - "maxhops": { - "type": "u32", - "description": "" - } - } - }, - "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.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)" + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt12 invoice" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + false + ] + } } - } - } - }, - "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": "" - }, - "description": { - "type": "string", - "description": "" - }, - "label": { - "oneOf": [ - { - "type": "string", - "description": "" }, - { - "type": "integer", - "description": "" - } - ] - }, - "expiry": { - "type": "u64", - "description": "" - }, - "fallbacks": { - "type": "array", - "description": "", - "items": { - "type": "string" - } - }, - "preimage": { - "type": "hex", - "description": "" - }, - "exposeprivatechannels": { - "oneOf": [ - { - "type": "boolean", - "description": "" - }, - { - "type": "array", - "items": { - "type": "short_channel_id" + "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." + ] + } + } + } + } } - }, - { - "type": "short_channel_id" } - ] - }, - "cltv": { - "type": "u32", - "description": "" - }, - "deschashonly": { - "type": "boolean", - "description": "" - } - } - }, - "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": "" - }, - "description": { - "type": "string", - "description": "" - }, - "issuer": { - "type": "string", - "description": "" - }, - "label": { - "type": "string", - "description": "" - }, - "absolute_expiry": { - "type": "u64", - "description": "" - }, - "single_use": { - "type": "boolean", - "description": "" - } - } - }, - "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" - }, - "amount_msat": { - "type": "msat" - }, - "label": { - "type": "string" - }, - "maxfeepercent": { - "type": "number" - }, - "retry_for": { - "type": "u32" - }, - "maxdelay": { - "type": "u32" - }, - "exemptfee": { - "type": "msat" - }, - "routehints": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, + }, + { + "if": { + "properties": { + "type": { + "type": "string", + "enum": [ + "bolt11 invoice" + ] + }, + "valid": { + "type": "boolean", + "enum": [ + true + ] + } + } + }, + "then": { "required": [ - "id", - "scid", - "feebase", - "feeprop", - "expirydelta" + "currency", + "created_at", + "expiry", + "payee", + "min_final_cltv_expiry", + "payment_hash", + "signature" ], + "additionalProperties": false, "properties": { - "id": { - "type": "pubkey" + "type": {}, + "valid": {}, + "currency": { + "type": "string", + "description": [ + "The BIP173 name for the currency." + ] }, - "scid": { - "type": "short_channel_id" + "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." + ] }, - "feebase": { - "type": "msat" + "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." + ] + } + } + } }, - "feeprop": { - "type": "u32" + "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." + ] + } + } + } + } }, - "expirydelta": { - "type": "u16" + "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." + ] + } + } + } } } } - } - }, - "extratlvs": { - "type": "object", - "additionalProperties": true, - "required": [] - } - } - }, - "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" - } - } - }, - "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 supplied, limits the channels to just the peer with the given ID, if it exists." - } - } - }, - "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" - } - } - } - } - } - }, - "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" - ], + }, + { + "if": { "properties": { - "value_str": { + "type": { "type": "string", - "description": "field from cmdline" + "enum": [ + "rune" + ] }, - "source": { - "type": "string", + "valid": { + "type": "boolean", "enum": [ - "cmdline" - ], - "description": "source of configuration setting" + true + ] } } }, - "developer": { - "type": "object", - "added": "v23.08", - "additionalProperties": false, + "then": { "required": [ - "set", - "source" + "string", + "restrictions", + "valid" ], + "additionalProperties": false, "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" + "unique_id": { + "type": "string", + "description": [ + "Unique id (always a numeric id on runes we create)." + ] }, - "source": { + "version": { "type": "string", - "description": "source of configuration setting" - } - } - }, - "clear-plugins": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { + "description": [ + "Rune version, not currently set on runes we create." + ] + }, + "valid": { "type": "boolean", - "description": "`true` if set in config or cmdline" + "enum": [ + true + ] }, - "source": { + "type": {}, + "string": { "type": "string", - "description": "source of configuration setting" + "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." + ] + } + } + } } } - }, - "disable-mpp": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], + } + }, + { + "if": { "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { + "type": { "type": "string", - "description": "source of configuration setting" + "enum": [ + "rune" + ] }, - "plugin": { - "type": "string", - "description": "plugin which registered this configuration setting" + "valid": { + "type": "boolean", + "enum": [ + false + ] } } }, - "mainnet": { - "type": "object", - "additionalProperties": false, + "then": { "required": [ - "set", - "source" + "valid" ], + "additionalProperties": false, "properties": { - "set": { + "valid": { "type": "boolean", - "description": "`true` if set in config or cmdline" + "enum": [ + false + ] }, - "source": { + "type": {}, + "warning_rune_invalid_utf8": { "type": "string", - "description": "source of configuration setting" + "description": [ + "The rune contains invalid UTF-8 strings." + ] + }, + "hex": { + "type": "hex", + "description": [ + "The raw rune in hex." + ] } } - }, - "regtest": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], + } + }, + { + "if": { "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { + "type": { "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" + "enum": [ + "emergency recover" + ] }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "testnet": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], - "properties": { - "set": { + "valid": { "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { - "type": "string", - "description": "source of configuration setting" + "enum": [ + true + ] } } }, - "important-plugin": { - "type": "object", - "additionalProperties": false, + "then": { "required": [ - "values_str", - "sources" + "decrypted" ], - "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" - } + "type": {}, + "valid": {}, + "decrypted": { + "type": "hex", + "description": [ + "The decrypted value of the provided bech32 of emergency.recover." + ], + "added": "v23.11" } } - }, - "plugin-dir": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" + } + } + ] + }, + "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" ], - "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" - } - } - } + "summary": "method (of command) starts with 'list' OR method (of command) starts with 'get' OR method (of command) equal to 'summary'" }, - "lightning-dir": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" + { + "alternatives": [ + "method/listdatastore" ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } + "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 } - }, - "network": { + ] + ], + "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", - "additionalProperties": false, "required": [ - "value_str", - "source" + "type", + "hex" ], + "additionalProperties": false, "properties": { - "value_str": { + "type": { "type": "string", - "description": "field from config or cmdline, or default (can also be changed by `testnet`, `signet`, `regtest` options!)" + "description": [ + "The address type (if known)." + ], + "enum": [ + "P2PKH", + "P2SH", + "P2WPKH", + "P2WSH", + "P2TR" + ] }, - "source": { + "addr": { "type": "string", - "description": "source of configuration setting" + "description": [ + "The address in appropriate format for *type*." + ] + }, + "hex": { + "type": "hex", + "description": [ + "Raw encoded address." + ] } } - }, - "allow-deprecated-apis": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_bool", - "source" + } + }, + "routes": { + "type": "array", + "description": [ + "Route hints to the *payee*." + ], + "items": { + "type": "array", + "description": [ + "Hops in the route." ], - "properties": { - "value_bool": { - "type": "boolean", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" + "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." + ] + } } } - }, - "rpc-file": { + } + }, + "extra": { + "type": "array", + "description": [ + "Any extra fields we didn't know how to parse." + ], + "items": { "type": "object", - "additionalProperties": false, "required": [ - "value_str", - "source" + "tag", + "data" ], + "additionalProperties": false, "properties": { - "value_str": { + "tag": { "type": "string", - "description": "field from config or cmdline, or default" + "description": [ + "The bech32 letter which identifies this field." + ], + "maxLength": 1, + "minLength": 1 }, - "source": { + "data": { "type": "string", - "description": "source of configuration setting" + "description": [ + "The bech32 data for this field." + ] } } - }, - "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": [ + "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" } - }, - "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" - } + ] + }, + "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" + ] }, - "daemon": { - "type": "object", + "then": { + "required": [], "additionalProperties": false, - "required": [ - "set", - "source" - ], "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" + "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." + ] }, - "source": { + "invreq_payer_note": { "type": "string", - "description": "source of configuration setting" + "description": [ + "The optional *invreq_payer_note* from invoice_request which created this invoice." + ] } } }, - "wallet": { - "type": "object", - "additionalProperties": false, + "else": { "required": [ - "value_str", - "source" + "bolt11" ], + "additionalProperties": false, "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } + "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": {} } - }, - "large-channels": { - "type": "object", - "additionalProperties": false, - "required": [ - "set", - "source" - ], + } + }, + { + "if": { "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" - }, - "source": { + "status": { "type": "string", - "description": "source of configuration setting" + "enum": [ + "paid" + ] } } }, - "experimental-dual-fund": { - "type": "object", + "then": { "additionalProperties": false, "required": [ - "set", - "source" + "pay_index", + "amount_received_msat", + "paid_at", + "payment_preimage" ], "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" + "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." + ] }, - "source": { - "type": "string", - "description": "source of configuration setting" + "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." + ] } } }, - "experimental-splicing": { - "added": "v23.08", - "type": "object", + "else": { "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" - } + "label": {}, + "bolt11": {}, + "bolt12": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "description": {}, + "payment_hash": {}, + "expires_at": {}, + "created_index": {}, + "updated_index": {}, + "pay_index": {}, + "invreq_payer_note": {}, + "local_offer_id": {} } - }, - "experimental-onion-messages": { + } + } + ], + "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": [ - "set", - "source" + "created_index", + "id", + "payment_hash", + "status", + "amount_sent_msat", + "created_at" ], "properties": { - "set": { - "type": "boolean", - "description": "`true` if set in config or cmdline" + "created_index": { + "added": "v23.11", + "type": "u64", + "description": [ + "1-based index indicating order this payment was created in." + ] }, - "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" + "id": { + "type": "u64", + "description": [ + "Old synonym for created_index." + ] }, - "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" + "payment_hash": { + "type": "hash", + "description": [ + "The hash of the *payment_preimage* which will prove payment." + ] }, - "source": { + "status": { "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" + "enum": [ + "pending", + "failed", + "complete" + ], + "description": [ + "Status of the payment." + ] }, - "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" + "amount_sent_msat": { + "type": "msat", + "description": [ + "The amount we actually sent, including fees." + ] }, - "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" + "partid": { + "type": "u64", + "description": [ + "Unique ID within this (multi-part) payment." + ] }, - "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" + "destination": { + "type": "pubkey", + "description": [ + "The final destination of the payment if known." + ] }, - "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 + "amount_msat": { + "type": "msat", + "description": [ + "The amount the destination received, if known." + ] }, - "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" + "created_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was initiated." + ] }, - "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" + "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)." + ] }, - "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" + "completed_at": { + "type": "u64", + "description": [ + "The UNIX timestamp showing when this payment was completed." + ] }, - "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" + "groupid": { + "type": "u64", + "description": [ + "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." + ] }, - "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" + "payment_preimage": { + "type": "secret", + "description": [ + "Proof of payment." + ] }, - "source": { + "label": { "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" + "description": [ + "The label, if given to sendpay." + ] }, - "source": { + "bolt11": { "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" + "description": [ + "The bolt11 string (if pay supplied one)." + ] }, - "source": { + "bolt12": { "type": "string", - "description": "source of configuration setting" + "description": [ + "The bolt12 string (if supplied for pay: **experimental-offers** only)." + ] + }, + "erroronion": { + "type": "hex", + "description": [ + "The error onion returned on failure, if any." + ] } } - }, - "cltv-final": { + } + } + }, + "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": false, + "additionalProperties": true, "required": [ - "value_int", - "source" + "state", + "opener", + "features", + "peer_connected", + "peer_id" ], "properties": { - "value_int": { - "type": "u32", - "description": "field from config or cmdline, or default" + "peer_id": { + "type": "pubkey", + "description": [ + "Node Public key." + ] }, - "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" + "peer_connected": { + "type": "boolean", + "description": [ + "A boolean flag that is set to true if the peer is online." + ] }, - "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" + "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." + ] }, - "source": { + "state": { "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" + "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." + ] }, - "source": { + "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": "source of configuration setting" - } - } - }, - "fee-per-satoshi": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { + "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": "field from config or cmdline, or default" + "description": [ + "The 0-based output number of the funding transaction which opens the channel." + ] }, - "source": { + "initial_feerate": { "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" + "description": [ + "For inflight opens, the first feerate used to initiate the channel open." + ] }, - "source": { + "last_feerate": { "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": [ + "For inflight opens, the most recent feerate used on the channel open." + ] }, - "source": { + "next_feerate": { "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" + "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." + ] + } + } + } }, - "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" + "close_to": { + "type": "hex", + "description": [ + "ScriptPubkey which we have to close to if we mutual close." + ] }, - "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" + "private": { + "type": "boolean", + "description": [ + "If True, we will not announce this channel." + ] }, - "source": { + "opener": { "type": "string", - "description": "source of configuration setting" + "enum": [ + "local", + "remote" + ], + "description": [ + "Who initiated the channel." + ] }, - "dynamic": { - "type": "boolean", + "closer": { + "type": "string", "enum": [ - true + "local", + "remote" ], - "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" - } + "description": [ + "Who initiated the channel close (only present if closing)." + ] }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": "source of configuration setting" - } - } - } - }, - "announce-addr": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { + "features": { "type": "array", "items": { "type": "string", - "description": "field from config or cmdline" + "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." + ] } }, - "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" + "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." + ] + } } }, - "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" + "to_us_msat": { + "type": "msat", + "description": [ + "How much of channel is owed to us." + ] }, - "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" + "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." + ] }, - "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" + "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." + ] }, - "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" + "total_msat": { + "type": "msat", + "description": [ + "Total amount in the channel." + ] }, - "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" + "fee_base_msat": { + "type": "msat", + "description": [ + "Amount we charge to use the channel." + ] }, - "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": { + "fee_proportional_millionths": { "type": "u32", - "description": "field from config or cmdline, or default" + "description": [ + "Amount we charge to use the channel in parts-per-million." + ] }, - "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" + "dust_limit_msat": { + "type": "msat", + "description": [ + "Minimum amount for an output on the channel transactions." + ] }, - "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" + "max_total_htlc_in_msat": { + "type": "msat", + "description": [ + "Max amount accept in a single payment." + ] }, - "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" + "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." + ] }, - "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" + "max_accepted_htlcs": { + "type": "u32", + "description": [ + "Maximum number of incoming HTLC we will accept at once." + ] }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "log-file": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { + "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": "string", - "description": "field from config or cmdline" + "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." + ] + } + } } }, - "sources": { + "status": { "type": "array", "items": { "type": "string", - "description": "source of configuration setting" + "description": [ + "Billboard log of significant changes." + ] } - } - } - }, - "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" + "in_payments_offered": { + "type": "u64", + "description": [ + "Number of incoming payment attempts." + ] }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "subdaemon": { - "type": "object", - "additionalProperties": false, - "required": [ - "values_str", - "sources" - ], - "properties": { - "values_str": { + "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": "string", - "description": "field from config or cmdline" + "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." + ] + } + } } }, - "sources": { - "type": "array", - "items": { - "type": "string", - "description": "source of configuration setting" + { + "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." + ] + } + } } } - } - }, - "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" + ] + } + } + }, + "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 } - } - }, - "accept-htlc-tlv-types": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" + }, + "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" ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" + "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 }, - "source": { - "type": "string", - "description": "source of configuration setting" + "remote": { + "htlc_minimum_msat": 0, + "htlc_maximum_msat": 990000000, + "cltv_expiry_delta": 6, + "fee_base_msat": 1, + "fee_proportional_millionths": 10 } - } - }, - "tor-service-password": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_str", - "source" + }, + "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" ], - "properties": { - "value_str": { - "type": "string", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" + "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" } - } - }, - "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" + "status": [ + "CHANNELD_NORMAL:Channel ready for use." ], - "properties": { - "value_bool": { - "type": "boolean", - "description": "field from config or cmdline, or default" - }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "commit-fee": { + "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": false, + "additionalProperties": true, "required": [ - "value_int", - "source" + "id", + "connected", + "num_channels" ], "properties": { - "value_int": { - "type": "u64", - "description": "field from config or cmdline, or default" + "id": { + "type": "pubkey", + "description": [ + "The unique id of the peer." + ] }, - "source": { - "type": "string", - "description": "source of configuration setting" - } - } - }, - "commit-feerate-offset": { - "type": "object", - "additionalProperties": false, - "required": [ - "value_int", - "source" - ], - "properties": { - "value_int": { + "connected": { + "type": "boolean", + "description": [ + "Value showing the connection status." + ] + }, + "num_channels": { "type": "u32", - "description": "field from config or cmdline, or default" + "description": [ + "The number of channels the peer has with this node." + ], + "added": "v23.02" }, - "source": { - "type": "string", - "description": "source of configuration setting" + "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." + ] + } + } + } + } + ] + } } - } - } - } - }, - "# 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" + "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 + } }, - "commit-feerate-offset": { - "type": "u32", - "added": "v23.11", - "description": "additional commitment feerate applied by channel owner" + { + "id": "example:listpeers#2", + "method": "listpeers", + "params": { + "id": null, + "level": null + } } - } - }, - "listdatastore.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "key": { - "oneOf": [ + ], + "example_json_response": [ + { + "peers": [ { - "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" - } - }, + "id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", + "connected": true, + "num_channels": 1, + "netaddr": [ + "127.0.0.1:44619" + ], + "features": "08a0000a0a69a2" + } + ] + }, + { + "peers": [ { - "type": "string", - "description": "" + "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):", + "" + ] }, - "listdatastore.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-listsendpays.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "datastore" + "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." ], - "properties": { - "datastore": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "key" + "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" ], - "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" - } - } + "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." + ] } - } - } - }, - "listforwards.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "properties": { - "status": { - "type": "string", - "enum": [ - "offered", - "settled", - "local_failed", - "failed" - ] - }, - "in_channel": { - "type": "short_channel_id" - }, - "out_channel": { - "type": "short_channel_id" - }, - "index": { - "type": "string", - "added": "v23.11", - "enum": [ - "created", - "updated" - ], - "description": "" }, - "start": { - "type": "u64", - "added": "v23.11", - "description": "" - }, - "limit": { - "type": "u32", - "added": "v23.11", - "description": "" + "dependentUpon": { + "index": [ + "start", + "limit" + ] } - } - }, - "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" - ], - "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" + }, + "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." ] }, - "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*" - } - } + "id": { + "type": "u64", + "description": [ + "Old synonym for created_index." + ] }, - "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" - ] - } - } + "groupid": { + "type": "u64", + "description": [ + "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash." + ] }, - "then": { - "additionalProperties": false, - "required": [ - "resolved_time" + "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" ], - "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" - } - } + "description": [ + "Status of the payment." + ] }, - "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": {} - } + "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)." + ] } }, - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "local_failed", - "failed" - ] + "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**." + ] + } } } }, - "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" + { + "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." + ] + } } } }, - "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": {} + { + "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 } } - } - }, - "listfunds.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": { - "spent": { - "type": "boolean", - "description": "Should outputs that are already spent be included in the result?" + ], + "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: " + ] }, - "listfunds.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-listsqlschemas.json": { + "$schema": "../rpc-schema-draft.json", "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" - ] - } - } + "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." + ] }, - "then": { - "additionalProperties": false, - "required": [ - "blockheight" + "columns": { + "type": "array", + "description": [ + "The columns, in database order." ], - "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" - ] + "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." + ] + } } } }, - "then": { - "additionalProperties": false, - "required": [ - "reserved_to_block" + "indices": { + "type": "array", + "description": [ + "Any index we created to speed lookups." ], - "properties": { - "txid": {}, - "output": {}, - "amount_msat": {}, - "scriptpubkey": {}, - "address": {}, - "value": {}, - "redeemscript": {}, - "status": {}, - "blockheight": {}, - "reserved": {}, - "reserved_to_block": { - "type": "u32", - "description": "Block height where reservation will expire" + "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" } }, - "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" - ] - } - } + { + "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." + ] }, - "then": { - "additionalProperties": false, - "required": [ - "short_channel_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." ], - "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" - ] + "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." + ] + } } } }, - "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)" + "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." + ] + } } } } } - ] + } } } - } - }, - "listhtlcs.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "properties": { - "id": { - "type": "string", - "description": "channel id or short_channel_id" + }, + "example_json_request": [ + { + "id": "example:listtransactions#1", + "method": "listtransactions", + "params": {} } - } - }, - "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`." - } + "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" + } + ] } - } - } - } - }, - "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": "" - }, - "active_only": { - "type": "boolean", - "description": "" + ] } - } + ], + "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: " + ] }, - "listinvoicerequests.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-makesecret.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "invoicerequests" + "rpc": "makesecret", + "title": "Command for deriving pseudorandom key from HSM", + "description": [ + "The **makesecret** RPC command derives a secret key from the HSM_secret." ], - "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" - } - } + "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." + ] } } - } - }, - "listinvoices.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "label": { - "oneOf": [ - { - "type": "string", - "description": "" - }, - { - "type": "integer", - "description": "" - } + }, + "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" ] }, - "invstring": { - "type": "string", - "description": "" - }, - "payment_hash": { - "type": "hex", - "description": "" - }, - "offer_id": { - "type": "string", - "description": "" - }, - "index": { - "type": "string", - "added": "v23.08", - "enum": [ - "created", - "updated" - ], - "description": "" - }, - "start": { - "type": "u64", - "added": "v23.08", - "description": "" + { + "id": "example:makesecret#2", + "method": "makesecret", + "params": [ + null, + "scb secret" + ] + } + ], + "example_json_response": [ + { + "secret": "a9a2e742405c28f059349132923a99337ae7f71168b7485496e3365f5bc664ed" }, - "limit": { - "type": "u32", - "added": "v23.08", - "description": "" + { + "secret": "a9a2e742405c28f059349132923a99337ae7f71168b7485496e3365f5bc664ed" } - } + ], + "author": [ + "Aditya <> is mainly responsible." + ], + "resources": [ + "Main web site: " + ] }, - "listinvoices.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-multifundchannel.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "invoices" + "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." ], - "properties": { - "invoices": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "label", - "created_index", - "payment_hash", - "status", - "expires_at" + "request": { + "required": [ + "destinations" + ], + "properties": { + "destinations": { + "type": "array", + "description": [ + "There must be at least one entry in *destinations*; it cannot be an empty array." ], - "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" - ] - } - } + "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." + ] }, - "then": { - "additionalProperties": false, - "required": [ - "pay_index", - "amount_received_msat", - "paid_at", - "payment_preimage" + "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*." ], - "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": "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." ] } } - } - }, - "listnodes.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": { - "id": { - "type": "pubkey" - } - } - }, - "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" - ], - "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" + }, + "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." ] }, - "then": { + "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": [ - "nodeid", - "last_timestamp", - "alias", - "color", - "features", - "addresses" + "bits", + "names" ], "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" + "bits": { + "type": "array", + "description": [ + "Each bit set in this channel_type." + ], + "added": "v24.02", + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } }, - "addresses": { + "names": { "type": "array", - "description": "The addresses this node advertized", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "added": "v24.02", "items": { - "type": "object", - "required": [ - "type", - "port" + "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" ], - "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": {} - } - } + "description": [ + "Name of feature bit." + ] } } } }, - "else": { - "additionalProperties": false, - "properties": { - "nodeid": {} - } + "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": { - "required": [ - "option_will_fund" + } + } + }, + "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." ] }, - "then": { - "additionalProperties": true, + "method": { + "type": "string", + "enum": [ + "connect", + "openchannel_init", + "fundchannel_start", + "fundchannel_complete" + ], + "description": [ + "What stage we failed at." + ] + }, + "error": { + "type": "object", + "additionalProperties": false, "required": [ - "option_will_fund" + "code", + "message" ], "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" - } - } + "code": { + "type": "integer", + "description": [ + "JSON error code from failing stage." + ] + }, + "message": { + "type": "string", + "description": [ + "Message from stage." + ] + }, + "data": { + "untyped": true, + "description": [ + "Additional error data." + ] } } } } - ] - } - } - } - }, - "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" - }, - "active_only": { - "type": "boolean", - "description": "f active_only is set and is true, only offers with active true are returned." + } + } + }, + "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: " + ] }, - "listoffers.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-multiwithdraw.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "offers" + "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*." ], - "properties": { - "offers": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "offer_id", - "active", - "single_use", - "bolt12", - "used" + "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." ], - "properties": { - "offer_id": { - "type": "hash", - "description": "the id of this offer (merkle hash of non-signature fields)" + "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" }, - "active": { - "type": "boolean", - "description": "whether this can still be used" + { + "bcrt1q6r4vvt7uack33qf9n05umfxy8h5s2rdcmq7ra3": "3333000msat" + } + ], + "feerate": null, + "minconf": null, + "utxos": null + } + }, + { + "id": "example:multiwithdraw#2", + "method": "multiwithdraw", + "params": { + "outputs": [ + { + "BCRT1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KYGT080": 1000 }, - "single_use": { - "type": "boolean", - "description": "whether this expires as soon as it's paid" + { + "bcrt1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qzf4jry": 1000 }, - "bolt12": { - "type": "string", - "description": "the bolt12 encoding of the offer" + { + "bcrt1pw508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7k0ylj56": 1000 }, - "used": { - "type": "boolean", - "description": "True if an associated invoice has been paid" + { + "BCRT1SW50QT2UWHA": 1000 }, - "label": { - "type": "string", - "description": "the (optional) user-specified label" + { + "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: " + ] }, - "listpays.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-newaddr.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", - "required": [], "additionalProperties": false, - "properties": { - "bolt11": { - "type": "string" + "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 + } }, - "payment_hash": { - "type": "hash" + { + "id": "example:newaddr#2", + "method": "newaddr", + "params": { + "addresstype": "bech32" + } + } + ], + "example_json_response": [ + { + "bech32": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf" }, - "status": { - "type": "string", - "enum": [ - "pending", - "complete", - "failed" - ] + { + "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: " + ] }, - "listpays.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-notifications.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "pays" + "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." ], - "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)" + "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" }, - "bolt12": { - "type": "string", - "description": "the bolt12 string (if supplied for pay: **experimental-offers** only)." + { + "type": "currency" } - }, - "allOf": [ + ], + "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": [ { - "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" } + ], + "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: " + ] }, - "listpeerchannels.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-openchannel_abort.json": { + "$schema": "../rpc-schema-draft.json", "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." + "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: " + ] }, - "listpeerchannels.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-openchannel_bump.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "added": "v23.02", - "required": [ - "channels" + "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." ], - "properties": { - "channels": { - "type": "array", - "items": { + "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", - "additionalProperties": true, - "required": [ - "state", - "opener", - "features", - "peer_connected", - "peer_id" + "description": [ + "Channel_type as negotiated with peer." ], - "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" + "added": "v24.02", + "additionalProperties": false, + "required": [ + "bits", + "names" + ], + "properties": { + "bits": { + "type": "array", + "description": [ + "Each bit set in this channel_type." ], - "description": "Who initiated the channel close (only present if closing)" + "added": "v24.02", + "items": { + "type": "u32", + "description": [ + "Bit number." + ] + } }, - "features": { + "names": { "type": "array", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "added": "v24.02", "items": { "type": "string", "enum": [ - "option_static_remotekey", - "option_anchor_outputs", - "option_anchors_zero_fee_htlc_tx", - "option_scid_alias", - "option_zeroconf" + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" ], - "description": "BOLT #9 features which apply to this channel" + "description": [ + "Name of feature bit." + ] } - }, - "funding": { - "type": "object", - "additionalProperties": false, - "required": [ - "local_funds_msat", - "remote_funds_msat" + } + } + }, + "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." ], - "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" - } + "added": "v24.02", + "items": { + "type": "u32", + "description": [ + "Bit number." + ] } }, - "state_changes": { + "names": { "type": "array", - "description": "Prior state changes", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "added": "v24.02", "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "timestamp", - "old_state", - "new_state", - "cause", - "message" + "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" ], - "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" - } - } + "description": [ + "Name of feature bit." + ] } - }, - "status": { + } + } + }, + "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": "string", - "description": "Billboard log of significant changes" + "type": "u32", + "description": [ + "Bit number." + ] } }, - "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": { + "names": { "type": "array", - "description": "current HTLCs in this channel", + "description": [ + "Feature name for each bit set in this channel_type." + ], + "added": "v24.02", "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "direction", - "id", - "amount_msat", - "expiry", - "payment_hash", - "state" + "type": "string", + "enum": [ + "static_remotekey/even", + "anchor_outputs/even", + "anchors_zero_fee_htlc_tx/even", + "scid_alias/even", + "zeroconf/even" ], - "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" - } - } - } - } + "description": [ + "Name of feature bit." ] } } - }, - "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" + } + }, + "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": 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": true, + "required": [ + "channel_id", + "funding_outnum" + ], + "properties": { + "commitments_secured": {}, + "channel_id": { + "type": "hash", + "description": [ + "The derived channel id." ] }, - "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" + "close_to": { + "type": "hex", + "description": [ + "If a `close_to` address was provided to `openchannel_init` and the peer supports `option_upfront_shutdownscript`." ] }, - "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" + "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" }, - "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" - } - } + { + "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: " + ] }, - "listpeers.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-ping.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": "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 }, - "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." + { + "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: " + ] }, - "listpeers.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-plugin.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", - "additionalProperties": false, - "required": [ - "peers" + "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)." ], - "properties": { - "peers": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true, - "required": [ - "id", - "connected", - "num_channels" + "request": { + "required": [ + "subcommand" + ], + "oneOfMany": [ + [ + "plugin", + "directory" + ] + ], + "properties": { + "subcommand": { + "type": "string", + "enum": [ + "start", + "stop", + "rescan", + "startdir", + "list" ], - "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" - } - } - } - } + "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" ] } - }, - "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": [ + "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." ] }, - "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" + "active": { + "type": "boolean", + "description": [ + "Status; plugin completed init and is operational, plugins are configured asynchronously." ] }, - "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" + "dynamic": { + "type": "boolean", + "description": [ + "Plugin can be stopped or started without restarting lightningd." ] - }, - "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" - } - } } } + } + } + } + } + }, + { + "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" ] } } }, - "allOf": [ - { - "if": { - "additionalProperties": true, - "properties": { - "connected": { - "enum": [ - true - ] - } - } + "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." + ] }, - "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" - } - } + "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!" } } - } - }, - "listsendpays.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": { - "bolt11": { - "type": "string" - }, - "payment_hash": { - "type": "hash" - }, - "status": { - "type": "string", - "enum": [ - "pending", - "complete", - "failed" - ] - }, - "index": { - "type": "string", - "added": "v23.11", - "enum": [ - "created", - "updated" - ], - "description": "" - }, - "start": { - "type": "u64", - "added": "v23.11", - "description": "" - }, - "limit": { - "type": "u32", - "added": "v23.11", - "description": "" + ], + "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: " + ] }, - "listsendpays.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-sendonion.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "payments" + "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\"", + "]", + "```" ], - "properties": { - "payments": { - "type": "array", - "items": { + "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", - "additionalProperties": true, + "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", - "created_index", - "payment_hash", - "status", - "groupid", - "created_at", - "amount_sent_msat" + "amount_msat", + "delay" ], "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" + "description": [ + "Node id for the peer. Use any available channel available to this peer." + ] }, - "amount_sent_msat": { + "amount_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)" + "description": [ + "The amount to add an HTLC for millisatoshis." + ] }, - "bolt12": { - "type": "string", - "description": "the bolt12 string (if supplied for pay: **experimental-offers** only)." + "delay": { + "type": "u16", + "description": [ + "The number of blocks delay of blocks on top of the current blockheight." + ] } - }, - "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" - } - } + } + }, + "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" + ] } - }, - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "pending" - ] - } - } + } + }, + "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." + ] }, - "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": {} - } + "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" + ] }, - "listsqlschemas.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-sendonionmessage.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", - "required": [], - "added": "v23.02", - "properties": { - "table": { - "type": "string" + "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" + ] }, - "listsqlschemas.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-sendpay.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "schemas" + "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." ], - "properties": { - "schemas": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "tablename", - "columns" + "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*." ], - "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" - } - } + "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 }, - "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" - } - } + { + "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: " + ] }, - "listtransactions.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-sendpsbt.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", - "required": [], "additionalProperties": false, - "properties": {} + "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: " + ] }, - "listtransactions.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-setchannel.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "transactions" + "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": { - "transactions": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "hash", - "rawtx", - "blockheight", - "txindex", - "locktime", - "version", - "inputs", - "outputs" + "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": { - "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" - } - } + "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." + ] } } } } } - } - }, - "makesecret.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "hex": { - "type": "hex", - "description": "This will be used for deriving the secret" + }, + "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 + } }, - "string": { - "type": "string", - "description": "This will be used for deriving the secret" + { + "id": "example:setchannel#2", + "method": "setchannel", + "params": { + "id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199", + "feebase": 4000, + "feeppm": 300, + "htlcmin": null, + "htlcmax": null, + "enforcedelay": 0, + "ignorefeelimits": null + } } - } - }, - "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": [ + { + "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: " + ] }, - "multifundchannel.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-setconfig.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "destinations" + "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": { - "destinations": { - "type": "array", - "items": { + "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": [ - "id", - "amount" + "config", + "source", + "dynamic" ], "properties": { - "id": { - "type": "string" - }, - "amount": { - "type": "msat_or_all" - }, - "announce": { - "type": "boolean" + "config": { + "type": "string", + "description": [ + "Name of the config variable which was set." + ] }, - "push_msat": { - "type": "msat" + "source": { + "type": "string", + "description": [ + "Source of configuration setting (`file`:`linenum`)." + ] }, - "close_to": { - "type": "string" + "plugin": { + "type": "string", + "description": [ + "The plugin this configuration setting is for." + ] }, - "request_amt": { - "type": "msat" + "dynamic": { + "type": "boolean", + "enum": [ + true + ], + "description": [ + "Whether this option is settable via setconfig." + ] }, - "compact_lease": { - "type": "string" + "set": { + "type": "boolean", + "description": [ + "For simple flag options." + ] }, - "mindepth": { - "description": "Number of confirmations required before we consider the channel active", - "type": "u32" + "value_str": { + "type": "string", + "description": [ + "For string options." + ] }, - "reserve": { + "value_msat": { "type": "msat", - "description": "The amount we want the peer to maintain on its side" + "description": [ + "For msat options." + ] }, - "channel_type": { - "type": "array", - "items": { - "type": "u32" - } + "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 + ] }, - "feerate": { - "type": "feerate" - }, - "minconf": { - "type": "u32" + { + "id": "example:setconfig#2", + "method": "setconfig", + "params": [ + "test-dynamic-config", + "changed" + ] }, - "utxos": { - "type": "array", - "items": { - "type": "outpoint" + { + "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 } }, - "minchannels": { - "type": "u32" + { + "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 + } }, - "commitment_feerate": { - "type": "feerate" + { + "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: " + ] }, - "multifundchannel.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-setpsbtversion.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "tx", - "txid", - "channel_ids" - ], - "properties": { - "tx": { - "type": "hex", - "description": "The raw transaction which funded the channel" + "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" + } }, - "txid": { - "type": "txid", - "description": "The txid of the transaction which funded the channel" + { + "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=" }, - "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" + { + "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)." + ] } - }, - "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:showrunes#1", + "method": "showrunes", + "params": "{}" }, - "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:showrunes#2", + "method": "showrunes", + "params": { + "rune": "Bl0V_vkVkGr4h356JbCMCcoDyyKE8djkoQ2156iPB509MCZwZXI9MTAwMDAwMDAwMG5zZWM=" } } - } - }, - "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" + ], + "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" + } + ] }, - "txid": { - "type": "txid", - "description": "The txid of the **tx**" + { + "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: " + ] }, - "newaddr.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-signinvoice.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", - "required": [], "additionalProperties": false, - "properties": { - "addresstype": { - "type": "string", - "enum": [ - "bech32", - "p2tr", - "all" + "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" ] } - } - }, - "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" - }, - "bech32": { - "type": "string", - "description": "The bech32 (native segwit) address" + ], + "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: " + ] }, - "notifications.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-signmessage.json": { + "$schema": "../rpc-schema-draft.json", "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" + "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." + ] + } } - } - }, - "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" + }, + "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)." + ] + } } - } - }, - "openchannel_abort.schema.json": { - "$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 + }, + "example_json_request": [ + { + "id": "example:signmessage#1", + "method": "signmessage", + "params": { + "message": "this is a test!" + } }, - "channel_canceled": { - "type": "boolean", - "description": "whether this is completely canceled (there may be remaining in-flight transactions)" + { + "id": "example:signmessage#2", + "method": "signmessage", + "params": { + "message": "message for you" + } + } + ], + "example_json_response": [ + { + "signature": "a2ec227012795f9d6b80a3f5ea98374c6d2886917517c05336799923fcf37caf08344c0431275e1a8189da01b444ae978007fe70f0cc9009f38cabe074ade87d", + "recid": "00", + "zbase": "d6tqaeuonjhi98mmont9m4wag7gg4krg1f4txonug3h31e9h6p6k6nbwjondnj46dkyausobstnk7fhyy998bhgc1yr98dfmhb4k54d7" }, - "reason": { - "type": "string", - "description": "usually \"Abort requested\", but if it happened to fail at the same time it could be different" + { + "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)" + ] }, - "openchannel_bump.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-signpsbt.json": { + "$schema": "../rpc-schema-draft.json", "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" - } + "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 + } }, - "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*" + { + "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=" }, - "requires_confirmed_inputs": { - "type": "boolean", - "description": "Does peer require confirmed inputs in psbt?" + { + "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: " + ] }, - "openchannel_init.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-splice_init.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "id", - "amount", - "initialpsbt" - ], - "properties": { - "id": { - "type": "pubkey" - }, - "amount": { - "type": "msat" - }, - "initialpsbt": { - "type": "string" - }, - "commitment_feerate": { - "type": "feerate" - }, - "funding_feerate": { - "type": "feerate" - }, - "announce": { - "type": "boolean" - }, - "close_to": { - "type": "hex" - }, - "request_amt": { - "type": "msat" - }, - "compact_lease": { - "type": "hex" - }, - "channel_type": { - "type": "array", - "description": "Each bit set in this channel_type", - "items": { + "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": "Bit number" + "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." + ] } } - } - }, - "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": [ + "psbt" + ], + "properties": { + "psbt": { + "type": "string", + "description": [ + "The (incomplete) PSBT of the splice 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?" } - } - }, - "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 + }, + "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 + } }, - "tx": { - "type": "hex", - "description": "the funding transaction" + { + "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=" }, - "txid": { - "type": "txid", - "description": "The txid of the **tx**" + { + "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: " + ] }, - "openchannel_update.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-splice_signed.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" - } - } + "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." + ] } - }, - "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.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 - } - } + }, + "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: " + ] }, - "pay.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-splice_update.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "bolt11" + "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." ], - "properties": { - "bolt11": { - "type": "string" - }, - "amount_msat": { - "type": "msat" - }, - "label": { - "type": "string" - }, - "riskfactor": { - "type": "number" - }, - "maxfeepercent": { - "type": "number" - }, - "retry_for": { - "type": "u16" - }, - "maxdelay": { - "type": "u16" - }, - "exemptfee": { - "type": "msat" - }, - "localinvreqid": { - "type": "hex" - }, - "exclude": { - "type": "array", - "items": { - "oneOf": [ - { - "type": "short_channel_id_dir" - }, - { - "type": "pubkey" - } + "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." ] } - }, - "maxfee": { - "type": "msat" - }, - "description": { - "type": "string" } - } - }, - "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" + }, + "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." + ] + } } - } - }, - "ping.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "id" + }, + "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", + "```" ], - "additionalProperties": false, - "properties": { - "id": { - "type": "pubkey" - }, - "len": { - "type": "u16" - }, - "pongbytes": { - "type": "u16" + "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=" + } } - } - }, - "ping.schema.json": { - "$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)" + "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: " + ] }, - "plugin.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-sql-template.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", - "additionalProperties": true, - "required": [ - "command" + "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." ], - "properties": { - "command": { - "type": "string", - "enum": [ - "start", - "stop", - "rescan", - "startdir", - "list" - ], - "description": "the subcommand this is responding to" + "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)." + ] + } } }, - "allOf": [ - { - "if": { - "properties": { - "command": { - "type": "string", - "enum": [ - "start", - "startdir", - "rescan", - "list" - ] - } + "response": { + "required": [ + "rows" + ], + "properties": { + "rows": { + "type": "array", + "items": { + "type": "array" } }, - "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" - } - } - } - } - } + "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;" + ] + }, { - "if": { - "properties": { - "command": { - "type": "string", - "enum": [ - "stop" - ] - } - } - }, - "then": { - "additionalProperties": false, - "required": [ - "command", - "result" + "id": "example:sql#2", + "method": "sql", + "params": [ + "SELECT * from peerchannels_features" + ] + } + ], + "example_json_response": [ + { + "rows": [] + }, + { + "rows": [ + [ + 6, + 1, + 0, + "option_static_remotekey" ], - "properties": { - "command": {}, - "result": { - "type": "string", - "description": "A message saying it successfully stopped" - } - } - } + [ + 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: " ] }, - "preapproveinvoice.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-staticbackup.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "added": "v23.02", - "required": [ - "bolt11" + "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." ], - "properties": { - "bolt11": { - "type": "string", - "added": "v23.02" + "request": { + "required": [], + "properties": {} + }, + "response": { + "required": [ + "scb" + ], + "properties": { + "scb": { + "type": "array", + "items": { + "type": "hex", + "description": [ + "SCB of a channel in TLV format." + ] + } + } } - } - }, - "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", - "added": "v23.02" - }, - "payment_hash": { - "type": "hex", - "added": "v23.02", - "description": "the hash of the *payment_preimage* which will prove payment", - "maxLength": 64, - "minLength": 64 - }, - "amount_msat": { - "type": "msat", - "added": "v23.02" + }, + "example_json_request": [ + { + "id": "example:staticbackup#1", + "method": "staticbackup", + "params": "{}" } - } - }, - "preapprovekeysend.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "properties": {} - }, - "recoverchannel.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "scb" ], - "scb": { - "type": "array", - "description": "SCB of the channels in an array", - "items": { - "type": "hexstr" + "example_json_response": [ + { + "scb": [ + "0000000000000001c707da9b230e1655b0a6c082b8daf4fa44d9d1f68163ed4d531d45cf453dc651022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d5900017f000001b2e3c707da9b230e1655b0a6c082b8daf4fa44d9d1f68163ed4d531d45cf453dc6510000000000000000000186a000021000" + ] } - } + ], + "author": [ + "Aditya <> is mainly responsible." + ], + "see_also": [ + "lightning-getsharedsecret(7)" + ], + "resources": [ + "Main web site: " + ] }, - "recoverchannel.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-stop.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "stubs" + "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": { - "stubs": { - "type": "array", - "items": { + "request": { + "required": [], + "properties": {} + }, + "response": { + "required": [ + "result" + ], + "properties": { + "result": { "type": "string", - "description": "Channel IDs of channels successfully inserted." + "added": "v24.05", + "enum": [ + "Shutdown complete" + ] } } - } - }, - "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" + }, + "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: " + ] }, - "renepaystatus.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "added": "v23.08", + "lightning-txdiscard.json": { + "$schema": "../rpc-schema-draft.json", "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" - } - } - } + "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: " + ] }, - "reserveinputs.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-txprepare.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "reservations" + "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": { - "reservations": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "txid", - "vout", - "was_reserved", - "reserved", - "reserved_to_block" + "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." ], - "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" - } + "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" } } } - } - }, - "sendcustommsg.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "node_id", - "msg" + }, + "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." ], - "added": "v0.10.1", - "additionalProperties": false, - "properties": { - "node_id": { - "type": "pubkey" + "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=" }, - "msg": { - "type": "hex" + { + "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: " + ] }, - "sendcustommsg.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-txsend.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "status" + "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": { - "status": { - "type": "string", - "description": "Information about where message was queued" + "request": { + "required": [ + "txid" + ], + "properties": { + "txid": { + "type": "txid", + "description": [ + "The transaction id of the transaction created by `txprepare` rpc command." + ] + } } - } - }, - "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)" + }, + "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*." + ] + } } }, - "allOf": [ + "errors": [ + "On failure, an error is reported (from bitcoind), and the inputs from the transaction are unreserved.", + "", + "- -1: Catchall nonspecific error." + ], + "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": {}, - "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" - } - } + "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: " ] }, - "sendonion.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-unreserveinputs.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "onion", - "first_hop", - "payment_hash" - ], - "properties": { - "onion": { - "type": "hex" - }, - "first_hop": { - "type": "object", - "required": [ - "id", - "amount_msat", - "delay" - ], - "properties": { - "id": { - "type": "pubkey" - }, - "amount_msat": { - "type": "msat" - }, - "delay": { - "type": "u16" - } - } - }, - "payment_hash": { - "type": "hash" - }, - "label": { - "type": "string" - }, - "shared_secrets": { - "type": "array", - "items": { - "type": "secret" + "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 } - }, - "partid": { - "type": "u16" - }, - "bolt11": { - "type": "string" - }, - "amount_msat": { - "type": "msat" - }, - "destination": { - "type": "pubkey" - }, - "localinvreqid": { - "type": "hash" - }, - "groupid": { - "type": "u64" } - } - }, - "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" + }, + "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." + ] + } + } + } + } + ] + } + } } }, - "allOf": [ + "errors": [ + "On failure, an error is reported and no UTXOs are unreserved.", + "", + "- -32602: Invalid parameter, i.e. an unparseable PSBT." + ], + "example_json_request": [ { - "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**" - } + "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 } - } + ] }, { - "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" - } - } - } + "reservations": [] } + ], + "author": [ + "Lisa Neigut <> is mainly responsible." + ], + "see_also": [ + "lightning-unreserveinputs(7)", + "lightning-signpsbt(7)", + "lightning-sendpsbt(7)" + ], + "resources": [ + "Main web site: " ] }, - "sendonionmessage.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": {} - }, - "sendpay.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-upgradewallet.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": "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." ], - "properties": { - "amount_msat": { - "type": "msat" - }, - "id": { - "type": "pubkey" - }, - "delay": { - "type": "u16" - }, - "channel": { - "type": "short_channel_id" - } - } + "added": "v23.02", + "default": "*opening*" + }, + "reservedok": { + "type": "boolean", + "description": [ + "Tells the wallet to include all P2SH-wrapped inputs, including reserved ones." + ], + "added": "v23.02" } - }, - "payment_hash": { - "type": "hash" - }, - "label": { - "type": "string" - }, - "amount_msat": { - "type": "msat" - }, - "bolt11": { - "type": "string" - }, - "payment_secret": { - "type": "secret" - }, - "partid": { - "type": "u16" - }, - "localinvreqid": { - "type": "hex" - }, - "groupid": { - "type": "u64" - } - } - }, - "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)." } }, - "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": { - "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" - ] - } - } + "added": "v23.02" }, - "then": { - "additionalProperties": false, - "required": [ - "message" + "tx": { + "type": "hex", + "description": [ + "The raw transaction which was sent." ], - "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" - } - } + "added": "v23.02" + }, + "txid": { + "type": "txid", + "description": [ + "The txid of the **tx**." + ], + "added": "v23.02" } } - ] - }, - "sendpsbt.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt" + }, + "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." ], - "properties": { - "psbt": { - "type": "string" + "example_json_request": [ + { + "id": "example:upgradewallet#1", + "method": "upgradewallet", + "params": "{}" }, - "reserve": { - "type": "boolean" + { + "id": "example:upgradewallet#2", + "method": "upgradewallet", + "params": { + "feerate": "urgent", + "reservedok": true + } } - } - }, - "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" + ], + "example_json_response": [ + { + "upgraded_outs": 0 }, - "txid": { - "type": "txid", - "description": "The txid of the **tx**" + { + "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: " + ] }, - "setchannel.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-utxopsbt.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "id" + "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." ], - "properties": { - "id": { - "type": "string" - }, - "feebase": { - "type": "msat" - }, - "feeppm": { - "type": "u32" - }, - "htlcmin": { - "type": "msat" - }, - "htlcmax": { - "type": "msat" - }, - "enforcedelay": { - "type": "u32" - }, - "ignorefeelimits": { - "added": "v23.08", - "type": "boolean" + "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." + ] + } } - } - }, - "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" + }, + "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)." ], - "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" + "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." + ] + } } } } - } - } - }, - "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" + "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 + } }, - "channels": { - "type": "array", - "description": "channel(s) whose rate is now set", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "peer_id", - "channel_id" + { + "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)" - } - } + "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" + "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": {} - } - }, - "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" + { + "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 }, - "value_bool": { - "type": "boolean", - "description": "for boolean options" + { + "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: " + ] }, - "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": "optional rune to list" - } - } - }, - "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, - "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" - } - } - } + "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." + ] }, - "english": { + "bolt11": { "type": "string", - "description": "English readable summary of alternatives above" + "description": [ + "The BOLT11 string." + ] + }, + "bolt12": { + "type": "string", + "description": [ + "The BOLT12 string." + ] } } } - }, - "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" - ], - "properties": { - "invstring": { - "type": "string", - "description": "" - } - } - }, - "signinvoice.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "bolt11" - ], - "properties": { - "bolt11": { - "type": "string", - "description": "the bolt11 string" - } - } - }, - "signmessage.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "message" - ], - "additionalProperties": false, - "properties": { - "message": { - "type": "string" - } - } - }, - "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 - }, - "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" - }, - "signonly": { - "type": "array", - "items": { - "type": "u32" - } - } - } - }, - "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" + }, + { + "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." ], - "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" - } - } - }, - "splice_init.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt" + "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." ], - "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" + "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." ], - "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" + "example_json_request": [ + { + "id": "example:wait#1", + "method": "wait", + "params": { + "subsystem": "invoices", + "indexname": "created", + "nextvalue": 1 + } }, - "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" - ], - "added": "v23.08", - "properties": { - "tx": { - "type": "hex", - "description": "The hex representation of the final transaction that is published" + { + "id": "example:wait#2", + "method": "wait", + "params": { + "subsystem": "invoices", + "indexname": "updated", + "nextvalue": 2 + } }, - "txid": { - "type": "txid", - "description": "The txid is of the final transaction" + { + "id": "example:wait#3", + "method": "wait", + "params": { + "subsystem": "sendpays", + "indexname": "updated", + "nextvalue": 2 + } } - } - }, - "splice_update.request.json": { - "$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" + "example_json_response": [ + { + "subsystem": "invoices", + "created": 1, + "details": { + "status": "unpaid", + "label": "invlabel", + "bolt11": "lnbcrt420p1pjmxtevsp5d8c6gnaj8lyjy2qly783vklda9dfaqeyzyc37agxxp8h3uguv8pqpp5w6lhwxhqnuew4hle5h7qwjm27zz784mvsrzhmayhscy5t2hy5c4qdqvd9h8ver9wd3sxqyjw5qcqp99qxpqysgq09gxhjhwu9u3z6dlt5ln5f4g8zl78wz4pgh0am3kz54m9lllhqckf4gmhmt2ftrclq5x62zkqmggc7y0ju0ghdfwjz8hyd8l5cqvemgpyyhm6w" + } }, - "psbt": { - "type": "string", - "description": "the (optional) base 64 encoded PSBT to begin with. If not specified, one will be generated automatically" - } - } - }, - "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" + { + "subsystem": "invoices", + "updated": 2, + "details": { + "status": "expired" + } }, - "commitments_secured": { - "type": "boolean", - "description": "whether or not the commitments were secured" + { + "subsystem": "sendpays", + "updated": 2, + "details": { + "status": "complete", + "partid": 0, + "groupid": 1, + "payment_hash": "220dcfcf43e1fab3ce30f70eb943c3ce962393f5a65ced52d749e324b443d19e" + } } - } - }, - "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" + "author": [ + "Rusty Russell <> is mainly responsible." ], - "properties": { - "rows": { - "type": "array", - "items": { - "type": "array" - } - }, - "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" + "see_also": [ + "lightning-listinvoice(7)", + "lightning-listforwards(7)", + "lightning-listsendpays(7)" ], - "properties": { - "scb": { - "type": "array", - "items": { - "type": "hex", - "description": "SCB of a channel in TLV format" - } - } - } - }, - "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": "string", - "enum": [ - "Shutdown complete" + "resources": [ + "Main web site: " ] }, - "txdiscard.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "txid" - ], - "properties": { - "txid": { - "type": "txid" - } - } - }, - "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" - }, - "txid": { - "type": "txid", - "description": "the transaction id of *unsigned_tx*" - } - } - }, - "txprepare.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-waitanyinvoice.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "outputs" + "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." ], - "properties": { - "outputs": { - "type": "array", - "items": { - "type": "outputdesc" - } - }, - "feerate": { - "type": "feerate" - }, - "minconf": { - "type": "u32" - }, - "utxos": { - "type": "array", - "items": { - "type": "outpoint" + "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." + ] } } - } - }, - "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" - }, - "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" - ], - "properties": { - "txid": { - "type": "txid" - } - } - }, - "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" - }, - "txid": { - "type": "txid", - "description": "the transaction id of *tx*" - } - } - }, - "unreserveinputs.schema.json": { - "$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" + }, + "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" ], - "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)" + "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": { - "type": "u32", - "description": "what blockheight the reservation will expire" - } - } - } - } - ] - } - } - } - }, - "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" - }, - "feerate": { - "type": "feerate" - }, - "startweight": { - "type": "u32" - }, - "utxos": { - "type": "array", - "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)." - }, - "reservedok": { - "type": "boolean" - }, - "locktime": { - "type": "u32" - }, - "min_witness_weight": { - "type": "u32" - }, - "excess_as_change": { - "type": "boolean" - }, - "opening_anchor_channel": { - "added": "v23.08", - "type": "boolean" - } - } - }, - "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" + "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": {} } } } - } - } - }, - "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", - "enum": [ - "invoices", - "forwards", - "sendpays" - ] + ] + }, + "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 + } }, - "indexname": { - "type": "string", - "enum": [ - "created", - "updated", - "deleted" - ] + { + "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 }, - "nextvalue": { - "type": "u64" + { + "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: " + ] }, - "wait.schema.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-waitblockheight.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": "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)." + ] + } }, - "details": {} + "post_return_value_notes": [ + "If *timeout* seconds is reached without the specified blockheight being reached, this command will fail with a code of `2000`." + ] }, - "allOf": [ + "errors": [ + "The following error codes may occur:", + "", + "- 2000: Timed out." + ], + "example_json_request": [ { - "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" - } - } - } - } + "id": "example:waitblockheight#1", + "method": "waitblockheight", + "params": { + "blockheight": 99, + "timeout": null } }, { - "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" - } - } - } - } + "id": "example:waitblockheight#2", + "method": "waitblockheight", + "params": { + "blockheight": 103, + "timeout": 600 } + } + ], + "example_json_response": [ + { + "blockheight": 99 }, { - "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" - } - } - } - } - } + "blockheight": 103 } + ], + "author": [ + "ZmnSCPxj <> is mainly responsible." + ], + "resources": [ + "Main web site: " ] }, - "waitanyinvoice.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-waitinvoice.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [], - "properties": { - "lastpay_index": { - "type": "u64" - }, - "timeout": { - "type": "u64" - } - } - }, - "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)" + "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." + ] + } } }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "paid" - ] - } - } + "response": { + "required": [ + "label", + "description", + "payment_hash", + "status", + "created_index", + "expires_at" + ], + "properties": { + "label": { + "type": "string", + "description": [ + "Unique label supplied at invoice creation." + ] }, - "then": { - "additionalProperties": false, - "required": [ - "pay_index", - "amount_received_msat", - "paid_at", - "payment_preimage" + "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" ], - "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" + "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." + ] } - }, - "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": {} + }, + "else": { + "additionalProperties": false, + "properties": { + "label": {}, + "description": {}, + "payment_hash": {}, + "status": {}, + "msatoshi": {}, + "amount_msat": {}, + "bolt11": {}, + "bolt12": {}, + "created_index": {}, + "updated_index": {}, + "expires_at": {} + } } } - } - ] - }, - "waitblockheight.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "blockheight" + ] + }, + "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." ], - "properties": { - "blockheight": { - "type": "u32", - "description": "The current block height (>= blockheight parameter)" - }, - "timeout": { - "type": "u32", - "description": "If timeout seconds is reached without the specified blockheight being reached, this command will fail with a code of 2000." + "example_json_request": [ + { + "id": "example:waitinvoice#1", + "method": "waitinvoice", + "params": { + "label": "inv2" + } } - } - }, - "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)" + "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: " + ] }, - "waitinvoice.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-waitsendpay.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "label" + "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." ], - "properties": { - "label": { - "type": "string" - } - } - }, - "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" + "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." + ] + } }, - "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)" - } + "pairedWith": [ + [ + "partid", + "groupid" + ] + ] }, - "allOf": [ - { - "if": { - "properties": { - "status": { - "type": "string", - "enum": [ - "paid" - ] - } - } + "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." + ] }, - "then": { - "additionalProperties": false, - "required": [ - "pay_index", - "amount_received_msat", - "paid_at", - "payment_preimage" + "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" ], - "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" - } + "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**." + ] } - }, - "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, 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: " ] }, - "waitsendpay.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", + "lightning-withdraw.json": { + "$schema": "../rpc-schema-draft.json", "type": "object", "additionalProperties": false, - "required": [ - "payment_hash" + "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": { - "payment_hash": { - "type": "hash" - }, - "timeout": { - "type": "u32" - }, - "partid": { - "type": "u64" - }, - "groupid": { - "type": "u64" - } - } - }, - "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" - ] - } - } + "request": { + "required": [ + "destination", + "satoshi" + ], + "properties": { + "destination": { + "type": "string", + "description": [ + "Any Bitcoin accepted type, including bech32." + ] }, - "then": { - "additionalProperties": false, - "required": [ - "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": { - "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**" - } + "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" } } } - ] - }, - "withdraw.request.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "destination" + }, + "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)." ], - "properties": { - "destination": { - "type": "string" - }, - "satoshi": { - "type": "msat_or_all" - }, - "feerate": { - "type": "feerate" - }, - "minconf": { - "type": "u16" + "example_json_request": [ + { + "id": "example:withdraw#1", + "method": "withdraw", + "params": { + "destination": "bcrt1qjc7j2l5es4haw35c9jzm8dfm763ng5djp8f0s0", + "satoshi": 555555, + "feerate": null, + "minconf": null, + "utxos": null + } }, - "utxos": { - "type": "array", - "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/contrib/msggen/msggen/utils/utils.py b/contrib/msggen/msggen/utils/utils.py index f02bd4f90cd7..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()) @@ -39,10 +40,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 02d56edc51f4..7b8e7f80c733 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\"\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) @@ -35,472 +35,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=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['_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=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 7b89de6ee7fc..5a71c33f8b08 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 @@ -382,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 @@ -396,9 +413,11 @@ 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, + "currency": is_currency, "txid": is_txid, "signature": is_signature, "bip340sig": is_bip340sig, @@ -413,15 +432,16 @@ def is_msat_or_any(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: @@ -429,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 5d94587c43fc..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 @@ -1515,6 +1517,7 @@ def wait2py(m): def stop2py(m): return remove_default({ + "result": str(m.result), # EnumField in generate_composite }) 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/Makefile b/doc/Makefile index 647efff13d49..a3f58c32a3a2 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,78 @@ 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) + +# - 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 -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 +167,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 +186,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 +231,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/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/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/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/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-addgossip.7.md b/doc/lightning-addgossip.7.md deleted file mode 100644 index 2edaf9db8475..000000000000 --- a/doc/lightning-addgossip.7.md +++ /dev/null @@ -1,45 +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. - -RETURN VALUE ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an empty object is returned. - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-pay(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:b0793c2fa864b0ce3bc6f1618135f28ac551dfd1b8a0127caac73fd948e62d9d) diff --git a/doc/lightning-addpsbtoutput.7.md b/doc/lightning-addpsbtoutput.7.md deleted file mode 100644 index 780c4f5d718d..000000000000 --- a/doc/lightning-addpsbtoutput.7.md +++ /dev/null @@ -1,68 +0,0 @@ -lightning-addpsbtoutput -- Command to populate PSBT outputs from the wallet -================================================================ - -SYNOPSIS --------- - -**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*. - -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 -------------- - -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 -``` - -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) - -AUTHOR ------- - -@dusty\_daemon - -SEE ALSO --------- - -lightning-fundpsbt(7), lightning-utxopsbt(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:6a31cc1575f9112d0582b5b9db560a5217d6e1a7bd33d399958e3aff7b022ac3) diff --git a/doc/lightning-autoclean-once.7.md b/doc/lightning-autoclean-once.7.md deleted file mode 100644 index cf790f872842..000000000000 --- a/doc/lightning-autoclean-once.7.md +++ /dev/null @@ -1,70 +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). - -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 ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -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 - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightningd-config(5), lightning-autoclean-status(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:c6f69b86958274c082aeb4a6154173f65644315a0f5912820803afecfece8635) diff --git a/doc/lightning-autoclean-status.7.md b/doc/lightning-autoclean-status.7.md deleted file mode 100644 index 4d82bd95dc35..000000000000 --- a/doc/lightning-autoclean-status.7.md +++ /dev/null @@ -1,94 +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. - -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 ------------- - -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: - -- **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 - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -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 deleted file mode 100644 index 8228f47cbc16..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* is *true* to enable batching, *false* to disable it (the -default). - -EXAMPLE JSON REQUEST --------------------- -```json -{ - "id": 82, - "method": "batching", - "params": { - "enable": true - } -} -``` - -RETURN VALUE ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an empty object is returned. - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -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: - -[comment]: # ( SHA256STAMP:b0793c2fa864b0ce3bc6f1618135f28ac551dfd1b8a0127caac73fd948e62d9d) diff --git a/doc/lightning-bkpr-channelsapy.7.md b/doc/lightning-bkpr-channelsapy.7.md deleted file mode 100644 index 0ad2a10a7674..000000000000 --- a/doc/lightning-bkpr-channelsapy.7.md +++ /dev/null @@ -1,68 +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. - -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 ------------- - -[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) - -AUTHOR ------- - -niftynei 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: - -[comment]: # ( SHA256STAMP:9f598b60159787757d0b2491445af59f7e1ffad9d98da989b06e93c0df715018) diff --git a/doc/lightning-bkpr-dumpincomecsv.7.md b/doc/lightning-bkpr-dumpincomecsv.7.md deleted file mode 100644 index 081c867d82cc..000000000000 --- a/doc/lightning-bkpr-dumpincomecsv.7.md +++ /dev/null @@ -1,60 +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** 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 ------------- - -[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") - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -AUTHOR ------- - -niftynei 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: - -[comment]: # ( SHA256STAMP:e7ac14cae72e6a26d886b57e5a72139615638b4129e38337fceb216a7917133f) diff --git a/doc/lightning-bkpr-inspect.7.md b/doc/lightning-bkpr-inspect.7.md deleted file mode 100644 index 4c29f838d8d8..000000000000 --- a/doc/lightning-bkpr-inspect.7.md +++ /dev/null @@ -1,55 +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. - -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: - -- **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) - -AUTHOR ------- - -niftynei is mainly responsible. - -SEE ALSO --------- - -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 deleted file mode 100644 index fbfb6b7b33c0..000000000000 --- a/doc/lightning-bkpr-listaccountevents.7.md +++ /dev/null @@ -1,74 +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. - - -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: - -- **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 - -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 - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -AUTHOR ------- - -niftynei is mainly responsible. - -SEE ALSO --------- - -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 deleted file mode 100644 index 3efc20d27cfd..000000000000 --- a/doc/lightning-bkpr-listbalances.7.md +++ /dev/null @@ -1,56 +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. - -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: - -- **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 - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -AUTHOR ------- - -niftynei 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: - -[comment]: # ( SHA256STAMP:93c258c5a9352584515769c2db1f000ca8b565fea2eeb7a9c262a2edc58ed091) diff --git a/doc/lightning-bkpr-listincome.7.md b/doc/lightning-bkpr-listincome.7.md deleted file mode 100644 index 887e541fbbc4..000000000000 --- a/doc/lightning-bkpr-listincome.7.md +++ /dev/null @@ -1,60 +0,0 @@ -lightning-bkpr-listincome -- Command for listing all income impacting events -======================================================================= - -SYNOPSIS --------- - -**bkpr-listincome** \[*consolidate\_fees*\] \[*start\_time*\] \[*end\_time*\] - -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 ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -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. - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -AUTHOR ------- - -niftynei is mainly responsible. - -SEE ALSO --------- - -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 deleted file mode 100644 index d0e913930f3b..000000000000 --- a/doc/lightning-blacklistrune.7.md +++ /dev/null @@ -1,44 +0,0 @@ -lightning-blacklistrune -- Command to prevent a rune from working -============================================================== - -SYNOPSIS --------- - -**blacklistrune** [*start* [*end*]] - -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. - -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) - -AUTHOR ------- - -Shahana Farooqui <> is mainly responsible. - -SEE ALSO --------- - -lightning-commando-blacklist(7), lightning-showrunes(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:7f9e7ab72e0e8d6e7cc59c560a274ffcfd5d257c73e37866d05ffa74d587fb3f) diff --git a/doc/lightning-check.7.md b/doc/lightning-check.7.md deleted file mode 100644 index 17f634b02be1..000000000000 --- a/doc/lightning-check.7.md +++ /dev/null @@ -1,48 +0,0 @@ -lightning-check -- Command for verifying parameters -============================== - -SYNOPSIS --------- - -**check** *command\_to\_check* [*parameters*] - -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). - -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. - -RETURN VALUE ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object is returned, containing: - -- **command\_to\_check** (string): the *command\_to\_check* argument - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -AUTHOR ------- - -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 deleted file mode 100644 index 010327477ca2..000000000000 --- a/doc/lightning-checkmessage.7.md +++ /dev/null @@ -1,54 +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. - -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 ------------- - -[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 - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-signmessage(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:2e39c4cb816b9585d5e8262a09b873a9eaa0f04ac8f1281bfb36e08f71e5c923) diff --git a/doc/lightning-checkrune.7.md b/doc/lightning-checkrune.7.md deleted file mode 100644 index e70df117b59b..000000000000 --- a/doc/lightning-checkrune.7.md +++ /dev/null @@ -1,49 +0,0 @@ -lightning-checkrune -- Command to Validate Rune -================================================ - -SYNOPSIS --------- - -**checkrune** *rune* [*nodeid*] [*method*] [*params*] - -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. - -RETURN VALUE ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object is returned, containing: - -- **valid** (boolean): true if the rune is valid - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -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. - -AUTHOR ------- - -Shahana Farooqui <> is mainly responsible -for consolidating logic from commando. - -SEE ALSO --------- - -lightning-createrune(7), lightning-blacklistrune(7) - -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 deleted file mode 100644 index 95c34a56a21e..000000000000 --- a/doc/lightning-close.7.md +++ /dev/null @@ -1,130 +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*. - -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. - -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 ------------- - -[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") - -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. - -AUTHOR ------- - -ZmnSCPxj <> is mainly responsible. - -SEE ALSO --------- - -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 deleted file mode 100644 index 8607f35b5529..000000000000 --- a/doc/lightning-commando-blacklist.7.md +++ /dev/null @@ -1,42 +0,0 @@ -lightning-commando-blacklist -- Command to prevent a rune from working -====================================================================== - -SYNOPSIS --------- - -**commando-blacklist** [*start* [*end*]] - -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. - -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) - -AUTHOR ------- - -Shahana Farooqui <> is mainly responsible. - -SEE ALSO --------- - -lightning-commando-listrunes(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:7f9e7ab72e0e8d6e7cc59c560a274ffcfd5d257c73e37866d05ffa74d587fb3f) diff --git a/doc/lightning-commando-listrunes.7.md b/doc/lightning-commando-listrunes.7.md deleted file mode 100644 index 87771cdf18f3..000000000000 --- a/doc/lightning-commando-listrunes.7.md +++ /dev/null @@ -1,54 +0,0 @@ -lightning-commando-listrunes -- Command to list previously generated runes -========================================================================== - -SYNOPSIS --------- - -**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. - -NOTE: Runes generated prior to v23.05 were not stored, so will not appear in this list. - -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: - -- **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) - -AUTHOR ------- - -Shahana Farooqui <> is mainly responsible. - -SEE ALSO --------- - -lightning-commando-rune(7), lightning-commando-blacklist(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:f951001acafe71d2ab6d95367bd122067f449af71e755672e44e719fc5a8c1fa) diff --git a/doc/lightning-commando-rune.7.md b/doc/lightning-commando-rune.7.md deleted file mode 100644 index 08ac7a025e36..000000000000 --- a/doc/lightning-commando-rune.7.md +++ /dev/null @@ -1,221 +0,0 @@ -lightning-commando-rune -- Command to Authorize Remote Peer Access -=================================================================== - -SYNOPSIS --------- - -**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". - -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! - -EXAMPLES --------- - -This creates a fresh rune which can do anything: - - $ 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" - } - -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: - - $ 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" - } - -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 - } - - -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 ------------- - -[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) - -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) - -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: - -[comment]: # ( SHA256STAMP:b211db22d5bb348471b259839c4fd15f72bf5d2056d1dc857f5e2db4a7268e14) diff --git a/doc/lightning-commando.7.md b/doc/lightning-commando.7.md deleted file mode 100644 index 52ab1f94936a..000000000000 --- a/doc/lightning-commando.7.md +++ /dev/null @@ -1,52 +0,0 @@ -lightning-commando -- Command to Send a Command to a Remote Peer -================================================================ - -SYNOPSIS --------- - -**commando** *peer\_id* *method* [*params*] [*rune*] - -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. - -RETURN VALUE ------------- - -On success, the return depends on the *method* invoked. - -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: - -[comment]: # ( SHA256STAMP:6f4406cae30cab813b3bf4e1242af914276716a057e558474e29340665ee8c2f) diff --git a/doc/lightning-connect.7.md b/doc/lightning-connect.7.md deleted file mode 100644 index 5f784346795d..000000000000 --- a/doc/lightning-connect.7.md +++ /dev/null @@ -1,108 +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. - -*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). - -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. - -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") - - 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 - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -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" : "..." } - -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: - -[comment]: # ( SHA256STAMP:fc79236aaca9d4c46a85e73c7f3e5fae92436a86f26e48f6bc53b870e954d769) diff --git a/doc/lightning-createinvoice.7.md b/doc/lightning-createinvoice.7.md deleted file mode 100644 index 003c0cb8add0..000000000000 --- a/doc/lightning-createinvoice.7.md +++ /dev/null @@ -1,83 +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. - -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 ------------- - -(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) - -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: - -[comment]: # ( SHA256STAMP:ad1c985a529da5c845c1d6d348556e61531a6ec75e9a47dc91e9a276008d3ffa) diff --git a/doc/lightning-createonion.7.md b/doc/lightning-createonion.7.md deleted file mode 100644 index 5cd3ba94c9a5..000000000000 --- a/doc/lightning-createonion.7.md +++ /dev/null @@ -1,135 +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. - -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: - -```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](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. - -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) - -EXAMPLE -------- - -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**. - -AUTHOR ------- - -Christian Decker <> is mainly responsible. - -SEE ALSO --------- - -lightning-sendonion(7), lightning-getroute(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:faac7539bd94fe5e561350f36002895ad2f3d4539f8bb4688027b6a81ec6f70c) diff --git a/doc/lightning-createrune.7.md b/doc/lightning-createrune.7.md deleted file mode 100644 index dbc8ce2acaaa..000000000000 --- a/doc/lightning-createrune.7.md +++ /dev/null @@ -1,225 +0,0 @@ -lightning-createrune -- Command to Create/Update Rune for Authorizing Remote Peer Access -========================================================================================= - -SYNOPSIS --------- - -**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". - -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! - -EXAMPLES --------- - -This creates a fresh rune which can do anything: - - $ lightning-cli createrune - { - "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" - } - -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: - - $ 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" - } - -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 - } - - -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 ------------- - -[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) - -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) - -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: - -[comment]: # ( SHA256STAMP:b211db22d5bb348471b259839c4fd15f72bf5d2056d1dc857f5e2db4a7268e14) diff --git a/doc/lightning-datastore.7.md b/doc/lightning-datastore.7.md deleted file mode 100644 index 80984849afd6..000000000000 --- a/doc/lightning-datastore.7.md +++ /dev/null @@ -1,70 +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* 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 ------------- - -[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) - -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: - -[comment]: # ( SHA256STAMP:098e407da175f50d8c5e9c70d61b7e9e586f74ad395a9e86532641e106eb2d60) diff --git a/doc/lightning-datastoreusage.7.md b/doc/lightning-datastoreusage.7.md deleted file mode 100644 index aa9758fe2407..000000000000 --- a/doc/lightning-datastoreusage.7.md +++ /dev/null @@ -1,43 +0,0 @@ -lightning-datastoreusage -- Command for listing datastore usage info -============================================================ - -SYNOPSIS --------- - -**datastoreusage** - -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. -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) - -AUTHOR ------- - -Peter Neuroth <> is mainly responsible. - -SEE ALSO --------- - -lightning-datastore(7), lightning-deldatastore(7), lightning-listdatastore(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:3c3f29e7b2489959fe4c36dd1bdb1db7023a47ade6298101fb4fba411bce4dc2) diff --git a/doc/lightning-decode.7.md b/doc/lightning-decode.7.md deleted file mode 100644 index c850d60a9b92..000000000000 --- a/doc/lightning-decode.7.md +++ /dev/null @@ -1,313 +0,0 @@ -lightning-decode -- Command for decoding an invoice string (low-level) -======================================================================= - -SYNOPSIS --------- - -**decode** *string* - -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. - -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! - -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 - - 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): 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 - - 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): 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 - - 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): 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 - -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 - -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)* - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-pay(7), lightning-offer(7), lightning-fetchinvoice(7), lightning-sendinvoice(7), lightning-commando-rune(7) - -[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 deleted file mode 100644 index b93a4fe4c521..000000000000 --- a/doc/lightning-decodepay.7.md +++ /dev/null @@ -1,74 +0,0 @@ -lightning-decodepay -- Command for decoding a bolt11 string (low-level) -======================================================================= - -SYNOPSIS --------- - -**decodepay** *bolt11* [*description*] - -DESCRIPTION ------------ - -The **decodepay** RPC command checks and parses a *bolt11* string as -specified by the BOLT 11 specification. - -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. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -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 ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:a5939424a8e93fc4e79a702753b58fa3da4e4c5efa00571d46dd35c9a68ea38e) diff --git a/doc/lightning-deldatastore.7.md b/doc/lightning-deldatastore.7.md deleted file mode 100644 index 466190782648..000000000000 --- a/doc/lightning-deldatastore.7.md +++ /dev/null @@ -1,53 +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. - -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) - -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: - -[comment]: # ( SHA256STAMP:7eaa7b42799aa2a1ee0719abd3e1c12cd135c1031b6c363ae52e339aa5670a47) diff --git a/doc/lightning-delexpiredinvoice.7.md b/doc/lightning-delexpiredinvoice.7.md deleted file mode 100644 index 7a863d1a9ca1..000000000000 --- a/doc/lightning-delexpiredinvoice.7.md +++ /dev/null @@ -1,41 +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*. - -If *maxexpirytime* is not specified then all expired invoices are -deleted. - -RETURN VALUE ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an empty object is returned. - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -AUTHOR ------- - -ZmnSCPxj <> is mainly responsible. - -SEE ALSO --------- - -lightning-delinvoice(7), lightning-autoclean-status(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:8e8ea93d37e6896251df4a07648383e72064aa75f0a415820f773178fc35083c) diff --git a/doc/lightning-delforward.7.md b/doc/lightning-delforward.7.md deleted file mode 100644 index c8304843dc01..000000000000 --- a/doc/lightning-delforward.7.md +++ /dev/null @@ -1,58 +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. - -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 ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an empty object is returned. - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -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: - -[comment]: # ( SHA256STAMP:3faddc7dd03a73725f4a3e7249c7a417a11c6ac31f8666a9df2a8e5ebcfe2875) diff --git a/doc/lightning-delinvoice.7.md b/doc/lightning-delinvoice.7.md deleted file mode 100644 index f9f4a16d1774..000000000000 --- a/doc/lightning-delinvoice.7.md +++ /dev/null @@ -1,86 +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. - -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 ------------- - -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)* - -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 - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -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: - -[comment]: # ( SHA256STAMP:de866707ddf6d47a646cf83f7c190a9f09f623d6d4e39dab01357c0074f6566c) diff --git a/doc/lightning-delpay.7.md b/doc/lightning-delpay.7.md deleted file mode 100644 index 33105400e542..000000000000 --- a/doc/lightning-delpay.7.md +++ /dev/null @@ -1,112 +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`. 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. - -EXAMPLE JSON REQUEST ------------- -```json -{ - "id": 82, - "method": "delpay", - "params": { - "payment_hash": "4fa2f1b001067ec06d7f95b8695b8acd9ef04c1b4d1110e3b94e1fa0687bb1e0", - "status": "complete" - } -} -``` - -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) - -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. - -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 ------- - -Vincenzo Palazzo <> is mainly responsible. - -SEE ALSO --------- - -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 deleted file mode 100644 index 55506b05b32a..000000000000 --- a/doc/lightning-deprecations.7.md +++ /dev/null @@ -1,49 +0,0 @@ -lightning-deprecations -- Command to enable/disable deprecated APIs -=================================================================== - -SYNOPSIS --------- - -**deprecations** *enable* - -DESCRIPTION ------------ - -(Added *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. - - -EXAMPLE JSON REQUEST --------------------- -```json -{ - "id": 82, - "method": "deprecations", - "params": { - "enable": false - } -} -``` - -RETURN VALUE ------------- - -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-disableinvoicerequest.7.md b/doc/lightning-disableinvoicerequest.7.md deleted file mode 100644 index 6bb652d70bd7..000000000000 --- a/doc/lightning-disableinvoicerequest.7.md +++ /dev/null @@ -1,54 +0,0 @@ -lightning-disableinvoicerequest -- Command for removing an invoice request -========================================================================== - -SYNOPSIS --------- -**(WARNING: experimental-offers only)** - -**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).. - -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 ------------- - -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) - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -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 deleted file mode 100644 index ef92868ff5ea..000000000000 --- a/doc/lightning-disableoffer.7.md +++ /dev/null @@ -1,77 +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). - -EXAMPLE JSON REQUEST ------------- -```json -{ - "id": 82, - "method": "disableoffer", - "params": { - "offer_id": "713a16ccd4eb10438bdcfbc2c8276be301020dd9d489c530773ba64f3b33307d ", - } -} -``` - -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) - -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: - -[comment]: # ( SHA256STAMP:b8d233fdc0130cb4768ee07176707ca24a6db8c863f65530cf0ec8f1b82d7462) diff --git a/doc/lightning-disconnect.7.md b/doc/lightning-disconnect.7.md deleted file mode 100644 index 960799c122d4..000000000000 --- a/doc/lightning-disconnect.7.md +++ /dev/null @@ -1,62 +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. 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 ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an empty object is returned. - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -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: - -[comment]: # ( SHA256STAMP:b0793c2fa864b0ce3bc6f1618135f28ac551dfd1b8a0127caac73fd948e62d9d) diff --git a/doc/lightning-emergencyrecover.7.md b/doc/lightning-emergencyrecover.7.md deleted file mode 100644 index 31af839ffda3..000000000000 --- a/doc/lightning-emergencyrecover.7.md +++ /dev/null @@ -1,44 +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. - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **stubs** (array of hexs): - - Each item is the channel ID of the channel successfully inserted - - -AUTHOR ------- - -Aditya <> is mainly responsible. - -SEE ALSO --------- - -lightning-getsharedsecret(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:9cfaa9eb4609b36accc3e3b12a352c00ddd402307e4461f4df274146d12f6eb0) diff --git a/doc/lightning-feerates.7.md b/doc/lightning-feerates.7.md deleted file mode 100644 index 330f9e9021af..000000000000 --- a/doc/lightning-feerates.7.md +++ /dev/null @@ -1,147 +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. - -*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`. - -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**. - -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. - -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". - -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: - -[comment]: # ( SHA256STAMP:e0da3f19e5ae27cebe038c1c7c3188405a56bf283ef4d897bf8fb9d63f9b3039) diff --git a/doc/lightning-fetchinvoice.7.md b/doc/lightning-fetchinvoice.7.md deleted file mode 100644 index 5d091834a055..000000000000 --- a/doc/lightning-fetchinvoice.7.md +++ /dev/null @@ -1,93 +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`. - -*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 ------------- - -[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) - -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: - -[comment]: # ( SHA256STAMP:fb90f5792c2d809ee17e8bc4c838802404a1bc2c0900516cce8393fc440fecb8) diff --git a/doc/lightning-fundchannel.7.md b/doc/lightning-fundchannel.7.md deleted file mode 100644 index 4b9bbc36504f..000000000000 --- a/doc/lightning-fundchannel.7.md +++ /dev/null @@ -1,143 +0,0 @@ -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*] - -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). - -*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 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"]' - -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` -- **mindepth** (u32, optional): Number of confirmations before we consider the channel active. - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -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: - -[comment]: # ( SHA256STAMP:b890bd25970e8e1ef92812daa89a25ded100173f9ab411492a87d6cd268ee32d) diff --git a/doc/lightning-fundchannel_cancel.7.md b/doc/lightning-fundchannel_cancel.7.md deleted file mode 100644 index b95cc991f621..000000000000 --- a/doc/lightning-fundchannel_cancel.7.md +++ /dev/null @@ -1,63 +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. - -*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. - -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. - -RETURN VALUE ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object is returned, containing: - -- **cancelled** (string): A message indicating it was cancelled by RPC - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -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: - -[comment]: # ( SHA256STAMP:8b0f33ba88ad83b91b4f574b1a6320690bf5cd2fdb4cc731691a8be62edb7671) diff --git a/doc/lightning-fundchannel_complete.7.md b/doc/lightning-fundchannel_complete.7.md deleted file mode 100644 index fd10e2ffab55..000000000000 --- a/doc/lightning-fundchannel_complete.7.md +++ /dev/null @@ -1,65 +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. - -*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 -successfully completes. Broadcasting transaction before can lead to -unrecoverable loss of funds. - -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*) - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -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: - -[comment]: # ( SHA256STAMP:68a03c118fd7851c8025f52f52393d108d26e1045e126cd194e7605867114b24) diff --git a/doc/lightning-fundchannel_start.7.md b/doc/lightning-fundchannel_start.7.md deleted file mode 100644 index b8d5c62a475a..000000000000 --- a/doc/lightning-fundchannel_start.7.md +++ /dev/null @@ -1,119 +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. - -*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 -are not secured until the complete command succeeds. Broadcasting -transaction before that can lead to unrecoverable loss of funds. - -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` - -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) - -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: - -[comment]: # ( SHA256STAMP:55a714d25c1e01c90076462f022ad814aad42bbf824ba44060d406d53ebcad0c) diff --git a/doc/lightning-funderupdate.7.md b/doc/lightning-funderupdate.7.md deleted file mode 100644 index 300b69e2f20b..000000000000 --- a/doc/lightning-funderupdate.7.md +++ /dev/null @@ -1,150 +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*] - -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). - -* `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. - -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. - -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") -- **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. - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -The following error code may occur: - -- -32602: If the given parameters are invalid. - -AUTHOR ------- - -@niftynei <> is mainly responsible. - -SEE ALSO --------- - -lightning-fundchannel(7), lightning-listfunds(7) - - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:64262de96cbce3ee1914ffed90e5a5112c2448703406e33c0056790e6ed68320) diff --git a/doc/lightning-fundpsbt.7.md b/doc/lightning-fundpsbt.7.md deleted file mode 100644 index ec2697d25ff2..000000000000 --- a/doc/lightning-fundpsbt.7.md +++ /dev/null @@ -1,115 +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*] - -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 -------------- - -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. - -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. - -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: - -[comment]: # ( SHA256STAMP:b54a80322773ed94fdf3337d709fcdeb71eb1dd91509407aaa65d2d14060da05) diff --git a/doc/lightning-getinfo.7.md b/doc/lightning-getinfo.7.md deleted file mode 100644 index f9488136ec47..000000000000 --- a/doc/lightning-getinfo.7.md +++ /dev/null @@ -1,142 +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": 82, - "method": "getinfo", - "params": {} -} -``` - -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 - - 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 - - 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. - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -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" - } -} - -``` - - -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: - -[comment]: # ( SHA256STAMP:7cbf6da26c94f60886abf79637e70d5c00a4d50a204cc3c2c2433e929188131a) diff --git a/doc/lightning-getlog.7.md b/doc/lightning-getlog.7.md deleted file mode 100644 index 9ab39594187b..000000000000 --- a/doc/lightning-getlog.7.md +++ /dev/null @@ -1,98 +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*: A string that represents the log level (*broken*, *unusual*, *info*, *debug*, or *io*). The default is *info*. - -EXAMPLE JSON REQUEST --------------------- -```json -{ - "id": 82, - "method": "getlog", - "params": { - "level": "debug" - } -} -``` - -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 -- **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 - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -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. - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:10caba663098a54c2273026882187958afe8cd334dfe7f3457909bf2dc0b717d) diff --git a/doc/lightning-getroute.7.md b/doc/lightning-getroute.7.md deleted file mode 100644 index d4739416128b..000000000000 --- a/doc/lightning-getroute.7.md +++ /dev/null @@ -1,311 +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*-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. - -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. - -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 ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -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") - -[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. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -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 deleted file mode 100644 index 5efe98337b88..000000000000 --- a/doc/lightning-help.7.md +++ /dev/null @@ -1,72 +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. - -EXAMPLE JSON REQUEST --------------------- -```json -{ - "id": 82, - "method": "help", - "params": {} -} -``` - -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) - -On failure, one of the following error codes may be returned: - -- -32602: Error in given parameters. - -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). " - } - ] -} -``` - -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: - -[comment]: # ( SHA256STAMP:2215b33f35ca1e21be55a68c24708a44d5e6525e9d681a92e3f43ffc0114bff4) 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 deleted file mode 100644 index 5c7dca5d5ef1..000000000000 --- a/doc/lightning-invoice.7.md +++ /dev/null @@ -1,124 +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. - -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 ------------- - -[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)* - -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) - -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: - -[comment]: # ( SHA256STAMP:1ca3d3b2f0ec5ef0a1dd702e6ce0c17125f8c9bbd3d91d73243b38eb9c4ad84e) diff --git a/doc/lightning-invoicerequest.7.md b/doc/lightning-invoicerequest.7.md deleted file mode 100644 index ede4998a7700..000000000000 --- a/doc/lightning-invoicerequest.7.md +++ /dev/null @@ -1,86 +0,0 @@ -lightning-invoicerequest -- Command for offering payments -========================================================= - -SYNOPSIS --------- - -**(WARNING: experimental-offers only)** - -**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. - -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 ------------- - -[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) - -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: - -- -1: Catchall nonspecific error. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -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 deleted file mode 100644 index 4b987c8cc15d..000000000000 --- a/doc/lightning-keysend.7.md +++ /dev/null @@ -1,123 +0,0 @@ -lightning-keysend -- Send funds to a node without an invoice -============================================================ - -SYNOPSIS --------- - -**keysend** *destination* *amount\_msat* [*label*] [*maxfeepercent*] [*retry\_for*] [*maxdelay*] [*exemptfee*] [*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`. - -`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. - -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 ------------- - -[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 - -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) - -You can monitor the progress and retries of a payment using the lightning-paystatus(7) command. - -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: - -[comment]: # ( SHA256STAMP:6b81d49a305cb833336af71dc2cadfa608957c4283194638d2b4cdc8575a1d8c) diff --git a/doc/lightning-listchannels.7.md b/doc/lightning-listchannels.7.md deleted file mode 100644 index dca5003065a3..000000000000 --- a/doc/lightning-listchannels.7.md +++ /dev/null @@ -1,86 +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). - -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 -broadcast on the gossip network. - -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 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: - -Lightning RFC site - -- BOLT \#7: - - -[comment]: # ( SHA256STAMP:3c6cfe3faea9b58c4faeaa9aa695ae0ce05a9771f6e3b5396c754426d898e3eb) diff --git a/doc/lightning-listclosedchannels.7.md b/doc/lightning-listclosedchannels.7.md deleted file mode 100644 index 7c74836bf3ed..000000000000 --- a/doc/lightning-listclosedchannels.7.md +++ /dev/null @@ -1,80 +0,0 @@ -lightning-listclosedchannels -- Get data on our closed historical channels -========================================================================== - -SYNOPSIS --------- - -**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). - -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 -- **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)* - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -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 - -[comment]: # ( SHA256STAMP:559d917217fe6d765d8bf019e46bf03d37dae9a437e530b1456252bcb901cbc9) diff --git a/doc/lightning-listconfigs.7.md b/doc/lightning-listconfigs.7.md deleted file mode 100644 index 93395d97d5af..000000000000 --- a/doc/lightning-listconfigs.7.md +++ /dev/null @@ -1,482 +0,0 @@ -lightning-listconfigs -- Command to list all configuration options. -================================================================ - -SYNOPSIS --------- - -**listconfigs** [*config*] - -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 -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 --------------------- - -```json -{ - "id": 82, - "method": "listconfigs", - "params": { - "config": "network" - } -} -``` - -RETURN VALUE ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -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") - - **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): - - field from config or cmdline - - **sources** (array of strings): - - source of configuration setting - - **plugin** (object, optional): - - **values\_str** (array of strings): - - field from config or cmdline - - **sources** (array of strings): - - source of configuration setting - - **plugin-dir** (object, optional): - - **values\_str** (array of strings): - - field from config or cmdline - - **sources** (array of strings): - - 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): - - field from config or cmdline - - **sources** (array of strings): - - 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): field from config or cmdline, or default (always 6 characters) - - **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): Can this be set by setconfig() (always *true*) - - **addr** (object, optional): - - **values\_str** (array of strings): - - field from config or cmdline - - **sources** (array of strings): - - source of configuration setting - - **announce-addr** (object, optional): - - **values\_str** (array of strings): - - field from config or cmdline - - **sources** (array of strings): - - source of configuration setting - - **bind-addr** (object, optional): - - **values\_str** (array of strings): - - field from config or cmdline - - **sources** (array of strings): - - 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): field from config or cmdline, or default (one of "true", "false", "auto") - - **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): - - field from config or cmdline - - **sources** (array of strings): - - 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): - - field from config or cmdline - - **sources** (array of strings): - - 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**: - - `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)* -- **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) - - -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 ---------------------- - -```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/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", -} - -``` - -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: - -[comment]: # ( SHA256STAMP:89743916ac51dc00d774c4d3c33715521846b36bc77e0b2083a262ef32b130f4) diff --git a/doc/lightning-listdatastore.7.md b/doc/lightning-listdatastore.7.md deleted file mode 100644 index 1e25879bfbaf..000000000000 --- a/doc/lightning-listdatastore.7.md +++ /dev/null @@ -1,51 +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. - -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 ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -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) - -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: - -[comment]: # ( SHA256STAMP:774755024cb431c96e74f5ca634cf8c03da853caa740c196b6ef24cdcf942874) diff --git a/doc/lightning-listforwards.7.md b/doc/lightning-listforwards.7.md deleted file mode 100644 index c47e0603f5a6..000000000000 --- a/doc/lightning-listforwards.7.md +++ /dev/null @@ -1,75 +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. - -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 ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -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") - -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 - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -AUTHOR ------- - -Rene Pickhardt <> is mainly responsible. - -SEE ALSO --------- - -lightning-autoclean-status(7), lightning-getinfo(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:59b3f52c26252730440bc305dabaf191edcacc9ba87021ce4b9065f37f873e5c) diff --git a/doc/lightning-listfunds.7.md b/doc/lightning-listfunds.7.md deleted file mode 100644 index 8d1b68b7de52..000000000000 --- a/doc/lightning-listfunds.7.md +++ /dev/null @@ -1,77 +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* is a boolean: if true, then the *outputs* will include spent outputs -in addition to the unspent ones. Default is false. - -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 - - **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): 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)* - - 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) - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -AUTHOR ------- - -Felix <> is mainly responsible. - -SEE ALSO --------- - -lightning-newaddr(7), lightning-fundchannel(7), lightning-withdraw(7), lightning-listtransactions(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:0b6c17b8595fb242b2be02fa6dac412534f355b0d41b96ff6a7cd9c389573ead) diff --git a/doc/lightning-listhtlcs.7.md b/doc/lightning-listhtlcs.7.md deleted file mode 100644 index 2fe30c6e3744..000000000000 --- a/doc/lightning-listhtlcs.7.md +++ /dev/null @@ -1,49 +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). 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). - -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: - -- **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") - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-listforwards(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:e787b9ea6bee54252239ba2f2b7220f5f3c79b2932c0b5a9ea255fbf1b14cf55) diff --git a/doc/lightning-listinvoicerequests.7.md b/doc/lightning-listinvoicerequests.7.md deleted file mode 100644 index 8dd5f27e9333..000000000000 --- a/doc/lightning-listinvoicerequests.7.md +++ /dev/null @@ -1,50 +0,0 @@ -lightning-listinvoicerequests -- Command for querying invoice\_request status -============================================================================= - -SYNOPSIS --------- - -**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. - -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 ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -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 - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -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 deleted file mode 100644 index 32c45db1deb7..000000000000 --- a/doc/lightning-listinvoices.7.md +++ /dev/null @@ -1,71 +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. - -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. - -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)* - -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) - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -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 deleted file mode 100644 index ab83f066872b..000000000000 --- a/doc/lightning-listnodes.7.md +++ /dev/null @@ -1,103 +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. - -EXAMPLE JSON REQUEST ------------- -```json -{ - "id": 82, - "method": "listnodes", - "params": { - "id": "02e29856dab8ddd9044c18486e4cab79ec717b490447af2d4831e290e48d57638a" - } -} -``` - -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: - -- **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 - - 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 - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -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. - -SEE ALSO --------- - -FIXME: - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:54744d83c606d436d62335f02525804cbbfa9c488e45f8b776a4b4c99a251f08) diff --git a/doc/lightning-listoffers.7.md b/doc/lightning-listoffers.7.md deleted file mode 100644 index a1a31577141a..000000000000 --- a/doc/lightning-listoffers.7.md +++ /dev/null @@ -1,84 +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). If `active_only` is -set and is true, only offers with `active` true are returned. - -EXAMPLE JSON REQUEST ------------- -```json -{ - "id": 82, - "method": "listoffers", - "params": { - "active_only": false - } -} -``` - -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 - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -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 - } - ] -} - -``` - - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -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 deleted file mode 100644 index d82e413bcea2..000000000000 --- a/doc/lightning-listpays.7.md +++ /dev/null @@ -1,62 +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. -It is possible filter the payments also by *status*. - -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: - -- **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). - -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. - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -The returned array is ordered by increasing **created\_at** fields. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -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 deleted file mode 100644 index 2aa51ac92284..000000000000 --- a/doc/lightning-listpeerchannels.7.md +++ /dev/null @@ -1,224 +0,0 @@ -lightning-listpeerchannels -- Command returning data on channels of connected lightning nodes -========================================================================== - -SYNOPSIS --------- - -**listpeerchannels** \[*id*\] - -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. - -Supplying *id* will filter the results to only return channel data that match *id*, -if one exists. - -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): 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") -- **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") -- **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 -- **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", "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 -- **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) - - 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") - - 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") - -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) - -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) - -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). - -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-setchannelfee(7) - -RESOURCES ---------- - -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 deleted file mode 100644 index fe3c12cd5ff8..000000000000 --- a/doc/lightning-listpeers.7.md +++ /dev/null @@ -1,403 +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. - -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". - -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. - -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: - -- **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: - - **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) **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") - - **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") - - **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 - - **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 - - **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) - - 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") - - 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") - - If **close\_to** is present: - - - **close\_to\_addr** (string, optional): The bitcoin address we will close to - - 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 - - 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: - - 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. - -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): - - -[comment]: # ( SHA256STAMP:5b622ce05ce081a3184b01dc1cf5d2d5882293e171b3a3a118efff3748d8e25a) diff --git a/doc/lightning-listsendpays.7.md b/doc/lightning-listsendpays.7.md deleted file mode 100644 index 26b7d00d68fb..000000000000 --- a/doc/lightning-listsendpays.7.md +++ /dev/null @@ -1,76 +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 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 ------------- - -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). - -If **status** is "complete": - - - **payment\_preimage** (secret): the proof of payment: SHA256 of this **payment\_hash** - -If **status** is "failed": - - - **erroronion** (hex, optional): the onion message returned - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -AUTHOR ------- - -Christian Decker <> is mainly -responsible. - -SEE ALSO --------- - -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 deleted file mode 100644 index f399f6ed32e5..000000000000 --- a/doc/lightning-listsqlschemas.7.md +++ /dev/null @@ -1,109 +0,0 @@ -lightning-listsqlschemas -- Command to example lightning-sql schemas -==================================================================== - -SYNOPSIS --------- - -**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. - -If *table* is given, only that table is in the resulting list, otherwise -all tables are listed. - -EXAMPLE JSON REQUEST ------------- -```json -{ - "id": 82, - "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" - ] - ] - } - ] -} -``` - -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: - -- **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 - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-sql(7). - -RESOURCES ---------- - -Main web site: -[comment]: # ( SHA256STAMP:1b00b9a14c9b433321cbf661fdb39cebd2c5fd5239ab80c3ebb845d7705c47d0) diff --git a/doc/lightning-listtransactions.7.md b/doc/lightning-listtransactions.7.md deleted file mode 100644 index 43a0c9881969..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": 82, - "method": "listtransactions", - "params": {} -} -``` - -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) - -On failure, one of the following error codes may be returned: - -- -32602: Error in given parameters. - -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" - } - ] - } - ] -} -``` - - -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: - -[comment]: # ( SHA256STAMP:6b91e8a2ad267e8ec6f0f40f5f8bd00fa7e0b415f722b1cf1535fd3f132c35bf) diff --git a/doc/lightning-makesecret.7.md b/doc/lightning-makesecret.7.md deleted file mode 100644 index d6d93db5c01b..000000000000 --- a/doc/lightning-makesecret.7.md +++ /dev/null @@ -1,42 +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. - -One of *hex* or *string* must be specified: *hex* can be any hex data, -*string* is a UTF-8 string interpreted literally. - -RETURN VALUE ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object is returned, containing: - -- **secret** (secret): the pseudorandom key derived from HSM\_secret - -[comment]: # (GENERATE-FROM-SCHEMA-END) - - -The following error codes may occur: - -- -1: Catchall nonspecific error. - -AUTHOR ------- - -Aditya <> is mainly responsible. - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:098d2882774cb9f33fb8aa93b7be1bf102d96a4835c550fdda7828ab5812490d) diff --git a/doc/lightning-multifundchannel.7.md b/doc/lightning-multifundchannel.7.md deleted file mode 100644 index 888c7bea1e87..000000000000 --- a/doc/lightning-multifundchannel.7.md +++ /dev/null @@ -1,217 +0,0 @@ -lightning-multifundchannel -- Command for establishing many lightning channels -============================================================================== - -SYNOPSIS --------- - -**multifundchannel** *destinations* [*feerate*] [*minconf*] [*utxos*] [*minchannels*] [*commitment\_feerate*] [*channel\_type*] - -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* 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 ------------- - -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. - -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 -------- - -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): - -``` -$ 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": [] -} -``` - -AUTHOR ------- - -ZmnSCPxj <> is mainly responsible. - -SEE ALSO --------- - -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 deleted file mode 100644 index ca450b66d708..000000000000 --- a/doc/lightning-multiwithdraw.7.md +++ /dev/null @@ -1,70 +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*, -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. - -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) - -On failure, an error is reported and the withdrawal 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. -- 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: - -[comment]: # ( SHA256STAMP:ba123ea4052af7850655f99ee85ed42c0254d7c15ba3861df0574fd58e4d8355) diff --git a/doc/lightning-newaddr.7.md b/doc/lightning-newaddr.7.md deleted file mode 100644 index 3fcc67d9fa78..000000000000 --- a/doc/lightning-newaddr.7.md +++ /dev/null @@ -1,59 +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. - -*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`. - -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 - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -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: - -[comment]: # ( SHA256STAMP:443545e42992626b55c87dd694b272aba58a2fd80e776edad95428e161f229a3) diff --git a/doc/lightning-notifications.7.md b/doc/lightning-notifications.7.md deleted file mode 100644 index 3f39affd36ec..000000000000 --- a/doc/lightning-notifications.7.md +++ /dev/null @@ -1,106 +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*: *true* to enable notifications, *false* to disable them. - -EXAMPLE JSON REQUEST --------------------- -```json -{ - "id": 82, - "method": "notifications", - "params": { - "enable": true - } -} -``` - -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 ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an empty object is returned. - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -On success, if *enable* was *true*, notifications will be forwarded -from then on. - -On failure, one of the following error codes may be returned: - -- -32602: Error in given parameters. - -EXAMPLE NOTIFICATIONS ---------------------- - -```json -{ - "method": "message", - "params": { - "id": 83, - "message": "This is a test message", - "level": "DEBUG" - } -} -``` - -```json -{ - "method": "progress", - "params": { - "id": 83, - "num": 0, - "total": 30 - "stage": { - "num": 0, - "total": 2 - } - } -} -``` - -AUTHOR ------- - -Rusty Russell <> wrote the initial version of this man page. - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:b0793c2fa864b0ce3bc6f1618135f28ac551dfd1b8a0127caac73fd948e62d9d) diff --git a/doc/lightning-offer.7.md b/doc/lightning-offer.7.md deleted file mode 100644 index df237c703fd3..000000000000 --- a/doc/lightning-offer.7.md +++ /dev/null @@ -1,137 +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*] [*recurrence\_start\_any\ -_period*] - -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. - -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) - -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. - -The following error codes may occur: - -- -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: - -[comment]: # ( SHA256STAMP:9938c16e54f86deabe03d86788600f87dffc54492ea4896d4f590916683afb0a) diff --git a/doc/lightning-openchannel_abort.7.md b/doc/lightning-openchannel_abort.7.md deleted file mode 100644 index d8ad16c1ba27..000000000000 --- a/doc/lightning-openchannel_abort.7.md +++ /dev/null @@ -1,59 +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* is id of this channel. - - -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 - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -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 - -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. - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:59ff1f15b6e89bdaaaef184267e8d6ab5c8c0b0ce04b003375de758dc0c345f3) diff --git a/doc/lightning-openchannel_bump.7.md b/doc/lightning-openchannel_bump.7.md deleted file mode 100644 index 388d6efb0d14..000000000000 --- a/doc/lightning-openchannel_bump.7.md +++ /dev/null @@ -1,91 +0,0 @@ -lightning-openchannel\_bump -- Command to initiate a channel RBF -===================================================================== - -SYNOPSIS --------- - -**openchannel\_bump** *channel\_id* *amount* *initalpsbt* [*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. - -*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 ------------- - -[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* -- **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 channel is not in a state that is eligible for RBF, this command -will return an error. - -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 - -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. - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:98faf34f08ec57a266c82dfdb876f35d08187a16c1b6d53fedaa12570144a64f) diff --git a/doc/lightning-openchannel_init.7.md b/doc/lightning-openchannel_init.7.md deleted file mode 100644 index c82df91f55fd..000000000000 --- a/doc/lightning-openchannel_init.7.md +++ /dev/null @@ -1,127 +0,0 @@ -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*] - -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* 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 ------------- - -[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* -- **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. - -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 - -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. - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:2815e0b486c5346d0d058a7670b7e34f55b7ce0f5d35861dd76316e42b7b589d) diff --git a/doc/lightning-openchannel_signed.7.md b/doc/lightning-openchannel_signed.7.md deleted file mode 100644 index 08ac9c1299dd..000000000000 --- a/doc/lightning-openchannel_signed.7.md +++ /dev/null @@ -1,71 +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* 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 ------------- - -[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) - -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 - -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. - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:80378065a1b5cf6db0e6a677a1b4f63e9ddeb54268b31bd278349513be943164) diff --git a/doc/lightning-openchannel_update.7.md b/doc/lightning-openchannel_update.7.md deleted file mode 100644 index 1e2726b9e0c4..000000000000 --- a/doc/lightning-openchannel_update.7.md +++ /dev/null @@ -1,85 +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* 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 ------------- - -[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 -- **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. - -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 - -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. - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:13df70a54c29a3ac4b8f44a0d2f4cdc47928417b7c810bc19ec35fe820558730) diff --git a/doc/lightning-parsefeerate.7.md b/doc/lightning-parsefeerate.7.md deleted file mode 100644 index e27cdda658e9..000000000000 --- a/doc/lightning-parsefeerate.7.md +++ /dev/null @@ -1,47 +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. - -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) - -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: - -[comment]: # ( SHA256STAMP:01ed00df0f944625c827aa538c173e988a7ba7cebbddb16f5a392206a296fbd3) diff --git a/doc/lightning-pay.7.md b/doc/lightning-pay.7.md deleted file mode 100644 index 99855f096c24..000000000000 --- a/doc/lightning-pay.7.md +++ /dev/null @@ -1,173 +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. 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. - -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. - -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 ------------- - -[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 - -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) - -You can monitor the progress and retries of a payment using the -lightning-paystatus(7) command. - -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: - -[comment]: # ( SHA256STAMP:1d2a7a9867493439268aa1b6036f5d23bdfe9337ca3a29463997c9ccdb11b95f) diff --git a/doc/lightning-ping.7.md b/doc/lightning-ping.7.md deleted file mode 100644 index b57e277222e2..000000000000 --- a/doc/lightning-ping.7.md +++ /dev/null @@ -1,74 +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. - -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, - "method": "ping", - "params": { - "len": 128, - "pongbytes": 128 - } -} -``` - -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) - -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 -} - -``` - - -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: - -[comment]: # ( SHA256STAMP:3d65bfe95b32d6f1229fcf9215045516ff04e670de8ba0485e585d699e1b1f71) diff --git a/doc/lightning-plugin.7.md b/doc/lightning-plugin.7.md deleted file mode 100644 index 41e9fe67cf67..000000000000 --- a/doc/lightning-plugin.7.md +++ /dev/null @@ -1,92 +0,0 @@ -lightning-plugin -- Manage plugins with RPC -=========================================== - -SYNOPSIS --------- - -**plugin** *subcommand* [plugin|directory] [*options*] ... - - -DESCRIPTION ------------ - -The **plugin** RPC command 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 -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' -``` - -*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") - -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 - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -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 ------- - -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 deleted file mode 100644 index 28f767e5a8e7..000000000000 --- a/doc/lightning-preapproveinvoice.7.md +++ /dev/null @@ -1,51 +0,0 @@ -lightning-preapproveinvoice -- Ask the HSM to preapprove an invoice (low-level) -================================================================== - -SYNOPSIS --------- - -**preapproveinvoice** *bolt11* - -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. - -RETURN VALUE ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an empty object is returned. - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -AUTHOR ------- - -Ken Sedgwick <> is mainly responsible. - -SEE ALSO --------- - -lightning-pay(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:351b7e2537562036bab7c45cfa1108991ade2a9190ef902afbf9e2804cc0f466) diff --git a/doc/lightning-preapprovekeysend.7.md b/doc/lightning-preapprovekeysend.7.md deleted file mode 100644 index e22c58de7ddd..000000000000 --- a/doc/lightning-preapprovekeysend.7.md +++ /dev/null @@ -1,61 +0,0 @@ -lightning-preapprovekeysend -- Ask the HSM to preapprove a keysend payment (low-level) -================================================================== - -SYNOPSIS --------- - -**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. - -*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. - -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. - -RETURN VALUE ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an empty object is returned. - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -AUTHOR ------- - -Ken Sedgwick <> is mainly responsible. - -SEE ALSO --------- - -lightning-keysend(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:b0793c2fa864b0ce3bc6f1618135f28ac551dfd1b8a0127caac73fd948e62d9d) diff --git a/doc/lightning-recover.7.md b/doc/lightning-recover.7.md deleted file mode 100644 index cbb8c8309ece..000000000000 --- a/doc/lightning-recover.7.md +++ /dev/null @@ -1,42 +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. - -RETURN VALUE ------------- - -On success, an empty object is returned, and your node is restarted. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-hsmtool(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:9cfaa9eb4609b36accc3e3b12a352c00ddd402307e4461f4df274146d12f6eb0) diff --git a/doc/lightning-recoverchannel.7.md b/doc/lightning-recoverchannel.7.md deleted file mode 100644 index ac6c1cfed1b1..000000000000 --- a/doc/lightning-recoverchannel.7.md +++ /dev/null @@ -1,46 +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' - - -RETURN VALUE ------------- - -On success, an object is returned, containing: - -- **stubs** (array of hexs): - - Each item is the channel ID of the channel successfully inserted - - -AUTHOR ------- - -Aditya <> is mainly responsible. - -SEE ALSO --------- - -lightning-getsharedsecret(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:9cfaa9eb4609b36accc3e3b12a352c00ddd402307e4461f4df274146d12f6eb0) diff --git a/doc/lightning-renepay.7.md b/doc/lightning-renepay.7.md deleted file mode 100644 index fc3bb73fbd51..000000000000 --- a/doc/lightning-renepay.7.md +++ /dev/null @@ -1,145 +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 ------------ - -**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 **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 ----------- - -**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 ------------- - -[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. - -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* - -[comment]: # ( SHA256STAMP:946ad2fc9ef6bb6dbab6613b9cb55d34ed5a15dd876efcaeaa41174f0bdc40b0) diff --git a/doc/lightning-renepaystatus.7.md b/doc/lightning-renepaystatus.7.md deleted file mode 100644 index 33a884cd1de6..000000000000 --- a/doc/lightning-renepaystatus.7.md +++ /dev/null @@ -1,55 +0,0 @@ -lightning-renepaystatus -- Command for quering the status of previous renepay attempts -====================================================================================== - -SYNOPSIS --------- - -**renepaystatus** [*invstring*] - - -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 ------------- - -[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) - -AUTHOR ------- - -Eduardo Quintana-Miranda <> is mainly responsible. - -SEE ALSO --------- - -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 deleted file mode 100644 index 6a44c4d7adb0..000000000000 --- a/doc/lightning-reserveinputs.7.md +++ /dev/null @@ -1,68 +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. 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*. - -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 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. - -SEE ALSO --------- - -lightning-unreserveinputs(7), lightning-signpsbt(7), lightning-sendpsbt(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:ca50532790e2f80730b6ec6f066cee5a1e57867548fd36503e8faebc16a205b5) diff --git a/doc/lightning-sendcustommsg.7.md b/doc/lightning-sendcustommsg.7.md deleted file mode 100644 index e5d1a46f3f4e..000000000000 --- a/doc/lightning-sendcustommsg.7.md +++ /dev/null @@ -1,70 +0,0 @@ -lightning-sendcustommsg -- Low-level interface to send protocol messages to peers -===================================================================================== - -SYNOPSIS --------- - -**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. - -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. - -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. - -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object is returned, containing: - -- **status** (string): Information about where message was queued - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -AUTHOR ------- - -Christian Decker <> is mainly responsible. - -SEE ALSO --------- - -lightning-createonion(7), lightning-sendonion(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:5603fac5f46c7f91c625b33d98df1a2a587262788465ebd1db24433989425a2e) diff --git a/doc/lightning-sendinvoice.7.md b/doc/lightning-sendinvoice.7.md deleted file mode 100644 index 82ed2f4a9e8b..000000000000 --- a/doc/lightning-sendinvoice.7.md +++ /dev/null @@ -1,85 +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* 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 ------------- - -[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)* - -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) - -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: - -[comment]: # ( SHA256STAMP:d0fbe11d7a39dce76da63f0d3e4d06ad7da6d94f5efcaaa8c43daafd192d86f9) diff --git a/doc/lightning-sendonion.7.md b/doc/lightning-sendonion.7.md deleted file mode 100644 index 69a2eab3d885..000000000000 --- a/doc/lightning-sendonion.7.md +++ /dev/null @@ -1,140 +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*] - -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 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: - -```json -[ - "298606954e9de3e9d938d18a74fed794c440e8eda82e52dc08600953c8acf9c4", - "2dc094de72adb03b90894192edf9f67919cb2691b37b1f7d4a2f4f31c108b087", - "a7b82b240dbd77a4ac8ea07709b1395d8c510c73c17b4b392bb1f0605d989c85" -] -``` - -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 ------------- - -[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 - -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 - -[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. - -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 -[comment]: # ( SHA256STAMP:eb3725c7a47c32298ca9e13ad6ef3fc90a818354b21fc0b17abd16d8e9515a24) diff --git a/doc/lightning-sendonionmessage.7.md b/doc/lightning-sendonionmessage.7.md deleted file mode 100644 index fdd5ef5a4215..000000000000 --- a/doc/lightning-sendonionmessage.7.md +++ /dev/null @@ -1,46 +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. - -*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 ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an empty object is returned. - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -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 - -[comment]: # ( SHA256STAMP:3faddc7dd03a73725f4a3e7249c7a417a11c6ac31f8666a9df2a8e5ebcfe2875) diff --git a/doc/lightning-sendpay.7.md b/doc/lightning-sendpay.7.md deleted file mode 100644 index 1db7a99b0ad9..000000000000 --- a/doc/lightning-sendpay.7.md +++ /dev/null @@ -1,150 +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. - -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 -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. - -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). - -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 - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -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. - -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: - -[comment]: # ( SHA256STAMP:663977d29846cd633000accebcb272e7983764e5f7aea8704517451836294a46) diff --git a/doc/lightning-sendpsbt.7.md b/doc/lightning-sendpsbt.7.md deleted file mode 100644 index d9f448ebad77..000000000000 --- a/doc/lightning-sendpsbt.7.md +++ /dev/null @@ -1,70 +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*: A string that represents psbt value. -- *reserve*: an optional number of blocks to increase reservation of any of our inputs by; default is 72. - -EXAMPLE JSON REQUEST --------------------- - -```json -{ - "id": 82, - "method": "sendpsbt", - "params": { - "psbt": "some_psbt" - } -} -``` - -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) - -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 -{ - "txid": "05985072bbe20747325e69a159fe08176cc1bbc96d25e8848edad2dddc1165d0", - "tx": "02000000027032912651fc25a3e0893acd5f9640598707e2dfef92143bb5a4020e335442800100000017160014a5f48b9aa3cb8ca6cc1040c11e386745bb4dc932ffffffffd229a4b4f78638ebcac10a68b0561585a5d6e4d3b769ad0a909e9b9afaeae24e00000000171600145c83da9b685f9142016c6f5eb5f98a45cfa6f686ffffffff01915a01000000000017a9143a4dfd59e781f9c3018e7d0a9b7a26d58f8d22bf8700000000", -} -``` - -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: - -[comment]: # ( SHA256STAMP:ba123ea4052af7850655f99ee85ed42c0254d7c15ba3861df0574fd58e4d8355) diff --git a/doc/lightning-setchannel.7.md b/doc/lightning-setchannel.7.md deleted file mode 100644 index 3256e208525e..000000000000 --- a/doc/lightning-setchannel.7.md +++ /dev/null @@ -1,119 +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* 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 ------------- - -[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 - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -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. Rusty Russell <> is mainly -responsible for the Core Lightning project. - -SEE ALSO --------- - -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 deleted file mode 100644 index 49ee652dfa46..000000000000 --- a/doc/lightning-setconfig.7.md +++ /dev/null @@ -1,60 +0,0 @@ -lightning-setconfig -- Dynamically change some config options -============================================================= - -SYNOPSIS --------- - -**setconfig** *config* [*val*] - -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. - - -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) - -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: - -[comment]: # ( SHA256STAMP:9acb35e4b599c17e776ed0bf37b2e55022968ca10cb9d467c2e3f1f8e8d88662) diff --git a/doc/lightning-setpsbtversion.7.md b/doc/lightning-setpsbtversion.7.md deleted file mode 100644 index 753e1b77a323..000000000000 --- a/doc/lightning-setpsbtversion.7.md +++ /dev/null @@ -1,63 +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*: The PSBT to change versions. -- *version*: The version to set. - -EXAMPLE JSON REQUEST ------------- -```json -{ - "id": 82, - "method": "setpsbtversion", - "params": { - "psbt": "cHNidP8BAAoCAAAAAAAAAAAAAA==", - "version": "2" - } -} -``` - -RETURN VALUE ------------- - -If successful the command returns a converted PSBT of the requested version. - -On failure, an error is returned. - -The following error codes may occur: - -- -32602: Parameter missed or malformed; - -EXAMPLE JSON RESPONSE ------ -```json -{ - "psbt": "cHNidP8BAgQCAAAAAQQBAAEFAQABBgEDAfsEAgAAAAA=" -} -``` - - -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 d4b133c9e81d..000000000000 --- a/doc/lightning-showrunes.7.md +++ /dev/null @@ -1,52 +0,0 @@ -lightning-showrunes -- Command to list previously generated runes -================================================================== - -SYNOPSIS --------- - -**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. - -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: - -- **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) - -AUTHOR ------- - -Shahana Farooqui <> is mainly responsible. - -SEE ALSO --------- - -lightning-commando-showrunes(7), lightning-blacklistrune(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:f951001acafe71d2ab6d95367bd122067f449af71e755672e44e719fc5a8c1fa) diff --git a/doc/lightning-signinvoice.7.md b/doc/lightning-signinvoice.7.md deleted file mode 100644 index de2efe6cd660..000000000000 --- a/doc/lightning-signinvoice.7.md +++ /dev/null @@ -1,52 +0,0 @@ -lightning-signinvoice -- Low-level invoice signing -===================================================== - -SYNOPSIS --------- - -**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. - -The *invstring* parameter is of bolt11 form, but the final signature -is ignored. Minimal sanity checks are done. - -RETURN VALUE ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object is returned, containing: - -- **bolt11** (string): the bolt11 string - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -On failure, an error is returned. - -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: - -[comment]: # ( SHA256STAMP:5f0154bc5c2e60c7ae5e238cd803a1171552c7c7fa46ddda538cd71ea1511533) diff --git a/doc/lightning-signmessage.7.md b/doc/lightning-signmessage.7.md deleted file mode 100644 index fedb42c35abe..000000000000 --- a/doc/lightning-signmessage.7.md +++ /dev/null @@ -1,45 +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* must be less that 65536 characters. - -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) - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-checkmessage(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:485db85e3822babcb397b55f251e6797528c3b9e14743d2823e890e2b22432c0) diff --git a/doc/lightning-signpsbt.7.md b/doc/lightning-signpsbt.7.md deleted file mode 100644 index 24c612e2be5a..000000000000 --- a/doc/lightning-signpsbt.7.md +++ /dev/null @@ -1,76 +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. - -- *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. - -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, - "method": "signpsbt", - "params": { - "psbt": "some_psbt" - } -} -``` - -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) - -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 ---------------------- - -```json -{ - "psbt": "some_psbt" -} -``` - -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: - -[comment]: # ( SHA256STAMP:f6607621c81dec26313167c524e994d2511ea556577ee2aca7135cb27ac653c3) diff --git a/doc/lightning-splice_init.7.md b/doc/lightning-splice_init.7.md deleted file mode 100644 index 08cf0295f1ab..000000000000 --- a/doc/lightning-splice_init.7.md +++ /dev/null @@ -1,113 +0,0 @@ -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*] - -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 -lightning-cli splice_init -- $CHANNEL_ID -100000 -``` - -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 -``` - -RETURN VALUE ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object is returned, containing: - -- **psbt** (string): the (incomplete) PSBT of the splice transaction - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -SEE ALSO --------- - -AUTHOR ------- - -@dusty\_daemon - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:86db6fc3e01abf0d325ab80cc82a4c7bd68358511f4a8bd6528040e5db402cd4) diff --git a/doc/lightning-splice_signed.7.md b/doc/lightning-splice_signed.7.md deleted file mode 100644 index 9bcb0cc5174c..000000000000 --- a/doc/lightning-splice_signed.7.md +++ /dev/null @@ -1,95 +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 ------------ - -`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. - -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 -``` - -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) - -SEE ALSO --------- - -AUTHOR ------- - -@dusty\_daemon - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:429eb13039cd6af7180c7de1d74f001eb1090c6c6d404bac0dcb2af51e0ab0f4) diff --git a/doc/lightning-splice_update.7.md b/doc/lightning-splice_update.7.md deleted file mode 100644 index a59933e72b08..000000000000 --- a/doc/lightning-splice_update.7.md +++ /dev/null @@ -1,108 +0,0 @@ -lightning-splice\_update -- Command to initiate a channel to a peer -===================================================================== - -SYNOPSIS --------- -**(WARNING: experimental-splicing only)** - -**splice\_update** *channel\_id* *psbt* - -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 -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. 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 -``` - -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 - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -SEE ALSO --------- - -AUTHOR ------- - -@dusty\_daemon - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:60ebb90eba3d3e5a52266efdad0e226bc2a4fa7b16f7cc67a5bcc33055ddc92c) diff --git a/doc/lightning-sql.7.md b/doc/lightning-sql.7.md deleted file mode 100644 index 6615eae5ae3b..000000000000 --- a/doc/lightning-sql.7.md +++ /dev/null @@ -1,537 +0,0 @@ -lightning-sql -- Command to do complex queries on list commands -=============================================================== - -SYNOPSIS --------- - -**sql** *query* - -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 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. - -It is, however faster for remote access if the result of the query is -much smaller than the list commands would be. - -Note that queries like "SELECT *" are fragile, as columns will -change across releases; see lightning-listsqlschemas(7). - -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`) - - `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`) - - `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`) - -- `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`) - - `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. - -On failure, an error is returned. - -EXAMPLES --------- -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: - -``` -$ lightning-cli sql "SELECT id FROM peers" -{ - "rows": [ - [ - "02ba9965e3db660385bd1dd2c09dd032e0f2179a94fc5db8917b60adf0b363da00" - ] - ] -} -``` - -A statement containing using `=` needs `-o`: - -``` -$ 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: - -``` -$ 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: - -``` -$ 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: - -``` -$ lightning-cli sql 'SELECT COUNT(*) FROM nodes" -{ - "rows": [ - [ - 3 - ] - ] -} -``` - -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: -[comment]: # ( SHA256STAMP:24eeff191907cb804299716293ef0733ef25cf8e74eb1808749aebbfd9e9fa9f) diff --git a/doc/lightning-staticbackup.7.md b/doc/lightning-staticbackup.7.md deleted file mode 100644 index 317734bc4f88..000000000000 --- a/doc/lightning-staticbackup.7.md +++ /dev/null @@ -1,42 +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. - - -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 - -[comment]: # (GENERATE-FROM-SCHEMA-END) - - -AUTHOR ------- - -Aditya <> is mainly responsible. - -SEE ALSO --------- - -lightning-getsharedsecret(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:2d991663ce45ada109fd8b0bfca5cee3c9f4f59503d63a5f5b1f669f83cefc67) diff --git a/doc/lightning-stop.7.md b/doc/lightning-stop.7.md deleted file mode 100644 index 874d2422dd6c..000000000000 --- a/doc/lightning-stop.7.md +++ /dev/null @@ -1,46 +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": 82, - "method": "stop", - "params": {} -} -``` - -RETURN VALUE ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, returns a single element (string) (always "Shutdown complete") -[comment]: # (GENERATE-FROM-SCHEMA-END) - -Once it has returned, the daemon has cleaned up completely, and if -desired may be restarted immediately. - - -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: - -[comment]: # ( SHA256STAMP:d070207640745cfc9b9ba26e5d023e96a3befcdde9a2c9b17d48d46dafb460f9) diff --git a/doc/lightning-txdiscard.7.md b/doc/lightning-txdiscard.7.md deleted file mode 100644 index 4cb40826e6b1..000000000000 --- a/doc/lightning-txdiscard.7.md +++ /dev/null @@ -1,49 +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). - -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* - -[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*. - -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: - -[comment]: # ( SHA256STAMP:8186e8767a80b13a133ecfe5a433252514f4a7eb31387f0380c04eb2b2d0a696) diff --git a/doc/lightning-txprepare.7.md b/doc/lightning-txprepare.7.md deleted file mode 100644 index d1a9bc11e8fd..000000000000 --- a/doc/lightning-txprepare.7.md +++ /dev/null @@ -1,82 +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*. - -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**. - -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) - -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. -- 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: - -[comment]: # ( SHA256STAMP:2711c2b658ca99c61153facb3a532ae3b3a5b8ac86419796e0bf2f7daa6e53c5) diff --git a/doc/lightning-txsend.7.md b/doc/lightning-txsend.7.md deleted file mode 100644 index c9e16deeca4a..000000000000 --- a/doc/lightning-txsend.7.md +++ /dev/null @@ -1,49 +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**. - -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* - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -On failure, an error is reported (from bitcoind), and the inputs from -the transaction are unreserved. - -The following error codes may occur: - -- -1: Catchall nonspecific error. - -AUTHOR ------- - -Rusty Russell <> is mainly responsible. - -SEE ALSO --------- - -lightning-txprepare(7), lightning-txdiscard(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:26872287dd544ccf20343128682f0b1a496f816cadc5c1accc814dae02fcc420) diff --git a/doc/lightning-unreserveinputs.7.md b/doc/lightning-unreserveinputs.7.md deleted file mode 100644 index 34bd4084250f..000000000000 --- a/doc/lightning-unreserveinputs.7.md +++ /dev/null @@ -1,59 +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). - -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 ------------- - -[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 (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) - -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. - -SEE ALSO --------- - -lightning-unreserveinputs(7), lightning-signpsbt(7), lightning-sendpsbt(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:2957a85bf8b9d70f8e253d6646f31aa9c2f135c7a161fd52d0e86d933adc3c57) diff --git a/doc/lightning-upgradewallet.7.md b/doc/lightning-upgradewallet.7.md deleted file mode 100644 index a92cf7d04fe3..000000000000 --- a/doc/lightning-upgradewallet.7.md +++ /dev/null @@ -1,52 +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* 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. - -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. - -RETURN VALUE ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -[comment]: # (GENERATE-FROM-SCHEMA-END) - - -AUTHOR ------- - -~niftynei~ <> is mainly responsible. - -SEE ALSO --------- - -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 deleted file mode 100644 index 2120758ecd89..000000000000 --- a/doc/lightning-utxopsbt.7.md +++ /dev/null @@ -1,103 +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*] - -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. - -*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 ------------- - -[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. - -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: - -[comment]: # ( SHA256STAMP:5fe266fd3032274779129a8bf3868228a22481f178f3ec98a4fa9b6ad8a127d5) diff --git a/doc/lightning-wait.7.md b/doc/lightning-wait.7.md deleted file mode 100644 index 47f6fc9c773b..000000000000 --- a/doc/lightning-wait.7.md +++ /dev/null @@ -1,118 +0,0 @@ -lightning-wait -- Command to wait for creations, changes and deletions -====================================================================== - -SYNOPSIS --------- - -**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!). - -*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*) - - -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. - -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 - -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 - -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 - -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) - -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: -[comment]: # ( SHA256STAMP:a6686d2d46b49984c3848305dc15129a7436dd48d95f6afd9ba0e2902b52fc5d) diff --git a/doc/lightning-waitanyinvoice.7.md b/doc/lightning-waitanyinvoice.7.md deleted file mode 100644 index 98bfc4d8ff10..000000000000 --- a/doc/lightning-waitanyinvoice.7.md +++ /dev/null @@ -1,83 +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; 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. - -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)* - -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) - -Possible errors are: - -* 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: - -[comment]: # ( SHA256STAMP:9e15a21311e8822a4e61a2f47f047caea6a8fa2a65acd1c81854c0c42ea6bba1) diff --git a/doc/lightning-waitblockheight.7.md b/doc/lightning-waitblockheight.7.md deleted file mode 100644 index 48465720b712..000000000000 --- a/doc/lightning-waitblockheight.7.md +++ /dev/null @@ -1,42 +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*. -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 ------------- - -[comment]: # (GENERATE-FROM-SCHEMA-START) -On success, an object is returned, containing: - -- **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`. - -AUTHOR ------- - -ZmnSCPxj <> is mainly responsible. - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:4c77e26ed8145c090bf5c5765fe8817a0d819e302fd479dd451ae78443921826) diff --git a/doc/lightning-waitinvoice.7.md b/doc/lightning-waitinvoice.7.md deleted file mode 100644 index 7974e431b379..000000000000 --- a/doc/lightning-waitinvoice.7.md +++ /dev/null @@ -1,68 +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**. - -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)* - -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) - -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: - -[comment]: # ( SHA256STAMP:9e15a21311e8822a4e61a2f47f047caea6a8fa2a65acd1c81854c0c42ea6bba1) diff --git a/doc/lightning-waitsendpay.7.md b/doc/lightning-waitsendpay.7.md deleted file mode 100644 index 8e5dba779339..000000000000 --- a/doc/lightning-waitsendpay.7.md +++ /dev/null @@ -1,111 +0,0 @@ -lightning-waitsendpay -- Command for sending a payment via a route -================================================================== - -SYNOPSIS --------- - -**waitsendpay** *payment\_hash* [*timeout*] [*partid*] - -DESCRIPTION ------------ - -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. - -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). - -If **status** is "complete": - - - **payment\_preimage** (secret): the proof of payment: SHA256 of this **payment\_hash** - -[comment]: # (GENERATE-FROM-SCHEMA-END) - -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. - -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: - -[comment]: # ( SHA256STAMP:241504486cac188734d741260c5cc2931570bdf190f91c227e8d13e348656312) diff --git a/doc/lightning-withdraw.7.md b/doc/lightning-withdraw.7.md deleted file mode 100644 index 9d7d770fc6a0..000000000000 --- a/doc/lightning-withdraw.7.md +++ /dev/null @@ -1,74 +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*. - -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 ------------- - -[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) - -On failure, an error is reported and the withdrawal 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. -- 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: - -[comment]: # ( SHA256STAMP:e5f8da653907dd205d79e41cb64147c2042908d307ea2e36fb1b55c55a366c37) 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] ``` 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/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 diff --git a/doc/schemas/addgossip.request.json b/doc/schemas/addgossip.request.json deleted file mode 100644 index 5729e2fa2e96..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 5f63a7a5df54..000000000000 --- a/doc/schemas/addpsbtoutput.request.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "satoshi" - ], - "added": "v23.11", - "properties": { - "satoshi": { - "type": "msat" - }, - "locktime": { - "type": "u32" - }, - "initialpsbt": { - "type": "string", - "description": "the (optional) base 64 encoded PSBT to begin with. If not specified, one will be generated automatically" - }, - "destination": { - "type": "string" - } - } -} 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 9cc41516273e..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" - }, - "age": { - "type": "u64", - "description": "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 b289de135241..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" - } - } -} 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 03c794d4a92b..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" - } - } -} 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.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.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.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.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.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 40bc91940951..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": "A brief description about consolidate_fees" - }, - "start_time": { - "type": "u32", - "description": "Filters the events after the time" - }, - "end_time": { - "type": "u32", - "description": "Filters the events up to the timestamp" - } - } -} 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.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 df896bbf43ef..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 1870b72f2528..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" - }, - "unilateraltimeout": { - "type": "u32", - "description": "" - }, - "destination": { - "type": "string", - "description": "" - }, - "fee_negotiation_step": { - "type": "string", - "description": "" - }, - "wrong_funding": { - "type": "outpoint", - "description": "" - }, - "force_lease_closed": { - "type": "boolean", - "description": "" - }, - "feerange": { - "type": "array", - "items": { - "type": "feerate" - }, - "description": "" - } - } -} 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 ed61d69fedda..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/connect.request.json b/doc/schemas/connect.request.json deleted file mode 100644 index 48303300b487..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": "" - }, - "host": { - "type": "string", - "description": "The hostname of the node." - }, - "port": { - "type": "u16", - "description": "Port to try connecting to" - } - } -} 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 4a15268e7f0a..000000000000 --- a/doc/schemas/createinvoice.request.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "invstring", - "label", - "preimage" - ], - "properties": { - "invstring": { - "type": "string", - "description": "" - }, - "label": { - "type": "string", - "description": "" - }, - "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 d027dbbd9493..000000000000 --- a/doc/schemas/createonion.request.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "hops", - "assocdata" - ], - "properties": { - "hops": { - "type": "array", - "description": "", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "pubkey", - "payload" - ], - "properties": { - "pubkey": { - "type": "pubkey" - }, - "payload": { - "type": "hex" - } - } - } - }, - "assocdata": { - "type": "hex", - "description": "" - }, - "session_key": { - "type": "secret" - }, - "onion_size": { - "type": "u16" - } - } -} 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 00983287f449..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 d9c0a95e5925..000000000000 --- a/doc/schemas/datastore.request.json +++ /dev/null @@ -1,47 +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" - } - ] - }, - "string": { - "type": "string", - "description": "" - }, - "hex": { - "type": "hex", - "description": "" - }, - "mode": { - "type": "string", - "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”." - } - } -} 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 6ff72bcb9a51..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 0dff816f24c3..000000000000 --- a/doc/schemas/decode.request.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "added": "v23.05", - "required": [ - "string" - ], - "properties": { - "string": { - "type": "string" - } - } -} 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 d4e5ae4d31d7..000000000000 --- a/doc/schemas/decodepay.request.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "added": "v23.05", - "required": [ - "bolt11" - ], - "properties": { - "bolt11": { - "type": "string" - }, - "description": { - "type": "string" - } - } -} 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 22367461323a..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 45ffc910e1ff..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": "" - } - } -} 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 163c79909af6..000000000000 --- a/doc/schemas/delforward.request.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "properties": { - "in_channel": { - "type": "short_channel_id" - }, - "in_htlc_id": { - "type": "u64" - }, - "status": { - "type": "string", - "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 1e2493839159..000000000000 --- a/doc/schemas/delinvoice.request.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "label", - "status" - ], - "properties": { - "label": { - "oneOf": [ - { - "type": "string", - "description": "" - }, - { - "type": "integer", - "description": "" - } - ] - }, - "status": { - "type": "string", - "enum": [ - "paid", - "expired", - "unpaid" - ] - }, - "desconly": { - "type": "boolean" - } - } -} 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 d670094e6388..000000000000 --- a/doc/schemas/delpay.request.json +++ /dev/null @@ -1,28 +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 hash of the *payment_preimage* which will prove payment" - }, - "status": { - "type": "string", - "enum": [ - "complete", - "failed" - ] - }, - "partid": { - "type": "u64" - }, - "groupid": { - "type": "u64" - } - } -} 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 08bbe7f7b723..000000000000 --- a/doc/schemas/disableinvoicerequest.request.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "invreq_id" - ], - "properties": { - "invreq_id": { - "type": "string", - "description": "" - } - } -} 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.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 8714dbe089bd..000000000000 --- a/doc/schemas/disconnect.request.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "id" - ], - "properties": { - "id": { - "type": "pubkey" - }, - "force": { - "type": "boolean" - } - } -} 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 127dfbc6bf43..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": "string", - "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 d4dbffe3b770..000000000000 --- a/doc/schemas/feerates.request.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "style" - ], - "properties": { - "style": { - "type": "string", - "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 d3f293d4ab61..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": "" - }, - "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)." - }, - "quantity": { - "type": "u64", - "description": "quantity is is 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." - }, - "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." - }, - "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." - }, - "timeout": { - "type": "number", - "description": "timeout is an optional timeout; 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." - } - } -} 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 2d8066febe37..000000000000 --- a/doc/schemas/fundchannel.request.json +++ /dev/null @@ -1,60 +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" - }, - "feerate": { - "type": "feerate" - }, - "announce": { - "type": "boolean" - }, - "minconf": { - "type": "u32" - }, - "push_msat": { - "type": "msat" - }, - "close_to": { - "type": "string" - }, - "request_amt": { - "type": "msat" - }, - "compact_lease": { - "type": "string" - }, - "utxos": { - "type": "array", - "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" - }, - "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 5f0c8f7345c2..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": "the 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 2939acc10524..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": "id is the 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)" - } - } -} 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 e71b8ea01dab..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": "id is the peer id obtained from connect." - }, - "amount": { - "type": "msat_or_all", - "description": "The amount that the channel will be funded." - }, - "feerate": { - "type": "feerate", - "description": "Sets the feerate for the subsequent commitment transaction." - }, - "announce": { - "type": "boolean", - "description": "Whether or not to announce the channel." - }, - "close_to": { - "type": "string", - "description": "A bitcoin address to which the channel funds should be sent to on close." - }, - "push_msat": { - "type": "msat", - "description": "The amount of millisatoshis to push to the channel at open. This is a gift to the peer." - }, - "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.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 7752196ade17..000000000000 --- a/doc/schemas/fundpsbt.request.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "satoshi", - "feerate", - "startweight" - ], - "properties": { - "satoshi": { - "type": "msat_or_all" - }, - "feerate": { - "type": "feerate" - }, - "startweight": { - "type": "u32" - }, - "minconf": { - "type": "u32" - }, - "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)." - }, - "locktime": { - "type": "u32" - }, - "min_witness_weight": { - "type": "u32" - }, - "excess_as_change": { - "type": "boolean" - }, - "nonwrapped": { - "added": "v23.02", - "type": "boolean" - }, - "opening_anchor_channel": { - "added": "v23.08", - "type": "boolean" - } - } -} 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.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 1d0ee771f3eb..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": "" - }, - "amount_msat": { - "type": "msat", - "description": "" - }, - "riskfactor": { - "type": "u64", - "description": "" - }, - "cltv": { - "type": "u32", - "description": "" - }, - "fromid": { - "type": "pubkey", - "description": "" - }, - "fuzzpercent": { - "type": "u32", - "description": "" - }, - "exclude": { - "type": "array", - "description": "", - "items": { - "type": "string" - } - }, - "maxhops": { - "type": "u32", - "description": "" - } - } -} 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.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 62cceaeda81c..000000000000 --- a/doc/schemas/invoice.request.json +++ /dev/null @@ -1,72 +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": "" - }, - "description": { - "type": "string", - "description": "" - }, - "label": { - "oneOf": [ - { - "type": "string", - "description": "" - }, - { - "type": "integer", - "description": "" - } - ] - }, - "expiry": { - "type": "u64", - "description": "" - }, - "fallbacks": { - "type": "array", - "description": "", - "items": { - "type": "string" - } - }, - "preimage": { - "type": "hex", - "description": "" - }, - "exposeprivatechannels": { - "oneOf": [ - { - "type": "boolean", - "description": "" - }, - { - "type": "array", - "items": { - "type": "short_channel_id" - } - }, - { - "type": "short_channel_id" - } - ] - }, - "cltv": { - "type": "u32", - "description": "" - }, - "deschashonly": { - "type": "boolean", - "description": "" - } - } -} 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 e94b190ba40a..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": "" - }, - "description": { - "type": "string", - "description": "" - }, - "issuer": { - "type": "string", - "description": "" - }, - "label": { - "type": "string", - "description": "" - }, - "absolute_expiry": { - "type": "u64", - "description": "" - }, - "single_use": { - "type": "boolean", - "description": "" - } - } -} 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 64e74e73c7b7..000000000000 --- a/doc/schemas/keysend.request.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "destination", - "amount_msat" - ], - "properties": { - "destination": { - "type": "pubkey" - }, - "amount_msat": { - "type": "msat" - }, - "label": { - "type": "string" - }, - "maxfeepercent": { - "type": "number" - }, - "retry_for": { - "type": "u32" - }, - "maxdelay": { - "type": "u32" - }, - "exemptfee": { - "type": "msat" - }, - "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": [] - } - } -} 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/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-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-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: " + ] +} diff --git a/doc/schemas/listchannels.request.json b/doc/schemas/listchannels.request.json deleted file mode 100644 index 80c7344900ee..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 2726913be3d1..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 supplied, limits the channels to just the peer with the given ID, if it exists." - } - } -} 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.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 fc817532724f..000000000000 --- a/doc/schemas/listdatastore.request.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "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", - "description": "" - } - ] - } - } -} 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 b5e9e6fa89d0..000000000000 --- a/doc/schemas/listforwards.request.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "properties": { - "status": { - "type": "string", - "enum": [ - "offered", - "settled", - "local_failed", - "failed" - ] - }, - "in_channel": { - "type": "short_channel_id" - }, - "out_channel": { - "type": "short_channel_id" - }, - "index": { - "type": "string", - "added": "v23.11", - "enum": [ - "created", - "updated" - ], - "description": "" - }, - "start": { - "type": "u64", - "added": "v23.11", - "description": "" - }, - "limit": { - "type": "u32", - "added": "v23.11", - "description": "" - } - } -} 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 00faf6c658e8..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": "Should outputs that are already spent be included in the result?" - } - } -} 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 df03123299a8..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": "channel id or short_channel_id" - } - } -} 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 01104b40a18f..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": "" - }, - "active_only": { - "type": "boolean", - "description": "" - } - } -} 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 f40710fa7490..000000000000 --- a/doc/schemas/listinvoices.request.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "label": { - "oneOf": [ - { - "type": "string", - "description": "" - }, - { - "type": "integer", - "description": "" - } - ] - }, - "invstring": { - "type": "string", - "description": "" - }, - "payment_hash": { - "type": "hex", - "description": "" - }, - "offer_id": { - "type": "string", - "description": "" - }, - "index": { - "type": "string", - "added": "v23.08", - "enum": [ - "created", - "updated" - ], - "description": "" - }, - "start": { - "type": "u64", - "added": "v23.08", - "description": "" - }, - "limit": { - "type": "u32", - "added": "v23.08", - "description": "" - } - } -} 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 c7f1eb55611f..000000000000 --- a/doc/schemas/listnodes.request.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": { - "id": { - "type": "pubkey" - } - } -} 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 f313c861388b..000000000000 --- a/doc/schemas/listpays.request.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": { - "bolt11": { - "type": "string" - }, - "payment_hash": { - "type": "hash" - }, - "status": { - "type": "string", - "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 1027da569c80..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 f2b02304acd3..000000000000 --- a/doc/schemas/listpeers.request.json +++ /dev/null @@ -1,16 +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. Valid log levels are “io”, “debug”, “info”, and “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 a498bbc697ad..000000000000 --- a/doc/schemas/listsendpays.request.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": { - "bolt11": { - "type": "string" - }, - "payment_hash": { - "type": "hash" - }, - "status": { - "type": "string", - "enum": [ - "pending", - "complete", - "failed" - ] - }, - "index": { - "type": "string", - "added": "v23.11", - "enum": [ - "created", - "updated" - ], - "description": "" - }, - "start": { - "type": "u64", - "added": "v23.11", - "description": "" - }, - "limit": { - "type": "u32", - "added": "v23.11", - "description": "" - } - } -} 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 5059babd01d5..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": "This will be used for deriving the secret" - }, - "string": { - "type": "string", - "description": "This will be used for deriving the secret" - } - } -} 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 7020c8a3432c..000000000000 --- a/doc/schemas/multifundchannel.request.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "destinations" - ], - "properties": { - "destinations": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "amount" - ], - "properties": { - "id": { - "type": "string" - }, - "amount": { - "type": "msat_or_all" - }, - "announce": { - "type": "boolean" - }, - "push_msat": { - "type": "msat" - }, - "close_to": { - "type": "string" - }, - "request_amt": { - "type": "msat" - }, - "compact_lease": { - "type": "string" - }, - "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" - }, - "channel_type": { - "type": "array", - "items": { - "type": "u32" - } - } - } - } - }, - "feerate": { - "type": "feerate" - }, - "minconf": { - "type": "u32" - }, - "utxos": { - "type": "array", - "items": { - "type": "outpoint" - } - }, - "minchannels": { - "type": "u32" - }, - "commitment_feerate": { - "type": "feerate" - } - } -} 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.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 b0eadf2c7d98..000000000000 --- a/doc/schemas/newaddr.request.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [], - "additionalProperties": false, - "properties": { - "addresstype": { - "type": "string", - "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.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.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.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 8f893befa78b..000000000000 --- a/doc/schemas/openchannel_init.request.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "amount", - "initialpsbt" - ], - "properties": { - "id": { - "type": "pubkey" - }, - "amount": { - "type": "msat" - }, - "initialpsbt": { - "type": "string" - }, - "commitment_feerate": { - "type": "feerate" - }, - "funding_feerate": { - "type": "feerate" - }, - "announce": { - "type": "boolean" - }, - "close_to": { - "type": "hex" - }, - "request_amt": { - "type": "msat" - }, - "compact_lease": { - "type": "hex" - }, - "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.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.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.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 784035cfac3c..000000000000 --- a/doc/schemas/pay.request.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "bolt11" - ], - "properties": { - "bolt11": { - "type": "string" - }, - "amount_msat": { - "type": "msat" - }, - "label": { - "type": "string" - }, - "riskfactor": { - "type": "number" - }, - "maxfeepercent": { - "type": "number" - }, - "retry_for": { - "type": "u16" - }, - "maxdelay": { - "type": "u16" - }, - "exemptfee": { - "type": "msat" - }, - "localinvreqid": { - "type": "hex" - }, - "exclude": { - "type": "array", - "items": { - "oneOf": [ - { - "type": "short_channel_id_dir" - }, - { - "type": "pubkey" - } - ] - } - }, - "maxfee": { - "type": "msat" - }, - "description": { - "type": "string" - } - } -} 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 31f2aefdbd7a..000000000000 --- a/doc/schemas/ping.request.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "id" - ], - "additionalProperties": false, - "properties": { - "id": { - "type": "pubkey" - }, - "len": { - "type": "u16" - }, - "pongbytes": { - "type": "u16" - } - } -} 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.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 85437b9a21af..000000000000 --- a/doc/schemas/preapproveinvoice.request.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "added": "v23.02", - "required": [ - "bolt11" - ], - "properties": { - "bolt11": { - "type": "string", - "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 53a1cb8d50f9..000000000000 --- a/doc/schemas/preapprovekeysend.request.json +++ /dev/null @@ -1,28 +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", - "added": "v23.02" - }, - "payment_hash": { - "type": "hex", - "added": "v23.02", - "description": "the hash of the *payment_preimage* which will prove payment", - "maxLength": 64, - "minLength": 64 - }, - "amount_msat": { - "type": "msat", - "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/recoverchannel.request.json b/doc/schemas/recoverchannel.request.json deleted file mode 100644 index ea6701bc2000..000000000000 --- a/doc/schemas/recoverchannel.request.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "scb" - ], - "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.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.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.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 3a06534d4feb..000000000000 --- a/doc/schemas/sendcustommsg.request.json +++ /dev/null @@ -1,18 +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" - }, - "msg": { - "type": "hex" - } - } -} 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.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 26cd99aa6ee7..000000000000 --- a/doc/schemas/sendonion.request.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "onion", - "first_hop", - "payment_hash" - ], - "properties": { - "onion": { - "type": "hex" - }, - "first_hop": { - "type": "object", - "required": [ - "id", - "amount_msat", - "delay" - ], - "properties": { - "id": { - "type": "pubkey" - }, - "amount_msat": { - "type": "msat" - }, - "delay": { - "type": "u16" - } - } - }, - "payment_hash": { - "type": "hash" - }, - "label": { - "type": "string" - }, - "shared_secrets": { - "type": "array", - "items": { - "type": "secret" - } - }, - "partid": { - "type": "u16" - }, - "bolt11": { - "type": "string" - }, - "amount_msat": { - "type": "msat" - }, - "destination": { - "type": "pubkey" - }, - "localinvreqid": { - "type": "hash" - }, - "groupid": { - "type": "u64" - } - } -} 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.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 67d645423ec9..000000000000 --- a/doc/schemas/sendpay.request.json +++ /dev/null @@ -1,61 +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": { - "amount_msat": { - "type": "msat" - }, - "id": { - "type": "pubkey" - }, - "delay": { - "type": "u16" - }, - "channel": { - "type": "short_channel_id" - } - } - } - }, - "payment_hash": { - "type": "hash" - }, - "label": { - "type": "string" - }, - "amount_msat": { - "type": "msat" - }, - "bolt11": { - "type": "string" - }, - "payment_secret": { - "type": "secret" - }, - "partid": { - "type": "u16" - }, - "localinvreqid": { - "type": "hex" - }, - "groupid": { - "type": "u64" - } - } -} 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 bc55bb8308ba..000000000000 --- a/doc/schemas/sendpsbt.request.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt" - ], - "properties": { - "psbt": { - "type": "string" - }, - "reserve": { - "type": "boolean" - } - } -} 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 dae031975705..000000000000 --- a/doc/schemas/setchannel.request.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string" - }, - "feebase": { - "type": "msat" - }, - "feeppm": { - "type": "u32" - }, - "htlcmin": { - "type": "msat" - }, - "htlcmax": { - "type": "msat" - }, - "enforcedelay": { - "type": "u32" - }, - "ignorefeelimits": { - "added": "v23.08", - "type": "boolean" - } - } -} 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/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/setconfig.request.json b/doc/schemas/setconfig.request.json deleted file mode 100644 index 7dd24fc1b151..000000000000 --- a/doc/schemas/setconfig.request.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "config" - ], - "added": "v23.08", - "properties": { - "config": { - "type": "string" - }, - "val": {} - } -} 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/showrunes.request.json b/doc/schemas/showrunes.request.json deleted file mode 100644 index 5bc5b8fc8322..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": "optional rune to list" - } - } -} 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 40b8e3f46a55..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": "" - } - } -} 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 163239e207bc..000000000000 --- a/doc/schemas/signmessage.request.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "message" - ], - "additionalProperties": false, - "properties": { - "message": { - "type": "string" - } - } -} 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 c8a2bbf85555..000000000000 --- a/doc/schemas/signpsbt.request.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "psbt" - ], - "properties": { - "psbt": { - "type": "string" - }, - "signonly": { - "type": "array", - "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 ed01150df351..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 08bf814a49a8..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 (optional) base 64 encoded PSBT to begin with. If not specified, one will be generated automatically" - } - } -} 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 00105c74383b..000000000000 --- a/doc/schemas/stop.schema.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "string", - "enum": [ - "Shutdown complete" - ] -} diff --git a/doc/schemas/txdiscard.request.json b/doc/schemas/txdiscard.request.json deleted file mode 100644 index 6488647acce7..000000000000 --- a/doc/schemas/txdiscard.request.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "txid" - ], - "properties": { - "txid": { - "type": "txid" - } - } -} 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 936c4d9e5880..000000000000 --- a/doc/schemas/txprepare.request.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "outputs" - ], - "properties": { - "outputs": { - "type": "array", - "items": { - "type": "outputdesc" - } - }, - "feerate": { - "type": "feerate" - }, - "minconf": { - "type": "u32" - }, - "utxos": { - "type": "array", - "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 6488647acce7..000000000000 --- a/doc/schemas/txsend.request.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "txid" - ], - "properties": { - "txid": { - "type": "txid" - } - } -} 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.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 6a58abdfacc6..000000000000 --- a/doc/schemas/utxopsbt.request.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "satoshi", - "feerate", - "startweight", - "utxos" - ], - "properties": { - "satoshi": { - "type": "msat" - }, - "feerate": { - "type": "feerate" - }, - "startweight": { - "type": "u32" - }, - "utxos": { - "type": "array", - "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)." - }, - "reservedok": { - "type": "boolean" - }, - "locktime": { - "type": "u32" - }, - "min_witness_weight": { - "type": "u32" - }, - "excess_as_change": { - "type": "boolean" - }, - "opening_anchor_channel": { - "added": "v23.08", - "type": "boolean" - } - } -} 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 2febefeb16dd..000000000000 --- a/doc/schemas/wait.request.json +++ /dev/null @@ -1,32 +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", - "enum": [ - "invoices", - "forwards", - "sendpays" - ] - }, - "indexname": { - "type": "string", - "enum": [ - "created", - "updated", - "deleted" - ] - }, - "nextvalue": { - "type": "u64" - } - } -} 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 5c9ce9867bb0..000000000000 --- a/doc/schemas/waitanyinvoice.request.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [], - "properties": { - "lastpay_index": { - "type": "u64" - }, - "timeout": { - "type": "u64" - } - } -} 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 d564a5628afa..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": "The current block height (>= blockheight parameter)" - }, - "timeout": { - "type": "u32", - "description": "If timeout seconds is reached without the specified blockheight being reached, this command will fail with a code of 2000." - } - } -} 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 18cc4093d54b..000000000000 --- a/doc/schemas/waitinvoice.request.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "label" - ], - "properties": { - "label": { - "type": "string" - } - } -} 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 9e6f3942b14a..000000000000 --- a/doc/schemas/waitsendpay.request.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "payment_hash" - ], - "properties": { - "payment_hash": { - "type": "hash" - }, - "timeout": { - "type": "u32" - }, - "partid": { - "type": "u64" - }, - "groupid": { - "type": "u64" - } - } -} 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 8a43b988fa94..000000000000 --- a/doc/schemas/withdraw.request.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "additionalProperties": false, - "required": [ - "destination" - ], - "properties": { - "destination": { - "type": "string" - }, - "satoshi": { - "type": "msat_or_all" - }, - "feerate": { - "type": "feerate" - }, - "minconf": { - "type": "u16" - }, - "utxos": { - "type": "array", - "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" - } - } -} 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")); 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 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 a7eb310199da..f2c437641c03 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', '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'] + + +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)