2024-01-15 22:35:14 +01:00
{
"$schema" : "../rpc-schema-draft.json" ,
"type" : "object" ,
"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"
] ,
2024-10-30 00:08:42 +01:00
"additionalProperties" : false ,
2024-01-15 22:35:14 +01:00
"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"
] ,
2024-10-30 00:08:42 +01:00
"additionalProperties" : false ,
2024-01-15 22:35:14 +01:00
"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*."
] ,
2024-06-20 23:57:02 +02:00
"author" : [
"Lisa Neigut <<niftynei@gmail.com>> is mainly responsible."
] ,
"see_also" : [
"lightning-unreserveinputs(7)" ,
"lightning-signpsbt(7)" ,
"lightning-sendpsbt(7)"
] ,
"resources" : [
"Main web site: <https://github.com/ElementsProject/lightning>"
] ,
"examples" : [
2024-01-15 22:35:14 +01:00
{
2024-03-28 02:45:18 +01:00
"request" : {
"id" : "example:reserveinputs#1" ,
"method" : "reserveinputs" ,
"params" : {
2024-07-18 09:28:22 +02:00
"psbt" : "cHNidP8BADMCAAAAAfcJ+tPRXly5UFuX2jOOOBUcBBjfDGAC8vLWfrkJf/O2AQAAAAD9////AAAAAAAAAA=="
2024-01-15 22:35:14 +01:00
}
2024-03-28 02:45:18 +01:00
} ,
"response" : {
"reservations" : [
{
2024-07-18 09:28:22 +02:00
"txid" : "b6f37f09b97ed6f2f202600cdf18041c15388e33da975b50b95c5ed1d3fa09f7" ,
2024-03-28 02:45:18 +01:00
"vout" : 1 ,
"was_reserved" : false ,
"reserved" : true ,
2024-07-18 09:28:22 +02:00
"reserved_to_block" : 226
2024-03-28 02:45:18 +01:00
}
]
}
2024-01-15 22:35:14 +01:00
} ,
{
2024-03-28 02:45:18 +01:00
"request" : {
"id" : "example:reserveinputs#2" ,
"method" : "reserveinputs" ,
"params" : {
2024-07-18 09:28:22 +02:00
"psbt" : "cHNidP8BADMCAAAAAQmU87pv4WOONFOqae6XAQBHIi5fZ4Ztyt0vn1YASZntAAAAAAD9////AAAAAAAAAA=="
2024-01-15 22:35:14 +01:00
}
2024-03-28 02:45:18 +01:00
} ,
"response" : {
"reservations" : [
{
2024-07-18 09:28:22 +02:00
"txid" : "ed994900569f2fddca6d86675f2e2247000197ee69aa53348e63e16fbaf39409" ,
2024-03-28 02:45:18 +01:00
"vout" : 0 ,
2024-07-18 09:28:22 +02:00
"was_reserved" : false ,
2024-03-28 02:45:18 +01:00
"reserved" : true ,
2024-07-18 09:28:22 +02:00
"reserved_to_block" : 226
2024-03-28 02:45:18 +01:00
}
]
}
2024-01-15 22:35:14 +01:00
}
]
}