-
Notifications
You must be signed in to change notification settings - Fork 456
feat: paraswap permit #1399
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
Merged
Merged
feat: paraswap permit #1399
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
7911570
feat: add permit params to paraswap methods in poolSlice
defispartan 19410cf
feat: update paraswap actions and transaction handler to support permit
defispartan df4d748
feat: add utility for calculating signature amount for aToken
defispartan d72af27
feat: add signature request helper function to slice
defispartan c7828e7
feat: configure paraswap tx handler to support permit
defispartan 2fc9704
feat: update repay with collateral action with permit parameters
defispartan 0c3515a
feat: update collateral swap action with permit parameters
defispartan 1022af6
feat: add comments
defispartan 61c7422
feat: add slippage and amount tip for Paraswap gas estimation error
defispartan dcb0b59
chore: run i18n
defispartan 3d56c2a
feat: export variable for percentage increase of signature amount
defispartan 977656e
fix: use collateral asset in useEffect depedency for collateral swap
defispartan 76a0927
feat: correctly display approval and error states based on dependency…
defispartan 9fbbee8
chore: update range for re-using signature on amount update
defispartan 6e308a8
fix: swap and collateral repay tests by tx approve
MareskoY 39837b6
chore: remove console log
defispartan 74997d6
Merge branch 'main' into feat/paraswap-permit
defispartan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
31 changes: 31 additions & 0 deletions
31
src/components/transactions/Warnings/ParaswapErrorDisplay.tsx
This file contains hidden or 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,31 @@ | ||
| import { Trans } from '@lingui/macro'; | ||
| import { Box, Typography } from '@mui/material'; | ||
| import { Warning } from 'src/components/primitives/Warning'; | ||
| import { TxErrorType } from 'src/ui-config/errorMapping'; | ||
|
|
||
| import { GasEstimationError } from '../FlowCommons/GasEstimationError'; | ||
|
|
||
| const USER_DENIED_SIGNATURE = 'MetaMask Message Signature: User denied message signature.'; | ||
| const USER_DENIED_TRANSACTION = 'MetaMask Message Signature: User denied message signature.'; | ||
|
|
||
| interface ErrorProps { | ||
| txError: TxErrorType; | ||
| } | ||
| export const ParaswapErrorDisplay: React.FC<ErrorProps> = ({ txError }) => { | ||
| return ( | ||
| <Box> | ||
| <GasEstimationError txError={txError} /> | ||
| {txError.rawError.message !== USER_DENIED_SIGNATURE && | ||
| txError.rawError.message !== USER_DENIED_TRANSACTION && ( | ||
| <Box sx={{ pt: 4 }}> | ||
| <Warning severity="info"> | ||
| <Typography variant="description"> | ||
| {' '} | ||
| <Trans> Tip: Try increasing slippage or reduce input amount</Trans> | ||
| </Typography> | ||
| </Warning> | ||
| </Box> | ||
| )} | ||
| </Box> | ||
| ); | ||
| }; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.