-
Notifications
You must be signed in to change notification settings - Fork 380
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add permit params to paraswap methods in poolSlice * feat: update paraswap actions and transaction handler to support permit * feat: add utility for calculating signature amount for aToken * feat: add signature request helper function to slice * feat: configure paraswap tx handler to support permit * feat: update repay with collateral action with permit parameters * feat: update collateral swap action with permit parameters * feat: add comments * feat: add slippage and amount tip for Paraswap gas estimation error * chore: run i18n * feat: export variable for percentage increase of signature amount * fix: use collateral asset in useEffect depedency for collateral swap * feat: correctly display approval and error states based on dependency changes * chore: update range for re-using signature on amount update * fix: swap and collateral repay tests by tx approve * chore: remove console log Co-authored-by: NikitaY <right2maresko@gmail.com>
- Loading branch information
1 parent
74bd1ac
commit fe8a113
Showing
13 changed files
with
303 additions
and
37 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
31 changes: 31 additions & 0 deletions
31
src/components/transactions/Warnings/ParaswapErrorDisplay.tsx
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,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.