This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
mvn package# Run unit tests only
make unit
# or: mvn test -Dcucumber.filter.tags="@unit"
# Run integration tests only
make integration
# or: mvn test -Dtest=com.algorand.algosdk.integration.RunCucumberIntegrationTest -Dcucumber.filter.tags="@integration"
# Run all tests (unit + integration)
make ci-test
# Run tests with Docker test harness
make docker-test
# Start/stop test harness manually
make harness
make harness-downThe examples/ directory contains example code:
cd examples/
mvn package
java -cp target/sdk-extras-1.0-SNAPSHOT.jar com.algorand.examples.ExampleThis is the official Java SDK for Algorand blockchain, providing client libraries for interacting with algod and indexer nodes.
account/- Account management, keypair generation, and logic signature accountscrypto/- Core cryptographic primitives (Ed25519, addresses, signatures, multisig)transaction/- Transaction types, builders, and atomic transaction composerv2/client/- REST clients for algod and indexer APIs (auto-generated from OpenAPI specs)builder/transaction/- Fluent transaction builders for all transaction typesabi/- Application Binary Interface support for smart contractsmnemonic/- BIP39 mnemonic phrase utilitiesutil/- Encoding/decoding utilities (MessagePack, Base64, etc.)
- Transaction Builder Pattern: All transaction types use fluent builders (e.g.,
PaymentTransactionBuilder,ApplicationCallTransactionBuilder) - Atomic Transaction Composer: High-level interface for building transaction groups with ABI method calls
- Transaction Types: Payment, asset transfer, application calls, key registration, state proof, heartbeat
- AlgodClient: REST client for algod daemon (node operations, transaction submission)
- IndexerClient: REST client for indexer service (historical queries, account lookups)
- Generated Code: Most v2 client classes are auto-generated from OpenAPI specifications
- Ed25519: Primary signature algorithm using BouncyCastle
- Multisig: M-of-N threshold signatures
- Logic Signatures: Delegated signing using TEAL programs
- Address: 32-byte public key hash with checksum
The v2 client code (v2.client.algod.*, v2.client.indexer.*, v2.client.model.*) is generated from OpenAPI specs:
- algod.oas2.json - algod daemon API
- indexer.oas2.json - indexer service API
To regenerate clients, use the generate_java.sh script from the generator repository.
Uses Cucumber BDD testing with separate unit and integration test suites:
- Unit tests: Fast tests using mocked clients (
@unittags) - Integration tests: Full integration with test harness (
@integrationtags) - Test harness: Dockerized Algorand network for integration testing
Test files are organized under:
src/test/java/com/algorand/algosdk/unit/- Unit test step definitionssrc/test/java/com/algorand/algosdk/integration/- Integration test step definitionssrc/test/resources/- Test data and response fixturestest-harness/features/- Cucumber feature files
- Java 8+ Compatibility: Maintains Java 8 compatibility with Android support (minSdkVersion 26+)
- Dependencies: Uses Jackson for JSON, MessagePack for serialization, BouncyCastle for crypto
- Maven Profiles: Includes IDE profile for IntelliJ compatibility with mixed Java versions
- Generated Content: Do not manually edit generated client code - regenerate from specs instead