Language

Choose a language

/build/rpc / btc

simulaterawtransaction

simulaterawtransaction ( ["rawtx",...] {"include_watchonly":bool,...} ) Calculate the balance change resulting in the signing and broadcasting of the given transaction(s). Arguments: 1. rawtxs (json array, optional) An array of hex strings of raw transactions. [ "rawtx", (string) ... ] 2. options (json object, optional) Options object that can be used to pass named arguments, listed below. Named Arguments: include_watchonly (boolean, optional, default=true for watch-only wallets, otherwise false) Whether to include watch-only addresses (see RPC importaddress) Result: { (json object) "balance_change" : n (numeric) The wallet balance change (negative means decrease). } Examples: > bitcoin-cli simulaterawtransaction ["myhex"] > curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "simulaterawtransaction", "params": [["myhex"]]}' -H 'content-type: application/json' http://127.0.0.1:8332/

Signature

simulaterawtransaction(rawtxs?: array, options?: object) → any

Code samples

curl --user "$RPC_USER:$RPC_PASS" \
  --data-binary '{"jsonrpc":"1.0","id":"docs","method":"simulaterawtransaction","params":[[],{}]}' \
  -H 'content-type: text/plain;' \
  http://127.0.0.1:8332/

Parameters

NameTypeReq.Description
rawtxsany[]An array of hex strings of raw transactions. [ "rawtx", (string) ... ]
optionsobjectOptions object that can be used to pass named arguments, listed below. Named Arguments: include_watchonly (boolean, optional, default=true for watch-only wallets, otherwise false) Whether to include watch-only addresses (see RPC importaddress)

Result

Type:  any

{ (json object) "balance_change" : n (numeric) The wallet balance change (negative means decrease). }

Source: services/core-node/bcore/src/wallet/rpc/wallet.cpp:558

C++ symbol: simulaterawtransaction