How offchainlabs/arbitrum-token-bridge works
Project type and purpose
• This is a monorepo for the Arbitrum Token Bridge, a full-stack web application built with Next.js (React) that provides a UI for bridging tokens between Ethereum L1, Arbitrum L2, and Orbit chains.
• It also contains auxiliary CLI scripts (under packages/scripts) to manage chain configurations and a token-bridge SDK (under arb-token-bridge-ui/src/token-bridge-sdk) to orchestrate on-chain transactions.
File structure
• Top-level:
• Monorepo root with CI/CD config (.github/workflows, vercel.json), lint/format configs, workspace definitions (package.json, tsconfig.base.json).
• packages/arb-token-bridge-ui: the Next.js app (UI + serverless API)
• packages/scripts: standalone Node.js CLI tools
• Under arb-token-bridge-ui:
• src/pages – React pages (including pages/api/** for Next.js serverless endpoints)
• src/components, src/hooks, src/util, src/token-bridge-sdk – feature modules (UI, business logic, SDK)
• public – static assets
• tests/e2e – Cypress/Synpress end-to-end tests
• scripts – build-time data-generation scripts
• Presence of Next.js API routes indicates a serverless backend layer co-located with the UI.
README for additional insights
• Confirms a dev workflow: run Node/NVM, yarn workspaces, set env vars (INFURA key, WalletConnect project), then yarn dev to launch Next.js.
• E2E tests connect to a local Nitro test node.
Detail
• Next.js API route is represented (or group them under “API Routes”)
• That Token-Bridge-SDK is invoked by UI and API layers for transaction building
• Environment variables/config (INFURA_KEY, WC_PROJECT_ID) feeding into RPC and WalletConnect