@basementdev/ethers-provider
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

Basement ethers.js provider wrapper

Installation

npm:

npm install @basementdev/ethers-provider

yarn:

yarn add @basementdev/ethers-provider

Getting started

const provider = new AlchemyProvider(); // It could be any UrlJsonRpcProvider provider
const enhancedProvider = BasementProvider.enhance(provider);

const logs = await enhancedProvider.getEnhancedLogs(
  {
    fromBlock: 16426225,
    toBlock: 16426226,
  },
  { transaction: { from: true, to: true, events: true } }
);
console.log(logs);

getEnhancedLogs can be used as a drop-in replacement for ethers.js' getLogs; there are several improvements added:

  • Find logs from multiple addresses
  • Resolve the related transaction the log was emitted
  • Resolve the reverse profile from the sender and receiver of the transaction.
  • Resolve the events related to the transaction

The documentation for the include options and filters that can be included can be found here

Package Sidebar

Install

npm i @basementdev/ethers-provider

Weekly Downloads

11

Version

0.0.4

License

MIT

Unpacked Size

23.3 kB

Total Files

14

Last publish

Collaborators

  • nickforall
  • anas.y