@@ -338,6 +338,24 @@ public List<Transaction> findTransactionObjectsByBundle(String[] input) {
338
338
* @throws InvalidTransferException is thrown when an invalid transfer is provided.
339
339
*/
340
340
public List <String > prepareTransfers (String seed , int security , final List <Transfer > transfers , String remainder , List <Input > inputs ) throws NotEnoughBalanceException , InvalidSecurityLevelException , InvalidAddressException , InvalidTransferException {
341
+ return prepareTransfers (seed , security , transfers , remainder , inputs , true );
342
+ }
343
+ /**
344
+ * Prepares transfer by generating bundle, finding and signing inputs.
345
+ *
346
+ * @param seed 81-tryte encoded address of recipient.
347
+ * @param security The security level of private key / seed.
348
+ * @param transfers Array of transfer objects.
349
+ * @param remainder If defined, this address will be used for sending the remainder value (of the inputs) to.
350
+ * @param inputs The inputs.
351
+ * @param validateInputs whether or not to validate the balances of the provided inputs
352
+ * @return Returns bundle trytes.
353
+ * @throws InvalidAddressException is thrown when the specified address is not an valid address.
354
+ * @throws NotEnoughBalanceException is thrown when a transfer fails because their is not enough balance to perform the transfer.
355
+ * @throws InvalidSecurityLevelException is thrown when the specified security level is not valid.
356
+ * @throws InvalidTransferException is thrown when an invalid transfer is provided.
357
+ */
358
+ public List <String > prepareTransfers (String seed , int security , final List <Transfer > transfers , String remainder , List <Input > inputs , boolean validateInputs ) throws NotEnoughBalanceException , InvalidSecurityLevelException , InvalidAddressException , InvalidTransferException {
341
359
342
360
// Input validation of transfers object
343
361
if (!InputValidator .isTransfersCollectionValid (transfers )) {
@@ -416,7 +434,8 @@ public List<String> prepareTransfers(String seed, int security, final List<Trans
416
434
417
435
// Get inputs if we are sending tokens
418
436
if (totalValue != 0 ) {
419
-
437
+ if (!validateInputs )
438
+ return addRemainder (seed , security , inputs , bundle , tag , totalValue , remainder , signatureFragments );
420
439
// Case 1: user provided inputs
421
440
// Validate the inputs by calling getBalances
422
441
if (inputs != null && !inputs .isEmpty ()) {
0 commit comments