|
5105 | 5105 | } |
5106 | 5106 | ] |
5107 | 5107 | }, |
| 5108 | + "bkpr-report.json": { |
| 5109 | + "$schema": "../rpc-schema-draft.json", |
| 5110 | + "type": "object", |
| 5111 | + "added": "v26.04", |
| 5112 | + "rpc": "bkpr-report", |
| 5113 | + "title": "Formatting for all income impacting events", |
| 5114 | + "description": [ |
| 5115 | + "The **bkpr-report** RPC command creates a list of all income impacting events that the bookkeeper plugin has recorded for this node.", |
| 5116 | + "", |
| 5117 | + "It has the useful property that when used with `lightning-cli` and the `escape=csv` it can directly produce valid CSV files." |
| 5118 | + ], |
| 5119 | + "request": { |
| 5120 | + "required": [], |
| 5121 | + "additionalProperties": false, |
| 5122 | + "properties": { |
| 5123 | + "format": { |
| 5124 | + "type": "string", |
| 5125 | + "description": [ |
| 5126 | + "This format string is used for each income event (note that `lightning-cli` can get confused if the format begins and ends with `{` and `}`, so you may need to add a space). The following tags in braces are replaced:", |
| 5127 | + "{account}: account name (channel id, or 'wallet')", |
| 5128 | + "{tag}: event tag. This will be one of:", |
| 5129 | + " * `deposit`: an onchain send to the wallet by `outpoint`.", |
| 5130 | + " * `htlc_fulfill`: an onchain HTLC fulfill (due to unilaterally closed channel) at `outpoint`.", |
| 5131 | + " * `invoice`: either incoming (positive credit) or outgoing (positive debit) payment.", |
| 5132 | + " * `invoice_fee`: the routing fee paid to pay an outgoing invoice", |
| 5133 | + " * `journal_entry`: an accounting fixup, caused by loss of data (or, a node which predates bookkeeper)", |
| 5134 | + " * `lease_fee`: a fee paid or received to lease a channel via the experimental liquidity advertisement option", |
| 5135 | + " * `onchain_fee,`: a miner fee paid to open/close a channel, or make a bitcoin payment. The `txid` will correspond to a `withdrawal` `outpoint` for withdrawl", |
| 5136 | + " * `pushed`: an amount pushed to or from us on channel open.", |
| 5137 | + " * `rebalance_fee`: routing fee paid for sending a payment to ourselves.", |
| 5138 | + " * `routed`: credit gained from routing a payment", |
| 5139 | + " * `withdrawal`: debit from an onchain spend.", |
| 5140 | + "{description}: description as provided in the invoice, if present", |
| 5141 | + "{credit}: credit amount in BTC", |
| 5142 | + "{debit}: debit amount in BTC", |
| 5143 | + "{fees}: fee amount in BTC", |
| 5144 | + "{localtime}: event timestamp in local time as YYYY-MM-DD HH:MM:SS", |
| 5145 | + "{utctime}: event timestamp in UTC as YYYY-MM-DD HH:MM:SS", |
| 5146 | + "{outpoint}: outpoint, if present", |
| 5147 | + "{txid}: txid, if present", |
| 5148 | + "{payment_id}: payment hash, if present", |
| 5149 | + "{bkpr-currency}: value of bkpr-currency, if any", |
| 5150 | + "{currencyrate}: exchange rate for 1 BTC at that event time, if available", |
| 5151 | + "{creditdebit}: +credit or -debit (or 0) in BTC", |
| 5152 | + "{currencycredit}: credit amount converted into bkpr-currency", |
| 5153 | + "{currencydebit}: debit amount converted into bkpr-currency", |
| 5154 | + "{currencycreditdebit}: +credit or -debit (or 0) in bkpr-currency", |
| 5155 | + "", |
| 5156 | + "If a field is unavailable, it expands to an empty string.", |
| 5157 | + "", |
| 5158 | + "You can provide fallback with ?, including more variable:", |
| 5159 | + " * {outpoint?NONE}", |
| 5160 | + " * {payment_id?txid: {txid?UNKNOWN}}", |
| 5161 | + "The first one the outpoint, or NONE if that is not available. ", |
| 5162 | + "The second prints the payment_id, or if that is not available, the string 'txid: ' followed by the txid, or if that is not available, 'txid: UNKNOWN'.", |
| 5163 | + "", |
| 5164 | + "The text after ? is used only if that tag would otherwise be empty.", |
| 5165 | + "", |
| 5166 | + "To include a literal {, write {{." |
| 5167 | + ] |
| 5168 | + }, |
| 5169 | + "headers": { |
| 5170 | + "type": "array", |
| 5171 | + "description": [ |
| 5172 | + "strings to place at the top of the output (useful when creating CSV files directly)." |
| 5173 | + ], |
| 5174 | + "items": { |
| 5175 | + "type": "string" |
| 5176 | + } |
| 5177 | + }, |
| 5178 | + "escape": { |
| 5179 | + "type": "string", |
| 5180 | + "description": [ |
| 5181 | + "How to handle fields: if set to `csv` it will handle fields with commas or double-quotes correctly for that format." |
| 5182 | + ], |
| 5183 | + "items": { |
| 5184 | + "type": "string" |
| 5185 | + }, |
| 5186 | + "default": "none" |
| 5187 | + }, |
| 5188 | + "start_time": { |
| 5189 | + "type": "u32", |
| 5190 | + "description": [ |
| 5191 | + "UNIX timestamp (in seconds) that filters events after the provided timestamp." |
| 5192 | + ], |
| 5193 | + "default": "zero" |
| 5194 | + }, |
| 5195 | + "end_time": { |
| 5196 | + "type": "u32", |
| 5197 | + "description": [ |
| 5198 | + "UNIX timestamp (in seconds) that filters events up to and at the provided timestamp." |
| 5199 | + ], |
| 5200 | + "default": "max-int" |
| 5201 | + } |
| 5202 | + } |
| 5203 | + }, |
| 5204 | + "response": { |
| 5205 | + "required": [ |
| 5206 | + "report" |
| 5207 | + ], |
| 5208 | + "additionalProperties": false, |
| 5209 | + "properties": { |
| 5210 | + "format-hint": {}, |
| 5211 | + "report": { |
| 5212 | + "type": "array", |
| 5213 | + "items": { |
| 5214 | + "type": "string", |
| 5215 | + "description": [ |
| 5216 | + "The headers one per entry, followed by the formatted strings for each income event" |
| 5217 | + ] |
| 5218 | + } |
| 5219 | + } |
| 5220 | + } |
| 5221 | + }, |
| 5222 | + "author": [ |
| 5223 | + "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible." |
| 5224 | + ], |
| 5225 | + "see_also": [ |
| 5226 | + "lightning-bkpr-listaccountevents(7)", |
| 5227 | + "lightning-bkpr-listbalances(7)", |
| 5228 | + "lightningd-config(5)" |
| 5229 | + ], |
| 5230 | + "resources": [ |
| 5231 | + "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)" |
| 5232 | + ] |
| 5233 | + }, |
5108 | 5234 | "blacklistrune.json": { |
5109 | 5235 | "$schema": "../rpc-schema-draft.json", |
5110 | 5236 | "type": "object", |
|
0 commit comments