Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update type signature of RpcProviderModule to implement Ethers's AbstractProvider #373

Closed
3 tasks done
charesbast opened this issue Oct 13, 2022 · 3 comments
Closed
3 tasks done

Comments

@charesbast
Copy link

charesbast commented Oct 13, 2022

✅ Prerequisites

  • Did you perform a cursory search of open issues? Is this bug already reported elsewhere?
  • Are you running the latest SDK version?
  • Are you reporting to the correct repository (magic-sdk)?

🐛 Description

Similar to #83, we have the same problem with ethers library: magic.rpcProvider type does not match the expected param type of ethers.providers.Web3Provider constructor.

Capture d’écran 2022-10-13 à 17 29 46

🤔 Expected behavior

Being able to write const provider = new ethers.providers.Web3Provider(magic.rpcProvider); without a compilation error

💻 Code Sample

const magic = new Magic('PUBLIC_API_KEY');
const provider = new ethers.providers.Web3Provider(magic.rpcProvider);

🌎 Environment

Software Version(s)
magic-sdk 10.0.0
ethers 5.7.1
Browser chrome version 106.0.5249.103
yarn 3.2.0
Operating System macbook pro 2021 16"
@am-hernandez
Copy link
Member

Hi @charesbast and thank you for submitting this issue. I've gone ahead and marked this as a feature request. Will update this thread when we implement the requested changes!

@grabbou
Copy link

grabbou commented Jan 29, 2023

Hey! I am seeing this issue with the latest Magic SDK & React Native. Are you sure @am-hernandez this was a feature request, not an actual bug? It seems that this is recommended way of setting things up, as per your documentation. Current workaround is to cast to any, but that is far from ideal.

@lantelyes
Copy link

@am-hernandez this is still an issue...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants