Socket
Socket
Sign inDemoInstall

@web3modal/core

Package Overview
Dependencies
Maintainers
4
Versions
374
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@web3modal/core - npm Package Compare versions

Comparing version 2.3.2 to 2.3.3

2

dist/index.js

@@ -1,2 +0,2 @@

import{proxy as p,subscribe as C}from"valtio/vanilla";import{Buffer as $}from"buffer";let M;const m={ethereumClient:void 0,setEthereumClient(e){M=e},client(){if(M)return M;throw new Error("ClientCtrl has no client set")}},i=p({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),f={state:i,subscribe(e){return C(i,()=>e(i))},push(e,t){e!==i.view&&(i.view=e,t&&(i.data=t),i.history.push(e))},reset(e){i.view=e,i.history=[e]},replace(e){i.history.length>1&&(i.history[i.history.length-1]=e,i.view=e)},goBack(){if(i.history.length>1){i.history.pop();const[e]=i.history.slice(-1);i.view=e}},setData(e){i.data=e}},c={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",W3M_VERSION:"W3M_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return c.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return c.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},formatNativeUrl(e,t,n){if(c.isHttpUrl(e))return this.formatUniversalUrl(e,t,n);let s=e;s.includes("://")||(s=e.replaceAll("/","").replaceAll(":",""),s=`${s}://`),this.setWalletConnectDeepLink(s,n);const a=encodeURIComponent(t);return`${s}wc?uri=${a}`},formatUniversalUrl(e,t,n){if(!c.isHttpUrl(e))return this.formatNativeUrl(e,t,n);let s=e;e.endsWith("/")&&(s=e.slice(0,-1)),this.setWalletConnectDeepLink(s,n);const a=encodeURIComponent(t);return`${s}/wc?uri=${a}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){localStorage.setItem(c.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))},setWalletConnectAndroidDeepLink(e){const[t]=e.split("?");localStorage.setItem(c.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))},setWeb3ModalVersionInStorage(){typeof localStorage<"u"&&localStorage.setItem(c.W3M_VERSION,"2.3.2")},getWalletRouterData(){var e;const t=(e=f.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t},getSwitchNetworkRouterData(){var e;const t=(e=f.state.data)==null?void 0:e.SwitchNetwork;if(!t)throw new Error('Missing "SwitchNetwork" view data');return t}},r=p({selectedChain:void 0,chains:void 0,standaloneChains:void 0,standaloneUri:void 0,isStandalone:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1,isInjectedMobile:!1,walletConnectVersion:1}),d={state:r,subscribe(e){return C(r,()=>e(r))},setChains(e){r.chains=e},setStandaloneChains(e){r.standaloneChains=e},setStandaloneUri(e){r.standaloneUri=e},getSelectedChain(){const e=m.client().getNetwork().chain;return e&&(r.selectedChain=e),r.selectedChain},setSelectedChain(e){r.selectedChain=e},setIsStandalone(e){r.isStandalone=e},setIsCustomDesktop(e){r.isCustomDesktop=e},setIsCustomMobile(e){r.isCustomMobile=e},setIsDataLoaded(e){r.isDataLoaded=e},setIsUiLoaded(e){r.isUiLoaded=e},setWalletConnectVersion(e){r.walletConnectVersion=e},setIsInjectedMobile(e){r.isInjectedMobile=e}},O=p({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chainImages:void 0,tokenImages:void 0,tokenContracts:void 0,standaloneChains:void 0,enableStandaloneMode:!1,enableNetworkView:!1,enableAccountView:!0,enableExplorer:!0,defaultChain:void 0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),b={state:O,subscribe(e){return C(O,()=>e(O))},setConfig(e){var t,n,s,a;d.setStandaloneChains(e.standaloneChains),d.setIsStandalone(!!((t=e.standaloneChains)!=null&&t.length)||!!e.enableStandaloneMode),d.setIsCustomMobile(!!((n=e.mobileWallets)!=null&&n.length)),d.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),d.setWalletConnectVersion((a=e.walletConnectVersion)!=null?a:1),d.state.isStandalone||(d.setChains(m.client().chains),d.setIsInjectedMobile(c.isMobile()&&m.client().isInjectedProviderInstalled())),e.defaultChain&&d.setSelectedChain(e.defaultChain),c.setWeb3ModalVersionInStorage(),Object.assign(O,e)}},o=p({address:void 0,profileName:void 0,profileAvatar:void 0,profileLoading:!1,balanceLoading:!1,balance:void 0,isConnected:!1}),V={state:o,subscribe(e){return C(o,()=>e(o))},getAccount(){const e=m.client().getAccount();o.address=e.address,o.isConnected=e.isConnected},async fetchProfile(e,t){var n;try{o.profileLoading=!0;const s=t??o.address,a=(n=d.state.chains)==null?void 0:n.find(l=>l.id===1);if(s&&a){const[l,u]=await Promise.all([m.client().fetchEnsName({address:s,chainId:1}),m.client().fetchEnsAvatar({address:s,chainId:1})]);u&&await e(u),o.profileName=l,o.profileAvatar=u}}finally{o.profileLoading=!1}},async fetchBalance(e){try{const{chain:t}=m.client().getNetwork(),{tokenContracts:n}=b.state;let s;t&&n&&(s=n[t.id]),o.balanceLoading=!0;const a=e??o.address;if(a){const l=await m.client().fetchBalance({address:a,token:s});o.balance={amount:l.formatted,symbol:l.symbol}}}finally{o.balanceLoading=!1}},setAddress(e){o.address=e},setIsConnected(e){o.isConnected=e},resetBalance(){o.balance=void 0},resetAccount(){o.address=void 0,o.isConnected=!1,o.profileName=void 0,o.profileAvatar=void 0,o.balance=void 0}},S="https://explorer-api.walletconnect.com";async function j(e,t){const n=new URL(e,S);return n.searchParams.append("projectId",b.state.projectId),Object.entries(t).forEach(([s,a])=>{a&&n.searchParams.append(s,String(a))}),(await fetch(n)).json()}const h={async getDesktopListings(e){return j("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return j("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return j("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return j("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${S}/w3m/v1/getWalletImage/${e}?projectId=${b.state.projectId}`},getAssetImageUrl(e){return`${S}/w3m/v1/getAssetImage/${e}?projectId=${b.state.projectId}`}};var R=Object.defineProperty,U=Object.getOwnPropertySymbols,_=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable,N=(e,t,n)=>t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,H=(e,t)=>{for(var n in t||(t={}))_.call(t,n)&&N(e,n,t[n]);if(U)for(var n of U(t))B.call(t,n)&&N(e,n,t[n]);return e};const k=c.isMobile(),g=p({wallets:{listings:[],total:0,page:1},injectedWallets:[],search:{listings:[],total:0,page:1},recomendedWallets:[]}),X={state:g,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=b.state;if(e==="NONE"||t==="ALL"&&!e)return g.recomendedWallets;if(c.isArray(e)){const n={recommendedIds:e.join(",")},{listings:s}=await h.getAllListings(n),a=Object.values(s);a.sort((l,u)=>{const v=e.indexOf(l.id),I=e.indexOf(u.id);return v-I}),g.recomendedWallets=a}else{const{standaloneChains:n,walletConnectVersion:s}=d.state,a=n?.join(","),l=c.isArray(t),u={page:1,entries:c.RECOMMENDED_WALLET_AMOUNT,chains:a,version:s,excludedIds:l?t.join(","):void 0},{listings:v}=k?await h.getMobileListings(u):await h.getDesktopListings(u);g.recomendedWallets=Object.values(v)}return g.recomendedWallets},async getWallets(e){const t=H({},e),{explorerRecommendedWalletIds:n,explorerExcludedWalletIds:s}=b.state,{recomendedWallets:a}=g;if(s==="ALL")return g.wallets;a.length?t.excludedIds=a.map(T=>T.id).join(","):c.isArray(n)&&(t.excludedIds=n.join(",")),c.isArray(s)&&(t.excludedIds=[t.excludedIds,s].filter(Boolean).join(","));const{page:l,search:u}=e,{listings:v,total:I}=k?await h.getMobileListings(t):await h.getDesktopListings(t),y=Object.values(v),A=u?"search":"wallets";return g[A]={listings:[...g[A].listings,...y],total:I,page:l??1},{listings:y,total:I}},async getInjectedWallets(){const{listings:e}=await h.getInjectedListings({}),t=Object.values(e);return g.injectedWallets=t,g.injectedWallets},getWalletImageUrl(e){return h.getWalletImageUrl(e)},getAssetImageUrl(e){return h.getAssetImageUrl(e)},resetSearch(){g.search={listings:[],total:0,page:1}}},W=p({pairingUri:"",pairingError:!1}),D={state:W,subscribe(e){return C(W,()=>e(W))},setPairingUri(e){W.pairingUri=e},setPairingError(e){W.pairingError=e}},L=p({open:!1}),Y={state:L,subscribe(e){return C(L,()=>e(L))},async open(e){return new Promise(t=>{const{isStandalone:n,isUiLoaded:s,isDataLoaded:a}=d.state,{pairingUri:l}=D.state,{isConnected:u}=V.state,{enableNetworkView:v}=b.state;if(n?(d.setStandaloneUri(e?.uri),d.setStandaloneChains(e?.standaloneChains),f.reset("ConnectWallet")):e!=null&&e.route?f.reset(e.route):u?f.reset("Account"):v?f.reset("SelectNetwork"):f.reset("ConnectWallet"),s&&a&&(n||l||u))L.open=!0,t();else{const I=setInterval(()=>{const y=d.state,A=D.state;y.isUiLoaded&&y.isDataLoaded&&(y.isStandalone||A.pairingUri||u)&&(clearInterval(I),L.open=!0,t())},200)}})},close(){L.open=!1}};var K=Object.defineProperty,x=Object.getOwnPropertySymbols,J=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,P=(e,t,n)=>t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,z=(e,t)=>{for(var n in t||(t={}))J.call(t,n)&&P(e,n,t[n]);if(x)for(var n of x(t))q.call(t,n)&&P(e,n,t[n]);return e};function F(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const E=p({themeMode:F()?"dark":"light"}),Z={state:E,subscribe(e){return C(E,()=>e(E))},setThemeConfig(e){const{themeMode:t,themeVariables:n}=e;t&&(E.themeMode=t),n&&(E.themeVariables=z({},n))}},w=p({open:!1,message:"",variant:"success"}),ee={state:w,subscribe(e){return C(w,()=>e(w))},openToast(e,t){w.open=!0,w.message=e,w.variant=t},closeToast(){w.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=$),window.global||(window.global=window),window.process||(window.process={env:{}}));export{V as AccountCtrl,m as ClientCtrl,b as ConfigCtrl,c as CoreUtil,X as ExplorerCtrl,Y as ModalCtrl,d as OptionsCtrl,f as RouterCtrl,Z as ThemeCtrl,ee as ToastCtrl,D as WcConnectionCtrl};
import{proxy as p,subscribe as C}from"valtio/vanilla";import{Buffer as $}from"buffer";let M;const m={ethereumClient:void 0,setEthereumClient(e){M=e},client(){if(M)return M;throw new Error("ClientCtrl has no client set")}},i=p({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),f={state:i,subscribe(e){return C(i,()=>e(i))},push(e,t){e!==i.view&&(i.view=e,t&&(i.data=t),i.history.push(e))},reset(e){i.view=e,i.history=[e]},replace(e){i.history.length>1&&(i.history[i.history.length-1]=e,i.view=e)},goBack(){if(i.history.length>1){i.history.pop();const[e]=i.history.slice(-1);i.view=e}},setData(e){i.data=e}},c={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",W3M_VERSION:"W3M_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return c.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return c.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},formatNativeUrl(e,t,n){if(c.isHttpUrl(e))return this.formatUniversalUrl(e,t,n);let s=e;s.includes("://")||(s=e.replaceAll("/","").replaceAll(":",""),s=`${s}://`),this.setWalletConnectDeepLink(s,n);const a=encodeURIComponent(t);return`${s}wc?uri=${a}`},formatUniversalUrl(e,t,n){if(!c.isHttpUrl(e))return this.formatNativeUrl(e,t,n);let s=e;e.endsWith("/")&&(s=e.slice(0,-1)),this.setWalletConnectDeepLink(s,n);const a=encodeURIComponent(t);return`${s}/wc?uri=${a}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){localStorage.setItem(c.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))},setWalletConnectAndroidDeepLink(e){const[t]=e.split("?");localStorage.setItem(c.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))},setWeb3ModalVersionInStorage(){typeof localStorage<"u"&&localStorage.setItem(c.W3M_VERSION,"2.3.3")},getWalletRouterData(){var e;const t=(e=f.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t},getSwitchNetworkRouterData(){var e;const t=(e=f.state.data)==null?void 0:e.SwitchNetwork;if(!t)throw new Error('Missing "SwitchNetwork" view data');return t}},r=p({selectedChain:void 0,chains:void 0,standaloneChains:void 0,standaloneUri:void 0,isStandalone:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1,isInjectedMobile:!1,walletConnectVersion:1}),d={state:r,subscribe(e){return C(r,()=>e(r))},setChains(e){r.chains=e},setStandaloneChains(e){r.standaloneChains=e},setStandaloneUri(e){r.standaloneUri=e},getSelectedChain(){const e=m.client().getNetwork().chain;return e&&(r.selectedChain=e),r.selectedChain},setSelectedChain(e){r.selectedChain=e},setIsStandalone(e){r.isStandalone=e},setIsCustomDesktop(e){r.isCustomDesktop=e},setIsCustomMobile(e){r.isCustomMobile=e},setIsDataLoaded(e){r.isDataLoaded=e},setIsUiLoaded(e){r.isUiLoaded=e},setWalletConnectVersion(e){r.walletConnectVersion=e},setIsInjectedMobile(e){r.isInjectedMobile=e}},O=p({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chainImages:void 0,tokenImages:void 0,tokenContracts:void 0,standaloneChains:void 0,enableStandaloneMode:!1,enableNetworkView:!1,enableAccountView:!0,enableExplorer:!0,defaultChain:void 0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),b={state:O,subscribe(e){return C(O,()=>e(O))},setConfig(e){var t,n,s,a;d.setStandaloneChains(e.standaloneChains),d.setIsStandalone(!!((t=e.standaloneChains)!=null&&t.length)||!!e.enableStandaloneMode),d.setIsCustomMobile(!!((n=e.mobileWallets)!=null&&n.length)),d.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),d.setWalletConnectVersion((a=e.walletConnectVersion)!=null?a:1),d.state.isStandalone||(d.setChains(m.client().chains),d.setIsInjectedMobile(c.isMobile()&&m.client().isInjectedProviderInstalled())),e.defaultChain&&d.setSelectedChain(e.defaultChain),c.setWeb3ModalVersionInStorage(),Object.assign(O,e)}},o=p({address:void 0,profileName:void 0,profileAvatar:void 0,profileLoading:!1,balanceLoading:!1,balance:void 0,isConnected:!1}),V={state:o,subscribe(e){return C(o,()=>e(o))},getAccount(){const e=m.client().getAccount();o.address=e.address,o.isConnected=e.isConnected},async fetchProfile(e,t){var n;try{o.profileLoading=!0;const s=t??o.address,a=(n=d.state.chains)==null?void 0:n.find(l=>l.id===1);if(s&&a){const[l,u]=await Promise.all([m.client().fetchEnsName({address:s,chainId:1}),m.client().fetchEnsAvatar({address:s,chainId:1})]);u&&await e(u),o.profileName=l,o.profileAvatar=u}}finally{o.profileLoading=!1}},async fetchBalance(e){try{const{chain:t}=m.client().getNetwork(),{tokenContracts:n}=b.state;let s;t&&n&&(s=n[t.id]),o.balanceLoading=!0;const a=e??o.address;if(a){const l=await m.client().fetchBalance({address:a,token:s});o.balance={amount:l.formatted,symbol:l.symbol}}}finally{o.balanceLoading=!1}},setAddress(e){o.address=e},setIsConnected(e){o.isConnected=e},resetBalance(){o.balance=void 0},resetAccount(){o.address=void 0,o.isConnected=!1,o.profileName=void 0,o.profileAvatar=void 0,o.balance=void 0}},S="https://explorer-api.walletconnect.com";async function j(e,t){const n=new URL(e,S);return n.searchParams.append("projectId",b.state.projectId),Object.entries(t).forEach(([s,a])=>{a&&n.searchParams.append(s,String(a))}),(await fetch(n)).json()}const h={async getDesktopListings(e){return j("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return j("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return j("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return j("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${S}/w3m/v1/getWalletImage/${e}?projectId=${b.state.projectId}`},getAssetImageUrl(e){return`${S}/w3m/v1/getAssetImage/${e}?projectId=${b.state.projectId}`}};var R=Object.defineProperty,U=Object.getOwnPropertySymbols,_=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable,N=(e,t,n)=>t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,H=(e,t)=>{for(var n in t||(t={}))_.call(t,n)&&N(e,n,t[n]);if(U)for(var n of U(t))B.call(t,n)&&N(e,n,t[n]);return e};const k=c.isMobile(),g=p({wallets:{listings:[],total:0,page:1},injectedWallets:[],search:{listings:[],total:0,page:1},recomendedWallets:[]}),X={state:g,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=b.state;if(e==="NONE"||t==="ALL"&&!e)return g.recomendedWallets;if(c.isArray(e)){const n={recommendedIds:e.join(",")},{listings:s}=await h.getAllListings(n),a=Object.values(s);a.sort((l,u)=>{const v=e.indexOf(l.id),I=e.indexOf(u.id);return v-I}),g.recomendedWallets=a}else{const{standaloneChains:n,walletConnectVersion:s}=d.state,a=n?.join(","),l=c.isArray(t),u={page:1,entries:c.RECOMMENDED_WALLET_AMOUNT,chains:a,version:s,excludedIds:l?t.join(","):void 0},{listings:v}=k?await h.getMobileListings(u):await h.getDesktopListings(u);g.recomendedWallets=Object.values(v)}return g.recomendedWallets},async getWallets(e){const t=H({},e),{explorerRecommendedWalletIds:n,explorerExcludedWalletIds:s}=b.state,{recomendedWallets:a}=g;if(s==="ALL")return g.wallets;t.search||(a.length?t.excludedIds=a.map(T=>T.id).join(","):c.isArray(n)&&(t.excludedIds=n.join(","))),c.isArray(s)&&(t.excludedIds=[t.excludedIds,s].filter(Boolean).join(","));const{page:l,search:u}=e,{listings:v,total:I}=k?await h.getMobileListings(t):await h.getDesktopListings(t),y=Object.values(v),A=u?"search":"wallets";return g[A]={listings:[...g[A].listings,...y],total:I,page:l??1},{listings:y,total:I}},async getInjectedWallets(){const{listings:e}=await h.getInjectedListings({}),t=Object.values(e);return g.injectedWallets=t,g.injectedWallets},getWalletImageUrl(e){return h.getWalletImageUrl(e)},getAssetImageUrl(e){return h.getAssetImageUrl(e)},resetSearch(){g.search={listings:[],total:0,page:1}}},W=p({pairingUri:"",pairingError:!1}),D={state:W,subscribe(e){return C(W,()=>e(W))},setPairingUri(e){W.pairingUri=e},setPairingError(e){W.pairingError=e}},L=p({open:!1}),Y={state:L,subscribe(e){return C(L,()=>e(L))},async open(e){return new Promise(t=>{const{isStandalone:n,isUiLoaded:s,isDataLoaded:a}=d.state,{pairingUri:l}=D.state,{isConnected:u}=V.state,{enableNetworkView:v}=b.state;if(n?(d.setStandaloneUri(e?.uri),d.setStandaloneChains(e?.standaloneChains),f.reset("ConnectWallet")):e!=null&&e.route?f.reset(e.route):u?f.reset("Account"):v?f.reset("SelectNetwork"):f.reset("ConnectWallet"),s&&a&&(n||l||u))L.open=!0,t();else{const I=setInterval(()=>{const y=d.state,A=D.state;y.isUiLoaded&&y.isDataLoaded&&(y.isStandalone||A.pairingUri||u)&&(clearInterval(I),L.open=!0,t())},200)}})},close(){L.open=!1}};var K=Object.defineProperty,x=Object.getOwnPropertySymbols,J=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,P=(e,t,n)=>t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,z=(e,t)=>{for(var n in t||(t={}))J.call(t,n)&&P(e,n,t[n]);if(x)for(var n of x(t))q.call(t,n)&&P(e,n,t[n]);return e};function F(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const E=p({themeMode:F()?"dark":"light"}),Z={state:E,subscribe(e){return C(E,()=>e(E))},setThemeConfig(e){const{themeMode:t,themeVariables:n}=e;t&&(E.themeMode=t),n&&(E.themeVariables=z({},n))}},w=p({open:!1,message:"",variant:"success"}),ee={state:w,subscribe(e){return C(w,()=>e(w))},openToast(e,t){w.open=!0,w.message=e,w.variant=t},closeToast(){w.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=$),window.global||(window.global=window),window.process||(window.process={env:{}}));export{V as AccountCtrl,m as ClientCtrl,b as ConfigCtrl,c as CoreUtil,X as ExplorerCtrl,Y as ModalCtrl,d as OptionsCtrl,f as RouterCtrl,Z as ThemeCtrl,ee as ToastCtrl,D as WcConnectionCtrl};
//# sourceMappingURL=index.js.map
{
"name": "@web3modal/core",
"version": "2.3.2",
"version": "2.3.3",
"main": "dist/index.js",

@@ -23,3 +23,3 @@ "type": "module",

"devDependencies": {
"@web3modal/ethereum": "2.3.2"
"@web3modal/ethereum": "2.3.3"
},

@@ -26,0 +26,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc