Skip to contents

Tests a stream filter's JavaScript code against a specific stream item (transaction and optional vout) without permanently creating the filter.

Usage

mc_test_stream_filter(conn, options, js_code, tx = NULL, vout = NULL)

Arguments

conn

A connection object created by mc_connect.

options

List of filter options (similar to mc_create_stream_filter).

js_code

Character string. JavaScript code to test.

tx

Optional character string. Transaction ID or hex representation of the stream item's transaction.

vout

Optional integer. Output index if the stream item is in a transaction output.

Value

The result of the filter evaluation.

Examples

if (FALSE) { # \dontrun{
result <- mc_test_stream_filter(conn, list(libraries = list()),
                                "function filter(stream, item) { return true; }",
                                tx = "txid...", vout = 0)
} # }