Commit Graph

314 Commits

Author SHA1 Message Date
Moody Salem
bff3811faf
use multicall2 2021-04-23 18:26:24 -05:00
Moody Salem
60d1f8743f
just a bit more refactoring to remove the data directory 2021-04-23 17:57:48 -05:00
Moody Salem
2d118a904a
refactor some hooks into the hooks directory 2021-04-23 17:54:24 -05:00
Moody Salem
b69f08cbe1
allow fetching multiple pools via usePools.ts 2021-04-23 17:31:36 -05:00
Noah Zinsmeister
644ecdbd32
extra / 2021-04-23 13:04:12 -04:00
Moody Salem
539a6e05e5
don't fetch pool tick data 2021-04-23 11:58:07 -05:00
Ian Lapham
18408c9c75
Increase Liquidity, component cleanup, preview components (#50)
* basic +/- buttons

* start increase liquidity

* fix v3 remove
2021-04-22 22:58:03 -04:00
Noah Zinsmeister
c00eb2451f
fix small merge bug 2021-04-22 18:43:07 -04: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
925668c7a7
get skeleton remove working 2021-04-21 17:46:25 -04:00
Noah Zinsmeister
d1fad3c4ea
update to latest deploy
refactor useV3Positions to work with remove

axe old redirects
2021-04-20 15:31:31 -04:00
Moody Salem
2d4b60b9dd
Merge branch 'main' into v3-main
# Conflicts:
#	.env
#	README.md
#	package.json
#	src/components/TokenWarningModal/index.tsx
#	src/connectors/index.ts
#	src/constants/index.ts
#	src/hooks/Trades.ts
#	src/index.tsx
#	src/state/claim/hooks.ts
#	src/state/user/hooks.tsx
#	yarn.lock
2021-04-19 11:37:33 -05:00
Noah Zinsmeister
9fc096d091
Finish migration (#42)
* start migration (wip)

abstract some add liquidity components

bump deploy version

* add slippage params
2021-04-16 17:35:50 -04:00
Jordan Frankfurt
9f5584c37d
Start Position management, bug fix on add amounts (#40)
* very rough positions/pools data fetching and position list rendering

* fix formatting

* fix loading

* position page routing, bug on add page

Co-authored-by: ianlapham <ianlapham@gmail.com>
2021-04-16 15:33:26 -04:00
Noah Zinsmeister
231289732c
add additional bases (#1363)
* add routing token

* add logic for additional bases

* update address
2021-04-16 13:47:38 -04:00
Ian Lapham
0c0305a53d
Add page MVP UI + v3 pool hooks and state (#35)
* WIP start usePool and useDerivedMint hooks

* naming updates

* Use real tick and pool math

* rate updates

* WIP start usePool and useDerivedMint hooks

* naming updates

* Use real tick and pool math

* rate updates

* fix warnings

* fix incorrect import

* clean up state, fix preview

* same token check

* amoutn parse update

* update hard coded chain id

* fix price creation in util

* update 1 amount in price calculation

* update comments

* update tick spacing input

* fix label on counter

* update rate label on range select

* update labels

* fixing pool hook

* clean pool hook

* preserve working rate switching

* reset values on rate switch

* clean up derived hook - setup for testnet

* format slippage amounts and support ETH

* fix import error

* fix package.json dependencies

* silence warnings

* silence more warnings

* bump multicodec and multihashes

* update migrator constants

* update txn to use sdk calldata

* fix txn formatting, update summary

* Squashed commit of the following:

commit b81ff7ca9e57bb8c3823be4c54827e5955fb3d15
Author: ianlapham <ianlapham@gmail.com>
Date:   Mon Apr 12 23:46:09 2021 -0400

    fix txn formatting, update summary

commit b9f91b0746c546602d336c8fd6f614ec9b4f3f19
Author: ianlapham <ianlapham@gmail.com>
Date:   Mon Apr 12 19:29:12 2021 -0400

    update txn to use sdk calldata

commit 20acf704c67cfd4f597494c8cb9c672c6270ae02
Merge: 4431914 2462901
Author: ianlapham <ianlapham@gmail.com>
Date:   Sun Apr 11 20:33:39 2021 -0400

    Merge branch 'minting' of https://github.com/Uniswap/v3-interface into minting

commit 44319146372e1c373b025741ae896fa2476e5765
Author: ianlapham <ianlapham@gmail.com>
Date:   Sun Apr 11 20:32:35 2021 -0400

    update migrator constants

commit 35e0618de06ba316d3a3f327075625760414ab83
Merge: 8927882 c3f65e3
Author: ianlapham <ianlapham@gmail.com>
Date:   Sun Apr 11 20:13:36 2021 -0400

    Merge branch 'main' of https://github.com/Uniswap/v3-interface into minting

commit 24629019e80c368c337a2679a51d4acb1097171c
Author: Noah Zinsmeister <noahwz@gmail.com>
Date:   Fri Apr 9 15:56:25 2021 -0400

    bump multicodec and multihashes

commit 9b5dd1876a64acbf6694d208b608bb0b429e317f
Author: Noah Zinsmeister <noahwz@gmail.com>
Date:   Fri Apr 9 14:59:09 2021 -0400

    silence more warnings

commit 140ddc1b54c7fbdd7ead2fa64bcc302f201d69f5
Author: Noah Zinsmeister <noahwz@gmail.com>
Date:   Fri Apr 9 14:57:58 2021 -0400

    silence warnings

commit 5a2726ebdd4ffaacfb3d8ec7903a944042c1bd9d
Author: Noah Zinsmeister <noahwz@gmail.com>
Date:   Fri Apr 9 14:35:01 2021 -0400

    fix package.json dependencies

commit 7c4d0a40931338de9a6197652b82fdab773483e3
Author: Noah Zinsmeister <noahwz@gmail.com>
Date:   Fri Apr 9 14:21:46 2021 -0400

    fix import error

commit e49ef19cbef7fbdf1737787a439e7cb78ba295b4
Merge: 8927882 c3f65e3
Author: Noah Zinsmeister <noahwz@gmail.com>
Date:   Fri Apr 9 14:08:34 2021 -0400

    Merge branch 'main' into minting

commit 89278825bd798a87d6010a74f8fc1d2b34a8ece1
Author: ianlapham <ianlapham@gmail.com>
Date:   Thu Apr 8 15:18:40 2021 -0400

    format slippage amounts and support ETH

commit 9a90b19e9a759cbc0c3e903a983660730c8833ad
Author: ianlapham <ianlapham@gmail.com>
Date:   Wed Apr 7 19:43:43 2021 -0400

    clean up derived hook - setup for testnet

commit dc034bc78a147f95f47b077d28a7d6e3165cedd7
Author: ianlapham <ianlapham@gmail.com>
Date:   Wed Apr 7 00:48:24 2021 -0400

    reset values on rate switch

commit bb5ccb2c853f7b2c27ec8d2f34f42a1b06f845b9
Author: ianlapham <ianlapham@gmail.com>
Date:   Wed Apr 7 00:38:39 2021 -0400

    preserve working rate switching

commit 5312d0ae7015150da48ba304de8c7a02b7d8925c
Author: ianlapham <ianlapham@gmail.com>
Date:   Mon Apr 5 13:52:46 2021 -0400

    clean pool hook

commit 5222de14834e76c37755225be17214a6e798d872
Merge: b2ba466 24521f0
Author: ianlapham <ianlapham@gmail.com>
Date:   Mon Apr 5 12:20:34 2021 -0400

    Merge branch 'main' of https://github.com/Uniswap/v3-interface into minting

commit b2ba46684a7b0bd8a8362f5990f4a208bfeff2dd
Author: ianlapham <ianlapham@gmail.com>
Date:   Mon Apr 5 12:19:20 2021 -0400

    fixing pool hook

commit b10742af99a725e04c1b756aa20f99e995f8cfeb
Author: ianlapham <ianlapham@gmail.com>
Date:   Thu Apr 1 16:53:52 2021 -0400

    update labels

commit 05abd395949245596c95090a9d5d77c7c272dbd3
Author: ianlapham <ianlapham@gmail.com>
Date:   Thu Apr 1 15:34:17 2021 -0400

    update rate label on range select

commit f098d01b6f4dc1dcb99e0fa314dde93647a19bb6
Author: ianlapham <ianlapham@gmail.com>
Date:   Thu Apr 1 15:26:30 2021 -0400

    fix label on counter

commit 16ffe61e8ee2b677adf5d468efa9d7aa8d7e092e
Author: ianlapham <ianlapham@gmail.com>
Date:   Thu Apr 1 15:06:50 2021 -0400

    update tick spacing input

commit 0fa2c8a15821dd32ec978750991a962ecb8f7344
Author: ianlapham <ianlapham@gmail.com>
Date:   Thu Apr 1 14:53:18 2021 -0400

    update comments

commit 1fccf57a1ef081ef6ba9790dc20e0ed604ac2b09
Author: ianlapham <ianlapham@gmail.com>
Date:   Thu Apr 1 14:52:37 2021 -0400

    update 1 amount in price calculation

commit b0e5d22bf8c57b3eacd75f077f68aaca4a9f975a
Author: ianlapham <ianlapham@gmail.com>
Date:   Thu Apr 1 14:46:41 2021 -0400

    fix price creation in util

commit 1ce246e85372e4f120f983ca18a1eb3d16e8647e
Author: ianlapham <ianlapham@gmail.com>
Date:   Thu Apr 1 13:55:14 2021 -0400

    update hard coded chain id

commit 2360b2d0a3233b604956e89de4bd7b09c0506875
Author: ianlapham <ianlapham@gmail.com>
Date:   Thu Apr 1 13:09:21 2021 -0400

    amoutn parse update

commit 6a99a7b71fe446fe77cb2741adce4c067862ca4a
Author: ianlapham <ianlapham@gmail.com>
Date:   Thu Apr 1 13:05:41 2021 -0400

    same token check

commit 83a1fd5a9ff02c6a49532cb54a57770b52fc052e
Author: ianlapham <ianlapham@gmail.com>
Date:   Thu Apr 1 12:31:21 2021 -0400

    clean up state, fix preview

commit 8592383b8386d7adbbaeaa2c6f9c36bb121d1c65
Author: ianlapham <ianlapham@gmail.com>
Date:   Wed Mar 31 22:47:56 2021 -0400

    fix incorrect import

commit ce526fd545e52142f847dbf3caec1ca37bb0650b
Author: ianlapham <ianlapham@gmail.com>
Date:   Wed Mar 31 22:36:10 2021 -0400

    fix warnings

commit 572770fd3e000ce31cd3a6c5c5c91eac92cc8c5c
Merge: a9e5b6c 2677491
Author: ianlapham <ianlapham@gmail.com>
Date:   Wed Mar 31 22:16:30 2021 -0400

    Merge branch 'minting' of https://github.com/Uniswap/v3-interface into minting

commit a9e5b6c5e5983e279a640886783f97c33b713125
Author: ianlapham <ianlapham@gmail.com>
Date:   Wed Mar 31 22:12:43 2021 -0400

    rate updates

commit b88cab6c06176eefe5cf71f7cc3e3664d9f514ab
Author: ianlapham <ianlapham@gmail.com>
Date:   Wed Mar 31 16:15:08 2021 -0400

    Use real tick and pool math

commit ed933cfd17141174c03b0bcac5f41cf75ff9b258
Author: ianlapham <ianlapham@gmail.com>
Date:   Sun Mar 28 22:42:05 2021 -0400

    naming updates

commit 50c0a0ece5c6c66a603508529c5e7a28f45db632
Author: ianlapham <ianlapham@gmail.com>
Date:   Sun Mar 28 22:36:08 2021 -0400

    WIP start usePool and useDerivedMint hooks

commit 2677491e2128e1318a0dd4307e63069e0f8e1dfe
Author: ianlapham <ianlapham@gmail.com>
Date:   Wed Mar 31 22:12:43 2021 -0400

    rate updates

commit c2f59d6c61068a2bf4d34d102d5d28c9863ce982
Author: ianlapham <ianlapham@gmail.com>
Date:   Wed Mar 31 16:15:08 2021 -0400

    Use real tick and pool math

commit 7d53e5c7e979be19fc5c63eb52307f302328c4eb
Author: ianlapham <ianlapham@gmail.com>
Date:   Sun Mar 28 22:42:05 2021 -0400

    naming updates

commit 9022650d391682f97e71d336021c2db2e5ea5455
Author: ianlapham <ianlapham@gmail.com>
Date:   Sun Mar 28 22:36:08 2021 -0400

    WIP start usePool and useDerivedMint hooks

* remove 1337 references

* clean up multicall

* clean up redirects/router

* cleanup

* improve useAllV3Ticks

* fix multicall

* typo

* Fix code style issues with ESLint

* preserve sticky

* reset to non fixed scroll

* fix inputs at 1

* update tests

* fix routes

* sticky sidebar

Co-authored-by: Noah Zinsmeister <noahwz@gmail.com>
Co-authored-by: Lint Action <lint-action@samuelmeuli.com>
Co-authored-by: Callil Capuozzo <callil.capuozzo@gmail.com>
2021-04-14 10:12:35 -04:00
Noah Zinsmeister
c3f65e3abd
migration v2 (#38)
* wip

* add some v2 paths

* start to refactor migrate page

update deploy addresses

* fix tests

* stub out v3 remove

* silence some lint warnings
2021-04-09 14:01:56 -04:00
Noah Zinsmeister
f0f4110b4b
update some multicall constants 2021-04-06 10:34:28 -04:00
Noah Zinsmeister
24521f0c92
deploy new tick lens, fix hook 2021-04-02 21:21:47 -04:00
Noah Zinsmeister
a037595e6e
chunk multicall by gas cost
add useAllV3Ticks
2021-04-02 20:00:28 -04:00
Jordan Frankfurt
edf4c47451
add external abi types (#37) 2021-03-31 03:40:13 -04:00
Jordan Frankfurt
c0ce6a55c4
add typechain gen scripts (#36)
add typechain generation for core/periphery contracts
2021-03-30 03:51:37 -04:00
Ian Lapham
878fc9cf4d
Refactor with core (#33)
* Update index.ts

* feature(service worker): add offline support (#1319)

* Revert "feature(service worker): add offline support (#1319)" (#1320)

This reverts commit 34dfb41a1e0a647596c5d37d5e3f7baa6c4005a3.

* Revert "Revert "feature(service worker): add offline support (#1319)" (#1320)" (#1321)

This reverts commit db3328c8d9d7ea7b7cf7e75dc658714798d007a4.

* unregisters all installed service workers (#1322)

* fix: modals stealing focus across frames (#1326)

* improvement(lists): add BA SEC tokens to unsupported list  (#1327)

* show hidden search results by default

* update break styles

* optimize filter, use debounce on input

* increase debounce time

* add ba association list

* handle dismiss (#1328)

* split up sdk use between core and v2

* Fix code style issues with ESLint

* remove service worker

Co-authored-by: Moody Salem <moodysalem@users.noreply.github.com>
Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com>
Co-authored-by: Hyperion <72735936+moontools-hyperion@users.noreply.github.com>
Co-authored-by: Lint Action <lint-action@samuelmeuli.com>
2021-03-23 21:45:58 -04:00
Jordan Frankfurt
32e679c62e
prototype position data hook (#32)
Co-authored-by: Jordan Frankfurt <layup-entropy@protonmail.com>
2021-03-23 20:18:52 -04:00
Ian Lapham
b258f557d1
improvement(lists): add BA SEC tokens to unsupported list (#1327)
* show hidden search results by default

* update break styles

* optimize filter, use debounce on input

* increase debounce time

* add ba association list
2021-02-25 14:08:17 -05:00
Lint Action
9d9b57dd4c Fix code style issues with ESLint 2021-02-16 08:46:17 +00:00
Lint Action
b6d8512316 Fix code style issues with ESLint 2021-02-16 08:36:54 +00:00
Jordan Frankfurt
4e17107ac5 upgrade prettier 2021-02-16 03:34:45 -05:00
Jordan Frankfurt
6965707d45 Revert "upgrade prettier"
This reverts commit 5fabe438e52d4844307f86577d1d13a2e571e5f5.
2021-02-16 03:26:53 -05:00
ianlapham
3cb382376a format chart component 2021-02-15 21:27:42 -05:00
Lint Action
b630d59437 Fix code style issues with ESLint 2021-02-15 17:01:46 +00:00
Ian Lapham
f450d34d69
feat(transactions): enable button to add tokens to metamask (#1311)
* start on adding button for watching tokens

* add tokens to metamask

* add confirmation view

* reset modal view
2021-02-09 18:55:38 -05:00
Ian Lapham
267204d98e
Improvement(lists): Switch to multiple active lists (#1237)
* basic support for multiple active lists

* start search across inactive lists

* store card before list update

* basic import flow for inactive tokens

* update supported lists

* update import flow for address pasting

* basic mvp

* hide filter if no results

* update min heights

* update manage view, index tokens on page load

* start routing fix for multi hops

* switch to input amount comparison on exactOut

* start list import view

* updated list UI, token search updates, list import flow, surpress popups and warnings

* add unsupported tokens

* show warning if logged out

* update to opyn list

* show token details on warning;

* make percent logic more clear

* remove uneeded comaprisons

* move logic to functions for testing

* test updates

* update list reducer tests

* remove unused locals

* code cleanup

* add unsupported local list

* add multi hop disable switch

* add GA

* fix bug to return multihop no single

* update swap details

* copy updates

* Visual refinements

* Further tweaks

* copy updates, actual list order

* Move settings button

* Update all trade views with settings cog

* Add better tips, remove darkmode toggle from dropdown

* Clean up routing UI

* UI tweaks

* minor tweaks

* copy updates

* add local default list, use existing function for trade comparison, disable v1 helper, show inactive/active at once

* updated inactive view

* remove slippage fix

* update output amount return

* center button, update search to character threshold

* reset add state on back navigation

* style tweak on add button

* fix bug on search results

Co-authored-by: Callil Capuozzo <callil.capuozzo@gmail.com>
2021-01-14 11:20:50 -05:00
Ian Lapham
a70aa41df2
Routing updates only (#1265)
* start routing fix for multi hops

* switch to input amount comparison on exactOut

* make percent logic more clear

* remove uneeded comaprisons

* move logic to functions for testing

* add multi hop disable switch

* add GA

* fix bug to return multihop no single

* update swap details

* code clean

* routing only
2021-01-12 17:36:57 -05:00
Ian Lapham
587b659816
catch error in bytes32 string parsing (#1253) 2020-12-30 11:50:40 -05:00
Moody Salem
03913d9c0b
UNI 2020-09-24 11:29:31 -05:00
Ian Lapham
975570fa97
improvement(swap): progress bar and more minimal default UI, also fix custom add/remove (#1069)
* add progress bar and minimal UI updates on swap

* add hook to explicity check user added tokens, fixes add/remove bug

* update with latest

* remove confusing comment

* update styles on loading, update arrow placement, code cleanup

* fix typo on progress import
2020-08-31 15:27:30 -04:00
Moody Salem
85217452db
improvement(ts): strict everywhere 2020-08-27 13:10:00 -05:00
Moody Salem
f7a1a2ab58
move noImplicitAny and some type declarations 2020-08-27 12:24:03 -05:00
Moody Salem
66a2006284
more strictness everywhere, fix a pair pricing issue in mint/hooks.ts 2020-08-27 12:05:09 -05:00
Moody Salem
467e80a42f
improvement(#1043): do not allow swapping to bad addresses 2020-08-26 09:19:59 -05:00
Moody Salem
7cf25ac7c8
feat(lists): allow selecting and adding token lists (#1023)
* more list stuff

Use the selected list instead of the default list, but also use the default list

start list selection code

* move token warning to a modal, fix the install issue

* add/remove/enter key

* handle enter on currency select for ETHER

* change slippage tolerance to be a slider

* make ui closer to the mocks

* commit slider changes

* back to tabs

* copy changes

* bump list version

* some styling for the list select

* bump uniswap default list version

* use contract calls to get ens names and addresses

* show list logo

* fix failing integration test

* .eth.link

* list introduction screen

* remove showSendWithSwap

* fix integration and unit tests

* resolve ENS names

* logos from ens

* fix the lint errors

* some refactoring to better support using a the library provider from the user for resolving ENS names

* load list info from the list url for the introduction page

* make it slightly harder to remove a list

* minor clean up, some help text and links

* remove icon from list update popup

* show added/removed tokens

* add GA everywhere, don't debounce contenthash lookups

* show tags

* fix tag key

* tag display, list rendering, needs optimization

* fix list fetching in firefox, style issue in safari

* sort the lists, clean up styling

* use client provider when possible

* show token warning for url loaded tokens

* improve the warning modal

* some refactoring to fix the list fetching on networks other than mainnet

* fix tests

* some minor improvements

* increase timeout to maybe fix integration tests which pass locally

* build for tests using the dev network url

* reset the lists if we deleted the other two copies

* improve how we handle updating the default list of lists

* fix integration test

* Update token list selection styles

* fix external links, reuse the on click outside code, show add errors

* show the list origin instead of the full url

* fix update list link

* show host instead of hostname
do not automatically dismiss major version upgrades for lists

* fix link to tokenlists.org

* add uma

* clean up styling in list rows

* bump token list version

* bump token list version again

* hover symbol to see currency name

* bump version

* add cmc lists, dharma list

Co-authored-by: Callil Capuozzo <callil.capuozzo@gmail.com>
2020-08-26 08:46:21 -05:00
Moody Salem
6e91311489
remove console.log statement 2020-08-10 15:11:05 -05:00
Moody Salem
f6a464cb3b
fix(ampl): do not swap ampl via pairs other than DAI/ETH 2020-08-10 15:05:41 -05:00
Moody Salem
e589c751d7
improvement(swap errors): show more information about the swap error 2020-08-10 12:05:35 -05:00
Moody Salem
0f91af1df2
improvement(swap): Better swap errors for FoT (#1015)
* move the gas estimation stuff into its own hook and report errors from the gas estimation

* fix linter errors

* show the swap callback error separately

* rename some variables

* use a manually specified key for gas estimates

* flip price... thought i did this already

* only show swap callback error if approval state is approved

* some clean up to the swap components

* stop proactively looking for gas estimates

* improve some retry stuff, show errors inline

* add another retry test

* latest ethers

* fix integration tests

* simplify modal and fix jitter on open in mobile

* refactor confirmation modal into pieces before creating the error content

* finish refactoring of transaction confirmation modal

* show error state in the transaction confirmation modal

* fix lint errors

* error not always relevant

* fix lint errors, remove action item

* move a lot of code into ConfirmSwapModal.tsx

* show accept changes flow, not styled

* Adjust styles for slippage error states

* Add styles for updated price prompt

* Add input/output highlighting

* lint errors

* fix link to wallets in modal

* use total supply instead of reserves for `noLiquidity` (fixes #701)

* bump the walletconnect version to the fixed alpha

Co-authored-by: Callil Capuozzo <callil.capuozzo@gmail.com>
2020-08-06 18:18:43 -05:00
Moody Salem
e3b3d9e825
fix(swaps): band-aid fix for gas estimates to disable multihop for eth-ampl 2020-07-31 11:50:30 -05:00
Moody Salem
e78b6d61f2
improvement(transactions): some clean up and unit tests
- fetch transaction state less often for old transactions
- fix a bug calling non payable methods with value 0
2020-07-27 08:45:48 -05:00
Moody Salem
365b429c0b
feat(token lists): implement the uniswap default list as a token list (#983)
* load tokens from url `useTokenList`

* improve performance of the loading

* move the loading to redux and save loaded lists

* lint error

* move the list fetching code to a separate component

* change how token lists are fetched to use the updater and add unit tests

* fix a crash with currencyEquals

* bump sdk version

* token lists should automatically update for minor/patch changes

* nit

* show popups for list updates

* support pointing at localhost

* spuport ipfs/ipns logos

* use the updater to bump list versions

* save the old/new list in the popup for viewing diffs

* improve the list popup

* fix linter error, make sure visibility checking is working

* show list update notifications

* address a couple metamask warnings, linter error

* fix the custom added/default tokens

* refactor some popup stuff to reuse the fader

* linter error

* Revert: refactor some popup stuff to reuse the fader (a7b0f752)

* style improvements, linter

* add to the readme, drop the token-request template

* back to the beta that works with wallet connect

* get the dependencies to a state that works with wallet connect and passes integration tests
2020-07-25 10:41:03 -05:00
Moody Salem
19b1e9e399
feat(weth): support WETH across the site and use sdk 3.0 (#947)
* first pass of sdk 3.0

* second pass using weth

* kill unused pool popup

* get it compiling again

* first pass of sdk 3.0

* switch to currencies

* get it compiling after the big move merge

* restore margin

* clean up add liquidity more

* fix a bunch of bugs

* todo trade on v1

* show eth in currency list

* allow selecting eth in the swap page

* fix unit tests for swap page

* test lint errors

* fix failing integration tests

* fix another couple of failing unit tests

* handle selecting currency b when no currency a

* improve the import pool page

* clean up add liquidity for invalid pairs

* bold

* first pass at swap arguments for v1, some unit tests

* fix some bugs in add liquidity, burn hook

* fix last of ts errors in remove liquidity

* support wrapping/unwrapping weth

* kill a bunch of code including the dummy pairs

* required pair prop in the position card

* tests for the v1 swap arguments

* do not say estimated on the wrap ui

* show ETH instead of WETH in the pool summaries

* small size socks

* fix lint error

* in burn, use currencies from the URL

* fix some integration tests

* both contain weth

* receive eth/weth link

* fix empty row

* show wrapped only if one currency is weth

* currency selects in the remove liquidity page
2020-07-20 06:48:42 -05:00
Moody Salem
eeef306bdd
fix(🧦): 🧦 2020-07-10 12:42:24 -04:00
Moody Salem
63a491d4b1
improvement(approval): show approval state approved if allowance exceeds amount to approve, even when pending 2020-07-09 13:34:29 -04:00
Moody Salem
0fa238af0b
fix(swap): swap to account if recipient is null (#940)
* fix(swap): swap to account if recipient is null

* fix naming and strict ts error
2020-07-09 09:55:20 -04:00
Moody Salem
21c1484c0e
feat(send page): remove send page, implement recipient feature in swap page (#934)
* quick poc for removing swap page

* accidental import

* error for recipient field

* query parameter working

* undo id change

* tweaks to match mocks better

* tweaks to match mocks better

* some extra integration tests

* clean up nav tabs a bit

* clean up nav tabs a bit

* space swap/pool better

* stop selecting button text when double clicking

* remove unused transfer modal header

* add info to swap confirm modal

* shorten address

* improve summary message, remove unused send callback, fix react ga event

* fix lint errors

* arrow color
2020-07-08 23:06:29 -04:00
Moody Salem
f5229ca838
linter error 2020-07-06 21:31:08 -04:00
Moody Salem
875203f0ef
fix(responsiveness): small tweaks for mobile 2020-07-06 21:26:38 -04:00
Moody Salem
852e8f749f
fix(swap routing): max hops back to 3 2020-06-26 14:12:12 -04:00
Moody Salem
6694e5e398
improvement(swap routing): consider more bases in the swap (#909)
* consider more bases in the swap

* all match type

* max hops 2, only 1 result
2020-06-26 13:27:38 -04:00
Moody Salem
2c4f4092d8
improvement(advanced): always show advanced (#890)
* always show advanced

* fix test

* always show the price, less jitter

* show tokens in price field

* fix the dropdown sticking around when switching between swap/send

* lint

* fix ios scrolling the modal body into the viewport bug

* don't use react-spring for simple slide animation

* safer price impact constants
2020-06-15 10:13:12 -04:00
Callil Capuozzo
fd162a72ff
feat(expert mode): Add expert mode (#828)
* Add expert mode scaffolding

* move advanced settings to settings tab, add expert mode

* update settings modal

* update font weight

* fix text

* update with modal
;

* add null checks

* update with input checking

* merge and add fixes

* update language and bg

Co-authored-by: ianlapham <ianlapham@gmail.com>
2020-06-12 15:26:28 -04:00
Moody Salem
7e49babff7
improvement(token search): No automatic add (#888)
* no automatic add, major refactors

* fix nit with version link

* add/remove links in the token search modal

* close tooltip when user types

* remove skip
2020-06-12 11:15:18 -04:00
Moody Salem
bafd3f3c05
feat(v1-support): Enable executing swaps on v1 or v2 (#883)
* swap-v1

* toggle the version switch based on the search query parameter

* rework some of the query parameter stuff in send/swap

* hide the url when they click it

* allow switching back to v2 via the toggle

* represent the v1 trade in the UI if they toggle it on

* show trade link in both directions (5% threshold for v1 link)

* input amounts should reflect v1/v2

* perform the approve on v1 exchange for v1 trades

* get swap on v1 working

* move some code around to reduce duplication

* fix ts error

* correct input allowance

* fix exact token to token on v1

* fix pending approvals to be specific to the spender

* google analytics for swap version

* disable the version switch on pages other than swap and send
2020-06-11 15:56:28 -04:00
Moody Salem
9869a9fcb7
fix(swap): if swap fails in FoT router but not in regular router, throw an error (#875)
this is an alternative solution to hard coding forced FoT router tokens
2020-06-08 10:06:37 -04:00
Moody Salem
97deebad37
temporary workaround for tokens that have transfer methods that succeed but do not transfer tokens 2020-06-06 08:41:31 -04:00
Noah Zinsmeister
e667615449
support proposed new FoT-capable methods (#866)
* support new FoT-capable methods

short-circuit modal footer rendering if no trade

improve clarity of tx modal flow

* update router address + ABI
2020-06-05 18:40:02 -04:00
Moody Salem
104be830fc
perf(multicall): use single call to get token information (#855)
* use single call to get token information

* delete the bytes32 overload

* console log statement

* add a bunch of tests to actions.ts for multicall

* fix to work with bytes32 symbols/names

* only include name/symbol

* enforce lowercase calldata
2020-06-03 22:15:26 -04:00
Moody Salem
c1d35cc8b3
feat(migrate): adds the migrate flow to the uniswap exchange site
* links and page

* print all the details of the liquidity

* show working approve/migrate buttons

* testnet v1 factory addresses

* split code up into two pages

* getting closer to styled

* compute min amount out of eth and token

* compute min amount out of eth and token

* add a back button to the list page

* Improve empty states

* Improve the state management

* change the display of the migrate page to be more similar to original

* style fix, pending transaction hook fix

* add forwarding to netlify.toml

* handle case where v2 spot price does not exist because pair does not exist

* make ternaries more accurate

* handle first liquidity provider situation

* Style tweaks for migrate

* merge

* Address feedback
- show pool token amount
- show success when migration complete
- show price warning only if price difference is large

Co-authored-by: Callil Capuozzo <callil.capuozzo@gmail.com>
2020-06-03 14:07:01 -04:00
Noah Zinsmeister
6ffbf756f8
memoize common bases (#853)
* memoize common bases

* improve memoization
2020-06-02 15:43:10 -04:00
Noah Zinsmeister
2d6eddf9d4
introduce batched usePairs (#851)
centralize all lists of bases

pin some pairs
2020-06-01 16:55:31 -04:00
Moody Salem
9492e7375a
chore(multicall/migrate): move some v1 stuff around for migrate 2020-05-29 15:08:07 -04:00
Moody Salem
9c1fe53e4b
perf(ethereum): reduce number of calls by batching all polling node calls (#840)
* initial refactoring

* rebase lint error

* start implementing reducer

* multicall reducer

* working multicall!

* clean up performance, re-fix annoying error

* use multicall everywhere

* use multicall for balances

* fix lint warning

* Use checksummed address

* Fix strict warning

* get it to a working state with the more generic form

* convert useETHBalances

* Remove the eth-scan contract completely

* Remove the eth-scan contract completely more

* Default export

* Put the encoding/decoding in the methods that can do it most efficiently

* Avoid duplicate fetches via debounce

* Reduce delay to something less noticeable

* Return null if pair reserves are undefined to indicate it does not exist
2020-05-28 21:17:45 -04:00
Moody Salem
c9721c42bf
perf(reduce call volume): save a bunch of calls to infura when the tab is not focused, change infura IDs for v2 2020-05-26 13:36:09 -04:00
Moody Salem
7b9b332c42
fix(popover): ios safari not showing the popover 2020-05-25 01:39:50 -04:00
Moody Salem
ccab6f01cf
More tests for add/remove liquidity and fix the automatic loading of tokens in those pages 2020-05-20 23:11:49 -05:00
Moody Salem
04584cc4ac
Fix the add liquidity link from uniswap.info 2020-05-20 21:09:36 -05:00
Moody Salem
7d20dd976b
Fix a crash related to WETH being loaded from add liquidity 2020-05-20 20:51:25 -05:00
Moody Salem
1bb4db5414
Make the hooks directory strict (#817)
* Make the hooks directory strict

* Move using the v1 factory contract to hooks

* Add a comment to why we copy the token map

* Fix another lint error and make AllTokens deep readonly

* Move ALL_TOKENS to constants directory
2020-05-20 14:39:28 -05:00
Moody Salem
1e7072d5f2
Fix swap + send not going to recipient (#810) 2020-05-19 18:28:26 -05:00
Noah Zinsmeister
373b3180d3
manual approve fallback for remove liquidity (#806)
* generalize useApproveCallback

* show proper slippageAdjustedAmounts in dialog

* make confirmed button text readable in light mode

* default timeout from 15 -> 20 minutes

* add manual approve fallback to remove liquidity

* remove console log

* fix bad web3-react import introduced by refactor

* rename our wrapped version of useWeb3React

* return an enum from useApproveCallback

* fix comment
2020-05-19 15:08:58 -04:00
Moody Salem
3b2c21e26d
Fix issue where tokens did not disappear after removed 2020-05-18 22:46:06 -05:00
Moody Salem
0e72f1c5d3
Remove unnecessary memoization that causes a caching issue 2020-05-18 22:40:46 -05:00
Noah Zinsmeister
e311e2fcf9
mainnet (#782)
* mainnet config

* fix token + pair sorting

* standardize wrapped useWeb3React imports

* add final return to pair sorting

* add connecting pairs

* break tokens out into separate files

revert isAddress change

* filter out duplicate pairs

* remove add liquidity prompts

* link to v1 trades that are invalid on v2

* forward v2 subdomain to apex

* update blog link

* get rid of smart quotes

* link to uniswap info in position card

* improve pair sorting/searching

break out token identification

fix crash on early pool position clicks

change pair token separator from : to /
2020-05-18 13:20:42 -04:00
Moody Salem
095beae0c2
Refactor ExchangePage into Swap and Send pages (#774)
* Part 1, separate swap and send, move duplicate code into separate files

* Move some more constants out of the swap/send

* Support defaults from URL parameters

* Implement query string parsing via a redux action

* Finish merging the changes

* Fix the slippage warnings

* Clean up some other files

* More refactoring

* Move the price bar out of the component

* Move advanced details and some computations into utilities

* Make same improvements to send

* Approval hook

* Swap page functional with swap callback hook

* Swap/send page functional with swap callback hook

* Fix lint

* Move styleds.ts

* Fix integration test

* Fix error state in swap and move some things around

* Move send callback out of send page

* Make send behave more like current behavior

* Differentiate swap w/o send on send page from swap w/o send on swap page

* Remove userAdvanced which was always false

* Remove the price bar which is not used in the new UI

* Delete the file

* Fix null in the send dialog and move another component out of send

* Move the swap modal header out to another file

* Include change after merge

* Add recipient to swap message

* Keep input token selected if user has no balance and clicks send with swap

* Move the modal footer out of send component

* Remove the hard coded estimated time

* Fix the label/action for swap/sends

* Share the swap modal footer between swap and send

* Fix integration test

* remove margin from popper to suppress warnings

fix missing ENS name recipient link

default deadline to 15 minutes

* ensure useApproveCallback returns accurate data

* clean up callbacks

* extra space

* Re-apply ignored changes from v2 branch ExchangePage file

Co-authored-by: Noah Zinsmeister <noahwz@gmail.com>
2020-05-16 16:55:22 -05:00
Noah Zinsmeister
7bffea0692
update swr hooks when block number changes (#771)
* key per-block SWR data with block number

* fix + tweak copy and decrease sig figs for lp fee

* don't use blocknumber as a key

instead mutate when it changes

* fix totalsupply + user liquidity sync issues

* fix v1 trade checker logic

* rough fix allowing removal of user added tokens

probably needs a more comprehensive overhaul...

* refactor SWR block updates to custom hook

* typo

* fix import error

* fix footer css to work cross-broswer

* disallow \ to be typing into amount inputs

add test case for this

add value assertions to all input integration tests

* fix import error

* remove console.log

* clean up address input a bit

trim whitespace from pasted addresses

* fix input maxing

remove spurious max output logic
2020-05-14 17:12:59 -04:00
Moody Salem
b1ffab1890
Refactors (#772)
* Bunch of refactoring

* Add an integration test that gets as far as swapping

* Drop the nonce code that isn't doing anything right now

* Undo one of the accidental changes to the reducer
2020-05-14 15:56:40 -04:00
Moody Salem
0733cdd63c
Fix trade routing to not throw 2020-05-13 19:57:12 -04:00
Moody Salem
6da8e2c84d
Introduce redux for one of the state stores (#742)
* Introduce redux for one of the state stores

* Remove unused state

* Clean up hooks

* Add types for react-redux and fix error from any type on useSelector

* Strongly type the web3 provider

* Make the popup content into a POJO

* Lint errors

* Clean up method call

* Fix lint error

* Fix lint error

* Lint
2020-05-11 18:23:01 -04:00
Noah Zinsmeister
d40d81ca6a
noah changes (#739)
* remove duplicated prettier from dependencies

* use swr for allowances

* slight improvements to error cascading

* fetch totalsupply with SWR

fetch pairs with SWR (except persistent pairs, will be refactored later)

* fix lint error

* stop using pair context, instead store per-user pairs in local storage

* add more pairs to the default list

remove unnecessary isWETH

fix lint error

* add more bases to trade consideration

* fix lint warnings

* get SWR data on same schedule

* don't pass value if it's 0

fix WETH equality checks

* clean up fixed/significant formatting

* fix slippage calculation bug in swap

add slippage to remove

* fix token logos

* show fewer sig figs

* lint error

* remove unused signer

* add calculateSlippageAmount safety check and tests

* fix useAllBalances type

stop spuriously sorting token amounts of different tokens

use slightly better comparisons for slippage calculations

* improve priceSlippage comparison logic

* useReserves -> usePair

* use checksum for DAI logo address
2020-05-11 16:39:05 -04:00
Moody Salem
ee92df1554
Handle insufficient reserves/input errors without crashing 2020-05-09 12:41:21 -04:00
Moody Salem
843d5e790a
Done with linter errors! 2020-05-08 18:32:36 -04:00
Moody Salem
3b3f281319
Use eslint/prettier for typescript files 2020-05-08 14:50:27 -04:00
Moody Salem
17eceebcf5
Final typescript migration push 2020-05-08 14:15:47 -04:00
Moody Salem
2adb0a3dfb
Ts almost everywhere (#736)
* First 2

* More typescript

* More and more

* Almost there

* More

* More typescript

* Fix remove liquidity button

* Make the error chain more readable

* Slippage tabs
2020-05-08 13:48:05 -04:00
Moody Salem
a1a9d9f041
Type safety for styled components (#733) 2020-05-08 11:24:47 -04:00
Moody Salem
9b2fe0bdca
Use best trade to get the best route (#731) 2020-05-08 11:13:16 -04:00
Moody Salem
7fcecc22d9
TS migrations and commit hash in code link (#730)
* TypeScript in the utils directory, README fixes

* Remove unused methods

* Added unnecessary space

* Some env variable cleanup

* Bug in change

* Another file to ts

* App.tsx

* Header and Footer to tsx

* Few more TS migrations and add a commit hash title to the uni icon

* Few more TS migrations and put commit hash in code link

* Splitting up files

* Splitting up files (merged dark mode changes)
2020-05-07 18:52:26 -04:00
Noah Zinsmeister
64dd09f2cc
update to latest deploy (#712) 2020-05-05 16:36:22 -04:00
Ian Lapham
eaf8d5a39c
Add routes through ETH (#665)
* add fix for ETH balance fetching

* add tokens to other testnets

* update with Exchange -> Pair

* routes throuh ETH

* fix logs

* fix conflict
2020-03-26 12:42:06 -04:00
ianlapham
6211dff044 typed pages 2020-03-20 16:03:23 -04:00
ianlapham
e43d9e03f1 add popups to context 2020-03-11 10:44:39 -04:00
Paul Razvan Berg
701cbde274 Fix "useENSName" Hook (#578)
* Fix "useENSName" Hook

* Check for "stale" in "useENSName" Hook
2019-12-31 15:17:10 -05:00
Ian Lapham
015c9f8598 Hosted wallets (#528)
* formnatic setup

* stable with new hosted

* stable version, fortmatic and portis

* fix safari bug

* cleanup

* add white version of arrow

* update options to tabbable buttons

* update injected version

* style tweaks

* style tweaks, remove portis connector
2019-12-04 17:31:56 -05:00
Paul Razvan Berg
7d9ff637ef Replace networkId with chainId (#521) 2019-11-27 09:33:11 -05:00
Ian Lapham
795caac4fd Wallet Support with web3-react v6 (#514)
* basic support for desktop and mobile, with or without web3

* stable before mobile view update

* mobile modal views

* remove unused modules

* create global context for wallet modal, update to click button to connect

* first pass

* drag with react pose

* try without pose

* replace context with new syntax, basic setup

* stable version on all browser types

* remove dev flags

* fix swap broken

* update to clickable connect button if logged out

* stable, good entry

* fix bugs, exit animations

* prep for merge

* stable version with updated application context

* update animations with correct gesture package

* refactor wallet logic to multi-root

* small fixes

* Style Updates

* remove unused imports

* refactor wallet page
2019-11-25 17:56:31 -05:00
Paul Cowgill
2c856d279a Typo fix (#482) 2019-10-21 18:30:47 -04:00
Noah Zinsmeister
ae50d269ed
fix ens stuff again (#407) 2019-08-12 11:03:11 -04:00
Noah Zinsmeister
8d0b8e32a4
fix ens name typing bug (#378)
* fix ens typing error handling
2019-07-29 18:34:15 -04:00
Noah Zinsmeister
b7f49672de
merge beta to production (#317)
* update SNX exchange and token address (#301)

* update SNX exchange and token address

* checksum exchange address

* Account improvements (#302)

* begin account migration

* prep for styling

* improve multi-network support

allow deprecated window.web3 providers

* kill old modal

* remove tests

* clean up css

* Style account modal

* kill scss

* bug fixes

* use suspense for code-splitting and i18n

move abis

add ENS support to Web3Status

* Account modal mobile styles

* style tweaks

* finalize migration

* fix account styling

* fix ethereum svg

* fixes

* Split wallet modal into components

* refactor wallet modal and add connect button styles

* removing tap highlights

fix spacing on some mobile browsers

* Styling fixes for account and warning

* clean up injected connector logic

* remove console

* add wrong network copy

* restore border radius

change wallet logo

* various improvements (#313)

* add unchecked signer

* remove focus underline from tabs

* update tokens

* remove console log

* remove snx for now

* make slippage warnings more robust

* memo-ize contexts

* improve slippage styling

* fix warnings + bugs

* clear stale network error

* Feather icons (#314)

* Remove fontawesome

* Update new SNX exchange and new token address (#316)

* Update new SNX exchange and new token address

* remove whitespace

* checksum exchange address
2019-05-30 16:42:25 -04:00
Noah Zinsmeister
e27cd92cd2
Slippage warning (#292)
* add rudimentary slippage warning

fix address checksum bug

debounce address input

alway show tx details if valid trade

* fix estimated copy
2019-05-16 13:21:14 -04:00
Noah Zinsmeister
2f0e2fb234
Beta cleanup (#285)
* improve context logic

* fix font-variant

* add dependencies for later

* fix icon
2019-05-14 10:19:09 -04:00
Noah Zinsmeister
44d77ce948
Swap Migration (#277)
* migrate core logic

* finalize swap migration

* upgrade react-scripts and fix errors/warnings

* finalize swap, modularize currency input

* remove console.logs

* copy swap logic for send

* remove unnecessary variable

* tighten caching logic

* snappier ens integration
2019-05-03 16:37:59 -04:00
Noah Zinsmeister
4e413915f8
web3-react migration (#269)
* put suspense below redux

* don't mount qr

* properly format .json's

* remove useless Web3Connect component

* remove react-responsive header logic

* finalize initial web3-react migration

* add rudimentary network support

* address ci/cd issues

* fix syntax

* add infura support

rewrite create-exchange

closes #173

* remove CI flag, lazy loaded disabled for now

* roll back /pool

* fix currency input errors

fix valid state of buttons

* fix nav

* obscure env variables

* fix mobile header bug
2019-04-25 12:12:47 -04:00