Contents

eth_getLogs RPC method

Parameters:

  1. Object - The filter options in the following shape:

    fromBlock - Integer block number encoded as a hexadecimal, "latest","pending", or "earliest" tags.

    toBlock - Integer block number encoded as a hexadecimal, "latest","pending", or "earliest" tags.

    address - Contract address or a list of addresses from which logs should originate.

    topics - Array of DATA topics. Topics are order-dependent. Go here to learn more about topics.

    blockhash - - (optional) With the addition of EIP-234, blockHash will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to fromBlock = toBlock = the block number with hash blockHash. If blockHash is present in in the filter criteria, then neither fromBlock nor toBlock are allowed.

    Returns:

  1. Array - Array of log objects, or an empty array if nothing has changed since last poll:

    removed - Boolean true if log was removed, due to a chain reorganization. false if its a valid log.

    logIndex - Integer of log index position in the block encoded as a hexadecimal. null if pending.

    transactionIndex - Integer of transactions index position log was created from. null if pending.

    transactionHash - Hash of the transactions this log was created from. null if pending.

    blockHash - Hash of the block where this log was in. null when its pending. null if pending.

    blockNumber - The block number where this log was, encoded as a hexadecimal. null if pending.

    address - The address from which this log originated.

    data - Contains one or more 32 Bytes non-indexed arguments of the log.

    topics - Array of 0 to 4 32 Bytes of indexed log arguments.

Code Examples:

curl http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"method":"eth_getLogs","params":[{"address": "0xdAC17F958D2ee523a2206206994597C13D831ec7"}],"id":1,"jsonrpc":"2.0"}'
Ready to try QuickNode? Start your 7-day free trial