-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1046 from cowprotocol/refactor/new-swap-form-p4
[SWAP REFACTORING #4.4] new swap page, merge develop, code cleanup
- Loading branch information
Showing
75 changed files
with
815 additions
and
568 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Wrap/unwrap flow | ||
|
||
![wrap/unwrap flow](http://www.plantuml.com/plantuml/png/bLHDRzim3BtdLt3f8Oc1fjimO803R0Y6Tjrb1PeEkUmYMtIiLQ44IQuR3FllesGxTJzMO3d4iKG-liT7nWVXmYHVJSW41ATsTSZXfaQej6b1YuRA6ZqOqWTeQoGG49oG2AMX81JrL-StbsTR_e9vwuGzQoW-4iPYDL4LpBzvm7kBBi3US3QIA3JApmi84NH-GB-O05Wceu8o1DFpKNJ4cS9l3W28ODyHfGTXhJDtGZy50SYpR9qk4OAvHSgoLJfF6ZLMB75JcqPBA10a-jAf0YNNSjW5elO8Sp8T799KrUfO_LAm5ZBDheQeqd8cYQ26Ob08BQXariPrlJeI702PtpRsPvmsSEnPzavi427BfjidJPrc6PoUVXfnFMeVaSqt65wco0eKsIP0sJY7L1xwX2lBbxxbAcnlfTnU93FO1A4V6i1UZcEUsnW_9rPet3b4og-R7ZJDr4-EOrbvEhhWawLjzdengFV1s9TCY8YARlDrONWiOkuB6OFsFvE7vD5CFMjZcgcJuZs-hJxcF19jD8oyA5Fyynv0gqBDXjXOYNPSMWHaDwEewLhlZG-n4mxVm8NHKIs_CH4VqFhbSZcDv4wg3zKxBDWTal1r3NY7562MNg-SH3UBKNsZ7zlKkpZkDyotnrMBdUfWnp9wpXAjyIemsL9e3QQ2jB1nZnr7nff3qs3-OxJ0hwB6XtIYVHMsi-KLwMf78-dvMah-do5yR4SmNC-XREuPiOuh9cyUhdrdHhT6-HTjM4eab7ppgNfiwTfXvn08EW0wPvn_Ehx_O7aUWsV0MpsxnbzOXaIscyh_c9rKSqnscD_nl1_FkjRnFASVVm40) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
@startuml | ||
start | ||
:; | ||
note right: The flow launches only when a trade contains only ETH/WETH (wrap/unwrap flow); | ||
if (Is expert mode enabled?) then (yes) | ||
partition "Expert mode flow" { | ||
if (Needs approval?) then (yes) | ||
:**Approve token**; | ||
note left: Should be described more; | ||
else (no) | ||
endif; | ||
if (Has enough wrapped native token balance for trade?) then (no) | ||
:**Wrap native token**; | ||
note right: See **"Wrap/unwrap flow"** --> | ||
else (yes) | ||
endif; | ||
:Set wrapped native token as input currency; | ||
:Open swap confirmation modal; | ||
if (Is swap confirmed?) then (yes) | ||
#palegreen:Run swap flow \n (See: swapFlow.puml); | ||
stop; | ||
else (no) | ||
#pink:Abort swap; | ||
stop; | ||
endif; | ||
} | ||
else (no) | ||
partition "Wrap/unwrap flow" { | ||
#b2e0f7:Show transaction confirmation modal with **pending state:** \n "Almost there! Follow these steps..."; | ||
#f4f1eb:Send GA event 'Send Order'; | ||
if (Is input currency native?) then (yes (Wrap flow)) | ||
:Send transaction with **deposit** call of WETH contract; | ||
else (no (Unwrap flow)) | ||
:Send transaction with **withdraw** call of WETH contract; | ||
endif; | ||
|
||
#f4f1eb:Send GA event 'Sign Order'; | ||
:Add a new transaction to **redux enhancedTransactions state**; | ||
:Close all modals; | ||
|
||
if (Are there any errors?) then (yes) | ||
#f4f1eb:Send GA event 'Error' or 'Reject'; | ||
#pink:Show transaction confirmation modal with **error state**; | ||
stop; | ||
else (no) | ||
stop; | ||
endif; | ||
} | ||
endif; | ||
@enduml | ||
|
Oops, something went wrong.