Compare commits

...

838 Commits

Author SHA1 Message Date
Charles Bachmeier
d6865b033a feat: add feature flag for avax (#6905)
* feat: add feature flag for avax

* add new files

* block swapping when user manually changes chain

* rule of hooks

* remove comment
2023-07-10 17:05:19 -04:00
UL Service Account
e5dff197a9 ci: add global CODEOWNERS 2023-07-07 19:02:47 +00:00
UL Service Account
3b30410284 ci(t9n): download translations from crowdin 2023-07-07 19:02:47 +00:00
Vignesh Mohankumar
e4dbef80eb chore: remove Google Analytics from CSP (#6888)
* disable ga

* comment
2023-07-07 14:15:41 -04:00
Vignesh Mohankumar
e169c9d900 chore: delete WalletConnect v1 (#6857)
* chore: remove walletConnectFallback flag

* chore: remove walletConnectV2 flag

* chore: delete WalletConnect v1

* chore: remove walletConnectV2 flag (#6856)

* rm hidden

* toggle account drawer

* fix test

* Revert "rm hidden"

This reverts commit 9e8dd65b04.

* fix test

* -u

* optional?

* Revert "optional?"

This reverts commit 8456080b78.

* switch mock

* expect

* test

* fix test

* update connection tests
2023-07-07 14:06:07 -04:00
Zach Pomerantz
c8a17f5fe9 build: use context.sha (#6900) 2023-07-07 10:48:00 -07:00
Vignesh Mohankumar
552a38994b chore: remove WalletConnect feature flags (#6855)
* chore: remove walletConnectFallback flag

* chore: remove walletConnectV2 flag (#6856)

* rm hidden

* toggle account drawer

* fix test

* Revert "rm hidden"

This reverts commit 9e8dd65b04.

* fix test

* -u

* optional?

* Revert "optional?"

This reverts commit 8456080b78.

* switch mock

* expect

* test
2023-07-07 13:15:13 -04:00
Zach Pomerantz
b313ac9843 build: upgrade cypress-hardhat (#6897) 2023-07-07 10:03:06 -07:00
Jack Short
88aec2c894 fix: 0 showing as collected fee amount (#6804)
* fix: 0 showing as collected fee amount

* initial test setup

* fire events

* checking for data in tests
2023-07-07 12:51:35 -04:00
Zach Pomerantz
86677ed193 test(staging): add staging-only t9n test (#6899)
* test(staging): add staging-only test

* test(staging): translations mount

* ci(t9n): download translations from crowdin

* test: proving that it works

* Revert "ci(t9n): download translations from crowdin"

This reverts commit b6e0f0c5c2.

* Revert "test: proving that it works"

This reverts commit 1d3a1c2a23.

* fix: spec->test

---------

Co-authored-by: UL Service Account <hello-happy-puppy@users.noreply.github.com>
2023-07-07 09:41:20 -07:00
Zach Pomerantz
accf0905f8 build: block promotion on Test (#6898) 2023-07-07 08:47:32 -07:00
Brendan Wong
ef5065de48 feat: wrangler infra and test environment (#6797)
* feat: add token and nft injection

* feat: basic tests

* fix: get jest configured properly

* fix: change timeout

* fix: uninstall port ready

* fix: readd port ready

* fix: local tests work

* fix: remove other stuff to make this pr smaller

* fix: remove unneeded dependencies

* fix: remove port-ready

* Update yarn.lock

* fix: add lint disable due to module exports for jest

* fix: added waitPort

* fix: deduplicated things?

* Update package.json

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* update typing

* change tests to typescript instead of javascript

* changing typing of globalThis servers

* yarn deduplicate

* Update functions/global-teardown.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update functions/global.d.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update functions/tsconfig.json

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update functions/tsconfig.json

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update package.json

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* change dependencies to dev dependencies

* final touches

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-07-07 11:41:09 -04:00
Vignesh Mohankumar
bcb45cded6 feat: add user id to sentry (#6896)
* feat: add user id to sentry

* downgrade

* key

* Update src/tracing/index.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update src/tracing/index.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* fixes

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-07-07 11:14:36 -04:00
cartcrom
dfe50b4bee feat: remove old routing slice and flag (#6895)
feat: remove ura flag
2023-07-07 09:49:42 -04:00
Charles Bachmeier
90f72e05b9 feat: upgrade sdk-core to 3.2.6 and add AVAX (#6757)
* init refactor

* upgrade to 3.2.6 and refactor more uses of chainid

* cleaned up lock file

* remove console log and add placeholder

* use supported chains type for switch fn

* allow passing of all chainIds to switcher

* additional typecast

* better casting solution

* yarn.lock cleanup

* prettier

* better casting for rpc

* prettier

* deprecate no longer needed addresses

* better isSupported checking

* deprecate redundant fn

* cleanup toSupportedChainId

* address initial ocmments

* pretier

* includes testnet

* remove unused export

* merge conflicts

* spread for mutable copy

* explorer text

* check is supported before activating chain

* remove extra uses of mumbai

* remove cast to MockChainId

* retain var name supportedChainId

* updated prettier

* use t for explorer translation

* use mockchainid for test

* feat: Add Avalanche support (#6776)

* init avax

* add most avax props

* add logo

* correct subgraph

* update avax blocksPerFetch

* add square logo

* upgrade ur sdk

* version syntax

* correct tokens

* remove unused token

* remove unused token

* update token list and add coming soon to searchbar

* add coming soon to token explore page

* names to ids

* cleaned up routing

* usdc token

* upgrade default token list

* update SOR

* upgrade SOR

* merge conflicts

* snowtrace

* upgrade SOR

* handle be avax support

* temp hide avax

* show pool positions

* whole

* spotprice update

* not yet supported

* BACKEND_SUPPORTED_CHAINS

* add avax to BE not supported

* update multicall blocks to 5

* add todo

* updated prettier

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>

* be added avax token balances

* validateUrlChainParam should return eth for backend unsupported chain

* readonly

* respond to comments

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-07-06 21:44:06 -07:00
Vignesh Mohankumar
3a0f6920d0 build: use webpack-retry-chunk-load-plugin (#6885)
* build: use webpack retry chunk load plugin

* fix

* dedupe

* lint

* retry backoff

* reduce from 1000 to 500ms

* add cache bust query

* rm cache bust

* 3

* cache bust

* Update craco.config.cjs

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-07-06 17:54:49 -04:00
eddie
07eb9eb9a2 fix: combine userState with default injected wallet in cypress setup (#6849)
* fix: combine userState with default injected wallet in cypress setup

* fix: unconnected state in two tests

* fix: update name
2023-07-06 14:01:13 -07:00
Brendan Wong
a9e8e8b275 fix: web app without NFTs (#6712)
* fix: web app without NFTs

* fix: change card display to memoization

* fix: remove unneeded imports and variables

* fix: readd search bar modification

* fix: update dependencies

* fix: update atom value to use hook

* fix: change hook name

* fix: add tests

* Update src/pages/Landing/index.tsx

Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com>

* Update src/components/NavBar/SearchBar.tsx

Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com>

* Update src/components/NavBar/SearchBarDropdown.tsx

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update src/components/NavBar/SearchBarDropdown.test.tsx

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update SearchBar.tsx

* fix lint

---------

Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com>
Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-07-06 15:46:41 -04:00
Vignesh Mohankumar
4708d3d3d7 fix: update InterfaceGqlChain syntax (#6892)
lint: update InterfaceGqlChain syntax
2023-07-06 12:31:15 -04:00
Vignesh Mohankumar
27acddc0e7 chore: upgrade prettier (#6887)
* lint

* upgrade prettier

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-07-06 11:54:04 -04:00
Charles Bachmeier
102a935ff8 fix: Handle new and unsupported chains passed in from GQL BE (#6878)
* add subset chain type and checks

* add sentry logging for invalid chain errors

* add test cases

* dynamic token balances

* add test for BE adding a new chain

* rename and use slice

* address comments

* undo yarn.lock changes

* make copy in utils

* chore: Declare GQL variables as readonly (#6889)

* declare gql variables as readonly

* remove console log

* Merge branch 'cab/error_supported_chain' into tina/gql-readonly

---------

Co-authored-by: Charlie B <charles@bachmeier.io>

---------

Co-authored-by: Charlie Bachmeier <charlie.bachmeier@Charlies-MacBook-Pro.local>
Co-authored-by: Tina <59578595+tinaszheng@users.noreply.github.com>
2023-07-05 21:31:30 -07:00
Charles Bachmeier
614c15243e fix: tokens with same name brake cypress test (#6890)
* fix: tokens with same name brake cypress test

* lowercase
2023-07-05 20:23:03 -07:00
Zach Pomerantz
082db21308 build: set test status per commit (#6824)
* build: annotate commit with test status

* build: Test / promotion

* fix: ellipsis

* build: also run on releases/staging

* errant comma

* script context

* runId

* build: post after pre
2023-07-05 14:42:43 -07:00
Jack Short
0f75c6a52b chore: matching swap input number formatting to mobile (#6788)
* initial currency formatting

* updating price formatting on swap

* updating the test
2023-07-05 17:37:57 -04:00
Brendan Wong
1c2ed1d9e4 fix: add margins for empty pool icon (#6884)
* fix: increase height of svg

* update test
2023-07-05 16:36:18 -04:00
Vignesh Mohankumar
0e956fb7c4 chore: remove @walletconnect/modal dependency (#6877) 2023-07-05 13:34:24 -07:00
Zach Pomerantz
b49dd03e25 test(e2e): use electron (#6827)
* test(e2e): use electron

* build: use default container for cypress-test-matrix
2023-07-05 13:30:54 -07:00
Charles Bachmeier
82211a888c fix: show bnb pool positions in mini port (#6880) 2023-07-05 11:16:11 -07:00
cartcrom
5dd8cbbdc9 chore: update tos & privacy policy last updated date (#6882) 2023-07-05 14:12:20 -04:00
eddie
5640c115de fix: remove error popup when switching chains from URL param (#6866) 2023-07-03 17:13:12 -07:00
cartcrom
7b8114b401 fix: remove phantom from injection detection (#6875)
* fix: remove phantom from injection detection

* fix: remove logo image
2023-07-03 16:24:08 -04:00
Brendan Wong
8e36361866 fix: remove blue dot next to buy (#6808)
* remove button

* remove dependencies

* fix: remove useBuyFiatFlowCompleted

* fix: update lint and unit tests

* fix: update user state

* fix: remove migration

* Revert "fix: remove migration"

This reverts commit eef313f9ce.

* test

* fix: add ts ignore
2023-07-03 15:55:49 -04:00
Brendan Wong
0a04cff7eb fix: icons no longer clip (#6812) 2023-06-30 17:41:53 -04:00
Jack Short
d3dd1d4ebd fix: position list row highlight overflowing container (#6805) 2023-06-30 17:25:24 -04:00
Vignesh Mohankumar
50f2e2770a chore: upgrade @web3-react/walletconnect-v2 (#6867)
chore: upgrade @web3-react/walletconnect-v2 (#6863)

* update

* types
2023-06-30 15:27:37 -05:00
Vignesh Mohankumar
830cd07f38 fix: upgrade @web3-react/gnosis-safe (#6868)
fix: upgrade @web3-react/gnosis-safe (#6864)

* fix: upgrade @web3-react/gnosis-safe

* Update yarn.lock
2023-06-30 15:27:20 -05:00
Vignesh Mohankumar
326ae58f04 chore: update @walletconnect/modal (#6851)
* chore: upgrade @walletconnect/modal

* fix
2023-06-30 14:05:10 -04:00
Vignesh Mohankumar
25f5a7178f chore: upgrade @web3-react/walletconnect-v2 (#6847) 2023-06-30 13:34:03 -04:00
Zach Pomerantz
e5591e8f06 fix: allow wallets w/o mainnet to connect to WCv2 (#6854)
* fix: re-initialize wc connector with active chain

* test(e2e): fix universal-search flake
2023-06-30 13:28:48 -04:00
Jordan Frankfurt
1c4a383a49 feat: gate v1 retirement (#6845)
* Revert "feat(wallet-connect): retire v1 (#6820)"

This reverts commit d6759b86e3.

* gate v1/v2 switch with v2 fallback on wc entry

* fix tests

* add a second flag--isolate ... menu and default values from each other

* Update src/components/WalletModal/Option.tsx

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update src/featureFlags/flags/walletConnectPopover.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* pr feedback

* pr feedback

* pr nit

---------

Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt>
Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-06-26 15:59:13 -04:00
Vignesh Mohankumar
469a006088 fix: filter more CSP errors (#6839)
* fix: filter more CSP errors

* fix regex

* fix
2023-06-26 14:04:54 -04:00
Vignesh Mohankumar
c673c9e458 fix: filter user reject errors temporarily (#6840) 2023-06-26 13:41:17 -04:00
Vignesh Mohankumar
dd957d07e4 chore: upgrade @web3-react/walletconnect-v2 (#6842)
* chore: upgrade @web3-react/walletconnect-v2

* fix typecheck
2023-06-26 13:15:16 -04:00
Vignesh Mohankumar
3837ce24ac revert: "feat(wallet-connect): retire v1" (#6841)
Revert "feat(wallet-connect): retire v1 (#6820)"

This reverts commit d6759b86e3.
2023-06-26 12:43:16 -04:00
Zach Pomerantz
4b87e3d9b8 test(e2e): skip failing slippage test (#6844) 2023-06-26 12:29:42 -04:00
Jordan Frankfurt
d6759b86e3 feat(wallet-connect): retire v1 (#6820)
* feat(wallet-connect): retire v1

* fix unit test

* Update src/state/user/reducer.ts

Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com>

* useToggleAccountDrawer

* fix test

---------

Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com>
2023-06-23 15:12:21 -05:00
Jordan Frankfurt
df55456409 fix: chrome tie sort resolution (#6833) 2023-06-23 15:05:47 -05:00
Jack Short
f290787b99 fix: divide by zero error on pool page (#6837)
* fix: divide by zero error on pool page

* removing changes here

* adding price in conditional

---------

Co-authored-by: John Short <john.short@CORN-Jack-899.local>
2023-06-23 15:56:41 -04:00
Zach Pomerantz
2f84507a23 chore: add CODEOWNERS to public (#6813) 2023-06-23 14:41:14 -04:00
Zach Pomerantz
96c58361a5 build: rm global yarn cache (#6822)
* build: omit caching global modules

* docs: build omitting cache
2023-06-23 14:41:06 -04:00
Zach Pomerantz
011136d0e9 build: improve workflow caching (#6825)
* build: only cache on main

* build: do not glob yarn.lock

* build: do not cache on yarn.lock
2023-06-23 14:40:58 -04:00
Vignesh Mohankumar
054d1de88a chore: upgrade @web3-react/walletconnect-v2 (#6831) 2023-06-23 14:40:30 -04:00
Jack Short
ebab00d7bd fix: adding wallet connect v2 behind feature flag (#6826)
* fix: adding wallet connect v2 behind feature flag

* passing unit tests
2023-06-22 16:16:41 -04:00
Brendan Wong
01dc10d4f3 fix: scroll behavior on MP on mobile (#6750)
* fix: update overflow

* fix: add margin for mobile

* fix: update css to use built in styling
2023-06-22 16:11:23 -04:00
Brendan Wong
fb3abf275e fix: added op and arb as base tokens (#6810)
* fix: added op and arb as base tokens

* fix: unit testing
2023-06-22 16:10:49 -04:00
Zach Pomerantz
f6ad694200 build: fix slack markdown (#6811)
* build: fix slack markdown

* build: simpler slack messages

* build: simpler message
2023-06-22 14:52:26 -04:00
Zach Pomerantz
a3d72a4bbc build: simplify workflows (#6814)
* build: simplify workflows

* docs: better name
2023-06-22 14:48:42 -04:00
Vignesh Mohankumar
1bb750f136 feat: track quote method in Quote Received event (#6807)
* WIP

* WIP

* more work

* comment

* fix

* v2slice

* add method to data

* add names

* fellback

* rm-log

* only success
2023-06-22 14:19:23 -04:00
Zach Pomerantz
5315272694 chore: rm committed t9n (#6792)
* chore: rm committed t9n

* chore: ignore t9n

* test(e2e): fix locale selection test
2023-06-22 09:30:06 -04:00
Jordan Frankfurt
43b9e398b5 fix: allow more session namespace keys (#6802)
* allow more session namespace keys

* pr feedback

* add test case
2023-06-21 17:02:13 -05:00
eddie
1247989cf4 fix: cut off wallet icon (#6815) 2023-06-21 14:35:08 -07:00
Jordan Frankfurt
45a5ca3b88 feat: sort supported chains to top of the chain selector list (#6800)
* feat: sort supported chains to top of the chain selector list

* pr feedback

---------

Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt>
2023-06-21 16:10:46 -05:00
eddie
54b4567a81 test: add e2e test for usdt special case (#6784)
* feat: revoke USDT approvals in ConfirmSwapModal

* chore: fix bad merge

* test: add e2e test for usdt special case

* fix: refactor test

* fix: make variable static

* fix: comments
2023-06-21 14:02:14 -07:00
Jordan Frankfurt
fc45a504fb fix: log the error message instead of [object Object] (#6773)
* fix: log the error message instead of [object Object]

add tina's rec

pr review

zzmp input

* pr feedback
2023-06-21 15:35:23 -05:00
eddie
052cc69414 feat: log minimum_output_after_slippage to amplitude (#6769)
* feat: log minimum_output_after_slippage to amplitude

* fix: memoize logging props

* fix: dont memoize at all
2023-06-21 10:22:48 -07:00
Zach Pomerantz
5caaaf1b1f test(e2e): switching network (#6662)
* test(e2e): switching network

Co-authored-by: Jordan Frankfurt <<jordan@CORN-Jordan-949.frankfurt>

* fix: reconnect after failed chain switch

* test(e2e): add forks to hardhat.config

* test(e2e): wait on wallet_switchEthereumChain

* build: upgrade cypress-hardhat

* fix: do not disconnect whilst switching

* fix: unit tests

* fix: better chain selector check

* test(e2e): better helper fn naming

* test(e2e): better stub naming

* fix: doc re-activation

* fix: add back click

* build: upgrade cypress-hardhat to include network caching

* unwrap web3status

---------

Co-authored-by: Jordan Frankfurt <<jordan@CORN-Jordan-949.frankfurt>
2023-06-21 13:15:03 -04:00
Zach Pomerantz
c0163767ed build: rm crowdin-sync (#6793) 2023-06-21 10:45:21 -04:00
Zach Pomerantz
342b0c81f6 chore: rm pseudo locale (#6794)
chore: rm pseudo t9n
2023-06-21 10:45:03 -04:00
Jordan Frankfurt
cb21750b87 fix: remove unused types (#6791)
* fix: remove unused types

* update name
2023-06-16 14:38:03 -05:00
Jordan Frankfurt
2e8ef480f9 feat(testnets): add toggle for testnets (#6786)
* feat(testnets): add toggle for testnets

* e2e test

* update toggle syntax and fix a bug

* simplify list calculation per eddie's input

* add all testnets

* clean up the styles

* Update src/components/NavBar/ChainSelector.tsx

* fix lint
2023-06-16 14:09:05 -05:00
Nate Wienert
f27bba9ffa fix: use shortenAddress for mini portfolio addresses (#6774)
* fix: use shortenAddress for mini portfolio addresses

* Update src/utils/addresses.ts

Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com>

---------

Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com>
2023-06-16 08:51:03 -10:00
eddie
6528fd136e feat: log swap failures to amplitude (#6789) 2023-06-16 11:20:09 -07:00
Zach Pomerantz
eb802266e1 build: rm ignored en-US (#6790) 2023-06-16 13:05:49 -05:00
Jordan Frankfurt
5bec0b78da fix: update copy per Fred's input (#6787) 2023-06-16 12:46:59 -05:00
Zach Pomerantz
4894460821 build: download translations when pushing to staging (#6780)
* build: pin crowdin action

* build: download t9n to staging
2023-06-16 12:41:32 -05:00
Vignesh Mohankumar
f3889e326e chore: migrate from JIRA to Linear (#6747)
* chore: migrate from JIRA to Linear

* INFRA -> WEB
2023-06-16 12:48:27 -04:00
Jordan Frankfurt
2d61c72588 feat(wallet-connect): make v2 the default walletconnect method (#6785)
* explicitly enumerate all supported wcv2 methods as optional ?

* use only sign methods in optionalMethods

* rename class

* feat(wallet-connect): make v2 the default

* fix loader and menu button occlusion

* fix test

* pr feedback from zzmp

* update connector name

* add slack convo link from x-walletconnect
2023-06-16 11:33:37 -05:00
Brendan Wong
1a634c350a fix: success indication for copy (#6711)
* fix: success indication for copy

* fix: remove redundant styles
2023-06-15 20:51:11 -04:00
eddie
35b83ab842 feat: revoke USDT approvals in ConfirmSwapModal (#6730) 2023-06-15 17:12:10 -07:00
eddie
c0d42ade6f fix: clear dependent variable when trade inputs become invalid (#6782)
* fix: handle polling interrupt separately from invalid trades

* fix: clear output when trade becomes invalid, dont use stale trade

* fix: tests

* fix: invert skip

* fix: remove debounce delay
2023-06-15 16:05:57 -07:00
eddie
0e2344ba85 feat: refactor ConfirmSwapModal for clarity (#6729)
* feat: refactor ConfirmSwapModal for clarity

* fix: remove reset effect for now

* fix: catchUserReject update

* fix: remove unnecessary awaits
2023-06-15 15:31:41 -07:00
Tina
309d03b5e7 feat: Bump default auto-slippage to 0.5% (#6778)
bump default to 0.5%
2023-06-15 18:10:28 -04:00
Vignesh Mohankumar
8d32e315ed feat: filter moz-extension errors (#6781) 2023-06-15 18:05:39 -04:00
Jack Short
1c8b3f0339 fix: currency select modal when chain is not supported (#6759)
* fix: currency select modal when chain is not supported

* removing pay with if on unsupported network

* refactor
2023-06-15 12:39:35 -04:00
eddie
fc83659041 fix: bottom padding on error modal (#6758) 2023-06-15 09:16:32 -07:00
cartcrom
e8f5a0e8c8 feat: detect more injections (#6752)
* feat: detect more injectors

* feat: added comments

* refactor: move image folder

* test: add tests for new injectors

* feat: small test change

* fix: update comment about coinbase injection

* test: update snapshots

* fix: pr nits
2023-06-15 12:08:54 -04:00
Jordan Frankfurt
9e213fc396 fix: update web3-react (#6749)
* fix: update web3-react

* update flakey snapshot test and add required config var

* revert snapshot change

* allow ^

* update lockfile with permissive version

* add newly required explicit options for @web3modal
2023-06-15 10:55:19 -05:00
Saro Vindigni
f10ba73529 fix: <a> cannot appear as a descendant of <a> (#6737)
* fix: <a> cannot appear as a descendant of <a>

* refact: change render logic to SwitchLocaleLink
2023-06-15 10:02:18 -05:00
Jordan Frankfurt
c2a83cabaa feat: add loading indicator to activity tab in mini portfolio (#6754)
* feat: add loading indicator to activity tab in mini portfolio

* should not render spinner when activity key is active

* add an unread notification dot that is dismissed when the user visits the activity tab

* pr feedback
2023-06-14 19:06:10 -05:00
Jordan Frankfurt
7a3c51bc90 fix: uniswap_wallet -> uniwallet (#6764)
* fix: uniswap_wallet -> uniwallet

update tests

Revert "fix: uniswap_wallet -> uniwallet"

This reverts commit 7bdf34b33025d0b564c5870b073eb20e3d1774e1.

Revert "update tests"

This reverts commit cc841cb5e01a1a239f79fa4d9d480e6479128f08.

add migration

* refactor: add deprecated value back to enum (#6768)

* add deprecated value back to enum

* Update src/connection/types.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* add deprecated case to getConnection

---------

Co-authored-by: Charles Bachmeier <charles@bachmeier.io>
Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-06-14 18:16:12 -05:00
eddie
e69a7c2712 feat: log user router preference as a user property (#6761)
* feat: log router preference in user properties

* fix: update analytics events
2023-06-14 16:03:23 -07:00
Vignesh Mohankumar
d149512d93 fix: update arbitrum subgraph (#6679) 2023-06-14 17:14:05 -04:00
eddie
5826ed15c8 fix: remove sentry logging for swap failures (#6765) 2023-06-14 11:16:05 -07:00
eddie
3db9e1b9a4 feat: rename permit2 variables for clarity (#6728)
* feat: rename permit2 variables for clarity

* fix: types
2023-06-14 11:13:54 -07:00
eddie
79a72d6fe2 feat: update permit2 hook to allow revoking (#6727)
* feat: update permit2 hook to allow revoking

* fix: types

* fix: rename reset to revoke

* fix: re-use useUpdateTokenAllowance

* fix: add tests

* fix: improve code style

* fix: undefined nit
2023-06-14 10:26:12 -07:00
Brendan Wong
f3bfd4ad41 fix: prevent scrolling with settings modal open (#6739)
* fix: prevent scrolling with settings modal open

* fix: create hook

* fix: create tests

* fix: simplify useeffect and add JSDoc
2023-06-14 12:30:42 -04:00
Brendan Wong
45acf421b3 fix: tick labels respond to width of the graph (#6741)
* fix: tick labels respond to width of the graph

* fix: add description to new useeffect

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-06-14 12:30:22 -04:00
Saro Vindigni
2c5ea67ada fix: remove gradientId from svg props (#6751) 2023-06-14 11:14:07 -05:00
eddie
2e141ac94c fix: make text white in success state (#6755) 2023-06-13 14:20:26 -07:00
eddie
8b16f454ca feat: add amount to local copy of Approval transactions (#6726)
* feat: add amount to local copy of Approval transactions

* fix: use alternate

* fix: type problem

* feat: add test
2023-06-13 13:55:45 -07:00
Tina
094664dc7a chore: Feature flag cleanup for Arbitrum native USDC (#6743)
remove feature flag stuff
2023-06-12 15:20:24 -04:00
Charles Bachmeier
62a6ef00da fix: [DetailsV2] flaky time relevant test (#6753)
fix flaky time relevant test

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-06-12 10:51:11 -07:00
Tina
3a739476ca fix: Catch routing-api v2 no liquidity error case (#6742)
catch URA no liquidity case
2023-06-12 12:25:24 -04:00
Tina
04e4335cc2 feat: Use routing-api or URA for price fetches behind feature flag (#6740)
use routing-api or URA for price fetches behind feature flag
2023-06-09 15:07:53 -04:00
Zach Pomerantz
4235b57cd8 build: make codecov reports consistent/not confusing (#6734)
* build: codecov config

* build: better codecov

* build: omit default

* build: sensical codecov

* build: upload-artifact

* build: customize codecov comment

* build: try again

* build: try again

* build: turn off status except flags

* build: flag comments

* build: changes on

* build: simplify

* build: after_n for comment
2023-06-09 11:00:27 -07:00
Charles Bachmeier
cb362f1b2c fix: Handle scientific notation for NFT Details pricing (#6707)
* fix: Handle scientific notation for NFT Details pricing

* add test case

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-06-09 09:10:40 -07:00
Jack Short
a4d61d8eaa fix: insufficient liquidity state flashes (#6733) 2023-06-09 12:10:13 -04:00
Jack Short
310623b948 fix: language updating in search bar (#6720) 2023-06-09 11:56:20 -04:00
Shubham Rasal
b7303fb9c0 style: navbar ui updated (#6627)
* ui: navbar ui updated

* added margin right

* moved style to higher component
2023-06-09 08:52:52 -07:00
Jack Short
4fbb8e9117 chore: removing error state for rejecting chain switch (#6713)
* chore: removing error state for rejecting chain switch

* removing connection error state
2023-06-09 11:45:35 -04:00
Zach Pomerantz
f0502bfc33 build: rm old release workflow (#6731) 2023-06-08 14:52:24 -07:00
eddie
98f4af55c9 fix: stop resetting modal when we interrupt quote polling (#6695)
* test(e2e): disable video compression

* refactor: improve popupList impl/test

* test(e2e): log JSON-RPC calls

* fix: retry backoff logic

* test(e2e): wait for hardhat/popup assertions

* fix: remove transactions after expired

* test(e2e): re-enable other swap tests

Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com>

* chore: rm console.log

* fix: expire txs after 6h

* refactor: dry trade info

* test(e2e): use default deadline

* test(e2e): use aliases for permit2 test

* test(e2e): automine/off in beforeEach

* test(e2e): rm intermediate screen with no pause

* fix: stop resetting modal when we interrupt quote polling'

* feat: add e2e test for window losing focus

* fix: move test

* fix: combine tests

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com>
2023-06-08 13:44:47 -07:00
Jordan Frankfurt
08b8bdd769 chore: update @web3-react/walletconnect-v2 (#6724) 2023-06-08 14:20:14 -05:00
Jordan Frankfurt
1283199d0d fix: remove mainnet from optional chains list (#6725)
* fix: remove mainnet from optional chains list

* simplify imports
2023-06-08 14:09:41 -05:00
Jack Short
c1fff5ea49 fix: time interval axis overlap (#6717) 2023-06-08 13:26:25 -04:00
cartcrom
94adc449a1 refactor: convert getConnection to non-hook (#6714)
* refactor: convert getConnection to non-hook

* fix: remove getConnection from hook dependecies

* fix: unecessary optional
2023-06-08 13:06:46 -04:00
eddie
4b24e5f754 fix: remove step indicators in sucess state (#6716) 2023-06-08 09:14:39 -07:00
eddie
e0a531e538 fix: type error in cypress infra (#6700) 2023-06-07 18:16:57 -07:00
eddie
8cef1ca0f7 fix: bottom padding on swap modal (#6715)
<!-- Your PR title must follow conventional commits: https://github.com/Uniswap/interface#pr-title -->

## Description
<!-- Summary of change, including motivation and context. -->
<!-- Use verb-driven language: "Fixes XYZ" instead of "This change fixes XYZ" -->


<!-- Delete inapplicable lines: -->
_Linear ticket:_ https://linear.app/uniswap/issue/WEB-2151/permit2-fix-dialog-window-height


<!-- Delete this section if your change does not affect UI. -->
## Screen capture

### Before
|    Mobile    |   Desktop    |
| ------------ | ------------ |
| paste_before | <img width="516" alt="image" src="https://github.com/Uniswap/interface/assets/66155195/4b7320c3-9bd3-4c5c-8d28-341a5ae7fa4f"> |


### After
|    Mobile    |   Desktop   |
| ------------ | ----------- |
| paste_after  | ![image](https://github.com/Uniswap/interface/assets/66155195/8b112a05-39d5-4a01-b412-47a7d74d040f) |
2023-06-07 18:09:20 -07:00
Zach Pomerantz
088f1d9ae4 test(e2e): use aliases for permit2 test (#6656)
* test(e2e): disable video compression

* refactor: improve popupList impl/test

* test(e2e): log JSON-RPC calls

* fix: retry backoff logic

* test(e2e): wait for hardhat/popup assertions

* fix: remove transactions after expired

* test(e2e): re-enable other swap tests

Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com>

* chore: rm console.log

* fix: expire txs after 6h

* refactor: dry trade info

* test(e2e): use default deadline

* test(e2e): use aliases for permit2 test

* test(e2e): automine/off in beforeEach

* test(e2e): rm intermediate screen with no pause

* fix merge

* fix only

---------

Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com>
2023-06-07 17:55:27 -07:00
Nate Wienert
89a7d98b41 ci: fix wallet disconnect test regression (#6723) 2023-06-07 13:17:58 -10:00
Zach Pomerantz
0076fdc65b test(e2e): skip outdated disconnect-wallet test (#6722) 2023-06-07 16:57:37 -04:00
Nate Wienert
48b4a533c3 feat: disconnect button has confirmation step with animated width transition to show confirm text (#6668)
* feat: changes disconnect button to a two-step animated button with confirmation

* fix: use ConfirmSwapModal in expert mode (#6673)

Fixes the swap flow for users who are still in expert mode  and need permit2 approvals for a token

---------

Co-authored-by: eddie <66155195+just-toby@users.noreply.github.com>
2023-06-07 09:37:32 -10:00
Zach Pomerantz
0b66fde26c fix: only remove expired transactions from updater (#6625)
* test(e2e): disable video compression

* refactor: improve popupList impl/test

* test(e2e): log JSON-RPC calls

* fix: retry backoff logic

* test(e2e): wait for hardhat/popup assertions

* fix: remove transactions after expired

* test(e2e): re-enable other swap tests

Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com>

* chore: rm console.log

* fix: expire txs after 6h

* refactor: dry trade info

* test(e2e): use default deadline

---------

Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com>
2023-06-07 09:29:23 -07:00
Jordan Frankfurt
5788385951 feat(wallet-connect): add support for v2 (#6582)
* feat(wallet-connect): add support for v2

* use theme button to fix opacity issue

* fix lint

* add new web3-react v2 package

* add mainnet to chains list

* fix test

* yarn dedupe

* add new @walletconnect/ethereum-provider

* fix safari padding

* fix second-click flash on popover toggle

* add walletconnect theme

* add goerli to non-prod chain selector

* remove: debug

* remove vertical line

* WEB-2107 Fix modal close behavior

* remove logging

* clean up accountDrawerOpenAtom usage

* remove irrelevant comments

* remove unintentional whitespace diff

* yarn yarn-deduplicate --strategy=highest

* add conditional chain selector

* update wc package version

* goerli -> sepolia

* goerli -> sepolia

* yarn yarn-deduplicate --strategy=highest

* UNIWALLET -> UNISWAP_WALLET

* useWalletSupportsChain -> useWalletSupportedChains

* use TOGGLE_SIZE

* remove inline styles

* remove inline styles and use better alt text

* update Option.test

* use a named function for forwardRef arg

* fix types

---------

Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt>
2023-06-07 11:11:08 -05:00
Brendan Wong
0891e67528 fix: token bridge pointer bug (#6670)
* fix: token bridge pointer bug

* fix: use zIndex enum instead of hardcoded
2023-06-07 10:18:48 -04:00
Brendan Wong
b319acd9c4 fix: info labels for extended list tokens (#6678)
* fix: info labels for extended list tokens

* test: update warning tests for new changes

* fix: function for label and padding

* fix: use warning check function

* fix: update displayWarningLabel
2023-06-07 10:15:36 -04:00
Brendan Wong
05977f950b fix: updated celo logo (#6676)
* fix: updated celo logo

* fix: use celo logo from local fs

* fix: removed outdated comments

* fix: combine if statements in celo check

* fix: fix lint
2023-06-07 10:15:06 -04:00
Nate Wienert
5ac36d4156 feat: add link to download the uniswap wallet to the homepage (#6690)
* feat: add link to download the uniswap wallet to the homepage
2023-06-06 14:17:42 -10:00
clrdo
fb998706c2 fix: swaps with native currency destination in BNB Chain (#6705)
fix: swaps with native currency destination in BNB Chain

Co-authored-by: clrdo <clrdo@github.com>
2023-06-06 16:48:36 -05:00
eddie
c45492c890 feat: log swap errors to sentry (#6698)
* feat: log swap errors to sentry

* fix: dont stringify
2023-06-06 13:31:46 -07:00
eddie
41219b435f feat: update content in permit2 flow (#6699) 2023-06-06 13:30:06 -07:00
eddie
e1321843de fix: disable settings button when contextual chainId !== connectedChainId (#6696)
* fix: disable settings button when contextual chainId !== connectedChainId

* fix: re-enable TDP tests (#6708)
2023-06-06 13:28:21 -07:00
Charles Bachmeier
0baa8a1fff feat: upgrade to node 18 (#6606)
* feat: upgrade to node 18

* use 18.x

* try removing npx from fetch schema fn

* use yarn

* setup github build on 18

* no yarn

* use yarn and sanitize output

* yarn silent

* update workflows

* fully remove unused step

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-06-06 11:59:03 -07:00
Zach Pomerantz
f2a3b66357 test(e2e): simplify and re-enable token explore filter test (#6660) 2023-06-06 09:05:16 -07:00
Zach Pomerantz
f2af46037e test(e2e): wallet connection (#6661) 2023-06-06 08:57:04 -07:00
Zach Pomerantz
20a06c9b5a test: skip SwapDetailsDropdown tests (#6652)
* test: skip SwapDetailsDropdown tests

Tests depend on network requests, which may cause flakiness.
These tests should have the network requests mocked, then be re-enabled.

* add TODO

---------

Co-authored-by: cartcrom <cartergcromer@gmail.com>
2023-06-05 22:03:05 -07:00
Zach Pomerantz
8ef54d41b6 docs(e2e): cypress README (#6523)
* docs(e2e): best practices

* docs: rewording running

* wip: thenable

* docs(e2e): writing tests
2023-06-05 19:38:25 -07:00
Jordan Frankfurt
1cdddd1321 chore: add better documentation to a complicated hook (#6689)
* chore: add better documentation to a complicated hook

* input from eddie

* Update src/hooks/useUnmountingAnimation.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* remove jsdoc types

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-06-05 20:34:34 -05:00
Brendan Wong
f834af69fe fix: Trust wallet loading state (#6694) 2023-06-05 16:25:30 -04:00
Jordan Frankfurt
08cd4bec41 fix: add '-' instead of '$0.00' when the api does not return a price for a tokens page entry (#6691)
* fix: show '-' instead of .00 when we don't have price data on a token

* explicitly handle the 0 case

* add tests to token row component
2023-06-05 14:56:49 -05:00
cartcrom
63ac64f470 fix: use coned function for chart prices (#6693) 2023-06-05 15:40:03 -04:00
Nate Wienert
72686f1e32 ci: temporarily disable coverage tests as they are too flakey (#6684) 2023-06-05 06:42:59 -10:00
Jordan Frankfurt
c07359362f feat: dismiss the landing page when the account drawer is opened (#6633)
* feat: dismiss the landing page when the account drawer is opened

* remove the gradient before the page transition

* pr feedback

* clean up darkmode handling

* pr feedback from design

* update link test

---------

Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt>
2023-06-05 11:37:18 -05:00
cartcrom
ed58c39bdc feat: parse moonpay purchases (#6677)
* feat: parse moonpay purchases

* fix: update comment

* fix: use new coned function

* refactor: simplify nested if statements
2023-06-02 16:46:57 -04:00
Nate Wienert
5d2254be27 fix: searchbar showing incorrect spacing at medium size (#6637)
* fix: searchbar showing incorrect spacing at medium size

* refactor: remove media query navSearchInputVisible into hook only useNavSearchInputVisible

* fix: disable slight blur showing incorrectly when 1100px to lg breakpoint width

* build: use repository slack secret (#6639)

* feat: add animation to Settings menu (#6617)

* feat: add price impact back

* chore: update tes tname

* chore: update snapshot for price impact

* fix

* fix

* update snapshot after rebase

* update snapshot

* chore: finish

* chore: remove snapshot

* feat: add test matcher

* cleanup

* chore: add animation test

* add comment

* update comment

* fix: no-undefined-or in object field types (#6640)

* feat: show affordance in swap UI when we can't fetch usd quote (#6622)

* initial commit:

* add todo to linear

* fix: increase useBestTrade debounce time (#6631)

* fix: increase useBestTrade debounce time

* reduce

* increase

* 350

* fix

* build: caching i18n extractor (#6619)

* fix: do not attempt to cache i18n:extract

* fix: i18n extraction

* docs: improve comments

* fix: remove app advert on mobile safari (#6630)

Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt>

* fix: include sw metric with web vitals (#6646)

* build: add vscode settings for default formatter (#6644)

build: add vscode settings for default formatter to be dbaeumer.vscode-eslint

* test(e2e): improve hardhat configuration (#6650)

build: cache hardhat cache

* feat: permit2 flow updates (#6538)

* test: swap flow cypress tests

* fix: use default parameter

* feat: use Swap Component on TDP

* feat: auto nav for TDP tokens

* chore: merge

* chore: merge

* chore: merge

* chore: merge

* fix: remove extra inputCurrency URL parsing logic

* fix: undo last change

* fix: pass expected chain id to swap component

* fix: search for default tokens on unconnected networks if needed

* test: e2e test for l2 token

* fix: delete irrelevant tests

* fix: address comments

* fix: lint error

* test: update TDP e2e tests

* fix: use pageChainId for filter

* fix: rename chainId

* fix: typecheck

* fix: chainId bug

* fix: chainId required fixes

* fix: bad merge in e2e test

* fix: remove unused test util

* fix: remove unnecessary variable

* fix: token defaults

* fix: address comments

* fix: address comments and fix tests

* fix: e2e test formatting, remove Maybe<>

* fix: remove unused variable

* fix: use feature flag for swap component on TDP

* fix: back button

* feat: copy review screen UI from widgetg

* fix: modal padding

* feat: add final detail row

* fix: remove widget comment

* fix: update unit tests

* fix: code style consistency

* fix: remove padding from AutoColumn

* fix: update snapshots

* fix: use semantic gaps

* fix: more px and gaps

* fix: design feedbacks

* fix: button radius in summary modal

* fix: design nits

* feat: update design of summary modal

* fix: font weight and vertical spacing

* fix: update snapshots

* fix: css nits

* fix: modal flicker when refetching trade

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: remove step indicators when only one step

* feat: move content into PendingModalContent component

* fix: lint

* fix: correct modal state when moving between steps

* fix: comments

* fix: code style improvements

* feat: require trade to be defined

* fix: remove extra props from ThemedTexts

* fix: one more trans

* fix: remove unused export

* feat: remove undefined checks and other fixes

* fix: update test

* fix: add missing dollar sign

* fix: remove null check and update test

* fix: remove max width from detail row value

* fix: remove isOpen prop

* fix: isopen

* feat: refactor approval flow into a hook

* fix: tradeMeaningfullyDiffers improvement and prepareFlow fix

* fix: address  comments

* feat: add comments explaining async state

* fix: nits

* fix: address comments

* feat: permit2 e2e tests (#6541)

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: re-order functions

* wip: move approval to summary modal

* wip: not working

* feat: update permit2 e2e tests

* feat: tests passing

* fix: swap test

* fix: bad merge

* chore: merge

* fix: update tests for new modal

* fix: testid fix

* fix: test updates

* fix: reduce nesting

* test: remove line from test for debugging

* fix: update tests

* fix: more nesting in test

* fix: update test

* fix: reorganize test code

* test: permit2 flow component tests (#6551)

* test: swap flow cypress tests

* fix: use default parameter

* feat: use Swap Component on TDP

* feat: auto nav for TDP tokens

* chore: merge

* chore: merge

* chore: merge

* chore: merge

* fix: remove extra inputCurrency URL parsing logic

* fix: undo last change

* fix: pass expected chain id to swap component

* fix: search for default tokens on unconnected networks if needed

* test: e2e test for l2 token

* fix: delete irrelevant tests

* fix: address comments

* fix: lint error

* test: update TDP e2e tests

* fix: use pageChainId for filter

* fix: rename chainId

* fix: typecheck

* fix: chainId bug

* fix: chainId required fixes

* fix: bad merge in e2e test

* fix: remove unused test util

* fix: remove unnecessary variable

* fix: token defaults

* fix: address comments

* fix: address comments and fix tests

* fix: e2e test formatting, remove Maybe<>

* fix: remove unused variable

* fix: use feature flag for swap component on TDP

* fix: back button

* feat: copy review screen UI from widgetg

* fix: modal padding

* feat: add final detail row

* fix: remove widget comment

* fix: update unit tests

* fix: code style consistency

* fix: remove padding from AutoColumn

* fix: update snapshots

* fix: use semantic gaps

* fix: more px and gaps

* fix: design feedbacks

* fix: button radius in summary modal

* fix: design nits

* feat: update design of summary modal

* fix: font weight and vertical spacing

* fix: update snapshots

* fix: css nits

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: re-order functions

* wip: move approval to summary modal

* wip: not working

* feat: update permit2 e2e tests

* feat: tests passing

* fix: swap test

* fix: bad merge

* wip: move approval to summary modal

* wip: not working

* feat: PendingModalContent tests

* feat: useMaxAmountIn

* fix: bad merge

* fix: naming

* fix: modal flicker when refetching trade

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: remove step indicators when only one step

* feat: move content into PendingModalContent component

* fix: lint

* chore: merge

* fix: update tests for new modal

* fix: correct modal state when moving between steps

* fix: comments

* fix: code style improvements

* feat: require trade to be defined

* fix: remove extra props from ThemedTexts

* fix: one more trans

* fix: remove unused export

* feat: remove undefined checks and other fixes

* fix: update test

* fix: add missing dollar sign

* fix: remove null check and update test

* fix: remove max width from detail row value

* fix: remove isOpen prop

* fix: isopen

* feat: refactor approval flow into a hook

* fix: testid fix

* fix: tradeMeaningfullyDiffers improvement and prepareFlow fix

* fix: address  comments

* feat: add comments explaining async state

* fix: test updates

* fix: nits

* fix: reduce nesting

* fix: address comments

* test: remove line from test for debugging

* fix: update tests

* fix: update tests

* fix: more nesting in test

* fix: update test

* fix: reorganize test code

* feat: add l2 chain logo to modal (#6575)

* test: swap flow cypress tests

* fix: use default parameter

* feat: use Swap Component on TDP

* feat: auto nav for TDP tokens

* chore: merge

* chore: merge

* chore: merge

* chore: merge

* fix: remove extra inputCurrency URL parsing logic

* fix: undo last change

* fix: pass expected chain id to swap component

* fix: search for default tokens on unconnected networks if needed

* test: e2e test for l2 token

* fix: delete irrelevant tests

* fix: address comments

* fix: lint error

* test: update TDP e2e tests

* fix: use pageChainId for filter

* fix: rename chainId

* fix: typecheck

* fix: chainId bug

* fix: chainId required fixes

* fix: bad merge in e2e test

* fix: remove unused test util

* fix: remove unnecessary variable

* fix: token defaults

* fix: address comments

* fix: address comments and fix tests

* fix: e2e test formatting, remove Maybe<>

* fix: remove unused variable

* fix: use feature flag for swap component on TDP

* fix: back button

* feat: copy review screen UI from widgetg

* fix: modal padding

* feat: add final detail row

* fix: remove widget comment

* fix: update unit tests

* fix: code style consistency

* fix: remove padding from AutoColumn

* fix: update snapshots

* fix: use semantic gaps

* fix: more px and gaps

* fix: design feedbacks

* fix: button radius in summary modal

* fix: design nits

* feat: update design of summary modal

* fix: font weight and vertical spacing

* fix: update snapshots

* fix: css nits

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: re-order functions

* wip: move approval to summary modal

* wip: not working

* feat: update permit2 e2e tests

* feat: tests passing

* fix: swap test

* fix: bad merge

* wip: move approval to summary modal

* wip: not working

* feat: PendingModalContent tests

* feat: useMaxAmountIn

* fix: bad merge

* fix: naming

* fix: modal flicker when refetching trade

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: remove step indicators when only one step

* feat: move content into PendingModalContent component

* fix: lint

* chore: merge

* fix: update tests for new modal

* feat: add l2 chain logo to modal

* feat: add unit test

* fix: correct modal state when moving between steps

* fix: comments

* fix: code style improvements

* feat: require trade to be defined

* fix: remove extra props from ThemedTexts

* fix: one more trans

* fix: remove unused export

* feat: remove undefined checks and other fixes

* fix: update test

* fix: add missing dollar sign

* fix: remove null check and update test

* fix: remove max width from detail row value

* fix: remove isOpen prop

* fix: isopen

* feat: refactor approval flow into a hook

* fix: testid fix

* fix: tradeMeaningfullyDiffers improvement and prepareFlow fix

* fix: address  comments

* fix: headerContent prop

* feat: add comments explaining async state

* fix: test updates

* fix: nits

* fix: reduce nesting

* fix: address comments

* test: remove line from test for debugging

* fix: update tests

* fix: address  comments

* fix: update tests

* fix: more nesting in test

* fix: update test

* fix: reorganize test code

* feat: swap rejection error handling (#6576)

* test: swap flow cypress tests

* fix: use default parameter

* feat: use Swap Component on TDP

* feat: auto nav for TDP tokens

* chore: merge

* chore: merge

* chore: merge

* chore: merge

* fix: remove extra inputCurrency URL parsing logic

* fix: undo last change

* fix: pass expected chain id to swap component

* fix: search for default tokens on unconnected networks if needed

* test: e2e test for l2 token

* fix: delete irrelevant tests

* fix: address comments

* fix: lint error

* test: update TDP e2e tests

* fix: use pageChainId for filter

* fix: rename chainId

* fix: typecheck

* fix: chainId bug

* fix: chainId required fixes

* fix: bad merge in e2e test

* fix: remove unused test util

* fix: remove unnecessary variable

* fix: token defaults

* fix: address comments

* fix: address comments and fix tests

* fix: e2e test formatting, remove Maybe<>

* fix: remove unused variable

* fix: use feature flag for swap component on TDP

* fix: back button

* feat: copy review screen UI from widgetg

* fix: modal padding

* feat: add final detail row

* fix: remove widget comment

* fix: update unit tests

* fix: code style consistency

* fix: remove padding from AutoColumn

* fix: update snapshots

* fix: use semantic gaps

* fix: more px and gaps

* fix: design feedbacks

* fix: button radius in summary modal

* fix: design nits

* feat: update design of summary modal

* fix: font weight and vertical spacing

* fix: update snapshots

* fix: css nits

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: re-order functions

* wip: move approval to summary modal

* wip: not working

* feat: update permit2 e2e tests

* feat: tests passing

* fix: swap test

* fix: bad merge

* wip: move approval to summary modal

* wip: not working

* feat: PendingModalContent tests

* feat: useMaxAmountIn

* fix: bad merge

* fix: naming

* fix: modal flicker when refetching trade

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: remove step indicators when only one step

* feat: move content into PendingModalContent component

* fix: lint

* chore: merge

* fix: update tests for new modal

* feat: add l2 chain logo to modal

* feat: add unit test

* fix: correct modal state when moving between steps

* fix: correct modal state when moving between steps

* fix: proper error handling of user rejection of swap

* feat: update e2e test

* fix: typecheck

* fix: comments

* fix: code style improvements

* feat: require trade to be defined

* fix: remove extra props from ThemedTexts

* fix: one more trans

* fix: remove unused export

* feat: remove undefined checks and other fixes

* fix: update test

* fix: add missing dollar sign

* fix: remove null check and update test

* fix: remove max width from detail row value

* fix: remove isOpen prop

* fix: isopen

* feat: refactor approval flow into a hook

* fix: custom error type

* fix: testid fix

* fix: add comment

* fix: tradeMeaningfullyDiffers improvement and prepareFlow fix

* fix: address  comments

* fix: headerContent prop

* feat: add comments explaining async state

* fix: test updates

* fix: nits

* fix: reduce nesting

* fix: address comments

* test: remove line from test for debugging

* fix: update tests

* fix: address  comments

* fix: update tests

* fix: more nesting in test

* fix: update test

* fix: update e2e test

* fix: update error test

* fix: reorganize test code

* feat: update content in Swap Submission Modal (#6577)

* test: swap flow cypress tests

* fix: use default parameter

* feat: use Swap Component on TDP

* feat: auto nav for TDP tokens

* chore: merge

* chore: merge

* chore: merge

* chore: merge

* fix: remove extra inputCurrency URL parsing logic

* fix: undo last change

* fix: pass expected chain id to swap component

* fix: search for default tokens on unconnected networks if needed

* test: e2e test for l2 token

* fix: delete irrelevant tests

* fix: address comments

* fix: lint error

* test: update TDP e2e tests

* fix: use pageChainId for filter

* fix: rename chainId

* fix: typecheck

* fix: chainId bug

* fix: chainId required fixes

* fix: bad merge in e2e test

* fix: remove unused test util

* fix: remove unnecessary variable

* fix: token defaults

* fix: address comments

* fix: address comments and fix tests

* fix: e2e test formatting, remove Maybe<>

* fix: remove unused variable

* fix: use feature flag for swap component on TDP

* fix: back button

* feat: copy review screen UI from widgetg

* fix: modal padding

* feat: add final detail row

* fix: remove widget comment

* fix: update unit tests

* fix: code style consistency

* fix: remove padding from AutoColumn

* fix: update snapshots

* fix: use semantic gaps

* fix: more px and gaps

* fix: design feedbacks

* fix: button radius in summary modal

* fix: design nits

* feat: update design of summary modal

* fix: font weight and vertical spacing

* fix: update snapshots

* fix: css nits

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: re-order functions

* wip: move approval to summary modal

* wip: not working

* feat: update permit2 e2e tests

* feat: tests passing

* fix: swap test

* fix: bad merge

* wip: move approval to summary modal

* wip: not working

* feat: PendingModalContent tests

* feat: useMaxAmountIn

* fix: bad merge

* fix: naming

* fix: modal flicker when refetching trade

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: remove step indicators when only one step

* feat: move content into PendingModalContent component

* fix: lint

* chore: merge

* fix: update tests for new modal

* feat: add l2 chain logo to modal

* feat: add unit test

* fix: correct modal state when moving between steps

* fix: correct modal state when moving between steps

* fix: proper error handling of user rejection of swap

* feat: update e2e test

* fix: typecheck

* feat: design updates, state updates

* fix: comments

* fix: code style improvements

* feat: require trade to be defined

* fix: remove extra props from ThemedTexts

* fix: one more trans

* fix: remove unused export

* feat: remove undefined checks and other fixes

* fix: update test

* fix: add missing dollar sign

* fix: remove null check and update test

* fix: remove max width from detail row value

* fix: remove isOpen prop

* fix: isopen

* feat: refactor approval flow into a hook

* fix: custom error type

* fix: testid fix

* fix: text colors

* fix: add comment

* fix: tradeMeaningfullyDiffers improvement and prepareFlow fix

* fix: address  comments

* fix: headerContent prop

* fix: change tooltip to external link

* feat: add comments explaining async state

* fix: test updates

* fix: nits

* fix: reduce nesting

* fix: address comments

* test: remove line from test for debugging

* fix: update tests

* fix: address  comments

* fix: comments

* fix: update tests

* fix: update tests

* fix: more nesting in test

* fix: update test

* fix: update e2e test

* fix: update error test

* fix: update content in test

* fix: reorganize test code

* feat: permit2 animations WEB-2036 (#6590)

* test: swap flow cypress tests

* fix: use default parameter

* feat: use Swap Component on TDP

* feat: auto nav for TDP tokens

* chore: merge

* chore: merge

* chore: merge

* chore: merge

* fix: remove extra inputCurrency URL parsing logic

* fix: undo last change

* fix: pass expected chain id to swap component

* fix: search for default tokens on unconnected networks if needed

* test: e2e test for l2 token

* fix: delete irrelevant tests

* fix: address comments

* fix: lint error

* test: update TDP e2e tests

* fix: use pageChainId for filter

* fix: rename chainId

* fix: typecheck

* fix: chainId bug

* fix: chainId required fixes

* fix: bad merge in e2e test

* fix: remove unused test util

* fix: remove unnecessary variable

* fix: token defaults

* fix: address comments

* fix: address comments and fix tests

* fix: e2e test formatting, remove Maybe<>

* fix: remove unused variable

* fix: use feature flag for swap component on TDP

* fix: back button

* feat: copy review screen UI from widgetg

* fix: modal padding

* feat: add final detail row

* fix: remove widget comment

* fix: update unit tests

* fix: code style consistency

* fix: remove padding from AutoColumn

* fix: update snapshots

* fix: use semantic gaps

* fix: more px and gaps

* fix: design feedbacks

* fix: button radius in summary modal

* fix: design nits

* feat: update design of summary modal

* fix: font weight and vertical spacing

* fix: update snapshots

* fix: css nits

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: re-order functions

* wip: move approval to summary modal

* wip: not working

* feat: update permit2 e2e tests

* feat: tests passing

* fix: swap test

* fix: bad merge

* wip: move approval to summary modal

* wip: not working

* feat: PendingModalContent tests

* feat: useMaxAmountIn

* fix: bad merge

* fix: naming

* fix: modal flicker when refetching trade

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: remove step indicators when only one step

* feat: move content into PendingModalContent component

* fix: lint

* chore: merge

* fix: update tests for new modal

* feat: add l2 chain logo to modal

* feat: add unit test

* fix: correct modal state when moving between steps

* fix: correct modal state when moving between steps

* fix: proper error handling of user rejection of swap

* feat: update e2e test

* fix: typecheck

* feat: design updates, state updates

* fix: comments

* fix: code style improvements

* feat: require trade to be defined

* fix: remove extra props from ThemedTexts

* fix: one more trans

* fix: remove unused export

* feat: remove undefined checks and other fixes

* fix: update test

* fix: add missing dollar sign

* fix: remove null check and update test

* fix: remove max width from detail row value

* fix: remove isOpen prop

* fix: isopen

* feat: refactor approval flow into a hook

* fix: custom error type

* fix: testid fix

* fix: text colors

* fix: add comment

* wip: permit2 modal animations

* fix: entrance animations

* feat: step indicator transitions

* feat: icon aniamtions

* feat: fix spinner icon

* fix: re-organize new code

* fix: svg import

* fix: tradeMeaningfullyDiffers improvement and prepareFlow fix

* fix: address  comments

* fix: headerContent prop

* fix: change tooltip to external link

* feat: add comments explaining async state

* fix: test updates

* fix: nits

* fix: design nits

* fix: reduce nesting

* fix: address comments

* test: remove line from test for debugging

* fix: update tests

* fix: address  comments

* fix: comments

* fix: update tests

* fix: update tests

* fix: more nesting in test

* fix: update test

* fix: update e2e test

* fix: update error test

* fix: dont show loader unless onchain processing is happening

* fix: update designs and add comments

* fix: update content in test

* fix: update tests more

* fix: reorganize test code

* fix: mainnet loading indicator on last step

* fix: re-use opacity css code

* fix: testid issue with test

* fix: lint

* fix: modal height and css improvements

* fix: empty

* feat: fix help center link (#6621)

* test: swap flow cypress tests

* fix: use default parameter

* feat: use Swap Component on TDP

* feat: auto nav for TDP tokens

* chore: merge

* chore: merge

* chore: merge

* chore: merge

* fix: remove extra inputCurrency URL parsing logic

* fix: undo last change

* fix: pass expected chain id to swap component

* fix: search for default tokens on unconnected networks if needed

* test: e2e test for l2 token

* fix: delete irrelevant tests

* fix: address comments

* fix: lint error

* test: update TDP e2e tests

* fix: use pageChainId for filter

* fix: rename chainId

* fix: typecheck

* fix: chainId bug

* fix: chainId required fixes

* fix: bad merge in e2e test

* fix: remove unused test util

* fix: remove unnecessary variable

* fix: token defaults

* fix: address comments

* fix: address comments and fix tests

* fix: e2e test formatting, remove Maybe<>

* fix: remove unused variable

* fix: use feature flag for swap component on TDP

* fix: back button

* feat: copy review screen UI from widgetg

* fix: modal padding

* feat: add final detail row

* fix: remove widget comment

* fix: update unit tests

* fix: code style consistency

* fix: remove padding from AutoColumn

* fix: update snapshots

* fix: use semantic gaps

* fix: more px and gaps

* fix: design feedbacks

* fix: button radius in summary modal

* fix: design nits

* feat: update design of summary modal

* fix: font weight and vertical spacing

* fix: update snapshots

* fix: css nits

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: re-order functions

* wip: move approval to summary modal

* wip: not working

* feat: update permit2 e2e tests

* feat: tests passing

* fix: swap test

* fix: bad merge

* wip: move approval to summary modal

* wip: not working

* feat: PendingModalContent tests

* feat: useMaxAmountIn

* fix: bad merge

* fix: naming

* fix: modal flicker when refetching trade

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: remove step indicators when only one step

* feat: move content into PendingModalContent component

* fix: lint

* chore: merge

* fix: update tests for new modal

* feat: add l2 chain logo to modal

* feat: add unit test

* fix: correct modal state when moving between steps

* fix: correct modal state when moving between steps

* fix: proper error handling of user rejection of swap

* feat: update e2e test

* fix: typecheck

* feat: design updates, state updates

* fix: comments

* fix: code style improvements

* feat: require trade to be defined

* fix: remove extra props from ThemedTexts

* fix: one more trans

* fix: remove unused export

* feat: remove undefined checks and other fixes

* fix: update test

* fix: add missing dollar sign

* fix: remove null check and update test

* fix: remove max width from detail row value

* fix: remove isOpen prop

* fix: isopen

* feat: refactor approval flow into a hook

* fix: custom error type

* fix: testid fix

* fix: text colors

* fix: add comment

* wip: permit2 modal animations

* fix: entrance animations

* feat: step indicator transitions

* feat: icon aniamtions

* feat: fix spinner icon

* fix: re-organize new code

* fix: svg import

* fix: tradeMeaningfullyDiffers improvement and prepareFlow fix

* fix: address  comments

* fix: headerContent prop

* fix: change tooltip to external link

* feat: add comments explaining async state

* fix: test updates

* fix: nits

* fix: design nits

* fix: reduce nesting

* fix: address comments

* test: remove line from test for debugging

* fix: update tests

* fix: address  comments

* fix: comments

* fix: update tests

* fix: update tests

* fix: more nesting in test

* feat: correct help center article

* fix: update test

* fix: update e2e test

* fix: update error test

* fix: dont show loader unless onchain processing is happening

* fix: update designs and add comments

* fix: update content in test

* fix: update tests more

* fix: reorganize test code

* fix: mainnet loading indicator on last step

* fix: re-use opacity css code

* fix: testid issue with test

* fix: lint

* fix: modal height and css improvements

* fix: empty

* fix: design nits on summary view (#6623)

* fix: chainId required fixes

* fix: bad merge in e2e test

* fix: remove unused test util

* fix: remove unnecessary variable

* fix: token defaults

* fix: address comments

* fix: address comments and fix tests

* fix: e2e test formatting, remove Maybe<>

* fix: remove unused variable

* fix: use feature flag for swap component on TDP

* fix: back button

* feat: copy review screen UI from widgetg

* fix: modal padding

* feat: add final detail row

* fix: remove widget comment

* fix: update unit tests

* fix: code style consistency

* fix: remove padding from AutoColumn

* fix: update snapshots

* fix: use semantic gaps

* fix: more px and gaps

* fix: design feedbacks

* fix: button radius in summary modal

* fix: design nits

* feat: update design of summary modal

* fix: font weight and vertical spacing

* fix: update snapshots

* fix: css nits

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: re-order functions

* wip: move approval to summary modal

* wip: not working

* feat: update permit2 e2e tests

* feat: tests passing

* fix: swap test

* fix: bad merge

* wip: move approval to summary modal

* wip: not working

* feat: PendingModalContent tests

* feat: useMaxAmountIn

* fix: bad merge

* fix: naming

* fix: modal flicker when refetching trade

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: remove step indicators when only one step

* feat: move content into PendingModalContent component

* fix: lint

* chore: merge

* fix: update tests for new modal

* feat: add l2 chain logo to modal

* feat: add unit test

* fix: correct modal state when moving between steps

* fix: correct modal state when moving between steps

* fix: proper error handling of user rejection of swap

* feat: update e2e test

* fix: typecheck

* feat: design updates, state updates

* fix: comments

* fix: code style improvements

* feat: require trade to be defined

* fix: remove extra props from ThemedTexts

* fix: one more trans

* fix: remove unused export

* feat: remove undefined checks and other fixes

* fix: update test

* fix: add missing dollar sign

* fix: remove null check and update test

* fix: remove max width from detail row value

* fix: remove isOpen prop

* fix: isopen

* feat: refactor approval flow into a hook

* fix: custom error type

* fix: testid fix

* fix: text colors

* fix: add comment

* wip: permit2 modal animations

* fix: entrance animations

* feat: step indicator transitions

* feat: icon aniamtions

* feat: fix spinner icon

* fix: re-organize new code

* fix: svg import

* fix: tradeMeaningfullyDiffers improvement and prepareFlow fix

* fix: address  comments

* fix: headerContent prop

* fix: change tooltip to external link

* feat: add comments explaining async state

* fix: test updates

* fix: nits

* fix: design nits

* fix: reduce nesting

* fix: address comments

* test: remove line from test for debugging

* fix: update tests

* fix: address  comments

* fix: comments

* fix: update tests

* fix: update tests

* fix: more nesting in test

* feat: correct help center article

* fix: design nits on summary view

* fix: update test

* fix: update snapshots

* fix: update e2e test

* fix: etherscan link

* fix: update error test

* fix: dont show loader unless onchain processing is happening

* fix: update designs and add comments

* fix: update content in test

* fix: update tests more

* fix: test

* fix: reorganize test code

* fix: sentence case in one more test

* fix: mainnet loading indicator on last step

* fix: re-use opacity css code

* fix: testid issue with test

* fix: update copy

* fix: update strings in test

* fix: lint

* fix: modal height and css improvements

* fix: empty

* fix: padding on l2 badge

* fix: lint

* feat: log swap button click (#6654)

* build: disable scheduled releases (#6651)

* feat: [DetailsV2] Add Activity Chart Time Period Switcher (#6653)

* add endButton and new TimePeriodSwitcher component

* add snapshot testing

* add test file

* remove switcher from TabbedComponent

* update snapshots

* update describe

* update padding

* extra return

* as const notation

* update snapshots

* no more abs positioning

* cleanup tests and add dropdown test

* add divider line to tabbed component

* update design to match new specs

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>

* fix: reduce ETH amount on mainnet useUSDPrice request to 50 (#6642)

* feat: page wallet connect txn completed (#6655)

* feat: add page to wallet_connect_txn_completed event

* feat: unit test

* fix: test

* chore: cleaning up buy button states (#6618)

* fix: typecheck error in bagfooter (#6669)

* feat: increased debounce swap quote rate (#6666)

* feat: increased debounce swap quote time

* fix

* add basic test for initial useScreenSize

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
Co-authored-by: Mike Grabowski <grabbou@gmail.com>
Co-authored-by: eddie <66155195+just-toby@users.noreply.github.com>
Co-authored-by: Vignesh Mohankumar <me@vig.xyz>
Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com>
Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt>
Co-authored-by: Charles Bachmeier <charles@bachmeier.io>
Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
Co-authored-by: Jack Short <john.short.tj@gmail.com>
2023-06-02 09:40:04 -10:00
Tina
83f4b53f55 feat: Add Circle native Arbitrum USDC to common base tokens in token selector (#6680)
* add feature flag for usdc arbitrum

* add to feature flag modal
2023-06-02 14:05:41 -04:00
Brendan Wong
4b5e2f7f16 fix: polygon bridge link leading to error page (#6664)
* fix: polygon bridge link leading to error page

* fix: fix polygon bridge to send directly to POS bridge
2023-06-02 10:03:50 -07:00
eddie
0c5d915638 feat: upgrade conedison (#6688)
<!-- Your PR title must follow conventional commits: https://github.com/Uniswap/interface#pr-title -->

## Description
<!-- Summary of change, including motivation and context. -->
<!-- Use verb-driven language: "Fixes XYZ" instead of "This change fixes XYZ" -->
upgrades the coned package to get this change: https://github.com/Uniswap/conedison/pull/19


## Test plan

<!-- Delete this section if your change is not a bug fix. -->
### Reproducing the error

<!-- Include steps to reproduce the bug. -->
1. Try to sign a permit2 signature with trustwallet ios on optimism or arbitrum - it will fail without this change.

### QA (ie manual testing)

<!-- Include steps to test the change, ensuring no regression. -->
- [x] manually moved this change into `interface` and tested it , it works as a fallback
2023-06-02 09:32:56 -07:00
Tina
a03231d356 fix: Bug with flipping ura feature flag on/off in dev mode (#6686)
fix bug
2023-06-02 12:12:06 -04:00
Jack Short
72936322b3 feat: adding price impact modal (#6681) 2023-06-02 11:01:28 -04:00
Charles Bachmeier
1bc6eb9a23 feat: Add support for Sepolia (#6610)
* initial sepolia const setup

* uni sepolia

* add more consts for sepolia

* better comment

* upgrade ur sdk

* need to request BE add Ethereum sepolia to supported chains

* update weth address

* remove sepolia from defaults

* add tick lens addr

* add multicall && quoter

* use weth9 checksum

* successful wrap

* use supportedChainId over magic num

* upgrade default-token-list && deduplicate

* cleanup

* use checksum for usdc

* upgrade SOR

* placeholder setProperty

* comment cleanup

* add to anonymizeLink

* bump core-sdk

* deduplicate

* update infura fork block

* add comment

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-06-01 17:57:03 -07:00
Tina
8954aa792a feat: Use routing-api v2 behind feature flag (#6594)
* add unified-routing-api slice

* rename legacy -> legacyAPI

* deduplicate client params and ura params

* move shared functions into utils and rename comments for unified routing API

* use feature flag

* remove eslint ignore since the function is now being used

* add typing to args

* rename ura -> routing-api v2

* update trace name and comment

* rename variables

* lint
2023-06-01 16:52:03 -04:00
eddie
379437b720 fix: remove all references to expert mode (#6675) 2023-06-01 12:04:16 -07:00
Nate Wienert
02c0dee089 feat: hide logo on swap currency selector modal (and other areas that use CurrencyLogo) for unsupported currencies (#6659) 2023-06-01 08:00:02 -10:00
eddie
c55e1af101 fix: reset confirm trade modal state when chain switches (#6667)
<!-- Your PR title must follow conventional commits: https://github.com/Uniswap/interface#pr-title -->

## Description
<!-- Summary of change, including motivation and context. -->
<!-- Use verb-driven language: "Fixes XYZ" instead of "This change fixes XYZ" -->

Resets the swap component's local state when the chain changes, to fix Confirmation Modal behavior


<!-- Delete inapplicable lines: -->
_Linear ticket:_ https://linear.app/uniswap/issue/WEB-2161/wonky-swap-modal-behavior-after-switching-chains
_Slack thread:_ https://uniswapteam.slack.com/archives/C047U65H422/p1685467094162069?thread_ts=1685459249.400839&cid=C047U65H422


<!-- Delete this section if your change does not affect UI. -->
## Screen capture

### Before

https://github.com/Uniswap/interface/assets/66155195/115e243a-858b-490d-be9e-269174cc7561


### After

https://github.com/Uniswap/interface/assets/66155195/a47b3606-08ac-490f-abc8-01acf2423efb 



## Test plan

<!-- Delete this section if your change is not a bug fix. -->
### Reproducing the error

<!-- Include steps to reproduce the bug. -->
1. swap on a l2
2. via the metamask extension (or in whatever wallet), trigger a chain-change event (e.g. from optimism to mainnet)
    a. this does not repro if you change chains from within the app selector.
4. fill in the input details for a new trade (ideally with different tokens so you can notice the bug easily)
5. see that the Confirm Swap modal opens automatically when it shouldn't, and it has the wrong trade details

### QA (ie manual testing)

<!-- Include steps to test the change, ensuring no regression. -->
- [x] same steps as above, ensuring the modal behaves correctly 


#### Devices
<!-- If applicable, include different devices and screen sizes that may be affected, and how you've tested them. -->


### Automated testing

<!-- If N/A, check and note so it is obvious to your reviewers and does not show up as an incomplete task. -->
<!-- eg - [x] Unit test N/A -->
- [ ] Unit test
- [ ] Integration/E2E test
2023-06-01 10:02:37 -07:00
eddie
87cbd1ab38 fix: use ConfirmSwapModal in expert mode (#6673)
Fixes the swap flow for users who are still in expert mode  and need permit2 approvals for a token

### test plan

added e2e test for full permit2 flow with expert mode enabled. 

failing test without the change:
<img width="1394" alt="Screenshot 2023-05-31 at 2 24 12 PM" src="https://github.com/Uniswap/interface/assets/66155195/6a39e039-31b5-4bce-91d2-5e3ebc777378">


passing test with change in the CI of this PR
2023-05-31 14:52:04 -07:00
eddie
1090e97bb5 fix: update snapshots (#6672) 2023-05-31 16:37:45 -05:00
Nate Wienert
921c6b105f fix: prevent searchbar from overflowing the bottom of the window viewport (WEB-2099) (#6645)
fix: prevent searchbar from overflowing the bottom of the window viewport, add scrolling support for inner contents
2023-05-31 10:03:02 -10:00
Vignesh Mohankumar
bc08e9263d feat: increased debounce swap quote rate (#6666)
* feat: increased debounce swap quote time

* fix
2023-05-31 15:46:59 -04:00
Jack Short
8c8300a5de fix: typecheck error in bagfooter (#6669) 2023-05-31 13:50:22 -04:00
Jack Short
3f169adcf2 chore: cleaning up buy button states (#6618) 2023-05-31 11:34:49 -04:00
eddie
774368f325 feat: page wallet connect txn completed (#6655)
* feat: add page to wallet_connect_txn_completed event

* feat: unit test

* fix: test
2023-05-30 11:10:16 -07:00
Vignesh Mohankumar
f83f15d37a fix: reduce ETH amount on mainnet useUSDPrice request to 50 (#6642) 2023-05-30 12:30:16 -04:00
Charles Bachmeier
d9f1402576 feat: [DetailsV2] Add Activity Chart Time Period Switcher (#6653)
* add endButton and new TimePeriodSwitcher component

* add snapshot testing

* add test file

* remove switcher from TabbedComponent

* update snapshots

* update describe

* update padding

* extra return

* as const notation

* update snapshots

* no more abs positioning

* cleanup tests and add dropdown test

* add divider line to tabbed component

* update design to match new specs

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-05-26 16:06:36 -07:00
Zach Pomerantz
d81cb28010 build: disable scheduled releases (#6651) 2023-05-26 14:10:40 -07:00
eddie
b57a5d7ddb feat: log swap button click (#6654) 2023-05-26 10:13:28 -07:00
eddie
e2dd78fd0e fix: design nits on summary view (#6623)
* fix: chainId required fixes

* fix: bad merge in e2e test

* fix: remove unused test util

* fix: remove unnecessary variable

* fix: token defaults

* fix: address comments

* fix: address comments and fix tests

* fix: e2e test formatting, remove Maybe<>

* fix: remove unused variable

* fix: use feature flag for swap component on TDP

* fix: back button

* feat: copy review screen UI from widgetg

* fix: modal padding

* feat: add final detail row

* fix: remove widget comment

* fix: update unit tests

* fix: code style consistency

* fix: remove padding from AutoColumn

* fix: update snapshots

* fix: use semantic gaps

* fix: more px and gaps

* fix: design feedbacks

* fix: button radius in summary modal

* fix: design nits

* feat: update design of summary modal

* fix: font weight and vertical spacing

* fix: update snapshots

* fix: css nits

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: re-order functions

* wip: move approval to summary modal

* wip: not working

* feat: update permit2 e2e tests

* feat: tests passing

* fix: swap test

* fix: bad merge

* wip: move approval to summary modal

* wip: not working

* feat: PendingModalContent tests

* feat: useMaxAmountIn

* fix: bad merge

* fix: naming

* fix: modal flicker when refetching trade

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: remove step indicators when only one step

* feat: move content into PendingModalContent component

* fix: lint

* chore: merge

* fix: update tests for new modal

* feat: add l2 chain logo to modal

* feat: add unit test

* fix: correct modal state when moving between steps

* fix: correct modal state when moving between steps

* fix: proper error handling of user rejection of swap

* feat: update e2e test

* fix: typecheck

* feat: design updates, state updates

* fix: comments

* fix: code style improvements

* feat: require trade to be defined

* fix: remove extra props from ThemedTexts

* fix: one more trans

* fix: remove unused export

* feat: remove undefined checks and other fixes

* fix: update test

* fix: add missing dollar sign

* fix: remove null check and update test

* fix: remove max width from detail row value

* fix: remove isOpen prop

* fix: isopen

* feat: refactor approval flow into a hook

* fix: custom error type

* fix: testid fix

* fix: text colors

* fix: add comment

* wip: permit2 modal animations

* fix: entrance animations

* feat: step indicator transitions

* feat: icon aniamtions

* feat: fix spinner icon

* fix: re-organize new code

* fix: svg import

* fix: tradeMeaningfullyDiffers improvement and prepareFlow fix

* fix: address  comments

* fix: headerContent prop

* fix: change tooltip to external link

* feat: add comments explaining async state

* fix: test updates

* fix: nits

* fix: design nits

* fix: reduce nesting

* fix: address comments

* test: remove line from test for debugging

* fix: update tests

* fix: address  comments

* fix: comments

* fix: update tests

* fix: update tests

* fix: more nesting in test

* feat: correct help center article

* fix: design nits on summary view

* fix: update test

* fix: update snapshots

* fix: update e2e test

* fix: etherscan link

* fix: update error test

* fix: dont show loader unless onchain processing is happening

* fix: update designs and add comments

* fix: update content in test

* fix: update tests more

* fix: test

* fix: reorganize test code

* fix: sentence case in one more test

* fix: mainnet loading indicator on last step

* fix: re-use opacity css code

* fix: testid issue with test

* fix: update copy

* fix: update strings in test

* fix: lint

* fix: modal height and css improvements

* fix: empty

* fix: padding on l2 badge

* fix: lint
2023-05-25 15:57:13 -07:00
eddie
96d6e00ed6 feat: fix help center link (#6621)
* test: swap flow cypress tests

* fix: use default parameter

* feat: use Swap Component on TDP

* feat: auto nav for TDP tokens

* chore: merge

* chore: merge

* chore: merge

* chore: merge

* fix: remove extra inputCurrency URL parsing logic

* fix: undo last change

* fix: pass expected chain id to swap component

* fix: search for default tokens on unconnected networks if needed

* test: e2e test for l2 token

* fix: delete irrelevant tests

* fix: address comments

* fix: lint error

* test: update TDP e2e tests

* fix: use pageChainId for filter

* fix: rename chainId

* fix: typecheck

* fix: chainId bug

* fix: chainId required fixes

* fix: bad merge in e2e test

* fix: remove unused test util

* fix: remove unnecessary variable

* fix: token defaults

* fix: address comments

* fix: address comments and fix tests

* fix: e2e test formatting, remove Maybe<>

* fix: remove unused variable

* fix: use feature flag for swap component on TDP

* fix: back button

* feat: copy review screen UI from widgetg

* fix: modal padding

* feat: add final detail row

* fix: remove widget comment

* fix: update unit tests

* fix: code style consistency

* fix: remove padding from AutoColumn

* fix: update snapshots

* fix: use semantic gaps

* fix: more px and gaps

* fix: design feedbacks

* fix: button radius in summary modal

* fix: design nits

* feat: update design of summary modal

* fix: font weight and vertical spacing

* fix: update snapshots

* fix: css nits

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: re-order functions

* wip: move approval to summary modal

* wip: not working

* feat: update permit2 e2e tests

* feat: tests passing

* fix: swap test

* fix: bad merge

* wip: move approval to summary modal

* wip: not working

* feat: PendingModalContent tests

* feat: useMaxAmountIn

* fix: bad merge

* fix: naming

* fix: modal flicker when refetching trade

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: remove step indicators when only one step

* feat: move content into PendingModalContent component

* fix: lint

* chore: merge

* fix: update tests for new modal

* feat: add l2 chain logo to modal

* feat: add unit test

* fix: correct modal state when moving between steps

* fix: correct modal state when moving between steps

* fix: proper error handling of user rejection of swap

* feat: update e2e test

* fix: typecheck

* feat: design updates, state updates

* fix: comments

* fix: code style improvements

* feat: require trade to be defined

* fix: remove extra props from ThemedTexts

* fix: one more trans

* fix: remove unused export

* feat: remove undefined checks and other fixes

* fix: update test

* fix: add missing dollar sign

* fix: remove null check and update test

* fix: remove max width from detail row value

* fix: remove isOpen prop

* fix: isopen

* feat: refactor approval flow into a hook

* fix: custom error type

* fix: testid fix

* fix: text colors

* fix: add comment

* wip: permit2 modal animations

* fix: entrance animations

* feat: step indicator transitions

* feat: icon aniamtions

* feat: fix spinner icon

* fix: re-organize new code

* fix: svg import

* fix: tradeMeaningfullyDiffers improvement and prepareFlow fix

* fix: address  comments

* fix: headerContent prop

* fix: change tooltip to external link

* feat: add comments explaining async state

* fix: test updates

* fix: nits

* fix: design nits

* fix: reduce nesting

* fix: address comments

* test: remove line from test for debugging

* fix: update tests

* fix: address  comments

* fix: comments

* fix: update tests

* fix: update tests

* fix: more nesting in test

* feat: correct help center article

* fix: update test

* fix: update e2e test

* fix: update error test

* fix: dont show loader unless onchain processing is happening

* fix: update designs and add comments

* fix: update content in test

* fix: update tests more

* fix: reorganize test code

* fix: mainnet loading indicator on last step

* fix: re-use opacity css code

* fix: testid issue with test

* fix: lint

* fix: modal height and css improvements

* fix: empty
2023-05-25 15:40:42 -07:00
eddie
dd29c59238 feat: permit2 animations WEB-2036 (#6590)
* test: swap flow cypress tests

* fix: use default parameter

* feat: use Swap Component on TDP

* feat: auto nav for TDP tokens

* chore: merge

* chore: merge

* chore: merge

* chore: merge

* fix: remove extra inputCurrency URL parsing logic

* fix: undo last change

* fix: pass expected chain id to swap component

* fix: search for default tokens on unconnected networks if needed

* test: e2e test for l2 token

* fix: delete irrelevant tests

* fix: address comments

* fix: lint error

* test: update TDP e2e tests

* fix: use pageChainId for filter

* fix: rename chainId

* fix: typecheck

* fix: chainId bug

* fix: chainId required fixes

* fix: bad merge in e2e test

* fix: remove unused test util

* fix: remove unnecessary variable

* fix: token defaults

* fix: address comments

* fix: address comments and fix tests

* fix: e2e test formatting, remove Maybe<>

* fix: remove unused variable

* fix: use feature flag for swap component on TDP

* fix: back button

* feat: copy review screen UI from widgetg

* fix: modal padding

* feat: add final detail row

* fix: remove widget comment

* fix: update unit tests

* fix: code style consistency

* fix: remove padding from AutoColumn

* fix: update snapshots

* fix: use semantic gaps

* fix: more px and gaps

* fix: design feedbacks

* fix: button radius in summary modal

* fix: design nits

* feat: update design of summary modal

* fix: font weight and vertical spacing

* fix: update snapshots

* fix: css nits

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: re-order functions

* wip: move approval to summary modal

* wip: not working

* feat: update permit2 e2e tests

* feat: tests passing

* fix: swap test

* fix: bad merge

* wip: move approval to summary modal

* wip: not working

* feat: PendingModalContent tests

* feat: useMaxAmountIn

* fix: bad merge

* fix: naming

* fix: modal flicker when refetching trade

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: remove step indicators when only one step

* feat: move content into PendingModalContent component

* fix: lint

* chore: merge

* fix: update tests for new modal

* feat: add l2 chain logo to modal

* feat: add unit test

* fix: correct modal state when moving between steps

* fix: correct modal state when moving between steps

* fix: proper error handling of user rejection of swap

* feat: update e2e test

* fix: typecheck

* feat: design updates, state updates

* fix: comments

* fix: code style improvements

* feat: require trade to be defined

* fix: remove extra props from ThemedTexts

* fix: one more trans

* fix: remove unused export

* feat: remove undefined checks and other fixes

* fix: update test

* fix: add missing dollar sign

* fix: remove null check and update test

* fix: remove max width from detail row value

* fix: remove isOpen prop

* fix: isopen

* feat: refactor approval flow into a hook

* fix: custom error type

* fix: testid fix

* fix: text colors

* fix: add comment

* wip: permit2 modal animations

* fix: entrance animations

* feat: step indicator transitions

* feat: icon aniamtions

* feat: fix spinner icon

* fix: re-organize new code

* fix: svg import

* fix: tradeMeaningfullyDiffers improvement and prepareFlow fix

* fix: address  comments

* fix: headerContent prop

* fix: change tooltip to external link

* feat: add comments explaining async state

* fix: test updates

* fix: nits

* fix: design nits

* fix: reduce nesting

* fix: address comments

* test: remove line from test for debugging

* fix: update tests

* fix: address  comments

* fix: comments

* fix: update tests

* fix: update tests

* fix: more nesting in test

* fix: update test

* fix: update e2e test

* fix: update error test

* fix: dont show loader unless onchain processing is happening

* fix: update designs and add comments

* fix: update content in test

* fix: update tests more

* fix: reorganize test code

* fix: mainnet loading indicator on last step

* fix: re-use opacity css code

* fix: testid issue with test

* fix: lint

* fix: modal height and css improvements

* fix: empty
2023-05-25 15:25:07 -07:00
eddie
8c2a0f1905 feat: update content in Swap Submission Modal (#6577)
* test: swap flow cypress tests

* fix: use default parameter

* feat: use Swap Component on TDP

* feat: auto nav for TDP tokens

* chore: merge

* chore: merge

* chore: merge

* chore: merge

* fix: remove extra inputCurrency URL parsing logic

* fix: undo last change

* fix: pass expected chain id to swap component

* fix: search for default tokens on unconnected networks if needed

* test: e2e test for l2 token

* fix: delete irrelevant tests

* fix: address comments

* fix: lint error

* test: update TDP e2e tests

* fix: use pageChainId for filter

* fix: rename chainId

* fix: typecheck

* fix: chainId bug

* fix: chainId required fixes

* fix: bad merge in e2e test

* fix: remove unused test util

* fix: remove unnecessary variable

* fix: token defaults

* fix: address comments

* fix: address comments and fix tests

* fix: e2e test formatting, remove Maybe<>

* fix: remove unused variable

* fix: use feature flag for swap component on TDP

* fix: back button

* feat: copy review screen UI from widgetg

* fix: modal padding

* feat: add final detail row

* fix: remove widget comment

* fix: update unit tests

* fix: code style consistency

* fix: remove padding from AutoColumn

* fix: update snapshots

* fix: use semantic gaps

* fix: more px and gaps

* fix: design feedbacks

* fix: button radius in summary modal

* fix: design nits

* feat: update design of summary modal

* fix: font weight and vertical spacing

* fix: update snapshots

* fix: css nits

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: re-order functions

* wip: move approval to summary modal

* wip: not working

* feat: update permit2 e2e tests

* feat: tests passing

* fix: swap test

* fix: bad merge

* wip: move approval to summary modal

* wip: not working

* feat: PendingModalContent tests

* feat: useMaxAmountIn

* fix: bad merge

* fix: naming

* fix: modal flicker when refetching trade

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: remove step indicators when only one step

* feat: move content into PendingModalContent component

* fix: lint

* chore: merge

* fix: update tests for new modal

* feat: add l2 chain logo to modal

* feat: add unit test

* fix: correct modal state when moving between steps

* fix: correct modal state when moving between steps

* fix: proper error handling of user rejection of swap

* feat: update e2e test

* fix: typecheck

* feat: design updates, state updates

* fix: comments

* fix: code style improvements

* feat: require trade to be defined

* fix: remove extra props from ThemedTexts

* fix: one more trans

* fix: remove unused export

* feat: remove undefined checks and other fixes

* fix: update test

* fix: add missing dollar sign

* fix: remove null check and update test

* fix: remove max width from detail row value

* fix: remove isOpen prop

* fix: isopen

* feat: refactor approval flow into a hook

* fix: custom error type

* fix: testid fix

* fix: text colors

* fix: add comment

* fix: tradeMeaningfullyDiffers improvement and prepareFlow fix

* fix: address  comments

* fix: headerContent prop

* fix: change tooltip to external link

* feat: add comments explaining async state

* fix: test updates

* fix: nits

* fix: reduce nesting

* fix: address comments

* test: remove line from test for debugging

* fix: update tests

* fix: address  comments

* fix: comments

* fix: update tests

* fix: update tests

* fix: more nesting in test

* fix: update test

* fix: update e2e test

* fix: update error test

* fix: update content in test

* fix: reorganize test code
2023-05-25 14:57:04 -07:00
eddie
682fba219d feat: swap rejection error handling (#6576)
* test: swap flow cypress tests

* fix: use default parameter

* feat: use Swap Component on TDP

* feat: auto nav for TDP tokens

* chore: merge

* chore: merge

* chore: merge

* chore: merge

* fix: remove extra inputCurrency URL parsing logic

* fix: undo last change

* fix: pass expected chain id to swap component

* fix: search for default tokens on unconnected networks if needed

* test: e2e test for l2 token

* fix: delete irrelevant tests

* fix: address comments

* fix: lint error

* test: update TDP e2e tests

* fix: use pageChainId for filter

* fix: rename chainId

* fix: typecheck

* fix: chainId bug

* fix: chainId required fixes

* fix: bad merge in e2e test

* fix: remove unused test util

* fix: remove unnecessary variable

* fix: token defaults

* fix: address comments

* fix: address comments and fix tests

* fix: e2e test formatting, remove Maybe<>

* fix: remove unused variable

* fix: use feature flag for swap component on TDP

* fix: back button

* feat: copy review screen UI from widgetg

* fix: modal padding

* feat: add final detail row

* fix: remove widget comment

* fix: update unit tests

* fix: code style consistency

* fix: remove padding from AutoColumn

* fix: update snapshots

* fix: use semantic gaps

* fix: more px and gaps

* fix: design feedbacks

* fix: button radius in summary modal

* fix: design nits

* feat: update design of summary modal

* fix: font weight and vertical spacing

* fix: update snapshots

* fix: css nits

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: re-order functions

* wip: move approval to summary modal

* wip: not working

* feat: update permit2 e2e tests

* feat: tests passing

* fix: swap test

* fix: bad merge

* wip: move approval to summary modal

* wip: not working

* feat: PendingModalContent tests

* feat: useMaxAmountIn

* fix: bad merge

* fix: naming

* fix: modal flicker when refetching trade

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: remove step indicators when only one step

* feat: move content into PendingModalContent component

* fix: lint

* chore: merge

* fix: update tests for new modal

* feat: add l2 chain logo to modal

* feat: add unit test

* fix: correct modal state when moving between steps

* fix: correct modal state when moving between steps

* fix: proper error handling of user rejection of swap

* feat: update e2e test

* fix: typecheck

* fix: comments

* fix: code style improvements

* feat: require trade to be defined

* fix: remove extra props from ThemedTexts

* fix: one more trans

* fix: remove unused export

* feat: remove undefined checks and other fixes

* fix: update test

* fix: add missing dollar sign

* fix: remove null check and update test

* fix: remove max width from detail row value

* fix: remove isOpen prop

* fix: isopen

* feat: refactor approval flow into a hook

* fix: custom error type

* fix: testid fix

* fix: add comment

* fix: tradeMeaningfullyDiffers improvement and prepareFlow fix

* fix: address  comments

* fix: headerContent prop

* feat: add comments explaining async state

* fix: test updates

* fix: nits

* fix: reduce nesting

* fix: address comments

* test: remove line from test for debugging

* fix: update tests

* fix: address  comments

* fix: update tests

* fix: more nesting in test

* fix: update test

* fix: update e2e test

* fix: update error test

* fix: reorganize test code
2023-05-25 14:56:37 -07:00
eddie
0f5e871054 feat: add l2 chain logo to modal (#6575)
* test: swap flow cypress tests

* fix: use default parameter

* feat: use Swap Component on TDP

* feat: auto nav for TDP tokens

* chore: merge

* chore: merge

* chore: merge

* chore: merge

* fix: remove extra inputCurrency URL parsing logic

* fix: undo last change

* fix: pass expected chain id to swap component

* fix: search for default tokens on unconnected networks if needed

* test: e2e test for l2 token

* fix: delete irrelevant tests

* fix: address comments

* fix: lint error

* test: update TDP e2e tests

* fix: use pageChainId for filter

* fix: rename chainId

* fix: typecheck

* fix: chainId bug

* fix: chainId required fixes

* fix: bad merge in e2e test

* fix: remove unused test util

* fix: remove unnecessary variable

* fix: token defaults

* fix: address comments

* fix: address comments and fix tests

* fix: e2e test formatting, remove Maybe<>

* fix: remove unused variable

* fix: use feature flag for swap component on TDP

* fix: back button

* feat: copy review screen UI from widgetg

* fix: modal padding

* feat: add final detail row

* fix: remove widget comment

* fix: update unit tests

* fix: code style consistency

* fix: remove padding from AutoColumn

* fix: update snapshots

* fix: use semantic gaps

* fix: more px and gaps

* fix: design feedbacks

* fix: button radius in summary modal

* fix: design nits

* feat: update design of summary modal

* fix: font weight and vertical spacing

* fix: update snapshots

* fix: css nits

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: re-order functions

* wip: move approval to summary modal

* wip: not working

* feat: update permit2 e2e tests

* feat: tests passing

* fix: swap test

* fix: bad merge

* wip: move approval to summary modal

* wip: not working

* feat: PendingModalContent tests

* feat: useMaxAmountIn

* fix: bad merge

* fix: naming

* fix: modal flicker when refetching trade

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: remove step indicators when only one step

* feat: move content into PendingModalContent component

* fix: lint

* chore: merge

* fix: update tests for new modal

* feat: add l2 chain logo to modal

* feat: add unit test

* fix: correct modal state when moving between steps

* fix: comments

* fix: code style improvements

* feat: require trade to be defined

* fix: remove extra props from ThemedTexts

* fix: one more trans

* fix: remove unused export

* feat: remove undefined checks and other fixes

* fix: update test

* fix: add missing dollar sign

* fix: remove null check and update test

* fix: remove max width from detail row value

* fix: remove isOpen prop

* fix: isopen

* feat: refactor approval flow into a hook

* fix: testid fix

* fix: tradeMeaningfullyDiffers improvement and prepareFlow fix

* fix: address  comments

* fix: headerContent prop

* feat: add comments explaining async state

* fix: test updates

* fix: nits

* fix: reduce nesting

* fix: address comments

* test: remove line from test for debugging

* fix: update tests

* fix: address  comments

* fix: update tests

* fix: more nesting in test

* fix: update test

* fix: reorganize test code
2023-05-25 14:14:35 -07:00
eddie
07527bab26 test: permit2 flow component tests (#6551)
* test: swap flow cypress tests

* fix: use default parameter

* feat: use Swap Component on TDP

* feat: auto nav for TDP tokens

* chore: merge

* chore: merge

* chore: merge

* chore: merge

* fix: remove extra inputCurrency URL parsing logic

* fix: undo last change

* fix: pass expected chain id to swap component

* fix: search for default tokens on unconnected networks if needed

* test: e2e test for l2 token

* fix: delete irrelevant tests

* fix: address comments

* fix: lint error

* test: update TDP e2e tests

* fix: use pageChainId for filter

* fix: rename chainId

* fix: typecheck

* fix: chainId bug

* fix: chainId required fixes

* fix: bad merge in e2e test

* fix: remove unused test util

* fix: remove unnecessary variable

* fix: token defaults

* fix: address comments

* fix: address comments and fix tests

* fix: e2e test formatting, remove Maybe<>

* fix: remove unused variable

* fix: use feature flag for swap component on TDP

* fix: back button

* feat: copy review screen UI from widgetg

* fix: modal padding

* feat: add final detail row

* fix: remove widget comment

* fix: update unit tests

* fix: code style consistency

* fix: remove padding from AutoColumn

* fix: update snapshots

* fix: use semantic gaps

* fix: more px and gaps

* fix: design feedbacks

* fix: button radius in summary modal

* fix: design nits

* feat: update design of summary modal

* fix: font weight and vertical spacing

* fix: update snapshots

* fix: css nits

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: re-order functions

* wip: move approval to summary modal

* wip: not working

* feat: update permit2 e2e tests

* feat: tests passing

* fix: swap test

* fix: bad merge

* wip: move approval to summary modal

* wip: not working

* feat: PendingModalContent tests

* feat: useMaxAmountIn

* fix: bad merge

* fix: naming

* fix: modal flicker when refetching trade

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: remove step indicators when only one step

* feat: move content into PendingModalContent component

* fix: lint

* chore: merge

* fix: update tests for new modal

* fix: correct modal state when moving between steps

* fix: comments

* fix: code style improvements

* feat: require trade to be defined

* fix: remove extra props from ThemedTexts

* fix: one more trans

* fix: remove unused export

* feat: remove undefined checks and other fixes

* fix: update test

* fix: add missing dollar sign

* fix: remove null check and update test

* fix: remove max width from detail row value

* fix: remove isOpen prop

* fix: isopen

* feat: refactor approval flow into a hook

* fix: testid fix

* fix: tradeMeaningfullyDiffers improvement and prepareFlow fix

* fix: address  comments

* feat: add comments explaining async state

* fix: test updates

* fix: nits

* fix: reduce nesting

* fix: address comments

* test: remove line from test for debugging

* fix: update tests

* fix: update tests

* fix: more nesting in test

* fix: update test

* fix: reorganize test code
2023-05-25 14:13:55 -07:00
eddie
7934777fa2 feat: permit2 flow updates (#6538)
* test: swap flow cypress tests

* fix: use default parameter

* feat: use Swap Component on TDP

* feat: auto nav for TDP tokens

* chore: merge

* chore: merge

* chore: merge

* chore: merge

* fix: remove extra inputCurrency URL parsing logic

* fix: undo last change

* fix: pass expected chain id to swap component

* fix: search for default tokens on unconnected networks if needed

* test: e2e test for l2 token

* fix: delete irrelevant tests

* fix: address comments

* fix: lint error

* test: update TDP e2e tests

* fix: use pageChainId for filter

* fix: rename chainId

* fix: typecheck

* fix: chainId bug

* fix: chainId required fixes

* fix: bad merge in e2e test

* fix: remove unused test util

* fix: remove unnecessary variable

* fix: token defaults

* fix: address comments

* fix: address comments and fix tests

* fix: e2e test formatting, remove Maybe<>

* fix: remove unused variable

* fix: use feature flag for swap component on TDP

* fix: back button

* feat: copy review screen UI from widgetg

* fix: modal padding

* feat: add final detail row

* fix: remove widget comment

* fix: update unit tests

* fix: code style consistency

* fix: remove padding from AutoColumn

* fix: update snapshots

* fix: use semantic gaps

* fix: more px and gaps

* fix: design feedbacks

* fix: button radius in summary modal

* fix: design nits

* feat: update design of summary modal

* fix: font weight and vertical spacing

* fix: update snapshots

* fix: css nits

* fix: modal flicker when refetching trade

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: remove step indicators when only one step

* feat: move content into PendingModalContent component

* fix: lint

* fix: correct modal state when moving between steps

* fix: comments

* fix: code style improvements

* feat: require trade to be defined

* fix: remove extra props from ThemedTexts

* fix: one more trans

* fix: remove unused export

* feat: remove undefined checks and other fixes

* fix: update test

* fix: add missing dollar sign

* fix: remove null check and update test

* fix: remove max width from detail row value

* fix: remove isOpen prop

* fix: isopen

* feat: refactor approval flow into a hook

* fix: tradeMeaningfullyDiffers improvement and prepareFlow fix

* fix: address  comments

* feat: add comments explaining async state

* fix: nits

* fix: address comments

* feat: permit2 e2e tests (#6541)

* wip: move approval to summary modal

* wip: not working

* feat: working

* fix: fix flow

* feat: simplify states and build new modal UI

* feat: todos and differs fix

* feat: update tx status modal

* feat: split up approve and permit

* feat: error state

* feat: update success and error states

* feat: undo changes to TxConfirmationModal

* feat: re-order functions

* wip: move approval to summary modal

* wip: not working

* feat: update permit2 e2e tests

* feat: tests passing

* fix: swap test

* fix: bad merge

* chore: merge

* fix: update tests for new modal

* fix: testid fix

* fix: test updates

* fix: reduce nesting

* test: remove line from test for debugging

* fix: update tests

* fix: more nesting in test

* fix: update test

* fix: reorganize test code
2023-05-25 13:49:27 -07:00
Zach Pomerantz
2415a1e3cd test(e2e): improve hardhat configuration (#6650)
build: cache hardhat cache
2023-05-25 11:53:39 -07:00
Nate Wienert
1ba796a895 build: add vscode settings for default formatter (#6644)
build: add vscode settings for default formatter to be dbaeumer.vscode-eslint
2023-05-25 08:22:51 -10:00
Zach Pomerantz
4446eb9b84 fix: include sw metric with web vitals (#6646) 2023-05-25 10:12:20 -07:00
Jordan Frankfurt
d23b6e5da6 fix: remove app advert on mobile safari (#6630)
Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt>
2023-05-25 10:36:57 -05:00
Zach Pomerantz
44c355c7f0 build: caching i18n extractor (#6619)
* fix: do not attempt to cache i18n:extract

* fix: i18n extraction

* docs: improve comments
2023-05-24 14:23:40 -07:00
Vignesh Mohankumar
e4a9764a12 fix: increase useBestTrade debounce time (#6631)
* fix: increase useBestTrade debounce time

* reduce

* increase

* 350

* fix
2023-05-24 14:44:18 -04:00
Mike Grabowski
303fa15240 feat: show affordance in swap UI when we can't fetch usd quote (#6622)
* initial commit:

* add todo to linear
2023-05-24 22:32:53 +04:00
eddie
d180aef306 fix: no-undefined-or in object field types (#6640) 2023-05-24 11:31:40 -07:00
Mike Grabowski
c07c401189 feat: add animation to Settings menu (#6617)
* feat: add price impact back

* chore: update tes tname

* chore: update snapshot for price impact

* fix

* fix

* update snapshot after rebase

* update snapshot

* chore: finish

* chore: remove snapshot

* feat: add test matcher

* cleanup

* chore: add animation test

* add comment

* update comment
2023-05-24 22:02:59 +04:00
Zach Pomerantz
65d91eb363 build: use repository slack secret (#6639) 2023-05-24 13:15:28 -04:00
Jordan Frankfurt
bd4042aa16 chore: update pr template (#6634)
Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt>
2023-05-23 14:53:07 -07:00
github-actions[bot]
1dcafd2f2d chore(i18n): new Crowdin translations (#6215)
* chore(i18n): synchronize translations from crowdin [skip ci]

* chore: trigger actions

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-05-23 14:39:58 -07:00
Jordan Frankfurt
66fcdb4465 feat: improve yarn prepare scripts (#6609)
* feat: improve yarn prepare scripts

* reset yarn.lock to main

* pr feedback

* Update scripts/prepare.js

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update scripts/prepare.js

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update scripts/prepare.js

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update scripts/prepare.js

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update scripts/prepare.js

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update scripts/prepare.js

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update scripts/prepare.js

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* pr feedback

* switch to using concurrently

* yarn dedupe

---------

Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt>
Co-authored-by: Jordan Frankfurt <jordan@corn-jordan-949.lan>
Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-05-23 16:07:05 -05:00
Jack Short
e398e8b950 fix: allow unsupported chain in pwat (#6629)
chore: allow unsupported chain in pwat
2023-05-23 13:36:28 -04:00
Tina
6424fdfbcd fix: Simplify event logging for SWAP_QUOTE_RECEIVED (#6628)
* simplify event logging

* remove unused function parameter
2023-05-23 11:06:18 -04:00
eddie
95814e3271 fix: prevent race condition for swap state (#6624) 2023-05-22 15:57:17 -07:00
Jack Short
caa2524e27 feat: [DetailsV2] instant buy (#6599)
* initial impl

* removing isopen change

* stopping refetching

* shared button

* pending animiation

* updating shared

* updating snapshots

* adding disabled state

* isLoading in hook

* pulling out ternary

* removing fragment

* separate file for offer button

* fixing price diff check

* remove unnecessary export

* changing name to useBuyAssetCallback
2023-05-22 18:28:48 -04:00
Zach Pomerantz
d28a4b34cd fix: do not attempt to cache i18n:extract (#6616) 2023-05-22 14:03:11 -07:00
cartcrom
f3a80c6272 feat: special case arb search (#6584)
* feat: special case arb search

* fix: check both current and existing token
2023-05-22 12:40:46 -04:00
Zach Pomerantz
b89ee36448 test(e2e): attempt to de-flake (#6611)
* test(e2e): improve memory mgmt

* test(e2e): record flakes

* test(e2e): simplify tests in attempt to de-flake

* test(e2e): more simplification

* test(e2e): disable transaction popup checks

* test(e2e): better wrap assertions

* test(e2e): always assert both inputs
2023-05-22 09:02:54 -07:00
Vignesh Mohankumar
fbc55db937 chore: remove chunkResponseStatus tag (#6586)
* chore: remove chunkResponseStatus tag

* lint
2023-05-21 17:25:58 -04:00
Jordan Frankfurt
835c62acfa fix: use ephemeral props for styled component (#6607)
* fix: use ephemeral props for styled component

* add
2023-05-20 16:55:37 -05:00
Zach Pomerantz
8fe7c7a0a7 build: notify from notify/test (#6597)
* build: notify from notify/test

* debug

* debug2

* revert debugs
2023-05-19 12:24:11 -07:00
Tina
41113e6e41 fix: Use client side router only for price fetching (#6604)
use client side router only for price fetching
2023-05-19 13:35:29 -04:00
Mike Grabowski
58b25d29a9 feat: expand settings by default when custom values are set (#6603)
feat: expand by default
2023-05-19 21:35:02 +04:00
Zach Pomerantz
a2db3e2719 test(e2e): configure Cypress to post PR status comments (#6591) 2023-05-19 06:32:42 -07:00
Mike Grabowski
b62f9066a7 fix: add price impact back (#6581)
* feat: add price impact back

* chore: update tes tname

* chore: update snapshot for price impact

* fix

* fix

* update snapshot after rebase

* update snapshot
2023-05-19 09:24:06 +04:00
Zach Pomerantz
258f22e037 build: continue-on-error for slack notifications (#6600) 2023-05-18 15:30:43 -07:00
Zach Pomerantz
38b306a80f build: pin github-tag-action (#6598) 2023-05-18 15:30:24 -07:00
Zach Pomerantz
9050f09bfe build: notify from notify/releases (#6596) 2023-05-18 15:30:03 -07:00
Zach Pomerantz
77d46c361a test(e2e): de-flake wrap (#6589)
* test(e2e): mv swap to dir

* test(e2e): split swap/wrap/errors

* test(e2e): de-flake wrap
2023-05-18 13:47:15 -07:00
Charles Bachmeier
4fb48bdd1f fix: only request 1 listing on NFTDetails page (#6602)
only request 1 listing

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-05-18 13:35:01 -07:00
cartcrom
cf2b6bf568 fix: portfolio balances after switching accounts (#6527)
* fix: handle portfolio staleness upon account change

* fix: only consider current account for tx updates

* test: add e2e test for account switching

* fix: remove unnused data-testid

* fix: added todo comment

* refactor: move test into existing folder

* fix: add account to dependency array

* todo: tx reducer

* test: update cypress config to pass in env variables

* fix: undo unintended change

* fix: use process.env

* fix: use regex instead of env
2023-05-18 16:32:35 -04:00
eddie
03095f4e48 feat: add feature flag for URA (#6593) 2023-05-18 10:14:18 -07:00
lavalamp
b2966f8d29 ci: Fix YAML spacing (#6592)
Fix YAML spacing
2023-05-18 09:43:02 -07:00
Charles Bachmeier
ef6d1f20ed feat: [DetailsV2] Show data page header when nft scrolled out of view (#6585)
* show data page header when nft scrolled out of view

* add new snapshot test

* useRef for observer

* add comment

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-05-18 09:41:04 -07:00
lavalamp
10b156ff2b ci: Final CI fixes pass (#6556)
* Final CI fixes pass

* Change cut to awk

* Remove workflow_dispatch

* Start, success, failure messges

* Deploy from main and add comment

* Update .github/workflows/2-deploy-to-staging.yml

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update jobs to have correct comments, simplification in prod

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-05-17 14:29:06 -06:00
Zach Pomerantz
146c5f29cf feat: only pre-cache the document (#6580)
* test(e2e): de-flake service-worker

* feat: rm stale cache storage

* fix: put not del

* fix: staging and test

* test: include staging

* fix: log

* test: rm console.log

* fix: unregister before

* test: deflake by restoring state afterwards
2023-05-17 12:10:28 -07:00
Zach Pomerantz
66a3475bf6 test(e2e): split swap tests (#6587)
* test(e2e): mv swap to dir

* test(e2e): split swap/wrap/errors
2023-05-17 09:43:52 -07:00
Zach Pomerantz
f6c393b016 test(e2e): de-flake activity-history (#6583) 2023-05-17 09:43:26 -07:00
cartcrom
15f8d34320 fix: update nonce deduplication logic (#6588)
* fix: update nonce-deduplication logic
* lint
2023-05-16 21:28:19 -04:00
eddie
504e09d3dc feat: new review design (#6451)
* test: swap flow cypress tests

* fix: use default parameter

* feat: use Swap Component on TDP

* feat: auto nav for TDP tokens

* chore: merge

* chore: merge

* chore: merge

* chore: merge

* fix: remove extra inputCurrency URL parsing logic

* fix: undo last change

* fix: pass expected chain id to swap component

* fix: search for default tokens on unconnected networks if needed

* test: e2e test for l2 token

* fix: delete irrelevant tests

* fix: address comments

* fix: lint error

* test: update TDP e2e tests

* fix: use pageChainId for filter

* fix: rename chainId

* fix: typecheck

* fix: chainId bug

* fix: chainId required fixes

* fix: bad merge in e2e test

* fix: remove unused test util

* fix: remove unnecessary variable

* fix: token defaults

* fix: address comments

* fix: address comments and fix tests

* fix: e2e test formatting, remove Maybe<>

* fix: remove unused variable

* fix: use feature flag for swap component on TDP

* fix: back button

* feat: copy review screen UI from widgetg

* fix: modal padding

* feat: add final detail row

* fix: remove widget comment

* fix: update unit tests

* fix: code style consistency

* fix: remove padding from AutoColumn

* fix: update snapshots

* fix: use semantic gaps

* fix: more px and gaps

* fix: design feedbacks

* fix: button radius in summary modal

* fix: design nits

* feat: update design of summary modal

* fix: font weight and vertical spacing

* fix: update snapshots

* fix: css nits

* fix: modal flicker when refetching trade

* fix: comments

* fix: code style improvements

* feat: require trade to be defined

* fix: remove extra props from ThemedTexts

* fix: one more trans

* fix: remove unused export

* feat: remove undefined checks and other fixes

* fix: update test

* fix: add missing dollar sign

* fix: remove null check and update test

* fix: remove max width from detail row value

* fix: remove isOpen prop

* fix: isopen
2023-05-16 15:15:30 -07:00
Vignesh Mohankumar
1f755e8b0d feat: add retry logic for dynamic imports (#6512)
* feat: add retry logic for lazy import

* try again

* add tests

* refactor: moves retry helper to subfolder

* missing-files

* fix

* doc comment

* tsdoc

* fake timers

* fix

* add eslint rule

* try again?

* try again?

* only dynamic

* try again

* try again

* IT WORKS

* add retry

* fix

* add test

* warn -> error

* lint

* lint

* lint

* add back cache

* rm test

* try again

* real timers but really short intervals

* try returning the promise?

* try returning the promise?

* try this package

* retry

* Update src/utils/retry.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update rules/enforce-retry-on-import.js

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update rules/enforce-retry-on-import.js

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* eslint_rules

* test fixes

* name

* fix

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-05-16 16:53:22 -04:00
Vignesh Mohankumar
f45a7f921b fix: handle switchChain failure in swap (#6507)
* fix: handle switchChain failure in swap

* comment

* fix
2023-05-16 16:47:13 -04:00
Vignesh Mohankumar
29db61ff90 fix: filter error caused by missing meta tags (#6546)
* fix: filter error caused by missing meta tags

* fix
2023-05-16 16:40:25 -04:00
Tina
8431ad9161 chore: Refactor swap request flow (#6499)
* Refactor swap quote flow with widget logic

* remove console logging

* add ignore path for serialization check and pass in native currencies for client side routing

* apply stashed changes

* revert node version change

* remove TODO comment because maybe no longer relevant

* update unit tests

* wip: add snapshot test

* add snapshot test for gas estimate badge

* address PR comments: rename variables, fix client side router initialization

* update Trade type

* add TODO comment about isExactInput util

* change | undefined convention to ?

* PR comments

* update type

* remove client side initialization logic and replace with TODO

* use routing-api for price fetching trades too

* remove QuoteType.Initialized
2023-05-16 16:33:46 -04:00
Vignesh Mohankumar
fd1aded517 fix: remove trailing slash from request url (#6542)
* fix: remove trailing slash from request url

* moves cast

* {}
2023-05-16 12:36:24 -04:00
Vignesh Mohankumar
27ad7cbd41 test: move all tests to beforeSend (#6513)
* beforeSend tests

* fix

* refactor: filterKnownErrors -> shouldRejectError (#6547)

* refactor: filterKnownErrors -> shouldRejectError

* no unknown

* comments
2023-05-16 12:36:17 -04:00
Joshua DeCristi
01e5de436a fix: "Minimum output" should be "Maximum output" when trade is Exact Output (#6565)
* fix: minimum output should be showing maximum input when trade type is exact output

* fix: test for minimum output should be showing maximum input when trade type is exact output

---------

Co-authored-by: Josh DeCristi <joshdecristi@Joshs-MacBook-Pro.local>
2023-05-16 12:07:39 -04:00
Charles Bachmeier
fd5aa1b51e fix: use padding component (#6579)
* fix: rm unused const

* use component

* update snapshot

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-05-16 08:56:51 -07:00
Mike Grabowski
a6e1a7e6d9 feat: add slippage warning to MenuButton (#6548)
* feat: initial commit

* chore: add unit tests

* chore: move menubutton to sep. component

* chore: simplify styles and add real focused state

* chore: fix tests + some other tweaks

* chore: rename

* test: add snapshot tests

* tweaks
2023-05-16 11:41:14 +04:00
Jack Short
629fe2c144 feat: [DetailsV2] trait bubbles (#6552) 2023-05-15 19:17:45 -04:00
Vignesh Mohankumar
d73763ce75 refactor: imports shared polyfills in setupTests (#6571) 2023-05-15 17:11:28 -04:00
Zach Pomerantz
fe6df38997 build: upgrade to webpack5 with polyfilled Buffer (#6568)
* fix: Revert "fix: Revert "build: upgrade to webpack 5 (#6459)" (#6566)"

This reverts commit 5e591455b3.

* build: polyfill Buffer

* docs: fix comment negation
2023-05-15 14:07:05 -07:00
eddie
719ee0f5b5 fix: loosen permit2 expiration tolerance in e2e tests (#6573) 2023-05-15 10:58:05 -07:00
Charles Bachmeier
75bdf9a8d4 feat: [DetailsV2] Add left padding to trait rows and headers (#6534)
* feat: [DetailsV2] Add left padding to trait rows

* update snapshot

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-05-15 10:40:38 -07:00
Tina
efbe3994bb fix: catch RouterPreference.AUTO case for routing-api usage (#6572)
catch AUTO case for routing-api
2023-05-15 13:38:59 -04:00
Vignesh Mohankumar
93fe8e4349 fix: polyfill ResizeObserver (#6553)
* polyfill

* lint

* polyfill test

* dedupe
2023-05-15 12:39:31 -04:00
Vignesh Mohankumar
6062f615a0 build: change automated release to 16:00 UTC (#6567) 2023-05-15 12:25:49 -04:00
Charles Bachmeier
42e3af7b5c feat: [DetailsV2] Offer and Listing Tables (#6515)
* added home icon, basic content container with scroll behaviour

* add more struct

* add timeUntil util, add main structure of generic component, basic mock data

* propagate asset

* actual fake data

* working scroll

* proper alignment

* 1155 quantity

* small window sizes

* more action buttons

* cleanup

* update snapshot

* add tests

* add new test files

* add outline and hide usd price for certain screen sizes

* use sell order data

* update tests

* fetch multiple listings

* better price width on select screens

* mobile icon for approve

* bottom padding on mobile

* update snapshot

* use test objs in tests

* update query

* add border between rows

* update page padding

* breakpoint overlap

* simplified sellOrder check

* external link

* upstream button and better mobile padding

* add file and update tests

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-05-15 09:14:09 -07:00
Vignesh Mohankumar
57274a800d fix: don't console.error for WalletConnect modal close (#6559) 2023-05-15 12:13:34 -04:00
Tina
5e591455b3 fix: Revert "build: upgrade to webpack 5 (#6459)" (#6566)
Revert "build: upgrade to webpack 5 (#6459)"

This reverts commit ec547ab100.
2023-05-15 09:48:27 -04:00
Zach Pomerantz
ec547ab100 build: upgrade to webpack 5 (#6459)
* fix: import default from json

* fix: fallback to path-browserify

* build: upgrade to webpack5

* test: update size-tests to reflect single entry

* test: increase service-worker timeout

* docs: improve comments

* build: rm MiniCssExtract workaround

* docs: even better comments

* test: back out longer test

* build: vendor chunk

* test: increase sw timeout

* fix: justified splitChunks config

* better explanation

* fix: longer timeout

* fix: caching

* merge and rm duplication

* build
2023-05-12 12:55:01 -07:00
Charles Bachmeier
9de76c69ae feat: [DetailsV2] Data Page Header (#6549)
* hide header on mobile

* add buy and offer buttons, thumbnail, text

* handle no sell orders and add tests

* rehide on mobile

* breakpoint optimizations

* design feedback

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-05-12 14:48:26 -04:00
Charles Bachmeier
85d1b90197 feat: [DetailsV2] Mobile support for traits (#6535)
Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-05-12 13:39:31 -04:00
lavalamp
38af86e1bb ci: More CI pipeline fixes (#6550)
Move git config
2023-05-12 10:03:45 -07:00
Zach Pomerantz
11a8df2a3e build: report test failures via Slack (#6539)
* build: report test failures
2023-05-12 09:19:20 -07:00
Vignesh Mohankumar
3726b6bb47 fix: remove top-level Fragment (#6540) 2023-05-12 11:19:52 -04:00
Vignesh Mohankumar
bfde34c774 refactor: moves retry helper to subfolder (#6531) 2023-05-12 11:08:14 -04:00
Tina
bd8113d018 chore: Goodbye widget :( (#6543)
* goodbye widget :(

* remove unused function

* modify trace tests

* fix lint

* is github down?
2023-05-12 11:05:22 -04:00
lavalamp
14e3ef044e ci: CI pipeline fixes for merge issues (#6529)
* CI fixes

* update text content

* Change PR to force push

* releases environment for prod deploy

* add runs-on

* Rename third step

* Update .github/workflows/1-main-to-staging.yml

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update .github/workflows/1-main-to-staging.yml

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* nits

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-05-12 08:30:30 -04:00
Vignesh Mohankumar
4fc4bdcd55 fix: propagates user rejection errors (#6533) 2023-05-11 19:40:02 -04:00
Zach Pomerantz
3733570a89 build: update workflow owners (#6537) 2023-05-11 14:24:52 -07:00
Tina
7a042a5199 chore: Replace widget skeleton with internal swap skeleton (#6524)
* replace widget skeleton with internal version

* remove unuecessary div wrappers

* add snapshot test

* forgot to commit this file earlier

* remove exports

* revert(e2e): waitForAnimations

* convert values to px, refactor a bit to use flex gap instead of padding

* remove unnecessary props

* update snapshot test

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-05-11 16:58:35 -04:00
Jordan Frankfurt
6d5e17a6e7 fix: deduplicate remote and local tx lists (#6438)
* fix: deduplicate remote and local tx lists

* add nonce to local transactions

* removes local transactions that have nonces that are duplicates of remote transactions

* add e2e test

* lint fix

* fix types in test

* use supported chain id for reducer tests

* use getReceipt to remove outdated transactions via existing polling setup

* pr nits from cmcewen

* fix lint

* fix test
2023-05-11 13:16:18 -05:00
Jack Short
8301c5892c chore: removing token type check from routing (#6536) 2023-05-11 13:37:28 -04:00
Vignesh Mohankumar
59b757dda0 fix: disables CMC list temporarily (#6532)
* fix: disables CMC list temporarily

* -
2023-05-10 20:32:43 -04:00
Jack Short
92a6ec67b3 feat: [DetailsV2] different media types on landing page (#6492)
* initial layout assuming media type exists

* fixing embeds

* media type function

* updated snapshot test

* initial shadow impl

* better shadows

* audio player controls

* updating tests

* content not available handlers

* errors on all media types

* removing fullscreen from iframe

* adding snapshot tests

* responding to comments

* text align center

* updating tests
2023-05-10 13:10:25 -04:00
lavalamp
1d6a1e90d7 ci: GH action for deploying to production (#6482)
* GH action for deploying to production

* Remove dependency on tests

* Update .github/workflows/4-deploy-to-prod.yml

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update .github/workflows/4-deploy-to-prod.yml

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Add tag as action step rather than separate target

* Comments

* Update .github/workflows/4-deploy-to-prod.yml

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Specify branches

* Update run name

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-05-10 12:59:59 -04:00
Jack Short
01aa3291b3 chore: bubbling up pwat spender from route query (#6481)
* chore: bubbling up pwat spender from route query

* refactoring

* adding loading state

* moving to loading allowance

* responding to comments

* linting
2023-05-10 12:45:58 -04:00
Zach Pomerantz
5539ebedf7 build: update stage 2 name (#6526) 2023-05-10 09:38:31 -07:00
Vignesh Mohankumar
e6adddbf55 refactor: return onDemandEntries instead of mediaURLs (#6514)
* refactor: return onDemandEntries instead of mediaURLs

* lint

* fix test
2023-05-10 11:46:28 -04:00
Mike Grabowski
0050b1e165 feat: new routing diagram (#6510)
* chore: initial commit

* chore: add todo to refactor and simplify if conditional in the future

* chore: update layout

* chore: ui tweaks

* chore: add todo

* chore: change todo

* chore: update UI

* chore: tmp

* feat: rename router preference

* chore: update type

* fix error

* fix one more issue

* finish UI work

* chore: remove unecessary components

* chore: update non-snapshot unit tests

* chore: fix lint

* chore: fix ts

* chore: one more time

* fix

* chore: update snapshots

* chore: add jira tickets

* chore: fix mobile popovers

* chore: add analytics event

* chore: fix padding and send event

* chore: fix loading state

* oops

* chore: address review

* chore: comment

* chore
2023-05-10 19:06:12 +04:00
Vignesh Mohankumar
5bf33ab004 revert(e2e): waitForAnimations (#6525)
Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-05-10 10:53:53 -04:00
lavalamp
a4cfeecd8c ci: Workflow for pushing to releases/staging (#6319)
* Initial draft of releases/staging force push

* Rename

* Update PAT, test on PR target

* Remove pull request target, add environment

* Update .github/workflows/push-staging.yml

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update .github/workflows/push-staging.yml

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update .github/workflows/push-staging.yml

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* comments

* Update step name

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-05-10 08:29:31 -04:00
lavalamp
76cbfdd0b9 ci: GH action for promoting staging -> prod (#6366)
* Add action for promoting to prod

* Update .github/workflows/pr-staging-to-prod.yml

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update .github/workflows/pr-staging-to-prod.yml

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update .github/workflows/pr-staging-to-prod.yml

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update .github/workflows/pr-staging-to-prod.yml

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update .github/workflows/pr-staging-to-prod.yml

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Comments

* Comments

* Remove commit message

* Fix service account reference, add CODEOWNERS

* Update .github/workflows/pr-staging-to-prod.yml

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Nits

* Fix newline

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-05-10 08:29:20 -04:00
lavalamp
0db9e51e41 ci: Staging deploy GH action definition (#6455)
* Staging deploy GH action definition

* Remove workflow_dispatch

* Update src/utils/env.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Restrict sentry reporting to staging environment

* Rename and change environment

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-05-10 08:28:59 -04:00
Vignesh Mohankumar
82e7925a17 fix: properly filter AbortErrors (#6519)
* fix: properly filter AbortErrors

* lol
2023-05-09 19:04:41 -04:00
Zach Pomerantz
2150347ba2 build: cache generated files across builds (#6495)
* build: cache generated files across builds

* docs: lingui pkg-up comment

* docs: explain clean extraction
2023-05-09 15:49:53 -07:00
Vignesh Mohankumar
2f80646ddd fix: add chunkResponseStatus tag (#6509)
* fix: add chunkResponseStatus tag

* add-tests

* fix tests

* tests

* description

* comments

* comment

* move

* comment

* lint
2023-05-09 17:44:58 -04:00
matteen
55eea6a724 chore(deps): bump @uniswap/token-lists (#6520)
* chore(deps): bump @uniswap/token-lists

* run yarn deduplicate
2023-05-09 17:34:05 -04:00
matteen
709a70652f feat: add tokenlist validation (#6504)
* feat: add tokenlist validation

* use alternative for spread operator

* maintain tokenlists version and use original ajv version

* bump ajv

* Revert "bump ajv"

This reverts commit b9d2dd61c6.

* rename vars in validator

* update gitignore

* nit fixes

* test

* add ^ back

* remove ^

* removed and readded ajv

* try require.resolve

* Revert "try require.resolve"

This reverts commit 62f58bcb7f.

* bump eslint-config

* yarn lock merge conflict

* bring back spread operator

* remove redundant lint ignore
2023-05-09 16:34:15 -04:00
Jack Short
5a7a041f12 feat: [DetailsV2] background for nft details (#6496)
* feat: background for nft details

* fixing top spacing

* adding new states for zindex
2023-05-09 16:08:28 -04:00
cartcrom
b60d98fc17 fix: loading spinner console bug (#6518)
fix: update svg path
2023-05-09 14:59:26 -04:00
Zach Pomerantz
38d9ab67eb test(e2e): token details and test cleanup (#6516)
* test(e2e): split e2e commands/setup

* test(e2e): consolidate tests

* test(e2e): simplify

* test(e2e): mv token details tests to appropriate spec

* test(e2e): rm obsolete constant

* test(e2e): comments

* test(e2e): do not wait for animations
2023-05-09 10:33:55 -07:00
Jordan Frankfurt
5e6ef1575b test: skip flakey e2e test (#6517) 2023-05-09 11:07:13 -05:00
Vignesh Mohankumar
4a015e9d0d fix: ensure event.request is defined in trace (#6498)
* fix: ensure event.request is defined in trace

* add check for empty event
2023-05-09 11:44:07 -04:00
Mike Grabowski
c383a0a0a2 feat: new Settings menu for Swap (#6480)
* feat: initial commit

* remove extra check

* chore: divider fix

* feat: switch from boolean to routerPreference enum

* chore: align name

* chore: fix two errors

* chore: clean up

* chore: entire radio button clickable

* chore: remove unused toggle component

* Revert "chore: remove unused toggle component"

This reverts commit 42858a02b5.

* feat: rewrite slippage

* feat: Slippage

* chore: tbd tomorrow

* Update src/state/user/reducer.ts

Co-authored-by: Tina <59578595+tinaszheng@users.noreply.github.com>

* feat: replace auto with Slippage enum

* chore: add todo for deadline

* chore: cleanup

* feat: improve autoslippage

* chore: replace price with auto

* chore: fix lint

* test: add coverage for Expand

* chore: fix tests

* chore: review feedback part 1

* chore: rework warning

* chore: add jira tickets

* feat: add tests for useUserSlippageTolerance

* chore: add some more

* chore: one more

* add tests for slippage

* chore: add unit tests for transactionsettings

* remove

* revet changes to improve coverage

* chore: update to figma caption

* chore

* chore

* chore: update wording

* Update src/components/Expand/index.tsx

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* fix: issue with new value, update confusing migration comment

* chore: remove opacity animation temporarily

* chore: update snapshot test

* chore: fix e2e + update comment

* chore: fix tests

* chore: fix tests

---------

Co-authored-by: Tina <59578595+tinaszheng@users.noreply.github.com>
Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-05-09 10:33:25 -04:00
Vignesh Mohankumar
d6e92804ad fix: filter AbortError from Sentry (#6497) 2023-05-08 18:25:00 -04:00
Zach Pomerantz
f0d8f8b23b test(e2e): mock uniswap token lists from ipfs (#6511)
* test(e2e): mock uniswap token lists from ipfs

* test(e2e): correctly intercept
2023-05-08 15:04:02 -07:00
Charles Bachmeier
ff080aa957 fix: update OS listing fee (#6505)
* update OS listing fee

* remove redundancy

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-05-08 10:28:01 -07:00
cartcrom
04d9ff7d71 feat: update useAllTokensMultichain usage (#6493)
* feat: updates useAllTokensMultichain to return userAddedTokens

* fix: use correct types in tests

* chore: add documentation for future removal of TokenAddressMap

* fix: use doc comments

* test: add unit test for useAllTokensMultichain

* fix: check userAddedTokens for undefined
2023-05-05 18:15:27 -04:00
cartcrom
406893d99a test(e2e): permit2 approval (#6488)
* build: upgrade cypress-hardhat

* test: reset hardhat between tests

* test: enable auto-mining

* build: upgrade cypress-hardhat again

* test: permit2 e2e tests

* test: user approval rejection

* refactor: reuse common permit util vars to reduce # of lines

* fix: var casing

* refactor: polish

* refactor: clean up comments and function names

* refactor: remove approval util and update scoping

* fix: further nits
2023-05-05 17:52:22 -04:00
Vignesh Mohankumar
4630720956 fix: handle addEventListener being unsupported on Safari <14 (#6426)
* fix: handle addEventListener being unsupported on Safari

* conditionally call

* Revert "conditionally call"

This reverts commit b6b7d2f017.

* comment

* fix

* callback

* add tests

* lint

* casting

* good pr comments

* fix
2023-05-05 13:36:20 -04:00
Jordan Frankfurt
e73e1540ad fix: errors are responsible for their own grammar (#6490) 2023-05-05 11:38:00 -05:00
Vignesh Mohankumar
3a82642fe6 fix: update service worker to precache css/js files (#6486)
* fix: update service worker to precache css/js files

* add test

* move to utils

* working tests

* fixes

* lint

* change names

* lint

* change return type

* fix

* fix

* changes

* lint

* rename cache

* lint

* fix comments and remove string[] case

* string |

* Update src/serviceWorker/utils.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

---------
2023-05-04 14:29:13 -04:00
Zach Pomerantz
2a50d6a17e test(e2e): reset hardhat between tests (#6487) 2023-05-04 08:31:53 -07:00
eddie
c8a8149127 fix: add amplitude page context to swap flow events (#6489) 2023-05-04 11:20:12 -04:00
Vignesh Mohankumar
38cde648cf fix: add a catch on collect static call (#6491)
* fix: add a catch on collect static call

* comment
2023-05-04 11:07:01 -04:00
Charles Bachmeier
33c099119d chore: refactor Bag to use scroll hook (#6483)
* chore: refactor Bag to use scroll hook

* remove outdated comment

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-05-03 14:19:27 -07:00
Jordan Frankfurt
40247ff7e0 test(e2e): slippage failure (#6464)
* initial draft

* remove logs

* assertions improvement

* add more comments

* add explicit call to disable automine

* test out a very long timeout

* Revert "test out a very long timeout"

This reverts commit 0fc2666d6f.

* improve test reliability

* remove mock list response

* remove hardhat reset and clean up tests

* simplify assertion

* add zzmp's nits
2023-05-03 16:03:43 -05:00
eddie
30d1de8e84 fix: moonpay modal height (#6439) 2023-05-03 14:05:50 -04:00
Jack Short
0e5328bee9 feat: [DetailsV2] initial details landing page view (#6453)
* feat: initial view of details landing page

* gap

* dynamic font sizes

* added test

* responding to comments

* updating snapshot

* linting
2023-05-03 11:08:48 -04:00
Jordan Frankfurt
d1995bc5a6 test(e2e): deadline passed swap error state (#6444)
* chore: ignore hardhat cache files

* test: add forking hardhat config

* test: install cypress-hardhat

* build: add cypress-hardhat

* fix: lint

* build: add hardhat

* build: add @sentry/types

* fix: better origin

* test: update cypress VisitOptions to include hardhat

* fix: default to connected wallet user state

* test: add a hardhat provider

* build: update imports

* chore: comments

* fix: massage eth_sendTransaction

* feat: example swap test (#6415)

* initial commit

* add intercept for amplitude

* fix: destructure result

* click swap submission

* fix: eth_sendTransaction via bridge

* test works

* finish chain interaction test

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* swap should render an error when a transaction fails due to a passed deadline

* use mining utils to manage transaction confirmation

* update to use new hardhat syntax and make comments more clear

* test a very long timeout in CI

* Revert "test a very long timeout in CI"

This reverts commit 141c28e15c.

* fiddle with automine settings

* pr feedback

* cleanup

* bump cypress-hardhat

* use setAutomine

* use setAutomine

* remove .reset

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-05-02 23:52:07 -05:00
Jordan Frankfurt
4959836c2a test(e2e): (un/)wrap transactions (#6474)
* chore: e2e test (un/)wrap transactions

* wrap button should not be disabled (wait for enabled state)

* use automine

* pr feedback

* configure automine

* make tests stop relying on reset
2023-05-02 23:51:17 -05:00
Charles Bachmeier
ef4a80852d chore: update to listing with seaport 1.5 (#6485)
update to listing with seaport 1.5

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-05-02 18:46:12 -07:00
Vignesh Mohankumar
c2a972eb75 fix: filter chrome-extension errors (#6475)
* fix: filter chrome-extension errors in Sentry

* check stack
2023-05-02 15:43:37 -04:00
eddie
47a2768d89 chore: remove unused feature flags (#6484) 2023-05-02 15:28:12 -04:00
eddie
ca60caf6b0 feat: use Swap Component on TDP (#6332)
* test: swap flow cypress tests

* fix: use default parameter

* feat: use Swap Component on TDP

* feat: auto nav for TDP tokens

* chore: merge

* chore: merge

* chore: merge

* chore: merge

* fix: remove extra inputCurrency URL parsing logic

* fix: undo last change

* fix: pass expected chain id to swap component

* fix: search for default tokens on unconnected networks if needed

* test: e2e test for l2 token

* fix: delete irrelevant tests

* fix: address comments

* fix: lint error

* test: update TDP e2e tests

* fix: use pageChainId for filter

* fix: rename chainId

* fix: typecheck

* fix: chainId bug

* fix: chainId required fixes

* fix: bad merge in e2e test

* fix: remove unused test util

* fix: remove unnecessary variable

* fix: token defaults

* fix: address comments

* fix: address comments and fix tests

* fix: e2e test formatting, remove Maybe<>

* fix: remove unused variable

* fix: use feature flag for swap component on TDP

* fix: back button
2023-05-02 14:39:44 -04:00
Zach Pomerantz
252acef199 build: cap chunk size to 5MB (#6479)
* build: cap chunk size to 5MB

* test: rm size-tests
2023-05-02 08:46:32 -07:00
Zach Pomerantz
00ecb933ac test(lint): separate multiline comments (#6476) 2023-05-02 08:26:07 -07:00
Vignesh Mohankumar
607d0d443e fix: filter errors with OneKey in stack (#6477)
* fix: filter errors with OneKey in stack

* check stack
2023-05-01 15:32:05 -04:00
Charles Bachmeier
ff0209a78f feat: [DetailsV2] add link and hover state to trait component (#6472)
* hide trait container when asset has no traits

* add traits header row

* trait value rows and scroll behaviour

* row with placeholder values

* add random filler values and proper scrollbar styles

* working rarity graph

* bar border radius

* move rarity graph to its own file

* always show scrim

* working scrim and move traitrow to its own file

* cleanup

* remove padding

* move scrollbar right

* add snapshot tests

* add comment about randomly generated rarities

* cleanup

* only pass traits

* justify

* not important

* cleanup scrim styles

* remove comment

* add scroll state hook

* lint

* update test

* object over map

* remove spaces

* justify content

* add ticket

* add comments

* update snapshot

* add link and hover state to trait component

* correct padding

* respond to comments

* add component and use css for vis

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-05-01 11:52:49 -07:00
Zach Pomerantz
924e83139b test: keep test output clean (#6469) 2023-05-01 10:58:32 -07:00
Jack Short
4d5cc8267e chore: removing pwat feature flag (#6467)
* chore: removing pwat flag

* removing it from enum

* updating test

* trade is not the same as usingPwat
2023-05-01 11:57:56 -04:00
Charles Bachmeier
6bc7cfc996 feat: [DetailsV2] Add Trait component content (#6460)
* hide trait container when asset has no traits

* add traits header row

* trait value rows and scroll behaviour

* row with placeholder values

* add random filler values and proper scrollbar styles

* working rarity graph

* bar border radius

* move rarity graph to its own file

* always show scrim

* working scrim and move traitrow to its own file

* cleanup

* remove padding

* move scrollbar right

* add snapshot tests

* add comment about randomly generated rarities

* cleanup

* only pass traits

* justify

* not important

* cleanup scrim styles

* remove comment

* add scroll state hook

* lint

* update test

* object over map

* remove spaces

* justify content

* add ticket

* add comments

* update snapshot

* correct padding

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-05-01 11:43:55 -04:00
Vignesh Mohankumar
97312bb174 fix: match OneKey more generically (#6461)
* fix: match OneKey more generically

* flip

* Update src/tracing/errors.test.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update src/tracing/errors.test.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update src/tracing/errors.test.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* backslashes

* fix

---------
2023-05-01 11:02:26 -04:00
cartcrom
d0a10fcf8d refactor: activation hook w/ global state (#6413)
* feat: moved tryActivation to global hook/state

* test: activation hook

* fix: merge conflicts

* fix: update file path for render utils in activate.test.ts

* fix: add await for connector deactivation

* fix: pr comment fixes

* fix: update tests

* refactor: use stronger activation state type

* refactor: use global state instead of props in ConnectionErrorView

* fix: re-add uri availability check

* fix: lint

* fix: nits

* fix: css regression

* fix: update test enum usage

* fix: use native disabled attribute

* test: add snapshot tests for different Option states

* fix: zach's PR comments

* test: update snapshots/unit tests

* style: pending boolean names

* fix: updated test import

* docs: added comment explaining analytics difference in wallet connection

* test: assert console.debug calls and fix act() issues

* test: drawer close

* test: import specific drawer fn instead of whole module
2023-04-28 19:14:30 -04:00
Jordan Frankfurt
7a1a476e45 fix: spoof origin and referer (#6468)
* fix: spoof origin and referer

* comments, chaining, and an accurate replication of amplitude response bodies
2023-04-28 17:29:16 -05:00
Vignesh Mohankumar
b3bfc1003a build: upgrade sentry-release action (#6463) 2023-04-28 11:55:28 -04:00
Zach Pomerantz
3b1ef8033b test: upgrade cypress-hardhat (#6462) 2023-04-28 08:46:42 -07:00
Zach Pomerantz
803485b96a build: update default test settings (#6441)
build: coverage on CI by default
2023-04-27 14:34:37 -07:00
Jack Short
6df5d3a701 chore: moving nft test fixtures to their own file (#6456)
* chore: moving nft test fixtures to their own file

* refactoring structure

* renaming file
2023-04-27 17:10:06 -04:00
lynn
2d4eafc6b3 test: unsupported currency footer unit test (#6360)
* tests are complete

* update comment

* remove console log, and test close icon

* init

* lets try something else to avoid timeout

* try splitting up last test for timeout

* undo, it wasnt working

* revert order test

* add comment for sanity check

* test another way

* try userEvent

* increase timeout

* move timeout

* init

* use test constants

* use constants

* change address

* more comprehensive tests

* merge constants and use mocked

* remove comments

* remove dual import

* Update src/components/swap/UnsupportedCurrencyFooter.test.tsx

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* respond comments

* update tests

* remove console log

* fixes

* add act

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-04-27 16:54:05 -04:00
lynn
9b52fea58a test: swap details dropdown unit test (#6349)
* init for swap details dropdown test

* more tests

* complete tests, ready for review

* add to dev deps

* init

* merge main

* init

* use test constants

* use constants

* change address

* more comprehensive tests

* merge with constants

* move noop

* add eslint rule

* return null in noop

* merge

* update snapshot

* constant name

* snapshot change

* lint

* undo eslint change

* Update src/components/swap/SwapDetailsDropdown.test.tsx

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update src/components/swap/SwapDetailsDropdown.test.tsx

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update src/components/swap/SwapDetailsDropdown.test.tsx

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* respond comments

* update snapshot

* merge main

* user event instead

* add act

* import fix

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-04-27 16:53:45 -04:00
Jack Short
b92b286626 chore: updating listing marketplace icons (#6458)
* chore: updating listing marketplace icons

* removing svgs from public

* responding to comments
2023-04-27 16:51:53 -04:00
lynn
a8268728d3 test: advanced swap details component unit test (#6363)
* init

* init

* init

* use test constants

* use constants

* change address

* more comprehensive tests

* move noop

* add eslint rule

* return null in noop

* merge

* checkpoint

* fixes

* add tooltip test

* remove unused file

* merge swap modal header

* add third test

* add test for syncing and loading case

* respond to comments

* more descriptive comments

* update snapshot

* update

* change to act
2023-04-27 16:36:36 -04:00
lynn
ab6debbf46 test: swap modal footer unit test (#6353)
* swap footer modal test

* remove empty test

* init

* merge main and jordan comment

* init

* use test constants

* use constants

* change address

* more comprehensive tests

* merge constants

* fix errors

* remove dual import noop

* update snapshot

* Update src/components/swap/SwapModalFooter.test.tsx

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* update snapshot

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-04-27 15:07:49 -04:00
matteen
4c664645c6 feat: add L2 CG tokenlists (#6292)
* feat: add L2 CG tokenlists

* remove extra line
2023-04-27 12:50:05 -04:00
Jordan Frankfurt
4416a84fd7 fix: disable bnb network option on uniwallet (#6452)
* fix: disable bnb network option on uniwallet

* use supported chain set
2023-04-27 09:16:28 -05:00
lavalamp
eaaff81a67 ci: Emit to slack on merge to releases/* branch (#6318)
* Initial draft of Slack notification on releases/* merges

Test

* Add back proper Slack message content

* Feedback revisions

* Update .github/workflows/notify-slack-on-release-merge.yml

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update .github/workflows/notify-slack-on-release-merge.yml

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update .github/workflows/notify-slack-on-release-merge.yml

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Comments

* revert to github env

* Add PR target back

* Revert multi-line

* write to context, add multi-line back

* Try other reference to context

* one other way of settings output...

* Pull from output

* Remove env

* Remove PR target

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-04-26 20:32:42 -06:00
Zach Pomerantz
f7b8f945f2 build: allow parallel cypress re-run (#6449)
* build: allow parallel cypress re-run

* build: add a step
2023-04-26 17:02:53 -07:00
Jordan Frankfurt
115c65500b feat: mining mode switch to disable auto-mine (#6450)
* feat: mining mode switch to update so we can make assertions about pending transaction state

* update test to use explicit mining

* Update hardhat.config.js

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-04-26 15:16:51 -05:00
Jordan Frankfurt
3d8d29fd18 feat: e2e testing - Handle wallet rejection (#6442)
* chore: ignore hardhat cache files

* test: add forking hardhat config

* test: install cypress-hardhat

* build: add cypress-hardhat

* fix: lint

* build: add hardhat

* build: add @sentry/types

* fix: better origin

* test: update cypress VisitOptions to include hardhat

* fix: default to connected wallet user state

* test: add a hardhat provider

* build: update imports

* chore: comments

* fix: massage eth_sendTransaction

* feat: example swap test (#6415)

* initial commit

* add intercept for amplitude

* fix: destructure result

* click swap submission

* fix: eth_sendTransaction via bridge

* test works

* finish chain interaction test

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* stub sending a transaction to simulate wallet rejection of a transaction

finish test

s

* Update cypress/e2e/swap.test.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* lint

* fix network connection bug

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-04-26 13:02:51 -05:00
Charles Bachmeier
c178da626f chore: add more ip infringing collections to the blocklist (#6446)
* updated blocked collections and don't allow for address search of blocked collections

* revert to array
2023-04-26 10:31:49 -07:00
Zach Pomerantz
e3c589ae41 fix: wallet connection analytics (#6296)
* test: web3

* fix: wallet connection analytics

* test: wallet connection analytics

* build: upgrade web3-react@^8.2

* test: web3

* chore: better merge

* fix: unmock

* fix: use usePrevious

* fix: naming

* fix: deps
2023-04-26 10:27:04 -07:00
Vignesh Mohankumar
6d60aca437 fix: filter OneKey related errors (#6396)
* fix: filter OneKey related errors

* fix

* .app
2023-04-26 11:57:13 -04:00
Charles Bachmeier
c77885c4c0 fix: remove patches (#6448)
remove patches
2023-04-25 16:20:46 -07:00
Zach Pomerantz
01684977b3 test: add a 'hardhat' mock window.ethereum (#6395) 2023-04-25 14:24:57 -07:00
Vignesh Mohankumar
025a84de93 build: analyzes only mapped (#6437)
build: analyze only mapped
2023-04-25 16:59:10 -04:00
Jack Short
0025997175 chore: updating purchasable markets from activity (#6443)
* updating purchasable markets from activity

* renaming

* adding trans + refactor

* snapshot test

* removing snapshot test and only matchin test

* deleting snap
2023-04-25 16:17:36 -04:00
Vignesh Mohankumar
acf97e042c fix: filter WebAssembly compile errors (#6445)
* test

* fix: filter WebAssembly compilition errors

* Update src/tracing/errors.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

---------
2023-04-25 15:35:14 -04:00
Jack Short
771618b1c9 chore: updating marketplace icons (#6424)
* chore: updating marketplace icons

* removing console

* eslint

* uni logo

* nft20

* weird svg id bug

* adding gradient id to other marketplaces

* purchasable markets

* test size inc

* removing the nxyz endpoint

* adding back nxyz endpoint for testing

* graphql enum is purchasable markets

* removing nxyz

* self nit

* changing width and height to size - removing gradientId from props - updating gradient id

* removing purchasable markets

* linting

* adding tests to ensure marketplace

* better description

* needs to check for null and not undefined
2023-04-25 15:20:30 -04:00
Zach Pomerantz
87144de9c8 test: transform vanilla-extract for jest (#6425)
* fix: transform vanilla extract for jest

* lint: vanilla transform

* build: deduplicate

* test: improve transformIgnorePatterns

* fix: broken snapshot

* nits

* Update craco.config.cjs

* build: lockfile

* build: lockfile

* Update vanilla.transform.cjs
2023-04-25 12:06:58 -07:00
Charles Bachmeier
63d0290a50 feat: [DetailsV2] more shared component content (#6420)
* add page break and placeholder files

* container layout

* description tabs

* add table tabs

* mobile wrap

* remove todo

* adaptive padding

* add extensible tabbed component

* add new file

* add snapshot test for empty data page

* update snapshot

* add new snapshot

* undo unrelated snapshot change

* draft: details v2 containers

* Revert "draft: details v2 containers"

This reverts commit 7c6580c974.

* uniform padding and single tab styling

* update snapshot

* update default tab behaviour

* add trait bubble

* working chevrons

* shared bubble tab title

* add placeholder nums for offers and listings

* remove styles and update snapshot

* remove chevron and update snapshot

* use test asset for snapshot

* max width

* convert to map with keys

* remove bubbletext helper

* remove extra brace

* use styled components and memo

* update trait component height

* update snapshot

* Add count field to Tab

* add comment

* update snapshot

* move styled component to shared folder

* update snapshot

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
Co-authored-by: Jack Short <john.short.tj@gmail.com>
2023-04-25 09:40:43 -07:00
Zach Pomerantz
963121f19b test: prevent async debounce updates (#6427)
* test: prevent async debounce updates

* lint

* fix: actually fix

* fix: rm unused act

* fix: synchronously update popper

* lint

* way better
2023-04-24 16:26:28 -07:00
Zach Pomerantz
58417412f1 build: tighten tsconfig (to include build cache, exclude watch folders) (#6375)
* build: extend cypress tsconfig from build tsconfig

* build: exclude node_modules from watch to improve typechecking perf

* fix: even tighter tsconfigs

* fix: even tighter

* fix: tailor cypress tsconfig to testing

* fix: split them up again

* fix: pr comments
2023-04-24 16:00:04 -07:00
Charles Bachmeier
cd3cff0202 chore: remove graphql feature flag and old query methods (#6384)
* remove graphql feature flag and old query methods

* remove unused fn

* remove redundant names, simplify import

* explicit var naming

* column

* add comment

* update flag check

* undo

* visit /swap in uni search test

* empty array base

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-04-24 14:03:24 -07:00
Zach Pomerantz
90546fd803 fix: rm non-serializable data (#6430) 2023-04-24 12:59:23 -07:00
Zach Pomerantz
bee558fa1a test: squelch console.debug (#6429) 2023-04-24 12:59:12 -07:00
Zach Pomerantz
87514742f1 test: shard GH action unit tests (#6428)
* test: shard GH action unit tests

* fix: use percent
2023-04-24 12:59:05 -07:00
eddie
75b0320bbe feat: use codecov flags (#6418) 2023-04-24 12:44:41 -07:00
Zach Pomerantz
4966ee56dd fix: mock useWeb3React (#6422)
* fix: mock useWeb3React

* fix: pr nits

* fix: do not import for perf

* fix: update snaps

* fix: import type

* Revert "fix: import type"

This reverts commit d7da5a04d1.
2023-04-24 12:43:55 -07:00
Tina
545fdd2cbe feat: Update Subhead text to match Figma spec (#6307)
* update font weight and line height to match figma

* remove unnecessary fontWeight and lineHeight props

* revert textSecondary change

* revert SubheadSmall change

* remove lineHeight from Subheader for Success screen

* add Trans wrapper to Sweep text

* reduce gap between name and address to 2px

* update snapshot tests for classnames change

* fix failing snapshot

---------

Co-authored-by: Lynn Yu <lynn.yu@uniswap.org>
2023-04-24 15:06:15 -04:00
Zach Pomerantz
201dc2ce85 refactor: keep constants insular (#6411) 2023-04-24 08:45:38 -07:00
Zach Pomerantz
c36d9c3d3f test: rm flaky retry test (#6431) 2023-04-24 08:32:38 -07:00
Jordan Frankfurt
bc48b4fb0e feat: reduce severity of phishing filter to allow url token names (#6249)
* feat: reduce severity of phishing filter to allow url token names

* fix # positions, prototype progressive risk check w/ list presence

* functional progressive risk check functionality

* better name for tokenList

* remove logs/todos

* make it work for mini-portfolio

* getUniqueAddressesFromPositions

* useTokenContractsConstant

* adds comment documenting the positionInfo->positionDetails type mapping

* safe->filtered positions in the Pool page

* use for loop instead of reduce

* WIP: token constants lookup table consolidating chain data and list data

* remove lookup table to pr#6268

* use NEVER_RELOAD

* use a counter on tokenList inclusion

* pr feedback - code simplification

* add tests

* tinaszheng pr feedback

* fix incorrect undefined fn signature

* forEach -> for loop

* add comment explainer to useFilterPossiblyMaliciousPositions

* simplify and comments re: filtration logic

* fix tests
2023-04-24 10:11:04 -05:00
Vignesh Mohankumar
ffdd311be9 fix: handle other types of chunk error codes (#6423)
* fix: handle other types of chunk error codes

* lint

* change regex

* letters only
2023-04-21 16:34:08 -04:00
Charles Bachmeier
3e5c0bddd7 feat: [DetailsV2] build containers for data page (#6399)
* add page break and placeholder files

* container layout

* description tabs

* add table tabs

* mobile wrap

* remove todo

* adaptive padding

* add extensible tabbed component

* add new file

* add snapshot test for empty data page

* update snapshot

* add new snapshot

* undo unrelated snapshot change

* draft: details v2 containers

* Revert "draft: details v2 containers"

This reverts commit 7c6580c974.

* uniform padding and single tab styling

* update snapshot

* update default tab behaviour

* max width

* convert to map with keys

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
Co-authored-by: Jack Short <john.short.tj@gmail.com>
2023-04-21 12:38:07 -07:00
Tina
b161022fb1 feat: Use local reducer in Swap flow (#6312)
* test: swap flow cypress tests

* fix: use default parameter

* use local reducer in swap flow

* remove swap from global reducer

* fix: remove comments

* feat: add new test

* move token constant to fixtures file

---------

Co-authored-by: Eddie Dugan <eddie.dugan@uniswap.org>
2023-04-21 14:32:13 -04:00
eddie
a527f00905 feat: add apple store banner (#6412)
* feat: add apple store banner

* feat: make apple meta tag use the current url

* fix: tag error

* fix: lint

* fix: yarn dedup

* feat: back to basic impl

* fix: syntax

* fix: comment
2023-04-21 11:30:06 -07:00
eddie
a05dedd8be fix: remove the info icon popover from the toolbar (#6407)
* fix: remove the info icon popover from the toolbar

* fix: boolean
2023-04-21 11:10:10 -07:00
Vignesh Mohankumar
916ebef480 fix: filter CSS related 499 chunk errors (#6417)
* add in css errors

* rm console

* change code
2023-04-21 13:07:50 -04:00
Jack Short
aa77a7a23a chore: adding snapshot tests for nftCard components (#6410) 2023-04-21 12:28:46 -04:00
Vignesh Mohankumar
67b5896886 fix: ignore ChunkLoadingErrors if related to 499 or missing data (#6365)
* fix: ignore ChunkLoadingErrors if related to 499 or missing data

* add tests

* more tests

* types

* no syntaxerror

* handle undefined performance

* change test name

* comment

* Update src/tracing/errors.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update src/tracing/errors.test.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update src/tracing/errors.test.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* rm unnecessary

* change

* rm any

* cast earlier

* fixes

* fix: typings

* fixes

* rm mock

* rm comment

* try polyfill

* fix mocks

* rm stuff

* move mock

---------
2023-04-21 12:03:25 -04:00
cartcrom
9e31756cc6 chore: remove miniportfolio and mgtm flags (#6416)
* chore: remove miniportfolio and mgtm flags

* fix: tiny css fix
2023-04-21 12:00:09 -04:00
Jack Short
3900cdd0dc chore: removing fallback rarity provider (#6408) 2023-04-21 11:56:13 -04:00
Vignesh Mohankumar
fcc6a2d560 fix: filter out all unsafe-eval csp errors (#6409)
* update match

* Update src/tracing/errors.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* lint

* add test

---------
2023-04-21 10:58:49 -04:00
Jack Short
98841c783d chore: removing unused files in nft public folder (#6403) 2023-04-20 20:11:45 -04:00
eddie
820e179560 fix: e2e test coverage reporting (#6286)
* fix: e2e test coverage reporting

* fix: try increasing

* fix: names

* fix: optimize test.yml

* fix: undo last change and add cache
2023-04-20 15:34:09 -07:00
Zach Pomerantz
2268860615 test: web3 (#6299)
* build: upgrade web3-react@^8.2

* test: web3

* fix: update test name
2023-04-20 15:30:30 -07:00
Zach Pomerantz
9c41955e52 build: upgrade web3-react@^8.2 (#6401) 2023-04-20 14:27:50 -07:00
Zach Pomerantz
b6874b8094 build: remove unnecessary webpack plugins (#6386)
* build: remove duplicate file case check

* build: remove unused moment tree-shaking

* fix: nits
2023-04-20 14:12:43 -07:00
Zach Pomerantz
5e090db8b3 build: add yarn-analyze (#6400) 2023-04-20 14:01:28 -07:00
eddie
cf95949406 fix: replace CMC token list URL (#6406) 2023-04-20 13:58:55 -07:00
Zach Pomerantz
2b60961812 build: use ignore-path for craco eslint (#6372)
* build: add caching to eslint

* build: add caching to jest

* build: add caching to tsc

* build: add caching to actions

* fix: upgrade upload-artifact to v3

* build: update craco eslint cacheLocation

* build: use ignore-path for craco eslint
2023-04-20 13:44:57 -07:00
Zach Pomerantz
aed969f38d test: silence CI tests (#6387) 2023-04-20 13:44:29 -07:00
Zach Pomerantz
4e6121d4ab test: restrict test-utils from src (#6392) 2023-04-20 13:43:31 -07:00
eddie
d63bcca539 test: swap flow cypress tests (#6331)
* test: swap flow cypress tests

* fix: use default parameter

* fix: use shared token addresses

* fix: fix test

* fix: nits
2023-04-20 13:00:43 -07:00
Vignesh Mohankumar
671041360d fix: filter CSP unsafe-eval errors (#6397)
* fix: filter CSP errors

* not syntax

* comment
2023-04-20 14:58:45 -04:00
Vignesh Mohankumar
36bdf5dd3e fix: show empty state on /add and /remove (#6346)
* fix: handle invalid chainId on position page

* fix

* add test

* Revert "add test"

This reverts commit d18742aa50.

* fix: prevent crashes on /add and /remove on unsupported chains

* handle v3 rm

* chainId

* lint

* Update src/pages/RemoveLiquidity/V3.tsx

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-04-20 14:54:27 -04:00
lynn
8b1a0e99ee test: swap modal header unit test (#6361)
* init

* init

* use test constants

* use constants

* change address

* more comprehensive tests

* move noop

* add eslint rule

* return null in noop

* merge

* fixes
2023-04-20 11:21:57 -04:00
cartcrom
a68a7e1bb4 fix: updated uniswap wallet images (#6390)
* fix: updated uniswap wallet images

* fix: revert unintended css update

* feat: use updated app icon w/ border
2023-04-20 10:54:33 -04:00
yyip-dev
95b9624bca feat: Update to app store link with tracking params (#6398)
Update to app store link with tracking params
2023-04-19 18:35:05 -04:00
Zach Pomerantz
04a0479236 test: add cypress-hardhat (#6394)
* chore: ignore hardhat cache files

* test: add forking hardhat config

* test: install cypress-hardhat

* build: add cypress-hardhat

* fix: lint

* build: add hardhat

* build: add @sentry/types

* fix: better origin
2023-04-19 10:50:25 -07:00
Jack Short
55f1e35ffc fix: pwat not setting correct spender (#6320)
* fix: pwat not setting correct spender

* todo

* responding to comments
2023-04-19 13:43:37 -04:00
lynn
01a3aa1c92 chore: add constants for testing (#6367)
* init

* use constants

* change address

* move noop

* add eslint rule

* return null in noop

* fixes
2023-04-19 12:21:30 -04:00
Zach Pomerantz
7121b4aa1c test: expand collectCoverageFrom (#6393)
* test: expand collectCoverageFrom

* fix: improve types coverage

* fix: target generated dirs

* fix: glob dirs
2023-04-19 09:04:41 -07:00
Zach Pomerantz
a538bf0b69 build: target ESNext for dev (#6379)
* build: add caching to eslint

* build: add caching to jest

* build: add caching to tsc

* build: add caching to actions

* fix: upgrade upload-artifact to v3

* build: update craco eslint cacheLocation

* build: target ESNext for dev

* merge again
2023-04-17 14:26:00 -07:00
Zach Pomerantz
135cb8fb34 fix: translate "Get started" on landing page (#6371)
* fix: translate "Get started" on landing page

* lint: html
2023-04-17 14:03:38 -07:00
cartcrom
bf50582d38 test: local activity tests (#6341)
* refactor: move MP files into subfolders

* refactor: consolidate MP subfolder file-naming scheme

* test: add tests for parseLocal.ts

* refactor: update existing parseLocal tests
2023-04-17 13:03:43 -07:00
lynn
110e23d6eb fix: fix padding for transaction toast notifications (#6373)
* padding fixes, special casing for txn

* add drop shadow, change width to 348px, remove debug code

* opacity animation

* address comments

* one more change

* respond to tina comments

* name change

* add $ to padding
2023-04-17 14:39:38 -04:00
Zach Pomerantz
7ab6a17b42 build: utilize the node_modules/.cache (#6364)
* build: add caching to eslint

* build: add caching to jest

* build: add caching to tsc

* build: add caching to actions

* fix: upgrade upload-artifact to v3

* build: update craco eslint cacheLocation

* fix: pr nits
2023-04-17 09:28:00 -07:00
lynn
7ad13c96a8 fix: fix slow yarn start (#6369)
init
2023-04-14 11:45:33 -05:00
Vignesh Mohankumar
4e99cc4d93 build: send url without hash to sentry (#6352)
* build: send url without hash to sentry

* comments

* Update src/tracing/index.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update src/tracing/index.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* add test

* move files around
2023-04-13 17:49:29 -04:00
Vignesh Mohankumar
6d29815f59 fix: ignore error caused by Cloudflare HTML response (#6356)
* fix: ignore error caused by Cloudflare HTML response

* add test

* Update src/tracing/errors.test.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update src/tracing/errors.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update src/tracing/errors.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* multiline
2023-04-13 17:48:50 -04:00
Zach Pomerantz
4888fe23df test: add jest.asMock (#6310)
* test: add jest.asMock

* test: use mocked instead

* test: split test-utils to prevent interaction

* test: whoops missed one

* Merge but actually this time
2023-04-13 12:44:06 -07:00
Zach Pomerantz
ef9ecd9ce2 build: optimize build by splitting out typechecking and linting (#6323)
* build: move typecheck/lint out of build

* build: add typecheck to test action

* build: fix lint to use gitignore

* fix: correctly lint/check

* fix: simplify lint

* build: back out eslint array-ification

* test(lint): add comment RE config/typings

* build: clarify craco webpack plugin mods

* build: simplify craco webpack with functional methods

* build: rm unused IgnorePlugin

* test(lint): order imports
2023-04-13 12:43:47 -07:00
Jack Short
f5d0804c46 feat: creating feature flag for details v2 page (#6359)
* feat: creating feature flag for details v2 page

* eslint ignore

* moving details v2 under trace
2023-04-13 15:43:14 -04:00
Vignesh Mohankumar
0bac257254 fix: handle invalid chainId on position page (#6338)
* fix: handle invalid chainId on position page

* fix

* add test

* Revert "add test"

This reverts commit d18742aa50.

* pr comments

* rename

* fix
2023-04-13 15:40:31 -04:00
lynn
a77752ab83 fix: re-implement dark mode for connector icons (#6329)
* init

* init

* Update src/connection/index.test.tsx

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update src/components/Identicon/StatusIcon.test.tsx

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update src/components/Identicon/StatusIcon.test.tsx

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* address comments

* unit test + remove _url in names

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-04-13 11:17:48 -04:00
cartcrom
bf31ca4f06 feat: updated banner (#6355)
* feat: updated banner

* fix: linted

* feat: add download link to overflow menu

* feat: hover animation

* fix: update landing screen hide logic

* feat: added descriptor comment for stopPropogation

* fix: translations & responsiveness of button text

* fix: icon sizing / padding + word casing

* fix: Learn more casing
2023-04-12 22:00:05 -04:00
Charles Bachmeier
ed8afbd851 fix: App crashing when changing sorting or toggling usd price on trneding NFTs table (#6354)
* fix app breaking when changing sorting or toggling usd price

* compare floor change correctly

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-04-12 15:49:04 -07:00
Vignesh Mohankumar
47b6a7c4d5 build: add chainId as tag in sentry ErrorBoundary (#6345)
* build: add chainId to sentry tags

* set it in web3provider

* set before sending
2023-04-12 14:43:37 -04:00
cartcrom
086fc65457 feat: remove /wallet route (#6350)
* feat: replace internal microsite routes with links to external site

* feat: use updated analytics events from events repo

* fix: remove unnused empty wallet page
2023-04-12 13:55:53 -04:00
cartcrom
7df53f30a0 feat: uniwallet banner (#6344)
* feat: update wallet banner display logic

* fix: linted

* fix: learn more link
2023-04-12 12:03:00 -04:00
Jack Short
66497a0108 fix: last sale nan (#6337)
* fix: last sale nan

* correct formatted price

* responding to comments

* refactoring for readability
2023-04-12 11:45:48 -04:00
cartcrom
e0eb701bc0 feat: log connection activation/errors (#6333)
* feat: log connection activation/errors in console.debug

* fix: remove now-redundant comment
2023-04-12 10:36:01 -04:00
cartcrom
36cb0668a3 fix: use updated wallet links/language (#6343)
fix: use updated links/language
2023-04-11 18:36:34 -04:00
eddie
810f42136e fix: auto-dismiss MP bottom sheet after Buy Crypto click (#6298) 2023-04-11 14:46:28 -07:00
Vignesh Mohankumar
07b7d7f268 test: add test for position page states (#6342) 2023-04-11 17:10:38 -04:00
Charles Bachmeier
39b5bb37cd feat: hide looksrare until we can support their sdk (#6339)
* hide looksrare until we can support their sdk

* remove commented code

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-04-11 13:13:55 -07:00
cartcrom
feed63b1b3 refactor: reorganize mini-portfolio file names (#6336)
* refactor: move MP files into subfolders

* refactor: consolidate MP subfolder file-naming scheme
2023-04-11 15:26:27 -04:00
Vignesh Mohankumar
ee56382956 fix: ignores "user rejected transaction" errors (#6330)
* ignore user rejected errors

* test

* fix

* use util
2023-04-11 14:28:30 -04:00
lynn
64e396d9e0 fix: update empty state svg icons (#6326)
* update icons

* add snapshot test for empty states

* update failing snapshot
2023-04-11 13:37:05 -04:00
Tina
2ffc8a0bdf chore: Remove SWAP_TRANSACTION_COMPLETED event (#6328)
remove swap completed event
2023-04-10 17:27:02 -07:00
eddie
5ec9cdc5c4 fix: redo MP drawer layout changes with mobile fixed (#6280)
* fix: redo MP drawer layout changes with mobile fixed

* fix: mobile fix and another test

* fix: comments
2023-04-10 12:53:58 -07:00
eddie
4d85775d90 fix: update CurrencyList unit tests (#6321)
* fix: testing snapshot updates

* fix: remove inline style and update snapshots tests
2023-04-10 12:18:54 -07:00
eddie
c1c59ca692 refactor: rename WalletDropdown to AccountDrawer (#6313)
* feat: rename WalletDropdown to Portfolio

* fix: update after rebase

* feat: rename from Portfolio to AccountDrawer

* fix: fix test
2023-04-10 11:26:05 -07:00
Zach Pomerantz
f29d97413e build: use env node for craco lint (#6311) 2023-04-10 10:05:22 -07:00
Zach Pomerantz
a078d94a38 chore: update pr template (#6314) 2023-04-10 10:05:06 -07:00
lynn
c9c3329bc3 fix: switch back buttons in mini portfolio (#6327)
switch back header
2023-04-10 12:57:31 -04:00
eddie
13d0b70fa8 fix: remove "Received Swap Quote" field from Connect Wallet event (#6316) 2023-04-10 09:18:07 -07:00
lynn
b852e4e64a feat: adding analytics for fiat on ramp buy button feature (#6272)
* init

* testing if it works

* wip

* tooltip still not working correctly

* modal still not triggered after initial buy click

* remove invalid import

* region check fixed

* add disabled buy button treatment

* simplify and fix toggle twice bug

* no more state mgmt bugs finally

* rename vars for clarity and add todos

* add feature flag, remove toast

* keep wallet drawer open upon repeated buy clicks

* remove from feature flag modal for now

* unused vars

* first round respond to tina comments

* respond to tina padding comments, fix padding in response to cal feedback

* last round tina comments

* init pending element names being added to analytics events repo

* update event names

* add tooltip delay requested by fred and cal

* middle of revisions, fiat buy flow readability wip

* hook logic refactor done + added basic unit test

* rename enum and add todo for unit tests

* mouseover tooltip disable properly

* fix mouseover tooltip not working, ensure dot working as expected, rename buyFiatClicked to buyFiatFlowCompleted

* change developer doc comment

* respond comments

* update snapshot test

* lint fix

* remove unnecessary changes
2023-04-07 13:02:07 -04:00
lynn
55bd3555be feat: Web 2996 add fiat on ramp buy flow to swap modal on the interface (#6240)
* init

* testing if it works

* wip

* tooltip still not working correctly

* modal still not triggered after initial buy click

* remove invalid import

* region check fixed

* add disabled buy button treatment

* simplify and fix toggle twice bug

* no more state mgmt bugs finally

* rename vars for clarity and add todos

* add feature flag, remove toast

* keep wallet drawer open upon repeated buy clicks

* remove from feature flag modal for now

* unused vars

* first round respond to tina comments

* respond to tina padding comments, fix padding in response to cal feedback

* last round tina comments

* add tooltip delay requested by fred and cal

* middle of revisions, fiat buy flow readability wip

* hook logic refactor done + added basic unit test

* rename enum and add todo for unit tests

* mouseover tooltip disable properly

* fix mouseover tooltip not working, ensure dot working as expected, rename buyFiatClicked to buyFiatFlowCompleted

* change developer doc comment

* respond comments

* update snapshot test

* comments

* small changes + unit tests

* dedup

* remove enzyme

* Remove unecessary line

* simplify

* more cleanup

* add missing await

* more comments

* more comment responses

* more comment responses

* delay show fixes and respond to comments

* fix logic for show

* remove tooltip delay, unit test changes

* Update src/components/Popover/index.tsx

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* remove delay on tooltip

* missed one

* Update src/components/swap/SwapBuyFiatButton.test.tsx

Co-authored-by: Tina <59578595+tinaszheng@users.noreply.github.com>

* comments

* .

* lint error

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
Co-authored-by: Tina <59578595+tinaszheng@users.noreply.github.com>
2023-04-06 17:06:50 -04:00
Zach Pomerantz
972a65066c fix: do not double-report i18n exception (#6308) 2023-04-06 13:18:01 -07:00
eddie
39a212f762 fix: catch json parse error in fetchTokenList (#6278)
* fix: catch json parse error in fetchTokenList

* fix: refactor fetchTokenList and add more tests

* fix: import in test

* fix: comments and names

* fix: comment format

* fix: comment formatting
2023-04-06 11:15:39 -07:00
Jack Short
c362f4fe39 chore: removing unnecessary data in assets query (#6301)
* chore: removing unnecessary data in assets query

* no smallimageurl

* disabling nft drawer loading initially on nft pages

* removed too much

* renaming

* fix missing rank
2023-04-06 14:04:16 -04:00
eddie
271ef580e1 fix: make token list version bump error quieter (#6271)
* fix: use console.debug for expected transient error

* fix: add tests

* fix: name and lints
2023-04-06 10:26:56 -07:00
Zach Pomerantz
81ced4cb8b test(e2e): configure cypress test retries for CI (#6305)
test: configure retries for cypress CI
2023-04-06 09:30:07 -07:00
cartcrom
ab214a8133 fix: only use local txs for current account (#6284)
* fix: only use local txs for current account

* refactor: remove unecessary try/catch

* fix: add back try/catch
2023-04-06 11:43:39 -04:00
eddie
1b2d86ae3a feat: remove amplitude swap error logging (#6306) 2023-04-05 16:09:07 -07:00
Zach Pomerantz
40cac44e07 docs: use comments for pull_request_template (#6304)
* docs: use comments for pull_request_template

* docs: update
2023-04-05 09:12:38 -07:00
eddie
4e6d28cff4 feat: Update pull_request_template.md (#6302)
Update pull_request_template.md

add notes about testing mobile layouts to the test plan prompts
2023-04-04 14:57:47 -07:00
eddie
709fad0804 test: add unit test coverage to some redux state files (#6285) 2023-04-04 09:46:24 -07:00
Zach Pomerantz
573f4c873a fix: omit failed eth_blockNumber calls from sentry (#6267)
* build: upgrade sentry

* fix: omit failed eth_blockNumber calls from sentry

* test: beforeSend

* fix: bring to parity with #6281

* docs: type filterKnownErrors to beforeSend
2023-04-03 15:12:33 -07:00
eddie
d300db669f fix: z index issue with socks icon (#6295) 2023-04-03 15:12:22 -07:00
eddie
fb8217ddea fix: dont block trade when price impact is favorable (#6261)
* fix: dont block trade when price impact is favorable

* fix: add comment
2023-04-03 14:13:27 -07:00
Jordan Frankfurt
7b9a23d920 feat: reduce severity of phishing filter to allow url token names (#6282)
* feat: reduce severity of phishing filter to allow url token names

* tests

* remove unused var from test

* test rendering mini portfolio pools list

* update owner

* update variable names to match cmcewen's suggestions

* checkStringForURL -> hasURL
2023-03-31 12:59:02 -05:00
Connor McEwen
120ad935fa revert: "fix: mini portfolio layout fixes" (#6279)
Revert "fix: mini portfolio layout fixes (#6260)"

This reverts commit fb05439d32.
2023-03-30 18:47:42 -04:00
cartcrom
4eaf16b624 fix: injection detection bug (#6276)
* fix: use functions to check injection status rather than static vars

* fix: unnused field

* fix: don't prompt mm install for generics

* fix: generic injector function

* fix: display name for MM on cb browser

* fix: re-add ios mobile check for uniswap wallet

* fix: reword comment

* fix: refactor delayed-injection test

* feat: added comments

* fix: revert to minimal changes

* fix: update tests
2023-03-30 17:50:20 -04:00
Connor McEwen
857e2915ab fix: put environment in the wrong place (#6277)
* fix: put environment in the wrong place

* move to proper step
2023-03-30 16:54:45 -04:00
Connor McEwen
7410c81b42 chore: update workflow release env (#6275) 2023-03-30 15:43:18 -04:00
eddie
fb05439d32 fix: mini portfolio layout fixes (#6260)
* fix: mini portfolio layout fixes

* feat: refactor MP drawer CSS
2023-03-30 12:07:02 -07:00
eddie
fb7eade70b fix: l2 icon borders in MP (#6254)
* fix: l2 icon borders in MP

* fix: bool logic

* fix: comments and add test

* fix: change variable name

* fix: split l2 icon into two components
2023-03-30 11:59:46 -07:00
eddie
bd2b2c487a fix: close MP drawer on nft nav (#6251)
* fix: close MP drawer on nft nav

* fix: make callbacks optional, rename props

* fix: improve card API

* fix: add e2e test
2023-03-29 15:08:30 -07:00
eddie
2f004ed1d9 fix: remove deprecated default imports from zustand (#6270)
* fix: replace default imports from zustand

* fix: add eslint rule

* fix: typo

o
2023-03-29 13:25:30 -07:00
Zach Pomerantz
db257c73f2 fix: improve chain id error (#6266)
* build: upgrade sentry

* fix: improve chain id error
2023-03-29 12:38:33 -07:00
Zach Pomerantz
7c37b9d00e build: upgrade sentry (#6264)
* build: upgrade sentry

* chore: comment nits
2023-03-29 11:05:13 -07:00
Connor McEwen
7688c527f0 chore: update codecov yaml (#6262)
chore: set patch coverage to 80%, lower tolerance threshold, remove unused keys
2023-03-29 11:31:27 -04:00
eddie
06dd41a9cd fix: getCurrency crash when token not found (#6263)
* fix: getCurrency crash when token not found

* fix: comments and add test

* fix: remove extra whitespace in unit test

* fix: make e2e test pass
2023-03-28 18:44:48 -07:00
eddie
850fec40a9 fix: remove price tag from nft cards in the side drawer (#6252)
* fix: remove price tag from nft cards in the side drawer

* fix: decouple price from display logic

* fix: missing file chaneg

* fix: add tests
2023-03-28 09:26:32 -07:00
yyip-dev
3c7eabc3d8 docs: Update PR template (#6235)
* Update PR template

* Add screen capture section and simplify descriptions

* Link out to PR title conventions & remove monitoring section
2023-03-28 11:31:11 -04:00
Jordan Frankfurt
048607080c feat: add query param to disable the nft sections of the app (#6225)
* feat: add queryparam to disable the nft sections of the app

* fix

* include mini portfolio

* add comments explaining nft disable atom usage and suggesting future work

* add subtitle exception to landing page and correct the bool

* update comment

* comment syntax nits
2023-03-27 20:54:39 -05:00
eddie
a0f20c54d8 feat: implement new designs for tx notifs (#6232)
* feat: re-add transaction activity popups

* feat: implement new designs for tx notifs

* fix: address comments

* fix: remove color from alert icon

* fix: nits

* fix: remove null check

* fix: fix
2023-03-27 13:56:52 -07:00
Zoltan Arvai
da79abbc0d feat: adds Ledger Connect to non-MetaMask wallet list (#6257)
feat: add Ledger Connect to non-MetaMask wallet list
2023-03-27 16:16:30 -04:00
Vignesh Mohankumar
5ac08e1142 fix: link to lowercase chain name from position page (#6195)
* fix: link to lowercase chain name from position page

* fix: use existing const
2023-03-27 14:41:03 -04:00
eddie
d330eea375 feat: re-add transaction activity popups (#6223) 2023-03-27 10:07:41 -07:00
eddie
35dace7bfe feat: cypress test coverage reporting (#6212)
* wip

* fix: only instrument thru babel in test and dev

* fix: remove unused deps

* fix: yarn dedup

* fix: remove nyc_output dir from git

* fix: remove comment from index.html
2023-03-27 09:48:02 -07:00
Vignesh Mohankumar
8ce8e17f62 fix: Revert to previous Nav menu (#6258)
* fix: revert nav

* lint

* fix

* fix
2023-03-27 12:32:01 -04:00
Vignesh Mohankumar
eb105b6ec7 fix: align /pools CTAs to the top (#6253)
* fix: align /pools CTAs to the top

* connor comments

* Revert "connor comments"

This reverts commit e8f25e8fa1.
2023-03-24 18:33:28 -04:00
eddie
267e7de2b6 feat: remove unicon tooltip entirely (#6250) 2023-03-24 13:11:21 -07:00
lynn
ab9f2af054 fix: modify mini portfolio pools row event properties (#6248)
* init

* use memo
2023-03-24 15:49:38 -04:00
Connor McEwen
67b405dd42 chore: update codeowners (#6247) 2023-03-24 12:18:07 -04:00
lynn
281dbf4305 feat: remove tax service toast, modal, and menu item (#6244)
* init

* fix
2023-03-24 11:50:07 -04:00
lynn
369f2d7dfa fix: update tax copy again (#6241)
init
2023-03-23 20:29:37 -04:00
Jordan Frankfurt
803c749b13 fix: remove backend name check from badge flag (#6236)
* fix: remove backend name check from badge flag

* drop undefined check

* drop bool cast
2023-03-23 17:01:09 -05:00
lynn
8818dadf24 fix: update tax services copy (#6239)
init
2023-03-23 17:39:22 -04:00
Jordan Frankfurt
d179fc6b84 fix: don't show the add liquidity warning when no position currently … (#6238)
fix: don't show the add liquidity warning when no position currently exists
2023-03-23 16:18:35 -05:00
Jordan Frankfurt
18ec675c52 feat: warn when adding liquidity to an unowned LP position (#6219)
* feat: warn when adding liquidity to an unowned LP position

* update boolean name

* use a better address equivalence check
2023-03-23 12:09:22 -05:00
lynn
1a79bac893 feat: add additional mini portfolio events (#6233)
* add events

* update nft logging

* fix lint

* mikes comments
2023-03-23 12:34:59 -04:00
Jordan Frankfurt
bbf49b0477 feat: use new consolidated signing endpoint (#6222)
feat: use new consolidate signing endpoint
2023-03-22 21:41:17 -05:00
Jordan Frankfurt
7ee41abd99 feat: design refresh on pool list items (#6230)
* update LP tags

* design feedback
2023-03-22 20:48:31 -05:00
Jordan Frankfurt
581c0982db fix: add url name filtering to mini-portfolio (#6231)
* fix: add url name filtering to mini-portfolio

* Update src/components/WalletDropdown/MiniPortfolio/Pools/index.tsx

Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com>

* fix: remove unused deps (#6227)

* init

* remove one more useless dep

* bump up test size

* bump up test size

* up size

* fix lint and add str == undefined case to hasURL

---------

Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com>
Co-authored-by: lynn <41491154+lynnshaoyu@users.noreply.github.com>
2023-03-22 20:47:54 -05:00
eddie
478a05a34f fix: crash in nft listing flow (#6234)
* fix: crash in nft listing flow

* fix: rename test
2023-03-22 16:45:39 -07:00
lynn
5d6664019e fix: remove unused deps (#6227)
* init

* remove one more useless dep

* bump up test size

* bump up test size

* up size
2023-03-22 18:32:27 -04:00
Jordan Frankfurt
0cc187a7cb feat: add 1bps pool to arbitrum (#6224) 2023-03-22 17:01:33 -05:00
cartcrom
f3e09a90e2 fix: use correct chain var when switching (#6229) 2023-03-22 17:06:06 -04:00
Jordan Frankfurt
17db102484 fix: update url regex to correctly match URLs (#6220)
* fix: update url regex to correctly match URLs

* add test

* more test cases and better comment explanation
2023-03-22 14:05:27 -05:00
Jordan Frankfurt
e8ca84ee07 fix: update theme gold400 value (#6213)
fix: update theme gold200 value
2023-03-22 12:23:12 -05:00
Vignesh Mohankumar
dae7314aa9 feat: show error state when on invalid position (#6214) 2023-03-22 12:02:18 -04:00
cartcrom
32e6237624 feat: 🤑 Portfolios 🖼 (#6216)
* feat: squash mgtm differences w/ public repo into new base commit to fix rebase issues going forward

* feat: new settings menu (#85)

* feat: new settings flow

* feat: add statsig geo gate for MGTM assets (#91)

* init
* feat: geo-gate mgtm features & wallet tab

* feat: new theme toggle (#86)

* feat: new theme toggle

* fix: import

* refactor: polish

* refactor: use enum instead of string union

* feat: mini portfolio tabs (#88)

* feat: mini portfolio tabs

* feat: feature flag

* feat: portfolio query (#89)

* feat: portfolio balance query

* polish

* fix: added todo for api key

* feat: tokens mini-portfolio tab (#93)

* feat: tokens tab

* fix: lint

* fix: pr comment polish

* fix: snapshot update

* feat: common portfolio row component (#99)

* feat: porfolio row component

* fix: updated layout

* feat: update token row design (#100)

* feat: porfolio row component

* fix: updated layout

* fix: updated tokens tab to latest design

* fix: unnused export

* feat: dropdown drawer (#95)

* inital drawer

* feat: animated drawer

* fix: attempt animation perf fix

* fix: lint

* feat: better animations

* fix: scrim

* refactor: const name

* test: update chain switcher test

* test: update chain switcher test id

* feat: Add NFT tab for mini porftolio (#104)

* add NFT tab

* add min width to verified icon size

* add keyArgs to nftBalances query so that different callers dont override query cache

* revert yarn node changes

* use flex shrink

* move styled components to top

* navigate to nft page

* update snapshot test after adding gap to Row

* Update src/components/WalletDropdown/MiniPortfolio/NFT.tsx

Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com>

---------

Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com>

* fix scroll behavior (#105)

* feat: portfolio loading state (#106)

* feat: loading state for token row

* fix: revert hardcoded loading states

* fix: removed unused component

* feat: activity feed tab (#103)

* init

* feat: ens avatars

* feat: etherscan api experiment

* fix: ignore error policy

* polish

* fix: query pageSize

* fix: revert redux change

* fix: small polish item

* fix: pr comments

* fix: translated activity titles

* fix: typing and todo comment

* todo comment

* fix: accidental chain name mismatch

* feat: remove dropdown chevron (#110)

* feat: small drawer UI updates (#109)

* feat: small changes

* fix: resize status icon w/ ens

* fix: commented css

* feat: activity loading state (#108)

* feat: activity loading state

* fix: unused wrapper

* fix: activity/nftbalance cache overlap

* fix: mp sidebar width adjustment (#112)

* fix: mp sidebar width adjustment

* fix: navbar breakpoints

* feat: nav bar MenuDropdown updates (#107)

* feat: nav bar MenuDropdown updates

* fix: pool breakpoints

* fix: pool in menu dropdown

* fix: lints

* fix: tests

* feat: swap click updates (#111)

* feat: swap click updates

* fix: updates

* fix: simplify

* fix: snapshots

* fix: snapshots

* feat: collapse button (#113)

* feat: collapse button

* fix: esc keypress and animation

* fix: MP scrollbar (#115)

* feat: hide small balances in token list (#116)

* feat: collapse button (#113)

* feat: collapse button

* fix: esc keypress and animation

* chore: merge

* fix: updates

* feat: show the hidden tokens at the bottom

* feat: empty balance state for tokens (#118)

* feat: empty balance state for tokens

* fix: balance change check

* fix: token inputs on TDP widget (#120)

* feat: remove quick swap button (#125)

* fix: nft activity descriptor (#119)

* fix: improper substring usage error

* pr comments + small fix

* feat: add mini portfolio events (#126)

* add events

* fix failing snapshot test

* incorporate eddie comment

* fix chain switching (#127)

* feat: pre-parse activity to catch errors (#129)

* feat: update wallet option icons (#128)

* feat: update wallet option icons

* feat: theme-aware injected logo, svg logos

* fix: rabby extension

* feat: uni icons avatars (#130)

* feat: update wallet option icons

* feat: theme-aware injected logo, svg logos

* fix: rabby extension

* feat: update avatar / icon logic

* fix: remove testing hardcoded socks balance

* fix: add isTrustWallet check

* feat: pools tab (#122)

* init

* feat: working cross-chain calls

* feat: inline range text

* feat: better multicall perf

* feat: loading state

* feat: pools persist between mounts

* feat: polish

* fix: small refactors

* remove stuff to split into sep pr

* fix: remove comment

* fix: judo PR comments

* fix: currencyKey case

* fix: eddie's comment

* fix (#134)

* feat: removed microsite content, updated responsiveness for wallet tab (#137)

* fix: injector unit tests (#136)

* fix: injector unit tests

* fix: lint

---------

Co-authored-by: cartcrom <cartergcromer@gmail.com>

* feat: toggle closed positions (#138)

* rename file

* refactored hidden row to use for closed positions

* fix: remove unnused atom

* fix: lint

* feat: MP tab empty states (#132)

* feat: squash mgtm differences w/ public repo into new base commit to fix rebase issues going forward

* feat: new settings menu (#85)

* feat: new settings flow

* feat: add statsig geo gate for MGTM assets (#91)

* init
* feat: geo-gate mgtm features & wallet tab

* feat: new theme toggle (#86)

* feat: new theme toggle

* fix: import

* refactor: polish

* refactor: use enum instead of string union

* feat: mini portfolio tabs (#88)

* feat: mini portfolio tabs

* feat: feature flag

* feat: portfolio query (#89)

* feat: portfolio balance query

* polish

* fix: added todo for api key

* feat: tokens mini-portfolio tab (#93)

* feat: tokens tab

* fix: lint

* fix: pr comment polish

* fix: snapshot update

* feat: common portfolio row component (#99)

* feat: porfolio row component

* fix: updated layout

* feat: update token row design (#100)

* feat: porfolio row component

* fix: updated layout

* fix: updated tokens tab to latest design

* fix: unnused export

* feat: dropdown drawer (#95)

* inital drawer

* feat: animated drawer

* fix: attempt animation perf fix

* fix: lint

* feat: better animations

* fix: scrim

* refactor: const name

* test: update chain switcher test

* test: update chain switcher test id

* feat: Add NFT tab for mini porftolio (#104)

* add NFT tab

* add min width to verified icon size

* add keyArgs to nftBalances query so that different callers dont override query cache

* revert yarn node changes

* use flex shrink

* move styled components to top

* navigate to nft page

* update snapshot test after adding gap to Row

* Update src/components/WalletDropdown/MiniPortfolio/NFT.tsx

Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com>

---------

Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com>

* fix scroll behavior (#105)

* feat: portfolio loading state (#106)

* feat: loading state for token row

* fix: revert hardcoded loading states

* fix: removed unused component

* feat: activity feed tab (#103)

* init

* feat: ens avatars

* feat: etherscan api experiment

* fix: ignore error policy

* polish

* fix: query pageSize

* fix: revert redux change

* fix: small polish item

* fix: pr comments

* fix: translated activity titles

* fix: typing and todo comment

* todo comment

* fix: accidental chain name mismatch

* feat: remove dropdown chevron (#110)

* feat: small drawer UI updates (#109)

* feat: small changes

* fix: resize status icon w/ ens

* fix: commented css

* init

* feat: working cross-chain calls

* feat: inline range text

* feat: better multicall perf

* feat: activity loading state (#108)

* feat: activity loading state

* fix: unused wrapper

* feat: loading state

* feat: pools persist between mounts

* fix: activity/nftbalance cache overlap

* fix: mp sidebar width adjustment (#112)

* fix: mp sidebar width adjustment

* fix: navbar breakpoints

* feat: nav bar MenuDropdown updates (#107)

* feat: nav bar MenuDropdown updates

* fix: pool breakpoints

* fix: pool in menu dropdown

* fix: lints

* fix: tests

* feat: swap click updates (#111)

* feat: swap click updates

* fix: updates

* fix: simplify

* fix: snapshots

* fix: snapshots

* feat: collapse button (#113)

* feat: collapse button

* fix: esc keypress and animation

* fix: MP scrollbar (#115)

* feat: hide small balances in token list (#116)

* feat: collapse button (#113)

* feat: collapse button

* fix: esc keypress and animation

* chore: merge

* fix: updates

* feat: show the hidden tokens at the bottom

* feat: empty balance state for tokens (#118)

* feat: empty balance state for tokens

* fix: balance change check

* fix: token inputs on TDP widget (#120)

* feat: polish

* fix: small refactors

* remove stuff to split into sep pr

* fix: remove comment

* feat: remove quick swap button (#125)

* fix: nft activity descriptor (#119)

* fix: improper substring usage error

* pr comments + small fix

* feat: add mini portfolio events (#126)

* add events

* fix failing snapshot test

* incorporate eddie comment

* fix chain switching (#127)

* feat: pre-parse activity to catch errors (#129)

* fix: activity/nftbalance cache overlap

* fix: mp sidebar width adjustment (#112)

* fix: mp sidebar width adjustment

* fix: navbar breakpoints

* feat: nav bar MenuDropdown updates (#107)

* feat: nav bar MenuDropdown updates

* fix: pool breakpoints

* fix: pool in menu dropdown

* fix: lints

* fix: tests

* feat: swap click updates (#111)

* feat: swap click updates

* fix: updates

* fix: simplify

* fix: snapshots

* fix: snapshots

* feat: collapse button (#113)

* feat: collapse button

* fix: esc keypress and animation

* fix: MP scrollbar (#115)

* feat: hide small balances in token list (#116)

* feat: collapse button (#113)

* feat: collapse button

* fix: esc keypress and animation

* chore: merge

* fix: updates

* feat: show the hidden tokens at the bottom

* feat: empty balance state for tokens (#118)

* feat: empty balance state for tokens

* fix: balance change check

* fix: token inputs on TDP widget (#120)

* feat: remove quick swap button (#125)

* fix: nft activity descriptor (#119)

* fix: improper substring usage error

* pr comments + small fix

* feat: add mini portfolio events (#126)

* add events

* fix failing snapshot test

* incorporate eddie comment

* fix chain switching (#127)

* feat: pre-parse activity to catch errors (#129)

* feat: start empty state updates

* feat: update wallet option icons (#128)

* feat: update wallet option icons

* feat: theme-aware injected logo, svg logos

* fix: rabby extension

* feat: empty wallet states w/ good positioning

* feat: finish empty states w/ theme aware icons

* fix: judo PR comments

* fix: currencyKey case

* feat: uni icons avatars (#130)

* feat: update wallet option icons

* feat: theme-aware injected logo, svg logos

* fix: rabby extension

* feat: update avatar / icon logic

* fix: remove testing hardcoded socks balance

* fix: add isTrustWallet check

* fix: eddie's comment

* feat: pools tab (#122)

* init

* feat: working cross-chain calls

* feat: inline range text

* feat: better multicall perf

* feat: loading state

* feat: pools persist between mounts

* feat: polish

* fix: small refactors

* remove stuff to split into sep pr

* fix: remove comment

* fix: judo PR comments

* fix: currencyKey case

* fix: eddie's comment

* fix (#134)

* feat: removed microsite content, updated responsiveness for wallet tab (#137)

* fix: injector unit tests (#136)

* fix: injector unit tests

* fix: lint

---------

Co-authored-by: cartcrom <cartergcromer@gmail.com>

* fix: pool loading state

* fix: simplify pools loading state

* fix: removed unused var

* feat: toggle closed positions (#138)

* rename file

* refactored hidden row to use for closed positions

* fix: remove unnused atom

* fix: lint

* fix: dry

* fix: lint

* fix: address review comments

* fix: lints

* fix: bad merge

---------

Co-authored-by: cartcrom <cartergcromer@gmail.com>
Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com>
Co-authored-by: Tina <59578595+tinaszheng@users.noreply.github.com>
Co-authored-by: lynn <41491154+lynnshaoyu@users.noreply.github.com>

* make sure mp is above tax service banner (#142)

* feat: add git version number to settings menu (#141)

* fix: remove unicon tooltip (#146)

* feat: remove unicon tooltip from mobile and timer prop

* fix: flip bool logic

* fix: small nits for mp from fred (#150)

* fixes

* fix

* feat: Local tx activity (#148)

* local swap working

* feat: cross-chain

* fix: revert query changes

* feat: local approvals

* feat: wrapped activity

* feat: local lp tx history

* fix: add doc comment

* fix: linted

* fix: no pools render error (#152)

* feat: mp activity feed design tweaks  (#145)

* feat: squash mgtm differences w/ public repo into new base commit to fix rebase issues going forward

* feat: new settings menu (#85)

* feat: new settings flow

* feat: add statsig geo gate for MGTM assets (#91)

* init
* feat: geo-gate mgtm features & wallet tab

* feat: new theme toggle (#86)

* feat: new theme toggle

* fix: import

* refactor: polish

* refactor: use enum instead of string union

* feat: mini portfolio tabs (#88)

* feat: mini portfolio tabs

* feat: feature flag

* feat: portfolio query (#89)

* feat: portfolio balance query

* polish

* fix: added todo for api key

* feat: tokens mini-portfolio tab (#93)

* feat: tokens tab

* fix: lint

* fix: pr comment polish

* fix: snapshot update

* feat: common portfolio row component (#99)

* feat: porfolio row component

* fix: updated layout

* feat: update token row design (#100)

* feat: porfolio row component

* fix: updated layout

* fix: updated tokens tab to latest design

* fix: unnused export

* feat: dropdown drawer (#95)

* inital drawer

* feat: animated drawer

* fix: attempt animation perf fix

* fix: lint

* feat: better animations

* fix: scrim

* refactor: const name

* test: update chain switcher test

* test: update chain switcher test id

* feat: Add NFT tab for mini porftolio (#104)

* add NFT tab

* add min width to verified icon size

* add keyArgs to nftBalances query so that different callers dont override query cache

* revert yarn node changes

* use flex shrink

* move styled components to top

* navigate to nft page

* update snapshot test after adding gap to Row

* Update src/components/WalletDropdown/MiniPortfolio/NFT.tsx

Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com>

---------

Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com>

* fix scroll behavior (#105)

* feat: portfolio loading state (#106)

* feat: loading state for token row

* fix: revert hardcoded loading states

* fix: removed unused component

* feat: activity feed tab (#103)

* init

* feat: ens avatars

* feat: etherscan api experiment

* fix: ignore error policy

* polish

* fix: query pageSize

* fix: revert redux change

* fix: small polish item

* fix: pr comments

* fix: translated activity titles

* fix: typing and todo comment

* todo comment

* fix: accidental chain name mismatch

* feat: remove dropdown chevron (#110)

* feat: small drawer UI updates (#109)

* feat: small changes

* fix: resize status icon w/ ens

* fix: commented css

* feat: activity loading state (#108)

* feat: activity loading state

* fix: unused wrapper

* fix: activity/nftbalance cache overlap

* fix: mp sidebar width adjustment (#112)

* fix: mp sidebar width adjustment

* fix: navbar breakpoints

* feat: nav bar MenuDropdown updates (#107)

* feat: nav bar MenuDropdown updates

* fix: pool breakpoints

* fix: pool in menu dropdown

* fix: lints

* fix: tests

* feat: swap click updates (#111)

* feat: swap click updates

* fix: updates

* fix: simplify

* fix: snapshots

* fix: snapshots

* feat: collapse button (#113)

* feat: collapse button

* fix: esc keypress and animation

* fix: MP scrollbar (#115)

* feat: hide small balances in token list (#116)

* feat: collapse button (#113)

* feat: collapse button

* fix: esc keypress and animation

* chore: merge

* fix: updates

* feat: show the hidden tokens at the bottom

* feat: empty balance state for tokens (#118)

* feat: empty balance state for tokens

* fix: balance change check

* fix: token inputs on TDP widget (#120)

* feat: remove quick swap button (#125)

* fix: nft activity descriptor (#119)

* fix: improper substring usage error

* pr comments + small fix

* feat: add mini portfolio events (#126)

* add events

* fix failing snapshot test

* incorporate eddie comment

* fix chain switching (#127)

* feat: pre-parse activity to catch errors (#129)

* feat: update wallet option icons (#128)

* feat: update wallet option icons

* feat: theme-aware injected logo, svg logos

* fix: rabby extension

* wip

* feat: uni icons avatars (#130)

* feat: update wallet option icons

* feat: theme-aware injected logo, svg logos

* fix: rabby extension

* feat: update avatar / icon logic

* fix: remove testing hardcoded socks balance

* fix: add isTrustWallet check

* feat: pools tab (#122)

* init

* feat: working cross-chain calls

* feat: inline range text

* feat: better multicall perf

* feat: loading state

* feat: pools persist between mounts

* feat: polish

* fix: small refactors

* remove stuff to split into sep pr

* fix: remove comment

* fix: judo PR comments

* fix: currencyKey case

* fix: eddie's comment

* fix (#134)

* wip with activity status icons

* feat: removed microsite content, updated responsiveness for wallet tab (#137)

* fix: injector unit tests (#136)

* fix: injector unit tests

* fix: lint

---------

Co-authored-by: cartcrom <cartergcromer@gmail.com>

* temp

* in progress

* text, and activity status changes working. missing logo changes

* fix lint issues

* refactor: square logo location

* feat: merge other activity changes

---------

Co-authored-by: cartcrom <cartergcromer@gmail.com>
Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com>
Co-authored-by: Tina <59578595+tinaszheng@users.noreply.github.com>
Co-authored-by: eddie <66155195+just-toby@users.noreply.github.com>

* feat: portfolio polling/refetching/performance (#154)

* init

* feat: implement asset polling & tx updating balances

* add refetching to activity tab

* fix: re-add error policy

* fix: add TODO

* fix: fix scroll + console warnings on mini portfolio nfts (#155)

* fixes

* rename

* init (#158)

* fix: browser wallet icons (#156)

* fix: moved border radius css (#157)

* feat: token details state for BNB (#151)

* fix: update token details missing flow

* refactor

* fix: lint

* fix: add bnb to queries

* feat: add comment explaining unsupported chains

* fix: remove buy crypto animation (#160)

* fix: price display pools tab (#159)

* fix: price display pools tab

* fix: lint

* feat: pools tab performance (#123)

* init

* fix: pr comments

* update cache return type

* refactor: rename type

* fix: further pr comments

* fix: remove stringify

* refactor: readability and caching

* fix: zach pr comments

* fix: removed hardcoded value

* feat: catch position errors for chains

* fix: add todo comment for followup ticket

* fix: build issue from merge conflict

* refactor: split up token caching function

* feat: separate array slicing into util with tests

* feat: close wallet drawer on wallet connection (#161)

* feat: close wallet drawer on wallet connection

* feat: added comment explaining fetchPolicy

* fix: only close if open

* refactor: add comment about ref

* fix: revert change to useAllTokens & rename with more descriptive name (#163)

* fix: square Arbitrum logo design changes  (#162)

* feat: close wallet drawer on wallet connection

* feat: added comment explaining fetchPolicy

* fix: only close if open

* init

* fixes

* fix border radius

---------

Co-authored-by: cartcrom <cartergcromer@gmail.com>

* fix: token loading state (#165)

* fix: remove unnused code and comments

* fix: privacy policy date

* fix: revert readme change

* fix: remove unnused FOR file

* fix: missed query id

* fix: add id to portfolios query

* fix: widget cypress test

---------

Co-authored-by: Tina <59578595+tinaszheng@users.noreply.github.com>
Co-authored-by: eddie <66155195+just-toby@users.noreply.github.com>
Co-authored-by: lynn <41491154+lynnshaoyu@users.noreply.github.com>
2023-03-22 11:29:26 -04:00
Jordan Frankfurt
cee19aebe7 fix: improve fetch-schema logging and platform support (#6191)
* fix: improve fetch-schema logging and platform support

* don't use async/await because linter doesn't like it
2023-03-22 10:14:07 -05:00
Vignesh Mohankumar
b2fbba13a2 fix: set height on vote and v2 liquidity buttons (#6217) 2023-03-22 00:11:01 -04:00
github-actions[bot]
a15a6108c1 chore(i18n): new Crowdin translations (#6196)
* chore(i18n): synchronize translations from crowdin [skip ci]

* merge in translations

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: Yannie Yip <yannie.yip@uniswap.org>
2023-03-21 20:01:47 -04:00
eddie
46724cd8f6 feat: preserve input currency on TDP when navigating (#6209)
* fix: NPE when connector is undefined

* feat: retain input token when switching Token Detail Page

* fix: remove logic from string template
2023-03-21 16:31:28 -07:00
Jordan Frankfurt
09e6d38f25 feat: bnb network notif badge in search (#6210)
* feat: bnb network notif badge in search

* add chainname check
2023-03-21 17:08:11 -05:00
Jordan Frankfurt
236a4dc145 feat: add tax service discount to help menu (#6211) 2023-03-21 17:07:57 -05:00
eddie
991d07ef39 fix: use weth in e2e test (#6207) 2023-03-21 09:50:02 -07:00
Jordan Frankfurt
7f5707e551 feat: add BNB Chain placeholder to token explore network menu (#6198)
* feat: add BNB Chain placeholder to token explore network menu

* don't make badge .6 opacity
2023-03-21 12:18:06 -04:00
lynn
4050b1b241 fix: dismiss tax service toast after 1 dismissal instead of 3 (#6200)
* init

* add todo
2023-03-20 18:26:47 -05:00
Charles Bachmeier
a19aa303d9 feat: list 1155s (#6193)
* undisable 1155s and add nftStandard to CollectionRow

* working OS 1155 listing

* amend OS listing to handle 0 creator fee

* handle no royalties set

* disable already listed protection for 1155s

* can list to LR

* stuck on x2

* working x2y2

* remove comment

* add listing issue finding to helper fn

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-03-20 12:31:56 -07:00
dependabot[bot]
c7f67437fd build(deps): bump @uniswap/widgets from 2.48.5 to 2.49.0 (#6189)
Bumps [@uniswap/widgets](https://github.com/Uniswap/widgets) from 2.48.5 to 2.49.0.
- [Release notes](https://github.com/Uniswap/widgets/releases)
- [Changelog](https://github.com/Uniswap/widgets/blob/main/.releaserc.json)
- [Commits](https://github.com/Uniswap/widgets/compare/v2.48.5...v2.49.0)

---
updated-dependencies:
- dependency-name: "@uniswap/widgets"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-20 10:03:38 -07:00
Jordan Frankfurt
b5192a2b7d feat: update "Browser wallet" icons (#6194)
feat: update Browser wallet icons
2023-03-20 11:58:54 -05:00
Tina
cd92e4cf6f fix: Revert "feat: trace jsonrpc (#6159)" (#6190)
Revert "feat: trace jsonrpc (#6159)"

This reverts commit 6fee37c4b8.
2023-03-20 11:47:13 -04:00
Zach Pomerantz
089fba5dee test: parallelize cypress (again) with a consistent container (#6182)
* Revert "test: run cypress on one machine (#6181)"

This reverts commit a2812fcf79.

* test: use consistent container across cypress-test-matrix

* test: condition cypress-tests on cypress-test-matrix

* test: check cypress-test-matrix

* debug: cypress-test-matrix.result

* test: fix error

* test: fix error

* test: fix error

* test: fix error

* test: fix error

* test: fix error
2023-03-17 13:09:20 -07:00
cartcrom
503a33314f fix: use proper apollo client for ticks query (#6185)
fix: pass thegraph client to ticks query instead of default
2023-03-17 14:29:46 -04:00
Zach Pomerantz
6fee37c4b8 feat: trace jsonrpc (#6159)
* feat: maybeTrace

* feat: maybeTrace jsonrpc

* docs: maybeTrace

* test: fix test typing

* fix: pr feedback
2023-03-16 22:16:41 -07:00
Zach Pomerantz
a2812fcf79 test: run cypress on one machine (#6181)
* test: run cypress on one machine

* build: turn off parallel cypress
2023-03-16 21:10:36 -07:00
Vignesh Mohankumar
c42aeae96a fix: update useIsPoolsPage hook (#6179)
* fix: update `useIsPoolsPage` hook

* rename file
2023-03-16 19:36:07 -04:00
Vignesh Mohankumar
80ab000d34 fix: back button should lead to /pools not /pools/v2 (#6171) 2023-03-16 18:47:28 -04:00
eddie
81206f1eef test: widget integration tests (#6145)
* feat: upgrade widget

* test: swap widget integration tests

* test: handle conditional token safety warning

* fix: yarn dedup

* fix: try reformatting cy commands

* test: try waiting for page to load

* fix: update test

* fix: update test

* fix: test
2023-03-16 15:19:02 -07:00
Vignesh Mohankumar
568b05fda1 feat: support both /pool and /pools (#6173)
* more

* change locally
2023-03-16 18:08:10 -04:00
Vignesh Mohankumar
3d0ca21036 fix: remove Create a pool menu option (#6168) 2023-03-16 18:01:54 -04:00
Vignesh Mohankumar
8b743615d1 fix: link to providing liquidity help doc (#6169) 2023-03-16 18:01:46 -04:00
eddie
9e4fdabc34 feat: upgrade widget (#6176)
* feat: upgrade widget

* fix: yarn dedup
2023-03-16 14:05:52 -07:00
lynn
decb922d4b fix: handle undefined tax service banner counter in state (#6178)
* fix

* use ternary

* update
2023-03-16 16:42:43 -04:00
Vignesh Mohankumar
ac50555647 fix: equal width for CTA tiles on /pool (#6170) 2023-03-16 16:07:17 -04:00
Vignesh Mohankumar
f48356d0fb feat: link to token details from /pool/{} (#6162)
* feat: link to token details from /pool/{}

* use backend chain names

* use fn
2023-03-16 15:36:55 -04:00
Jack Short
a362f8797a chore: refactoring bag (#6039)
* chore: refactoring bag component to sub components (#6027)

* moving totalEthPrice to hook

* moving everything from bag to bag footer

* moving transaction state to sep hook

* explicit type

* itemsInBag

* fixing transaction tracking

* chore: refactor useFetchAssets to make it more readable (#6043)

* chore: refactoring useFetchAssets to make it more readable

* remvoing eslint stuff

* extracting what can be

* comments

* removing feature flag

* changing return type of useUsd hook

* zustand shallow
2023-03-16 14:39:50 -04:00
Jack Short
783f42abcc fix: cards floating point error (#6174) 2023-03-16 14:39:24 -04:00
Tina
0923cf4ac9 fix: Auto-slippage logic (#6167)
* range auto slippage from [.1% to 5%] and multiply gas by 110% instead of 10%

* remove newline

* no multiplier on gas, add comments

* consolidate constant variables
2023-03-16 12:46:59 -04:00
cartcrom
801958d0ae fix: skip when address undefined (#6172)
* fix: skip when address undefined

* fix: add back lowercase

* fix: use ms

* update loading var name
2023-03-16 09:33:47 -07:00
Zach Pomerantz
8392c29a1e feat: omit unnecessary sentry logs (#6166)
* fix: omit gracefully handled events from sentry

* fix: log locale load exception to sentry
2023-03-16 09:25:50 -07:00
Charles Bachmeier
8d36edf2b7 chore: remove no longer used anayltics query (#6165)
* chore: remove no longer used anayltics query

* Remove from index

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-03-15 18:30:28 -06:00
Charles Bachmeier
0f8d3fa506 fix: add more null checks for trending collections gql query (#6164)
add more null checks for trending collections gql query

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-03-15 18:30:01 -06:00
Zach Pomerantz
5f64149f39 feat: trace quote (#6160)
* feat: trace quote

* fix: include more data
2023-03-15 17:09:22 -07:00
Zach Pomerantz
7115729e3e feat: trace swap.send (#6147)
* feat: trace swap.send

* docs: comments

* test: sentry transaction trace

* fix: tag as non-widget

* fix: nits

* refactor: brackets

* fix: type TraceTags

* docs: traceTransaction

* chore: transaction->span

* docs: even more docs

* fix: is_widget
2023-03-15 16:39:04 -07:00
Zach Pomerantz
6618135e7d feat: enable sentry via .env.production (#6163)
* build: alphabetize

* fix: rm SENTRY_ENABLED as it defaults to false

* feat: enable sentry via .env.production

* test: do not send events from e2e tests

* fix: negation
2023-03-15 11:59:48 -07:00
Jordan Frankfurt
d3085c1f3c feat: Add BNB Network support (#6036)
* Support BNB Chain

* Update Interface with BNB Chain

* use SupportedChainId from sdk

* yarn-deduplicate

* add rpc urls

* add support for arbitrum goerli

* add arbitrum_goerli to jsonrpc list

* remove eslint disables

* remove non-existent gql gen Chain type

* fix import issues

* fix test

* Update src/utils/getExplorerLink.ts

Co-authored-by: Tina <59578595+tinaszheng@users.noreply.github.com>

* add quicknode rpc as primary

* bump universal router sdk to support bnb chain

* add correct network name for asset repo indexing

* add v3 smart order router

* yarn-deduplicate --strategy=highest

* let ethersproject stuff update

* remove safety test that is no longer relevant

* update network info link

* fix block explorer stuff, fix light theme

* add subgraph support

* update quicknode rpc

* update the wrapped BNB token symbol to WBNB

* update useStablecoinPrice api to support loading states

* update useStablecoinPrice api to support loading states

* Revert "update useStablecoinPrice api to support loading states"

This reverts commit c1fa6297d0.

* Revert "update useStablecoinPrice api to support loading states"

This reverts commit 2e703552b5.

* fix copy and quote token for non-eth networks

* add coingecko bnb list

* fix: design treatment from @infredible for bnb support (#6052)

merging in current state--can merge again when the rest is ready

* fix info site links

* fix: don't show a price impact warning if the user is (un)wrapping

* finish switching to chains/constants

* fix chainId test

* fred's bnb background colors

* pr feedback from zzmp

* update sdk-core

* remove unused image

* update bnb chain asset url extension

* new addresses

* fix test and patch sdk-core version to use BNB instead of BSC

* checking in this weird schema file--maybe a mistake?

* remove temp file

* fix bases

* fix network bridge alert text color

* fix: widget defaultToken resetting on TDP

---------

Co-authored-by: ILIA.eth <4621066+ilyamk@users.noreply.github.com>
Co-authored-by: Tina <59578595+tinaszheng@users.noreply.github.com>
Co-authored-by: lynn <41491154+lynnshaoyu@users.noreply.github.com>
Co-authored-by: Tina Zheng <tina.s.zheng+github@gmail.com>
Co-authored-by: Eddie Dugan <eddie.dugan@uniswap.org>
2023-03-15 09:00:09 -05:00
Vignesh Mohankumar
813aeda012 feat: use tx formatting for PositionPage cards (#6142)
* tooltip

* add numberType

* try again

* eslint

* one more
2023-03-14 21:57:13 -04:00
Tina
13d3e75ada fix: Eth price fetch cache miss and use default fetch policy to remove extra network requests (#6157) 2023-03-14 20:43:08 -04:00
github-actions[bot]
8c55c70a1e chore(i18n): new Crowdin translations (#6000)
* chore(i18n): synchronize translations from crowdin [skip ci]

* merge in translations

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: Yannie Yip <yannie.yip@uniswap.org>
2023-03-14 18:25:40 -04:00
Charles Bachmeier
18939aa871 feat: Migrate NFT Activity to GraphQL (#6103)
* add new activity query

* add nftactivity hook and fix query

* converted activity type to accept optionals, hook should return activity type

* single asset activity

* relaystylepagination

* working on local endpoint

* working timestamps

* updated endpoint

* use correct env var

* undo asset testing

* forgot last

* undo more testing

* don't break on null address

* working loading state

* better loading states

* handle marketplace type update

* remove types

* properly format price and reduce redundancy

* handle null price

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-03-14 14:07:32 -07:00
Tina
bc251230da fix: Remove block number check for quotes (#6148)
* remove block number check

* add refetchOnMountOrArgChange
2023-03-14 16:30:31 -04:00
Charles Bachmeier
b0aea5f62a feat: add infringing collection to blocklist (#6151)
add infringing collection to blocklist

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-03-14 13:06:38 -07:00
Jack Short
b963d3b27b feat: cards v2 (#6048)
* initial setup

* forgot border

* cta

* rough draft

* adding marketplace container and selector

* removing last sale

* details link

* marketplace icons

* removing hovered

* adding icons

* removing unused exports

* fixing hover

* not linking to details

* linting

* mobile

* moving cards to component

* linting

* profile cards

* deleting cards

* fixing imports

* actually fixing imports

* tryingn to fix linting errors

* disabling module export for this file

* fixing build

* seems to hate uppercase C

* fixing tests

* passing data-testid correctly

* tertiary info

* removing the extra times

* button states

* adjusting tertiary

* pointer-events

* border animation

* variance bug

* cryptopunks

* unavailable for listing

* disabled cta

* set heihgt

* animated slide up

* animation

* badge changes

* shadows

* ran yarn

* removing eslint comment

* removing types and hooks

* removing from cache

* small tweaks

* removing unused tertiary info

* initial comment addressing

* more comments

* translations

* refactoring file structure

* removing trans tag

* reverting to what it prev was

* text-shadow

* eslint ignore

* updating size test
2023-03-14 15:38:39 -04:00
Charles Bachmeier
799edfb493 fix: don't fire off a graphql query on an empty search (#6152)
don't fire off a graphql query on an empty search

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-03-14 12:38:13 -07:00
Jordan Frankfurt
1e25436421 feat: injected -> browser wallet w/ icon updates (#6155)
* feat: injected -> browser wallet w/ icon updates

* update tests
2023-03-14 14:08:49 -05:00
Zach Pomerantz
ee2dc1ee17 feat: pageload performance tracing (#6146)
* build: add @sentry/tracing

* feat: turn on pageload tracing

* feat: simple trace abstractions

* fix: set sample rate in .env

* fix: rm unused trace

* fix: bump size for new deps

* fix: unnecessary line
2023-03-14 11:39:58 -07:00
cartcrom
4bdef2b601 fix: pricing sources (#6156)
* Revert "fix: "revert feat: Use ETH based pricing instead of USDC based pricing for quote USD values (#6132) (#6150)"

This reverts commit 645d92185a.

* Revert "fix: Use non-subgraph fields for calculating USD prices on explore and token details pages (#6134)"

This reverts commit 5c8b45c8e5.
2023-03-14 14:37:58 -04:00
eddie
acc6b0a740 fix: reset to defaultTokens when chain changes (#6154) 2023-03-14 11:18:50 -07:00
Jordan Frankfurt
645d92185a fix: "revert feat: Use ETH based pricing instead of USDC based pricing for quote USD values (#6132) (#6150)
* Revert "feat: Use ETH based pricing instead of USDC based pricing for quote USD values (#6132)"

This reverts commit a8864614c1.

* revert isLoading api

* fix lint errors

* fix loading state
2023-03-14 13:44:44 -04:00
lynn
145c96caa6 fix: tax promo banner updates (#6144)
* init

* update unit test

* fix hover states, fix landing pg behavior

* wip

* fix hook

* rename tax service hook

* fix typo

* remove left and right borders on mobile

* fix height of inner container on mobile
2023-03-14 11:50:43 -04:00
cartcrom
c3ae545b68 fix: fetch same tokens for topTokens and sparkline queries (#6135)
* fix: fetch same tokens for topTokens and sparkline queries

* fix: updated comment
2023-03-13 16:38:39 -04:00
Tina
2a04f0faca fix: loading states for USD prices (#6141)
* set loading state in usdc price fetch

* remove console log

* use 100 for polygon

* use 10k for polygon
2023-03-13 15:18:20 -04:00
Zach Pomerantz
1d2d1259e5 fix: set user properties before event properties (#6143) 2023-03-13 11:30:58 -07:00
Jordan Frankfurt
10eda002f5 fix: full range lp shortcut (#6136)
* fix: fix full range LP

* make a dedicated hook for syncing query parameters

* sync full range button to url

* add comment explaining lint rule disable
2023-03-13 12:36:45 -05:00
eddie
b5f665bc6e fix: allow defaultTokens to reset state in Widget (#6131)
fix: tdp widget bug
2023-03-13 10:31:15 -07:00
lynn
bf337f2865 fix: fix overflowing lp ui (#6138)
* fix

* incorporate comments from jordan + tina
2023-03-13 11:47:19 -04:00
Tina
5c8b45c8e5 fix: Use non-subgraph fields for calculating USD prices on explore and token details pages (#6134)
* use non subgraph fields for querying usd prices

* undefined check

* remove unuecessary logoUrl field

* remove outdated test

* fix: switch recently fetched tokens to token project market & update missing chart message

---------

Co-authored-by: cartcrom <cartergcromer@gmail.com>
2023-03-11 14:01:38 -05:00
Tina
2eb5ff3c5c fix: USD price for WETH + don't call gql for testnets (#6133)
fix weth + dont call gql for testnets
2023-03-11 12:04:28 -05:00
Tina
a8864614c1 feat: Use ETH based pricing instead of USDC based pricing for quote USD values (#6132)
* add eth denominated usd pricing mecanism

* fix usd value change and trade price calculations

* remove console log

* break out 10k into constant

* put back faulty block number check for now - separate PR

* add 1 min poll interval

* use lib/utils/tryParseCurrencyAmount

---------

Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com>
2023-03-11 01:53:47 -06:00
Jordan Frankfurt
19d25de1d9 chore: bump dep versions (#6128)
* chore: bump dep versions

* drop sdk-core

* checkout lock from main, yarn i, dedupe
2023-03-10 19:20:42 -06:00
Vignesh Mohankumar
a9e7c6f560 chore: remove deprecated zustand import (#6129) 2023-03-10 18:42:59 -05:00
Vignesh Mohankumar
333c3a289a fix: check if supported chainId before calling universal-router-sdk (#6126) 2023-03-10 16:58:59 -05:00
Vignesh Mohankumar
d06451cb98 refactor: remove universal-router logic in pay with any token flag (#6127) 2023-03-10 16:44:41 -05:00
shortcircuit
c1297b2aa3 fix: Use html for linking to tax services (#6124)
* Use html for linking to tax services

* Add target blank

* styling

* override default styling

---------

Co-authored-by: Lynn Yu <lynn.yu@uniswap.org>
2023-03-10 13:57:48 -05:00
lynn
6ab6f4daa5 fix: Revert "fix: use chain query param properly when activating" (#6122)
Revert "fix: use `chain` query param properly when activating (#6114)"

This reverts commit ae559d164a.
2023-03-10 11:32:31 -05:00
Vignesh Mohankumar
ae559d164a fix: use chain query param properly when activating (#6114)
* fix: use `chain` query param properly when activating

* move

* Update src/hooks/useSyncChainQuery.ts

Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com>

---------

Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com>
2023-03-09 22:24:14 -05:00
Zach Pomerantz
a90318cbe9 fix: update test-size (#6118)
* fix: update test-size

* fix: update main size
2023-03-09 14:49:39 -08:00
Zach Pomerantz
93cf4b358e build: ignore types and hooks and update test-size (#6117)
build: gitignore types and hooks
2023-03-09 14:27:46 -08:00
Vignesh Mohankumar
ad8aff0b90 chore: update graphql types (#6115) 2023-03-09 16:50:14 -05:00
lynn
8757e413bb feat: tax service toast + modal (#6101)
* working

* unused export

* remove fiat on ramp toast

* design feedback tweaks

* add test + final design tweaks from fred

* add back fiat on ramp modal

* temp

* remove temp

* remove fiat on ramp stuff

* add back modal

* remove fiat on ramp ack from reducer

* respond to jordan

* mobile full width

* add feature flag

* fixes

* TESTING FEATURE FLAG

* testing w blair

* add stat sig server to prod env

* testing stat sig, wait for initialization

* revert stat sig testing stuff

* fix
2023-03-09 14:19:45 -05:00
Vignesh Mohankumar
78ac7650ee fix: remove full range warning in AddLiquidity (#6113)
* fix: remove full range warning in AddLiquidity

* rm button yellow
2023-03-09 13:59:03 -05:00
Jordan Frankfurt
f3e9b513ba fix: dont fetch a route for wrap transactions (#6102)
* fix: dont fetch a route for wrap transactions

* refactor logic into useBestTrade

* add mock for useWeb3React

* remove unnecessary diff

* fix tests

* Update src/hooks/useBestTrade.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update src/hooks/useBestTrade.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* remove unnecessary wethContract reference

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-03-09 11:16:33 -06:00
Annie Ke
412a10e0d9 fix: change optimism goerli addresses to actual deploy (#5542)
* fix: change optimism goerli addresses to actual deploy

* Update addresses.ts

---------

Co-authored-by: Vignesh Mohankumar <me@vig.xyz>
2023-03-09 11:56:15 -05:00
Jesse
411b690ae4 chore: update Celo logo with new version (#6111)
Update Celo logo SVG with new version
2023-03-09 11:38:34 -05:00
Tina
b721824c7f feat: Add USD amounts to swap analytics (#6108) 2023-03-09 10:07:46 -05:00
Charles Bachmeier
2451a5c9ec chore: Remove limit from topCollections query (#6104)
the limit does not exist

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-03-08 17:19:44 -08:00
eddie
d62dd585ea feat: upgrade widget again (#6106) 2023-03-08 15:43:44 -08:00
Zach Pomerantz
6ba3c6cf93 chore: group third-party initializations (#6097)
* chore: clean up 3P initialization

* chore: integrations
2023-03-08 13:45:04 -08:00
Charles Bachmeier
e069ba1153 feat: NFT Collection Search via GraphQL (#6081)
* add new search query and formatting helper fn

* working search

* skip gql search if not enabled

* minimize query

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-03-08 10:34:53 -08:00
Mike Grabowski
4ebc467c58 feat: implement Sentry for state tracking (#6015)
* feat: add sentry middleware

* chore: remove file

* chore: reorg

* chore: update txt

* chore: fix types

* chore

* chore: normalize

* add todo

* Update src/state/logging.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update src/state/logging.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* chore: update type

* nits

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-03-08 12:28:40 +04:00
Vignesh Mohankumar
7b7e4e61d2 chore: derive SupportedChainId from sdk-core (#6091)
* chore: derrive SupportedChainId from sdk-core

* fix

* fix more types

* wip

* Revert "wip"

This reverts commit dccd83f6ac.

* Revert "fix more types"

This reverts commit 4f11b5a10c.

* fix: use literal enum for derived types

* Update src/components/NetworkAlert/NetworkAlert.tsx

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-03-07 20:19:06 -05:00
Vignesh Mohankumar
e8936f500b chore: upgrade widgets (#6099) 2023-03-07 20:18:55 -05:00
Charles Bachmeier
3d8a5ed6fe feat: Support listing to Seaport v1.4 (#6094)
* upgrade seaport

* working 1.4 listing

* update OS fee to 0%

* update zone to null addr

* update var name

* rounding bug

* unused exports

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-03-07 16:34:38 -08:00
eddie
c3d2c43861 fix: unsupported chain bugs (#6098)
* feat: upgrade widget again

* fix: verify chainId is supported
2023-03-07 16:02:06 -08:00
Zach Pomerantz
de5816e573 feat: export window.GIT_COMMIT_HASH (#6080) 2023-03-07 13:54:59 -08:00
eddie
5a2f81c4bf fix: show error message when token is not found (#6057)
* fix: show error message when token is not found

* fix: make onContinue optional
2023-03-07 13:04:51 -08:00
eddie
c34742c23b chore: add reviewers to dependabot PRs (#6095)
* chore: add reviewers to dependabot PRs

* chore: update dependabot reviewers to team

* fix: remove web tokens

* Update .github/dependabot.yml

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-03-07 12:45:36 -08:00
Vignesh Mohankumar
6225462645 chore: upgrade web3-react, zustand (#6090)
fix
2023-03-07 15:31:41 -05:00
eddie
c21b9379fd feat: add Peer Wallet Name to WALLET_CONNECT_TXN_COMPLETED event (#6084)
* feat: add Peer Wallet Name to WALLET_CONNECT_TXN_COMPLETED event

* fix: yarn dedup

* feat: use agent instead of name

* fix: rename name to agent
2023-03-07 10:48:49 -08:00
Vignesh Mohankumar
1610356a18 fix: Revert "fix: deep link by swapping sooner after user interaction" (#6092)
Revert "fix: deep link by swapping sooner after user interaction (#6073)"

This reverts commit 3eeb467266.
2023-03-07 13:29:10 -05:00
Jack Short
1b8cee7e87 fix: react router updated appropriate fix (#6086) 2023-03-07 13:05:54 -05:00
Zach Pomerantz
a7c6ce499d test: enforce package size (#4098)
* build: use fewer babel versions

* build: dedup

* test: test deps dedups

* fix: test.yml

* fix: typo

* test: failing

* fix: dedup

* fix: dedup

* test: comment dedup tests

* chore: whitespace

* test: package size

* build: scripts

* test: update test-size

* docs: CONTRIBUTING
2023-03-07 09:27:20 -08:00
Charles Bachmeier
e9fc55550d fix: Revert "chore: upgrade web3-react, widgets" (#6085)
Revert "chore: upgrade web3-react, widgets (#6077)"

This reverts commit 521b9b8e52.
2023-03-06 18:44:08 -08:00
Zach Pomerantz
3eeb467266 fix: deep link by swapping sooner after user interaction (#6073)
* build: conedison@1.5

* fix: use conedison/sendTransaction when able

* build: dedup

* build: upgrade conedison again

* build: deduplicate

* fix: nits
2023-03-06 15:14:47 -08:00
Vignesh Mohankumar
585d67c44a refactor: always enable permit2 (#6068)
* refactor: always enable permit2

* rm from modal

* one more

* rm

* more

* more

* more

* rm useswapcallback

* rm useapprovecallback

* unused hooks

* unused hooks

* rm

* lint
2023-03-06 18:07:19 -05:00
Vignesh Mohankumar
521b9b8e52 chore: upgrade web3-react, widgets (#6077)
* fix: support permit2 in gnosis safe apps

* package

* rm qr code

* 8.1.1

* revert

* update widgets
2023-03-06 16:56:40 -05:00
Mike Grabowski
cba1b83cd6 fix: focus issues with WalletConnect modal (#6060)
* Update index.tsx

* Update index.tsx

* add type

* chore: fix lint
2023-03-07 01:07:08 +04:00
Vignesh Mohankumar
498d4bf667 chore: remove unused assets (#5738) 2023-03-06 15:05:46 -05:00
eddie
34bed922ab feat: upgrade widget again (#6079) 2023-03-06 11:42:28 -08:00
eddie
b026db3db3 test: fix url param in tests (#6072) 2023-03-06 10:14:26 -08:00
eddie
912eb82971 feat: setup widget integration update (#6045)
* feat: setup widget integration update

* feat: preview of widget token selector

* feat: upgrade widget again for token selector

* fix: add back legacy token selector

* fix: token

* fix: upgrade again

* fix: tooltip bug

* fix: for real

* fix: updates
2023-03-06 10:03:37 -08:00
gzeon
2ddf3fe6bd feat: add arbitrum goerli (#5457)
* chore: add ARBITRUM_GOERLI

* chore: add arb goerli custom deployment

* fix: typo

* chore: add arbitrum goerli rpc

* fix: add rpc url for arb goerli

* chore: update providers.ts

* fix: arb goerli everywhere

* fix: declare ARBITRUM_GOERLI as testnet

* chore: add ARBITRUM_GOERLI to theme

* Merge remote-tracking branch 'upstream/main'

* chore: add todos

* fix: patch router

* fix: use bridged goerli usdc

* chore: remove patch

* feat: add usdc to arb goerli default

* chore: bump smart-order-router to 3.4.0

* fix: yarn-deduplicate

* chore: bump sdk-core to 3.1.1

* revert: smart-order-router 2.10.0

* Revert "chore: remove patch"

This reverts commit 84311c1828.

* fix: remove debug log in patch file

* fix: use bridged official Goerli USDC in patch

* fix: revert unnecessary change to yarn.lock

* fix: yarn yarn-deduplicate

* docs: fix comments

* remove patch

* rm rink

* link

---------

Co-authored-by: Vignesh Mohankumar <me@vig.xyz>
2023-03-03 20:29:49 -05:00
Vignesh Mohankumar
79ad611e79 fix: remove $ in hexlified string (#6075)
* fix

* Update cypress/support/ethereum.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-03-03 20:09:36 -05:00
Zach Pomerantz
e6d0d96ce4 fix: omit gas estimation from token.approve (#6069) 2023-03-03 15:01:34 -08:00
Vignesh Mohankumar
dcb660d052 refactor: variable for goerli in test (#6066) 2023-03-03 17:45:06 -05:00
Vignesh Mohankumar
1f0b8ffaf0 test: disable /send redirect test temporarily (#6070) 2023-03-03 17:42:56 -05:00
Vignesh Mohankumar
c59b3d7d88 build: upgrade sdk-core (#6065)
upgrade
2023-03-03 16:09:35 -05:00
Zach Pomerantz
513c90723b build: upgrade ethers@5.7.2, smart-order-router@3.6.0, widgets@2.43.2 (#5958)
* build: upgrade ethers@5.7.2

* fix: use namehash directly

* fix: TS7030

* build: upgrade widgets version and smart-order-router (#6053)

* upgrade widgets

* build: dedup router packages

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* chore: remove deprecated chains (#6054)

* start

* more

* more

* more

* use SupportedChainId from sdk

* add support for arbitrum goerli

* add arbitrum_goerli to jsonrpc list

* local sdk-core

* Revert "add arbitrum_goerli to jsonrpc list"

This reverts commit 51b29764f5.

* add local chain ids

* Revert "add support for arbitrum goerli"

This reverts commit 46cdd15543.

* rm arb goerli in supported chain ids

* autofix

* fix import

* fix import

* fix import

* move back down for sdk-core

* use the supportedchainid

* add-types

* comment

---------

Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com>

* combine

---------

Co-authored-by: Vignesh Mohankumar <vignesh@vigneshmohankumar.com>
Co-authored-by: Vignesh Mohankumar <me@vig.xyz>
Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com>
2023-03-03 15:18:42 -05:00
eddie
ef388e17d5 test: e2e tsts for goerli (#6063)
* fix: e2e tsts for goerli

* fix: test
2023-03-03 14:20:41 -05:00
Marcus Milton-Ellis
e2f5041707 refactor: Improve A11y (#5913)
* Imporove a11y

* fix cypress test

* Add translations to labels
2023-03-03 10:42:59 -08:00
Jordan Frankfurt
ac8d294ef6 fix: don't show a price impact warning if the user is (un)wrapping (#6059) 2023-03-03 13:04:14 -05:00
Zach Pomerantz
2df0ca178c build: fix vanilla-extract for M1 (#6058) 2023-03-03 09:56:33 -08:00
Jordan Frankfurt
02c970a077 chore: update types to match schema changes (#6062) 2023-03-03 12:10:19 -05:00
cartcrom
a965c3792b feat: Unicons (#6061)
* feat: unicons

* fix: linted

* fix: deduplicate
2023-03-03 11:30:51 -05:00
Charles Bachmeier
e8c689e1d4 feat: Migrate trending nfts endpoint to graphql (#6049)
* defined useTrendingCollections hook and made fields optional

* working trending collections table

* add gql file

* add gql to search suggestions and handle floor wei vs eth

* gql carousel

* fontWeight typo and skip if flag disabled

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-03-01 16:18:17 -08:00
cartcrom
70cd7272a1 fix: hide missing % changes/prices (#6046) 2023-03-01 10:23:06 -05:00
Jack Short
2b5769ac86 chore: removing VE from cards (#6038)
* moving cards to styled components

* converting rows to styled components

* image

* finished images

* handling all media

* removed VE from cards

* no content colors

* removing aspect ratio calc

* responding to all comments
2023-02-28 16:49:51 -05:00
Charles Bachmeier
b811afd134 feat: add new statsig backed feature flag for nft graphql migration (#6044)
* NFT-1113 add new statsig backed feature flag for nft graphql migration

* remove comment

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-02-28 13:38:10 -08:00
Charles Bachmeier
6131e6bfab chore: Cleanup and refactor significant portion of listing logic (#6042)
* NFT-91 move listing mode to shared

* move expiration setting out of useEffect

* simplify price input color logic

* unused boolean

* simplify removal of local listing market

* handle global same pricing

* undo local market change

* added comment

* undo expiration changes

* remove old listing state logic

* formatting

* small cleanup

* cleanup

* deprecate global listing state

* use stablecoin values

* remove unused pausing functionality

* remove unused pausing functionality

* remove unused warning logic

* remove unused royalty field

* use royalty helper fn

* simplify global vs normal price input

* simplified price setting logic

* price inputs need to respond to global price method changes

* slight simplifcations

* move dynamic price logic to hook

* move utils file

* move enum to shared

* only usdc check

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-02-28 11:47:22 -08:00
Vignesh Mohankumar
5979635939 chore: update coinbase-wallet sdk (#6037) 2023-02-27 17:18:21 -05:00
dependabot[bot]
5399bdb550 chore(deps): bump @uniswap/widgets from 2.39.0 to 2.40.0 (#6032)
Bumps [@uniswap/widgets](https://github.com/Uniswap/widgets) from 2.39.0 to 2.40.0.
- [Release notes](https://github.com/Uniswap/widgets/releases)
- [Changelog](https://github.com/Uniswap/widgets/blob/main/.releaserc.json)
- [Commits](https://github.com/Uniswap/widgets/compare/v2.39.0...v2.40.0)

---
updated-dependencies:
- dependency-name: "@uniswap/widgets"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-27 15:01:55 -05:00
Charles Bachmeier
1df9da9eff chore: Refactor ListingButton with deprecation of Listing V1 (#6023)
* remove unused wrapper

* remove old listing modal

* simplify button styling

* deprecate outdated listing logic and move button to styled components

* remove unused linting protection

* remove unused functions from sellAssets hook

* undo and save this refactor for different PR

* remove more unused items

* hook dependencies

* more trash cleanup

* styled continue button

* slight continue button tweaks

* cleanup

* add new standard hover state

* no mixed conditionals

* lint

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-02-27 10:42:30 -08:00
Jordan Frankfurt
b1e6d0ab7a chore: schema changed gen types (#6033)
schema changed gen types
2023-02-27 13:03:20 -05:00
eddie
a7fcbb4cfc revert: dont hideConnectionUI for widget (#6030)
Revert "fix: dont hideConnectionUI for widget (#6010)"

This reverts commit c18522159b.
2023-02-27 09:18:47 -08:00
Moody Salem
a5a6a037e5 ci: references to old id upload (#6034)
fix: references to old id `upload`

`upload` seems to have been changed to `pinata`
2023-02-27 09:09:50 -08:00
Andrew MacPherson
8bfebd37a2 Updating .env.production file to also include the same comment as .env about reporting these public API keys 2023-02-27 10:00:22 -05:00
Vignesh Mohankumar
4029819090 chore: update widget (#6029) 2023-02-24 17:27:08 -05:00
Vignesh Mohankumar
021ae5e74e fix: reset tokens, amounts when switching chains (#6026)
* fix: reset tokens when switching chains on widget

* clear amounts
2023-02-24 16:35:53 -05:00
eddie
2b9720705f feat: log errors on swap page (#6008)
* feat: log error from widget

* fix: upgrade analytics

* feat: add swap error to main Error Boundary too
2023-02-24 12:09:41 -08:00
blairmason
8f1ea32e5e feat: config statsig init to use reverse proxy (#6018)
* config statsig init to use reverse proxy

* formatting fixes

* update statsig proxy endpoints to prod url
2023-02-24 09:28:01 -08:00
eddie
23acb3b395 feat: add statsig feature gate for widget (#6011)
* feat: add statsig feature gate for widget

* feat: move statsig check into featureFlag infra

* fix: move statsig check deeper into feature flag code

* Update src/featureFlags/flags/featureFlags.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* Update src/featureFlags/flags/dummyFeatureGate.ts

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-02-23 12:47:26 -08:00
Charles Bachmeier
772416cc7a feat: add collection blocklist for ip infringement (#6022)
Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-02-23 10:44:27 -08:00
Jordan Frankfurt
f15e5725f1 fix: token list load issue WEB-2083 (#6019) 2023-02-22 22:24:30 -06:00
Jordan Frankfurt
83c8393f19 fix: back arrow from migration should take you to v3 pool page (#6020) 2023-02-22 22:24:22 -06:00
Jack Short
1348eb3322 fix: token selector correct zIndex on mobile for pwat (#6017) 2023-02-22 20:43:35 -05:00
eddie
a2271ba428 fix: widget defaultChainId (#6012) 2023-02-22 14:14:12 -08:00
Charles Bachmeier
1845cb3b7b chore: remove listv2 feature flag (#6009)
* remove listv2 feature flag

* no longer used styles and icons

* missed one

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-02-22 09:43:39 -08:00
Jordan Frankfurt
6a02bde8e0 fix: darkmode FoR iframe wrapper background color (#5993)
* fix: darkmode FoR iframe wrapper background color

* pr feedback
2023-02-22 10:38:52 -06:00
eddie
c18522159b fix: dont hideConnectionUI for widget (#6010) 2023-02-22 09:23:56 -06:00
Jack Short
5ea7b1de3f feat: enable pay with any token (#6002) 2023-02-22 08:25:09 -05:00
Charles Bachmeier
6efe8f3260 feat: [ListV2] Several Small Polish Changes (#5998)
* NFT-1075 update floor and last price to use body primary

* NFT-1080 update image thumbnail size and adjusted row accordingly

* NFT-1081 force page refresh on success screen

* NFT-1089 update same price icons

* NFT-1082 show warning colors over focus

* remove unused state var

* replace margin with padding for sticky header

* NFT-1109 properly calc if listing date is over 6mo

* NFT-1076 change listing button text to light and mobile profile bar to backgroundSurface

* NFT-1079 persist row data when listing to multiple markets

* perf improvement

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-02-21 13:56:26 -08:00
lynn
9ac28a4571 fix: token selector scroll margin (#6005)
* fix

* update tests

* remove gql file

* fix breakng snapshot
2023-02-21 16:40:36 -05:00
eddie
bde1421ffb fix: use ipfs token list as fallback for unsupported list (#6007) 2023-02-21 12:55:40 -08:00
eddie
3dceb45d9e fix: use ipfs token list temporarily (#6006)
fix: use ipfs token list as fallback
2023-02-21 12:19:39 -08:00
Jack Short
7b589561bc fix: not using stablecoin to calc price impact pwat (#5997)
* feat: implementing graphql endpoint

* changing from hook to function call

* initial gql routing works

* feat: initial pwatRouting setup

* sending correct amount

* removing console

* it is working

* sufficient balance

* 0 if no inputCurrency

* removing value to send if erc20

* removing console

* permit2 optional flag

* removing not necessary stuff

* mobile fixes

* overlay needs to be here

* changing swap amount to pool reserves

* refactoring routing logic

* no route found button state

* better price loading for insufficient liquidity

* refactoring graphql routing code

* overflow

* initial comments

* resetting bag status on input currency change

* locking

* done

* remove helper text for eth

* fix: pay with any token routing bug

* reordering button

* zindex

* price updated

* keeping debounce

* feat: adding amplitude events for pwat

* bumping analytics version

* types and hooks

* moving erc20 flag to useSendTransaction

* why did i put it in a hook

* no return

* fix: not using usdc value to calculate price impact

* refactor + loading state
2023-02-21 12:55:35 -05:00
eddie
c9d3dc36b8 feat: introduce statsig and expose dummy feature gate (#5974)
* feat: introduce statsig and expose dummy feature gate

* feat: use the flag for different copy

* feat: use amplitude user ID

* fix: lock file

* feat: upgrade analytics package

* fix: update snapshots

* fix: unit test snapshot

* fix: fix tests and value check

* feat: switch user ID to device ID

* fix: move statsig wrapper

* fix: move statsig wrapper

* fix: e2e tests

* fix: e2e tests

* fix: env var

* fix: env var

* fix: try testEnv

* fix: undo last commit

* fix: e2e tests

* fix: typo

* fix: dont wait for init

* wip

* fix: undo wip change
2023-02-17 17:42:57 -08:00
eddie
ef4d8fc269 fix: change e2e test language (#5999) 2023-02-17 17:29:59 -08:00
Jack Short
ff9cc5cb69 feat: pwat amp events (#5991)
* feat: implementing graphql endpoint

* changing from hook to function call

* initial gql routing works

* feat: initial pwatRouting setup

* sending correct amount

* removing console

* it is working

* sufficient balance

* 0 if no inputCurrency

* removing value to send if erc20

* removing console

* permit2 optional flag

* removing not necessary stuff

* mobile fixes

* overlay needs to be here

* changing swap amount to pool reserves

* refactoring routing logic

* no route found button state

* better price loading for insufficient liquidity

* refactoring graphql routing code

* overflow

* initial comments

* resetting bag status on input currency change

* locking

* done

* remove helper text for eth

* fix: pay with any token routing bug

* reordering button

* zindex

* price updated

* keeping debounce

* feat: adding amplitude events for pwat

* bumping analytics version

* types and hooks

* moving erc20 flag to useSendTransaction

* why did i put it in a hook

* no return
2023-02-17 16:26:57 -05:00
lynn
719fd524ed fix: update user rejected txn errors to stay up to date with widget (#5996)
init
2023-02-17 16:03:26 -05:00
github-actions[bot]
f15dd1e61e chore(i18n): new Crowdin translations (#5855)
chore(i18n): synchronize translations from crowdin [skip ci]

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-02-17 11:12:47 -05:00
Jack Short
8c372c6142 fix: fixing pwat routing edge case (#5987)
* feat: implementing graphql endpoint

* changing from hook to function call

* initial gql routing works

* feat: initial pwatRouting setup

* sending correct amount

* removing console

* it is working

* sufficient balance

* 0 if no inputCurrency

* removing value to send if erc20

* removing console

* permit2 optional flag

* removing not necessary stuff

* mobile fixes

* overlay needs to be here

* changing swap amount to pool reserves

* refactoring routing logic

* no route found button state

* better price loading for insufficient liquidity

* refactoring graphql routing code

* overflow

* initial comments

* resetting bag status on input currency change

* locking

* done

* remove helper text for eth

* fix: pay with any token routing bug

* reordering button

* zindex

* price updated

* keeping debounce
2023-02-16 18:46:42 -05:00
Charles Bachmeier
8c0998bd59 feat: [ListV2] Updated page responsiveness and breakpoints (#5972)
* updated responsiveness for grid

* add sell nfts back header

* input responsiveness

* lint

* remove shrink property

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-02-16 14:23:26 -08:00
Charles Bachmeier
ad3a4ea808 feat: [ListV2] Proceeds bar polish (#5966)
* update nft info row height

* update proceeds styling

* update text

* move issues to hook

* update br padding

* mobile bar padding

* fix bug where no expiration wouldn't create issue

* build issue

* update bar padding

* reorganize statement

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-02-16 14:22:54 -08:00
Charles Bachmeier
d30c5173f5 feat: [ListV2] Dropdown and Modal Polish (#5990)
* update market dropdown border and shadow

* duration modal polish

* update twitter button text color

* reduce height of durection switcher

* NFT-1074 update approval modal text styling

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-02-16 14:02:33 -08:00
Jordan Frankfurt
689100afa2 feat: support moonpay iframe theme (#5986)
* feat: support moonpay iframe theme

* move theme param to body
2023-02-16 14:52:48 -06:00
Charles Bachmeier
d546ffec1c fix: Market icons displaying over dropdown (#5989)
* remove correct market

* fix market icons displaying overtooltip

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-02-16 12:11:51 -08:00
Jordan Frankfurt
4a72d8835c chore: remove FoR feature flag (#5985)
remove feature flag
2023-02-16 13:02:02 -06:00
eddie
19c6023601 fix: remove gap on tdp bottom bar (#5973)
* fix: remove gap on tdp bottom bar

* fix: adjust bottom and border
2023-02-16 08:43:19 -08:00
Jordan Frankfurt
a4a954c8af fix: update subgraph query to actually fetch all tick data (#5982) 2023-02-15 20:50:36 -06:00
Charles Bachmeier
82dcdcec55 feat: [ListV2] Updated fee tooltip style (#5976)
* updated tooltip style

* never forget your colon

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-02-15 14:35:07 -08:00
Jack Short
27e20d7230 feat: pay with any token routing (#5959)
* feat: implementing graphql endpoint

* changing from hook to function call

* initial gql routing works

* feat: initial pwatRouting setup

* sending correct amount

* removing console

* it is working

* sufficient balance

* 0 if no inputCurrency

* removing value to send if erc20

* removing console

* permit2 optional flag

* removing not necessary stuff

* mobile fixes

* overlay needs to be here

* changing swap amount to pool reserves

* refactoring routing logic

* no route found button state

* better price loading for insufficient liquidity

* refactoring graphql routing code

* overflow

* initial comments

* resetting bag status on input currency change

* locking

* done

* remove helper text for eth
2023-02-15 16:59:17 -05:00
eddie
95eafbab7d fix: wait for page to load in e2e tests (#5983)
* fix: make FoR announcement click optional in e2e tests

* fix: optional chaining

* fix: build error

* fix: wait for page to load
2023-02-15 13:55:35 -08:00
Jordan Frankfurt
639fe2f73b fix: add default case to switch (#5984) 2023-02-15 13:55:42 -06:00
Vignesh Mohankumar
72cd27f045 fix: allow signing with smart contract wallets (#5970)
* chore: upgrade universal-router-sdk

* dedupe

* update widgets

* empty
2023-02-15 11:30:09 -05:00
eddie
4e64c0e88f fix: round corners of CurrencySearch (#5969) 2023-02-14 15:17:54 -08:00
Charles Bachmeier
fda28d9be3 fix: Mixed success modal wrapping (#5967)
fix mixed success wrapping

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-02-14 14:19:45 -08:00
cartcrom
bc92af6c15 fix: use latest version of tokenlists over cache (#5975)
fix: use constants in fetch interval callback to prevent updates
2023-02-14 15:48:53 -05:00
lynn
9a257e0ca8 fix: correct copy on TVL (#5968)
fix copy
2023-02-13 19:28:00 -05:00
cartcrom
82646b77dd feat: migrate search tokens to gql (#5802)
* init

* feat: search tokens hook

* feat: search ordering

* feat: separated FungibleToken parsing into sep function

* refactor: memoized search token sorting

* fix: cache waterfall issue

* fix: removed no longer relevant test

* feat: trending tokens from gql (#5805)

* feat: trending tokens from gql

* fix: reverted out-of-scope change

* refactor: remove trendingTokensFetcher

* fix: linted

* fix: removed fetch policy overrides

* fix: loading state cache

* fix: unwrap native trending tokens

* feat: refetch recently searched (#5894)

* feat: trending tokens from gql

* fix: reverted out-of-scope change

* refactor: remove trendingTokensFetcher

* feat: recently searched tokens query

* fix: linted

* feat: combined query function

* feat: recently searched hooks

* feat: combined query

* fix: removed fetch policy overrides

* fix: loading state cache

* fix: empty history loading state

* fix: revert change

* fix: revert unintended nft query change

* refactor: state functions

* fix: removed unnused query var

* fix: unwrap native trending tokens

* feat: remove fungible token type (#5896)

* feat: trending tokens from gql

* fix: reverted out-of-scope change

* refactor: remove trendingTokensFetcher

* feat: recently searched tokens query

* fix: linted

* feat: combined query function

* feat: recently searched hooks

* feat: combined query

* fix: removed fetch policy overrides

* fix: loading state cache

* fix: empty history loading state

* fix: revert change

* fix: revert unintended nft query change

* refactor: state functions

* fix: removed unnused query var

* refactor: remove FungibleToken type

* refactor: use TokenStandard.Native instead of string

* refactor: improve boolean logic readability

* refactor: removed duplicate code

* fix: unwrap native trending tokens

* fix: type error

* fix: duplicate entry bug

* refactor: use undefined instead of null/string cast

* fix: update apollo types

* fix: polygon edge case & polish
2023-02-13 18:45:13 -05:00
Jordan Frankfurt
1992c5de06 fix: don't render LP position when token name or symbol includes a url (#5961) 2023-02-13 13:45:08 -06:00
Charles Bachmeier
0208ccd7d2 feat: [ListV2] Changes to Multiple Market handling and row hovering (#5953)
* add overlay to row hover

* add remove icon on hover

* working expand and collapse icons

* fixed margin

* don't show collpase on nonhovered rows

* display mutliple markets

* remove market

* 0 margin divider

* hide on mobile

* better mobile check

* margin adjustment and hover border radius

* address comments

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-02-09 11:58:59 -08:00
Jordan Frankfurt
12df4b3981 fix: update some urls to match current page structure (#5957) 2023-02-09 13:35:12 -06:00
Jack Short
3eaeb65b07 feat: implementing permit2 with pay with any token (#5926)
* feat: implementing permit2 with pay with any token

* permit2 hook

* usePayWithAnyTokenHook

* removing ternary operators

* weird export type bug

* resolving merge

* fixing nft test

* styles

* refactoring styles

* reformatting

* price impact warnings

* forgot trans tag

* responding to comments

* fixes

* disabling pay with any token when on the wrong chain

* missing enabled flag

* vertically centering button
2023-02-09 13:41:30 -05:00
Jordan Frankfurt
6df2f3677e fix: use general sort rank instead of only volume rank for row numbers (#5955) 2023-02-09 12:37:13 -06:00
lynn
80edf5a0d6 fix: follow custom design for token selector scrollbar (#5952)
* fix

* remove unused styled component

* update snapshot

* disable scroll on larger currency search modal

* update snapshot
2023-02-09 13:17:58 -05:00
eddie
96f6929127 fix: showCommonBases for widget token selector (#5951) 2023-02-08 16:50:21 -08:00
eddie
4ec95d0927 fix: URL params for widget (#5943)
* fix: URL params for widget

* fix: remove output token from tokenDetails callsite

* fix: combine props, rename initial state values

* fix: better prop types

* fix: rename prop type
2023-02-08 16:50:11 -08:00
yyip-dev
fba6cc9e02 fix: test pr for github<>jira integration (#5950)
* test pr for github<>jira integration

* remove diff
2023-02-08 18:13:04 -05:00
lynn
bc2f68565b fix: Web 1992 token details update blocked token detail pages (#5948)
* init

* Update src/components/Tokens/TokenDetails/index.tsx

Co-authored-by: eddie <66155195+just-toby@users.noreply.github.com>

* oops last commit leads to error :/

---------

Co-authored-by: eddie <66155195+just-toby@users.noreply.github.com>
2023-02-08 18:03:36 -05:00
Zach Pomerantz
f232643d8e feat: upgrade conedison to improve signing (#5947)
* feat: upgrade conedison to improve signing

* fix: deduplicate conedison
2023-02-08 13:32:19 -08:00
lynn
527270e33f fix: handle wallets that don't send default 4001 error code for user rejected txns (#5941)
* init

* add more to comment

* zzmp comments

* regex

* oops

* fix
2023-02-08 13:34:21 -05:00
cartcrom
18cd5ec9d9 fix: default to null when query address is undefined (#5937) 2023-02-08 00:17:39 -05:00
Jordan Frankfurt
5ddb565805 feat: add feedback link to ... menu (#5933)
add feedback link to ... menu
2023-02-07 18:21:00 -06:00
Jack Short
f0b4b92b88 chore: setting up feature flags and boilerplate gql for routing gql endpoint (#5935)
* feat: routing gql endpoint

* adding feature flags

* adding to modal

* adding mocked provider to test

* adding apollo client to mocked providers

* comment
2023-02-07 18:33:41 -05:00
Charles Bachmeier
4d82f9fb3a fix: Handle Different Listing Failure Responses (#5940)
fix: handle different failure responses

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-02-07 10:26:36 -08:00
Charles Bachmeier
654b26dc54 feat: [ListV2] Enable ListV2 feature flag (#5939)
enable v2 feature flag

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-02-07 09:05:43 -08:00
Charles Bachmeier
c0753ae52f fix: [ListV2] Better Collection and Listing Retry and Removal Logic (#5938)
* keep approved collection status when removing

* better map name

* improve callback logic

* improve callback logic for collection approval

* reduce zustand calls

* additional zustand reductions

* add back correct check

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-02-07 08:29:58 -08:00
Charles Bachmeier
16bb9470ae feat: [ListV2] Changes based off Bug Bash (#5936)
* duration wrap

* better styling a different breakpoints

* throw error on listing same price

* don't show spinner on v2

* remove unused check

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-02-06 19:04:56 -08:00
Jordan Frankfurt
6dcfca24cb fix: remove roll list (#5934) 2023-02-06 20:41:01 -06:00
Charles Bachmeier
9cac9f8299 feat: [ListV2] error and warning states (#5921)
* update error message for price inputs

* add grid and button warning states

* add list below floor warning modal

* only warn for prices 20% below floor

* highlight unentered price in red on button press

* missing dependency

* updated modal name and mobile height

* add new file

* fix column presence

* rookie mistake

* bulk zustand imports

* below floor threshold

* move issue check higher

* cleanup mouseEvent

* rename color var

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-02-06 13:00:29 -08:00
Charles Bachmeier
5def0dd166 feat: [ListV2] Add retry and remove logic to listings and collection approvals (#5923)
* add remove/retry buttons

* add retry logic functionality

* add scroll to active row

* properly update rejected status

* replace loadingicon with loader

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-02-06 12:55:05 -08:00
Charles Bachmeier
7229637c4c feat: [ListV2] Update price and duration dropdowns (#5925)
* add custom option and style market dropdown

* working dropdown for price

* hide dropdown on mobile

* update duration dropdown

* themed opacity hover

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-02-06 12:54:56 -08:00
Charles Bachmeier
f26b09537d feat: [ListV2] Success modal + Twitter Share (#5924)
* added success screen with images

* add listing proceeds

* working return

* working single tweet

* working tweet multiple

* update how we parse twitterName

* add scrollbar styles

* usestablecoinvalue

* math.min

* add collection name backup to tweet

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-02-06 12:45:13 -08:00
Charles Bachmeier
8f922b665a feat: [ListV2] Add extra bottom padding to collection assets (#5930)
add extra bottom padding to collection assets

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-02-06 12:43:59 -08:00
Zach Pomerantz
134b1d708f revert: "fix: surface connection error" (#5932)
Revert "fix: surface connection error (#5931)"

This reverts commit e9bddcb670.
2023-02-06 12:20:11 -08:00
Zach Pomerantz
e9bddcb670 fix: surface connection error (#5931)
* fix: surface connection error

* fix: to spec

* fix: sentence case
2023-02-06 15:01:12 -05:00
Callil Capuozzo
19e45fd119 fix: style collect and create a proposal buttons (#5927)
* Add responsive button styles

* Clean up responsive

* Use SmallButtonPrimary

* Allow button to accept padding props

* Fix vote padding and update link

* Hide position NFT in mobile
2023-02-06 12:49:58 -05:00
Noah Zinsmeister
ae4135fa49 fix: block time is 12 seconds now (#5929)
* block time is 12 seconds now

* fix lint error

* Update governance.ts
2023-02-06 11:18:30 -05:00
Jordan Frankfurt
89e438bcc5 chore: update generated types (#5922) 2023-02-03 15:15:03 -06:00
cartcrom
92af2167ee refactor: L2 icons in component (#5901)
* feat: feature complete

* fix: hide l2 icons on most currencylogos

* linted

* refactor: remove unecessary logo container skeleton

* fix: removed todo comment and linted
2023-02-03 14:15:08 -05:00
eddie
db6084d717 feat: widget on tx success callback (#5916)
feat: log SWAP_TRANSACTION_COMPLETED for widget transactions
2023-02-03 10:23:41 -08:00
Jack Short
927d35d59e fix: useStablecoinPrice switching between WETH and ETH (#5904) 2023-02-03 11:05:47 -05:00
eddie
b4e981b2fd fix: landing page styling of widget (#5917) 2023-02-02 18:08:48 -08:00
Zach Pomerantz
967a698178 fix: upgrade @web3-react connectors (#5920) 2023-02-02 16:24:31 -08:00
Zach Pomerantz
7818426b53 fix: use conedison signTypedData (#5875)
* fix: use conedison signTypedData

* chore: rm old signTypedData

* fix: deduplicate
2023-02-02 14:02:45 -08:00
Jordan Frankfurt
93e0054f10 feat: add jest coverage to github action (#5850)
* add jest coverage to github action

* working on action config

* fix yaml syntax
2023-02-02 14:06:15 -06:00
eddie
661d2b6a33 feat: add zIndex to widget theme (#5915)
* feat: create feature flag for swap widget

* feat: add new flag to modal

* fix: missing defaultField usage

* feat: add zIndex to widget theme
2023-02-02 11:28:15 -08:00
eddie
c560b94366 feat: create feature flag for swap widget (#5909)
* feat: create feature flag for swap widget

* feat: add new flag to modal

* fix: missing defaultField usage
2023-02-02 11:26:24 -08:00
Jack Short
93a4f00287 fix: adding usd_value back to trace event (#5912) 2023-02-02 12:05:29 -07:00
Charles Bachmeier
48833f27e3 feat: [ListV2] Connect modal styling to functionality (#5905)
* dynamic styles based on listing status

* connect collection approval to v2 modal

* import cleanup

* add comments

* connect sign listing logic

* correct pending styles

* correct pending status for collection approval

* correct pending status for os listings

* use check from react-feather

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-02-01 13:41:50 -08:00
Jack Short
35a03e2681 fix: using the swap token selector for pay with any token (#5902)
* feat: adds input token quote for nfts

* remove eslint

* correct usdc pricing

* fix: uses swap token selector for pay with any token selector

* check when balances are loaded

* removing token selector

* only showing active tokens in pay with any token
2023-02-01 15:59:06 -05:00
Charles Bachmeier
ac0badfb1d feat: [ListV2] Add mobile styles (#5906)
* correct mobile modal width

* better mobile styling for listing page

* add height to modal
2023-02-01 12:54:55 -08:00
eddie
149b18f02e fix: about footer link weights (#5898) 2023-02-01 09:13:15 -08:00
Jack Short
52a43f3db0 chore: removeing fetch usd price for bag footer (#5903)
* chore: removing fetchUsdprice

* removing console
2023-02-01 12:00:39 -05:00
Jack Short
0a2a46d506 feat: quote token price for nfts (#5897)
* feat: adds input token quote for nfts

* remove eslint

* correct usdc pricing
2023-01-31 15:45:02 -05:00
Charles Bachmeier
a7c1bd4391 feat: [ListV2] Setup styles for Listing Modal (#5870)
* init modal title

* active and closed section headers

* added left border to section

* add tooltip

* complete collection row

* enforce max height

* add sign listings section

* fix top margin for section

* file re-org

* make modal section re-useable and move to its own file

* format

* define section props

* use accentAction for icons

* improved index

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-01-30 12:22:48 -08:00
cartcrom
13221e6935 feat: caching and polling on apollo token queries (#5874)
* fix: caching on apollo token queries

* refactor: rename state variable

* added documentation for state variable purpose

* added documentation for nullish operator usage
2023-01-30 14:53:53 -05:00
lynn
26fc3caa55 fix: Revert "fix: remove gwei indicator", restore block number (#5891)
* Revert "fix: remove gwei indicator (#5873)"

This reverts commit 409ba72f9f.

* add back block number
2023-01-30 14:30:01 -05:00
Charles Bachmeier
6072bb1be0 fix: Broken NFT Details test (#5893)
fix broken NFT test

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-01-30 10:09:45 -08:00
eddie
302af21a22 fix: widget theme integration (#5880)
* fix: add missing colors to widget theme integration

* feat: upgrade widget version

* fix: conedison in jest tests
2023-01-25 17:12:23 -05:00
Rachel-Eichenberger
b61a2d4111 fix: Update footer Github and Discord links (#5841)
Update footer github and discord links

Discord and github links were reversed
2023-01-25 16:15:23 -05:00
Zach Pomerantz
9be26788a2 test: skip flaky universal search test (#5881)
test: skip flaky test
2023-01-24 12:57:08 -05:00
Zach Pomerantz
ed393de481 fix: use wallet modal for widget-prompted connection (#5879)
* fix: use wallet modal for widget-prompted connection

* fix: prevent widget modal

* fix: invoke modal toggle
2023-01-24 12:36:50 -05:00
Zach Pomerantz
cf5c393d97 fix: sanitize legacy signature format (#5878)
Upgrades @uniswap/universal-router-sdk to fix a bug where legacy wallets submitted unhandled legacy signature formats, with suffixes that failed to execute when calling estimateGas.

See ticket CX-140
2023-01-23 09:37:06 -05:00
lynn
68d81a0040 fix: txn header styling for long ens names (#5872)
done fix
2023-01-22 22:00:29 -05:00
Mike Grabowski
53caa51ac3 fix: disconnection error while switching networks with MetaMask (#5871)
* fix: disconnection error while switching networks with MetaMask

* nit: oops

* fix: tests
2023-01-21 02:20:43 +04:00
lynn
409ba72f9f fix: remove gwei indicator (#5873)
* remove polling

* remove dead code

* lint issues
2023-01-20 15:58:30 -05:00
Mike Grabowski
9d9b3dca78 feat: detect Brave Wallet (#5836)
* feat: support brave better

* fix: apply review comments

* address revieW

* chore: fix lint

* chore: add comment
2023-01-21 00:42:43 +04:00
Jack Short
a11c7e9573 feat: select input token for pay with any token (#5865)
* feat: select input token for pay with any token

* creating zustand state

* updating symbol

* cursor pointer
2023-01-20 13:02:43 -05:00
Charles Bachmeier
31bbcae1ed fix: slideout menu title overlap on firefox (#5869)
fix wallet overlap on firefox

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-01-20 12:03:42 -05:00
Zach Pomerantz
a1f6c7270e fix: amend gas estimate error message (#5868)
* fix: amend gas estimate error message

* fix: language

* Update src/utils/swapErrorToUserReadableMessage.tsx

Co-authored-by: Tina <59578595+tinaszheng@users.noreply.github.com>

Co-authored-by: Tina <59578595+tinaszheng@users.noreply.github.com>
2023-01-19 17:48:54 -08:00
Zach Pomerantz
8471d9b46f test: skip token explore filter tests (#5867) 2023-01-19 16:16:00 -08:00
lynn
5fc4d98faa chore: universal search e2e test (#5839)
* init

* change comments

* init

* done

* charlie comments

* fix lint

* fix explore filter test
2023-01-19 18:12:40 -05:00
Zach Pomerantz
8d9ddf36a2 fix: display specific gas estimation error (#5863) 2023-01-19 14:11:01 -08:00
Zach Pomerantz
6cfd5fa475 fix: allow signing from safepal (#5862) 2023-01-19 14:10:03 -08:00
Zach Pomerantz
f2c5a7c09c fix: track universal router swaps and err on wallet-edited calldata (#5864)
fix: track universal router swaps
2023-01-19 13:04:36 -08:00
lynn
fb52770953 chore: token explore filter e2e test (#5835)
* init

* fix

* init

* remove old token test

* fixes

* remove extraneous tokens test

* init

* tests working

* remove unnecessary data-cy
2023-01-19 14:29:05 -05:00
Zach Pomerantz
94aa8ae2c9 fix: avoid error swap state while loading (#5860)
fix: omit price impact warning while loading
2023-01-19 10:41:58 -08:00
Zach Pomerantz
6cb0824a0b fix: rm "approval failed" UI (#5861) 2023-01-19 10:32:04 -08:00
Zach Pomerantz
777887b25d fix: rm faulty revert flow (#5859) 2023-01-19 08:57:14 -08:00
Zach Pomerantz
d15d5d85f5 feat: enable permit2 (#5858) 2023-01-19 10:11:18 -05:00
Zach Pomerantz
43218d5655 feat: retry gas estimate and log to console (#5856) 2023-01-18 20:53:20 -08:00
Zach Pomerantz
a534ba41ed revert: "feat: enable permit2" (#5854)
Revert "feat: enable permit2 (#5833)"

This reverts commit a9ab5717de.
2023-01-18 16:27:09 -08:00
Zach Pomerantz
4715115743 fix: compute price impact off of debounced trade (#5852)
* fix: compute price impact off of debounced trade

* chore: rm console log
2023-01-18 16:23:19 -08:00
Zach Pomerantz
3389d01213 fix: fetch allowances without debouncing (#5853) 2023-01-18 16:04:28 -08:00
Zach Pomerantz
d9a0aa3ff0 fix: use non-warning colors for allowance button (#5851) 2023-01-18 16:03:29 -08:00
github-actions[bot]
e9e5d2e43e chore(i18n): new Crowdin translations (#5627)
chore(i18n): synchronize translations from crowdin [skip ci]

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-01-18 18:57:43 -05:00
Jack Short
d58dc14bd5 feat: initial token selector for pay with any token (#5848)
* feat: initial token selector for pay with any token

* addressing some comments

* addressing comments

* linting
2023-01-18 18:52:17 -05:00
Charles Bachmeier
909e18cb23 chore: convert top level profile page to styled components (#5849)
* move const to shared file

* convert top level page wrappers to styled components

* style empty content

* simplify and wrap empty content and remove unused ve styles

* better margins

* delete unused common style

* isListingNfts bool

* remove comment

* cleanup bools

* import bag_width
2023-01-18 15:22:07 -08:00
Zach Pomerantz
a9ab5717de feat: enable permit2 (#5833) 2023-01-18 12:17:30 -08:00
Zach Pomerantz
94544de74b fix: fallback to eth_sign for permit approval (#5847)
* fix: fallback to eth_sign for permit approval

* chore: clean up comments/logs

* refactor: mirror ethers impl

* chore: add comment re: impl
2023-01-18 12:14:55 -08:00
lynn
96f24d5a9b fix: txn and language dropdown styling fix (#5845)
fix
2023-01-18 14:10:04 -05:00
Charles Bachmeier
8e59a352c0 feat: [NFTListV2] convert old bag to modal (#5838)
* hide bag on list page

* use feature flag

* maxWidth

* convert existing bag to modal'

* add new file

* add overlay

* only show old padding with flag off

* set margin const

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-01-18 10:58:25 -08:00
lynn
3b765b4f05 chore: token details test (#5830)
* init

* fix

* init

* remove old token test

* fixes

* remove extraneous tokens test

* respond to mike

* oops
2023-01-18 13:36:30 -05:00
cartcrom
9f4a1f48a5 feat: fixed modal positioning on mobile & updated theming (#5790)
* feat: fixed modal positioning on mobile & updated theming

* fix: undid spacing change
2023-01-18 13:27:21 -05:00
Zach Pomerantz
de9533399a build: re-enable releases for Monday (#5844)
Revert "build: skip Monday releases (#5834)"

This reverts commit 6f147c1ff3.
2023-01-18 10:14:35 -08:00
Jordan Frankfurt
a02afd50b5 fix: add react state hookup for fiat announcement dismissal (#5840) 2023-01-18 11:35:33 -06:00
lynn
1f7ba5ae9f chore: add token explore integration test (#5820)
* init

* fix

* fixes

* remove extraneous tokens test
2023-01-17 21:40:08 -05:00
Mike Grabowski
3686803c17 refactor: improve metamask error modal (#5818)
* refactor: improve metamask error modal

* chore: rename and use translations

* chore: fix lint

* chore: Fix test
2023-01-16 20:34:42 +04:00
Zach Pomerantz
6f147c1ff3 build: skip Monday releases (#5834) 2023-01-13 14:41:32 -08:00
Zach Pomerantz
049a09a346 build: upgrade @uniswap/widgets@2.25.1 (#5831)
* build: upgrade @uniswap/widgets@2.25.0

* build: upgrade @uniswap/widgets@2.25.1
2023-01-13 14:18:34 -08:00
Zach Pomerantz
4b9a885a34 test: enable skipped fetchTokenList test (#5822) 2023-01-13 13:53:40 -08:00
Jordan Frankfurt
e3918d039f fix: spacing and other small cosmetic errors in for account dropdown (#5829)
* consolidate padding in connection menu

* reduce button vertical spacing

* reduce button vertical spacing

* add 'ETH Balance' header

* reduce cc icon size to 20px
2023-01-13 13:42:28 -06:00
Zach Pomerantz
9719af66e5 fix: update permit2 to match widget implementation again (#5826)
* fix: update permit2 to match widget implementation (#5821)

* refactor: usePermit2->usePermit2Allowance

* fix: update permit2 logic to match widgets

* fix: lint issues

* fix: memoize the interval callback
2023-01-13 11:28:54 -08:00
Jack Short
14b02eda0f feat: initial pay with any token setup (#5823)
* feat: initial pay with any token ui setup

* reordering

* refactoring

* refactoring
2023-01-13 14:09:27 -05:00
Zach Pomerantz
60bc2a1660 revert: "fix: update permit2 to match widget implementation (#5821)" (#5825)
Revert "fix: update permit2 to match widget implementation (#5821)"

This reverts commit ef3407f299.
2023-01-12 16:40:00 -08:00
Zach Pomerantz
ef3407f299 fix: update permit2 to match widget implementation (#5821)
* refactor: usePermit2->usePermit2Allowance

* fix: update permit2 logic to match widgets

* fix: lint issues
2023-01-12 15:16:07 -08:00
Jordan Frankfurt
f312a148d0 fix: persist volume ranking in token table rows instead of using index (#5819)
* fix: persist volume ranking in token table rows instead of using index

* pr feedback
2023-01-12 14:54:40 -06:00
Charles Bachmeier
cf5bb5740d feat: [List V2] Initial Floating Bar (#5817)
* initial floating bar and VE removal

* dynamic price info

* align bottom bar to bottom

* fixed to bottom

* darkmode gradient

* dynamic overlay

* style tweaks

* toggle bag if flag enabled

* handle really small numbers

* address comments

* add border

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-01-12 12:11:59 -08:00
Jack Short
5f280ffd0e fix: nft add to bag test (#5824)
fix: nft add to bag teest
2023-01-12 14:33:04 -05:00
Jack Short
97075acb91 feat: pay with any token feature flag (#5814) 2023-01-12 12:16:11 -05:00
Jack Short
6089d38daf feat: adding price scaling for sudoswap xyk pool (#5804)
* feat: adding price scaling for sudoswap xyk pool

* big number

* updating pricing logic for xyk

* fixing sweep

* removing isnotxykpool

* sudoswap calc refactoring

* refactoring calcpoolprice to include sudoswap

* refactoring calcpoolprice

* not letting asset items equal to 0 to be added

* removing comment
2023-01-11 16:05:51 -05:00
Mike Grabowski
3c6e067e90 refactor: less confusing MetaMask extension/connection detection (#5816)
* fix

* chore: remove
2023-01-12 00:12:10 +04:00
Mike Grabowski
fd1ee61daf fix: crash when invalid ENS avatar (#5810)
* chore: fix invalid ens

* chore: unwanted
2023-01-11 21:57:29 +04:00
Charles Bachmeier
de71f07b65 fix: collectionNft called before intialized (#5815)
Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-01-11 09:51:39 -08:00
Mike Grabowski
59f9c6c2d8 fix: infinite render loop on connection error (#5808)
fix: infinite render loop
2023-01-10 22:01:04 +04:00
lynn
3efcd3b23a fix: correct link on add liquidity page (#5803)
init
2023-01-09 19:03:55 -05:00
Jordan Frankfurt
726640787d fix: use number formatting lib for tick bounds on LP positions (#5573)
* fix: use number formatting lib for tick bounds on LP positions

* lint

* configure craco to work with conedison

* lint
2023-01-09 15:54:48 -06:00
Charles Bachmeier
889cdf6b66 feat: add nft list page v2 feature flag (#5801)
* add nft list page v2 feature flag

* add new flag file

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-01-09 11:27:18 -08:00
Charles Bachmeier
400666cd0b chore: migrate MarketplaceRow to styled-components (#5798)
* style ethPrice

* style old price info and fix up ethpricedisplay

* share style and use for remove icon

* style icon

* style fee column

* style returns column

* marketplace wrapper

* needed column

* remove unused style file

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-01-09 10:20:44 -08:00
Mike Grabowski
7f4fe6cc9b chore: disable Sentry in production (#5795)
disable sentry
2023-01-09 21:49:35 +04:00
Mike Grabowski
dce891ddbd chore: update Sentry version (#5794)
fix: update version:
2023-01-09 21:49:19 +04:00
Charles Bachmeier
bc9bb39a8f chore: Migrate List PriceInput from vanilla-extract to styled-components (#5792)
* wrapper

* wrap currency type

* global price icon

* style warning message

* rename style

* style warning message

* style input border

* remove useMemo

* simplify boolean

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-01-06 11:41:52 -08:00
Jack Short
0cc6879638 fix: do not show assets in sudoswap xyk pools (#5793)
* fix: failed sudoswap listings do not throw error

* valid asset filter on collection queries

* responding to comments
2023-01-05 16:28:58 -05:00
Jack Short
a5534803a1 chore: migrating bag footer to styled components (#5791) 2023-01-05 15:07:46 -05:00
eddie
a06f885724 fix: adjust the styling of BalanceSummary component to match design (#5755) 2023-01-05 12:04:09 -08:00
eddie
de7cfc93e6 fix: theme-aware root element color (#5788)
* fix: theme-aware root element color

* fix: add comment
2023-01-05 09:20:56 -08:00
eddie
aa6c469042 fix: remove manual redirects on token page (#5752) 2023-01-05 09:09:33 -08:00
Charles Bachmeier
dc478ce37e chore: Migrate NFTListRow from vanilla-extract to styled-components (#5785)
* remove redundant styles

* wrap nft info

* added back needed style

* style nft image

* style token and collection name

* wrap token info and marketplace rows

* use Row and Column shared components

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-01-05 08:46:54 -08:00
Jordan Frankfurt
3f3f16c366 fix: after 1 dismissal FoR banner should go away (#5778)
* Revert "fix: use localStorage for Fiat announcement (#5750)"

This reverts commit 62361647e0.

* fix: when a user dismisses the FoR banner, never show it again

* pr feedback

* fix some weird nft e2e test issues
2023-01-05 10:05:05 -06:00
Jack Short
8e84a53e57 fix: updating generated graphql types (#5784) 2023-01-05 11:03:24 -05:00
eddie
e88a50d309 fix: colors in token warnings (#5787) 2023-01-04 15:14:44 -08:00
Charles Bachmeier
102d99afa2 chore: Migrate NFTListingGrid from vanilla-extract to styled-components (#5782)
* remove some redundant styles

* column to Box

* add NFT header style

* wrap all price headers

* last header columns

* remove unused import

* unintentional build change

* migrate divider styles

* unintentional build change

* remove more unused styles

* use Row and Column shared components

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-01-04 13:34:36 -08:00
Jordan Frankfurt
73e4202497 fix: use analytics-events exported event names for sendAnalyticsEvent calls (#5781)
use analytics-events exported event names for sendAnalyticsEvent calls
2023-01-04 13:01:05 -06:00
eddie
6e228185b4 fix: add missing trace events and fix logo (#5780) 2023-01-04 10:45:49 -08:00
aballerr
bb92a9ee36 feat: consolidating fee columns (#5713)
* adding in floor price

* consolidating fee columns

* adding in tooltip

* adding in floor price

* current table progress

* better flex experience

* improved mobile listing experience

* improving the mobile experience

* cleaned up mobile experience

* reverting some file changes

* improving mobile experience

* some final adjustments

* updating text color to be line with task

* updating to address design comments

* resolving lint errors

* updating fees logic

* fixing linting issues

* removing generated files

* removing generated files

* removing generated files

* updating margin left

* Adding in trans components

* fixingl inting errors

* fixing minus icon placement

* i18n sort dropdown prompt

* move tooltip to its own file

* remove unused styles

* move NFTListRow to its own file

* move PriceTextInput to its own file

* adjust column settings

* add more translations

* Move MarketplaceRow to its own file

* warning message on small screens

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-01-04 09:49:23 -08:00
Charles Bachmeier
4936ec5cfc feat: nft input price field to use numeric keypad on mobile (#5775)
Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-01-04 08:39:03 -08:00
Adrian Kant
bb1db9048a refactor: using more specific analytics names (#5505)
* using new events library

* use not found page name constant

* use 2.0

* fix

* latest package including commonJS

* update to latest version
2023-01-04 10:29:12 -05:00
Charles Bachmeier
20dbb2a9f7 build: restart daily releases (#5777)
Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-01-03 13:26:37 -08:00
eddie
fd4430fe69 fix: include descriptions and links for native tokens (#5756) 2023-01-03 11:57:53 -08:00
eddie
167cc695c9 fix: stop showing the token logos from different chains as a fallback (#5761) 2023-01-03 11:57:22 -08:00
eddie
e175bff7f4 feat: build correct footer into About page (#5757)
* feat: build correct footer into About page

* fix: remove about link from footer
2023-01-03 11:56:53 -08:00
cartcrom
4442933eac feat: fetch top tokens based on volume & update data descriptions (#5360)
* replaced info icons w/ popover text
* replaced tooltip components w/ existing mouseover component
* fix: updating useCallback dependencies in tooltip component
* fix: removing redundant space
2023-01-03 12:12:06 -05:00
Charles Bachmeier
8447b30327 feat: update tx complete share icon (#5771)
update tx complete share icon

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-01-03 08:29:17 -08:00
Charles Bachmeier
22ce55ec46 fix: center empty wallet text on Profile Page Mobile (#5770)
center empty wallet text

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-01-03 08:29:06 -08:00
Vignesh Mohankumar
b25da9de2d fix: end -> flex-end (#5774) 2022-12-29 21:55:42 -05:00
Zach Pomerantz
ae1fb4367f build: pause scheduled releases (#5765) 2022-12-22 10:32:38 -08:00
Mike Grabowski
1410edda32 fix: Sentry source maps URL (#5764)
fix
2022-12-22 22:14:03 +04:00
Jordan Frankfurt
3bc7f015ee fix: add two more analytics events for m parity (#5748)
* fix: add two more analytics events for m parity

* pr feedback
2022-12-22 11:26:34 -06:00
lynn
802714377c fix: display warning / reload prompt modal when metamask erroneously disconnects (#5722)
* init

* hook up modal to error detection

* zzmp comments

* zzmp fixes
2022-12-21 18:32:34 -05:00
Mike Grabowski
352daf959e feat: enable Sentry (#5758) 2022-12-22 02:44:04 +04:00
Mike Grabowski
92c21c2811 feat: better UX when Sentry disabled (#5695)
* feat: disable sentry

* chore: update error page

* chore: use continue on error instead

* chore: wrap in trans

* flip check
2022-12-22 00:39:29 +04:00
lynn
e70723aaf3 fix: add missing amplitude sell events (#5530)
* in progress

* add events

* remove debug

* update analytics pkg

* removed signatures requested

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2022-12-21 11:19:38 -08:00
Mike Grabowski
1802f50163 chore: use @uniswap eslint preset (#5556)
* feat: replace eslint with preset

* chore: update

* add empty line

* Revert changes

* chore: replace colors

* chore: tweaks

* Revert "chore: replace colors"

This reverts commit 3462420ecb.

* bring lint back

* chore: tweaks

* chore: add note

* chore: fix yarn lock

* chore: fix yarn.lock 2

* chore: use ESLint from npm

* Chore: update lockfile

* tweaks

* chore: initial take fixing some lint issues

* tweaks

* chore: another take

* chore: further tweaks

* chore: fix further

* feat: ignore Jest for cypress

* revert change

* chore: update to latest preset

* tmp lets see if this works

* chore: turn error into warning

* chore: remove warnings

* chore: deduplicate yarn lock

* feat: add recommended ESLint extension in case someone has Prettier instead

* upgrade to latest uniswap config

* chore: update todo

* remove patch

* find to some

* name

* chore: tweak yarn lock

* update

* cleanup

* update name for filter

* nl

* no unsafe finally

* chore: update doc

* fix

* fix

* one more fix

* one more file

* chore: Fix two last build issues

* add generated back

* fix lint after merge

* chore: fix tests

* remove

* one more
2022-12-21 03:08:20 +04:00
Charles Bachmeier
2aa1b18d14 chore: Migrate from Relay to Apollo (#5754)
* feat: initial apollo configutation (#5565)

* initial apollo configutation

* add new files

* check in types-and-hooks

* config unused export

* deduplicate

* ignore checked in schema for linting

* remove prettier ignore

* test unchecking types and hooks file

* undo

* rename codegen, respond to comments

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>

* Remove maybe value from codegen

* add babel gql codegen

* correct ts graphql-tag

* remove plugin from craco

* chore: migrate Assets Query to Apollo (#5665)

* chore: migrate Assets Query to Apollo

* delete comment

* move length check back to collectionAssets

* remove uneeded check

* respond to comments

* working switching and filters

* change sweep fetch policy

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>

* chore: migrate collection query to apollo (#5647)

* migrate collection query to apollo

* remove page level suspense

* undo removing page level suspense

* rename query and hook

* guard returns

* add return type prop

* cleanup nullables

* memoizing

* use gql from apollo

* use babel gql and move empty trait

* add fetch policy

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>

* chore: migrate NFT details query to apollo (#5648)

* chore: migrate NFT details query to apollo

* update todo

* update imports

* remove no longer used hook

* rename query

* use babel gql and nonnullable type

* working page

* add fetchpolicy

* respond to comments

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>

* chore: migrate NftBalanceQuery (#5653)

* chore: migrate NftBalanceQuery

* cleanup

* update pagination

* better undefined handling

* move brake listing for invalid asset higher

* better handle loading

* memoize and cleanup

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>

* remove named gql query consts

* set default fetchPolicy

* null suspense

* chore: Migrate The Graph queries (#5727)

* migrate TheGraph queries to Apollo

* add new files

* ignore thegraph generated types

* use standard fetchPolicy

* update apollo codegen commands

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>

* chore: migrate token queries to Apollo (#5682)

* migrate utils to types-and-hooks

* too many TokenTable re-renders

* working token queries

* fixed sparkline for native asset

* onChangeTimePeriod

* define inline

* use query instead of data in naming

* sparklineQuery instead of sparklineData

* rename to usePriceHistory

* multiline if else

* remove optional

* remove unneeded eslint ignore

* rename tokenQueryLoading

* rename OnChangeTimePeriod

* token address fallback

* just address

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>

* chore: deprecate Relay (#5747)

* chore: deprecate Relay

* remove graph:ql generate step

* add new files

* apollo to graphql centric naming

* add new files

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>

* remove no longer needed config exclusions

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2022-12-20 13:42:52 -08:00
Vignesh Mohankumar
a286e5b114 test: disable fiat announcement on cypress tests (#5751)
* test: disable fiat announcement on cypress tests

* Revert "test: skip tests due to fiat on-ramp change (#5742)"

This reverts commit 283479f76e.

* dismissed
2022-12-20 15:36:57 -05:00
Vignesh Mohankumar
62361647e0 fix: use localStorage for Fiat announcement (#5750)
* fix: use localStorage for Fiat announcement

* move to redux

* rm locally

* lint

* add change to hook

* fixes
2022-12-20 15:21:52 -05:00
Vignesh Mohankumar
deee278439 chore: remove unused isOpen state in Landing (#5732)
Co-authored-by: eddie <66155195+just-toby@users.noreply.github.com>
2022-12-20 14:55:18 -05:00
Vignesh Mohankumar
6340deb201 chore: remove unused NFT redux user reducer state (#5753) 2022-12-20 14:55:08 -05:00
Vignesh Mohankumar
28b154ebe8 chore: remove landing redirect flag (#5736)
* test: add tests for landing redirect

* test: add tests for landing page (#5737)

* test: add tests for landing page

* lint

* intro=true

* rm downloads?

* fix: use second config option for no wallet in cypress

Co-authored-by: Eddie Dugan <eddie.dugan@uniswap.org>

Co-authored-by: Eddie Dugan <eddie.dugan@uniswap.org>
2022-12-20 14:54:56 -05:00
aballerr
3bde2165f4 fix: modal was removed, updating test to accommodate (#5749)
nft modal was removed, updating cypress to accommodate
2022-12-20 14:47:15 -05:00
Jack Short
78c8fd2359 style: updating cards to use appropriate aspect ratio (#5681)
* style: updating cards to use appropriate aspect ratio

* loading card height

* audio and video cards

* change loading height rendering

* respond to self serving comments

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2022-12-20 11:10:54 -08:00
eddie
c378752910 feat: fiat on ramp tile for about page (#5746)
* feat: move about content into landing page

* fix: delete unused image files

* fix: remove unused components

* fix: pointer events on title and subtitle

* feat: add about footer to landing page

* fix: simplify css in Landing Page

* feat(moonpay): moonpay ip checks to determine if the user can access the fiat onramp (#10)

* feat(moonpay): useFiatOnrampAvailable

* feat(moonpay): ip check with moonpay for buy crypto availability

* add error state and clear up some of the sequence of logic

* add button-specific spinner, put the ... menu button behind the feature flag

* hide ... menu option if onramp is unavailable

* add live publishable moonpay key

* add initial FoR hype border flash to announcement acknowledgment

* remove ... menu access to FoR feature

* add tooltip and external link to info icon

* nicer error display

* add stale market to ack

* pr feedback from zzmp

* fix really weird react bug

* ts fix and clear timeout

* pairing staleness handler w/ zzmp

* add back feature flag

* feat: fiat on ramp tile for about page

Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com>
2022-12-20 13:23:29 -05:00
eddie
0bf7b92013 feat: move about content into landing page (#5734)
* feat: move about content into landing page

* fix: delete unused image files

* fix: remove unused components

* fix: pointer events on title and subtitle

* feat: add about footer to landing page

* fix: simplify css in Landing Page

* feat(moonpay): moonpay ip checks to determine if the user can access the fiat onramp (#10)

* feat(moonpay): useFiatOnrampAvailable

* feat(moonpay): ip check with moonpay for buy crypto availability

* add error state and clear up some of the sequence of logic

* add button-specific spinner, put the ... menu button behind the feature flag

* hide ... menu option if onramp is unavailable

* add live publishable moonpay key

* add initial FoR hype border flash to announcement acknowledgment

* remove ... menu access to FoR feature

* add tooltip and external link to info icon

* nicer error display

* add stale market to ack

* pr feedback from zzmp

* fix really weird react bug

* ts fix and clear timeout

* pairing staleness handler w/ zzmp

* add back feature flag

Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com>
2022-12-20 13:07:46 -05:00
Jordan Frankfurt
283479f76e test: skip tests due to fiat on-ramp change (#5742)
skip tests
2022-12-20 12:31:11 -05:00
Vignesh Mohankumar
d3c30e2f6b docs: update buying crypto helpcenter link (#5744)
* docs: update buying crypto helpcenter link

* new link

* new link
2022-12-20 12:30:32 -05:00
Jordan Frankfurt
32d226f78e feat: enable FoR flag (#5741) 2022-12-20 11:50:00 -05:00
Jordan Frankfurt
96744505c0 Merge pull request #5740 from Uniswap/FoR-publish
feat: FoR publish
2022-12-20 10:40:36 -06:00
Jordan Frankfurt
97236033d4 conditional access of .renderCount 2022-12-20 10:27:52 -06:00
Jordan Frankfurt
86e62dc4b9 add back feature flag 2022-12-20 09:56:15 -06:00
Vignesh Mohankumar
e584a5fa36 chore: removes unused Liquidity Mining code (#5451)
* feat: remove unused liquidity mining pages

* some changes

* rm more
2022-12-19 20:06:59 -05:00
Vignesh Mohankumar
332ef6e6c8 chore: remove /#/claim (#5445)
rm claim
2022-12-19 19:46:36 -05:00
Jordan Frankfurt
8cbd111e65 Merge pull request #8 from Uniswap/merge-upstream
chore: Merge upstream
2022-12-19 15:25:10 -06:00
Jordan Frankfurt
55ffcbd465 Merge remote-tracking branch 'upstream/main' into merge-upstream 2022-12-19 15:12:16 -06:00
Jordan Frankfurt
404775e86d Merge pull request #7 from Uniswap/analytics-account-dropdown-click
chore: analytics account dropdown click
2022-12-19 15:10:15 -06:00
Vignesh Mohankumar
0ae9fe28a2 feat: force landing page to show based on landing query param (#5730)
* feat: force landing page to show based on `landing` query param

* flag

* use intro

* lint
2022-12-19 15:49:42 -05:00
Vignesh Mohankumar
89c0caae43 feat: push nav icon to /?intro=true (#5731)
* feat: push nav icon to /?intro=true

* search
2022-12-19 15:48:53 -05:00
Vignesh Mohankumar
c8086e3c76 fix: wait to render Landing content until checking wallet cache (#5729)
* fix: wait to render Landing content until checking wallet cache

* use state
2022-12-19 15:22:13 -05:00
Jordan Frankfurt
1c2842e5a0 chore: analytics account dropdown click 2022-12-19 14:21:50 -06:00
Vignesh Mohankumar
a2c6d3f475 feat: navigate to /swap if user has a wallet cached (#5728)
* feat: navigate to /swap if user has a wallet cached

* flag it
2022-12-19 14:55:51 -05:00
Jordan Frankfurt
841ea7f8a1 Merge pull request #6 from Uniswap/fix-menu-z-index
fix: landing page overlay occlusion of Z_INDEX.dropdown
2022-12-19 13:49:10 -06:00
aballerr
804692b114 fix: adding fixed header (#5712)
*  adding fixed header
2022-12-19 14:26:07 -05:00
Vignesh Mohankumar
6282298d13 chore: add landing page redirect flag (#5724)
* chore: add landing page redirect flag

* unused

* fix
2022-12-19 13:38:03 -05:00
eddie
7a5b855097 chore: bump version of @uniswap/analytics-events (#5726) 2022-12-19 13:36:42 -05:00
Jordan Frankfurt
c9908748cf make under-dropdown 990 2022-12-19 12:24:43 -06:00
Jordan Frankfurt
79b77deee1 fix: bump conedison (#5725) 2022-12-19 12:15:16 -06:00
Jordan Frankfurt
a554af6670 pr feedback 2022-12-19 11:39:29 -06:00
lynn
1843f214b1 fix: hover button states (#5553)
* init but this looks wrong based on figma

* init

* fix props

* add back children
2022-12-19 12:18:25 -05:00
Jordan Frankfurt
3e0788092e Merge pull request #5 from Uniswap/geocheck-analytics
feat: add analytics for moonpay ip check
2022-12-19 11:13:30 -06:00
Jordan Frankfurt
d14c49df0d fix: landing page overlay occlusion of Z_INDEX.dropdown 2022-12-19 11:03:03 -06:00
eddie
c098ad1ffe fix: correct font size for the trade rate to on safari (#5714)
* fix: correct font size for the trade rate to on safari

* fix: use themedText.BodySmall for this label
2022-12-19 09:27:43 -05:00
Jordan Frankfurt
48114ef51d feat: add analytics for moonpay ip check 2022-12-18 09:48:38 -06:00
Jordan Frankfurt
cb7132ee17 Merge pull request #3 from Uniswap/FoR-main
feat: FoR commits from mgtm repo
2022-12-16 11:10:30 -06:00
Jordan Frankfurt
0fa4859a09 6a47ac3c231a42a00ffee40677c46bf612e14187 2022-12-15 17:39:38 -06:00
Jordan Frankfurt
f8bb5046f0 73ad9987e4b337987f8e3cb2ef861bf03c42cc67 2022-12-15 17:37:58 -06:00
Jordan Frankfurt
7d1589d1df fixing from cherry-pick process 2022-12-15 17:05:06 -06:00
Jordan Frankfurt
26b603cc2e fix: update moonpay supported currencies list (#57)
lint
2022-12-15 16:34:05 -06:00
Jordan Frankfurt
ece68a0ec7 fix: close wallet modal on connection (#53)
fix: hide celo on uniswap wallet connections (#48)

* fix: hide celo on uniswap wallet connections

* add disabled UI instead of removing network from list

Revert "fix: hide celo on uniswap wallet connections (#48)"

This reverts commit b22d82545fef6812b22fe1adc3f281588642c9cd.
2022-12-15 15:32:21 -06:00
Jordan Frankfurt
fd212477ce fix: json.stringify addresses (#52) 2022-12-15 15:32:20 -06:00
Jordan Frankfurt
a16d2387cc fix: FoR polish (#47)
* fix: remove currencyCode config property from moonpay url

* add 8px padding to moonpay iframe

* don't switch button text when loading

* update tooltip text

* update announcement text

* remove FoR announcement on iOS mobile

* improve fiat quote format in account dropdown

fix: typo (#51)
2022-12-15 15:32:20 -06:00
Jordan Frankfurt
cae56ec385 feat: add supported currency list to moonpay config (#45) 2022-12-15 15:32:20 -06:00
Jordan Frankfurt
d16b3473e0 fix: remove currencyCode config property from moonpay url (#40) 2022-12-15 15:32:20 -06:00
Jordan Frankfurt
f66f249dba fix: fiat onramp polish (#36)
* fix: fiat onramp polish

* add 3 session render cap on FoR announcement
2022-12-15 15:32:20 -06:00
Jordan Frankfurt
08afd888d0 fix(moonpay): add ?platform=web to moonpay env vars (#35) 2022-12-15 15:32:20 -06:00
Jordan Frankfurt
b427be2673 feat(moonpay): moonpay ip checks to determine if the user can access the fiat onramp (#10)
* feat(moonpay): useFiatOnrampAvailable

* feat(moonpay): ip check with moonpay for buy crypto availability

* add error state and clear up some of the sequence of logic

* add button-specific spinner, put the ... menu button behind the feature flag

* hide ... menu option if onramp is unavailable

* add live publishable moonpay key

* add initial FoR hype border flash to announcement acknowledgment

* remove ... menu access to FoR feature

* add tooltip and external link to info icon

* nicer error display

* add stale market to ack

* pr feedback from zzmp

* fix really weird react bug

* ts fix and clear timeout

* pairing staleness handler w/ zzmp
2022-12-15 15:32:20 -06:00
Jordan Frankfurt
f753a5e325 feat(moonpay): add iframe (#9)
* feat(moonpay): add iframe

* add prod url

* polish iframe styles and supply the firebase fn with the new platform query param

* pr feedback

* pr feedback - .production env key distinction

feat(moonpay): add iframe (#9)

* feat(moonpay): add iframe

* add prod url

* polish iframe styles and supply the firebase fn with the new platform query param

* pr feedback

* pr feedback - .production env key distinction
2022-12-15 15:32:19 -06:00
Jordan Frankfurt
46d9d8e3df feat(fiat): announcement
cleanup

cleanup

fix close button

cleanup
2022-12-15 15:32:19 -06:00
Jordan Frankfurt
680d3a3f26 feat(fiat): add overflow menu cta 2022-12-15 15:32:19 -06:00
Jordan Frankfurt
e4c625ee71 feat(onramp): cta 2022-12-15 15:32:19 -06:00
1064 changed files with 110779 additions and 51238 deletions

13
.env
View File

@@ -1,7 +1,14 @@
REACT_APP_INFURA_KEY="4bf032f2d38a4ed6bb975b80d6340847"
# These API keys are intentionally public. Please do not report them - thank you for your concern.
ESLINT_NO_DEV_ERRORS=true
REACT_APP_AMPLITUDE_PROXY_URL="https://api.uniswap.org/v1/amplitude-proxy"
REACT_APP_AWS_API_REGION="us-east-2"
REACT_APP_AWS_API_ENDPOINT="https://beta.api.uniswap.org/v1/graphql"
REACT_APP_TEMP_API_URL="https://temp.api.uniswap.org/v1"
REACT_APP_BNB_RPC_URL="https://rough-sleek-hill.bsc.quiknode.pro/413cc98cbc776cda8fdf1d0f47003583ff73d9bf"
REACT_APP_INFURA_KEY="4bf032f2d38a4ed6bb975b80d6340847"
REACT_APP_MOONPAY_API="https://api.moonpay.com"
REACT_APP_MOONPAY_LINK="https://us-central1-uniswap-mobile.cloudfunctions.net/signMoonpayLinkV2?platform=web&env=staging"
REACT_APP_MOONPAY_PUBLISHABLE_KEY="pk_test_DycfESRid31UaSxhI5yWKe1r5E5kKSz"
REACT_APP_SENTRY_DSN="https://a3c62e400b8748b5a8d007150e2f38b7@o1037921.ingest.sentry.io/4504255148851200"
ESLINT_NO_DEV_ERRORS=true
REACT_APP_STATSIG_PROXY_URL="https://api.uniswap.org/v1/statsig-proxy"
REACT_APP_TEMP_API_URL="https://temp.api.uniswap.org/v1"
REACT_APP_WALLET_CONNECT_PROJECT_ID="c6c9bacd35afa3eb9e6cccf6d8464395"

View File

@@ -1,7 +1,15 @@
# These API keys are intentionally public. Please do not report them - thank you for your concern.
REACT_APP_AMPLITUDE_PROXY_URL="https://api.uniswap.org/v1/amplitude-proxy"
REACT_APP_INFURA_KEY="099fc58e0de9451d80b18d7c74caa7c1"
REACT_APP_AWS_API_ENDPOINT="https://api.uniswap.org/v1/graphql"
REACT_APP_BNB_RPC_URL="https://old-wispy-arrow.bsc.quiknode.pro/f5c060177236065c1058531a0615ab4f7a34a2fd"
REACT_APP_FIREBASE_KEY="AIzaSyBcZWwTcTJHj_R6ipZcrJkXdq05PuX0Rs0"
REACT_APP_FORTMATIC_KEY="pk_live_F937DF033A1666BF"
REACT_APP_GOOGLE_ANALYTICS_ID="G-KDP9B6W4H8"
REACT_APP_FIREBASE_KEY="AIzaSyBcZWwTcTJHj_R6ipZcrJkXdq05PuX0Rs0"
REACT_APP_AWS_API_ENDPOINT="https://api.uniswap.org/v1/graphql"
REACT_APP_INFURA_KEY="099fc58e0de9451d80b18d7c74caa7c1"
REACT_APP_MOONPAY_API="https://api.moonpay.com"
REACT_APP_MOONPAY_LINK="https://us-central1-uniswap-mobile.cloudfunctions.net/signMoonpayLinkV2?platform=web&env=production"
REACT_APP_MOONPAY_PUBLISHABLE_KEY="pk_live_uQG4BJC4w3cxnqpcSqAfohdBFDTsY6E"
REACT_APP_SENTRY_ENABLED=true
REACT_APP_SENTRY_TRACES_SAMPLE_RATE=0.00003
REACT_APP_STATSIG_PROXY_URL="https://api.uniswap.org/v1/statsig-proxy"
THE_GRAPH_SCHEMA_ENDPOINT="https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v3"

View File

@@ -1,2 +0,0 @@
*.config.ts
*.d.ts

61
.eslintrc.js Normal file
View File

@@ -0,0 +1,61 @@
/* eslint-env node */
require('@uniswap/eslint-config/load')
const rulesDirPlugin = require('eslint-plugin-rulesdir')
rulesDirPlugin.RULES_DIR = 'eslint_rules'
module.exports = {
extends: ['@uniswap/eslint-config/react'],
plugins: ['rulesdir'],
overrides: [
{
files: ['**/*'],
rules: {
'multiline-comment-style': ['error', 'separate-lines'],
'rulesdir/no-undefined-or': 'error',
},
},
{
// Configuration/typings typically export objects/definitions that are used outside of the transpiled package
// (eg not captured by the tsconfig). Because it's typical and not exceptional, this is turned off entirely.
files: ['**/*.config.*', '**/*.d.ts'],
rules: {
'import/no-unused-modules': 'off',
},
},
{
files: ['**/*.ts', '**/*.tsx'],
rules: {
'import/no-restricted-paths': [
'error',
{
zones: [
{
target: ['src/**/*[!.test].ts', 'src/**/*[!.test].tsx'],
from: 'src/test-utils',
},
],
},
],
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'moment',
// tree-shaking for moment is not configured because it degrades performance - see craco.config.cjs.
message: 'moment is not configured for tree-shaking. If you use it, update the Webpack configuration.',
},
{
name: 'zustand',
importNames: ['default'],
message: 'Default import from zustand is deprecated. Import `{ create }` instead.',
},
],
},
],
},
},
],
}

View File

@@ -1,109 +0,0 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"ecmaFeatures": {
// Allows for the parsing of JSX
"jsx": true
}
},
"settings": {
"react": {
"version": "detect"
},
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"typescript": {
"alwaysTryTypes": true
}
}
},
"ignorePatterns": [
"src/types/v3",
"src/abis/types",
"src/locales/**/*.js",
"src/locales/**/en-US.po",
"node_modules",
"coverage",
"build",
"dist",
".DS_Store",
".env.local",
".env.development.local",
".env.test.local",
".env.production.local",
".idea/",
".vscode/",
"package-lock.json",
"yarn.lock"
],
"extends": [
"react-app",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
"prettier/@typescript-eslint",
"plugin:prettier/recommended",
"plugin:import/typescript"
],
"plugins": ["import", "simple-import-sort", "unused-imports"],
"rules": {
"import/no-unused-modules": [2, { "unusedExports": true }],
"unused-imports/no-unused-imports": "error",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"@typescript-eslint/explicit-function-return-type": "off",
"prettier/prettier": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"react/react-in-jsx-scope": "off",
"react/jsx-curly-brace-presence": ["error", { "props": "never", "children": "never" }],
"object-shorthand": ["error", "always"],
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "ethers",
"message": "Please import from '@ethersproject/module' directly to support tree-shaking."
},
{
"name": "styled-components",
"message": "Please import from styled-components/macro."
},
{
"name": "@lingui/macro",
"importNames": ["t"],
"message": "Please use <Trans> instead of t."
}
],
"patterns": [
{
"group": ["**/dist"],
"message": "Do not import from dist/ - this is an implementation detail, and breaks tree-shaking."
},
{
"group": ["!styled-components/macro"]
}
]
}
],
"@typescript-eslint/no-restricted-imports": [
"error",
{
"paths": [
{
"name": "@ethersproject/providers",
"message": "Please only use Providers instantiated in constants/providers to improve traceability.",
"allowTypeImports": true
}
]
}
]
}
}

2
.github/CODEOWNERS vendored
View File

@@ -1 +1 @@
@uniswap/web
@uniswap/web-admins

View File

@@ -0,0 +1,32 @@
name: Cache on main
description: caches node_modules/.cache, but only saves from main
inputs:
path:
description: 'A list of files, directories, and wildcard patterns to cache and store'
required: true
key:
description: 'An explicit key for restoring and saving the cache'
required: true
restore-keys:
description: 'An ordered list of keys to use for restoring stale cache if no cache hit occured for key. Note `cache-hit` returns false in this case.'
required: false
# Many build steps have their own caches to improve subsequent build times.
# Build tools are configured to cache to node_modules/.cache, so they are cached independently of node_modules.
# Caches are saved every run *on main* (by keying on github.run_id), and the most recent available cache is loaded.
# Caches are not saved on feature branches because they have limited utility, and extend the runtime of the workflow.
# See https://jongleberry.medium.com/speed-up-your-ci-and-dx-with-node-modules-cache-ac8df82b7bb0.
runs:
using: composite
steps:
- uses: actions/cache/restore@v3
with:
path: ${{ inputs.path }}
key: ${{ inputs.key }}
restore-keys: ${{ inputs.restore-keys }}
- if: github.ref_name == 'main'
uses: actions/cache/save@v3
with:
path: ${{ inputs.path }}
key: ${{ inputs.key }}

48
.github/actions/report/action.yml vendored Normal file
View File

@@ -0,0 +1,48 @@
name: Report
description: Report test failures via Slack
inputs:
name:
description: The name of the failing test
required: true
SLACK_WEBHOOK_URL:
description: The webhook URL to send the report to
required: true
runs:
using: composite
steps:
- uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844
with:
payload: |
{
"text": "${{ inputs.name }} failing on `${{ github.ref_name }}`",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*${{ inputs.name }} failing on `${{ github.ref_name }}`:* <https://github.com/${{ github.repository}}/actions/runs/${{ github.run_id }}|view failing action>"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "_This is blocking pull requests and branch promotions._\n_Please prioritize fixing the build._"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ inputs.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
# The !oncall bot requires its own message:
- uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844
with:
payload: |
{
"text": "!oncall web"
}
env:
SLACK_WEBHOOK_URL: ${{ inputs.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

View File

@@ -1,4 +1,6 @@
name: Setup
description: checkout repo, setup node, and install node_modules
runs:
using: composite
steps:
@@ -6,16 +8,67 @@ runs:
- uses: actions/setup-node@v3
with:
node-version: 14
node-version: 18
registry-url: https://registry.npmjs.org
cache: yarn
# cache is intentionally omitted, as it is faster with yarn v1 to cache node_modules.
- uses: actions/cache@v3
id: install-cache
with:
path: node_modules/
key: ${{ runner.os }}-install-${{ hashFiles('**/yarn.lock') }}
# node_modules/.cache is intentionally omitted, as this is used for build tool caches.
path: |
node_modules
!node_modules/.cache
key: ${{ runner.os }}-install-${{ hashFiles('yarn.lock') }}
- if: steps.install-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --ignore-scripts
shell: bash
# Validators compile quickly, so caching can be omitted.
- run: yarn ajv
shell: bash
# Contracts are compiled from source. If source hasn't changed, the contracts do not need to be re-compiled.
- uses: actions/cache@v3
id: contracts-cache
with:
path: |
src/abis/types
src/types/v3
key: ${{ runner.os }}-contracts-${{ hashFiles('src/abis/**/*.json', 'node_modules/@uniswap/**/artifacts/contracts/**/*.json') }}
- if: steps.contracts-cache.outputs.cache-hit != 'true'
run: yarn contracts
shell: bash
# GraphQL is generated from schema. The schema is always fetched, but if unchanged, graphql does not need to be re-generated.
- run: yarn graphql:fetch
shell: bash
- uses: actions/cache@v3
id: graphql-cache
with:
path: src/graphql/**/__generated__
key: ${{ runner.os }}-graphql-${{ hashFiles('src/graphql/**/schema.graphql') }}
- if: steps.graphql-cache.outputs.cache-hit != 'true'
run: yarn graphql:generate
shell: bash
# Messages are extracted from source.
# A record of source file content hashes and catalogs is maintained in node_modules/.cache/lingui.
# Messages are always extracted, but extraction may short-circuit from the custom extractor's cache.
- uses: ./.github/actions/cache-on-main
with:
path: node_modules/.cache
key: ${{ runner.os }}-i18n-extract-${{ github.run_id }}
restore-keys: ${{ runner.os }}-i18n-extract-
- run: yarn i18n:extract
shell: bash
# Translations are compiled from messages. If messages haven't changed, the translations do not need to be re-compiled.
- uses: actions/cache@v3
id: i18n-compile-cache
with:
path: src/locales/*.js
key: ${{ runner.os }}-i18n-compile-${{ hashFiles('src/locales/*.po') }}
- if: steps.i18n-compile-cache.outputs.cache-hit !='true'
run: yarn i18n:compile
shell: bash

View File

@@ -8,4 +8,5 @@ updates:
allow:
- dependency-name: '@uniswap/default-token-list'
- dependency-name: '@uniswap/token-lists'
- dependency-name: '@uniswap/widgets'
reviewers:
- 'Uniswap/dependabot-reviewers'

View File

@@ -1,24 +1,52 @@
Your PR title must follow [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary), and should start with one of the following [types](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#type):
<!-- Your PR title must follow conventional commits: https://github.com/Uniswap/interface#pr-title -->
- build: Changes that affect the build system or external dependencies (example scopes: yarn, eslint, typescript)
- ci: Changes to our CI configuration files and scripts (example scopes: vercel, github, cypress)
- docs: Documentation only changes
- feat: A new feature
- fix: A bug fix
- perf: A code change that improves performance
- refactor: A code change that neither fixes a bug nor adds a feature
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- test: Adding missing tests or correcting existing tests
## Description
<!-- Summary of change, including motivation and context. -->
<!-- Use verb-driven language: "Fixes XYZ" instead of "This change fixes XYZ" -->
Example commit messages:
- feat: adds support for gnosis safe wallet
- fix: removes a polling memory leak
- chore: bumps redux version
<!-- Delete inapplicable lines: -->
_Linear ticket:_
_Slack thread:_
_Relevant docs:_
Other things to note:
- Please describe the change using verb statements (ex: Removes X from Y)
- PRs with multiple changes should use a list of verb statements
- Add any relevant unit / integration tests
- Changes will be previewable via vercel. Non-obvious changes should include instructions for how to reproduce them
<!-- Delete this section if your change does not affect UI. -->
## Screen capture
### Before
| Mobile | Desktop |
| ------------ | ------------ |
| paste_before | paste_before |
### After
| Mobile | Desktop |
| ------------ | ----------- |
| paste_after | paste_after |
## Test plan
<!-- Delete this section if your change is not a bug fix. -->
### Reproducing the error
<!-- Include steps to reproduce the bug. -->
1.
### QA (ie manual testing)
<!-- Include steps to test the change, ensuring no regression. -->
- [ ] N/A
#### Devices
<!-- If applicable, include different devices and screen sizes that may be affected, and how you've tested them. -->
### Automated testing
<!-- If N/A, check and note so it is obvious to your reviewers and does not show up as an incomplete task. -->
<!-- eg - [x] Unit test N/A -->
- [ ] Unit test
- [ ] Integration/E2E test

73
.github/workflows/1-main-to-staging.yml vendored Normal file
View File

@@ -0,0 +1,73 @@
name: 1 | Push main -> staging
# This CI job is responsible for pushing the current contents of the `main` branch to the
# `releases/staging` branch, which will in turn kick off a deploy to the staging environment.
on:
workflow_dispatch:
# https://stackoverflow.com/questions/57921401/push-to-origin-from-github-action
jobs:
push-staging:
name: 'Push to staging branch'
runs-on: ubuntu-latest
environment:
name: push/staging
steps:
- name: Check test status
uses: actions/github-script@v6.4.1
with:
script: |
const statuses = await github.rest.repos.listCommitStatusesForRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: context.sha
})
const status = statuses.data.find(status => status.context === 'Test / promotion')?.state || 'missing'
core.info('Status: ' + status)
if (status !== 'success') {
core.setFailed('"Test / promotion" must be successful before pushing')
}
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
with:
token: ${{ secrets.RELEASE_SERVICE_ACCESS_TOKEN }}
ref: main
# The source file must exist for the corresponding translation messages to be downloaded.
- run: touch src/locales/en-US.po
- name: Download translations
uses: crowdin/github-action@3133cc916c35590475cf6705f482fb653d8e36e9
with:
upload_sources: false
download_translations: true
project_id: 458284
token: ${{ secrets.CROWDIN_PERSONAL_TOKEN_SECRET }}
source: 'src/locales/en-US.po'
translation: 'src/locales/%locale%.po'
localization_branch_name: main
create_pull_request: false
push_translations: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Git config
run: |
git config user.name 'UL Service Account'
git config user.email 'hello-happy-puppy@users.noreply.github.com'
- name: Add translations
run: |
rm src/locales/en-US.po
git add -f src/locales/*.po
git commit -m 'ci(t9n): download translations from crowdin'
- name: Add CODEOWNERS
run: |
echo '@uniswap/web-admins' > CODEOWNERS
git add CODEOWNERS
git commit -m 'ci: add global CODEOWNERS'
- name: Git push
run: |
git push origin main:releases/staging --force

View File

@@ -0,0 +1,64 @@
name: 2 | Deploy staging
on:
push:
branches:
- 'releases/staging'
jobs:
deploy-to-staging:
runs-on: ubuntu-latest
environment:
name: deploy/staging
steps:
- uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844
continue-on-error: true
with:
payload: |
{
"text": "Deploy _started_ for ${{ github.ref_name }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: yarn build
env:
REACT_APP_STAGING: 1
- name: Update Cloudflare Pages deployment
id: pages-deployment
uses: cloudflare/pages-action@364c7ca09a4b57837c5967871d64a2c31adb8c0d
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: interface-staging
directory: build
githubToken: ${{ secrets.GITHUB_TOKEN }}
# Cloudflare uses `main` as the default production branch, so we push using the `main` branch so that it can be aliased by a custom domain.
branch: main
- uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844
continue-on-error: true
if: always()
with:
payload: |
{
"text": "Deploy *${{ steps.pages-deployment.outcome }}* for ${{ github.ref_name }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
- name: Upload source maps to Sentry
uses: getsentry/action-release@bd5f874fcda966ba48139b0140fb3ec0cb3aabdd
continue-on-error: true
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
with:
environment: staging
sourcemaps: './build/static/js'
url_prefix: '~/static/js'

27
.github/workflows/3-staging-to-prod.yml vendored Normal file
View File

@@ -0,0 +1,27 @@
name: 3 | Push staging -> prod
# This CI job is responsible for force pushing the content of releases/staging to releases/prod. It
# is restricted to web-reviewers through virtue of the GitHub environment protection rules for the
# prod environment.
on:
workflow_dispatch:
jobs:
push-prod:
name: 'Push to prod branch'
runs-on: ubuntu-latest
environment:
name: push/prod
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
with:
token: ${{ secrets.RELEASE_SERVICE_ACCESS_TOKEN }}
ref: releases/staging
- name: Git config
run: |
git config user.name "UL Service Account"
git config user.email "hello-happy-puppy@users.noreply.github.com"
- name: Git push
run: |
git push origin releases/staging:releases/prod --force

View File

@@ -1,118 +1,106 @@
name: Release
name: 4 | Deploy prod
on:
schedule:
- cron: '0 12 * * 1-4' # every day 12:00 UTC Monday-Thursday
# manual trigger
workflow_dispatch:
push:
branches:
- 'releases/prod'
jobs:
wait-on-tests:
deploy-to-prod:
runs-on: ubuntu-latest
environment:
name: deploy/prod
steps:
- id: unit-tests
uses: fountainhead/action-wait-for-check@v1.0.0
- uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844
continue-on-error: true
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: unit-tests
- id: cypress-tests
uses: fountainhead/action-wait-for-check@v1.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: cypress-tests
- if: steps.unit-tests.outputs.conclusion != 'success' || steps.cypress-tests.outputs.conclusion != 'success'
run: exit 1
payload: |
{
"text": "Deploy _started_ for ${{ github.ref_name }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
tag:
needs: wait-on-tests
runs-on: ubuntu-latest
outputs:
new_tag: ${{ steps.github-tag-action.outputs.new_tag }}
changelog: ${{ steps.github-tag-action.outputs.changelog }}
steps:
- uses: actions/checkout@v3
- name: Bump and tag
id: github-tag-action
uses: mathieudutour/github-tag-action@v6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
release_branches: .*
default_bump: patch
release:
needs: tag
if: ${{ needs.tag.outputs.new_tag != null }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: yarn prepare
- run: yarn build
- name: Bump and tag
id: github-tag-action
uses: mathieudutour/github-tag-action@d745f2e74aaf1ee82e747b181f7a0967978abee0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
release_branches: releases/prod
default_bump: patch
- name: Pin to IPFS
id: pinata
uses: anantaramdas/ipfs-pinata-deploy-action@39bbda1ce1fe24c69c6f57861b8038278d53688d
with:
pin-name: Uniswap ${{ needs.tag.outputs.new_tag }}
pin-name: Uniswap ${{ steps.github-tag-action.outputs.new_tag }}
path: './build'
pinata-api-key: ${{ secrets.PINATA_API_KEY }}
pinata-secret-api-key: ${{ secrets.PINATA_API_SECRET_KEY }}
- name: Pin to Crust
uses: crustio/ipfs-crust-action@v2.0.3
continue-on-error: true
timeout-minutes: 2
with:
cid: ${{ steps.upload.outputs.hash }}
seeds: ${{ secrets.CRUST_SEEDS }}
- name: Convert CIDv0 to CIDv1
id: convert-cidv0
uses: uniswap/convert-cidv0-cidv1@v1.0.0
with:
cidv0: ${{ steps.pinata.outputs.hash }}
- name: Release
- name: Publish release
uses: actions/create-release@v1.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.tag.outputs.new_tag }}
release_name: Release ${{ needs.tag.outputs.new_tag }}
tag_name: ${{ steps.github-tag-action.outputs.new_tag }}
release_name: Release ${{ steps.github-tag-action.outputs.new_tag }}
body: |
IPFS hash of the deployment:
- CIDv0: `${{ steps.pinata.outputs.hash }}`
- CIDv1: `${{ steps.convert-cidv0.outputs.cidv1 }}`
The latest release is always accessible via our alias to the Cloudflare IPFS gateway at [app.uniswap.org](https://app.uniswap.org).
The latest release is always mirrored at [app.uniswap.org](https://app.uniswap.org).
You can also access the Uniswap Interface directly from an IPFS gateway.
You can also access the Uniswap Interface from an IPFS gateway.
**BEWARE**: The Uniswap interface uses [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) to remember your settings, such as which tokens you have imported.
**You should always use an IPFS gateway that enforces origin separation**, or our alias to the latest release at [app.uniswap.org](https://app.uniswap.org).
**You should always use an IPFS gateway that enforces origin separation**, or our hosted deployment of the latest release at [app.uniswap.org](https://app.uniswap.org).
Your Uniswap settings are never remembered across different URLs.
IPFS gateways:
- https://${{ steps.convert-cidv0.outputs.cidv1 }}.ipfs.dweb.link/
- https://${{ steps.convert-cidv0.outputs.cidv1 }}.ipfs.cf-ipfs.com/
- [ipfs://${{ steps.upload.outputs.hash }}/](ipfs://${{ steps.pinata.outputs.hash }}/)
- [ipfs://${{ steps.pinata.outputs.hash }}/](ipfs://${{ steps.pinata.outputs.hash }}/)
${{ needs.tag.outputs.changelog }}
- name: Setup node@16 (required by Cloudflare Pages)
uses: actions/setup-node@v3
with:
node-version: 16
${{ steps.github-tag-action.outputs.changelog }}
- name: Update Cloudflare Pages deployment
uses: cloudflare/pages-action@364c7ca09a4b57837c5967871d64a2c31adb8c0d
id: pages-deployment
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }}
directory: build
githubToken: ${{ secrets.GITHUB_TOKEN }}
# Cloudflare uses `main` as the default production branch, so we push using the `main` branch so that it can be aliased by a custom domain.
branch: main
- uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844
continue-on-error: true
if: always()
with:
payload: |
{
"text": "Deploy *${{ steps.pages-deployment.outcome }}* for ${{ github.ref_name }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
- name: Upload source maps to Sentry
uses: getsentry/action-release@bd5f874fcda966ba48139b0140fb3ec0cb3aabdd
uses: getsentry/action-release@4744f6a65149f441c5f396d5b0877307c0db52c7
continue-on-error: true
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
@@ -120,4 +108,4 @@ jobs:
with:
environment: production
sourcemaps: './build/static/js'
url_prefix: '/static/js'
url_prefix: '~/static/js'

View File

@@ -1,33 +0,0 @@
name: Crowdin Download
on:
schedule:
# Download translations every hour.
# This is not done as part of the build so that builds remain reproducible.
- cron: '0 * * * *'
# manual trigger
workflow_dispatch:
jobs:
download-translations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: yarn i18n:extract
- name: Download Crowdin translations
uses: crowdin/github-action@1.4.9
with:
upload_sources: false
download_translations: true
project_id: 458284
token: ${{ secrets.CROWDIN_PERSONAL_TOKEN_SECRET }}
source: 'src/locales/en-US.po'
translation: 'src/locales/%locale%.po'
create_pull_request: true
pull_request_title: 'chore(i18n): new Crowdin translations'
localization_branch_name: l10n_crowdin
commit_message: 'chore(i18n): synchronize translations from crowdin [skip ci]'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -14,7 +14,7 @@ jobs:
- run: yarn i18n:extract
- name: Upload Crowdin sources
uses: crowdin/github-action@1.1.0
uses: crowdin/github-action@3133cc916c35590475cf6705f482fb653d8e36e9
with:
upload_sources: true
download_translations: false

View File

@@ -0,0 +1,91 @@
name: Slack notification on pushes to releases/*
# This CI job will push notifications to Slack whenever code is merged into any releases/* branch
#
# The steps of the command line kung-fu shown below are as follows:
# First we take the JSON-formatted Github context
# echo $GITHUB_CONTEXT \
# Then we parse out the specific fields we want for our messages using jq and format it into tab-separated values
# | jq '.event.commits[] | [.url, .id[0:7], .author.username, .timestamp, .message] | @tsv' \
# We need to do some cleaning on this output - specifically removing quotes and replacing newlines with something easier to split
# | sed 's/"//g' | sed 's/\\t/;/g' | sed 's/\\n/;/g' | sed 's/\\//g' \
# We then use awk to format the TSV into a Slack message
# | awk -F';' '{print "• <"$1"|"$2"> (<https://github.com/"$3"|"$3">, "$4") - "$5}' \
# We need to deal with some escaping issues with newlines so that we don't break the Slack message format
# | sed 's/$/\\n/g' | tr -d '\n' \
# Finally we have to truncate the message to 3,000 characters max, otherwise Slack will reject it
# | awk '{print substr($0,0,3000);}' \
# Then shove the bytes into a file to store them in their exact format
# > /tmp/parsed_github_context
on:
push:
branches:
- 'releases/*'
jobs:
notify-slack:
runs-on: ubuntu-latest
environment:
name: notify/releases
steps:
- name: Parse event to slug
id: parse-slug
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
# Formats the contents of the GitHub event into slugs: one line per commit, formatted for Slack.
# Explanation for each line is in the comments above.
run: |
echo $GITHUB_CONTEXT \
| jq '.event.commits[] | [.url, .id[0:7], .author.username, .timestamp, .message] | @tsv' \
| sed 's/"//g' | sed 's/\\t/;/g' | sed 's/\\n/;/g' | sed 's/\\//g' \
| awk -F';' '{print "• <"$1"|"$2"> (<https://github.com/"$3"|"$3">, "$4") - "$5}' \
| sed 's/$/\\n/g' | tr -d '\n' \
| awk '{print substr($0,0,3000);}' \
> /tmp/parsed_github_context
echo "SLACK_COMMITS=$(cat /tmp/parsed_github_context)" >> "$GITHUB_OUTPUT"
- uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844
with:
payload: |
{
"text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}",
"blocks": [
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Code merged to <https://github.com/Uniswap/interface/tree/${{ github.ref }}|${{ github.ref_name }}> branch:*\n"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Actor*: <https://github.com/${{ github.triggering_actor }}/|${{ github.triggering_actor }}>\n*Force pushed*: ${{ github.event.forced || false }}\n"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ steps.parse-slug.outputs.SLACK_COMMITS || 'New branch created' }}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "<${{ github.event.compare}}|View Diff>"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

View File

@@ -1,27 +0,0 @@
name: Revert
on:
# manual trigger
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: yarn prepare
- run: yarn build
- name: Setup node@16 (required by Cloudflare Pages)
uses: actions/setup-node@v3
with:
node-version: 16
- name: Update Cloudflare Pages deployment
uses: cloudflare/pages-action@364c7ca09a4b57837c5967871d64a2c31adb8c0d
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }}
directory: build
githubToken: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,12 +1,16 @@
name: Test
# Many build steps have their own caches, so each job has its own cache to improve subsequent build times.
# Build tools are configured to cache to node_modules/.cache, so they are cached independently of node_modules.
# Caches are saved every run (by keying on github.run_id), and the most recent available cache is loaded.
# See https://jongleberry.medium.com/speed-up-your-ci-and-dx-with-node-modules-cache-ac8df82b7bb0.
on:
push:
branches:
- main
- releases/staging
pull_request:
# manual trigger
workflow_dispatch:
jobs:
lint:
@@ -14,7 +18,34 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- uses: ./.github/actions/cache-on-main
with:
path: node_modules/.cache
key: ${{ runner.os }}-eslint-${{ github.run_id }}
restore-keys: ${{ runner.os }}-eslint-
- run: yarn lint
- if: failure() && github.ref_name == 'main'
uses: ./.github/actions/report
with:
name: Lint
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_TEST_REPORTER_WEBHOOK }}
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- uses: ./.github/actions/cache-on-main
with:
path: node_modules/.cache
key: ${{ runner.os }}-tsc-${{ github.run_id }}
restore-keys: ${{ runner.os }}-tsc-
- run: yarn typecheck
- if: failure() && github.ref_name == 'main'
uses: ./.github/actions/report
with:
name: Typecheck
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_TEST_REPORTER_WEBHOOK }}
deps-tests:
runs-on: ubuntu-latest
@@ -22,39 +53,61 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: yarn yarn-deduplicate --strategy=highest --list --fail
- if: failure() && github.ref_name == 'main'
uses: ./.github/actions/report
with:
name: Dependency checks
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_TEST_REPORTER_WEBHOOK }}
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: yarn prepare
- run: yarn test
- uses: ./.github/actions/cache-on-main
with:
path: node_modules/.cache
key: ${{ runner.os }}-jest-${{ github.run_id }}
restore-keys: ${{ runner.os }}-jest-
- run: yarn test --coverage --maxWorkers=100%
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
flags: unit-tests
- if: failure() && github.ref_name == 'main'
uses: ./.github/actions/report
with:
name: Unit tests
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_TEST_REPORTER_WEBHOOK }}
cypress-build:
build-e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: yarn prepare
- run: yarn build
- uses: actions/upload-artifact@v2
- uses: ./.github/actions/cache-on-main
with:
name: build
path: node_modules/.cache
key: ${{ runner.os }}-build-e2e-${{ github.run_id }}
restore-keys: ${{ runner.os }}-build-e2e-
- run: yarn build:e2e
env:
NODE_OPTIONS: "--max_old_space_size=4096"
- uses: actions/upload-artifact@v3
with:
name: build-e2e
path: build
if-no-files-found: error
- uses: actions/cache@v3
id: cypress-cache
with:
path: /home/runner/.cache/Cypress
key: ${{ runner.os }}-cypress-${{ hashFiles('node_modules/cypress') }}
- if: steps.cypress-cache.outputs.cache-hit != 'true'
run: yarn cypress install
# Allows for parallel re-runs of cypress tests without re-building.
cypress-rerun:
runs-on: ubuntu-latest
steps:
- run: exit 0
cypress-test-matrix:
needs: cypress-build
needs: [build-e2e, cypress-rerun]
runs-on: ubuntu-latest
strategy:
fail-fast: false
@@ -63,35 +116,97 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- uses: actions/download-artifact@v2
- uses: ./.github/actions/cache-on-main
with:
name: build
path: /root/.cache/Cypress
key: ${{ runner.os }}-cypress-${{ hashFiles('**/node_modules/cypress/package.json') }}
- run: |
yarn cypress install
yarn cypress info
- uses: actions/download-artifact@v3
with:
name: build-e2e
path: build
- uses: actions/cache@v3
id: cypress-cache
- uses: ./.github/actions/cache-on-main
with:
path: /home/runner/.cache/Cypress
key: ${{ runner.os }}-cypress-${{ hashFiles('node_modules/cypress') }}
- if: steps.cypress-cache.outputs.cache-hit != 'true'
run: yarn cypress install
path: cache
key: ${{ runner.os }}-hardhat-${{ hashFiles('hardhat.config.js') }}-${{ github.run_id }}
restore-keys: ${{ runner.os }}-hardhat-${{ hashFiles('hardhat.config.js') }}-
- uses: cypress-io/github-action@v4
with:
install: false
start: yarn serve
wait-on: 'http://localhost:3000'
browser: chrome
record: true
parallel: true
start: yarn serve
wait-on: 'http://localhost:3000'
browser: electron
group: e2e
spec: ${{ github.ref_name == 'releases/staging' && 'cypress/{e2e,staging}/**/*.test.ts' || 'cypress/e2e/**/*.test.ts' }}
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMIT_INFO_BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }}
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title || github.event.head_commit.message }}
COMMIT_INFO_AUTHOR: ${{ github.event.sender.login || github.event.head_commit.author.login }}
# Cypress requires an email for filtering by author, but GitHub does not expose one.
# GitHub's public profile email can be deterministically produced from user id/login.
COMMIT_INFO_EMAIL: ${{ github.event.sender.id || github.event.head_commit.author.id }}+${{ github.event.sender.login || github.event.head_commit.author.login }}@users.noreply.github.com
COMMIT_INFO_SHA: ${{ github.event.pull_request.head.sha || github.event.head_commit.sha }}
COMMIT_INFO_TIMESTAMP: ${{ github.event.pull_request.updated_at || github.event.head_commit.timestamp }}
CYPRESS_PULL_REQUEST_ID: ${{ github.event.pull_request.number }}
CYPRESS_PULL_REQUEST_URL: ${{ github.event.pull_request.html_url }}
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
flags: e2e-tests
- if: failure() && github.ref_name == 'main'
uses: ./.github/actions/report
with:
name: Cypress tests
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_TEST_REPORTER_WEBHOOK }}
# Included as a single job to check against for cypress test success, as cypress runs in a matrix.
cypress-tests:
needs: cypress-test-matrix
pre:
if: ${{ github.ref_name == 'main' || github.ref_name == 'releases/staging' }}
runs-on: ubuntu-latest
steps:
- run: echo 'Finished cypress tests https\://dashboard.cypress.io/projects/yp82ef'
- uses: actions/github-script@v6.4.1
with:
script: |
github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.sha,
state: 'pending',
context: 'Test / promotion',
description: 'Running tests...',
target_url: 'https://github.com/Uniswap/interface/actions/runs/' + context.runId
})
post:
if: ${{ github.ref_name == 'main' || github.ref_name == 'releases/staging' }}
needs: [pre, lint, typecheck, deps-tests, unit-tests, cypress-test-matrix]
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6.4.1
with:
script: |
github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.sha,
state: ${{ env.STATUS }} ? 'success' : 'failure',
context: 'Test / promotion',
description: ${{ env.STATUS }} ? 'All tests passed' : 'One or more tests failed and are blocking promotion',
target_url: 'https://github.com/Uniswap/interface/actions/runs/' + context.runId
})
env:
STATUS: |
${{ needs.lint.result == 'success' }} &&
${{ needs.typecheck.result == 'success' }} &&
${{ needs.deps-tests.result == 'success' }} &&
${{ needs.unit-tests.result == 'success' }} &&
${{ needs.cypress-test-matrix.result == 'success' }}

14
.gitignore vendored
View File

@@ -5,11 +5,12 @@
/src/types/v3
/src/abis/types
/src/locales/**/*.js
/src/locales/**/en-US.po
/src/locales/**/pseudo.po
/src/locales/**/*.po
# generated graphql types
__generated__/
# generated files
/src/**/__generated__
# schema
schema.graphql
# dependencies
@@ -17,6 +18,7 @@ schema.graphql
# testing
/coverage
/cache
# builds
/build
@@ -29,6 +31,10 @@ schema.graphql
.env.test.local
.env.production.local
instrumented
.nyc_output
.nyc_output/**/*
/.netlify
npm-debug.log*

2
.nvmrc
View File

@@ -1 +1 @@
14.20.0
v18.16.0

View File

@@ -1 +0,0 @@
/src/schema/schema.graphql

View File

@@ -1,5 +0,0 @@
{
"semi": false,
"singleQuote": true,
"printWidth": 120
}

6
.vscode/extensions.json vendored Normal file
View File

@@ -0,0 +1,6 @@
{
"recommendations": [
"dbaeumer.vscode-eslint"
],
"unwantedRecommendations": []
}

12
.vscode/settings.json vendored
View File

@@ -5,7 +5,7 @@
"editor.formatOnSaveMode": "file",
"editor.tabCompletion": "on",
"editor.tabSize": 2,
"editor.formatOnSave": true,
"editor.formatOnSave": false,
"editor.inlineSuggest.enabled": true,
"editor.codeActionsOnSave": {
"source.fixAll": true
@@ -13,7 +13,13 @@
"files.eol": "\n",
"eslint.enable": true,
"eslint.debug": true,
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[typescriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
}

1
CODEOWNERS Normal file
View File

@@ -0,0 +1 @@
@uniswap/web-admins

View File

@@ -64,6 +64,14 @@ To run _all_ cypress integration tests _from the command line_:
yarn cypress:run
```
## Adding a new dependency
Adding many new dependencies would cause bloat, so we have a test to guard against this: `scripts/test-size.js`. This will run as part of CI with every PR.
If you *need* to add a new dependency, and it causes the generated build to exceed its size quota, you'll need to increase the quota. Do so in `scripts/test-size.js`.
You can also run the test on your last build using `yarn build && yarn test:size`. If you exceed the size quota, it will let you know what to do :).
## Engineering standards
Code merged into the `main` branch of this repository should adhere to high standards of correctness and maintainability.

View File

@@ -1,5 +1,7 @@
# Uniswap Labs Interface
[![codecov](https://codecov.io/gh/Uniswap/interface/branch/main/graph/badge.svg?token=YVT2Y86O82)](https://codecov.io/gh/Uniswap/interface)
[![Unit Tests](https://github.com/Uniswap/interface/actions/workflows/unit-tests.yaml/badge.svg)](https://github.com/Uniswap/interface/actions/workflows/unit-tests.yaml)
[![Integration Tests](https://github.com/Uniswap/interface/actions/workflows/integration-tests.yaml/badge.svg)](https://github.com/Uniswap/interface/actions/workflows/integration-tests.yaml)
[![Lint](https://github.com/Uniswap/interface/actions/workflows/lint.yml/badge.svg)](https://github.com/Uniswap/interface/actions/workflows/lint.yml)
@@ -36,14 +38,41 @@ You can block an entire list of tokens by passing in a tokenlist like [here](./s
For steps on local deployment, development, and code contribution, please see [CONTRIBUTING](./CONTRIBUTING.md).
#### PR Title
Your PR title must follow [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary), and should start with one of the following [types](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#type):
- build: Changes that affect the build system or external dependencies (example scopes: yarn, eslint, typescript)
- ci: Changes to our CI configuration files and scripts (example scopes: vercel, github, cypress)
- docs: Documentation only changes
- feat: A new feature
- fix: A bug fix
- perf: A code change that improves performance
- refactor: A code change that neither fixes a bug nor adds a feature
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- test: Adding missing tests or correcting existing tests
Example commit messages:
- feat: adds support for gnosis safe wallet
- fix: removes a polling memory leak
- chore: bumps redux version
Other things to note:
- Please describe the change using verb statements (ex: Removes X from Y)
- PRs with multiple changes should use a list of verb statements
- Add any relevant unit / integration tests
- Changes will be previewable via vercel. Non-obvious changes should include instructions for how to reproduce them
## Accessing Uniswap V2
The Uniswap Interface supports swapping, adding liquidity, removing liquidity and migrating liquidity for Uniswap protocol V2.
- Swap on Uniswap V2: https://app.uniswap.org/#/swap?use=v2
- View V2 liquidity: https://app.uniswap.org/#/pool/v2
- Add V2 liquidity: https://app.uniswap.org/#/add/v2
- Migrate V2 liquidity to V3: https://app.uniswap.org/#/migrate/v2
- Swap on Uniswap V2: <https://app.uniswap.org/#/swap?use=v2>
- View V2 liquidity: <https://app.uniswap.org/#/pools/v2>
- Add V2 liquidity: <https://app.uniswap.org/#/add/v2>
- Migrate V2 liquidity to V3: <https://app.uniswap.org/#/migrate/v2>
## Accessing Uniswap V1

View File

@@ -1,3 +1,5 @@
/* eslint-env node */
const isDev = process.env.NODE_ENV === 'development'
module.exports = {

46
codecov.yml Normal file
View File

@@ -0,0 +1,46 @@
ignore:
- "**/generated/**/*"
- "**/generated/*"
- "**/cypress/**/*"
- "cypress/**/*"
- "**/instrumented/**/*"
- "**/styles/**/*"
- "styles/**/*"
- "**/constants/**/*"
- "constants/**/*"
coverage:
status:
# Omit merging unit/e2e reports into the defaults, as it is nonsensical.
project: off
patch: off
flag_management:
default_rules:
statuses:
- type: project
target: auto
threshold: 1%
# Adjust the base when removing code to avoid penalizing tech debt payback / dead code removal.
removed_code_behavior: adjust_base
if_ci_failed: error
- type: patch
target: 80%
individual_flags:
- name: unit-tests
- name: e2e-tests
# Wait until all machines have reported coverage - e2e tests run across 4 machines.
after_n_builds: 4
statuses:
- type: patch
target: 0%
comment:
layout: flags
# Wait until all machines have reported coverage - e2e tests run across 4 machines + unit tests across 1.
after_n_builds: 5
hide_comment_details: false
github_checks:
# Turn off GitHub Check annotations, as they make it more difficult to review code.
annotations: false

View File

@@ -1,35 +1,207 @@
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-env node */
const { VanillaExtractPlugin } = require('@vanilla-extract/webpack-plugin')
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin')
const { execSync } = require('child_process')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const { DefinePlugin } = require('webpack')
const path = require('path')
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin')
const { DefinePlugin, IgnorePlugin, ProvidePlugin } = require('webpack')
const { RetryChunkLoadPlugin } = require('webpack-retry-chunk-load-plugin')
const commitHash = require('child_process').execSync('git rev-parse HEAD')
const commitHash = execSync('git rev-parse HEAD').toString().trim()
const isProduction = process.env.NODE_ENV === 'production'
// Linting and type checking are only necessary as part of development and testing.
// Omit them from production builds, as they slow down the feedback loop.
const shouldLintOrTypeCheck = !isProduction
function getCacheDirectory(cacheName) {
// Include the trailing slash to denote that this is a directory.
return `${path.join(__dirname, 'node_modules/.cache/', cacheName)}/`
}
module.exports = {
babel: {
plugins: ['@vanilla-extract/babel-plugin'],
plugins: [
'@vanilla-extract/babel-plugin',
...(process.env.REACT_APP_ADD_COVERAGE_INSTRUMENTATION
? [
[
'istanbul',
{
all: true,
include: ['src/**/*.tsx', 'src/**/*.ts'],
exclude: [
'src/**/*.css',
'src/**/*.css.ts',
'src/**/*.test.ts',
'src/**/*.test.tsx',
'src/**/*.spec.ts',
'src/**/*.spec.tsx',
'src/**/graphql/**/*',
'src/**/*.d.ts',
],
},
],
]
: []),
],
},
eslint: {
enable: shouldLintOrTypeCheck,
pluginOptions(eslintConfig) {
return Object.assign(eslintConfig, {
cache: true,
cacheLocation: getCacheDirectory('eslint'),
ignorePath: '.gitignore',
// Use our own eslint/plugins/config, as overrides interfere with caching.
// This ensures that `yarn start` and `yarn lint` share one cache.
eslintPath: require.resolve('eslint'),
resolvePluginsRelativeTo: null,
baseConfig: null,
})
},
},
typescript: {
enableTypeChecking: shouldLintOrTypeCheck,
},
jest: {
configure(jestConfig) {
return Object.assign(jestConfig, {
cacheDirectory: getCacheDirectory('jest'),
transform: Object.assign(jestConfig.transform, {
// Transform vanilla-extract using its own transformer.
// See https://sandroroth.com/blog/vanilla-extract-cra#jest-transform.
'\\.css\\.ts$': '@vanilla-extract/jest-transform',
}),
// Use @uniswap/conedison's build directly, as jest does not support its exports.
transformIgnorePatterns: ['@uniswap/conedison/format', '@uniswap/conedison/provider'],
moduleNameMapper: {
'@uniswap/conedison/format': '@uniswap/conedison/dist/format',
'@uniswap/conedison/provider': '@uniswap/conedison/dist/provider',
},
})
},
},
webpack: {
plugins: [
new VanillaExtractPlugin(),
new DefinePlugin({
'process.env.REACT_APP_GIT_COMMIT_HASH': JSON.stringify(commitHash.toString()),
// Webpack 5 does not polyfill node globals, so we do so for those necessary:
new ProvidePlugin({
// - react-markdown requires process.cwd
process: 'process/browser',
}),
// vanilla-extract has poor performance on M1 machines with 'debug' identifiers, so we use 'short' instead.
// See https://vanilla-extract.style/documentation/integrations/webpack/#identifiers for docs.
// See https://github.com/vanilla-extract-css/vanilla-extract/issues/771#issuecomment-1249524366.
new VanillaExtractPlugin({ identifiers: 'short' }),
new RetryChunkLoadPlugin({
cacheBust: `function() {
return 'cache-bust=' + Date.now();
}`,
// Retries with exponential backoff (500ms, 1000ms, 2000ms).
retryDelay: `function(retryAttempt) {
return 2 ** (retryAttempt - 1) * 500;
}`,
maxRetries: 3,
}),
],
configure: (webpackConfig) => {
const instanceOfMiniCssExtractPlugin = webpackConfig.plugins.find(
(plugin) => plugin instanceof MiniCssExtractPlugin
)
if (instanceOfMiniCssExtractPlugin !== undefined) instanceOfMiniCssExtractPlugin.options.ignoreOrder = true
// Configure webpack plugins:
webpackConfig.plugins = webpackConfig.plugins
.map((plugin) => {
// Extend process.env with dynamic values (eg commit hash).
// This will make dynamic values available to JavaScript only, not to interpolated HTML (ie index.html).
if (plugin instanceof DefinePlugin) {
Object.assign(plugin.definitions['process.env'], {
REACT_APP_GIT_COMMIT_HASH: JSON.stringify(commitHash),
})
}
// We're currently on Webpack 4.x that doesn't support the `exports` field in package.json.
// See https://github.com/webpack/webpack/issues/9509.
//
// In case you need to add more modules, make sure to remap them to the correct path.
//
// Map @uniswap/conedison to its dist folder.
// This is required because conedison uses * to redirect all imports to its dist.
webpackConfig.resolve.alias['@uniswap/conedison'] = '@uniswap/conedison/dist'
// CSS ordering is mitigated through scoping / naming conventions, so we can ignore order warnings.
// See https://webpack.js.org/plugins/mini-css-extract-plugin/#remove-order-warnings.
if (plugin instanceof MiniCssExtractPlugin) {
plugin.options.ignoreOrder = true
}
// Disable TypeScript's config overwrite, as it interferes with incremental build caching.
// This ensures that `yarn start` and `yarn typecheck` share one cache.
if (plugin.constructor.name == 'ForkTsCheckerWebpackPlugin') {
delete plugin.options.typescript.configOverwrite
}
return plugin
})
.filter((plugin) => {
// Case sensitive paths are already enforced by TypeScript.
// See https://www.typescriptlang.org/tsconfig#forceConsistentCasingInFileNames.
if (plugin instanceof CaseSensitivePathsPlugin) return false
// IgnorePlugin is used to tree-shake moment locales, but we do not use moment in this project.
if (plugin instanceof IgnorePlugin) return false
return true
})
// Configure webpack resolution:
webpackConfig.resolve = Object.assign(webpackConfig.resolve, {
plugins: webpackConfig.resolve.plugins.map((plugin) => {
// Allow vanilla-extract in production builds.
// This is necessary because create-react-app guards against external imports.
// See https://sandroroth.com/blog/vanilla-extract-cra#production-build.
if (plugin instanceof ModuleScopePlugin) {
plugin.allowedPaths.push(path.join(__dirname, 'node_modules/@vanilla-extract/webpack-plugin'))
}
return plugin
}),
// Webpack 5 does not resolve node modules, so we do so for those necessary:
fallback: {
// - react-markdown requires path
path: require.resolve('path-browserify'),
},
})
// Configure webpack transpilation (create-react-app specifies transpilation rules in a oneOf):
webpackConfig.module.rules[1].oneOf = webpackConfig.module.rules[1].oneOf.map((rule) => {
// The fallback rule (eg for dependencies).
if (rule.loader && rule.loader.match(/babel-loader/) && !rule.include) {
// Allow not-fully-specified modules so that legacy packages are still able to build.
rule.resolve = { fullySpecified: false }
// The class properties transform is required for @uniswap/analytics to build.
rule.options.plugins.push('@babel/plugin-proposal-class-properties')
}
return rule
})
// Configure webpack optimization:
webpackConfig.optimization = Object.assign(
webpackConfig.optimization,
isProduction
? {
splitChunks: {
// Cap the chunk size to 5MB.
// react-scripts suggests a chunk size under 1MB after gzip, but we can only measure maxSize before gzip.
// react-scripts also caps cacheable chunks at 5MB, which gzips to below 1MB, so we cap chunk size there.
// See https://github.com/facebook/create-react-app/blob/d960b9e/packages/react-scripts/config/webpack.config.js#L713-L716.
maxSize: 5 * 1024 * 1024,
// Optimize over all chunks, instead of async chunks (the default), so that initial chunks are also optimized.
chunks: 'all',
},
}
: {}
)
// Configure webpack caching:
webpackConfig.cache = Object.assign(webpackConfig.cache, {
cacheDirectory: getCacheDirectory('webpack'),
})
// Ignore failed source mappings to avoid spamming the console.
// Source mappings for a package will fail if the package does not provide them, but the build will still succeed,
// so it is unnecessary (and bothersome) to log it. This should be turned off when debugging missing sourcemaps.
// See https://webpack.js.org/loaders/source-map-loader#ignoring-warnings.
webpackConfig.ignoreWarnings = [/Failed to parse source map/]
return webpackConfig
},

View File

@@ -1,20 +1,33 @@
import codeCoverageTask from '@cypress/code-coverage/task'
import { defineConfig } from 'cypress'
import { setupHardhatEvents } from 'cypress-hardhat'
import { unlinkSync } from 'fs'
export default defineConfig({
projectId: 'yp82ef',
videoUploadOnPasses: false,
defaultCommandTimeout: 24000, // 2x average block time
chromeWebSecurity: false,
experimentalMemoryManagement: true, // better memory management, see https://github.com/cypress-io/cypress/pull/25462
retries: { runMode: 2 },
videoCompression: false,
e2e: {
setupNodeEvents(on, config) {
return {
...config,
// Only enable Chrome.
// Electron (the default) has issues injecting window.ethereum before pageload, so it is not viable.
browsers: config.browsers.filter(({ name }) => name === 'chrome'),
}
async setupNodeEvents(on, config) {
await setupHardhatEvents(on, config)
codeCoverageTask(on, config)
// Delete recorded videos for specs that passed without flakes.
on('after:spec', async (spec, results) => {
if (results && results.video) {
// If there were no failures (including flakes), delete the recorded video.
if (!results.tests?.some((test) => test.attempts.some((attempt) => attempt?.state === 'failed'))) {
unlinkSync(results.video)
}
}
})
return config
},
baseUrl: 'http://localhost:3000',
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
specPattern: 'cypress/{e2e,staging}/**/*.test.ts',
},
})

View File

@@ -1,8 +0,0 @@
import { defineConfig } from 'cypress'
export default defineConfig({
projectId: 'yp82ef',
e2e: {
specPattern: 'cypress/release.ts',
},
})

202
cypress/README.md Normal file
View File

@@ -0,0 +1,202 @@
# e2e testing with Cypress
End-to-end tests are run through [Cypress](https://docs.cypress.io/api/table-of-contents/), which runs tests in a real browser. Cypress is a little different than other testing frameworks, and e2e tests are a little different than unit tests, so this directory has its own set of patterns, idioms, and best practices. Not only that, but we're testing against a forked blockchain, not just against typical Web APIs, so we have unique flows that you may not have seen elsewhere.
## Running your first e2e tests
Cypress tests run against a local server, so you'll need to run the application locally at the same time. The fastest way to run e2e tests is to use your dev server: `yarn start`.
Open cypress at the same time with `yarn cypress:open`. You should do this from another window or tab, so that you can continue to see any typechecking/linting warnings from `yarn start`.
Cypress opens its own instance of Chrome, with a list of "E2E specs" for you to select. When you're developing locally, you usually only want to run one spec file at a time. Select your spec by clicking on the filename and it will run.
## Glossary
#### spec
Cypress considers each file a separate spec, or collection of tests.
Specs are always run as a whole through `yarn cypress:open` or on the same machine through CI.
#### Thenable
Cypress queues commands to run in the browser using [Thenables](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), not Promises.
For this reason, you should not use `async/await` syntax in Cypress unless it is wholly-contained in a `cy.then` function argument.
## Writing your first e2e test
_For an excellent treatment on tests, check out the [Cypress Fundamentals](https://learn.cypress.io/cypress-fundamentals/how-to-write-a-test) course._
_While some of that will be paraphrased here, this should be sufficient to get you started:_
### What is a test?
Cypress tests are just like any other test: you should set up an initial state, execute an action, and verify the action's consequence. This is codified in the AAA (Arrange-Act-Assert) pattern, and you'll see this in most of our tests. In _our_ case, it plays out as:
1. Arrange: Visit a page, eg `cy.visit('/swap')`, and set up the state, on the blockchain and the page.
2. Act: Initiate your action under test, eg `initiateSwap()`
3. Assert: Verify that the action has occured, eg `// Verify swap has occured`
You'll usually see the setup, followed by a newline, followed by assertions with comments stating what they are asserting.
Because Cypress tests are translated into user actions, it may be hard to follow the action being described. You should use comments liberally to describe what you are doing and what you intend to test, to make tests easier to read and maintain in the future.
### Thinking about tests: queuing up a sequence of commands
Cypress uses `Thenable`s to achieve "command chaining". A test is described as a series of commands, which are only executed once the previous command in the chain has executed.
```
cy.visit('/swap')
cy.contains('Select token').click()
cy.contains('DAI').click()
```
In this example, `cy.contains('Select token').click()` is queued up right away (all the code is synchronous), but it will not execute until `/swap` has loaded (all the commands are chained); and `click()` will not execute until `Select token` has been found.
This becomes more relevant as you work with data on the blockchain, as you'll need to load it at the correct time, _after_ it's been modified by the application:
```
cy.hardhat().then(async (hardhat) => {
cy.visit(`/swap?inputCurrency=ETH&outputCurrency=${USDC_MAINNET.address}`, { ethereum: 'hardhat' })
cy.get('#swap-currency-output .token-amount-input').type('1').should('have.value', '1')
cy.get('#swap-button').click()
cy.contains('Confirm swap').click()
// wait for the transaction to be executed
cy.get(getTestSelector('web3-status-connected')).should('contain', '1 Pending')
cy.get(getTestSelector('web3-status-connected')).should('not.contain', 'Pending')
// BAD: This will get the balance _before_ the other queued actions have executed.
const balance = await hardhat.getBalance(hardhat.wallet, USDC_MAINNET)
cy.wrap(balance).should('deep.equal', expectedBalance)
})
```
```
cy.visit(`/swap?inputCurrency=ETH&outputCurrency=${USDC_MAINNET.address}`, { ethereum: 'hardhat' })
cy.get('#swap-currency-output .token-amount-input').type('1').should('have.value', '1')
cy.get('#swap-button').click()
cy.contains('Confirm swap').click()
// wait for the transaction to be executed
cy.get(getTestSelector('web3-status-connected')).should('contain', '1 Pending')
cy.get(getTestSelector('web3-status-connected')).should('not.contain', 'Pending')
// GOOD: cy.then chains the command so that it runs _after_ executing the swap
cy.hardhat()
.then((hardhat) => hardhat.getBalance(hardhat.wallet, USDC_MAINNET))
.should('deep.equal', expectedBalance)
})
```
### Working with the blockchain (ie hardhat)
Our tests use a local hardhat node to simulate blockchain transactions. This can be accessed with `cy.hardhat().then((hardhat) => ...)`.
Currently, tests using hardhat must opt-in in when they load the page: `cy.visit('/swap', { ethereum: 'hardhat' })`. This will not be necessary once we've totally migrated to hardhat.
By default, automining is turned on, so that any transaction that you send to the blockchain is mined immediately. If you want to assert on intermediate states (between sending a transaction and mining it), you can turn off automining: `cy.hardhat({ automine: false })`.
The hardhat integration has built-in utilities to let you modify and assert on balances, approvals, and permits, and should be fully typed. Check it out at [Uniswap/cypress-hardhat](https://github.com/Uniswap/cypress-hardhat).
### Asserting on wallet methods
Wallet methods to hardhat are all aliased. If you'd like to assert that a method was sent to the wallet, you can do so using the method name, prefixed with `@`:
```
// Asserts that `eth_sendRawTransaction` was sent to the wallet.
cy.wait('@eth_sendRawTransaction')
```
Sometimes, you may want a method to _fail_. In this case, you can stub it, but you should disable logging to avoid spamming the test:
```
// Stub calls to eth_signTypedData_v4 and fail them
cy.hardhat().then((hardhat) => {
// Note the closure to keep signTypedDataStub in scope. Using closures instead of variables (eg let) helps prevent misuse of chaining.
const signTypedDataStub = cy.stub(hardhat.provider, 'send').log(false)
signTypedDataStub.withArgs('eth_signTypedData_v4).rejects(USER_REJECTION)
signTypedDataStub.callThrough() // allws other methods to call through to hardhat
cy.contains('Confirm swap').click()
// Verify the call occured
// Note the call to cy.wrap to correctly queue the chained command. Without this, the test would occur before the stub is called.
cy.wrap(permitApprovalStub).should('be.calledWith', 'eth_signTypedData_v4')
// Restore the stub
// note the call to cy.then to correctly queue the chained command. Without this, the stub would be restored immediately.
cy.then(() => permitApprovalStub.restore())
})
```
## Best practices
<!-- Best practices should all be labeled using H3, with the rationale italicized at the end of the section. -->
<!-- Best practice 🤣 is to also include an example before your rationale. -->
### Spec / test grouping
Each spec should be specific to one route, _not_ one functional behavior.
For example, `token-details.test.ts` is separated from `swap.test.ts`.
If a route has different functional behaviors, that route should become a directory name, and its spec should be split.
For example, `swap.test.ts` may be split into `swap/swap.test.ts`, `swap/wrap.test.ts`, `swap/permit2.test.ts`.
_This prevents specs from growing too large, which is important because they are always run as a whole locally and on the same machine through CI. If a spec grows too large, it will have a longer local feedback loop, and it will become the bottleneck for CI test runtime._
_Similarly, avoid actions outside the scope of your spec, as it will cause total testing time to increase._
### Use closures instead of variables
Avoid usage of `let`, instead assigning a constant. In practice, this means using closures for your variables:
```javascript
let badVariable
cy.hardhat({ automine: false })
.then((hardhat) => cy.then(() => hardhat.provider.getBalance(hardhat.wallet.address)))
.then((initialBalance) => {
// Do not assign to a variable outside of your closure!
badVariable = initialBalance // <-- bad!
// Use initial balance here, within the closure.
})
cy.get('.class-name').then((el) => {
// Do not use badVariable here! It may have changed value due to the queued async nature of Cypress.
expect(el).should('contain', badVariable) // <-- bad!
})
```
_This prevents misuse of a not-yet-initialized variable, or a variable that has changed as the test progresses._
### Prefer selecting elements using on-screen text over data-testid attributes
When selecting components (eg with `cy.get`), prefer defining your selector with visible UI. Sometimes this is not possible (eg if the text is duplicated on-screen), and you'll need to add a `data-testid` property.
_Defining tests using visual fields helps ensure that we don't break them. `data-testid` may select an element that is only selectable programmatically, and should be used only when necessary, as its use may cover up UI breakages._
_You'll still want to use `data-testid` in cases where the text is rendered in multiple containers and you need to select the correct one, or where the component doesn't render predictable text output._
### Avoid branching logic
Do not write tests that rely on if-statements or conditionals. Do not create helper methods which do more than one thing, and rely on branching logic to apply to different but similar situations.
_Tests should be readable and simple. Branching logic makes it harder to reason about tests, and may hide otherwise flaky or ill-defined behaviors._
_Similarly, you should avoid complicated for-loops. Sometimes, for simple repetition, for-loops are ok._
### Avoid spamming the console
It is ok to include logging while you are developing a test, but that logging should be removed if it is not needed to debug (potential) errors.
For example, stubbing a wallet method will result in dumping a hex string (the calldata) to the log. Instead, suppress logging from methods which you know will flood the log.
```javascript
cy.stub(hardhat.wallet, 'sendTransaction')
.log(false) // <-- suppresses logs from this stub
.rejects(new Error('user cancelled'))
```
_Unnecessary logs it makes it harder to reason about a test overall._
### Name helper methods using transitive verbs
Name helper methods using "action verbs": `expectsThisToHappen`, not `expectThisToHappen`; `selectsToken(token: string)`, not `selectAToken(token: string)`.
_This makes your tests read more naturally, and makes it easier to follow given existing `should` syntax._

View File

@@ -10,28 +10,28 @@ describe('Add Liquidity', () => {
})
it('loads the two correct tokens', () => {
cy.visit('/add/0xF9bA5210F91D0474bd1e1DcDAeC4C58E359AaD85/0xc778417E063141139Fce010982780140Aa0cD5Ab/500')
cy.get('#add-liquidity-input-tokena .token-symbol-container').should('contain.text', 'MKR')
cy.visit('/add/0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984/0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6/500')
cy.get('#add-liquidity-input-tokena .token-symbol-container').should('contain.text', 'UNI')
cy.get('#add-liquidity-input-tokenb .token-symbol-container').should('contain.text', 'ETH')
})
it('does not crash if ETH is duplicated', () => {
cy.visit('/add/0xc778417E063141139Fce010982780140Aa0cD5Ab/0xc778417E063141139Fce010982780140Aa0cD5Ab')
cy.visit('/add/0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6/0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6')
cy.get('#add-liquidity-input-tokena .token-symbol-container').should('contain.text', 'ETH')
cy.get('#add-liquidity-input-tokenb .token-symbol-container').should('not.contain.text', 'ETH')
})
it.skip('token not in storage is loaded', () => {
cy.visit('/add/0xb290b2f9f8f108d03ff2af3ac5c8de6de31cdf6d/0xF9bA5210F91D0474bd1e1DcDAeC4C58E359AaD85')
cy.get('#add-liquidity-input-tokena .token-symbol-container').should('contain.text', 'SKL')
cy.get('#add-liquidity-input-tokenb .token-symbol-container').should('contain.text', 'MKR')
cy.visit('/add/0x07865c6e87b9f70255377e024ace6630c1eaa37f/0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984')
cy.get('#add-liquidity-input-tokena .token-symbol-container').should('contain.text', 'USDC')
cy.get('#add-liquidity-input-tokenb .token-symbol-container').should('contain.text', 'UNI')
})
it.skip('single token can be selected', () => {
cy.visit('/add/0xb290b2f9f8f108d03ff2af3ac5c8de6de31cdf6d')
cy.get('#add-liquidity-input-tokena .token-symbol-container').should('contain.text', 'SKL')
cy.visit('/add/0xF9bA5210F91D0474bd1e1DcDAeC4C58E359AaD85')
cy.get('#add-liquidity-input-tokena .token-symbol-container').should('contain.text', 'MKR')
cy.visit('/add/0x07865c6e87b9f70255377e024ace6630c1eaa37f')
cy.get('#add-liquidity-input-tokena .token-symbol-container').should('contain.text', 'USDC')
cy.visit('/add/0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984')
cy.get('#add-liquidity-input-tokena .token-symbol-container').should('contain.text', 'UNI')
})
it.skip('loads fee tier distribution', () => {
@@ -53,7 +53,7 @@ describe('Add Liquidity', () => {
}
})
cy.visit('/add/0xF9bA5210F91D0474bd1e1DcDAeC4C58E359AaD85/0xc778417E063141139Fce010982780140Aa0cD5Ab')
cy.visit('/add/0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984/0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6')
cy.wait('@FeeTierDistributionQuery')

View File

@@ -0,0 +1,28 @@
import { getTestSelector } from '../utils'
describe('Buy Crypto Modal', () => {
it('should open and close', () => {
cy.visit('/')
// Open the fiat onramp modal
cy.get(getTestSelector('buy-fiat-button')).click()
cy.get(getTestSelector('fiat-onramp-modal')).should('be.visible')
// Click on a location that should be outside the modal, which should close it
cy.get('body').click(0, 100)
cy.get(getTestSelector('fiat-onramp-modal')).should('not.exist')
})
it('should open and close, mobile viewport', () => {
cy.viewport('iphone-6')
cy.visit('/')
// Open the fiat onramp modal
cy.get(getTestSelector('buy-fiat-button')).click()
cy.get(getTestSelector('fiat-onramp-modal')).should('be.visible')
// Click on a location that should be outside the modal, which should close it
cy.get('body').click(10, 10)
cy.get(getTestSelector('fiat-onramp-modal')).should('not.exist')
})
})

View File

@@ -1,12 +1,42 @@
import { getTestSelector } from '../utils'
import { CONNECTED_WALLET_USER_STATE, DISCONNECTED_WALLET_USER_STATE } from '../utils/user-state'
describe('Landing Page', () => {
beforeEach(() => cy.visit('/'))
it('loads swap page', () => {
cy.get('#swap-page')
it('shows landing page when no user state exists', () => {
cy.visit('/', { userState: DISCONNECTED_WALLET_USER_STATE })
cy.get(getTestSelector('landing-page'))
cy.screenshot()
})
it('redirects to swap page when a user has already connected a wallet', () => {
cy.visit('/', { userState: CONNECTED_WALLET_USER_STATE })
cy.get('#swap-page')
cy.url().should('include', '/swap')
cy.screenshot()
})
it('shows landing page when a user has already connected a wallet but ?intro=true is in query', () => {
cy.visit('/?intro=true', { userState: CONNECTED_WALLET_USER_STATE })
cy.get(getTestSelector('landing-page'))
})
it('shows landing page when the unicorn icon in nav is selected', () => {
cy.visit('/swap')
cy.get(getTestSelector('uniswap-logo')).click()
cy.get(getTestSelector('landing-page'))
})
it('allows navigation to pool', () => {
cy.get('#pool-nav-link').click()
cy.url().should('include', '/pool')
cy.viewport(2000, 1600)
cy.visit('/swap')
cy.get(getTestSelector('pool-nav-link')).first().click()
cy.url().should('include', '/pools')
})
it('allows navigation to pool on mobile', () => {
cy.viewport('iphone-6')
cy.visit('/swap')
cy.get(getTestSelector('pool-nav-link')).last().click()
cy.url().should('include', '/pools')
})
})

View File

@@ -1,7 +1,8 @@
// see https://github.com/Uniswap/interface/pull/4115
describe('Link', () => {
it('should update route', () => {
cy.visit('/')
cy.viewport(2000, 1600)
cy.visit('/swap')
cy.contains('Pool').click()
cy.get('[data-cy="join-pool-button"]').should('exist')
})

View File

@@ -0,0 +1,79 @@
import { getTestSelector } from '../../utils'
describe('Mini Portfolio account drawer', () => {
beforeEach(() => {
cy.intercept(/api.uniswap.org\/v1\/graphql/, cy.spy().as('gqlSpy'))
cy.visit('/swap', { ethereum: 'hardhat' })
})
it('fetches balances when account button is first hovered', () => {
// The balances should not be fetched before the account button is hovered
cy.get('@gqlSpy').should('not.have.been.called')
// Balances should have been fetched once after hover
cy.get(getTestSelector('web3-status-connected')).trigger('mouseover')
cy.get('@gqlSpy').should('have.been.calledOnce')
// Balances should not be refetched upon second hover
cy.get(getTestSelector('web3-status-connected')).trigger('mouseover')
cy.get('@gqlSpy').should('have.been.calledOnce')
// Balances should not be refetched upon opening drawer
cy.get(getTestSelector('web3-status-connected')).click()
cy.get('@gqlSpy').should('have.been.calledOnce')
// Balances should not be refetched upon closing & reopening drawer
cy.get(getTestSelector('close-account-drawer')).click()
cy.get(getTestSelector('web3-status-connected')).click()
cy.get('@gqlSpy').should('have.been.calledOnce')
})
it('fetches account information', () => {
// Open the mini portfolio
cy.intercept(/graphql/, { fixture: 'mini-portfolio/tokens.json' })
cy.get(getTestSelector('web3-status-connected')).click()
// Verify that wallet state loads correctly
cy.get(getTestSelector('mini-portfolio-navbar')).contains('Tokens')
cy.get(getTestSelector('mini-portfolio-page')).contains('Hidden (201)')
cy.intercept(/graphql/, { fixture: 'mini-portfolio/nfts.json' })
cy.get(getTestSelector('mini-portfolio-navbar')).contains('NFTs').click()
cy.get(getTestSelector('mini-portfolio-page')).contains('I Got Plenty')
cy.get(getTestSelector('mini-portfolio-navbar')).contains('Pools').click()
cy.get(getTestSelector('mini-portfolio-page')).contains('No pools yet')
cy.intercept(/graphql/, { fixture: 'mini-portfolio/activity.json' })
cy.get(getTestSelector('mini-portfolio-navbar')).contains('Activity').click()
cy.get(getTestSelector('mini-portfolio-page')).contains('Contract Interaction')
})
it('refetches balances when account changes', () => {
cy.hardhat().then((hardhat) => {
const accountA = hardhat.wallets[0].address
const accountB = hardhat.wallets[1].address
// Opens the account drawer
cy.get(getTestSelector('web3-status-connected')).click()
// A shortened version of the first account's address should be shown
cy.contains(accountA.slice(0, 6)).should('exist')
// Stores the current portfolio balance to later compare to next account's balance
cy.get(getTestSelector('portfolio-total-balance'))
.invoke('text')
.then((originalBalance) => {
// TODO(INFRA-3) Replace window.ethereum access below with cypress-hardhat utility
// Simulates the wallet changing accounts via eip-1193 event
cy.window().then((win) => win.ethereum.emit('accountsChanged', [accountB]))
// The second account's address should now be shown
cy.contains(accountB.slice(0, 6)).should('exist')
// The second account's portfolio balance should differ from the original balance
cy.get(getTestSelector('portfolio-total-balance')).should('not.have.text', originalBalance)
})
})
})
})

View File

@@ -0,0 +1,116 @@
import { USDC_MAINNET } from '../../../src/constants/tokens'
import { getTestSelector } from '../../utils'
describe('mini-portfolio activity history', () => {
beforeEach(() => {
cy.hardhat()
.then((hardhat) => hardhat.wallet.getTransactionCount())
.then((nonce) => {
// Mock graphql response to include specific nonces.
cy.intercept(
{
method: 'POST',
url: 'https://beta.api.uniswap.org/v1/graphql',
},
{
body: {
data: {
portfolios: [
{
id: 'UG9ydGZvbGlvOjB4NUNlYUI3NGU0NDZkQmQzYkY2OUUyNzcyMDBGMTI5ZDJiQzdBMzdhMQ==',
assetActivities: [
{
id: 'QXNzZXRBY3Rpdml0eTpWSEpoYm5OaFkzUnBiMjQ2TUhnME5tUm1PVGs0T0RrNVl6UmtNR1kzWTJNNE9HRTVNVFEzTURBME9EWmtOVGhrTURnNFpqbG1NelkxTnpRM1l6WXdZek15WVRFNE4yWXlaRFEwWVdVNFh6QjRZV1EyWXpCa05XTmlOVEZsWWpjMU5qUTFaRGszT1RneE4yRTJZVEkxTmpreU1UbG1ZbVE1Wmw4d2VEQXpOR0UwTURjMk5EUTROV1kzWlRBNFkyRXhOak0yTm1VMU1ETTBPVEZoTm1GbU56ZzFNR1E9',
timestamp: 1681150079,
type: 'UNKNOWN',
chain: 'ETHEREUM',
transaction: {
id: 'VHJhbnNhY3Rpb246MHg0NmRmOTk4ODk5YzRkMGY3Y2M4OGE5MTQ3MDA0ODZkNThkMDg4ZjlmMzY1NzQ3YzYwYzMyYTE4N2YyZDQ0YWU4XzB4YWQ2YzBkNWNiNTFlYjc1NjQ1ZDk3OTgxN2E2YTI1NjkyMTlmYmQ5Zl8weDAzNGE0MDc2NDQ4NWY3ZTA4Y2ExNjM2NmU1MDM0OTFhNmFmNzg1MGQ=',
blockNumber: 17019453,
hash: '0x46df998899c4d0f7cc88a914700486d58d088f9f365747c60c32a187f2d44ae8',
status: 'CONFIRMED',
to: '0x034a40764485f7e08ca16366e503491a6af7850d',
from: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
nonce,
__typename: 'Transaction',
},
assetChanges: [],
__typename: 'AssetActivity',
},
{
id: 'QXNzZXRBY3Rpdml0eTpWSEpoYm5OaFkzUnBiMjQ2TUhneE16UXpaR1ppTlROaE9XRmpNR00yWW1aaVpqUTNNRFEyWWpObFkyRXhORGN3TUdZd00yWXhOMkV3WWpnM1pqWXpPRFpsWVRnNU16QTRNVFZtWmpoaFh6QjRZMkUzTXpOalkySm1OelZoTXpnME1ERXhPR1ZpT1RjNU9EVTJOemRpTkdRMk56TTBZemMwWmw4d2VERmlOVEUxTkdGaE5HSTRaakF5TjJJNVptUXhPVE0wTVRFek1tWmpPV1JoWlRFd1pqY3pOVGs9',
timestamp: 1681149995,
type: 'SEND',
chain: 'ETHEREUM',
transaction: {
id: 'VHJhbnNhY3Rpb246MHgxMzQzZGZiNTNhOWFjMGM2YmZiZjQ3MDQ2YjNlY2ExNDcwMGYwM2YxN2EwYjg3ZjYzODZlYTg5MzA4MTVmZjhhXzB4Y2E3MzNjY2JmNzVhMzg0MDExOGViOTc5ODU2NzdiNGQ2NzM0Yzc0Zl8weDFiNTE1NGFhNGI4ZjAyN2I5ZmQxOTM0MTEzMmZjOWRhZTEwZjczNTk=',
blockNumber: 17019446,
hash: '0x1343dfb53a9ac0c6bfbf47046b3eca14700f03f17a0b87f6386ea8930815ff8a',
status: 'CONFIRMED',
to: '0x1b5154aa4b8f027b9fd19341132fc9dae10f7359',
from: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
nonce: nonce + 1,
__typename: 'Transaction',
},
assetChanges: [
{
__typename: 'TokenTransfer',
id: 'VG9rZW5UcmFuc2ZlcjoweDVjZWFiNzRlNDQ2ZGJkM2JmNjllMjc3MjAwZjEyOWQyYmM3YTM3YTFfMHhiMWRjNDlmMDY1N2FkNTA1YjUzNzUyN2RkOWE1MDk0YTM2NTkzMWMxXzB4MTM0M2RmYjUzYTlhYzBjNmJmYmY0NzA0NmIzZWNhMTQ3MDBmMDNmMTdhMGI4N2Y2Mzg2ZWE4OTMwODE1ZmY4YQ==',
asset: {
id: 'VG9rZW46RVRIRVJFVU1fMHgxY2MyYjA3MGNhZjAxNmE3ZGRjMzA0N2Y5MzI3MmU4Yzc3YzlkZGU5',
name: 'USD Coin (USDC)',
symbol: 'USDC',
address: '0x1cc2b070caf016a7ddc3047f93272e8c77c9dde9',
decimals: 6,
chain: 'ETHEREUM',
standard: null,
project: {
id: 'VG9rZW5Qcm9qZWN0OkVUSEVSRVVNXzB4MWNjMmIwNzBjYWYwMTZhN2RkYzMwNDdmOTMyNzJlOGM3N2M5ZGRlOQ==',
isSpam: true,
logo: null,
__typename: 'TokenProject',
},
__typename: 'Token',
},
tokenStandard: 'ERC20',
quantity: '18011.212084',
sender: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
recipient: '0xb1dc49f0657ad505b537527dd9a5094a365931c1',
direction: 'OUT',
transactedValue: null,
},
],
__typename: 'AssetActivity',
},
],
__typename: 'Portfolio',
},
],
},
},
}
).as('graphql')
})
})
it('should deduplicate activity history by nonce', () => {
cy.visit(`/swap?inputCurrency=ETH&outputCurrency=${USDC_MAINNET.address}`, { ethereum: 'hardhat' }).hardhat({
automine: false,
})
// Input swap info.
cy.get('#swap-currency-input .token-amount-input').clear().type('1').should('have.value', '1')
cy.get('#swap-currency-output .token-amount-input').should('not.have.value', '')
cy.get('#swap-button').click()
cy.get('#confirm-swap-or-send').click()
cy.get(getTestSelector('confirmation-close-icon')).click()
// Check activity history tab.
cy.get(getTestSelector('web3-status-connected')).click()
cy.get(getTestSelector('mini-portfolio-navbar')).contains('Activity').click()
// Assert that the local pending transaction is replaced by a remote transaction with the same nonce.
cy.contains('Swapping').should('not.exist')
})
})

View File

@@ -1,13 +1,11 @@
import { getTestSelector } from '../utils'
const COLLECTION_ADDRESS = '0xbd3531da5cf5857e7cfaa92426877b022e612cf8'
const PUDGY_COLLECTION_ADDRESS = '0xbd3531da5cf5857e7cfaa92426877b022e612cf8'
const BONSAI_COLLECTION_ADDRESS = '0xec9c519d49856fd2f8133a0741b4dbe002ce211b'
describe('Testing nfts', () => {
before(() => {
cy.visit('/')
})
it('should load nft leaderboard', () => {
cy.visit('/')
cy.get(getTestSelector('nft-nav')).first().click()
cy.get(getTestSelector('nft-nav')).first().should('exist')
cy.get(getTestSelector('nft-nav')).first().click()
@@ -15,29 +13,24 @@ describe('Testing nfts', () => {
})
it('should load pudgy penguin collection page', () => {
cy.visit(`/#/nfts/collection/${COLLECTION_ADDRESS}`)
cy.visit(`/#/nfts/collection/${PUDGY_COLLECTION_ADDRESS}`)
cy.get(getTestSelector('nft-collection-asset')).should('exist')
cy.get(getTestSelector('nft-collection-filter-buy-now')).should('not.exist')
cy.get(getTestSelector('nft-filter')).first().click()
cy.get(getTestSelector('nft-collection-filter-buy-now')).should('exist')
})
it('should be able to open bag and open sweep', () => {
cy.get(getTestSelector('nft-sweep-button')).first().click()
cy.get(getTestSelector('nft-empty-bag')).should('exist')
cy.get(getTestSelector('nft-sweep-slider')).should('exist')
})
it('should be able to navigate to activity', () => {
cy.visit(`/#/nfts/collection/${PUDGY_COLLECTION_ADDRESS}`)
cy.get(getTestSelector('nft-activity')).first().click()
cy.get(getTestSelector('nft-activity-row')).should('exist')
})
it('should go to the details page', () => {
cy.visit(`/#/nfts/collection/${COLLECTION_ADDRESS}`)
cy.visit(`/#/nfts/collection/${PUDGY_COLLECTION_ADDRESS}`)
cy.get(getTestSelector('nft-filter')).first().click()
cy.get(getTestSelector('nft-collection-filter-buy-now')).click()
cy.get(getTestSelector('nft-details-link')).first().click()
cy.get(getTestSelector('nft-collection-asset')).first().click()
cy.get(getTestSelector('nft-details-traits')).should('exist')
cy.get(getTestSelector('nft-details-activity')).should('exist')
cy.get(getTestSelector('nft-details-description')).should('exist')
@@ -45,6 +38,7 @@ describe('Testing nfts', () => {
})
it('should toggle buy now on details page', () => {
cy.visit(`#/nfts/asset/${BONSAI_COLLECTION_ADDRESS}/7580`)
cy.get(getTestSelector('nft-details-description-text')).should('exist')
cy.get(getTestSelector('nft-details-description')).click()
cy.get(getTestSelector('nft-details-description-text')).should('not.exist')
@@ -52,13 +46,11 @@ describe('Testing nfts', () => {
cy.get(getTestSelector('nft-bag')).should('exist')
})
it('should go view my nfts', () => {
it('should navigate to and from the owned nfts page', () => {
cy.visit('/')
cy.get(getTestSelector('web3-status-connected')).click()
cy.get(getTestSelector('nft-view-self-nfts')).click()
cy.get(getTestSelector('nft-explore-nfts-button')).should('exist')
cy.get(getTestSelector('nft-no-nfts-selected')).should('exist')
cy.get(getTestSelector('nft-bag-close-icon')).click()
cy.get(getTestSelector('nft-explore-nfts-button')).click()
cy.get(getTestSelector('nft-welcome-modal')).should('exist')
cy.get(getTestSelector('mini-portfolio-navbar')).contains('NFTs').click()
cy.get(getTestSelector('mini-portfolio-nft')).click()
cy.get(getTestSelector('mini-portfolio-navbar')).should('not.be.visible')
})
})

247
cypress/e2e/permit2.test.ts Normal file
View File

@@ -0,0 +1,247 @@
import { BigNumber } from '@ethersproject/bignumber'
import { MaxUint160, MaxUint256 } from '@uniswap/permit2-sdk'
import { CurrencyAmount, Token } from '@uniswap/sdk-core'
import { DAI, USDC_MAINNET, USDT } from '../../src/constants/tokens'
import { getTestSelector } from '../utils'
/** Initiates a swap. */
function initiateSwap() {
// The swap button is re-rendered once enabled, so we must wait until the original button is not disabled to re-select the appropriate button.
cy.get('#swap-button').should('not.be.disabled')
// Completes the swap.
cy.get('#swap-button').click()
cy.contains('Confirm swap').click()
}
describe('Permit2', () => {
function setupInputs(inputToken: Token, outputToken: Token) {
// Sets up a swap between inputToken and outputToken.
cy.visit(`/swap/?inputCurrency=${inputToken.address}&outputCurrency=${outputToken.address}`, {
ethereum: 'hardhat',
})
cy.get('#swap-currency-input .token-amount-input').type('0.01')
}
/** Asserts permit2 has a max approval for spend of the input token on-chain. */
function expectTokenAllowanceForPermit2ToBeMax(inputToken: Token) {
// check token approval
cy.hardhat()
.then(({ approval, wallet }) => approval.getTokenAllowanceForPermit2({ owner: wallet, token: inputToken }))
.should('deep.equal', MaxUint256)
}
/** Asserts the universal router has a max permit2 approval for spend of the input token on-chain. */
function expectPermit2AllowanceForUniversalRouterToBeMax(inputToken: Token) {
cy.hardhat()
.then((hardhat) => hardhat.approval.getPermit2Allowance({ owner: hardhat.wallet, token: inputToken }))
.then((allowance) => {
cy.wrap(MaxUint160.eq(allowance.amount)).should('eq', true)
// Asserts that the on-chain expiration is in 30 days, within a tolerance of 40 seconds.
const THIRTY_DAYS_SECONDS = 2_592_000
const expected = Math.floor(Date.now() / 1000 + THIRTY_DAYS_SECONDS)
cy.wrap(allowance.expiration).should('be.closeTo', expected, 40)
})
}
describe('approval process (with intermediate screens)', () => {
// Turn off automine so that intermediate screens are available to assert on.
beforeEach(() => cy.hardhat({ automine: false }))
it('swaps after completing full permit2 approval process', () => {
setupInputs(DAI, USDC_MAINNET)
initiateSwap()
// verify that the modal retains its state when the window loses focus
cy.window().trigger('blur')
// Verify token approval
cy.contains('Enable spending DAI on Uniswap')
cy.wait('@eth_sendRawTransaction')
cy.hardhat().then((hardhat) => hardhat.mine())
cy.get(getTestSelector('popups')).contains('Approved')
expectTokenAllowanceForPermit2ToBeMax(DAI)
// Verify permit2 approval
cy.contains('Allow DAI to be used for swapping')
cy.wait('@eth_signTypedData_v4')
cy.wait('@eth_sendRawTransaction')
cy.hardhat().then((hardhat) => hardhat.mine())
cy.contains('Success')
cy.get(getTestSelector('popups')).contains('Swapped')
expectPermit2AllowanceForUniversalRouterToBeMax(DAI)
})
it('swaps with existing permit approval and missing token approval', () => {
setupInputs(DAI, USDC_MAINNET)
cy.hardhat().then(async (hardhat) => {
await hardhat.approval.setPermit2Allowance({ owner: hardhat.wallet, token: DAI })
await hardhat.mine()
})
initiateSwap()
// Verify token approval
cy.contains('Enable spending DAI on Uniswap')
cy.wait('@eth_sendRawTransaction')
cy.hardhat().then((hardhat) => hardhat.mine())
cy.get(getTestSelector('popups')).contains('Approved')
expectTokenAllowanceForPermit2ToBeMax(DAI)
// Verify transaction
cy.wait('@eth_sendRawTransaction')
cy.hardhat().then((hardhat) => hardhat.mine())
cy.contains('Success')
cy.get(getTestSelector('popups')).contains('Swapped')
})
/**
* On mainnet, you have to revoke USDT approval before increasing it.
* From the token contract:
* To change the approve amount you first have to reduce the addresses`
* allowance to zero by calling `approve(_spender, 0)` if it is not
* already 0 to mitigate the race condition described here:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*/
it('swaps USDT with existing permit, and existing but insufficient token approval', () => {
cy.hardhat().then(async (hardhat) => {
await hardhat.fund(hardhat.wallet, CurrencyAmount.fromRawAmount(USDT, 2e6))
await hardhat.mine()
await hardhat.approval.setTokenAllowanceForPermit2({ owner: hardhat.wallet, token: USDT }, 1e6)
await hardhat.mine()
await hardhat.approval.setPermit2Allowance({ owner: hardhat.wallet, token: USDT })
await hardhat.mine()
})
setupInputs(USDT, USDC_MAINNET)
cy.get('#swap-currency-input .token-amount-input').clear().type('2')
initiateSwap()
// Verify allowance revocation
cy.contains('Reset USDT')
cy.wait('@eth_sendRawTransaction')
cy.hardhat().then((hardhat) => hardhat.mine())
cy.hardhat()
.then(({ approval, wallet }) => approval.getTokenAllowanceForPermit2({ owner: wallet, token: USDT }))
.should('deep.equal', BigNumber.from(0))
// Verify token approval
cy.contains('Enable spending USDT on Uniswap')
cy.wait('@eth_sendRawTransaction')
cy.hardhat().then((hardhat) => hardhat.mine())
cy.get(getTestSelector('popups')).contains('Approved')
expectTokenAllowanceForPermit2ToBeMax(USDT)
// Verify transaction
cy.wait('@eth_sendRawTransaction')
cy.hardhat().then((hardhat) => hardhat.mine())
cy.contains('Success')
cy.get(getTestSelector('popups')).contains('Swapped')
})
})
it('swaps when user has already approved token and permit2', () => {
cy.hardhat().then(({ approval, wallet }) =>
Promise.all([
approval.setTokenAllowanceForPermit2({ owner: wallet, token: DAI }),
approval.setPermit2Allowance({ owner: wallet, token: DAI }),
])
)
setupInputs(DAI, USDC_MAINNET)
initiateSwap()
// Verify transaction
cy.contains('Success')
cy.get(getTestSelector('popups')).contains('Swapped')
})
it('swaps after handling user rejection of both approval and signature', () => {
setupInputs(DAI, USDC_MAINNET)
const USER_REJECTION = { code: 4001 }
cy.hardhat().then((hardhat) => {
// Reject token approval
const tokenApprovalStub = cy.stub(hardhat.wallet, 'sendTransaction').log(false)
tokenApprovalStub.rejects(USER_REJECTION) // rejects token approval
initiateSwap()
// Verify token approval rejection
cy.wrap(tokenApprovalStub).should('be.calledOnce')
cy.contains('Review swap')
// Allow token approval
cy.then(() => tokenApprovalStub.restore())
// Reject permit2 approval
const permitApprovalStub = cy.stub(hardhat.provider, 'send').log(false)
permitApprovalStub.withArgs('eth_signTypedData_v4').rejects(USER_REJECTION) // rejects permit approval
permitApprovalStub.callThrough() // allows non-eth_signTypedData_v4 send calls to return non-stubbed values
cy.contains('Confirm swap').click()
// Verify token approval
cy.get(getTestSelector('popups')).contains('Approved')
expectTokenAllowanceForPermit2ToBeMax(DAI)
// Verify permit2 approval rejection
cy.wrap(permitApprovalStub).should('be.calledWith', 'eth_signTypedData_v4')
cy.contains('Review swap')
// Allow permit2 approval
cy.then(() => permitApprovalStub.restore())
cy.contains('Confirm swap').click()
// Verify permit2 approval
cy.contains('Success')
cy.get(getTestSelector('popups')).contains('Swapped')
expectPermit2AllowanceForUniversalRouterToBeMax(DAI)
})
})
it('prompts token approval when existing approval amount is too low', () => {
setupInputs(DAI, USDC_MAINNET)
cy.hardhat().then(({ approval, wallet }) =>
Promise.all([
approval.setPermit2Allowance({ owner: wallet, token: DAI }),
approval.setTokenAllowanceForPermit2({ owner: wallet, token: DAI }, 1),
])
)
initiateSwap()
// Verify token approval
cy.get(getTestSelector('popups')).contains('Approved')
expectPermit2AllowanceForUniversalRouterToBeMax(DAI)
})
it('prompts signature when existing permit approval is expired', () => {
setupInputs(DAI, USDC_MAINNET)
const expiredAllowance = { expiration: Math.floor((Date.now() - 1) / 1000) }
cy.hardhat().then(({ approval, wallet }) =>
Promise.all([
approval.setTokenAllowanceForPermit2({ owner: wallet, token: DAI }),
approval.setPermit2Allowance({ owner: wallet, token: DAI }, expiredAllowance),
])
)
initiateSwap()
// Verify permit2 approval
cy.wait('@eth_signTypedData_v4')
cy.contains('Success')
cy.get(getTestSelector('popups')).contains('Swapped')
expectPermit2AllowanceForUniversalRouterToBeMax(DAI)
})
it('prompts signature when existing permit approval amount is too low', () => {
setupInputs(DAI, USDC_MAINNET)
const smallAllowance = { amount: 1 }
cy.hardhat().then(({ approval, wallet }) =>
Promise.all([
approval.setTokenAllowanceForPermit2({ owner: wallet, token: DAI }),
approval.setPermit2Allowance({ owner: wallet, token: DAI }, smallAllowance),
])
)
initiateSwap()
// Verify permit2 approval
cy.wait('@eth_signTypedData_v4')
cy.contains('Success')
cy.get(getTestSelector('popups')).contains('Swapped')
expectPermit2AllowanceForUniversalRouterToBeMax(DAI)
})
})

View File

@@ -1,8 +1,17 @@
describe('Pool', () => {
beforeEach(() => cy.visit('/pool'))
beforeEach(() => {
cy.visit('/pools').then(() => {
cy.wait('@eth_blockNumber')
})
})
it('add liquidity links to /add/ETH', () => {
cy.get('#join-pool-button').click()
cy.url().should('contain', '/add/ETH')
cy.get('body').then(() => {
cy.get('#join-pool-button')
.click()
.then(() => {
cy.url().should('contain', '/add/ETH')
})
})
})
})

View File

@@ -0,0 +1,11 @@
describe('Position', () => {
it('shows an valid state on a supported network', () => {
cy.visit('/pools/1')
cy.contains('UNI / ETH')
})
it('shows an invalid state on a supported network', () => {
cy.visit('/pools/788893')
cy.contains('To view a position, you must be connected to the network it belongs to.')
})
})

View File

@@ -1,24 +1,24 @@
describe('Remove Liquidity', () => {
it('eth remove', () => {
cy.visit('/remove/v2/ETH/0xF9bA5210F91D0474bd1e1DcDAeC4C58E359AaD85')
cy.visit('/remove/v2/ETH/0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984')
cy.get('#remove-liquidity-tokena-symbol').should('contain.text', 'ETH')
cy.get('#remove-liquidity-tokenb-symbol').should('contain.text', 'MKR')
cy.get('#remove-liquidity-tokenb-symbol').should('contain.text', 'UNI')
})
it('eth remove swap order', () => {
cy.visit('/remove/v2/0xF9bA5210F91D0474bd1e1DcDAeC4C58E359AaD85/ETH')
cy.get('#remove-liquidity-tokena-symbol').should('contain.text', 'MKR')
cy.visit('/remove/v2/0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984/ETH')
cy.get('#remove-liquidity-tokena-symbol').should('contain.text', 'UNI')
cy.get('#remove-liquidity-tokenb-symbol').should('contain.text', 'ETH')
})
it('loads the two correct tokens', () => {
cy.visit('/remove/v2/0xc778417E063141139Fce010982780140Aa0cD5Ab/0xF9bA5210F91D0474bd1e1DcDAeC4C58E359AaD85')
cy.visit('/remove/v2/0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6/0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984')
cy.get('#remove-liquidity-tokena-symbol').should('contain.text', 'WETH')
cy.get('#remove-liquidity-tokenb-symbol').should('contain.text', 'MKR')
cy.get('#remove-liquidity-tokenb-symbol').should('contain.text', 'UNI')
})
it('does not crash if ETH is duplicated', () => {
cy.visit('/remove/v2/0xc778417E063141139Fce010982780140Aa0cD5Ab/0xc778417E063141139Fce010982780140Aa0cD5Ab')
cy.visit('/remove/v2/0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6/0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6')
cy.get('#remove-liquidity-tokena-symbol').should('contain.text', 'WETH')
cy.get('#remove-liquidity-tokenb-symbol').should('contain.text', 'WETH')
})

View File

@@ -1,4 +1,4 @@
import assert = require('assert')
import assert from 'assert'
describe('Service Worker', () => {
before(() => {
@@ -9,7 +9,7 @@ describe('Service Worker', () => {
throw new Error(
'\n' +
'Service Worker tests must be run on a production-like build\n' +
'To test, build with `yarn build:e2e` and serve with `yarn serve`'
'To test, build with `yarn build` and serve with `yarn serve`'
)
}
})
@@ -20,65 +20,78 @@ describe('Service Worker', () => {
}
})
function unregister() {
return cy.log('unregister service worker').then(async () => {
const cacheKeys = await window.caches.keys()
const cacheKey = cacheKeys.find((key) => key.match(/precache/))
if (cacheKey) {
await window.caches.delete(cacheKey)
}
function unregisterServiceWorker() {
return cy.log('unregisters service worker').then(async () => {
const sw = await window.navigator.serviceWorker.getRegistration(Cypress.config().baseUrl ?? undefined)
await sw?.unregister()
})
}
before(unregister)
after(unregister)
before(unregisterServiceWorker)
after(unregisterServiceWorker)
beforeEach(() => {
cy.intercept({ hostname: 'www.google-analytics.com' }, (req) => {
const body = req.body.toString()
if (req.query['ep.event_category'] === 'Service Worker' || body.includes('Service%20Worker')) {
if (req.query['en'] === 'Not Installed' || body.includes('Not%20Installed')) {
req.alias = 'NotInstalled'
} else if (req.query['en'] === 'Cache Hit' || body.includes('Cache%20Hit')) {
req.alias = 'CacheHit'
} else if (req.query['en'] === 'Cache Miss' || body.includes('Cache%20Miss')) {
req.alias = 'CacheMiss'
}
cy.intercept('https://api.uniswap.org/v1/amplitude-proxy', (req) => {
const body = JSON.stringify(req.body)
const serviceWorkerStatus = body.match(/"service_worker":"(\w+)"/)?.[1]
if (serviceWorkerStatus) {
req.alias = `ServiceWorker:${serviceWorkerStatus}`
}
})
})
it('installs a ServiceWorker', () => {
it('installs a ServiceWorker and reports the uninstalled status to analytics', () => {
cy.visit('/', { serviceWorker: true })
.get('#swap-page')
.wait('@NotInstalled', { timeout: 20000 })
.window({ timeout: 20000 })
.and((win) => {
expect(win.navigator.serviceWorker.controller?.state).to.equal('activated')
})
cy.wait('@ServiceWorker:uninstalled')
cy.window().should(
'have.nested.property',
// The parent is checked instead of the AUT because it is on the same origin,
// and the AUT will not be considered "activated" until the parent is idle.
'parent.navigator.serviceWorker.controller.state',
'activated'
)
})
it('records a cache hit', () => {
cy.visit('/', { serviceWorker: true }).get('#swap-page').wait('@CacheHit', { timeout: 20000 })
})
it('records a cache miss', () => {
cy.then(async () => {
const cacheKeys = await window.caches.keys()
const cacheKey = cacheKeys.find((key) => key.match(/precache/))
assert(cacheKey)
const cache = await window.caches.open(cacheKey)
const keys = await cache.keys()
const key = keys.find((key) => key.url.match(/index/))
assert(key)
await cache.put(key, new Response())
describe('cache hit', () => {
it('reports the hit to analytics', () => {
cy.visit('/', { serviceWorker: true })
cy.wait('@ServiceWorker:hit')
})
})
describe('cache miss', () => {
let cache: Cache | undefined
let request: Request | undefined
let response: Response | undefined
before(() => {
// Mocks the index.html in the cache to force a cache miss.
cy.visit('/', { serviceWorker: true }).then(async () => {
const cacheKeys = await window.caches.keys()
const cacheKey = cacheKeys.find((key) => key.match(/precache/))
assert(cacheKey)
cache = await window.caches.open(cacheKey)
const keys = await cache.keys()
request = keys.find((key) => key.url.match(/index/))
assert(request)
response = await cache.match(request)
assert(response)
await cache.put(request, new Response())
})
})
after(() => {
// Restores the index.html in the cache so that re-runs behave as expected.
// This is necessary because the Service Worker will not re-populate the cache.
cy.then(async () => {
if (cache && request && response) {
await cache.put(request, response)
}
})
})
it('reports the miss to analytics', () => {
cy.visit('/', { serviceWorker: true })
cy.wait('@ServiceWorker:miss')
})
.visit('/', { serviceWorker: true })
.get('#swap-page')
.wait('@CacheMiss', { timeout: 20000 })
})
})

View File

@@ -1,53 +0,0 @@
describe('Swap', () => {
before(() => {
cy.visit('/swap')
})
it('starts with ETH selected by default', () => {
cy.get('#swap-currency-input .token-amount-input').should('have.value', '')
cy.get('#swap-currency-input .token-symbol-container').should('contain.text', 'ETH')
cy.get('#swap-currency-output .token-amount-input').should('not.have.value')
cy.get('#swap-currency-output .token-symbol-container').should('contain.text', 'Select token')
})
it('can enter an amount into input', () => {
cy.get('#swap-currency-input .token-amount-input').clear().type('0.001').should('have.value', '0.001')
})
it('zero swap amount', () => {
cy.get('#swap-currency-input .token-amount-input').clear().type('0.0').should('have.value', '0.0')
})
it('invalid swap amount', () => {
cy.get('#swap-currency-input .token-amount-input').clear().type('\\').should('have.value', '')
})
it('can enter an amount into output', () => {
cy.get('#swap-currency-output .token-amount-input').clear().type('0.001').should('have.value', '0.001')
})
it('zero output amount', () => {
cy.get('#swap-currency-output .token-amount-input').clear().type('0.0').should('have.value', '0.0')
})
it.skip('can swap ETH for DAI', () => {
cy.get('#swap-currency-output .open-currency-select-button').click()
cy.get('.token-item-0xc7AD46e0b8a400Bb3C915120d284AafbA8fc4735').click()
cy.get('#swap-currency-input .token-amount-input').clear().type('0.0000001')
cy.get('#swap-currency-output .token-amount-input').should('not.equal', '')
cy.get('#swap-button').click()
cy.get('#confirm-swap-or-send').should('contain', 'Confirm Swap')
cy.get('[data-cy="confirmation-close-icon"]').click()
})
it('add a recipient does not exist unless in expert mode', () => {
cy.get('#add-recipient-button').should('not.exist')
})
it.skip('ETH to wETH is same value (wrapped swaps have no price impact)', () => {
cy.get('#swap-currency-output .open-currency-select-button').click()
cy.get('.token-item-0xc778417E063141139Fce010982780140Aa0cD5Ab').click()
cy.get('#swap-currency-input .token-amount-input').clear().type('0.01')
cy.get('#swap-currency-output .token-amount-input').should('have.value', '0.01')
})
})

View File

@@ -0,0 +1,107 @@
import { BigNumber } from '@ethersproject/bignumber'
import { ChainId } from '@uniswap/sdk-core'
import { DEFAULT_DEADLINE_FROM_NOW } from '../../../src/constants/misc'
import { UNI, USDC_MAINNET } from '../../../src/constants/tokens'
import { getBalance, getTestSelector } from '../../utils'
const UNI_MAINNET = UNI[ChainId.MAINNET]
describe('Swap errors', () => {
it('wallet rejection', () => {
cy.visit(`/swap?inputCurrency=ETH&outputCurrency=${USDC_MAINNET.address}`, { ethereum: 'hardhat' })
cy.hardhat().then((hardhat) => {
// Stub the wallet to reject any transaction.
cy.stub(hardhat.wallet, 'sendTransaction').log(false).rejects(new Error('user cancelled'))
// Enter amount to swap
cy.get('#swap-currency-output .token-amount-input').type('1').should('have.value', '1')
cy.get('#swap-currency-input .token-amount-input').should('not.have.value', '')
// Submit transaction
cy.get('#swap-button').click()
cy.contains('Confirm swap').click()
cy.wait('@eth_estimateGas')
// Verify rejection
cy.contains('Review swap')
cy.contains('Confirm swap')
})
})
it('transaction past deadline', () => {
cy.visit(`/swap?inputCurrency=ETH&outputCurrency=${USDC_MAINNET.address}`, { ethereum: 'hardhat' })
cy.hardhat({ automine: false })
getBalance(USDC_MAINNET).then((initialBalance) => {
// Enter amount to swap
cy.get('#swap-currency-output .token-amount-input').type('1').should('have.value', '1')
cy.get('#swap-currency-input .token-amount-input').should('not.have.value', '')
// Submit transaction
cy.get('#swap-button').click()
cy.contains('Confirm swap').click()
cy.wait('@eth_estimateGas').wait('@eth_sendRawTransaction').wait('@eth_getTransactionReceipt')
cy.contains('Transaction submitted')
cy.get(getTestSelector('confirmation-close-icon')).click()
cy.get(getTestSelector('web3-status-connected')).should('contain', '1 Pending')
// Mine transaction
cy.hardhat().then(async (hardhat) => {
// Remove the transaction from the mempool, so that it doesn't fail but it is past the deadline.
// This should result in it being removed from pending transactions, without a failure notificiation.
const transactions = await hardhat.send('eth_pendingTransactions', [])
await hardhat.send('hardhat_dropTransaction', [transactions[0].hash])
// Mine past the deadline
await hardhat.mine(1, DEFAULT_DEADLINE_FROM_NOW + 1)
})
cy.wait('@eth_getTransactionReceipt')
// Verify transaction did not occur
cy.get(getTestSelector('web3-status-connected')).should('not.contain', 'Pending')
cy.get(getTestSelector('popups')).should('not.contain', 'Swap failed')
cy.get('#swap-currency-output').contains(`Balance: ${initialBalance}`)
getBalance(USDC_MAINNET).should('eq', initialBalance)
})
})
it.skip('slippage failure', () => {
cy.visit(`/swap?inputCurrency=ETH&outputCurrency=${UNI_MAINNET.address}`, { ethereum: 'hardhat' })
cy.hardhat({ automine: false })
getBalance(USDC_MAINNET).then((initialBalance) => {
// Gas estimation fails for this transaction (that would normally fail), so we stub it.
cy.hardhat().then((hardhat) => {
const send = cy.stub(hardhat.provider, 'send').log(false)
send.withArgs('eth_estimateGas').resolves(BigNumber.from(2_000_000))
send.callThrough()
})
// Set slippage to a very low value.
cy.get(getTestSelector('open-settings-dialog-button')).click()
cy.get(getTestSelector('max-slippage-settings')).click()
cy.get(getTestSelector('slippage-input')).clear().type('0.01')
cy.get('body').click('topRight') // close modal
cy.get(getTestSelector('slippage-input')).should('not.exist')
// Submit 2 transactions
for (let i = 0; i < 2; i++) {
cy.get('#swap-currency-input .token-amount-input').type('200').should('have.value', '200')
cy.get('#swap-currency-output .token-amount-input').should('not.have.value', '')
cy.get('#swap-button').click()
cy.contains('Confirm swap').click()
cy.wait('@eth_sendRawTransaction').wait('@eth_getTransactionReceipt')
cy.contains('Transaction submitted')
cy.get(getTestSelector('confirmation-close-icon')).click()
}
cy.get(getTestSelector('web3-status-connected')).should('contain', '2 Pending')
// Mine transactions
cy.hardhat().then((hardhat) => hardhat.mine())
cy.wait('@eth_getTransactionReceipt')
// Verify transaction did not occur
cy.get(getTestSelector('web3-status-connected')).should('not.contain', 'Pending')
cy.get(getTestSelector('popups')).contains('Swap failed')
getBalance(UNI_MAINNET).should('eq', initialBalance)
})
})
})

View File

@@ -0,0 +1,14 @@
import { getTestSelector } from '../../utils'
describe('Swap settings', () => {
it('Opens and closes the settings menu', () => {
cy.visit('/swap')
cy.contains('Settings').should('not.exist')
cy.get(getTestSelector('open-settings-dialog-button')).click()
cy.contains('Max slippage').should('exist')
cy.contains('Transaction deadline').should('exist')
cy.contains('Auto Router API').should('exist')
cy.get(getTestSelector('open-settings-dialog-button')).click()
cy.contains('Settings').should('not.exist')
})
})

View File

@@ -0,0 +1,90 @@
import { ChainId } from '@uniswap/sdk-core'
import { UNI, USDC_MAINNET } from '../../../src/constants/tokens'
import { getBalance, getTestSelector } from '../../utils'
const UNI_MAINNET = UNI[ChainId.MAINNET]
describe('Swap', () => {
describe('Swap on main page', () => {
it('starts with ETH selected by default', () => {
cy.visit('/swap')
cy.get(`#swap-currency-input .token-amount-input`).should('have.value', '')
cy.get(`#swap-currency-input .token-symbol-container`).should('contain.text', 'ETH')
cy.get(`#swap-currency-output .token-amount-input`).should('not.have.value')
cy.get(`#swap-currency-output .token-symbol-container`).should('contain.text', 'Select token')
})
it('should default inputs from URL params ', () => {
cy.visit(`/swap?inputCurrency=${UNI_MAINNET.address}`)
cy.get(`#swap-currency-input .token-symbol-container`).should('contain.text', 'UNI')
cy.get(`#swap-currency-output .token-symbol-container`).should('contain.text', 'Select token')
cy.visit(`/swap?outputCurrency=${UNI_MAINNET.address}`)
cy.get(`#swap-currency-input .token-symbol-container`).should('contain.text', 'Select token')
cy.get(`#swap-currency-output .token-symbol-container`).should('contain.text', 'UNI')
cy.visit(`/swap?inputCurrency=ETH&outputCurrency=${UNI_MAINNET.address}`)
cy.get(`#swap-currency-input .token-symbol-container`).should('contain.text', 'ETH')
cy.get(`#swap-currency-output .token-symbol-container`).should('contain.text', 'UNI')
})
it('inputs reset when navigating between pages', () => {
cy.visit('/swap')
cy.get('#swap-currency-input .token-amount-input').should('have.value', '')
cy.get('#swap-currency-input .token-amount-input').type('0.01').should('have.value', '0.01')
cy.visit('/pool').visit('/swap')
cy.get('#swap-currency-input .token-amount-input').should('have.value', '')
})
it('resets the dependent input when the independent input is cleared', () => {
cy.visit(`/swap?inputCurrency=ETH&outputCurrency=${UNI_MAINNET.address}`)
cy.get('#swap-currency-input .token-amount-input').should('have.value', '')
cy.get(`#swap-currency-output .token-amount-input`).should('have.value', '')
cy.get('#swap-currency-input .token-amount-input').type('0.01').should('have.value', '0.01')
cy.get(`#swap-currency-output .token-amount-input`).should('not.have.value', '')
cy.get('#swap-currency-input .token-amount-input').clear()
cy.get(`#swap-currency-output .token-amount-input`).should('not.have.value')
cy.window().trigger('blur')
cy.get(`#swap-currency-output .token-amount-input`).should('not.have.value')
})
it('swaps ETH for USDC', () => {
cy.visit('/swap', { ethereum: 'hardhat' })
cy.hardhat({ automine: false })
getBalance(USDC_MAINNET).then((initialBalance) => {
// Select USDC
cy.get('#swap-currency-output .open-currency-select-button').click()
cy.get(getTestSelector('token-search-input')).type(USDC_MAINNET.address)
cy.contains('USDC').click()
// Enter amount to swap
cy.get('#swap-currency-output .token-amount-input').type('1').should('have.value', '1')
cy.get('#swap-currency-input .token-amount-input').should('not.have.value', '')
// Submit transaction
cy.get('#swap-button').click()
cy.contains('Review swap')
cy.contains('Confirm swap').click()
cy.wait('@eth_estimateGas').wait('@eth_sendRawTransaction').wait('@eth_getTransactionReceipt')
cy.contains('Transaction submitted')
cy.get(getTestSelector('confirmation-close-icon')).click()
cy.contains('Transaction submitted').should('not.exist')
cy.get(getTestSelector('web3-status-connected')).should('contain', '1 Pending')
// Mine transaction
cy.hardhat().then((hardhat) => hardhat.mine())
cy.wait('@eth_getTransactionReceipt')
// Verify transaction
cy.get(getTestSelector('web3-status-connected')).should('not.contain', 'Pending')
cy.get(getTestSelector('popups')).contains('Swapped')
const finalBalance = initialBalance + 1
cy.get('#swap-currency-output').contains(`Balance: ${finalBalance}`)
getBalance(USDC_MAINNET).should('eq', finalBalance)
})
})
})
})

View File

@@ -0,0 +1,80 @@
import { ChainId, CurrencyAmount, WETH9 } from '@uniswap/sdk-core'
import { getBalance, getTestSelector } from '../../utils'
const WETH = WETH9[ChainId.MAINNET]
describe('Swap wrap', () => {
beforeEach(() => {
cy.visit(`/swap?inputCurrency=ETH&outputCurrency=${WETH.address}`, { ethereum: 'hardhat' }).hardhat({
automine: false,
})
})
it('ETH to wETH is same value (wrapped swaps have no price impact)', () => {
cy.get('#swap-currency-input .token-amount-input').type('0.01').should('have.value', '0.01')
cy.get('#swap-currency-output .token-amount-input').should('have.value', '0.01')
cy.get('#swap-currency-output .token-amount-input').clear().type('0.02').should('have.value', '0.02')
cy.get('#swap-currency-input .token-amount-input').should('have.value', '0.02')
})
it('should be able to wrap ETH', () => {
getBalance(WETH).then((initialBalance) => {
cy.contains('Enter ETH amount')
// Enter amount to wrap
cy.get('#swap-currency-output .token-amount-input').type('1').should('have.value', 1)
cy.get('#swap-currency-input .token-amount-input').should('have.value', 1)
// Submit transaction
cy.contains('Wrap').click()
cy.wait('@eth_estimateGas').wait('@eth_sendRawTransaction').wait('@eth_getTransactionReceipt')
cy.get(getTestSelector('web3-status-connected')).should('contain', '1 Pending')
// Mine transaction
cy.hardhat().then((hardhat) => hardhat.mine())
cy.wait('@eth_getTransactionReceipt')
// Verify transaction
cy.get(getTestSelector('web3-status-connected')).should('not.contain', 'Pending')
cy.get(getTestSelector('popups')).contains('Wrapped')
const finalBalance = initialBalance + 1
cy.get('#swap-currency-output').contains(`Balance: ${finalBalance}`)
getBalance(WETH).should('equal', finalBalance)
})
})
it('should be able to unwrap WETH', () => {
cy.hardhat().then(async (hardhat) => {
await hardhat.fund(hardhat.wallet, CurrencyAmount.fromRawAmount(WETH, 1e18))
await hardhat.mine()
})
getBalance(WETH).then((initialBalance) => {
// Swap input/output to unwrap WETH
cy.get(getTestSelector('swap-currency-button')).click()
cy.contains('Enter WETH amount')
// Enter the amount to unwrap
cy.get('#swap-currency-output .token-amount-input').type('1').should('have.value', 1)
cy.get('#swap-currency-input .token-amount-input').should('have.value', 1)
// Submit transaction
cy.contains('Unwrap').click()
cy.wait('@eth_estimateGas').wait('@eth_sendRawTransaction').wait('@eth_getTransactionReceipt')
cy.get(getTestSelector('web3-status-connected')).should('contain', '1 Pending')
// Mine transaction
cy.hardhat().then((hardhat) => hardhat.mine())
cy.wait('@eth_getTransactionReceipt')
// Verify transaction
cy.get(getTestSelector('web3-status-connected')).should('not.contain', 'Pending')
cy.get(getTestSelector('popups')).contains('Unwrapped')
const finalBalance = initialBalance - 1
cy.get('#swap-currency-input').contains(`Balance: ${finalBalance}`)
getBalance(WETH).should('equal', finalBalance)
})
})
})

View File

@@ -0,0 +1,158 @@
import { ChainId, WETH9 } from '@uniswap/sdk-core'
import { ARB, UNI } from '../../src/constants/tokens'
import { getTestSelector } from '../utils'
const UNI_MAINNET = UNI[ChainId.MAINNET]
const UNI_ADDRESS = '0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984'
describe('Token details', () => {
beforeEach(() => {
cy.viewport(1440, 900)
})
it('Uniswap token should have all information populated', () => {
// Uniswap token
cy.visit(`/tokens/ethereum/${UNI_ADDRESS}`)
// Price chart should be filled in
cy.get('[data-cy="chart-header"]').should('include.text', '$')
cy.get('[data-cy="price-chart"]').should('exist')
// Stats should have: TVL, 24H Volume, 52W low, 52W high
cy.get(getTestSelector('token-details-stats')).should('exist')
cy.get(getTestSelector('token-details-stats')).within(() => {
cy.get('[data-cy="tvl"]').should('include.text', '$')
cy.get('[data-cy="volume-24h"]').should('include.text', '$')
cy.get('[data-cy="52w-low"]').should('include.text', '$')
cy.get('[data-cy="52w-high"]').should('include.text', '$')
})
// About section should have description of token
cy.get(getTestSelector('token-details-about-section')).should('exist')
cy.contains('UNI is the governance token for Uniswap').should('exist')
// Links section should link out to Etherscan, More analytics, Website, Twitter
cy.get('[data-cy="resources-container"]').within(() => {
cy.contains('Etherscan').should('have.attr', 'href').and('include', `etherscan.io/address/${UNI_ADDRESS}`)
cy.contains('More analytics')
.should('have.attr', 'href')
.and('include', `info.uniswap.org/#/tokens/${UNI_ADDRESS}`)
cy.contains('Website').should('have.attr', 'href').and('include', 'uniswap.org')
cy.contains('Twitter').should('have.attr', 'href').and('include', 'twitter.com/Uniswap')
})
// Contract address should be displayed
cy.contains(UNI_ADDRESS).should('exist')
})
it('token with warning and low trading volume should have all information populated', () => {
// Shiba predator token, low trading volume and also has warning modal
cy.visit('/tokens/ethereum/0xa71d0588EAf47f12B13cF8eC750430d21DF04974')
// Should have missing price chart when price unavailable (expected for this token)
if (cy.get('[data-cy="chart-header"]').contains('Price Unavailable')) {
cy.get('[data-cy="missing-chart"]').should('exist')
}
// Stats should have: TVL, 24H Volume, 52W low, 52W high
cy.get(getTestSelector('token-details-stats')).should('exist')
cy.get(getTestSelector('token-details-stats')).within(() => {
cy.get('[data-cy="tvl"]').should('exist')
cy.get('[data-cy="volume-24h"]').should('exist')
cy.get('[data-cy="52w-low"]').should('exist')
cy.get('[data-cy="52w-high"]').should('exist')
})
// About section should have description of token
cy.get(getTestSelector('token-details-about-section')).should('exist')
cy.contains('QOM is the Shiba Predator').should('exist')
// Links section should link out to Etherscan, More analytics, Website, Twitter
cy.get('[data-cy="resources-container"]').within(() => {
cy.contains('Etherscan')
.should('have.attr', 'href')
.and('include', 'etherscan.io/address/0xa71d0588EAf47f12B13cF8eC750430d21DF04974')
cy.contains('More analytics')
.should('have.attr', 'href')
.and('include', 'info.uniswap.org/#/tokens/0xa71d0588EAf47f12B13cF8eC750430d21DF04974')
cy.contains('Website').should('have.attr', 'href').and('include', 'qom')
cy.contains('Twitter').should('have.attr', 'href').and('include', 'twitter.com/ShibaPredator1')
})
// Contract address should be displayed
cy.contains('0xa71d0588EAf47f12B13cF8eC750430d21DF04974').should('exist')
// Warning label should show if relevant ([spec](https://www.notion.so/3f7fce6f93694be08a94a6984d50298e))
cy.get('[data-cy="token-safety-message"]')
.should('include.text', 'Warning')
.and('include.text', "This token isn't traded on leading U.S. centralized exchanges")
})
describe('swapping', () => {
beforeEach(() => {
// On mobile widths, we just link back to /swap instead of rendering the swap component.
cy.viewport(1200, 800)
cy.visit(`/tokens/ethereum/${UNI_MAINNET.address}`, {
ethereum: 'hardhat',
}).then(() => {
cy.wait('@eth_blockNumber')
cy.scrollTo('top')
})
})
it('should have the expected output for a tokens detail page', () => {
cy.get(`#swap-currency-input .token-amount-input`).should('have.value', '')
cy.get(`#swap-currency-input .token-symbol-container`).should('contain.text', 'Select token')
cy.get(`#swap-currency-output .token-amount-input`).should('not.have.value')
cy.get(`#swap-currency-output .token-symbol-container`).should('contain.text', 'UNI')
})
it('should automatically navigate to the new TDP', () => {
cy.get(`#swap-currency-output .open-currency-select-button`).click()
cy.contains('WETH').click()
cy.url().should('include', `${WETH9[1].address}`)
cy.url().should('not.include', `${UNI_MAINNET.address}`)
})
it('should not share swap state with the main swap page', () => {
cy.get(`#swap-currency-output .token-symbol-container`).should('contain.text', 'UNI')
cy.get(`#swap-currency-input .open-currency-select-button`).click()
cy.contains('WETH').click()
cy.visit('/swap')
cy.contains('UNI').should('not.exist')
cy.contains('WETH').should('not.exist')
})
it('can enter an amount into input', () => {
cy.get('#swap-currency-input .token-amount-input').clear().type('0.001').should('have.value', '0.001')
})
it('zero swap amount', () => {
cy.get('#swap-currency-input .token-amount-input').clear().type('0.0').should('have.value', '0.0')
})
it('invalid swap amount', () => {
cy.get('#swap-currency-input .token-amount-input').clear().type('\\').should('have.value', '')
})
it('can enter an amount into output', () => {
cy.get('#swap-currency-output .token-amount-input').clear().type('0.001').should('have.value', '0.001')
})
it('zero output amount', () => {
cy.get('#swap-currency-output .token-amount-input').clear().type('0.0').should('have.value', '0.0')
})
it('should show a L2 token even if the user is connected to a different network', () => {
cy.visit('/tokens', { ethereum: 'hardhat' })
cy.get(getTestSelector('tokens-network-filter-selected')).click()
cy.get(getTestSelector('tokens-network-filter-option-arbitrum')).click()
cy.get(getTestSelector('tokens-network-filter-selected')).should('contain', 'Arbitrum')
cy.get(getTestSelector(`token-table-row-${ARB.address.toLowerCase()}`)).click()
cy.get(`#swap-currency-output .token-symbol-container`).should('contain.text', 'ARB')
cy.get(getTestSelector('open-settings-dialog-button')).should('be.disabled')
cy.contains('Connect to Arbitrum').should('exist')
})
})
})

View File

@@ -0,0 +1,24 @@
describe('Token explore filter', () => {
beforeEach(() => {
cy.visit('/tokens')
})
function aliasFilteredTokens(filter: string) {
cy.get('[data-cy="token-name"]').then((tokens) => {
cy.wrap(Array.from(tokens).filter((token) => token.innerText.toLowerCase().includes(filter))).as('filteredTokens')
})
}
function searchFor(filter: string) {
cy.get('[data-cy="explore-tokens-search-input"]').clear().type(filter).type('{enter}')
}
it('should filter correctly by dao search term', () => {
aliasFilteredTokens('dao')
searchFor('dao')
cy.get('@filteredTokens').then((filteredTokens) => {
cy.get('[data-cy="token-name"]').should('deep.equal', filteredTokens)
})
})
})

View File

@@ -0,0 +1,76 @@
import { getTestSelector, getTestSelectorStartsWith } from '../utils'
describe('Token explore', () => {
before(() => {
cy.visit('/')
})
it('should load token leaderboard', () => {
cy.visit('/tokens/ethereum')
cy.get(getTestSelectorStartsWith('token-table')).its('length').should('be.greaterThan', 0)
// check sorted svg icon is present in volume cell, since tokens are sorted by volume by default
cy.get(getTestSelector('header-row')).find(getTestSelector('volume-cell')).find('svg').should('exist')
cy.get(getTestSelector('token-table-row-NATIVE')).find(getTestSelector('name-cell')).should('include.text', 'Ether')
cy.get(getTestSelector('token-table-row-NATIVE')).find(getTestSelector('volume-cell')).should('include.text', '$')
cy.get(getTestSelector('token-table-row-NATIVE')).find(getTestSelector('price-cell')).should('include.text', '$')
cy.get(getTestSelector('token-table-row-NATIVE')).find(getTestSelector('tvl-cell')).should('include.text', '$')
cy.get(getTestSelector('token-table-row-NATIVE'))
.find(getTestSelector('percent-change-cell'))
.should('include.text', '%')
cy.get(getTestSelector('header-row')).find(getTestSelector('price-cell')).click()
cy.get(getTestSelector('header-row')).find(getTestSelector('price-cell')).find('svg').should('exist')
})
it('should update when time window toggled', () => {
cy.visit('/tokens/ethereum')
cy.get(getTestSelector('time-selector')).should('contain', '1D')
cy.get(getTestSelector('token-table-row-NATIVE'))
.find(getTestSelector('volume-cell'))
.then(function ($elem) {
cy.wrap($elem.text()).as('dailyEthVol')
})
cy.get(getTestSelector('time-selector')).click()
cy.get(getTestSelector('1Y')).click()
cy.get(getTestSelector('token-table-row-NATIVE'))
.find(getTestSelector('volume-cell'))
.then(function ($elem) {
cy.wrap($elem.text()).as('yearlyEthVol')
})
expect(cy.get('@dailyEthVol')).to.not.equal(cy.get('@yearlyEthVol'))
})
it('should navigate to token detail page when row clicked', () => {
cy.visit('/tokens/ethereum')
cy.get(getTestSelector('token-table-row-NATIVE')).click()
cy.get(getTestSelector('token-details-about-section')).should('exist')
cy.get(getTestSelector('token-details-stats')).should('exist')
cy.get(getTestSelector('token-info-container')).should('exist')
cy.get(getTestSelector('chart-container')).should('exist')
cy.contains('Ethereum is a smart contract platform that enables developers to build tokens').should('exist')
cy.contains('Etherscan').should('exist')
})
it('should update when global network changed', () => {
cy.visit('/tokens/ethereum')
cy.get(getTestSelector('tokens-network-filter-selected')).should('contain', 'Ethereum')
cy.get(getTestSelector('token-table-row-NATIVE')).should('exist')
// note: cannot switch global chain via UI because we cannot approve the network switch
// in metamask modal using plain cypress. this is a workaround.
cy.visit('/tokens/polygon')
cy.get(getTestSelector('tokens-network-filter-selected')).should('contain', 'Polygon')
cy.get(getTestSelector('token-table-row-NATIVE'))
.find(getTestSelector('name-cell'))
.should('include.text', 'Polygon Matic')
})
it('should update when token explore table network changed', () => {
cy.visit('/tokens/ethereum')
cy.get(getTestSelector('tokens-network-filter-selected')).click()
cy.get(getTestSelector('tokens-network-filter-option-optimism')).click()
cy.get(getTestSelector('tokens-network-filter-selected')).should('contain', 'Optimism')
cy.reload()
cy.get(getTestSelector('tokens-network-filter-selected')).should('contain', 'Optimism')
cy.get(getTestSelector('chain-selector-logo')).invoke('attr', 'alt').should('eq', 'Ethereum')
})
})

View File

@@ -1,20 +0,0 @@
import { getTestSelector, getTestSelectorStartsWith } from '../utils'
describe('Testing tokens on uniswap page', () => {
before(() => {
cy.visit('/')
})
it('should load token leaderboard', () => {
cy.visit('/tokens/ethereum')
cy.get(getTestSelectorStartsWith('token-table')).its('length').should('be.gte', 25)
})
it('should load go to ethereum token and return to token list page', () => {
cy.visit('/tokens/ethereum')
cy.get(getTestSelector('token-table-row-Ether')).click()
cy.get(getTestSelector('token-details-stats')).should('exist')
cy.get(getTestSelector('token-details-return-button')).click()
cy.get(getTestSelectorStartsWith('token-table')).its('length').should('be.gte', 25)
})
})

View File

@@ -0,0 +1,45 @@
describe('Universal search bar', () => {
beforeEach(() => {
cy.visit('/')
cy.get('[data-cy="magnifying-icon"]').parent().eq(1).click()
})
it('should yield clickable result for regular token or nft collection search term', () => {
// Search for uni token by name.
cy.get('[data-cy="search-bar-input"]').last().clear().type('uni')
cy.get('[data-cy="searchbar-token-row-UNI"]')
.should('contain.text', 'Uniswap')
.and('contain.text', 'UNI')
.and('contain.text', '$')
.and('contain.text', '%')
cy.get('[data-cy="searchbar-token-row-UNI"]').first().click()
cy.location('hash').should('equal', '#/tokens/ethereum/0x1f9840a85d5af5bf1d1762f925bdaddc4201f984')
})
it.skip('should show recent tokens and popular tokens with empty search term', () => {
cy.get('[data-cy="magnifying-icon"]')
.parent()
.then(($navIcon) => {
$navIcon.click()
})
// Recently searched UNI token should exist.
cy.get('[data-cy="search-bar-input"]').last().clear()
cy.get('[data-cy="searchbar-dropdown"]')
.contains('[data-cy="searchbar-dropdown"]', 'Recent searches')
.find('[data-cy="searchbar-token-row-UNI"]')
.should('exist')
// Most popular 3 tokens should be shown.
cy.get('[data-cy="searchbar-dropdown"]')
.contains('[data-cy="searchbar-dropdown"]', 'Popular tokens')
.find('[data-cy^="searchbar-token-row"]')
.its('length')
.should('be.eq', 3)
})
it.skip('should show blocked badge when blocked token is searched for', () => {
// Search for mTSLA, which is a blocked token.
cy.get('[data-cy="search-bar-input"]').last().clear().type('mtsla')
cy.get('[data-cy="searchbar-token-row-mTSLA"]').find('[data-cy="blocked-icon"]').should('exist')
})
})

View File

@@ -0,0 +1,41 @@
import { getTestSelector } from '../../utils'
import { DISCONNECTED_WALLET_USER_STATE } from '../../utils/user-state'
describe('disconnect wallet', () => {
it('should clear state', () => {
cy.visit('/swap', { ethereum: 'hardhat' })
cy.get('#swap-currency-input .token-amount-input').clear().type('1')
// Verify wallet is connected
cy.hardhat().then((hardhat) => cy.contains(hardhat.wallet.address.substring(0, 6)))
cy.contains('Balance:')
// Disconnect the wallet
cy.hardhat().then((hardhat) => cy.contains(hardhat.wallet.address.substring(0, 6)).click())
cy.get(getTestSelector('wallet-disconnect')).click()
cy.get(getTestSelector('wallet-disconnect')).contains('Disconnect')
cy.get(getTestSelector('wallet-disconnect')).click()
// Verify wallet has disconnected
cy.contains('Connect a wallet').should('exist')
cy.get(getTestSelector('navbar-connect-wallet')).contains('Connect')
cy.contains('Connect Wallet')
// Verify swap input is cleared
cy.get('#swap-currency-input .token-amount-input').should('have.value', '')
})
})
describe('connect wallet', () => {
it('should load state', () => {
cy.visit('/swap', { ethereum: 'hardhat', userState: DISCONNECTED_WALLET_USER_STATE })
// Connect the wallet
cy.get(getTestSelector('navbar-connect-wallet')).contains('Connect').click()
cy.contains('MetaMask').click()
// Verify wallet is connected
cy.hardhat().then((hardhat) => cy.contains(hardhat.wallet.address.substring(0, 6)))
cy.contains('Balance:')
})
})

View File

@@ -0,0 +1,130 @@
import { createDeferredPromise } from '../../../src/test-utils/promise'
import { getTestSelector } from '../../utils'
function waitsForActiveChain(chain: string) {
cy.get(getTestSelector('chain-selector-logo')).invoke('attr', 'alt').should('eq', chain)
}
function switchChain(chain: string) {
cy.get(getTestSelector('chain-selector')).eq(1).click()
cy.contains(chain).click()
}
describe('network switching', () => {
beforeEach(() => {
cy.visit('/swap', { ethereum: 'hardhat' })
cy.get(getTestSelector('web3-status-connected'))
})
function rejectsNetworkSwitchWith(rejection: unknown) {
cy.hardhat().then((hardhat) => {
// Reject network switch
const sendStub = cy.stub(hardhat.provider, 'send').log(false).as('switch')
sendStub.withArgs('wallet_switchEthereumChain').rejects(rejection)
sendStub.callThrough() // allows other calls to return non-stubbed values
})
switchChain('Polygon')
// Verify rejected network switch
cy.get('@switch').should('have.been.calledWith', 'wallet_switchEthereumChain')
waitsForActiveChain('Ethereum')
cy.get(getTestSelector('web3-status-connected'))
}
it('should not display message on user rejection', () => {
const USER_REJECTION = { code: 4001 }
rejectsNetworkSwitchWith(USER_REJECTION)
cy.get(getTestSelector('popups')).should('not.contain', 'Failed to switch networks')
})
it('should display message on unknown error', () => {
rejectsNetworkSwitchWith(new Error('Unknown error'))
cy.get(getTestSelector('popups')).contains('Failed to switch networks')
})
it('should add missing chain', () => {
cy.hardhat().then((hardhat) => {
// https://docs.metamask.io/guide/rpc-api.html#unrestricted-methods
const CHAIN_NOT_ADDED = { code: 4902 } // missing message in useSelectChain
// Reject network switch with CHAIN_NOT_ADDED
const sendStub = cy.stub(hardhat.provider, 'send').log(false).as('switch')
let added = false
sendStub
.withArgs('wallet_switchEthereumChain')
.callsFake(() => (added ? Promise.resolve(null) : Promise.reject(CHAIN_NOT_ADDED)))
sendStub.withArgs('wallet_addEthereumChain').callsFake(() => {
added = true
return Promise.resolve(null)
})
sendStub.callThrough() // allows other calls to return non-stubbed values
})
switchChain('Polygon')
// Verify the network was added
cy.get('@switch').should('have.been.calledWith', 'wallet_switchEthereumChain')
cy.get('@switch').should('have.been.calledWith', 'wallet_addEthereumChain', [
{
blockExplorerUrls: ['https://polygonscan.com/'],
chainId: '0x89',
chainName: 'Polygon',
nativeCurrency: { name: 'Polygon Matic', symbol: 'MATIC', decimals: 18 },
rpcUrls: ['https://polygon-rpc.com/'],
},
])
})
it('should not disconnect while switching', () => {
const promise = createDeferredPromise()
cy.hardhat().then((hardhat) => {
// Reject network switch with CHAIN_NOT_ADDED
const sendStub = cy.stub(hardhat.provider, 'send').log(false).as('switch')
sendStub.withArgs('wallet_switchEthereumChain').returns(promise)
sendStub.callThrough() // allows other calls to return non-stubbed values
})
switchChain('Polygon')
// Verify there is no disconnection
cy.get('@switch').should('have.been.calledWith', 'wallet_switchEthereumChain')
cy.contains('Connecting to Polygon')
cy.get(getTestSelector('web3-status-connected')).should('be.disabled')
promise.resolve()
})
it('should switch networks', () => {
// Select an output currency
cy.get('#swap-currency-output .open-currency-select-button').click()
cy.contains('USDC').click()
// Populate input/output fields
cy.get('#swap-currency-input .token-amount-input').clear().type('1')
cy.get('#swap-currency-output .token-amount-input').should('not.equal', '')
// Switch network
switchChain('Polygon')
// Verify network switch
cy.wait('@wallet_switchEthereumChain')
waitsForActiveChain('Polygon')
cy.get(getTestSelector('web3-status-connected'))
// Verify that the input/output fields were reset
cy.get('#swap-currency-input .token-amount-input').should('have.value', '')
cy.get(`#swap-currency-input .token-symbol-container`).should('contain.text', 'MATIC')
cy.get(`#swap-currency-output .token-amount-input`).should('not.have.value')
cy.get(`#swap-currency-output .token-symbol-container`).should('contain.text', 'Select token')
})
})
describe('network switching from URL param', () => {
it('should switch network from URL param', () => {
cy.visit('/swap?chain=polygon', { ethereum: 'hardhat' })
cy.get(getTestSelector('web3-status-connected'))
cy.wait('@wallet_switchEthereumChain')
waitsForActiveChain('Polygon')
})
})

View File

@@ -1,51 +1,132 @@
import { getTestSelector } from '../utils'
describe('Wallet Dropdown', () => {
before(() => {
cy.visit('/pool')
function itChangesTheme() {
it('should change theme', () => {
cy.get(getTestSelector('theme-lightmode')).click()
cy.get(getTestSelector('theme-lightmode')).should('not.have.css', 'background-color', 'rgba(0, 0, 0, 0)')
cy.get(getTestSelector('theme-darkmode')).should('have.css', 'background-color', 'rgba(0, 0, 0, 0)')
cy.get(getTestSelector('theme-auto')).should('have.css', 'background-color', 'rgba(0, 0, 0, 0)')
cy.get(getTestSelector('theme-darkmode')).click()
cy.get(getTestSelector('theme-lightmode')).should('have.css', 'background-color', 'rgba(0, 0, 0, 0)')
cy.get(getTestSelector('theme-darkmode')).should('not.have.css', 'background-color', 'rgba(0, 0, 0, 0)')
cy.get(getTestSelector('theme-auto')).should('have.css', 'background-color', 'rgba(0, 0, 0, 0)')
cy.get(getTestSelector('theme-auto')).click()
cy.get(getTestSelector('theme-lightmode')).should('have.css', 'background-color', 'rgba(0, 0, 0, 0)')
cy.get(getTestSelector('theme-darkmode')).should('have.css', 'background-color', 'rgba(0, 0, 0, 0)')
cy.get(getTestSelector('theme-auto')).should('not.have.css', 'background-color', 'rgba(0, 0, 0, 0)')
})
}
function itChangesLocale() {
it('should change locale', () => {
cy.contains('Uniswap available in: English').should('not.exist')
cy.get(getTestSelector('wallet-language-item')).contains('Afrikaans').click({ force: true })
cy.location('hash').should('match', /\?lng=af-ZA$/)
cy.contains('Uniswap available in: English')
cy.get(getTestSelector('wallet-language-item')).contains('English').click({ force: true })
cy.location('hash').should('match', /\?lng=en-US$/)
cy.contains('Uniswap available in: English').should('not.exist')
})
}
describe('connected', () => {
beforeEach(() => {
cy.visit('/')
cy.get(getTestSelector('web3-status-connected')).click()
cy.get(getTestSelector('wallet-settings')).click()
})
itChangesTheme()
itChangesLocale()
})
it('should change the theme', () => {
cy.get(getTestSelector('web3-status-connected')).click()
cy.get(getTestSelector('wallet-select-theme')).click()
cy.get(getTestSelector('wallet-select-theme')).contains('Light theme').should('exist')
describe('testnet toggle', () => {
beforeEach(() => {
cy.visit('/swap')
})
it('should toggle testnet visibility', () => {
cy.get(getTestSelector('chain-selector')).last().click()
cy.get(getTestSelector('chain-selector-options')).should('not.contain.text', 'Sepolia')
cy.get(getTestSelector('web3-status-connected')).click()
cy.get(getTestSelector('wallet-settings')).click()
cy.get('#testnets-toggle').click()
cy.get(getTestSelector('close-account-drawer')).click()
cy.get(getTestSelector('chain-selector')).last().click()
cy.get(getTestSelector('chain-selector-options')).should('contain.text', 'Sepolia')
})
})
it('should select a language', () => {
cy.get(getTestSelector('wallet-select-language')).click()
cy.get(getTestSelector('wallet-language-item')).contains('Afrikaans').click({ force: true })
cy.get(getTestSelector('wallet-header')).should('contain', 'Taal')
cy.get(getTestSelector('wallet-language-item')).contains('English').click({ force: true })
cy.get(getTestSelector('wallet-header')).should('contain', 'Language')
cy.get(getTestSelector('wallet-back')).click()
describe('disconnected', () => {
beforeEach(() => {
cy.visit('/')
cy.get(getTestSelector('web3-status-connected')).click()
// click twice, first time to show confirmation, second to confirm
cy.get(getTestSelector('wallet-disconnect')).click()
cy.get(getTestSelector('wallet-disconnect')).should('contain', 'Disconnect')
cy.get(getTestSelector('wallet-disconnect')).click()
cy.get(getTestSelector('wallet-settings')).click()
})
itChangesTheme()
itChangesLocale()
})
it('should be able to view transactions', () => {
cy.get(getTestSelector('wallet-transactions')).click()
cy.get(getTestSelector('wallet-empty-transaction-text')).should('exist')
cy.get(getTestSelector('wallet-back')).click()
describe('with color theme', () => {
function visitSwapWithColorTheme({ dark }: { dark: boolean }) {
cy.visit('/swap', {
onBeforeLoad(win) {
cy.stub(win, 'matchMedia')
.withArgs('(prefers-color-scheme: dark)')
.returns({
matches: dark,
addEventListener() {
/* noop */
},
removeEventListener() {
/* noop */
},
})
},
})
}
it('should properly use dark system theme when auto theme setting is selected', () => {
visitSwapWithColorTheme({ dark: true })
cy.get(getTestSelector('web3-status-connected')).click()
cy.get(getTestSelector('wallet-settings')).click()
cy.get(getTestSelector('theme-auto')).click()
cy.get(getTestSelector('wallet-header')).should('have.css', 'color', 'rgb(152, 161, 192)')
})
it('should properly use light system theme when auto theme setting is selected', () => {
visitSwapWithColorTheme({ dark: false })
cy.get(getTestSelector('web3-status-connected')).click()
cy.get(getTestSelector('wallet-settings')).click()
cy.get(getTestSelector('theme-auto')).click()
cy.get(getTestSelector('wallet-header')).should('have.css', 'color', 'rgb(119, 128, 160)')
})
})
it('should change the theme when not connected', () => {
cy.get(getTestSelector('wallet-disconnect')).click()
cy.get(getTestSelector('wallet-select-theme')).click()
cy.get(getTestSelector('wallet-select-theme')).contains('Dark theme').should('exist')
cy.get(getTestSelector('wallet-select-theme')).click()
cy.get(getTestSelector('wallet-select-theme')).contains('Light theme').should('exist')
})
describe('mobile', () => {
beforeEach(() => {
cy.viewport('iphone-6').visit('/')
})
it('should select a language when not connected', () => {
cy.get(getTestSelector('wallet-select-language')).click()
cy.get(getTestSelector('wallet-language-item')).contains('Afrikaans').click({ force: true })
cy.get(getTestSelector('wallet-header')).should('contain', 'Taal')
cy.get(getTestSelector('wallet-language-item')).contains('English').click({ force: true })
cy.get(getTestSelector('wallet-header')).should('contain', 'Language')
cy.get(getTestSelector('wallet-back')).click()
})
it('should dismiss the wallet bottom sheet when clicking buy crypto', () => {
cy.get(getTestSelector('web3-status-connected')).click()
cy.get(getTestSelector('wallet-buy-crypto')).click()
cy.contains('Buy crypto').should('not.be.visible')
})
it('should open the wallet connect modal from the drop down when not connected', () => {
cy.get(getTestSelector('wallet-connect-wallet')).click()
cy.get(getTestSelector('wallet-modal')).should('exist')
cy.get(getTestSelector('wallet-modal-close')).click()
it('should use a bottom sheet and dismiss when on a mobile screen size', () => {
cy.get(getTestSelector('web3-status-connected')).click()
cy.root().click(15, 40)
cy.get(getTestSelector('wallet-settings')).should('not.be.visible')
})
})
})

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,20 +0,0 @@
const ONE_MINUTE = 60_000
describe(
'Release',
{
pageLoadTimeout: ONE_MINUTE,
retries: 30,
},
() => {
it('loads swap page', () => {
// We *must* wait in order to space out the retry attempts.
cy.wait(ONE_MINUTE)
.visit('/', {
retryOnStatusCodeFailure: true,
retryOnNetworkFailure: true,
})
.get('#swap-page')
})
}
)

View File

@@ -0,0 +1,19 @@
import { getTestSelector } from '../utils'
describe('translations', () => {
it('loads locale from the query param', () => {
cy.visit('/?lng=fr-FR')
cy.contains('Échanger')
cy.contains('Uniswap disponible en : English')
})
it('loads locale from menu', () => {
cy.visit('/')
cy.get(getTestSelector('web3-status-connected')).click()
cy.get(getTestSelector('wallet-settings')).click()
cy.get(getTestSelector('wallet-language-item')).contains('français').click({ force: true })
cy.location('hash').should('match', /\?lng=fr-FR$/)
cy.contains('Échanger')
cy.contains('Uniswap disponible en : English')
})
})

View File

@@ -0,0 +1,80 @@
import 'cypress-hardhat/lib/browser'
import { Eip1193Bridge } from '@ethersproject/experimental/lib/eip1193-bridge'
import { FeatureFlag } from '../../src/featureFlags'
import { UserState } from '../../src/state/user/reducer'
import { CONNECTED_WALLET_USER_STATE } from '../utils/user-state'
import { injected } from './ethereum'
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace Cypress {
interface ApplicationWindow {
ethereum: Eip1193Bridge
}
interface VisitOptions {
serviceWorker?: true
featureFlags?: Array<FeatureFlag>
/**
* The mock ethereum provider to inject into the page.
* @default 'goerli'
*/
// TODO(INFRA-175): Migrate all usage of 'goerli' to 'hardhat'.
ethereum?: 'goerli' | 'hardhat'
/**
* Initial user state.
* @default {@type import('../utils/user-state').CONNECTED_WALLET_USER_STATE}
*/
userState?: Partial<UserState>
}
}
}
// sets up the injected provider to be a mock ethereum provider with the given mnemonic/index
// eslint-disable-next-line no-undef
Cypress.Commands.overwrite(
'visit',
(original, url: string | Partial<Cypress.VisitOptions>, options?: Partial<Cypress.VisitOptions>) => {
if (typeof url !== 'string') throw new Error('Invalid arguments. The first argument to cy.visit must be the path.')
// Add a hash in the URL if it is not present (to use hash-based routing correctly with queryParams).
let hashUrl = url.startsWith('/') && url.length > 2 && !url.startsWith('/#') ? `/#${url}` : url
if (options?.ethereum === 'goerli') hashUrl += `${url.includes('?') ? '&' : '?'}chain=goerli`
return cy
.intercept('/service-worker.js', options?.serviceWorker ? undefined : { statusCode: 404 })
.provider()
.then((provider) =>
original({
...options,
url: hashUrl,
onBeforeLoad(win) {
options?.onBeforeLoad?.(win)
// We want to test from a clean state, so we clear the local storage (which clears redux).
win.localStorage.clear()
// Set initial user state.
win.localStorage.setItem(
'redux_localstorage_simple_user', // storage key for the user reducer using 'redux-localstorage-simple'
JSON.stringify({ ...CONNECTED_WALLET_USER_STATE, ...(options?.userState ?? {}) })
)
// Set feature flags, if configured.
if (options?.featureFlags) {
const featureFlags = options.featureFlags.reduce((flags, flag) => ({ ...flags, [flag]: 'enabled' }), {})
win.localStorage.setItem('featureFlags', JSON.stringify(featureFlags))
}
// Inject the mock ethereum provider.
if (options?.ethereum === 'hardhat') {
win.ethereum = provider
} else {
win.ethereum = injected
}
},
})
)
}
)

View File

@@ -5,81 +5,20 @@
// https://on.cypress.io/configuration
// ***********************************************************
// Import commands.ts using ES2015 syntax:
import { injected } from './ethereum'
import assert = require('assert')
import '@cypress/code-coverage/support'
import './commands'
import './setupTests'
import { FeatureFlag } from '../../src/featureFlags/flags/featureFlags'
// Squelch logs from fetches, as they clutter the logs so much as to make them unusable.
// See https://docs.cypress.io/api/commands/intercept#Disabling-logs-for-a-request.
// TODO(https://github.com/cypress-io/cypress/issues/26069): Squelch only wildcard logs once Cypress allows it.
const log = Cypress.log
Cypress.log = function (options, ...args) {
if (options.displayName === 'script' || options.name === 'request') return
return log(options, ...args)
} as typeof log
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace Cypress {
interface ApplicationWindow {
ethereum: typeof injected
}
interface VisitOptions {
serviceWorker?: true
featureFlags?: Array<FeatureFlag>
}
}
}
// sets up the injected provider to be a mock ethereum provider with the given mnemonic/index
// eslint-disable-next-line no-undef
Cypress.Commands.overwrite(
'visit',
(original, url: string | Partial<Cypress.VisitOptions>, options?: Partial<Cypress.VisitOptions>) => {
assert(typeof url === 'string')
cy.intercept('/service-worker.js', options?.serviceWorker ? undefined : { statusCode: 404 }).then(() => {
original({
...options,
url: (url.startsWith('/') && url.length > 2 && !url.startsWith('/#') ? `/#${url}` : url) + '?chain=goerli',
onBeforeLoad(win) {
options?.onBeforeLoad?.(win)
win.localStorage.clear()
win.localStorage.setItem('redux_localstorage_simple_user', '{"selectedWallet":"INJECTED"}')
if (options?.featureFlags) {
const featureFlags = options.featureFlags.reduce(
(flags, flag) => ({
...flags,
[flag]: 'enabled',
}),
{}
)
win.localStorage.setItem('featureFlags', JSON.stringify(featureFlags))
}
win.ethereum = injected
},
})
})
}
)
beforeEach(() => {
// Infura security policies are based on Origin headers.
// These are stripped by cypress because chromeWebSecurity === false; this adds them back in.
cy.intercept(/infura.io/, (res) => {
res.headers['origin'] = 'http://localhost:3000'
res.continue()
})
// Graphql security policies are based on Origin headers.
// These are stripped by cypress because chromeWebSecurity === false; this adds them back in.
cy.intercept('https://api.uniswap.org/v1/graphql', (res) => {
res.headers['origin'] = 'https://app.uniswap.org'
res.continue()
})
cy.intercept('https://beta.api.uniswap.org/v1/graphql', (res) => {
res.headers['origin'] = 'https://app.uniswap.org'
res.continue()
})
})
Cypress.on('uncaught:exception', (_err, _runnable) => {
// returning false here prevents Cypress from
// failing the test
Cypress.on('uncaught:exception', () => {
// returning false here prevents Cypress from failing the test
return false
})

View File

@@ -3,9 +3,9 @@
*/
import { Eip1193Bridge } from '@ethersproject/experimental/lib/eip1193-bridge'
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
import { JsonRpcProvider } from '@ethersproject/providers'
import { Wallet } from '@ethersproject/wallet'
import { ChainId } from '@uniswap/sdk-core'
// todo: figure out how env vars actually work in CI
// const TEST_PRIVATE_KEY = Cypress.env('INTEGRATION_TEST_PRIVATE_KEY')
@@ -13,11 +13,13 @@ const TEST_PRIVATE_KEY = '0xe580410d7c37d26c6ad1a837bbae46bc27f9066a466fb3a66e77
// address of the above key
const TEST_ADDRESS_NEVER_USE = new Wallet(TEST_PRIVATE_KEY).address
const CHAIN_ID = ChainId.GOERLI
const HEXLIFIED_CHAIN_ID = `0x${CHAIN_ID.toString(16)}`
const provider = new JsonRpcProvider('https://goerli.infura.io/v3/4bf032f2d38a4ed6bb975b80d6340847', 4)
const provider = new JsonRpcProvider('https://goerli.infura.io/v3/4bf032f2d38a4ed6bb975b80d6340847', 5)
const signer = new Wallet(TEST_PRIVATE_KEY, provider)
export const injected = new (class extends Eip1193Bridge {
chainId = /* GOERLI= */ 5
chainId = CHAIN_ID
async sendAsync(...args: any[]) {
console.debug('sendAsync called', ...args)
@@ -46,9 +48,9 @@ export const injected = new (class extends Eip1193Bridge {
}
if (method === 'eth_chainId') {
if (isCallbackForm) {
callback(null, { result: '0x4' })
callback(null, { result: HEXLIFIED_CHAIN_ID })
} else {
return Promise.resolve('0x4')
return Promise.resolve(HEXLIFIED_CHAIN_ID)
}
}
try {

View File

@@ -0,0 +1,63 @@
// @ts-ignore
import TokenListJSON from '@uniswap/default-token-list'
import { CyHttpMessages } from 'cypress/types/net-stubbing'
beforeEach(() => {
// Many API calls enforce that requests come from our app, so we must mock Origin and Referer.
cy.intercept('*', (req) => {
req.headers['referer'] = 'https://app.uniswap.org'
req.headers['origin'] = 'https://app.uniswap.org'
})
// Infura uses a test endpoint, which allow-lists http://localhost:3000 instead.
cy.intercept(/infura.io/, (req) => {
req.headers['referer'] = 'http://localhost:3000'
req.headers['origin'] = 'http://localhost:3000'
req.alias = req.body.method
req.continue()
})
// Log requests to hardhat.
cy.intercept(/:8545/, logJsonRpc)
// Mock analytics responses to avoid analytics in tests.
cy.intercept('https://api.uniswap.org/v1/amplitude-proxy', (req) => {
const requestBody = JSON.stringify(req.body)
const byteSize = new Blob([requestBody]).size
req.reply(
JSON.stringify({
code: 200,
server_upload_time: Date.now(),
payload_size_bytes: byteSize,
events_ingested: req.body.events.length,
})
)
}).intercept('https://*.sentry.io', { statusCode: 200 })
// Mock our own token list responses to avoid the latency of IPFS.
cy.intercept('https://gateway.ipfs.io/ipns/tokens.uniswap.org', TokenListJSON)
.intercept('https://gateway.ipfs.io/ipns/extendedtokens.uniswap.org', { statusCode: 404 })
.intercept('https://gateway.ipfs.io/ipns/unsupportedtokens.uniswap.org', { statusCode: 404 })
// Reset hardhat between tests to ensure isolation.
// This resets the fork, as well as options like automine.
cy.hardhat().then((hardhat) => hardhat.reset())
})
function logJsonRpc(req: CyHttpMessages.IncomingHttpRequest) {
req.alias = req.body.method
const log = Cypress.log({
autoEnd: false,
name: req.body.method,
message: req.body.params?.map((param: unknown) =>
typeof param === 'object' ? '{...}' : param?.toString().substring(0, 10)
),
})
req.on('after:response', (res) => {
if (res.statusCode === 200) {
log.end()
} else {
log.error(new Error(`${res.statusCode}: ${res.statusMessage}`))
}
})
}

View File

@@ -1,9 +1,18 @@
{
"compilerOptions": {
"esModuleInterop": true,
"incremental": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"noEmit": true,
"strict": true,
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress"]
"target": "ES5",
"tsBuildInfoFile": "../node_modules/.cache/tsbuildinfo/cypress", // avoid clobbering the build tsbuildinfo
"types": ["cypress", "node"],
"jsx": "react"
},
"include": ["**/*.ts"]
"exclude": ["node_modules"],
"include": ["**/*.ts"],
"watchOptions": {
"excludeDirectories": ["node_modules"]
}
}

View File

@@ -1,7 +1,7 @@
// Utility to match GraphQL mutation based on the query name
export const hasQuery = (req: any, queryName: string) => {
const { body } = req
return body.hasOwnProperty('query') && body.query.includes(queryName)
return Object.prototype.hasOwnProperty.call(body, 'query') && body.query.includes(queryName)
}
// Alias query if queryName matches

View File

@@ -1,3 +1,13 @@
import { Currency } from '@uniswap/sdk-core'
export const getTestSelector = (selectorId: string) => `[data-testid=${selectorId}]`
export const getTestSelectorStartsWith = (selectorId: string) => `[data-testid^=${selectorId}]`
/** Gets the balance of a token as a Chainable. */
export function getBalance(token: Currency) {
return cy
.hardhat()
.then((hardhat) => hardhat.getBalance(hardhat.wallet, token))
.then((balance) => Number(balance.toFixed(1)))
}

View File

@@ -0,0 +1,5 @@
import { UserState } from '../../src/state/user/reducer'
export const CONNECTED_WALLET_USER_STATE: Partial<UserState> = { selectedWallet: 'INJECTED' }
export const DISCONNECTED_WALLET_USER_STATE: Partial<UserState> = { selectedWallet: undefined }

View File

@@ -0,0 +1,44 @@
/* eslint-env node */
module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Enforce the use of optional object fields',
category: 'Best Practices',
recommended: true,
},
fixable: 'code',
schema: [],
},
create(context) {
return {
'TSPropertySignature > TSTypeAnnotation > TSUnionType': (node) => {
const types = node.types
const hasUndefined = types.some((typeNode) => typeNode.type === 'TSUndefinedKeyword')
if (hasUndefined) {
const typesWithoutUndefined = types.filter((typeNode) => typeNode.type !== 'TSUndefinedKeyword')
// If there is more than one type left after removing 'undefined',
// join them together with ' | ' to create a new union type.
const newTypeSource =
typesWithoutUndefined.length > 1
? typesWithoutUndefined.map((typeNode) => context.getSourceCode().getText(typeNode)).join(' | ')
: context.getSourceCode().getText(typesWithoutUndefined[0])
context.report({
node,
message: `Prefer optional properties to "Type | undefined".`,
fix(fixer) {
const propertySignature = node.parent.parent
const isAlreadyOptional = propertySignature.optional
const newTypeAnnotation = isAlreadyOptional ? `: ${newTypeSource}` : `?: ${newTypeSource}`
return fixer.replaceText(node.parent, newTypeAnnotation)
},
})
}
},
}
},
}

View File

@@ -1,22 +0,0 @@
/* eslint-disable */
require('dotenv').config({ path: '.env.production' })
const { exec } = require('child_process')
const dataConfig = require('./relay.config')
const thegraphConfig = require('./relay_thegraph.config')
/* eslint-enable */
function fetchSchema(url, outputFile) {
exec(
`get-graphql-schema --h Origin=https://app.uniswap.org ${url} | tee ${outputFile}.temp`,
(error, stdout, stderr) => {
if (error || stderr) {
console.log(`Failed to fetch schema from ${url}`)
} else if (stdout) {
exec(`mv ${outputFile}.temp ${outputFile}`)
}
}
)
}
fetchSchema(process.env.THE_GRAPH_SCHEMA_ENDPOINT, thegraphConfig.schema)
fetchSchema(process.env.REACT_APP_AWS_API_ENDPOINT, dataConfig.schema)

View File

@@ -0,0 +1 @@
export const presets = ['@babel/preset-env']

View File

@@ -0,0 +1,9 @@
import { setup } from 'jest-dev-server'
module.exports = async function globalSetup() {
globalThis.servers = await setup({
command: `yarn start:cloud`,
port: 3000,
launchTimeout: 50000,
})
}

View File

@@ -0,0 +1,5 @@
import { teardown } from 'jest-dev-server'
module.exports = async function globalTeardown() {
await teardown(globalThis.servers)
}

6
functions/global.d.ts vendored Normal file
View File

@@ -0,0 +1,6 @@
import { setup } from 'jest-dev-server'
declare global {
// eslint-disable-next-line no-var
var servers: Awaited<ReturnType<typeof setup>>
}

View File

@@ -0,0 +1,9 @@
{
"globalSetup": "<rootDir>/global-setup.ts",
"globalTeardown": "<rootDir>/global-teardown.ts",
"preset": "ts-jest",
"transform": {
"'^.+\\.(ts|tsx)?$'": "ts-jest",
"^.+\\.(js|jsx)$": "babel-jest"
}
}

3
functions/nft.test.ts Normal file
View File

@@ -0,0 +1,3 @@
test('example', async () => {
expect(true).toBe(true)
})

19
functions/tsconfig.json Normal file
View File

@@ -0,0 +1,19 @@
{
"compilerOptions": {
"esModuleInterop": true,
"incremental": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"noEmit": true,
"strict": true,
"target": "ES6",
"tsBuildInfoFile": "../node_modules/.cache/tsbuildinfo/functions", // avoid clobbering the build tsbuildinfo
"types": ["jest", "node"],
"jsx": "react",
"moduleResolution": "NodeNext",
},
"exclude": ["node_modules"],
"include": ["**/*.ts"],
"watchOptions": {
"excludeDirectories": ["node_modules"]
}
}

View File

@@ -0,0 +1,26 @@
/* eslint-env node */
import type { CodegenConfig } from '@graphql-codegen/cli'
// Generates TS objects from the schemas returned by graphql queries
// To learn more: https://www.apollographql.com/docs/react/development-testing/static-typing/#setting-up-your-project
const config: CodegenConfig = {
overwrite: true,
schema: './src/graphql/data/schema.graphql',
documents: ['./src/graphql/data/**', '!./src/graphql/data/__generated__/**', '!**/thegraph/**'],
generates: {
'src/graphql/data/__generated__/types-and-hooks.ts': {
plugins: ['typescript', 'typescript-operations', 'typescript-react-apollo'],
config: {
withHooks: true,
// This avoid all generated schemas being wrapped in Maybe https://the-guild.dev/graphql/codegen/plugins/typescript/typescript#maybevalue-string-default-value-t--null
maybeValue: 'T',
immutableTypes: true,
},
},
},
}
// This is used in package.json when generating apollo schemas however the linter stills flags this as unused
// eslint-disable-next-line import/no-unused-modules
export default config

View File

@@ -1,3 +1,5 @@
/* eslint-env node */
module.exports = {
src: './src',
language: 'typescript',

View File

@@ -0,0 +1,25 @@
/* eslint-env node */
import type { CodegenConfig } from '@graphql-codegen/cli'
// Generates TS objects from the schemas returned by graphql queries
// To learn more: https://www.apollographql.com/docs/react/development-testing/static-typing/#setting-up-your-project
const config: CodegenConfig = {
overwrite: true,
schema: './src/graphql/thegraph/schema.graphql',
documents: ['!./src/graphql/data/**', '!./src/graphql/thegraph/__generated__/**', './src/graphql/thegraph/**'],
generates: {
'src/graphql/thegraph/__generated__/types-and-hooks.ts': {
plugins: ['typescript', 'typescript-operations', 'typescript-react-apollo'],
config: {
withHooks: true,
// This avoid all generated schemas being wrapped in Maybe https://the-guild.dev/graphql/codegen/plugins/typescript/typescript#maybevalue-string-default-value-t--null
maybeValue: 'T',
},
},
},
}
// This is used in package.json when generating apollo schemas however the linter stills flags this as unused
// eslint-disable-next-line import/no-unused-modules
export default config

View File

@@ -1,5 +1,6 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const defaultConfig = require('./relay.config')
/* eslint-env node */
const defaultConfig = require('./graphql.data.config')
module.exports = {
src: defaultConfig.src,

46
hardhat.config.js Normal file
View File

@@ -0,0 +1,46 @@
import { ChainId } from '@uniswap/sdk-core'
/* eslint-env node */
require('dotenv').config()
// Block selection is arbitrary, as e2e tests will build up their own state.
// The only requirement is that all infrastructure under test (eg Permit2 contracts) are already deployed.
// TODO(WEB-2187): Make more dynamic to avoid manually updating
const BLOCK_NUMBER = 17388567
const POLYGON_BLOCK_NUMBER = 43600000
const forkingConfig = {
httpHeaders: {
Origin: 'localhost:3000', // infura allowlists requests by origin
},
}
const forks = {
[ChainId.MAINNET]: {
url: `https://mainnet.infura.io/v3/${process.env.REACT_APP_INFURA_KEY}`,
blockNumber: BLOCK_NUMBER,
...forkingConfig,
},
[ChainId.POLYGON]: {
url: `https://polygon-mainnet.infura.io/v3/${process.env.REACT_APP_INFURA_KEY}`,
blockNumber: POLYGON_BLOCK_NUMBER,
...forkingConfig,
},
}
module.exports = {
forks,
networks: {
hardhat: {
chainId: ChainId.MAINNET,
forking: forks[ChainId.MAINNET],
accounts: {
count: 2,
},
mining: {
auto: true, // automine to make tests easier to write.
interval: 0, // do not interval mine so that tests remain deterministic
},
},
},
}

View File

@@ -1,8 +1,77 @@
/* eslint-env node */
import { default as babelExtractor } from '@lingui/cli/api/extractors/babel'
import { createHash } from 'crypto'
import { mkdirSync, readFileSync, writeFileSync } from 'fs'
import { existsSync } from 'fs'
import * as path from 'path'
/** A custom caching extractor built on top of babelExtractor. */
const cachingExtractor: typeof babelExtractor = {
/** Delegates to babelExtractor.match. */
match(filename: string) {
return babelExtractor.match(filename)
},
/**
* Checks a cache before extraction, only delegating to babelExtractor.extract if the file has changed.
*
* The lingui extractor works by extracting JSON (the catalog) from `filename` to `buildDir/filename.json`.
* Caching works by man-in-the-middling this:
* - File freshness is computed as a hash of `filename` contents.
* - Before extracting, we check the cache to see if we already have a fresh catalog for the file.
* If we do, we copy it to `localeDir/filename.json`. Copying is significantly faster than extracting.
* - After extracting, we copy the catalog to the cache.
*/
extract(filename: string, localeDir: string, ...options: unknown[]) {
// This runs from node_modules/@lingui/conf, so we need to back out to the root.
const root = __dirname.split('/node_modules')[0]
// This logic mimics catalogFilename in @lingui/babel-plugin-extract-messages.
const buildDir = path.join(localeDir, '_build')
const localePath = path.join(buildDir, filename + '.json')
const filePath = path.join(root, filename)
const fileHash = createHash('sha256').update(readFileSync(filePath)).digest('hex')
const cacheRoot = path.join(root, 'node_modules/.cache/lingui')
const cachePath = path.join(cacheRoot, filename + '.json')
// If we have a matching cached copy of the catalog, we can copy it to localePath and return early.
if (existsSync(cachePath)) {
const { hash, catalog } = JSON.parse(readFileSync(cachePath, 'utf8'))
if (hash === fileHash) {
if (catalog) {
mkdirSync(path.dirname(localePath), { recursive: true })
writeFileSync(localePath, JSON.stringify(catalog, null, 2))
}
return
}
}
babelExtractor.extract(filename, localeDir, ...options)
// Cache the extracted catalog.
mkdirSync(path.dirname(cachePath), { recursive: true })
if (existsSync(localePath)) {
const catalog = JSON.parse(readFileSync(localePath, 'utf8'))
writeFileSync(cachePath, JSON.stringify({ hash: fileHash, catalog }))
} else {
writeFileSync(cachePath, JSON.stringify({ hash: fileHash }))
}
},
}
const linguiConfig = {
catalogs: [
{
path: '<rootDir>/src/locales/{locale}',
include: ['<rootDir>/src'],
include: ['<rootDir>/src/**/*.ts', '<rootDir>/src/**/*.tsx'],
exclude: [
'<rootDir>/src/**/*.d.ts',
'<rootDir>/src/**/*.test.*',
'<rootDir>/src/types/v3/**',
'<rootDir>/src/abis/types/**',
'<rootDir>/src/graphql/**/__generated__/**',
],
},
],
compileNamespace: 'cjs',
@@ -46,13 +115,12 @@ const linguiConfig = {
'vi-VN',
'zh-CN',
'zh-TW',
'pseudo',
],
orderBy: 'messageId',
rootDir: '.',
runtimeConfigModule: ['@lingui/core', 'i18n'],
sourceLocale: 'en-US',
pseudoLocale: 'pseudo',
extractors: [cachingExtractor],
}
export default linguiConfig

View File

@@ -1,42 +1,50 @@
{
"name": "@uniswap/interface",
"version": "1.0.7",
"version": "1.1.0",
"description": "Uniswap Interface",
"homepage": ".",
"license": "GPL-3.0-or-later",
"scripts": {
"ajv": "node scripts/compile-ajv-validators.js",
"contracts:compile:abi": "typechain --target ethers-v5 --out-dir src/abis/types \"./src/abis/**/*.json\"",
"contracts:compile:v3": "typechain --target ethers-v5 --out-dir src/types/v3 \"./node_modules/@uniswap/**/artifacts/contracts/**/*[!dbg].json\"",
"contracts:compile": "yarn contracts:compile:abi && yarn contracts:compile:v3",
"relay": "relay-compiler relay.config.js",
"relay-thegraph": "relay-compiler relay_thegraph.config.js",
"graphql:fetch": "node fetch-schema.js",
"graphql:generate": "yarn relay && yarn relay-thegraph",
"prei18n:extract": "node prei18n-extract.js",
"contracts": "yarn contracts:compile:abi && yarn contracts:compile:v3",
"graphql:fetch": "node scripts/fetch-schema.js",
"graphql:generate:data": "graphql-codegen --config graphql.data.codegen.config.ts",
"graphql:generate:thegraph": "graphql-codegen --config graphql.thegraph.codegen.config.ts",
"graphql:generate": "yarn graphql:generate:data && yarn graphql:generate:thegraph",
"graphql": "yarn graphql:fetch && yarn graphql:generate",
"i18n:extract": "lingui extract --locale en-US",
"i18n:compile": "yarn i18n:extract && lingui compile",
"i18n:pseudo": "lingui extract --locale pseudo && lingui compile",
"prepare": "yarn contracts:compile && yarn graphql:fetch && yarn graphql:generate && yarn i18n:compile",
"i18n:compile": "lingui compile",
"i18n": "yarn i18n:extract --clean && yarn i18n:compile",
"prepare": "concurrently \"npm:ajv\" \"npm:contracts\" \"npm:graphql\" \"npm:i18n\"",
"start": "craco start",
"start:cloud": "NODE_OPTIONS=--dns-result-order=ipv4first PORT=3001 npx wrangler pages dev --proxy=3001 --port=3000 -- yarn start",
"build": "craco build",
"build:e2e": "REACT_APP_CSP_ALLOW_UNSAFE_EVAL=true REACT_APP_ADD_COVERAGE_INSTRUMENTATION=true craco build",
"analyze": "source-map-explorer 'build/static/js/*.js' --only-mapped",
"serve": "serve build -l 3000",
"deduplicate": "yarn-deduplicate --strategy=highest",
"lint": "yarn eslint .",
"test": "craco test --coverage",
"lint": "yarn eslint --ignore-path .gitignore --cache --cache-location node_modules/.cache/eslint/ .",
"typecheck": "tsc",
"test": "craco test",
"test:cloud": "NODE_OPTIONS=--experimental-vm-modules yarn jest functions --watch --config=functions/jest.config.json",
"cypress:open": "cypress open --browser chrome --e2e",
"cypress:run": "cypress run --browser chrome --e2e",
"postinstall": "patch-package"
"deduplicate": "yarn-deduplicate --strategy=highest"
},
"jest": {
"collectCoverageFrom": [
"src/components/**/*.ts*",
"src/hooks/**/*.ts*",
"src/lib/hooks/**/*.ts*",
"src/lib/state/**/*.ts*",
"src/lib/utils/**/*.ts*",
"src/pages/**/*.ts*",
"src/state/**/*.ts*",
"src/utils/**/*.ts*"
"src/**/*.ts*",
"!src/**/*.d.ts",
"!src/abis/types/**",
"!src/constants/**/*.ts",
"!src/graphql/**/__generated__/**",
"!src/locales/**",
"!src/test-utils/**",
"!src/types/v3/**"
],
"coveragePathIgnorePatterns": [
".snap"
],
"coverageThreshold": {
"global": {
@@ -60,11 +68,14 @@
]
},
"devDependencies": {
"@craco/craco": "6.4.3",
"@babel/preset-env": "^7.22.7",
"@cloudflare/workers-types": "^4.20230518.0",
"@craco/craco": "^7.1.0",
"@ethersproject/experimental": "^5.4.0",
"@lingui/cli": "^3.9.0",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.1",
"@testing-library/user-event": "^14.4.3",
"@typechain/ethers-v5": "^7.0.0",
"@types/array.prototype.flat": "^1.2.1",
"@types/array.prototype.flatmap": "^1.2.2",
@@ -87,76 +98,93 @@
"@types/rebass": "^4.0.7",
"@types/styled-components": "^5.1.25",
"@types/testing-library__cypress": "^5.0.5",
"@types/ua-parser-js": "^0.7.35",
"@types/ua-parser-js": "^0.7.36",
"@types/uuid": "^8.3.4",
"@types/wcag-contrast": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^4",
"@typescript-eslint/parser": "^4",
"@uniswap/default-token-list": "^11.2.0",
"@uniswap/eslint-config": "^1.2.0",
"@vanilla-extract/babel-plugin": "^1.1.7",
"@vanilla-extract/jest-transform": "^1.1.1",
"@vanilla-extract/webpack-plugin": "^2.1.11",
"babel-plugin-relay": "^14.1.0",
"cypress": "^10.3.1",
"@walletconnect/types": "^2.8.6",
"babel-jest": "^29.6.1",
"babel-plugin-istanbul": "^6.1.1",
"buffer": "^6.0.3",
"concurrently": "^8.0.1",
"cypress": "12.12.0",
"cypress-hardhat": "^2.4.2",
"env-cmd": "^10.1.0",
"eslint": "^7.11.0",
"eslint-config-prettier": "^6.11.0",
"eslint-import-resolver-typescript": "^3.5.2",
"eslint-plugin-better-styled-components": "^1.1.2",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-plugin-unused-imports": "^2.0.0",
"eslint-plugin-import": "^2.27",
"eslint-plugin-rulesdir": "^0.2.2",
"hardhat": "^2.14.0",
"jest": "^29.6.1",
"jest-dev-server": "^9.0.0",
"jest-fail-on-console": "^3.1.1",
"jest-fetch-mock": "^3.0.3",
"jest-styled-components": "^7.0.8",
"ms.macro": "^2.0.0",
"patch-package": "^6.4.7",
"postinstall-postinstall": "^2.1.0",
"prettier": "^2.7.1",
"react-scripts": "^4.0.3",
"relay-compiler": "^14.1.0",
"path-browserify": "^1.0.1",
"prettier": "^2.8.8",
"process": "^0.11.10",
"react-scripts": "^5.0.1",
"resize-observer-polyfill": "^1.5.1",
"serve": "^11.3.2",
"source-map-explorer": "^2.5.3",
"ts-jest": "^29.1.1",
"ts-transform-graphql-tag": "^0.2.1",
"typechain": "^5.0.0",
"typescript": "^4.4.3",
"wrangler": "https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/4925945367/npm-package-wrangler-3048",
"webpack-retry-chunk-load-plugin": "^3.1.1",
"yarn-deduplicate": "^6.0.0"
},
"dependencies": {
"@coinbase/wallet-sdk": "^3.3.0",
"@apollo/client": "^3.7.2",
"@coinbase/wallet-sdk": "^3.6.4",
"@cypress/code-coverage": "^3.10.0",
"@fontsource/ibm-plex-mono": "^4.5.1",
"@fontsource/inter": "^4.5.1",
"@graphql-codegen/cli": "^2.15.0",
"@graphql-codegen/client-preset": "^1.2.1",
"@graphql-codegen/typescript": "^2.8.3",
"@graphql-codegen/typescript-operations": "^2.5.8",
"@graphql-codegen/typescript-react-apollo": "^3.3.7",
"@graphql-codegen/typescript-resolvers": "^2.7.8",
"@juggle/resize-observer": "^3.4.0",
"@lingui/core": "^3.14.0",
"@lingui/macro": "^3.14.0",
"@lingui/react": "^3.14.0",
"@looksrare/sdk": "^0.10.2",
"@metamask/jazzicon": "^2.0.0",
"@opensea/seaport-js": "^1.0.2",
"@opensea/seaport-js": "^1.2.0",
"@popperjs/core": "^2.4.4",
"@reach/dialog": "^0.10.3",
"@reach/portal": "^0.10.3",
"@react-hook/window-scroll": "^1.3.0",
"@reduxjs/toolkit": "^1.6.1",
"@sentry/react": "7.20.1",
"@types/react-relay": "^13.0.2",
"@sentry/react": "^7.45.0",
"@sentry/tracing": "^7.45.0",
"@sentry/types": "^7.45.0",
"@types/react-window-infinite-loader": "^1.0.6",
"@uniswap/analytics": "1.2.0",
"@uniswap/analytics-events": "1.3.1",
"@uniswap/conedison": "^1.1.0",
"@uniswap/analytics": "^1.3.1",
"@uniswap/analytics-events": "^2.13.0",
"@uniswap/conedison": "^1.7.1",
"@uniswap/governance": "^1.0.2",
"@uniswap/liquidity-staker": "^1.0.2",
"@uniswap/merkle-distributor": "1.0.1",
"@uniswap/permit2-sdk": "1.2.0",
"@uniswap/redux-multicall": "^1.1.8",
"@uniswap/router-sdk": "^1.3.0",
"@uniswap/sdk-core": "^3.0.1",
"@uniswap/smart-order-router": "^2.10.0",
"@uniswap/token-lists": "^1.0.0-beta.30",
"@uniswap/universal-router-sdk": "1.3.0",
"@uniswap/sdk-core": "^3.2.6",
"@uniswap/smart-order-router": "3.13.5",
"@uniswap/token-lists": "^1.0.0-beta.31",
"@uniswap/universal-router-sdk": "^1.5.3",
"@uniswap/v2-core": "1.0.0",
"@uniswap/v2-periphery": "^1.1.0-beta.0",
"@uniswap/v2-sdk": "^3.0.1",
"@uniswap/v3-core": "1.0.0",
"@uniswap/v3-periphery": "^1.1.1",
"@uniswap/v3-sdk": "^3.9.0",
"@uniswap/widgets": "2.22.11",
"@vanilla-extract/css": "^1.7.2",
"@vanilla-extract/css-utils": "^0.1.2",
"@vanilla-extract/dynamic": "^2.0.2",
@@ -168,25 +196,25 @@
"@visx/react-spring": "^2.12.2",
"@visx/responsive": "^2.10.0",
"@visx/shape": "^2.11.1",
"@walletconnect/ethereum-provider": "^1.8.0",
"@web3-react/coinbase-wallet": "8.0.34-beta.0",
"@web3-react/core": "8.0.35-beta.0",
"@web3-react/eip1193": "8.0.26-beta.0",
"@web3-react/empty": "8.0.20-beta.0",
"@web3-react/gnosis-safe": "8.0.7-beta.0",
"@web3-react/metamask": "8.0.28-beta.0",
"@web3-react/network": "8.0.27-beta.0",
"@web3-react/types": "8.0.20-beta.0",
"@web3-react/url": "8.0.25-beta.0",
"@web3-react/walletconnect": "8.0.36-beta.0",
"@web3-react/coinbase-wallet": "^8.2.0",
"@web3-react/core": "^8.2.0",
"@web3-react/eip1193": "^8.2.0",
"@web3-react/empty": "^8.2.0",
"@web3-react/gnosis-safe": "^8.2.1",
"@web3-react/metamask": "^8.2.0",
"@web3-react/network": "^8.2.0",
"@web3-react/types": "^8.2.0",
"@web3-react/url": "^8.2.0",
"@web3-react/walletconnect-v2": "^8.3.7",
"ajv": "^8.11.0",
"ajv-formats": "^2.1.1",
"array.prototype.flat": "^1.2.4",
"array.prototype.flatmap": "^1.2.4",
"cids": "^1.0.0",
"clsx": "^1.1.1",
"copy-to-clipboard": "^3.2.0",
"d3": "^7.6.1",
"ethers": "^5.1.4",
"firebase": "^9.1.3",
"ethers": "^5.7.2",
"focus-visible": "^5.2.0",
"get-graphql-schema": "^2.1.2",
"graphql": "^16.5.0",
@@ -202,7 +230,7 @@
"numbro": "^2.3.6",
"polished": "^3.3.2",
"polyfill-object.fromentries": "^1.0.1",
"popper-max-size-modifier": "^0.2.0",
"qrcode.react": "^3.1.0",
"qs": "^6.9.4",
"rc-slider": "^10.0.1",
"react": "^18.2.0",
@@ -215,8 +243,6 @@
"react-popper": "^2.2.3",
"react-query": "^3.39.1",
"react-redux": "^8.0.2",
"react-relay": "^14.1.0",
"react-relay-network-modern": "^6.2.1",
"react-router-dom": "^6.3.0",
"react-spring": "^9.5.5",
"react-table": "^7.8.0",
@@ -227,12 +253,11 @@
"rebass": "^4.0.7",
"redux": "^4.1.2",
"redux-localstorage-simple": "^2.3.1",
"setimmediate": "^1.0.5",
"statsig-react": "^1.22.0",
"styled-components": "^5.3.5",
"tiny-invariant": "^1.2.0",
"ua-parser-js": "^0.7.28",
"use-count-up": "^2.2.5",
"use-resize-observer": "^9.0.2",
"ua-parser-js": "^1.0.35",
"use-resize-observer": "^9.1.0",
"uuid": "^8.3.2",
"video-extensions": "^1.2.0",
"wcag-contrast": "^3.0.0",
@@ -241,11 +266,11 @@
"workbox-navigation-preload": "^6.1.0",
"workbox-precaching": "^6.1.0",
"workbox-routing": "^6.1.0",
"zustand": "^4.0.0-rc.1"
"zustand": "^4.3.6"
},
"engines": {
"npm": "please-use-yarn",
"node": "14",
"node": "18.x",
"yarn": ">=1.22"
}
}

View File

@@ -1,22 +0,0 @@
diff --git a/node_modules/@vanilla-extract/css/dist/vanilla-extract-css.cjs.dev.js b/node_modules/@vanilla-extract/css/dist/vanilla-extract-css.cjs.dev.js
index 6e40061..10283a2 100644
--- a/node_modules/@vanilla-extract/css/dist/vanilla-extract-css.cjs.dev.js
+++ b/node_modules/@vanilla-extract/css/dist/vanilla-extract-css.cjs.dev.js
@@ -177,11 +177,13 @@ function generateIdentifier(debugId) {
var fileScopeHash = hash__default["default"](packageName ? "".concat(packageName).concat(filePath) : filePath);
var identifier = "".concat(fileScopeHash).concat(refCount);
- if (adapter_dist_vanillaExtractCssAdapter.getIdentOption() === 'debug') {
- var devPrefix = getDevPrefix(debugId);
+ if (process.env.VANILLA_EXTRACT_DEV_PREFIX) {
+ if (adapter_dist_vanillaExtractCssAdapter.getIdentOption() === 'debug') {
+ var devPrefix = getDevPrefix(debugId);
- if (devPrefix) {
- identifier = "".concat(devPrefix, "__").concat(identifier);
+ if (devPrefix) {
+ identifier = "".concat(devPrefix, "__").concat(identifier);
+ }
}
}

View File

@@ -1,9 +0,0 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { exec } = require('child_process')
const isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE)
if (isWindows) {
exec(`type nul > src/locales/en-US.po`)
} else {
exec(`touch src/locales/en-US.po`)
}

1
public/CODEOWNERS Normal file
View File

@@ -0,0 +1 @@
@uniswap/web-admins

View File

@@ -18,17 +18,25 @@
<meta name="theme-color" content="#FC72FF" />
<meta
http-equiv="Content-Security-Policy"
content="script-src 'self' https://www.google-analytics.com https://www.googletagmanager.com 'unsafe-inline'"
<% if (process.env.REACT_APP_CSP_ALLOW_UNSAFE_EVAL) { %>
content="script-src 'self' 'unsafe-inline' 'unsafe-eval'"
<% } else { %>
content="script-src 'self' 'unsafe-inline'"
<% } %>
/>
<!--
Apple Smart App Banner for Safari on iOS
https://developer.apple.com/documentation/webkit/promoting_apps_with_smart_app_banners
-->
<meta name="apple-itunes-app" content="app-id=6443944476">
<!--
manifest.json provides metadata used when the app is installed as a PWA.
See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="preconnect" href="https://www.google-analytics.com/" />
<link rel="preload" href="%PUBLIC_URL%/fonts/Inter-roman.var.woff2" as="font" type="font/woff2" crossorigin />
<style>
@@ -76,8 +84,8 @@
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
/* Use this to apply network-specific gradient backgrounds, in RadialGradientByChainUpdater.ts */
#background-radial-gradient {
background: linear-gradient(180deg, #202738 0%, #070816 100%);
position: fixed;
top: 0;
left: 0;
@@ -97,13 +105,13 @@
@media (prefers-color-scheme: dark) {
html {
background-color: #212429;
background: linear-gradient(180deg, #202738 0%, #070816 100%);
}
}
@media (prefers-color-scheme: light) {
html {
background-color: #f7f8fa;
background: radial-gradient(100% 100% at 50% 0%, rgba(255, 184, 226, 0.51) 0%, rgba(255, 255, 255, 0) 100%), #FFFFFF
}
}
</style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

View File

@@ -1,3 +0,0 @@
<svg width="29" height="28" viewBox="0 0 29 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.74219 20.29C6.74219 22.1885 7.71777 23.1729 9.59863 23.1729H18.959C20.8398 23.1729 21.8154 22.1885 21.8154 20.29V7.02734C21.8154 5.1377 20.8398 4.14453 18.959 4.14453H9.59863C7.71777 4.14453 6.74219 5.1377 6.74219 7.02734V20.29ZM8.46484 20.1846V7.13281C8.46484 6.31543 8.88672 5.86719 9.73926 5.86719H18.8096C19.6621 5.86719 20.0928 6.31543 20.0928 7.13281V20.1846C20.0928 21.002 19.6621 21.4502 18.8096 21.4502H9.73926C8.88672 21.4502 8.46484 21.002 8.46484 20.1846ZM10.5391 9.16309C10.9961 9.16309 11.3564 8.79395 11.3564 8.3457C11.3564 7.88867 10.9961 7.52832 10.5391 7.52832C10.0908 7.52832 9.72168 7.89746 9.72168 8.3457C9.72168 8.79395 10.0908 9.16309 10.5391 9.16309ZM12.9561 8.91699H18.2646C18.5811 8.91699 18.8359 8.66211 18.8359 8.3457C18.8359 8.0293 18.5811 7.77441 18.2646 7.77441H12.9561C12.6396 7.77441 12.3848 8.0293 12.3848 8.3457C12.3848 8.66211 12.6396 8.91699 12.9561 8.91699ZM10.5391 11.7822C10.9961 11.7822 11.3564 11.4131 11.3564 10.9648C11.3564 10.5078 10.9961 10.1562 10.5391 10.1562C10.082 10.1562 9.72168 10.5166 9.72168 10.9648C9.72168 11.4131 10.082 11.7822 10.5391 11.7822ZM12.9561 11.5361H18.2646C18.5898 11.5361 18.8359 11.2812 18.8359 10.9648C18.8359 10.6484 18.5898 10.4023 18.2646 10.4023H12.9561C12.6309 10.4023 12.3848 10.6484 12.3848 10.9648C12.3848 11.2812 12.6309 11.5361 12.9561 11.5361ZM10.5391 14.5332C10.9961 14.5332 11.3564 14.1641 11.3564 13.7158C11.3564 13.2588 10.9961 12.8896 10.5391 12.8896C10.0908 12.8896 9.72168 13.2676 9.72168 13.7158C9.72168 14.1553 10.0908 14.5332 10.5391 14.5332ZM12.9561 14.2871H18.2646C18.5811 14.2871 18.8359 14.0234 18.8359 13.7158C18.8359 13.3994 18.5898 13.1445 18.2646 13.1445H12.9561C12.6309 13.1445 12.3848 13.3994 12.3848 13.7158C12.3848 14.0234 12.6396 14.2871 12.9561 14.2871Z" fill="#0A0A3B"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

Some files were not shown because too many files have changed in this diff Show More