-
Notifications
You must be signed in to change notification settings - Fork 184
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
feat: add autorouter API URL param #54
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…widgets into feat/auto-router-params
src/hooks/useClientSideV3Trade.ts
Outdated
@@ -23,6 +23,7 @@ const DEFAULT_GAS_QUOTE = 2_000_000 | |||
* @param amountSpecified the exact amount to swap in/out | |||
* @param otherCurrency the desired output/payment currency | |||
*/ | |||
// TODO: delete this function & deprecate it after swapping out USDC usage for SOR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do this in a separate PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after swapping out USDC usage for SOR
What is this referring to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useUSDCPrice
still uses useV2Quoter & useV3Quoter to calculate the price in USDC of the input currency - but now that we have a multichain SOR, we can deprecate those in favor of using SOR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#58 (edit: i've merged that into this branch)
amount: debouncedAmountSpecified, | ||
tradeType, | ||
routerUrl, | ||
provider: library as JsonRpcProvider, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we somehow verify that library
is in fact a jsonrpcprovider
instead of casting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and throw error if not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
library is of type (JsonRpcProvider & { provider?: ExternalProvider }) | Web3Provider
and Web3Provider extends JsonRpcProvider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so we should be good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now good work!
🎉 This PR is included in version 2.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The Swap Widget computes the optimal trade route by running the @uniswap/smart-order-router package locally in the browser. This can take a few seconds to load & is slow.
Provider needs to support eth_feeHistory