feat: add transaction history to Buy SPORE page #71

Merged
sameh-farouk merged 1 commit from feature/transaction-history into development 2026-04-08 10:09:28 +00:00
Member

Summary

  • Add Transaction History section to the Buy SPORE page showing all past TFT→SPORE purchases fetched from the hero_tfspores bridge API
  • Display extrinsic hash (real on-chain hash) with click-to-copy and visual feedback, instead of the bridge's synthetic tx_hash
  • Remove redundant "Latest Transfer" card (info already in success banner and history)
  • Style history rows to match existing dark card UI
  • Add 30-second periodic auto-refresh for TFT balance, SPORE balance, and transaction history
  • Smart refresh on bridge terminal states: CONFIRMED refreshes all three; REFUNDED refreshes TFT balance and history

Changes

File Change
crates/shared/src/lib.rs Added SporeBridgeHistoryResponse type
crates/backend/src/api.rs Added /api/spore-bridge/history?sender= proxy endpoint
crates/backend/src/main.rs Registered route
crates/frontend/src/api.rs Added fetch_spore_bridge_history()
crates/frontend/src/components/copyable_address.rs Made copy_to_clipboard public for reuse
crates/frontend/src/components/transfer.rs Transaction history UI, periodic refresh, click-to-copy hash

Test plan

  • Backend: make check && make lint && make fmt pass
  • Tested locally against devnet bridge (br.dev.projectmycelium.com)
  • Made 4 test purchases (1, 10, 5, 15 TFT) — all confirmed by bridge
  • History table shows correct amounts, dates, statuses
  • Click-to-copy extrinsic hash works with visual feedback
  • Auto-refresh every 30s verified
  • Balance + history refresh on CONFIRMED status verified

Closes #60
Closes #70

## Summary - Add **Transaction History** section to the Buy SPORE page showing all past TFT→SPORE purchases fetched from the hero_tfspores bridge API - Display extrinsic hash (real on-chain hash) with **click-to-copy** and visual feedback, instead of the bridge's synthetic tx_hash - Remove redundant "Latest Transfer" card (info already in success banner and history) - Style history rows to match existing dark card UI - Add **30-second periodic auto-refresh** for TFT balance, SPORE balance, and transaction history - Smart refresh on bridge terminal states: CONFIRMED refreshes all three; REFUNDED refreshes TFT balance and history ## Changes | File | Change | |------|--------| | `crates/shared/src/lib.rs` | Added `SporeBridgeHistoryResponse` type | | `crates/backend/src/api.rs` | Added `/api/spore-bridge/history?sender=` proxy endpoint | | `crates/backend/src/main.rs` | Registered route | | `crates/frontend/src/api.rs` | Added `fetch_spore_bridge_history()` | | `crates/frontend/src/components/copyable_address.rs` | Made `copy_to_clipboard` public for reuse | | `crates/frontend/src/components/transfer.rs` | Transaction history UI, periodic refresh, click-to-copy hash | ## Test plan - [x] Backend: `make check && make lint && make fmt` pass - [x] Tested locally against devnet bridge (`br.dev.projectmycelium.com`) - [x] Made 4 test purchases (1, 10, 5, 15 TFT) — all confirmed by bridge - [x] History table shows correct amounts, dates, statuses - [x] Click-to-copy extrinsic hash works with visual feedback - [x] Auto-refresh every 30s verified - [x] Balance + history refresh on CONFIRMED status verified Closes #60 Closes #70
feat: add transaction history to Buy SPORE page
All checks were successful
Test / check (pull_request) Successful in 6m12s
1617d63e9a
- Add Transaction History section showing all past TFT→SPORE purchases
  fetched from the hero_tfspores bridge API (/txs?sender=)
- Display extrinsic hash (real on-chain hash) with click-to-copy and
  visual feedback, instead of the bridge's synthetic tx_hash
- Remove redundant "Latest Transfer" card (info already in success
  banner and history)
- Style history rows to match existing dark card UI
- Add 30-second periodic auto-refresh for TFT balance, SPORE balance,
  and transaction history
- Refresh relevant data on bridge terminal states (CONFIRMED refreshes
  all; REFUNDED refreshes TFT balance and history)
- Backend proxy endpoint: /api/spore-bridge/history?sender=
- Shared type: SporeBridgeHistoryResponse

Closes #60
mahmoud approved these changes 2026-04-08 10:08:13 +00:00
sameh-farouk merged commit d981900ca4 into development 2026-04-08 10:09:28 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mycelium/www_migrate_mycelium!71
No description provided.