Commit Graph

111 Commits

Author SHA1 Message Date
b8126c6080 Add Send and Receive buttons to main view using active address
Some checks failed
check / check (push) Has been cancelled
2026-02-26 03:47:04 +07:00
0d543288b2 Parallelize address scanning and unify address display formatting
Some checks failed
check / check (push) Has been cancelled
Scanning: check all gap-limit addresses in parallel per batch instead
of sequentially. For a wallet with 1 used address this reduces from
12 sequential RPC round-trips to 1 parallel batch + 1 small follow-up.

Display: add shared formatAddressHtml(address, ensName, maxLen) and
escapeHtml() to helpers.js. Use them in confirm-tx (was missing color
dot entirely) and approval view. Remove duplicate escapeHtml from
addressDetail.js.
2026-02-26 03:46:25 +07:00
1dfc006cb9 Fix [select] inheriting bold from parent flex container
Some checks failed
check / check (push) Has been cancelled
2026-02-26 03:44:45 +07:00
0643307824 Style [select] indicator as bracket-wrapped with dashed underline
Some checks failed
check / check (push) Has been cancelled
2026-02-26 03:41:43 +07:00
56fa56bc8a Add site connection permissions, approval flow, and active address
Some checks failed
check / check (push) Has been cancelled
- Add activeAddress, allowedSites, deniedSites, rememberSiteChoice to
  persisted state
- Replace auto-connect with permission checks: allowed sites connect
  automatically, denied sites are rejected, unknown sites trigger an
  approval popup
- Add approval popup UI with hostname display, active address preview,
  remember checkbox, and allow/deny buttons
- Add ACTIVE/[select] indicator on address rows in the main view to
  set the active web3 address
- Add allowed/denied site list management in settings with delete buttons
- Broadcast accountsChanged to connected dapps when active address changes
- Handle approval window close as implicit denial
2026-02-26 03:40:34 +07:00
9a6e544167 Truncate address to 40 chars on address detail pane for dot alignment
Some checks failed
check / check (push) Has been cancelled
2026-02-26 03:31:13 +07:00
0f03ba7cd8 Link tx hash, from, and to addresses to Etherscan in transaction detail view
Some checks failed
check / check (push) Has been cancelled
2026-02-26 03:29:42 +07:00
166bb46149 Truncate addresses by 2 chars to compensate for color dot width
Some checks failed
check / check (push) Has been cancelled
Move truncateMiddle to helpers.js for reuse. Shorten displayed addresses
by 2 characters wherever a dot is shown: home view (40 char max), tx list
(maxAddr - 2), and address detail container (40ch width).
2026-02-26 03:29:09 +07:00
138468287c Fix address color palette to use equally saturated colors
Some checks failed
check / check (push) Has been cancelled
Replace mixed-saturation palette with 16 hues evenly spaced at 22.5°
intervals, all at HSL(h, 70%, 50%) for uniform vibrancy.
2026-02-26 03:27:48 +07:00
d28d5a5a51 Add address color dots and cached ENS reverse lookups
Some checks failed
check / check (push) Has been cancelled
Deterministic colored dots derived from address bytes (16-color palette)
displayed before every address. ENS reverse resolution for transaction
counterparties with 12-hour localStorage cache.
2026-02-26 03:26:52 +07:00
fbff44ade6 Fix tx amount display to 4 decimal places, add relative time to tx detail
Some checks failed
check / check (push) Has been cancelled
- Transaction values now use exactly 4 decimal places (was 6),
  matching balance display everywhere else
- Transaction detail view shows "2026-02-25 15:04:23 (23 days ago)"
  instead of just the ISO date
