MCPcopy Index your code
hub / github.com/LFDT-web3j/web3j

github.com/LFDT-web3j/web3j @v6.0.0 sqlite

repository ↗ · DeepWiki ↗ · release v6.0.0 ↗
6,240 symbols 20,308 edges 737 files 905 documented · 15%
README

Web3j: Web3 Java Ethereum Dapp API

Documentation Status build status codecov Discord Gurubase

Web3j is a lightweight, highly modular, reactive, type safe Java and Android library for working with Smart Contracts and integrating with clients (nodes) on the Ethereum network:

image

This allows you to work with the Ethereum blockchain, without the additional overhead of having to write your own integration code for the platform.

The Java and the Blockchain talk provides an overview of blockchain, Ethereum and Web3j.

NEW! Get involved!

Since Web3J moved under Hyperledger we started to do Web3J Contributors calls every 2 weeks! Subscribe to our community page and to see check our call schedule. Your contribution matters! - Community Link - Check our last updates! - Calendar Invite - Add the contributor call to your calendar!

Features

It has five runtime dependencies:

It also uses JavaPoet for generating smart contract wrappers.

QuickStart

The simplest way to start your journey with Web3j is to create a project. We provide this functionality using the Web3j CLI. This latter can be installed as follows:

For Unix:

```shell script curl -L get.web3j.io | sh && source ~/.web3j/source.sh


For Windows, in Powershell:

```shell script
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/hyperledger/web3j-installer/main/installer.ps1'))

Create a new project by running:

```shell script $ web3j new


Or use our [Maven](https://github.com/web3j/web3j-maven-plugin) or 
[Gradle](https://github.com/web3j/web3j-gradle-plugin) plugins to 
generate java files from Solidity contracts.


#### Please head to the [Web3j Documentation](https://docs.web3j.io) for further instructions on using Web3j.

Maven
-----

Java:

```xml
<dependency>
  <groupId>org.web3j</groupId>
  <artifactId>core</artifactId>
  <version>6.0.0</version>
</dependency>

Note: The Web3j Java binaries are compiled using Java 21. Java 21 or a more recent version is required to use Web3j as a dependency.

Android:

<dependency>
  <groupId>org.web3j</groupId>
  <artifactId>core</artifactId>
  <version>4.12.3-android</version>
</dependency>

Gradle

Java:

implementation ('org.web3j:core:6.0.0')

Android:

implementation ('org.web3j:core:4.12.3-android')

Build instructions

Web3j includes integration tests for running against a live Ethereum client. If you do not have a client running, you can exclude their execution as per the below instructions.

To run a full build (excluding integration tests):

$ ./gradlew check

To run the integration tests, you will need to set up these variables in order to pull the Docker images from the Docker Hub registry:

  • registry.username
  • registry.password

Then run the following command:

$ ./gradlew -Pintegration-tests=true :integration-tests:test

If you do not want the integration test to run:

$ ./gradlew -Pintegration-tests=false :test

Check the Docker client API for more information on configuration options.

Projects using Web3j

<img alt="Alphawallet logo" src="https://github.com/LFDT-web3j/web3j/raw/v6.0.0/static-imgs/alphawallet-light.svg" width="auto" height="50">

<img alt="Linea logo" src="https://github.com/LFDT-web3j/web3j/raw/v6.0.0/static-imgs/linea-light.svg" width="auto" height="50">

<img alt="ConsenSys logo" src="https://github.com/LFDT-web3j/web3j/raw/v6.0.0/static-imgs/consensys-light.svg" width="auto" height="50">

<img alt="ENS logo" src="https://github.com/LFDT-web3j/web3j/raw/v6.0.0/static-imgs/ens-light.svg" width="auto" height="50">

<img alt="Hyperledger Besu logo" src="https://github.com/LFDT-web3j/web3j/raw/v6.0.0/static-imgs/hyperledger-besu-light.svg" width="auto" height="50">

<img alt="Web3Auth logo" src="https://github.com/LFDT-web3j/web3j/raw/v6.0.0/static-imgs/web3auth_light.svg" width="auto" height="50">

<img alt="Hedera logo" src="https://github.com/LFDT-web3j/web3j/raw/v6.0.0/static-imgs/hedera-light.svg" width="auto" height="50">

