Skip to content

diem/client-sdk-java

client-sdk-java

Java CI with Gradle Server API Reference Apache V2 License javadoc

client-sdk-java is the official diem Client SDK for the Java programming language.

Overview of SDK's Packages

SPEC = specification DIP-X = Diem Improvement Protocol

  • jsonrpc: diem JSON-RPC APIs client. SPEC
  • stdlib: generated code, move stdlib script utils for constructing transaction script playload.
  • types: generated code, diem on-chain data structure types. Mostly generated code with small extension code for attaching handy functions to generated types.
  • utils: utility functions, account address utils, currency code, hashing, hex encoding / decoding, transaction utils.
  • AccountIdentifier & IntentIdentifier: encoding & decoding diem Account Identifier and Intent URL. DIP-5
  • DiemClient: interface of JSON-RPC client.
  • DiemException: root exception of all checked exceptions defined in SDK.
  • PrivateKey: abstraction for hiding private key details, implement this interface for plugin your customized private key signing logic.
  • Signer: sign transaction logic.
  • Testnet: Testnet utility, minting coins, create Testnet client, chain id, Testnet JSON-RPC URL.
  • TransactionMetadata: utils for creating peer to peer transaction metadata. DIP-4
  • Constants: static data and JSON-RPC response enum type values.

Examples

You can find all of the example code under the src/test/java/com/diem/examples directory:

Download

Gradle

implementation 'com.diem:client-sdk-java:1.0.5'

Maven

<dependency>
  <groupId>com.diem</groupId>
  <artifactId>client-sdk-java</artifactId>
  <version>1.0.5</version>
</dependency>

Download Jars on Maven

Development

System Requirements

Build

gradle build

Jar file location: build/libs/client-sdk-java.jar

Test

gradle test

Upgrade to latest diem release

// checkout diem submodule
git submodule update diem


// reset diem submodule to diem release revision
cd diem
git fetch/checkout/pull origin <revision/branch>

// re-generate stdlib and lcs type classes
gradle gen

// generate jsonrpc types from protobuf definition
gradle generateProto

// confirm everything works
gradle test

License

Apache License V2

Contributing

CONTRIBUTING