Uniswap / v3-sdk

🛠 An SDK for building applications on top of Uniswap V3
MIT License
544 stars 416 forks source link

AlphaRouter Provider mismatching with etherjs v6 #187

Open alinasir85 opened 9 months ago

alinasir85 commented 9 months ago

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 commented 8 months ago

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

sbeben commented 4 months ago

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 commented 4 months ago

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.