dsplend-java

DSplend Java SDK

License

License

Categories

Categories

Java Languages
GroupId

GroupId

com.github.splend-io
ArtifactId

ArtifactId

dsplend-java
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

dsplend-java
DSplend Java SDK
Project URL

Project URL

https://github.com/splend-io/dsplend-java
Source Code Management

Source Code Management

https://github.com/splend-io/dsplend-java

Download dsplend-java

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.splend-io/dsplend-java/ -->
<dependency>
    <groupId>com.github.splend-io</groupId>
    <artifactId>dsplend-java</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.splend-io/dsplend-java/
implementation 'com.github.splend-io:dsplend-java:1.0.1'
// https://jarcasting.com/artifacts/com.github.splend-io/dsplend-java/
implementation ("com.github.splend-io:dsplend-java:1.0.1")
'com.github.splend-io:dsplend-java:jar:1.0.1'
<dependency org="com.github.splend-io" name="dsplend-java" rev="1.0.1">
  <artifact name="dsplend-java" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.splend-io', module='dsplend-java', version='1.0.1')
)
libraryDependencies += "com.github.splend-io" % "dsplend-java" % "1.0.1"
[com.github.splend-io/dsplend-java "1.0.1"]

Dependencies

compile (11)

Group / Artifact Type Version
log4j : log4j jar 1.2.17
com.google.guava : guava jar 24.1-jre
com.madgag.spongycastle : core jar 1.58.0.0
org.bouncycastle : bcprov-jdk15on jar 1.59
org.web3j : crypto jar 4.1.1
org.slf4j : slf4j-api jar 1.7.25
org.apache.httpcomponents : httpclient jar 4.5.5
com.fasterxml.jackson.core : jackson-core jar 2.9.5
com.fasterxml.jackson.core : jackson-annotations jar 2.9.5
com.fasterxml.jackson.core : jackson-databind jar 2.9.5
org.json : json jar 20180130

Project Modules

There are no modules declared in this project.

DSplend Java SDK

Prerequisites

  • Java 1.8 or higher
  • Maven 3.5.0 or higher

Setup and Run

  • git clone https://github.com/splend-io/dsplend-java.git
  • cd dsplend-java
    if macOS:
  • brew install automake
  • brew install libtool
    if Unix:
  • apt-get install autoreconf
  • apt-get install libtool
    then:
  • sh build.sh
  • Remember to set -Djava.library.path="...secp256k1/.libs" in your VM Arguments

Sample

        System.out.println("DSplend SDK Example");
        try {
            Sdk sdk = new Sdk("127.0.0.1");
            List<Node> nodes = sdk.getDelegates();
            Account fromAccount = sdk.createAccount();
            Account toAccount = sdk.createAccount();
            Receipt receipt = sdk.transferTokens(nodes.get(0), fromAccount, toAccount, 45);
            System.out.println(receipt.getStatus());

            // Pending?
            while ((receipt = sdk.getLastStatus()).getStatus().equals(Receipt.Status.PENDING)) {
                Thread.sleep(100);
            }
            System.out.println(receipt.getStatus());

            // Get transactions.
            List<Transaction> transactions = sdk.getTransactions(nodes.get(0));
            System.out.println(transactions);
        } catch (Throwable t) {
            System.out.println(t);
        }

Versions

Version
1.0.1
1.0.0