-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into chore/bump-assets-controller
- Loading branch information
Showing
6 changed files
with
130 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
import { ApprovalRequest } from '@metamask/approval-controller'; | ||
import { ApprovalType } from '@metamask/controller-utils'; | ||
import { TransactionType } from '@metamask/transaction-controller'; | ||
import { Json } from '@metamask/utils'; | ||
|
||
const SignatureApprovalTypes = [ | ||
export const REDESIGN_APPROVAL_TYPES = [ | ||
ApprovalType.EthSignTypedData, | ||
ApprovalType.PersonalSign, | ||
ApprovalType.Transaction, | ||
] as const; | ||
|
||
export const REDESIGN_TRANSACTION_TYPES = [ | ||
TransactionType.contractInteraction, | ||
] as const; | ||
|
||
const SIGNATURE_APPROVAL_TYPES = [ | ||
ApprovalType.EthSign, | ||
ApprovalType.PersonalSign, | ||
ApprovalType.EthSignTypedData, | ||
]; | ||
|
||
export const isSignatureApprovalRequest = ( | ||
request: ApprovalRequest<Record<string, Json>>, | ||
) => SignatureApprovalTypes.includes(request.type as ApprovalType); | ||
) => SIGNATURE_APPROVAL_TYPES.includes(request.type as ApprovalType); |