Skip to content

Commit eddf73d

Browse files
committed
updated getAccountData
1 parent 2a9a6ab commit eddf73d

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎src/main/java/jota/IotaAPI.java‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,10 @@ public GetBundleResponse getBundle(String transaction) throws ArgumentException,
711711
*
712712
* @param seed Tryte-encoded seed. It should be noted that this seed is not transferred.
713713
* @param security The Security level of private key / seed.
714+
* @param index Key index to start search from. If the index is provided, the generation of the address is not deterministic.
715+
* @param checksum Adds 9-tryte address checksum.
716+
* @param total Total number of addresses to generate.
717+
* @param returnAll If <code>true</code>, it returns all addresses which were deterministically generated (until findTransactions returns null).
714718
* @param start Starting key index.
715719
* @param end Ending key index.
716720
* @param inclusionStates If <code>true</code>, it gets the inclusion states of the transfers.
@@ -721,10 +725,10 @@ public GetBundleResponse getBundle(String transaction) throws ArgumentException,
721725
* @throws InvalidTrytesException is thrown when invalid trytes is provided.
722726
* @throws InvalidSecurityLevelException is thrown when the specified security level is not valid.
723727
* @throws InvalidAddressException is thrown when the specified address is not an valid address.
724-
* @throws NoInclusionStatesException when it not possible to get a inclusion state.
728+
* @throws NoInclusionStatesException is thrown when it not possible to get a inclusion state.
725729
* @throws NoNodeInfoException is thrown when its not possible to get node info.
726730
*/
727-
public GetAccountDataResponse getAccountData(String seed, int security, int start, int end, boolean inclusionStates, long threshold)
731+
public GetAccountDataResponse getAccountData(String seed, int security, int index, boolean checksum, int total, boolean returnAll, int start, int end, boolean inclusionStates, long threshold)
728732
throws InvalidBundleException, ArgumentException, InvalidSignatureException,
729733
InvalidTrytesException, InvalidSecurityLevelException, InvalidAddressException, NoInclusionStatesException, NoNodeInfoException {
730734

@@ -746,7 +750,7 @@ public GetAccountDataResponse getAccountData(String seed, int security, int star
746750
throw new IllegalStateException("Invalid inputs provided");
747751
}
748752

749-
GetNewAddressResponse gna = getNewAddress(seed, security, 0, true, 0, true);
753+
GetNewAddressResponse gna = getNewAddress(seed, security, index, checksum, total, returnAll);
750754
GetTransferResponse gtr = getTransfers(seed, security, start, end, inclusionStates);
751755
GetBalancesAndFormatResponse gbr = getInputs(seed, security, start, end, threshold);
752756

‎src/test/java/jota/IotaAPITest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public void shouldFindTransactionObjects() {
132132

133133
@Test
134134
public void shouldGetAccountData() throws NoInclusionStatesException, InvalidTrytesException, NoNodeInfoException, ArgumentException, InvalidBundleException, InvalidSecurityLevelException, InvalidAddressException, InvalidSignatureException {
135-
GetAccountDataResponse gad = iotaClient.getAccountData(TEST_SEED1, 2, 0, 0, true, 100);
135+
GetAccountDataResponse gad = iotaClient.getAccountData(TEST_SEED1, 2, 0, true, 0, true, 0, 0, true, 100);
136136
assertThat(gad, IsNull.notNullValue());
137137
}
138138

0 commit comments

Comments
 (0)