Skip to contents

Convenience function to send a single asset (or native currency) to an address. Equivalent to mc_send but with a simpler interface.

Usage

mc_send_asset(
  conn,
  address,
  asset,
  quantity,
  native_amount = 0,
  comment = "",
  comment_to = ""
)

Arguments

conn

A connection object created by mc_connect.

address

Character string. Recipient address.

asset

Character string. Asset name, reference, or issuance transaction ID.

quantity

Numeric. Amount of the asset to send.

native_amount

Numeric. Amount of native currency to send (default 0).

comment

Character string. Optional transaction comment.

comment_to

Character string. Optional comment‑to field.

Value

A character string containing the transaction ID.

Examples

if (FALSE) { # \dontrun{
# Send 100 units of "myasset"
txid <- mc_send_asset(conn, "1A...", "myasset", 100)

# Send asset along with 0.5 native coins
txid <- mc_send_asset(conn, "1A...", "myasset", 100, native_amount = 0.5)
} # }