blockcoders / nestjs-ethers

Ethereum utilities for NestJS based on Ethers.js
Apache License 2.0
93 stars 23 forks source link

Added option to use MulticallProvider instead of StaticJsonRpcProvider when using custom provider #148

Closed 0x67 closed 1 year ago

0x67 commented 1 year ago

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

What is the current behavior?

No option to make aggregated/batched requests.

Issue Number: N/A

What is the new behavior?

Added batched: boolean to ProviderOptions to create MulticallProvider, this should work on any ethers.js v5 providers.

Does this PR introduce a breaking change?

Other information

Not sure if this is relevant, but this is my first ever contribution ever to OSS project, so don't hesitate to correct me.

0x67 commented 1 year ago

The use case is pretty niche, but if you always call multiple methods and/or multiple contracts, this can significantly reduce the time needed to complete the requests.

0xslipk commented 1 year ago

The use case is pretty niche, but if you always call multiple methods and/or multiple contracts, this can significantly reduce the time needed to complete the requests.

Amazing PR. thank you so much @0x67. I will take a look this week.