Skip to content

Blockchain Confirmation Block Counter Widget #515

Description

@Kingsman-99

Description

After a user signs and submits a payment transaction, the app shows no indication of how many block confirmations have been received, leaving them unsure whether the transaction is still pending or already finalized. A live confirmation block counter should display progress toward finality.

Technical Context

src/hooks/useTransactionConfirmations.ts (new) polls src/app/api/tx/[hash]/route.ts (new), which queries Horizon /transactions/<hash> and returns the ledger sequence and the current ledger sequence from /ledgers?order=desc&limit=1 to compute confirmations. A src/components/invoice/ConfirmationCounter.tsx renders a circular progress indicator (SVG arc) that fills as confirmations increase toward a FINALITY_THRESHOLD constant (e.g., 3). Polling stops when the threshold is reached.

Acceptance Criteria

  • After a transaction is submitted, a confirmation counter appears showing "0 / 3 confirmations"
  • The counter increments as the Horizon polling endpoint returns new ledger data
  • A circular SVG progress arc fills proportionally as confirmations approach the finality threshold
  • When the threshold is reached the counter displays "Confirmed" with a green checkmark and polling stops
  • The polling interval is 5 seconds and pauses when the browser tab is hidden using the Page Visibility API
  • All CI checks (npm test, npm run build, ESLint/TypeScript) pass and the branch has no merge conflicts

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions