lightning-listtransactions

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.

RETURN VALUE

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.

ERRORS

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

  • -32602: Error in given parameters.

AUTHOR

Vincenzo Palazzo <[email protected]> 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: https://github.com/ElementsProject/lightning

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

Core Lightning (previously c-lightning) is a lightweight, highly customizable and standard compliant implementation of the Lightning Network protocol.

© 2023 Core Lightning
All rights reserved.

Discussion Forum

The official Core Lightning forum is hosted at discuss.corelightning.org

BuildonL2 Community

The official BuildOnL2 community lives at community.corelightning.org. Join us and build the future of bitcoin on lightning.

Mailing List

For general discussions about CLN implementation, use [email protected]. For the Lightning Network, use [email protected]

Telegram

Community-driven telegram group where most of the node operators hang out. Go to https://t.me/lightningd to join.

Discord

Community-driven discord server where the devs flock together. Go to https://discord.gg/w27fMFESMN to join.

Internet Relay Chat

Don't hesitate to reach out to us on IRC at #lightning-dev @ libera.chat, #c-lightning @ libera.chat.