Docs

watchBlockNumber

Watches the block number for a specific chain.

Example

import { watchBlockNumber } from "thirdweb";
const unwatch = watchBlockNumber({
client,
chainId,
onNewBlockNumber: (blockNumber) => {
// do something with the block number
},
});
// later stop watching
unwatch();

Parameters

Returns

The unwatch function.