POSTeth_getLogs

Tron Mainnethttps://tron-mainnet.nodit.io/

Returns all event logs that match the given conditions.

Request Body
idintegerrequired
jsonrpcstringrequired
methodstringrequired
paramsoneOf[]required

It contains following parameter in order:

  1. filterOptions: The log query conditions, as an object. (required)
params[0]object
fromBlockstring

The block to start searching from. Pass a hexadecimal block number or the latest, earliest or finalized tag. pending and safe are not supported. When omitted, latest is applied.

toBlockstring

The block to stop searching at. It accepts the same tags as fromBlock, and latest is applied when omitted.

addressstring

The contract address that emitted the logs. Pass a single address or an array of addresses. By default the array allows up to 1,000 entries; exceeding that returns a -32602 error.

The contract address.

topicsobject[]

The list of topics to query. Their order is significant, and up to 4 positions can be specified. Each position may contain null (matches any value) or an array for OR conditions, and by default each position allows up to 1,000 OR candidates.

blockHashstring

A 32-byte block hash that restricts the query to a single block. When this value is given, fromBlock and toBlock must not be specified together.

Responses
addressstring

The address of the contract that emitted the log.

topicsstring[]

The list of log topics. The first entry is the event signature hash.

datastring

The ABI-encoded data for the non-indexed event arguments.

blockNumberstring

The number of the block containing the log.

blockHashstring

The hash of the block containing the log.

blockTimestampstring

The creation time of the block containing the log, in UNIX epoch seconds, hex-encoded. It is returned on GreatVoyage-v4.8.2 and later, and may be omitted on gateways that have not been upgraded yet.

transactionHashstring

The hash of the transaction that emitted the log.

transactionIndexstring

The transaction index within the block.

logIndexstring

The log index within the block.

removedboolean

Whether the log was removed by a chain reorganization.

X-API-KEY
RequestCU66
cURL
curl -X POST "https://tron-mainnet.nodit.io/" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_getLogs",
  "params": [
    {
      "address": "0x42a1e39aefa49290f2b3f9ed688d7cecf86cd6e0",
      "fromBlock": "0x3e8a920",
      "toBlock": "0x3e8a984",
      "topics": [
        "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
        "0x0000000000000000000000001975fbea3496424a88de2a147d76baa34a3d1b93",
        "0x000000000000000000000000c3abfbceb364febe625662a9af6add366df58f81"
      ]
    }
  ]
}'
Response
Example · 200
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": [
    {
      "address": "0x42a1e39aefa49290f2b3f9ed688d7cecf86cd6e0",
      "blockHash": "0x0000000003e8a947c68442f90bb271d2f7b1b8bb86f6a78a1d4f2d53ab92d81d",
      "blockNumber": "0x3e8a947",
      "blockTimestamp": "0x6a26903f",
      "data": "0x0000000000000000000000000000000000000000000000000000000000736201",
      "logIndex": "0x0",
      "removed": false,
      "topics": [
        "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
        "0x0000000000000000000000001975fbea3496424a88de2a147d76baa34a3d1b93",
        "0x000000000000000000000000c3abfbceb364febe625662a9af6add366df58f81"
      ],
      "transactionHash": "0xba60eb123d557f6b9ffefae573499b9d65ee15430a55b24cb28ef4ab2118f814",
      "transactionIndex": "0x1"
    }
  ]
}