Commit Graph

278 Commits

Author SHA1 Message Date
54e6f6c180 Show tx status screens after dApp transaction approval
All checks were successful
check / check (push) Successful in 17s
Previously the approval popup closed immediately after the user
entered their password, giving zero feedback about whether the
transaction was broadcast or confirmed. Now:

1. Background sends the broadcast result back to the popup via
   sendResponse callback (txHash or error)
2. Popup shows wait-tx screen on success (with polling timer)
   or error-tx screen on failure
3. Wait-tx polls for confirmation and transitions to success-tx
4. Done button closes the approval window

txStatus.init() moved before the approval early-return so the
wait/success/error views are wired up in the approval popup.
Done buttons detect the approval context and call window.close()
instead of navigating to address detail.
2026-02-27 12:50:24 +07:00
1ebc206201 Replace old 150-token list with 511-token tokenList.js
All checks were successful
check / check (push) Successful in 14s
Delete src/shared/tokens.js and migrate all consumers to
src/shared/tokenList.js which has 511 tokens (vs ~150) sourced
from CoinGecko with on-chain verified decimals.

- prices.js: getTopTokenPrices now from tokenList
- transactions.js: KNOWN_SYMBOLS now from tokenList (3.4x more
  symbols for spoof detection)
- send.js: KNOWN_SYMBOLS for token dropdown filtering
- approval.js: uses pre-built TOKEN_BY_ADDRESS map instead of
  constructing its own from TOKENS array
- addToken.js: uses getTopTokens(25) for quick-pick buttons
  (only top 25 shown, not all 511)
2026-02-27 12:39:41 +07:00
e7711274b3 Add tokenList.js with 511 ERC-20 tokens ranked by market cap
All checks were successful
check / check (push) Successful in 13s
New module with top Ethereum mainnet ERC-20 tokens sourced from
CoinGecko API (market cap ranking) with decimals verified on-chain
via eth_call to each contract. Addresses are EIP-55 checksummed.

Exports:
- TOKENS: full array ordered by market cap
- TOKEN_BY_ADDRESS: Map of lowercase address -> token info
- KNOWN_SYMBOLS: Map of uppercase symbol -> legitimate address
- getTopTokens(n): return first n tokens

This module is not yet integrated into the existing token.js — it
exists alongside it for now as a data source ready for integration.
2026-02-27 12:37:01 +07:00
a9935eca8d Decode ERC-20 calldata in transaction approval popup
All checks were successful
check / check (push) Successful in 15s
The tx approval screen now decodes known ERC-20 function calls
(approve, transfer) and shows them in plain language instead of
raw hex. For the Uniswap approve example, the user now sees:

  Action: Token Approval
  Approve spending of your USDT
  Token: USDT (with full contract address + etherscan link)
  Spender: (full address + etherscan link)
  Amount: Unlimited

Known tokens from the built-in list show their symbol. Unknown
tokens show the contract address. Max uint256 approvals are
labeled "Unlimited". The raw data is still shown below in a
scrollable area for verification.

Also labels the "To" field as "Contract" since dApp transactions
are always contract calls, and shows the token symbol above the
contract address when recognized.
2026-02-27 12:33:09 +07:00
d29273114b Fix ERC-20 transfers showing as 0 ETH due to dedup bug
All checks were successful
check / check (push) Successful in 14s
When sending an ERC-20 token, Blockscout returns the same tx hash
from both the /transactions endpoint (as a 0 ETH contract call) and
the /token-transfers endpoint (as the actual token transfer with
amount and symbol). The old dedup logic kept the 0 ETH version and
skipped the token transfer.

Now token transfers replace normal transactions with the same hash,
since the token transfer has the real amount, symbol, and contract
address.
2026-02-27 12:29:15 +07:00
2467dfd09c Centralize view state into app ctx with viewData persistence
All checks were successful
check / check (push) Successful in 17s
Creates a centralized transactionDetail.js view module, replacing
the duplicated showTxDetail/copyableHtml/blockieHtml/txDetailAddressHtml
code that was in both addressDetail.js and addressToken.js (~120 lines
removed). Transaction data is stored in state.viewData and persisted,
so the transaction detail view survives popup close/reopen.