- Added Display Consistency policy to README
2026-02-26 03:19:42 +07:00
a1ddbd035b Fix balance line spacing: use width:42ch;max-width:100%
Some checks failed
check / check (push) Has been cancelled
2026-02-26 03:17:08 +07:00
e1bd3bab58 Increase right padding to pr-5 (20px) for scrollbar gutter
Some checks failed
check / check (push) Has been cancelled
2026-02-26 03:15:32 +07:00
4765bf835f Add right padding on #app for overlay scrollbar gutter
Some checks failed
check / check (push) Has been cancelled
2026-02-26 03:14:39 +07:00
ff3554e24e Widen popup body to 412px to account for scrollbar width
Some checks failed
check / check (push) Has been cancelled
2026-02-26 03:13:31 +07:00
75ec67617b Rewrite tx list with innerHTML, fix scrollbar overlay and overflow
Some checks failed
check / check (push) Has been cancelled
- Rebuilt tx list rendering using innerHTML instead of createElement
- scrollbar-gutter: stable on body to prevent content shift
- max-width:42ch instead of width:42ch to prevent horizontal overflow
- overflow-x:hidden on body and #app
2026-02-26 03:12:33 +07:00
197f40bde5 Use inline styles for tx list items to fix overflow
Some checks failed
check / check (push) Has been cancelled
2026-02-26 02:33:42 +07:00
be08723851 Fix tx list overflow: add min-w-0 to truncatable flex children
Some checks failed
check / check (push) Has been cancelled
2026-02-26 02:32:04 +07:00
d0cca13715 Fix tx list overflow: use truncate on left spans, shrink-0+pl-2 on right
All checks were successful
check / check (push) Successful in 13s
Left-side spans (age, address) get tailwind truncate class so they
can't push the row wider than its container. Right-side spans (direction,
amount) get shrink-0 so they keep their full text. Also added
overflow-hidden on #tx-list container.
2026-02-26 02:30:32 +07:00
cef3d2ad37 Fix horizontal overflow: overflow-x-hidden on body and app, remove shrink-0 from 42ch spans
All checks were successful
check / check (push) Successful in 13s
The 42ch fixed-width spans with shrink-0 prevented flex from shrinking
them when the container was narrower, causing horizontal scrolling.
Also added overflow-x: hidden on body and #app as a safety net.
2026-02-26 02:29:11 +07:00
3eeaa7a7b2 Fix horizontal scrolling in transaction list with overflow-hidden
All checks were successful
check / check (push) Successful in 14s
2026-02-26 02:26:43 +07:00
9c80dbccf4 Shorten truncated address by 2 more chars to prevent wrapping
All checks were successful
check / check (push) Successful in 13s
2026-02-26 02:25:20 +07:00
7dba48b61d Shorten truncated address by 2 chars to prevent wrapping
All checks were successful
check / check (push) Successful in 14s
2026-02-26 02:24:34 +07:00
c278be65ed Refactor truncateAddress to truncateMiddle(str, maxLen)
All checks were successful
check / check (push) Successful in 14s
Clean signature that takes a target length instead of leaking
the amount-length calculation into the function.
2026-02-26 02:23:30 +07:00
9abe570e43 Truncate counterparty address in tx list based on amount width
All checks were successful
check / check (push) Successful in 14s
For every character beyond 10 in the amount string (e.g. "17.1900 USDT"
is 12 chars, 2 excess), remove that many characters from the middle of
the counterparty address, replaced with an ellipsis. Hover shows the
full address; clicking goes to tx detail which also shows it in full.
Prevents the address from wrapping onto a second line.
2026-02-26 02:22:38 +07:00
bf9ae4919d Redesign transaction list and add transaction detail view
All checks were successful
check / check (push) Successful in 13s
Transaction list entries are now two lines with more spacing:
- Line 1: humanized age (hover for ISO datetime) + direction (Sent/Received)
- Line 2: counterparty address + amount with symbol
- Clickable rows navigate to transaction detail view

Transaction detail view (placeholder) shows:
- Status, time, amount, from, to, transaction hash
- Back button returns to address detail

