feat: add Type field and on-chain details to transaction detail view #130
No reviewers
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/AutistMask#130
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/issue-95-transaction-type-display"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds a prominent Type field as the first item in the transaction detail view, and fetches additional on-chain details from Blockscout to make this the authoritative record view.
Transaction Type Detection
The Type field identifies each transaction as one of:
toaddressAdditional On-Chain Details
The view now fetches and displays from Blockscout:
Token Contract Display
For ERC-20 token transfers, shows the token contract address with identicon dot and Etherscan link.
All new fields are click-copyable.
closes #95
Changes Summary
This PR addresses issue #95 by making the transaction detail view the authoritative record it should be.
1. Type Field (Primary Request)
Added a Type key/value pair as the first field under the "Transaction" heading. It uses
getTransactionType()to classify every transaction:toaddressapprove/setApprovalForAllmethodThe Type field is always visible — previously it was only shown for contract calls.
2. On-Chain Details (Audit Enhancement)
The view now fetches full transaction data from Blockscout for all transactions (not just contract calls) and displays:
3. Token Contract Address
For ERC-20 token transfers, a Token contract field shows the full contract address with identicon dot and Etherscan link.
4. All Fields Click-Copyable
Every new field follows the existing pattern — click to copy with flash feedback.
Files Changed
src/popup/views/transactionDetail.js— type detection logic, on-chain detail fetching, token contract displaysrc/popup/index.html— HTML sections for new fieldsBuild
docker build .passes cleanly.Review: NEEDS REWORK
Code Quality
The implementation is solid. Type classification logic is correct and covers all cases. On-chain detail fetching correctly extends the existing Blockscout
loadCalldatapattern. Token contract display for ERC-20 transfers is correct. Click-copyable fields follow existing conventions.docker build .passes. No modifications to Makefile, RULES.md, linter config, or tests.Issue: README.md not updated
The TransactionDetail section in README.md (line ~435) lists the elements shown on this screen but does not include any of the new fields added by this PR:
The README is the project's primary documentation and the TransactionDetail screen description must match what the code actually renders. The Type field should be listed first in the Elements list (matching its position in the UI). The on-chain details should be listed after the transaction hash entry.
Please update the
#### TransactionDetailsection in README.md to include all new fields.Review: PASS ✅
Summary
Clean, well-structured addition that makes the transaction detail view significantly more informative. Two files changed (+171/−12), no Makefile/test/linter modifications. Docker build passes.
Type Detection (
getTransactionType())!tx.tofor contract creation,tx.direction === "contract"with sub-conditions for swaps/approvals, then falls through to token symbol check for ERC-20 vs nativeOn-Chain Details (
populateOnChainDetails())formatEther✅formatUnits✅txData.fee?.value || txData.tx_feehandles both Blockscout v2 response shapesToken Contract Display
Code Quality
hidden(no layout shift) ✅data-copyhandlers ✅ethersimports (formatEther,formatUnits) are standard utilities ✅contractAddressproperly threaded throughshow()→state.viewData✅Minor Nit (non-blocking)
log.errorf("loadCalldata failed:", ...)— stale function name in log message after rename toloadFullTxDetails. Cosmetic only.Checks
docker build .✅ passesmain(no rebase needed)Marking
merge-ready.Rework Complete
Updated the TransactionDetail section in README.md screen map to document the 7 new fields added by this PR:
All fields are tap-to-copy, matching the implementation in
transactionDetail.js.docker build .passes. OnlyREADME.mdwas modified.Addresses review feedback on PR #130 for issue #95.
Re-review: PASS ✅
Re-reviewed after README rework. All 7 new fields are now documented in the TransactionDetail screen map:
README descriptions match the code implementation.
docker build .passes. Branch is up to date with main.Labeled
merge-ready, assigned to @sneak for final review.