Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 777c670

Browse files
author
Brord van Wierst
committed
Merge branch 'release-v1.0.0-beta7'
2 parents 5119509 + 6b63c57 commit 777c670

File tree

81 files changed

+758
-788
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+758
-788
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
<!--- Remove text and sections that do not apply -->
11+
The issue tracker is only for reporting bugs or submitting feature requests.
12+
If you need technical assistance for running a node please consult the #fullnode channel on Discord (https://discord.iota.org) or https://forum.helloiota.com/Technology/Help.
13+
If you have general questions on IOTA you can go to https://iota.stackexchange.com/, https://helloiota.com/, or browse Discord channels (https://discord.iota.org).
14+
15+
### Bug description
16+
A general description of the bug.
17+
18+
### Versions
19+
What iota-java version are you running?
20+
What node are you connected to?
21+
22+
### Steps To Reproduce
23+
1.
24+
2.
25+
3.
26+
27+
### Expected behaviour
28+
What should happen.
29+
30+
### Actual behaviour
31+
What really happened.
32+
33+
### Errors
34+
Paste any errors that you see.
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
*Note*
11+
The feature request will probably be integrated faster if you do a pull request for it.
12+
If you want to discuss the feature before you actually write the code you are welcome to do it by first submitting an issue.
13+
14+
### Description
15+
Briefly describe the feature you want.
16+
17+
### Motivation
18+
Explain why this feature is needed.
19+
20+
### Requirements
21+
Create a list of what you want this feature request to fulfill.
22+
23+
### Open Questions (optional)
24+
Anything you want to discuss.
25+
26+
### Am I planning to do it myself with a PR?
27+
Yes/No.

README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This is the **official** Java client library, which allows you to do the followi
1313
* Interact with an IRI node
1414

