{"id":13536146,"url":"https://github.com/iotaledger/iota-java","last_synced_at":"2025-04-02T02:32:28.232Z","repository":{"id":52315244,"uuid":"71725051","full_name":"iotaledger/iota-java","owner":"iotaledger","description":"IOTA Java API Library. Find documentation on","archived":true,"fork":false,"pushed_at":"2022-11-16T01:50:39.000Z","size":4757,"stargazers_count":141,"open_issues_count":24,"forks_count":86,"subscribers_count":25,"default_branch":"dev","last_synced_at":"2024-05-21T15:19:16.177Z","etag":null,"topics":["api","cryptocurrency","iota","iota-java-library","iota-library","java"],"latest_commit_sha":null,"homepage":"https://docs.iota.org/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iotaledger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null}},"created_at":"2016-10-23T19:34:35.000Z","updated_at":"2024-05-21T11:10:56.000Z","dependencies_parsed_at":"2022-08-22T14:20:42.755Z","dependency_job_id":null,"html_url":"https://github.com/iotaledger/iota-java","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iotaledger%2Fiota-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iotaledger%2Fiota-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iotaledger%2Fiota-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iotaledger%2Fiota-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iotaledger","download_url":"https://codeload.github.com/iotaledger/iota-java/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222795273,"owners_count":17038797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","cryptocurrency","iota","iota-java-library","iota-library","java"],"created_at":"2024-08-01T09:00:35.231Z","updated_at":"2024-11-03T01:30:27.587Z","avatar_url":"https://github.com/iotaledger.png","language":"Java","readme":"\u003ch1 align=\"center\"\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://docs.iota.org/docs/client-libraries/0.1/getting-started/java-quickstart\"\u003e\u003cimg src=\"iota-java.png\"\u003e\u003c/a\u003e\n\u003c/h1\u003e\n\n\u003ch2 align=\"center\"\u003eThe official Java client library for interacting with the legacy Tangle (deprecated since Chrysalis)\u003c/h2\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://docs.iota.org/docs/client-libraries/0.1/getting-started/java-quickstart\" style=\"text-decoration:none;\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Documentation%20portal-blue.svg?style=for-the-badge\"\n         alt=\"Developer documentation portal\"\u003e\n      \u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://iotaledger.github.io/iota-java/javadoc/\" style=\"text-decoration:none;\"\u003e\u003cimg src=\"https://img.shields.io/badge/javadoc-reference-informational.svg\" alt=\"Auto-generated docs\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://discord.iota.org/\" style=\"text-decoration:none;\"\u003e\u003cimg src=\"https://img.shields.io/badge/Discord-9cf.svg?logo=discord\" alt=\"Discord\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://iota.stackexchange.com/\" style=\"text-decoration:none;\"\u003e\u003cimg src=\"https://img.shields.io/badge/StackExchange-9cf.svg?logo=stackexchange\" alt=\"StackExchange\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/iotaledger/iota-java/blob/dev/LICENSE\" style=\"text-decoration:none;\"\u003e\u003cimg src=\"https://img.shields.io/github/license/iotaledger/iota-java.svg\" alt=\"Apache 2.0 license\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://docs.iota.org/docs/node-software/0.1/iri/references/api-reference\" style=\"text-decoration:none;\"\u003e\u003cimg src=\"https://img.shields.io/badge/Node%20API%20coverage-18/18%20commands-green.svg\" alt=\"Supported IRI API endpoints\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.codacy.com/app/kwek20/iota-java?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=iotaledger/iota-java\u0026amp;utm_campaign=Badge_Grade\" style=\"text-decoration:none;\"\u003e\u003cimg src=\"https://api.codacy.com/project/badge/Grade/92feea51a15c4e589386c269475b8761\" alt=\"Code quality\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://jitpack.io/#iotaledger/iota-java\" style=\"text-decoration:none;\"\u003e\u003cimg src=\"https://jitpack.io/v/iotaledger/iota-java.svg\" alt=\"Latest release\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://travis-ci.org/iotaledger/iota-java\" style=\"text-decoration:none;\"\u003e\u003cimg src=\"https://travis-ci.org/iotaledger/iota-java.svg?branch=dev\" alt=\"Build status\"\u003e\u003c/a\u003e\n  \u003ca href='https://sourcespy.com/github/iotaledgeriotajava'  style=\"text-decoration:none;\" title='SourceSpy Dashboard'\u003e\u003cimg src='https://img.shields.io/badge/SourceSpy-dashboard-165cc5'/\u003e\u003c/a\u003e\n\u003c/p\u003e\n      \n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#about\"\u003eAbout\u003c/a\u003e ◈\n  \u003ca href=\"#prerequisites\"\u003ePrerequisites\u003c/a\u003e ◈\n  \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e ◈\n  \u003ca href=\"#getting-started\"\u003eGetting started\u003c/a\u003e ◈\n  \u003ca href=\"#api-reference\"\u003eAPI reference\u003c/a\u003e ◈\n  \u003ca href=\"#examples\"\u003eExamples\u003c/a\u003e ◈\n  \u003ca href=\"#change-logs\"\u003eChange logs\u003c/a\u003e ◈\n  \u003ca href=\"#supporting-the-project\"\u003eSupporting the project\u003c/a\u003e ◈\n  \u003ca href=\"#joining-the-discussion\"\u003eJoining the discussion\u003c/a\u003e \n\u003c/p\u003e\n\n---\n\n## Deprecation warning\n\nThis java client is no longer usable in the new Chrysalis network.\nPlease use the Java bindings generated for iota.rs.\nThey can be found [here](https://github.com/iotaledger/iota.rs/tree/dev/bindings/java)\n\n## About\n\nThis was the **official** Java client library, which allows you to do the following:\n\n* Create transactions\n* Read transactions\n* Sign transactions\n* Generate addresses\n\nThis is beta software, so there may be performance and stability issues.\nPlease report any issues in our [issue tracker](https://github.com/iotaledger/iota-java/issues/new/choose).\n\n## Prerequisites\n\nTo use the IOTA Java client library, your computer must have the following minimum requirement:\n\n* Java 6 (or higher)\n\n## Installation\n\nThe IOTA Java client library is available on [**jitpack.io**][jitpack].\n\nTo install the IOTA Java client library and its dependencies, you can use one of the following options:\n\n* Download the library with Gradle\n* Download the library with Maven\n* Download the library manually\n\n### Gradle\n\n 1. Add the following repository to your root `build.gradle` file (**not** your module `build.gradle` file):\n\n    ```gradle\n    allprojects {\n        repositories {\n            maven { url 'https://jitpack.io' }\n        }\n    }\n    ```\n\n2. Add the following dependency to your module `build.gradle` file:\n\n    ```gradle\n    dependencies {\n        compile 'com.github.iotaledger:iota-java:1.0.0-beta8'\n    }\n    ```\n    \n### Maven\n\n#### Through Maven central\n1. Add the following repository to your root `pom.xml` file:\n    ```xml\n    \u003cdependency\u003e\n        \u003cgroupId\u003eorg.iota\u003c/groupId\u003e\n        \u003cartifactId\u003ejota\u003c/artifactId\u003e\n        \u003cclassifier\u003ejar-with-dependencies\u003c/classifier\u003e\n        \u003cversion\u003e1.0.0-beta9\u003c/version\u003e\n    \u003c/dependency\u003e\n    ```\n\n#### Through Jitpack\n\n1. Add the following repository to your root `pom.xml` file:\n    ```xml\n    \u003crepositories\u003e\n        \u003crepository\u003e\n            \u003cid\u003ejitpack.io\u003c/id\u003e\n            \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n        \u003c/repository\u003e\n    \u003c/repositories\u003e\n    ```\n\n2. Add the following dependency to your module `pom.xml` file:\n    ```xml\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecom.github.iotaledger.iota-java\u003c/groupId\u003e\n        \u003cartifactId\u003ejota\u003c/artifactId\u003e\n        \u003cclassifier\u003ejar-with-dependencies\u003c/classifier\u003e\n        \u003cversion\u003e[VERSION_INFORMATION]\u003c/version\u003e\n    \u003c/dependency\u003e\n    ```\n    \n3. Change the value of the `\u003cversion\u003e` tag to either a release number or the first 10 characters of a Git commit hash:\n`\u003cversion\u003eb703ef3c05f05\u003c/version\u003e` or `\u003cversion\u003e1.0.0-beta9\u003c/version\u003e`\n\n**Note:** Find the latest version on the [Jitpack](https://jitpack.io/#iotaledger/iota-java) page.\n\n### Manual installation\n\n1. Clone or download the [GitHub repository](https://github.com/iotaledger/iota-java).\n\n    Inside the project, you'll have the following directories:\n    * jota\n    * jota-parent\n\n2. Import and reference the jota directory in your project\nFor example in Eclipse: `right mouse on your project -\u003e Properties -\u003e Java Build Path -\u003e Projects -\u003e Add 'jota'`\n\n3. In the jota directory, run the following command:\n\n    `mvn clean install`\n\nYou'll have a .jar file called `jota-[VERSION]-jar-with-dependencies.jar`, depending on your version of the library.\n\n## Getting Started\n\nAfter you've [installed the library](#installation), you can connect to an IRI node to send transactions to it and interact with the Tangle.\nAn extended guide can be found on our [documentation portal](https://docs.iota.org/docs/client-libraries/0.1/getting-started/java-quickstart), we strongly recommend you to go here for starting off. A quick start tutorial is shown below.\n\nTo connect to a local IRI node on port 14265, do the following:\n\n```java\nIotaAPI api = new IotaAPI.Builder().build();\nGetNodeInfoResponse response = api.getNodeInfo();\n```\n\nTo connect to a remote IRI node on port 14265, do the following:\n\n```java\nIotaAPI api = new IotaAPI.Builder()\n        .protocol(\"http\")\n        .host(\"URL OF THE REMOTE IRI NODE\")\n        .port(14265)\n        .build();\nGetNodeInfoResponse response = api.getNodeInfo();\n```\n\n**Note:** To separate your IRI node configuration from the implementation, you can also specify your IRI node configuration in a [**Java `.properties` file**](https://en.wikipedia.org/wiki/.properties) 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.\nTo make the API read from this file, add the configuration to the builder like so: `.config(new FileConfig(\"node_config.properties\"))`\n\n**Example .properties files**\n\n```java\niota.node.protocol=http\niota.node.host=127.0.0.1\niota.node.port=14265\n```\n\nMost 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.\n\n## API Reference\n\nFor a full list of API commands for the IOTA Java client library, go to the [GitHub page](https://iotaledger.github.io/iota-java/javadoc/jota/IotaAPICommands.html#enum.constant.summary).\n\nHere are some of the most commonly used API functions:\n\n- [`getTransactionsObjects`](https://iotaledger.github.io/iota-java/javadoc/jota/IotaAPI.html#getTransactionsObjects-java.lang.String:A-)\n- [`findTransactionObjects`](https://iotaledger.github.io/iota-java/javadoc/jota/IotaAPI.html#findTransactionObjects-java.lang.String:A-)\n- [`getTransactionsObjects`](https://iotaledger.github.io/iota-java/javadoc/jota/IotaAPI.html#getTransactionsObjects-java.lang.String:A-)\n- [`getLatestInclusion`](https://iotaledger.github.io/iota-java/javadoc/jota/IotaAPI.html#getLatestInclusion-java.lang.String:A-)\n- [`broadcastAndStore`](https://iotaledger.github.io/iota-java/javadoc/jota/IotaAPI.html#broadcastAndStore-java.lang.String...-)\n- [`getNewAddress`](https://iotaledger.github.io/iota-java/javadoc/jota/IotaAPI.html#getNewAddress-java.lang.String-int-int-boolean-int-boolean-)\n- [`getInputs`](https://iotaledger.github.io/iota-java/javadoc/jota/IotaAPI.html#getInputs-java.lang.String-int-int-int-long-)\n- [`prepareTransfers`](https://iotaledger.github.io/iota-java/javadoc/jota/IotaAPI.html#prepareTransfers-java.lang.String-int-java.util.List-java.lang.String-java.util.List-boolean-)\n- [`sendTrytes`](https://iotaledger.github.io/iota-java/javadoc/jota/IotaAPI.html#sendTrytes-java.lang.String:A-int-int-)\n- [`sendTransfer`](https://iotaledger.github.io/iota-java/javadoc/jota/IotaAPI.html#sendTransfer-java.lang.String-int-int-int-java.util.List-jota.model.Input:A-java.lang.String-)\n- [`replayBundle`](https://iotaledger.github.io/iota-java/javadoc/jota/IotaAPI.html#replayBundle-java.lang.String-int-int-)\n- [`getBundle`](https://iotaledger.github.io/iota-java/javadoc/jota/IotaAPI.html#getBundle-java.lang.String-)\n- [`getTransfers`](https://iotaledger.github.io/iota-java/javadoc/jota/IotaAPI.html#getTransfers-java.lang.String-int-java.lang.Integer-java.lang.Integer-java.lang.Boolean-)\n- [`initiateTransfer`](https://iotaledger.github.io/iota-java/javadoc/jota/IotaAPI.html#initiateTransfer-int-java.lang.String-java.lang.String-java.util.List-boolean-)\n- [`getAccountData`](https://iotaledger.github.io/iota-java/javadoc/jota/IotaAPI.html#getAccountData-java.lang.String-int-int-boolean-int-boolean-int-int-boolean-long-)\n\n## Examples\n\nWe have a list of test cases in the [`src/test/java` directory][tests] that you can use as a reference when developing apps with IOTA.\nA good starter is the [`IotaAPITest` case](https://github.com/iotaledger/iota-java/blob/master/jota/src/test/java/org/iota/jota/IotaAPITest.java).\n\nHere's how you could send a zero-value transaction, using the library. For the guide, see the [documentation portal](https://docs.iota.org/docs/client-libraries/0.1/how-to-guides/java/send-your-first-bundle).\n\n```java\nclass SendData {\n    public static void main(String[] args) throws ArgumentException {\n\n        // Connect to a node\n        IotaAPI api = new IotaAPI.Builder()\n            .protocol(\"https\")\n            .host(\"nodes.devnet.thetangle.org\")\n            .port(443)\n            .build();\n\n        int depth = 3;\n        int minimumWeightMagnitude = 9;\n\n        // Even though a seed is not necessary because zero value transactions are not signed,\n        // the library requires a seed to send a transaction.\n        // This seed can be any random string of 81 trytes\n        String myRandomSeed = SeedRandomGenerator.generateNewSeed();\n\n        // Define any security level (like the seed, this is not used)\n        int securityLevel = 2;\n\n        // Define an address.\n        // This does not need to belong to anyone or have IOTA tokens.\n        // It must only contain a maximum of 81 trytes\n        // or 90 trytes with a valid checksum\n        String address = \"ZLGVEQ9JUZZWCZXLWVNTHBDX9G9KZTJP9VEERIIFHY9SIQKYBVAHIMLHXPQVE9IXFDDXNHQINXJDRPFDXNYVAPLZAW\";\n        // This is a zero-value transaction\n        int value = 0;\n        // Define a message to send.\n        // This message must include only ASCII characters.\n        String message = TrytesConverter.asciiToTrytes(\"Hello world\");\n        String tag = \"HELLOWORLD\";\n\n        Transfer zeroValueTransaction = new Transfer(address, value, message, tag);\n        \n        ArrayList\u003cTransfer\u003e transfers = new ArrayList\u003cTransfer\u003e();\n\n        transfers.add(zeroValueTransaction);\n        \n        // Create a bundle from the transfers list\n        // and send the transaction to the node\n        try { \n            // Since we don't send any value, we can skip validation of inputs\n            SendTransferResponse response = api.sendTransfer(myRandomSeed, securityLevel, depth, minimumWeightMagnitude, transfers, null, null, false, false, null);\n            System.out.println(response.getTransactions());\n        } catch (ArgumentException e) { \n            // Handle error\n            e.printStackTrace(); \n         }\n    }\n}\n```\n\n## Change logs\n\n- Changes in [**1.0.0-beta9**](https://github.com/iotaledger/iota-java/compare/1.0.0-beta8...1.0.0-beta9)\n- Changes in [**1.0.0-beta8**](https://github.com/iotaledger/iota-java/compare/1.0.0-beta7...1.0.0-beta8)\n- Changes in [**1.0.0-beta7**](https://github.com/iotaledger/iota-java/compare/1.0.0-beta6...1.0.0-beta7)\n- Changes in [**1.0.0-beta6**](https://github.com/iotaledger/iota-java/compare/1.0.0-beta5...1.0.0-beta6)\n- Changes in [**1.0.0-beta5**](https://github.com/iotaledger/iota-java/compare/1.0.0-beta4...1.0.0-beta5)\n- Changes in [**1.0.0-beta4**](https://github.com/iotaledger/iota-java/compare/1.0.0-beta3...1.0.0-beta4)\n- Changes in [**1.0.0-beta3**](https://github.com/iotaledger/iota-java/compare/1.0.0-beta2...1.0.0-beta3)\n- Changes in [**1.0.0-beta2**](https://github.com/iotaledger/iota-java/compare/1.0.0-beta1...1.0.0-beta2)\n- Changes in [**1.0.0-beta1**](https://github.com/iotaledger/iota-java/compare/0.9.10...1.0.0-beta1)\n- Changes in [**v0.9.10**](https://github.com/iotaledger/iota-java/compare/v0.9.6...0.9.10)\n- Changes in [**v0.9.6**](https://github.com/iotaledger/iota-java/compare/v0.9.5...v0.9.6)\n- Changes in [**v0.9.5**](https://github.com/iotaledger/iota-java/compare/v0.9.4...v0.9.5)\n- Changes in [**v0.9.4**](https://github.com/iotaledger/iota-java/compare/v0.9.3...v0.9.4)\n- Changes in [**v0.9.3**](https://github.com/iotaledger/iota-java/compare/v0.9.2...v0.9.3)\n- Changes in [**v0.9.2**](https://github.com/iotaledger/iota-java/compare/v0.9.1...v0.9.2)\n- Changes in [**v0.9.1**](https://github.com/iotaledger/iota-java/commits/v0.9.1)\n\n## Supporting the project\n\nIf the IOTA Java client library has been useful to you and you feel like contributing, consider posting a [bug report](https://github.com/iotaledger/iota-java/issues/new-issue), feature request or a [pull request](https://github.com/iotaledger/iota-java/pulls/).  \n\nWe have some [basic contribution guidelines](.github/CONTRIBUTING.md) to keep our code base stable and consistent.\n\n## Joining the discussion\n\nIf 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](https://discord.iota.org/).  \n\n\n[issues]: https://github.com/iotaledger/iota-java/issues\n[new-issue]: https://github.com/iotaledger/iota-java/issues/new\n[pull-requests]: https://github.com/iotaledger/iota-java/pulls\n[new-pull-request]: https://github.com/iotaledger/iota-java/compare\n[contribution-guidelines]: https://github.com/iotaledger/iota-java/blob/master/CONTRIBUTING.md\n[tests]: https://github.com/iotaledger/iota-java/tree/master/jota/src/test/java/org/iota/jota\n[iota-discord]: https://discord.iota.org/\n[iota-forum]: https://forum.iota.org/\n","funding_links":[],"categories":["Developers"],"sub_categories":["Official by the IOTA Foundation"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiotaledger%2Fiota-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiotaledger%2Fiota-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiotaledger%2Fiota-java/lists"}