Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@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.0.0-67a0c29f to 2.0.0-6ce38ab

dist/_types/index.d.ts

2

dist/index.js

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

import{proxy as s,subscribe as n}from"valtio/vanilla";function c(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const o=s({configured:!1,projectId:"",theme:c()?"dark":"light",accentColor:"default",ethereumClient:void 0}),i={state:o,subscribe(e){return n(o,()=>e(o))},setConfig(e){Object.assign(o,e),o.configured=!0}},l={configure:i.setConfig,config:i.state},r=s({open:!1}),u={state:r,subscribe(e){return n(r,()=>e(r))},openModal(){r.open=!0},closeModal(){r.open=!1}},t=s({history:["ConnectWallet"],view:"ConnectWallet"}),h={state:t,subscribe(e){return n(t,()=>e(t))},push(e){t.view=e,t.history.push(e)},replace(e){t.view=e,t.history=[e]},goBack(){if(t.history.length>1){t.history.pop();const[e]=t.history.slice(-1);t.view=e}}};export{i as ConfigCtrl,u as ModalCtrl,h as RouterCtrl,l as Web3ModalCore};
import{Buffer as C}from"buffer";import{proxy as a,subscribe as l}from"valtio/vanilla";const g={connected:!1,chainSupported:!1,address:"",chainId:"",connector:""},i=a(g),O={state:i,subscribe(e){return l(i,()=>e(i))},setAccount(e){Object.assign(i,e),i.connected=!0},setAddress(e){i.address=e},setChain(e,t){i.chainId=e,i.chainSupported=t},resetAccount(){Object.assign(i,g)}},w=a({ethereum:void 0}),$={ethereum(){if(!w.ethereum)throw new Error("Ethereum client was not provided");return w.ethereum},async setEthereumClient(e){const{Web3ModalEthereum:t}=await import("@web3modal/ethereum");w.ethereum=t.createClient(e)}};function b(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const u=a({configured:!1,projectId:"",theme:b()?"dark":"light",accentColor:"default"}),E={state:u,subscribe(e){return l(u,()=>e(u))},setConfig(e){if(!e.projectId)throw new Error("Web3Modal requires projectId that can be obtained at cloud.walletconnect.com");Object.assign(u,e),u.configured=!0}},p=a({open:!1}),A={state:p,subscribe(e){return l(p,()=>e(p))},openModal(){p.open=!0},closeModal(){p.open=!1}};function v(){return{url:"https://explorer-api.walletconnect.com",projectId:E.state.projectId}}function y(e){const t=Object.fromEntries(Object.entries(e).map(([s,n])=>[s,n.toString()]));return new URLSearchParams(t).toString()}function W(e){const{url:t,projectId:s}=v();return`${t}/v3/wallets?projectId=${s}&${y(e)}`}async function f(e){return(await fetch(W(e))).json()}const r=a({search:"",page:1,wallets:{listings:[],total:0},previewWallets:[]}),L={state:r,subscribe(e){return l(r,()=>e(r))},async getPreviewWallets(){const{listings:e}=await f({page:1,entries:10,version:1});return r.previewWallets=Object.values(e),r.previewWallets},async getPaginatedWallets(e){const{listings:t,total:s}=await f(e),n=Object.values(t);r.wallets={listings:[...r.wallets.listings,...n],total:s};const{page:d,search:h}=e;return typeof d<"u"&&r.page!==d&&(r.page=d),typeof h<"u"&&r.search!==h&&(r.search=h),{listings:n,total:s}}},c=a({open:!1,message:""}),M={state:c,subscribe(e){return l(c,()=>e(c))},openToast(e){c.open=!0,c.message=e},closeToast(){c.open=!1}},o=a({history:["ConnectWallet"],view:"ConnectWallet"}),S={state:o,subscribe(e){return l(o,()=>e(o))},push(e){o.view=e,o.history.push(e)},replace(e){o.view=e,o.history=[e]},goBack(){if(o.history.length>1){o.history.pop();const[e]=o.history.slice(-1);o.view=e}}},m="WALLETCONNECT_DEEPLINK_CHOICE",P={isCoinbaseExtension(){return window.coinbaseWalletExtension},isMobile(){return Boolean(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent))},formatNativeUrl(e,t,s){const n=e.replaceAll("/","").replaceAll(":","");return this.setWalletConnectDeepLink(n,s),`${n}://wc?uri=${t}`},formatUniversalUrl(e,t,s){let n=e;return e.endsWith("/")&&(n=e.slice(0,-1)),this.setWalletConnectDeepLink(n,s),`${n}/wc?uri=${t}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t="_self"){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){localStorage.setItem(m,JSON.stringify({href:e,name:t}))},removeWalletConnectDeepLink(){localStorage.removeItem(m)}};typeof window<"u"&&!window.Buffer&&(window.Buffer=C);export{O as AccountCtrl,$ as ClientCtrl,E as ConfigCtrl,A as ConnectModalCtrl,P as CoreHelpers,L as ExplorerCtrl,M as ModalToastCtrl,S as RouterCtrl,v as getExplorerApi,g as initialAccountlState};
//# sourceMappingURL=index.js.map
{
"name": "@web3modal/core",
"version": "2.0.0-67a0c29f",
"version": "2.0.0-6ce38ab",
"main": "dist/index.js",

@@ -20,6 +20,7 @@ "unpkg": "dist/index.umd.js",

"dependencies": {
"buffer": "6.0.3",
"valtio": "1.7.0"
},
"devDependencies": {
"@web3modal/ethereum": "2.0.0-67a0c29f"
"@web3modal/ethereum": "2.0.0-6ce38ab"
},

@@ -33,3 +34,21 @@ "peerDependencies": {

}
},
"keywords": [
"web3",
"crypto",
"ethereum",
"web3modal",
"walletconnect",
"web3auth"
],
"author": "WalletConnect <walletconnect.com>",
"license": "MIT",
"homepage": "https://github.com/web3modal/web3modal",
"repository": {
"type": "git",
"url": "git+https://github.com/web3modal/web3modal.git"
},
"bugs": {
"url": "https://github.com/web3modal/web3modal/issues"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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