Arbitrum One
Prêt à utiliser cela en production ?
Le niveau gratuit couvre les projets personnels. Le paiement à l'usage évolue sans carte bancaire.
Arbitrum One
Le niveau gratuit couvre les projets personnels. Le paiement à l'usage évolue sans carte bancaire.
For JavaScript and TypeScript work on Arbitrum One you have two mature library choices: web3.js and ethers.js. Both are actively maintained and both speak the standard Ethereum JSON-RPC that Arbitrum One's Nitro nodes expose, so either connects to https://arbitrum.therpc.io/YOUR_API_KEY without chain-specific glue. For new projects we recommend ethers.js v6 — it has stronger first-class TypeScript support and a smaller bundle, which matters for browser dApps interacting with Arbitrum DeFi like GMX or Uniswap.
Both web3.js and ethers.js are actively maintained and production-ready against Arbitrum One. For greenfield projects, ethers.js v6 is the recommended starting point thanks to its better TypeScript support and smaller bundle size.
web3.js is the original and still widely used JavaScript API for Ethereum-compatible chains, with a large body of examples and community support that applies directly to Arbitrum One. Install it with npm install web3, then instantiate the client by passing the Arbitrum One endpoint to the constructor: new Web3('https://arbitrum.therpc.io/YOUR_API_KEY').
ethers.js is a modern, compact library with first-class TypeScript support, which makes it a natural fit for typed Arbitrum One dApps. Install it with npm install ethers, then create a provider by passing the endpoint to new ethers.JsonRpcProvider('https://arbitrum.therpc.io/YOUR_API_KEY'). From there getBalance, parseEther, and sendTransaction behave exactly as on L1, since Arbitrum One is EVM-equivalent.
Both web3.js and ethers.js ship their own type definitions, so you get full TypeScript coverage for Arbitrum One without installing any @types/* packages. The payoff is IDE autocompletion on every provider and contract method, compile-time checking that catches a wrong argument before it costs you a reverted transaction, and types that double as inline documentation as you build.
Both libraries run in Node.js, whether your project uses CommonJS require() or ESM import — useful for server-side Arbitrum One workloads like indexers, webhook handlers, or scheduled balance checks. The connection string stays the same on the server as in the browser.
In the browser, import either library as an ES module and let a bundler like webpack or Vite tree-shake it into your build. When you need the user's own wallet — MetaMask or any injected provider — wrap it with new ethers.BrowserProvider(window.ethereum) instead of a JSON-RPC provider; the wallet then signs Arbitrum One transactions and prompts the user, while you still read chain state through your endpoint. Make sure the wallet is pointed at chain ID 42161 so it signs for Arbitrum One.