Get current block number

Hey there, how can I get the most recent block number from any chain? With standard web3js I can get block the most recent block to get data from it, I am unsure how to do this with Moralis, it seems like I have to have a block number get stats, but I would like to first be able to get the most recent block number, thanks

Hey @DegenDeveloper, you can use getDateToBlock here https://docs.moralis.io/moralis-server/web3-sdk/native#getdatetoblock and set the date as the current or future date and it should be fetching the latest block :raised_hands:

Cheers~

1 Like