Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add documentation for echo activity api #560

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions echo/evm/activity.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: 'Activity (Alpha)'
openapi: 'GET /echo/alpha/activity/{address}'
---

<Note>
This endpoint is currently in alpha and available only for testing purposes. Authentication is required using a normal Dune API key.
</Note>

The Activity endpoint provides a real-time feed of on-chain activity for any EVM address. Activity is returned in chronological order (newest first) and includes:
- Native token transfers
- ERC20 token transfers with metadata (symbol, decimals)
- ERC721 (NFT) transfers with token IDs
- Contract interactions with decoded function calls

# Response Fields

| Field | Description | Type |
|--------|-------------|------|
| activity | Array of activity items | array |
| next_offset | Pagination cursor for next page | string |

## Activity Item Fields

| Field | Description | Type |
|--------|-------------|------|
| chain_id | ID of the blockchain where activity occurred | integer |
| block_number | Block number where activity occurred | integer |
| block_time | Unix timestamp of the block | integer |
| transaction_hash | Hash of the transaction | string |
| type | Activity type: 'transfer', 'call', or 'mint' | string |
| asset_type | Asset type: 'native', 'erc20', or 'erc721' | string |
| token_address | Contract address of token (for ERC20/ERC721) | string |
| from | Address initiating the activity | string |
| to | Recipient address | string |
| value | Amount transferred (in WEI) or contract call value | string |
| id | Token ID (for ERC721 transfers) | string |
| metadata | Additional context about the activity | object |
| metadata.symbol | Token symbol (for ERC20) | string |
| metadata.decimals | Token decimals (for ERC20) | integer |
| metadata.description | Human-readable description of the activity | string |
| function | Decoded function information (for contract calls) | object |
| function.name | Name of the called function | string |
| function.inputs | Array of decoded function parameters | array |

# Ordering

Activities are ordered by block time (descending) and then by transaction index within each block, so that newer activities appear first.

# Pagination

This endpoint uses cursor-based pagination. You can use the `limit` parameter to define the maximum page size.
Results might at times be less than the maximum page size.
The `next_offset` value is included in the initial response and can be utilized to fetch the next page of results by passing it as the `offset` query parameter in the next request.

<Warning>You can only use the value from `next_offset` to set the `offset` parameter of the next page of results. Using your own `offset` value will not have any effect.</Warning>
178 changes: 177 additions & 1 deletion echo/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,79 @@
}
],
"paths": {
"/echo/alpha/activity/{address}": {
"get": {
"tags": [
"activity"
],
"summary": "Get EVM activity for a given address",
"description": "This endpoint provides a real-time feed of on-chain activity for any EVM address, including token transfers (native, ERC20, ERC721), contract interactions, and transaction details.",
"operationId": "getEvmActivity",
"parameters": [
{
"name": "X-Dune-Api-Key",
"in": "header",
"description": "API key to access the service",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "address",
"in": "path",
"description": "Address to get activity for",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "offset",
"in": "query",
"description": "The offset to paginate through result sets. This is a cursor being passed from the previous response, only use what the backend returns here.",
"required": false,
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "limit",
"in": "query",
"description": "Maximum number of activity items to return",
"required": false,
"schema": {
"type": "integer",
"format": "int64",
"nullable": true,
"minimum": 0
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ActivityResponse"
}
}
}
},
"400": {
"description": "Bad Request - The request could not be understood by the server due to malformed data"
},
"404": {
"description": "Not Found"
},
"500": {
"description": "Internal Server Error - A generic error occurred on the server."
}
}
}
},
"/echo/beta/balances/svm/{address}": {
"get": {
"tags": [
Expand Down Expand Up @@ -957,6 +1030,105 @@
},
"components": {
"schemas": {
"ActivityItem": {
"type": "object",
"required": [
"chain_id",
"block_number",
"block_time",
"transaction_hash",
"type",
"from",
"to",
"value"
],
"properties": {
"chain_id": {
"type": "integer",
"format": "int64"
},
"block_number": {
"type": "integer",
"format": "int64"
},
"block_time": {
"type": "integer",
"format": "int64"
},
"transaction_hash": {
"type": "string"
},
"type": {
"type": "string",
"enum": ["transfer", "call", "mint"]
},
"asset_type": {
"type": "string",
"enum": ["native", "erc20", "erc721"]
},
"token_address": {
"type": "string"
},
"from": {
"type": "string"
},
"to": {
"type": "string"
},
"value": {
"type": "string"
},
"id": {
"type": "string"
},
"metadata": {
"type": "object",
"properties": {
"symbol": {
"type": "string"
},
"decimals": {
"type": "integer"
},
"description": {
"type": "string"
}
}
},
"function": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"inputs": {
"type": "array",
"items": {
"type": "object"
}
}
}
}
}
},
"ActivityResponse": {
"type": "object",
"required": [
"activity"
],
"properties": {
"activity": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ActivityItem"
}
},
"next_offset": {
"type": "string",
"nullable": true
}
}
},
"BalanceData": {
"type": "object",
"required": [
Expand Down Expand Up @@ -1435,6 +1607,10 @@
}
},
"tags": [
{
"name": "activity",
"description": "Activity API"
},
{
"name": "balance",
"description": "Balances API"
Expand All @@ -1448,4 +1624,4 @@
"description": "Transactions API"
}
]
}
}