JVM SDK for ERC-8004 Trustless AI Agent Registries using web3j.
implementation 'agency.erc8004:erc8004:0.1.0'<dependency>
<groupId>agency.erc8004</groupId>
<artifactId>erc8004</artifactId>
<version>0.1.0</version>
</dependency>import agency.erc8004.*;
import java.util.List;
var client = new ERC8004Client("bsc-testnet");
var meta = AgentMetadata.of("My Agent", "Built with Java SDK",
List.of(
AgentService.of("A2A", "https://agent.example.com/a2a"),
AgentService.of("MCP", "https://agent.example.com/mcp")
));
String uri = client.buildAgentUri(meta);
System.out.println("URI: " + uri.substring(0, 80) + "...");
client.close();import agency.erc8004.*
val client = ERC8004Client("bsc-testnet")
val meta = AgentMetadata.of("My Agent", "Built with Kotlin",
listOf(AgentService.of("A2A", "https://agent.example.com/a2a")))
val uri = client.buildAgentUri(meta)
println("URI: ${uri.take(80)}...")
client.close()| Name | Chain ID | Key |
|---|---|---|
| BSC Testnet | 97 | bsc-testnet |
| BSC Mainnet | 56 | bsc |
| Ethereum | 1 | ethereum |
| Sepolia | 11155111 | sepolia |
ERC8004Client(chainName)— Create clientbuildAgentUri(metadata)— Encode as data URIparseAgentUri(uri)— Decode metadata URIisConnected()— Check RPC connectionweb3j()— Access underlying Web3j instance
Chains.getChain(name)— Get config by nameChains.getChainById(id)— Get config by IDChains.BSC_TESTNET/BSC_MAINNET/ETHEREUM/SEPOLIA
./gradlew testApache-2.0