Get event logs
get_logsQuery event logs over a block range, filtering by contract address or event signature/topics to decode and return matching logs.
Instructions
Query event logs over a block range. Filter by contract address and either an event signature (with optional indexed-argument values) or raw topics. Without an address or topic filter the range is capped at MAX_LOG_BLOCK_RANGE blocks (default 2,000, about 3-7 minutes on Elysium); with one, any range is allowed. Either way the RPC returns at most 10,000 logs per query; split longer ranges or add filters if you hit that.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| abi | No | Optional ABI used to decode logs (in addition to event). Either a JSON ABI (array of items, or a single item), or human-readable signatures such as ["function balanceOf(address owner) view returns (uint256)", "event Transfer(address indexed from, address indexed to, uint256 value)"]. | |
| args | No | Values for indexed event parameters, by name, e.g. {"from": "0x..."}. A list of values means "any of". Requires event. | |
| event | No | Event to filter by, as a human-readable signature ("event Transfer(address indexed from, address indexed to, uint256 value)") or a JSON ABI event item. Matching logs are decoded. | |
| limit | No | Maximum logs to return (default 1000). The response says if results were truncated. | |
| topics | No | Raw topic filter (alternative to event): position-matched 32-byte hex values, a list for "any of", or null for wildcard. | |
| address | No | Contract address, or a list of up to 20, that emitted the logs. | |
| toBlock | No | Last block (inclusive): a number or tag. Defaults to latest. | |
| fromBlock | Yes | First block (inclusive): a number or tag (latest, safe, finalized, earliest). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| logs | Yes | ||
| count | Yes | Number of logs returned. | |
| toBlock | Yes | ||
| fromBlock | Yes | ||
| truncated | Yes | ||
| totalMatched | Yes | Number of logs the node returned before applying limit. |