1515
This is beta software, so there may be performance and stability issues.
16-
Please report any issues in our [issue tracker](https://github.com/iotaledger/iota-java/issues/new-issue).
16+
Please report any issues in our [issue tracker](https://github.com/iotaledger/iota-java/issues/new/choose).
1717

1818
|Table of contents|
1919
|:----|
@@ -69,7 +69,7 @@ To download the IOTA Java client library and its dependencies, you can use one o
6969
7070
```gradle
7171
dependencies {
72-
compile 'com.github.iotaledger:iota-java:1.0.0-beta6'
72+
compile 'com.github.iotaledger:iota-java:1.0.0-beta7'
7373
}
7474
```
7575
@@ -96,7 +96,7 @@ To download the IOTA Java client library and its dependencies, you can use one o
9696
```
9797
9898
3. Change the value of the `<version>` tag to either a release number or the first 10 characters of a Git commit hash:
99-
`<version>efdc784d8a9ef</version>` or `<version>1.0.0-beta6</version>`
99+
`<version>efdc784d8a9ef</version>` or `<version>1.0.0-beta7</version>`
100100
101101
**Note:** Find the latest version on the [Jitpack](https://jitpack.io/#iotaledger/iota-java) page.
102102
@@ -182,6 +182,7 @@ We have a list of test cases on the [`src/test/java` directory][tests] that you
182182
A good starter is the [`IotaAPITest` case](https://github.com/iotaledger/iota-java/blob/master/jota/src/test/java/org/iota/jota/IotaAPITest.java).
183183

184184
## Change logs:
185+
- Changes in [**1.0.0-beta7**](https://github.com/iotaledger/iota-java/compare/1.0.0-beta6...1.0.0-beta7)
185186
- Changes in [**1.0.0-beta6**](https://github.com/iotaledger/iota-java/compare/1.0.0-beta5...1.0.0-beta6)
186187
- Changes in [**1.0.0-beta5**](https://github.com/iotaledger/iota-java/compare/1.0.0-beta4...1.0.0-beta5)
187188
- Changes in [**1.0.0-beta4**](https://github.com/iotaledger/iota-java/compare/1.0.0-beta3...1.0.0-beta4)
@@ -203,7 +204,7 @@ We have some [basic contribution guidelines](CONTRIBUTING.md) to keep our code b
203204

204205
## Joining the Discussion
205206

206-
If you want to get involved in the community, need help with getting setup, have any issues related with the library or just want to discuss blockchain, distributed ledgers, and IoT with other people, feel free to join our [Discord](https://discordapp.com/invite/fNGZXvh).
207+
If you want to get involved in the community, need help with getting setup, have any issues related with the library or just want to discuss blockchain, distributed ledgers, and IoT with other people, feel free to join our [Discord](https://discord.iota.org/).
207208

208209
## License
209210

@@ -229,5 +230,5 @@ The Apache 2.0 license can be found [here](LICENSE).
229230
[new-pull-request]: https://github.com/iotaledger/iota-java/compare
230231
[contribution-guidelines]: https://github.com/iotaledger/iota-java/blob/master/CONTRIBUTING.md
231232
[tests]: https://github.com/iotaledger/iota-java/tree/master/jota/src/test/java/org/iota/jota
232-
[iota-discord]: https://discord.gg/7Gu2mG5
233+
[iota-discord]: https://discord.iota.org/
233234
[iota-forum]: https://forum.iota.org/

docs/iota-java/addRemainder.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
# [addRemainder](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L1598)
2+
# [addRemainder](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L1529)
33
List<String> 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<String> signatureFragments)
44

55
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.
@@ -14,7 +14,7 @@ Uses input, and adds to the bundle, untill `totalValue` is reached. If there is
1414
| bundle | [Bundle](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Bundle.java) | Required | The [Bundle](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Bundle.java) to be populated. |
1515
| tag | String | Required | The tag to add to each bundle entry (input and remainder) |
1616
| totalValue | long | Required | The total value of the desired transaction |
17-
| remainderAddress | String | Required | The address used for sending the remainder value (of the last input). If this is `null`, [getNextAvailableAddress(String, int, boolean)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L115) is used. |
17+
| remainderAddress | String | Required | The address used for sending the remainder value (of the last input). If this is `null`, [generateNewAddresses(AddressRequest)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L86) is used. |
1818
| signatureFragments | List<String> | Required | The signature fragments (message), used for signing.Should be 2187 characters long, can be padded with 9s. |
1919

2020
## Output
@@ -27,21 +27,21 @@ Uses input, and adds to the bundle, untill `totalValue` is reached. If there is
2727
|:---------------|:--------|
2828
| [ArgumentException](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/error/ArgumentException.java) | When the seed is invalid |
2929
| [ArgumentException](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/error/ArgumentException.java) | When the security level is wrong. |
30-
| IllegalStateException | When the inputs do not contain enough balance to reach <tt>totalValue</tt>. |
30+
| IllegalStateException | When the inputs do not contain enough balance to reach `totalValue`. |
3131

3232
## Related APIs (link to other product documentation)
3333
| API | Description |
3434
|:---------------|:--------|
35-
| [signInputsAndReturn(String, List, Bundle, List, org.iota.jota.pow.ICurl)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/utils/IotaAPIUtils.java#L64) | Finalizes and signs the bundle transactions. Bundle and inputs are assumed correct. |
36-
| [getNextAvailableAddress(String, int, boolean)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L115) | Checks all addresses until the first unspent address is found. Starts at index 0. |
35+
| [signInputsAndReturn(String, List, Bundle, List, org.iota.jota.pow.ICurl)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/utils/IotaAPIUtils.java#L79) | Finalizes and signs the bundle transactions. Bundle and inputs are assumed correct. |
36+
| [generateNewAddresses(AddressRequest)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L86) | Generates new addresses, meaning addresses which were not spend from, according to the connected node. Stops when [getAmount()](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/builder/AddressRequest.java#L104) of unspent addresses are found, starting from [getIndex()](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/builder/AddressRequest.java#L96) If [getAmount()](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/builder/AddressRequest.java#L104) is set to 0, we will generate until the first unspent address is found, and stop. |
3737

3838
## Example
3939

4040
```Java
4141
IotaAPI iotaAPI = new IotaAPI.Builder().build();
4242

4343
try {
44-
List<String> response = iotaAPI.addRemainder("GJRKVXECSQFPQOEMFNKWZLBKMYXUW9ZX9DCBBKFUFFICTCL9BXCWDEUQWHWRDYYSJEBYRRTJJZEVFXROV", "365", ["inputs", "inputs"], "bundle", "OVTBVZF9UHIMBKAE9NQZUNWZ9AUWGAMTKUPG9BOEOS9LFYYYXGPCOZWVXARKK9QXJJEQITVIODK9AZNOG", "totalvalue", "VIGLBXE9SWTYGJYDLSPNGVTRLIVRVGHXFMMZAIXNGFWZVQYXMQISB99MACJ9XUOVMSXALC99YPWAVCCJL", ["AFGGZR9I9GCPKYAE9PEWRIUDIUBQKQWUOR9BIL9QKUQOTAKTNKYLRTBQ9HL9NRULMPJIDEWIEAMWLLERI", "YHKJKHNRUFGRJ9CYZVFOJXLAWNWC9OEPXMTNPLNUBGKKFI9AOBWTNQZPARWILW9FHSUVRSLFNJNTLVI9K"]);
44+
List<String> response = iotaAPI.addRemainder("YOUR9SECRET9SEED9999999...", 3, new List<Input>(new Input[]{inputs, inputs}), bundle, "TAG9TIGHDELJXFHN9KLKZHVGBST", 284, "LTWUDWCICFHSWYOXMBWXEYQGBJNAKHCXIQGSTOQOTJR9DBOOVYGZ9NLHAK9FGCSXWKTBPBBMOVZMJBHKJ", new List<String>(new String[]{"PSDFHESDBFMKIEGSKIYHTIQEC ... BDVYKAQWWAGBZBPSFVKWBY9YB", "PSXXTETHXPZPIUQNMCORDIOOG ... QCFIIPMYGROYCQAMKSNIUDJPG"}));
4545
} catch (ArgumentException e) {
4646
// Handle error
4747
e.printStackTrace();

docs/iota-java/usableBalance.md renamed to docs/iota-java/availableBalance.md

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

2-
# [usableBalance](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/account/Account.java#L82)
3-
long usableBalance()
2+
# [availableBalance](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/account/Account.java#L82)
3+
long availableBalance()
44

55
Runs the input selection with the CDAs in order to determine the usable balance for funding transfers.
66
> **Important note:** This API is currently in Beta and is subject to change. Use of these APIs in production applications is not supported.
@@ -20,16 +20,10 @@ Runs the input selection with the CDAs in order to determine the usable balance
2020
## Example
2121

2222
```Java
23-
Account account = new IotaAccount.Builder().build();
24-
23+
IotaAPI iotaAPI = new IotaAPI.Builder().build();
24+
IotaAccount account = new IotaAccount.Builder("MY9SEED9..").api(iotaAPI).build()
2525
try {
26-
long balance = account.usableBalance();
27-
28-
// Sweep your account balance to 1 address
29-
Future<ConditionalDepositAddress> response = account.newDepositAddress(nextHour, false, balance);
30-
ConditionalDepositAddress cda = response.get();
31-
32-
account.send(new Recipient(balance, "My sweep message", "IOTA9SWEEP9", cda.getDepositAddress())
26+
long response = account.availableBalance();
3327
} catch (AccountError e) {
3428
// Handle error
3529
e.printStackTrace();

docs/iota-java/bundlesFromAddresses.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
# [bundlesFromAddresses](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L309)
2+
# [bundlesFromAddresses](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L225)
33
[Bundle[]](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Bundle.java) bundlesFromAddresses(Boolean inclusionStates , String[] addresses)
44

55
Internal function to get the formatted bundles of a list of addresses.
@@ -8,8 +8,8 @@ Internal function to get the formatted bundles of a list of addresses.
88
## Input
99
| Parameter | Type | Required or Optional | Description |
1010
|:---------------|:--------|:--------| :--------|
11-
| inclusionStates | Boolean | Required | Array of addresses. |
12-
| addresses | String[] | Required | If `true`, it also gets the inclusion state of each bundle. |
11+
| inclusionStates | Boolean | Required | If `true`, it also gets the inclusion state of each bundle. |
12+
| addresses | String[] | Required | Array of addresses. |
1313

1414
## Output
1515
| Return type | Description |
@@ -20,7 +20,7 @@ Internal function to get the formatted bundles of a list of addresses.
2020
| Exceptions | Description |
2121
|:---------------|:--------|
2222
| [ArgumentException](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/error/ArgumentException.java) | When the addresses are invalid |
23-
| IllegalStateException | When inclusion state/confirmed could not be determined (<tt>null</tt> returned) |
23+
| IllegalStateException | When inclusion state/confirmed could not be determined (`null` returned) |
2424

2525

2626
## Example
@@ -29,7 +29,7 @@ Internal function to get the formatted bundles of a list of addresses.
2929
IotaAPI iotaAPI = new IotaAPI.Builder().build();
3030

3131
try {
32-
Bundle response = iotaAPI.bundlesFromAddresses("true", ["KVB9GPIDVFGM9MIVJES9IPRRFUSBWWFLG9BYEOY9JIBMIMBTERXSIXSUUGYEQZZQEQGBKZJNZZVIOSZDL", "LNIHWRCCWVTEZYGEWDZBRHIWVXWCIKSSPGYPB9PU9JYOIP9VQDJU9ADCCZLDDQXCHNLKFLNRKOJZUOIVC"]);
32+
Bundle[] response = iotaAPI.bundlesFromAddresses(false, new String[]{"UTSPUMBBRHRCVMPKAWDRXIFUYHOYLJGTZ9DTRIQJFD9UFDYCNLFQBV9LTOMGASNPWVFMCAMKVKOCVNZKG", "WAZEFGAKXRACVFNEP9JXYPASTZVBYXF9UNHKUHRUDWDBETAJYD9OFWBOJON9FDQRRBTVXZMCMMTLZLRWH"});
3333
} catch (ArgumentException e) {
3434
// Handle error
3535
e.printStackTrace();

docs/iota-java/checkWereAddressSpentFrom.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
# [checkWereAddressSpentFrom](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L1022)
2+
# [checkWereAddressSpentFrom](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L948)
33
boolean[] checkWereAddressSpentFrom(String[] addresses)
44

55
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
2727
IotaAPI iotaAPI = new IotaAPI.Builder().build();
2828

2929
try {
30-
boolean response = iotaAPI.checkWereAddressSpentFrom(["WXBYKDMRDYKCQBJWZZFPNHKZLYINE9TLYSETXLOFXQKRUKDVRGWFQHVPSNHJMNIHU9QVPLPQKSNXRBLAV", "JYWRGZDJJCRUOUVZJKNWGMEWOLJEEQLHAIVM9D9GWEZN9YJZWYLOBGUCBBWIMEUQDYZG9HPVAZZDSVLSP"]);
30+
boolean[] response = iotaAPI.checkWereAddressSpentFrom(new String[]{"LFR9BZETOYCK99HAUF9QCKHNFKWRSGMUSWCBES99LBQNLA9FPZHZWOXALDUYBUUYSSCVECENJXIKVKFOT", "RUIZBLTGKNUQN9K9MFTODKMM9VXLKWAHVYATRFIC9COFBMXO9POVTRVBSZAEICJSFFAHWZLPMU9AEWKIE"});
3131
} catch (ArgumentException e) {
3232
// Handle error
3333
e.printStackTrace();

docs/iota-java/findTransactionObjectsByAddresses.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
# [findTransactionObjectsByAddresses](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L480)
2+
# [findTransactionObjectsByAddresses](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L396)
33
List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java)> findTransactionObjectsByAddresses(String[] addresses)
44

55
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,6 +12,7 @@ Wrapper function: Finds transactions, gets trytes and turns it into [Transaction
1212

1313
## Output
1414
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:
15+
1516
| Return type | Description |
1617
|--|--|
1718
| long attachmentTimestampLowerBound | |
@@ -41,16 +42,16 @@ List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/
4142
## Related APIs (link to other product documentation)
4243
| API | Description |
4344
|:---------------|:--------|
44-
| [findTransactionsByAddresses(String...)](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L273) | Find the transactions by addresses with checksum |
45-
| [findTransactionsObjectsByHashes](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L454) | 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. |
45+
| [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 |
46+
| [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. |
4647

4748
## Example
4849

4950
```Java
5051
IotaAPI iotaAPI = new IotaAPI.Builder().build();
5152

5253
try {
53-
List<Transaction> response = iotaAPI.findTransactionObjectsByAddresses(["AYZWDCHCJLLEAXMLMHR9OKZW9KXFQEJVMNNMQCFYAOMVRIIAOYNUVAINKORAFDADZRHFCYWIZVSHZFNLS", "ZHCFE9YXMOOHCHCKFRTCIXCXPTRFHIUITFSUEYORRLQVWKVQQUJTAALHEGJJIWAHEMZNSVDHPLCFTCGMV"]);
54+
List<Transaction> response = iotaAPI.findTransactionObjectsByAddresses(new String[]{"GHIALCNSUKFIOHCNZOWRAVNRJTMEHWTRBNMMCLCZAXPDWXTUXPWCUOIRKWKX9YXYNS9JGPNCIURDYBNDY", "BYANZHOP9YKVFFWJZGBDTGFBNRTUQGEFXWMJNTOACZ9IRETPQX9EKMFNTVJFYRCKWCKFQAQXXD9JVSQBX"});
5455
} catch (ArgumentException e) {
5556
// Handle error
5657
e.printStackTrace();

0 commit comments

Comments
 (0)