lightning-listfunds -- Command showing all funds currently managed by the Core Lightning node
SYNOPSIS
listfunds [spent]
DESCRIPTION
The listfunds RPC command displays all funds available, either in unspent outputs (UTXOs) in the internal wallet or funds locked in currently open channels.
- spent (boolean, optional): If True, then the outputs will include spent outputs in addition to the unspent ones. The default is False.
RETURN VALUE
On success, an object is returned, containing:
-
outputs (array of objects):
- txid (txid): The ID of the spendable transaction.
- output (u32): The index within txid.
- amount_msat (msat): The amount of the output.
- scriptpubkey (hex): The scriptPubkey of the output.
- status (string) (one of "unconfirmed", "confirmed", "spent", "immature")
- reserved (boolean): Whether this UTXO is currently reserved for an in-flight tx.
- address (string, optional): The bitcoin address of the output.
- redeemscript (hex, optional): The redeemscript, only if it's p2sh-wrapped.
If status is "confirmed":
- blockheight (u32): Block height where it was confirmed.
If reserved is "true":
- reserved_to_block (u32): Block height where reservation will expire.
-
channels (array of objects):
- peer_id (pubkey): The peer with which the channel is opened.
- our_amount_msat (msat): Available satoshis on our node's end of the channel.
- amount_msat (msat): Total channel value.
- funding_txid (txid): Funding transaction id.
- funding_output (u32): The 0-based index of the output in the funding transaction.
- connected (boolean): Whether the channel peer is connected.
- state (string) (one of "OPENINGD", "CHANNELD_AWAITING_LOCKIN", "CHANNELD_NORMAL", "CHANNELD_SHUTTING_DOWN", "CLOSINGD_SIGEXCHANGE", "CLOSINGD_COMPLETE", "AWAITING_UNILATERAL", "FUNDING_SPEND_SEEN", "ONCHAIN", "DUALOPEND_OPEN_INIT", "DUALOPEND_AWAITING_LOCKIN", "DUALOPEND_OPEN_COMMITTED", "DUALOPEND_OPEN_COMMIT_READY"): The channel state, in particular
CHANNELD_NORMAL
means the channel can be used normally. - channel_id (hash): The full channel_id (funding txid Xored with output number). (added v23.05)
If state is "CHANNELD_NORMAL":
- short_channel_id (short_channel_id): Short channel id of channel.
If state is "CHANNELD_SHUTTING_DOWN", "CLOSINGD_SIGEXCHANGE", "CLOSINGD_COMPLETE", "AWAITING_UNILATERAL", "FUNDING_SPEND_SEEN" or "ONCHAIN":
- short_channel_id (short_channel_id, optional): Short channel id of channel (only if funding reached lockin depth before closing).
AUTHOR
Felix <[email protected]> is mainly responsible.
SEE ALSO
lightning-newaddr(7), lightning-fundchannel(7), lightning-withdraw(7), lightning-listtransactions(7)
RESOURCES
Main web site: https://github.com/ElementsProject/lightning
EXAMPLES
Example 1:
Request:
lightning-cli listfunds
{
"id": "example:listfunds#1",
"method": "listfunds",
"params": {}
}
Response:
{
"outputs": [
{
"txid": "9454852bb62e304ee8933662284e10bd22a7f3710c262da4c94bdcc8b05ae407",
"output": 0,
"amount_msat": 19993653000,
"scriptpubkey": "51206c27e1956acfa61e68292c80908880e813450f754132e8a2ac471a86bf1326b5",
"address": "bcrt1pdsn7r9t2e7npu6pf9jqfpzyqaqf52rm4gyew3g4vgudgd0cny66srft45s",
"status": "confirmed",
"blockheight": 103,
"reserved": false
},
{
"txid": "7547ffc11396c62852104f7100d5ca27a2b9c0d5d43d08122147b2b03eb157a5",
"output": 0,
"amount_msat": 2000000000,
"scriptpubkey": "00149fb67bfcefee6cb7db4c7e55d9c6bfd749e31d1e",
"address": "bcrt1qn7m8hl80aekt0k6v0e2an34l6ay7x8g703x07y",
"status": "confirmed",
"blockheight": 108,
"reserved": false
},
{
"txid": "737d6835ddafd515ba9e9def733bb4e4211f6053a32b1422bf1c8cc240850f96",
"output": 0,
"amount_msat": 198995073000,
"scriptpubkey": "512035f1184f6b470c9df347da62c4b28e7ec9ee10b220bac3accd22209def0036ea",
"address": "bcrt1pxhc3snmtguxfmu68mf3vfv5w0my7uy9jyzav8txdygsfmmcqxm4q0mms62",
"status": "confirmed",
"blockheight": 109,
"reserved": false
}
],
"channels": [
{
"peer_id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
"connected": true,
"state": "CHANNELD_NORMAL",
"channel_id": "252d1b0a1e57895e84137f28cf19ab2c35847e284c112fefdecc7afeaa5c1de7",
"short_channel_id": "109x1x1",
"our_amount_msat": 490518792,
"amount_msat": 1000000000,
"funding_txid": "737d6835ddafd515ba9e9def733bb4e4211f6053a32b1422bf1c8cc240850f96",
"funding_output": 1
}
]
}