<img alt="Celo logo" src="https://github.com/LFDT-web3j/web3j/raw/v6.0.0/static-imgs/celo-light.svg" width="auto" height="50">

<img alt="WalletConnect logo" src="https://github.com/LFDT-web3j/web3j/raw/v6.0.0/static-imgs/walletconnect-light.svg" width="auto" height="50">

<img alt="Argent logo" src="https://github.com/LFDT-web3j/web3j/raw/v6.0.0/static-imgs/argent-light.svg" width="auto" height="50">

<img alt="Unstoppable Domains logo" src="https://github.com/LFDT-web3j/web3j/raw/v6.0.0/static-imgs/unstoppable_domains-light.svg" width="auto" height="50">

<img alt="Fnality logo" src="https://github.com/LFDT-web3j/web3j/raw/v6.0.0/static-imgs/fnality-light.svg" width="auto" height="50">

<img alt="zksync logo" src="https://github.com/LFDT-web3j/web3j/raw/v6.0.0/static-imgs/zksync-light.svg" width="auto" height="50">

Commercial support and training

Commercial support and training is available from web3labs.com.

License

Apache 2.0

Extension points exported contracts — how you extend this code

TxSignService (Interface)
Service to sign transaction. [6 implementers]
core/src/main/java/org/web3j/service/TxSignService.java
Tuple (Interface)
Tuple abstraction. [44 implementers]
tuples/src/main/java/org/web3j/tuples/Tuple.java
ITransaction (Interface)
(no doc) [6 implementers]
crypto/src/main/java/org/web3j/crypto/transaction/type/ITransaction.java
State (Interface)
(no doc) [6 implementers]
parity/src/main/java/org/web3j/protocol/parity/methods/response/StateDiff.java
Type (Interface)
ABI Types. [3 implementers]
abi/src/main/java/org/web3j/abi/datatypes/Type.java
IntegrationTestConfig (Interface)
Common values used by integration tests. [2 implementers]
integration-tests/src/test/java/org/web3j/protocol/core/IntegrationTestConfig.java
RlpType (Interface)
Base RLP type. [2 implementers]
rlp/src/main/java/org/web3j/rlp/RlpType.java
IPrivateTransaction (Interface)
(no doc) [4 implementers]
eea/src/main/java/org/web3j/protocol/eea/crypto/transaction/type/IPrivateTransaction.java

Core symbols most depended-on inside this repo

get
called by 1053
core/src/main/java/org/web3j/protocol/core/methods/response/EthLog.java
valueOf
called by 627
core/src/main/java/org/web3j/protocol/core/DefaultBlockParameter.java
send
called by 433
core/src/main/java/org/web3j/protocol/Web3jService.java
add
called by 373
core/src/main/java/org/web3j/protocol/core/BatchRequest.java
getValue
called by 221
core/src/main/java/org/web3j/protocol/core/methods/request/Filter.java
encodePacked
called by 207
abi/src/main/java/org/web3j/abi/TypeEncoder.java
encodeNumeric
called by 167
abi/src/main/java/org/web3j/abi/TypeEncoder.java
getValues
called by 158
rlp/src/main/java/org/web3j/rlp/RlpList.java

Shape

Method 5,350
Class 836
Interface 44
Enum 10

Languages

Java100%

Modules by API surface

core/src/main/java/org/web3j/protocol/core/JsonRpc2_0Web3j.java103 symbols
core/src/main/java/org/web3j/protocol/core/methods/response/EthBlock.java101 symbols
parity/src/main/java/org/web3j/protocol/parity/methods/response/Trace.java100 symbols
core/src/test/java/org/web3j/protocol/core/RequestTest.java87 symbols
core/src/test/java/org/web3j/protocol/core/ResponseTest.java85 symbols
core/src/main/java/org/web3j/protocol/core/Ethereum.java84 symbols
codegen/src/main/java/org/web3j/codegen/SolidityFunctionWrapper.java81 symbols
core/src/main/java/org/web3j/ens/contracts/generated/PublicResolver.java67 symbols
core/src/main/java/org/web3j/protocol/core/methods/response/Transaction.java66 symbols
core/src/main/java/org/web3j/crypto/WalletFile.java66 symbols
parity/src/main/java/org/web3j/protocol/parity/methods/response/VMTrace.java53 symbols
core/src/test/java/org/web3j/tx/ContractTest.java52 symbols

For agents

$ claude mcp add web3j \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact