@privy-io/react-auth 1.92.1 → 1.92.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{getEmbeddedConnectedWallet-DK-neKM8.js → getEmbeddedConnectedWallet-CaBjd2bz.js} +1 -1
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/ui.js +1 -1
- package/dist/cjs/{useFundWallet-CSN6dNrN.js → useFundWallet-DEtObexE.js} +1 -1
- package/dist/cjs/{useWallets-BfxJw3Qz.js → useWallets-Db8wjylW.js} +1 -1
- package/dist/dts/index.d.mts +4 -4
- package/dist/dts/index.d.ts +4 -4
- package/dist/dts/smart-wallets.d.mts +15 -1
- package/dist/dts/smart-wallets.d.ts +15 -1
- package/dist/dts/{solana-Bkx5LP3w.d.ts → solana-fAf6H5G5.d.mts} +3 -3
- package/dist/dts/{solana-Bkx5LP3w.d.mts → solana-fAf6H5G5.d.ts} +3 -3
- package/dist/dts/solana.d.mts +2 -2
- package/dist/dts/solana.d.ts +2 -2
- package/dist/dts/{types-CWBSfCm7.d.mts → types-C2RbyZWT.d.mts} +1 -1
- package/dist/dts/{types-CWBSfCm7.d.ts → types-C2RbyZWT.d.ts} +1 -1
- package/dist/dts/ui.d.mts +1 -1
- package/dist/dts/ui.d.ts +1 -1
- package/dist/esm/{getEmbeddedConnectedWallet-DLXE8X2r.mjs → getEmbeddedConnectedWallet-Dv6wjrtm.mjs} +1 -1
- package/dist/esm/index.mjs +3 -3
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/ui.mjs +1 -1
- package/dist/esm/{useFundWallet-BDQk98dS.mjs → useFundWallet-D5B39g9B.mjs} +1 -1
- package/dist/esm/{useWallets-BnVot5R3.mjs → useWallets-BQQjDV6b.mjs} +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useRef as t,useState as a,useCallback as n,useContext as r,useEffect as i,createContext as s}from"react";import{z as o,a3 as l}from"./useWallets-BQQjDV6b.mjs";import{P as c,u as d,h as m}from"./privy-context-QVrL4VJ3.mjs";import{u,g as p,M as f}from"./getEmbeddedConnectedWallet-Dv6wjrtm.mjs";export{b as useAbstractSmartWallets}from"./getEmbeddedConnectedWallet-Dv6wjrtm.mjs";import{createSmartAccountClient as h}from"permissionless";import{toLightSmartAccount as g,toBiconomySmartAccount as y,toEcdsaKernelSmartAccount as w,toSafeSmartAccount as W}from"permissionless/accounts";import{createPimlicoClient as P}from"permissionless/clients/pimlico";import{createPublicClient as E,http as v}from"viem";import{entryPoint06Address as C,entryPoint07Address as S}from"viem/account-abstraction";import"@ethersproject/providers";import"tinycolor2";import"ofetch";import"viem/actions";import"viem/chains";let T={address:C,version:"0.6"},x={address:S,version:"0.7"},I=({owner:e,smartWalletType:t,chain:a})=>{let n=E({chain:a,transport:v()});switch(t){case"safe":return W({client:n,entryPoint:x,owners:[e],version:"1.4.1"});case"kernel":return w({client:n,version:"0.3.1",entryPoint:x,owners:[e]});case"biconomy":return y({client:n,owners:[e],entryPoint:T});case"light_account":return g({client:n,entryPoint:T,owner:e,version:"1.1.0"});default:throw Error(`Invalid smart account type: ${t}.`)}},N=["rpc.zerodev.app","public.pimlico.io","api.pimlico.io"];let D=({calls:e,chain:t,maxPriorityFeePerGas:a,maxFeePerGas:n,nonce:r})=>e.map((e=>({to:e.to||void 0,data:e.data,value:e.value,chainId:t.id,nonce:r,maxFeePerGas:n,maxPriorityFeePerGas:a})));const F=async({chain:e,paymasterContext:t,embeddedWallet:a,user:n,smartWalletsConfig:r})=>{if(!r?.enabled||!n||!a)return;let i=await a.getEthereumProvider(),s=r?.configuredNetworks.find((t=>t.chainId===`eip155:${e.id}`));if(!s)throw new c(`The chain ${e.name} (eip155:${e.id}) must be configured in the smart wallet configuration in your dashboard`);let o=n.smartWallet?.smartWalletType??r.smartWalletType,l=await(async({owner:e,smartWalletType:t,chain:a,bundlerUrl:n,paymasterUrl:r,paymasterContext:i})=>{let s=E({chain:a,transport:v()}),o=await I({owner:e,smartWalletType:t,chain:a}),l=P({transport:v(n),entryPoint:o.entryPoint}),c=r?P({transport:v(r),entryPoint:o.entryPoint}):void 0;return h({account:o,chain:a,paymaster:c,paymasterContext:i,bundlerTransport:v(n),userOperation:{estimateFeesPerGas:async()=>{if(N.some((e=>n.includes(e))))return await l.getUserOperationGasPrice().then((e=>e.fast));{let e=await s.estimateFeesPerGas();return{...e,maxFeePerGas:125n*e.maxFeePerGas/100n,maxPriorityFeePerGas:125n*e.maxPriorityFeePerGas/100n}}}}})})({owner:i,smartWalletType:o,chain:e,paymasterContext:t,...s});if(!l)throw new c(`Failed to create smart wallet client for chain ${e.name} (eip155:${e.id})`);return l},_=({clientConfig:e,smartWalletsConfig:r})=>{let{noPromptOnSignature:i,openPrivyModal:s}=d(),h=o(),{setModalData:g}=u(),{user:y}=m(),{chains:w}=o(),{chainId:W,clients:P,setChainId:E,chainIdState:v}=(()=>{let e=t(),[n,r]=a();return{clients:t({}),setChainId:t=>{e.current=t,r(t)},chainId:e,chainIdState:n}})(),C=w.find((e=>e.id===v)),{wallets:S}=l(),T=n((async()=>W.current),[W]),b=n((async({id:t})=>{if(!P.current[t]){let a=p(S),n=await F({chain:w.find((e=>e.id===t)),embeddedWallet:a,user:y,paymasterContext:e?.paymasterContext,smartWalletsConfig:r});n&&(P.current[t]=n)}E(t)}),[w,e,S,y,r]);return{wrapSmartAccountClient:e=>{P.current[e.chain.id]=e,v||E(e.chain.id);return{...e,sendTransaction:async e=>{let t=void 0===h.embeddedWallets.showWalletUIs?h.embeddedWallets.noPromptOnSignature:!h.embeddedWallets.showWalletUIs,a=P.current[W.current];if(!a)throw new c(`Smart wallet client for chain (eip155:${W.current}) not found`);if(t)return i.current=!0,await a.sendTransaction(e).finally((()=>i.current=!1));let n=[];"calls"in e&&void 0!==e.calls?n=[...e.calls]:"to"in e&&(n=[{to:e.to,value:e.value||BigInt(0),data:e.data||"0x"}]);let r=async()=>{if(!a.paymaster)return!1;let{paymasterAndData:t,paymasterData:r}=await a.prepareUserOperation({calls:n,maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0});return Number(t??r??0)>0};return new Promise((async(t,o)=>{i.current=!0,g({connectWallet:{onCompleteNavigateTo:f.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:D({calls:n,chain:a.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),rootWallet:{address:a.account.address},transactingWallet:{address:a.account.address,walletIndex:null},getIsSponsored:r,onConfirm:()=>a.sendTransaction(e),onSuccess:e=>t(e.hash),onFailure:o,uiOptions:{}}}),s(f.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{i.current=!1}))},signMessage:async({message:e})=>{let t=void 0===h.embeddedWallets.showWalletUIs?h.embeddedWallets.noPromptOnSignature:!h.embeddedWallets.showWalletUIs,a=P.current[W.current];if(!a)throw new c(`Smart wallet client for chain (eip155:${W.current}) not found`);return t?(i.current=!0,await a.signMessage({message:e}).finally((()=>i.current=!1))):new Promise((async(t,n)=>{i.current=!0,g({connectWallet:{onCompleteNavigateTo:f.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>a.signMessage({message:e}),onSuccess:e=>t(e),onFailure:n,uiOptions:{}}}),s(f.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{i.current=!1}))},signTypedData:async e=>{let t=void 0===h.embeddedWallets.showWalletUIs?h.embeddedWallets.noPromptOnSignature:!h.embeddedWallets.showWalletUIs,a=P.current[W.current];if(!a)throw new c(`Smart wallet client for chain (eip155:${W.current}) not found`);return t?(i.current=!0,await a.signTypedData(e).finally((()=>i.current=!1))):new Promise((async(t,n)=>{i.current=!0,g({connectWallet:{onCompleteNavigateTo:f.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>a.signTypedData(e),onSuccess:e=>t(e),onFailure:n,uiOptions:{}}}),s(f.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{i.current=!1}))},getChainId:T,chain:C,switchChain:b}}}};let G=s({client:void 0});const M=({config:t,children:a})=>e(U,{children:e($,{config:t,children:e(B,{children:a})})}),O=()=>{let{client:e}=r(G);return{client:e}};let A=s({config:void 0}),L=()=>{let{config:e}=r(A);return{config:e}},U=({children:t})=>{let[n,r]=a(void 0),{client:s}=d();return i((()=>{!n&&s&&(async()=>{try{if(!s)return void console.warn("No client found");let e=await s.getSmartWalletsConfig();r(e)}catch(e){console.warn("Error generating smart wallet config: ",e)}})()}),[!!s]),e(A.Provider,{value:{config:n},children:t})},$=({config:t,children:n})=>{let{config:r}=L(),{chains:s,defaultChain:d}=o(),{wallets:u}=l(),{user:f}=m(),[h,g]=a(),y=p(u);return i((()=>{(async()=>{if(!r?.enabled)return;let e=r.configuredNetworks.find((e=>e.chainId===`eip155:${d.id}`))?d:s.find((e=>r.configuredNetworks.map((e=>e.chainId)).includes(`eip155:${e.id}`)));if(!e)throw new c("Could not find smart wallets chain configurations for any Privy client configured chains. Please configure smart wallets for your chains in the Privy dashboard.");g(await F({chain:e,paymasterContext:t?.paymasterContext,embeddedWallet:y,user:f,smartWalletsConfig:r}))})()}),[!!r?.enabled,!!f?.smartWallet,!!y]),e(R.Provider,{value:{client:h,config:t},children:n})},R=s({client:void 0,config:void 0}),B=({children:t})=>{let{client:a,config:n}=(()=>{let{client:e,config:t}=r(R);return{client:e,config:t}})(),{config:s}=L(),{wrapSmartAccountClient:o}=_({clientConfig:n,smartWalletsConfig:s}),{user:l}=m(),{generateSiweMessageForSmartWallet:c,linkSmartWallet:u,noPromptOnSignature:p}=d();return i((()=>{(async()=>{if(a&&!l?.smartWallet&&s?.enabled)try{let e=await c({address:a.account.address,chainId:`eip155:${a.chain.id}`});p.current=!0;let t=await a.signMessage({message:e});await u({signature:t,message:e,smartWalletType:s.smartWalletType})}catch(e){console.error("Error creating smart wallet:",e)}finally{p.current=!1}})()}),[!!a,!!l?.smartWallet,!!s?.enabled]),e(G.Provider,{value:{client:l?.smartWallet&&a?o(a):void 0},children:t})};export{M as SmartWalletsProvider,O as useSmartWallets};
|
package/dist/esm/ui.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import{h as r,u as n}from"./privy-context-QVrL4VJ3.mjs";import{f as l,u as o,x as a,o as s,W as d,k as c,d as h,q as p,b as C,v as u,w as g,B as f}from"./useFundWallet-
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import{h as r,u as n}from"./privy-context-QVrL4VJ3.mjs";import{f as l,u as o,x as a,o as s,W as d,k as c,d as h,q as p,b as C,v as u,w as g,B as f}from"./useFundWallet-D5B39g9B.mjs";import{E as w,a3 as m,z as v}from"./useWallets-BQQjDV6b.mjs";import{styled as x,css as y}from"styled-components";import{CheckIcon as _}from"@heroicons/react/24/outline";import*as k from"react";import{useState as b,useContext as M,createContext as L,useRef as z}from"react";import{useMergeRefs as H,useTransitionStyles as V,FloatingPortal as F,FloatingFocusManager as Z,useFloating as B,autoUpdate as U,offset as S,flip as A,shift as O,useInteractions as j,useClick as R,useDismiss as P,useRole as G}from"@floating-ui/react";import{g as T}from"./events-context-DLn7buIf.mjs";import"ofetch";import"@heroicons/react/24/outline/Square2StackIcon";import"@ethersproject/bignumber";import"@ethersproject/units";import"viem";import"@ethersproject/providers";import"tinycolor2";import"@ethersproject/address";const W=t=>e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:e("path",{d:"M9.99999 10.8333C12.3012 10.8333 14.1667 8.96785 14.1667 6.66667C14.1667 4.36548 12.3012 2.5 9.99999 2.5C7.69881 2.5 5.83333 4.36548 5.83333 6.66667C5.83333 8.96785 7.69881 10.8333 9.99999 10.8333ZM9.99999 10.8333C11.7681 10.8333 13.4638 11.5357 14.714 12.786C15.9643 14.0362 16.6667 15.7319 16.6667 17.5M9.99999 10.8333C8.23188 10.8333 6.53619 11.5357 5.28595 12.786C4.03571 14.0362 3.33333 15.7319 3.33333 17.5",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})}),N=x.button`
|
|
2
2
|
--size: ${({$size:e})=>`${e}px`};
|
|
3
3
|
|
|
4
4
|
-webkit-font-smoothing: antialiased;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useState as r,useEffect as e,createContext as o,useContext as t,useMemo as a,useCallback as c}from"react";import{jsx as i,jsxs as l,Fragment as n}from"react/jsx-runtime";import{styled as s,keyframes as d,css as h}from"styled-components";import{E as v,z as p,ao as u,Q as m}from"./useWallets-
|
|
1
|
+
import{useState as r,useEffect as e,createContext as o,useContext as t,useMemo as a,useCallback as c}from"react";import{jsx as i,jsxs as l,Fragment as n}from"react/jsx-runtime";import{styled as s,keyframes as d,css as h}from"styled-components";import{E as v,z as p,ao as u,Q as m}from"./useWallets-BQQjDV6b.mjs";import{u as g}from"./events-context-DLn7buIf.mjs";import{l as y,u as f,h as b}from"./privy-context-QVrL4VJ3.mjs";import w from"@heroicons/react/24/outline/Square2StackIcon";import{BigNumber as x}from"@ethersproject/bignumber";import{formatEther as $}from"@ethersproject/units";import{createPublicClient as V,http as Z}from"viem";let M=r=>x.from(r);function P(r){if("number"==typeof r||"bigint"==typeof r||"string"==typeof r)return r;if("function"==typeof r.toHexString)return r.toHexString();throw Error(`Expected numeric value but received ${r}`)}function k(r){let e={};return void 0!==r.to&&(e.to=r.to),void 0!==r.data&&(e.data=r.data),void 0!==r.chainId&&(e.chainId=r.chainId),void 0!==r.type&&(e.type=r.type),void 0!==r.accessList&&(e.accessList=r.accessList),void 0!==r.nonce&&(e.nonce=M(r.nonce).toNumber()),void 0!==r.gasLimit&&(e.gasLimit=M(r.gasLimit)),void 0!==r.gasPrice&&(e.gasPrice=M(r.gasPrice)),void 0!==r.value&&(e.value=M(r.value)),void 0!==r.maxFeePerGas&&(e.maxFeePerGas=M(r.maxFeePerGas)),void 0!==r.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=M(r.maxPriorityFeePerGas)),e}class L{get(r){let e=localStorage.getItem(r);return null===e?void 0:JSON.parse(e)}put(r,e){void 0!==e?localStorage.setItem(r,JSON.stringify(e)):this.del(r)}del(r){localStorage.removeItem(r)}getKeys(){return Object.entries(localStorage).map((([r])=>r))}}function T(){try{let r="privy:__session_storage__test",e=new L;return e.put(r,"blobby"),e.del(r),!0}catch(r){return!1}}var C="undefined"!=typeof window&&window.localStorage?new L:new class{get(r){return this._cache[r]}put(r,e){void 0!==e?this._cache[r]=e:this.del(r)}del(r){delete this._cache[r]}getKeys(){return Object.keys(this._cache)}constructor(){this._cache={}}};const S=o=>{let[t,a]=r("auto");return e((()=>{let r=new ResizeObserver((r=>{a(r[0]?.contentRect.height??"auto")}));return o.current&&r.observe(o.current),()=>{o.current&&r.unobserve(o.current)}}),[o.current]),t},_=({success:r,fail:e})=>l(n,{children:[i(I,{className:r?"success":e?"fail":""}),i(N,{className:r?"success":e?"fail":""})]}),I=s.span`
|
|
2
2
|
&& {
|
|
3
3
|
width: 82px;
|
|
4
4
|
height: 82px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{StaticJsonRpcProvider as e}from"@ethersproject/providers";import{c as t}from"./privy-context-QVrL4VJ3.mjs";import{jsx as a}from"react/jsx-runtime";import{useState as r,useMemo as n,useEffect as l,useContext as i,createContext as o}from"react";import s from"tinycolor2";const p=e=>e.isApexWallet?"Apex Wallet":e.isAvalanche?"Core Wallet":e.isBackpack?"Backpack":e.isBifrost?"Bifrost Wallet":e.isBitKeep?"BitKeep":e.isBitski?"Bitski":e.isBlockWallet?"BlockWallet":e.isBraveWallet?"Brave Wallet":e.isClover?"Clover":e.isCoin98?"Coin98 Wallet":e.isCoinbaseWallet?"Coinbase Wallet":e.isDawn?"Dawn Wallet":e.isDefiant?"Defiant":e.isDesig?"Desig Wallet":e.isEnkrypt?"Enkrypt":e.isExodus?"Exodus":e.isFordefi?"Fordefi":e.isFrame?"Frame":e.isFrontier?"Frontier Wallet":e.isGamestop?"GameStop Wallet":e.isHaqqWallet?"HAQQ Wallet":e.isHyperPay?"HyperPay Wallet":e.isImToken?"ImToken":e.isHaloWallet?"Halo Wallet":e.isKuCoinWallet?"KuCoin Wallet":e.isMathWallet?"MathWallet":e.isNovaWallet?"Nova Wallet":e.isOkxWallet||e.isOKExWallet?"OKX Wallet":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch Wallet":e.isOneKey?"OneKey Wallet":e.isOpera?"Opera":e.isPhantom?"Phantom":e.isPortal?"Ripio Portal":e.isRabby?"Rabby Wallet":e.isRainbow?"Rainbow":e.isSafePal?"SafePal Wallet":e.isStatus?"Status":e.isSubWallet?"SubWallet":e.isTalisman?"Talisman":e.isTally||e.isTaho?"Taho":e.isTokenPocket?"TokenPocket":e.isTokenary?"Tokenary":e.isTrust||e.isTrustWallet?"Trust Wallet":e.isTTWallet?"TTWallet":e.isXDEFI?"XDEFI Wallet":e.isZeal?"Zeal":e.isZerion?"Zerion":e.isMetaMask?"MetaMask":void 0,c=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||"MetaMask"!==p(e))return!1;if(e.providers)for(let t of e.providers)if(!c(t))return!1;return!0},u=()=>{if("phantom"in window){let e=window;if(e?.phantom?.ethereum?.isPhantom&&e?.phantom?.ethereum?.chainId)return!0}return!1},h=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers)for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0;return!1},d=(e,t)=>{let a=[],r=[];for(let[n,l]of e.entries())n<t?a.push(l):r.push(l);return[a,r]},m=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),f=(e,t)=>{let a=e.slice(0),r=[];for(;a.length;)r.push(a.splice(0,t));return r},g=(e,t=3,a=4,r="ethereum")=>{if(!e)return"";let n="ethereum"===r?2:0;return t+a+n+3>=e.length?e:`${e.slice(0,n+t)}...${e.slice(e.length-a,e.length)}`},y=(e,t=3,a=4)=>g(e,t,a,"solana"),b=e=>new Promise((t=>setTimeout(t,e)));function w(e,{interval:t=100,timeout:a=5e3}={}){return new Promise(((r,n)=>{let l,i=0,o=()=>{i>=a?n("Max attempts reached without result"):(l=e(),i+=t,null==l?setTimeout(o,t):r(l))};o()}))}const v=(e,t={})=>{let a=t.delayMs||150,r=t.maxAttempts||270;return new Promise((async(n,l)=>{let i=!1,o=0;for(;!i&&o<r;){if(t.abortSignal?.aborted)return;e().then((e=>{i=!0,n(e)}),((...e)=>{i=!0,l(...e)})),o+=1,await b(a)}i||l(Error("Exceeded max attempts before resolving function"))}))},C=(e,t,a={},r={})=>{let n=new URL(t,e);for(let[e,t]of Object.entries(a))void 0!==t&&n.searchParams.set(e,t);let l=Object.entries(r);if(l.length>0){let e=new URLSearchParams;for(let[t,a]of l)e.append(t,a);n.hash=e.toString()}return n.href},k=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),E=e=>"string"==typeof e?e:"0x"+e.toString(16);async function W({store:e,walletList:t,externalWalletConfig:a,walletChainType:r,timeout:n=3e3}){let l=!1,i=window;return new Promise((o=>{function s(){if(l)return;l=!0,window.removeEventListener("ethereum#initialized",s);let n=e.getProviders();console.debug("Detected injected providers:",n.map((e=>e.info)));let i=[];for(let e of n)t.includes("coinbase_wallet")&&"com.coinbase.wallet"===e.info.rdns||"solana-only"===r&&"app.phantom"===e.info.rdns||i.push({type:e.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:e});if("solana-only"!==r)for(let e of function(){let e=window,t=e.ethereum;if(!t)return[];let a=[];if(t.providers?.length)for(let e of t.providers)e&&a.push(e);return a.push(e.ethereum),a}()){let t=p(e);if(!n.some((e=>e.info.name===t))){if(c(e,!0)&&!i.find((e=>"metamask"===e.type))){i.push({type:"metamask",legacyInjectedProvider:e});continue}if("Phantom"===t&&!i.find((e=>"phantom"===e.type))){i.push({type:"phantom",legacyInjectedProvider:e});continue}if("Coinbase Wallet"===t&&!i.find((e=>"coinbase_wallet"===e.type&&"smartWalletOnly"!==a.coinbaseWallet?.connectionOptions))){i.push({type:"coinbase_wallet",legacyInjectedProvider:e});continue}i.find((e=>"unknown_browser_extension"===e.type))||i.push({type:"unknown_browser_extension",legacyInjectedProvider:e})}}o(i)}i.ethereum?s():(window.addEventListener("ethereum#initialized",s,{once:!0}),setTimeout((()=>{s()}),n))}))}function S(e){return`eip155:${String(Number(e))}`}const U=(e,a,r,n)=>{let l=Number(e),i=a.find((e=>e.id===l));if(!i)throw new t(`Unsupported chainId ${e}`,4901);return x(i,r,n)},x=(e,a,r)=>{let n,l=e.id,i=Number(e.id);if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])n=e.rpcUrls.privyWalletOverride.http[0];else if(a.rpcUrls&&a.rpcUrls[i])n=a.rpcUrls[i];else if(e.rpcUrls.privy?.http[0]){let t=new URL(e.rpcUrls.privy.http[0]);t.searchParams.append("privyAppId",r),n=t.toString()}else n=e.rpcUrls.public?.http[0]?e.rpcUrls.public.http[0]:e.rpcUrls.default?.http[0];if(!n)throw new t(`No RPC url found for ${l}`);return n},O=(e,a)=>{let r=Number(e),n=a.find((e=>e.id===r));if(!n)throw new t(`Unsupported chainId ${e}`,4901);return n.blockExplorers?.default.url},A=(a,r,n,l)=>{let i=Number(a),o=r.find((e=>e.id===i));if(!o)throw new t(`Unsupported chainId ${a}`,4901);return new e(o.rpcUrls.privyWalletOverride&&o.rpcUrls.privyWalletOverride.http[0]?o.rpcUrls.privyWalletOverride.http[0]:n.rpcUrls&&n.rpcUrls[i]?n.rpcUrls[i]:o.rpcUrls.privy?.http[0]?{url:o.rpcUrls.privy.http[0],headers:{"privy-app-id":l.appId}}:o.rpcUrls.public?.http[0]?o.rpcUrls.public.http[0]:o.rpcUrls.default?.http[0])},M=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},a=e.types.EIP712Domain??Object.entries(e.domain).map((([e,a])=>{if(null!=a&&"string"==typeof e&&e in t)return{name:e,type:t[e]}})).filter((e=>void 0!==e));return{...e,types:{...e.types,EIP712Domain:a}}};function T(e,{min:t,max:a}){return Math.min(Math.max(e,t),a)}const F="https://auth.privy.io",P=2e4,L=1400,H=2500,_=4e3,I="1.92.1",D="privy:token",j="privy-token",B="privy:refresh_token",z="privy-refresh-token",R="privy:id_token",K="privy-id-token",$="privy-session",q="privy:session_transfer_token",Z="privy:caid",N=e=>`privy:guest:${e}`,G=e=>`privy:cross-app:${e}`,X="privy:state_code",Y="privy:code_verifier",J="privy:headless_oauth",V="privy:oauth_disable_signup",Q=e=>`privy:wallet:${e}`,ee="privy:connectors",te="privy:connections",ae=12e4,re=1,ne="0x1",le=3e4,ie="https://api.moonpay.com/v1",oe="https://api.moonpay.com/v1",se="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",pe="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",ce="deprecated",ue={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}},he={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0},de={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}},me={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0},fe={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}},ge={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0},ye={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1},be={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1},we={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}},ve={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}},Ce={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0},ke={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}},Ee={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0},We={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0},Se={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}},Ue=[ue,he,We,we,ve,Ce,ke,Ee,ye,{id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0},{id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}},{id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}},fe,ge,{id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0},{id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}},be,{id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0},de,me,Se,{id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0},{id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},{id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}},{id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}},{id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}}],xe=new Set(Ue.map((e=>e.id))),Oe={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let Ae=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","wallet_connect","detected_wallets","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe"]),Me=e=>Ae.has(e),Te=(e,t,a)=>a.indexOf(e)===t;const Fe=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(Me).filter(Te):e?e.filter(Me).filter(Te):Oe.appearance.walletList;function Pe(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function Le(e){let t=e.filter((e=>!xe.has(e.id)));return Ue.concat(t)}function He(e,t){return{...e,rpcUrls:{...e.rpcUrls,privy:{http:[t]}}}}let _e="#FFFFFF";function Ie(e,t){let a=Math.max(0,Math.min(1,e.toHsl().l+t));return s({...e.toHsl(),l:a})}function De({backgroundTheme:e,accentHex:t}){let a;switch(e){case"light":a=_e;break;case"dark":a="#1E1E1D";break;default:a=e}let r=s(a),n=s(t),l=s("#51BA81"),i=s("#FFB74D"),o=s("#EC6351"),p=function(e){return e<.8&&e>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),e>.5?"light":"dark"}(r.getLuminance()),c=Ie(r,"light"===p?-.04:.11),u=Ie(r,"light"===p?-.88:.87),h=Ie(r,"light"===p?-.7:.75),d=Ie(r,"light"===p?-.43:.45).desaturate("light"===p?60:20),m=Ie(r,"light"===p?-.08:.25).desaturate("light"===p?60:20),f=Ie(n,.15),g=Ie(n,-.06),y=Ie(o,.3),b=Ie(i,.3),w=s(n.getLuminance()>.5?"#040217":_e),v=Ie(l,-.16),C=Ie(l,.4);return{colorScheme:p,background:r.toHslString(),background2:c.toHslString(),foreground:u.toHslString(),foreground2:h.toHslString(),foreground3:d.toHslString(),foreground4:m.toHslString(),accent:n.toHslString(),accentLight:f.toHslString(),accentDark:g.toHslString(),foregroundAccent:w.toHslString(),success:l.toHslString(),successDark:v.toHslString(),successLight:C.toHslString(),error:o.toHslString(),errorLight:y.toHslString(),warn:i.toHslString(),warnLight:b.toHslString()}}function je(e,t,a){let r,n,l,i,o,s,p,c,u,h,d,m,f,g,y,b,w=a?console.warn:()=>{};t?.loginMethods?(r=t.loginMethods.includes("email"),n=t.loginMethods.includes("sms"),i=t.loginMethods.includes("wallet"),o=t.loginMethods.includes("google"),s=t.loginMethods.includes("twitter"),p=t.loginMethods.includes("discord"),u=t.loginMethods.includes("spotify"),h=t.loginMethods.includes("instagram"),c=t.loginMethods.includes("tiktok"),m=t.loginMethods.includes("github"),d=t.loginMethods.includes("linkedin"),f=t.loginMethods.includes("apple"),g=t.loginMethods.includes("farcaster"),y=t.loginMethods.includes("telegram")):(r=e.emailAuth,n=e.smsAuth,i=e.walletAuth||e.solanaWalletAuth,o=e.googleOAuth,s=e.twitterOAuth,p=e.discordOAuth,m=e.githubOAuth,u=e.spotifyOAuth,h=e.instagramOAuth,c=e.tiktokOAuth,d=e.linkedinOAuth,f=e.appleOAuth,g=e.farcasterAuth,y=e.telegramAuth),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential?l=!1:e.passkeyAuth&&(l=!0);let v=[r,n].filter(Boolean),C=[o,s,p,m,u,h,c,d,f,g,y].filter(Boolean),k=[i].filter(Boolean);if(v.length+C.length+k.length===0)throw Error("You must enable at least one login method");let E=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;E&&0===k.length?(w("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),E=!1):E||C.length+v.length!==0||(w("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),E=!0);let W=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&w("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let S=Fe({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),U=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],a=[];for(let a of(e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),e.primary.slice(1)))t.includes(a)?console.warn(`Duplicated login method: ${a}`):t.push(a);for(let r of e.overflow??[])t.includes(r)||a.includes(r)?console.warn(`Duplicated login method: ${r}`):a.push(r);return{primary:t,overflow:a}})({input:t?.loginMethodsAndOrder}),x=t?.intl?.defaultCountry??"US",{chains:O,defaultChain:A}=function({additionalChains:e,supportedChains:t,defaultChainFromConfig:a,hasRpcConfigDefined:r}){let n;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(0===t.length)throw Error("`supportedChains` must contain at least one chain");t.filter((e=>e.rpcUrls.privyWalletOverride)).length>0&&r&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),n=t.map((e=>{if(e.rpcUrls.privyWalletOverride)return e;let t=Ue.find((t=>t.id===e.id)),a=t?.rpcUrls.privy?.http[0];return a?He(e,a):e}))}else n=Ue.concat(e??[]);let l=t?n[0]:we,i=a??l;if(!n.find((e=>e.id===i.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:i}}({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),M=!!t?.defaultChain,T=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,F=!(e.enforceWalletUis??1);if(b=e.legacyWalletUiConfig??1?T?t?.embeddedWallets?.noPromptOnSignature??!0:t?.embeddedWallets?.noPromptOnSignature??F:F,!1===t?.embeddedWallets?.waitForTransactionConfirmation&&!0!==b)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:P,...L}=t?.embeddedWallets??{};return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??Oe.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:De({backgroundTheme:t?.appearance?.theme??Oe.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??Oe.appearance.accentColor}),loginGroupPriority:E?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:S,walletChainType:t?.appearance?.walletChainType??(({evmWalletAuth:e,solanaWalletAuth:t})=>e&&t?"ethereum-and-solana":e?"ethereum-only":t?"solana-only":"ethereum-only")({evmWalletAuth:e.walletAuth??!1,solanaWalletAuth:e.solanaWalletAuth??!1})},loginMethods:{wallet:i,email:r,sms:n,passkey:l,google:o,twitter:s,discord:p,github:m,spotify:u,instagram:h,tiktok:c,linkedin:d,apple:f,farcaster:g,telegram:y},disablePlusEmails:e.disablePlusEmails,loginMethodsAndOrder:U,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??Oe.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??Oe.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??Oe.rpcConfig.rpcTimeouts},chains:O,defaultChain:A,intl:{defaultCountry:x},shouldEnforceDefaultChainOnConnect:M,captchaEnabled:e.captchaEnabled??Oe.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??Oe.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:W},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{...e.embeddedWalletConfig,..."boolean"==typeof P?{requireUserOwnedRecoveryOnCreate:P}:{},...T?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...L,noPromptOnSignature:b,showWalletUIs:t?.embeddedWallets?.showWalletUIs},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:T?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??Oe._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??Oe.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??Oe.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??Oe.fundingMethodConfig.moonpay.useSandbox}}}}let Be={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,disablePlusEmails:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""};const ze=je(Be,void 0,!1);let Re=o({appConfig:ze,isServerConfigLoaded:!1});const Ke=({children:e,legacyCreateEmbeddedWalletFlag:t,client:i,clientConfig:o})=>{let[s,p]=r(null),c=n((()=>je(s??Be,o,!!s)),[s,o]);return l((()=>{if(!s)return;let e=function(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:a,additionalChains:r,supportedChains:n,defaultChain:l,externalWallets:i,...o}=e;return{...o,...r?{additionalChains:r.map((e=>e.id))}:void 0,...n?{supportedChains:n.map((e=>e.id))}:void 0,...l?{defaultChain:l.id}:void 0,...i?{walletConnect:i.walletConnect,coinbaseWallet:i.coinbaseWallet,solana:{connectors:i.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0,legacyCreateEmbeddedWalletFlag:t}}(o,t),a=function(e,t=0){let a=3735928559^t,r=1103547991^t;for(let t,n=0;n<e.length;n++)a=Math.imul(a^(t=e.charCodeAt(n)),2654435761),r=Math.imul(r^t,1597334677);return a=Math.imul(a^a>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&(r=Math.imul(r^r>>>16,2246822507)^Math.imul(a^a>>>13,3266489909)))+(a>>>0)}(JSON.stringify(e)).toString(),r=`privy:sent:${s.id}:${a}`;localStorage.getItem(r)||(i.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(r,"t"))}),[o,t,s]),l((()=>{s||(async()=>{try{let e=await i.getServerConfig();e.customApiUrl&&i.updateApiUrl(e.customApiUrl),p(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),a(Re.Provider,{value:{appConfig:c,isServerConfigLoaded:!!s},children:e})},$e=()=>{let{appConfig:e}=i(Re);return e},qe=()=>{let{isServerConfigLoaded:e}=i(Re);return e},Ze=o(null);function Ne(){let e=i(Ze);if(null===e)throw Error("`useWallets` was called outside the PrivyProvider component");return e}export{we as $,L as A,h as B,Y as C,ae as D,g as E,q as F,b as G,J as H,R as I,H as J,C as K,f as L,T as M,Le as N,V as O,re as P,x as Q,B as R,X as S,D as T,ue as U,I as V,le as W,de as X,fe as Y,ye as Z,be as _,A as a,ve as a0,ke as a1,Se as a2,Ne as a3,_ as a4,y as a5,oe as a6,ie as a7,pe as a8,se as a9,m as aa,d as ab,We as ac,Ce as ad,Ee as ae,ge as af,me as ag,he as ah,Ke as ai,qe as aj,Ze as ak,Ue as al,Pe as am,He as an,O as ao,ze as ap,M as b,Q as c,ne as d,xe as e,S as f,N as g,U as h,v as i,ee as j,W as k,u as l,te as m,G as n,$ as o,w as p,ce as q,j as r,k as s,E as t,z as u,K as v,F as w,P as x,Z as y,$e as z};
|
|
1
|
+
import{StaticJsonRpcProvider as e}from"@ethersproject/providers";import{c as t}from"./privy-context-QVrL4VJ3.mjs";import{jsx as a}from"react/jsx-runtime";import{useState as r,useMemo as n,useEffect as l,useContext as i,createContext as o}from"react";import s from"tinycolor2";const p=e=>e.isApexWallet?"Apex Wallet":e.isAvalanche?"Core Wallet":e.isBackpack?"Backpack":e.isBifrost?"Bifrost Wallet":e.isBitKeep?"BitKeep":e.isBitski?"Bitski":e.isBlockWallet?"BlockWallet":e.isBraveWallet?"Brave Wallet":e.isClover?"Clover":e.isCoin98?"Coin98 Wallet":e.isCoinbaseWallet?"Coinbase Wallet":e.isDawn?"Dawn Wallet":e.isDefiant?"Defiant":e.isDesig?"Desig Wallet":e.isEnkrypt?"Enkrypt":e.isExodus?"Exodus":e.isFordefi?"Fordefi":e.isFrame?"Frame":e.isFrontier?"Frontier Wallet":e.isGamestop?"GameStop Wallet":e.isHaqqWallet?"HAQQ Wallet":e.isHyperPay?"HyperPay Wallet":e.isImToken?"ImToken":e.isHaloWallet?"Halo Wallet":e.isKuCoinWallet?"KuCoin Wallet":e.isMathWallet?"MathWallet":e.isNovaWallet?"Nova Wallet":e.isOkxWallet||e.isOKExWallet?"OKX Wallet":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch Wallet":e.isOneKey?"OneKey Wallet":e.isOpera?"Opera":e.isPhantom?"Phantom":e.isPortal?"Ripio Portal":e.isRabby?"Rabby Wallet":e.isRainbow?"Rainbow":e.isSafePal?"SafePal Wallet":e.isStatus?"Status":e.isSubWallet?"SubWallet":e.isTalisman?"Talisman":e.isTally||e.isTaho?"Taho":e.isTokenPocket?"TokenPocket":e.isTokenary?"Tokenary":e.isTrust||e.isTrustWallet?"Trust Wallet":e.isTTWallet?"TTWallet":e.isXDEFI?"XDEFI Wallet":e.isZeal?"Zeal":e.isZerion?"Zerion":e.isMetaMask?"MetaMask":void 0,c=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||"MetaMask"!==p(e))return!1;if(e.providers)for(let t of e.providers)if(!c(t))return!1;return!0},u=()=>{if("phantom"in window){let e=window;if(e?.phantom?.ethereum?.isPhantom&&e?.phantom?.ethereum?.chainId)return!0}return!1},h=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers)for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0;return!1},d=(e,t)=>{let a=[],r=[];for(let[n,l]of e.entries())n<t?a.push(l):r.push(l);return[a,r]},m=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),f=(e,t)=>{let a=e.slice(0),r=[];for(;a.length;)r.push(a.splice(0,t));return r},g=(e,t=3,a=4,r="ethereum")=>{if(!e)return"";let n="ethereum"===r?2:0;return t+a+n+3>=e.length?e:`${e.slice(0,n+t)}...${e.slice(e.length-a,e.length)}`},y=(e,t=3,a=4)=>g(e,t,a,"solana"),b=e=>new Promise((t=>setTimeout(t,e)));function w(e,{interval:t=100,timeout:a=5e3}={}){return new Promise(((r,n)=>{let l,i=0,o=()=>{i>=a?n("Max attempts reached without result"):(l=e(),i+=t,null==l?setTimeout(o,t):r(l))};o()}))}const v=(e,t={})=>{let a=t.delayMs||150,r=t.maxAttempts||270;return new Promise((async(n,l)=>{let i=!1,o=0;for(;!i&&o<r;){if(t.abortSignal?.aborted)return;e().then((e=>{i=!0,n(e)}),((...e)=>{i=!0,l(...e)})),o+=1,await b(a)}i||l(Error("Exceeded max attempts before resolving function"))}))},C=(e,t,a={},r={})=>{let n=new URL(t,e);for(let[e,t]of Object.entries(a))void 0!==t&&n.searchParams.set(e,t);let l=Object.entries(r);if(l.length>0){let e=new URLSearchParams;for(let[t,a]of l)e.append(t,a);n.hash=e.toString()}return n.href},k=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),E=e=>"string"==typeof e?e:"0x"+e.toString(16);async function W({store:e,walletList:t,externalWalletConfig:a,walletChainType:r,timeout:n=3e3}){let l=!1,i=window;return new Promise((o=>{function s(){if(l)return;l=!0,window.removeEventListener("ethereum#initialized",s);let n=e.getProviders();console.debug("Detected injected providers:",n.map((e=>e.info)));let i=[];for(let e of n)t.includes("coinbase_wallet")&&"com.coinbase.wallet"===e.info.rdns||"solana-only"===r&&"app.phantom"===e.info.rdns||i.push({type:e.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:e});if("solana-only"!==r)for(let e of function(){let e=window,t=e.ethereum;if(!t)return[];let a=[];if(t.providers?.length)for(let e of t.providers)e&&a.push(e);return a.push(e.ethereum),a}()){let t=p(e);if(!n.some((e=>e.info.name===t))){if(c(e,!0)&&!i.find((e=>"metamask"===e.type))){i.push({type:"metamask",legacyInjectedProvider:e});continue}if("Phantom"===t&&!i.find((e=>"phantom"===e.type))){i.push({type:"phantom",legacyInjectedProvider:e});continue}if("Coinbase Wallet"===t&&!i.find((e=>"coinbase_wallet"===e.type&&"smartWalletOnly"!==a.coinbaseWallet?.connectionOptions))){i.push({type:"coinbase_wallet",legacyInjectedProvider:e});continue}i.find((e=>"unknown_browser_extension"===e.type))||i.push({type:"unknown_browser_extension",legacyInjectedProvider:e})}}o(i)}i.ethereum?s():(window.addEventListener("ethereum#initialized",s,{once:!0}),setTimeout((()=>{s()}),n))}))}function S(e){return`eip155:${String(Number(e))}`}const U=(e,a,r,n)=>{let l=Number(e),i=a.find((e=>e.id===l));if(!i)throw new t(`Unsupported chainId ${e}`,4901);return x(i,r,n)},x=(e,a,r)=>{let n,l=e.id,i=Number(e.id);if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])n=e.rpcUrls.privyWalletOverride.http[0];else if(a.rpcUrls&&a.rpcUrls[i])n=a.rpcUrls[i];else if(e.rpcUrls.privy?.http[0]){let t=new URL(e.rpcUrls.privy.http[0]);t.searchParams.append("privyAppId",r),n=t.toString()}else n=e.rpcUrls.public?.http[0]?e.rpcUrls.public.http[0]:e.rpcUrls.default?.http[0];if(!n)throw new t(`No RPC url found for ${l}`);return n},O=(e,a)=>{let r=Number(e),n=a.find((e=>e.id===r));if(!n)throw new t(`Unsupported chainId ${e}`,4901);return n.blockExplorers?.default.url},A=(a,r,n,l)=>{let i=Number(a),o=r.find((e=>e.id===i));if(!o)throw new t(`Unsupported chainId ${a}`,4901);return new e(o.rpcUrls.privyWalletOverride&&o.rpcUrls.privyWalletOverride.http[0]?o.rpcUrls.privyWalletOverride.http[0]:n.rpcUrls&&n.rpcUrls[i]?n.rpcUrls[i]:o.rpcUrls.privy?.http[0]?{url:o.rpcUrls.privy.http[0],headers:{"privy-app-id":l.appId}}:o.rpcUrls.public?.http[0]?o.rpcUrls.public.http[0]:o.rpcUrls.default?.http[0])},M=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},a=e.types.EIP712Domain??Object.entries(e.domain).map((([e,a])=>{if(null!=a&&"string"==typeof e&&e in t)return{name:e,type:t[e]}})).filter((e=>void 0!==e));return{...e,types:{...e.types,EIP712Domain:a}}};function T(e,{min:t,max:a}){return Math.min(Math.max(e,t),a)}const F="https://auth.privy.io",P=2e4,L=1400,H=2500,_=4e3,I="1.92.2",D="privy:token",j="privy-token",B="privy:refresh_token",z="privy-refresh-token",R="privy:id_token",K="privy-id-token",$="privy-session",q="privy:session_transfer_token",Z="privy:caid",N=e=>`privy:guest:${e}`,G=e=>`privy:cross-app:${e}`,X="privy:state_code",Y="privy:code_verifier",J="privy:headless_oauth",V="privy:oauth_disable_signup",Q=e=>`privy:wallet:${e}`,ee="privy:connectors",te="privy:connections",ae=12e4,re=1,ne="0x1",le=3e4,ie="https://api.moonpay.com/v1",oe="https://api.moonpay.com/v1",se="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",pe="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",ce="deprecated",ue={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}},he={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0},de={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}},me={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0},fe={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}},ge={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0},ye={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1},be={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1},we={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}},ve={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}},Ce={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0},ke={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}},Ee={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0},We={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0},Se={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}},Ue=[ue,he,We,we,ve,Ce,ke,Ee,ye,{id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0},{id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}},{id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}},fe,ge,{id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0},{id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}},be,{id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0},de,me,Se,{id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0},{id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},{id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}},{id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}},{id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}}],xe=new Set(Ue.map((e=>e.id))),Oe={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let Ae=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","wallet_connect","detected_wallets","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe"]),Me=e=>Ae.has(e),Te=(e,t,a)=>a.indexOf(e)===t;const Fe=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(Me).filter(Te):e?e.filter(Me).filter(Te):Oe.appearance.walletList;function Pe(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function Le(e){let t=e.filter((e=>!xe.has(e.id)));return Ue.concat(t)}function He(e,t){return{...e,rpcUrls:{...e.rpcUrls,privy:{http:[t]}}}}let _e="#FFFFFF";function Ie(e,t){let a=Math.max(0,Math.min(1,e.toHsl().l+t));return s({...e.toHsl(),l:a})}function De({backgroundTheme:e,accentHex:t}){let a;switch(e){case"light":a=_e;break;case"dark":a="#1E1E1D";break;default:a=e}let r=s(a),n=s(t),l=s("#51BA81"),i=s("#FFB74D"),o=s("#EC6351"),p=function(e){return e<.8&&e>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),e>.5?"light":"dark"}(r.getLuminance()),c=Ie(r,"light"===p?-.04:.11),u=Ie(r,"light"===p?-.88:.87),h=Ie(r,"light"===p?-.7:.75),d=Ie(r,"light"===p?-.43:.45).desaturate("light"===p?60:20),m=Ie(r,"light"===p?-.08:.25).desaturate("light"===p?60:20),f=Ie(n,.15),g=Ie(n,-.06),y=Ie(o,.3),b=Ie(i,.3),w=s(n.getLuminance()>.5?"#040217":_e),v=Ie(l,-.16),C=Ie(l,.4);return{colorScheme:p,background:r.toHslString(),background2:c.toHslString(),foreground:u.toHslString(),foreground2:h.toHslString(),foreground3:d.toHslString(),foreground4:m.toHslString(),accent:n.toHslString(),accentLight:f.toHslString(),accentDark:g.toHslString(),foregroundAccent:w.toHslString(),success:l.toHslString(),successDark:v.toHslString(),successLight:C.toHslString(),error:o.toHslString(),errorLight:y.toHslString(),warn:i.toHslString(),warnLight:b.toHslString()}}function je(e,t,a){let r,n,l,i,o,s,p,c,u,h,d,m,f,g,y,b,w=a?console.warn:()=>{};t?.loginMethods?(r=t.loginMethods.includes("email"),n=t.loginMethods.includes("sms"),i=t.loginMethods.includes("wallet"),o=t.loginMethods.includes("google"),s=t.loginMethods.includes("twitter"),p=t.loginMethods.includes("discord"),u=t.loginMethods.includes("spotify"),h=t.loginMethods.includes("instagram"),c=t.loginMethods.includes("tiktok"),m=t.loginMethods.includes("github"),d=t.loginMethods.includes("linkedin"),f=t.loginMethods.includes("apple"),g=t.loginMethods.includes("farcaster"),y=t.loginMethods.includes("telegram")):(r=e.emailAuth,n=e.smsAuth,i=e.walletAuth||e.solanaWalletAuth,o=e.googleOAuth,s=e.twitterOAuth,p=e.discordOAuth,m=e.githubOAuth,u=e.spotifyOAuth,h=e.instagramOAuth,c=e.tiktokOAuth,d=e.linkedinOAuth,f=e.appleOAuth,g=e.farcasterAuth,y=e.telegramAuth),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential?l=!1:e.passkeyAuth&&(l=!0);let v=[r,n].filter(Boolean),C=[o,s,p,m,u,h,c,d,f,g,y].filter(Boolean),k=[i].filter(Boolean);if(v.length+C.length+k.length===0)throw Error("You must enable at least one login method");let E=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;E&&0===k.length?(w("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),E=!1):E||C.length+v.length!==0||(w("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),E=!0);let W=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&w("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let S=Fe({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),U=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],a=[];for(let a of(e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),e.primary.slice(1)))t.includes(a)?console.warn(`Duplicated login method: ${a}`):t.push(a);for(let r of e.overflow??[])t.includes(r)||a.includes(r)?console.warn(`Duplicated login method: ${r}`):a.push(r);return{primary:t,overflow:a}})({input:t?.loginMethodsAndOrder}),x=t?.intl?.defaultCountry??"US",{chains:O,defaultChain:A}=function({additionalChains:e,supportedChains:t,defaultChainFromConfig:a,hasRpcConfigDefined:r}){let n;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(0===t.length)throw Error("`supportedChains` must contain at least one chain");t.filter((e=>e.rpcUrls.privyWalletOverride)).length>0&&r&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),n=t.map((e=>{if(e.rpcUrls.privyWalletOverride)return e;let t=Ue.find((t=>t.id===e.id)),a=t?.rpcUrls.privy?.http[0];return a?He(e,a):e}))}else n=Ue.concat(e??[]);let l=t?n[0]:we,i=a??l;if(!n.find((e=>e.id===i.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:i}}({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),M=!!t?.defaultChain,T=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,F=!(e.enforceWalletUis??1);if(b=e.legacyWalletUiConfig??1?T?t?.embeddedWallets?.noPromptOnSignature??!0:t?.embeddedWallets?.noPromptOnSignature??F:F,!1===t?.embeddedWallets?.waitForTransactionConfirmation&&!0!==b)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:P,...L}=t?.embeddedWallets??{};return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??Oe.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:De({backgroundTheme:t?.appearance?.theme??Oe.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??Oe.appearance.accentColor}),loginGroupPriority:E?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:S,walletChainType:t?.appearance?.walletChainType??(({evmWalletAuth:e,solanaWalletAuth:t})=>e&&t?"ethereum-and-solana":e?"ethereum-only":t?"solana-only":"ethereum-only")({evmWalletAuth:e.walletAuth??!1,solanaWalletAuth:e.solanaWalletAuth??!1})},loginMethods:{wallet:i,email:r,sms:n,passkey:l,google:o,twitter:s,discord:p,github:m,spotify:u,instagram:h,tiktok:c,linkedin:d,apple:f,farcaster:g,telegram:y},disablePlusEmails:e.disablePlusEmails,loginMethodsAndOrder:U,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??Oe.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??Oe.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??Oe.rpcConfig.rpcTimeouts},chains:O,defaultChain:A,intl:{defaultCountry:x},shouldEnforceDefaultChainOnConnect:M,captchaEnabled:e.captchaEnabled??Oe.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??Oe.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:W},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{...e.embeddedWalletConfig,..."boolean"==typeof P?{requireUserOwnedRecoveryOnCreate:P}:{},...T?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...L,noPromptOnSignature:b,showWalletUIs:t?.embeddedWallets?.showWalletUIs},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:T?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??Oe._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??Oe.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??Oe.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??Oe.fundingMethodConfig.moonpay.useSandbox}}}}let Be={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,disablePlusEmails:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""};const ze=je(Be,void 0,!1);let Re=o({appConfig:ze,isServerConfigLoaded:!1});const Ke=({children:e,legacyCreateEmbeddedWalletFlag:t,client:i,clientConfig:o})=>{let[s,p]=r(null),c=n((()=>je(s??Be,o,!!s)),[s,o]);return l((()=>{if(!s)return;let e=function(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:a,additionalChains:r,supportedChains:n,defaultChain:l,externalWallets:i,...o}=e;return{...o,...r?{additionalChains:r.map((e=>e.id))}:void 0,...n?{supportedChains:n.map((e=>e.id))}:void 0,...l?{defaultChain:l.id}:void 0,...i?{walletConnect:i.walletConnect,coinbaseWallet:i.coinbaseWallet,solana:{connectors:i.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0,legacyCreateEmbeddedWalletFlag:t}}(o,t),a=function(e,t=0){let a=3735928559^t,r=1103547991^t;for(let t,n=0;n<e.length;n++)a=Math.imul(a^(t=e.charCodeAt(n)),2654435761),r=Math.imul(r^t,1597334677);return a=Math.imul(a^a>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&(r=Math.imul(r^r>>>16,2246822507)^Math.imul(a^a>>>13,3266489909)))+(a>>>0)}(JSON.stringify(e)).toString(),r=`privy:sent:${s.id}:${a}`;localStorage.getItem(r)||(i.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(r,"t"))}),[o,t,s]),l((()=>{s||(async()=>{try{let e=await i.getServerConfig();e.customApiUrl&&i.updateApiUrl(e.customApiUrl),p(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),a(Re.Provider,{value:{appConfig:c,isServerConfigLoaded:!!s},children:e})},$e=()=>{let{appConfig:e}=i(Re);return e},qe=()=>{let{isServerConfigLoaded:e}=i(Re);return e},Ze=o(null);function Ne(){let e=i(Ze);if(null===e)throw Error("`useWallets` was called outside the PrivyProvider component");return e}export{we as $,L as A,h as B,Y as C,ae as D,g as E,q as F,b as G,J as H,R as I,H as J,C as K,f as L,T as M,Le as N,V as O,re as P,x as Q,B as R,X as S,D as T,ue as U,I as V,le as W,de as X,fe as Y,ye as Z,be as _,A as a,ve as a0,ke as a1,Se as a2,Ne as a3,_ as a4,y as a5,oe as a6,ie as a7,pe as a8,se as a9,m as aa,d as ab,We as ac,Ce as ad,Ee as ae,ge as af,me as ag,he as ah,Ke as ai,qe as aj,Ze as ak,Ue as al,Pe as am,He as an,O as ao,ze as ap,M as b,Q as c,ne as d,xe as e,S as f,N as g,U as h,v as i,ee as j,W as k,u as l,te as m,G as n,$ as o,w as p,ce as q,j as r,k as s,E as t,z as u,K as v,F as w,P as x,Z as y,$e as z};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@privy-io/react-auth",
|
|
3
|
-
"version": "1.92.
|
|
3
|
+
"version": "1.92.2",
|
|
4
4
|
"description": "React client for the Privy Auth API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"authentication",
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"@heroicons/react": "^2.1.1",
|
|
108
108
|
"@marsidev/react-turnstile": "^0.4.1",
|
|
109
109
|
"@metamask/eth-sig-util": "^6.0.0",
|
|
110
|
-
"@privy-io/js-sdk-core": "0.29.
|
|
110
|
+
"@privy-io/js-sdk-core": "0.29.3",
|
|
111
111
|
"@simplewebauthn/browser": "^9.0.1",
|
|
112
112
|
"@solana/wallet-adapter-base": "^0.9.23",
|
|
113
113
|
"@solana/wallet-standard-wallet-adapter-base": "^1.1.2",
|