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

Commit

Permalink
Merge branch 'release-v1.0.0-beta7'
Browse files Browse the repository at this point in the history
  • Loading branch information
Brord van Wierst committed Oct 29, 2019
2 parents 5119509 + 6b63c57 commit 777c670
Show file tree
Hide file tree
Showing 81 changed files with 758 additions and 788 deletions.
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

<!--- Remove text and sections that do not apply -->
The issue tracker is only for reporting bugs or submitting feature requests.
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.
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).

### Bug description
A general description of the bug.

### Versions
What iota-java version are you running?
What node are you connected to?

### Steps To Reproduce
1.
2.
3.

### Expected behaviour
What should happen.

### Actual behaviour
What really happened.

### Errors
Paste any errors that you see.
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

*Note*
The feature request will probably be integrated faster if you do a pull request for it.
If you want to discuss the feature before you actually write the code you are welcome to do it by first submitting an issue.

### Description
Briefly describe the feature you want.

### Motivation
Explain why this feature is needed.

### Requirements
Create a list of what you want this feature request to fulfill.

### Open Questions (optional)
Anything you want to discuss.

### Am I planning to do it myself with a PR?
Yes/No.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This is the **official** Java client library, which allows you to do the followi
* Interact with an IRI node

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

|Table of contents|
|:----|
Expand Down Expand Up @@ -69,7 +69,7 @@ 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-beta6'
compile 'com.github.iotaledger:iota-java:1.0.0-beta7'
}
```

Expand All @@ -96,7 +96,7 @@ To download the IOTA Java client library and its dependencies, you can use one o
```

3. Change the value of the `<version>` tag to either a release number or the first 10 characters of a Git commit hash:
`<version>efdc784d8a9ef</version>` or `<version>1.0.0-beta6</version>`
`<version>efdc784d8a9ef</version>` or `<version>1.0.0-beta7</version>`

