Merged
Conversation
b43337b to
c27cede
Compare
d640251 to
385cfe7
Compare
Add a closing_balance_sats field to Statement so consumers (e.g. the export summary) can report the final BTC balance without recomputing it. Include the closing sat balance in the export summary line when FIFO or mark-to-market entries are present. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extend WalletTransaction with two new fields: - payment_hash: Optional Lightning payment hash for invoice matching. - kind: TxKind enum distinguishing standard transactions from liquidity purchases that need special accounting treatment. All existing constructors set the defaults (None / TxKind::Default). No behavioral changes yet — this is purely a data-model extension. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Teach the accounting engine to handle Lightning-specific fields: - Refactor format_description to support empty labels (Lightning transactions have no address) and an optional suffix for payment hash or fee notes. - Handle TxKind::LiquidityPurchase: emit as a single fee entry with pre-formatted mining/service fee breakdown. - Include payment_hash in receive and send descriptions. - Add fee_threshold_cents: fees below this threshold are folded into the parent entry description instead of emitted as separate entries. - Use "Lightning send fee" label when tx.label is "lightning_sent". - Add --fee-threshold-cents CLI flag. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a phoenixd CSV transaction source that parses the CSV format produced by `phoenix-cli exportcsv` (phoenixd v0.7.3). Supported types: lightning_received, lightning_sent, swap_out, channel_close, and liquidity_purchase. All other types are rejected with an error. Channel-opening receives (lightning_received with mining/service fees) are split into a plain receive plus a LiquidityPurchase fee entry. Fee credits are folded into the received amount. The CSV fixture contains 7 representative rows from the upstream phoenixd testnet sample database. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add --phoenixd-csv and --nodeid flags to the export command. When --phoenixd-csv is given, transactions are read from a phoenixd CSV export instead of Bitcoin Core RPC. The node ID is cached in .cache/phoenixd_node.txt after the first run. Refactor run() into run_bitcoin_core_source() and run_phoenixd_source() that return a common (iban, transactions, wallet_balance, descriptors, bank_name) tuple. The integration test uses real CSV rows from the upstream phoenixd testnet sample database and real 2024 Kraken EUR/BTC daily rates. CI validates the generated XML against the CAMT.053 XSD. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Usage:
phoenix-cli exportcsv cargo run -- export --country FR --phoenixd-csv payments.csv --nodeid 03864e... --output lightning.xml