Appends arbitrary data (metadata) to a raw transaction. The data is embedded in an output with zero native value.
Arguments
- conn
A connection object created by
mc_connect.- tx_hex
Character string. The raw transaction hex.
- data
Data to embed. Can be a string or a list (converted to JSON then hex).
Examples
if (FALSE) { # \dontrun{
# Add a text note
updated_hex <- mc_append_raw_data(conn, tx_hex, "This is a note.")
# Add JSON metadata
updated_hex <- mc_append_raw_data(conn, tx_hex, list(tag = "invoice", id = 123))
} # }