**Note:** Find the latest version on the [Jitpack](https://jitpack.io/#iotaledger/iota-java) page.

Expand Down Expand Up @@ -182,6 +182,7 @@ We have a list of test cases on the [`src/test/java` directory][tests] that you
A good starter is the [`IotaAPITest` case](https://github.com/iotaledger/iota-java/blob/master/jota/src/test/java/org/iota/jota/IotaAPITest.java).

## Change logs:
- 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)
- Changes in [**1.0.0-beta4**](https://github.com/iotaledger/iota-java/compare/1.0.0-beta3...1.0.0-beta4)
Expand All @@ -203,7 +204,7 @@ We have some [basic contribution guidelines](CONTRIBUTING.md) to keep our code b

## Joining the Discussion

If you want to get involved in the community, need help with getting setup, have any issues related with the library or just want to discuss blockchain, distributed ledgers, and IoT with other people, feel free to join our [Discord](https://discordapp.com/invite/fNGZXvh).
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/).

## License

Expand All @@ -229,5 +230,5 @@ The Apache 2.0 license can be found [here](LICENSE).
[new-pull-request]: https://github.com/iotaledger/iota-java/compare
[contribution-guidelines]: https://github.com/iotaledger/iota-java/blob/master/CONTRIBUTING.md
[tests]: https://github.com/iotaledger/iota-java/tree/master/jota/src/test/java/org/iota/jota
[iota-discord]: https://discord.gg/7Gu2mG5
[iota-discord]: https://discord.iota.org/
[iota-forum]: https://forum.iota.org/
12 changes: 6 additions & 6 deletions docs/iota-java/addRemainder.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

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

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.
Expand All @@ -14,7 +14,7 @@ Uses input, and adds to the bundle, untill `totalValue` is reached. If there is
| 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. |
| tag | String | Required | The tag to add to each bundle entry (input and remainder) |
| totalValue | long | Required | The total value of the desired transaction |
| 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. |
| 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. |
| signatureFragments | List<String> | Required | The signature fragments (message), used for signing.Should be 2187 characters long, can be padded with 9s. |

## Output
Expand All @@ -27,21 +27,21 @@ Uses input, and adds to the bundle, untill `totalValue` is reached. If there is
|:---------------|:--------|
| [ArgumentException](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/error/ArgumentException.java) | When the seed is invalid |
| [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. |
| IllegalStateException | When the inputs do not contain enough balance to reach <tt>totalValue</tt>. |
| IllegalStateException | When the inputs do not contain enough balance to reach `totalValue`. |

## Related APIs (link to other product documentation)
| API | Description |
|:---------------|:--------|
| [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. |
| [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. |
| [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. |
| [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. |

## Example

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

try {
List<String> response = iotaAPI.addRemainder("GJRKVXECSQFPQOEMFNKWZLBKMYXUW9ZX9DCBBKFUFFICTCL9BXCWDEUQWHWRDYYSJEBYRRTJJZEVFXROV", "365", ["inputs", "inputs"], "bundle", "OVTBVZF9UHIMBKAE9NQZUNWZ9AUWGAMTKUPG9BOEOS9LFYYYXGPCOZWVXARKK9QXJJEQITVIODK9AZNOG", "totalvalue", "VIGLBXE9SWTYGJYDLSPNGVTRLIVRVGHXFMMZAIXNGFWZVQYXMQISB99MACJ9XUOVMSXALC99YPWAVCCJL", ["AFGGZR9I9GCPKYAE9PEWRIUDIUBQKQWUOR9BIL9QKUQOTAKTNKYLRTBQ9HL9NRULMPJIDEWIEAMWLLERI", "YHKJKHNRUFGRJ9CYZVFOJXLAWNWC9OEPXMTNPLNUBGKKFI9AOBWTNQZPARWILW9FHSUVRSLFNJNTLVI9K"]);
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"}));
} catch (ArgumentException e) {
// Handle error
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

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

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

```Java
Account account = new IotaAccount.Builder().build();

IotaAPI iotaAPI = new IotaAPI.Builder().build();
IotaAccount account = new IotaAccount.Builder("MY9SEED9..").api(iotaAPI).build()
try {
long balance = account.usableBalance();

// Sweep your account balance to 1 address
Future<ConditionalDepositAddress> response = account.newDepositAddress(nextHour, false, balance);
ConditionalDepositAddress cda = response.get();

account.send(new Recipient(balance, "My sweep message", "IOTA9SWEEP9", cda.getDepositAddress())
long response = account.availableBalance();
} catch (AccountError e) {
// Handle error
e.printStackTrace();
Expand Down
10 changes: 5 additions & 5 deletions docs/iota-java/bundlesFromAddresses.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

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

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

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


## Example
Expand All @@ -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("true", ["KVB9GPIDVFGM9MIVJES9IPRRFUSBWWFLG9BYEOY9JIBMIMBTERXSIXSUUGYEQZZQEQGBKZJNZZVIOSZDL", "LNIHWRCCWVTEZYGEWDZBRHIWVXWCIKSSPGYPB9PU9JYOIP9VQDJU9ADCCZLDDQXCHNLKFLNRKOJZUOIVC"]);
Bundle[] response = iotaAPI.bundlesFromAddresses(false, new String[]{"UTSPUMBBRHRCVMPKAWDRXIFUYHOYLJGTZ9DTRIQJFD9UFDYCNLFQBV9LTOMGASNPWVFMCAMKVKOCVNZKG", "WAZEFGAKXRACVFNEP9JXYPASTZVBYXF9UNHKUHRUDWDBETAJYD9OFWBOJON9FDQRRBTVXZMCMMTLZLRWH"});
} catch (ArgumentException e) {
// Handle error
e.printStackTrace();
Expand Down
4 changes: 2 additions & 2 deletions docs/iota-java/checkWereAddressSpentFrom.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# [checkWereAddressSpentFrom](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L1022)
# [checkWereAddressSpentFrom](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L948)
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.
Expand Down Expand Up @@ -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(["WXBYKDMRDYKCQBJWZZFPNHKZLYINE9TLYSETXLOFXQKRUKDVRGWFQHVPSNHJMNIHU9QVPLPQKSNXRBLAV", "JYWRGZDJJCRUOUVZJKNWGMEWOLJEEQLHAIVM9D9GWEZN9YJZWYLOBGUCBBWIMEUQDYZG9HPVAZZDSVLSP"]);
boolean[] response = iotaAPI.checkWereAddressSpentFrom(new String[]{"LFR9BZETOYCK99HAUF9QCKHNFKWRSGMUSWCBES99LBQNLA9FPZHZWOXALDUYBUUYSSCVECENJXIKVKFOT", "RUIZBLTGKNUQN9K9MFTODKMM9VXLKWAHVYATRFIC9COFBMXO9POVTRVBSZAEICJSFFAHWZLPMU9AEWKIE"});
} catch (ArgumentException e) {
// Handle error
e.printStackTrace();
Expand Down
9 changes: 5 additions & 4 deletions docs/iota-java/findTransactionObjectsByAddresses.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# [findTransactionObjectsByAddresses](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L480)
# [findTransactionObjectsByAddresses](https://github.com/iotaledger/iota-java/blob/master/jota/src/main/java/org/iota/jota/IotaAPI.java#L396)
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.
Expand All @@ -12,6 +12,7 @@ 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 | |
Expand Down Expand Up @@ -41,16 +42,16 @@ 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#L273) | 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#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. |
| [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. |

## Example

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

try {
List<Transaction> response = iotaAPI.findTransactionObjectsByAddresses(["AYZWDCHCJLLEAXMLMHR9OKZW9KXFQEJVMNNMQCFYAOMVRIIAOYNUVAINKORAFDADZRHFCYWIZVSHZFNLS", "ZHCFE9YXMOOHCHCKFRTCIXCXPTRFHIUITFSUEYORRLQVWKVQQUJTAALHEGJJIWAHEMZNSVDHPLCFTCGMV"]);
List<Transaction> response = iotaAPI.findTransactionObjectsByAddresses(new String[]{"GHIALCNSUKFIOHCNZOWRAVNRJTMEHWTRBNMMCLCZAXPDWXTUXPWCUOIRKWKX9YXYNS9JGPNCIURDYBNDY", "BYANZHOP9YKVFFWJZGBDTGFBNRTUQGEFXWMJNTOACZ9IRETPQX9EKMFNTVJFYRCKWCKFQAQXXD9JVSQBX"});
} catch (ArgumentException e) {
// Handle error
e.printStackTrace();
Expand Down
Loading

0 comments on commit 777c670

Please sign in to comment.