@web3modal/core
Advanced tools
Comparing version 2.0.0-67a0c29f to 2.0.0-6ce38ab
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
4923707
21
0
4798
0
1
0
3
2
+ Addedbuffer@6.0.3
+ Addedbase64-js@1.5.1(transitive)
+ Addedbuffer@6.0.3(transitive)
+ Addedieee754@1.2.1(transitive)