Uniswap without TORN censoring
Go to file
Justin Domingue cd22955817
feat: routing api integration (#2116)
* initial routing api integration

* add routing api slice

* display route in dialog

* addressed pr feedback

* improved routing

* switch to `get`

* first pass at integration new MultiRouteTrade

* initial implementation of RoutingDiagram

* add RoutingDiagram tests

* improve tests in RoutingDiagram

* integrate with v3-sdk 3.3.1

* removed references to MultiRouteTrade

* revert swapcallback

* fix abi compilation error

* added useRoute hook to build a Route from edges and nodes

* added react-hooks-testing-library

* integrated latest changes

* renamed router hook to routerTrade

* improve integration

* fixed routing

* usability

* mock RoutingDiagram children to reduce size

* undo mocked children

* adjust ui

* better support long routes

* use routing api logo and adjust ux

* set default percent to 0

* added intermediary hook to combine local and routing api trades

* added intermediary hook to combine local and routing api trades

* make account optional

* improve ux

* improve router

* fixed duplicate pool bug and inputAmount undefined bug

* extract input/outputAmounts from routes

* add todo

* fixed uninitialized issue and added %

* fixed tests

* fix duplicate pool bug

* added routing api setting

* change router label based on router version

* improve useRoutes and fix duplicate pool bug

* debounce routing api/local routing

* removed single hop setting

* fix bug when moving between v2/v3

* consider isUnitialized non loading

* ui fixes

* reverted change to usedebounce

* use new route schema

* visual updates

* log quoteId for polish session

* fix: persist advanced swap details toggle state

* fix no route found

* poll every 10s

* derive currencies from pool rather than input

* polish query status handling in useRouterTrade

* removed RouterVersion

* update ui

* update ui

* update loading state

* animate auto router

* apply loading treatment to out

* disable routing api on l2 and support auto slippage

* use opacity on the whole element

* show loading card when syncing

* updated gradient

* polished ui

* create routerlabel component

* disable router on all bu mainnet

* polish

* feat: [draft] routing api polish (#2224)

* show loading card when syncing

* updated gradient

* polished ui

* create routerlabel component

* disable router on all bu mainnet

* polish

* polished loading state

* add dashes

* fixed tooltip styles

* fixed merge conflict

* few updates

* polish

* updated yarn.lock

* fixed styles

* updated routing diagram

* Fix code style issues with ESLint

* routing api enabled without localstorage upgrade

* fixed lint error

* Fix code style issues with ESLint

* refined mocks in routing diagram tests

* addressed pr feedback

* polish

* revert sending eth

* improved loading animation

* handle stale routing api

* Fix code style issues with ESLint

* updated yarn.lock

* support native eth

* Compute gas adjusted quote for V2 trade and compare to V3 gas adjusted quote

* Incorporate approval gas cost estimate

* feat: simplify routing api ux (#2258)

* support native eth

* simplified ui

* perf optimization

* implement realized lp fee

* improved route realized lp fee

* fix lp realized fee

* fix auto router gradient

* initial route overlay

* add auto router svg

* adjusted ux to mocks

* fix lp fee

* upddated routing diagram

* optimize tradeBetter hook

* adjust type and name

* add useBetterTrade

* useBetterTrade takes gasEstimateWei

* implement gasEstimateForApproval

* import state from react

* use gas estimate

* improve integration with gas estimate comparison

* remove dependency on account

* fix currency switch bug

* improve syncing state

* add loadingbar

* style tooltip container

* updated tooltip styles

* increase opacity range

* always keep dependent currency input interactable

* show placeholders in tooltips

* Revert v2 gas estimates and approval estimates

* Add debug logs

* refactor

* fix bug

* removed comment

* update engish key

* add try-catch

* addressed pr feedback

* remove loading bar for price impact

* addressed pr feedback and bug bash feedback

* fix: use url to force version

* addressed pr feedback and bug bash feedback

* stop fetching when losing focus

* only show auto router label when activated

* avoid showing syncing status

* move V3TradeSTate to own file

* make useRoutes a function rather than hook

* use logo from active list when possible

* renamed and refactored hook

* renamed and refactored hook

* update status

* polish

* remove unused import

* fixed merge error

* updated combined trade tests

* remove priceimpact while loading

* Design tweaks

* polish latest design

* removed some styles

* log gaevent on tooltip open and clean up origin

* Small tweaks

* addressed pr feedback

* wrap route length in a loading container

* renamed local to clientside

* fix percent and token logo

* addressed pr feedback

* avoid comparing trades when v3 not ready

* some refactor

Co-authored-by: Lint Action <lint-action@samuelmeuli.com>
Co-authored-by: Will Pote <will@uniswap.org>
Co-authored-by: Callil Capuozzo <callil.capuozzo@gmail.com>
2021-09-16 10:50:58 -04:00
.github chore: use ubuntu-latest for integration tests (#2348) 2021-09-14 10:04:15 -07:00
cypress Revert "test: support stubbing subgraph data in cypress (#2259)" (#2269) 2021-08-31 11:10:07 -04:00
public chore: fix SEO and accessibility nits for Lighthouse (#2212) 2021-08-16 18:30:52 -04:00
src feat: routing api integration (#2116) 2021-09-16 10:50:58 -04:00
.env fix: walletconnect on L2 issues with Rainbow (#2242) 2021-08-24 12:01:53 -05:00
.env.production feat: allow walletconnect on testnets (#1389) 2021-05-13 17:46:30 -05:00
.eslintrc.json style: enforce object-shorthand (#2286) 2021-09-01 13:32:20 -07:00
.gitignore ignore state/data/generated.ts 2021-06-29 16:27:12 -07:00
.nvmrc feature(storybook): first pass at storybook integration 2021-02-12 15:32:25 -05:00
.prettierignore feat(thegraph): auto-generate graphql types (#1926) 2021-06-28 16:43:24 -07:00
.prettierrc set up eslint and prettier; run prettier 2019-04-15 12:56:40 -04:00
.yarnrc fix(responsiveness): small tweaks for mobile 2020-07-06 21:26:38 -04:00
babel-plugin-macros.config.js use styled-components/macro to display className in dev builds (#1541) 2021-05-13 09:15:13 -04:00
codegen.yml feat(pools): fetch pool tick data from uniswap v3 subgraph (#1932) 2021-07-01 11:08:53 -07:00
CONTRIBUTING.md chore: copy edit on CONTRIBUTING.md 2021-07-22 16:14:55 -05:00
custom-test-env.js test: set up component snapshot testing (#2102) 2021-07-26 10:41:08 -07:00
cypress.json chore: support stubbing subgraph in integration tests (#2039) 2021-07-13 12:54:49 -07:00
LICENSE add tokens, do some summer cleaning (#368) 2019-07-23 13:50:31 -04:00
lingui.config.ts chore(i18n): add id-ID 2021-05-31 09:55:01 -05:00
package.json feat: routing api integration (#2116) 2021-09-16 10:50:58 -04:00
README.md Squashed commit of the following: 2021-09-05 13:26:47 -04:00
tsconfig.json chore: upgrade type system (#2276) 2021-09-01 12:38:10 -07:00
yarn.lock feat: routing api integration (#2116) 2021-09-16 10:50:58 -04:00

Uniswap Interface

Unit Tests Integration Tests Lint Release Crowdin

An open source interface for Uniswap -- a protocol for decentralized exchange of Ethereum tokens.

Accessing the Uniswap Interface

To access the Uniswap Interface, use an IPFS gateway link from the latest release, or visit app.uniswap.org.

Unsupported tokens

Check out useUnsupportedTokenList() in src/state/lists/hooks.ts for blocking tokens in your instance of the interface.

You can block an entire list of tokens by passing in a tokenlist like here or you can block specific tokens by adding them to unsupported.tokenlist.json.

Contributions

For steps on local deployment, development, and code contribution, please see CONTRIBUTING.

Accessing Uniswap V2

The Uniswap Interface supports swapping, adding liquidity, removing liquidity and migrating liquidity for Uniswap protocol V2.

Accessing Uniswap V1

The Uniswap V1 interface for mainnet and testnets is accessible via IPFS gateways linked from the v1.0.0 release.