|
7 | 7 | */ |
8 | 8 | package multichain.command.builders; |
9 | 9 |
|
| 10 | +import java.util.HashMap; |
| 11 | +import java.util.Iterator; |
10 | 12 | import java.util.List; |
| 13 | +import java.util.Map; |
11 | 14 |
|
12 | 15 | import multichain.command.MultichainException; |
13 | 16 | import multichain.command.tools.MultichainTestParameter; |
@@ -193,8 +196,10 @@ protected static String executeCreateRawTransaction(List<TxIdVout> inputs, List< |
193 | 196 | * @return hexidecimal blob as String |
194 | 197 | * @throws MultichainException |
195 | 198 | */ |
196 | | - protected static String executeCreateRawSendFrom(String blockchainAddress, String asset, String streamItem) throws MultichainException { |
197 | | - return execute(CommandEnum.CREATERAWSENDFROM, blockchainAddress, asset, streamItem); |
| 199 | + protected static String executeCreateRawSendFrom(String blockchainAddress, String asset, Map<String, Object> streamItem) throws MultichainException { |
| 200 | + String streamItemAsJson = formatJson(streamItem); |
| 201 | + String streamItemAsArray = "[" + streamItemAsJson +"]"; |
| 202 | + return execute(CommandEnum.CREATERAWSENDFROM, blockchainAddress, asset, streamItemAsArray); |
198 | 203 | } |
199 | 204 |
|
200 | 205 | /** |
@@ -361,7 +366,7 @@ protected static String executeGetRawTransaction(String txid, int verbose) throw |
361 | 366 | */ |
362 | 367 | protected static String executeSendRawTransaction(String hexString) throws MultichainException{ |
363 | 368 | MultichainTestParameter.isNotNullOrEmpty("hexString", hexString); |
364 | | - return execute(CommandEnum.SENDRAWTRANSACTION, formatJson(hexString)); |
| 369 | + return execute(CommandEnum.SENDRAWTRANSACTION, hexString); |
365 | 370 | } |
366 | 371 |
|
367 | 372 |
|
@@ -428,7 +433,9 @@ protected static String executeSignRawTransaction(String hexString) throws Multi |
428 | 433 | protected static String executeSignRawTransactionWithPrivKey(String hexString, String privKey) throws MultichainException { |
429 | 434 | MultichainTestParameter.isNotNullOrEmpty("hexString", hexString); |
430 | 435 | MultichainTestParameter.isNotNullOrEmpty("privKey", privKey); |
431 | | - return execute(CommandEnum.SIGNRAWTRANSACTION, formatJson(hexString),"[]" ,formatJson(privKey)); |
| 436 | + Object privKeyAsObj = privKey; |
| 437 | + privKey = "[" + formatJson(privKeyAsObj) + "]"; |
| 438 | + return execute(CommandEnum.SIGNRAWTRANSACTION, hexString,"[]" ,privKey); |
432 | 439 | } |
433 | 440 |
|
434 | 441 | } |
0 commit comments