Skip to content

ExternalProvider not available in v6? #4209

Answered by ricmoo
DexSwaper asked this question in Q&A
Discussion options

You must be logged in to vote

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)

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@DexSwaper
Comment options

@ricmoo
Comment options

@DexSwaper
Comment options

Answer selected by DexSwaper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #4208 on July 05, 2023 12:54.