Adds viewData to persisted state. Each view that needs data for
restore stores it in state.viewData before rendering. The ctx object
now has showTransactionDetail() alongside all other show methods.

Restorable views expanded to include: transaction (via viewData.tx),
success-tx (via viewData.hash/blockNumber), error-tx (via
viewData.message). txStatus.js split into show (sets data) + render
(reads data) for each screen, enabling restore.

Non-restorable views (send, confirm-tx, wait-tx, add-wallet,
import-key, add-token) fall back to the nearest parent since they
involve active form state or network polling.
2026-02-27 12:16:33 +07:00
034253077c Persist navigation state across popup close/reopen
All checks were successful
check / check (push) Successful in 17s
The current view, selected wallet, selected address, and selected
token are now saved to extension storage. When the popup reopens,
it restores to the last visited view instead of always returning
to the home screen.

Restorable views: main, address detail, address-token, receive,
settings. Non-restorable views (send, confirm, tx status, forms)
fall back to the nearest parent. Stored indices are validated
against current wallet data to handle stale references.

Also refactors receive view setup into a centralized receive.show()
function, eliminating duplicate QR/address/warning code from
addressDetail.js, addressToken.js, and home.js. Adds settings.show()
to centralize settings field population.
2026-02-27 12:12:07 +07:00
75cbbea035 Add user-facing documentation in docs/README.md
All checks were successful
check / check (push) Successful in 15s
Covers rationale, hard guidelines (always/never), external service
details (RPC, Blockscout, CoinDesk APIs with what data is sent),
encryption model, installation, wallet management, sending/receiving,
web3 site connections, scam protection, settings, and FAQ.

Written for a technical cryptocurrency user who is not a programmer.
2026-02-27 12:08:43 +07:00
6c3cc0c516 Update README Screen Map with all views and state transitions
All checks were successful
check / check (push) Successful in 17s
Complete rewrite of the Screen Map section documenting all 17 views:
Welcome, Home, AddWallet, ImportKey, AddressDetail, AddressToken,
Send, ConfirmTx, WaitTx, SuccessTx, ErrorTx, Receive,
TransactionDetail, AddToken, Settings, SiteApproval, TxApproval.

Each view documents its elements (with display details like blockies,
color dots, etherscan links, formatting) and all state transitions
with their destination screens and conditions.
2026-02-27 12:07:11 +07:00
d229000258 Add dedicated wait/success/error screens for transaction status
After broadcast, the user is taken to a full-screen wait view showing
the amount, recipient, tx hash (copyable + etherscan link), and a
count-up timer. The view polls every 10 seconds for confirmation.

On confirmation: navigates to success screen showing block number,
tx hash, and a Done button that returns to the address view.

On 60-second timeout or error: navigates to error screen with the
failure message, tx hash (if available), and Done button.

Replaces the previous inline confirm-status div that was crammed
onto the confirmation page.
2026-02-27 12:06:32 +07:00
e58f113cda Fix display consistency across all views
All checks were successful
check / check (push) Successful in 18s
Receive view: address now shows color dot and etherscan link,
matching every other address display in the app.

Send view "From": address now includes etherscan link alongside
the existing color dot.

Send view "What to send" (ERC-20 from token view): shows token
symbol as bold heading, then full contract address below with
color dot, copy-on-click, and etherscan link.

Approval views: tx approval From/To addresses now show color
dots and etherscan links instead of bare text. Site approval
address adds etherscan link. Tx approval value uses 4 decimal
places consistent with all other amount displays.

