eth-block-tracker
Advanced tools
Comparing version 4.4.3 to 5.0.0
@@ -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 |
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
3
0
2
30781
13
16
398
1
+ Added@metamask/safe-event-emitter@2.0.0(transitive)
- Removed@babel/runtime@^7.5.5
- Removedeth-query@^2.1.0
- Removedsafe-event-emitter@^1.0.1
- Removed@ampproject/remapping@2.3.0(transitive)
- Removed@babel/code-frame@7.24.7(transitive)
- Removed@babel/compat-data@7.25.4(transitive)
- Removed@babel/core@7.25.2(transitive)
- Removed@babel/generator@7.25.6(transitive)
- Removed@babel/helper-compilation-targets@7.25.2(transitive)
- Removed@babel/helper-define-polyfill-provider@0.6.2(transitive)
- Removed@babel/helper-module-imports@7.24.7(transitive)
- Removed@babel/helper-module-transforms@7.25.2(transitive)
- Removed@babel/helper-plugin-utils@7.24.8(transitive)
- Removed@babel/helper-simple-access@7.24.7(transitive)
- Removed@babel/helper-string-parser@7.24.8(transitive)
- Removed@babel/helper-validator-identifier@7.24.7(transitive)
- Removed@babel/helper-validator-option@7.24.8(transitive)
- Removed@babel/helpers@7.25.6(transitive)
- Removed@babel/highlight@7.24.7(transitive)
- Removed@babel/parser@7.25.6(transitive)
- Removed@babel/plugin-transform-runtime@7.25.4(transitive)
- Removed@babel/runtime@7.25.6(transitive)
- Removed@babel/template@7.25.0(transitive)
- Removed@babel/traverse@7.25.6(transitive)
- Removed@babel/types@7.25.6(transitive)
- Removed@jridgewell/gen-mapping@0.3.5(transitive)
- Removed@jridgewell/resolve-uri@3.1.2(transitive)
- Removed@jridgewell/set-array@1.2.1(transitive)
- Removed@jridgewell/sourcemap-codec@1.5.0(transitive)
- Removed@jridgewell/trace-mapping@0.3.25(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedbabel-plugin-polyfill-corejs2@0.4.11(transitive)
- Removedbabel-plugin-polyfill-corejs3@0.10.6(transitive)
- Removedbabel-plugin-polyfill-regenerator@0.6.2(transitive)
- Removedbrowserslist@4.24.0(transitive)
- Removedcaniuse-lite@1.0.30001664(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedconvert-source-map@2.0.0(transitive)
- Removedcore-js-compat@3.38.1(transitive)
- Removeddebug@4.3.7(transitive)
- Removedelectron-to-chromium@1.5.29(transitive)
- Removedescalade@3.2.0(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedeth-query@2.1.2(transitive)
- Removedevents@3.3.0(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedgensync@1.0.0-beta.2(transitive)
- Removedglobals@11.12.0(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedhasown@2.0.2(transitive)
- Removedis-core-module@2.15.1(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedjsesc@2.5.2(transitive)
- Removedjson5@2.2.3(transitive)
- Removedlodash.debounce@4.0.8(transitive)
- Removedlru-cache@5.1.1(transitive)
- Removedms@2.1.3(transitive)
- Removednode-releases@2.0.18(transitive)
- Removedpath-parse@1.0.7(transitive)
- Removedpicocolors@1.1.0(transitive)
- Removedregenerator-runtime@0.14.1(transitive)
- Removedresolve@1.22.8(transitive)
- Removedsafe-event-emitter@1.0.1(transitive)
- Removedsemver@6.3.1(transitive)
- Removedsupports-color@5.5.0(transitive)
- Removedsupports-preserve-symlinks-flag@1.0.0(transitive)
- Removedto-fast-properties@2.0.0(transitive)
- Removedupdate-browserslist-db@1.1.1(transitive)
- Removedxtend@4.0.2(transitive)
- Removedyallist@3.1.1(transitive)