Closed this issue 10 months ago · 2 comments
I tried to get the block from the date but it says error like this
Source code is following:
const EthDater = require('ethereum-block-by-date'); const dater = new EthDater(web3); let blockFrom = await dater.getDate('2023-06-21T08:00:00Z');
Please let me know how to fix this error. Thank you😀
Hi @0xColm,
What is your lib? web3.js or ethers.js? What is your web3 provider?
The error you provided shows that function getBlock(1) of you web3 object returns null. Could you check if your web3 object is returning the correct value for getBlock(1)?
getBlock(1)
null