You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.
import{SwapToRatioStatus}from"@uniswap/smart-order-router";constV3_SWAP_ROUTER_ADDRESS="0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45";constMY_ADDRESS="0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B";if(routeToRatioResponse.status==SwapToRatioStatus.success){// Error 1 - '.success' instead of '.SUCCESS'constroute=routeToRatioResponse.resultconsttransaction={data: route.methodParameters.calldata,to: V3_SWAP_ROUTER_ADDRESS,value: BigNumber.from(route.methodParameters.value),from: MY_ADDRESS,gasPrice: BigNumber.from(route.gasPriceWei),};)// Error 2 - Closing ')' instead of '}'awaitweb3Provider.sendTransaction(transaction);// Possible Error - await out of 'if' scope, if it fails transaction is not defined
If one tries to run the code above (making the relevant changes such as the Address) it will not work.
In the Swap and Add Liquidity Atomically documentation page https://docs.uniswap.org/sdk/guides/liquidity/swap-and-add there are two errors in the code provided when sending the transaction.
The example provided is:
If one tries to run the code above (making the relevant changes such as the Address) it will not work.
The code should instead be:
As the SwapToRatioStatus enum does not have a property called success but instead SUCCESS:
The text was updated successfully, but these errors were encountered: