feat(payment-receipt-reconciler): reconcile payment ops with account effects - #492
Merged
egekoca merged 3 commits intoSep 30, 2026
Merged
Conversation
|
@chainsmt Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
HttpResponse.json<T extends JsonBodyType>() cannot infer a type parameter from a bare 'unknown' argument, since 'unknown' is not assignable to JsonBodyType's Record<string, any> | primitive union. Typing the fixture parameters as JsonBodyType directly (msw's own exported type) fixes the type error without loosening what the fixtures can actually be.
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.
Closes #466
Summary
Adds Payment Receipt Reconciler under
features/payment-receipt-reconciler/. Given one settled classic payment or path-payment transaction, it builds a public receipt that ties supported operations to observed Horizon debit/credit effects, shows exact per-asset totals, and keeps the charged fee separate — without pretending to be a full accounting export.Motivation
/transactions/{hash}plus operations and effects already contain the pieces of a receipt, but operators still have to manually correlate operation TOIDs with effect IDs and decide what belongs “inside” the receipt. Silent drops of unrelated ops/effects hide audit trails. This tool keeps outside items visible and links supported transfers exactly.What this PR does
empty_input/invalid_hash).GET /transactions/{hash},/operations, and/effectson the selected network vialib/receipt-fetch.ts.transaction_not_found) and failed transactions (transaction_failed) with specific outcomes — a failed payment is not treated as a durable receipt.payment,path_payment_strict_send, andpath_payment_strict_receiveas supported operations; everything else is listed under Outside this receipt (not silently dropped).account_debited/account_creditedeffects using the operation TOID embedded in the effect id (lib/effect-links.ts). Missing either side yieldsincomplete_effects.BigIntstroops (lib/receipt-amounts.ts). Charged fee is displayed separately and never folded into debit totals.Architecture notes
features/payment-receipt-reconciler/.request_failed; domain outcomes keep dedicated codes for actionable UI copy.Acceptance criteria coverage
Out of scope
Test plan
npm run verify:features -- payment-receipt-reconciler(35 files)npm test -- features/payment-receipt-reconciler(52 tests)