Home tx list: row padding changed from py-1 to py-2, matching
addressDetail and addressToken transaction lists.
2026-02-27 12:01:34 +07:00
a43e8f20ea Show blockies on confirm page, put USD values inline in parentheses
All checks were successful
check / check (push) Successful in 17s
From and To addresses now render with 48px blockie identicons,
color dots, and etherscan links — matching the transaction detail
view pattern. USD estimates for amount, balance, and network fee
are shown in parentheses after the value on the same line, not on
a separate line below.
2026-02-27 11:58:04 +07:00
b85eac1e75 Enhance confirm transaction page with full verification details
All checks were successful
check / check (push) Successful in 17s
The confirmation page now shows:
- Transaction type (Native ETH transfer vs ERC-20 token transfer)
- Full ERC-20 token contract address with etherscan link
- Token symbol throughout (not raw contract address)
- Current balance of the token being sent, with USD value
- Estimated network fee in ETH and USD (fetched async)
- USD value for ERC-20 token amounts (not just ETH)
- Insufficient balance errors for ERC-20 tokens

Also implements actual ERC-20 token transfers via the token contract's
transfer() function, rather than only supporting native ETH sends.
2026-02-27 11:42:42 +07:00
01201d54b2 Fix send balance display when sending from address-token view
All checks were successful
check / check (push) Successful in 17s
Read token from state.selectedToken when set, falling back to the
select element. This ensures the correct token balance is shown even
when the select dropdown is hidden or its value didn't take because
the token was filtered out by renderSendTokenSelect.
2026-02-27 11:39:50 +07:00
fbb0def267 Replace send token dropdown with static display when token is locked
All checks were successful
check / check (push) Successful in 17s
When sending from the address-token view, show the token symbol as
plain text instead of a disabled dropdown. ERC-20 tokens include an
etherscan link to the contract address. The dropdown is restored when
navigating back or entering send from other views.
2026-02-27 11:38:42 +07:00
a1b181a471 Move ERC-20 warning from address-token view to receive/QR view
All checks were successful
check / check (push) Successful in 17s
The warning about only sending ERC-20 tokens on the Ethereum network
belongs on the receive page where the QR code is shown, not on the
token detail view. Non-token receive flows hide the warning.
2026-02-27 11:37:18 +07:00
21fe854fa4 Add address-token detail view for per-token transaction filtering
All checks were successful
check / check (push) Successful in 17s
Clicking a token balance on the address detail view navigates to a
focused view showing only that token's transactions. Send pre-selects
and locks the token dropdown, Receive shows an ERC-20 warning for
non-ETH tokens, and all back buttons return to the correct parent view.
2026-02-27 11:26:59 +07:00
a5b2470dba Implement eth_sendTransaction for dApp-initiated transactions
All checks were successful
check / check (push) Successful in 17s
Show a confirmation popup with tx details (from, to, value, data) and
password prompt when a dApp calls eth_sendTransaction. Sign and broadcast
the transaction in the background, returning the tx hash to the dApp.
2026-02-26 18:39:09 +07:00
c131b89732 Fix spacing inconsistencies on home screen
All checks were successful
check / check (push) Successful in 16s
- Remove mb-1 from Recent Transactions header (wallet headers have
  no bottom margin, so this should match)
- Remove mb-3 wrapper from wallet sections (section header bg
  provides the visual break, extra margin created uneven gaps)
