eth_getLogs - TRON RPC Method
Query event logs on TRON. Essential for indexing TRC-20 transfers, wallet operations, and EVM-compatible smart contract integrations on the TVM-compatible Layer 1 for TRC-20 payments, wallet APIs, and low-cost smart contract execution.
Returns an array of all logs matching a given filter object on TRON.
Why TRON? Build on the TVM-compatible Layer 1 for TRC-20 payments, wallet APIs, and low-cost smart contract execution with TVM compatibility paired with native TRON wallet APIs, DPoS block production, and low-cost transaction flows.
Use Cases
The eth_getLogs method is essential for:
- Event indexing - Track contract events for TRC-20 transfers, wallet operations, and EVM-compatible smart contract integrations
- Token transfers - Monitor ERC20/ERC721 transfers
- DeFi analytics - Track swaps, liquidity events, and more
- Notification systems - Alert on specific on-chain events
Request Parameters
Starting block (default: "latest")
Ending block (default: "latest")
Contract address(es) to filter
Array of topic filters
Filter single block by hash
Response Body
Contract that emitted the log
Array of indexed topics
Non-indexed log data
Block number
Transaction hash
Log index in block
Code Examples
curl -X POST https://api-tron-mainnet.n.dwellir.com/YOUR_API_KEY/jsonrpc \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getLogs",
"params": [{
"fromBlock": "latest",
"toBlock": "latest",
"address": "0xc7885b2334355ba766f54a3ad14d5a5339934bb3",
"topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]
}],
"id": 1
}'Error Handling
| Error Code | Message | Description |
|---|---|---|
| -32005 | Query returned more than 10000 results | Reduce block range |
| -32602 | Invalid params | Invalid filter parameters |
Related Methods
eth_newFilter- Create a filter for logseth_getFilterChanges- Poll filter for new logs