lib icon indicating copy to clipboard operation
lib copied to clipboard

feat(investor-foxy): switch from web3 to ethers and JsonRpcBatchProvider

Open gomesalexandre opened this issue 2 years ago • 2 comments

Description

This switches the current investor-foxy API implementation from web3.js to ethers.js, to be able to use JsonRpcBatchProvider.

web3.js also provides a BatchRequest API, unfortunately after spending more than a day on it, it seems like that API is rugged currently and isn't compatible with our programmatic calls with blockNumber specified.

  • [x] Base migration from web3.js to ethers - compiles
  • [x] Regression test that values are correct
  • [ ] ~~Batch promises together so the underlying JSON RPC calls are automagically batched by JsonRpcBatchProvider~~ This will better live in a follow-up PR. Let's get the switch to ethers.js merged first, and then we can improve the business logic

Issue

N/A

Risks

Everything FOXy could be borked - test locally against latest @shapeshiftoss/investor-foxy.

gomesalexandre avatar Sep 18 '22 14:09 gomesalexandre

Current dependencies on/for this PR:

  • main
    • PR #1032 Graphite 👈
      • PR #1131 Graphite
        • PR #1130 Graphite

This comment was auto-generated by Graphite.

gomesalexandre avatar Sep 18 '22 14:09 gomesalexandre

Opening for early review, added self-review comments

gomesalexandre avatar Sep 21 '22 11:09 gomesalexandre