= PolkaJ - Polkadot Java Client :lib-version: 0.3.0 :lib-version-dev: 0.5.0-SNAPSHOT
image:https://github.com/emeraldpay/polkaj/workflows/Tests/badge.svg["Unit Tests"] image:https://codecov.io/gh/emeraldpay/polkaj/branch/master/graph/badge.svg["Coverage",link="https://codecov.io/gh/emeraldpay/polkaj"] image:https://img.shields.io/github/license/emeraldpay/polkaj.svg?style=flat-square&maxAge=2592000["License",link="https://github.com/emeraldpay/polkaj/blob/master/LICENSE"] image:https://badges.gitter.im/emeraldpay/community.svg["Gitter",link="https://gitter.im/emeraldpay/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge"]
Java client library to use and access API of Polkadot based networks.
WARNING: UNDER DEVELOPMENT
== Modules
io.emeraldpay.polkaj:polkaj-scale:{lib-version}
- SCALE codec implementationio.emeraldpay.polkaj:polkaj-scale-types:{lib-version}
- SCALE mapping for standard Polkadot typesio.emeraldpay.polkaj:polkaj-schnorrkel:{lib-version}
- Schnorrkel for Javaio.emeraldpay.polkaj:polkaj-ss58:{lib-version}
- SS58 codec to encode/decode addresses and pubkeysio.emeraldpay.polkaj:polkaj-common-types:{lib-version}
- common types (Address, DotAmount, Hash256, etc)io.emeraldpay.polkaj:polkaj-json-types:{lib-version}
- JSON RPC mapping to Java classesio.emeraldpay.polkaj:polkaj-api-base:{lib-version}
- RPC base classesio.emeraldpay.polkaj:polkaj-api-http:{lib-version}
- JSON RPC HTTP clientio.emeraldpay.polkaj:polkaj-api-ws:{lib-version}
- JSON RPC WebSocket clientio.emeraldpay.polkaj:polkaj-tx:{lib-version}
- Storage access and Extrinsics== Usage
To use development SNAPSHOT versions you need to install the library into the local Maven repository.
repositories { // polkaj public repo maven { url "https://dl.bintray.com/emerald/polkaj" } // required for com.github.multiformats:java-multibase library maven { url 'https://jitpack.io' } }
== Documentation
See link:docs/[Documentation] in ./docs
directory, and a demonstration in ./examples
.
== Example
PolkadotHttpApi client = PolkadotApi.newBuilder()
.rpcCallAdapter(JavaHttpAdapter.newBuilder().build())
.build();
Future
Hash256 hash = hashFuture.get(); System.out.println("Current head: " + hash);
Future
BlockResponseJson block = blockFuture.get(); System.out.println("Current height: " + block.getBlock().getHeader().getNumber()); System.out.println("State hash: " + block.getBlock().getHeader().getStateRoot());
== License
The core project code is released under Apache 2.0 license.
Examples and docs are published under CC0 license + additionally Apache 2.0 for code parts in the examples.