### Important Note

Each call incurs a fixed CU charge, plus additional CUs for API operations. See the [Compute Units Usage](https://docs.blockdaemon.com/reference/compute-units-usage-events) page for details.

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

## How does it work?

When a rule references a [variable](https://docs.blockdaemon.com/docs/step-3-create-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.

### Important

Value matching is **case-sensitive**. For example, EVM addresses must be in checksum case (e.g., `0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B`) to match correctly.

---

## Receiving block events

To receive block events:

- Add the value "`block`" to the designated variable.
- Replace the `<VARIABLE_ID>` with the [variable id](https://docs.blockdaemon.com/docs/step-3-create-a-variable) you've created.

cURL

```curl
curl --location 'https://svc.blockdaemon.com/streaming/v2/variables/<VARIABLE_ID>/values' \n--header 'Content-Type: application/json' \n--header 'Accept: application/json' \n--data '{\n  "value": "block"\n}'
```

A successful response will return a variable value details.

201 - Created

```json
{
    "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](https://docs.blockdaemon.com/docs/step-3-create-a-variable) you've created.

cURL

```curl
curl --location 'https://svc.blockdaemon.com/streaming/v2/variables/<VARIABLE_ID>/values' \n--header 'Content-Type: application/json' \n--header 'Accept: application/json' \n--data '{\n  "value": "12xtAYsRUrmbniiWQqJtECiBQrMn8AypQcXhnQAc6RB6XkLW"\n}'
```

A successful response will return a variable value details.

201 - Created

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

---

## Delete a Variable Value

You can delete a variable value in two ways:

### Option 1: Delete Variable Value by Value

Deletes a specific variable value by matching the variable's ID and the exact value you want to remove. This is useful when you know the value itself but not its ID.

**Example Payload**

Request Payload

```curl
curl --request DELETE \n     --url https://svc.blockdaemon.com/streaming/v2/variables/{variable_id}/{VALUE_HERE} \n     --header 'accept: application/json' \n     --header 'authorization: Bearer 2go1YqUcuAr4WZ2-3WgSD3c7qpatZqQuNWhTVBldKZnTSUtw'
```

```json
A 204 response status indicates the variable value was successfully deleted.
```

### Option 2: Delete Variable Value by ID

Deletes a specific variable value using its value ID. Use this method when you have a value ID (e.g., from a [GET call](https://docs.blockdaemon.com/reference/find-variable-values)/when [creating a new variable value](https://docs.blockdaemon.com/reference/add-variable-value)).

**Example Payload**

Request Payload

```curl
curl --request DELETE \n     --url https://svc.blockdaemon.com/streaming/v2/variables/{variable_id}/values/{VALUE_ID_HERE} \n     --header 'accept: application/json' \n     --header 'authorization: Bearer YOUR_API_KEY'
```

```json
A 204 response status indicates the variable value was successfully deleted.
```

## Need Help?

Contact us through [email](mailto:support@blockdaemon.com) or our [support page](/content/support/index.html) for any issues, bugs, or assistance you may need.
