Socket
Socket
Sign inDemoInstall

eth-block-tracker

Package Overview
Dependencies
Maintainers
7
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eth-block-tracker - npm Package Compare versions

Comparing version 4.4.3 to 5.0.0

dist/BaseBlockTracker.d.ts

71

CHANGELOG.md

@@ -1,3 +0,31 @@

### 4.0.0
# Changelog
All notable changes to this project will be documented in this file, as of version `5.0.0`.
Of prior releases, only versions `3.0.0` and `4.0.0` were documented at all.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [5.0.0] - 2021-03-25
### Changed
- **(BREAKING)** Refactor exports ([#71](https://github.com/MetaMask/eth-block-tracker/pull/71))
- **(BREAKING)** Target ES2017, remove ES5 builds ([#71](https://github.com/MetaMask/eth-block-tracker/pull/71))
- Migrate to TypeScript ([#71](https://github.com/MetaMask/eth-block-tracker/pull/71))
- Update various dependencies ([#44](https://github.com/MetaMask/eth-block-tracker/pull/44), [#49](https://github.com/MetaMask/eth-block-tracker/pull/49), [#54](https://github.com/MetaMask/eth-block-tracker/pull/54), [#59](https://github.com/MetaMask/eth-block-tracker/pull/59), [#61](https://github.com/MetaMask/eth-block-tracker/pull/61), [#62](https://github.com/MetaMask/eth-block-tracker/pull/62), [#63](https://github.com/MetaMask/eth-block-tracker/pull/63), [#70](https://github.com/MetaMask/eth-block-tracker/pull/70), [#72](https://github.com/MetaMask/eth-block-tracker/pull/72))
### Removed
- Unused production dependencies ([#60](https://github.com/MetaMask/eth-block-tracker/pull/60), [#68](https://github.com/MetaMask/eth-block-tracker/pull/68))
## [4.4.3] - 2019-08-30
This release is included in the changelog to help illustrate the differences between
major versions `4` and `5`.
## [4.0.0] - 2018-04-26
Significant rewrite of `eth-block-tracker`. Primary reason was optimizing network IO.

@@ -10,20 +38,35 @@

- added isRunning
- added `error` event
- renamed awaitCurrentBlock -> getLatestBlock
- removed tx body from block
- removed getTrackingBlock
- removed start/stop
- removed `block` event
- removed test/util/testBlockMiddleware
### 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
## [3.0.0] - 2018-04-16
### Changed
- npm module main now exports unprocessed source
- module includes dist:
- bundle: `dist/EthBlockTracker.js`
- es5 source: `dist/es5/`
- fixes `awaitCurrentBlock` return value
- Module includes dist:
- Bundle: `dist/EthBlockTracker.js`
- ES5 source: `dist/es5/`
- Fixes `awaitCurrentBlock` return value
- `lib` renamed to `src`
- `eth-block-tracker` is now a normal `EventEmitter`, does not provide a callback to event handlers
## [2.0.0] - 2017-06-14
## [1.0.0] - 2017-02-03
[Unreleased]:https://github.com/MetaMask/eth-block-tracker/compare/v5.0.0...HEAD
[5.0.0]:https://github.com/MetaMask/eth-block-tracker/compare/v4.4.3...v5.0.0
[4.4.3]:https://github.com/MetaMask/eth-block-tracker/compare/v4.0.0...v4.4.3
[4.0.0]:https://github.com/MetaMask/eth-block-tracker/compare/v3.0.0...v4.0.0
[3.0.0]:https://github.com/MetaMask/eth-block-tracker/compare/v2.0.0...v3.0.0
[2.0.0]:https://github.com/MetaMask/eth-block-tracker/compare/v1.0.0...v2.0.0
[1.0.0]:https://github.com/MetaMask/eth-block-tracker/releases/tag/v1.0.0

61

package.json
{
"name": "eth-block-tracker",
"version": "4.4.3",
"version": "5.0.0",
"description": "A block tracker for the Ethereum blockchain. Keeps track of the latest block.",
"main": "src/polling.js",
"main": "dist/index.js",
"files": [
"dist/"
],
"scripts": {
"test": "npm run build && npm run test:unit && npm run test:lint:deps",
"test:unit": "node test/index.js",
"test:lint:deps": "npx depcheck --ignore-dirs dist --ignores babelify,@babel/runtime,@babel/preset-env,@babel/plugin-transform-runtime",
"prepublishOnly": "npm run build",
"build": "npm run build:clean && npm run build:es5 && npm run build:bundle && npm run build:validate",
"build:clean": "rm -rf ./dist && mkdir -p ./dist",
"build:es5": "babel ./src -d dist/es5/",
"build:bundle": "npm run build:bundle:polling && npm run build:bundle:base && npm run build:bundle:subscribe",
"build:bundle:polling": "browserify -s PollingBlockTracker -e src/polling.js -g babelify > dist/PollingBlockTracker.js",
"build:bundle:subscribe": "browserify -s SubscribeBlockTracker -e src/subscribe.js -g babelify > dist/SubscribeBlockTracker.js",
"build:bundle:base": "browserify -s BaseBlockTracker -e src/base.js -g babelify > dist/BaseBlockTracker.js",
"build:validate": "uglifyjs dist/es5/**.js > /dev/null"
"lint": "eslint . --ext ts,js,json",
"lint:fix": "yarn lint --fix",
"build": "tsc --project .",
"test": "yarn build && node test/index.js",
"prepublishOnly": "yarn lint && yarn test"
},
"author": "kumavis",
"license": "MIT",
"resolutions": {
"ganache-core/**/elliptic": "^6.5.3",
"ganache-core/lodash": "^4.17.19"
},
"dependencies": {
"@babel/plugin-transform-runtime": "^7.5.5",
"@babel/runtime": "^7.5.5",
"eth-query": "^2.1.0",
"@metamask/safe-event-emitter": "^2.0.0",
"json-rpc-random-id": "^1.0.1",
"pify": "^3.0.0",
"safe-event-emitter": "^1.0.1"
"pify": "^3.0.0"
},
"devDependencies": {
"@babel/cli": "^7.5.5",
"@babel/core": "^7.5.5",
"@babel/plugin-transform-regenerator": "^7.4.5",
"@babel/preset-env": "^7.5.5",
"babelify": "^10.0.0",
"browserify": "^16.5.0",
"eth-json-rpc-infura": "^4.0.2",
"@metamask/eslint-config": "^5.0.0",
"@types/json-rpc-random-id": "^1.0.0",
"@types/pify": "^5.0.0",
"@typescript-eslint/eslint-plugin": "^4.14.1",
"@typescript-eslint/parser": "^4.14.1",
"eslint": "^7.18.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-json": "^2.1.2",
"eslint-plugin-node": "^11.1.0",
"ganache-core": "^2.7.0",
"json-rpc-engine": "^6.1.0",
"tape": "^4.9.0",
"uglify-js": "^3.4.10"
"typescript": "^4.1.3"
},

@@ -47,8 +46,8 @@ "directories": {

"type": "git",
"url": "git+https://github.com/kumavis/eth-block-tracker.git"
"url": "git+https://github.com/MetaMask/eth-block-tracker.git"
},
"bugs": {
"url": "https://github.com/kumavis/eth-block-tracker/issues"
"url": "https://github.com/MetaMask/eth-block-tracker/issues"
},
"homepage": "https://github.com/kumavis/eth-block-tracker#readme"
"homepage": "https://github.com/MetaMask/eth-block-tracker#readme"
}

@@ -1,2 +0,1 @@

# eth-block-tracker

@@ -8,13 +7,20 @@

```js
const HttpProvider = require('ethjs-provider-http')
const PollingBlockTracker = require('eth-block-tracker')
const createInfuraProvider = require('eth-json-rpc-infura')
const { PollingBlockTracker } = require('eth-block-tracker')
const provider = new HttpProvider('https://mainnet.infura.io')
const provider = createInfuraProvider({ network: 'mainnet', projectId: process.env.INFURA_PROJECT_ID })
const blockTracker = new PollingBlockTracker({ provider })
blockTracker.on('latest', console.log)
blockTracker.on('sync', ({ newBlock, oldBlock }) => {
if (oldBlock) {
console.log(`sync #${Number(oldBlock)} -> #${Number(newBlock)}`)
} else {
console.log(`first sync #${Number(newBlock)}`)
}
})
```
### methods
## Methods
##### new PollingBlockTracker({ provider, pollingInterval, retryTimeout, keepEventLoopActive })
### new PollingBlockTracker({ provider, pollingInterval, retryTimeout, keepEventLoopActive })

@@ -26,3 +32,3 @@ creates a new block tracker with `provider` as a data source and

##### getCurrentBlock()
### getCurrentBlock()

@@ -35,3 +41,3 @@ synchronous returns the current block. may be `null`.

##### async getLatestBlock()
### async getLatestBlock()

@@ -41,3 +47,3 @@ Asynchronously returns the latest block.

##### async checkForLatestBlock()
### async checkForLatestBlock()

@@ -48,5 +54,5 @@ Tells the block tracker to ask for a new block immediately, in addition to its normal polling interval.

### EVENTS
## Events
##### latest
### latest

@@ -60,3 +66,3 @@ The `latest` event is emitted for whenever a new latest block is detected.

##### sync
### sync

@@ -69,3 +75,3 @@ The `sync` event is emitted the same as "latest" but includes the previous block.

##### error
### error

@@ -77,7 +83,1 @@ The `error` event means an error occurred while polling for the latest block.

```
### NOTES
Version 4.x.x differs significantly from version 3.x.x
Please see the [CHANGELOG](./CHANGELOG.md).

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc