1111
1212import multichain .command .builders .QueryBuilderRAWTransaction ;
1313import multichain .object .Address ;
14- import multichain .object .AddressBalanceAsset ;
14+ import multichain .object .AddressBalance ;
1515import multichain .object .SignedTransactionRAW ;
1616import multichain .object .TransactionRAW ;
1717import multichain .object .formatters .RAWTransactionFormatter ;
2020
2121/**
2222 * @author Ub - H. MARTEAU
23- * @version 3.0
23+ * @version 4.10
2424 */
2525public class RAWTransactionCommand extends QueryBuilderRAWTransaction {
2626
@@ -354,63 +354,76 @@ public String createRawSendFrom(String address, List<RawParam> rawParams) throws
354354 * Note that the transaction's inputs are not signed, and
355355 * it is not stored in the wallet or transmitted to the network.
356356 *
357+ * Create a transaction spending the given inputs.
358+ *
357359 * Arguments:
358- * 1. "transactions" (string, required) A json array of json objects
359- * [
360- * {
361- * "txid":"id", (string, required) The transaction id
362- * "vout":n (numeric, required) The output number
363- * }
364- * ,...
365- * ]
366- * 2. "addresses" (string, required) a json object with addresses as keys and amounts as values
367- * {
368- * "address":
369- * x.xxx (numeric, required) The key is the address, the value is the native currency amount
370- * or
371- * { (object) A json object of assets to send
372- * "asset-identifier" : asset-quantity
373- * ,...
374- * }
375- * or
376- * { (object) A json object describing new asset issue
377- * "issue" :
378- * {
379- * "raw" : n (numeric, required) The asset total amount in raw units
380- * ,...
381- * }
382- * ,...
383- * }
384- * or
385- * { (object) A json object describing follow-on asset issue
386- * "issuemore" :
387- * {
388- * "asset" : "asset-identifier" (string, required) Asset identifier - one of the following: issue txid. asset
389- * reference, asset name.
390- * "raw" : n (numeric, required) The asset total amount in raw units
391- * ,...
392- * }
393- * ,...
394- * }
395- * or
396- * { (object) A json object describing permission change
397- * "permissions" :
398- * {
399- * "type" : "permission(s)" (string,required) Permission strings, comma delimited. Possible values:
400- * connect,send,receive,issue,mine,admin,activate
401- * "startblock" (numeric, optional) Block to apply permissions from (inclusive). Default - 0
402- * "endblock" (numeric, optional) Block to apply permissions to (exclusive). Default - 4294967295
403- * "timestamp" (numeric, optional) This helps resolve conflicts between permissions assigned by the same
404- * administrator. Default - current time
405- * ,...
406- * }
407- * ,...
408- * }
409- * ,...
410- * }
360+ * 1. transactions (array, required) A json array of json objects
361+ * [
362+ * {
363+ * "txid":"id", (string, required) The transaction id
364+ * "vout":n (numeric, required) The output number
365+ * "scriptPubKey": "hex", (string, optional) script key, used if cache=true or action=sign
366+ * "redeemScript": "hex" (string, optional) redeem script, used if action=sign
367+ * "cache":true|false (boolean, optional) If true - add cached script to tx, if omitted - add automatically if needed
368+ * }
369+ * ,...
370+ * ]
371+ * 2. addresses (object, required) a json object with addresses as keys and amounts as values
372+ * {
373+ * "address":
374+ * x.xxx (numeric, required) The key is the address, the value is the native currency amount
375+ * or
376+ * { (object) A json object of assets to send
377+ * "asset-identifier" : asset-quantity
378+ * ,...
379+ * }
380+ * or
381+ * { (object) A json object describing new asset issue
382+ * "issue" :
383+ * {
384+ * "raw" : n (numeric, required) The asset total amount in raw units
385+ * ,...
386+ * }
387+ * ,...
388+ * }
389+ * or
390+ * { (object) A json object describing follow-on asset issue
391+ * "issuemore" :
392+ * {
393+ * "asset" : "asset-identifier"(string, required) Asset identifier - one of the following: issue txid. asset reference, asset name.
394+ * "raw" : n (numeric, required) The asset total amount in raw units
395+ * ,...
396+ * }
397+ * ,...
398+ * }
399+ * or
400+ * { (object) A json object describing permission change
401+ * "permissions" :
402+ * {
403+ * "type" : "permission(s)" (string,required) Permission strings, comma delimited. Possible values:
404+ * connect,send,receive,issue,mine,admin,activate,create
405+ * "startblock" : n (numeric, optional) Block to apply permissions from (inclusive). Default - 0
406+ * "endblock" : n (numeric, optional) Block to apply permissions to (exclusive). Default - 4294967295
407+ * "timestamp" : n (numeric, optional) This helps resolve conflicts between
408+ * permissions assigned by the same administrator. Default - current time
409+ * ,...
410+ * }
411+ * ,...
412+ * }
413+ * ,...
414+ * }
415+ * 3. data (array, optional) Array of hexadecimal strings or data objects, see help appendrawdata for details.
416+ * 4."action" (string, optional, default "") Additional actions: "lock", "sign", "lock,sign", "sign,lock", "send".
411417 *
412418 * Result:
413- * "transaction" (string) hex string of the transaction
419+ * "transaction" (string) hex string of the transaction (if action= "" or "lock")
420+ * or
421+ * { (object) A json object (if action= "sign" or "lock,sign" or "sign,lock")
422+ * "hex": "value", (string) The raw transaction with signature(s) (hex-encoded string)
423+ * "complete": true|false (boolean) if transaction has a complete set of signature (0 if not)
424+ * }
425+ * or
426+ * "hex" (string) The transaction hash in hex (if action= "send")
414427 *
415428 * @param txids
416429 * @param vouts
@@ -419,17 +432,22 @@ public String createRawSendFrom(String address, List<RawParam> rawParams) throws
419432 * @return
420433 * @throws MultichainException
421434 */
422- public String createRawTransaction (List <TxIdVout > inputs , List <AddressBalanceAsset > addessAssets )
435+ public String createRawTransaction (List <TxIdVout > inputs , List <AddressBalance > addessBalances , List < String > hexMetaData )
423436 throws MultichainException {
424437 String createTransactionRAW = new String ();
425438
426- Object objectTransactionRAW = executeCreateRawTransaction (inputs , addessAssets );
439+ Object objectTransactionRAW = executeCreateRawTransaction (inputs , addessBalances , hexMetaData );
427440 if (verifyInstance (objectTransactionRAW , String .class )) {
428441 createTransactionRAW = (String ) objectTransactionRAW ;
429442 }
430443
431444 return createTransactionRAW ;
432445 }
446+
447+ public String createRawTransaction (List <TxIdVout > inputs , List <AddressBalance > addessBalances )
448+ throws MultichainException {
449+ return createRawTransaction (inputs , addessBalances , null );
450+ }
433451
434452 /**
435453 *
0 commit comments