-
Ethers Version6.6.2 Search TermsNo response Describe the Problemi didnt find ExternalProvider in version 6, how can i convert the following code to version 6? Regards Code Snippetimport { providers } from 'ethers'
constructor(provider: providers.ExternalProvider | providers.Web3Provider | providers.JsonRpcProvider) {
this.provider = providers.Provider.isProvider(provider) ? provider : new providers.Web3Provider(provider)
}
|
Beta Was this translation helpful? Give feedback.
Answered by
ricmoo
Jul 5, 2023
Replies: 1 comment 3 replies
-
I’m not at a computer right now, so typing on my phone, but I think you want: import { ethers } from 'ethers'
constructor(provider: ethers.Eip1193Proviser | ethers.JsonRpcProvider) {
this.provider = provider instanceof ethers.JsonRpcProvider ? provider: new ethers.BrowserProvider(provider)
} Let me know if that works. :) (moving to discussions) |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
DexSwaper
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I’m not at a computer right now, so typing on my phone, but I think you want:
Let me know if that works. :)
(moving to discussions)