-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(swap): add settings option for partial approve * feat(swap): add sell amount to regular approve tx * feat(swap): add sell amount to permit value * chore: fix build * fix: cache permit taking amount into account * feat(swap): take partial approves into account for sc wallets * fix: ignore account agnostic permit in hooks details * fix: take permit amount into account when caching * fix: skip partial permits in widgets besides swap * chore: fix permit hook description * chore: fix conditions * fix: disable partial approve for Hooks store * fix: support partial approve it classic eth flow * fix: do not use infinite approvals in swap when partial approve mode * chore: fix circular dependency * chore: add a dot * chore: fix tooltips * chore: adjust approve tooltip * fix: display hook details only in Hooks store confirm modal * feat(partial-approvals): partial approve v2 (#5269) * refactor: expose UndelinedLinkStyledButton component * chore: removed unused React import * refactor: export useOpenSettingsTab hook * feat: expose needsApproval flag for all token types, not just permittable * feat: add PartialApprovalBanner * feat: update settings name Partial Approve to Minimal approve and tooltip * fix: fix typo and padding on settings link * fix: reworked minimal approvals title and tooltip * fix: lint issues * fix: cosmos build * fix: fix grammar * fix: do not show approval banner when selling native * chore: move partial approval banner after TWAP warning * feat: simplify text * feat: remove isApprovalNeeded prop * feat: remove banner from swap warnings * feat: add banner to top of Swap widget * chore: remove settings from cosmos --------- Co-authored-by: Leandro <[email protected]>
- Loading branch information
1 parent
198231f
commit f080ffd
Showing
43 changed files
with
350 additions
and
149 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Erc20__factory } from '@cowprotocol/abis' | ||
import type { BigNumber } from '@ethersproject/bignumber' | ||
|
||
const erc20Interface = Erc20__factory.createInterface() | ||
|
||
export interface PermitParameters { | ||
owner: string | ||
spender: string | ||
value: BigNumber | ||
deadline: BigNumber | ||
} | ||
|
||
export function parsePermitData(callData: string): PermitParameters { | ||
return erc20Interface.decodeFunctionData('permit', callData) as unknown as PermitParameters | ||
} |
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
Oops, something went wrong.