All Projects → iotaledger → Iota Java

iotaledger / Iota Java

Licence: apache-2.0
IOTA Java API Library. Find documentation on

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Iota Java

Iota.go
IOTA Go API Library. Find documentation on https://docs.iota.org/
Stars: ✭ 319 (+132.85%)
Mutual labels:  api, cryptocurrency, iota, internet-of-things
Iota.lib.cpp
IOTA C++ Library
Stars: ✭ 84 (-38.69%)
Mutual labels:  api, cryptocurrency, iota, internet-of-things
Iota.py
PyOTA: The IOTA Python API Library
Stars: ✭ 337 (+145.99%)
Mutual labels:  api, cryptocurrency, iota, internet-of-things
Cryptocurrency Cli
💰 Cryptocurrency Portfolio On The Command Line 💰
Stars: ✭ 99 (-27.74%)
Mutual labels:  api, cryptocurrency, iota
Currencyviewer
Short python framework that dynamically displays and converts the cryptocurrencies in your Kraken wallet into equivalents fiat money.
Stars: ✭ 13 (-90.51%)
Mutual labels:  api, cryptocurrency
Cryptocompare Api
Jupyter Notebook with examples of useful CryptoCompare API calls
Stars: ✭ 25 (-81.75%)
Mutual labels:  api, cryptocurrency
Iota Transaction Spammer Webapp
Stars: ✭ 40 (-70.8%)
Mutual labels:  cryptocurrency, iota
Iotamobile
A simple mobile wallet for IOTA built with React Native
Stars: ✭ 51 (-62.77%)
Mutual labels:  cryptocurrency, iota
Huobi golang
Go SDK for Huobi Spot API
Stars: ✭ 76 (-44.53%)
Mutual labels:  api, cryptocurrency
Waves Api
Waves API library for Node.js and browser
Stars: ✭ 78 (-43.07%)
Mutual labels:  api, cryptocurrency
Python Binance Chain
Binance Chain Exchange API python implementation for automated trading
Stars: ✭ 96 (-29.93%)
Mutual labels:  api, cryptocurrency
Binance.api.csharp.client
C#.NET client for Binance Exchange API.
Stars: ✭ 98 (-28.47%)
Mutual labels:  api, cryptocurrency
Iota.js
IOTA JavaScript monorepo
Stars: ✭ 921 (+572.26%)
Mutual labels:  iota, internet-of-things
Pytradfri
IKEA Trådfri/Tradfri API. Control and observe your lights from Python. Examples available. On pypi. Sans-io.
Stars: ✭ 778 (+467.88%)
Mutual labels:  api, internet-of-things
Bittrex Signalr Client
Node.js implementation of SignalR protocol tailored for Bittrex exchange
Stars: ✭ 37 (-72.99%)
Mutual labels:  api, cryptocurrency
Python Poloniex
Poloniex API wrapper for Python 2.7 & 3
Stars: ✭ 557 (+306.57%)
Mutual labels:  api, cryptocurrency
Exchangesharp
ExchangeSharp is a powerful, fast and easy to use .NET/C# API for interfacing with many crypto currency exchanges. REST and web sockets are supported.
Stars: ✭ 489 (+256.93%)
Mutual labels:  api, cryptocurrency
Bittrex.net
A C# .Net wrapper for the Bittrex web API including all features easily accessible and usable
Stars: ✭ 131 (-4.38%)
Mutual labels:  api, cryptocurrency
Crypto Exchanges Gateway
Your gateway to the world of crypto !
Stars: ✭ 343 (+150.36%)
Mutual labels:  api, cryptocurrency
Huobi python
Python SDK for Huobi Spot API
Stars: ✭ 391 (+185.4%)
Mutual labels:  api, cryptocurrency


The official Java client library for interacting with the Tangle

Developer documentation portal

Auto-generated docs Discord StackExchange Apache 2.0 license Supported IRI API endpoints Code quality Latest release Build status

AboutPrerequisitesInstallationGetting startedAPI referenceExamplesChange logsSupporting the projectJoining the discussion


About

This is the official Java client library, which allows you to do the following:

  • Create transactions
  • Read transactions
  • Sign transactions
  • Generate addresses

This is beta software, so there may be performance and stability issues. Please report any issues in our issue tracker.

Prerequisites

To use the IOTA Java client library, your computer must have the following minimum requirement:

  • Java 6 (or higher)

Installation

The IOTA Java client library is available on [jitpack.io][jitpack].

To install the IOTA Java client library and its dependencies, you can use one of the following options:

  • Download the library with Gradle
  • Download the library with Maven
  • Download the library manually

Gradle

  1. Add the following repository to your root build.gradle file (not your module build.gradle file):

    allprojects {
        repositories {
            maven { url 'https://jitpack.io' }
        }
    }
    
  2. Add the following dependency to your module build.gradle file:

    dependencies {
        compile 'com.github.iotaledger:iota-java:1.0.0-beta8'
    }
    

Maven

Through Maven central

  1. Add the following repository to your root pom.xml file:
    <dependency>
        <groupId>org.iota</groupId>
        <artifactId>jota</artifactId>
        <classifier>jar-with-dependencies</classifier>
        <version>1.0.0-beta9</version>
    </dependency>
    

