[Reviewer hint: use ?w=1 to avoid seeing a bunch of indentation changes.]
Right now, some RPC commands return JSON data along with transaction hex strings, which means scripting and/or chaining needs to do JSON processing before being able to use the resulting transaction data. For use cases where you don’t need the extra info, this PR adds a verbose=false mode (default true) which returns only the transaction hex string.
This means you can now do things like this:
0./bitcoin-cli -regtest -named signrawtransactionwithwallet hexstring=$(
1 ./bitcoin-cli -regtest -named fundrawtransaction hexstring=$(
2 ./bitcoin-cli -regtest createrawtransaction "[]" "{\"$(
3 ./bitcoin-cli -regtest getnewaddress)\": 10.0}") verbose=false) verbose=false
This is also useful in scripts, where you perform some operation on a transaction and store the tx itself in a variable. Before you would need e.g. jq
or some other tool to do this.
Edit: signrawtransaction
has been deprecated; I chose to add verbose to the new commands withkey
/withwallet
but not to signrawtransaction
.