This repo contains uniswap dex controller for safle swap.
await getSupportedTokens()
This will give us the list of all tokens supported in uniswap.
await getExchangeRate({ toContractAddress, toContractDecimal, fromContractAddress, fromContractDecimal, fromQuantity, slippageTolerance })
This will give us the exchange rate of 2 tokens.
Amount of toContractAddress
the user will receive for quantity
of fromContractAddress
.
await getEstimatedGas({ toContractAddress, toContractDecimal, fromContractAddress, fromContractDecimal, fromQuantity, slippageTolerance })
This will give us the estimated amount of gas in BigNumber for the swap.
await getRawTransaction({ walletAddress, toContractAddress, toContractDecimal, fromContractAddress, fromContractDecimal, toQuantity, fromQuantity, slippageTolerance })
This will give us the raw transaction to swap the tokens on uniswap.