Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

AlphaRouter Provider mismatching with etherjs v6 #187

Open
alinasir85 opened this issue Oct 18, 2023 · 3 comments
Open

AlphaRouter Provider mismatching with etherjs v6 #187

alinasir85 opened this issue Oct 18, 2023 · 3 comments

Comments

@alinasir85
Copy link

Hi,

In v6 of ether.js they have renamed Web3Provider with BrowserProvider

Screenshot 2023-10-18 at 2 05 11 PM

when I'm trying to use BrowserProvider provider with AlphaRouter like this

const provider = new ethers.BrowserProvider(config);
const router = new AlphaRouter({
chainId,
provider,
});

its giving error

TS2740: Type  BrowserProvider  is missing the following properties from type  BaseProvider :  _networkPromise, _events, formatter, _emitted , and  36  more.
alpha-router.d.ts(27, 5): The expected type comes from property  provider  which is declared here on type  AlphaRouterParams
 

because Provider in the AlphaRouter is of type BaseProvider which comes from '@ethersproject/providers'

@Florian-S-A-W
Copy link

Hi @alinasir85
The smart-order-router sdk expects you to use ethers v5.

@sbeben
Copy link

sbeben commented Mar 18, 2024

Hi @alinasir85 The smart-order-router sdk expects you to use ethers v5.

You kidding? There's no even a workaroud?

@Florian-S-A-W
Copy link

You should open this issue in the smart-order-router sdk if this affects you @sbeben . The v3-sdk is a different package.
Maybe there is a workaround that I am not aware of.

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

No branches or pull requests

3 participants