Also added "transaction" to VIEWS list in helpers.
2026-02-26 02:20:13 +07:00
a15fb1a761 Fix Blockscout tx fetch: remove unsupported limit parameter
All checks were successful
check / check (push) Successful in 4s
Blockscout v2 API rejects the `limit` query parameter on
/transactions and /token-transfers endpoints (returns 422).
Remove it and slice results client-side instead.
2026-02-26 02:15:26 +07:00
3bd2b58543 Token auto-discovery, tx history, balance polling, EIP-6963, UI overhaul
All checks were successful
check / check (push) Successful in 14s
Major changes:
- Fetch token balances and tx history from Blockscout API (configurable)
- Remove manual token discovery (discoverTokens) in favor of Blockscout
- HD address gap scanning on mnemonic import
- Duplicate mnemonic detection on wallet add
- EIP-6963 multi-wallet discovery + selectedAddress updates in inpage
- Two-tier balance refresh: 10s while popup open, 60s background
- Fix $0.00 flash before prices load (return null when no prices)
- No-layout-shift: min-height on total value element
- Aligned balance columns (42ch address width, consistent USD column)
- All errors use flash messages instead of off-screen error divs
- Settings gear in global title bar, add-wallet moved to settings pane
- Settings wells with light grey background, configurable Blockscout URL
- Consistent "< Back" buttons top-left on all views
- Address titles (Address 1.1, 1.2, etc.) on main and detail views
- Send view shows current balance of selected asset
- Clickable affordance policy added to README
- Shortened mnemonic backup warning
- Fix broken background script constant imports
2026-02-26 02:13:39 +07:00
2b2137716c Add transaction confirmation screen and password modal
All checks were successful
check / check (push) Successful in 13s
New send flow: Send → Confirm → Password → Broadcast.

Send view: collects To (with ENS resolution), Amount, Token.
"Review" button advances to confirmation. No password field.

Confirm Transaction view: shows From, To (with ENS name),
Amount (with USD value), and runs pre-send checks:
- Scam address warning (checked against local blocklist)
- Self-send warning
- Insufficient balance error (disables Send button)

Password modal: full-screen overlay, appears only after user
clicks Send on the confirmation screen. Decrypts the wallet
secret, signs and broadcasts the transaction. Wrong password
is caught inline.

scamlist.js: hardcoded set of known scam/fraud addresses
(Tornado Cash sanctioned, drainer contracts, address
poisoning). Checked locally, no external API.
2026-02-25 18:55:42 +07:00
023d8441bc Split popup into one file per view
All checks were successful
check / check (push) Successful in 4s
popup/index.js reduced to ~75 lines: loads state, builds a
shared context object, initializes all views, shows first screen.

Each view in popup/views/:
  helpers.js      — $(), showError, hideError, showView
  welcome.js      — welcome screen
  addWallet.js    — unified create/import recovery phrase
  importKey.js    — private key import
  home.js         — wallet list, total value, address derivation
  addressDetail.js — address view, token list, QR, copy
  send.js         — send form, ENS resolution, tx broadcast
  receive.js      — QR + copy
  addToken.js     — token lookup, common token picker
  settings.js     — RPC endpoint
  approval.js     — dApp approval (stub)

Views communicate via a ctx object with shared callbacks
(renderWalletList, showAddressDetail, doRefreshAndRender, etc).
2026-02-25 18:51:41 +07:00
f50a2a0389 Refactor popup into shared modules, wire up real ERC-20 tokens
All checks were successful
check / check (push) Successful in 13s
Split popup/index.js (784 lines) into focused modules:
- shared/state.js: state management, storage persistence
- shared/wallet.js: mnemonic gen, HD derivation, signing
- shared/prices.js: price cache (5min TTL), USD formatting,
  value aggregation (address → wallet → total)
- shared/balances.js: ETH + ERC-20 balance cache (60s TTL),
  ENS lookup, token contract metadata lookup
- shared/vault.js: unchanged (libsodium encryption)
- shared/tokens.js: unchanged (token list + CoinDesk client)
- popup/index.js: view switching and event wiring only

