This repository was archived by the owner on Oct 16, 2025. It is now read-only.
Releases: MetaMask/eth-block-tracker
Releases · MetaMask/eth-block-tracker
7.1.0
7.0.1
7.0.0
Changed
- BREAKING: The type of the
provider
option forPollingBlockTracker
andSubscribeBlockTracker
has changed (#130)- The
provider
option must be compatible with theSafeEventEmitterProvider
type from@metamask/eth-json-rpc-middleware
. - The new provider type should be mostly equivalent, except that it's now expected to have a
send
method. We don't use thatsend
method in this package though.
- The
Removed
- BREAKING: Remove the
Provider
exported type (#130)- We now use
@metamask/eth-json-rpc-provider
for this instead, so there was no need to re-export it.
- We now use
6.1.0
6.0.0
Added
- Add logging (#112)
- You will not be able to see log messages by default, but you can turn them on for this library by setting the
DEBUG
environment variable tometamask:eth-block-tracker:*
ormetamask:*
.
- You will not be able to see log messages by default, but you can turn them on for this library by setting the
- Add
destroy
method to block tracker classes (#106) - Update PollingBlockTracker to support new
blockResetDuration
option (#103) - Expose types that represent options to PollingBlockTracker and SubscribeBlockTracker constructors (#103)
Changed
- BREAKING: Require Node >= 14 (#113)
- BREAKING: Make BaseBlockTracker abstract (#103)
- If you are using this class directly, you must only use PollingBlockTracker or SubscribeBlockTracker.
- BREAKING: Make options for BaseBlockTracker required (#103)
- Subclasses must pass a set of options to
super
in their constructors.
- Subclasses must pass a set of options to
- Make argument to
removeAllListeners
in BaseBlockTracker optional (#103) - BREAKING: Update signatures for
_start
and_end
in BaseBlockTracker (#103)- Subclasses must provide an implementation for both of these methods; they are no longer no-ops.
- Both methods must return a promise.
- Update SubscribeBlockTracker to not pass empty
newHeads
parameter toeth_subscribe
call (#108)- This change was made because OpenEthereum does not support this parameter. While we've done our best to confirm that this will not be a breaking change for other Ethereum implementations, you will want to confirm no breakages for yours.
Security
- Add
@lavamoat/allow-scripts
to ensure that install scripts are opt-in for dependencies (#97)
5.0.1
5.0.0
4.4.3
4.0.0
Significant rewrite of eth-block-tracker
. Primary reason was optimizing network IO.
BlockTrackers no longer have manual stop/start methods, they now automatically start and stop based on listener count for the latest
and sync
events. You can force a stop by calling the EventEmitter
method removeAllListeners
.
Events now only return the block number. Internal polling is done via eth_blockNumber
.
The block
event has been removed, please use latest
or sync
.
Changed
- Added isRunning method
- Added
error
event - Renamed awaitCurrentBlock -> getLatestBlock
- Removed tx body from block
- Removed getTrackingBlock
- Removed start/stop
- Removed
block
event - Removed test/util/testBlockMiddleware
3.0.0
Changed
- npm module main now exports unprocessed source
- Module includes dist:
- Bundle:
dist/EthBlockTracker.js
- ES5 source:
dist/es5/
- Bundle:
- Fixes
awaitCurrentBlock
return value lib
renamed tosrc
eth-block-tracker
is now a normalEventEmitter
, does not provide a callback to event handlers