LIGHTNING-LISTTRANSACTIONS(7)

πŸ“¦
version 26.06.9 Β· 2 versions
, in nixpkgs unstable

πŸ’œ LIGHTNING-LISTTRANSACTIONS(7) β€” the manual page, but make it cute

okay so bestie, this is the lightning-listtransactions page from the LIGHTNING-LISTTRANSACTIONS(7) manual, and honestly? it's a whole vibe. it's your wallet's receipts folder. let's get into it ✨


🌸 NAME 🌸

listtransactions β€” the command that gets you the list of transactions that was stored in the wallet. that's it. that's the whole thing. periodt πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

listtransactions

no flags, no args, no drama. she just is. 😌


πŸŽ€ DESCRIPTION πŸŽ€

so the listtransactions command returns transactions tracked in the wallet. like, everything the wallet knows about itself. 🫢

this includes:

  • deposits πŸ’°
  • withdrawals πŸ’Έ
  • transactions related to channels 🌈

and here's the iconic part β€” a transaction may have multiple types. for example, a transaction may both be a close and a deposit if it closes the channel and returns funds to the wallet. she contains multitudes. main character energy fr fr πŸ‘‘


✨ RETURN VALUE ✨

on success, an object containing transactions is returned. it's an array of objects, where each object contains:

  • hash (txid) β€” the transaction id. her name, her identity πŸ’–
  • rawtx (hex) β€” the raw transaction. the whole entire thing in hex 🧚
  • 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

like, gather. the inputs and the outputs both have their own little nested moments. it's giving structurally sound πŸ—οΈπŸ’…


πŸ’€ ERRORS πŸ’€

on failure, one of the following error codes may be returned:

  • -32602 β€” error in given parameters. like bestie... the params were not param-ing 😭

πŸ‘‘ AUTHOR πŸ‘‘

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. shoutout to the whole group chat, ngl 🫢✨


🌈 SEE ALSO 🌈

go read those too, they're lowkey iconic in their own right πŸ’œ


⭐ RESOURCES ⭐


πŸ“ EXAMPLES πŸ“

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"
        }
      ]
    }
  ]
}

two transactions, one with a single output and one with a lil pair of outputs β€” see how the second txindex is 1 and its blockheight is 102? bestie they're ✨different✨. notice that. iykyk πŸ’…


and that's the whole page, bestie!! this was Core Lightning v26.06.9 β€” the LIGHTNING-LISTTRANSACTIONS(7) manual, dated and delivered with love. mwah. πŸ«ΆπŸ’–πŸŽ€

πŸ“¦ where this page comes from