diff --git a/evm/activity.mdx b/evm/activity.mdx index 8d929d1..36a4056 100644 --- a/evm/activity.mdx +++ b/evm/activity.mdx @@ -86,9 +86,33 @@ If you request `?chain_ids=1,9999,10`, the API returns activity for chains 1 and Check the [Supported Chains](/evm/supported-chains) page to see which chains are currently supported for the Activity endpoint. -## Token Filtering +## Filtering -We include all the data needed for custom filtering in the responses, allowing you to implement your own filtering logic. For a detailed explanation of our approach, see our [Token Filtering](/token-filtering) guide. +You can filter activities server-side using the following query parameters: + +- **`token_address`** — Filter by token contract address. Accepts a single address or a comma-separated list. For example, pass the USDC contract address to return only USDC-related activity, or pass multiple addresses to match any of them. Note: swap and call activities do not have a single token address, so they are always excluded when this filter is set. Native transfers are also excluded since they have no token contract. +- **`activity_type`** — Filter by activity type. Accepts a single value or a comma-separated list. Accepted values: `send`, `receive`, `mint`, `burn`, `swap`, `approve`, `call`. +- **`asset_type`** — Filter by asset standard. Accepts a single value or a comma-separated list. Accepted values: `native`, `erc20`, `erc721`, `erc1155`. Use `native` to include native token transfers (e.g. ETH). Contract call activities have no asset type and are excluded when this filter is set. + +All filters are optional and can be combined. For example, to get only native token receives: + +``` +GET /v1/evm/activity/{address}?activity_type=receive&asset_type=native +``` + +To get only sends and receives (multi-value): + +``` +GET /v1/evm/activity/{address}?activity_type=send,receive +``` + +Or to get only USDC sends: + +``` +GET /v1/evm/activity/{address}?token_address=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48&activity_type=send +``` + +For additional client-side filtering, we include all the data needed in the responses. See our [Token Filtering](/token-filtering) guide for more details. ## Compute Unit Cost diff --git a/evm/openapi/activity.json b/evm/openapi/activity.json index 7da035f..37aba12 100644 --- a/evm/openapi/activity.json +++ b/evm/openapi/activity.json @@ -73,6 +73,36 @@ "maximum": 100, "default": 20 } + }, + { + "name": "token_address", + "in": "query", + "description": "Filter activities by token contract address. Provide a single address (e.g. `?token_address=0xa0b8...`) or a comma-separated list (e.g. `?token_address=0xa0b8...,0xdac1...`). Only activities involving the specified token(s) will be returned. Swap and call activities are excluded when this filter is set, as they do not have a single token address. Native transfers are also excluded since they have no token contract.", + "required": false, + "schema": { + "type": "string" + }, + "example": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" + }, + { + "name": "activity_type", + "in": "query", + "description": "Filter activities by type. Provide a single value (e.g. `?activity_type=send`) or a comma-separated list (e.g. `?activity_type=send,receive`). Only activities matching one of the specified types will be returned.", + "required": false, + "schema": { + "type": "string" + }, + "example": "send,receive" + }, + { + "name": "asset_type", + "in": "query", + "description": "Filter activities by asset standard. Provide a single value (e.g. `?asset_type=native`) or a comma-separated list (e.g. `?asset_type=erc20,erc721`). Use `native` to include native token transfers (e.g. ETH). Contract call activities have no asset type and are excluded when this filter is set.", + "required": false, + "schema": { + "type": "string" + }, + "example": "erc20" } ], "responses": {