Skip to contents

Initialises a partial atomic exchange transaction by specifying the first locked output and the desired assets/currency in return. This is the first step in constructing a multi‑party atomic exchange.

Usage

mc_create_raw_exchange(conn, txid, vout, amounts)

Arguments

conn

A connection object created by mc_connect.

txid

Character string. Transaction ID of the locked output (obtained via mc_prepare_lock_unspent).

vout

Integer. Output index (vout) of the locked output.

amounts

A list specifying the assets or native currency asked for in exchange. Format: list(asset_name = quantity, ...) or a numeric value for native currency.

Value

Character string. Raw partial transaction in hexadecimal.

Examples

if (FALSE) { # \dontrun{
# First, lock some output
locked <- mc_prepare_lock_unspent(conn, amounts = list(myasset = 10))
# Create the exchange offer
offer <- mc_create_raw_exchange(conn, locked$txid, locked$vout,
                                amounts = list(otherasset = 5))
} # }