diff --git a/pom.xml b/pom.xml
index d3b98e8..a3b9207 100644
--- a/pom.xml
+++ b/pom.xml
@@ -63,6 +63,7 @@
4.12
test
+
diff --git a/src/main/java/jota/IotaAPI.java b/src/main/java/jota/IotaAPI.java
index 4c156c4..5955d38 100644
--- a/src/main/java/jota/IotaAPI.java
+++ b/src/main/java/jota/IotaAPI.java
@@ -4,6 +4,7 @@ import jota.dto.response.*;
import jota.error.ArgumentException;
import jota.error.InvalidBundleException;
import jota.error.InvalidSignatureException;
+import jota.error.NotEnoughBalanceException;
import jota.model.*;
import jota.pow.ICurl;
import jota.pow.JCurl;
@@ -318,7 +319,7 @@ public class IotaAPI extends IotaAPICoreProxy {
* @property {string} address Remainder address
* @returns {array} trytes Returns bundle trytes
**/
- public List prepareTransfers(String seed, final List transfers, String remainder, List inputs) {
+ public List prepareTransfers(String seed, final List transfers, String remainder, List inputs) throws NotEnoughBalanceException {
// Input validation of transfers object
if (!InputValidator.isTransfersCollectionCorrect(transfers)) {
@@ -687,7 +688,7 @@ public class IotaAPI extends IotaAPICoreProxy {
return getInclusionStates(hashes, latestMilestone);
}
- public SendTransferResponse sendTransfer(String seed, int depth, int minWeightMagnitude, final List transfers, Input[] inputs, String address) {
+ public SendTransferResponse sendTransfer(String seed, int depth, int minWeightMagnitude, final List transfers, Input[] inputs, String address) throws NotEnoughBalanceException {
StopWatch stopWatch = new StopWatch();
List trytes = prepareTransfers(seed, transfers, address, inputs == null ? null : Arrays.asList(inputs));
@@ -780,7 +781,7 @@ public class IotaAPI extends IotaAPICoreProxy {
final String tag,
final long totalValue,
final String remainderAddress,
- final List signatureFragments) {
+ final List signatureFragments) throws NotEnoughBalanceException {
for (int i = 0; i < inputs.size(); i++) {
long thisBalance = inputs.get(i).getBalance();
@@ -824,7 +825,7 @@ public class IotaAPI extends IotaAPICoreProxy {
totalTransferValue -= thisBalance;
}
}
- return null;
+ throw new NotEnoughBalanceException();
}
public static class Builder extends IotaAPICoreProxy.Builder {