How to create transaction object to get rawtransaction in hex?
rdrk last edited by
To send raw transaction first, needed to get the raw transaction in hex format.
How can I get this raw transaction?
jb395 last edited by jb395
Use the sequence
sendrawtransaction. Here is an example https://github.com/qtumproject/documents/tree/master/en/commands#createrawtransaction-txididvoutn-addressamountdatahex--locktime---replaceable-
The main thing to watch out for is setting up the change address with the right amount, otherwise you could pay a high transaction fee.
Once you have the signed transaction in hex, you can use
sendrawtransactionor send it with the explorers (send raw transaction https://qtum.info/misc/raw-tx).
Of course, the ideal way to try this out is on Qtum Testnet.
rdrk last edited by rdrk
@jb395 But the createrawtransaction function requires txnid and other details as well. How could I get that txn id?
jb395 last edited by
@rdrk you can read about all the commands here https://github.com/qtumproject/documents/tree/master/en/commands
listunspentcommand gives available transactions https://github.com/qtumproject/documents/tree/master/en/commands#listunspent--minconf-maxconf--addresses-include_unsafe-query_options