Skip to content

vision-consensus/vision-java-sdk

develop
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
abi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

vision-java-sdk

The VISION JAVA client library.

How to use

Gradle Setting

Add repo setting:

repositories {
    maven {
        url  "https://maven.pkg.github.com/vision-consensus/vision-java-sdk"
    }
}

Then add abi client utils as dependency.

dependencies {
    ....

    implementation 'org.vision.visionjsdk:abi:0.5.0'
    implementation 'org.vision.visionjsdk:client:0.5.0'
    implementation 'org.vision.visionjsdk:utils:0.5.0'

    ....
}

Maven Settings

<dependency>
  <groupId>org.vision.visionjsdk</groupId>
  <artifactId>abi</artifactId>
  <version>0.5.0</version>
</dependency>
<dependency>
  <groupId>org.vision.visionjsdk</groupId>
  <artifactId>client</artifactId>
  <version>0.5.0</version>
</dependency>
<dependency>
  <groupId>org.vision.visionjsdk</groupId>
  <artifactId>utils</artifactId>
  <version>0.5.0</version>
</dependency>

Construct Smart Contract Function Demo

Refer demo project.

/*
import java.math.BigInteger;
import java.util.*;

import FunctionEncoder;
import org.vision.visionjsdk.abi.datatypes.*;
import Bytes10;
import Uint256;
import Uint32;
*/


// Function(name, input, output)
Function function =
        new Function(
                "sam",
                Arrays.asList(
                        new DynamicBytes("dave".getBytes()),
                        new Bool(true),
                        new Address("VBZsQtsKdzFU5fLyHWeduQLHAw6HvSDd7i"),
                        new DynamicArray<>(
                                new Uint(BigInteger.ONE),
                                new Uint(BigInteger.valueOf(2)),
                                new Uint(BigInteger.valueOf(3)))),
                Collections.emptyList());
String encodedHex = FunctionEncoder.encode(function);

demo code path: demo/src/main/java/demo

About

No description, website, or topics provided.

Resources

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE
Unknown
LICENSE.web3j

Stars

Watchers

Forks

Packages 3

 
 
 

Languages