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:
Native ETH Transfer — plain ETH send with no calldata
ERC-20 Token Transfer — token transfer (non-ETH symbol)
Swap — decoded Uniswap/DEX swap
Token Approval — approve/setApprovalForAll calls
Contract Call — generic contract interaction
Contract Creation — no to address
Additional On-Chain Details
The view now fetches and displays from Blockscout:
Block number (with Etherscan link)
Nonce
Transaction fee (in ETH)
Gas price (in Gwei)
Gas used
Token Contract Display
For ERC-20 token transfers, shows the token contract address with identicon dot and Etherscan link.
## 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:
- **Native ETH Transfer** — plain ETH send with no calldata
- **ERC-20 Token Transfer** — token transfer (non-ETH symbol)
- **Swap** — decoded Uniswap/DEX swap
- **Token Approval** — approve/setApprovalForAll calls
- **Contract Call** — generic contract interaction
- **Contract Creation** — no `to` address
### Additional On-Chain Details
The view now fetches and displays from Blockscout:
- **Block number** (with Etherscan link)
- **Nonce**
- **Transaction fee** (in ETH)
- **Gas price** (in Gwei)
- **Gas used**
### 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 https://git.eeqj.de/sneak/AutistMask/issues/95
- Always display a Type field as the first item under the Transaction
heading, identifying the transaction as: Native ETH Transfer, ERC-20
Token Transfer, Swap, Token Approval, Contract Call, or Contract Creation
- Show token contract address with identicon for ERC-20 transfers
- Fetch and display on-chain details from Blockscout: block number,
nonce, transaction fee, gas price, and gas used
- All new fields are click-copyable with Etherscan links where applicable
closes#95
src/popup/index.html — HTML sections for new fields
Build
docker build . passes cleanly.
## Changes Summary
This PR addresses [issue #95](https://git.eeqj.de/sneak/AutistMask/issues/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:
| Condition | Type Label |
|---|---|
| No `to` address | Contract Creation |
| Decoded swap | Swap |
| `approve`/`setApprovalForAll` method | Token Approval |
| Other contract interaction | Contract Call |
| Non-ETH symbol | ERC-20 Token Transfer |
| ETH with no calldata | Native ETH Transfer |
The 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:
- **Block number** — with Etherscan link
- **Nonce**
- **Transaction fee** — formatted in ETH
- **Gas price** — formatted in Gwei
- **Gas used**
### 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 display
- `src/popup/index.html` — HTML sections for new fields
### Build
`docker build .` passes cleanly.
clawbot
self-assigned this 2026-03-01 15:13:33 +01:00
The implementation is solid. Type classification logic is correct and covers all cases. On-chain detail fetching correctly extends the existing Blockscout loadCalldata pattern. 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:
Type (the primary deliverable of this PR)
Token contract (for ERC-20 transfers)
Block number
Nonce
Transaction fee
Gas price
Gas used
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 #### TransactionDetail section in README.md to include all new fields.
## 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 `loadCalldata` pattern. 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](https://git.eeqj.de/sneak/AutistMask/src/branch/main/README.md#transactiondetail) (line ~435) lists the elements shown on this screen but does not include any of the new fields added by this PR:
- **Type** (the primary deliverable of this PR)
- **Token contract** (for ERC-20 transfers)
- **Block number**
- **Nonce**
- **Transaction fee**
- **Gas price**
- **Gas used**
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 `#### TransactionDetail` section in README.md to include all new fields.
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())
Correctly classifies into 6 categories: Native ETH Transfer, ERC-20 Token Transfer, Swap, Token Approval, Contract Call, Contract Creation
Logic is sound: checks !tx.to for contract creation, tx.direction === "contract" with sub-conditions for swaps/approvals, then falls through to token symbol check for ERC-20 vs native
Now always displayed (previously only shown for contract interactions)
On-Chain Details (populateOnChainDetails())
Block number with Etherscan link ✅
Nonce ✅
Transaction fee converted from wei → ETH via formatEther✅
Shows contract address with identicon dot and Etherscan link for ERC-20 transfers ✅
Correctly hidden for native ETH transfers ✅
Code Quality
All new sections start hidden (no layout shift) ✅
All fields are click-copyable with proper data-copy handlers ✅
HTML structure is consistent with existing patterns (mb-4, text-xs, text-muted) ✅
ethers imports (formatEther, formatUnits) are standard utilities ✅
Now fetches Blockscout details for ALL transactions, not just contract calls — correct per design intent ✅
contractAddress properly threaded through show() → state.viewData✅
Minor Nit (non-blocking)
Line 397: log.errorf("loadCalldata failed:", ...) — stale function name in log message after rename to loadFullTxDetails. Cosmetic only.
Checks
docker build .✅ passes
Branch is up to date with main (no rebase needed)
No Makefile, test config, or linter config modifications
Marking merge-ready.
## 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()`)
- Correctly classifies into 6 categories: Native ETH Transfer, ERC-20 Token Transfer, Swap, Token Approval, Contract Call, Contract Creation
- Logic is sound: checks `!tx.to` for contract creation, `tx.direction === "contract"` with sub-conditions for swaps/approvals, then falls through to token symbol check for ERC-20 vs native
- Now always displayed (previously only shown for contract interactions)
### On-Chain Details (`populateOnChainDetails()`)
- Block number with Etherscan link ✅
- Nonce ✅
- Transaction fee converted from wei → ETH via `formatEther` ✅
- Gas price converted to Gwei via `formatUnits` ✅
- Gas used ✅
- Proper fallback: `txData.fee?.value || txData.tx_fee` handles both Blockscout v2 response shapes
### Token Contract Display
- Shows contract address with identicon dot and Etherscan link for ERC-20 transfers ✅
- Correctly hidden for native ETH transfers ✅
### Code Quality
- All new sections start `hidden` (no layout shift) ✅
- All fields are click-copyable with proper `data-copy` handlers ✅
- HTML structure is consistent with existing patterns (mb-4, text-xs, text-muted) ✅
- `ethers` imports (`formatEther`, `formatUnits`) are standard utilities ✅
- Now fetches Blockscout details for ALL transactions, not just contract calls — correct per design intent ✅
- `contractAddress` properly threaded through `show()` → `state.viewData` ✅
### Minor Nit (non-blocking)
- Line 397: `log.errorf("loadCalldata failed:", ...)` — stale function name in log message after rename to `loadFullTxDetails`. Cosmetic only.
### Checks
- `docker build .` ✅ passes
- Branch is up to date with `main` (no rebase needed)
- No Makefile, test config, or linter config modifications
Marking `merge-ready`.
Add Type, Token contract, Block, Nonce, Transaction fee, Gas price,
and Gas used fields to the TransactionDetail section in the README
screen map to match the implemented UI.
## Rework Complete
Updated the **TransactionDetail** section in README.md screen map to document the 7 new fields added by this PR:
- **Type**: transaction classification (Native ETH Transfer, ERC-20 Token Transfer, Swap, Token Approval, Contract Call, Contract Creation)
- **Token contract**: shown for ERC-20 transfers (color dot + full address + etherscan token link)
- **Block**: block number + etherscan block link
- **Nonce**: transaction nonce
- **Transaction fee**: ETH amount
- **Gas price**: value in Gwei
- **Gas used**: integer
All fields are tap-to-copy, matching the implementation in `transactionDetail.js`.
`docker build .` passes. Only `README.md` was modified.
Addresses review feedback on [PR #130](https://git.eeqj.de/sneak/AutistMask/pulls/130) for [issue #95](https://git.eeqj.de/sneak/AutistMask/issues/95).
Re-reviewed after README rework. All 7 new fields are now documented in the TransactionDetail screen map:
Type — transaction classification (Native ETH Transfer, ERC-20 Token Transfer, Swap, Token Approval, Contract Call, Contract Creation)
Token contract — shown for ERC-20 transfers with color dot, copyable address, etherscan token link
Block — block number with copyable value and etherscan block link
Nonce — transaction nonce (copyable)
Transaction fee — ETH amount (copyable)
Gas price — value in Gwei (copyable)
Gas used — integer (copyable)
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.
## Re-review: PASS ✅
Re-reviewed after README rework. All 7 new fields are now documented in the TransactionDetail screen map:
- **Type** — transaction classification (Native ETH Transfer, ERC-20 Token Transfer, Swap, Token Approval, Contract Call, Contract Creation)
- **Token contract** — shown for ERC-20 transfers with color dot, copyable address, etherscan token link
- **Block** — block number with copyable value and etherscan block link
- **Nonce** — transaction nonce (copyable)
- **Transaction fee** — ETH amount (copyable)
- **Gas price** — value in Gwei (copyable)
- **Gas used** — integer (copyable)
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.
sneak
merged commit 4e097c1e32 into main2026-03-01 15:46:33 +01:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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.