Generate list of block numbers
Closed this issue · 3 comments
StayFoolisj commented
monosux commented
Hi,
what do you mean? Like first blocks of every day during 3 years? If so, try something like this:
let blocks = await dater.getEvery(
'days',
'2019-09-01T12:00:00Z', // put start date here,
'2019-09-30T12:00:00Z' // put end date here
);
monosux commented
It will return you something like this:
[
{
date: '2019-09-01T12:00:00Z', // searched date
block: 8464234, // found block number
timestamp: 1567339207 // found block timestamp
},
{
date: '2019-09-02T12:00:00Z',
block: 8470641,
timestamp: 1567425601
},
{
date: '2019-09-03T12:00:00Z',
block: 8477057,
timestamp: 1567512020
},
...
]
monosux commented
Hi, @StayFoolisj I am closing the issue, feel free to contact me if you have more questions.