Search code examples
ethereumweb3js

eth_getLogs compared to eth.getPastLogs


Is using eth_getLogs the same as eth.getPastLogs in the web3js library? Wondering what the difference is and when should they be used?


Solution

  • These functions are the same. The function getPastLogs() internally just calls getLogs() (with one default return type).