Through Jitpack

  1. Add the following repository to your root pom.xml file:

    <repositories>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>
    
  2. Add the following dependency to your module pom.xml file:

    <dependency>
        <groupId>com.github.iotaledger.iota-java</groupId>
        <artifactId>jota</artifactId>
        <classifier>jar-with-dependencies</classifier>
        <version>[VERSION_INFORMATION]</version>
    </dependency>
    
  3. Change the value of the <version> tag to either a release number or the first 10 characters of a Git commit hash: <version>b703ef3c05f05</version> or <version>1.0.0-beta9</version>

Note: Find the latest version on the Jitpack page.

Manual installation

  1. Clone or download the GitHub repository.

    Inside the project, you'll have the following directories:

    • jota
    • jota-parent
  2. Import and reference the jota directory in your project For example in Eclipse: right mouse on your project -> Properties -> Java Build Path -> Projects -> Add 'jota'

  3. In the jota directory, run the following command:

    mvn clean install

You'll have a .jar file called jota-[VERSION]-jar-with-dependencies.jar, depending on your version of the library.

Getting Started

After you've installed the library, you can connect to an IRI node to send transactions to it and interact with the Tangle. An extended guide can be found on our documentation portal, we strongly recommend you to go here for starting off. A quick start tutorial is shown below.

To connect to a local IRI node on port 14265, do the following:

IotaAPI api = new IotaAPI.Builder().build();
GetNodeInfoResponse response = api.getNodeInfo();

To connect to a remote IRI node on port 14265, do the following:

IotaAPI api = new IotaAPI.Builder()
        .protocol("http")
        .host("URL OF THE REMOTE IRI NODE")
        .port(14265)
        .build();
GetNodeInfoResponse response = api.getNodeInfo();

Note: To separate your IRI node configuration from the implementation, you can also specify your IRI node configuration in a Java .properties file or as command line flags. These options are useful if you develop an open-source app which is deployed on a CI and don't want contributors to see the internal IRI node configuration. To make the API read from this file, add the configuration to the builder like so: .config(new FileConfig("node_config.properties"))

Example .properties files

iota.node.protocol=http
iota.node.host=127.0.0.1
iota.node.port=14265

Most API calls are synchronous. Therefore, we recommend that you call the API from a background thread or a worker thread to stop the API from blocking other threads such as the UI or the main thread.

API Reference

For a full list of API commands for the IOTA Java client library, go to the GitHub page.

Here are some of the most commonly used API functions:

Examples

We have a list of test cases in the src/test/java directory that you can use as a reference when developing apps with IOTA. A good starter is the IotaAPITest case.

Here's how you could send a zero-value transaction, using the library. For the guide, see the documentation portal.

class SendData {
    public static void main(String[] args) throws ArgumentException {

        // Connect to a node
        IotaAPI api = new IotaAPI.Builder()
            .protocol("https")
            .host("nodes.devnet.thetangle.org")
            .port(443)
            .build();

        int depth = 3;
        int minimumWeightMagnitude = 9;

        // Even though a seed is not necessary because zero value transactions are not signed,
        // the library requires a seed to send a transaction.
        // This seed can be any random string of 81 trytes
        String myRandomSeed = SeedRandomGenerator.generateNewSeed();

        // Define any security level (like the seed, this is not used)
        int securityLevel = 2;

        // Define an address.
        // This does not need to belong to anyone or have IOTA tokens.
        // It must only contain a maximum of 81 trytes
        // or 90 trytes with a valid checksum
        String address = "ZLGVEQ9JUZZWCZXLWVNTHBDX9G9KZTJP9VEERIIFHY9SIQKYBVAHIMLHXPQVE9IXFDDXNHQINXJDRPFDXNYVAPLZAW";
        // This is a zero-value transaction
        int value = 0;
        // Define a message to send.
        // This message must include only ASCII characters.
        String message = TrytesConverter.asciiToTrytes("Hello world");
        String tag = "HELLOWORLD";

        Transfer zeroValueTransaction = new Transfer(address, value, message, tag);
        
        ArrayList<Transfer> transfers = new ArrayList<Transfer>();

        transfers.add(zeroValueTransaction);
        
        // Create a bundle from the transfers list
        // and send the transaction to the node
        try { 
            // Since we don't send any value, we can skip validation of inputs
            SendTransferResponse response = api.sendTransfer(myRandomSeed, securityLevel, depth, minimumWeightMagnitude, transfers, null, null, false, false, null);
            System.out.println(response.getTransactions());
        } catch (ArgumentException e) { 
            // Handle error
            e.printStackTrace(); 
         }
    }
}

Change logs

Supporting the project

If the IOTA Java client library has been useful to you and you feel like contributing, consider posting a bug report, feature request or a pull request.

We have some basic contribution guidelines to keep our code base stable and consistent.

Joining the discussion

If you want to get involved in the community, need help with getting setup, have any issues related with the library or just want to discuss blockchain, distributed ledgers, and IoT with other people, feel free to join our Discord.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].