Predicate design
Predicates are the building blocks of Chainhook.
The core design of chainhooks revolves around the concept of predicates. Each individual chainhook has a customizable predicate that specifies what information you are scanning for.
Predicates are defined in an if-this
, then-that
format. You'll write your condition in the if-this
condition template and use then-that
to output the result.
if-this
The if-this
predicate design can use the following attributes to define the predicates. The 'scope' parameter is mandatory to use with any other parameters.
Other available parameters:
equals
op_return
ends_with
p2pkh
p2sh
p2wpkh
operation
For more information on predicate definitions, refer to the scopes reference page.
then-that
The then-that
predicate design can use the following attributes to output the result based on the if-this
condition defined.