Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: routing api integration #2116

Merged
merged 165 commits into from
Sep 16, 2021
Merged
Changes from 1 commit
Commits
Show all changes
165 commits
Select commit Hold shift + click to select a range
f6b9445
initial routing api integration
Jul 19, 2021
3c37da5
add routing api slice
Jul 19, 2021
817b5ac
display route in dialog
Jul 19, 2021
a6fb6e9
Merge branch 'main' into judo/routing/api
Jul 19, 2021
375d674
addressed pr feedback
Jul 20, 2021
c1b9856
improved routing
Jul 21, 2021
4801aec
switch to `get`
Jul 21, 2021
2fdbfe8
Merge branch 'main'
Jul 21, 2021
a18b183
first pass at integration new MultiRouteTrade
Jul 22, 2021
d90a5a4
initial implementation of RoutingDiagram
Jul 24, 2021
934b091
add RoutingDiagram tests
Jul 24, 2021
74bbde6
Merge branch 'main' into judo/routing/ui-viz
Jul 26, 2021
c9730b2
improve tests in RoutingDiagram
Jul 26, 2021
b4a4321
integrate with v3-sdk 3.3.1
Jul 26, 2021
552b2e1
Merge branch 'main' into judo/routing/api2
Jul 26, 2021
be3376c
removed references to MultiRouteTrade
Jul 26, 2021
cbf031d
revert swapcallback
Jul 26, 2021
9fa69af
fix abi compilation error
Jul 26, 2021
5a07ab1
Merge branch 'judo/routing/ui-viz' into judo/routing/feat
Jul 26, 2021
2a7742a
added useRoute hook to build a Route from edges and nodes
Jul 27, 2021
037ec01
added react-hooks-testing-library
Jul 27, 2021
c4e5686
integrated latest changes
Jul 27, 2021
b96ca26
renamed router hook to routerTrade
Jul 27, 2021
e7ecff4
Merge branch 'judo/routing/ui' into judo/routing/feat
Jul 27, 2021
4764579
improve integration
Jul 27, 2021
8743621
fixed routing
Jul 28, 2021
35d0a3d
usability
Jul 28, 2021
ecb9088
mock RoutingDiagram children to reduce size
Jul 28, 2021
11b3625
undo mocked children
Jul 28, 2021
9ca0899
adjust ui
Jul 28, 2021
e1e0897
better support long routes
Jul 28, 2021
16f3e4e
use routing api logo and adjust ux
Jul 28, 2021
4be4f37
set default percent to 0
Jul 28, 2021
5d1eff4
added intermediary hook to combine local and routing api trades
Jul 28, 2021
62ecb8d
added intermediary hook to combine local and routing api trades
Jul 28, 2021
0ceffe0
make account optional
Jul 28, 2021
87c8a4e
improve ux
Jul 29, 2021
4dbd7b4
improve router
Jul 29, 2021
b2d6cca
fixed duplicate pool bug and inputAmount undefined bug
Jul 29, 2021
9ed8066
extract input/outputAmounts from routes
Jul 29, 2021
f7fbb3f
add todo
Jul 29, 2021
04e5436
fixed uninitialized issue and added %
Jul 29, 2021
aacda94
fixed tests
Jul 29, 2021
985cab7
fix duplicate pool bug
Aug 4, 2021
c03eb18
added routing api setting
Aug 4, 2021
0c12b51
change router label based on router version
Aug 4, 2021
11def8a
improve useRoutes and fix duplicate pool bug
Aug 5, 2021
8a62c01
debounce routing api/local routing
Aug 5, 2021
7e2d6bb
removed single hop setting
Aug 5, 2021
1a8a63b
fix bug when moving between v2/v3
Aug 9, 2021
98d5675
consider isUnitialized non loading
Aug 9, 2021
2bf7632
ui fixes
Aug 9, 2021
2655b98
reverted change to usedebounce
Aug 9, 2021
701e733
use new route schema
Aug 10, 2021
d4b78de
visual updates
Aug 10, 2021
5d0831e
log quoteId for polish session
Aug 10, 2021
1ccf62a
fix: persist advanced swap details toggle state
Aug 10, 2021
4ef2449
Merge branch 'judo/routing/swapinfostre' into judo/routing/feat
Aug 10, 2021
efa3905
fix no route found
Aug 10, 2021
7216c56
poll every 10s
Aug 11, 2021
1220ca4
derive currencies from pool rather than input
Aug 11, 2021
db42868
polish query status handling in useRouterTrade
Aug 11, 2021
3e3e141
removed RouterVersion
Aug 11, 2021
96d9010
update ui
Aug 11, 2021
7c4a2ea
update ui
Aug 11, 2021
bb25127
update loading state
Aug 11, 2021
8da25d2
animate auto router
Aug 11, 2021
390e007
apply loading treatment to out
Aug 11, 2021
8c465d9
disable routing api on l2 and support auto slippage
Aug 11, 2021
d121c3a
use opacity on the whole element
Aug 11, 2021
46aeecc
show loading card when syncing
Aug 11, 2021
c613b15
updated gradient
Aug 12, 2021
1738fa2
polished ui
Aug 13, 2021
e13e212
create routerlabel component
Aug 13, 2021
217ab52
disable router on all bu mainnet
Aug 13, 2021
4199897
polish
Aug 19, 2021
24f3c8b
feat: [draft] routing api polish (#2224)
Aug 20, 2021
d9fa469
Merge branch 'judo/routing/feat' of https://github.com/Uniswap/uniswa…
Aug 20, 2021
7a9e12e
fixed merge conflict
Aug 20, 2021
a5d559a
few updates
Aug 20, 2021
ad71eb2
polish
Aug 20, 2021
8d7e58d
Merge branch 'main' into judo/routing/feat
Aug 20, 2021
8f4664f
updated yarn.lock
Aug 20, 2021
94bc877
fixed styles
Aug 23, 2021
df95a57
updated routing diagram
Aug 23, 2021
91879f1
Fix code style issues with ESLint
lint-action Aug 23, 2021
bad8ea5
routing api enabled without localstorage upgrade
Aug 26, 2021
6bea519
Merge branch 'judo/routing/feat' of https://github.com/Uniswap/uniswa…
Aug 26, 2021
a0b0dfc
fixed lint error
Aug 26, 2021
91cf621
Fix code style issues with ESLint
lint-action Aug 26, 2021
6d203d1
Merge branch 'main' into judo/routing/feat
Aug 26, 2021
4fd7e49
Merge branch 'judo/routing/feat' of https://github.com/Uniswap/uniswa…
Aug 26, 2021
6a530a0
refined mocks in routing diagram tests
Aug 26, 2021
a26ddb0
addressed pr feedback
Aug 26, 2021
e1018be
polish
Aug 26, 2021
724249e
revert sending eth
Aug 26, 2021
d0be881
improved loading animation
Aug 27, 2021
bca6704
handle stale routing api
Aug 27, 2021
37a26b2
Fix code style issues with ESLint
lint-action Aug 27, 2021
a3b9b6a
updated yarn.lock
Aug 27, 2021
3137722
Merge branch 'judo/routing/feat' of https://github.com/Uniswap/uniswa…
Aug 27, 2021
ee8693f
support native eth
Aug 27, 2021
98a71df
Compute gas adjusted quote for V2 trade and compare to V3 gas adjuste…
Aug 30, 2021
74a8ecc
Incorporate approval gas cost estimate
Aug 31, 2021
b1dc2c7
feat: simplify routing api ux (#2258)
Aug 31, 2021
f04e746
Merge branch 'judo/routing/feat' of https://github.com/Uniswap/uniswa…
Sep 1, 2021
d030c77
optimize tradeBetter hook
Sep 1, 2021
0542d92
adjust type and name
Sep 1, 2021
de73f97
add useBetterTrade
Sep 1, 2021
432c96c
useBetterTrade takes gasEstimateWei
Sep 1, 2021
a6f6374
implement gasEstimateForApproval
Sep 1, 2021
aeadd66
Merge branch 'judo/routing/feat' of https://github.com/Uniswap/uniswa…
Sep 1, 2021
0329b81
import state from react
Sep 1, 2021
127075c
use gas estimate
Sep 1, 2021
2bef442
improve integration with gas estimate comparison
Sep 1, 2021
d382eaa
remove dependency on account
Sep 1, 2021
2a6d065
fix currency switch bug
Sep 1, 2021
ba09319
improve syncing state
Sep 2, 2021
43eea2d
add loadingbar
Sep 2, 2021
ec0051f
style tooltip container
Sep 2, 2021
6e9ceca
updated tooltip styles
Sep 2, 2021
89c80af
increase opacity range
Sep 2, 2021
e64125b
always keep dependent currency input interactable
Sep 7, 2021
28718f3
show placeholders in tooltips
Sep 7, 2021
9ffee9c
Revert v2 gas estimates and approval estimates
Sep 7, 2021
047ad7b
Add debug logs
Sep 7, 2021
5acb4dd
refactor
Sep 7, 2021
e791a03
fix bug
Sep 7, 2021
23abe84
removed comment
Sep 7, 2021
76a9647
update engish key
Sep 8, 2021
bff0fca
add try-catch
Sep 8, 2021
a865823
addressed pr feedback
Sep 9, 2021
e6e0ec3
remove loading bar for price impact
Sep 9, 2021
3c07567
addressed pr feedback and bug bash feedback
Sep 9, 2021
c9401f7
fix: use url to force version
Sep 10, 2021
749105f
addressed pr feedback and bug bash feedback
Sep 10, 2021
f33c00a
stop fetching when losing focus
Sep 10, 2021
e592c3e
only show auto router label when activated
Sep 13, 2021
d24fcd3
avoid showing syncing status
Sep 13, 2021
07ffd34
move V3TradeSTate to own file
Sep 13, 2021
a3980cb
make useRoutes a function rather than hook
Sep 13, 2021
621e9e2
use logo from active list when possible
Sep 14, 2021
b5069fb
renamed and refactored hook
Sep 14, 2021
02c2168
renamed and refactored hook
Sep 14, 2021
c329957
update status
Sep 14, 2021
4cf60c5
polish
Sep 14, 2021
7202610
remove unused import
Sep 15, 2021
d5d04f2
Merge branch 'main' into judo/routing/feat
Sep 15, 2021
8c2642e
fixed merge error
Sep 15, 2021
960bd94
updated combined trade tests
Sep 15, 2021
0698c70
remove priceimpact while loading
Sep 15, 2021
67de89d
Design tweaks
callil Sep 15, 2021
b79bd3f
Merge branch 'judo/routing/feat' of https://github.com/Uniswap/uniswa…
Sep 15, 2021
f7e0fa6
polish latest design
Sep 15, 2021
83a569f
removed some styles
Sep 15, 2021
831c55f
log gaevent on tooltip open and clean up origin
Sep 15, 2021
0dcc0e5
Small tweaks
callil Sep 15, 2021
50badf1
addressed pr feedback
Sep 15, 2021
8d88b89
Merge branch 'judo/routing/feat' of https://github.com/Uniswap/uniswa…
Sep 15, 2021
042b8fd
wrap route length in a loading container
Sep 15, 2021
e60d11b
renamed local to clientside
Sep 15, 2021
c84ac4f
fix percent and token logo
Sep 16, 2021
1659066
addressed pr feedback
Sep 16, 2021
a606cbb
avoid comparing trades when v3 not ready
Sep 16, 2021
a6417a7
some refactor
Sep 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
apply loading treatment to out
Justin Domingue committed Aug 11, 2021

Verified

This commit was signed with the committer’s verified signature.
gortiz Gonzalo Ortiz Jaureguizar
commit 390e007959409d5f43161c110c63f2e0c1592078
1 change: 1 addition & 0 deletions src/hooks/useV3Trade.ts
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ export enum V3TradeState {
SYNCING,
}

// TODO(judo): reenable
const shouldUseFallback = (state: V3TradeState) => false //[V3TradeState.NO_ROUTE_FOUND].includes(state)

/**
2 changes: 1 addition & 1 deletion src/state/routing/useRouterTrade.ts
Original file line number Diff line number Diff line change
@@ -118,7 +118,7 @@ export function useRouterTradeExactOut(currencyIn?: Currency, amountOut?: Curren
}
}

if (isLoading) {
if (isLoading && !data) {
return {
state: V3TradeState.LOADING,
trade: null,