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

Commit 6b63c57

Browse files
author
Brord van Wierst
authored
Merge pull request #205 from kwek20/v1.0.0-beta7
v1.0.0 beta7
2 parents 8f15095 + 5c17c6f commit 6b63c57

Some content is hidden

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

43 files changed

+232
-300
lines changed

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -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)

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

+3-9
Original file line numberDiff line numberDiff line change
@@ -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.availableBalance();
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();

docs/iota-java/findTransactionObjectsByApprovees.md

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

2-
# [findTransactionObjectsByApprovees](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L516)
2+
# [findTransactionObjectsByApprovees](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L435)
33
List<[Transaction](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/model/Transaction.java)> findTransactionObjectsByApprovees(String[] approvees)
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,15 +42,15 @@ 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-
| [findTransactionsByApprovees](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L304) | Find the transactions by approvees |
45+
| [findTransactionsByApprovees](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPICore.java#L334) | Find the transactions by approvees |
4546

4647
## Example
4748

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

5152
try {
52-
List<Transaction> response = iotaAPI.findTransactionObjectsByApprovees(["VKXPUUA9QIRJCIPIOGOWCLTDHNPAM99NYWPKOCVDKJVES9EWQ9TN9IMIU9GRTANLI9QMZEBGNZTOR9OVB", "FQCOXX99V9HMBAKSFKJTMDYUPKNYLGFE9LAJMRFQIGTOQNGXWEXVGALCEHHTC9LFTQY9IRJWLZZFFAGUN"]);
53+
List<Transaction> response = iotaAPI.findTransactionObjectsByApprovees(new String[]{"WSOLQGWRUZEPMZUKRDVDADHVESYRLOWOEHCWONIIT9HSPBZLEGQNYIHVKLMIEZYTPADXJYBOVNNYCPCYJ", "MFZMSUNPKPLDMTWQSPIMULPIZGBENUCSHYORAVNQPTKGKIXLTPUVPJHNJQLRNZHNZXOFGUUMIHDZPWNWP"});
5354
} catch (ArgumentException e) {
5455
// Handle error
5556
e.printStackTrace();

0 commit comments

Comments
 (0)