包详细信息

@metamask/eth-json-rpc-filters

MetaMask67.3kISC9.0.0

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

自述文件

@metamask/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

CHANGELOG.md

更新日志

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

9.0.0

Changed

  • BREAKING: Adapt to EIP-1193 provider changes by replacing the deprecated sendAsync method with the request method (#170)

Fixed

  • Bump @metamask/json-rpc-engine from ^9.0.0 to ^10.0.0 (#194)

8.0.0

Changed

  • BREAKING: Drop support for Node.js v16, v21 (#164)
  • Update @metamask/json-rpc-engine from ^8.0.2 to ^9.0.0 (#165)

7.0.1

Changed

  • yarn version 1.22.22 declared as packageManager in package.json (#156)
  • Bump @metamask/eth-query from ^3.0.1 to ^4.0.0 (#126)
  • Bump @metamask/json-rpc-engine from ^7.1.0 to ^8.0.2 (#162)

Fixed

  • Bump async-mutex from ^0.2.6 to ^0.5.0 (#163)

7.0.0

Changed

  • BREAKING: Set minimum Node.js version to v16 (#102)
  • BREAKING: Rename package from eth-json-rpc-filters to @metamask/eth-json-rpc-filters (#103)
  • Bump @metamask/json-rpc-engine from ^6.0.0 to ^7.1.0 (#104)
  • Replace @metamask/eth-query@^2.1.2 with @metamask/eth-query@^3.0.1 (#107)

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

  • Update RPC packages (#29)
    • json-rpc-engine@5.3.0
    • eth-json-rpc-middleware@6.0.0

3.0.1 - 2018-10-08

Changed

  • BREAKING: BaseFilter now extends SafeEventEmitter (c583ba9d9410ca7c861282b0a122212b7c22ba47)

2.0.0 - 2018-05-22

Changed

  • BREAKING: expect EthBlockTracker@4 (062fd0849631a9862780c0591a3987bcadfe880f)