* Add etherscan links for the two tokens in the pool on the NFT page
* moving linked tokens to a function
added arrow to show that it's a link
added check for eth
* clean up impl
Co-authored-by: Noah Zinsmeister <noahwz@gmail.com>
* only animate NFT SVG on hover by using a canvas
* handle high dpis
* animation transition between canvas and img
* set start state to not animated
* removed animations that were causing issues on Firefox
* simplify code
* remove debugger statement
* remove useEffect in favor of an event handler
* hide canvas without unmounting to avoid blinking
* fix lint error
* fix flicker on hover by leaving canvas always visible
* add comment about z-index
Co-authored-by: Justin Domingue <domingue.justin@gmail.com>
* 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
* Change price ratio using slash to "per"
* Fix header, toggle copy and increase copy
* Add clearer V2 and migrate buttons
* Fix link
* fix account modal background color
* tweak sig figs
Co-authored-by: Noah Zinsmeister <noahwz@gmail.com>
* 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>
* 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)
* Use ts enum for ProposalState in state/governance/hooks.ts (#1166)
* Use ProposalState enum in Vote/styled.tsx for determining colors of state text etc. (#1166)
* Better position list layout WIP
* Position list updates
* add badge data and current price hover
* merge cleanup
* fix missing library
* position page improvements
* Clean up position page and overview
* layout and color updates
* Clean up page
* Clean up position page
* clean up errors
* Add icons
* Merge main
* Position styles tweaks
Co-authored-by: Noah Zinsmeister <noahwz@gmail.com>
* add a usePermit hook
* semi working
* Fix code style issues with ESLint
* don't override gas, some cleanup in the permit function
* fix permit validity
* some more permit fixes
* nits
* another nit
* use the erc20 permit hook everywhere
* unused exports
* handle missing version
* replace everywhere
* add DAI and todos
* woopsie bug
Co-authored-by: Lint Action <lint-action@samuelmeuli.com>
* re-work header
* swap tweaks
* re-work swap in progress
- inline slippage
- hidey details
- better invert UI
- better flip rate ui
* Swap improvements
- new layout order
* New swap layout
* merge main
* get all the tests running
* skip the swap test as well
Co-authored-by: Moody Salem <moody.salem@gmail.com>
* use token0 as base in all calculations
* refactor
* fix price order
* fix existing position ticks
* remove empty space
* basic remove page
Co-authored-by: Noah Zinsmeister <noahwz@gmail.com>
* use token0 as base in all calculations
* refactor
* fix price order
* fix existing position ticks
* remove empty space
Co-authored-by: Noah Zinsmeister <noahwz@gmail.com>
* 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>
* 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>
* 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>
* 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
* 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>
* 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>
* 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
* 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
* deleting some code first
* strict, some refactoring
* denser common bases
* more add liquidity refactoring
* add liquidity paths working
* show common bases in the token selects
* fix the ability to select duplicate tokens
* useless rename
* try to handle alllll the duplicate token edge cases
* think i got them all lol
* remove common bases header
* Revert "remove common bases header"
This reverts commit 6ac4565d
* fix and add integration tests
* make gap between rows smaller
* get integration tests actually running again
* try another format of the command, upgrade serve
* frozen lockfile on install
* try the cypress github action
* install cypress in ci
* remove redundant ignore-scripts command
* use a specific github commit for the pinata action
* fix a bug in the multicall reducer, improve token list rendering performance
* improve the enter key on the token search modal
* stop using history.push
* fix linting errors
* position card cleanup before updating to match mock
* 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
* 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
* 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
* 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
* 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>
* 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
* 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
* migrate burn
* disable token selection in mint
clear input between pairs
* reset fields between pairs
* tweak helper text
* address review comments
* 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
* 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
* 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
* 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
* Token warning a la #789 and #790
* Clean up the duplicate name or symbol implementation
* Fix the spacing
* Change wording and add to send page
* Wording changes
* Refactor the common code to a component
* Fix lint error
* 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
* 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
* 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 /
* 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>
* 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
* 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
* Create the wallet store
* Get the updater completed
* Code complete
* Fix token balance bug
* Fix another bug in the hooks
* Final bug fix, blockNumber can be undefined
* Formalize the fact that block number can be undefined
* Woops add package
* Add more info to errors
* Replace balances in the v1 methods with the new ones
* Only return a balance value if it's present
* Address comments
* Trigger updateVersion before anything else
* 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
* Rewrite the local storage context into a redux store for user data
* Separate out the mega methods
* Fix infinite loop
* Missing dependency
* Missing dependency, rename version field
* 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
* First 2
* More typescript
* More and more
* Almost there
* More
* More typescript
* Fix remove liquidity button
* Make the error chain more readable
* Slippage tabs
* 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
* 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)
* Prepare for V2 testing
* popup styles, slippage language and amounts, min max copy
* Bug fixes and tweaks
* Add form link
* remove other imports
Co-authored-by: Callil Capuozzo <callil.capuozzo@gmail.com>
* 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>
* Hide dark and advanced, fix bug on empty balances
* remove unused imports
* change default dark mode
* add warning on main net
* remove unused imports
* 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
* 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
* make jazzicon same as metamask
* fix token-token market rate
fix transactions bugs
add new contextual info to send
* fix .1 balance check on add liquidity
fix double click max balance bug