@getsafle/uniswap-controller

1.1.4 • Public • Published

uniswap-dex-controller

This repo contains uniswap dex controller for safle swap.

Get supported tokens

await getSupportedTokens()

This will give us the list of all tokens supported in uniswap.

Get Exchange Rate

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.

Get Estimated gas

await getEstimatedGas({ toContractAddress, toContractDecimal, fromContractAddress, fromContractDecimal, fromQuantity, slippageTolerance })

This will give us the estimated amount of gas in BigNumber for the swap.

Get Raw Transaction

await getRawTransaction({ walletAddress, toContractAddress, toContractDecimal, fromContractAddress, fromContractDecimal, toQuantity, fromQuantity, slippageTolerance })

This will give us the raw transaction to swap the tokens on uniswap.

Readme

Keywords

none

Package Sidebar

Install

npm i @getsafle/uniswap-controller

Weekly Downloads

7

Version

1.1.4

License

ISC

Unpacked Size

31.6 kB

Total Files

12

Last publish

Collaborators

  • subhanshugupta
  • apoorv31
  • shubham.3008
  • sidth