Skip to contents

Tests a transaction filter's JavaScript code against a given transaction without permanently creating the filter.

Usage

mc_test_tx_filter(conn, options, js_code, tx = NULL)

Arguments

conn

A connection object created by mc_connect.

options

List of filter options (similar to mc_create_tx_filter).

js_code

Character string. JavaScript code to test.

tx

Optional character string. Hex representation or transaction ID of a transaction to test against. If omitted, a generic test is performed.

Value

The result of the filter evaluation (typically a boolean or transformed transaction).

Examples

if (FALSE) { # \dontrun{
result <- mc_test_tx_filter(conn, list("for" = "asset1"),
                            "function filter(tx) { return true; }",
                            tx = "txid...")
} # }