Rubilmax / ethers-multicall-provider

⚡🕰️ Call any set of functions from any set of smart contracts in a single RPC query, seamlessly using ethers' providers API!
https://github.com/Rubilmax/ethers-multicall-provider
MIT License
62 stars 7 forks source link

Add support for older build setups (up to es5) #44

Closed vad99lord closed 1 year ago

vad99lord commented 1 year ago

Current Behavior

I'm trying to use the package in a legacy environment, where new features (eg. numeric separators) are not supported and node modules packages are not transpiled down. My simplified setup is in a repro repo If you try to start the project there are babel loader errors, such as:

Module parse failed: Identifier directly after number (40:104)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|   static wrap(provider) {
|     let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 16;
>     let maxMulticallDataLength = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 200_000;

Expected Behavior

Currently, the project seems to be using esnext target I think this package should support the same es version as ethers package, which is es5 for ethers v5.7.2

Steps to Reproduce the Problem

  1. use node 16 to build repro package
  2. npm install
  3. npm start

Environment

Rubilmax commented 1 year ago

Should be fixed with: https://github.com/Rubilmax/ethers-multicall-provider/commit/7c84f3bb2f5b1ebfc2d4a522bbdc720e111f9d25 in v3.0.4

vad99lord commented 1 year ago

Works fine for me in the latest version, thanks!

Rubilmax commented 1 year ago

Thanks for reporting!