diff --git a/README.md b/README.md index 82de3323..3617b9bd 100644 --- a/README.md +++ b/README.md @@ -69,12 +69,23 @@ To download the IOTA Java client library and its dependencies, you can use one o ```gradle dependencies { - compile 'com.github.iotaledger:iota-java:1.0.0-beta7' + compile 'com.github.iotaledger:iota-java:1.0.0-beta8' } ``` ### Downloading the library with Maven +#### Through Maven central +1. Add the following repository to your root `pom.xml` file: + ```xml + + org.iota + jota + jar-with-dependencies + 1.0.0-beta8 + + ``` +#### Through Jitpack 1. Add the following repository to your root `pom.xml` file: ```xml @@ -96,7 +107,7 @@ To download the IOTA Java client library and its dependencies, you can use one o ``` 3. Change the value of the `` tag to either a release number or the first 10 characters of a Git commit hash: -`efdc784d8a9ef` or `1.0.0-beta7` +`efdc784d8a9ef` or `1.0.0-beta8` **Note:** Find the latest version on the [Jitpack](https://jitpack.io/#iotaledger/iota-java) page. @@ -108,7 +119,8 @@ To download the IOTA Java client library and its dependencies, you can use one o * jota * jota-parent -2. Reference the jota directory in your project +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: @@ -181,7 +193,60 @@ Here are some of the most commonly used API functions: We have a list of test cases on the [`src/test/java` directory][tests] that you can use as a reference when developing apps with IOTA. A good starter is the [`IotaAPITest` case](https://github.com/iotaledger/iota-java/blob/master/jota/src/test/java/org/iota/jota/IotaAPITest.java). +### Creating and broadcasting transactions +This example shows you how to create and send a transaction to an IRI node by calling the `prepareTransfers()` method and piping the prepared bundle to the `sendTrytes()` method. + +```java +String fromAddr = "G9OPCBSQZO9GUNOYLLJYY ... JCF9TCDSZAU9VSOCZPC"; +String toAddr = "TKGLOMEGTJWXIKDTF9CAV ... 9Q9RHCNDXTLGJYJPYM9"; + +// difficulty of the proof of work required to attach a transaction on the tangle +int mwm = 14; + +// how many milestones back to start the random walk from +int depth = 3; + +// create a transfer to the given recipient address +// optionally define a message and tag +List transfers = new LinkedList<>(); +transfers.add(new Transfer(toAddr, 80, "MESSAGE", "TAG")); + +// create inputs for the transfer, this address contains 100 iota +List inputs = new LinkedList<>(); +inputs.add(new Input(fromAddr, 100, 0, Constants.MAX_SECURITY_LEVEL)); + +// create an address for the remainder. +// in this case we will have 20 iotas as the remainder, since we spend 1000 from our input +// address and only send 80 to the recipient. +String remainder = api.generateNewAddresses( + new AddressRequest.Builder(seed, Constants.MAX_SECURITY_LEVEL).amount(1).checksum(true).build() + ).first(); + +// Prepare the transfer by creating a bundle with the given transfers and inputs. +// The result are trytes ready for PoW. +List trytes = api.prepareTransfers(seed, 3, transfers, remainder , inputs, null, false); + +// You can decrease your chance of sending to a spent address by checking the address before +// broadcasting your bundle. +WereAddressesSpentFromResponse spent = api.wereAddressesSpentFrom(transfers.get(0).getAddress()); +if (spent.getStates()[0]) { + System.out.println("Recipient address is spent from, aborting transfer"); + return; +} + +// at this point the bundle trytes are signed. +// now we need to: +// 1. select two tips +// 2. do proof-of-work +// 3. broadcast the bundle +// 4. store the bundle +// sendTrytes() conveniently does the steps above for us. +List bundle = api.sendTrytes(trytes.toArray(new String[0]), depth, mwm, null); +System.out.println("broadcasted bundle with tail tx hash: " + bundle.get(0)); +``` + ## Change logs: +- Changes in [**1.0.0-beta8**](https://github.com/iotaledger/iota-java/compare/1.0.0-beta7...1.0.0-beta8) - Changes in [**1.0.0-beta7**](https://github.com/iotaledger/iota-java/compare/1.0.0-beta6...1.0.0-beta7) - Changes in [**1.0.0-beta6**](https://github.com/iotaledger/iota-java/compare/1.0.0-beta5...1.0.0-beta6) - Changes in [**1.0.0-beta5**](https://github.com/iotaledger/iota-java/compare/1.0.0-beta4...1.0.0-beta5) diff --git a/docs/iota-java/addRemainder.md b/docs/iota-java/addRemainder.md index 791c1d3b..3ac2910f 100644 --- a/docs/iota-java/addRemainder.md +++ b/docs/iota-java/addRemainder.md @@ -1,5 +1,5 @@ -# [addRemainder](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L1529) +# [addRemainder](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L1527) List addRemainder(String seed , int security , List<[Input](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Input.java)> inputs , [Bundle](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Bundle.java) bundle , String tag , long totalValue , String remainderAddress , List signatureFragments) Uses input, and adds to the bundle, untill `totalValue` is reached. If there is a remainder left on the last input, a remainder transfer is added. @@ -41,7 +41,7 @@ Uses input, and adds to the bundle, untill `totalValue` is reached. If there is IotaAPI iotaAPI = new IotaAPI.Builder().build(); try { - List response = iotaAPI.addRemainder("YOUR9SECRET9SEED9999999...", 3, new List(new Input[]{inputs, inputs}), bundle, "TAG9TIGHDELJXFHN9KLKZHVGBST", 284, "LTWUDWCICFHSWYOXMBWXEYQGBJNAKHCXIQGSTOQOTJR9DBOOVYGZ9NLHAK9FGCSXWKTBPBBMOVZMJBHKJ", new List(new String[]{"PSDFHESDBFMKIEGSKIYHTIQEC ... BDVYKAQWWAGBZBPSFVKWBY9YB", "PSXXTETHXPZPIUQNMCORDIOOG ... QCFIIPMYGROYCQAMKSNIUDJPG"})); + List response = iotaAPI.addRemainder("YOUR9SECRET9SEED9999999...", 3, new List(new Input[]{inputs, inputs}), bundle, "TAG9QXJKVCMJTZKDLKBDJOFUNBG", 694, "YSSJTOKAUD9OVFEGQUPN9GRHEZAOUFGYUMJAVWTK9RVSTXGJMH9JPSLIWDPVXFXMIVIFCFF9DENNVILDV", new List(new String[]{"IANOICEWWXZAPDVKYHHVFHBCP ... ZGCSQDTXDPRTRPHHTZOFCRPYA", "LYSKNTDRWDLVCFXDHVKSDDVPY ... SWCBVCPPELYHKWUGEFWMZUFER"})); } catch (ArgumentException e) { // Handle error e.printStackTrace(); diff --git a/docs/iota-java/bundlesFromAddresses.md b/docs/iota-java/bundlesFromAddresses.md index 19d5a5bf..cef9217f 100644 --- a/docs/iota-java/bundlesFromAddresses.md +++ b/docs/iota-java/bundlesFromAddresses.md @@ -29,7 +29,7 @@ Internal function to get the formatted bundles of a list of addresses. IotaAPI iotaAPI = new IotaAPI.Builder().build(); try { - Bundle[] response = iotaAPI.bundlesFromAddresses(false, new String[]{"UTSPUMBBRHRCVMPKAWDRXIFUYHOYLJGTZ9DTRIQJFD9UFDYCNLFQBV9LTOMGASNPWVFMCAMKVKOCVNZKG", "WAZEFGAKXRACVFNEP9JXYPASTZVBYXF9UNHKUHRUDWDBETAJYD9OFWBOJON9FDQRRBTVXZMCMMTLZLRWH"}); + Bundle[] response = iotaAPI.bundlesFromAddresses(false, new String[]{"RMQYYPYZKJQOWHDJPXDFUB9NYFWDUNNUBHIQRYUZBYGHKMDDWFLURDCIUVYHGVNQJMFQSPCUNETZFPIPZ", "WALYAJHFLXYTGDTSRTEJZCDKIMAKJZSKEFVBVPUYYFSQDWUXP9TFGXOYSFVQTRZBDTRKYBYMKBJIDWNLZ"}); } catch (ArgumentException e) { // Handle error e.printStackTrace(); diff --git a/docs/iota-java/checkWereAddressSpentFrom.md b/docs/iota-java/checkWereAddressSpentFrom.md index f3d89169..3ed777bb 100644 --- a/docs/iota-java/checkWereAddressSpentFrom.md +++ b/docs/iota-java/checkWereAddressSpentFrom.md @@ -1,5 +1,5 @@ -# [checkWereAddressSpentFrom](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L948) +# [checkWereAddressSpentFrom](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L950) boolean[] checkWereAddressSpentFrom(String[] addresses) Check if a list of addresses was ever spent from, in the current epoch, or in previous epochs. Addresses must have a checksum. @@ -27,7 +27,7 @@ Check if a list of addresses was ever spent from, in the current epoch, or in pr IotaAPI iotaAPI = new IotaAPI.Builder().build(); try { - boolean[] response = iotaAPI.checkWereAddressSpentFrom(new String[]{"LFR9BZETOYCK99HAUF9QCKHNFKWRSGMUSWCBES99LBQNLA9FPZHZWOXALDUYBUUYSSCVECENJXIKVKFOT", "RUIZBLTGKNUQN9K9MFTODKMM9VXLKWAHVYATRFIC9COFBMXO9POVTRVBSZAEICJSFFAHWZLPMU9AEWKIE"}); + boolean[] response = iotaAPI.checkWereAddressSpentFrom(new String[]{"SEGOBHYIZQQSGZNAZKJGATEUEGVNFOQFOOWIEVKNWPEJ9VVMZBWJVYTDQMYZLOVGYYPFUVMXJABVAOMOI", "YCQ9OYOHBKCNTF9ELDWMXIZIMOZSWTCWRKKRHIL9SFKPFZIBTYOSGUQJZQJYSAEIFNVEKLBRAOSORCWUU"}); } catch (ArgumentException e) { // Handle error e.printStackTrace(); diff --git a/docs/iota-java/findTransactionObjectsByAddresses.md b/docs/iota-java/findTransactionObjectsByAddresses.md index 7aad873b..a97427d4 100644 --- a/docs/iota-java/findTransactionObjectsByAddresses.md +++ b/docs/iota-java/findTransactionObjectsByAddresses.md @@ -1,5 +1,5 @@ -# [findTransactionObjectsByAddresses](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L396) +# [findTransactionObjectsByAddresses](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L398) List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java)> findTransactionObjectsByAddresses(String[] addresses) Wrapper function: Finds transactions, gets trytes and turns it into [Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java) objects. @@ -12,7 +12,6 @@ Wrapper function: Finds transactions, gets trytes and turns it into [Transaction ## Output List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java)>, which contains the following fields: - | Return type | Description | |--|--| | long attachmentTimestampLowerBound | | @@ -42,8 +41,8 @@ List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/ ## Related APIs (link to other product documentation) | API | Description | |:---------------|:--------| -| [findTransactionsByAddresses(String...)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L308) | Find the transactions by addresses with checksum | -| [findTransactionsObjectsByHashes](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L370) | Wrapper function: get trytes and turns into [Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java) objects. Gets the trytes and transaction object from a list of transaction hashes. | +| [findTransactionsByAddresses(String...)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L319) | Find the transactions by addresses with checksum | +| [findTransactionsObjectsByHashes](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L372) | Wrapper function: get trytes and turns into [Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java) objects. Gets the trytes and transaction object from a list of transaction hashes. | ## Example @@ -51,7 +50,7 @@ List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/ IotaAPI iotaAPI = new IotaAPI.Builder().build(); try { - List response = iotaAPI.findTransactionObjectsByAddresses(new String[]{"GHIALCNSUKFIOHCNZOWRAVNRJTMEHWTRBNMMCLCZAXPDWXTUXPWCUOIRKWKX9YXYNS9JGPNCIURDYBNDY", "BYANZHOP9YKVFFWJZGBDTGFBNRTUQGEFXWMJNTOACZ9IRETPQX9EKMFNTVJFYRCKWCKFQAQXXD9JVSQBX"}); + List response = iotaAPI.findTransactionObjectsByAddresses(new String[]{"AJCSWDXXBPNZ9ZPDNPR99QQYLTBEDZYBOBHFHCYBJWJWUXQZTWMARLQOBIRUXKMFODVDVCXVZRICOK9OK", "EMA9ZMWSUTEVURWHCOSNTAASRPOKIVTNPSPAHXGILBMTHBYCILIJYNCWRPWFOYMVQRWPCGRYJUVAFSRFT"}); } catch (ArgumentException e) { // Handle error e.printStackTrace(); diff --git a/docs/iota-java/findTransactionObjectsByApprovees.md b/docs/iota-java/findTransactionObjectsByApprovees.md index ec830f8b..d8d3b8cb 100644 --- a/docs/iota-java/findTransactionObjectsByApprovees.md +++ b/docs/iota-java/findTransactionObjectsByApprovees.md @@ -1,5 +1,5 @@ -# [findTransactionObjectsByApprovees](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L435) +# [findTransactionObjectsByApprovees](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L437) List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java)> findTransactionObjectsByApprovees(String[] approvees) Wrapper function: Finds transactions, gets trytes and turns it into [Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java) objects. @@ -12,7 +12,6 @@ Wrapper function: Finds transactions, gets trytes and turns it into [Transaction ## Output List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java)>, which contains the following fields: - | Return type | Description | |--|--| | long attachmentTimestampLowerBound | | @@ -42,7 +41,7 @@ List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/ ## Related APIs (link to other product documentation) | API | Description | |:---------------|:--------| -| [findTransactionsByApprovees](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L334) | Find the transactions by approvees | +| [findTransactionsByApprovees](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L345) | Find the transactions by approvees | ## Example @@ -50,7 +49,7 @@ List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/ IotaAPI iotaAPI = new IotaAPI.Builder().build(); try { - List response = iotaAPI.findTransactionObjectsByApprovees(new String[]{"WSOLQGWRUZEPMZUKRDVDADHVESYRLOWOEHCWONIIT9HSPBZLEGQNYIHVKLMIEZYTPADXJYBOVNNYCPCYJ", "MFZMSUNPKPLDMTWQSPIMULPIZGBENUCSHYORAVNQPTKGKIXLTPUVPJHNJQLRNZHNZXOFGUUMIHDZPWNWP"}); + List response = iotaAPI.findTransactionObjectsByApprovees(new String[]{"TMIPRULGWLBQOUSQCFCMMOXUZNWBDSSXIJAXUVFFYWDJIGIRLQHUXJJAORAYPBAUYNCEHMDLIJRLYFNPJ", "LUWGMJBHQZYWGUGAYYUYCQ9KYFMA9MDFW9OWIHAYMZNRYPJETBVXQAQQAJXDVLCQHG9BSTTVWHPJHKKKW"}); } catch (ArgumentException e) { // Handle error e.printStackTrace(); diff --git a/docs/iota-java/findTransactionObjectsByTag.md b/docs/iota-java/findTransactionObjectsByTag.md index a9b61dbd..a26482e3 100644 --- a/docs/iota-java/findTransactionObjectsByTag.md +++ b/docs/iota-java/findTransactionObjectsByTag.md @@ -1,5 +1,5 @@ -# [findTransactionObjectsByTag](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L416) +# [findTransactionObjectsByTag](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L418) List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java)> findTransactionObjectsByTag(String[] tags) Wrapper function: Finds transactions, gets trytes and turns it into [Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java) objects. @@ -12,7 +12,6 @@ Wrapper function: Finds transactions, gets trytes and turns it into [Transaction ## Output List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java)>, which contains the following fields: - | Return type | Description | |--|--| | long attachmentTimestampLowerBound | | @@ -42,8 +41,8 @@ List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/ ## Related APIs (link to other product documentation) | API | Description | |:---------------|:--------| -| [findTransactionsByTags(String...)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L361) | Find the transactions by tags | -| [findTransactionsObjectsByHashes](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L370) | Wrapper function: get trytes and turns into [Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java) objects. Gets the trytes and transaction object from a list of transaction hashes. | +| [findTransactionsByTags(String...)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L372) | Find the transactions by tags | +| [findTransactionsObjectsByHashes](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L372) | Wrapper function: get trytes and turns into [Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java) objects. Gets the trytes and transaction object from a list of transaction hashes. | ## Example @@ -51,7 +50,7 @@ List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/ IotaAPI iotaAPI = new IotaAPI.Builder().build(); try { - List response = iotaAPI.findTransactionObjectsByTag(new String[]{"TAG9RODSMKAQRHOSDABVIGIMVYM", "TAG9XVOVWUZPEYGUUJFHEJRTDXL"}); + List response = iotaAPI.findTransactionObjectsByTag(new String[]{"TAG9RQWWNKCLKYYTNHKEZSFPDNJ", "TAG9LIZMXWNNLW9NXEEWAXDWYJE"}); } catch (ArgumentException e) { // Handle error e.printStackTrace(); diff --git a/docs/iota-java/findTransactionsObjectsByHashes.md b/docs/iota-java/findTransactionsObjectsByHashes.md index 5fc41279..d6207b86 100644 --- a/docs/iota-java/findTransactionsObjectsByHashes.md +++ b/docs/iota-java/findTransactionsObjectsByHashes.md @@ -1,5 +1,5 @@ -# [findTransactionsObjectsByHashes](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L370) +# [findTransactionsObjectsByHashes](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L372) List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java)> findTransactionsObjectsByHashes(String[] hashes) Wrapper function: get trytes and turns into [Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java) objects. Gets the trytes and transaction object from a list of transaction hashes. @@ -12,7 +12,6 @@ Wrapper function: get trytes and turns into [Transaction](https://github.com/iot ## Output List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java)>, which contains the following fields: - | Return type | Description | |--|--| | long attachmentTimestampLowerBound | | @@ -42,7 +41,7 @@ List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/ ## Related APIs (link to other product documentation) | API | Description | |:---------------|:--------| -| [getTrytes(String...)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L408) | Returns the raw transaction data (trytes) of a specific transaction. These trytes can then be easily converted into the actual transaction object. You can use [Transaction(String)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java#L145) for conversion to an object. | +| [getTrytes(String...)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L419) | Returns the raw transaction data (trytes) of a specific transaction. These trytes can then be easily converted into the actual transaction object. You can use [Transaction(String)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java#L145) for conversion to an object. | ## Example @@ -50,7 +49,7 @@ List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/ IotaAPI iotaAPI = new IotaAPI.Builder().build(); try { - List response = iotaAPI.findTransactionsObjectsByHashes(new String[]{"JQXBUOXGAFOTMXJZXHFYSC9RBYJTWTFDNFTXID9Z9XRJOTHZOFKPZJLCWPBASCCAWGOFNUVKFWLNUPNHZ", "YZVXFBPDEUAUIXEQI99YXWUYCLNEN9ZJZUNVWRKFNRQATZPGTXVISRMOYYTYQLKJYQWKAJHDSDEWIMCWI"}); + List response = iotaAPI.findTransactionsObjectsByHashes(new String[]{"CFFLBAXADNSMSIN9OUBLYAIANNKRFFOOWKAIUJHFOSCNLKWJROMLCDVDMCLWJEUDKZIAFQA9JPATXWNKN", "WLVSUYHXSJCQPFJEXRMENFNWJHC9RHGEPDBWTROFELSCAUPMDXVPMKHNHVMSHPKBLEVWNHRDKMPMHRV9E"}); } catch (ArgumentException e) { // Handle error e.printStackTrace(); diff --git a/docs/iota-java/generateNewAddresses.md b/docs/iota-java/generateNewAddresses.md index e2f03bb2..ca39cfc3 100644 --- a/docs/iota-java/generateNewAddresses.md +++ b/docs/iota-java/generateNewAddresses.md @@ -12,7 +12,6 @@ Generates new addresses, meaning addresses which were not spend from, according ## Output [GetNewAddressResponse](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/dto/response/GetNewAddressResponse.java), which contains the following fields: - | Return type | Description | |--|--| | Long duration | Gets the duration. | diff --git a/docs/iota-java/getAccountData.md b/docs/iota-java/getAccountData.md index c6bb0cbe..7cda099f 100644 --- a/docs/iota-java/getAccountData.md +++ b/docs/iota-java/getAccountData.md @@ -1,5 +1,5 @@ -# [getAccountData](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L912) +# [getAccountData](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L914) [GetAccountDataResponse](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/dto/response/GetAccountDataResponse.java) getAccountData(String seed , int security , int index , boolean checksum , int total , boolean returnAll , int start , int end , boolean inclusionStates , long threshold) Similar to getTransfers, just that it returns additional account data @@ -21,7 +21,6 @@ Similar to getTransfers, just that it returns additional account data ## Output [GetAccountDataResponse](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/dto/response/GetAccountDataResponse.java), which contains the following fields: - | Return type | Description | |--|--| | Long duration | Gets the duration. | @@ -47,7 +46,7 @@ Similar to getTransfers, just that it returns additional account data IotaAPI iotaAPI = new IotaAPI.Builder().build(); try { - GetAccountDataResponse response = iotaAPI.getAccountData("YOUR9SECRET9SEED9999999...", 3, 476, false, 145, false, 344, 775, true, 100); + GetAccountDataResponse response = iotaAPI.getAccountData("YOUR9SECRET9SEED9999999...", 3, 312, true, 902, false, 754, 633, false, 100); } catch (ArgumentException e) { // Handle error e.printStackTrace(); diff --git a/docs/iota-java/getAddressesUnchecked.md b/docs/iota-java/getAddressesUnchecked.md index 63621c70..3491087b 100644 --- a/docs/iota-java/getAddressesUnchecked.md +++ b/docs/iota-java/getAddressesUnchecked.md @@ -12,7 +12,6 @@ Generates `amount` of addresses, starting from `index` This does not mean that t ## Output [GetNewAddressResponse](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/dto/response/GetNewAddressResponse.java), which contains the following fields: - | Return type | Description | |--|--| | Long duration | Gets the duration. | diff --git a/docs/iota-java/getBalanceAndFormat.md b/docs/iota-java/getBalanceAndFormat.md index 03490294..33ceffbf 100644 --- a/docs/iota-java/getBalanceAndFormat.md +++ b/docs/iota-java/getBalanceAndFormat.md @@ -1,5 +1,5 @@ -# [getBalanceAndFormat](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L811) +# [getBalanceAndFormat](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L813) [GetBalancesAndFormatResponse](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/dto/response/GetBalancesAndFormatResponse.java) getBalanceAndFormat(List addresses , List tips , long threshold , int start , [StopWatch](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/utils/StopWatch.java) stopWatch , int security) Gets the balances and formats the output. @@ -17,7 +17,6 @@ Gets the balances and formats the output. ## Output [GetBalancesAndFormatResponse](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/dto/response/GetBalancesAndFormatResponse.java), which contains the following fields: - | Return type | Description | |--|--| | Long duration | Gets the duration. | @@ -37,7 +36,7 @@ Gets the balances and formats the output. IotaAPI iotaAPI = new IotaAPI.Builder().build(); try { - GetBalancesAndFormatResponse response = iotaAPI.getBalanceAndFormat(new List(new String[]{"VAMTBAMCJUVDGYJZHJEEDPWRGQEUVT9RIZQTBMTRUHBQQYWWVIMAFAHIKVPBKIINFDUAI9OXHSZGCTS9T", "UNHZZKMZTEOSWCWSQMOC9APL99UGLHFK9GAJGCOYGOAIMDVUIZF9M9KCLNUSGGUEMYSKTYSPNMZKUZCOH"}), new List(new String[]{"QKKLAGPKEGOYKSJIPJ9OBCEUMNIDQDMBUZSJHNMWMASYCHLXEVXKMB9BDYRRPT9GCTJXISBGBDSRLEIGY", "WKEXYDXSKIQAKMOTOSHPXKTONGQLORRSRNQODPQCSQCTDDFGWQEXSXUIWBTKWYESSWOPCSMAIBHVQ9B9N"}), 100, 851, new Stopwatch(), 3); + GetBalancesAndFormatResponse response = iotaAPI.getBalanceAndFormat(new List(new String[]{"UNOUHIFNQABYNYYPPT9XL9BJYDDTEMOFABJ9RMA9WORFMOOWEZQTFSELFPVZ9HBUWNRIVVYNWCCFNXOFU", "WXIHRFOQVBQZIUSKRM9CETVV9EPCBWXCZZRSMOZWDOETNFUMI9VM9COJOV9GNGHGEQUGGMGEJAKZDLROI"}), new List(new String[]{"UGEYEOHFP9HLIWFBSYDSSFNRACIWBSIH9SRPLGIXHDXBYUA9K9IQETEMRVNSMTJPTEQGHPHBTFUCA9GYB", "UQIERSSLDEQBNMY9QZGNAEEWWNO9ENDIJRXZNI9VTRCDDGGIFPE9MYPGHNGPXHIWUAQQBBVEICAPY9FRG"}), 100, 593, new Stopwatch(), 3); } catch (ArgumentException e) { // Handle error e.printStackTrace(); diff --git a/docs/iota-java/getBundle.md b/docs/iota-java/getBundle.md index 245534ab..41796dd9 100644 --- a/docs/iota-java/getBundle.md +++ b/docs/iota-java/getBundle.md @@ -1,5 +1,5 @@ -# [getBundle](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L873) +# [getBundle](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L875) [GetBundleResponse](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/dto/response/GetBundleResponse.java) getBundle(String transaction) Gets the associated bundle transactions of a single transaction. Does validation of signatures, total sum as well as bundle order. @@ -12,7 +12,6 @@ Gets the associated bundle transactions of a single transaction. Does validation ## Output [GetBundleResponse](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/dto/response/GetBundleResponse.java), which contains the following fields: - | Return type | Description | |--|--| | Long duration | Gets the duration. | @@ -31,7 +30,7 @@ Gets the associated bundle transactions of a single transaction. Does validation IotaAPI iotaAPI = new IotaAPI.Builder().build(); try { - GetBundleResponse response = iotaAPI.getBundle("OBMROAQCOJMZPCNIGHUMLJDDYVKWRBWYBINHTKWVIKVDBUOEYOUMTNFJIVXCEZCYPVZK9YQMKRQATUTWW"); + GetBundleResponse response = iotaAPI.getBundle("BNLTEIU9SRVIPUE9IAYNXTN9YNZWTQAANOM9HABENT9MMBQYWPMXDJWGBTDXDCDZQC9JIQVDPHXSVSZYW"); } catch (ArgumentException e) { // Handle error e.printStackTrace(); diff --git a/docs/iota-java/getInputs.md b/docs/iota-java/getInputs.md index c1a78f7b..094b113b 100644 --- a/docs/iota-java/getInputs.md +++ b/docs/iota-java/getInputs.md @@ -1,5 +1,5 @@ -# [getInputs](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L690) +# [getInputs](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L692) [GetBalancesAndFormatResponse](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/dto/response/GetBalancesAndFormatResponse.java) getInputs(String seed , int security , int start , int end , long threshold , String[] tips) Gets the inputs of a seed If start, end and threshold are 0, checks everything until an address with nothing is found. Addresses are all with checksum appended @@ -17,7 +17,6 @@ Gets the inputs of a seed If start, end and threshold are 0, checks everything u ## Output [GetBalancesAndFormatResponse](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/dto/response/GetBalancesAndFormatResponse.java), which contains the following fields: - | Return type | Description | |--|--| | Long duration | Gets the duration. | @@ -34,7 +33,7 @@ Gets the inputs of a seed If start, end and threshold are 0, checks everything u ## Related APIs (link to other product documentation) | API | Description | |:---------------|:--------| -| [getBalanceAndFormat(List, List, long, int, StopWatch, int)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L811) | Gets the balances and formats the output. | +| [getBalanceAndFormat(List, List, long, int, StopWatch, int)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L813) | Gets the balances and formats the output. | ## Example @@ -42,7 +41,7 @@ Gets the inputs of a seed If start, end and threshold are 0, checks everything u IotaAPI iotaAPI = new IotaAPI.Builder().build(); try { - GetBalancesAndFormatResponse response = iotaAPI.getInputs("YOUR9SECRET9SEED9999999...", 3, 657, 715, 100, new String[]{"P9FIGJYGRQILJLVICUANYBZJIODPOSPDNAKOXGXZGNLCTUZMJXMSHZMQXFDJNB9XIOBDNROZPWCSZKDOP", "UYBDJMWUXCJJMLJXWHDUPFAIOIW9IYW9BBXISXIQWPRBEPBEGFRMGJUEXCS9QSDCIMCC9RLDQVETHL9IJ"}); + GetBalancesAndFormatResponse response = iotaAPI.getInputs("YOUR9SECRET9SEED9999999...", 3, 946, 608, 100, new String[]{"HVHKRBAGNHGINEHQN9GKXVHXXKVLINJSIAKVBJZLVATZXAEORPRHDZHTZNPBNKDGVOEDPA9ANZFPBHPIT", "ZMUG9ZYRNGICRIGIJQFNOM9BSP9BHBKUAOZOVP9PBAPIQRKDEITGHOWFY99AFZUFUAAILS9UJQHGIIISD"}); } catch (ArgumentException e) { // Handle error e.printStackTrace(); diff --git a/docs/iota-java/getLatestInclusion.md b/docs/iota-java/getLatestInclusion.md index 0b13aae1..e542296e 100644 --- a/docs/iota-java/getLatestInclusion.md +++ b/docs/iota-java/getLatestInclusion.md @@ -1,5 +1,5 @@ -# [getLatestInclusion](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L1073) +# [getLatestInclusion](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L1075) [GetInclusionStateResponse](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/dto/response/GetInclusionStateResponse.java) getLatestInclusion(String[] hashes) Wrapper function: runs getNodeInfo and getInclusionStates Uses the latest milestone as tip @@ -12,7 +12,6 @@ Wrapper function: runs getNodeInfo and getInclusionStates Uses the latest milest ## Output [GetInclusionStateResponse](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/dto/response/GetInclusionStateResponse.java), which contains the following fields: - | Return type | Description | |--|--| | Long duration | Gets the duration. | @@ -26,8 +25,8 @@ Wrapper function: runs getNodeInfo and getInclusionStates Uses the latest milest ## Related APIs (link to other product documentation) | API | Description | |:---------------|:--------| -| [getNodeInfo()](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L183) | Returns information about this node. | -| [getInclusionStates(String[], String[])](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L384) | Get the inclusion states of a set of transactions. This is for determining if a transaction was accepted and confirmed by the network or not. You can search for multiple tips (and thus, milestones) to get past inclusion states of transactions. +| [getNodeInfo()](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L184) | Returns information about this node. | +| [getInclusionStates(String[], String[])](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L395) | Get the inclusion states of a set of transactions. This is for determining if a transaction was accepted and confirmed by the network or not. You can search for multiple tips (and thus, milestones) to get past inclusion states of transactions. This API call returns a list of boolean values in the same order as the submitted transactions. Boolean values will be `true` for confirmed transactions, otherwise `false`. | @@ -37,7 +36,7 @@ Wrapper function: runs getNodeInfo and getInclusionStates Uses the latest milest IotaAPI iotaAPI = new IotaAPI.Builder().build(); try { - GetInclusionStateResponse response = iotaAPI.getLatestInclusion(new String[]{"NFJQS9XEJCWEYEMQHIPJKHJGIASPGVYTGNCCVEPVUVIVQSMXIHRZFBKFUNJFVSFMITOFDEJWIQDKCWNFA", "GRRTTPUSUEVLOJSVMZAONAMUSXBAMWIBUTTLAINOTUZYMSTFLRAJHVGINQMPYOHEDCOVSCDU9KZTRCNKB"}); + GetInclusionStateResponse response = iotaAPI.getLatestInclusion(new String[]{"YCEOHHTBCNAXZSJLTNVIAGUWRIPDSBGNOVAHWBOOIZZSVGIVCQLOP9PACVSHGKQLKSIXGFG9KFZHLU9E9", "RMHXEATVMZUYDEWAHHPLYZ9HLUWE9UKMWLH9GGWJBZNWG9DIOCIIEMKFS9SHWUAOEBU9WJHTRXFDKUIYX"}); } catch (ArgumentException e) { // Handle error e.printStackTrace(); diff --git a/docs/iota-java/getTransfers.md b/docs/iota-java/getTransfers.md index cba2f8fd..5eb17ee7 100644 --- a/docs/iota-java/getTransfers.md +++ b/docs/iota-java/getTransfers.md @@ -16,7 +16,6 @@ Finds all the bundles for all the addresses based on this seed and security. ## Output [GetTransferResponse](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/dto/response/GetTransferResponse.java), which contains the following fields: - | Return type | Description | |--|--| | Long duration | Gets the duration. | @@ -36,7 +35,7 @@ Finds all the bundles for all the addresses based on this seed and security. IotaAPI iotaAPI = new IotaAPI.Builder().build(); try { - GetTransferResponse response = iotaAPI.getTransfers("YOUR9SECRET9SEED9999999...", 3, 576, 928, true); + GetTransferResponse response = iotaAPI.getTransfers("YOUR9SECRET9SEED9999999...", 3, 978, 649, false); } catch (ArgumentException e) { // Handle error e.printStackTrace(); diff --git a/docs/iota-java/initiateTransfer.md b/docs/iota-java/initiateTransfer.md index 2a4cf9cc..41f398b4 100644 --- a/docs/iota-java/initiateTransfer.md +++ b/docs/iota-java/initiateTransfer.md @@ -1,5 +1,5 @@ -# [initiateTransfer](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L1273) +# [initiateTransfer](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L1275) List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java)> initiateTransfer(int securitySum , String inputAddress , String remainderAddress , List<[Transfer](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transfer.java)> transfers , List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java)> tips , boolean testMode) Prepares transfer by generating the bundle with the corresponding cosigner transactions. Does not contain signatures. @@ -17,7 +17,6 @@ Prepares transfer by generating the bundle with the corresponding cosigner trans ## Output List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java)>, which contains the following fields: - | Return type | Description | |--|--| | long attachmentTimestampLowerBound | | @@ -55,7 +54,7 @@ List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/ IotaAPI iotaAPI = new IotaAPI.Builder().build(); try { - List response = iotaAPI.initiateTransfer(272, "WPGX9BLUCWEJXEVLTGXLREOILSSRYGNJNXUUUHUWYXN9PAFAWJKYZFOUTHGABLEBBKEIKQAXYMYFC9LST", "HLCSQIVLQLIWYSAJNUPGILDCUUUPHMGSKEWSXECSP99RMWLU9UUIQPRTCWZHWVQPWAXZAZIMSQCHOHYOQ", new List(new Transfer[]{transfers, transfers}), new List(new Transaction[]{tips, tips}), false); + List response = iotaAPI.initiateTransfer(605, "WYOIEKLACFYTKZUXCNGPTCPJBLZOWGKPOFGJERGGDBIWYW9KWDFTRBNODIESPXYHNJGLCXDEZFLZEAKBR", "MMAZVWVLOFJAPZTSVOJSRSBXCDBIBZSVRUFMEO9BGSESAYFEHZUCUUEZQBFQLJNPJMXJEHMCEYRVMSSXF", new List(new Transfer[]{transfers, transfers}), new List(new Transaction[]{tips, tips}), true); } catch (ArgumentException e) { // Handle error e.printStackTrace(); diff --git a/docs/iota-java/isPromotable.md b/docs/iota-java/isPromotable.md index 2e07a491..8731d920 100644 --- a/docs/iota-java/isPromotable.md +++ b/docs/iota-java/isPromotable.md @@ -1,5 +1,5 @@ -# [isPromotable](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L1601) +# [isPromotable](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L1599) boolean isPromotable([Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java) tail) Checks if a transaction hash is promotable @@ -23,7 +23,7 @@ Checks if a transaction hash is promotable ## Related APIs (link to other product documentation) | API | Description | |:---------------|:--------| -| [checkConsistency(String...)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L555) | Checks the consistency of the subtangle formed by the provided tails. | +| [checkConsistency(String...)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L566) | Checks the consistency of the subtangle formed by the provided tails. | ## Example diff --git a/docs/iota-java/newDepositAddress.md b/docs/iota-java/newDepositAddress.md index b3ffbd28..af071068 100644 --- a/docs/iota-java/newDepositAddress.md +++ b/docs/iota-java/newDepositAddress.md @@ -15,7 +15,6 @@ Allocates a new CDA in the underlying store. Note: Specifying both multi-use and ## Output Future<[ConditionalDepositAddress](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/account/deposits/ConditionalDepositAddress.java)>, which contains the following fields: - | Return type | Description | |--|--| | [DepositRequest](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/account/deposits/DepositRequest.java) request | The information about this deposit | @@ -34,7 +33,7 @@ Future<[ConditionalDepositAddress](https://github.com/iotaledger/iota-java/blob/ IotaAPI iotaAPI = new IotaAPI.Builder().build(); IotaAccount account = new IotaAccount.Builder("MY9SEED9..").api(iotaAPI).build() try { - Future response = account.newDepositAddress(timeout, true, 491, new ExpireCondition[]{null, null}); + Future response = account.newDepositAddress(timeout, true, 322, new ExpireCondition[]{null, null}); } catch (AccountError e) { // Handle error e.printStackTrace(); diff --git a/docs/iota-java/prepareTransfers.md b/docs/iota-java/prepareTransfers.md index 763bf02c..a435def9 100644 --- a/docs/iota-java/prepareTransfers.md +++ b/docs/iota-java/prepareTransfers.md @@ -1,5 +1,5 @@ -# [prepareTransfers](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L484) +# [prepareTransfers](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L486) List prepareTransfers(String seed , int security , List<[Transfer](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transfer.java)> transfers , String remainder , List<[Input](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Input.java)> inputs , List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java)> tips , boolean validateInputs) Prepares transfer by generating bundle, finding and signing inputs. @@ -36,7 +36,7 @@ Prepares transfer by generating bundle, finding and signing inputs. IotaAPI iotaAPI = new IotaAPI.Builder().build(); try { - List response = iotaAPI.prepareTransfers("YOUR9SECRET9SEED9999999...", 3, new List(new Transfer[]{transfers, transfers}), "MFBOZVTQZLNUATPTH9VWMXAQESBVZLOZSIRJDPGVDOVQXKWBVFOOXJNSESJF9XDMEBSEJPFXQZ9VXO9TR", new List(new Input[]{inputs, inputs}), new List(new Transaction[]{tips, tips}), false); + List response = iotaAPI.prepareTransfers("YOUR9SECRET9SEED9999999...", 3, new List(new Transfer[]{transfers, transfers}), "RSWV9HB9BUCKYFWZHLNSFHHJFUFUKAJYCFLOCFSHEZPSNXGEEQBICUULCMRKFMIQFXXLNERR9PJDIBRVZ", new List(new Input[]{inputs, inputs}), new List(new Transaction[]{tips, tips}), true); } catch (ArgumentException e) { // Handle error e.printStackTrace(); diff --git a/docs/iota-java/promoteTransaction.md b/docs/iota-java/promoteTransaction.md index 2bc98b30..df568e3d 100644 --- a/docs/iota-java/promoteTransaction.md +++ b/docs/iota-java/promoteTransaction.md @@ -1,5 +1,5 @@ -# [promoteTransaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L1668) +# [promoteTransaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L1666) List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java)> promoteTransaction(String tail , int depth , int minWeightMagnitude , [Bundle](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Bundle.java) bundle) Attempts to promote a transaction using a provided bundle and, if successful, returns the promoting Transactions. This is done by creating another transaction which points to the tail. This will effectively double the chances of the transaction to be picked, and this approved. @@ -15,7 +15,6 @@ Attempts to promote a transaction using a provided bundle and, if successful, re ## Output List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java)>, which contains the following fields: - | Return type | Description | |--|--| | long attachmentTimestampLowerBound | | @@ -48,15 +47,15 @@ List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/ ## Related APIs (link to other product documentation) | API | Description | |:---------------|:--------| -| [checkConsistency(String...)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L555) | Checks the consistency of the subtangle formed by the provided tails. | -| [getTransactionsToApprove(Integer, String)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L433) | Tip selection which returns `trunkTransaction` and `branchTransaction`. The input value `depth` determines how many milestones to go back for finding the transactions to approve. The higher your `depth` value, the more work you have to do as you are confirming more transactions. If the `depth` is too large (usually above 15, it depends on the node's configuration) an error will be returned. The `reference` is an optional hash of a transaction you want to approve. If it can't be found at the specified `depth` then an error will be returned. | -| [attachToTangle(String, String, Integer, String...)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L599) | Prepares the specified transactions (trytes) for attachment to the Tangle by doing Proof of Work. You need to supply `branchTransaction` as well as `trunkTransaction`. These are the tips which you're going to validate and reference with this transaction. These are obtainable by the `getTransactionsToApprove` API call. +| [checkConsistency(String...)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L566) | Checks the consistency of the subtangle formed by the provided tails. | +| [getTransactionsToApprove(Integer, String)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L444) | Tip selection which returns `trunkTransaction` and `branchTransaction`. The input value `depth` determines how many milestones to go back for finding the transactions to approve. The higher your `depth` value, the more work you have to do as you are confirming more transactions. If the `depth` is too large (usually above 15, it depends on the node's configuration) an error will be returned. The `reference` is an optional hash of a transaction you want to approve. If it can't be found at the specified `depth` then an error will be returned. | +| [attachToTangle(String, String, Integer, String...)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L610) | Prepares the specified transactions (trytes) for attachment to the Tangle by doing Proof of Work. You need to supply `branchTransaction` as well as `trunkTransaction`. These are the tips which you're going to validate and reference with this transaction. These are obtainable by the `getTransactionsToApprove` API call. The returned value is a different set of tryte values which you can input into `broadcastTransactions` and `storeTransactions`. The last 243 trytes of the return value consist of the following: * `trunkTransaction` * `branchTransaction` * `nonce` These are valid trytes which are then accepted by the network. | -| [storeAndBroadcast(String...)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L311) | Wrapper method: stores and broadcasts the specified trytes. | +| [storeAndBroadcast(String...)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L313) | Wrapper method: stores and broadcasts the specified trytes. | ## Example @@ -64,7 +63,7 @@ List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/ IotaAPI iotaAPI = new IotaAPI.Builder().build(); try { - List response = iotaAPI.promoteTransaction("EELIGC9OMGOGXVNDVOA9D9GBVGPICDB9BXOZXQK9DDDPYQCSQEBTKIYTPKVHC9ZDUFHTFYUWGM9RKHIZL", 15, 18, bundle); + List response = iotaAPI.promoteTransaction("K99QBCOVQNFWGEUEMAEJRQMBXNIJYLZJTMNSSYUPHZQFSOUHYDXLWCFIASKAKGSPNMBF9OOLBPJBJUYJ9", 15, 18, bundle); } catch (ArgumentException e) { // Handle error e.printStackTrace(); diff --git a/docs/iota-java/replayBundle.md b/docs/iota-java/replayBundle.md index ad8bb676..c74ca812 100644 --- a/docs/iota-java/replayBundle.md +++ b/docs/iota-java/replayBundle.md @@ -1,5 +1,5 @@ -# [replayBundle](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L985) +# [replayBundle](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L987) [ReplayBundleResponse](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/dto/response/ReplayBundleResponse.java) replayBundle(String tailTransactionHash , int depth , int minWeightMagnitude , String reference) Replays a transfer by doing Proof of Work again. This will make a new, but identical transaction which now also can be approved. If any of the replayed transactions gets approved, the others stop getting approved. @@ -15,7 +15,6 @@ Replays a transfer by doing Proof of Work again. This will make a new, but ident ## Output [ReplayBundleResponse](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/dto/response/ReplayBundleResponse.java), which contains the following fields: - | Return type | Description | |--|--| | Long duration | Gets the duration. | @@ -31,7 +30,7 @@ Replays a transfer by doing Proof of Work again. This will make a new, but ident ## Related APIs (link to other product documentation) | API | Description | |:---------------|:--------| -| [sendTrytes(String[], int, int, String)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L341) | Wrapper method: Gets transactions to approve, attaches to Tangle, broadcasts and stores. | +| [sendTrytes(String[], int, int, String)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L343) | Wrapper method: Gets transactions to approve, attaches to Tangle, broadcasts and stores. | ## Example @@ -39,7 +38,7 @@ Replays a transfer by doing Proof of Work again. This will make a new, but ident IotaAPI iotaAPI = new IotaAPI.Builder().build(); try { - ReplayBundleResponse response = iotaAPI.replayBundle("YFENZOSJNJNIYMHZKOIDHQXV9EPHCWSBLSNYJGPALZP9TTIEN9XJBDJMPREXI9NHGNXE9FTISHLOSXMHC", 15, 18, "BRBTTVNVOMFVINOGFKZENREFYKVLJXJVKNA9SSD9JRWBEIRPTZGJIQHSZELP9XANLFXKURHLWHSJFH9JW"); + ReplayBundleResponse response = iotaAPI.replayBundle("ZIWGSWCVJT9OTB9QXOVXFPNWI9AZJZQYH9QRSSFIPJYFV9JPQJWZNJICVRSFBORDCQQZNHLFAN9CLPIWJ", 15, 18, "XBHOCYL9W9NC9UVVLONGMUMOK9W9MHCJTKTDZSTBDYOYFPEWQTWEWRJFKJL9TORSRABFEJFLGPUYXRUYQ"); } catch (ArgumentException e) { // Handle error e.printStackTrace(); diff --git a/docs/iota-java/send(address, amount, message, tag).md b/docs/iota-java/send(address, amount, message, tag).md index 550e9731..1c9712bb 100644 --- a/docs/iota-java/send(address, amount, message, tag).md +++ b/docs/iota-java/send(address, amount, message, tag).md @@ -26,7 +26,7 @@ Sends a transfer using the accounts balance to the provided address. You must ca IotaAPI iotaAPI = new IotaAPI.Builder().build(); try { - Future response = iotaAPI.send("LJELQPYCMMIDBPQCFR9RDDBHEYZFHFYYXL9RQENKUUEPBOKLJEYVSQG9KWPMQBWIQSSJVKNTOXKCVXZMU", 793, Optional.of("HGWUAVVFVHWUJMNTPZCCLWFLLEBTVJFJYTBSRCHBCIDPTWGOLFVDGXDPKDZRVPLUMBQWUATRPKDS9UOFR", Optional.of("TAG9WCZKCNJA9JIRPUPDY9WXS9X"); + Future response = iotaAPI.send("EALDRNFRTERQMMWITNYJMDYSDTZJNQQY9BCXPGTQRPFQQVCARJXNQJBTUIHTKUZBEPIBL9AFAQAYNW99M", 314, Optional.of("YGRNPKXFERT9UTJFVWHPSJVHV9QTZFTNFURPLDFTRZGXTUNULLTFUZJ9JEBBBQVBLJZYPEUEACWYVGDJU", Optional.of("TAG9EQXHVTYYYUZATUPFAXMSVHC"); } catch (ArgumentException e) { // Handle error e.printStackTrace(); diff --git a/docs/iota-java/send.md b/docs/iota-java/send.md index 9547ef25..eaeee393 100644 --- a/docs/iota-java/send.md +++ b/docs/iota-java/send.md @@ -23,7 +23,7 @@ Sends the specified amounts to the given recipient. IotaAPI iotaAPI = new IotaAPI.Builder().build(); IotaAccount account = new IotaAccount.Builder("MY9SEED9..").api(iotaAPI).build() try { - Future response = account.send(new Recipient(257, "hi", "TAG", OOPIXBREIZGCFQSCQCGHEYHETHXFOMZALVLNPNSQJQSLLEZTR9SEVKPLQ9HZPKWASSWAWWA9DPXBEHRYP)); + Future response = account.send(new Recipient(264, "hi", "TAG", KPSDRZBWBYESGZQQVQWZYLVXVY9QRINZSM9JU9KQQYFYJJUNENX9VWMTFA9HOJOWHYTBPVRZZJ99HCLPM)); } catch (AccountError e) { // Handle error e.printStackTrace(); diff --git a/docs/iota-java/sendTransfer.md b/docs/iota-java/sendTransfer.md index 598819b1..cd8b9520 100644 --- a/docs/iota-java/sendTransfer.md +++ b/docs/iota-java/sendTransfer.md @@ -1,5 +1,5 @@ -# [sendTransfer](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L1109) +# [sendTransfer](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L1111) [SendTransferResponse](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/dto/response/SendTransferResponse.java) sendTransfer(String seed , int security , int depth , int minWeightMagnitude , List<[Transfer](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transfer.java)> transfers , List<[Input](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Input.java)> inputs , String remainderAddress , boolean validateInputs , boolean validateInputAddresses , List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java)> tips) Wrapper function: Runs prepareTransfers, as well as attachToTangle. We then broadcasts this and and store the transactions on the node. @@ -17,11 +17,10 @@ Wrapper function: Runs prepareTransfers, as well as attachToTangle. We then broa | remainderAddress | String | Required | If defined, this remainderAddress will be used for sending the remainder value (of the inputs) to. When this is not defined, but a remaining exists, the next free address is used. | | validateInputs | boolean | Required | Whether or not to validate the balances of the provided inputs. | | validateInputAddresses | boolean | Required | Whether or not to validate if the destination address is already use. If a key reuse is detect or it's send to inputs. | -| tips | List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java)> | Required | The starting points we walk back from to find the balance of the addresses If multiple tips are supplied, only the first tip is used for [getTransactionsToApprove(Integer, String)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L433) | +| tips | List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java)> | Required | The starting points we walk back from to find the balance of the addresses If multiple tips are supplied, only the first tip is used for [getTransactionsToApprove(Integer, String)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L444) | ## Output [SendTransferResponse](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/dto/response/SendTransferResponse.java), which contains the following fields: - | Return type | Description | |--|--| | Long duration | Gets the duration. | @@ -40,9 +39,9 @@ Wrapper function: Runs prepareTransfers, as well as attachToTangle. We then broa ## Related APIs (link to other product documentation) | API | Description | |:---------------|:--------| -| [prepareTransfers(String, int, List, String, List, List, boolean)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L484) | Prepares transfer by generating bundle, finding and signing inputs. | -| [sendTrytes(String[], int, int, String)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L341) | Wrapper method: Gets transactions to approve, attaches to Tangle, broadcasts and stores. | -| [validateTransfersAddresses(String, int, List)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L1455) | Validates the supplied transactions with seed and security. This will check for correct input/output and key reuse +| [prepareTransfers(String, int, List, String, List, List, boolean)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L486) | Prepares transfer by generating bundle, finding and signing inputs. | +| [sendTrytes(String[], int, int, String)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L343) | Wrapper method: Gets transactions to approve, attaches to Tangle, broadcasts and stores. | +| [validateTransfersAddresses(String, int, List)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L1453) | Validates the supplied transactions with seed and security. This will check for correct input/output and key reuse In order to do this we will generate all addresses for this seed which are currently in use. Address checksums will be regenerated and these addresses will be looked up, making this an expensive method call. If no error is thrown, the transaction trytes are using correct addresses. This will not validate transaction fields. | @@ -52,7 +51,7 @@ Wrapper function: Runs prepareTransfers, as well as attachToTangle. We then broa IotaAPI iotaAPI = new IotaAPI.Builder().build(); try { - SendTransferResponse response = iotaAPI.sendTransfer("YOUR9SECRET9SEED9999999...", 3, 15, 18, new List(new Transfer[]{transfers, transfers}), new List(new Input[]{inputs, inputs}), "HUFXOTMRAISYFPAIYTBE9QDZIUURWCQLOOASYZWD9SKSKJIQNWDKOSWMJWQAIIUGRYIAVZAIFNYWJYGKS", true, 9LOBIDVNZUQESJVBWEQAYFEPPHTXBXKQCKMNMTYGMS9AMVMIDSNG9VCPPXJVQIFHRQFUHYKCFSNHDMSFD, new List(new Transaction[]{tips, tips})); + SendTransferResponse response = iotaAPI.sendTransfer("YOUR9SECRET9SEED9999999...", 3, 15, 18, new List(new Transfer[]{transfers, transfers}), new List(new Input[]{inputs, inputs}), "XKEECQCBCEQQTLKHRJLXWUQM9QJATLTFEUZSVR9M9VHK9IDWRJIKTRCGKUAHXCENLQMJTCCEUCSDCZIEX", true, IFSGYTOOQRZCWNGTNAWZQSNLFUYGMSU9XHV9PINWJCSNXZDFRCXTACCENCHKRFMVOFYAMHUFBYKDFCIBC, new List(new Transaction[]{tips, tips})); } catch (ArgumentException e) { // Handle error e.printStackTrace(); diff --git a/docs/iota-java/sendTrytes.md b/docs/iota-java/sendTrytes.md index 37438d56..110ab966 100644 --- a/docs/iota-java/sendTrytes.md +++ b/docs/iota-java/sendTrytes.md @@ -1,5 +1,5 @@ -# [sendTrytes](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L341) +# [sendTrytes](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L343) List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java)> sendTrytes(String[] trytes , int depth , int minWeightMagnitude , String reference) Wrapper method: Gets transactions to approve, attaches to Tangle, broadcasts and stores. @@ -15,7 +15,6 @@ Wrapper method: Gets transactions to approve, attaches to Tangle, broadcasts and ## Output List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java)>, which contains the following fields: - | Return type | Description | |--|--| | long attachmentTimestampLowerBound | | @@ -45,14 +44,14 @@ List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/ ## Related APIs (link to other product documentation) | API | Description | |:---------------|:--------| -| [broadcastTransactions(String...)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L723) | Broadcast a list of transactions to all neighbors. The trytes to be used for this call should be valid, attached transaction trytes. These trytes are returned by `attachToTangle`, or by doing proof of work somewhere else. | -| [attachToTangle(String, String, Integer, String...)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L599) | Prepares the specified transactions (trytes) for attachment to the Tangle by doing Proof of Work. You need to supply `branchTransaction` as well as `trunkTransaction`. These are the tips which you're going to validate and reference with this transaction. These are obtainable by the `getTransactionsToApprove` API call. +| [broadcastTransactions(String...)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L734) | Broadcast a list of transactions to all neighbors. The trytes to be used for this call should be valid, attached transaction trytes. These trytes are returned by `attachToTangle`, or by doing proof of work somewhere else. | +| [attachToTangle(String, String, Integer, String...)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L610) | Prepares the specified transactions (trytes) for attachment to the Tangle by doing Proof of Work. You need to supply `branchTransaction` as well as `trunkTransaction`. These are the tips which you're going to validate and reference with this transaction. These are obtainable by the `getTransactionsToApprove` API call. The returned value is a different set of tryte values which you can input into `broadcastTransactions` and `storeTransactions`. The last 243 trytes of the return value consist of the following: * `trunkTransaction` * `branchTransaction` * `nonce` These are valid trytes which are then accepted by the network. | -| [storeAndBroadcast(String...)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L311) | Wrapper method: stores and broadcasts the specified trytes. | +| [storeAndBroadcast(String...)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L313) | Wrapper method: stores and broadcasts the specified trytes. | ## Example @@ -60,7 +59,7 @@ List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/ IotaAPI iotaAPI = new IotaAPI.Builder().build(); try { - List response = iotaAPI.sendTrytes(new String[]{"KHBAKNKVUQYRBTUXKMOZ9ZOXU ... UTVBLAGC9KWSGIJAWLQERGMUW", "YWDXHAAOVNHHOH9EGNQA9OMUT ... NYACHEEEZCAWHCD9CQZZKXJZS"}, 15, 18, "SPLXLNCQUEEATUPIJ9GTNNJTIHSEGEMWLXSY9ZLAXODMCEYVYLDVZOTXMDPVDBTTUFYQMRAR9FOFWZOSL"); + List response = iotaAPI.sendTrytes(new String[]{"GCPCSDBVLIXLMTXECRYYLRTXP ... FQBSZXGFWWETBSSDLSHXLYRRK", "TRRUNNCRBAKEBCMGYRWOE9SPR ... TVLXUAVJAKMBPLMXE9VZREHEC"}, 15, 18, "XIIM9RIRSWOGUKBEOXJWOGKJEUYMQAQPTOWIXDVHNBGWQPH9PICWCZJVKWRUAKNUZLUATVGKSLVDRNIOS"); } catch (ArgumentException e) { // Handle error e.printStackTrace(); diff --git a/docs/iota-java/storeAndBroadcast.md b/docs/iota-java/storeAndBroadcast.md index 6b4703bf..89392aed 100644 --- a/docs/iota-java/storeAndBroadcast.md +++ b/docs/iota-java/storeAndBroadcast.md @@ -1,5 +1,5 @@ -# [storeAndBroadcast](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L311) +# [storeAndBroadcast](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L313) [BroadcastTransactionsResponse](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/dto/response/BroadcastTransactionsResponse.java) storeAndBroadcast(String[] trytes) Wrapper method: stores and broadcasts the specified trytes. @@ -24,8 +24,8 @@ Wrapper method: stores and broadcasts the specified trytes. ## Related APIs (link to other product documentation) | API | Description | |:---------------|:--------| -| [storeTransactions(String...)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L740) | Stores transactions in the local storage. The trytes to be used for this call should be valid, attached transaction trytes. These trytes are returned by `attachToTangle`, or by doing proof of work somewhere else. | -| [broadcastTransactions(String...)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L723) | Broadcast a list of transactions to all neighbors. The trytes to be used for this call should be valid, attached transaction trytes. These trytes are returned by `attachToTangle`, or by doing proof of work somewhere else. | +| [storeTransactions(String...)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L751) | Stores transactions in the local storage. The trytes to be used for this call should be valid, attached transaction trytes. These trytes are returned by `attachToTangle`, or by doing proof of work somewhere else. | +| [broadcastTransactions(String...)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L734) | Broadcast a list of transactions to all neighbors. The trytes to be used for this call should be valid, attached transaction trytes. These trytes are returned by `attachToTangle`, or by doing proof of work somewhere else. | ## Example @@ -33,7 +33,7 @@ Wrapper method: stores and broadcasts the specified trytes. IotaAPI iotaAPI = new IotaAPI.Builder().build(); try { - BroadcastTransactionsResponse response = iotaAPI.storeAndBroadcast(new String[]{"B9TITZVUJIUKHFSCZTVDBCJRO ... N9MPUYIYWHHI99GVPCS9IOTKK", "XUTHPELTJB9DSPTNNBOYOMZQF ... VBVPVIXICSWQLJISBMTJEYWWB"}); + BroadcastTransactionsResponse response = iotaAPI.storeAndBroadcast(new String[]{"RK9KALXATTO9IVRWYPMZR9TSQ ... NFQ9MMBVFCULXBSYXYZMYCNMI", "TDBZTXFEVXHTDELKXKN9KEUFS ... AMDWEVETDECBXBSPJAXMJMFCE"}); } catch (ArgumentException e) { // Handle error e.printStackTrace(); diff --git a/docs/iota-java/traverseBundle.md b/docs/iota-java/traverseBundle.md index abb7fc13..8041e9eb 100644 --- a/docs/iota-java/traverseBundle.md +++ b/docs/iota-java/traverseBundle.md @@ -1,5 +1,5 @@ -# [traverseBundle](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L1149) +# [traverseBundle](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L1151) [Bundle](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Bundle.java) traverseBundle(String trunkTx , String bundleHash , [Bundle](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Bundle.java) bundle) Traverses the Bundle by going down the trunkTransactions until the bundle hash of the transaction changes. In case the input transaction hash is not a tail, we return an error. @@ -31,7 +31,7 @@ Traverses the Bundle by going down the trunkTransactions until the bundle hash o IotaAPI iotaAPI = new IotaAPI.Builder().build(); try { - Bundle response = iotaAPI.traverseBundle("EYNEUPN9LBCPURHKHXUEETYSDKNXUUWB9LUZFEU9ZLBBGL9Q9TNG9FYFHYVZM9LT9RMRZTMCKSZJYEIBX", "ATFTUXGOXESQMPPUOQFURSSUWOLQEVBRNQCXQBBGYWOLIXOFZWJARWZJSXRVVQGNWUGXDYPUQ9GOHXT9U", bundle); + Bundle response = iotaAPI.traverseBundle("PJHHCJCVKJRJIJXFNBCVOLITWEIYXRFLDOGYOALCXARJAHBHXIWTC9JRJDMV9GGOJKE9VLBRWV9GGUVCV", "GA9HIPJXDA9XNXWQBEEYWYSKNYVIGIDHXDSWQUIW9QY9ANNLLHBZGTPVKGIXKBXHXVLXKYCKTLNNVOUFE", bundle); } catch (ArgumentException e) { // Handle error e.printStackTrace(); diff --git a/docs/iota-java/validateTransfersAddresses.md b/docs/iota-java/validateTransfersAddresses.md index a6a73815..07acb38f 100644 --- a/docs/iota-java/validateTransfersAddresses.md +++ b/docs/iota-java/validateTransfersAddresses.md @@ -1,5 +1,5 @@ -# [validateTransfersAddresses](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L1455) +# [validateTransfersAddresses](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L1453) void validateTransfersAddresses(String seed , int security , List trytes) Validates the supplied transactions with seed and security. This will check for correct input/output and key reuse @@ -32,7 +32,7 @@ IotaAPI iotaAPI = new IotaAPI.Builder().build(); try { - iotaAPI.validateTransfersAddresses("YOUR9SECRET9SEED9999999...", 3, new List(new String[]{"KGLWWPR9MHFREICQFUHIXCDLZ ... FAWKSGCDTVLXVUNBZUH9CTALY", "UMTQBVHXUSDZRWG9PXFXVDWZG ... ROSBBTESUBUVXGSFOCPBNDEQB"})); + iotaAPI.validateTransfersAddresses("YOUR9SECRET9SEED9999999...", 3, new List(new String[]{"SVGXZDOJAMLWHTKOISD9THZMG ... P9EFIVJUGYPUUAJITJHSMPM9A", "QCFTIYSFROZXIW9ITTMTOZFUR ... HCADCWOVYOUFYBAJGARMRQOFV"})); } catch (ArgumentException e) { // Handle error e.printStackTrace(); diff --git a/jota/pom.xml b/jota/pom.xml index 0a1947f3..f5361a2d 100644 --- a/jota/pom.xml +++ b/jota/pom.xml @@ -5,7 +5,7 @@ org.iota jota-parent - 1.0.0-beta7 + 1.0.0-beta8 JOTA : Library diff --git a/jota/src/main/java/org/iota/jota/IotaAPI.java b/jota/src/main/java/org/iota/jota/IotaAPI.java index c97878c4..7a4a243a 100644 --- a/jota/src/main/java/org/iota/jota/IotaAPI.java +++ b/jota/src/main/java/org/iota/jota/IotaAPI.java @@ -282,7 +282,9 @@ public Bundle[] bundlesFromAddresses(Boolean inclusionStates, String... addresse } // If error returned from getBundle, simply ignore it because the bundle was most likely incorrect } catch (ArgumentException e) { - log.warn(Constants.GET_BUNDLE_RESPONSE_ERROR); + if (!Thread.interrupted()) { + log.warn(Constants.GET_BUNDLE_RESPONSE_ERROR); + } } }); } catch (InterruptedException e) { @@ -519,9 +521,6 @@ public List prepareTransfers(String seed, int security, // and prepare the signatureFragments, message and tag for (final Transfer transfer : transfers) { - // remove the checksum of the address - transfer.setAddress(Checksum.removeChecksum(transfer.getAddress())); - int signatureMessageLength = 1; // If message longer than 2187 trytes, increase signatureMessageLength (add 2nd transaction) @@ -566,7 +565,10 @@ public List prepareTransfers(String seed, int security, long timestamp = (long) Math.floor(Calendar.getInstance().getTimeInMillis() / 1000); // Add first entry to the bundle - bundle.addEntry(signatureMessageLength, transfer.getAddress(), transfer.getValue(), tag, timestamp); + bundle.addEntry(signatureMessageLength, + Checksum.removeChecksum(transfer.getAddress()), + transfer.getValue(), + tag, timestamp); // Sum up total value totalValue += transfer.getValue(); } @@ -1303,10 +1305,6 @@ public List initiateTransfer(int securitySum, String inputAddress, // Iterate over all transfers, get totalValue // and prepare the signatureFragments, message and tag for (final Transfer transfer : transfers) { - - // remove the checksum of the address - transfer.setAddress(Checksum.removeChecksum(transfer.getAddress())); - int signatureMessageLength = 1; // If message longer than 2187 trytes, increase signatureMessageLength (add next transaction) @@ -1354,7 +1352,7 @@ public List initiateTransfer(int securitySum, String inputAddress, long timestamp = (long) Math.floor(Calendar.getInstance().getTimeInMillis() / 1000); // Add first entry to the bundle - bundle.addEntry(signatureMessageLength, transfer.getAddress(), transfer.getValue(), tag, timestamp); + bundle.addEntry(signatureMessageLength, Checksum.removeChecksum(transfer.getAddress()), transfer.getValue(), tag, timestamp); // Sum up total value totalValue += transfer.getValue(); } diff --git a/jota/src/main/java/org/iota/jota/IotaAPICommand.java b/jota/src/main/java/org/iota/jota/IotaAPICommand.java index cf7658a4..99668ea9 100644 --- a/jota/src/main/java/org/iota/jota/IotaAPICommand.java +++ b/jota/src/main/java/org/iota/jota/IotaAPICommand.java @@ -7,6 +7,7 @@ public enum IotaAPICommand { GET_NODE_INFO("getNodeInfo"), + GET_NODE_API_CONFIGURATION("getNodeAPIConfiguration"), GET_NEIGHBORS("getNeighbors"), ADD_NEIGHBORS("addNeighbors"), REMOVE_NEIGHBORS("removeNeighbors"), diff --git a/jota/src/main/java/org/iota/jota/IotaAPICore.java b/jota/src/main/java/org/iota/jota/IotaAPICore.java index 743a338f..e89800bd 100644 --- a/jota/src/main/java/org/iota/jota/IotaAPICore.java +++ b/jota/src/main/java/org/iota/jota/IotaAPICore.java @@ -38,6 +38,7 @@ import org.iota.jota.dto.response.GetBalancesResponse; import org.iota.jota.dto.response.GetInclusionStateResponse; import org.iota.jota.dto.response.GetNeighborsResponse; +import org.iota.jota.dto.response.GetNodeAPIConfigurationResponse; import org.iota.jota.dto.response.GetNodeInfoResponse; import org.iota.jota.dto.response.GetTipsResponse; import org.iota.jota.dto.response.GetTransactionsToApproveResponse; @@ -183,6 +184,16 @@ private Connection getNodeFor(IotaAPICommand cmd){ public GetNodeInfoResponse getNodeInfo() throws ArgumentException { return getNodeFor(IotaAPICommand.GET_NODE_INFO).getNodeInfo(IotaCommandRequest.createNodeInfoRequest()); } + + /** + * Returns information about this node. + * + * @return {@link GetNodeInfoResponse} + * @throws ArgumentException The request was considered wrong in any way by the node + */ + public GetNodeAPIConfigurationResponse getNodeAPIConfiguration() throws ArgumentException { + return getNodeFor(IotaAPICommand.GET_NODE_API_CONFIGURATION).getNodeAPIConfiguration(IotaCommandRequest.createGetNodeAPIConfiguration()); + } /** * Returns the set of neighbors you are connected with, as well as their activity statistics (or counters). @@ -721,7 +732,7 @@ public InterruptAttachingToTangleResponse interruptAttachingToTangle() throws Ar * @throws ArgumentException when the provided transaction trytes are invalid */ public BroadcastTransactionsResponse broadcastTransactions(String... trytes) throws ArgumentException { - if (!InputValidator.isArrayOfRawTransactionTrytes(trytes)) { + if (!InputValidator.isArrayOfAttachedTrytes(trytes)) { throw new ArgumentException(INVALID_ATTACHED_TRYTES_INPUT_ERROR); } @@ -738,7 +749,7 @@ public BroadcastTransactionsResponse broadcastTransactions(String... trytes) thr * @throws ArgumentException when the provided transaction trytes are invalid */ public StoreTransactionsResponse storeTransactions(String... trytes) throws ArgumentException { - if (!InputValidator.isArrayOfRawTransactionTrytes(trytes)) { + if (!InputValidator.isArrayOfAttachedTrytes(trytes)) { throw new ArgumentException(INVALID_ATTACHED_TRYTES_INPUT_ERROR); } diff --git a/jota/src/main/java/org/iota/jota/IotaAccount.java b/jota/src/main/java/org/iota/jota/IotaAccount.java index e4490a0b..175e3605 100644 --- a/jota/src/main/java/org/iota/jota/IotaAccount.java +++ b/jota/src/main/java/org/iota/jota/IotaAccount.java @@ -754,7 +754,7 @@ private List sendTrytes(Hash reference, String... trytes) { try { getApi().storeAndBroadcast(res.getTrytes()); } catch (ArgumentException e) { - return new ArrayList<>(); + throw new AccountError(e); } final List trx = new ArrayList<>(); diff --git a/jota/src/main/java/org/iota/jota/account/ExportedAccountState.java b/jota/src/main/java/org/iota/jota/account/ExportedAccountState.java index 6e9be467..c021ea59 100644 --- a/jota/src/main/java/org/iota/jota/account/ExportedAccountState.java +++ b/jota/src/main/java/org/iota/jota/account/ExportedAccountState.java @@ -9,6 +9,10 @@ public class ExportedAccountState { private String id; private AccountState state; + + public ExportedAccountState() { + + } public ExportedAccountState(Date exportedDate, String id, AccountState state) { this.exportedDate = exportedDate; @@ -27,4 +31,9 @@ public String getId() { public AccountState getState() { return state; } + + @Override + public String toString() { + return "ExportedAccountState [exportedDate=" + exportedDate + ", id=" + id + ", state=" + state + "]"; + } } diff --git a/jota/src/main/java/org/iota/jota/account/deposits/methods/MagnetMethod.java b/jota/src/main/java/org/iota/jota/account/deposits/methods/MagnetMethod.java index 361b160f..004cee42 100644 --- a/jota/src/main/java/org/iota/jota/account/deposits/methods/MagnetMethod.java +++ b/jota/src/main/java/org/iota/jota/account/deposits/methods/MagnetMethod.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; +import org.apache.commons.lang3.BooleanUtils; import org.iota.jota.account.deposits.ConditionalDepositAddress; import org.iota.jota.account.deposits.DepositRequest; import org.iota.jota.account.errors.MagnetError; @@ -36,7 +37,7 @@ public class MagnetMethod implements DepositMethod { + CONDITION_AMOUNT + "=%d"; public MagnetMethod() { - this.curl = SpongeFactory.create(SpongeFactory.Mode.KERL); + this.curl = SpongeFactory.create(SpongeFactory.Mode.CURL_P81); } public void setCurl(ICurl curl) { @@ -67,7 +68,7 @@ private ConditionalDepositAddress parse(URI uri) throws MagnetError { Map> paramsMap = collectParams(uri); long timeOut = parseLong(getParam(CONDITION_EXPIRES, paramsMap, "0")); - boolean multiUse = Boolean.getBoolean(getParam(CONDITION_MULTI_USE, paramsMap, "false")); + boolean multiUse = parseBoolean(getParam(CONDITION_MULTI_USE, paramsMap, "false")); long expectedAmount = parseLong(getParam(CONDITION_AMOUNT, paramsMap, "0")); if (!magnetChecksum(address.substring(0, 81), timeOut, multiUse, expectedAmount) @@ -83,6 +84,10 @@ private ConditionalDepositAddress parse(URI uri) throws MagnetError { return conditions; } + private boolean parseBoolean(String param) { + return BooleanUtils.toBoolean(param) || param.equals("1"); + } + private long parseLong(String param) { try { return Long.parseLong(param); @@ -161,9 +166,9 @@ String magnetChecksum(String address, long timeout, boolean multiUse, long amoun System.arraycopy(addressTrits, 0, totalTrits, 0, addressRest); //Add fields to trits input - System.arraycopy(timeoutTrits, 0, totalTrits, addressRest + 27 - timeoutTrits.length, timeoutTrits.length); + System.arraycopy(timeoutTrits, 0, totalTrits, addressRest, timeoutTrits.length); totalTrits[addressRest + 27] = multiUse ? 1 : 0; - System.arraycopy(amountTrits, 0, totalTrits, addressRest + 27 + 1 + 81 - amountTrits.length, amountTrits.length); + System.arraycopy(amountTrits, 0, totalTrits, addressRest + 27 + 1, amountTrits.length); //Make checksum trits int[] checksumTrits = calculateChecksum(totalTrits); diff --git a/jota/src/main/java/org/iota/jota/account/event/events/EventReceivedMessage.java b/jota/src/main/java/org/iota/jota/account/event/events/EventReceivedMessage.java index 3e717049..185ae9b6 100644 --- a/jota/src/main/java/org/iota/jota/account/event/events/EventReceivedMessage.java +++ b/jota/src/main/java/org/iota/jota/account/event/events/EventReceivedMessage.java @@ -1,11 +1,7 @@ package org.iota.jota.account.event.events; -import java.util.List; - import org.iota.jota.account.event.AccountEventType; import org.iota.jota.model.Bundle; -import org.iota.jota.model.Transaction; -import org.iota.jota.utils.TrytesConverter; public class EventReceivedMessage extends EventAbstractBundle { @@ -20,14 +16,6 @@ public String getMessage() { return message; } - StringBuilder str = new StringBuilder(); - - List bundles = getBundle().getTransactions(); - for (Transaction t : bundles) { - if (t.getValue() == 0) { - str.append(t.getSignatureFragments()); - } - } - return message = TrytesConverter.trytesToAscii(str.toString()); + return message = getBundle().getMessage(); } } diff --git a/jota/src/main/java/org/iota/jota/account/plugins/transferchecker/IncomingTransferCheckerImpl.java b/jota/src/main/java/org/iota/jota/account/plugins/transferchecker/IncomingTransferCheckerImpl.java index d5e42e70..81209d16 100644 --- a/jota/src/main/java/org/iota/jota/account/plugins/transferchecker/IncomingTransferCheckerImpl.java +++ b/jota/src/main/java/org/iota/jota/account/plugins/transferchecker/IncomingTransferCheckerImpl.java @@ -1,5 +1,10 @@ package org.iota.jota.account.plugins.transferchecker; +import java.util.Map.Entry; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + import org.iota.jota.IotaAPI; import org.iota.jota.account.AccountBalanceCache; import org.iota.jota.account.AccountStateManager; @@ -17,11 +22,6 @@ import org.iota.jota.types.Address; import org.iota.jota.utils.thread.UnboundScheduledExecutorService; -import java.util.Map.Entry; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; - public class IncomingTransferCheckerImpl extends TransferCheckerImpl implements IncomingTransferChecker { private static final long CHECK_INCOMING_DELAY = 10000; @@ -70,7 +70,6 @@ public boolean start() { continue; } Address address = addressGen.get(entry.getKey()); - addUnconfirmedBundle(address); } diff --git a/jota/src/main/java/org/iota/jota/account/plugins/transferchecker/IncomingTransferCheckerTask.java b/jota/src/main/java/org/iota/jota/account/plugins/transferchecker/IncomingTransferCheckerTask.java index 4b2d6d10..176ec533 100644 --- a/jota/src/main/java/org/iota/jota/account/plugins/transferchecker/IncomingTransferCheckerTask.java +++ b/jota/src/main/java/org/iota/jota/account/plugins/transferchecker/IncomingTransferCheckerTask.java @@ -1,5 +1,8 @@ package org.iota.jota.account.plugins.transferchecker; +import java.util.ArrayList; +import java.util.List; + import org.iota.jota.IotaAPI; import org.iota.jota.account.AccountStateManager; import org.iota.jota.account.event.Event; @@ -14,9 +17,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.ArrayList; -import java.util.List; - public class IncomingTransferCheckerTask implements Runnable { private static final Logger log = LoggerFactory.getLogger(IncomingTransferCheckerTask.class); @@ -112,8 +112,11 @@ public void run() { skipFirst = false; } catch (Exception e) { - // Thread got interrupted or http call closed, could be a problem so we log - log.warn(e.getMessage()); + // http call closed?, could be a problem so we log, could also be a timeout + if (!Thread.interrupted()) { + System.out.println("EHUGFSIF"); + log.warn(e.getMessage(), e); + } } } diff --git a/jota/src/main/java/org/iota/jota/builder/AccountBuilder.java b/jota/src/main/java/org/iota/jota/builder/AccountBuilder.java index e565db74..07c7bc26 100644 --- a/jota/src/main/java/org/iota/jota/builder/AccountBuilder.java +++ b/jota/src/main/java/org/iota/jota/builder/AccountBuilder.java @@ -1,5 +1,8 @@ package org.iota.jota.builder; +import java.util.ArrayList; +import java.util.List; + import org.iota.jota.IotaAPI; import org.iota.jota.IotaAccount; import org.iota.jota.account.AccountOptions; @@ -19,9 +22,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.ArrayList; -import java.util.List; - /** * * Builder for the account module. diff --git a/jota/src/main/java/org/iota/jota/connection/HttpConnector.java b/jota/src/main/java/org/iota/jota/connection/HttpConnector.java index f652ef20..ed8503c0 100644 --- a/jota/src/main/java/org/iota/jota/connection/HttpConnector.java +++ b/jota/src/main/java/org/iota/jota/connection/HttpConnector.java @@ -1,6 +1,7 @@ package org.iota.jota.connection; import java.io.IOException; +import java.io.InterruptedIOException; import java.net.MalformedURLException; import java.net.URL; import java.util.Objects; @@ -28,6 +29,7 @@ import org.iota.jota.dto.response.GetBalancesResponse; import org.iota.jota.dto.response.GetInclusionStateResponse; import org.iota.jota.dto.response.GetNeighborsResponse; +import org.iota.jota.dto.response.GetNodeAPIConfigurationResponse; import org.iota.jota.dto.response.GetNodeInfoResponse; import org.iota.jota.dto.response.GetTipsResponse; import org.iota.jota.dto.response.GetTransactionsToApproveResponse; @@ -261,6 +263,11 @@ protected static Response wrapCheckedException(final Call call) throws return res; } catch (IOException e) { + if (e instanceof InterruptedIOException) { + // We shut down the app + return null; + } + log.error("Execution of the API call raised exception. IOTA Node not reachable?", e); throw new IllegalStateException(e.getMessage()); } @@ -271,6 +278,12 @@ public GetNodeInfoResponse getNodeInfo(IotaCommandRequest request) throws Argume final Call res = service.getNodeInfo(IotaCommandRequest.createNodeInfoRequest()); return wrapCheckedException(res).body(); } + + @Override + public GetNodeAPIConfigurationResponse getNodeAPIConfiguration(IotaCommandRequest request) throws ArgumentException { + final Call res = service.getNodeAPIConfiguration(IotaCommandRequest.createGetNodeAPIConfiguration()); + return wrapCheckedException(res).body(); + } @Override public GetNeighborsResponse getNeighbors(IotaCommandRequest request) throws ArgumentException { diff --git a/jota/src/main/java/org/iota/jota/connection/IotaNodeApi.java b/jota/src/main/java/org/iota/jota/connection/IotaNodeApi.java index dac9ae5d..8223694b 100644 --- a/jota/src/main/java/org/iota/jota/connection/IotaNodeApi.java +++ b/jota/src/main/java/org/iota/jota/connection/IotaNodeApi.java @@ -21,6 +21,7 @@ import org.iota.jota.dto.response.GetBalancesResponse; import org.iota.jota.dto.response.GetInclusionStateResponse; import org.iota.jota.dto.response.GetNeighborsResponse; +import org.iota.jota.dto.response.GetNodeAPIConfigurationResponse; import org.iota.jota.dto.response.GetNodeInfoResponse; import org.iota.jota.dto.response.GetTipsResponse; import org.iota.jota.dto.response.GetTransactionsToApproveResponse; @@ -41,6 +42,12 @@ public interface IotaNodeApi { */ GetNodeInfoResponse getNodeInfo(IotaCommandRequest request) throws ArgumentException; + /** + * Returns information about the node API configuration. + * @throws Exception + */ + GetNodeAPIConfigurationResponse getNodeAPIConfiguration(IotaCommandRequest request); + /** * Get the list of neighbors from the node. * @throws Exception diff --git a/jota/src/main/java/org/iota/jota/connection/IotaNodeHTTPService.java b/jota/src/main/java/org/iota/jota/connection/IotaNodeHTTPService.java index c0e3e4f5..659ccbbb 100644 --- a/jota/src/main/java/org/iota/jota/connection/IotaNodeHTTPService.java +++ b/jota/src/main/java/org/iota/jota/connection/IotaNodeHTTPService.java @@ -21,6 +21,7 @@ import org.iota.jota.dto.response.GetBalancesResponse; import org.iota.jota.dto.response.GetInclusionStateResponse; import org.iota.jota.dto.response.GetNeighborsResponse; +import org.iota.jota.dto.response.GetNodeAPIConfigurationResponse; import org.iota.jota.dto.response.GetNodeInfoResponse; import org.iota.jota.dto.response.GetTipsResponse; import org.iota.jota.dto.response.GetTransactionsToApproveResponse; @@ -39,7 +40,6 @@ /** * IOTA API Proxy Service definition using Retrofit2 * - * @author davassi */ public interface IotaNodeHTTPService { @@ -55,7 +55,18 @@ public interface IotaNodeHTTPService { @Headers({CONTENT_TYPE_HEADER, USER_AGENT_HEADER}) @POST("./") Call getNodeInfo(@Body IotaCommandRequest request); - + + + /** + * Returns information about the node API Configuration. + *

