Skip to content

feat: add Base network (8453) + refactor network visual system#79

Open
ignromanov wants to merge 27 commits intodevelopfrom
036-base-network
Open

feat: add Base network (8453) + refactor network visual system#79
ignromanov wants to merge 27 commits intodevelopfrom
036-base-network

Conversation

@ignromanov
Copy link
Copy Markdown
Owner

@ignromanov ignromanov commented Apr 3, 2026

Summary

  • Add Base (8453) and Base Sepolia (84532) as 5th supported network — Coinbase's OP Stack L2
  • Refactor network visual system — canonical palette, shared testnet utilities, zero duplication

What Changed

Base Network Support

  • Chain config, token registry (ETH/USDC/USDT), provider slugs, confirmation config, block estimates
  • UI theming: badges, glows, shadows, explorer links, brand colors (Coinbase Blue #0052FF)
  • NetworkIcon via @web3icons/react NetworkBase component

Network Visual System Refactor

  • network-palette.ts (NEW) — single source of truth for all network hex colors
  • testnet-utils.ts (NEW) — TESTNET_PARENT, withTestnets(), resolveMainnetId() — testnet configs derived automatically
  • network-themes.ts simplified — 10 manual entries → 5 mainnet + withTestnets() derivation (-82 lines)
  • Name collision resolvedgetNetworkThemeName (theme key) vs getNetworkName (display name)
  • Dead env vars removed — 10 unused NEXT_PUBLIC_ALCHEMY/INFURA_*_URL from env schema + .env.example
  • NetworkIcon — testnet chain IDs now resolve to mainnet icons + accessible aria-label
  • PageLayoutaccentColors hoisted to module scope (no re-creation per render)
  • Badge differentiation — Arbitrum sky-* vs Base blue-* (visually distinct)
  • Token addresses — Base USDC/USDT/Sepolia USDC normalized to lowercase

Adding a New Network (post-refactor)

  1. Add hex colors to NETWORK_PALETTE (network-palette.ts)
  2. Add chain to chains.ts + testnet mapping in testnet-utils.ts
  3. Everything else (badges, shadows, glows, themes) derives via withTestnets()

Details

  • Tokens: ETH + USDC + USDT (mainnet), ETH + USDC (testnet)
  • Confirmation: 1 block, 30min timeout (OP Stack, same as Optimism)
  • Codec: Already supported — chain-dict.ts has 8453 → 0x05

Test plan

  • pnpm type-check:build — 0 errors
  • pnpm lint — no issues
  • pnpm test — 188 files, 2623 tests passed, 0 failed
  • Create Base invoice → verify URL encodes correctly
  • Open /pay link → verify Base branding and glow
  • Connect wallet on Base → verify network switching
  • Test on Base Sepolia with test USDC

Closes #31

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
voidpay Ready Ready Preview, Comment Apr 6, 2026 10:18pm

Visual config Records (NETWORK_SHADOWS, NETWORK_GLOWS, NETWORK_GLOW_SHADOWS,
NETWORK_GLOW_BORDERS, NETWORK_BADGES) were keyed by mainnet chain IDs only,
causing missing glow on testnet invoices (e.g. Base Sepolia 84532).

Added withTestnets() helper that auto-derives testnet entries from
TESTNET_PARENT, so new networks only need one mapping update.
… NetworkIcon a11y

- NetworkTheme now aliases NetworkThemeName from network-palette (canonical source)
- isValidNetworkTheme validates against NETWORK_PALETTE instead of NETWORK_THEMES
- Remove 10 dead NEXT_PUBLIC_ALCHEMY/INFURA_*_URL env vars (RPC proxy uses API keys + slug maps)
- NetworkIcon resolves testnet chain IDs to mainnet for icon/color/letter lookup
- Add aria-label to both branded and fallback NetworkIcon paths
- Export NETWORK_PALETTE and NetworkThemeName from shared/ui public API
… tokens

Add 5th demo invoice for Base network (USDC, pending status) to landing
page carousel. Fix react-hook-form reset() not clearing tokenAddress when
loading native token templates (ETH/POL) — undefined must be mapped to ''
so RHF treats it as an explicit value rather than "keep current".
@ignromanov ignromanov changed the title feat: add Base network (8453) and Base Sepolia (84532) support feat: add Base network (8453) + refactor network visual system Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[codec] Add Base network support (chain 8453)

1 participant