Token tracking is now app-wide: trackedTokens stored in state,
balances fetched for all tracked tokens across all addresses.
Add Token now calls the real contract to read name/symbol/decimals.
Total portfolio value shown in 2x type on Home screen.
2026-02-25 18:48:44 +07:00
2a8c051377 Add total portfolio value, cached prices and balances
All checks were successful
check / check (push) Successful in 16s
Total USD value displayed in 2x type above wallet list on Home.
Value aggregation: getAddressValueUsd (ETH + all tokens) →
getWalletValueUsd → getTotalValueUsd. Price API cached for 5
minutes, balance fetches cached for 60 seconds. Both caches
are app-wide — repeated calls to refreshPrices/refreshBalances
are no-ops within the TTL.
2026-02-25 18:44:29 +07:00
64bd541013 Global title bar on all screens, screen name in DEBUG banner
All checks were successful
check / check (push) Successful in 14s
Move "AutistMask by @sneak" to a global title bar that appears
on every screen. Per-view headings demoted to h2 sub-headings.
Settings button moved to bottom of main view alongside Add
wallet. In DEBUG mode, the red banner now shows the current
screen name in parentheses (e.g. "DEBUG / INSECURE (main)").
2026-02-25 18:38:33 +07:00
1c9d5a9f2d Implement EIP-1193 provider for dApp connectivity
All checks were successful
check / check (push) Successful in 13s
Three-part architecture:
- inpage.js: creates window.ethereum in page context with
  request(), on(), send(), sendAsync(), enable() methods.
  Sets isMetaMask=true for compatibility.
- content/index.js: bridge between page and extension via
  postMessage (page<->content) and runtime.sendMessage
  (content<->background).
- background/index.js: handles RPC routing. Proxies read-only
  methods (eth_call, eth_getBalance, etc.) to configured RPC.
  Handles eth_requestAccounts (auto-connect for now),
  wallet_switchEthereumChain (mainnet only), and returns
  informative errors for unimplemented signing methods.

Manifests updated with web_accessible_resources for inpage.js.
Build updated to bundle inpage.js as a separate output file.
2026-02-25 18:36:27 +07:00
98b5eef21b Update header to "AutistMask by @sneak" with link
All checks were successful
check / check (push) Successful in 5s
2026-02-25 18:33:01 +07:00
cbb92f2a69 Add common token picker on Add Token screen
All checks were successful
check / check (push) Successful in 14s
Shows the top 25 tokens by market cap as clickable buttons
below the contract address input. Clicking a token fills in
its contract address automatically.
2026-02-25 18:31:39 +07:00
f6a47a6cea Show $0.00 instead of < $0.01 for zero balances
All checks were successful
check / check (push) Successful in 13s
2026-02-25 18:30:19 +07:00
f2e22cadf2 Encrypt secrets with libsodium, password required to send
All checks were successful
check / check (push) Successful in 14s
vault.js: Argon2id key derivation + XSalsa20-Poly1305 encryption
via libsodium-wrappers-sumo. No raw crypto primitives.

Wallet creation now requires a password. The mnemonic or private
key is encrypted before storage — only the ciphertext blob
(salt, nonce, ciphertext) is persisted. The plaintext secret
is never stored.

Sending requires the password to decrypt the secret, derive
the signing key, and construct the transaction. Wrong password
is caught and reported.
2026-02-25 18:23:09 +07:00
bfecddf2f7 Implement ETH send and QR code receive
All checks were successful
check / check (push) Successful in 22s
Send: stores mnemonic/private key with wallet data, derives
signing key from mnemonic + address index via ethers HDNodeWallet,
constructs transaction with parseEther, broadcasts via
sendTransaction, waits for confirmation, shows block number
and tx hash. ENS resolution in To field preserved.

Receive: QR code rendered to canvas via qrcode library (1.5.4).
Shows scannable QR above the full address text.

