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.
Web3j is the primary JVM library for working with Arbitrum One, supporting Java 8+ and Kotlin coroutines out of the box. Because Arbitrum One exposes the standard Ethereum JSON-RPC interface, Web3j connects to https://arbitrum.therpc.io/YOUR_API_KEY with no special configuration. For Android projects, use the web3j-android artifact, which strips desktop-only dependencies that would otherwise bloat your APK and trip up the dex compiler. Add the core library through Gradle with implementation "org.web3j:core:4.x.x".
Web3j supports Java 8+ and integrates cleanly with Kotlin coroutines, so an Arbitrum One backend service and an Android client can share the same domain logic. For mobile builds, depend on the web3j-android artifact to exclude desktop-only dependencies and keep the app slim.
Create the client with Web3j.build(new HttpService("https://arbitrum.therpc.io/YOUR_API_KEY")) and hold a single instance for the life of your application. The same builder call works identically from Java and Kotlin; the snippets below show balance reads and signed transfers in both languages against Arbitrum One.
On Android, never run RPC calls on the main thread — launch them with viewModelScope.launch and switch to Dispatchers.IO so the UI stays responsive while a request to Arbitrum One is in flight. The client setup is identical to the desktop case: Web3j.build(HttpService("https://arbitrum.therpc.io/YOUR_API_KEY")). Pairing coroutines with the sequencer's sub-second confirmations lets a wallet screen refresh balances almost as fast as the user taps.
Use the web3j CLI to generate Java or Kotlin wrapper classes from a Solidity ABI — the recommended way to integrate an Arbitrum One contract such as a Camelot router or an Aave pool. The generated wrapper exposes each contract method as a type-safe call, so the compiler catches argument and return-type mistakes before they ever reach the network. Grab verified ABIs from https://arbiscan.io to feed the generator.