Skip to contents

Appends arbitrary data (metadata) to a raw transaction. The data is embedded in an output with zero native value.

Usage

mc_append_raw_data(conn, tx_hex, data)

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).

Value

A character string containing the updated raw transaction 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))
} # }