Commit Graph

129 Commits

Author SHA1 Message Date
Moody Salem
355012eec9
fix: set polling interval back to 15 seconds 2021-06-07 17:52:49 -05:00
Moody Salem
02d80e07dc
refactor(L2): Arbitrum Kovan testnet and Arbitrum One support (#1716)
* experimental! point at a kovan arbitrum deployment

* remove the unwrapped token from mint hook

* fix explorer links

* Etherscan -> Explorer

* move chains to constant file

* use NETWORK_URLS instead

* temporary fix to the syncing issue

* fix tests

* fix unknown chain id crash

* use a multicall that returns arbitrum block numbers

* lower polling interval for layer 2

* use a better multicall

* remove unused import

* fixed multicall2

* make some v2 code chain specific

* fix build

* line number changes

* update keys

* fix the locale parsing of full locale string

* extract

* fix lint

* add arbitrum one

* add arbitrum one to supported chains

* add missing arbitrum one label

* refactor: remove storybook

* point to the arbitrum explorer address

* fix arbitrum mainnet links

* fix how weth shows up in the interface

* make the usdc price feature more cross chain compatible

* missing translation

* clean up some governance code so it doesn't crash on unsupported networks

* improve how we check for transaction receipts for sequencer networks

* improve it a bit more
2021-06-02 15:14:34 -05:00
Moody Salem
58a1be8421
chore(i18n): add a few more translations 2021-05-29 20:29:49 -05:00
Moody Salem
dbbffd17a6
fix: improve cancel/retry detection 2021-05-25 13:48:23 -05:00
Moody Salem
eff512deb8
bump sdk-core 2021-05-21 09:34:46 -05:00
Moody Salem
562b402293
feat: use multicall for argent wallets in swap and v3 add liquidity (#1387)
* use argent wallet contract in swap callback

* maybe working swap callback

* chore(v3): trigger a breaking release

BREAKING CHANGE: trigger a major release for the uniswap interface to indicate it now supports swapping and liquidity provision against uniswap protocol v3

* fix the value

* improve the error coverage

* retry more frequently, couple more error nits

* the is argent call was being sketchy

* get it working for add liquidity

* `0x0` for v2 swaps too

* small nits in position page

* fix import

* fix compiler error
2021-05-21 09:30:07 -05:00
Moody Salem
a6e46623ad
chore: bump ethers and regenerate lockfile (#1666)
* bump ethers

* regenerate lockfile

* update code style

* Fix code style issues with ESLint

* remove unused useRef

Co-authored-by: Lint Action <lint-action@samuelmeuli.com>
2021-05-20 20:11:32 -05:00
Moody Salem
5e30a4b4ad
refactor: bump to latest sdk (#1657) 2021-05-20 11:21:40 -05:00
Moody Salem
8d3babd015
refactor: more separation by chain of addresses 2021-05-18 14:33:03 -05:00
Moody Salem
3efe5268ae
refactor: break down some constants files and move some stuff around 2021-05-18 10:31:22 -05:00
Moody Salem
7a0b85bf41
improvement: estimated amounts instead of minimum/maximums (#1570)
* estimated amounts instead of minimum/maximums

* missed a spot

* fix linting error
2021-05-14 07:15:53 -05:00
Moody Salem
7d45ff5ca8
fix 0 decimal tokens error 2021-05-12 17:29:02 -05:00
Ian Lapham
dd33205bf6
update string in token amount formatting (#1539) 2021-05-12 14:19:01 -04:00
Ian Lapham
702500794d
truncate and format large numbers (#1518)
* truncate and format large numbers

* update truncation shorthand

* update logic for detecting small amount
2021-05-12 14:08:05 -04:00
Moody Salem
3aa045303a
remove a few unused isToken calls 2021-05-12 11:43:30 -05:00
Noah Zinsmeister
e0a7c3794e
bump gas margin to 20% 2021-05-12 12:35:46 -04:00
Moody Salem
27960532ca
refactor: use new sdk version (#1472)
* do not construct tokens for wrapped token info

* some cleanup of the wrapped token info

* back to extends, bump sdk core version via v2/v3 sdk updates

* Revert "back to extends, bump sdk core version via v2/v3 sdk updates"

This reverts commit 92cc5073

* update the sdk version

* fix some more uses of instanceof

* finish the refactor

* mess with the currency list performance

* start replacing with the latest v3/v2 sdks

* raw -> quotient

* more cleanup

* finish the refactor

* clean up currency list refactor

* fix list rendering

* perf(token lists): improve app performance when there are large inactive token lists (#1510)

* improve inactive token lists performance

* cleanup before larger changes to combine inactive lists

* only do the search if the query does not match any active lists, limit the number of results

* more performance improvements

* search inactive lists more aggressively
2021-05-12 08:52:17 -05:00
Moody Salem
7ee761a59e
feat: automatic slippage tolerance (#1463)
* automatic slippage tolerance start

* get it compiling

* out of range/in range behavior of slippage tolerance in add

* small useDerivedSwapInfo refactor

* improve useSwapSlippageTolerance

* fix unit test

* thread placeholder slippage through

* small improvement to slippage input behavior

* fix the display bug

* fix tx settings modal ux

* don't pass props unnecessarily

* switch back to static swap slippage for now

bump migrate slippage to .75%

* fix font size

* add flag for auto slippage migration

validate version updates even more

Co-authored-by: Noah Zinsmeister <noahwz@gmail.com>
2021-05-11 13:00:42 -04:00
jochenboesmans
78e95f6073
Add App-level error boundary, referring users to GitHub issue creation (#1464)
* Add App-level error boundary, referring users to GitHub issue creation on page crashes. (#1452)

* Class component is used as boundary since catching errors is apparently not yet possible with hooks.

* EventListener in window was removed and replaced by error boundary's error catch, which now fires a GA exception. The fields it passes are slightly different because React uses slightly different error types.

* Pre-filling issues with dynamic data is possible with POST requests to GitHub's API, but the GH web client seems to only support pre-fill based on templates. Therefore users still need to copy error info themselves.

* Prefill GitHub issues with crash data.

* Added package 'react-device-detect' to include device data such as OS, browser etc. in crash report.
* Included error stack in issue body.
* Used <code> html tag for displaying stack to user.

* Slightly reduce vertical padding on code block.

* Add ua-parser-js for parsing user agent.

* Revert react-device-detect to ^1.6.2 (which is used for mobile detection etc. in components)
2021-05-11 12:09:01 -04:00
Moody Salem
57786335df
fix calculateSlippageAmount (#1497) 2021-05-10 14:22:26 -05:00
Moody Salem
4d3f870b93
add a test for calculating slippage amounts 2021-05-09 12:31:45 -05:00
Moody Salem
452f2dc3c0
fix slippage amount bug https://github.com/Uniswap/uniswap-interface/issues/1473 2021-05-09 11:30:56 -05:00
Ian Lapham
b6bd59f2b1
Fix bug on formatted token amounts when decimals < sig fig (#1479)
* fix for error token map parsings

* fix error on formatting sig figs
2021-05-07 16:52:00 -04:00
Moody Salem
021aab6547
fix(wallet): workaround the ethers bug to fix other wallets 2021-05-06 11:10:45 -04:00
Moody Salem
d3898cf900
fix(wallet): workaround for coinbase wallet / fortmatic 2021-05-06 10:09:41 -04:00
Moody Salem
ab5114c5f5
move the compute price impact function out to a utility file 2021-05-04 17:55:51 -05:00
Moody Salem
509b307b67
show some price impact in the interface 2021-05-04 17:51:01 -05:00
Moody Salem
300dd70804
show currency values and price impact in the confirmation modal (fixes https://github.com/Uniswap/v3-interface/issues/92) 2021-05-04 08:38:47 -05:00
Moody Salem
7ca79ff12b
fix unit tests 2021-05-03 20:39:03 -05:00
Moody Salem
ee69357305
some minor refactoring with price impact functions 2021-05-03 20:25:23 -05:00
Moody Salem
9fec8dbe93
show percentage difference in price on swap 2021-05-03 17:13:05 -05:00
Moody Salem
e9a432b58e
fix a bug in v3 trade routing returning the wrong trade type for output trade 2021-04-30 22:43:29 -05:00
Moody Salem
1f41587ba9
fix the swap notification 2021-04-30 22:38:24 -05:00
Moody Salem
323edc0fcd
consistently use the worst price and amounts in the swap view 2021-04-28 16:42:56 -05:00
Moody Salem
fc258fdf5c
don't throw if the trades are not comparable 2021-04-28 13:34:22 -05:00
Moody Salem
2e599dc00e
handle loading v3 trade state better 2021-04-28 13:31:30 -05:00
Moody Salem
464a682fcc
show the better trade link for v2/v3 2021-04-28 13:27:14 -05:00
Moody Salem
3c3be3c61a
fix some unit tests 2021-04-28 12:17:40 -05:00
Moody Salem
3a34c2ec25
eth swaps kinda working 2021-04-27 19:20:05 -05:00
Moody Salem
3680b93fb3
make the way we get the v2 router consistent, start working through changes in the swap callback 2021-04-27 11:00:34 -05:00
Moody Salem
ccbd5dfcf7
show v3 quotes 2021-04-26 19:35:32 -05:00
Moody Salem
7f61b67947
first pass v3 routing code 2021-04-26 12:17:37 -05:00
Moody Salem
1c6d9d810e
keep list asset requests anonymous 2021-04-26 10:50:34 -05:00
Moody Salem
605368629f
surface the best v3 route to the swap page 2021-04-24 20:27:56 -05:00
Moody Salem
bd346030f0
useAllV3Routes, some cleanup 2021-04-24 17:43:14 -05:00
Moody Salem
60d1f8743f
just a bit more refactoring to remove the data directory 2021-04-23 17:57:48 -05:00
Noah Zinsmeister
6b99309fab
Merge remote-tracking branch 'refs/remotes/origin/main' 2021-04-22 18:36:20 -04:00
Noah Zinsmeister
976b15986f
add fee calculations 2021-04-22 18:36:11 -04:00
Moody Salem
df4c18c8d4
remove v1 swaps and migrate (#46)
* remove v1 swaps and migrate

* simplify

* more delete

* revert route changes

* fix v2 add

* fix integration tests

* try to fix https://github.com/Uniswap/v3-interface/issues/41
2021-04-22 17:10:18 -05:00
Noah Zinsmeister
f00adc755a
refactor range selection and use in migrate
improve migrate
2021-04-19 17:55:52 -04:00