-
Notifications
You must be signed in to change notification settings - Fork 31
/
35921.582452a1.iframe.bundle.js
1 lines (1 loc) · 35 KB
/
35921.582452a1.iframe.bundle.js
1
"use strict";(globalThis.webpackChunkmetamask_crx=globalThis.webpackChunkmetamask_crx||[]).push([[35921],{"./ui/components/app/user-preferenced-currency-display/index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>_user_preferenced_currency_display_component__WEBPACK_IMPORTED_MODULE_0__.A});var _user_preferenced_currency_display_component__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.component.js")},"./ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.component.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>UserPreferencedCurrencyDisplay});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),prop_types__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/prop-types/index.js"),prop_types__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_10__),react_redux__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react-redux/es/index.js"),_shared_constants_common__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./shared/constants/common.ts"),_helpers_constants_common__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./ui/helpers/constants/common.ts"),_ui_currency_display__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./ui/components/ui/currency-display/index.js"),_hooks_useUserPreferencedCurrency__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./ui/hooks/useUserPreferencedCurrency.js"),_component_library__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./ui/components/component-library/index.ts"),_selectors_multichain__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./ui/selectors/multichain.ts"),_hooks_useMultichainSelector__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./ui/hooks/useMultichainSelector.ts"),_selectors__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./ui/selectors/index.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}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 _object_without_properties(source,excluded){if(null==source)return{};var key,i,target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],!(excluded.indexOf(key)>=0)&&Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}function _object_without_properties_loose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],excluded.indexOf(key)>=0||(target[key]=source[key]);return target}function UserPreferencedCurrencyDisplay(_param){var _currentNetwork_rpcPrefs,dataTestId=_param["data-testid"],multichainAccount=_param.account,ethNumberOfDecimals=_param.ethNumberOfDecimals,fiatNumberOfDecimals=_param.fiatNumberOfDecimals,propsNumberOfDecimals=_param.numberOfDecimals,showEthLogo=_param.showEthLogo,type=_param.type,showFiat=_param.showFiat,showNative=_param.showNative,shouldCheckShowNativeToken=_param.shouldCheckShowNativeToken,showCurrencySuffix=_param.showCurrencySuffix,_param_privacyMode=_param.privacyMode,restProps=_object_without_properties(_param,["data-testid","account","ethNumberOfDecimals","fiatNumberOfDecimals","numberOfDecimals","showEthLogo","type","showFiat","showNative","shouldCheckShowNativeToken","showCurrencySuffix","privacyMode"]),evmAccount=(0,react_redux__WEBPACK_IMPORTED_MODULE_1__.d4)(_selectors__WEBPACK_IMPORTED_MODULE_9__.CoC),account=null!=multichainAccount?multichainAccount:evmAccount,currentNetwork=(0,_hooks_useMultichainSelector__WEBPACK_IMPORTED_MODULE_8__.t)(_selectors_multichain__WEBPACK_IMPORTED_MODULE_7__.UD,account),nativeCurrency=(0,_hooks_useMultichainSelector__WEBPACK_IMPORTED_MODULE_8__.t)(_selectors_multichain__WEBPACK_IMPORTED_MODULE_7__.zz,account),_useUserPreferencedCurrency=(0,_hooks_useUserPreferencedCurrency__WEBPACK_IMPORTED_MODULE_5__.r)(type,{account:account,ethNumberOfDecimals:ethNumberOfDecimals,fiatNumberOfDecimals:fiatNumberOfDecimals,numberOfDecimals:propsNumberOfDecimals,showFiatOverride:showFiat,showNativeOverride:showNative,shouldCheckShowNativeToken:shouldCheckShowNativeToken}),currency=_useUserPreferencedCurrency.currency,numberOfDecimals=_useUserPreferencedCurrency.numberOfDecimals,prefixComponent=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function(){var _currentNetwork_rpcPrefs;return showEthLogo&¤cy===nativeCurrency&&react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_6__.Gn,{size:_component_library__WEBPACK_IMPORTED_MODULE_6__.LM.Xs,name:null==currentNetwork?void 0:currentNetwork.nickname,src:null==currentNetwork?void 0:null===(_currentNetwork_rpcPrefs=currentNetwork.rpcPrefs)||void 0===_currentNetwork_rpcPrefs?void 0:_currentNetwork_rpcPrefs.imageUrl})},[currency,showEthLogo,nativeCurrency,null==currentNetwork?void 0:currentNetwork.nickname,null==currentNetwork?void 0:null===(_currentNetwork_rpcPrefs=currentNetwork.rpcPrefs)||void 0===_currentNetwork_rpcPrefs?void 0:_currentNetwork_rpcPrefs.imageUrl]);return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_ui_currency_display__WEBPACK_IMPORTED_MODULE_4__.A,_object_spread_props(_object_spread({},restProps),{account:account,currency:currency,"data-testid":dataTestId,numberOfDecimals:numberOfDecimals,prefixComponent:prefixComponent,suffix:showCurrencySuffix&&!showEthLogo&¤cy,privacyMode:void 0!==_param_privacyMode&&_param_privacyMode}))}var UserPreferencedCurrencyDisplayPropTypes={className:prop_types__WEBPACK_IMPORTED_MODULE_10___default().string,account:prop_types__WEBPACK_IMPORTED_MODULE_10___default().object,"data-testid":prop_types__WEBPACK_IMPORTED_MODULE_10___default().string,prefix:prop_types__WEBPACK_IMPORTED_MODULE_10___default().string,value:prop_types__WEBPACK_IMPORTED_MODULE_10___default().string,numberOfDecimals:prop_types__WEBPACK_IMPORTED_MODULE_10___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_10___default().string,prop_types__WEBPACK_IMPORTED_MODULE_10___default().number]),hideLabel:prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool,hideTitle:prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool,style:prop_types__WEBPACK_IMPORTED_MODULE_10___default().object,showEthLogo:prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool,type:prop_types__WEBPACK_IMPORTED_MODULE_10___default().oneOf([_helpers_constants_common__WEBPACK_IMPORTED_MODULE_3__.jd,_helpers_constants_common__WEBPACK_IMPORTED_MODULE_3__.lS]),ethNumberOfDecimals:prop_types__WEBPACK_IMPORTED_MODULE_10___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_10___default().string,prop_types__WEBPACK_IMPORTED_MODULE_10___default().number]),fiatNumberOfDecimals:prop_types__WEBPACK_IMPORTED_MODULE_10___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_10___default().string,prop_types__WEBPACK_IMPORTED_MODULE_10___default().number]),showFiat:prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool,showNative:prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool,showCurrencySuffix:prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool,currency:prop_types__WEBPACK_IMPORTED_MODULE_10___default().string,denomination:prop_types__WEBPACK_IMPORTED_MODULE_10___default().oneOf([_shared_constants_common__WEBPACK_IMPORTED_MODULE_2__.sk.GWEI,_shared_constants_common__WEBPACK_IMPORTED_MODULE_2__.sk.ETH]),displayValue:prop_types__WEBPACK_IMPORTED_MODULE_10___default().string,prefixComponent:prop_types__WEBPACK_IMPORTED_MODULE_10___default().node,suffix:prop_types__WEBPACK_IMPORTED_MODULE_10___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_10___default().string,prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool]),prefixComponentWrapperProps:prop_types__WEBPACK_IMPORTED_MODULE_10___default().object,textProps:prop_types__WEBPACK_IMPORTED_MODULE_10___default().object,suffixProps:prop_types__WEBPACK_IMPORTED_MODULE_10___default().object,shouldCheckShowNativeToken:prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool,privacyMode:prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool};UserPreferencedCurrencyDisplay.propTypes=UserPreferencedCurrencyDisplayPropTypes,UserPreferencedCurrencyDisplay.__docgenInfo={description:"@param {PropTypes.InferProps<typeof UserPreferencedCurrencyDisplayPropTypes>>}",methods:[],displayName:"UserPreferencedCurrencyDisplay",props:{privacyMode:{defaultValue:{value:"false",computed:!1},description:"",type:{name:"bool"},required:!1},className:{description:"",type:{name:"string"},required:!1},account:{description:"",type:{name:"object"},required:!1},"data-testid":{description:"",type:{name:"string"},required:!1},prefix:{description:"",type:{name:"string"},required:!1},value:{description:"",type:{name:"string"},required:!1},numberOfDecimals:{description:"",type:{name:"union",value:[{name:"string"},{name:"number"}]},required:!1},hideLabel:{description:"",type:{name:"bool"},required:!1},hideTitle:{description:"",type:{name:"bool"},required:!1},style:{description:"",type:{name:"object"},required:!1},showEthLogo:{description:"",type:{name:"bool"},required:!1},type:{description:"",type:{name:"enum",value:[{value:"'PRIMARY'",computed:!1},{value:"'SECONDARY'",computed:!1}]},required:!1},ethNumberOfDecimals:{description:"",type:{name:"union",value:[{name:"string"},{name:"number"}]},required:!1},fiatNumberOfDecimals:{description:"",type:{name:"union",value:[{name:"string"},{name:"number"}]},required:!1},showFiat:{description:"",type:{name:"bool"},required:!1},showNative:{description:"",type:{name:"bool"},required:!1},showCurrencySuffix:{description:"",type:{name:"bool"},required:!1},currency:{description:"Following are the props from CurrencyDisplay component.\nUserPreferencedCurrencyDisplay component should also accept all the props from Currency component",type:{name:"string"},required:!1},denomination:{description:"",type:{name:"enum",value:[{value:"EtherDenomination.GWEI",computed:!0},{value:"EtherDenomination.ETH",computed:!0}]},required:!1},displayValue:{description:"",type:{name:"string"},required:!1},prefixComponent:{description:"",type:{name:"node"},required:!1},suffix:{description:"",type:{name:"union",value:[{name:"string"},{name:"bool"}]},required:!1},prefixComponentWrapperProps:{description:"",type:{name:"object"},required:!1},textProps:{description:"",type:{name:"object"},required:!1},suffixProps:{description:"",type:{name:"object"},required:!1},shouldCheckShowNativeToken:{description:"",type:{name:"bool"},required:!1}}}},"./ui/components/ui/account-list/index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>account_list});var react=__webpack_require__("./node_modules/react/index.js"),prop_types=__webpack_require__("./node_modules/prop-types/index.js"),prop_types_default=__webpack_require__.n(prop_types),classnames=__webpack_require__("./node_modules/classnames/index.js"),classnames_default=__webpack_require__.n(classnames),lodash=__webpack_require__("./node_modules/lodash/lodash.js"),dist=__webpack_require__("./node_modules/@metamask/keyring-api/dist/index.mjs"),useI18nContext=__webpack_require__("./ui/hooks/useI18nContext.js"),identicon=__webpack_require__("./ui/components/ui/identicon/index.js"),user_preferenced_currency_display=__webpack_require__("./ui/components/app/user-preferenced-currency-display/index.js"),common=__webpack_require__("./ui/helpers/constants/common.ts"),tooltip=__webpack_require__("./ui/components/ui/tooltip/index.js"),component_library=__webpack_require__("./ui/components/component-library/index.ts"),design_system=__webpack_require__("./ui/helpers/constants/design-system.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 _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 AccountList=function(param){var selectNewAccountViaModal=param.selectNewAccountViaModal,accounts=param.accounts,addressLastConnectedMap=param.addressLastConnectedMap,selectedAccounts=param.selectedAccounts,nativeCurrency=param.nativeCurrency,allAreSelected=param.allAreSelected,deselectAll=param.deselectAll,selectAll=param.selectAll,handleAccountClick=param.handleAccountClick,t=(0,useI18nContext.P)(),selectedAccountScrollRef=(0,react.useRef)(null);(0,react.useLayoutEffect)(function(){var _selectedAccountScrollRef_current;null===(_selectedAccountScrollRef_current=selectedAccountScrollRef.current)||void 0===_selectedAccountScrollRef_current||_selectedAccountScrollRef_current.scrollIntoView({behavior:"smooth"})},[]);var firstSelectedAccount=_sliced_to_array(selectedAccounts,1)[0],handleEvmAccountClick=function(account){(0,dist.aw)(account.type)&&handleAccountClick(account.address)};return react.createElement("div",{className:"choose-account-list"},react.createElement(function(){var checked=allAreSelected(),isIndeterminate=!checked&&0!==selectedAccounts.size;return react.createElement("div",{className:classnames_default()({"choose-account-list__header--one-item":1===accounts.length,"choose-account-list__header--multiple-items":accounts.length>1})},accounts.length>1?react.createElement("div",{className:"choose-account-list__select-all"},react.createElement(component_library.Sc,{className:"choose-account-list__header-check-box","data-testid":"choose-account-list-operate-all-check-box",isChecked:checked,isIndeterminate:isIndeterminate,onClick:function(){return allAreSelected()?deselectAll():selectAll()}}),react.createElement(component_library.EY,{as:"div",className:"choose-account-list__text-grey",color:design_system.r7.textAlternative},t("selectAll")),react.createElement(tooltip.A,{position:"bottom",html:react.createElement("div",{style:{width:200,padding:4}},t("selectingAllWillAllow"))},react.createElement(component_library.In,{name:component_library.$M.Info,color:design_system.Li.iconMuted,className:"info-circle",marginInlineStart:2}))):null,react.createElement(component_library.vx,{color:design_system.r7.infoDefault,variant:design_system.J3.bodyMdMedium,style:{cursor:"pointer"},onClick:function(){return selectNewAccountViaModal(handleAccountClick)}},t("newAccount")))},null),react.createElement("div",{className:"choose-account-list__wrapper"},react.createElement(component_library.az,{className:"choose-account-list__list",style:{overflowX:"hidden"}},accounts.map(function(account,index){var address=account.address,addressLabel=account.addressLabel,balance=account.balance,isSelectedAccount=selectedAccounts.has(address);return react.createElement(component_library.az,{display:design_system.nl.Flex,width:design_system.Zf.Full,key:"choose-account-list-".concat(index),"data-testid":"choose-account-list-".concat(index),onClick:function(){return handleEvmAccountClick(account)},className:"choose-account-list__account",ref:isSelectedAccount&&address===firstSelectedAccount?selectedAccountScrollRef:null,backgroundColor:isSelectedAccount?design_system.Q1.primaryMuted:design_system.i0.backgroundDefault},react.createElement(component_library.az,{display:design_system.nl.Flex,width:design_system.Zf.Full,alignItems:design_system.k2.center},react.createElement(component_library.Sc,{isChecked:isSelectedAccount,isDisabled:!(0,dist.aw)(account.type)}),react.createElement(component_library.az,{marginLeft:2},react.createElement(identicon.A,{diameter:34,address:address})),react.createElement(component_library.az,{display:design_system.nl.Flex,justifyContent:design_system.A9.spaceBetween,width:design_system.Zf.Full,paddingLeft:3,style:{minWidth:0}},react.createElement(component_library.az,{display:design_system.nl.Flex,flexDirection:design_system.bo.Column,width:design_system.Zf.Full},react.createElement(component_library.EY,{variant:design_system.J3.bodyMdMedium,style:{textWrap:"nowrap"},ellipsis:!0},addressLabel),react.createElement(component_library.az,{display:design_system.nl.Flex},react.createElement(user_preferenced_currency_display.A,{account:account,type:common.jd,value:balance,style:{color:"var(--color-text-alternative)",flexWrap:"nowrap"},suffix:nativeCurrency,numberOfDecimals:2,ethNumberOfDecimals:5,textProps:{color:design_system.r7.textAlternative,variant:design_system.J3.bodySm},suffixProps:{color:design_system.r7.textAlternative,variant:design_system.J3.bodySm}})))),addressLastConnectedMap[address]?react.createElement(tooltip.A,{title:"".concat(t("lastConnected")," ").concat(addressLastConnectedMap[address])},react.createElement(component_library.In,{name:component_library.$M.Info,color:design_system.Li.iconMuted,className:"info-circle",marginInlineStart:2})):null))}))))};AccountList.propTypes={accounts:prop_types_default().arrayOf(prop_types_default().shape({address:prop_types_default().string,addressLabel:prop_types_default().string,lastConnectedDate:prop_types_default().string,balance:prop_types_default().string})).isRequired,selectNewAccountViaModal:prop_types_default().func.isRequired,addressLastConnectedMap:prop_types_default().object,nativeCurrency:prop_types_default().string.isRequired,selectedAccounts:prop_types_default().object.isRequired,allAreSelected:prop_types_default().func.isRequired,deselectAll:prop_types_default().func.isRequired,selectAll:prop_types_default().func.isRequired,handleAccountClick:prop_types_default().func.isRequired};let account_list=(0,react.memo)(AccountList,function(prevProps,nextProps){return(0,lodash.isEqual)(prevProps.selectedAccounts,nextProps.selectedAccounts)});AccountList.__docgenInfo={description:"",methods:[],displayName:"AccountList",props:{accounts:{description:"Array of user account objects",type:{name:"arrayOf",value:{name:"shape",value:{address:{name:"string",required:!1},addressLabel:{name:"string",required:!1},lastConnectedDate:{name:"string",required:!1},balance:{name:"string",required:!1}}}},required:!0},selectNewAccountViaModal:{description:"Function to select a new account via modal",type:{name:"func"},required:!0},addressLastConnectedMap:{description:"A map of the last connected addresses",type:{name:"object"},required:!1},nativeCurrency:{description:"Native currency of current chain",type:{name:"string"},required:!0},selectedAccounts:{description:"Currently selected accounts",type:{name:"object"},required:!0},allAreSelected:{description:"Function to check if all accounts are selected",type:{name:"func"},required:!0},deselectAll:{description:"Function to deselect all accounts",type:{name:"func"},required:!0},selectAll:{description:"Function to select all accounts",type:{name:"func"},required:!0},handleAccountClick:{description:"Function to handle account click",type:{name:"func"},required:!0}}}},"./ui/components/ui/identicon/index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>identicon_container});var es=__webpack_require__("./node_modules/react-redux/es/index.js"),selectors=__webpack_require__("./ui/selectors/index.js"),nft=__webpack_require__("./ui/selectors/nft.ts"),identicon_component=__webpack_require__("./ui/components/ui/identicon/identicon.component.js");let identicon_container=(0,es.Ng)(function(state){var _state_metamask=state.metamask,useBlockie=_state_metamask.useBlockie,ipfsGateway=_state_metamask.ipfsGateway;return{useBlockie:useBlockie,tokenList:(0,selectors.iM3)(state),ipfsGateway:ipfsGateway,watchedNftContracts:(0,nft.k9)(state)}})(identicon_component.A);identicon_component.A.__docgenInfo={description:"",methods:[{name:"loadImage",docblock:null,modifiers:["async"],params:[],returns:null},{name:"renderImage",docblock:null,modifiers:[],params:[],returns:null},{name:"renderJazzicon",docblock:null,modifiers:[],params:[],returns:null},{name:"renderBlockie",docblock:null,modifiers:[],params:[],returns:null},{name:"renderBlockieOrJazzIcon",docblock:null,modifiers:[],params:[],returns:null},{name:"getTokenImage",docblock:null,modifiers:[],params:[],returns:null},{name:"getNftImage",docblock:null,modifiers:[],params:[],returns:null},{name:"getTokenList",docblock:null,modifiers:[],params:[],returns:null}],displayName:"Identicon",props:{addBorder:{defaultValue:{value:"false",computed:!1},description:"Adds blue border around the Identicon used for selected account.\nIncreases the width and height of the Identicon by 8px",type:{name:"bool"},required:!1},address:{defaultValue:{value:"undefined",computed:!0},description:"Address used for generating random image",type:{name:"string"},required:!1},className:{defaultValue:{value:"undefined",computed:!0},description:"Add custom css class",type:{name:"string"},required:!1},diameter:{defaultValue:{value:"46",computed:!1},description:"Sets the width and height of the inner img element\nIf addBorder is true will increase components height and width by 8px",type:{name:"number"},required:!1},image:{defaultValue:{value:"undefined",computed:!0},description:"Used as the image source of the Identicon",type:{name:"union",value:[{name:"string"},{name:"array"}]},required:!1},useBlockie:{defaultValue:{value:"false",computed:!1},description:"Use the blockie type random image generator",type:{name:"bool"},required:!1},alt:{defaultValue:{value:"''",computed:!1},description:"The alt text of the image",type:{name:"string"},required:!1},tokenList:{defaultValue:{value:"{}",computed:!1},description:"Add list of token in object",type:{name:"object"},required:!1},watchedNftContracts:{defaultValue:{value:"{}",computed:!1},description:"Watched NFT contract data keyed by address",type:{name:"object"},required:!1},imageBorder:{description:"Check if show image border",type:{name:"bool"},required:!1},ipfsGateway:{description:"User preferred IPFS gateway",type:{name:"string"},required:!1}}}},"./ui/hooks/useUserPreferencedCurrency.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{r:()=>useUserPreferencedCurrency});var es=__webpack_require__("./node_modules/react-redux/es/index.js"),selectors=__webpack_require__("./ui/selectors/index.js"),multichain=__webpack_require__("./ui/selectors/multichain.ts"),common=__webpack_require__("./ui/helpers/constants/common.ts"),constants_common=__webpack_require__("./shared/constants/common.ts"),useMultichainSelector=__webpack_require__("./ui/hooks/useMultichainSelector.ts");function useUserPreferencedCurrency(type){var _opts_account,opts=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},selectedAccount=(0,es.d4)(selectors._rF),account=null!==(_opts_account=opts.account)&&void 0!==_opts_account?_opts_account:selectedAccount,nativeCurrency=(0,useMultichainSelector.t)(multichain.zz,account),showNativeTokenAsMainBalance=(0,es.d4)(selectors.lX9,es.bN).showNativeTokenAsMainBalance,showFiat=(0,useMultichainSelector.t)(multichain.J7,account),fiatReturn={currency:(0,useMultichainSelector.t)(multichain.H5,account),numberOfDecimals:opts.numberOfDecimals||opts.fiatNumberOfDecimals||2},nativeReturn={currency:nativeCurrency||constants_common.sk.ETH,numberOfDecimals:opts.numberOfDecimals||opts.ethNumberOfDecimals||8};return opts.showNativeOverride?nativeReturn:opts.showFiatOverride?fiatReturn:showFiat?opts.shouldCheckShowNativeToken&&showNativeTokenAsMainBalance||!opts.shouldCheckShowNativeToken?type===common.jd?nativeReturn:fiatReturn:type===common.jd?fiatReturn:nativeReturn:nativeReturn}},"./test/jest/mocks.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{H5:()=>createMockInternalAccount,rV:()=>getSelectedInternalAccountFromMockState});var _metamask_keyring_api__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@metamask/keyring-api/dist/index.mjs"),_metamask_keyring_controller__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@metamask/keyring-controller/dist/KeyringController.mjs"),uuid__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/uuid/dist/esm-browser/v4.js"),_metamask_accounts_controller__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/@metamask/accounts-controller/dist/utils.mjs"),_ui_ducks_send__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./ui/ducks/send/index.js");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 _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}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 createMockInternalAccount(){var methods,_ref=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref_name=_ref.name,name=void 0===_ref_name?"Account 1":_ref_name,_ref_address=_ref.address,_ref_type=_ref.type,type=void 0===_ref_type?_metamask_keyring_api__WEBPACK_IMPORTED_MODULE_0__.j0.Eoa:_ref_type,_ref_keyringType=_ref.keyringType,keyringType=void 0===_ref_keyringType?_metamask_keyring_controller__WEBPACK_IMPORTED_MODULE_2__.rI.hd:_ref_keyringType,_ref_lastSelected=_ref.lastSelected,_ref_snapOptions=_ref.snapOptions,_ref_options=_ref.options,options=void 0===_ref_options?void 0:_ref_options;switch(type){case _metamask_keyring_api__WEBPACK_IMPORTED_MODULE_0__.j0.Eoa:methods=[_metamask_keyring_api__WEBPACK_IMPORTED_MODULE_0__.F.PersonalSign,_metamask_keyring_api__WEBPACK_IMPORTED_MODULE_0__.F.SignTransaction,_metamask_keyring_api__WEBPACK_IMPORTED_MODULE_0__.F.SignTypedDataV1,_metamask_keyring_api__WEBPACK_IMPORTED_MODULE_0__.F.SignTypedDataV3,_metamask_keyring_api__WEBPACK_IMPORTED_MODULE_0__.F.SignTypedDataV4];break;case _metamask_keyring_api__WEBPACK_IMPORTED_MODULE_0__.j0.Erc4337:methods=[_metamask_keyring_api__WEBPACK_IMPORTED_MODULE_0__.F.PatchUserOperation,_metamask_keyring_api__WEBPACK_IMPORTED_MODULE_0__.F.PrepareUserOperation,_metamask_keyring_api__WEBPACK_IMPORTED_MODULE_0__.F.SignUserOperation];break;case _metamask_keyring_api__WEBPACK_IMPORTED_MODULE_0__.fi.P2wpkh:methods=[_metamask_keyring_api__WEBPACK_IMPORTED_MODULE_0__.Dj.SendBitcoin];break;default:throw Error("Unknown account type: ".concat(type))}return{address:void 0===_ref_address?"0xd5e099c71b797516c10ed0f0d895f429c2781111":_ref_address,id:(0,uuid__WEBPACK_IMPORTED_MODULE_3__.A)(),metadata:{name:null!=name?name:"".concat((0,_metamask_accounts_controller__WEBPACK_IMPORTED_MODULE_4__.o7)(keyringType)," 1"),importTime:Date.now(),keyring:{type:keyringType},snap:void 0===_ref_snapOptions?void 0:_ref_snapOptions,lastSelected:void 0===_ref_lastSelected?0:_ref_lastSelected},options:null!=options?options:{},methods:methods,type:type}}_object_spread_props(_object_spread({},_ui_ducks_send__WEBPACK_IMPORTED_MODULE_1__.ue),{currentTransactionUUID:"test-uuid",draftTransactions:{"test-uuid":_object_spread({},_ui_ducks_send__WEBPACK_IMPORTED_MODULE_1__.zv)}});var getSelectedInternalAccountFromMockState=function(state){return state.metamask.internalAccounts.accounts[state.metamask.internalAccounts.selectedAccount]}},"./ui/selectors/nft.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{k9:()=>getNftContractsByAddressOnCurrentChain,nG:()=>getNftContractsByAddressByChain});var reselect__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/reselect/dist/reselect.mjs"),_selectors__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./ui/selectors/selectors.js");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 _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 _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 _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 _object_without_properties(source,excluded){if(null==source)return{};var key,i,target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],!(excluded.indexOf(key)>=0)&&Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}function _object_without_properties_loose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],excluded.indexOf(key)>=0||(target[key]=source[key]);return target}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 getNftContractsByChainByAccount(state){var _state_metamask_allNftContracts;return null!==(_state_metamask_allNftContracts=state.metamask.allNftContracts)&&void 0!==_state_metamask_allNftContracts?_state_metamask_allNftContracts:{}}function getNftsByChainByAccount(state){var _state_metamask_allNfts;return null!==(_state_metamask_allNfts=state.metamask.allNfts)&&void 0!==_state_metamask_allNfts?_state_metamask_allNfts:{}}var getNftContractsByAddressByChain=(0,reselect__WEBPACK_IMPORTED_MODULE_1__.Mz)(getNftContractsByChainByAccount,function(nftContractsByChainByAccount){return Object.keys(nftContractsByChainByAccount).map(function(account){return Object.keys(nftContractsByChainByAccount[account]).map(function(chainId){return nftContractsByChainByAccount[account][chainId].map(function(contract){return _object_spread_props(_object_spread({},contract),{chainId:chainId})})})}).flat().flat().reduce(function(acc,contract){var _acc_chainId,chainId=contract.chainId,data=_object_without_properties(contract,["chainId"]),chainIdContracts=null!==(_acc_chainId=acc[chainId])&&void 0!==_acc_chainId?_acc_chainId:{};return acc[chainId]=chainIdContracts,chainIdContracts[data.address.toLowerCase()]=data,acc},{})}),getNftContractsByAddressOnCurrentChain=(0,reselect__WEBPACK_IMPORTED_MODULE_1__.Mz)(function(state){return(0,_selectors__WEBPACK_IMPORTED_MODULE_0__.wXH)(state)},getNftContractsByAddressByChain,function(currentChainId,nftContractsByAddressByChain){var _nftContractsByAddressByChain_currentChainId;return null!==(_nftContractsByAddressByChain_currentChainId=nftContractsByAddressByChain[currentChainId])&&void 0!==_nftContractsByAddressByChain_currentChainId?_nftContractsByAddressByChain_currentChainId:{}});(0,reselect__WEBPACK_IMPORTED_MODULE_1__.Mz)(getNftsByChainByAccount,function(nftsByChainByAccount){return Object.values(nftsByChainByAccount).reduce(function(acc,nftsByChain){var nftsArrays=Object.values(nftsByChain);return acc.concat.apply(acc,_to_consumable_array(nftsArrays))},[])})}}]);