README updated with qrcode dependency and TODO progress.
2026-02-25 18:17:23 +07:00
fc3f0e00c8 Rewrite TODO as 0.1.0 MVP checklist, add screen map
All checks were successful
check / check (push) Successful in 5s
Full screen map with iOS-style stack navigation: Welcome, Home,
AddWallet, ImportKey, AddressDetail, Send, Receive, AddToken,
Settings, Approval. Each screen documents its elements and
transitions. TODO reorganized into Done, Wallet Management,
Sending, Receiving, Display, Tokens, Testing, and Post-MVP.
External Services updated to include CoinDesk price API.
2026-02-25 18:04:28 +07:00
097f90d7f8 Add token list module with CoinDesk price client
All checks were successful
check / check (push) Successful in 12s
tokens.js: ~150 ERC-20 tokens ordered by market cap with
getTopTokenSymbols(n) and getTopTokenPrices(n) (errors if n>30).
Price fetching uses CoinDesk CADLI API. Popup now shows USD
values next to ETH balances in wallet list and address detail.
Prices and balances fetched in parallel on popup open.
2026-02-25 17:35:27 +07:00
933c13ad1a Add ENS support: reverse lookup and forward resolution
All checks were successful
check / check (push) Successful in 14s
Reverse ENS lookup on balance refresh — if an address has an
ENS name, it's shown in the wallet list and address detail view.
Send form accepts ENS names in the To field (resolves before
sending). Placeholder updated to indicate ENS support.
2026-02-25 17:09:44 +07:00
0b102f49c2 Fetch real ETH balances from RPC on popup open
All checks were successful
check / check (push) Successful in 13s
Uses ethers JsonRpcProvider to call eth_getBalance for every
address on popup open. Balances update in the background and
re-render the wallet list when done. Default RPC is
eth.llamarpc.com, configurable in settings.
2026-02-25 17:01:33 +07:00
1b806fb9e9 Store xpubs unencrypted, remove password from viewing flow
All checks were successful
check / check (push) Successful in 12s
Xpubs and derived addresses stored unencrypted in extension
storage for instant read-only access without a password.
Password will only be required for signing transactions
(not yet implemented). Real addresses now derived from
mnemonic via ethers HDNodeWallet at wallet creation time.
Removed lock screen, password fields, and Lock button.
BIP-39 mnemonic validation added. README updated with split
storage model documentation.
2026-02-25 16:13:22 +07:00
147ffbeb92 Document full identifiers policy in README
All checks were successful
check / check (push) Successful in 13s
Addresses, tx hashes, and contract addresses must always be
shown in full to prevent address poisoning attacks. Truncation
only acceptable when full identifier is one tap away.
2026-02-25 16:07:17 +07:00
d384d41c82 Show full addresses in wallet list
All checks were successful
check / check (push) Successful in 13s
Display complete addresses instead of truncated ones. Address
poisoning attacks use matching prefixes/suffixes to fool users
into copying fraud addresses. Showing the full address mitigates
this.
2026-02-25 16:06:33 +07:00
b166a96e87 Remove DEBUG lock-screen bypass, add DEBUG mode policy
All checks were successful
check / check (push) Successful in 11s
DEBUG mode must behave identically to normal mode except for
the red banner and hardcoded mnemonic. No other DEBUG branches
without explicit owner approval. Policy documented in README.
2026-02-25 16:06:03 +07:00
88f57263fb Persist wallet state to extension storage
All checks were successful
check / check (push) Successful in 12s
State (wallets, RPC URL, setup flag) is saved to
browser.storage.local / chrome.storage.local after every
mutation and loaded on popup open. In DEBUG mode, the lock
screen is skipped since encryption is not yet implemented.
2026-02-25 16:02:33 +07:00
079541e84b Add DEBUG mode with red banner and hardcoded mnemonic
All checks were successful
check / check (push) Successful in 12s
When DEBUG=true: a sticky red "DEBUG / INSECURE" banner appears
at the top of all views, and the die button returns a hardcoded
test mnemonic instead of generating a random one.
2026-02-25 15:59:50 +07:00
2a4e29b773 Remove fixed min-height, let popup auto-size to content
All checks were successful
check / check (push) Successful in 12s
Browser popups auto-size to fit content. A fixed min-height
forced the body taller than the browser allows, causing
scrollbars. Now each view is exactly as tall as it needs to be.
2026-02-25 15:57:07 +07:00