web3.eth.getPastLogs({
fromBlock : 3150168,
toBlock : 3153168,
address: "0xAD08C190Ed643ec60afBbAEB2E284F616F3C3b43",
topics: [topics]
})
.then(result=>{})
.catch(error=>{})
how to define topics parameter?
web3.eth.getPastLogs({
fromBlock : 3150168,
toBlock : 3153168,
address: "0xAD08C190Ed643ec60afBbAEB2E284F616F3C3b43",
topics: [topics]
})
.then(result=>{})
.catch(error=>{})
how to define topics parameter?
topics - Array: An array of values which must each appear in the log entries. The order is important, if you want to leave topics out use null, e.g. [null, '0x12...']. You can also pass an array for each topic with options for that topic e.g. [null, ['option1', 'option2']]
Source - https://web3js.readthedocs.io/en/1.0/web3-eth.html#getpastlogs
e.g. topics: ["0x033456732123ffff2342342dd12342434324234234fd234fd23fd4f23d4234"]
In order to calculate topic you need to generate SHA3 from event signature, looks like:
const transfer = web3.utils.keccak256("Transfer(address,address,uint256)");
getPastLogs. In order to do this, you need to explore whole chain – Aquila Oct 13 '18 at 12:20