Skip to content

stack/getpaid 2 53 accounting updates - #221

Draft
BullishNode wants to merge 3 commits into
stack/getpaid-2-52-nostr-keychain-manifestfrom
stack/getpaid-2-53-accounting-updates
Draft

stack/getpaid 2 53 accounting updates#221
BullishNode wants to merge 3 commits into
stack/getpaid-2-52-nostr-keychain-manifestfrom
stack/getpaid-2-53-accounting-updates

Conversation

@BullishNode

Copy link
Copy Markdown
Owner

Stack created with GitHub Stacks CLIGive Feedback 💬

FrancisPouliot and others added 3 commits July 31, 2026 04:49
…V export

A payment has two exact facts and one estimate, never forced to sum: the
fiat leg is exact (Bull Bitcoin's execution rate is the only real exchange
rate; spread is baked in; the payer pays network fees), while the Bitcoin
leg is exact in sats and approximate in fiat at the invoice-creation
reference rate. Reference rates exist only for fiat-priced invoices.

Rendering extends existing rows in place — no new sections:
- "Rate at creation" row (payment details + invoice details), shown only
  when the server provides the rate AND its face currency (the invoice
  face currency can differ from a fiat leg's currency)
- a muted ≈ sub-line under the L-BTC amount (sats × creation rate, face
  currency, banker's rounding — single derivation shared with the export)
- the settled fiat amount's sub-line shows "executed at <rate>/BTC" in the
  leg currency, maturing the same slot the pending explainer uses

Parser accepts the anticipated contract fields (creation_rate_minor_per_btc
+ creation_rate_currency on settlement_details and the invoice status;
execution_rate_minor_per_btc per fiat leg) with the established discipline:
absent means absent UI — bit-identical to today against current servers —
and present-but-invalid fails the projection closed. The v3 fixture
anticipates the server contract and is replaced byte-identical when the
bullnym PR lands.

CSV export (local, no server endpoint): a Get Paid export action pages the
full history and writes the accounting columns with exactness carried in
the column names (estimates suffixed _est, empty when no reference rate);
private payer comments are never exported. Reuses the shared save path.
- export: fail closed with a non-retryable incompleteHistory failure on
  page-cap-with-cursor and repeated-cursor loops instead of silently
  truncating the CSV as if it were the complete history
- export saver: move the shared TransactionExportSaver port + CSV impl to
  lib/core/export so Get Paid no longer imports a Transactions-internal port
- export cubit: guard emits with isClosed after the history walk, the save
  dialog, and in the exception handler so leaving the route no longer throws
- fixture: replace the anticipatory v3 fixture byte-for-byte with the
  bullnym SatoshiPortal#241 server fixture and drop the _comment
- tests: cover the cap/loop-guard failures and the route-disposal cases

Review finding #1 (render R2 on pending legs) intentionally not applied:
pending legs carry no execution rate in the contract and can reprice, so
the existing settled-gating is correct and would regress otherwise.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants