Skip to main content

fundrawtransaction

Overview

The 'fundrawtransaction' method is used to add inputs to a transaction until it has enough in value to meet its out value. If the transaction initially has no inputs, they will be automatically selected. This method can add at most one change output to the outputs and won't modify existing outputs unless specified by the "subtractFeeFromOutputs" option. Note that inputs which were signed may need to be resigned after the completion since in/outputs have been added. The added inputs will not be signed; use methods like 'signrawtransactionwithkey' or 'signrawtransactionwithwallet' for that.

Request

wget --no-check-certificate --quiet \
--method POST \
--timeout=0 \
--header 'Content-Type: application/json' \
--header 'accept: application/json' \
--header 'X-CoinAPI-Key: 4303fb63-adec-42dc-b571-74bc2f2a5167' \
--body-data '{"jsonrpc":"2.0","id":1,"method":"fundrawtransaction","params": [ ]}
' \
'https://bitcoin-mainnet.node.coinapi.io'

Request Parameters

  • hexstring (string, required): The hex string of the raw transaction.
  • options (json object, optional): Additional options for the transaction. Can include fields like "replaceable", "conf_target", and "estimate_mode".
  • iswitness (boolean, optional): Specifies whether the transaction hex is a serialized witness transaction. The default value depends on heuristic tests performed during decoding.

Response

  • psbt (string): The base64-encoded partially signed transaction if not extracted.
  • hex (string): The hex-encoded network transaction if extracted.
  • complete (boolean): Indicates if the transaction has a complete set of signatures.