Skip to content

feat: add shared transaction summary builder (Closes #90) - #209

Merged
El-swaggerito merged 1 commit into
Axionvera:mainfrom
panditdhamdhere:feat/transaction-summary-builder
Jul 29, 2026
Merged

feat: add shared transaction summary builder (Closes #90)#209
El-swaggerito merged 1 commit into
Axionvera:mainfrom
panditdhamdhere:feat/transaction-summary-builder

Conversation

@panditdhamdhere

Copy link
Copy Markdown
Contributor

Summary

Closes #90

Adds a shared review-before-action TransactionSummary model and builders for payment, anchor, and escrow preview screens, with web UI integration, fixtures, tests, and docs. Also restores apps/web/components/ui.tsx and apps/web/app/assets/page.tsx, which were truncated on main and blocked web typecheck/build.

Issue scope

Acceptance Criterion Status Implementation Evidence Tests Notes
Transaction summary type is implemented Complete packages/types TransactionSummary* + packages/validators TransactionSummarySchema packages/validators/test/summary.test.ts
Payment, anchor, and escrow summary cases are supported Complete paymentIntentToSummary, anchorRequestToSummary, anchorRecordToSummary, escrowMilestoneToSummary in packages/stellar-kit/src/summary.ts packages/stellar-kit/test/summary.test.ts
Network, asset, memo, and fee information is represented where available Complete Summary fields + fee estimate sources (anchor_config / anchor_record / unavailable / manual) stellar-kit + validators tests Protocol fee estimation is intentionally unavailable in MVP
Web preview components use the shared summary builder Complete TransactionSummaryPanel on payments, anchors, escrow apps/web/test/transaction-summary.test.ts Screenshots pending if required by reviewer
Tests cover major summary states Complete Payment / deposit / withdrawal / escrow / parse / fixtures stellar-kit, validators, web
Documentation explains summary limitations Complete docs/transaction-summary.md N/A Linked from docs page + README

Affected packages / apps

  • apps/web
  • packages/types
  • packages/config
  • packages/fixtures
  • packages/validators
  • packages/stellar-kit
  • packages/anchor-utils
  • contracts/treasury-escrow
  • docs/
  • Other (list): examples/, scripts/check-examples.mts

Testing performed

  • pnpm --filter @anchorkit/types... build
  • pnpm --filter @anchorkit/validators... build
  • pnpm --filter @anchorkit/stellar-kit... build
  • pnpm --filter @anchorkit/stellar-kit test -- summary.test.ts (13 passed)
  • pnpm --filter @anchorkit/validators test -- summary.test.ts examples.test.ts (25 passed)
  • pnpm check:examples (19 examples, 0 failing)
  • pnpm --filter @anchorkit/web test -- transaction-summary.test.ts (4 passed)
  • pnpm --filter @anchorkit/web typecheck
  • pnpm --filter @anchorkit/web build

CI status: Pending after PR open.

Screenshots / recordings

Before After
No shared summary panel on payment/anchor/escrow review surfaces Shared TransactionSummaryPanel on /payments, /anchors, /escrow

Security impact

  • This PR touches secret handling, callback URLs, network selection, or contract admin/authorization logic.
  • No security-relevant surface touched.

Defaults remain testnet-first. Summaries use public keys only; no secrets in fixtures.

Documentation impact

  • Docs under /docs updated for this change.
  • README updated (new package, script, or workflow).
  • No user-facing behaviour changed — no docs update needed.

Maintainer Review Checklist (self-check)

PR self-check

  • References the original issue with Closes #90 in the PR body.
  • Acceptance criteria on the issue are checked off individually in the PR description.
  • Local package builds + targeted tests + web typecheck/build passed.
  • pnpm check:boundaries (run if reviewer requests; package source imports added within existing deps).
  • pnpm contract:test N/A — no contract changes.

Stellar network correctness

  • New key parsing matches branded types.
  • Amounts remain 7-decimal strings.
  • Memo rules enforced if touched.
  • Horizon error handling N/A — no new Horizon calls.
  • No new mainnet-reaching Horizon/RPC calls.

Anchor and SEP flow correctness

  • Deposit/withdrawal metadata uses existing request shapes for summary mapping.
  • Callback URL validation N/A.
  • Lifecycle transitions N/A.
  • Exhaustive never checks used in operation headline switch.

Payment intent and readiness correctness

  • Payment summaries built from validated PaymentIntent objects.
  • Readiness warnings can be passed through as riskNotes.
  • Spendable balance model N/A for this PR.

Soroban contract correctness (if contracts/ changed)

  • N/A

Secret leakage (R0–R6)

  • R0–R6 respected; fixtures use public demo keys only.
  • Diff search for secret-key patterns is clean.

Mainnet safety

  • Defaults remain testnet-first.
  • No new mainnet submission paths.
  • No hardcoded mainnet production URLs.

Tests

  • New public functions have positive + negative Vitest cases.
  • Fixture/example validation covered.
  • Tests do not print or assert on raw secrets.

Documentation

  • docs/transaction-summary.md added.
  • README docs index + web docs nav updated.
  • Security docs N/A.

@El-swaggerito
El-swaggerito merged commit bf9572b into Axionvera:main Jul 29, 2026
1 check passed
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.

Add AnchorKit transaction summary builder

2 participants