Skip to content

MicroCoinHU/MicroCoin-Java-Client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MicroCoin Java Client

GitHub license CodeFactor

Requirements

Building the API client library requires Maven to be installed.

Installation

To install the API client library to your local Maven repository, simply execute:

mvn install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn deploy

Refer to the official documentation for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
    <groupId>hu.microcoin</groupId>
    <artifactId>hu.microcoin.client</artifactId>
    <version>1.0.0</version>
    <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

compile "hu.microcoin:hu.microcoin.client:1.0.0"

Others

At first generate the JAR by executing:

mvn package`

Then manually install the following JARs:

  • target/hu.microcoin.client-1.0.0.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

import Api.AccountApi;

public class AccountApiExample {

    public static void main(String[] args) {
        AccountApi apiInstance = new AccountApi();
        ChangeKeyRequest changeKey = new ChangeKeyRequest(); // ChangeKeyRequest | The signed transaction
        try {
            ChangeKey result = apiInstance.commitChangeKey(changeKey);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountApi#commitChangeKey");
            e.printStackTrace();
        }
    }
}

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.