1

1. Create a Filter Data Source

Request

curl --location 'https://api.allium.so/api/v1/streams/data-management/filter-data-sources' \
--header 'X-API-KEY: <YOUR_ALLIUM_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Ethereum Addresses",
"type": "string_array",
"description": "Allowlist of Ethereum addresses for transactions we want to track."
}'

Response

{
    "id": "3123712-aqw1-asdg-0293-1f48914e1e3f",
    "name": "Ethereum Addresses",
    "type": "string_array",
    "description": "Allowlist of Ethereum addresses for transactions we want to track."
}
2

2. Update values in Filter Data Source

After creating a Filter Data Source, we can now add the Ethereum addresses we would like to track to it.NOTE: For any running workflows, changing the values in a Data Source will be immediately applied.Use either of the following to update values in the Filter Data Source:
# Add value
curl --location 'https://api.allium.so/api/v1/streams/data-management/filter-data-sources/3123712-aqw1-asdg-0293-1f48914e1e3f/values' \
--header 'X-API-KEY: <YOUR_ALLIUM_API_KEY>' \
--header 'Content-Type: application/json' \
--data '
{
    "operation": "ADD",
    "values": [
        "0x0dfcac7b81015ea777f79d4e2f03980091ea0333",
        "0x0dfcac7b81015ea777f79d4e2f03980091ea1333",
        "0x0dfcac7b81015ea777f79d4e2f03980091ea2333",
        "0x0dfcac7b81015ea777f79d4e2f03980091ea3333",
        "0x0dfcac7b81015ea777f79d4e2f03980091ea4333",
        "0x0dfcac7b81015ea777f79d4e2f03980091ea5333",
        "0x0dfcac7b81015ea777f79d4e2f03980091ea6333",
        "0x0dfcac7b81015ea777f79d4e2f03980091ea7333",
        "0x0dfcac7b81015ea777f79d4e2f03980091ea8333",
        "0x0dfcac7b81015ea777f79d4e2f03980091ea9333",
    ]
}'
# Delete value
curl --location 'https://api.allium.so/api/v1/streams/data-management/filter-data-sources/3123712-aqw1-asdg-0293-1f48914e1e3f/values' \
--header 'X-API-KEY: <YOUR_ALLIUM_API_KEY>' \
--header 'Content-Type: application/json' \
--data '
{
    "operation": "DELETE",
    "values": [
        "0x0dfcac7b81015ea777f79d4e2f03980091ea2333"
    ]
}'
3

3. Create a Filter

After we have a Filter Data Source with values, we can now create a Filter that filters our Allium Ethereum transactions stream based on the wallet addresses we’re interested in.NOTE: Filters that uses a data source need to specify "type": "data_source"

Request

curl --location 'https://api.allium.so/api/v1/streams/data-management/filters' \
--header 'X-API-KEY: <YOUR_ALLIUM_API_KEY>' \
--header 'Content-Type: application/json' \
--data '
{
    "filter": {
        "field": "address",
        "operator": "IN",
        "type": "data_source",
        "data_source_id": "3123712-aqw1-asdg-0293-1f48914e1e3f"
    }
}
'

Response

{
    "id": "afas231k-das9-1232-als1-a89c32ca3c57",
    "filter": {
        "field": "address",
        "value": ["0x0dfcac7b81015ea777f79d4e2f03980091ea0333",
            "0x0dfcac7b81015ea777f79d4e2f03980091ea1333",
            "0x0dfcac7b81015ea777f79d4e2f03980091ea2333",
            "0x0dfcac7b81015ea777f79d4e2f03980091ea3333",
            "0x0dfcac7b81015ea777f79d4e2f03980091ea4333",
            "0x0dfcac7b81015ea777f79d4e2f03980091ea5333",
            "0x0dfcac7b81015ea777f79d4e2f03980091ea6333",
            "0x0dfcac7b81015ea777f79d4e2f03980091ea7333",
            "0x0dfcac7b81015ea777f79d4e2f03980091ea8333",
            "0x0dfcac7b81015ea777f79d4e2f03980091ea9333"
        ],
        "operator": "IN",
    }
}
4

4. Create a Workflow

To have any transactions that these wallet addresses engage in published to our webhook, simply specify a webhook URL in the data destination config.

Request

curl --location 'https://api.allium.so/api/v1/streams/data-management/workflows' \
--header 'X-API-KEY: <YOUR_ALLIUM_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
    "description": "Ethereum transactions workflow",
    "filter_id": "afas231k-das9-1232-als1-a89c32ca3c57",
    "data_source_config": {
        "type": "PUBSUB",
        "topic": "ethereum.transactions"
    },
    "data_destination_config": {
        "type": "PUBSUB",
        "delivery_type": "PUSH",
        "webhook_url": "https://my-ethereum-transactions-webhook.a.run.app/"
    }
}
'

Response

{
    "id": "50225675-69a6-4abc-bfdc-1ad0b1a223f9",
    "description": "Ethereum transactions workflow",
    "filter_id": "afas231k-das9-1232-als1-a89c32ca3c57",
    "data_source_config": {
        "type": "PUBSUB",
        "topic": "ethereum.transactions"
    },
    "data_destination_config": {
        "type": "PUBSUB",
        "topic": "allium.ethereum.transactions.data_transformation.abc56e30-0cfb-4998-804d-8fc2fe0065fc",
        "subscription": "allium_app.allium.ethereum.transactions.destination.data_transformation.abc56e30-0cfb-4998-804d-8fc2fe0065fc.push",
        "delivery_type": "PUSH",
        "webhook_url": "https://my-ethereum-transactions-webhook.a.run.app/"
    },
    "external_workflow_id": null,
    "status": "running"
}
5

5. Check that the Workflow has been created

Simply poll for the Workflow until the external_workflow_id returned is non-null, which indicates that our configured webhook URL is now receiving transactions related to the filtered wallet addresses.

Request

curl --location 'https://api.allium.so/api/v1/streams/data-management/workflows/50225675-69a6-4abc-bfdc-1ad0b1a223f9' \
--header 'X-API-KEY: <YOUR_ALLIUM_API_KEY>'