Commit Graph

40 Commits

Author SHA1 Message Date
Noah Zinsmeister
b2f0236ee8
Add liquidity callback (#830)
* give add liquidity the reducer treatment

rename setDefaultsFromURL to setDefaultsFromURLSearch

* fix tests and crash

* rework DOM structure to make flow more natural

* allow slippage + deadline setting in add liquidity

* disable token selection in mint

clear input between pairs
2020-05-27 11:42:25 -04:00
Moody Salem
a0d4710a11
perf(Search modal): performance improvements (#829)
* Search modal performance improvements

* Move more code out of the search modal

* Add the question helper to the search

* Fix a couple lint errors

* Fix the tests, duplicate import text

* Hide the token info on small screens, flex the list

* Fix token sorting, have a link that focuses and shows a tooltip for the search input

* Remove reach tooltip css

* Fix pair balances in the search modal

* Get the arrow working

* Only clear the input when they re-open

* Better way to exclude props

* More small performance tweaks
2020-05-23 12:06:16 -04:00
Moody Salem
199eb8bf50
Refactor pages directory (#809)
* Revert "Temporarily disable the token warning for style fixes"

This reverts commit 70722b5e

* Move pages around and refactor to better support rendering content outside the app body

* Automatically add tokens in the add and remove liquidity pages

* Put the warning above the send/swap pages

* Add a margin below the token warning cards

* Save token warning dismissal state in user state

* Linting errors

* style fix
2020-05-20 14:00:33 -05:00
Moody Salem
c35d8fc702
Quick fix to #800 2020-05-19 09:50:31 -05:00
Moody Salem
690a121218
Strict typescript (#792)
* Make typescript compilation strict in some new code

* Fix other errors, change how we set dark mode to always respond to url parameter

* Fix bug in block number
2020-05-18 18:23:58 -05: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
Moody Salem
1e1a049990
Add more unit tests to utils 2020-05-13 14:24:03 -04:00
Ian Lapham
3a2566b4e7
Changes to useReserves, escapreRegex moved to utils, code cleanup (#762)
* bug fixes on non-existent vs no reserves, fix scanning on pair search, small ui tweaks

* remove unused vars

* remove mainnet in injected connector

* code cleanup for pr

* update pair value check
2020-05-13 14:16:52 -04:00
Moody Salem
c9db5fb276
Change slippage calculation in trade page as discussed (#756)
* Change slippage calculation in trade page as discussed

* Revert test change

* Fix the missing import
2020-05-13 13:59:54 -04:00
Moody Salem
ef65943659
Rewrite tx store (#754)
* Rewrite the transaction store

* Working state

* Fix lint errors

* Just always call getSigner
2020-05-12 18:11:10 -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
843d5e790a
Done with linter errors! 2020-05-08 18:32:36 -04:00
Moody Salem
152e84bc25
Fix more linting errors 2020-05-08 15:46:42 -04:00
Moody Salem
3b3f281319
Use eslint/prettier for typescript files 2020-05-08 14:50:27 -04:00
Moody Salem
28b24036c6
Cypress (#734)
* Add some basic integration tests and CI in GitHub

* Add push trigger

* Add badge for tests to readme

* Unit tests

* Just use the development infura URL in the tests

* Remove unused webpack config

* Make integration test run on the same port as yarn start

* make test a little bit better

* rename describe
2020-05-08 11:38:33 -04:00
Moody Salem
9b2fe0bdca
Use best trade to get the best route (#731) 2020-05-08 11:13:16 -04:00
Noah Zinsmeister
cb00e0baa5
migrate full away from ethers v4 to v5 (#728)
move some pacakges from dependencies to dev dependencies

bump versions
2020-05-07 19:53:08 -04:00
Moody Salem
b6b094acb3
remove unused functions, typescript (#725)
* TypeScript in the utils directory, README fixes

* Remove unused methods

* Added unnecessary space

* Some env variable cleanup

* Bug in change

* Another file to ts
2020-05-07 14:36:26 -04:00
Noah Zinsmeister
64dd09f2cc
update to latest deploy (#712) 2020-05-05 16:36:22 -04:00
Noah Zinsmeister
c3d8bc7ed5
Localstorage and routing improvements (#704)
* remove tokens context in favor of localstorage

refactor localstorage

improve adding custom token flow

* drop exchange language

* ensure url tokens are added to localstorage

clean up routing

remove unnecessary output approval checks

* fix bad import

* Remove unused imported checks

* remove unused imports

Co-authored-by: Ian Lapham <ianlapham@gmail.com>
2020-05-04 17:56:10 -04:00
Ian Lapham
006fe9b325
Updated context keys, remove logs (#680)
* updated keys in pair context

* fix bug on imported liquidity

* Add price bar and spacing tweaks

* Header tweaks

* Base for token import, query params, styling updates

* remove unused imports

* query params, create flow

* set ETH as default for create

* Style tweaks and price bar location

* add mobile popups, mobile styling on header

* updated mobile styles

* style updates mobile, fix build

Co-authored-by: Callil Capuozzo <callil.capuozzo@gmail.com>
2020-04-22 17:22:13 -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
655b79569b basic send added 2020-03-17 16:23:27 -04:00
ianlapham
2ca3bf8da3 add slider to remove 2020-03-05 22:57:41 -05:00
ianlapham
236c3030e1 stable state for swaps, add, and remove eth (no remove token token yet) 2020-03-04 13:48:43 -05:00
ianlapham
753e5f3423 stable version with updated balances, add liquidity using SDK, pair menu search 2020-02-26 12:00:59 -05:00
Ian Lapham
38625d24e9 Balance and USD Refactor (#544)
* update injected loading state

* basic setup

* add contexts

* minor changes

* refactor balances and USd price

* small tweaks

* clean up balances context code

don't store usd price except in hook

refactor getUSDPrice to make clear it's sync

* add small memo
2019-12-10 10:33:35 -05:00
Ian Lapham
645484853a Dai Migration - UI Updates (#503)
* skeleton for migration - still need links and adrdess of new contract

* update render conditions

* fix close on click

* updated warning logic

* add mcd to token list

* changes before merge

* remove unused imports

* add checksums
2019-11-18 11:52:27 -05:00
Ian Lapham
829a968008 allow for ETH in output command, zupdate to 6 digits on exchange rate (#464) 2019-10-17 07:39:43 -07:00
Ian Lapham
a33a2d90e1 make balances clickable on add liquidity page (#449)
* make balances clickable on add liquidity page

* update formatting logic

* fix max slippage calculation
2019-09-30 15:24:40 -04:00
Ian Lapham
4f566ab0c2 Add Custom url parameters (#423)
* query params for input and output currencies

* add slippage option

* add slippage cusytom param

* updated for sender address

* add field and amount support

* update params for pool page

* finish basic url support

* update app format

* update error checking to top level

* update for all pages

* fix build

* param updates

* fix slippage to basis points, update theme text, refactor to minimize lookups

* fix code styles

* update theme logic, remove extra setting, update rounding

* remove eslint comment errors

* remove logs, ignore lock

* remove lock
2019-09-17 18:47:32 -04:00
Noah Zinsmeister
61d6556a0d
fix rounding issue (#445) 2019-09-17 18:47:14 -04:00
Ian Lapham
677537ca31 Updates to Token Modal (#399) 2019-08-12 20:37:32 -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
78cdf11b37
Liquidity migration (#279)
* finalize initial migration

* remove redux

* fix token to token rate bug

* finalize initial migration

* fix test
2019-05-07 22:25:55 -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