lightning-bkpr-listaccountevents -- Command for listing recorded bookkeeping events
SYNOPSIS
bkpr-listaccountevents [account] [payment_id]
DESCRIPTION
The bkpr-listaccountevents RPC command is a list of all bookkeeping events that have been recorded for this node.
If the optional parameter account is set, we only emit events for the specified account, if exists.
If the optional parameter payment_id is set, we only emit events which have that value as payment hash or as transaction id.
The parameters account and payment_id are mutually exclusive.
Note that the type onchain_fees that are emitted are of opposite credit/debit than as they appear in listincome, as listincome shows all events from the perspective of the node, whereas listaccountevents just dumps the event data as we've got it. Onchain fees are updated/recorded as we get more information about input and output spends -- the total onchain fees that were recorded for a transaction for an account can be found by summing all onchain fee events and taking the difference between the credit_msat and debit_msat for these events. We do this so that successive calls to listaccountevents always produce the same list of events -- no previously emitted event will be subsequently updated, rather we add a new event to the list.
- account (string, optional): Receive events for the specified account.
- payment_id (string, optional): Receive events for the specified payment id. (added v24.08)
RETURN VALUE
On success, an object containing events 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.
- type (string) (one of "onchain_fee", "chain", "channel"): Coin movement type.
- tag (string): Description of movement.
- credit_msat (msat): Amount credited.
- debit_msat (msat): Amount debited.
- currency (string): Human-readable bech32 part for this coin type.
- timestamp (u32): Timestamp this event was recorded by the node. For consolidated events such as onchain_fees, the most recent timestamp.
If type is "chain":
- outpoint (string): The txid:outnum for this event.
- blockheight (u32): For chain events, blockheight this occured at.
- description (string, optional): The description of this event.
- origin (string, optional): The account this movement originated from.
- payment_id (hex, optional): Lightning payment identifier. For an htlc, this will be the preimage.
- txid (txid, optional): The txid of the transaction that created this event.
If type is "onchain_fee":
- txid (txid): The txid of the transaction that created this event.
If type is "channel":
- fees_msat (msat, optional): Amount paid in fees.
- is_rebalance (boolean, optional): Is this payment part of a rebalance.
- payment_id (hex, optional): Lightning payment identifier. For an htlc, this will be the preimage.
- part_id (u32, optional): Counter for multi-part payments.
AUTHOR
Lisa Neigut <[email protected]> is mainly responsible.
SEE ALSO
lightning-bkpr-listincome(7), lightning-listfunds(7), lightning-bkpr-listbalances(7), lightning-bkpr-channelsapy(7)
RESOURCES
Main web site: https://github.com/ElementsProject/lightning
EXAMPLES
Example 1:
Request:
lightning-cli bkpr-listaccountevents
{
"id": "example:bkpr-listaccountevents#1",
"method": "bkpr-listaccountevents",
"params": {}
}
Response:
{
"events": [
{
"account": "wallet",
"type": "chain",
"tag": "deposit",
"credit_msat": 200000000000,
"debit_msat": 0,
"currency": "bcrt",
"outpoint": "386ad532212a5cffd753a39c2d7260793e0c885fc28bc1235362c2b133a4f6a4:0",
"timestamp": 1722303635,
"blockheight": 105
},
{
"account": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
"type": "chain",
"tag": "channel_open",
"credit_msat": 0,
"debit_msat": 0,
"currency": "bcrt",
"outpoint": "cd23f0517eefc27194981253eb07b19b055246df77033e052c66eaf2bbb00483:0",
"timestamp": 1722303653,
"blockheight": 111
},
{
"account": "wallet",
"type": "chain",
"tag": "deposit",
"credit_msat": 2000000000,
"debit_msat": 0,
"currency": "bcrt",
"outpoint": "b19a249c64f2c952b4b9a400bdec159b56af2af63939c9ecb8fd937f344a7056:0",
"timestamp": 1722303656,
"blockheight": 112
},
{
"account": "wallet",
"type": "chain",
"tag": "withdrawal",
"credit_msat": 0,
"debit_msat": 2000000000,
"currency": "bcrt",
"outpoint": "b19a249c64f2c952b4b9a400bdec159b56af2af63939c9ecb8fd937f344a7056:0",
"txid": "5aab7d37b6ed1d78de32f4f91122ab9bbf0924b21732206b63ce06639ecc3fe2",
"timestamp": 1722303659,
"blockheight": 113
},
{
"account": "wallet",
"type": "chain",
"tag": "deposit",
"credit_msat": 995073000,
"debit_msat": 0,
"currency": "bcrt",
"outpoint": "5aab7d37b6ed1d78de32f4f91122ab9bbf0924b21732206b63ce06639ecc3fe2:0",
"timestamp": 1722303659,
"blockheight": 113
},
{
"account": "21bd30cac60f477f2c4267220b1702a6ec5780db34f9934fa94b8c0508bf3357",
"type": "chain",
"tag": "channel_open",
"credit_msat": 1000000000,
"debit_msat": 0,
"currency": "bcrt",
"outpoint": "5aab7d37b6ed1d78de32f4f91122ab9bbf0924b21732206b63ce06639ecc3fe2:1",
"timestamp": 1722303659,
"blockheight": 113
},
{
"account": "wallet",
"type": "onchain_fee",
"tag": "onchain_fee",
"credit_msat": 1004927000,
"debit_msat": 0,
"currency": "bcrt",
"timestamp": 1722303659,
"txid": "5aab7d37b6ed1d78de32f4f91122ab9bbf0924b21732206b63ce06639ecc3fe2"
},
{
"account": "wallet",
"type": "onchain_fee",
"tag": "onchain_fee",
"credit_msat": 0,
"debit_msat": 1004927000,
"currency": "bcrt",
"timestamp": 1722303659,
"txid": "5aab7d37b6ed1d78de32f4f91122ab9bbf0924b21732206b63ce06639ecc3fe2"
},
{
"account": "21bd30cac60f477f2c4267220b1702a6ec5780db34f9934fa94b8c0508bf3357",
"type": "onchain_fee",
"tag": "onchain_fee",
"credit_msat": 4927000,
"debit_msat": 0,
"currency": "bcrt",
"timestamp": 1722303659,
"txid": "5aab7d37b6ed1d78de32f4f91122ab9bbf0924b21732206b63ce06639ecc3fe2"
},
{
"account": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
"type": "channel",
"tag": "invoice",
"credit_msat": 500000000,
"debit_msat": 0,
"currency": "bcrt",
"payment_id": "7f74f064ff4528b7ec7c578df662617657cae9af4a74f5f24f68cb8465b18670",
"part_id": 0,
"timestamp": 1722303673,
"description": "description send some sats l2 to l3",
"is_rebalance": false
},
{
"account": "21bd30cac60f477f2c4267220b1702a6ec5780db34f9934fa94b8c0508bf3357",
"type": "channel",
"tag": "invoice",
"credit_msat": 0,
"debit_msat": 500000000,
"currency": "bcrt",
"payment_id": "365522e0e6c2fe84987153324cc9fac02986855d849bbd650426ba6064463166",
"part_id": 0,
"timestamp": 1722303675,
"description": "description send some sats l3 to l4",
"is_rebalance": false
},
{
"account": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
"type": "channel",
"tag": "invoice",
"credit_msat": 10000,
"debit_msat": 0,
"currency": "bcrt",
"payment_id": "d598cfc62da16b381b8fb8af9833a24005f730e54cc32c317fecc511ffc6d2a2",
"part_id": 0,
"timestamp": 1722303677,
"description": "Invoice description l31",
"is_rebalance": false
},
{
"account": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
"type": "channel",
"tag": "invoice",
"credit_msat": 10000,
"debit_msat": 0,
"currency": "bcrt",
"payment_id": "80ff407792947a23f193f9a1968e9a437b071364ae3159f83631335c9a453c1b",
"part_id": 0,
"timestamp": 1722303679,
"description": "keysend",
"is_rebalance": false
},
{
"account": "21bd30cac60f477f2c4267220b1702a6ec5780db34f9934fa94b8c0508bf3357",
"type": "channel",
"tag": "routed",
"credit_msat": 0,
"debit_msat": 10000000,
"fees_msat": 101,
"currency": "bcrt",
"payment_id": "3b80a3028343b16f8ab7261343eae40ff73ba833b0b7d4dcbfd42a3078dc322b",
"part_id": 0,
"timestamp": 1722303682,
"is_rebalance": false
},
{
"account": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
"type": "channel",
"tag": "routed",
"credit_msat": 10000101,
"debit_msat": 0,
"fees_msat": 101,
"currency": "bcrt",
"payment_id": "3b80a3028343b16f8ab7261343eae40ff73ba833b0b7d4dcbfd42a3078dc322b",
"part_id": 0,
"timestamp": 1722303682,
"is_rebalance": false
},
{
"account": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
"type": "channel",
"tag": "invoice",
"credit_msat": 10000,
"debit_msat": 0,
"currency": "bcrt",
"payment_id": "0458c01fdd3aa0b9829002390301f92083e78dc27bb293bc3e7caee5d4ed7259",
"part_id": 0,
"timestamp": 1722303686,
"description": "keysend",
"is_rebalance": false
},
{
"account": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
"type": "channel",
"tag": "invoice",
"credit_msat": 50000,
"debit_msat": 0,
"currency": "bcrt",
"payment_id": "788aea729ede48d315a199ce5ded76169601a61dd52e9734e707eb7c52e4e79e",
"part_id": 0,
"timestamp": 1722303688,
"description": "l32 description",
"is_rebalance": false
},
{
"account": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
"type": "channel",
"tag": "invoice",
"credit_msat": 100000,
"debit_msat": 0,
"currency": "bcrt",
"payment_id": "2c66dc1dc3e5979fb692acc135e9796f5973e44ca9dbb1d8199c6b57f6531e68",
"part_id": 0,
"timestamp": 1722303689,
"description": "l33 description",
"is_rebalance": false
},
{
"account": "21bd30cac60f477f2c4267220b1702a6ec5780db34f9934fa94b8c0508bf3357",
"type": "channel",
"tag": "routed",
"credit_msat": 0,
"debit_msat": 1000,
"fees_msat": 1,
"currency": "bcrt",
"payment_id": "e445ebcf339db3cba6184330ccc6e4a41e0bb38d237b93c1d2f71958d5a74e13",
"part_id": 0,
"timestamp": 1722303692,
"is_rebalance": false
},
{
"account": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
"type": "channel",
"tag": "routed",
"credit_msat": 1001,
"debit_msat": 0,
"fees_msat": 1,
"currency": "bcrt",
"payment_id": "e445ebcf339db3cba6184330ccc6e4a41e0bb38d237b93c1d2f71958d5a74e13",
"part_id": 0,
"timestamp": 1722303692,
"is_rebalance": false
},
{
"account": "wallet",
"type": "chain",
"tag": "deposit",
"credit_msat": 510181000,
"debit_msat": 0,
"currency": "bcrt",
"outpoint": "70e0466dc2e74f25afe38df6a85d5e8857079873a6d5eda4732806a7ac427305:1",
"timestamp": 1722303693,
"blockheight": 121
},
{
"account": "21bd30cac60f477f2c4267220b1702a6ec5780db34f9934fa94b8c0508bf3357",
"type": "chain",
"tag": "channel_close",
"credit_msat": 0,
"debit_msat": 489999000,
"currency": "bcrt",
"outpoint": "5aab7d37b6ed1d78de32f4f91122ab9bbf0924b21732206b63ce06639ecc3fe2:1",
"txid": "2849a5c5cd182ebec02d18ba6348bb01e70a544d0ce9aa8b5533fb09d24c969e",
"timestamp": 1722303693,
"blockheight": 121
},
{
"account": "external",
"origin": "21bd30cac60f477f2c4267220b1702a6ec5780db34f9934fa94b8c0508bf3357",
"type": "chain",
"tag": "to_them",
"credit_msat": 510001000,
"debit_msat": 0,
"currency": "bcrt",
"outpoint": "2849a5c5cd182ebec02d18ba6348bb01e70a544d0ce9aa8b5533fb09d24c969e:1",
"timestamp": 1722303693,
"blockheight": 121
},
{
"account": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
"type": "chain",
"tag": "channel_close",
"credit_msat": 0,
"debit_msat": 510181102,
"currency": "bcrt",
"outpoint": "cd23f0517eefc27194981253eb07b19b055246df77033e052c66eaf2bbb00483:0",
"txid": "70e0466dc2e74f25afe38df6a85d5e8857079873a6d5eda4732806a7ac427305",
"timestamp": 1722303693,
"blockheight": 121
},
{
"account": "external",
"origin": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
"type": "chain",
"tag": "to_them",
"credit_msat": 486923000,
"debit_msat": 0,
"currency": "bcrt",
"outpoint": "70e0466dc2e74f25afe38df6a85d5e8857079873a6d5eda4732806a7ac427305:0",
"timestamp": 1722303693,
"blockheight": 121
},
{
"account": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
"type": "onchain_fee",
"tag": "onchain_fee",
"credit_msat": 102,
"debit_msat": 0,
"currency": "bcrt",
"timestamp": 1722303693,
"txid": "70e0466dc2e74f25afe38df6a85d5e8857079873a6d5eda4732806a7ac427305"
},
{
"account": "ecabe6d86abdd57565b3fb7e7c5d724e60ca1a07633951769b5dbfa48dc884b3",
"type": "chain",
"tag": "channel_open",
"credit_msat": 0,
"debit_msat": 0,
"currency": "bcrt",
"outpoint": "f2f4e67dbf2791a3b57dd986418156b116b452c5fc27b077da7c529db82f06f5:1",
"timestamp": 1722303702,
"blockheight": 123
},
{
"account": "wallet",
"type": "chain",
"tag": "deposit",
"credit_msat": 2000000000,
"debit_msat": 0,
"currency": "bcrt",
"outpoint": "4c4b46acfd0c9d4b8393a2c3fbc27cb70bfa9270bf47ade3348c4acd949b770b:0",
"timestamp": 1722303705,
"blockheight": 124
},
{
"account": "wallet",
"type": "chain",
"tag": "withdrawal",
"credit_msat": 0,
"debit_msat": 510181000,
"currency": "bcrt",
"outpoint": "70e0466dc2e74f25afe38df6a85d5e8857079873a6d5eda4732806a7ac427305:1",
"txid": "416618f92bc774497a510c55f8aee76e80135bc0abe1933ebe473eeb07b41dee",
"timestamp": 1722303708,
"blockheight": 125
},
{
"account": "wallet",
"type": "chain",
"tag": "withdrawal",
"credit_msat": 0,
"debit_msat": 2000000000,
"currency": "bcrt",
"outpoint": "4c4b46acfd0c9d4b8393a2c3fbc27cb70bfa9270bf47ade3348c4acd949b770b:0",
"txid": "416618f92bc774497a510c55f8aee76e80135bc0abe1933ebe473eeb07b41dee",
"timestamp": 1722303708,
"blockheight": 125
},
{
"account": "wallet",
"type": "chain",
"tag": "deposit",
"credit_msat": 1503221000,
"debit_msat": 0,
"currency": "bcrt",
"outpoint": "416618f92bc774497a510c55f8aee76e80135bc0abe1933ebe473eeb07b41dee:0",
"timestamp": 1722303708,
"blockheight": 125
},
{
"account": "7512083907c74ed3a045e9bf772b3d72948eb93daf84a1cee57108800451aaf2",
"type": "chain",
"tag": "channel_open",
"credit_msat": 1000000000,
"debit_msat": 0,
"currency": "bcrt",
"outpoint": "416618f92bc774497a510c55f8aee76e80135bc0abe1933ebe473eeb07b41dee:1",
"timestamp": 1722303708,
"blockheight": 125
},
{
"account": "wallet",
"type": "onchain_fee",
"tag": "onchain_fee",
"credit_msat": 1006960000,
"debit_msat": 0,
"currency": "bcrt",
"timestamp": 1722303708,
"txid": "416618f92bc774497a510c55f8aee76e80135bc0abe1933ebe473eeb07b41dee"
},
{
"account": "wallet",
"type": "onchain_fee",
"tag": "onchain_fee",
"credit_msat": 0,
"debit_msat": 1006960000,
"currency": "bcrt",
"timestamp": 1722303708,
"txid": "416618f92bc774497a510c55f8aee76e80135bc0abe1933ebe473eeb07b41dee"
},
{
"account": "7512083907c74ed3a045e9bf772b3d72948eb93daf84a1cee57108800451aaf2",
"type": "onchain_fee",
"tag": "onchain_fee",
"credit_msat": 6960000,
"debit_msat": 0,
"currency": "bcrt",
"timestamp": 1722303708,
"txid": "416618f92bc774497a510c55f8aee76e80135bc0abe1933ebe473eeb07b41dee"
}
]
}
Example 2:
Request:
lightning-cli bkpr-listaccountevents "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2"
{
"id": "example:bkpr-listaccountevents#2",
"method": "bkpr-listaccountevents",
"params": [
"a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2"
]
}
Response:
{
"events": [
{
"account": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
"type": "chain",
"tag": "channel_open",
"credit_msat": 0,
"debit_msat": 0,
"currency": "bcrt",
"outpoint": "cd23f0517eefc27194981253eb07b19b055246df77033e052c66eaf2bbb00483:0",
"timestamp": 1722303653,
"blockheight": 111
},
{
"account": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
"type": "channel",
"tag": "invoice",
"credit_msat": 500000000,
"debit_msat": 0,
"currency": "bcrt",
"payment_id": "7f74f064ff4528b7ec7c578df662617657cae9af4a74f5f24f68cb8465b18670",
"part_id": 0,
"timestamp": 1722303673,
"description": "description send some sats l2 to l3",
"is_rebalance": false
},
{
"account": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
"type": "channel",
"tag": "invoice",
"credit_msat": 10000,
"debit_msat": 0,
"currency": "bcrt",
"payment_id": "d598cfc62da16b381b8fb8af9833a24005f730e54cc32c317fecc511ffc6d2a2",
"part_id": 0,
"timestamp": 1722303677,
"description": "Invoice description l31",
"is_rebalance": false
},
{
"account": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
"type": "channel",
"tag": "invoice",
"credit_msat": 10000,
"debit_msat": 0,
"currency": "bcrt",
"payment_id": "80ff407792947a23f193f9a1968e9a437b071364ae3159f83631335c9a453c1b",
"part_id": 0,
"timestamp": 1722303679,
"description": "keysend",
"is_rebalance": false
},
{
"account": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
"type": "channel",
"tag": "routed",
"credit_msat": 10000101,
"debit_msat": 0,
"fees_msat": 101,
"currency": "bcrt",
"payment_id": "3b80a3028343b16f8ab7261343eae40ff73ba833b0b7d4dcbfd42a3078dc322b",
"part_id": 0,
"timestamp": 1722303682,
"is_rebalance": false
},
{
"account": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
"type": "channel",
"tag": "invoice",
"credit_msat": 10000,
"debit_msat": 0,
"currency": "bcrt",
"payment_id": "0458c01fdd3aa0b9829002390301f92083e78dc27bb293bc3e7caee5d4ed7259",
"part_id": 0,
"timestamp": 1722303686,
"description": "keysend",
"is_rebalance": false
},
{
"account": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
"type": "channel",
"tag": "invoice",
"credit_msat": 50000,
"debit_msat": 0,
"currency": "bcrt",
"payment_id": "788aea729ede48d315a199ce5ded76169601a61dd52e9734e707eb7c52e4e79e",
"part_id": 0,
"timestamp": 1722303688,
"description": "l32 description",
"is_rebalance": false
},
{
"account": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
"type": "channel",
"tag": "invoice",
"credit_msat": 100000,
"debit_msat": 0,
"currency": "bcrt",
"payment_id": "2c66dc1dc3e5979fb692acc135e9796f5973e44ca9dbb1d8199c6b57f6531e68",
"part_id": 0,
"timestamp": 1722303689,
"description": "l33 description",
"is_rebalance": false
},
{
"account": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
"type": "channel",
"tag": "routed",
"credit_msat": 1001,
"debit_msat": 0,
"fees_msat": 1,
"currency": "bcrt",
"payment_id": "e445ebcf339db3cba6184330ccc6e4a41e0bb38d237b93c1d2f71958d5a74e13",
"part_id": 0,
"timestamp": 1722303692,
"is_rebalance": false
},
{
"account": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
"type": "chain",
"tag": "channel_close",
"credit_msat": 0,
"debit_msat": 510181102,
"currency": "bcrt",
"outpoint": "cd23f0517eefc27194981253eb07b19b055246df77033e052c66eaf2bbb00483:0",
"txid": "70e0466dc2e74f25afe38df6a85d5e8857079873a6d5eda4732806a7ac427305",
"timestamp": 1722303693,
"blockheight": 121
},
{
"account": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
"type": "onchain_fee",
"tag": "onchain_fee",
"credit_msat": 102,
"debit_msat": 0,
"currency": "bcrt",
"timestamp": 1722303693,
"txid": "70e0466dc2e74f25afe38df6a85d5e8857079873a6d5eda4732806a7ac427305"
}
]
}