Skip to contents

Appends a change output to a raw transaction. This is useful when the transaction inputs exceed the required output amounts; the change is sent back to the specified address.

Usage

mc_append_raw_change(conn, tx_hex, address, native_fee = NULL)

Arguments

conn

A connection object created by mc_connect.

tx_hex

Character string. The raw transaction hex to which change is added.

address

Character string. The address that will receive the change.

native_fee

Optional numeric. Native currency fee to be deducted from the change. If provided, the change output is reduced accordingly.

Value

A character string containing the updated raw transaction hex.

Examples

if (FALSE) { # \dontrun{
# Add change to a raw transaction
updated_hex <- mc_append_raw_change(conn, tx_hex, "1A...")
} # }