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.0-6a0bdcf to 2.3.0-b3c240a

6

dist/_types/src/controllers/ExplorerCtrl.d.ts
import type { ExplorerCtrlState, ListingParams } from '../types/controllerTypes';
export declare const ExplorerCtrl: {
state: ExplorerCtrlState;
getRecomendedWallets(params: ListingParams): Promise<import("../types/controllerTypes").Listing[]>;
getWallets(params: ListingParams): Promise<{
getRecomendedWallets(): Promise<import("../types/controllerTypes").Listing[]>;
getWallets(params: ListingParams): Promise<(import("../types/controllerTypes").ListingResponse & {
page: number;
}) | {
listings: import("../types/controllerTypes").Listing[];

@@ -7,0 +9,0 @@ total: number;

@@ -33,4 +33,4 @@ import type { Chain, EthereumClient } from '@web3modal/ethereum';

enableExplorer?: boolean;
explorerAllowList?: string[];
explorerDenyList?: string[];
explorerRecommendedWalletIds?: string[] | 'NONE';
explorerExcludedWalletIds?: string[] | 'ALL';
termsOfServiceUrl?: string;

@@ -83,2 +83,4 @@ privacyPolicyUrl?: string;

chains?: string;
recommendedIds?: string;
excludedIds?: string;
}

@@ -85,0 +87,0 @@ export interface Listing {

@@ -8,2 +8,3 @@ export declare const CoreUtil: {

isHttpUrl(url: string): boolean;
isArray<T>(data?: T | T[] | undefined): data is T[];
formatNativeUrl(appUrl: string, wcUri: string, name: string): string;

@@ -10,0 +11,0 @@ formatUniversalUrl(appUrl: string, wcUri: string, name: string): string;

@@ -6,4 +6,5 @@ import type { ListingParams, ListingResponse } from '../types/controllerTypes';

getInjectedListings(params: ListingParams): Promise<ListingResponse>;
getAllListings(params: ListingParams): Promise<ListingResponse>;
getWalletImageUrl(imageId: string): string;
getAssetImageUrl(imageId: string): string;
};

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

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

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

"devDependencies": {
"@web3modal/ethereum": "2.3.0-6a0bdcf"
"@web3modal/ethereum": "2.3.0-b3c240a"
},

@@ -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