g + * {@code curl http://localhost:14265 -X POST -H 'X-IOTA-API-Version: 1.4.1' -H 'Content-Type: application/json'} + * {@code -d '{"command": "GetNodeAPIConfiguration"}'} + */ + @Headers({CONTENT_TYPE_HEADER, USER_AGENT_HEADER}) + @POST("./") + Call getNodeAPIConfiguration(@Body IotaCommandRequest request); + /** * Get the list of neighbors from the node. *

diff --git a/jota/src/main/java/org/iota/jota/dto/request/IotaCommandRequest.java b/jota/src/main/java/org/iota/jota/dto/request/IotaCommandRequest.java index 8b60ae1c..698dfd46 100644 --- a/jota/src/main/java/org/iota/jota/dto/request/IotaCommandRequest.java +++ b/jota/src/main/java/org/iota/jota/dto/request/IotaCommandRequest.java @@ -34,6 +34,15 @@ protected IotaCommandRequest(String command) { public static IotaCommandRequest createNodeInfoRequest() { return new IotaCommandRequest(IotaAPICommand.GET_NODE_INFO); } + + /** + * Get information about the API configuration. + * + * @return THe node API configuration + */ + public static IotaCommandRequest createGetNodeAPIConfiguration() { + return new IotaCommandRequest(IotaAPICommand.GET_NODE_API_CONFIGURATION); + } /** * Gets the tips of the node. diff --git a/jota/src/main/java/org/iota/jota/dto/response/GetNewAddressResponse.java b/jota/src/main/java/org/iota/jota/dto/response/GetNewAddressResponse.java index ad909586..ff558d9b 100644 --- a/jota/src/main/java/org/iota/jota/dto/response/GetNewAddressResponse.java +++ b/jota/src/main/java/org/iota/jota/dto/response/GetNewAddressResponse.java @@ -32,10 +32,10 @@ public List getAddresses() { } /** - * Gets the first address, for quick access + * Gets the first address, for quick access, or null if there is none * @return The address */ public String first() { - return addresses.get(0); + return addresses.size() > 0 ? addresses.get(0) : null; } } diff --git a/jota/src/main/java/org/iota/jota/dto/response/GetNodeAPIConfigurationResponse.java b/jota/src/main/java/org/iota/jota/dto/response/GetNodeAPIConfigurationResponse.java new file mode 100644 index 00000000..3cce67b3 --- /dev/null +++ b/jota/src/main/java/org/iota/jota/dto/response/GetNodeAPIConfigurationResponse.java @@ -0,0 +1,90 @@ +package org.iota.jota.dto.response; + +/** + * Contains information about the result of a successful {@link com.iota.iri.service.API#getNodeAPIConfigurationStatement()} API call. + * Response of api request 'GetNodeAPIConfiguration'. + */ +public class GetNodeAPIConfigurationResponse extends AbstractResponse { + private int maxFindTransactions; + private int maxRequestsList; + private int maxGetTrytes; + private int maxBodyLength; + private boolean testNet; + private int milestoneStartIndex; + + /** + * Initializes a new instance of the GetBundleResponse class. + */ + public static AbstractResponse create(int maxFindTransactions, int maxRequestsList, int maxGetTrytes, int maxBodyLength, boolean testNet, int milestoneStartIndex) { + final GetNodeAPIConfigurationResponse res = new GetNodeAPIConfigurationResponse(); + + res.maxFindTransactions = maxFindTransactions; + res.maxRequestsList = maxRequestsList; + res.maxGetTrytes = maxGetTrytes; + res.maxBodyLength = maxBodyLength; + res.testNet = testNet; + res.milestoneStartIndex = milestoneStartIndex; + + return res; + } + + /** + * The maximal number of transactions that may be returned by the "findTransactions" API call. + * If the number of transactions found exceeds this number an error will be returned. + * + * @return The maximum number of transactions returned + * */ + public int getMaxFindTransactions() { + return maxFindTransactions; + } + + /** + * The maximal number of parameters one can place in an API call. + * If the number parameters exceeds this number an error will be returned. + * + * @return The maximum number of request parameters + */ + public int getMaxRequestsList() { + return maxRequestsList; + } + + /** + * The maximal number of trytes that may be returned by the "getTrytes" API call. + * If the number of transactions found exceeds this number an error will be returned. + * + * @return The maximum number of trytes returned + */ + public int getMaxGetTrytes() { + return maxGetTrytes; + } + + /** + * The maximal number of characters the body of an API call may hold. + * If a request body length exceeds this number an error will be returned. + * + * @return The maximum length of the request body + */ + public int getMaxBodyLength() { + return maxBodyLength; + } + + /** + * If this node has started in testnet mode. + * + * @return true if it is, otherwise false + */ + public boolean isTestNet() { + return testNet; + } + + /** + * The start index of the milestones. + * This index is encoded in each milestone transaction by the coordinator. + * Usually the last global snapshot, with local snapshots it is the last/oldest local snapshot milestone + * + * @return The starting milestone index + */ + public int getMilestoneStartIndex() { + return milestoneStartIndex; + } +} diff --git a/jota/src/main/java/org/iota/jota/model/Bundle.java b/jota/src/main/java/org/iota/jota/model/Bundle.java index 1fa00d1b..45933ec3 100644 --- a/jota/src/main/java/org/iota/jota/model/Bundle.java +++ b/jota/src/main/java/org/iota/jota/model/Bundle.java @@ -1,5 +1,8 @@ package org.iota.jota.model; +import java.util.ArrayList; +import java.util.List; + import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -8,9 +11,7 @@ import org.iota.jota.utils.Constants; import org.iota.jota.utils.Converter; import org.iota.jota.utils.Signing; - -import java.util.ArrayList; -import java.util.List; +import org.iota.jota.utils.TrytesConverter; /** @@ -94,6 +95,20 @@ public String getBundleHash() { } + public String getMessage() { + StringBuilder str = new StringBuilder(); + + for (Transaction t : getTransactions()) { + if (t.getValue() == 0) { + str.append(t.getSignatureFragments()); + } + } + if (str.length() % 2 != 0) { + str.deleteCharAt(str.length() - 1); + } + return TrytesConverter.trytesToAscii(str.toString()); + } + public void addTransaction(Transaction transaction) { if (getTransactions() == null) { transactions = new ArrayList<>(getTransactions()); diff --git a/jota/src/main/java/org/iota/jota/store/FlatFileStore.java b/jota/src/main/java/org/iota/jota/store/FlatFileStore.java index 550e3d0b..93b1d6be 100644 --- a/jota/src/main/java/org/iota/jota/store/FlatFileStore.java +++ b/jota/src/main/java/org/iota/jota/store/FlatFileStore.java @@ -147,7 +147,7 @@ public boolean canWrite() { @Override public String toString() { - return file.getName(); + return "FlatFileStore: [" + (file != null ? file.getName() : inputStream.toString()) + "]"; } @Override diff --git a/jota/src/main/java/org/iota/jota/store/MemoryStore.java b/jota/src/main/java/org/iota/jota/store/MemoryStore.java index 5d740ffd..7952dc1f 100644 --- a/jota/src/main/java/org/iota/jota/store/MemoryStore.java +++ b/jota/src/main/java/org/iota/jota/store/MemoryStore.java @@ -18,7 +18,8 @@ public MemoryStore() { } public MemoryStore(Map store) { - this.store = store; + // Copy to ensure writeability + this.store = new ConcurrentHashMap(store); } @Override diff --git a/jota/src/main/java/org/iota/jota/utils/BundleValidator.java b/jota/src/main/java/org/iota/jota/utils/BundleValidator.java index d022b6a4..332b24c6 100644 --- a/jota/src/main/java/org/iota/jota/utils/BundleValidator.java +++ b/jota/src/main/java/org/iota/jota/utils/BundleValidator.java @@ -83,6 +83,10 @@ public static boolean isBundle(Bundle bundle, Optional custo curl = SpongeFactory.create(customCurlMode.get()); } + if (bundle == null) { + throw new ArgumentException(INVALID_BUNDLE_ERROR); + } + int totalSum = 0; int lastIndex = bundle.getLength() - 1; diff --git a/jota/src/main/java/org/iota/jota/utils/InputValidator.java b/jota/src/main/java/org/iota/jota/utils/InputValidator.java index de0e180f..8feecf56 100644 --- a/jota/src/main/java/org/iota/jota/utils/InputValidator.java +++ b/jota/src/main/java/org/iota/jota/utils/InputValidator.java @@ -1,17 +1,17 @@ package org.iota.jota.utils; -import org.apache.commons.lang3.Range; -import org.apache.commons.lang3.math.NumberUtils; -import org.iota.jota.error.ArgumentException; -import org.iota.jota.model.Input; -import org.iota.jota.model.Transfer; +import static org.iota.jota.utils.Constants.INVALID_ADDRESSES_INPUT_ERROR; +import static org.iota.jota.utils.Constants.INVALID_TRANSFERS_INPUT_ERROR; import java.util.Arrays; import java.util.List; import java.util.function.IntPredicate; -import static org.iota.jota.utils.Constants.INVALID_ADDRESSES_INPUT_ERROR; -import static org.iota.jota.utils.Constants.INVALID_TRANSFERS_INPUT_ERROR; +import org.apache.commons.lang3.Range; +import org.apache.commons.lang3.math.NumberUtils; +import org.iota.jota.error.ArgumentException; +import org.iota.jota.model.Input; +import org.iota.jota.model.Transfer; /** * @@ -44,7 +44,7 @@ public static boolean isAddressWithoutChecksum(String address) { * According to the following issue: * https://github.com/iotaledger/trinity-wallet/issues/866 * - * This is because Curl addresses always are with a 0 trit on the end. + * This is because Kerl addresses always are with a 0 trit on the end. * So we validate if we actually send to a proper address, to prevent having to double spent * * @param trytes The trytes to check @@ -135,7 +135,7 @@ public static boolean isTrytes(String trytes) { * @return true if the specified trytes are trytes otherwise, false. **/ public static boolean isTrytesOfExactLength(String trytes, int length) { - return trytes.matches("^[A-Z9]{" + (length == 0 ? "0," : length) + "}$"); + return trytes.matches("^[A-Z9]{" + (length == 0 ? "0," : length + ",") + "}$"); } /** @@ -158,7 +158,7 @@ public static boolean isTrytes(String trytes, int length) { * @return true if the specified string consist only of '9'; otherwise, false. **/ public static boolean isNinesTrytes(String trytes, int length) { - return trytes.matches("^[9]{" + (length == 0 ? "0," : length) + "}$"); + return trytes.matches("^[9]{" + (length == 0 ? "0," : length + ",") + "}$"); } /** diff --git a/jota/src/test/java/org/iota/jota/IotaAccountIntegrationTest.java b/jota/src/test/java/org/iota/jota/IotaAccountIntegrationTest.java index 5d4eca96..67194c4a 100644 --- a/jota/src/test/java/org/iota/jota/IotaAccountIntegrationTest.java +++ b/jota/src/test/java/org/iota/jota/IotaAccountIntegrationTest.java @@ -1,5 +1,14 @@ package org.iota.jota; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.when; + +import java.io.File; +import java.io.IOException; +import java.util.Date; +import java.util.concurrent.ExecutionException; + import org.apache.commons.io.FileUtils; import org.apache.commons.io.output.NullOutputStream; import org.iota.jota.account.deposits.ConditionalDepositAddress; @@ -18,14 +27,6 @@ import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import java.io.File; -import java.io.IOException; -import java.util.Date; -import java.util.concurrent.ExecutionException; - -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.Mockito.when; - public class IotaAccountIntegrationTest { private static String lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc lorem lorem, tristique vel pharetra in, consectetur sed ex. Maecenas sit amet porttitor mauris, in ullamcorper augue. Etiam pellentesque in velit ut pellentesque. Cras dignissim quam ut imperdiet pellentesque. Proin ac ullamcorper mi. Integer suscipit sagittis augue, quis elementum dui venenatis ut. Phasellus id elit malesuada, convallis libero eget, fringilla sem. In tincidunt semper massa, nec dictum velit hendrerit et. Maecenas venenatis, felis ut eleifend elementum, enim mauris pulvinar mi, mattis posuere dolor nunc quis metus.\n" + @@ -34,7 +35,8 @@ public class IotaAccountIntegrationTest { "Interdum et malesuada fames ac ante ipsum primis in faucibus. Aliquam condimentum sapien ac lacinia varius. Proin sollicitudin sem ligula. Morbi suscipit maximus lorem ut aliquet. Vestibulum at feugiat orci. Maecenas condimentum vitae est vitae pretium. Etiam nec metus ut purus ullamcorper sodales at nec quam. Proin eleifend ante felis, et molestie mauris tincidunt ut. Fusce sit amet est tempus, luctus risus ac, imperdiet mi. Aliquam hendrerit leo orci. Mauris sed nisi ut mauris iaculis condimentum vitae fringilla libero. Praesent egestas ultricies nisl, interdum vehicula ipsum lobortis et. Praesent vitae pulvinar lacus, sed vestibulum dui. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec accumsan fermentum euismod.\n" + "Morbi auctor massa et sem vulputate feugiat. In hac habitasse platea dictumst. Integer ullamcorper ipsum nec orci ultrices consectetur. Nullam id placerat odio, et eleifend lacus. Phasellus id mi ornare, blandit massa sit amet, rhoncus leo. Vestibulum pharetra bibendum lorem, quis efficitur odio consectetur sit amet. Nunc leo diam, interdum ac magna id, ornare porta nunc. Morbi lectus nibh, rutrum in rutrum sit amet, fermentum ut risus. Mauris tempor eget tortor ac iaculis. Suspendisse laoreet ullamcorper turpis, a rutrum diam ornare quis. Proin ac diam sodales risus volutpat pulvinar. Vestibulum scelerisque lorem ac leo auctor, sit amet fringilla dolor viverra. Fusce vel pretium magna. Etiam id dui fermentum, tristique arcu sed, finibus nisi."; - + private static int MWM = 9; + private static final String TEST_SEED = "IJEEPFTJEFGFRDTSQGLGEAUZPUJFP9LDMDOOYUNOZFJ9JMJFALJATJGHEUPHHFVTFDYSGZNKMRK9EQKWG"; private static final String TEST_SEED_ID = "J9SPZIPMIHEGZEBNDLMBTVVTCGQREQXZFXUYTJTYVQCR9TUZWZDBSJBOZLTTLJYXCGGVAIEQFPWLNUGHD"; private static final String ADDR_1_SEC_3 = "TAKWNELREDNHLFYCQ9LMGZVYGTPTABFDEPQZILJAYAZSSCPXMEGCVAH9AHTJRDPVDCGIH9APCWG9KBSGA9VKXRLMU9"; @@ -67,7 +69,7 @@ void load() { store = new AccountFileStore(file); IotaAccount account = new IotaAccount.Builder(TEST_SEED) .securityLevel(3) - .mwm(9) + .mwm(MWM) .store(store) .api(iotaAPI) .build(); @@ -85,7 +87,7 @@ void sendZeroValueTest() throws AccountError, InterruptedException, ExecutionExc JsonFlatFileStore json = new JsonFlatFileStore(this.getClass().getResourceAsStream("/accounts/client-test.store"), new NullOutputStream()); store = new AccountFileStore(json); - IotaAccount account = new IotaAccount.Builder(TEST_SEED).mwm(9).store(store).api(iotaAPI).build(); + IotaAccount account = new IotaAccount.Builder(TEST_SEED).mwm(MWM).store(store).api(iotaAPI).build(); Bundle sent = account.sendZeroValue("Another IOTA Accounts test run at " + new Date().toString(), "IOTA9ACCOUNTS", @@ -100,7 +102,7 @@ void sendLongZeroMessage() throws ArgumentException, SendException, InterruptedE JsonFlatFileStore json = new JsonFlatFileStore(this.getClass().getResourceAsStream("/accounts/client-test.store"), new NullOutputStream()); store = new AccountFileStore(json); - IotaAccount account = new IotaAccount.Builder(TEST_SEED).mwm(9).store(store).api(iotaAPI).build(); + IotaAccount account = new IotaAccount.Builder(TEST_SEED).mwm(MWM).store(store).api(iotaAPI).build(); Bundle sent = account.sendZeroValue(lorem, "IOTA9ACCOUNTS", account.getAccountManager().getNextAddress().getAddress().getHashCheckSum()).get(); @@ -115,7 +117,7 @@ void sendValueTest() throws AccountError, InterruptedException, ExecutionExcepti JsonFlatFileStore json = new JsonFlatFileStore(this.getClass().getResourceAsStream("/accounts/client-test.store"), new NullOutputStream()); store = new AccountFileStore(json); - IotaAccount account = new IotaAccount.Builder(TEST_SEED).mwm(9).store(store).api(iotaAPI).build(); + IotaAccount account = new IotaAccount.Builder(TEST_SEED).mwm(MWM).store(store).api(iotaAPI).build(); Date timeOut = new Date(Long.MAX_VALUE); ConditionalDepositAddress cda = account.newDepositAddress(timeOut, false, 10).get(); @@ -134,7 +136,7 @@ void sendLongValueTest() throws AccountError, InterruptedException, ExecutionExc JsonFlatFileStore json = new JsonFlatFileStore(this.getClass().getResourceAsStream("/accounts/client-test.store"), new NullOutputStream()); store = new AccountFileStore(json); - IotaAccount account = new IotaAccount.Builder(TEST_SEED).mwm(9).store(store).api(iotaAPI).build(); + IotaAccount account = new IotaAccount.Builder(TEST_SEED).mwm(MWM).store(store).api(iotaAPI).build(); Date timeOut = new Date(Long.MAX_VALUE); ConditionalDepositAddress cda = account.newDepositAddress(timeOut, false, 10).get(); @@ -153,7 +155,7 @@ void sendLongMultiValueTest() throws AccountError, InterruptedException, Executi JsonFlatFileStore json = new JsonFlatFileStore(this.getClass().getResourceAsStream("/accounts/client-testMulti.store"), new NullOutputStream()); store = new AccountFileStore(json); - IotaAccount account = new IotaAccount.Builder(TEST_SEED).mwm(9).store(store).api(iotaAPI).build(); + IotaAccount account = new IotaAccount.Builder(TEST_SEED).mwm(MWM).store(store).api(iotaAPI).build(); Date timeOut = new Date(Long.MAX_VALUE); ConditionalDepositAddress cda = account.newDepositAddress(timeOut, false, 10).get(); @@ -172,7 +174,7 @@ void sendLongMultiValueRemainderTest() throws AccountError, InterruptedException JsonFlatFileStore json = new JsonFlatFileStore(this.getClass().getResourceAsStream("/accounts/client-testMulti.store"), new NullOutputStream()); store = new AccountFileStore(json); - IotaAccount account = new IotaAccount.Builder(TEST_SEED).mwm(9).store(store).api(iotaAPI).build(); + IotaAccount account = new IotaAccount.Builder(TEST_SEED).mwm(MWM).store(store).api(iotaAPI).build(); Date timeOut = new Date(Long.MAX_VALUE); ConditionalDepositAddress cda = account.newDepositAddress(timeOut, false, 10).get(); diff --git a/jota/src/test/java/org/iota/jota/account/deposits/methods/MagnetTest.java b/jota/src/test/java/org/iota/jota/account/deposits/methods/MagnetTest.java index d92efb2f..90e97c03 100644 --- a/jota/src/test/java/org/iota/jota/account/deposits/methods/MagnetTest.java +++ b/jota/src/test/java/org/iota/jota/account/deposits/methods/MagnetTest.java @@ -1,5 +1,10 @@ package org.iota.jota.account.deposits.methods; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import java.util.Date; + import org.iota.jota.account.deposits.ConditionalDepositAddress; import org.iota.jota.account.deposits.DepositRequest; import org.iota.jota.account.deposits.DepositTest; @@ -7,18 +12,13 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import java.util.Date; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; - public class MagnetTest extends DepositTest { private static final long TIME = 0; private static final boolean MULTI = false; private static final long AMOUNT = 5; - private static final String MAGNET_CHECKSUM = "QC9AIWMMD"; + private static final String MAGNET_CHECKSUM = "UDJPO99SI"; private static final String MAGNET = "iota://" + DepositTest.depositAddress.getHash() + MAGNET_CHECKSUM + "/?" + MagnetMethod.CONDITION_EXPIRES + "=" + TIME + "&" @@ -43,6 +43,17 @@ public void buildMagnet() { assertEquals(MagnetTest.MAGNET, magnet); } + + @Test + public void readGoMagnet() { + // GO and JS allow 1 instead of true + String magnet = "iota://BWNYWGULIIAVRYOOFWZTSDFXFPRCFF9YEHGVBOORLGCPCJSKTHU9OKESUGZGWZXZZDLESFPPTGEHVKTTXG9BQLSIGP/?timeout_at=5174418337&multi_use=1&expected_amount=0"; + ConditionalDepositAddress cda = DepositFactory.get().parse(magnet, MagnetMethod.class); + + assertEquals(cda.getRequest().getTimeOut().getTime(), 5174418337l); + assertEquals(cda.getRequest().getExpectedAmount(), 0); + assertEquals(cda.getRequest().getMultiUse(), true); + } @Test public void readMagnet() { diff --git a/jota/src/test/java/org/iota/jota/account/store/MongoDBStoreTest.java b/jota/src/test/java/org/iota/jota/account/store/MongoDBStoreTest.java index 45b73ad5..87ecddb5 100644 --- a/jota/src/test/java/org/iota/jota/account/store/MongoDBStoreTest.java +++ b/jota/src/test/java/org/iota/jota/account/store/MongoDBStoreTest.java @@ -1,5 +1,8 @@ package org.iota.jota.account.store; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; + import java.util.Arrays; import java.util.Date; import java.util.Map; @@ -18,9 +21,6 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.fail; - @Disabled public class MongoDBStoreTest { @@ -29,10 +29,11 @@ public class MongoDBStoreTest { @BeforeEach public void setUp() { + int PORT = 12345; // Want to run this test? Update it with your mongodb details locally for now - this.store = new MongoStore("databasename", IotaDefaultConfig.Defaults.TABLE_NAME, - "url", 1337); - //store.addCredentials("username", "password"); + this.store = new MongoStore("database", IotaDefaultConfig.Defaults.TABLE_NAME, + "url", PORT); + store.addCredentials("user", "pass"); } @AfterEach @@ -41,7 +42,6 @@ public void tearDown() throws Exception { store.shutdown(); } - @Disabled @Test public void testConnection() { try { @@ -51,7 +51,6 @@ public void testConnection() { } } - @Disabled @Test public void depositRequestTest() throws Exception{ store.start(); diff --git a/jota/src/test/java/org/iota/jota/config/FileConfigTest.java b/jota/src/test/java/org/iota/jota/config/FileConfigTest.java index 37e067ab..e10e6fba 100644 --- a/jota/src/test/java/org/iota/jota/config/FileConfigTest.java +++ b/jota/src/test/java/org/iota/jota/config/FileConfigTest.java @@ -25,7 +25,7 @@ public void testNewConfig() throws Exception { FileConfig config = new FileConfig(store); assertEquals(500, config.getConnectionTimeout()); - assertEquals("client_new.store", config.getStore().toString()); + assertEquals("FlatFileStore: [client_new.store]", config.getStore().toString()); assertEquals(15, config.getMwm()); assertEquals(5, config.getDepth()); assertEquals(3, config.getSecurityLevel()); diff --git a/pom.xml b/pom.xml index 389947ce..6c3b99d6 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.iota jota-parent - 1.0.0-beta7 + 1.0.0-beta8 pom JOTA JOTA library is a simple Java wrapper around IOTA Node's JSON-REST HTTP interface. @@ -389,6 +389,10 @@ false + + ${env.GPG_KEYNAME} + ${env.GPG_PASSPHRASE} +