Logs

The Event Log API was designed to provide an alternative to the native eth_getLogs.

Below are the list of supported filter parameters:

  • fromBlock, toBlock, address

  • topic0, topic1, topic2, topic3 (32 Bytes per topic)

  • topic0_1_opr (and|or between topic0 & topic1), topic1_2_opr (and|or between topic1 & topic2), topic2_3_opr (and|or between topic2 & topic3), topic0_2_opr (and|or between topic0 & topic2), topic0_3_opr (and|or between topic0 & topic3), topic1_3_opr (and|or between topic1 & topic3)

  • FromBlock & ToBlock accepts the blocknumber (integer, NOT hex) or 'latest' (earliest & pending is NOT supported yet)

  • Topic Operator (opr) choices are either 'and' or 'or' and are restricted to the above choices only

  • FromBlock & ToBlock parameters are required

  • An address and/or topic(X) parameters are required, when multiple topic(X) parameters are used the topicX_X_opr (and|or operator) is also required

For performance & security considerations, only the first 1000 results are return. So please narrow down the filter parameters.

Sample Log API Queries

Get Event Logs from block number 8437178 to 'latest' , where log address = 0x261DA9C7E7932cCBC7d556836cf7128f543312b9 and topic[0] = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef

https://api-testnet.snowscan.xyz/api
   ?module=logs
   &action=getLogs
   &fromBlock=8437178
   &toBlock=latest
   &address=0x261DA9C7E7932cCBC7d556836cf7128f543312b9
   &topic0=0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
   &apikey=YourApiKeyToken

Get Event Logs from block number 8437178 to block 'latest', where log address = 0xd00ae08403B9bbb9124bB305C09058E32C39A48c, topic[0] = 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c 'AND' topic[1] = 0x000000000000000000000000c9c6f026e489e0a8895f67906ef1627f1e56860d

https://api-testnet.snowscan.xyz/api
   ?module=logs
   &action=getLogs
   &fromBlock=2444350
   &toBlock=latest
   &address=0xd00ae08403B9bbb9124bB305C09058E32C39A48c
   &topic0=0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c
   &topic0_1_opr=and
   &topic1=0x000000000000000000000000c9c6f026e489e0a8895f67906ef1627f1e56860d
   &apikey=YourApiKeyToken

Last updated