Creates a new transaction filter on the blockchain. Transaction filters are JavaScript programs that validate or transform transactions.
Arguments
- conn
A connection object created by
mc_connect.- name
Character string. Name of the filter (must be unique).
- options
List of filter options. Usually includes
for(target asset or stream) andlibraries(list of library names). Example:list("for" = "asset1", libraries = list("lib1")).- js_code
Character string. The JavaScript code for the filter.
See also
mc_create_stream_filter, mc_list_tx_filters
Other filters:
mc_approve_from(),
mc_create_stream_filter(),
mc_create_upgrade(),
mc_get_filter_code(),
mc_list_stream_filters(),
mc_list_tx_filters(),
mc_list_upgrades(),
mc_run_stream_filter(),
mc_run_tx_filter(),
mc_test_stream_filter(),
mc_test_tx_filter()
Examples
if (FALSE) { # \dontrun{
js_code <- "function filter(tx) { return tx.vin.length > 0; }"
mc_create_tx_filter(conn, "myfilter", list("for" = "asset1"), js_code)
} # }