curve-stablecoin-js icon indicating copy to clipboard operation
curve-stablecoin-js copied to clipboard

feat: allow init without RPC

Open DanielSchiavini opened this issue 1 year ago • 0 comments

Let me be clear: I do not like throwing exceptions. Ideally we should make the invalid states unreachable. However, given the existing code base, throwing good errors seems like the only feasible way.

  • CurveStableCoinJS currently requires a web3 provider to be initialized
  • However, we might not always have a RPC connection
  • This PR allows users to retrieve (part of) the data without requiring a RPC connection
  • However, it will raise exceptions whenever a function that requires RPC is called

This PR is similar to https://github.com/curvefi/curve-js/pull/394 and https://github.com/curvefi/curve-lending-js/pull/34

DanielSchiavini avatar Sep 18 '24 14:09 DanielSchiavini