- Change tx row padding from py-2 to py-1 to match address rows
2026-02-26 17:11:27 +07:00
44a078eaac Add visual spacer between recent transactions and add wallet link
Some checks are pending
check / check (push) Waiting to run
2026-02-26 17:02:39 +07:00
59eb02a022 Darker section header background to visually delimit sections
All checks were successful
check / check (push) Successful in 15s
Add --color-section (#dddddd) distinct from --color-well (#f5f5f5).
Section headers on the home screen use bg-section so they stand out
as visual dividers rather than blending with the price well.
2026-02-26 16:53:10 +07:00
24f04e509a Use wallet name in titles, replace hr dividers with grey stripe headers
All checks were successful
check / check (push) Successful in 12s
Address titles now use wallet name instead of wallet index (e.g.
"Wallet 1 — Address 2" instead of "Address 1.2"). This applies to
the address detail page title, the home address labels, and the
addressTitle() helper used on confirmation pages.

Section dividers on the home screen are now full-width grey
background stripes instead of horizontal rules, visually breaking
the page into wallet sections and a recent transactions section.
2026-02-26 16:49:52 +07:00
01048a1c3d Consistent headings on home: lighter title rules, thick section dividers
All checks were successful
check / check (push) Successful in 17s
Wallet and Recent Transactions headings now use border-border-light
for their bottom rule. Thick 2px black horizontal rules separate
wallet sections from each other and from the transactions section,
with generous vertical spacing.
2026-02-26 16:44:57 +07:00
e5ffbb4634 Show 25 most recent transactions from all addresses on home screen
All checks were successful
check / check (push) Successful in 15s
Fetch transactions for every address across all wallets in parallel,
merge and deduplicate by hash, apply anti-poisoning filters, sort by
block number, and display the top 25 below the wallet list. Clicking
a transaction navigates to the address detail page for the relevant
address. Shows "Loading..." placeholder to prevent layout shift.
2026-02-26 16:41:15 +07:00
4c04dc4878 Add breathing room to transaction detail section headings
All checks were successful
check / check (push) Successful in 15s
Increase section spacing from mb-3 to mb-4, add mb-1 gap between
each heading label and its content.
2026-02-26 16:37:41 +07:00
db5e968b1d Make tx detail blockies 48px to match address detail page
All checks were successful
check / check (push) Successful in 14s
Display consistency: blockies must be the same size everywhere.
2026-02-26 16:36:00 +07:00
f69ce7f9d2 Restore color dots, add blockies above addresses on tx detail page
All checks were successful
check / check (push) Successful in 14s
Blockies now appear above the from/to addresses on a separate line,
with color dots restored inline next to the address text. Increased
spacing between transaction detail fields from mb-2 to mb-3.
2026-02-26 16:33:42 +07:00
156e77b5cf Show blockie identicons on transaction detail page
All checks were successful
check / check (push) Successful in 16s
Replace color dots with 16px circular blockies next to from and to
addresses on the transaction detail view.
2026-02-26 16:31:36 +07:00
6ba9b2c057 Right-align address USD total to match token balance values
All checks were successful
check / check (push) Successful in 17s
2026-02-26 16:30:42 +07:00
a01161c3a3 Make blockie identicon circular with more breathing room
All checks were successful
check / check (push) Successful in 14s
2026-02-26 16:29:47 +07:00
b1b8807060 Add Etherscan-style blockie identicon to address detail page
All checks were successful
check / check (push) Successful in 27s
Show a 48px pixelated blockie (same style as Etherscan) centered
above the wallet title on the address detail page. Uses
ethereum-blockies-base64 which generates a base64 PNG from the
address. Replaces the previously added @metamask/jazzicon.
2026-02-26 16:27:47 +07:00
7dd688f571 Remove padding from [info] button to prevent address wrapping
Some checks failed
check / check (push) Has been cancelled
2026-02-26 16:18:01 +07:00
d9df8a05a5 Fix [info] button border not rendering
Some checks failed
check / check (push) Has been cancelled
px-0.5 was not being generated by Tailwind since it only appeared in
JS, not in scanned HTML. Use inline padding instead.
2026-02-26 16:16:03 +07:00
150a1a1a34 Clear scanning flash when address scan completes
Some checks failed
check / check (push) Has been cancelled
The "Scanning for addresses..." flash had a 30-second timeout and was
never cleared on completion. Now shows "Found N addresses." when
multiple are found, or briefly shows "Ready." for single-address
wallets.
2026-02-26 16:12:35 +07:00
6056699ac1 Toggle settings gear to go back when already on settings page
Some checks failed
check / check (push) Has been cancelled
2026-02-26 16:10:04 +07:00
73b592af35 Restore [info] button border and hover with tighter padding
Some checks failed
check / check (push) Has been cancelled
2026-02-26 16:08:58 +07:00
7c97eb55e5 Add "Add additional wallet..." link at bottom of main view
Some checks failed
check / check (push) Has been cancelled
2026-02-26 16:07:53 +07:00
e1c3fd8056 Shrink info button to prevent address line wrapping
Some checks failed
check / check (push) Has been cancelled
Remove border and padding from the info button, use dashed underline
text style instead. This saves enough horizontal space that the full
address no longer wraps.
2026-02-26 16:06:14 +07:00
fb89f5d27b Fix layout shift from ETH price well and Total subtitle
Some checks failed
check / check (push) Has been cancelled
Both elements now have min-height and placeholder content so they
reserve vertical space before API data arrives, preventing layout
jumps when prices load. This follows the No Layout Shift policy
in the README.
2026-02-26 16:05:32 +07:00
72cf4aab8c Swap address row click behavior: row selects active, [info] opens detail
Some checks failed
check / check (push) Has been cancelled
Clicking an address row now makes it the active address (bold title,
updates headline and active address display, broadcasts to dapps).
The [info] button on each row opens the address detail page. This
replaces the previous [ ]/ACTIVE toggle.
2026-02-26 16:04:23 +07:00
881217b16c Change ETH price label to "$x,xxx.xx USD/ETH"
Some checks failed
check / check (push) Has been cancelled
2026-02-26 16:01:26 +07:00
938861c12e Move USD total to its own line and add etherscan link on address page
Some checks failed
check / check (push) Has been cancelled
The address now sits on its own line with no other elements beside it,
followed by an etherscan external link icon. The USD total value moves
to a separate line below.
2026-02-26 16:00:50 +07:00
49dfd79d73 Show ETH price, split headline into ETH balance and total USD
Some checks failed
check / check (push) Has been cancelled
Headline shows active address ETH balance with ETH-only USD value
in parentheses. Small "Total:" subtitle below includes ETH + token
values. A centered well between Send/Receive buttons and the wallet
list displays the current ETH price in USD.
2026-02-26 15:58:39 +07:00
ba54f412d2 Show active address ETH balance and USD value in headline
Some checks failed
check / check (push) Has been cancelled
The headline now shows the active address's balance as
"x.yyyy ETH ($z.aa USD)" instead of the sum across all wallets.
2026-02-26 15:56:09 +07:00
e8e5edf5f2 Make active address display copyable with etherscan link
Some checks failed
check / check (push) Has been cancelled
Click the active address above Send/Receive to copy it. A small
box-arrow icon links to the address on etherscan.
2026-02-26 15:53:56 +07:00
fce907df55 Use compact [ ] select button and show active address above actions
Some checks failed
check / check (push) Has been cancelled
Replace [select] with [ ] to avoid wrapping the full address line.
ACTIVE label stays as-is for discoverability. Show the currently
active address (full, untruncated, with color dot) above the Send
and Receive buttons on the home screen.
2026-02-26 15:51:56 +07:00
fced156e3e Rearrange home address layout and widen rename input
Some checks failed
check / check (push) Has been cancelled
Each address now shows: title on its own line, full untruncated
address with ACTIVE/select marker on the next line, USD total
right-aligned on the next line, then token balances below. The
wallet rename input now fills the available width.
2026-02-26 15:48:09 +07:00
5d1873ac78 Allow renaming wallets by clicking the wallet name
Some checks failed
check / check (push) Has been cancelled
Click the wallet name on the home screen to edit it inline. The name
turns into a text input; press Enter or click away to save, Escape
to cancel. The dashed underline on the name indicates it is editable.
2026-02-26 15:44:17 +07:00
d24c10ca9c Debug-log every API request and response
Some checks failed
check / check (push) Has been cancelled
Add debugFetch wrapper in log.js that logs method, URL, and body on
request, and status code on response. Replace all fetch() calls
across balances, transactions, tokens, background RPC proxy, and
settings validation with debugFetch.
2026-02-26 15:40:09 +07:00
47e690f466 Show tracked tokens with zero balance on main and address pages
Some checks failed
check / check (push) Has been cancelled
Add showZeroBalanceTokens setting (default: on). When enabled,
balanceLinesForAddress merges state.trackedTokens with the address's
tokenBalances, showing 0.0000 lines for tracked tokens that have no
balance on that address. This gives users visibility into all tokens
they're watching across all addresses.
2026-02-26 15:37:39 +07:00