Static and Dynamic Blueprints filters

📘

You can create Blueprints with variables that will be instantiated dynamically when deploying a Stream

When creating a Blueprint you can work with two different kind of filters: static (hardcoded) filters, and variable (dynamic) filters. Whereas static filters will be the same each time a Blueprint is deployed, variable filters can be instantiated when deploying a Stream, programmatically.

Let's see how we can create both a static and a variable filter tracking the popular Transfer event, as defined in the ERC20 standard. In this example we're creating:

  • a static filter, set to 100000000
  • a dynamic filter, called "to", that will be instantiated when a Blueprint is deployed.
13701370

When deploying a Blueprint with the following filters, the value filter will be always set to 100000000, but the to filter will need take an argument every time. This allows you to deploy as many Streams as you want from the same Blueprint, with different to filters.

When deploying a Blueprint from the UI, it will look like this:

20582058

You can also deploy a Blueprint with cURL or any other programming language, for example like this:

curl --request POST \
     --url https://api.hal.xyz/v1/blueprints/873b8c8d-0d9d-424d-a69f-67c2f673d4b7/deploy \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --header 'X-Api-Key: <YOUR API KEY>' \
     --data '
{
     "variables": {
          "to": "0x000..."
     },
     "name": "Track USDC transfers > 100 with Events"
}