Commit Graph

374 Commits

Author SHA1 Message Date
Justin Domingue
bbc64f12bb
fix: back arrow bug in wallet modal and fill tx for wallet (#2687)
* add tx to wallet connect

* remove id from env

* restore env
2021-10-26 12:46:10 -04:00
Justin Domingue
8eb864426f
refactor monitoring (#2682) 2021-10-25 10:39:16 -04:00
Justin Domingue
af83399606
log full signed tx (#2681) 2021-10-25 09:44:07 -04:00
Justin Domingue
abe6bf500c
feat: extend privacy and terms (#2623)
* initial iteration

* add logging

* added hook

* polish

* remove unused import

* add hash

* addressed pr feedback

* remove autorouter icon

* use firebase store

* style

* adjust recat ga

* log remove liquidity

* update copy

* addressed pr feedback

* addressed pr feedback

* prevent privacy content from dismissing modal

* make top-level key origin

* use hostname

* restore trm
2021-10-25 08:41:55 -04:00
Jordan Frankfurt
f26a3306ec
fix(L2): ensure chainIds match before fetching pool data (#2652)
* ensure chainIds match before fetching pool data

* debounce both input currencies, and only look for pairs on currencies that share a chainId

* pr feedback
2021-10-22 12:14:04 -04:00
Moody Salem
5e8d725e0e
fix: split calls into more chunks if they fail due to out of gas errors (#2630)
* fix: split calls into more chunks if they fail due to out of gas errors

* set to 100m gas

* back to 25m so we batch fewer calls

* do not pass through gas limit, some simplification of the code

* unused import
2021-10-19 11:37:57 -05:00
Justin Domingue
aea2bca775
fix: increase quote gas overrides on arbitrum (#2614) 2021-10-14 14:22:26 -04:00
Justin Domingue
8dd1be3b47
fix: remove extra $ from translations (#2611)
* remove extra $

* refactor

* refactor
2021-10-14 10:34:16 -04:00
Justin Domingue
442879ccd9
improve fee tier selector (#2609) 2021-10-13 18:22:45 -04:00
Connor McEwen
03c3fdef34
Change import to lib/bundle (#2524) 2021-10-11 13:06:29 -04:00
Connor McEwen
d37e963f26
fix: Show proper graph color for non-Ethereum L1 chains (#2049) (#2284)
* Switch to fetching token color from the logoURI included

* Fall back to github hosted images

* Move logger to changes to another PR
2021-10-11 12:07:28 -04:00
Justin Domingue
be15604244
fix: replace t with <Trans> where possible (#2516)
* replace t macro with <Trans>

* replace t macro with <Trans>

* add lint rule for t

* fixed more ts
2021-10-11 09:30:51 -04:00
Ian Lapham
a7b945a812
update gas quote for arbitrum and USDC address (#2503) 2021-10-05 20:43:34 -04:00
Zach Pomerantz
31d286c8fa
chore: rm lodash (#2451)
Updates node-vibrant to use a webpack-compatible version.
lodash was implicitly installed through node-vibrant (and its lack of tree-shaking); with this fixed, lodash is no longer provided.
2021-09-27 13:07:09 -07:00
Zach Pomerantz
ea17c7c111
chore: restrict imports from dist (#2443)
* fix: consistent @uniswap/v3-sdk imports

* fix: consistent @redux/toolkit imports

* fix: consistent @web-react imports

* fix: consistent @uniswap/token-lists imports

* chore: restrict dist/ imports
2021-09-25 12:35:00 -07:00
Zach Pomerantz
1fcbd2dcd9
perf: import @ethersproject directly to enforce modularization (#2424)
* perf: import @ethersproject directly for modularization

* chore: update @davatar/react@1.6.0

* fix: lockfile
2021-09-24 10:19:45 -07:00
Zach Pomerantz
2482a10ca8
perf: rm duplicated ua-parser (#2427) 2021-09-24 08:13:40 -07:00
Zach Pomerantz
8de6bb6d51
perf(swap): initialize swap inputs from url (#2402)
* fix(swap): use undefined as initial currencyId state

Null should be used for a selection state, not an unknown state. undefined may signify that a currency was passed in the URL but not yet parsed.

* perf(swap): initialize swap with url

Initializes SwapState with URL parameters so that currency input may be rendered on the first frame.

* test(swap): update hooks tests

* test: fix casing

* fix: check nullish to allow eg 0
2021-09-23 09:41:35 -07:00
Zach Pomerantz
322c45bef4
perf: import lodash only as modules (#2426) 2021-09-23 07:35:23 -07:00
Moody Salem
53da48b646
refactor: add an import sorting plugin (#2417)
* refactor: add an import sorting plugin

* Fix code style issues with ESLint

Co-authored-by: Lint Action <lint-action@samuelmeuli.com>
2021-09-21 18:21:28 -05:00
Moody Salem
fb07919888
refactor: transaction info is translated in the appropriate places (#2380)
* refactor: transaction info is translated in the appropriate places

fixes https://github.com/Uniswap/interface/issues/1756

* getting closer

* more work

* finished, finally

* bit more refactoring

* move summary into its own file

* little more cleanup in the transaction summary file

* fix bad copy

* fix the migrate notification

* missing translation

* fix the language for vote and address other pr comments

* fix typo

* - remove old transactions with this update
- change to present tense
- show ens name where appropriate

* add a test that shows we don't clear old ones
2021-09-21 16:45:24 -05:00
Justin Domingue
91de599f12
fix: de-duplicate intermediate pairs (#2396)
* make useAllCurrencyCombinations return uniques

* consolidate useBestV3Trade* functions

* consolidate useBestV2Trade

* typo

* reverted changes to trade hooks

* reverted changes to trade hooks

Co-authored-by: Noah Zinsmeister <noahwz@gmail.com>
2021-09-21 15:42:30 -04:00
Justin Domingue
cc9650b74b
refactor: simplify trade hooks (#2371)
* merge tradeExactIn|Out

* cleanup

* reset polling interval

* polish

* improved types and fixed client side

* rename combined to bestv3
2021-09-21 13:51:50 -04:00
Justin Domingue
cd22955817
feat: routing api integration (#2116)
* initial routing api integration

* add routing api slice

* display route in dialog

* addressed pr feedback

* improved routing

* switch to `get`

* first pass at integration new MultiRouteTrade

* initial implementation of RoutingDiagram

* add RoutingDiagram tests

* improve tests in RoutingDiagram

* integrate with v3-sdk 3.3.1

* removed references to MultiRouteTrade

* revert swapcallback

* fix abi compilation error

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

* added react-hooks-testing-library

* integrated latest changes

* renamed router hook to routerTrade

* improve integration

* fixed routing

* usability

* mock RoutingDiagram children to reduce size

* undo mocked children

* adjust ui

* better support long routes

* use routing api logo and adjust ux

* set default percent to 0

* added intermediary hook to combine local and routing api trades

* added intermediary hook to combine local and routing api trades

* make account optional

* improve ux

* improve router

* fixed duplicate pool bug and inputAmount undefined bug

* extract input/outputAmounts from routes

* add todo

* fixed uninitialized issue and added %

* fixed tests

* fix duplicate pool bug

* added routing api setting

* change router label based on router version

* improve useRoutes and fix duplicate pool bug

* debounce routing api/local routing

* removed single hop setting

* fix bug when moving between v2/v3

* consider isUnitialized non loading

* ui fixes

* reverted change to usedebounce

* use new route schema

* visual updates

* log quoteId for polish session

* fix: persist advanced swap details toggle state

* fix no route found

* poll every 10s

* derive currencies from pool rather than input

* polish query status handling in useRouterTrade

* removed RouterVersion

* update ui

* update ui

* update loading state

* animate auto router

* apply loading treatment to out

* disable routing api on l2 and support auto slippage

* use opacity on the whole element

* show loading card when syncing

* updated gradient

* polished ui

* create routerlabel component

* disable router on all bu mainnet

* polish

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

* show loading card when syncing

* updated gradient

* polished ui

* create routerlabel component

* disable router on all bu mainnet

* polish

* polished loading state

* add dashes

* fixed tooltip styles

* fixed merge conflict

* few updates

* polish

* updated yarn.lock

* fixed styles

* updated routing diagram

* Fix code style issues with ESLint

* routing api enabled without localstorage upgrade

* fixed lint error

* Fix code style issues with ESLint

* refined mocks in routing diagram tests

* addressed pr feedback

* polish

* revert sending eth

* improved loading animation

* handle stale routing api

* Fix code style issues with ESLint

* updated yarn.lock

* support native eth

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

* Incorporate approval gas cost estimate

* feat: simplify routing api ux (#2258)

* support native eth

* simplified ui

* perf optimization

* implement realized lp fee

* improved route realized lp fee

* fix lp realized fee

* fix auto router gradient

* initial route overlay

* add auto router svg

* adjusted ux to mocks

* fix lp fee

* upddated routing diagram

* optimize tradeBetter hook

* adjust type and name

* add useBetterTrade

* useBetterTrade takes gasEstimateWei

* implement gasEstimateForApproval

* import state from react

* use gas estimate

* improve integration with gas estimate comparison

* remove dependency on account

* fix currency switch bug

* improve syncing state

* add loadingbar

* style tooltip container

* updated tooltip styles

* increase opacity range

* always keep dependent currency input interactable

* show placeholders in tooltips

* Revert v2 gas estimates and approval estimates

* Add debug logs

* refactor

* fix bug

* removed comment

* update engish key

* add try-catch

* addressed pr feedback

* remove loading bar for price impact

* addressed pr feedback and bug bash feedback

* fix: use url to force version

* addressed pr feedback and bug bash feedback

* stop fetching when losing focus

* only show auto router label when activated

* avoid showing syncing status

* move V3TradeSTate to own file

* make useRoutes a function rather than hook

* use logo from active list when possible

* renamed and refactored hook

* renamed and refactored hook

* update status

* polish

* remove unused import

* fixed merge error

* updated combined trade tests

* remove priceimpact while loading

* Design tweaks

* polish latest design

* removed some styles

* log gaevent on tooltip open and clean up origin

* Small tweaks

* addressed pr feedback

* wrap route length in a loading container

* renamed local to clientside

* fix percent and token logo

* addressed pr feedback

* avoid comparing trades when v3 not ready

* some refactor

Co-authored-by: Lint Action <lint-action@samuelmeuli.com>
Co-authored-by: Will Pote <will@uniswap.org>
Co-authored-by: Callil Capuozzo <callil.capuozzo@gmail.com>
2021-09-16 10:50:58 -04:00
Zach Pomerantz
58f1193a21
fix: add deps to try safe effect (#2349) 2021-09-14 11:20:52 -07:00
Zach Pomerantz
88cc20a61a
feat(i18n): initialize locale before React (#2343)
* feat: initialize locale before React

* chore: explain react-router-dom hash/search usage
2021-09-14 10:17:56 -07:00
Zach Pomerantz
15a339a0d7
lint: connect SafeApp on mount (#2341) 2021-09-13 15:29:27 -07:00
Zach Pomerantz
3c371af32a
fix: only try SafeApp connection in an iframe (#2340)
* fix: only try SafeApp connection in an iframe

Improves non-iframe pageload by 300ms. Fixes #2338.

The Gnosis check for a SafeApp races a postMessage and a 300ms timeout [1]. The SafeApp embeds the interface in an iframe, so this avoids the check when not in iframes.

[1]: f224869dd5/packages/safe-apps-web3-react/src/connector.ts (L52)

* refactor: IS_IN_IFRAME const
2021-09-13 15:17:54 -07:00
Justin Domingue
f7ac87fa85
fix: increase max block age for l2s (#2333)
* fix: increase max block age and refresh fee tier more often

* similar for tick data
2021-09-13 12:22:44 -04:00
Noah Zinsmeister
a52b7bf06b
feat: use SDK to format calldata passed to quoter (#2305)
* replace useSingleCallResult implementation

use useSingleContractMultipleData instead

* use sdk methods to format quoter calldata

* create cleaner useSingleContractWithCallData fn

* clean up useMultipleContractSingleData

* address comments
2021-09-09 16:40:37 -04:00
Zach Pomerantz
416a3f9433
chore: use native flatMap (#2231) 2021-09-03 12:29:37 -04:00
Noah Zinsmeister
30cffb7442
feat: governor bravo support (#2271)
* first pass

* Fix code style issues with ESLint

* address comments

Co-authored-by: Lint Action <lint-action@samuelmeuli.com>
2021-09-03 12:29:25 -04:00
Zach Pomerantz
f59c5f6877
chore: paint currency selector on initialization (#2245)
Avoids a flash of "Select a token" as the App initializes.
2021-09-02 10:57:01 -07:00
Zach Pomerantz
5831328364
style: enforce object-shorthand (#2286) 2021-09-01 13:32:20 -07:00
Zach Pomerantz
f5557a434c
chore: upgrade type system (#2276)
* chore: upgrade type system

Upgrade types, typescript, and formatters.

* fix: ListsState tests
2021-09-01 12:38:10 -07:00
Moody Salem
f463df97bf
fix: do not construct routes with the same pool twice (#2196) 2021-08-11 10:15:53 -05:00
Justin Domingue
a48b7ce702
fix: avoid running BestV3Trade when tokens are the same (#2172)
* avoid running BestV3Trade when tokens are the same

* flipped condition
2021-08-09 10:38:23 -04:00
Moody Salem
a6342d40f1
feat: support connecting to a gnosis safe (#2096)
* feat: support connecting to a gnosis safe

* add the manifest.json attributes required by gnosis safe

* remove background fill

* copy

* only try injected provider if not active after trying safe
2021-07-23 12:04:18 -05:00
Justin Domingue
4d3ed5d6ba
feat: routing api integration (#2080)
* initial routing api integration

* add routing api slice

* display route in dialog

* addressed pr feedback

* switch to `get`

* renamed useRouterTradeExactIn to useRouter

* moving few files to later iteration

* removed unnecessary `as`

* switch to polling

* add todo for blocknumber freshness

* remove account-slippage-deadline
2021-07-21 15:08:35 -07:00
Moody Salem
13d7d2c992
fix(swap): double max gas for quoting a v3 swap for large trades 2021-07-19 19:00:52 -05:00
Justin Domingue
1d82a4c71e
fix: set language using url param in language dropdown (#2063)
* set language using url param in language dropdown

* refactor common code into a hook

* add hook

* address pr feedback
2021-07-16 10:56:33 -07:00
Moody Salem
f5b601ee99
fix(L2): use 10 bips slippage for swaps by default on L2 (#2035)
* use 10bip slippage on L2

* update deps

Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com>
2021-07-13 10:41:46 -05:00
Justin Domingue
2bc2a2c76e
compare with undefined rather than falsy (#2027) 2021-07-12 16:13:45 -07:00
Justin Domingue
28bf95123e
load pool data for each tier to determine state (#2026) 2021-07-12 15:56:55 -07:00
Moody Salem
41330ab080
fix: price tokens on optimism mainnet using DAI 2021-07-12 11:03:10 -05:00
Jordan Frankfurt
4ba9d98e67
fix(L2): polish (#1988)
* polish

move getINfoLinkByChainId to chain constants

pr review - translations

optimism token list, typo, text color for L1 switch

use <Trans /> instead of t

undo unintentional tokenlist order change

use {'Optimism'} instead of {name}

switch deadline implementation

remove unused TYPE import

switch to generalized CHAIN_INFO instead of L2_INFO so we don't have to check in components

add target chain id param to optimism bridge

fix a minor breakpoint issue

reduce sigfigs for header balance

update network card dropdown text for optimism

remove list code

refactor SupportedChainId

* SupportedL1ChainId | SupportedL2ChainId -> SupportedChainId
2021-07-12 11:44:05 -04:00
Justin Domingue
ffbd2d107a
feat(pool): add liquidity distribution range slider and update add liquidity layout (#1829)
* first iteration of useTicks and useActiveLiquidity

* feat(pools): add liquidity depth chart (#1835)

* cleanup

* use area chart instead of bar chart

* check for undefined rather than falsy

* feat: range buttons based on fee amount (#1870)

* range buttons based on fee amount

* hardcode percentages as ticks

* increase blocksperfect

* feat: optimize add liquidity charts (#1880)

* ignore syncing state

* remove surrounding ticks

* avoid processing price1 as it is unused

* cleanup

* feat: add zoom buttons to liquidity depth chart (#1882)

* ignore syncing state

* remove surrounding ticks

* avoid processing price1 as it is unused

* cleanup

* first pass at +/- zoom buttons

* remove console.log, cleanup

* use real price for price line

* updated brush handles to latest spec

* added % labels to handles

* round tick to nearest usable tick

* first pass at brushable area chart with d3

* first pass at brushable area chart with d3

* rework

* address PR comments

* add brush handles

* address PR comments

* further improvements

* feat(pools): improve full range support + capital efficiency warning (#1903)

* handle min and max prices in add liquidity

* cleaned up

* use flag to denote full range

* reset inputs on fee select

* fixed merge conflict

* handle full range in positions preview

* fixed invalid range when tokens are reversed

* use formatTickData

* updated layout

* cleaned up layout

* fixed address

* avoid re-rendering deposit amounts

* added zoom behavior and more styling

* renamed chart

* renamed main chart file;

* add brush tooltips

* remove chart title

* added accents to brush handles

* more work

* moved to file

* modularize chart components

* fix maximum depth

* added brush labels

* cleanup

* cleanup

* set up zoom

* added new components

* improved brush and zoom integration

* cleaned up clip path

* fixed clip paths

* integrated with the graph changes

* adjust fee selector

* fix data error

* add bar chart

* polish

* merged

* clean up error

* cleaned up after merge

* visual improvements

* moved +/- buttons to the right/left

* removed margin bottom

* removed unsused

* fix brush labels % change

* use d3.axisBottom

* updated labels

* improve brush range

* fix one brush change only

* adjust zoom and clippath

* use bars

* use area

* adjust axis bottom to mocks;

* improved bars

* show bar colors

* better handle full range

* adjust colors for light mode

* updated to mocks

* adjusted handles for visibility

* switch to area

* add react ga events

* adjusted to mocks

* memo brush domain to avoid re-renders

* fix inputstepcounter color

* adjust handles

* rely on the graph sorting tickidx

* use curvestepafter

* updated polish

* merged main

* add clamping and other fixes

* highlight selected area using a mask

* use price instead of % for labels

* delete unused

* refine ux

* relayout

* improve hooks

* adjust layout for mobile

* fixed card color

* adjust padding

* preent tick overflow

* flip handles sooner

* delete bars.tsx
2021-07-08 11:30:43 -07:00
Justin Domingue
2db29f205b
fix: simplify liqudity depth hooks and improve chart primitives (#1999)
* updated hooks and chart primitives

* add lodash.inrange to package.json
2021-07-08 11:12:36 -07:00
Noah Zinsmeister
5ff2cff841
feat: Add Optimism (#1923)
* preliminary support

* fix multicall abi

add explorer support

* Fix code style issues with ESLint

* fix gas estimation

* fix todo tests

* fix gas estimation comments

* anonymize links to kovan etherscan and poll more frequently on optimistic kovan

* separate pool creation

* remove supported chain id

* remove the blocktag

* do not use the blocktag on optimism only

* give more gas to tokenURI for optimism

* update sdk

* temp fix to the block tag thing (do not update the block number from the fetch block number)

* remove unused import

* gasRequired -> multi-network

* bump quoter gas limit to 6m on optimism

* move the gas required parameter by chain id one level up

* missed a hook

* retry fetching receipts for optimism as many times as arbitrum

* fix duplicate enum, add optimism as well to retry options config

* fix: state not getting updated after a transaction confirmation

* bump sdk version

* update for mainnet optimism (#1998)

* fix for calculateGasMargin on optimism

Co-authored-by: Lint Action <lint-action@samuelmeuli.com>
Co-authored-by: Moody Salem <moody.salem@gmail.com>
2021-07-08 12:46:21 -04:00
Justin Domingue
e0c625671b
improve liquidity depth hooks and data fetching (#1989) 2021-07-07 14:37:29 -07:00
Justin Domingue
2182e676d4
fix: enforce styled-components/macro usage and upgrade react-scripts (#1981)
* upgrade react-scripts and enforce macro rule

* Fix code style issues with ESLint

Co-authored-by: Lint Action <lint-action@samuelmeuli.com>
2021-07-07 08:45:47 -07:00
Justin Domingue
f0fc11a3b5
stabilize fee distribution in hook (#1979) 2021-07-07 08:27:18 -07:00
Noah Zinsmeister
2ee9b16c49
remove a lot of dead code (#1970) 2021-07-06 17:08:40 -04:00
Moody Salem
c52cd2c38e
fix(position image): increase the gas required constraint for the token URI 2021-07-06 16:08:20 -05:00
Justin Domingue
568829d3b5
fix: invalidate subgraph cache with provideTags (#1962)
* invalidate queries using tags

* enhance generated api with provide tags

* clean up
2021-07-03 12:56:38 -07:00
Moody Salem
2c7b431e60
fix: use a multicall that allows limiting gas of the individual calls (#1953)
* fix: use a multicall that allows limiting gas of the individual calls

* use the latest multicall addresses
2021-07-02 12:25:37 -05:00
Moody Salem
27f756107e
refactor: logs hook (#1941)
* feat(logs): add an infrastructure for fetching logs in a declarative way

* use the logs hook in the vote page, first pass

* fix comment

* bit of cleanup

* unused imports

* improve loading indicator on vote page

* some testnet behavior improvements

* fix loader state

* loading state nit

* show correct indexes

* remove the unnecessary retry code

* first pass at the slice

* no throws

* loading indicator should go away if not connected

* use the logs slice for the logs hook state

* style changes per cal's request
2021-07-01 14:44:02 -05:00
Justin Domingue
abfd87c517
feat(pools): fetch pool tick data from uniswap v3 subgraph (#1932)
* add hooks to fecth ticks data and active liquidity

* cleanup

* add polling interval

* moved ms.macro types to dev deps

* generate graphql schema on build

* added @types/ms.macro

* use clone deep
2021-07-01 11:08:53 -07:00
Justin Domingue
d9c82ebf49
feat: add fee tier distribution badge (#1862)
* integrate with The Graph and auto-select fee tier

* restored

* addressed some design feedback

* add pulsing animation on feeAmount change

* simplify fee tier title

* adjust button radios

* addressed some design feedback

* log ReactGA events

* ignore data while fetching

* update to use new generated queries

* remove deleted file

* add usefeetierdistribution hook

* invalidate cache and standardize the outlined card

* added react ga

* fix show options logic

* address design feedback

* show % select in minified view

* updated merge error
2021-07-01 10:56:27 -07:00
Jordan Frankfurt
50c7d36164
replace trustwallet assets repo w/ our fork (#1922) 2021-06-28 16:35:31 -04:00
Moody Salem
f4935e9264
fix(arbitrum): miscellaneous arbitrum network changes
- adds the arbitrum rinkeby testnet deployment
- compute usdc prices on arbitrum one
2021-06-23 20:58:03 -05:00
Justin Domingue
9a1bb5dbfb
Add missing semicolon in English source 2021-06-21 08:10:00 -07:00
Noah Zinsmeister
3c8e8604b8
Merge remote-tracking branch 'refs/remotes/origin/main' 2021-06-16 17:22:46 -04:00
Noah Zinsmeister
b763659788
restrict governance UI to mainnet only
fix governor name bug

revert useContract change

add governorIndex to vote page

only fetch latest useLatestProposalCount

fix useDataFromEventLogs

hardcode proposalIndexes for old governors
2021-06-16 17:22:37 -04:00
Justin Domingue
3f242f1b44
fix: memoize extendedEther to unnecessary rerenders (#1869) 2021-06-16 11:07:16 -07:00
Jordan Frankfurt
014595cdfb
feat: add multi-contract governance support (#1860)
* Revert "feat: quick fix for new governor"
This reverts commit 5dd1249dddc3e097c26a68bd5b4157ffa341dd60.

* support multiple governance contracts
2021-06-15 22:36:27 -04:00
Justin Domingue
1724bee0f5
Update useSwapCallback.ts 2021-06-14 10:24:33 -07:00
Noah Zinsmeister
5dd1249ddd
feat: quick fix for new governor 2021-06-13 15:15:00 -04:00
Justin Domingue
4857281a1e
undo testing artifact 2021-06-08 11:49:38 -07: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
bed8dd5110
fix: do not show price data on non-mainnet 2021-06-01 17:33:50 -05:00
Justin Domingue
979686100e
chore: simplify useSelector and useDispatch types using inference (#1760)
* chore: simplify app dispatch and selector types with ts inference

* update SearchModal to use new types inference

* chore: simplify useSelector and useDispatch types using inference
2021-06-01 07:58:21 -07:00
Moody Salem
a7a1607faa
fix: add a link to switch the locale conditionally (#1776)
* add a link to switch the locale conditionally

* make it smaller

* add the locale labels

* language labels from the internet

* fix the heart in the claim popup

* undo the conditional change

* remove todo

* updated Chinese locale name to office-365 language ids

* added missing <Trans>

Co-authored-by: Justin Domingue <judo@uniswap.org>
2021-06-01 09:54:43 -05:00
Moody Salem
4b72d757c5
chore: add a bunch of missing translation keys 2021-05-29 16:02:43 -05:00
Moody Salem
408a07ebd4
try extracting en-US.po only in the github workflow 2021-05-29 15:32:51 -05:00
Moody Salem
cfea3723a2
remove setting the locale from using the active locale 2021-05-29 07:14:26 -05:00
Moody Salem
7d0fb9cc10
workaround for the url locale not sticking 2021-05-29 00:29:17 -05:00
Moody Salem
3394bc738f
fix the locale parsing of full locale string 2021-05-28 23:43:15 -05:00
Moody Salem
32b56ba0fd
just pick the first occurrence of an abbreviated locale in the locale parsing 2021-05-28 23:30:29 -05:00
Moody Salem
d719942931
chore: en -> en-US 2021-05-28 23:15:07 -05:00
Moody Salem
ab34645073
chore: pare down the locales directory to let the crowdin sync do the work 2021-05-28 23:06:54 -05:00
Justin Domingue
70174140bc
chore: refactored locale management hook (#1737)
* chore: refactored locale management hook

* use useMemo instead of useState
2021-05-28 17:36:37 -07:00
Moody Salem
7f1def300d
fix: usdc prices shouldn't reload when v3 prices reload 2021-05-27 15:28:45 -05:00
Justin Domingue
02269e9376
fix: handle usdc directly in useUSDCPrice (#1683) 2021-05-21 16:45:39 -07:00
Moody Salem
3aaa3fef89
fix: wrap/unwrap should not show computed trade details 2021-05-21 10:09:11 -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
d4c5d3e8c8
chore: run eslint 2021-05-20 20:14:55 -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
Noah Zinsmeister
ffc2015595
invalidate stale requests in useV3PositionFees 2021-05-20 12:31:46 -04:00
Moody Salem
5e30a4b4ad
refactor: bump to latest sdk (#1657) 2021-05-20 11:21:40 -05:00
Moody Salem
b14da2844d
chore: remove all tick lens stuff that is not used 2021-05-19 17:35:59 -05:00
Justin Domingue
d3c04b7246
fix: stabilize fiat value by fixing max hop and increasing USDC out to 100k (#1651)
* stablizie fiat value by fixing max hop and increasing USDC out to 100k

* move maxHops and singleHopOnly to parameter of useV2TradeExactOut

* remove single hop param
2021-05-19 13:21:27 -07:00
Moody Salem
8d3babd015
refactor: more separation by chain of addresses 2021-05-18 14:33:03 -05:00
Moody Salem
75ed4c5dae
fix: missed a memo for fetching v2 pairs (#1635) 2021-05-18 14:21:06 -05:00
Justin Domingue
980eb8a518
Leverage Trade api for USDC price with v2 & v3 support (#1610)
* calculate usdc price using trade exact out

* fix typo

* add support for non-mainnet

* use fromRawAmount instead of tryParseAmount
2021-05-18 10:07:37 -07: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
ae27e245b4
replace the message when we fail to parse an error 2021-05-14 14:13:13 -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
af6098bfe5
feat: allow walletconnect on testnets (#1389)
* try walletconnect multinetwork

* clean up environment variables for multinetwork

* remove irrelevant config

* move some stuff around

Co-authored-by: Noah Zinsmeister <noahwz@gmail.com>
2021-05-13 17:46:30 -05:00
Moody Salem
fce29bb36f
fix: division by 0 when computing the USDC value of tokens that do not have a v2 pair (fixes https://github.com/Uniswap/uniswap-interface/issues/1566) 2021-05-13 17:27:34 -05:00
Noah Zinsmeister
b40163ce05
allow fee collection/liquidity removal in weth (#1553)
* add dummy flags for burn/collect as weth

* add toggles

* clean up toggle position

* only show weth toggle if collection is possible
2021-05-13 14:49:54 -04:00
Moody Salem
cd37b7533d
put the error reason in the message so we can differentiate between unrecognized errors 2021-05-13 11:16:37 -05:00
Justin Domingue
c0cd6a1c8d
handle ape= query parameter (#1555)
* handle expert_mode= and ape= query parameters

* removed console log

* use useParsedQueryString

* only handle setting ape mode
2021-05-13 12:01:58 -04:00
Moody Salem
f6245d1093
retry more frequently, couple more error nits 2021-05-13 10:51:06 -05:00
Moody Salem
83c784f7c0
improve the error coverage 2021-05-13 10:51:06 -05:00
Moody Salem
3d95b1a33b
fix access of undefined property 2021-05-13 09:37:04 -05:00
Moody Salem
5c96942922
fix: show better errors 2021-05-13 09:02:48 -05:00
Moody Salem
b2f88965a9
handle errors better 2021-05-12 22:05:00 -05:00
Moody Salem
744db49803
do not show duplicate token results, and stop searching as soon as possible 2021-05-12 16:54:05 -05:00
Moody Salem
3aa045303a
remove a few unused isToken calls 2021-05-12 11:43:30 -05:00
Noah Zinsmeister
f5fc5da341
fix erroneous addition of tokensOwned{0,1} (#1533)
only pass tokenId to useV3PositionFees
2021-05-12 12:20:20 -04:00
Moody Salem
bea5c0484b
fix lint errors, show source list in extra tokens 2021-05-12 09:32:24 -05: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
Noah Zinsmeister
22c1ddf393
swaps to .5% slippage 2021-05-11 15:00:51 -04:00
Noah Zinsmeister
58a508c9d6
.25% -> .30% slippage for v3 swaps 2021-05-11 13:53:15 -04: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
Noah Zinsmeister
c0f58ae810
don't use a signer for callStatic contract 2021-05-10 16:59:11 -04:00
Noah Zinsmeister
54dd5476ca
fetch fees directly from collect via callStatic (#1500)
* fetch fees directly from collect via callStatic

* don't clear state
2021-05-10 16:30:02 -04:00
Moody Salem
6c880d29a6
fix(position fee computation): incorrect sub underflow 2021-05-05 22:54:30 -04:00
Noah Zinsmeister
0770bab032
try manual approve if erc712 doesn't work (#1397)
* initial impl

* fix async logic
2021-05-05 17:36:07 -04:00
Moody Salem
05acbfee88
fix(swap): do not throw an error in the routing if we cannot construct a pool 2021-05-05 14:22:57 -04:00
Noah Zinsmeister
ce81dd5a79
Merge remote-tracking branch 'refs/remotes/origin/main' 2021-05-05 12:47:47 -04:00
Noah Zinsmeister
73f29eea2c
don't show approve for both assets...
...in the single-sided liquidity provision case
2021-05-05 12:47:41 -04:00
Moody Salem
1aab086693
Swap interface tweaks (#159)
* fix some nits in the swap interface

* remove some unused css

* tweak the info icon a bit
2021-05-05 12:29:33 -04:00
Callil Capuozzo
699bcc25b6 Merge branch 'main' of https://github.com/Uniswap/v3-interface into main 2021-05-04 20:52:27 -04:00
Callil Capuozzo
e88a8effef style tweaks
- bring back gradient background
- improve header
- improve light mode
2021-05-04 20:52:25 -04:00
Moody Salem
4220cafbd3
fix the usdc permit 2021-05-04 18:22:45 -05:00
Moody Salem
ff12b7be10
refactor the fiat values 2021-05-03 16:29:45 -05:00
Moody Salem
91f3e21bd4
some list code cleanup 2021-04-30 22:56:19 -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
9b639bee65
invalidate signature data for old nonce 2021-04-30 21:23:16 -05:00
Moody Salem
eaddc9e6f8
dai style permit 2021-04-30 21:20:39 -05:00
Moody Salem
828f7ee446
Use permit in swap (#65)
* 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>
2021-04-30 12:50:57 -05:00
Moody Salem
8859ff6979
fix gas estimate bug 2021-04-29 11:56:02 -05:00
Moody Salem
e39e5908e7
drop the card in the position page 2021-04-29 11:18:56 -05:00
Moody Salem
c5424d2dcc
some tweaks to the token logo 2021-04-29 10:26:12 -05:00
Moody Salem
c3909bc1d0
improve the better trade link logic 2021-04-28 20:03:38 -05:00
Moody Salem
b25287923c
return fake price data for non mainnet and fill it into the currency input panel 2021-04-28 19:44:10 -05:00
Noah Zinsmeister
65c51ea4aa
update to latest sdk 2021-04-28 20:17:22 -04:00
Moody Salem
b09eb8fb52
mess with the gas estimation code a bit to allow swapping 2021-04-28 18:58:53 -05:00
Moody Salem
5b49cedebb
bump addresses 2021-04-28 18:16:49 -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
464a682fcc
show the better trade link for v2/v3 2021-04-28 13:27:14 -05:00
Noah Zinsmeister
d342ccdb78
use sdk for more calldata 2021-04-27 22:24:29 -04: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
8e86ded09b
temporarily hude the usdc value, use the disable multihop setting in the v3 routing 2021-04-27 10:35:09 -05:00
Moody Salem
37a50372f6
improve responsiveness of header 2021-04-27 10:16:02 -05:00