Get Contract Event Logs
1. Overview & Typical Use
Batch-query event logs and trigger transactions for a contract. Supports filtering by transaction hash, block number, and event name, with optional field projection.
- Typical use: monitor contract events, view recent contract trigger transactions, batch-query contract execution logs by hash.
- When not to use: for basic contract information only use “Get Contract Details”; for contract call statistics use “Get Contract Call Statistics”.
2. Endpoint & Authentication
POST /api/contracts/smart-contract-triggers-batch
For Base URL and authentication, see Common Network & Authentication.
3. Request
Fields
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
contractAddress | string | No | — | Contract address |
hashList | array | No | — | List of transaction hashes |
term | string | No | — | Query keyword — supports block number and event name |
fields | string | No | — | Comma-separated field names to include in list[] items |
4. Response
Fields
Top-level
| Field | Type | Required | Description | Unit/Precision |
|---|---|---|---|---|
event_list | array | Required | Event log list | — |
list | array | Required | Trigger transaction list | — |
event_list[] elements
| Field | Type | Required | Description | Unit/Precision |
|---|---|---|---|---|
block_number | integer | Required | Block height | — |
block_timestamp | integer | Required | Block time | Millisecond timestamp |
caller_contract_address | string | Required | Caller contract address | — |
contract_address | string | Required | Target contract address | — |
event_index | integer | Required | Index position of the event within the transaction | — |
event_name | string | Required | Event name | — |
event | string | Required | Full event signature | — |
result | object | Required | Event parameter key-value pairs (includes numeric index keys and named keys) | — |
result_type | object | Required | Event parameter type mapping | — |
result_with_topic | object | Required | Structured event parameters with topics (contains index array, topic hash, dataInArr array) | — |
transaction_id | string | Required | Transaction hash | — |
list[] elements
| Field | Type | Required | Description | Unit/Precision |
|---|---|---|---|---|
owner_address | string | Required | Transaction initiator address | — |
block | integer | Required | Block height | — |
hash | string | Required | Transaction hash | — |
date_created | integer | Required | Creation time | Millisecond timestamp |
contract_address | string | Required | Contract address | — |
token_id | integer | Required | Token ID (typically 0) | — |
token_value | integer | Required | Token transfer amount (typically 0) | — |
call_value | integer | Required | TRX call value | sun |
data | string | Required | Raw call data (hex-encoded) | — |
parameter | string | Required | Decoded parameters (JSON string) | — |
method | string | Required | Called method signature | — |
day | string | Required | Transaction date | YYYY-MM-DD |
confirmed | boolean | Required | Whether confirmed | — |
5. Errors
For HTTP status codes, see Common Errors. Key points for this endpoint:
- Must use POST: a GET request will return an error.
- Empty result is not an error: no matching events returns
200+ empty arrays — this is a normal response.
Last updated on: