Step 4. Add Variable Values

This section will contain a variable values details and how they work.

Variable values contain the actual addresses and event types you are interested in. All variable values should be unique.

How it works?

When a rule references a variable, it will trigger an event if its values match. This works as an OR condition, meaning that if a rule is set to match addresses A, B, and C, any transaction related to A, B, or C will trigger the rule.

📘

Info:

Please note that adding or removing a value to the variable automatically updates the corresponding rule. This ensures that changes dynamically affect event monitoring.


Receiving block events

To receive block events, add the value "block" to the designated variable.

  • Replace the <VARIABLE_ID> with the variable id you've created.
curl --location 'https://svc.blockdaemon.com/streaming/v2/variables/<VARIABLE_ID>/values' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
  "value": "block"
}'

A successful response will return a variable value details.

{
    "created_at": "2024-03-06T15:15:07.373101Z",
    "id": "4799906d-058a-4b99-874d-69874e8c0568",
    "value": "block"
}

Receiving events for a specific account address

To receive confirmed_tx and confirmed_balance events for a specific address, add the address value to the designated variable. You can add as many addresses as needed, but currently, it only supports adding one at a time.

  • Replace the <VARIABLE_ID> with the variable id you've created.
curl --location 'https://svc.blockdaemon.com/streaming/v2/variables/<VARIABLE_ID>/values' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
  "value": "12xtAYsRUrmbniiWQqJtECiBQrMn8AypQcXhnQAc6RB6XkLW"
}'

A successful response will return a variable value details.

{
    "created_at": "2024-03-07T09:00:15.142087Z",
    "id": "2c197266-6dde-47dc-a432-b9016a67d595",
    "value": "12xtAYsRUrmbniiWQqJtECiBQrMn8AypQcXhnQAc6RB6XkLW"
}

👋 Need Help?

Contact us through email or our support page for any issues, bugs, or assistance you may need.