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

v3 routing guide: alpha router instance can't be created #843

Open
kremalicious opened this issue Dec 18, 2024 · 0 comments
Open

v3 routing guide: alpha router instance can't be created #843

kremalicious opened this issue Dec 18, 2024 · 0 comments

Comments

@kremalicious
Copy link

kremalicious commented Dec 18, 2024

Out of the box, the v3 routing guide is not working as TypeScript complains about wrong imports.

This example for setting up the router has at least 2 issues:

import { AlphaRouter, ChainId } from '@uniswap/smart-order-router'

const provider = new ethers.providers.JsonRpcProvider(rpcUrl)

const router = new AlphaRouter({
  chainId: ChainId.MAINNET,
  provider,
})
  1. there is no ChainId exported from @uniswap/smart-order-router
  2. when using the correct import from @uniswap/sdk-core, TypeScript complains with "Type 'ChainId.MAINNET' is not assignable to type 'ChainId'"

My versions

"@uniswap/sdk-core": "^6.1.1",
"@uniswap/smart-order-router": "^4.9.2"

To me it looks like @uniswap/sdk-core v6 introduced this. For now, my solution is to keep sdk-core downgraded to v5.9.0.

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

No branches or pull requests

1 participant