-
Notifications
You must be signed in to change notification settings - Fork 31
/
30358.415d2827.iframe.bundle.js
1 lines (1 loc) · 36.5 KB
/
30358.415d2827.iframe.bundle.js
1
"use strict";(globalThis.webpackChunkmetamask_crx=globalThis.webpackChunkmetamask_crx||[]).push([[30358],{"./shared/lib/confirmation.utils.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{WP:()=>isCorrectSignatureApprovalType,_I:()=>shouldUseRedesignForTransactions,ml:()=>shouldUseRedesignForSignatures,nO:()=>isCorrectDeveloperTransactionType});var _metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@metamask/transaction-controller/dist/types.mjs"),_metamask_controller_utils__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@metamask/controller-utils/dist/constants.mjs");function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_without_holes(arr){if(Array.isArray(arr))return _array_like_to_array(arr)}function _iterable_to_array(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}function _non_iterable_spread(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _to_consumable_array(arr){return _array_without_holes(arr)||_iterable_to_array(arr)||_unsupported_iterable_to_array(arr)||_non_iterable_spread()}function _unsupported_iterable_to_array(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if("Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}}var REDESIGN_SIGNATURE_APPROVAL_TYPES=[_metamask_controller_utils__WEBPACK_IMPORTED_MODULE_0__.s.EthSignTypedData,_metamask_controller_utils__WEBPACK_IMPORTED_MODULE_0__.s.PersonalSign],REDESIGN_USER_TRANSACTION_TYPES=[_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_1__.D_.contractInteraction,_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_1__.D_.deployContract,_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_1__.D_.tokenMethodApprove,_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_1__.D_.tokenMethodIncreaseAllowance,_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_1__.D_.tokenMethodSetApprovalForAll,_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_1__.D_.tokenMethodTransfer,_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_1__.D_.tokenMethodTransferFrom,_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_1__.D_.tokenMethodSafeTransferFrom,_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_1__.D_.simpleSend],REDESIGN_DEV_TRANSACTION_TYPES=_to_consumable_array(REDESIGN_USER_TRANSACTION_TYPES);function shouldUseRedesignForTransactions(param){var transactionMetadataType=param.transactionMetadataType,isRedesignedTransactionsUserSettingEnabled=param.isRedesignedTransactionsUserSettingEnabled,isRedesignedConfirmationsDeveloperEnabled=param.isRedesignedConfirmationsDeveloperEnabled;return shouldUseRedesignForTransactionsUserMode(isRedesignedTransactionsUserSettingEnabled,transactionMetadataType)||shouldUseRedesignForTransactionsDeveloperMode(isRedesignedConfirmationsDeveloperEnabled,transactionMetadataType)}function shouldUseRedesignForSignatures(param){var approvalType=param.approvalType,isRedesignedSignaturesUserSettingEnabled=param.isRedesignedSignaturesUserSettingEnabled,isRedesignedConfirmationsDeveloperEnabled=param.isRedesignedConfirmationsDeveloperEnabled;return!!isCorrectSignatureApprovalType(approvalType)&&(isRedesignedSignaturesUserSettingEnabled||isRedesignedConfirmationsDeveloperEnabled)}function isCorrectSignatureApprovalType(approvalType){return!!approvalType&&REDESIGN_SIGNATURE_APPROVAL_TYPES.includes(approvalType)}function isCorrectDeveloperTransactionType(transactionMetadataType){return!!transactionMetadataType&&REDESIGN_DEV_TRANSACTION_TYPES.includes(transactionMetadataType)}function isCorrectUserTransactionType(transactionMetadataType){return!!transactionMetadataType&&REDESIGN_USER_TRANSACTION_TYPES.includes(transactionMetadataType)}function shouldUseRedesignForTransactionsDeveloperMode(isRedesignedConfirmationsDeveloperEnabled,transactionMetadataType){return isRedesignedConfirmationsDeveloperEnabled&&isCorrectDeveloperTransactionType(transactionMetadataType)}function shouldUseRedesignForTransactionsUserMode(isRedesignedTransactionsUserSettingEnabled,transactionMetadataType){return isRedesignedTransactionsUserSettingEnabled&&isCorrectUserTransactionType(transactionMetadataType)}},"./test/data/confirmations/contract-interaction.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{AC:()=>CHAIN_ID,cU:()=>PAYMASTER_AND_DATA,ey:()=>DEPOSIT_METHOD_DATA,mg:()=>genUnapprovedContractInteractionConfirmation,n_:()=>CONTRACT_INTERACTION_SENDER_ADDRESS});var _metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@metamask/transaction-controller/dist/constants.mjs"),_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@metamask/transaction-controller/dist/types.mjs"),PAYMASTER_AND_DATA="0x9d6ac51b972544251fcc0f2902e633e3f9bd3f2900000000000000000000000000000000000000000000000000000000666bfd410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003498a76eb88b702e5e52b00fbc16a36baf89ebe3e0dd23170949cffc0a623011383cced660ff67930308c22e5aa746a2d586629ddbd87046a146225bf80e9d6f1b",CONTRACT_INTERACTION_SENDER_ADDRESS="0x2e0d7e8c45221fca00d74a3609a0f7097035d09b",DEPOSIT_METHOD_DATA="0xd0e30db0",CHAIN_ID=_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_0__.tx.GOERLI,genUnapprovedContractInteractionConfirmation=function(){var _ref=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref_address=_ref.address,address=void 0===_ref_address?CONTRACT_INTERACTION_SENDER_ADDRESS:_ref_address,_ref_txData=_ref.txData,txData=void 0===_ref_txData?DEPOSIT_METHOD_DATA:_ref_txData,_ref_chainId=_ref.chainId,chainId=void 0===_ref_chainId?CHAIN_ID:_ref_chainId,simulationData=_ref.simulationData,confirmation={actionId:String(400855682),chainId:chainId,dappSuggestedGasFees:{gas:"0xab77"},defaultGasEstimates:{estimateType:"medium",gas:"0xab77",maxFeePerGas:"0xaa350353",maxPriorityFeePerGas:"0x59682f00"},gasFeeEstimatesLoaded:!0,history:[{actionId:String(400855682),chainId:chainId,dappSuggestedGasFees:{gas:"0xab77"},defaultGasEstimates:{estimateType:"medium",gas:"0xab77",maxFeePerGas:"0xaa350353",maxPriorityFeePerGas:"0x59682f00"},id:"1d7c08c0-fe54-11ee-9243-91b1e533746a",origin:"https://metamask.github.io",securityAlertResponse:{reason:"loading",result_type:"validation_in_progress"},sendFlowHistory:[],status:_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_1__.x8.unapproved,time:1713534772044,txParams:{data:txData,from:address,gas:"0xab77",maxFeePerGas:"0xaa350353",maxPriorityFeePerGas:"0x59682f00",to:"0x88aa6343307ec9a652ccddda3646e62b2f1a5125",value:"0x3782dace9d900000"},type:_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_1__.D_.contractInteraction,userEditedGasLimit:!1,userFeeLevel:"medium",verifiedOnBlockchain:!1},[{note:"TransactionController#updateSimulationData - Update simulation data",op:"add",path:"/simulationData",timestamp:1713534772417,value:{nativeBalanceChange:{difference:"0x3782dace9d900000",isDecrease:!0,newBalance:"0xcc0ea4fb7ffa87d",previousBalance:"0x4443c51e558fa87d"},tokenBalanceChanges:[]}},{op:"add",path:"/gasFeeEstimatesLoaded",value:!0}],[{note:"TransactionController:updatesecurityAlertResponse - securityAlertResponse updated",op:"replace",path:"/securityAlertResponse/result_type",timestamp:1713534773213,value:"Benign"},{op:"replace",path:"/securityAlertResponse/reason",value:""},{op:"add",path:"/securityAlertResponse/description",value:""},{op:"add",path:"/securityAlertResponse/features",value:[]},{op:"add",path:"/securityAlertResponse/block",value:5732063}]],id:"1d7c08c0-fe54-11ee-9243-91b1e533746a",origin:"https://metamask.github.io",securityAlertResponse:{features:[],reason:"",result_type:"Benign"},sendFlowHistory:[],simulationData:{nativeBalanceChange:{difference:"0x3782dace9d900000",isDecrease:!0,newBalance:"0xcc0ea4fb7ffa87d",previousBalance:"0x4443c51e558fa87d"},tokenBalanceChanges:[]},status:_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_1__.x8.unapproved,time:1713534772044,txParams:{data:txData,from:address,gas:"0xab77",maxFeePerGas:"0xaa350353",maxPriorityFeePerGas:"0x59682f00",to:"0x88aa6343307ec9a652ccddda3646e62b2f1a5125",value:"0x3782dace9d900000"},type:_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_1__.D_.contractInteraction,userEditedGasLimit:!1,userFeeLevel:"medium",verifiedOnBlockchain:!1};return simulationData&&(confirmation.simulationData=simulationData),confirmation}},"./test/data/confirmations/helper.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{f6:()=>getMockApproveConfirmState,gH:()=>getMockConfirmState,bb:()=>getMockConfirmStateForTransaction,cX:()=>getMockContractInteractionConfirmState,nN:()=>getMockPersonalSignConfirmState,bh:()=>getMockPersonalSignConfirmStateForRequest,oF:()=>getMockTokenTransferConfirmState,dV:()=>getMockTypedSignConfirmState,jk:()=>getMockTypedSignConfirmStateForRequest});var constants=__webpack_require__("./node_modules/@metamask/controller-utils/dist/constants.mjs"),lodash=__webpack_require__("./node_modules/lodash/lodash.js"),network=__webpack_require__("./shared/constants/network.ts"),mock_state=__webpack_require__("./test/data/mock-state.json"),contract_interaction=__webpack_require__("./test/data/confirmations/contract-interaction.ts"),personal_sign=__webpack_require__("./test/data/confirmations/personal_sign.ts"),types=__webpack_require__("./node_modules/@metamask/transaction-controller/dist/types.mjs");function token_approve_define_property(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function token_approve_object_spread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{},ownKeys=Object.keys(source);"function"==typeof Object.getOwnPropertySymbols&&(ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))),ownKeys.forEach(function(key){token_approve_define_property(target,key,source[key])})}return target}function token_approve_ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function token_approve_object_spread_props(target,source){return source=null!=source?source:{},Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):token_approve_ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))}),target}var genUnapprovedApproveConfirmation=function(){var _ref=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref_address=_ref.address,address=void 0===_ref_address?contract_interaction.n_:_ref_address,_ref_chainId=_ref.chainId,chainId=void 0===_ref_chainId?contract_interaction.AC:_ref_chainId;return token_approve_object_spread_props(token_approve_object_spread({},(0,contract_interaction.mg)({chainId:chainId})),{txParams:{from:address,data:"0x095ea7b30000000000000000000000002e0d7e8c45221fca00d74a3609a0f7097035d09b0000000000000000000000000000000000000000000000000000000000000001",gas:"0x16a92",to:"0x076146c765189d51be3160a2140cf80bfc73ad68",value:"0x0",maxFeePerGas:"0x5b06b0c0d",maxPriorityFeePerGas:"0x59682f00"},type:types.D_.tokenMethodApprove})};function token_transfer_define_property(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function token_transfer_object_spread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{},ownKeys=Object.keys(source);"function"==typeof Object.getOwnPropertySymbols&&(ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))),ownKeys.forEach(function(key){token_transfer_define_property(target,key,source[key])})}return target}function token_transfer_ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function token_transfer_object_spread_props(target,source){return source=null!=source?source:{},Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):token_transfer_ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))}),target}var genUnapprovedTokenTransferConfirmation=function(){var _ref=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref_address=_ref.address,address=void 0===_ref_address?contract_interaction.n_:_ref_address,_ref_chainId=_ref.chainId,chainId=void 0===_ref_chainId?contract_interaction.AC:_ref_chainId,_ref_isWalletInitiatedConfirmation=_ref.isWalletInitiatedConfirmation;return token_transfer_object_spread_props(token_transfer_object_spread({},(0,contract_interaction.mg)({chainId:chainId})),{txParams:{from:address,data:"0x095ea7b30000000000000000000000002e0d7e8c45221fca00d74a3609a0f7097035d09b0000000000000000000000000000000000000000000000000000000000000001",gas:"0x16a92",to:"0x076146c765189d51be3160a2140cf80bfc73ad68",value:"0x0",maxFeePerGas:"0x5b06b0c0d",maxPriorityFeePerGas:"0x59682f00"},type:types.D_.tokenMethodTransfer,origin:void 0!==_ref_isWalletInitiatedConfirmation&&_ref_isWalletInitiatedConfirmation?"metamask":"https://metamask.github.io"})},typed_sign=__webpack_require__("./test/data/confirmations/typed_sign.ts");function helper_define_property(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function helper_object_spread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{},ownKeys=Object.keys(source);"function"==typeof Object.getOwnPropertySymbols&&(ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))),ownKeys.forEach(function(key){helper_define_property(target,key,source[key])})}return target}function helper_ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function helper_object_spread_props(target,source){return source=null!=source?source:{},Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):helper_ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))}),target}var getMockTypedSignConfirmState=function(){var args=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{metamask:{}};return helper_object_spread_props(helper_object_spread({},mock_state,args),{metamask:helper_object_spread_props(helper_object_spread({},mock_state.metamask,args.metamask),{preferences:helper_object_spread_props(helper_object_spread({},mock_state.metamask.preferences),{redesignedTransactionsEnabled:!0,redesignedConfirmationsEnabled:!0,isRedesignedConfirmationsDeveloperEnabled:!0}),pendingApprovals:helper_define_property({},typed_sign.BC.id,{id:typed_sign.BC.id,type:constants.s.EthSignTypedData}),unapprovedTypedMessages:helper_define_property({},typed_sign.BC.id,typed_sign.BC)})})},getMockTypedSignConfirmStateForRequest=function(signature){var args=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{metamask:{}};return helper_object_spread_props(helper_object_spread({},mock_state,args),{metamask:helper_object_spread_props(helper_object_spread({},mock_state.metamask,args.metamask),{preferences:helper_object_spread_props(helper_object_spread({},mock_state.metamask.preferences),{redesignedTransactionsEnabled:!0,redesignedConfirmationsEnabled:!0,isRedesignedConfirmationsDeveloperEnabled:!0}),pendingApprovals:helper_define_property({},signature.id,{id:signature.id,type:constants.s.EthSignTypedData}),unapprovedTypedMessages:helper_define_property({},signature.id,signature)})})},getMockPersonalSignConfirmState=function(){var args=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{metamask:{}};return helper_object_spread_props(helper_object_spread({},mock_state,args),{metamask:helper_object_spread_props(helper_object_spread({},mock_state.metamask,args.metamask),{preferences:helper_object_spread_props(helper_object_spread({},mock_state.metamask.preferences),{redesignedTransactionsEnabled:!0,redesignedConfirmationsEnabled:!0,isRedesignedConfirmationsDeveloperEnabled:!0}),pendingApprovals:helper_define_property({},personal_sign.ds.id,{id:personal_sign.ds.id,type:constants.s.PersonalSign}),unapprovedPersonalMsgs:helper_define_property({},personal_sign.ds.id,personal_sign.ds)})})},getMockPersonalSignConfirmStateForRequest=function(signature){var args=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{metamask:{}};return helper_object_spread_props(helper_object_spread({},mock_state,args),{metamask:helper_object_spread_props(helper_object_spread({},mock_state.metamask,args.metamask),{preferences:helper_object_spread_props(helper_object_spread({},mock_state.metamask.preferences),{redesignedTransactionsEnabled:!0,redesignedConfirmationsEnabled:!0,isRedesignedConfirmationsDeveloperEnabled:!0}),pendingApprovals:helper_define_property({},signature.id,{id:signature.id,type:constants.s.PersonalSign}),unapprovedPersonalMsgs:helper_define_property({},signature.id,signature)})})},getMockConfirmState=function(){var _args_metamask,args=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{metamask:{}};return helper_object_spread_props(helper_object_spread({},mock_state,args),{metamask:helper_object_spread_props(helper_object_spread({},mock_state.metamask,args.metamask),{preferences:helper_object_spread_props(helper_object_spread({},mock_state.metamask.preferences,null===(_args_metamask=args.metamask)||void 0===_args_metamask?void 0:_args_metamask.preferences),{redesignedTransactionsEnabled:!0,redesignedConfirmationsEnabled:!0,isRedesignedConfirmationsDeveloperEnabled:!0})})})},getMockConfirmStateForTransaction=function(transaction){var args=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{metamask:{}};return getMockConfirmState((0,lodash.merge)({metamask:helper_object_spread_props(helper_object_spread({},args.metamask),{pendingApprovals:helper_define_property({},transaction.id,{id:transaction.id,type:constants.s.Transaction}),transactions:[transaction]})},args))},getMockContractInteractionConfirmState=function(){var args=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{metamask:{}};return getMockConfirmStateForTransaction((0,contract_interaction.mg)({chainId:network.tx.GOERLI}),args)},getMockApproveConfirmState=function(){return getMockConfirmStateForTransaction(genUnapprovedApproveConfirmation({chainId:"0x5"}))},getMockTokenTransferConfirmState=function(param){var _param_isWalletInitiatedConfirmation=param.isWalletInitiatedConfirmation;return getMockConfirmStateForTransaction(genUnapprovedTokenTransferConfirmation({chainId:"0x5",isWalletInitiatedConfirmation:void 0!==_param_isWalletInitiatedConfirmation&&_param_isWalletInitiatedConfirmation}))}},"./test/data/confirmations/personal_sign.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Bt:()=>SignatureRequestSIWEWithResources,Yw:()=>signatureRequestSIWE,ds:()=>unapprovedPersonalSignMsg});var _metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@metamask/transaction-controller/dist/constants.mjs"),unapprovedPersonalSignMsg={id:"0050d5b0-c023-11ee-a0cb-3390a510a0ab",chainId:_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_0__.tx.GOERLI,status:"unapproved",time:new Date().getTime(),type:"personal_sign",securityProviderResponse:null,chainid:"0x5",msgParams:{from:"0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc",data:"0x4578616d706c652060706572736f6e616c5f7369676e60206d657373616765",origin:"https://metamask.github.io",siwe:{isSIWEMessage:!1,parsedMessage:null}}},signatureRequestSIWE={id:"210ca3b0-1ccb-11ef-b096-89c4d726ebb5",chainId:_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_0__.tx.GOERLI,securityAlertResponse:{reason:"loading",result_type:"validation_in_progress",securityAlertId:"b826df20-2eda-41bf-becf-6a100141a8be"},status:"unapproved",time:1716884423019,type:"personal_sign",msgParams:{from:"0x935e73edb9ff52e23bac7f7e049a1ecd06d05477",data:"0x6d6574616d61736b2e6769746875622e696f2077616e747320796f7520746f207369676e20696e207769746820796f757220457468657265756d206163636f756e743a0a3078393335653733656462396666353265323362616337663765303433613165636430366430353437370a0a492061636365707420746865204d6574614d61736b205465726d73206f6620536572766963653a2068747470733a2f2f636f6d6d756e6974792e6d6574616d61736b2e696f2f746f730a0a5552493a2068747470733a2f2f6d6574616d61736b2e6769746875622e696f0a56657273696f6e3a20310a436861696e2049443a20310a4e6f6e63653a2033323839313735370a4973737565642041743a20323032312d30392d33305431363a32353a32342e3030305a",signatureMethod:"personal_sign",origin:"https://metamask.github.io",siwe:{isSIWEMessage:!0,parsedMessage:{address:"0x935e73edb9ff52e23bac7f7e049a1ecd06d05477",chainId:1,domain:"metamask.github.io",expirationTime:null,issuedAt:"2021-09-30T16:25:24.000Z",nonce:"32891757",notBefore:"2022-03-17T12:45:13.610Z",requestId:"some_id",scheme:null,statement:"I accept the MetaMask Terms of Service: https://community.metamask.io/tos",uri:"https://metamask.github.io",version:"1",resources:null}}}},SignatureRequestSIWEWithResources={id:"210ca3b0-1ccb-11ef-b096-89c4d726ebb5",chainId:_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_0__.tx.GOERLI,securityAlertResponse:{reason:"loading",result_type:"validation_in_progress",securityAlertId:"b826df20-2eda-41bf-becf-6a100141a8be"},status:"unapproved",time:1716884423019,type:"personal_sign",msgParams:{from:"0x935e73edb9ff52e23bac7f7e049a1ecd06d05477",data:"0x6d6574616d61736b2e6769746875622e696f2077616e747320796f7520746f207369676e20696e207769746820796f757220457468657265756d206163636f756e743a0a3078393335653733656462396666353265323362616337663765303433613165636430366430353437370a0a492061636365707420746865204d6574614d61736b205465726d73206f6620536572766963653a2068747470733a2f2f636f6d6d756e6974792e6d6574616d61736b2e696f2f746f730a0a5552493a2068747470733a2f2f6d6574616d61736b2e6769746875622e696f0a56657273696f6e3a20310a436861696e2049443a20310a4e6f6e63653a2033323839313735370a4973737565642041743a20323032312d30392d33305431363a32353a32342e3030305a",signatureMethod:"personal_sign",origin:"https://metamask.github.io",siwe:{isSIWEMessage:!0,parsedMessage:{address:"0x935e73edb9ff52e23bac7f7e043a1ecd06d05477",chainId:1,domain:"metamask.github.io",expirationTime:null,issuedAt:"2021-09-30T16:25:24.000Z",nonce:"32891757",notBefore:"2022-03-17T12:45:13.610Z",requestId:"some_id",scheme:null,statement:"I accept the MetaMask Terms of Service: https://community.metamask.io/tos",uri:"https://metamask.github.io",version:"1",resources:["ipfs://Qme7ss3ARVgxv6rXqVPiikMJ8u2NLgmgszg13pYrDKEoiu","https://example.com/my-web2-claim.json"]}}}}},"./test/data/confirmations/typed_sign.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{BC:()=>unapprovedTypedSignMsgV4,jH:()=>permitSignatureMsg,u0:()=>unapprovedTypedSignMsgV3,uF:()=>unapprovedTypedSignMsgV1});var _metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@metamask/transaction-controller/dist/constants.mjs"),_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@metamask/transaction-controller/dist/types.mjs"),_shared_constants_app__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./shared/constants/app.ts"),unapprovedTypedSignMsgV1={id:"82ab2400-e2c6-11ee-9627-73cc88f00492",chainId:_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_1__.tx.GOERLI,securityAlertResponse:{reason:"loading",result_type:"validation_in_progress",securityAlertId:"3a938cfc-301d-4af0-96c4-b51fe1a5d6ad"},status:"unapproved",time:1710505271872,type:_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_2__.D_.signTypedData,securityProviderResponse:null,msgParams:{from:"0x935e73edb9ff52e23bac7f7e043a1ecd06d05477",data:[{type:"string",name:"Message",value:"Hi, Alice!"},{type:"uint32",name:"A number",value:"1337"}],requestId:11,signatureMethod:"eth_signTypedData",version:"V1",origin:"https://metamask.github.io"}},unapprovedTypedSignMsgV3={id:"17e41af0-e073-11ee-9eec-5fd284826685",chainId:_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_1__.tx.GOERLI,securityAlertResponse:{reason:"loading",result_type:"validation_in_progress",securityAlertId:"efefe1db-6c6e-4a2c-aa0d-6183ad3ec810"},status:"unapproved",time:1710249542175,type:_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_2__.D_.signTypedData,securityProviderResponse:null,msgParams:{data:JSON.stringify({types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],Person:[{name:"name",type:"string"},{name:"wallet",type:"address"}],Mail:[{name:"from",type:"Person"},{name:"to",type:"Person"},{name:"contents",type:"string"}]},primaryType:"Mail",domain:{name:"Ether Mail",version:"1",chainId:1,verifyingContract:"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC"},message:{from:{name:"Cow",wallet:"0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826"},to:{name:"Bob",wallet:"0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"},contents:"Hello, Bob!"}}),from:"0x935e73edb9ff52e23bac7f7e043a1ecd06d05477",version:"V3",requestId:12,signatureMethod:"eth_signTypedData_v3",origin:"https://metamask.github.io"}},unapprovedTypedSignMsgV4={id:"0050d5b0-c023-11ee-a0cb-3390a510a0ab",chainId:_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_1__.tx.GOERLI,status:"unapproved",time:new Date().getTime(),chainid:"0x5",type:_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_2__.D_.signTypedData,securityProviderResponse:null,msgParams:{from:"0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc",data:JSON.stringify({domain:{chainId:97,name:"Ether Mail",verifyingContract:"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC",version:"1"},message:{contents:"Hello, Bob!",from:{name:"Cow",wallets:["0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826","0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF","0x06195827297c7A80a443b6894d3BDB8824b43896"]},to:[{name:"Bob",wallets:["0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB","0xB0BdaBea57B0BDABeA57b0bdABEA57b0BDabEa57","0xB0B0b0b0b0b0B000000000000000000000000000"]}]},primaryType:"Mail",types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],Mail:[{name:"from",type:"Person"},{name:"to",type:"Person[]"},{name:"contents",type:"string"}],Person:[{name:"name",type:"string"},{name:"wallets",type:"address[]"}]}}),origin:"https://metamask.github.io",requestId:123456789,signatureMethod:_shared_constants_app__WEBPACK_IMPORTED_MODULE_0__.$z.ETH_SIGN_TYPED_DATA_V4}};_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_1__.tx.GOERLI,_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_2__.D_.signTypedData;var permitSignatureMsg={id:"0b1787a0-1c44-11ef-b70d-e7064bd7b659",chainId:_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_1__.tx.GOERLI,securityAlertResponse:{reason:"loading",result_type:"validation_in_progress",securityAlertId:"ab21395f-2190-472f-8cfa-3d224e7529d8"},status:"unapproved",time:1716826404122,type:_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_2__.D_.signTypedData,msgParams:{data:'{"types":{"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}],"Permit":[{"name":"owner","type":"address"},{"name":"spender","type":"address"},{"name":"value","type":"uint256"},{"name":"nonce","type":"uint256"},{"name":"deadline","type":"uint256"}]},"primaryType":"Permit","domain":{"name":"MyToken","version":"1","verifyingContract":"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC","chainId":1},"message":{"owner":"0x935e73edb9ff52e23bac7f7e043a1ecd06d05477","spender":"0x5B38Da6a701c568545dCfcB03FcB875f56beddC4","value":3000,"nonce":0,"deadline":50000000000}}',from:"0x935e73edb9ff52e23bac7f7e043a1ecd06d05477",version:"V4",requestId:14,signatureMethod:"eth_signTypedData_v4",origin:"https://metamask.github.io"}};_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_1__.tx.GOERLI,_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_1__.tx.GOERLI,_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_1__.tx.GOERLI,_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_2__.D_.signTypedData,_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_1__.tx.GOERLI,_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_2__.D_.signTypedData},"./ui/pages/confirmations/context/confirm/index.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{VF:()=>ConfirmContextProvider,TW:()=>useConfirmContext});var react=__webpack_require__("./node_modules/react/index.js"),useCurrentConfirmation=__webpack_require__("./ui/pages/confirmations/hooks/useCurrentConfirmation.ts"),react_router=__webpack_require__("./node_modules/react-router-dom/node_modules/react-router/esm/react-router.js"),routes=__webpack_require__("./ui/helpers/constants/routes.ts");let hooks_syncConfirmPath=function(currentConfirmation){var history=(0,react_router.W6)(),paramsTransactionId=(0,react_router.g)().id;(0,react.useEffect)(function(){currentConfirmation&&(paramsTransactionId||history.replace("".concat(routes.s8,"/").concat(currentConfirmation.id)))},[currentConfirmation,paramsTransactionId])};function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_with_holes(arr){if(Array.isArray(arr))return arr}function _iterable_to_array_limit(arr,i){var _s,_e,_i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}}function _non_iterable_rest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array(arr,i){return _array_with_holes(arr)||_iterable_to_array_limit(arr,i)||_unsupported_iterable_to_array(arr,i)||_non_iterable_rest()}function _unsupported_iterable_to_array(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if("Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}}var ConfirmContext=(0,react.createContext)(void 0),ConfirmContextProvider=function(param){var children=param.children,_useState=_sliced_to_array((0,react.useState)(!0),2),isScrollToBottomCompleted=_useState[0],setIsScrollToBottomCompleted=_useState[1],currentConfirmation=(0,useCurrentConfirmation.A)().currentConfirmation;hooks_syncConfirmPath(currentConfirmation);var value=(0,react.useMemo)(function(){return{currentConfirmation:currentConfirmation,isScrollToBottomCompleted:isScrollToBottomCompleted,setIsScrollToBottomCompleted:setIsScrollToBottomCompleted}},[currentConfirmation,isScrollToBottomCompleted,setIsScrollToBottomCompleted]);return react.createElement(ConfirmContext.Provider,{value:value},children)},useConfirmContext=function(){var context=(0,react.useContext)(ConfirmContext);if(!context)throw Error("useConfirmContext must be used within an ConfirmContextProvider");return context};try{ConfirmContextProvider.displayName="ConfirmContextProvider",ConfirmContextProvider.__docgenInfo={description:"",displayName:"ConfirmContextProvider",props:{}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/pages/confirmations/context/confirm/index.tsx#ConfirmContextProvider"]={docgenInfo:ConfirmContextProvider.__docgenInfo,name:"ConfirmContextProvider",path:"ui/pages/confirmations/context/confirm/index.tsx#ConfirmContextProvider"})}catch(__react_docgen_typescript_loader_error){}},"./ui/pages/confirmations/hooks/useCurrentConfirmation.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>hooks_useCurrentConfirmation});var react=__webpack_require__("./node_modules/react/index.js"),es=__webpack_require__("./node_modules/react-redux/es/index.js"),react_router=__webpack_require__("./node_modules/react-router-dom/node_modules/react-router/esm/react-router.js"),selectors=__webpack_require__("./ui/selectors/index.js"),lib=__webpack_require__("./node_modules/reselect/lib/index.js"),util=__webpack_require__("./shared/modules/selectors/util.js"),transactions=__webpack_require__("./ui/selectors/transactions.js");function _define_property(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{},ownKeys=Object.keys(source);"function"==typeof Object.getOwnPropertySymbols&&(ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))),ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}var selectUnapprovedMessages=(0,lib.Mz)(transactions.cY,transactions.uJ,function(personalMsgs,typedMessages){return _object_spread({},personalMsgs,typedMessages)}),internalSelectUnapprovedMessage=(0,lib.Mz)(selectUnapprovedMessages,function(_state,messageId){return messageId},function(messages,messageId){return messages[messageId]}),selectUnapprovedMessage=(0,util._)(internalSelectUnapprovedMessage,function(message){return message}),confirmation_utils=__webpack_require__("./shared/lib/confirmation.utils.ts");let hooks_useCurrentConfirmation=function(){var paramsConfirmationId=(0,react_router.g)().id,oldestPendingApproval=(0,es.d4)(selectors.dMC),confirmationId=null!=paramsConfirmationId?paramsConfirmationId:null==oldestPendingApproval?void 0:oldestPendingApproval.id,isRedesignedSignaturesUserSettingEnabled=(0,es.d4)(selectors.eNZ),isRedesignedTransactionsUserSettingEnabled=(0,es.d4)(selectors.VOD),isRedesignedConfirmationsDeveloperEnabled=(0,es.d4)(selectors.q$Y),pendingApproval=(0,es.d4)(function(state){return(0,selectors.ll0)(state,confirmationId)}),transactionMetadata=(0,es.d4)(function(state){return(0,selectors.jJ$)(state,confirmationId)}),signatureMessage=(0,es.d4)(function(state){return selectUnapprovedMessage(state,confirmationId)}),useRedesignedForSignatures=(0,confirmation_utils.ml)({approvalType:null==pendingApproval?void 0:pendingApproval.type,isRedesignedSignaturesUserSettingEnabled:isRedesignedSignaturesUserSettingEnabled,isRedesignedConfirmationsDeveloperEnabled:isRedesignedConfirmationsDeveloperEnabled}),useRedesignedForTransaction=(0,confirmation_utils._I)({transactionMetadataType:null==transactionMetadata?void 0:transactionMetadata.type,isRedesignedTransactionsUserSettingEnabled:isRedesignedTransactionsUserSettingEnabled,isRedesignedConfirmationsDeveloperEnabled:isRedesignedConfirmationsDeveloperEnabled}),shouldUseRedesign=useRedesignedForSignatures||useRedesignedForTransaction;return(0,react.useMemo)(function(){var _ref;return shouldUseRedesign?{currentConfirmation:null!==(_ref=null!=transactionMetadata?transactionMetadata:signatureMessage)&&void 0!==_ref?_ref:void 0}:{currentConfirmation:void 0}},[transactionMetadata,signatureMessage,shouldUseRedesign])}}}]);