Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

eth-json-rpc-filters

MetaMask1.4mISC6.0.1

json-rpc-engine middleware implementing ethereum filter methods. Backed by an eth-block-tracker and web3 provider interface (web3.currentProvider).

readme

eth-json-rpc-filters

json-rpc-engine middleware implementing ethereum filter methods. Backed by an eth-block-tracker and web3 provider interface (web3.currentProvider).

supported rpc methods

  • eth_newFilter
  • eth_newBlockFilter
  • eth_newPendingTransactionFilter
  • eth_uninstallFilter
  • eth_getFilterChanges
  • eth_getFilterLogs

usage

basic usage:

const filterMiddleware = createFilterMiddleware({ blockTracker, provider })
engine.push(filterMiddleware)

cleanup:

// remove blockTracker handler to free middleware for garbage collection
filterMiddleware.destroy()

Running Tests

yarn test

Changelog

2.0
  • expect EthBlockTracker@4

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased

6.0.1

Changed

  • Bump @metamask/safe-event-emitter from ^2.0.0 to ^3.0.0 (#94)

6.0.0

Changed

  • BREAKING: Block filter middleware will not throw an error if a block is not found (#89)

5.1.0

Changed

  • Remove eth-json-rpc-middleware dependency (#76)
    • This package is still used in tests as a devDependency, but it's not used in the published package anymore.

Fixed

  • Fix eth_getFilterLogs (#84)
  • Fix for null reference exception when normalizing the block (#83)

5.0.0 - 2022-05-10

Added

  • Add retry logic to getBlocksForRange, treating a null block number as failure (#61)

Changed

  • BREAKING: Set minimum Node.js version to v12 (#50)
    • We officially support Node 12, 14, and 16, in alignment with our other packages.

4.2.2 - 2021-02-04

Changed

  • Replace await-semaphore with async-mutex (#33)
  • Move pify to production dependencies and update to v5 (#39 and #40)
  • Cleanup manifest metadata (#43 and #42)
  • Update json-rpc-engine from v5 to v6 (#35)
  • Update to @metamask/safe-event-emitter v2 (#37)
  • Remove lodash.flatmap dependency (#36)

4.2.1 - 2020-09-22

Changed

  • Specify publish files (#30)

4.2.0 - 2020-09-22

Changed