Files
palladum-lightning/doc/schemas/bkpr-listaccountevents.json
ShahanaFarooqui 3e841b358e docs: Updated schema for mdx compatibility
Changelog-Fixed: Ensure documentation renders correctly when adding/updating new RPCs by detecting non-MDX-compatible pages.
2025-12-18 10:27:15 +10:30

346 lines
11 KiB
JSON

{
"$schema": "../rpc-schema-draft.json",
"type": "object",
"rpc": "bkpr-listaccountevents",
"title": "Command for listing recorded bookkeeping events",
"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."
],
"request": {
"required": [],
"additionalProperties": false,
"properties": {
"account": {
"type": "string",
"description": [
"Receive events for the specified account."
]
},
"payment_id": {
"type": "string",
"added": "v24.08",
"description": [
"Receive events for the specified payment id."
]
}
}
},
"response": {
"required": [
"events"
],
"additionalProperties": false,
"properties": {
"events": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true,
"required": [
"account",
"type",
"tag",
"credit_msat",
"debit_msat",
"currency",
"timestamp"
],
"properties": {
"account": {
"type": "string",
"description": [
"The account name. If the account is a channel, the channel_id."
]
},
"type": {
"type": "string",
"enum": [
"onchain_fee",
"chain",
"channel"
],
"description": [
"Coin movement type."
]
},
"tag": {
"type": "string",
"description": [
"Description of movement."
]
},
"credit_msat": {
"type": "msat",
"description": [
"Amount credited."
]
},
"debit_msat": {
"type": "msat",
"description": [
"Amount debited."
]
},
"currency": {
"type": "string",
"description": [
"Human-readable bech32 part for this coin type."
]
},
"timestamp": {
"type": "u32",
"description": [
"Timestamp this event was recorded by the node. For consolidated events such as onchain_fees, the most recent timestamp."
]
}
},
"allOf": [
{
"if": {
"additionalProperties": true,
"properties": {
"type": {
"type": "string",
"enum": [
"chain"
]
}
}
},
"then": {
"additionalProperties": false,
"properties": {
"account": {},
"type": {},
"tag": {},
"credit_msat": {},
"debit_msat": {},
"currency": {},
"timestamp": {},
"description": {
"type": "string",
"description": [
"The description of this event."
]
},
"outpoint": {
"type": "string",
"description": [
"The txid:outnum for this event."
]
},
"blockheight": {
"type": "u32",
"description": [
"For chain events, blockheight this occured at."
]
},
"origin": {
"type": "string",
"description": [
"The account this movement originated from."
]
},
"payment_id": {
"type": "hex",
"description": [
"Lightning payment identifier. For an htlc, this will be the preimage."
]
},
"txid": {
"type": "txid",
"description": [
"The txid of the transaction that created this event."
]
}
},
"required": [
"outpoint",
"blockheight"
]
}
},
{
"if": {
"additionalProperties": true,
"properties": {
"type": {
"type": "string",
"enum": [
"onchain_fee"
]
}
}
},
"then": {
"additionalProperties": false,
"properties": {
"account": {},
"type": {},
"tag": {},
"credit_msat": {},
"debit_msat": {},
"currency": {},
"timestamp": {},
"description": {},
"txid": {
"type": "txid",
"description": [
"The txid of the transaction that created this event."
]
}
},
"required": [
"txid"
]
}
},
{
"if": {
"additionalProperties": true,
"properties": {
"type": {
"type": "string",
"enum": [
"channel"
]
}
}
},
"then": {
"additionalProperties": false,
"properties": {
"account": {},
"type": {},
"tag": {},
"credit_msat": {},
"debit_msat": {},
"currency": {},
"timestamp": {},
"description": {},
"fees_msat": {
"type": "msat",
"description": [
"Amount paid in fees."
]
},
"is_rebalance": {
"type": "boolean",
"description": [
"Is this payment part of a rebalance."
]
},
"payment_id": {
"type": "hex",
"description": [
"Lightning payment identifier. For an htlc, this will be the preimage."
]
},
"part_id": {
"type": "u32",
"description": [
"Counter for multi-part payments."
]
}
}
}
}
]
}
}
}
},
"author": [
"Lisa Neigut [niftynei@gmail.com](mailto:niftynei@gmail.com) 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](https://github.com/ElementsProject/lightning)"
],
"examples": [
{
"request": {
"id": "example:bkpr-listaccountevents#1",
"method": "bkpr-listaccountevents",
"params": [
"channelid0230200230200230200230200230200230200230200230200230200"
]
},
"response": {
"events": [
{
"account": "channelid0230200230200230200230200230200230200230200230200230200",
"type": "chain",
"tag": "channel_open",
"credit_msat": 0,
"debit_msat": 0,
"currency": "bcrt",
"outpoint": "txidbk0101010101010101010101010101010101010101010101010101010101:1",
"timestamp": 1738500000,
"blockheight": 123
}
]
}
},
{
"request": {
"id": "example:bkpr-listaccountevents#2",
"method": "bkpr-listaccountevents",
"params": {}
},
"response": {
"events": [
{
"account": "external",
"origin": "channelid0340000340000340000340000340000340000340000340000340000",
"type": "chain",
"tag": "to_them",
"credit_msat": 510010000,
"debit_msat": 0,
"currency": "bcrt",
"outpoint": "txidbk0202020202020202020202020202020202020202020202020202020202:1",
"timestamp": 1738520000,
"blockheight": 142
},
{
"account": "wallet",
"type": "chain",
"tag": "deposit",
"credit_msat": 200000000000,
"debit_msat": 0,
"currency": "bcrt",
"outpoint": "txidbk0101010101010101010101010101010101010101010101010101010101:1",
"timestamp": 1738510000,
"blockheight": 141,
"description": "edited utxo description"
},
{
"account": "channelid0230000230000230000230000230000230000230000230000230000",
"type": "chain",
"tag": "channel_open",
"credit_msat": 0,
"debit_msat": 0,
"currency": "bcrt",
"outpoint": "txidbk0303030303030303030303030303030303030303030303030303030303:1",
"timestamp": 1738530000,
"blockheight": 143
}
]
}
}
]
}