-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy path45748.ccdbbc67.iframe.bundle.js
1 lines (1 loc) · 43.3 KB
/
45748.ccdbbc67.iframe.bundle.js
1
"use strict";(globalThis.webpackChunkmetamask_crx=globalThis.webpackChunkmetamask_crx||[]).push([[45748],{"./ui/contexts/gasFee.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Sz:()=>useGasFeeContext,cB:()=>GasFeeContextProvider});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),prop_types__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/prop-types/index.js"),prop_types__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__),_pages_confirmations_hooks_useGasFeeInputs__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./ui/pages/confirmations/hooks/useGasFeeInputs.js"),GasFeeContext=(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({}),GasFeeContextProvider=function(param){var children=param.children,defaultEstimateToUse=param.defaultEstimateToUse,transaction=param.transaction,minimumGasLimit=param.minimumGasLimit,editGasMode=param.editGasMode,gasFeeDetails=(0,_pages_confirmations_hooks_useGasFeeInputs__WEBPACK_IMPORTED_MODULE_1__._)(defaultEstimateToUse,transaction,minimumGasLimit,editGasMode);return react__WEBPACK_IMPORTED_MODULE_0__.createElement(GasFeeContext.Provider,{value:gasFeeDetails},children)};function useGasFeeContext(){return(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(GasFeeContext)}GasFeeContextProvider.propTypes={children:prop_types__WEBPACK_IMPORTED_MODULE_2___default().node.isRequired,defaultEstimateToUse:prop_types__WEBPACK_IMPORTED_MODULE_2___default().string,transaction:prop_types__WEBPACK_IMPORTED_MODULE_2___default().object,minimumGasLimit:prop_types__WEBPACK_IMPORTED_MODULE_2___default().string,editGasMode:prop_types__WEBPACK_IMPORTED_MODULE_2___default().string},GasFeeContextProvider.__docgenInfo={description:"",methods:[],displayName:"GasFeeContextProvider",props:{children:{description:"",type:{name:"node"},required:!0},defaultEstimateToUse:{description:"",type:{name:"string"},required:!1},transaction:{description:"",type:{name:"object"},required:!1},minimumGasLimit:{description:"",type:{name:"string"},required:!1},editGasMode:{description:"",type:{name:"string"},required:!1}}}},"./ui/pages/confirmations/hooks/useTransactionEventFragment.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{W:()=>useTransactionEventFragment});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react_redux__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react-redux/es/index.js"),_contexts_gasFee__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/contexts/gasFee.js"),_store_actions__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./ui/__mocks__/actions.js"),_selectors__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./ui/selectors/index.js");function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){reject(error);return}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _async_to_generator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)})}}function _ts_generator(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}}var useTransactionEventFragment=function(){var _ref,transaction=(0,_contexts_gasFee__WEBPACK_IMPORTED_MODULE_2__.Sz)().transaction,fragmentExists=!!(0,react_redux__WEBPACK_IMPORTED_MODULE_1__.d4)(function(state){return(0,_selectors__WEBPACK_IMPORTED_MODULE_4__.oCl)(state,{fragmentOptions:{},existingId:"transaction-added-".concat(null==transaction?void 0:transaction.id)})}),gasTransactionId=null==transaction?void 0:transaction.id;return{updateTransactionEventFragment:(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((_ref=_async_to_generator(function(params,_transactionId){var transactionId;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(transactionId=_transactionId||gasTransactionId))return[2];if(fragmentExists)return[3,2];return[4,(0,_store_actions__WEBPACK_IMPORTED_MODULE_3__.createTransactionEventFragment)(transactionId)];case 1:_state.sent(),_state.label=2;case 2:return(0,_store_actions__WEBPACK_IMPORTED_MODULE_3__.updateEventFragment)("transaction-added-".concat(transactionId),params),(0,_store_actions__WEBPACK_IMPORTED_MODULE_3__.updateEventFragment)("transaction-submitted-".concat(transactionId),params),[2]}})}),function(params,_transactionId){return _ref.apply(this,arguments)}),[fragmentExists,gasTransactionId])}}},"./ui/pages/confirmations/components/simulation-details/simulation-details.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{_:()=>SimulationDetails});var SimulationResponseType,AssetType,FiatType,PetnameType,types=__webpack_require__("./node_modules/@metamask/transaction-controller/dist/types.mjs"),react=__webpack_require__("./node_modules/react/index.js"),alert_row=__webpack_require__("./ui/components/app/confirm/info/row/alert-row/alert-row.tsx"),constants=__webpack_require__("./ui/components/app/confirm/info/row/constants.ts"),section=__webpack_require__("./ui/components/app/confirm/info/row/section.tsx"),component_library=__webpack_require__("./ui/components/component-library/index.ts"),preloader_icon_component=__webpack_require__("./ui/components/ui/icon/preloader/preloader-icon.component.js"),tooltip=__webpack_require__("./ui/components/ui/tooltip/index.js"),design_system=__webpack_require__("./ui/helpers/constants/design-system.ts"),useI18nContext=__webpack_require__("./ui/hooks/useI18nContext.js"),asset_pill=__webpack_require__("./ui/pages/confirmations/components/simulation-details/asset-pill.tsx"),es=__webpack_require__("./node_modules/react-redux/es/index.js"),conversion_utils=__webpack_require__("./shared/modules/conversion.utils.ts"),transaction=__webpack_require__("./shared/constants/transaction.ts"),locale_locale=__webpack_require__("./ui/ducks/locale/locale.ts"),util=__webpack_require__("./ui/helpers/utils/util.js"),formatAmount=__webpack_require__("./ui/pages/confirmations/components/simulation-details/formatAmount.ts"),AmountPill=function(param){var asset=param.asset,amount=param.amount,locale=(0,es.d4)(locale_locale.gA),backgroundColor=amount.isNegative()?design_system.i0.errorMuted:design_system.i0.successMuted,color=amount.isNegative()?design_system.r7.errorAlternative:design_system.r7.successDefault,amountParts=[amount.isNegative()?"-":"+"],tooltipParts=[];if(asset.standard!==transaction.ph.ERC721){var formattedAmount=(0,formatAmount.e)(locale,amount.abs()),fullPrecisionAmount=(0,formatAmount.o)(locale,amount.abs());amountParts.push(formattedAmount),tooltipParts.push(fullPrecisionAmount)}if(asset.tokenId){var decimalTokenId=(0,conversion_utils.I0)(asset.tokenId),shortenedDecimalTokenId=(0,util.l1)(decimalTokenId,{truncatedCharLimit:11,truncatedStartChars:4,truncatedEndChars:4,skipCharacterInEnd:!1}),tooltipIdPart="#".concat(decimalTokenId);amountParts.push("#".concat(shortenedDecimalTokenId)),tooltipParts.push(tooltipIdPart)}return react.createElement(component_library.az,{"data-testid":"simulation-details-amount-pill",display:design_system.nl.Flex,flexDirection:design_system.bo.Row,backgroundColor:backgroundColor,alignItems:design_system.k2.center,borderRadius:design_system.Z6.pill,style:{padding:"0px 8px",flexShrink:1,flexBasis:"auto",minWidth:0}},react.createElement(tooltip.A,{position:"bottom",title:tooltipParts.join(" "),wrapperStyle:{minWidth:0},theme:"word-break-all",interactive:!0},react.createElement(component_library.EY,{ellipsis:!0,variant:design_system.J3.bodyMd,color:color},amountParts.join(" "))))};try{AmountPill.displayName="AmountPill",AmountPill.__docgenInfo={description:"Displays a pill with an amount and a background color indicating whether the amount\nis an increase or decrease.",displayName:"AmountPill",props:{asset:{defaultValue:null,description:"",name:"asset",required:!0,type:{name:"AssetIdentifier"}},amount:{defaultValue:null,description:"",name:"amount",required:!0,type:{name:"BigNumber"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/pages/confirmations/components/simulation-details/amount-pill.tsx#AmountPill"]={docgenInfo:AmountPill.__docgenInfo,name:"AmountPill",path:"ui/pages/confirmations/components/simulation-details/amount-pill.tsx#AmountPill"})}catch(__react_docgen_typescript_loader_error){}var fiat_display=__webpack_require__("./ui/pages/confirmations/components/simulation-details/fiat-display.tsx"),BalanceChangeRow=function(param){var label=param.label,showFiat=param.showFiat,balanceChange=param.balanceChange,asset=balanceChange.asset,amount=balanceChange.amount,fiatAmount=balanceChange.fiatAmount;return react.createElement(component_library.az,{"data-testid":"simulation-details-balance-change-row",display:design_system.nl.Flex,flexDirection:design_system.bo.Row,alignItems:design_system.k2.flexStart,gap:1,flexWrap:design_system.I4.Wrap},label&&react.createElement(component_library.EY,{style:{whiteSpace:"nowrap"},variant:design_system.J3.bodyMd},label),react.createElement(component_library.az,{display:design_system.nl.Flex,flexDirection:design_system.bo.Column,gap:1,marginLeft:"auto",style:{minWidth:0}},react.createElement(component_library.az,{display:design_system.nl.Flex,flexDirection:design_system.bo.Row,gap:1},react.createElement(AmountPill,{asset:asset,amount:amount}),react.createElement(asset_pill.a,{asset:asset})),showFiat&&react.createElement(fiat_display.m8,{fiatAmount:fiatAmount})))};try{BalanceChangeRow.displayName="BalanceChangeRow",BalanceChangeRow.__docgenInfo={description:"Displays a single balance change, including the asset, amount, and fiat value.",displayName:"BalanceChangeRow",props:{label:{defaultValue:null,description:"",name:"label",required:!1,type:{name:"string"}},showFiat:{defaultValue:null,description:"",name:"showFiat",required:!1,type:{name:"boolean"}},balanceChange:{defaultValue:null,description:"",name:"balanceChange",required:!0,type:{name:"Readonly<{ asset: AssetIdentifier; amount: BigNumber; fiatAmount: FiatAmount; }>"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/pages/confirmations/components/simulation-details/balance-change-row.tsx#BalanceChangeRow"]={docgenInfo:BalanceChangeRow.__docgenInfo,name:"BalanceChangeRow",path:"ui/pages/confirmations/components/simulation-details/balance-change-row.tsx#BalanceChangeRow"})}catch(__react_docgen_typescript_loader_error){}var simulation_details_types=__webpack_require__("./ui/pages/confirmations/components/simulation-details/types.ts");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 tokenStandardOrder=[transaction.ph.none,transaction.ph.ERC20,transaction.ph.ERC721,transaction.ph.ERC1155],comparators=[function(a,b){return a.fiatAmount===b.fiatAmount?0:a.fiatAmount===simulation_details_types.k?1:b.fiatAmount===simulation_details_types.k?-1:b.fiatAmount-a.fiatAmount},function(a,b){return tokenStandardOrder.indexOf(a.asset.standard)-tokenStandardOrder.indexOf(b.asset.standard)}],compareBalanceChanges=function(a,b){var _iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _step,_iterator=comparators[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var result=(0,_step.value)(a,b);if(0!==result)return result}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{_iteratorNormalCompletion||null==_iterator.return||_iterator.return()}finally{if(_didIteratorError)throw _iteratorError}}return 0},BalanceChangeList=function(param){var heading=param.heading,balanceChanges=param.balanceChanges,testId=param.testId,sortedBalanceChanges=(0,react.useMemo)(function(){return _to_consumable_array(balanceChanges).sort(compareBalanceChanges)},[balanceChanges]),fiatAmounts=(0,react.useMemo)(function(){return sortedBalanceChanges.map(function(bc){return bc.fiatAmount})},[sortedBalanceChanges]);if(0===sortedBalanceChanges.length)return null;var showFiatTotal=sortedBalanceChanges.length>1;return react.createElement(component_library.az,null,react.createElement(component_library.az,{"data-testid":testId,display:design_system.nl.Flex,flexDirection:design_system.bo.Column,gap:3},sortedBalanceChanges.map(function(balanceChange,index){return react.createElement(BalanceChangeRow,{key:index,label:0===index?heading:void 0,balanceChange:balanceChange,showFiat:!showFiatTotal})})),showFiatTotal&&react.createElement(component_library.az,{display:design_system.nl.Flex,flexDirection:design_system.bo.RowReverse},react.createElement(fiat_display.LJ,{fiatAmounts:fiatAmounts})))};try{BalanceChangeList.displayName="BalanceChangeList",BalanceChangeList.__docgenInfo={description:"Displays a list of incoming or outgoing balance changes, along with a heading and a\ntotal fiat amount.",displayName:"BalanceChangeList",props:{heading:{defaultValue:null,description:"",name:"heading",required:!0,type:{name:"string"}},balanceChanges:{defaultValue:null,description:"",name:"balanceChanges",required:!0,type:{name:"Readonly<{ asset: AssetIdentifier; amount: BigNumber; fiatAmount: FiatAmount; }>[]"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/pages/confirmations/components/simulation-details/balance-change-list.tsx#BalanceChangeList"]={docgenInfo:BalanceChangeList.__docgenInfo,name:"BalanceChangeList",path:"ui/pages/confirmations/components/simulation-details/balance-change-list.tsx#BalanceChangeList"})}catch(__react_docgen_typescript_loader_error){}var useBalanceChanges=__webpack_require__("./ui/pages/confirmations/components/simulation-details/useBalanceChanges.ts"),chunk_6W3DEAGA=__webpack_require__("./node_modules/@metamask/name-controller/dist/chunk-6W3DEAGA.mjs"),useTransactionEventFragment=__webpack_require__("./ui/pages/confirmations/hooks/useTransactionEventFragment.js"),useDisplayName=__webpack_require__("./ui/hooks/useDisplayName.ts"),metametrics=__webpack_require__("./ui/contexts/metametrics.js"),constants_metametrics=__webpack_require__("./shared/constants/metametrics.ts"),useLoadingTime=__webpack_require__("./ui/pages/confirmations/components/simulation-details/useLoadingTime.ts");function useSimulationMetrics_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 useSimulationMetrics_array_without_holes(arr){if(Array.isArray(arr))return useSimulationMetrics_array_like_to_array(arr)}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 useSimulationMetrics_iterable_to_array(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}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 useSimulationMetrics_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 _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}function 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 _object_spread_props(target,source){return source=null!=source?source:{},Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))}),target}function _sliced_to_array(arr,i){return _array_with_holes(arr)||_iterable_to_array_limit(arr,i)||useSimulationMetrics_unsupported_iterable_to_array(arr,i)||_non_iterable_rest()}function useSimulationMetrics_to_consumable_array(arr){return useSimulationMetrics_array_without_holes(arr)||useSimulationMetrics_iterable_to_array(arr)||useSimulationMetrics_unsupported_iterable_to_array(arr)||useSimulationMetrics_non_iterable_spread()}function useSimulationMetrics_unsupported_iterable_to_array(o,minLen){if(o){if("string"==typeof o)return useSimulationMetrics_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 useSimulationMetrics_array_like_to_array(o,minLen)}}function useSimulationMetrics(param){var _simulationData_error,balanceChanges=param.balanceChanges,loading=param.loading,simulationData=param.simulationData,transactionId=param.transactionId,enableMetrics=param.enableMetrics,_useLoadingTime=(0,useLoadingTime.H)(),loadingTime=_useLoadingTime.loadingTime,setLoadingComplete=_useLoadingTime.setLoadingComplete;loading||setLoadingComplete();var displayNameRequests=balanceChanges.filter(function(param){return!!param.asset.address}).map(function(param){var asset=param.asset;return{value:asset.address,type:chunk_6W3DEAGA.k.ETHEREUM_ADDRESS,preferContractSymbol:!0,variation:asset.chainId}}),displayNamesByAddress=(0,useDisplayName.k)(displayNameRequests).reduce(function(acc,displayNameResponse,index){var _balanceChanges_index_asset_address;return _object_spread_props(_object_spread({},acc),_define_property({},null!==(_balanceChanges_index_asset_address=balanceChanges[index].asset.address)&&void 0!==_balanceChanges_index_asset_address?_balanceChanges_index_asset_address:"",displayNameResponse))},{}),updateTransactionEventFragment=(0,useTransactionEventFragment.W)().updateTransactionEventFragment;useIncompleteAssetEvent(balanceChanges,displayNamesByAddress);var receivingAssets=balanceChanges.filter(function(change){return!change.amount.isNegative()}),sendingAssets=balanceChanges.filter(function(change){return change.amount.isNegative()}),params={properties:_object_spread({simulation_response:getSimulationResponseType(simulationData),simulation_latency:loadingTime},getProperties(receivingAssets,"simulation_receiving_assets_",displayNamesByAddress),getProperties(sendingAssets,"simulation_sending_assets_",displayNamesByAddress)),sensitiveProperties:{}},shouldSkipMetrics=!enableMetrics||[types.nl.ChainNotSupported,types.nl.Disabled].includes(null==simulationData?void 0:null===(_simulationData_error=simulationData.error)||void 0===_simulationData_error?void 0:_simulationData_error.code);(0,react.useEffect)(function(){shouldSkipMetrics||updateTransactionEventFragment(params,transactionId)},[shouldSkipMetrics,updateTransactionEventFragment,transactionId,JSON.stringify(params)])}function useIncompleteAssetEvent(balanceChanges,displayNamesByAddress){var trackEvent=(0,react.useContext)(metametrics.O2),_useState=_sliced_to_array((0,react.useState)([]),2),processedAssets=_useState[0],setProcessedAssets=_useState[1],_iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _step,_iterator=balanceChanges[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var _change_asset_address,change=_step.value,assetAddress=null!==(_change_asset_address=change.asset.address)&&void 0!==_change_asset_address?_change_asset_address:"",displayName=displayNamesByAddress[assetAddress],isIncomplete=change.asset.address&&!change.fiatAmount||"unknown"===getPetnameType(change,displayName),isProcessed=processedAssets.includes(assetAddress);isIncomplete&&!isProcessed&&(trackEvent({event:constants_metametrics.gP.SimulationIncompleteAssetDisplayed,category:constants_metametrics.FZ.Transactions,properties:{asset_address:change.asset.address,asset_petname:getPetnameType(change,displayName),asset_symbol:null==displayName?void 0:displayName.contractDisplayName,asset_type:getAssetType(change.asset.standard),fiat_conversion_available:change.fiatAmount?"available":"not_available",location:"confirmation"}}),setProcessedAssets(useSimulationMetrics_to_consumable_array(processedAssets).concat([assetAddress])))}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{_iteratorNormalCompletion||null==_iterator.return||_iterator.return()}finally{if(_didIteratorError)throw _iteratorError}}}function getProperties(changes,prefix,displayNamesByAddress){var quantity=changes.length,type=unique(changes.map(function(change){return getAssetType(change.asset.standard)})),value=unique(changes.map(function(change){return change.fiatAmount?"available":"not_available"})),petname=unique(changes.map(function(change){var _change_asset_address;return getPetnameType(change,displayNamesByAddress[null!==(_change_asset_address=change.asset.address)&&void 0!==_change_asset_address?_change_asset_address:""])})),fiatAmounts=changes.map(function(change){return change.fiatAmount}),totalFiat=(0,fiat_display.Z9)(fiatAmounts);return getPrefixProperties({petname:petname,quantity:quantity,type:type,value:value,total_value:totalFiat?Math.abs(totalFiat):void 0},prefix)}function getPrefixProperties(properties,prefix){return Object.entries(properties).reduce(function(acc,param){var _param=_sliced_to_array(param,2),key=_param[0],value=_param[1];return _object_spread_props(_object_spread({},acc),_define_property({},"".concat(prefix).concat(key),value))},{})}function getAssetType(standard){switch(standard){case transaction.ph.ERC20:return"erc20";case transaction.ph.ERC721:return"erc721";case transaction.ph.ERC1155:return"erc1155";default:return"native"}}function getPetnameType(balanceChange){var displayName=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{name:"",hasPetname:!1};return balanceChange.asset.standard===transaction.ph.none?"default":displayName.hasPetname?"saved":displayName.name?"default":"unknown"}function getSimulationResponseType(simulationData){var _simulationData_error;return simulationData?(null===(_simulationData_error=simulationData.error)||void 0===_simulationData_error?void 0:_simulationData_error.code)===types.nl.Reverted?"transaction_revert":simulationData.error?"failed":(null==simulationData?void 0:simulationData.nativeBalanceChange)||(null==simulationData?void 0:simulationData.tokenBalanceChanges.length)?"balance_change":"no_balance_change":"simulation_in_progress"}function unique(list){return Array.from(new Set(list))}function simulation_details_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 simulation_details_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){simulation_details_define_property(target,key,source[key])})}return target}!function(SimulationResponseType){SimulationResponseType.Failed="failed",SimulationResponseType.Reverted="transaction_revert",SimulationResponseType.NoChanges="no_balance_change",SimulationResponseType.Changes="balance_change",SimulationResponseType.InProgress="simulation_in_progress"}(SimulationResponseType||(SimulationResponseType={})),function(AssetType){AssetType.Native="native",AssetType.ERC20="erc20",AssetType.ERC721="erc721",AssetType.ERC1155="erc1155"}(AssetType||(AssetType={})),function(FiatType){FiatType.Available="available",FiatType.NotAvailable="not_available"}(FiatType||(FiatType={})),function(PetnameType){PetnameType.Saved="saved",PetnameType.Default="default",PetnameType.Unknown="unknown"}(PetnameType||(PetnameType={}));var LoadingIndicator=function(){return react.createElement("div",{role:"progressbar"},react.createElement(preloader_icon_component.A,{size:20}))},ErrorContent=function(param){var error=param.error,t=(0,useI18nContext.P)();return react.createElement(component_library.EY,{color:error.code===types.nl.Reverted?design_system.r7.warningDefault:design_system.r7.textDefault,variant:design_system.J3.bodyMd,display:design_system.nl.Flex,alignItems:design_system.k2.center},error.code===types.nl.Reverted&&react.createElement(component_library.In,{name:component_library.$M.Warning,marginInlineEnd:1}),t(error.code===types.nl.Reverted?"simulationDetailsTransactionReverted":"simulationDetailsUnavailable"))},EmptyContent=function(){var t=(0,useI18nContext.P)();return react.createElement(component_library.EY,{color:design_system.r7.textDefault,variant:design_system.J3.bodyMd},t("simulationDetailsNoChanges"))},HeaderWithAlert=function(param){var transactionId=param.transactionId,t=(0,useI18nContext.P)();return react.createElement(alert_row.n,{alertKey:constants.oE.Resimulation,label:t("simulationDetailsTitle"),ownerId:transactionId,tooltip:t("simulationDetailsTitleTooltip"),style:{paddingLeft:0,paddingRight:0}})},LegacyHeader=function(){var t=(0,useI18nContext.P)();return react.createElement(component_library.az,{display:design_system.nl.Flex,flexDirection:design_system.bo.Row,alignItems:design_system.k2.center,gap:1},react.createElement(component_library.EY,{variant:design_system.J3.bodyMdMedium},t("simulationDetailsTitle")),react.createElement(tooltip.A,{interactive:!0,position:"top",containerClassName:"info-tooltip__tooltip-container",tooltipInnerClassName:"info-tooltip__tooltip-content",tooltipArrowClassName:"info-tooltip__top-tooltip-arrow",html:t("simulationDetailsTitleTooltip"),theme:"tippy-tooltip-info",style:{display:design_system.nl.Flex}},react.createElement(component_library.In,{name:component_library.$M.Question,marginLeft:1,color:design_system.Li.iconMuted,size:component_library.lK.Sm})))},HeaderLayout=function(param){var children=param.children,isTransactionsRedesign=param.isTransactionsRedesign,transactionId=param.transactionId;return react.createElement(component_library.az,{display:design_system.nl.Flex,flexDirection:design_system.bo.Row,alignItems:design_system.k2.center,justifyContent:design_system.A9.spaceBetween},isTransactionsRedesign?react.createElement(HeaderWithAlert,{transactionId:transactionId}):react.createElement(LegacyHeader,null),children)},SimulationDetailsLayout=function(param){var inHeader=param.inHeader,isTransactionsRedesign=param.isTransactionsRedesign,transactionId=param.transactionId,children=param.children;return isTransactionsRedesign?react.createElement(section.C,{noPadding:!0},react.createElement(component_library.az,{"data-testid":"simulation-details-layout",className:"simulation-details-layout",display:design_system.nl.Flex,flexDirection:design_system.bo.Column,borderRadius:design_system.Z6.LG,borderColor:isTransactionsRedesign?design_system.cG.transparent:design_system.cG.borderDefault,padding:3,margin:isTransactionsRedesign?null:4,gap:3},react.createElement(HeaderLayout,{isTransactionsRedesign:isTransactionsRedesign,transactionId:transactionId},inHeader),children)):react.createElement(component_library.az,{"data-testid":"simulation-details-layout",className:"simulation-details-layout",display:design_system.nl.Flex,flexDirection:design_system.bo.Column,borderRadius:design_system.Z6.LG,borderColor:isTransactionsRedesign?design_system.cG.transparent:design_system.cG.borderDefault,padding:3,margin:isTransactionsRedesign?null:4,gap:3},react.createElement(HeaderLayout,{isTransactionsRedesign:isTransactionsRedesign,transactionId:transactionId},inHeader),children)},SimulationDetails=function(param){var transaction=param.transaction,_param_enableMetrics=param.enableMetrics,_param_isTransactionsRedesign=param.isTransactionsRedesign,isTransactionsRedesign=void 0!==_param_isTransactionsRedesign&&_param_isTransactionsRedesign,_param_metricsOnly=param.metricsOnly,t=(0,useI18nContext.P)(),chainId=transaction.chainId,transactionId=transaction.id,simulationData=transaction.simulationData,balanceChangesResult=(0,useBalanceChanges.D)({chainId:chainId,simulationData:simulationData}),loading=!simulationData||balanceChangesResult.pending;if(useSimulationMetrics({enableMetrics:void 0!==_param_enableMetrics&&_param_enableMetrics,balanceChanges:balanceChangesResult.value,loading:loading,simulationData:simulationData,transactionId:transactionId}),void 0!==_param_metricsOnly&&_param_metricsOnly)return null;if(loading)return react.createElement(SimulationDetailsLayout,{inHeader:react.createElement(LoadingIndicator,null),isTransactionsRedesign:isTransactionsRedesign,transactionId:transactionId});var error=simulationData.error;if([types.nl.ChainNotSupported,types.nl.Disabled].includes(null==error?void 0:error.code))return null;if(error){var inHeaderProp=error.code!==types.nl.Reverted&&{inHeader:react.createElement(ErrorContent,{error:error})};return react.createElement(SimulationDetailsLayout,simulation_details_object_spread({isTransactionsRedesign:isTransactionsRedesign,transactionId:transactionId},inHeaderProp),error.code===types.nl.Reverted&&react.createElement(ErrorContent,{error:error}))}var balanceChanges=balanceChangesResult.value;if(0===balanceChanges.length)return react.createElement(SimulationDetailsLayout,{isTransactionsRedesign:isTransactionsRedesign,transactionId:transactionId,inHeader:react.createElement(EmptyContent,null)});var outgoing=balanceChanges.filter(function(bc){return bc.amount.isNegative()}),incoming=balanceChanges.filter(function(bc){return!bc.amount.isNegative()});return react.createElement(SimulationDetailsLayout,{isTransactionsRedesign:isTransactionsRedesign,transactionId:transactionId},react.createElement(component_library.az,{display:design_system.nl.Flex,flexDirection:design_system.bo.Column,gap:3},react.createElement(BalanceChangeList,{heading:t("simulationDetailsOutgoingHeading"),balanceChanges:outgoing,testId:"simulation-rows-outgoing"}),react.createElement(BalanceChangeList,{heading:t("simulationDetailsIncomingHeading"),balanceChanges:incoming,testId:"simulation-rows-incoming"})))};try{SimulationDetails.displayName="SimulationDetails",SimulationDetails.__docgenInfo={description:"Preview of a transaction's effects using simulation data.",displayName:"SimulationDetails",props:{enableMetrics:{defaultValue:{value:"false"},description:"",name:"enableMetrics",required:!1,type:{name:"boolean"}},isTransactionsRedesign:{defaultValue:{value:"false"},description:"",name:"isTransactionsRedesign",required:!1,type:{name:"boolean"}},metricsOnly:{defaultValue:{value:"false"},description:"",name:"metricsOnly",required:!1,type:{name:"boolean"}},transaction:{defaultValue:null,description:"",name:"transaction",required:!0,type:{name:"TransactionMeta"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/pages/confirmations/components/simulation-details/simulation-details.tsx#SimulationDetails"]={docgenInfo:SimulationDetails.__docgenInfo,name:"SimulationDetails",path:"ui/pages/confirmations/components/simulation-details/simulation-details.tsx#SimulationDetails"})}catch(__react_docgen_typescript_loader_error){}},"./ui/pages/confirmations/components/simulation-details/useBalanceChanges.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{D:()=>useBalanceChanges});var react_redux__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react-redux/es/index.js"),_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@metamask/transaction-controller/dist/types.mjs"),bignumber_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/bignumber.js/bignumber.js"),_hooks_useAsyncResult__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/hooks/useAsyncResult.ts"),_shared_constants_transaction__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./shared/constants/transaction.ts"),_ducks_metamask_metamask__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./ui/ducks/metamask/metamask.js"),_selectors__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./ui/selectors/index.js"),_helpers_utils_util__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./ui/helpers/utils/util.js"),_utils_token__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./ui/pages/confirmations/utils/token.ts"),_types__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./ui/pages/confirmations/components/simulation-details/types.ts");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 _array_without_holes(arr){if(Array.isArray(arr))return _array_like_to_array(arr)}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){reject(error);return}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _async_to_generator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)})}}function _iterable_to_array(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}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 _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 _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 _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)}}function _ts_generator(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}}function convertStandard(standard){switch(standard){case _metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_8__._B.erc20:return _shared_constants_transaction__WEBPACK_IMPORTED_MODULE_3__.ph.ERC20;case _metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_8__._B.erc721:return _shared_constants_transaction__WEBPACK_IMPORTED_MODULE_3__.ph.ERC721;case _metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_8__._B.erc1155:return _shared_constants_transaction__WEBPACK_IMPORTED_MODULE_3__.ph.ERC1155;default:throw Error("Unknown token standard: ".concat(standard))}}function getAssetAmount(param,decimals){var isNegative=param.isDecrease,quantity=param.difference;return new bignumber_js__WEBPACK_IMPORTED_MODULE_1__.BigNumber(quantity,16).times(isNegative?-1:1).shift(-decimals)}function fetchAllErc20Decimals(addresses){return _fetchAllErc20Decimals.apply(this,arguments)}function _fetchAllErc20Decimals(){return(_fetchAllErc20Decimals=_async_to_generator(function(addresses){var uniqueAddresses;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.all((uniqueAddresses=_to_consumable_array(new Set(addresses.map(function(address){return address.toLowerCase()})))).map(_utils_token__WEBPACK_IMPORTED_MODULE_7__.tT))];case 1:return[2,Object.fromEntries(_state.sent().map(function(decimals,i){return[uniqueAddresses[i],decimals]}))]}})})).apply(this,arguments)}function fetchTokenFiatRates(fiatCurrency,erc20TokenAddresses,chainId){return _fetchTokenFiatRates.apply(this,arguments)}function _fetchTokenFiatRates(){return(_fetchTokenFiatRates=_async_to_generator(function(fiatCurrency,erc20TokenAddresses,chainId){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,(0,_helpers_utils_util__WEBPACK_IMPORTED_MODULE_6__.qI)(fiatCurrency,erc20TokenAddresses,chainId)];case 1:return[2,Object.fromEntries(Object.entries(_state.sent()).map(function(param){var _param=_sliced_to_array(param,2),address=_param[0],rate=_param[1];return[address.toLowerCase(),rate]}))]}})})).apply(this,arguments)}function getNativeBalanceChange(nativeBalanceChange,nativeFiatRate,chainId){if(nativeBalanceChange){var asset={chainId:chainId,standard:_shared_constants_transaction__WEBPACK_IMPORTED_MODULE_3__.ph.none},amount=getAssetAmount(nativeBalanceChange,18),fiatAmount=nativeFiatRate?amount.times(String(nativeFiatRate)).toNumber():_types__WEBPACK_IMPORTED_MODULE_9__.k;return{asset:asset,amount:amount,fiatAmount:fiatAmount}}}function getTokenBalanceChanges(tokenBalanceChanges,erc20Decimals,erc20FiatRates,chainId){return tokenBalanceChanges.map(function(tokenBc){var _erc20Decimals_asset_address,asset={chainId:chainId,standard:convertStandard(tokenBc.standard),address:tokenBc.address.toLowerCase(),tokenId:tokenBc.id},amount=getAssetAmount(tokenBc,asset.standard===_shared_constants_transaction__WEBPACK_IMPORTED_MODULE_3__.ph.ERC20?null!==(_erc20Decimals_asset_address=erc20Decimals[asset.address])&&void 0!==_erc20Decimals_asset_address?_erc20Decimals_asset_address:_utils_token__WEBPACK_IMPORTED_MODULE_7__.Mh:0),fiatRate=erc20FiatRates[tokenBc.address],fiatAmount=fiatRate?amount.times(String(fiatRate)).toNumber():_types__WEBPACK_IMPORTED_MODULE_9__.k;return{asset:asset,amount:amount,fiatAmount:fiatAmount}})}var useBalanceChanges=function(param){var chainId=param.chainId,simulationData=param.simulationData,fiatCurrency=(0,react_redux__WEBPACK_IMPORTED_MODULE_0__.d4)(_ducks_metamask_metamask__WEBPACK_IMPORTED_MODULE_4__.Fx),nativeFiatRate=(0,react_redux__WEBPACK_IMPORTED_MODULE_0__.d4)(function(state){return(0,_selectors__WEBPACK_IMPORTED_MODULE_5__._po)(state,chainId)}),_ref=null!=simulationData?simulationData:{},nativeBalanceChange=_ref.nativeBalanceChange,_ref_tokenBalanceChanges=_ref.tokenBalanceChanges,tokenBalanceChanges=void 0===_ref_tokenBalanceChanges?[]:_ref_tokenBalanceChanges,erc20TokenAddresses=tokenBalanceChanges.filter(function(tbc){return tbc.standard===_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_8__._B.erc20}).map(function(tbc){return tbc.address}),erc20Decimals=(0,_hooks_useAsyncResult__WEBPACK_IMPORTED_MODULE_2__._)(function(){return fetchAllErc20Decimals(erc20TokenAddresses)},[JSON.stringify(erc20TokenAddresses)]),erc20FiatRates=(0,_hooks_useAsyncResult__WEBPACK_IMPORTED_MODULE_2__._)(function(){return fetchTokenFiatRates(fiatCurrency,erc20TokenAddresses,chainId)},[JSON.stringify(erc20TokenAddresses),chainId,fiatCurrency]);if(erc20Decimals.pending||erc20FiatRates.pending||!simulationData)return{pending:!0,value:[]};var nativeChange=getNativeBalanceChange(nativeBalanceChange,nativeFiatRate,chainId),tokenChanges=getTokenBalanceChanges(tokenBalanceChanges,erc20Decimals.value,erc20FiatRates.value,chainId);return{pending:!1,value:_to_consumable_array(nativeChange?[nativeChange]:[]).concat(_to_consumable_array(tokenChanges))}}}}]);