lightning-bkpr-listbalances

lightning-bkpr-listbalances -- Command for listing current channel + wallet balances

SYNOPSIS

bkpr-listbalances

DESCRIPTION

The bkpr-listbalances RPC command is a list of all current and historical account balances. An account is either the on-chain wallet or a channel balance. Any funds sent to an external account will not be accounted for here.

Note that any channel that was recorded will be listed. Closed channel balances will be 0msat.

RETURN VALUE

On success, an object containing accounts is returned. It is an array of objects, where each object contains:

  • account (string): The account name. If the account is a channel, the channel_id.
  • balances (array of objects):
    • balance_msat (msat): Current account balance.
    • coin_type (string): Coin type, same as HRP for bech32.

If peer_id is present:

  • peer_id (pubkey): Node id for the peer this account is with.

  • we_opened (boolean): Did we initiate this account open (open the channel).

  • account_closed (boolean):

  • account_resolved (boolean): Has this channel been closed and all outputs resolved?

  • resolved_at_block (u32, optional): Blockheight account resolved on chain.

AUTHOR

Lisa Neigut <[email protected]> is mainly responsible.

SEE ALSO

lightning-bkpr-listincome(7), lightning-listfunds(7), lightning-bkpr-listaccountevents(7), lightning-bkpr-channelsapy(7), lightning-listpeers(7)

RESOURCES

Main web site: https://github.com/ElementsProject/lightning

EXAMPLES

Example 1:

Request:

lightning-cli bkpr-listbalances
{
  "id": "example:bkpr-listbalances#1",
  "method": "bkpr-listbalances",
  "params": {}
}

Response:

{
  "accounts": [
    {
      "account": "wallet",
      "balances": [
        {
          "balance_msat": 202050000000,
          "coin_type": "bcrt"
        }
      ]
    },
    {
      "account": "channelid0230000230000230000230000230000230000230000230000230000",
      "peer_id": "nodeid020202020202020202020202020202020202020202020202020202020202",
      "we_opened": false,
      "account_closed": true,
      "account_resolved": true,
      "resolved_at_block": 121,
      "balances": [
        {
          "balance_msat": 0,
          "coin_type": "bcrt"
        }
      ]
    },
    {
      "account": "channelid0340000340000340000340000340000340000340000340000340000",
      "peer_id": "nodeid040404040404040404040404040404040404040404040404040404040404",
      "we_opened": true,
      "account_closed": true,
      "account_resolved": false,
      "balances": [
        {
          "balance_msat": 0,
          "coin_type": "bcrt"
        }
      ]
    },
    {
      "account": "channelid0230200230200230200230200230200230200230200230200230200",
      "peer_id": "nodeid020202020202020202020202020202020202020202020202020202020202",
      "we_opened": false,
      "account_closed": false,
      "account_resolved": false,
      "balances": [
        {
          "balance_msat": 0,
          "coin_type": "bcrt"
        }
      ]
    },
    {
      "account": "channelid0340200340200340200340200340200340200340200340200340200",
      "peer_id": "nodeid040404040404040404040404040404040404040404040404040404040404",
      "we_opened": true,
      "account_closed": false,
      "account_resolved": false,
      "balances": [
        {
          "balance_msat": 1000000000,
          "coin_type": "bcrt"
        }
      ]
    }
  ]
}

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.