fundrawtransaction

It will add at most one change output to the outputs.

No existing outputs will be modified unless "subtractFeeFromOutputs" is specified.

Note that inputs which were signed may need to be resigned after completion since in/outputs have been added.

The inputs added will not be signed, use signrawtransactionwithkey or signrawtransactionwithwallet for that.

All existing inputs must either have their previous output transaction be in the wallet or be in the UTXO set. Solving data must be provided for non-wallet inputs.

Note that all inputs selected must be of standard form and P2SH scripts must be in the wallet using importaddress or addmultisigaddress (to calculate fees).

You can see whether this is the case by checking the "solvable" field in the listunspent output.

Only pay-to-pubkey, multisig, and P2SH versions thereof are currently supported for watch-only

Argument #1-hexstring

Type: string, Required

Description: The hex string of the raw transaction

Argument #2-options

Type: json object, Optional

Description: Options object that can be used to pass named arguments, listed below. For backward compatibility: passing in a true instead of an object will result in {"includeWatching":true}

Argument #3-iswitness

Type: boolean, Optional
Default=depends on heuristic tests

Description: Whether the transaction hex is a serialized witness transaction. If iswitness is not present, heuristic tests will be used in decoding. If true, only witness deserialization will be tried. If false, only non-witness deserialization will be tried. This boolean should reflect whether the transaction has inputs (e.g. fully valid, or on-chain transactions), if known by the caller. Warning: the resulting transaction may become invalid if one of the unsafe inputs disappears. If that happens, you will need to fund the transaction with different inputs and republish it. Only solvable inputs can be used. Watch-only destinations are solvable if the public key and/or output script was imported, e.g. with 'importpubkey' or 'importmulti' with the 'pubkeys' or 'desc' field. The fee will be equally deducted from the amount of each specified output. Those recipients will receive less bitcoins than you enter in their corresponding amount field. If no outputs are specified here, the sender pays the fee. "unset" "economical" "conservative" Allows this transaction to be replaced by a transaction with higher fees Used for fee estimation during coin selection. "scripts": [ (json array, optional, default=[]) Scripts involved in this transaction. "script", (string) A script ... ], "descriptors": [ (json array, optional, default=[]) Descriptors that provide solving data for this transaction. "descriptor", (string) A descriptor ... ], }

     {
       "pubkeys": [        (json array, optional, default=[]) Public keys involved in this transaction.
         "pubkey",         (string) A public key
         ...
       ],

Result

  {                     (json object)
    "hex" : "hex",      (string) The resulting raw transaction (hex-encoded string)
    "fee" : n,          (numeric) Fee in BTC the resulting transaction pays
    "changepos" : n     (numeric) The position of the added change output, or -1
  }