lightning-listtransactions -- Command to get the list of
transactions that was stored in the wallet.
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.
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.
On failure, one of the following error codes may be returned:
- •
- -32602: Error in given parameters.
Vincenzo Palazzo
<vincenzo.palazzo@protonmail.com>
wrote the initial version of this man page, but many others did the hard
work of actually implementing this rpc command.
lightning-newaddr(7), lightning-listfunds(7)
Example 1:
Request:
$ lightning-cli listtransactions
{
"id": "example:listtransactions#1",
"method": "listtransactions",
"params": {}
}
Response:
{
"transactions": [
{
"hash": "txid7000170001700017000170001700017000170001700017000170001",
"rawtx": "02000000000101lstx70001700017000170001700017000170001700017000170001700017000170001700017000170001700017000170001700017000170001700017000170001700017000170001700017000170001700017000170001",
"blockheight": 0,
"txindex": 0,
"locktime": 549000100,
"version": 2,
"inputs": [
{
"txid": "txid600116001160011600116001160011600116001160011600116001160011",
"index": 1,
"sequence": 2158511000
}
],
"outputs": [
{
"index": 1,
"amount_msat": 201998901100,
"scriptPubKey": "scriptpubkey01010101010101010101010101010101010101010101010101010101"
}
]
},
{
"hash": "txid7000270002700027000270002700027000270002700027000270002",
"rawtx": "02000000000101lstx70002700027000270002700027000270002700027000270002700027000270002700027000270002700027000270002700027000270002700027000270002700027000270002700027000270002700027000270002",
"blockheight": 102,
"txindex": 1,
"locktime": 549000200,
"version": 2,
"inputs": [
{
"txid": "txid600126001260012600126001260012600126001260012600126001260012",
"index": 1,
"sequence": 2158512000
}
],
"outputs": [
{
"index": 1,
"amount_msat": 201998902100,
"scriptPubKey": "scriptpubkey02010201020102010201020102010201020102010201020102010201"
},
{
"index": 2,
"amount_msat": 201998902200,
"scriptPubKey": "scriptpubkey02020202020202020202020202020202020202020202020202020202"
}
]
}
]
}