-
Notifications
You must be signed in to change notification settings - Fork 31
/
11370.8d177ae0.iframe.bundle.js
1 lines (1 loc) · 10.8 KB
/
11370.8d177ae0.iframe.bundle.js
1
"use strict";(globalThis.webpackChunkmetamask_crx=globalThis.webpackChunkmetamask_crx||[]).push([[11370],{"./ui/ducks/institutional/institutional.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{E0:()=>getInstitutionalConnectRequests,FB:()=>getChannelId,Oe:()=>getConnectionRequest});var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@reduxjs/toolkit/dist/redux-toolkit.cjs.development.js"),name="institutionalFeatures",initialState={metamask: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}({},name,{connectRequests:void 0,channelId:void 0,connectionRequest:void 0})};(0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__.createSlice)({name:name,initialState:initialState,reducers:{}}).reducer;var getInstitutionalConnectRequests=function(state){var _state_metamask_name;return null===(_state_metamask_name=state.metamask[name])||void 0===_state_metamask_name?void 0:_state_metamask_name.connectRequests},getChannelId=function(state){var _state_metamask_name;return null===(_state_metamask_name=state.metamask[name])||void 0===_state_metamask_name?void 0:_state_metamask_name.channelId},getConnectionRequest=function(state){var _state_metamask_name;return null===(_state_metamask_name=state.metamask[name])||void 0===_state_metamask_name?void 0:_state_metamask_name.connectionRequest}},"./ui/store/institutional/institution-background.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Hq:()=>showInteractiveReplacementTokenBanner,bB:()=>mmiActionsFactory,c:()=>setPersonalMessageInProgress,vn:()=>setNoteToTraderMessage});var loglevel__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/loglevel/lib/loglevel.js"),loglevel__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(loglevel__WEBPACK_IMPORTED_MODULE_0__),_actions__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./ui/store/actions.ts"),_background_connection__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/store/background-connection.ts"),_shared_modules_error__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./shared/modules/error.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 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 _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)}}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 showInteractiveReplacementTokenBanner(param){var _ref,url=param.url,oldRefreshToken=param.oldRefreshToken;return _ref=_async_to_generator(function(dispatch){var err;return _ts_generator(this,function(_state){switch(_state.label){case 0:return _state.trys.push([0,2,,3]),[4,(0,_background_connection__WEBPACK_IMPORTED_MODULE_2__.Rb)("showInteractiveReplacementTokenBanner",[{url:url,oldRefreshToken:oldRefreshToken}])];case 1:return _state.sent(),[3,3];case 2:if(err=_state.sent())throw dispatch((0,_actions__WEBPACK_IMPORTED_MODULE_1__.displayWarning)(err)),Error((0,_shared_modules_error__WEBPACK_IMPORTED_MODULE_3__.u1)(err));return[3,3];case 3:return[2]}})}),function(dispatch){return _ref.apply(this,arguments)}}function setNoteToTraderMessage(message){var _ref;return _ref=_async_to_generator(function(dispatch){var error;return _ts_generator(this,function(_state){switch(_state.label){case 0:return _state.trys.push([0,2,,3]),[4,(0,_background_connection__WEBPACK_IMPORTED_MODULE_2__.Rb)("setNoteToTraderMessage",[message])];case 1:return _state.sent(),[3,3];case 2:if(error=_state.sent())throw dispatch((0,_actions__WEBPACK_IMPORTED_MODULE_1__.displayWarning)(error.message)),Error(error.message);return[3,3];case 3:return[2]}})}),function(dispatch){return _ref.apply(this,arguments)}}function setPersonalMessageInProgress(msgId){var _ref;return _ref=_async_to_generator(function(dispatch){var error;return _ts_generator(this,function(_state){switch(_state.label){case 0:dispatch((0,_actions__WEBPACK_IMPORTED_MODULE_1__.showLoadingIndication)()),_state.label=1;case 1:return _state.trys.push([1,3,4,6]),[4,(0,_background_connection__WEBPACK_IMPORTED_MODULE_2__.Rb)("setPersonalMessageInProgress",[msgId])];case 2:return _state.sent(),[3,6];case 3:return error=_state.sent(),loglevel__WEBPACK_IMPORTED_MODULE_0___default().error(error),dispatch((0,_actions__WEBPACK_IMPORTED_MODULE_1__.displayWarning)(error)),[3,6];case 4:return[4,(0,_actions__WEBPACK_IMPORTED_MODULE_1__.forceUpdateMetamaskState)(dispatch)];case 5:return _state.sent(),dispatch((0,_actions__WEBPACK_IMPORTED_MODULE_1__.hideLoadingIndication)()),[7];case 6:return[2]}})}),function(dispatch){return _ref.apply(this,arguments)}}function mmiActionsFactory(){function createAsyncAction(name,params,useForceUpdateMetamaskState,loadingText){var _ref;return loglevel__WEBPACK_IMPORTED_MODULE_0___default().debug("background.".concat(name)),_ref=_async_to_generator(function(dispatch){var result,error;return _ts_generator(this,function(_state){switch(_state.label){case 0:loadingText&&dispatch((0,_actions__WEBPACK_IMPORTED_MODULE_1__.showLoadingIndication)(loadingText)),_state.label=1;case 1:return _state.trys.push([1,3,,4]),[4,(0,_background_connection__WEBPACK_IMPORTED_MODULE_2__.Rb)(name,_to_consumable_array(params))];case 2:return result=_state.sent(),[3,4];case 3:if(error=_state.sent(),dispatch((0,_actions__WEBPACK_IMPORTED_MODULE_1__.displayWarning)(error)),(0,_shared_modules_error__WEBPACK_IMPORTED_MODULE_3__.Ef)(error))throw Error((0,_shared_modules_error__WEBPACK_IMPORTED_MODULE_3__.u1)(error));throw error;case 4:if(loadingText&&dispatch((0,_actions__WEBPACK_IMPORTED_MODULE_1__.hideLoadingIndication)()),!useForceUpdateMetamaskState)return[3,6];return[4,(0,_actions__WEBPACK_IMPORTED_MODULE_1__.forceUpdateMetamaskState)(dispatch)];case 5:_state.sent(),_state.label=6;case 6:return[2,result]}})}),function(dispatch){return _ref.apply(this,arguments)}}function createAction(name,payload){return function(){(0,_background_connection__WEBPACK_IMPORTED_MODULE_2__.AN)(name,[payload],function(err){if((0,_shared_modules_error__WEBPACK_IMPORTED_MODULE_3__.Ef)(err))throw Error((0,_shared_modules_error__WEBPACK_IMPORTED_MODULE_3__.u1)(err))})}}return{connectCustodyAddresses:function(custodianType,custodianName,newAccounts){return createAsyncAction("connectCustodyAddresses",[custodianType,custodianName,newAccounts],_actions__WEBPACK_IMPORTED_MODULE_1__.forceUpdateMetamaskState,"Looking for your custodian account...")},getCustodianAccounts:function(token,envName,custody,getNonImportedAccounts){return createAsyncAction("getCustodianAccounts",[token,envName,custody,getNonImportedAccounts],_actions__WEBPACK_IMPORTED_MODULE_1__.forceUpdateMetamaskState,"Getting custodian accounts...")},getCustodianTransactionDeepLink:function(address,txId){return createAsyncAction("getCustodianTransactionDeepLink",[address,txId],_actions__WEBPACK_IMPORTED_MODULE_1__.forceUpdateMetamaskState)},getCustodianConfirmDeepLink:function(txId){return createAsyncAction("getCustodianConfirmDeepLink",[txId],_actions__WEBPACK_IMPORTED_MODULE_1__.forceUpdateMetamaskState)},getCustodianSignMessageDeepLink:function(from,custodyTxId){return createAsyncAction("getCustodianSignMessageDeepLink",[from,custodyTxId],_actions__WEBPACK_IMPORTED_MODULE_1__.forceUpdateMetamaskState)},getCustodianToken:function(custody){return createAsyncAction("getCustodianToken",[custody],_actions__WEBPACK_IMPORTED_MODULE_1__.forceUpdateMetamaskState)},getCustodianJWTList:function(custody){return createAsyncAction("getCustodianJWTList",[custody],_actions__WEBPACK_IMPORTED_MODULE_1__.forceUpdateMetamaskState)},setWaitForConfirmDeepLinkDialog:function(waitForConfirmDeepLinkDialog){return createAction("setWaitForConfirmDeepLinkDialog",waitForConfirmDeepLinkDialog)},removeAddTokenConnectRequest:function(param){return createAction("removeAddTokenConnectRequest",{origin:param.origin,environment:param.environment,token:param.token})},getMmiConfiguration:function(){return createAsyncAction("getMmiConfiguration",[])},getAllCustodianAccountsWithToken:function(custodyType,token){return createAsyncAction("getAllCustodianAccountsWithToken",[custodyType,token])},setCustodianNewRefreshToken:function(param){return createAsyncAction("setCustodianNewRefreshToken",[{address:param.address,refreshToken:param.refreshToken}])},setConnectionRequest:function(payload){return createAsyncAction("setConnectionRequest",[payload])}}}}}]);