I want to get logs of all transfer
methods in the block.
I am using web3.js or ether.js.
I have to set fromBlock and toBlock.
This is my sample code.
But I can't set fromBlock and toBlock.
Now, I get only logs of latest block.
web3.eth.subscribe('logs', {
fromBlock: 10150899,
toBlock: 'latest',
topics: ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"] // transfer
}, function(error, result){
// if (!error)
// console.log(result);
})
.on("connected", function(subscriptionId){
// console.log("subcriptionID === " + subscriptionId);
})
.on("data", function(log){
// console.log(log);
How to set fromBlock and toBlock in this sample?