@privy-io/react-auth 1.85.0 → 1.86.0

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.
@@ -1,4 +1,4 @@
1
- import{i as _,oa as F,ra as D,sa as b,ta as V}from"./chunk-XKAIXCX7.js";import{useContext as he}from"react";import{createContext as de,useContext as pe,useEffect as fe}from"react";var tt={login:{onComplete:[],onError:[],onOAuthLoginComplete:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},sendSolanaTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]},customAuth:{onAuthenticated:[],onUnauthenticated:[]}},me=de(void 0),N=()=>pe(me);function y(t,r){if(!r)return;let n=N().current[t];return fe(()=>{for(let[i,o]of Object.entries(r))n.hasOwnProperty(i)||console.warn(`Invalid event type "${i}" for action "${t}"`),n[i]?.push(o);return()=>{for(let[i,o]of Object.entries(r))n.hasOwnProperty(i)||console.warn(`Invalid event type "${i}" for action "${t}"`),n[i]=n[i]?.filter(s=>s!==o)}},[r])}function ye(t,r,e,...n){for(let i of t.current[r][e])i(...n)}function rt(){let t=N();return(r,e,...n)=>ye(t,r,e,...n)}function st(t){let{logout:r}=he(b);return y("logout",t),{logout:r}}import{useContext as ve}from"react";function pt(t){let{login:r}=ve(b);return y("login",t),{login:r}}import{useContext as ge}from"react";function vt(t){let{connectWallet:r}=ge(b);return y("connectWallet",t),{connectWallet:r}}var At=t=>{y("fundWallet",t);let{fundWallet:r}=V();return{fundWallet:r}};var S=class{constructor(){this._cache={}}get(r){return this._cache[r]}put(r,e){e!==void 0?this._cache[r]=e:this.del(r)}del(r){delete this._cache[r]}getKeys(){return Object.keys(this._cache)}},P=class{get(r){let e=localStorage.getItem(r);return e===null?void 0:JSON.parse(e)}put(r,e){e!==void 0?localStorage.setItem(r,JSON.stringify(e)):this.del(r)}del(r){localStorage.removeItem(r)}getKeys(){return Object.entries(localStorage).map(([r])=>r)}};function wt(){try{let t="privy:__session_storage__test",r="blobby",e=new P;return e.put(t,r),e.del(t),!0}catch{return!1}}function _e(){return typeof window<"u"&&window.localStorage?new P:new S}var A=_e();function B(){let t=window,r=t.ethereum;if(!r)return[];let e=[];if(r.providers?.length)for(let n of r.providers)n&&e.push(n);return e.push(t.ethereum),e}var T=t=>{if(t.isApexWallet)return"Apex Wallet";if(t.isAvalanche)return"Core Wallet";if(t.isBackpack)return"Backpack";if(t.isBifrost)return"Bifrost Wallet";if(t.isBitKeep)return"BitKeep";if(t.isBitski)return"Bitski";if(t.isBlockWallet)return"BlockWallet";if(t.isBraveWallet)return"Brave Wallet";if(t.isClover)return"Clover";if(t.isCoin98)return"Coin98 Wallet";if(t.isCoinbaseWallet)return"Coinbase Wallet";if(t.isDawn)return"Dawn Wallet";if(t.isDefiant)return"Defiant";if(t.isDesig)return"Desig Wallet";if(t.isEnkrypt)return"Enkrypt";if(t.isExodus)return"Exodus";if(t.isFordefi)return"Fordefi";if(t.isFrame)return"Frame";if(t.isFrontier)return"Frontier Wallet";if(t.isGamestop)return"GameStop Wallet";if(t.isHaqqWallet)return"HAQQ Wallet";if(t.isHyperPay)return"HyperPay Wallet";if(t.isImToken)return"ImToken";if(t.isHaloWallet)return"Halo Wallet";if(t.isKuCoinWallet)return"KuCoin Wallet";if(t.isMathWallet)return"MathWallet";if(t.isNovaWallet)return"Nova Wallet";if(t.isOkxWallet||t.isOKExWallet)return"OKX Wallet";if(t.isOneInchIOSWallet||t.isOneInchAndroidWallet)return"1inch Wallet";if(t.isOneKey)return"OneKey Wallet";if(t.isOpera)return"Opera";if(t.isPhantom)return"Phantom";if(t.isPortal)return"Ripio Portal";if(t.isRabby)return"Rabby Wallet";if(t.isRainbow)return"Rainbow";if(t.isSafePal)return"SafePal Wallet";if(t.isStatus)return"Status";if(t.isSubWallet)return"SubWallet";if(t.isTalisman)return"Talisman";if(t.isTally||t.isTaho)return"Taho";if(t.isTokenPocket)return"TokenPocket";if(t.isTokenary)return"Tokenary";if(t.isTrust||t.isTrustWallet)return"Trust Wallet";if(t.isTTWallet)return"TTWallet";if(t.isXDEFI)return"XDEFI Wallet";if(t.isZeal)return"Zeal";if(t.isZerion)return"Zerion";if(t.isMetaMask)return"MetaMask"};var R=(t,r)=>{if(!t.isMetaMask)return!1;if(t.isMetaMask&&!r)return!0;if(t.isBraveWallet&&!t._events&&!t._state||T(t)!=="MetaMask")return!1;if(t.providers){for(let e of t.providers)if(!R(e))return!1}return!0},Tt=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),Ct=()=>{let t=window;if(!t.ethereum)return!1;if(t.ethereum.isCoinbaseWallet)return!0;if(t.ethereum.providers){for(let r of t.ethereum.providers)if(r&&r.isCoinbaseWallet)return!0}return!1};import{StaticJsonRpcProvider as x}from"@ethersproject/providers";var It=(t,r)=>{let e=[],n=[];for(let[i,o]of t.entries())i<r?e.push(o):n.push(o);return[e,n]},Ut=t=>!!String(t).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,}))$/),Lt=(t,r)=>{let e=t.slice(0),n=[];for(;e.length;)n.push(e.splice(0,r));return n},O=(t,r=3,e=4,n="ethereum")=>{if(!t)return"";let i=n==="ethereum"?2:0,o=3;if(r+e+i+o>=t.length)return t;let s=t.slice(0,i+r),c=t.slice(t.length-e,t.length);return`${s}...${c}`},be=t=>new Promise(r=>setTimeout(r,t));function jt(t,{interval:r=100,timeout:e=5e3}={}){return new Promise((n,i)=>{let o=0,s,c=()=>{if(o>=e){i("Max attempts reached without result");return}if(s=t(),o+=r,s!=null){n(s);return}setTimeout(c,r)};c()})}var $t=(t,r={})=>{let e=r.delayMs||150,n=r.maxAttempts||270;return new Promise(async(i,o)=>{let s=!1,c=0;for(;!s&&c<n;){if(r.abortSignal?.aborted)return;t().then(l=>{s=!0,i(l)},(...l)=>{s=!0,o(...l)}),c+=1,await be(e)}s||o(new Error("Exceeded max attempts before resolving function"))})},Ft=(t,r,e={},n={})=>{let i=new URL(r,t);for(let[s,c]of Object.entries(e))c!==void 0&&i.searchParams.set(s,c);let o=Object.entries(n);if(o.length>0){let s=new URLSearchParams;for(let[c,l]of o)s.append(c,l);i.hash=s.toString()}return i.href};var Dt=t=>t.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),Vt=t=>typeof t=="string"?t:"0x"+t.toString(16);async function Nt(t,r,e,n=3e3){let i=!1,o=window;return new Promise(s=>{o.ethereum?c():(window.addEventListener("ethereum#initialized",c,{once:!0}),setTimeout(()=>{c()},n));function c(){if(i)return;i=!0,window.removeEventListener("ethereum#initialized",c);let l=t.getProviders();console.debug("Detected injected providers:",l.map(d=>d.info));let u=[];for(let d of l)r.includes("coinbase_wallet")&&d.info.rdns==="com.coinbase.wallet"||u.push({type:d.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:d});for(let d of B()){let h=T(d);if(!l.some(p=>p.info.name===h)){if(R(d,!0)&&!u.find(p=>p.type==="metamask")){u.push({type:"metamask",legacyInjectedProvider:d});continue}if(h==="Phantom"&&!u.find(p=>p.type==="phantom")){u.push({type:"phantom",legacyInjectedProvider:d});continue}if(h==="Coinbase Wallet"&&!u.find(p=>p.type==="coinbase_wallet"&&e?.coinbaseWallet?.connectionOptions!=="smartWalletOnly")){u.push({type:"coinbase_wallet",legacyInjectedProvider:d});continue}u.find(p=>p.type==="unknown_browser_extension")||u.push({type:"unknown_browser_extension",legacyInjectedProvider:d})}}s(u)}})}function Bt(t){return`eip155:${String(Number(t))}`}var Gt=(t,r,e,n)=>{let i=Number(t),o=r.find(s=>s.id===i);if(!o)throw new _(`Unsupported chainId ${t}`,4901);return Ae(o,e,n)},Ae=(t,r,e)=>{let n=t.id,i=Number(t.id),o;if(t.rpcUrls.privyWalletOverride&&t.rpcUrls.privyWalletOverride.http[0])o=t.rpcUrls.privyWalletOverride.http[0];else if(r.rpcUrls&&r.rpcUrls[i])o=r.rpcUrls[i];else if(t.rpcUrls.privy?.http[0]){let s=new URL(t.rpcUrls.privy.http[0]);s.searchParams.append("privyAppId",e),o=s.toString()}else t.rpcUrls.public?.http[0]?o=t.rpcUrls.public.http[0]:o=t.rpcUrls.default?.http[0];if(!o)throw new _(`No RPC url found for ${n}`);return o},G=(t,r)=>{let e=Number(t),n=r.find(i=>i.id===e);if(!n)throw new _(`Unsupported chainId ${t}`,4901);return n.blockExplorers?.default.url},Ht=(t,r,e,n)=>{let i=Number(t),o=r.find(c=>c.id===i);if(!o)throw new _(`Unsupported chainId ${t}`,4901);let s;if(o.rpcUrls.privyWalletOverride&&o.rpcUrls.privyWalletOverride.http[0]?s=new x(o.rpcUrls.privyWalletOverride.http[0]):e.rpcUrls&&e.rpcUrls[i]?s=new x(e.rpcUrls[i]):o.rpcUrls.privy?.http[0]?s=new x({url:o.rpcUrls.privy.http[0],headers:{"privy-app-id":n.appId}}):o.rpcUrls.public?.http[0]?s=new x(o.rpcUrls.public.http[0]):s=new x(o.rpcUrls.default?.http[0]),!s)throw new _(`No RPC url found for ${t}`);return s},Kt=t=>{let r={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},e=t.types.EIP712Domain??Object.entries(t.domain).map(([n,i])=>{if(i!=null&&typeof n=="string"&&n in r)return{name:n,type:r[n]}}).filter(n=>n!==void 0);return{...t,types:{...t.types,EIP712Domain:e}}};function zt(t,{min:r,max:e}){return Math.min(Math.max(t,r),e)}import{getAddress as H}from"@ethersproject/address";function a(t){return t?new Date(t*1e3):null}function We(t){let r=[];for(let e of t){let n=e.type;switch(e.type){case"wallet":let i={address:e.address,type:e.type,imported:e.imported,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at),chainType:e.chain_type,chainId:e.chain_id,walletClient:e.wallet_client_type==="privy"?"privy":"unknown",walletClientType:e.wallet_client_type,connectorType:e.connector_type,recoveryMethod:e.recovery_method,walletIndex:e.wallet_index};r.push(i);break;case"smart_wallet":let o={address:e.address,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at),smartWalletType:e.smart_wallet_type};r.push(o);break;case"cross_app":let s={type:e.type,subject:e.subject,embeddedWallets:e.embedded_wallets,smartWallets:e.smart_wallets,providerApp:{id:e.provider_app_id},verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(s);break;case"email":let c={address:e.address,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(c);break;case"phone":let l={number:e.phoneNumber,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(l);break;case"google_oauth":let u={subject:e.subject,email:e.email,name:e.name,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(u);break;case"spotify_oauth":let d={subject:e.subject,email:e.email,name:e.name,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(d);break;case"instagram_oauth":let h={subject:e.subject,username:e.username,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(h);break;case"twitter_oauth":let p={subject:e.subject,username:e.username,name:e.name,type:e.type,profilePictureUrl:e.profile_picture_url,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(p);break;case"discord_oauth":let g={subject:e.subject,username:e.username,email:e.email,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(g);break;case"github_oauth":let w={subject:e.subject,username:e.username,name:e.name,email:e.email,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(w);break;case"tiktok_oauth":let m={subject:e.subject,username:e.username,name:e.name,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(m);break;case"linkedin_oauth":let v={subject:e.subject,name:e.name,email:e.email,vanityName:e.vanity_name,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(v);break;case"apple_oauth":let E={subject:e.subject,email:e.email,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(E);break;case"custom_auth":r.push({type:e.type,customUserId:e.custom_user_id,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)});break;case"farcaster":let $={type:e.type,fid:e.fid,ownerAddress:e.owner_address,displayName:e.display_name,username:e.username,bio:e.bio,pfp:e.profile_picture_url,url:e.homepage_url,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at),signerPublicKey:e.signer_public_key};r.push($);break;case"passkey":let k={type:e.type,enrolledInMfa:e.enrolled_in_mfa,credentialId:e.credential_id,authenticatorName:e.authenticator_name,createdWithDevice:e.created_with_device,createdWithOs:e.created_with_os,createdWithBrowser:e.created_with_browser,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(k);break;case"telegram":let M={type:e.type,telegramUserId:e.telegram_user_id,firstName:e.first_name,lastName:e.last_name,username:e.username,photoUrl:e.photo_url,verifiedAt:a(e.first_verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(M);break;default:console.warn(`Unrecognized account type: ${n}. Please consider upgrading the Privy SDK.`)}}return r}function f(t,r){return t.slice().sort((e,n)=>(n.firstVerifiedAt??n.verifiedAt).getTime()-(e.firstVerifiedAt??e.verifiedAt).getTime()).find(e=>e.type===r)}var K=t=>t?.linkedAccounts.find(r=>r.type==="wallet"&&r.walletClientType==="privy"&&!r.imported&&r.chainType==="ethereum"&&r.walletIndex===0)||null,Qt=t=>t?.linkedAccounts.filter(r=>r.type==="wallet"&&r.walletClientType==="privy"&&!r.imported&&r.chainType==="ethereum"),we=t=>t?.linkedAccounts.filter(r=>r.type==="wallet"&&r.walletClientType==="privy"&&r.chainType==="ethereum"),ke=t=>t?.linkedAccounts.find(r=>r.type==="wallet"&&r.walletClientType==="privy"&&!r.imported&&r.chainType==="solana")||null,Xt=t=>t?.linkedAccounts.find(r=>r.type==="wallet"&&r.walletClientType==="privy"&&r.imported&&r.chainType==="ethereum")||null,qt=(t,r)=>{let e=we(t).find(i=>H(i.address)===H(r)),n=e?e.imported?e:K(t):void 0;return{signingWallet:e,rootWallet:n}},xe=t=>t.linkedAccounts.filter(r=>r.type==="wallet"),Yt=(t,r)=>K(t)||ke(t)?!1:r==="all-users"||r==="users-without-wallets"&&!xe(t)?.length;function er(t){if(!t)return null;let r=We(t.linked_accounts),e=f(r,"wallet"),n=f(r,"smart_wallet"),i=f(r,"email"),o=f(r,"phone"),s=f(r,"google_oauth"),c=f(r,"twitter_oauth"),l=f(r,"discord_oauth"),u=f(r,"github_oauth"),d=f(r,"spotify_oauth"),h=f(r,"instagram_oauth"),p=f(r,"tiktok_oauth"),g=f(r,"linkedin_oauth"),w=f(r,"apple_oauth"),m=f(r,"farcaster"),v=f(r,"telegram"),E=t.mfa_methods.map(({type:k,verified_at:M})=>({type:k,verifiedAt:a(M)}));return{id:t.id,createdAt:a(t.created_at),linkedAccounts:r,email:i&&{address:i?.address},phone:o&&{number:o?.number},wallet:e&&{address:e.address,chainType:e.chainType,chainId:e.chainId,walletClient:e.walletClient,walletClientType:e.walletClientType,connectorType:e.connectorType,recoveryMethod:e.recoveryMethod,imported:e.imported,walletIndex:e.walletIndex},smartWallet:n&&{address:n.address,smartWalletType:n.smartWalletType},google:s&&{subject:s.subject,email:s.email,name:s.name},twitter:c&&{subject:c.subject,username:c.username,name:c.name,profilePictureUrl:c.profilePictureUrl},discord:l&&{subject:l.subject,username:l.username,email:l.email},github:u&&{subject:u.subject,username:u.username,name:u.name,email:u.email},spotify:d&&{subject:d.subject,email:d.email,name:d.name},instagram:h&&{subject:h.subject,username:h.username},tiktok:p&&{subject:p.subject,username:p.username,name:p.name},linkedin:g&&{subject:g.subject,name:g.name,email:g.email,vanityName:g.vanityName},apple:w&&{subject:w.subject,email:w.email},farcaster:m&&{fid:m.fid,ownerAddress:m.ownerAddress,displayName:m.displayName,username:m.username,bio:m.bio,pfp:m.pfp,url:m.url,signerPublicKey:m.signerPublicKey},telegram:v&&{telegramUserId:v.telegramUserId,firstName:v.firstName,lastName:v.lastName,username:v.username,photoUrl:v.photoUrl},mfaMethods:E.map(k=>k.type),hasAcceptedTerms:t.has_accepted_terms??!1,isGuest:t.is_guest,customMetadata:t.custom_metadata}}import{useEffect as Pe,useState as Te}from"react";var nr=t=>{let[r,e]=Te("auto");return Pe(()=>{let n=new ResizeObserver(i=>{e(i[0]?.contentRect.height??"auto")});return t.current&&n.observe(t.current),()=>{t.current&&n.unobserve(t.current)}},[t.current]),r};import J from"styled-components";import{jsx as z}from"react/jsx-runtime";var Z=({...t})=>z("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:z("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:t.color||"var(--privy-color-foreground-3)"})});import{jsx as W,jsxs as Q}from"react/jsx-runtime";var I=J.div`
1
+ import{i as _,oa as F,ra as D,sa as b,ta as V}from"./chunk-Z4PCJGI3.js";import{useContext as he}from"react";import{createContext as de,useContext as pe,useEffect as fe}from"react";var tt={login:{onComplete:[],onError:[],onOAuthLoginComplete:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},sendSolanaTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]},customAuth:{onAuthenticated:[],onUnauthenticated:[]}},me=de(void 0),N=()=>pe(me);function y(t,r){if(!r)return;let n=N().current[t];return fe(()=>{for(let[i,o]of Object.entries(r))n.hasOwnProperty(i)||console.warn(`Invalid event type "${i}" for action "${t}"`),n[i]?.push(o);return()=>{for(let[i,o]of Object.entries(r))n.hasOwnProperty(i)||console.warn(`Invalid event type "${i}" for action "${t}"`),n[i]=n[i]?.filter(s=>s!==o)}},[r])}function ye(t,r,e,...n){for(let i of t.current[r][e])i(...n)}function rt(){let t=N();return(r,e,...n)=>ye(t,r,e,...n)}function st(t){let{logout:r}=he(b);return y("logout",t),{logout:r}}import{useContext as ve}from"react";function pt(t){let{login:r}=ve(b);return y("login",t),{login:r}}import{useContext as ge}from"react";function vt(t){let{connectWallet:r}=ge(b);return y("connectWallet",t),{connectWallet:r}}var At=t=>{y("fundWallet",t);let{fundWallet:r}=V();return{fundWallet:r}};var S=class{constructor(){this._cache={}}get(r){return this._cache[r]}put(r,e){e!==void 0?this._cache[r]=e:this.del(r)}del(r){delete this._cache[r]}getKeys(){return Object.keys(this._cache)}},P=class{get(r){let e=localStorage.getItem(r);return e===null?void 0:JSON.parse(e)}put(r,e){e!==void 0?localStorage.setItem(r,JSON.stringify(e)):this.del(r)}del(r){localStorage.removeItem(r)}getKeys(){return Object.entries(localStorage).map(([r])=>r)}};function wt(){try{let t="privy:__session_storage__test",r="blobby",e=new P;return e.put(t,r),e.del(t),!0}catch{return!1}}function _e(){return typeof window<"u"&&window.localStorage?new P:new S}var A=_e();function B(){let t=window,r=t.ethereum;if(!r)return[];let e=[];if(r.providers?.length)for(let n of r.providers)n&&e.push(n);return e.push(t.ethereum),e}var T=t=>{if(t.isApexWallet)return"Apex Wallet";if(t.isAvalanche)return"Core Wallet";if(t.isBackpack)return"Backpack";if(t.isBifrost)return"Bifrost Wallet";if(t.isBitKeep)return"BitKeep";if(t.isBitski)return"Bitski";if(t.isBlockWallet)return"BlockWallet";if(t.isBraveWallet)return"Brave Wallet";if(t.isClover)return"Clover";if(t.isCoin98)return"Coin98 Wallet";if(t.isCoinbaseWallet)return"Coinbase Wallet";if(t.isDawn)return"Dawn Wallet";if(t.isDefiant)return"Defiant";if(t.isDesig)return"Desig Wallet";if(t.isEnkrypt)return"Enkrypt";if(t.isExodus)return"Exodus";if(t.isFordefi)return"Fordefi";if(t.isFrame)return"Frame";if(t.isFrontier)return"Frontier Wallet";if(t.isGamestop)return"GameStop Wallet";if(t.isHaqqWallet)return"HAQQ Wallet";if(t.isHyperPay)return"HyperPay Wallet";if(t.isImToken)return"ImToken";if(t.isHaloWallet)return"Halo Wallet";if(t.isKuCoinWallet)return"KuCoin Wallet";if(t.isMathWallet)return"MathWallet";if(t.isNovaWallet)return"Nova Wallet";if(t.isOkxWallet||t.isOKExWallet)return"OKX Wallet";if(t.isOneInchIOSWallet||t.isOneInchAndroidWallet)return"1inch Wallet";if(t.isOneKey)return"OneKey Wallet";if(t.isOpera)return"Opera";if(t.isPhantom)return"Phantom";if(t.isPortal)return"Ripio Portal";if(t.isRabby)return"Rabby Wallet";if(t.isRainbow)return"Rainbow";if(t.isSafePal)return"SafePal Wallet";if(t.isStatus)return"Status";if(t.isSubWallet)return"SubWallet";if(t.isTalisman)return"Talisman";if(t.isTally||t.isTaho)return"Taho";if(t.isTokenPocket)return"TokenPocket";if(t.isTokenary)return"Tokenary";if(t.isTrust||t.isTrustWallet)return"Trust Wallet";if(t.isTTWallet)return"TTWallet";if(t.isXDEFI)return"XDEFI Wallet";if(t.isZeal)return"Zeal";if(t.isZerion)return"Zerion";if(t.isMetaMask)return"MetaMask"};var R=(t,r)=>{if(!t.isMetaMask)return!1;if(t.isMetaMask&&!r)return!0;if(t.isBraveWallet&&!t._events&&!t._state||T(t)!=="MetaMask")return!1;if(t.providers){for(let e of t.providers)if(!R(e))return!1}return!0},Tt=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),Ct=()=>{let t=window;if(!t.ethereum)return!1;if(t.ethereum.isCoinbaseWallet)return!0;if(t.ethereum.providers){for(let r of t.ethereum.providers)if(r&&r.isCoinbaseWallet)return!0}return!1};import{StaticJsonRpcProvider as x}from"@ethersproject/providers";var It=(t,r)=>{let e=[],n=[];for(let[i,o]of t.entries())i<r?e.push(o):n.push(o);return[e,n]},Ut=t=>!!String(t).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,}))$/),Lt=(t,r)=>{let e=t.slice(0),n=[];for(;e.length;)n.push(e.splice(0,r));return n},O=(t,r=3,e=4,n="ethereum")=>{if(!t)return"";let i=n==="ethereum"?2:0,o=3;if(r+e+i+o>=t.length)return t;let s=t.slice(0,i+r),c=t.slice(t.length-e,t.length);return`${s}...${c}`},be=t=>new Promise(r=>setTimeout(r,t));function jt(t,{interval:r=100,timeout:e=5e3}={}){return new Promise((n,i)=>{let o=0,s,c=()=>{if(o>=e){i("Max attempts reached without result");return}if(s=t(),o+=r,s!=null){n(s);return}setTimeout(c,r)};c()})}var $t=(t,r={})=>{let e=r.delayMs||150,n=r.maxAttempts||270;return new Promise(async(i,o)=>{let s=!1,c=0;for(;!s&&c<n;){if(r.abortSignal?.aborted)return;t().then(l=>{s=!0,i(l)},(...l)=>{s=!0,o(...l)}),c+=1,await be(e)}s||o(new Error("Exceeded max attempts before resolving function"))})},Ft=(t,r,e={},n={})=>{let i=new URL(r,t);for(let[s,c]of Object.entries(e))c!==void 0&&i.searchParams.set(s,c);let o=Object.entries(n);if(o.length>0){let s=new URLSearchParams;for(let[c,l]of o)s.append(c,l);i.hash=s.toString()}return i.href};var Dt=t=>t.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),Vt=t=>typeof t=="string"?t:"0x"+t.toString(16);async function Nt(t,r,e,n=3e3){let i=!1,o=window;return new Promise(s=>{o.ethereum?c():(window.addEventListener("ethereum#initialized",c,{once:!0}),setTimeout(()=>{c()},n));function c(){if(i)return;i=!0,window.removeEventListener("ethereum#initialized",c);let l=t.getProviders();console.debug("Detected injected providers:",l.map(d=>d.info));let u=[];for(let d of l)r.includes("coinbase_wallet")&&d.info.rdns==="com.coinbase.wallet"||u.push({type:d.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:d});for(let d of B()){let h=T(d);if(!l.some(p=>p.info.name===h)){if(R(d,!0)&&!u.find(p=>p.type==="metamask")){u.push({type:"metamask",legacyInjectedProvider:d});continue}if(h==="Phantom"&&!u.find(p=>p.type==="phantom")){u.push({type:"phantom",legacyInjectedProvider:d});continue}if(h==="Coinbase Wallet"&&!u.find(p=>p.type==="coinbase_wallet"&&e?.coinbaseWallet?.connectionOptions!=="smartWalletOnly")){u.push({type:"coinbase_wallet",legacyInjectedProvider:d});continue}u.find(p=>p.type==="unknown_browser_extension")||u.push({type:"unknown_browser_extension",legacyInjectedProvider:d})}}s(u)}})}function Bt(t){return`eip155:${String(Number(t))}`}var Gt=(t,r,e,n)=>{let i=Number(t),o=r.find(s=>s.id===i);if(!o)throw new _(`Unsupported chainId ${t}`,4901);return Ae(o,e,n)},Ae=(t,r,e)=>{let n=t.id,i=Number(t.id),o;if(t.rpcUrls.privyWalletOverride&&t.rpcUrls.privyWalletOverride.http[0])o=t.rpcUrls.privyWalletOverride.http[0];else if(r.rpcUrls&&r.rpcUrls[i])o=r.rpcUrls[i];else if(t.rpcUrls.privy?.http[0]){let s=new URL(t.rpcUrls.privy.http[0]);s.searchParams.append("privyAppId",e),o=s.toString()}else t.rpcUrls.public?.http[0]?o=t.rpcUrls.public.http[0]:o=t.rpcUrls.default?.http[0];if(!o)throw new _(`No RPC url found for ${n}`);return o},G=(t,r)=>{let e=Number(t),n=r.find(i=>i.id===e);if(!n)throw new _(`Unsupported chainId ${t}`,4901);return n.blockExplorers?.default.url},Ht=(t,r,e,n)=>{let i=Number(t),o=r.find(c=>c.id===i);if(!o)throw new _(`Unsupported chainId ${t}`,4901);let s;if(o.rpcUrls.privyWalletOverride&&o.rpcUrls.privyWalletOverride.http[0]?s=new x(o.rpcUrls.privyWalletOverride.http[0]):e.rpcUrls&&e.rpcUrls[i]?s=new x(e.rpcUrls[i]):o.rpcUrls.privy?.http[0]?s=new x({url:o.rpcUrls.privy.http[0],headers:{"privy-app-id":n.appId}}):o.rpcUrls.public?.http[0]?s=new x(o.rpcUrls.public.http[0]):s=new x(o.rpcUrls.default?.http[0]),!s)throw new _(`No RPC url found for ${t}`);return s},Kt=t=>{let r={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},e=t.types.EIP712Domain??Object.entries(t.domain).map(([n,i])=>{if(i!=null&&typeof n=="string"&&n in r)return{name:n,type:r[n]}}).filter(n=>n!==void 0);return{...t,types:{...t.types,EIP712Domain:e}}};function zt(t,{min:r,max:e}){return Math.min(Math.max(t,r),e)}import{getAddress as H}from"@ethersproject/address";function a(t){return t?new Date(t*1e3):null}function We(t){let r=[];for(let e of t){let n=e.type;switch(e.type){case"wallet":let i={address:e.address,type:e.type,imported:e.imported,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at),chainType:e.chain_type,chainId:e.chain_id,walletClient:e.wallet_client_type==="privy"?"privy":"unknown",walletClientType:e.wallet_client_type,connectorType:e.connector_type,recoveryMethod:e.recovery_method,walletIndex:e.wallet_index};r.push(i);break;case"smart_wallet":let o={address:e.address,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at),smartWalletType:e.smart_wallet_type};r.push(o);break;case"cross_app":let s={type:e.type,subject:e.subject,embeddedWallets:e.embedded_wallets,smartWallets:e.smart_wallets,providerApp:{id:e.provider_app_id},verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(s);break;case"email":let c={address:e.address,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(c);break;case"phone":let l={number:e.phoneNumber,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(l);break;case"google_oauth":let u={subject:e.subject,email:e.email,name:e.name,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(u);break;case"spotify_oauth":let d={subject:e.subject,email:e.email,name:e.name,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(d);break;case"instagram_oauth":let h={subject:e.subject,username:e.username,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(h);break;case"twitter_oauth":let p={subject:e.subject,username:e.username,name:e.name,type:e.type,profilePictureUrl:e.profile_picture_url,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(p);break;case"discord_oauth":let g={subject:e.subject,username:e.username,email:e.email,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(g);break;case"github_oauth":let w={subject:e.subject,username:e.username,name:e.name,email:e.email,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(w);break;case"tiktok_oauth":let m={subject:e.subject,username:e.username,name:e.name,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(m);break;case"linkedin_oauth":let v={subject:e.subject,name:e.name,email:e.email,vanityName:e.vanity_name,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(v);break;case"apple_oauth":let E={subject:e.subject,email:e.email,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(E);break;case"custom_auth":r.push({type:e.type,customUserId:e.custom_user_id,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)});break;case"farcaster":let $={type:e.type,fid:e.fid,ownerAddress:e.owner_address,displayName:e.display_name,username:e.username,bio:e.bio,pfp:e.profile_picture_url,url:e.homepage_url,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at),signerPublicKey:e.signer_public_key};r.push($);break;case"passkey":let k={type:e.type,enrolledInMfa:e.enrolled_in_mfa,credentialId:e.credential_id,authenticatorName:e.authenticator_name,createdWithDevice:e.created_with_device,createdWithOs:e.created_with_os,createdWithBrowser:e.created_with_browser,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(k);break;case"telegram":let M={type:e.type,telegramUserId:e.telegram_user_id,firstName:e.first_name,lastName:e.last_name,username:e.username,photoUrl:e.photo_url,verifiedAt:a(e.first_verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(M);break;default:console.warn(`Unrecognized account type: ${n}. Please consider upgrading the Privy SDK.`)}}return r}function f(t,r){return t.slice().sort((e,n)=>(n.firstVerifiedAt??n.verifiedAt).getTime()-(e.firstVerifiedAt??e.verifiedAt).getTime()).find(e=>e.type===r)}var K=t=>t?.linkedAccounts.find(r=>r.type==="wallet"&&r.walletClientType==="privy"&&!r.imported&&r.chainType==="ethereum"&&r.walletIndex===0)||null,Qt=t=>t?.linkedAccounts.filter(r=>r.type==="wallet"&&r.walletClientType==="privy"&&!r.imported&&r.chainType==="ethereum"),we=t=>t?.linkedAccounts.filter(r=>r.type==="wallet"&&r.walletClientType==="privy"&&r.chainType==="ethereum"),ke=t=>t?.linkedAccounts.find(r=>r.type==="wallet"&&r.walletClientType==="privy"&&!r.imported&&r.chainType==="solana")||null,Xt=t=>t?.linkedAccounts.find(r=>r.type==="wallet"&&r.walletClientType==="privy"&&r.imported&&r.chainType==="ethereum")||null,qt=(t,r)=>{let e=we(t).find(i=>H(i.address)===H(r)),n=e?e.imported?e:K(t):void 0;return{signingWallet:e,rootWallet:n}},xe=t=>t.linkedAccounts.filter(r=>r.type==="wallet"),Yt=(t,r)=>K(t)||ke(t)?!1:r==="all-users"||r==="users-without-wallets"&&!xe(t)?.length;function er(t){if(!t)return null;let r=We(t.linked_accounts),e=f(r,"wallet"),n=f(r,"smart_wallet"),i=f(r,"email"),o=f(r,"phone"),s=f(r,"google_oauth"),c=f(r,"twitter_oauth"),l=f(r,"discord_oauth"),u=f(r,"github_oauth"),d=f(r,"spotify_oauth"),h=f(r,"instagram_oauth"),p=f(r,"tiktok_oauth"),g=f(r,"linkedin_oauth"),w=f(r,"apple_oauth"),m=f(r,"farcaster"),v=f(r,"telegram"),E=t.mfa_methods.map(({type:k,verified_at:M})=>({type:k,verifiedAt:a(M)}));return{id:t.id,createdAt:a(t.created_at),linkedAccounts:r,email:i&&{address:i?.address},phone:o&&{number:o?.number},wallet:e&&{address:e.address,chainType:e.chainType,chainId:e.chainId,walletClient:e.walletClient,walletClientType:e.walletClientType,connectorType:e.connectorType,recoveryMethod:e.recoveryMethod,imported:e.imported,walletIndex:e.walletIndex},smartWallet:n&&{address:n.address,smartWalletType:n.smartWalletType},google:s&&{subject:s.subject,email:s.email,name:s.name},twitter:c&&{subject:c.subject,username:c.username,name:c.name,profilePictureUrl:c.profilePictureUrl},discord:l&&{subject:l.subject,username:l.username,email:l.email},github:u&&{subject:u.subject,username:u.username,name:u.name,email:u.email},spotify:d&&{subject:d.subject,email:d.email,name:d.name},instagram:h&&{subject:h.subject,username:h.username},tiktok:p&&{subject:p.subject,username:p.username,name:p.name},linkedin:g&&{subject:g.subject,name:g.name,email:g.email,vanityName:g.vanityName},apple:w&&{subject:w.subject,email:w.email},farcaster:m&&{fid:m.fid,ownerAddress:m.ownerAddress,displayName:m.displayName,username:m.username,bio:m.bio,pfp:m.pfp,url:m.url,signerPublicKey:m.signerPublicKey},telegram:v&&{telegramUserId:v.telegramUserId,firstName:v.firstName,lastName:v.lastName,username:v.username,photoUrl:v.photoUrl},mfaMethods:E.map(k=>k.type),hasAcceptedTerms:t.has_accepted_terms??!1,isGuest:t.is_guest,customMetadata:t.custom_metadata}}import{useEffect as Pe,useState as Te}from"react";var nr=t=>{let[r,e]=Te("auto");return Pe(()=>{let n=new ResizeObserver(i=>{e(i[0]?.contentRect.height??"auto")});return t.current&&n.observe(t.current),()=>{t.current&&n.unobserve(t.current)}},[t.current]),r};import J from"styled-components";import{jsx as z}from"react/jsx-runtime";var Z=({...t})=>z("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:z("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:t.color||"var(--privy-color-foreground-3)"})});import{jsx as W,jsxs as Q}from"react/jsx-runtime";var I=J.div`
2
2
  margin-top: 16px;
3
3
  font-size: 13px;
4
4
  text-align: center;
@@ -115,4 +115,4 @@ import{i as _,oa as F,ra as D,sa as b,ta as V}from"./chunk-XKAIXCX7.js";import{u
115
115
  ${t=>t.$state==="error"?"border-color: var(--privy-color-error);":""}
116
116
  `,le=ze.div`
117
117
  ${Je}
118
- `;import{Fragment as Qe,jsx as C,jsxs as L}from"react/jsx-runtime";var Zr=({errMsg:t,balance:r,address:e,isLoading:n,className:i,title:o,isPulsing:s,showIcon:c,statusColor:l="green"})=>{let u;return l?u=l:t?u="red":u="green",L(Qe,{children:[L(le,{className:i,$state:t?"error":void 0,children:[L(ae,{children:[C(se,{children:o||"Pay with"}),C(ee,{address:e,showCopyIcon:c||!!t})]}),r!==void 0&&C(ie,{isLoading:n,isPulsing:s,color:u,children:r})]}),t&&C(oe,{style:{marginTop:"0.25rem"},children:t})]})};import{BigNumber as Xe}from"@ethersproject/bignumber";import{formatEther as ce}from"@ethersproject/units";import{QuantityToBigNumber as qe}from"@privy-io/js-sdk-core";var Ye=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),ue=t=>Ye.format(t),rn=(t,r)=>{let e=ue(r*parseFloat(t));return e!=="$0.00"?e:"<$0.01"},nn=(t,r)=>{let e=ue(r*parseFloat(ce(t)));return e==="$0.00"?"<$0.01":e},an=(t,r,e=6,n=!1)=>{let o=parseFloat(ce(t)).toFixed(e).replace(/0+$/,"").replace(/\.$/,"");return n?`${o} ${r}`:`${o==="0"?"<0.001":o} ${r}`},on=t=>t.map(qe).reduce((r,e)=>r.add(e),Xe.from(0)).toHexString(),sn=(t,r)=>{let{chains:e}=D(),n=`https://etherscan.io/address/${r}`,i=`${G(t,e)}/address/${r}`;if(!i)return n;try{new URL(i)}catch{return n}return i};import{jsx as j}from"react/jsx-runtime";var cn=({color:t,...r})=>j("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...r,children:j("g",{children:j("path",{fill:t||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})});export{wt as a,A as b,Tt as c,Ct as d,It as e,Ut as f,Lt as g,O as h,be as i,jt as j,$t as k,Ft as l,Dt as m,Vt as n,Nt as o,Bt as p,Gt as q,Ae as r,Ht as s,Kt as t,zt as u,K as v,Qt as w,ke as x,Xt as y,qt as z,Yt as A,er as B,Z as C,nr as D,tt as E,me as F,y as G,ye as H,rt as I,cr as J,ur as K,Ce as L,re as M,ie as N,_r as O,br as P,ee as Q,st as R,oe as S,Je as T,le as U,Zr as V,cn as W,rn as X,nn as Y,an as Z,on as _,sn as $,pt as aa,vt as ba,At as ca};
118
+ `;import{Fragment as Qe,jsx as C,jsxs as L}from"react/jsx-runtime";var Zr=({errMsg:t,balance:r,address:e,isLoading:n,className:i,title:o,isPulsing:s,showIcon:c,statusColor:l="green"})=>{let u;return l?u=l:t?u="red":u="green",L(Qe,{children:[L(le,{className:i,$state:t?"error":void 0,children:[L(ae,{children:[C(se,{children:o||"Pay with"}),C(ee,{address:e,showCopyIcon:c||!!t})]}),r!==void 0&&C(ie,{isLoading:n,isPulsing:s,color:u,children:r})]}),t&&C(oe,{style:{marginTop:"0.25rem"},children:t})]})};import{BigNumber as Xe}from"@ethersproject/bignumber";import{formatEther as ce}from"@ethersproject/units";import{QuantityToBigNumber as qe}from"@privy-io/js-sdk-core";var Ye=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),ue=t=>Ye.format(t),rn=(t,r)=>{let e=ue(r*parseFloat(t));return e!=="$0.00"?e:"<$0.01"},nn=(t,r)=>{let e=ue(r*parseFloat(ce(t)));return e==="$0.00"?"<$0.01":e},an=(t,r,e=6,n=!1)=>{let o=parseFloat(ce(t)).toFixed(e).replace(/0+$/,"").replace(/\.$/,"");return n?`${o} ${r}`:`${o==="0"?"<0.001":o} ${r}`},on=t=>t.map(qe).reduce((r,e)=>r.add(e),Xe.from(0)).toHexString(),sn=(t,r)=>{let{chains:e}=D(),n=`https://etherscan.io/address/${r}`,i=`${G(t,e)}/address/${r}`;if(!i)return n;try{new URL(i)}catch{return n}return i};import{jsx as j}from"react/jsx-runtime";var cn=({color:t,...r})=>j("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...r,children:j("g",{children:j("path",{fill:t||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})});export{wt as a,A as b,Tt as c,Ct as d,It as e,Ut as f,Lt as g,O as h,be as i,jt as j,$t as k,Ft as l,Dt as m,Vt as n,Nt as o,Bt as p,Gt as q,Ae as r,Ht as s,Kt as t,zt as u,K as v,Qt as w,ke as x,Xt as y,qt as z,Yt as A,er as B,Z as C,nr as D,tt as E,me as F,y as G,ye as H,rt as I,cr as J,ur as K,Ce as L,ee as M,re as N,ie as O,_r as P,br as Q,st as R,oe as S,Je as T,le as U,Zr as V,cn as W,rn as X,nn as Y,an as Z,on as _,sn as $,pt as aa,vt as ba,At as ca};
@@ -1 +1 @@
1
- import{W as a,ka as c,la as d,ma as s,oa as u}from"./chunk-XKAIXCX7.js";function E(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function N(e){let t=e.filter(n=>!d.has(n.id));return c.concat(t)}function R(e){return e.find(n=>n.walletClientType==="privy"&&n.connectorType==="embedded"&&!n.imported)??null}import{createContext as M,useContext as I,useEffect as r,useRef as v,useState as D}from"react";import{jsx as C}from"react/jsx-runtime";function p({src:e,...t}){return C("img",{src:e,...t,style:{display:"none"}})}import{jsx as h,jsxs as x}from"react/jsx-runtime";var f=M({ready:!1,app:s,currentScreen:null,lastScreen:null,navigate:a,navigateBack:a,resetNavigation:a,setModalData:a,onUserCloseViaDialogOrKeybindRef:void 0}),y=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],W=e=>{let t=u(),n=e.authenticated,[i,l]=D(e.initialScreen);r(()=>{!n&&!y.includes(e.initialScreen)&&e.setInitialScreen(null)},[n]);let o=v(null);r(()=>{e.open||(o.current=null)},[e.open]),r(()=>{o.current=null},[e.initialScreen]);let g={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:i,navigate:(S,m=!0)=>{e.setInitialScreen(S),m&&l(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(i)},resetNavigation:()=>{e.setInitialScreen(null),l(null)},onUserCloseViaDialogOrKeybindRef:o};return x(f.Provider,{value:g,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&h(p,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},k=()=>I(f);function G(e){let n=new RegExp(/^eip155:(?<chainId>\d+)$/gm).exec(e)?.groups?.chainId;if(n)return parseInt(n);throw new Error("Chain ID not compatible with CAIP-2 format.")}export{W as a,k as b,E as c,N as d,G as e,R as f};
1
+ import{W as a,ka as c,la as d,ma as s,oa as u}from"./chunk-Z4PCJGI3.js";function E(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function N(e){let t=e.filter(n=>!d.has(n.id));return c.concat(t)}function R(e){return e.find(n=>n.walletClientType==="privy"&&n.connectorType==="embedded"&&!n.imported)??null}import{createContext as M,useContext as I,useEffect as r,useRef as v,useState as D}from"react";import{jsx as C}from"react/jsx-runtime";function p({src:e,...t}){return C("img",{src:e,...t,style:{display:"none"}})}import{jsx as h,jsxs as x}from"react/jsx-runtime";var f=M({ready:!1,app:s,currentScreen:null,lastScreen:null,navigate:a,navigateBack:a,resetNavigation:a,setModalData:a,onUserCloseViaDialogOrKeybindRef:void 0}),y=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],W=e=>{let t=u(),n=e.authenticated,[i,l]=D(e.initialScreen);r(()=>{!n&&!y.includes(e.initialScreen)&&e.setInitialScreen(null)},[n]);let o=v(null);r(()=>{e.open||(o.current=null)},[e.open]),r(()=>{o.current=null},[e.initialScreen]);let g={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:i,navigate:(S,m=!0)=>{e.setInitialScreen(S),m&&l(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(i)},resetNavigation:()=>{e.setInitialScreen(null),l(null)},onUserCloseViaDialogOrKeybindRef:o};return x(f.Provider,{value:g,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&h(p,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},k=()=>I(f);function G(e){let n=new RegExp(/^eip155:(?<chainId>\d+)$/gm).exec(e)?.groups?.chainId;if(n)return parseInt(n);throw new Error("Chain ID not compatible with CAIP-2 format.")}export{W as a,k as b,E as c,N as d,G as e,R as f};
@@ -0,0 +1 @@
1
+ var L=(t,n,o)=>{if(!n.has(t))throw TypeError("Cannot "+o)};var ut=(t,n,o)=>(L(t,n,"read from private field"),o?o.call(t):n.get(t)),ht=(t,n,o)=>{if(n.has(t))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(t):n.set(t,o)},gt=(t,n,o,i)=>(L(t,n,"write to private field"),i?i.call(t,o):n.set(t,o),o);var yt=(t,n,o)=>(L(t,n,"access private method"),o);var F="1.86.0";var H="34357d3c125c2bcf2ce2bc3309d98715",_t="https://auth.privy.io",Ct=2e4,St=1400,At=2500,wt=4e3,Tt=F;var kt="privy:token",Pt="privy-token",xt="privy:refresh_token",vt="privy-refresh-token",Wt="privy:id_token",Ot="privy-id-token",It="privy-session",Ut="privy:session_transfer_token",De="privy:wallet",Lt="privy:caid",Rt=t=>`privy:guest:${t}`,Mt=t=>`privy:cross-app:${t}`,Nt="privy:state_code",Dt="privy:code_verifier",Ft="privy:headless_oauth",Ht="privy:oauth_disable_signup",jt=t=>`${De}:${t}`,Kt="privy:connectors",Yt="privy:connections";var Gt=12e4,Bt=1,qt="0x1",zt=3e4,Vt="https://api.moonpay.com/v1",Xt="https://api.moonpay.com/v1",$t="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",Zt="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI";var Jt="deprecated";var j={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"}}};var K={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};var Y={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"}}};var G={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};var B={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"}}};var q={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};var z={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};var V={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};var X={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};var $={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"}}};var Z={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"}}};var J={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"}}};var Q={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"}}};var ee={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};var te={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};var ne={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"}}};var v={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"}}};var oe={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"}}};var ie={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};var se={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"}}};var ae={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};var re={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/"}}};var le={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};var pe={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"}}};var ce={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};var de={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};var W=[j,K,le,v,oe,ie,se,ae,V,X,$,Z,B,q,z,ne,ee,te,Y,G,pe,de,ce,Q,re,J],Qn=new Set(W.map(t=>t.id));import{createContext as Fe,useContext as He}from"react";var e=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var je=Fe({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:e,login:e,connectOrCreateWallet:e,linkEmail:e,linkPhone:e,linkFarcaster:e,linkWallet:e,startCrossAppAuthFlow:e,linkGoogle:e,linkTwitter:e,linkDiscord:e,linkGithub:e,linkSpotify:e,linkInstagram:e,linkTelegram:e,linkTiktok:e,linkLinkedIn:e,linkApple:e,linkPasskey:e,updateEmail:e,updatePhone:e,logout:e,getAccessToken:e,getEthereumProvider:e,getEthersProvider:e,getWeb3jsProvider:e,unlinkEmail:e,unlinkPhone:e,unlinkWallet:e,unlinkGoogle:e,unlinkTwitter:e,unlinkDiscord:e,unlinkGithub:e,unlinkSpotify:e,unlinkInstagram:e,unlinkTiktok:e,unlinkLinkedIn:e,unlinkApple:e,unlinkCrossAppAccount:e,unlinkFarcaster:e,unlinkTelegram:e,unlinkPasskey:e,setActiveWallet:e,forkSession:e,createWallet:e,importWallet:e,signMessage:e,signTypedData:e,enrollInMfa:e,initEnrollmentWithSms:e,initEnrollmentWithTotp:e,initEnrollmentWithPasskey:e,promptMfa:e,init:e,submitEnrollmentWithSms:e,submitEnrollmentWithTotp:e,submitEnrollmentWithPasskey:e,unenroll:e,submit:e,cancel:e,sendTransaction:e,sendSolanaTransaction:e,exportWallet:e,setWalletPassword:e,setWalletRecovery:e,requestFarcasterSignerFromWarpcast:e,getFarcasterSignerPublicKey:e,signFarcasterMessage:e,createGuestAccount:e,initLoginWithEmail:e,initLoginWithSms:e,otpState:{status:"initial"},loginWithCode:e,fundWallet:e,initLoginWithHeadlessOAuth:e,loginWithHeadlessOAuth:e,generateSiweMessage:e,linkWithSiwe:e,signMessageWithCrossAppWallet:e,signTypedDataWithCrossAppWallet:e,sendTransactionWithCrossAppWallet:e,isHeadlessOAuthLoading:!1,isModalOpen:!1,mfaMethods:[]}),io=()=>He(je);import{createContext as Ke,useContext as Ye}from"react";var Ge=Ke(null);function ro(){let t=Ye(Ge);if(t===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return t}import{FetchError as Be}from"ofetch";var g=class extends Error{constructor(o,i,s){super(o);i instanceof Error&&(this.cause=i),this.privyErrorCode=s}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},O=class extends g{constructor(o,i,s,r,l,p){super(s,r,l);this.type=o;this.status=i,this.data=p}},u=class extends g{constructor(o,i,s){super(o,i,s);this.type="client_error"}},me=class extends u{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var ue=class extends g{constructor(o,i,s){super(o,i,s);this.type="connector_error"}},co=t=>{if(t instanceof g)return t;if(!(t instanceof Be))return qe(t);if(!t.response)return new O("api_error",null,t.message,t);let{type:n,message:o,error:i,code:s}=t.data;return new O(n||"ApiError",t.response.status,o||i,t,s,t.data)},qe=t=>t instanceof g?t:t instanceof Error?new u(t.message,t):new u(`Internal error: ${t}`);var he=class extends u{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},ge=class extends u{constructor(n="Embedded wallet error",o){super(n,o,"unknown_embedded_wallet_error")}},ye=class extends u{constructor(n="User must be authenticated"){super(n,void 0,"must_be_authenticated")}};var fe=class extends u{constructor(n){super("This application is in development mode and must be upgraded to production to log in new users.",n,"max_accounts_reached")}};import{useContext as Pe,useEffect as ke,useMemo as it,useState as st}from"react";import{createContext as at}from"react";var d={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:H,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};var be=({input:t})=>{if(!t||!t.primary[0])return;let n=[t.primary[0]],o=[];t.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`");for(let i of t.primary.slice(1))n.includes(i)?console.warn(`Duplicated login method: ${i}`):n.push(i);for(let i of t.overflow??[])!n.includes(i)&&!o.includes(i)?o.push(i):console.warn(`Duplicated login method: ${i}`);return{primary:n,overflow:o}};var ze=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets","rabby_wallet","safe"]),Ee=t=>ze.has(t),_e=(t,n,o)=>o.indexOf(t)===n,Ce=({input:t,overrides:n})=>n?n.primary.concat(n.overflow??[]).filter(Ee).filter(_e):t?t.filter(Ee).filter(_e):d.appearance.walletList;import y from"tinycolor2";var Se="#FFFFFF",Ve="#040217",Xe=Se,$e="#1E1E1D";function Ze(t){return t<.8&&t>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),t>.5?"light":"dark"}function m(t,n){let o=Math.max(0,Math.min(1,t.toHsl().l+n));return y({...t.toHsl(),l:o})}var Je="#51BA81",Qe="#FFB74D",et="#EC6351",tt=Se,nt=Ve;function Ae({backgroundTheme:t,accentHex:n}){let o;switch(t){case"light":o=Xe;break;case"dark":o=$e;break;default:o=t;break}let i=y(o),s=y(n),r=y(Je),l=y(Qe),p=y(et),a=Ze(i.getLuminance()),c=m(i,a==="light"?-.04:.11),h=m(i,a==="light"?-.88:.87),f=m(i,a==="light"?-.7:.75),b=m(i,a==="light"?-.43:.45).desaturate(a==="light"?60:20),E=m(i,a==="light"?-.08:.25).desaturate(a==="light"?60:20),_=m(s,.15),C=m(s,-.06),S=m(p,.3),A=m(l,.3),w=y(s.getLuminance()>.5?nt:tt),P=m(r,-.16),x=m(r,.4);return{colorScheme:a,background:i.toHslString(),background2:c.toHslString(),foreground:h.toHslString(),foreground2:f.toHslString(),foreground3:b.toHslString(),foreground4:E.toHslString(),accent:s.toHslString(),accentLight:_.toHslString(),accentDark:C.toHslString(),foregroundAccent:w.toHslString(),success:r.toHslString(),successDark:P.toHslString(),successLight:x.toHslString(),error:p.toHslString(),errorLight:S.toHslString(),warn:l.toHslString(),warnLight:A.toHslString()}}function R(t,n,o){let i=o?console.warn:()=>{},s,r,l,p,a,c,h,f,b,E,_,C,S,A,w;n?.loginMethods?(s=n.loginMethods.includes("email"),r=n.loginMethods.includes("sms"),p=n.loginMethods.includes("wallet"),a=n.loginMethods.includes("google"),c=n.loginMethods.includes("twitter"),h=n.loginMethods.includes("discord"),b=n.loginMethods.includes("spotify"),E=n.loginMethods.includes("instagram"),f=n.loginMethods.includes("tiktok"),C=n.loginMethods.includes("github"),_=n.loginMethods.includes("linkedin"),S=n.loginMethods.includes("apple"),A=n.loginMethods.includes("farcaster"),w=n.loginMethods.includes("telegram")):(s=t.emailAuth,r=t.smsAuth,p=t.walletAuth,a=t.googleOAuth,c=t.twitterOAuth,h=t.discordOAuth,C=t.githubOAuth,b=t.spotifyOAuth,E=t.instagramOAuth,f=t.tiktokOAuth,_=t.linkedinOAuth,S=t.appleOAuth,A=t.farcasterAuth,w=t.telegramAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?l=!1:t.passkeyAuth&&(l=!0);let P=[s,r].filter(Boolean),x=[a,c,h,C,b,E,f,_,S,A,w].filter(Boolean),I=[p].filter(Boolean);if(P.length+x.length+I.length===0)throw new Error("You must enable at least one login method");let T=n?.appearance?.showWalletLoginFirst!==void 0?n?.appearance?.showWalletLoginFirst:t.showWalletLoginFirst;T&&I.length===0?(i("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),T=!1):!T&&x.length+P.length===0&&(i("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),T=!0);let ve=n?.externalWallets?.walletConnect?.enabled??!0;n?.loginMethods&&n.loginMethodsAndOrder&&i("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let We=Ce({input:n?.appearance?.walletList,overrides:n?.loginMethodsAndOrder}),Oe=be({input:n?.loginMethodsAndOrder}),Ie=n?.intl?.defaultCountry??"US",{chains:Ue,defaultChain:Le}=ot({additionalChains:n?.additionalChains,supportedChains:n?.supportedChains,defaultChainFromConfig:n?.defaultChain,hasRpcConfigDefined:Object.keys(n?.rpcConfig?.rpcUrls??{}).length>0}),Re=!!n?.defaultChain,U=n?.customAuth?.getCustomAccessToken&&n?.customAuth?.enabled!==!1,k,N=!(t.enforceWalletUis??!0);if(t.legacyWalletUiConfig??!0?U?k=n?.embeddedWallets?.noPromptOnSignature??!0:k=n?.embeddedWallets?.noPromptOnSignature??N:k=N,n?.embeddedWallets?.waitForTransactionConfirmation===!1&&k!==!0)throw new Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:D,...Me}=n?.embeddedWallets??{};return{id:t.id,name:t.name,allowlistConfig:t.allowlistConfig,legacyWalletUiConfig:t.legacyWalletUiConfig,appearance:{logo:n?.appearance?.logo??t.logoUrl,landingHeader:n?.appearance?.landingHeader??d.appearance.landingHeader,loginMessage:typeof n?.appearance?.loginMessage=="string"?n?.appearance?.loginMessage.slice(0,100):n?.appearance?.loginMessage,palette:Ae({backgroundTheme:n?.appearance?.theme??d.appearance.theme,accentHex:n?.appearance?.accentColor??t.accentColor??d.appearance.accentColor}),loginGroupPriority:T?"web3-first":"web2-first",hideDirectWeb2Inputs:!!n?.appearance?.hideDirectWeb2Inputs,walletList:We,walletChainType:n?.appearance?.walletChainType??"ethereum-only"},loginMethods:{wallet:p,email:s,sms:r,passkey:l,google:a,twitter:c,discord:h,github:C,spotify:b,instagram:E,tiktok:f,linkedin:_,apple:S,farcaster:A,telegram:w},loginMethodsAndOrder:Oe,legal:{termsAndConditionsUrl:n?.legal?.termsAndConditionsUrl??t.termsAndConditionsUrl,privacyPolicyUrl:n?.legal?.privacyPolicyUrl??t.privacyPolicyUrl,requireUsersAcceptTerms:t.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:n?.walletConnectCloudProjectId??t.walletConnectCloudProjectId??d.walletConnectCloudProjectId,rpcConfig:{rpcUrls:n?.rpcConfig?.rpcUrls??d.rpcConfig.rpcUrls,rpcTimeouts:n?.rpcConfig?.rpcTimeouts??d.rpcConfig.rpcTimeouts},chains:Ue,defaultChain:Le,intl:{defaultCountry:Ie},shouldEnforceDefaultChainOnConnect:Re,captchaEnabled:t.captchaEnabled??d.captchaEnabled,captchaSiteKey:t.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:n?.externalWallets?.coinbaseWallet?.connectionOptions??d.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:ve},solana:{connectors:n?.externalWallets?.solana?.connectors}},embeddedWallets:{...t.embeddedWalletConfig,...typeof D=="boolean"?{requireUserOwnedRecoveryOnCreate:D}:{},...U?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...Me,noPromptOnSignature:k},mfa:{methods:t.mfaMethods??[],noPromptOnMfaRequired:n?.mfa?.noPromptOnMfaRequired??!1},customAuth:U?{enabled:!0,...n.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:t.telegramAuthConfiguration},headless:!!n?.headless,render:{standalone:n?._render?.standalone??d._render.standalone},fundingConfig:t.fundingConfig,fundingMethodConfig:{...n?.fundingMethodConfig??d.fundingMethodConfig,moonpay:{...n?.fundingMethodConfig?.moonpay??d.fundingMethodConfig.moonpay,useSandbox:n?.fundingMethodConfig?.moonpay.useSandbox??n?.fiatOnRamp?.useSandbox??d.fundingMethodConfig.moonpay.useSandbox}}}}function we(t,n){if(!t)return{legacyCreateEmbeddedWalletFlag:n};let{appearance:o,additionalChains:i,supportedChains:s,defaultChain:r,externalWallets:l,...p}=t;return{...p,...i?{additionalChains:i.map(c=>c.id)}:void 0,...s?{supportedChains:s.map(c=>c.id)}:void 0,...r?{defaultChain:r.id}:void 0,...l?{walletConnect:l.walletConnect,coinbaseWallet:l.coinbaseWallet,solana:{connectors:l.solana?.connectors?.get().map(c=>c.walletClientType)}}:void 0,legacyCreateEmbeddedWalletFlag:n}}function ot({additionalChains:t,supportedChains:n,defaultChainFromConfig:o,hasRpcConfigDefined:i}){let s;if(t&&n&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),n){if(n.length===0)throw new Error("`supportedChains` must contain at least one chain");n.filter(a=>a.rpcUrls.privyWalletOverride).length>0&&i&&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`."),s=n.map(a=>a.rpcUrls.privyWalletOverride?a:W.find(h=>h.id===a.id)??a)}else s=W.concat(t??[]);let r=n?s[0]:v,l=o??r;if(!s.find(p=>p.id===l.id))throw new Error("`defaultChain` must be included in `supportedChains`");return{chains:s,defaultChain:l}}var Te=function(t,n=0){let o=3735928559^n,i=1103547991^n;for(let s=0,r;s<t.length;s++)r=t.charCodeAt(s),o=Math.imul(o^r,2654435761),i=Math.imul(i^r,1597334677);return o=Math.imul(o^o>>>16,2246822507),o^=Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507),i^=Math.imul(o^o>>>13,3266489909),4294967296*(2097151&i)+(o>>>0)};import{jsx as lt}from"react/jsx-runtime";var xe={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,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""},rt=R(xe,void 0,!1),M=at({appConfig:rt,isServerConfigLoaded:!1}),Uo=({children:t,legacyCreateEmbeddedWalletFlag:n,client:o,clientConfig:i})=>{let[s,r]=st(null),l=it(()=>R(s??xe,i,!!s),[s,i]);return ke(()=>{if(!s)return;let p=we(i,n),a=Te(JSON.stringify(p)).toString(),c=`privy:sent:${s.id}:${a}`;localStorage.getItem(c)||(o.createAnalyticsEvent({eventName:"sdk_initialize",payload:p}),localStorage.setItem(c,"t"))},[i,n,s]),ke(()=>{s||(async()=>{try{let a=await o.getServerConfig();a.customApiUrl&&o.updateApiUrl(a.customApiUrl),r(a)}catch(a){console.warn("Error generating app config: ",a)}})()},[]),lt(M.Provider,{value:{appConfig:l,isServerConfigLoaded:!!s},children:t})},Lo=()=>{let{appConfig:t}=Pe(M);return t},Ro=()=>{let{isServerConfigLoaded:t}=Pe(M);return t};import{createContext as pt,useContext as ct}from"react";var dt=pt({isNewUserThisSession:!1,walletConnectionStatus:null,connectors:[],solanaWallets:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,client:null,appId:"notAdded",customAuthStatus:{status:"not-enabled"},noPromptOnSignature:{current:!1},nativeTokenSymbolForChainId:e,initializeWalletProxy:e,getAuthMeta:e,getAuthFlow:e,closePrivyModal:e,openPrivyModal:e,connectWallet:e,initLoginWithWallet:e,loginWithWallet:e,initLoginWithFarcaster:e,loginWithFarcaster:e,loginWithCode:e,initLoginWithEmail:e,initLoginWithSms:e,initUpdateEmail:e,initUpdatePhone:e,resendEmailCode:e,resendSmsCode:e,initLoginWithHeadlessOAuth:e,loginWithHeadlessOAuth:e,crossAppAuthFlow:e,initLoginWithOAuth:e,recoveryOAuthFlow:e,loginWithOAuth:e,initLoginWithPasskey:e,loginWithPasskey:e,initLinkWithPasskey:e,linkWithPasskey:e,refreshUser:e,loginWithGuestAccountFlow:e,walletProxy:null,createAnalyticsEvent:e,acceptTerms:e,getUsdTokenPrice:e,getUsdPriceForSol:e,recoverEmbeddedEthereumWallet:e,getMoonpaySignedUrl:e,initCoinbaseOnRamp:e,getCoinbaseOnRampStatus:e,updateWallets:e,fundWallet:e,setReadyToTrue:e,requestFarcasterSignerStatus:e,initLoginWithTelegram:e,loginWithTelegram:e,generateSiweMessage:e,linkWithSiwe:e,linkSmartWallet:e,embeddedSolanaWallet:null,createEmbeddedSolanaWallet:e,recoverEmbeddedSolanaWallet:e,exportSolanaWallet:e,solanaSignMessage:e,connectCoinbaseSmartWallet:e,initiateAccountTransfer:e}),Ho=()=>ct(dt);export{ut as a,ht as b,gt as c,yt as d,g as e,O as f,u as g,me as h,ue as i,co as j,qe as k,he as l,ge as m,ye as n,fe as o,_t as p,Ct as q,St as r,At as s,wt as t,Tt as u,kt as v,Pt as w,xt as x,vt as y,Wt as z,Ot as A,It as B,Ut as C,Lt as D,Rt as E,Mt as F,Nt as G,Dt as H,Ft as I,Ht as J,jt as K,Kt as L,Yt as M,Gt as N,Bt as O,qt as P,zt as Q,Vt as R,Xt as S,$t as T,Zt as U,Jt as V,e as W,j as X,K as Y,Y as Z,G as _,B as $,q as aa,V as ba,ee as ca,v as da,oe as ea,ie as fa,se as ga,ae as ha,le as ia,pe as ja,W as ka,Qn as la,rt as ma,Uo as na,Lo as oa,Ro as pa,dt as qa,Ho as ra,je as sa,io as ta,Ge as ua,ro as va};
package/dist/esm/index.js CHANGED
@@ -1 +1 @@
1
- import{A as I,B as J,C as K,D as L,E as M,F as N,G as O,H as P,I as Q,J as R,K as S,L as T,M as U,a as b,b as c,c as d,d as e,f as g,g as h,h as i,i as k,j as m,k as n,l as o,m as r,n as s,o as t,p as u,q as v,r as x,s as y,t as z,u as A,v as B,w as D,x as F,y as G,z as H}from"./chunk-QTSNS7VF.js";import{R as l,aa as w,ba as C,ca as E}from"./chunk-LEABMTNM.js";import{c as p,f as V}from"./chunk-3AGMJGHJ.js";import{ka as f,ta as j,u as a,va as q}from"./chunk-XKAIXCX7.js";export{d as AsExternalProvider,i as Captcha,g as ConnectorManager,e as EthereumWalletConnector,t as LoginModal,h as PrivyClient,v as PrivyProvider,c as PrivyProxyProvider,f as SUPPORTED_CHAINS,a as VERSION,b as WalletConnector,p as addRpcUrlOverrideToChain,o as errorIndicatesMaxMfaRetries,m as errorIndicatesMfaTimeout,n as errorIndicatesMfaVerificationFailed,u as getAccessToken,V as getEmbeddedConnectedWallet,G as useConnectCoinbaseSmartWallet,C as useConnectWallet,D as useCreateWallet,H as useCrossAppAccounts,S as useCustomAuth,T as useExperimentalFarcasterSigner,U as useFarcasterSigner,E as useFundWallet,L as useGuestAccounts,B as useLinkAccount,A as useLinkWithSiwe,w as useLogin,y as useLoginWithEmail,x as useLoginWithOAuth,z as useLoginWithSms,l as useLogout,r as useMfa,s as useMfaEnrollment,P as useModalStatus,R as useOAuthTokens,j as usePrivy,k as useRegisterMfaListener,J as useSendSolanaTransaction,I as useSendTransaction,K as useSetWalletPassword,M as useSetWalletRecovery,N as useSignMessage,O as useSignTypedData,F as useSolanaWallets,Q as useToken,q as useWallets};
1
+ import{A as I,B as J,C as K,D as L,E as M,F as N,G as O,H as P,I as Q,J as R,K as S,L as T,M as U,a as b,b as c,c as d,d as e,f as g,g as h,h as i,i as k,j as m,k as n,l as o,m as r,n as s,o as t,p as u,q as v,r as x,s as y,t as z,u as A,v as B,w as D,x as F,y as G,z as H}from"./chunk-7M4DBJFW.js";import{R as l,aa as w,ba as C,ca as E}from"./chunk-QVSCWGK3.js";import{c as p,f as V}from"./chunk-TIACG3L3.js";import{ka as f,ta as j,u as a,va as q}from"./chunk-Z4PCJGI3.js";export{d as AsExternalProvider,i as Captcha,g as ConnectorManager,e as EthereumWalletConnector,t as LoginModal,h as PrivyClient,v as PrivyProvider,c as PrivyProxyProvider,f as SUPPORTED_CHAINS,a as VERSION,b as WalletConnector,p as addRpcUrlOverrideToChain,o as errorIndicatesMaxMfaRetries,m as errorIndicatesMfaTimeout,n as errorIndicatesMfaVerificationFailed,u as getAccessToken,V as getEmbeddedConnectedWallet,G as useConnectCoinbaseSmartWallet,C as useConnectWallet,D as useCreateWallet,H as useCrossAppAccounts,S as useCustomAuth,T as useExperimentalFarcasterSigner,U as useFarcasterSigner,E as useFundWallet,L as useGuestAccounts,B as useLinkAccount,A as useLinkWithSiwe,w as useLogin,y as useLoginWithEmail,x as useLoginWithOAuth,z as useLoginWithSms,l as useLogout,r as useMfa,s as useMfaEnrollment,P as useModalStatus,R as useOAuthTokens,j as usePrivy,k as useRegisterMfaListener,J as useSendSolanaTransaction,I as useSendTransaction,K as useSetWalletPassword,M as useSetWalletRecovery,N as useSignMessage,O as useSignTypedData,F as useSolanaWallets,Q as useToken,q as useWallets};
@@ -1 +1 @@
1
- import{b as v,d as N,e as F,f as G}from"./chunk-3AGMJGHJ.js";import{g as A,oa as E,ra as W,ta as I,va as _}from"./chunk-XKAIXCX7.js";import{createContext as Z,useContext as ee,useEffect as H,useState as L}from"react";import{createSmartAccountClient as k}from"permissionless";import{toBiconomySmartAccount as $,toEcdsaKernelSmartAccount as q,toLightSmartAccount as Q,toSafeSmartAccount as V}from"permissionless/accounts";import{createPimlicoClient as Y}from"permissionless/clients/pimlico";import{createPublicClient as O,http as h}from"viem";import{entryPoint06Address as j,entryPoint07Address as K}from"viem/account-abstraction";var z=({calls:o,chain:t,maxPriorityFeePerGas:r,maxFeePerGas:n,nonce:s})=>o.map(l=>({to:l.to||void 0,data:l.data,value:l.value,chainId:t.id,nonce:s,maxFeePerGas:n,maxPriorityFeePerGas:r})),R=()=>{let{chains:o,noPromptOnSignature:t,openPrivyModal:r}=W(),n=E(),{setModalData:s}=v();return{getSmartWalletClient:async(l,c,d)=>{let p=N(o),y=F(d.chainId),m=p.find(e=>e.id===y);if(!m)throw new Error(`Error finding chain object for smart wallet network ${d.chainId} in app config. Please ensure you have a chain object for ${d.chainId} in app config.`);let g=await l.getEthereumProvider(),{sendTransaction:T,signMessage:f,signTypedData:C,...a}=await X({owner:g,smartWalletType:c,chain:m,...d});return{...a,sendTransaction:async e=>{if(n.embeddedWallets.noPromptOnSignature||t.current)return await T(e);let u=[];"calls"in e&&typeof e.calls<"u"?u=[...e.calls]:"to"in e&&(u=[{to:e.to,value:e.value||BigInt(0),data:e.data||"0x"}]);let P=async()=>{if(!a.paymaster)return!1;let{paymasterAndData:S,paymasterData:x}=await a.prepareUserOperation({calls:u,maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0});return Number(S??x??0)>0};return new Promise(async(S,x)=>{t.current=!0,s({connectWallet:{onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:()=>{}},sendTransaction:{transactionRequests:z({calls:u,chain:m,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:P,onConfirm:()=>T(e),onSuccess:U=>S(U.hash),onFailure:x,uiOptions:{}}}),r("EMBEDDED_WALLET_CONNECTING_SCREEN")}).finally(()=>{t.current=!1})},signMessage:async({message:e})=>n.embeddedWallets.noPromptOnSignature||t.current?await f({message:e}):new Promise(async(u,P)=>{t.current=!0,s({connectWallet:{onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>f({message:e}),onSuccess:S=>u(S),onFailure:P,uiOptions:{}}}),r("EMBEDDED_WALLET_CONNECTING_SCREEN")}).finally(()=>{t.current=!1}),signTypedData:async e=>t.current?await C(e):new Promise(async(u,P)=>{t.current=!0,s({connectWallet:{onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>C(e),onSuccess:S=>u(S),onFailure:P,uiOptions:{}}}),r("EMBEDDED_WALLET_CONNECTING_SCREEN")}).finally(()=>{t.current=!1})}}}},b={address:j,version:"0.6"},M={address:K,version:"0.7"},J=({owner:o,smartWalletType:t,chain:r})=>{let n=O({chain:r,transport:h()});switch(t){case"safe":return V({client:n,entryPoint:M,owners:[o],version:"1.4.1"});case"kernel":return q({client:n,version:"0.3.1",entryPoint:M,owners:[o]});case"biconomy":return $({client:n,owners:[o],entryPoint:b});case"light_account":return Q({client:n,entryPoint:b,owner:o,version:"1.1.0"});default:throw new Error(`Invalid smart account type: ${t}.`)}},X=async({owner:o,smartWalletType:t,chain:r,bundlerUrl:n,paymasterUrl:s})=>{let l=O({chain:r,transport:h()}),c=await J({owner:o,smartWalletType:t,chain:r}),p=!!s?Y({transport:h(s),entryPoint:c.entryPoint}):void 0;return k({account:c,chain:r,paymaster:p,bundlerTransport:h(n),userOperation:{estimateFeesPerGas:async()=>{let y=await l.estimateFeesPerGas();return{...y,maxFeePerGas:y.maxFeePerGas*115n/100n,maxPriorityFeePerGas:y.maxPriorityFeePerGas*115n/100n}}}})};import{jsx as ae}from"react/jsx-runtime";var B=Z({client:void 0}),te=({children:o})=>{let[t,r]=L(null),{getSmartWalletClient:n}=R(),{generateSiweMessage:s,linkSmartWallet:l,client:c,noPromptOnSignature:d}=W(),{defaultChain:p}=E(),{wallets:y}=_(),{user:m}=I(),[g,T]=L(),f=G(y);return H(()=>{!t&&c&&(async()=>{try{if(!c){console.warn("No client found");return}let a=await c.getSmartWalletsConfig();r(a)}catch(a){console.warn("Error generating smart wallet config: ",a)}})()},[!!c]),H(()=>{(async()=>{if(!t?.enabled||!m||!f){T(void 0);return}if(g)return;let a=t.configuredNetworks.find(i=>i.chainId===`eip155:${p.id}`);if(!a)throw new A(`The defaultChain ${p.name} (eip155:${p.id}) must be configured in the smart wallet configuration in your dashboard`);if(m.smartWallet)try{let i=await n(f,m.smartWallet.smartWalletType,a);T(i);return}catch(i){console.error("Error loading smart wallet:",i);return}try{let i=await n(f,t.smartWalletType,a),w=await s({address:i.account.address,chainId:a.chainId});d.current=!0;let D=await i.signMessage({message:w});await l({signature:D,message:w,smartWalletType:t.smartWalletType}),T(i)}catch(i){console.error("Error creating smart wallet:",i)}finally{d.current=!1}})()},[!!t?.enabled,!!m?.smartWallet,!!f]),ae(B.Provider,{value:{client:g},children:o})},ne=()=>ee(B);export{te as SmartWalletsProvider,ne as useSmartWallets};
1
+ import{b as I,d as _,e as G,f as b}from"./chunk-TIACG3L3.js";import{g as A,oa as E,ra as h,ta as N,va as F}from"./chunk-Z4PCJGI3.js";import{createContext as ee,useContext as te,useEffect as L,useState as B}from"react";import{createSmartAccountClient as $}from"permissionless";import{toBiconomySmartAccount as q,toEcdsaKernelSmartAccount as Q,toLightSmartAccount as V,toSafeSmartAccount as Y}from"permissionless/accounts";import{createPimlicoClient as j}from"permissionless/clients/pimlico";import{createPublicClient as O,http as x}from"viem";import{entryPoint06Address as K,entryPoint07Address as z}from"viem/account-abstraction";var J=({calls:r,chain:t,maxPriorityFeePerGas:n,maxFeePerGas:o,nonce:l})=>r.map(c=>({to:c.to||void 0,data:c.data,value:c.value,chainId:t.id,nonce:l,maxFeePerGas:o,maxPriorityFeePerGas:n})),H=()=>{let{chains:r,noPromptOnSignature:t,openPrivyModal:n}=h(),o=E(),{setModalData:l}=I();return{getSmartWalletClient:async(c,P,i,T)=>{let u=_(r),p=G(i.chainId),d=u.find(e=>e.id===p);if(!d)throw new Error(`Error finding chain object for smart wallet network ${i.chainId} in app config. Please ensure you have a chain object for ${i.chainId} in app config.`);let C=await c.getEthereumProvider(),{sendTransaction:S,signMessage:y,signTypedData:W,...a}=await Z({owner:C,smartWalletType:P,chain:d,paymasterContext:T,...i});return{...a,sendTransaction:async e=>{if(o.embeddedWallets.noPromptOnSignature||t.current)return await S(e);let m=[];"calls"in e&&typeof e.calls<"u"?m=[...e.calls]:"to"in e&&(m=[{to:e.to,value:e.value||BigInt(0),data:e.data||"0x"}]);let g=async()=>{if(!a.paymaster)return!1;let{paymasterAndData:f,paymasterData:v}=await a.prepareUserOperation({calls:m,maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0});return Number(f??v??0)>0};return new Promise(async(f,v)=>{t.current=!0,l({connectWallet:{onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:()=>{}},sendTransaction:{transactionRequests:J({calls:m,chain:d,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:g,onConfirm:()=>S(e),onSuccess:k=>f(k.hash),onFailure:v,uiOptions:{}}}),n("EMBEDDED_WALLET_CONNECTING_SCREEN")}).finally(()=>{t.current=!1})},signMessage:async({message:e})=>o.embeddedWallets.noPromptOnSignature||t.current?await y({message:e}):new Promise(async(m,g)=>{t.current=!0,l({connectWallet:{onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>y({message:e}),onSuccess:f=>m(f),onFailure:g,uiOptions:{}}}),n("EMBEDDED_WALLET_CONNECTING_SCREEN")}).finally(()=>{t.current=!1}),signTypedData:async e=>t.current?await W(e):new Promise(async(m,g)=>{t.current=!0,l({connectWallet:{onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>W(e),onSuccess:f=>m(f),onFailure:g,uiOptions:{}}}),n("EMBEDDED_WALLET_CONNECTING_SCREEN")}).finally(()=>{t.current=!1})}}}},R={address:K,version:"0.6"},M={address:z,version:"0.7"},X=({owner:r,smartWalletType:t,chain:n})=>{let o=O({chain:n,transport:x()});switch(t){case"safe":return Y({client:o,entryPoint:M,owners:[r],version:"1.4.1"});case"kernel":return Q({client:o,version:"0.3.1",entryPoint:M,owners:[r]});case"biconomy":return q({client:o,owners:[r],entryPoint:R});case"light_account":return V({client:o,entryPoint:R,owner:r,version:"1.1.0"});default:throw new Error(`Invalid smart account type: ${t}.`)}},Z=async({owner:r,smartWalletType:t,chain:n,bundlerUrl:o,paymasterUrl:l,paymasterContext:c})=>{let P=O({chain:n,transport:x()}),i=await X({owner:r,smartWalletType:t,chain:n}),u=!!l?j({transport:x(l),entryPoint:i.entryPoint}):void 0;return $({account:i,chain:n,paymaster:u,paymasterContext:c,bundlerTransport:x(o),userOperation:{estimateFeesPerGas:async()=>{let p=await P.estimateFeesPerGas();return{...p,maxFeePerGas:p.maxFeePerGas*115n/100n,maxPriorityFeePerGas:p.maxPriorityFeePerGas*115n/100n}}}})};import{jsx as re}from"react/jsx-runtime";var U=ee({client:void 0}),ne=({config:r,children:t})=>{let[n,o]=B(null),{getSmartWalletClient:l}=H(),{generateSiweMessage:c,linkSmartWallet:P,client:i,noPromptOnSignature:T}=h(),{defaultChain:u}=E(),{wallets:p}=F(),{user:d}=N(),[C,S]=B(),y=b(p);return L(()=>{!n&&i&&(async()=>{try{if(!i){console.warn("No client found");return}let a=await i.getSmartWalletsConfig();o(a)}catch(a){console.warn("Error generating smart wallet config: ",a)}})()},[!!i]),L(()=>{(async()=>{if(!n?.enabled||!d||!y){S(void 0);return}if(C)return;let a=n.configuredNetworks.find(s=>s.chainId===`eip155:${u.id}`);if(!a)throw new A(`The defaultChain ${u.name} (eip155:${u.id}) must be configured in the smart wallet configuration in your dashboard`);if(d.smartWallet)try{let s=await l(y,d.smartWallet.smartWalletType,a,r?.paymasterContext);S(s);return}catch(s){console.error("Error loading smart wallet:",s);return}try{let s=await l(y,n.smartWalletType,a,r?.paymasterContext),w=await c({address:s.account.address,chainId:a.chainId});T.current=!0;let D=await s.signMessage({message:w});await P({signature:D,message:w,smartWalletType:n.smartWalletType}),S(s)}catch(s){console.error("Error creating smart wallet:",s)}finally{T.current=!1}})()},[!!n?.enabled,!!d?.smartWallet,!!y]),re(U.Provider,{value:{client:C},children:t})},ae=()=>te(U);export{ne as SmartWalletsProvider,ae as useSmartWallets};
@@ -1 +1 @@
1
- import{e as a,x as m}from"./chunk-QTSNS7VF.js";import"./chunk-LEABMTNM.js";import"./chunk-3AGMJGHJ.js";import"./chunk-XKAIXCX7.js";import{isWalletAdapterCompatibleStandardWallet as C}from"@solana/wallet-adapter-base";import{StandardWalletAdapter as S}from"@solana/wallet-standard-wallet-adapter-base";import{getWallets as f}from"@wallet-standard/app";var u=l=>{let{get:r,on:c}=f(),p=l?.shouldAutoConnect??!0,t=i(r()),e=t.map(o=>new a(o,p)),s=[],d;return{_setOnConnectorsUpdated:o=>{d=o},onMount:()=>{s.push(c("register",(...o)=>{t=t.concat(...i(o)),e=t.map(n=>new a(n,p)),d?.(e)}),c("unregister",(...o)=>{t=t.filter(n=>o.some(W=>n.wallet===W)),e=t.map(n=>new a(n,p)),d?.(e)}))},onUnmount:()=>{let o=s.pop();for(;o;)o(),o=s.pop()},get:()=>e}},i=l=>l.filter(C).map(r=>new S({wallet:r}));export{a as SolanaAdapterConnector,u as toSolanaWalletConnectors,m as useSolanaWallets};
1
+ import{e as a,x as m}from"./chunk-7M4DBJFW.js";import"./chunk-QVSCWGK3.js";import"./chunk-TIACG3L3.js";import"./chunk-Z4PCJGI3.js";import{isWalletAdapterCompatibleStandardWallet as C}from"@solana/wallet-adapter-base";import{StandardWalletAdapter as S}from"@solana/wallet-standard-wallet-adapter-base";import{getWallets as f}from"@wallet-standard/app";var u=l=>{let{get:r,on:c}=f(),p=l?.shouldAutoConnect??!0,t=i(r()),e=t.map(o=>new a(o,p)),s=[],d;return{_setOnConnectorsUpdated:o=>{d=o},onMount:()=>{s.push(c("register",(...o)=>{t=t.concat(...i(o)),e=t.map(n=>new a(n,p)),d?.(e)}),c("unregister",(...o)=>{t=t.filter(n=>o.some(W=>n.wallet===W)),e=t.map(n=>new a(n,p)),d?.(e)}))},onUnmount:()=>{let o=s.pop();for(;o;)o(),o=s.pop()},get:()=>e}},i=l=>l.filter(C).map(r=>new S({wallet:r}));export{a as SolanaAdapterConnector,u as toSolanaWalletConnectors,m as useSolanaWallets};
package/dist/esm/ui.js CHANGED
@@ -1,4 +1,4 @@
1
- import{D as q,K as j,P as e1,R as t1,V as o1,W as r1,Z as n1,aa as i1,ba as s1,ca as l1,h as I,r as Y,v as J}from"./chunk-LEABMTNM.js";import{oa as Q,ra as R,ta as g,va as w}from"./chunk-XKAIXCX7.js";import{jsx as a1}from"react/jsx-runtime";var p1=e=>a1("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:a1("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"})});import P2 from"styled-components";var H=P2.button`
1
+ import{D as q,K as j,Q as e1,R as t1,V as o1,W as r1,Z as n1,aa as i1,ba as s1,ca as l1,h as I,r as Y,v as J}from"./chunk-QVSCWGK3.js";import{oa as Q,ra as R,ta as g,va as w}from"./chunk-Z4PCJGI3.js";import{jsx as a1}from"react/jsx-runtime";var p1=e=>a1("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:a1("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"})});import P2 from"styled-components";var H=P2.button`
2
2
  --size: ${({$size:e})=>`${e}px`};
3
3
 
4
4
  -webkit-font-smoothing: antialiased;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import react__default, { MouseEvent } from 'react';
3
- import { C as Chain, W as WalletConnector, B as BaseConnectedEthereumWallet, a as RpcConfig, P as PrivyProxyProvider, E as Embedded1193Provider, b as WalletClientType, c as ConnectedWalletMetadata, d as ConnectorType, e as WalletListEntry, f as ExternalWalletsConfig, g as BaseConnectedWallet, S as SolanaWalletConnector, h as EIP1193Provider, U as User, O as OAuthTokens, i as OAuthProviderType, M as MoonpaySignRequest, j as MoonpaySignResponse, k as SmartWalletConfig, l as PrivyServerConfig, m as PrivyFarcasterSignerInitResponse, n as PrivyClientConfig, o as ConnectWalletModalOptions, L as LoginModalOptions, p as CreateWalletOptions, q as Wallet, r as SetWalletRecoveryOptions, s as SignMessageModalUIOptions, t as SignTypedDataParams, u as MfaMethod, v as UnsignedTransactionRequest, w as SendTransactionModalUIOptions, F as FundWalletConfig, T as TransactionReceipt, x as ConnectedWallet, y as PrivyIframeErrorTypesType, z as PrivyErrorCode, A as LoginMethod, D as LinkedAccountWithMetadata, G as UserRecoveryMethod, H as FundingMethod, I as LoginWithCode, J as OtpFlowState, K as UnsignedTransactionRequestWithChainId, N as CustomAuthFlowState } from './types-fcce0fc5.js';
4
- export { aa as Apple, ak as AppleOAuthWithMetadata, Q as AsExternalProvider, az as ConnectedSolanaWallet, as as ContractUIOptions, ad as CrossAppAccount, an as CrossAppAccountWithMetadata, a7 as Discord, ag as DiscordOAuthWithMetadata, ap as Email, a2 as EmailWithMetadata, aw as Farcaster, al as FarcasterWithMetadata, a8 as Github, ah as GithubOAuthWithMetadata, a5 as Google, ae as GoogleOAuthWithMetadata, a9 as LinkedIn, aj as LinkedInOAuthWithMetadata, ay as LoginMethodOrderOption, X as MessageTypes, Y as MoonpayConfig, Z as MoonpayCurrencyCode, au as MoonpayFundingConfig, _ as MoonpayPaymentMethod, at as NativeFundingConfig, a1 as NonEmptyArray, ax as Passkey, ao as PasskeyWithMetadata, aq as Phone, a3 as PhoneWithMetadata, av as PriceDisplayOptions, $ as Quantity, ac as Telegram, am as TelegramWithMetadata, ab as Tiktok, ai as TiktokOAuthWithMetadata, a0 as TransactionLog, ar as TransactionUIOptions, a6 as Twitter, af as TwitterOAuthWithMetadata, V as TypedMessage, a4 as WalletWithMetadata } from './types-fcce0fc5.js';
3
+ import { C as Chain, W as WalletConnector, B as BaseConnectedEthereumWallet, a as RpcConfig, P as PrivyProxyProvider, E as Embedded1193Provider, b as WalletClientType, c as ConnectedWalletMetadata, d as ConnectorType, e as WalletListEntry, f as ExternalWalletsConfig, g as BaseConnectedWallet, S as SolanaWalletConnector, h as EIP1193Provider, U as User, O as OAuthTokens, i as OAuthProviderType, M as MoonpaySignRequest, j as MoonpaySignResponse, k as SmartWalletConfig, l as PrivyServerConfig, m as PrivyFarcasterSignerInitResponse, L as LoginMethod, T as TelegramAuthResult, n as PrivyClientConfig, o as ConnectWalletModalOptions, p as LoginModalOptions, q as CreateWalletOptions, r as Wallet, s as SetWalletRecoveryOptions, t as SignMessageModalUIOptions, u as SignTypedDataParams, v as MfaMethod, w as UnsignedTransactionRequest, x as SendTransactionModalUIOptions, F as FundWalletConfig, y as TransactionReceipt, z as ConnectedWallet, A as PrivyIframeErrorTypesType, D as PrivyErrorCode, G as LinkedAccountWithMetadata, H as UserRecoveryMethod, I as FundingMethod, J as LoginWithCode, K as OtpFlowState, N as UnsignedTransactionRequestWithChainId, Q as CustomAuthFlowState } from './types-2f8e9783.js';
4
+ export { ab as Apple, al as AppleOAuthWithMetadata, V as AsExternalProvider, aA as ConnectedSolanaWallet, at as ContractUIOptions, ae as CrossAppAccount, ao as CrossAppAccountWithMetadata, a8 as Discord, ah as DiscordOAuthWithMetadata, aq as Email, a3 as EmailWithMetadata, ax as Farcaster, am as FarcasterWithMetadata, a9 as Github, ai as GithubOAuthWithMetadata, a6 as Google, af as GoogleOAuthWithMetadata, aa as LinkedIn, ak as LinkedInOAuthWithMetadata, az as LoginMethodOrderOption, Y as MessageTypes, Z as MoonpayConfig, _ as MoonpayCurrencyCode, av as MoonpayFundingConfig, $ as MoonpayPaymentMethod, au as NativeFundingConfig, a2 as NonEmptyArray, ay as Passkey, ap as PasskeyWithMetadata, ar as Phone, a4 as PhoneWithMetadata, aw as PriceDisplayOptions, a0 as Quantity, ad as Telegram, an as TelegramWithMetadata, ac as Tiktok, aj as TiktokOAuthWithMetadata, a1 as TransactionLog, as as TransactionUIOptions, a7 as Twitter, ag as TwitterOAuthWithMetadata, X as TypedMessage, a5 as WalletWithMetadata } from './types-2f8e9783.js';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { TurnstileProps } from '@marsidev/react-turnstile';
7
7
  import EventEmitter from 'eventemitter3';
@@ -651,6 +651,18 @@ declare class PrivyClient {
651
651
  walletClientType?: string;
652
652
  connectorType?: string;
653
653
  }): Promise<User>;
654
+ /**
655
+ *
656
+ */
657
+ sendAccountTransferRequest({ nonce, account, accountType, chainId, walletClientType, connectorType, telegramAuthResult, }: {
658
+ nonce: string;
659
+ account: string;
660
+ accountType: LoginMethod;
661
+ chainId?: string;
662
+ walletClientType?: string;
663
+ connectorType?: string;
664
+ telegramAuthResult?: TelegramAuthResult;
665
+ }): Promise<User>;
654
666
  /**
655
667
  * Headless method to link a new wallet via the Sign-In with Solana spec.
656
668
  *
@@ -1632,7 +1644,7 @@ interface PrivyEvents {
1632
1644
  /**
1633
1645
  * Callback that will execute once a successful `sendSolanaTransaction` completes.
1634
1646
  * This will not run in the case of a wallet-based authentication or link flow.
1635
- * @param response - the response (type SolanaTransactionReceipt https://solana-labs.github.io/solana-web3.js/types/ParsedTransactionMeta.html) from the successful transaction
1647
+ * @param response - the response {@link https://solana-labs.github.io/solana-web3.js/types/ParsedTransactionMeta.html SolanaTransactionReceipt} from the successful transaction
1636
1648
  */
1637
1649
  onSuccess?: (response: SolanaTransactionReceipt) => void;
1638
1650
  /**
@@ -1953,16 +1965,18 @@ declare function useRegisterMfaListener(callbacks: PrivyEvents['configureMfa']):
1953
1965
  * @returns linkEmail - opens the Privy modal and prompts the user to link an email address
1954
1966
  * @returns linkPhone - opens the Privy modal and prompts the user to link a phone number
1955
1967
  * @returns linkWallet - opens the Privy modal and prompts the user to link an external wallet
1956
- * @returns linkGoogle - opens the Privy modal and prompts the user to link their Google account
1957
- * @returns linkApple - opens the Privy modal and prompts the user to link their Apple account
1958
- * @returns linkTwitter - opens the Privy modal and prompts the user to link their Twitter account
1959
- * @returns linkDiscord - opens the Privy modal and prompts the user to link their Discord account
1960
- * @returns linkGithub - opens the Privy modal and prompts the user to link their Github account
1961
- * @returns linkLinkedIn - opens the Privy modal and prompts the user to link their LinkedIn account
1962
- * @returns linkTikTok - opens the Privy modal and prompts the user to link their TikTok account
1963
- * @returns linkSpotify - opens the Privy modal and prompts the user to link their Spotify account
1964
- * @returns linkInstagram - opens the Privy modal and prompts the user to link their Instagram account
1965
- * @returns linkFarcaster - opens the Privy modal and prompts the user to link their Farcaster account
1968
+ * @returns linkGoogle - immediately redirects to Google login page and prompts the user to link their account
1969
+ * @returns linkApple - immediately redirects to Apple login page and prompts the user to link their account
1970
+ * @returns linkTwitter - immediately redirects to Twitter login page and prompts the user to link their account
1971
+ * @returns linkDiscord - immediately redirects to Discord login page and prompts the user to link their account
1972
+ * @returns linkGithub - immediately redirects to Github login page and prompts the user to link their account
1973
+ * @returns linkLinkedIn - immediately redirects to LinkedIn login page and prompts the user to link their account
1974
+ * @returns linkTikTok - immediately redirects to TikTok login page and prompts the user to link their account
1975
+ * @returns linkSpotify - immediately redirects to Spotify login page and prompts the user to link their account
1976
+ * @returns linkInstagram - immediately redirects to Instagram login page and prompts the user to link their account
1977
+ * @returns linkTelegram - immediately redirects to Telegram login page and prompts the user to link their account
1978
+ * @returns linkFarcaster - displays a QR code to sign in with Farcaster and prompts user to link their account
1979
+ *
1966
1980
  */
1967
1981
  declare function useLinkAccount(callbacks?: PrivyEvents['linkAccount']): {
1968
1982
  linkEmail: () => void;
@@ -2396,4 +2410,4 @@ declare const LoginModal: ({ open }: {
2396
2410
  open: boolean;
2397
2411
  }) => react_jsx_runtime.JSX.Element;
2398
2412
 
2399
- export { CallbackError, Captcha, ConnectWalletModalOptions, ConnectedWallet, ConnectorManager, CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthProviderType, OAuthTokens, PrivyClient, PrivyClientConfig, PrivyEvents, PrivyInterface, PrivyProvider, PrivyProviderProps, PrivyProxyProvider, DEFAULT_SUPPORTED_CHAINS as SUPPORTED_CHAINS, SendCodeToEmail, SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, TransactionReceipt, UnsignedTransactionRequest, UseConnectCoinbaseSmartWalletInterface, UseCustomAuth, UseFundWalletInterface, UseLoginWithEmail, UseLoginWithSms, UseOAuthTokens, UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, addRpcUrlOverrideToChain, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getAccessToken, getEmbeddedConnectedWallet, useConnectCoinbaseSmartWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useExperimentalFarcasterSigner, useFarcasterSigner, useFundWallet, useGuestAccounts, useLinkAccount, useLinkWithSiwe, useLogin, useLoginWithEmail, useLoginWithOAuth, useLoginWithSms, useLogout, useMfa, useMfaEnrollment, useModalStatus, useOAuthTokens, usePrivy, useRegisterMfaListener, useSendSolanaTransaction, useSendTransaction, useSetWalletPassword, useSetWalletRecovery, useSignMessage, useSignTypedData, useToken, useWallets };
2413
+ export { CallbackError, Captcha, ConnectWalletModalOptions, ConnectedWallet, ConnectorManager, CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthProviderType, OAuthTokens, PrivyClient, PrivyClientConfig, PrivyEvents, PrivyInterface, PrivyProvider, PrivyProviderProps, PrivyProxyProvider, DEFAULT_SUPPORTED_CHAINS as SUPPORTED_CHAINS, SendCodeToEmail, SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SolanaTransactionReceipt, SupportedSolanaTransaction, TransactionReceipt, UnsignedTransactionRequest, UseConnectCoinbaseSmartWalletInterface, UseCustomAuth, UseFundWalletInterface, UseLoginWithEmail, UseLoginWithSms, UseOAuthTokens, UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, addRpcUrlOverrideToChain, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getAccessToken, getEmbeddedConnectedWallet, useConnectCoinbaseSmartWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useExperimentalFarcasterSigner, useFarcasterSigner, useFundWallet, useGuestAccounts, useLinkAccount, useLinkWithSiwe, useLogin, useLoginWithEmail, useLoginWithOAuth, useLoginWithSms, useLogout, useMfa, useMfaEnrollment, useModalStatus, useOAuthTokens, usePrivy, useRegisterMfaListener, useSendSolanaTransaction, useSendTransaction, useSetWalletPassword, useSetWalletRecovery, useSignMessage, useSignTypedData, useToken, useWallets };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQTSNS7VFjs = require('./chunk-QTSNS7VF.js');var _chunkLEABMTNMjs = require('./chunk-LEABMTNM.js');var _chunk3AGMJGHJjs = require('./chunk-3AGMJGHJ.js');var _chunkXKAIXCX7js = require('./chunk-XKAIXCX7.js');exports.AsExternalProvider = _chunkQTSNS7VFjs.c; exports.Captcha = _chunkQTSNS7VFjs.h; exports.ConnectorManager = _chunkQTSNS7VFjs.f; exports.EthereumWalletConnector = _chunkQTSNS7VFjs.d; exports.LoginModal = _chunkQTSNS7VFjs.o; exports.PrivyClient = _chunkQTSNS7VFjs.g; exports.PrivyProvider = _chunkQTSNS7VFjs.q; exports.PrivyProxyProvider = _chunkQTSNS7VFjs.b; exports.SUPPORTED_CHAINS = _chunkXKAIXCX7js.ka; exports.VERSION = _chunkXKAIXCX7js.u; exports.WalletConnector = _chunkQTSNS7VFjs.a; exports.addRpcUrlOverrideToChain = _chunk3AGMJGHJjs.c; exports.errorIndicatesMaxMfaRetries = _chunkQTSNS7VFjs.l; exports.errorIndicatesMfaTimeout = _chunkQTSNS7VFjs.j; exports.errorIndicatesMfaVerificationFailed = _chunkQTSNS7VFjs.k; exports.getAccessToken = _chunkQTSNS7VFjs.p; exports.getEmbeddedConnectedWallet = _chunk3AGMJGHJjs.f; exports.useConnectCoinbaseSmartWallet = _chunkQTSNS7VFjs.y; exports.useConnectWallet = _chunkLEABMTNMjs.ba; exports.useCreateWallet = _chunkQTSNS7VFjs.w; exports.useCrossAppAccounts = _chunkQTSNS7VFjs.z; exports.useCustomAuth = _chunkQTSNS7VFjs.K; exports.useExperimentalFarcasterSigner = _chunkQTSNS7VFjs.L; exports.useFarcasterSigner = _chunkQTSNS7VFjs.M; exports.useFundWallet = _chunkLEABMTNMjs.ca; exports.useGuestAccounts = _chunkQTSNS7VFjs.D; exports.useLinkAccount = _chunkQTSNS7VFjs.v; exports.useLinkWithSiwe = _chunkQTSNS7VFjs.u; exports.useLogin = _chunkLEABMTNMjs.aa; exports.useLoginWithEmail = _chunkQTSNS7VFjs.s; exports.useLoginWithOAuth = _chunkQTSNS7VFjs.r; exports.useLoginWithSms = _chunkQTSNS7VFjs.t; exports.useLogout = _chunkLEABMTNMjs.R; exports.useMfa = _chunkQTSNS7VFjs.m; exports.useMfaEnrollment = _chunkQTSNS7VFjs.n; exports.useModalStatus = _chunkQTSNS7VFjs.H; exports.useOAuthTokens = _chunkQTSNS7VFjs.J; exports.usePrivy = _chunkXKAIXCX7js.ta; exports.useRegisterMfaListener = _chunkQTSNS7VFjs.i; exports.useSendSolanaTransaction = _chunkQTSNS7VFjs.B; exports.useSendTransaction = _chunkQTSNS7VFjs.A; exports.useSetWalletPassword = _chunkQTSNS7VFjs.C; exports.useSetWalletRecovery = _chunkQTSNS7VFjs.E; exports.useSignMessage = _chunkQTSNS7VFjs.F; exports.useSignTypedData = _chunkQTSNS7VFjs.G; exports.useSolanaWallets = _chunkQTSNS7VFjs.x; exports.useToken = _chunkQTSNS7VFjs.I; exports.useWallets = _chunkXKAIXCX7js.va;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk7M4DBJFWjs = require('./chunk-7M4DBJFW.js');var _chunkQVSCWGK3js = require('./chunk-QVSCWGK3.js');var _chunkTIACG3L3js = require('./chunk-TIACG3L3.js');var _chunkZ4PCJGI3js = require('./chunk-Z4PCJGI3.js');exports.AsExternalProvider = _chunk7M4DBJFWjs.c; exports.Captcha = _chunk7M4DBJFWjs.h; exports.ConnectorManager = _chunk7M4DBJFWjs.f; exports.EthereumWalletConnector = _chunk7M4DBJFWjs.d; exports.LoginModal = _chunk7M4DBJFWjs.o; exports.PrivyClient = _chunk7M4DBJFWjs.g; exports.PrivyProvider = _chunk7M4DBJFWjs.q; exports.PrivyProxyProvider = _chunk7M4DBJFWjs.b; exports.SUPPORTED_CHAINS = _chunkZ4PCJGI3js.ka; exports.VERSION = _chunkZ4PCJGI3js.u; exports.WalletConnector = _chunk7M4DBJFWjs.a; exports.addRpcUrlOverrideToChain = _chunkTIACG3L3js.c; exports.errorIndicatesMaxMfaRetries = _chunk7M4DBJFWjs.l; exports.errorIndicatesMfaTimeout = _chunk7M4DBJFWjs.j; exports.errorIndicatesMfaVerificationFailed = _chunk7M4DBJFWjs.k; exports.getAccessToken = _chunk7M4DBJFWjs.p; exports.getEmbeddedConnectedWallet = _chunkTIACG3L3js.f; exports.useConnectCoinbaseSmartWallet = _chunk7M4DBJFWjs.y; exports.useConnectWallet = _chunkQVSCWGK3js.ba; exports.useCreateWallet = _chunk7M4DBJFWjs.w; exports.useCrossAppAccounts = _chunk7M4DBJFWjs.z; exports.useCustomAuth = _chunk7M4DBJFWjs.K; exports.useExperimentalFarcasterSigner = _chunk7M4DBJFWjs.L; exports.useFarcasterSigner = _chunk7M4DBJFWjs.M; exports.useFundWallet = _chunkQVSCWGK3js.ca; exports.useGuestAccounts = _chunk7M4DBJFWjs.D; exports.useLinkAccount = _chunk7M4DBJFWjs.v; exports.useLinkWithSiwe = _chunk7M4DBJFWjs.u; exports.useLogin = _chunkQVSCWGK3js.aa; exports.useLoginWithEmail = _chunk7M4DBJFWjs.s; exports.useLoginWithOAuth = _chunk7M4DBJFWjs.r; exports.useLoginWithSms = _chunk7M4DBJFWjs.t; exports.useLogout = _chunkQVSCWGK3js.R; exports.useMfa = _chunk7M4DBJFWjs.m; exports.useMfaEnrollment = _chunk7M4DBJFWjs.n; exports.useModalStatus = _chunk7M4DBJFWjs.H; exports.useOAuthTokens = _chunk7M4DBJFWjs.J; exports.usePrivy = _chunkZ4PCJGI3js.ta; exports.useRegisterMfaListener = _chunk7M4DBJFWjs.i; exports.useSendSolanaTransaction = _chunk7M4DBJFWjs.B; exports.useSendTransaction = _chunk7M4DBJFWjs.A; exports.useSetWalletPassword = _chunk7M4DBJFWjs.C; exports.useSetWalletRecovery = _chunk7M4DBJFWjs.E; exports.useSignMessage = _chunk7M4DBJFWjs.F; exports.useSignTypedData = _chunk7M4DBJFWjs.G; exports.useSolanaWallets = _chunk7M4DBJFWjs.x; exports.useToken = _chunk7M4DBJFWjs.I; exports.useWallets = _chunkZ4PCJGI3js.va;
@@ -22,12 +22,13 @@ type SmartWalletClientType = Omit<Awaited<ReturnType<typeof signerToSmartAccount
22
22
  [key: string]: unknown;
23
23
  }, TPrimaryType extends string, TAccount extends SmartAccount | undefined = SmartAccount | undefined>(args: SignTypedDataParameters<TTypedData, TPrimaryType, TAccount>) => Promise<Hex>;
24
24
  };
25
- declare const signerToSmartAccountClient: ({ owner, smartWalletType, chain, bundlerUrl, paymasterUrl, }: {
25
+ declare const signerToSmartAccountClient: ({ owner, smartWalletType, chain, bundlerUrl, paymasterUrl, paymasterContext, }: {
26
26
  owner: EIP1193Provider;
27
27
  smartWalletType: SmartWalletType;
28
28
  chain: Chain;
29
29
  bundlerUrl: string;
30
30
  paymasterUrl?: string;
31
+ paymasterContext?: Record<string, any>;
31
32
  }) => Promise<permissionless.SmartAccountClient<viem.HttpTransport, Chain, object & {
32
33
  client: viem.Client;
33
34
  entryPoint: {
@@ -715,9 +716,13 @@ declare const signerToSmartAccountClient: ({ owner, smartWalletType, chain, bund
715
716
  interface SmartWalletsInterface {
716
717
  client?: SmartWalletClientType;
717
718
  }
718
- declare const SmartWalletsProvider: ({ children }: {
719
+ interface SmartWalletsProviderProps {
720
+ config?: {
721
+ paymasterContext?: Record<string, any>;
722
+ };
719
723
  children: react__default.ReactNode;
720
- }) => react_jsx_runtime.JSX.Element;
724
+ }
725
+ declare const SmartWalletsProvider: ({ config, children }: SmartWalletsProviderProps) => react_jsx_runtime.JSX.Element;
721
726
  declare const useSmartWallets: () => SmartWalletsInterface;
722
727
 
723
- export { SmartWalletsProvider, useSmartWallets };
728
+ export { SmartWalletsProvider, SmartWalletsProviderProps, useSmartWallets };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunk3AGMJGHJjs = require('./chunk-3AGMJGHJ.js');var _chunkXKAIXCX7js = require('./chunk-XKAIXCX7.js');var _react = require('react');var _permissionless = require('permissionless');var _accounts = require('permissionless/accounts');var _pimlico = require('permissionless/clients/pimlico');var _viem = require('viem');var _accountabstraction = require('viem/account-abstraction');var z=({calls:o,chain:t,maxPriorityFeePerGas:r,maxFeePerGas:n,nonce:s})=>o.map(l=>({to:l.to||void 0,data:l.data,value:l.value,chainId:t.id,nonce:s,maxFeePerGas:n,maxPriorityFeePerGas:r})),R=()=>{let{chains:o,noPromptOnSignature:t,openPrivyModal:r}=_chunkXKAIXCX7js.ra.call(void 0, ),n=_chunkXKAIXCX7js.oa.call(void 0, ),{setModalData:s}=_chunk3AGMJGHJjs.b.call(void 0, );return{getSmartWalletClient:async(l,c,d)=>{let p=_chunk3AGMJGHJjs.d.call(void 0, o),y=_chunk3AGMJGHJjs.e.call(void 0, d.chainId),m=p.find(e=>e.id===y);if(!m)throw new Error(`Error finding chain object for smart wallet network ${d.chainId} in app config. Please ensure you have a chain object for ${d.chainId} in app config.`);let g=await l.getEthereumProvider(),{sendTransaction:T,signMessage:f,signTypedData:C,...a}=await X({owner:g,smartWalletType:c,chain:m,...d});return{...a,sendTransaction:async e=>{if(n.embeddedWallets.noPromptOnSignature||t.current)return await T(e);let u=[];"calls"in e&&typeof e.calls<"u"?u=[...e.calls]:"to"in e&&(u=[{to:e.to,value:e.value||BigInt(0),data:e.data||"0x"}]);let P=async()=>{if(!a.paymaster)return!1;let{paymasterAndData:S,paymasterData:x}=await a.prepareUserOperation({calls:u,maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0});return Number(_nullishCoalesce(_nullishCoalesce(S, () => (x)), () => (0)))>0};return new Promise(async(S,x)=>{t.current=!0,s({connectWallet:{onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:()=>{}},sendTransaction:{transactionRequests:z({calls:u,chain:m,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:P,onConfirm:()=>T(e),onSuccess:U=>S(U.hash),onFailure:x,uiOptions:{}}}),r("EMBEDDED_WALLET_CONNECTING_SCREEN")}).finally(()=>{t.current=!1})},signMessage:async({message:e})=>n.embeddedWallets.noPromptOnSignature||t.current?await f({message:e}):new Promise(async(u,P)=>{t.current=!0,s({connectWallet:{onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>f({message:e}),onSuccess:S=>u(S),onFailure:P,uiOptions:{}}}),r("EMBEDDED_WALLET_CONNECTING_SCREEN")}).finally(()=>{t.current=!1}),signTypedData:async e=>t.current?await C(e):new Promise(async(u,P)=>{t.current=!0,s({connectWallet:{onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>C(e),onSuccess:S=>u(S),onFailure:P,uiOptions:{}}}),r("EMBEDDED_WALLET_CONNECTING_SCREEN")}).finally(()=>{t.current=!1})}}}},b={address:_accountabstraction.entryPoint06Address,version:"0.6"},M={address:_accountabstraction.entryPoint07Address,version:"0.7"},J=({owner:o,smartWalletType:t,chain:r})=>{let n=_viem.createPublicClient.call(void 0, {chain:r,transport:_viem.http.call(void 0, )});switch(t){case"safe":return _accounts.toSafeSmartAccount.call(void 0, {client:n,entryPoint:M,owners:[o],version:"1.4.1"});case"kernel":return _accounts.toEcdsaKernelSmartAccount.call(void 0, {client:n,version:"0.3.1",entryPoint:M,owners:[o]});case"biconomy":return _accounts.toBiconomySmartAccount.call(void 0, {client:n,owners:[o],entryPoint:b});case"light_account":return _accounts.toLightSmartAccount.call(void 0, {client:n,entryPoint:b,owner:o,version:"1.1.0"});default:throw new Error(`Invalid smart account type: ${t}.`)}},X=async({owner:o,smartWalletType:t,chain:r,bundlerUrl:n,paymasterUrl:s})=>{let l=_viem.createPublicClient.call(void 0, {chain:r,transport:_viem.http.call(void 0, )}),c=await J({owner:o,smartWalletType:t,chain:r}),p=!!s?_pimlico.createPimlicoClient.call(void 0, {transport:_viem.http.call(void 0, s),entryPoint:c.entryPoint}):void 0;return _permissionless.createSmartAccountClient.call(void 0, {account:c,chain:r,paymaster:p,bundlerTransport:_viem.http.call(void 0, n),userOperation:{estimateFeesPerGas:async()=>{let y=await l.estimateFeesPerGas();return{...y,maxFeePerGas:y.maxFeePerGas*115n/100n,maxPriorityFeePerGas:y.maxPriorityFeePerGas*115n/100n}}}})};var _jsxruntime = require('react/jsx-runtime');var B=_react.createContext.call(void 0, {client:void 0}),te= exports.SmartWalletsProvider =({children:o})=>{let[t,r]=_react.useState.call(void 0, null),{getSmartWalletClient:n}=R(),{generateSiweMessage:s,linkSmartWallet:l,client:c,noPromptOnSignature:d}=_chunkXKAIXCX7js.ra.call(void 0, ),{defaultChain:p}=_chunkXKAIXCX7js.oa.call(void 0, ),{wallets:y}=_chunkXKAIXCX7js.va.call(void 0, ),{user:m}=_chunkXKAIXCX7js.ta.call(void 0, ),[g,T]=_react.useState.call(void 0, ),f=_chunk3AGMJGHJjs.f.call(void 0, y);return _react.useEffect.call(void 0, ()=>{!t&&c&&(async()=>{try{if(!c){console.warn("No client found");return}let a=await c.getSmartWalletsConfig();r(a)}catch(a){console.warn("Error generating smart wallet config: ",a)}})()},[!!c]),_react.useEffect.call(void 0, ()=>{(async()=>{if(!_optionalChain([t, 'optionalAccess', _2 => _2.enabled])||!m||!f){T(void 0);return}if(g)return;let a=t.configuredNetworks.find(i=>i.chainId===`eip155:${p.id}`);if(!a)throw new (0, _chunkXKAIXCX7js.g)(`The defaultChain ${p.name} (eip155:${p.id}) must be configured in the smart wallet configuration in your dashboard`);if(m.smartWallet)try{let i=await n(f,m.smartWallet.smartWalletType,a);T(i);return}catch(i){console.error("Error loading smart wallet:",i);return}try{let i=await n(f,t.smartWalletType,a),w=await s({address:i.account.address,chainId:a.chainId});d.current=!0;let D=await i.signMessage({message:w});await l({signature:D,message:w,smartWalletType:t.smartWalletType}),T(i)}catch(i){console.error("Error creating smart wallet:",i)}finally{d.current=!1}})()},[!!_optionalChain([t, 'optionalAccess', _3 => _3.enabled]),!!_optionalChain([m, 'optionalAccess', _4 => _4.smartWallet]),!!f]),_jsxruntime.jsx.call(void 0, B.Provider,{value:{client:g},children:o})},ne= exports.useSmartWallets =()=>_react.useContext.call(void 0, B);exports.SmartWalletsProvider = te; exports.useSmartWallets = ne;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkTIACG3L3js = require('./chunk-TIACG3L3.js');var _chunkZ4PCJGI3js = require('./chunk-Z4PCJGI3.js');var _react = require('react');var _permissionless = require('permissionless');var _accounts = require('permissionless/accounts');var _pimlico = require('permissionless/clients/pimlico');var _viem = require('viem');var _accountabstraction = require('viem/account-abstraction');var J=({calls:r,chain:t,maxPriorityFeePerGas:n,maxFeePerGas:o,nonce:l})=>r.map(c=>({to:c.to||void 0,data:c.data,value:c.value,chainId:t.id,nonce:l,maxFeePerGas:o,maxPriorityFeePerGas:n})),H=()=>{let{chains:r,noPromptOnSignature:t,openPrivyModal:n}=_chunkZ4PCJGI3js.ra.call(void 0, ),o=_chunkZ4PCJGI3js.oa.call(void 0, ),{setModalData:l}=_chunkTIACG3L3js.b.call(void 0, );return{getSmartWalletClient:async(c,P,i,T)=>{let u=_chunkTIACG3L3js.d.call(void 0, r),p=_chunkTIACG3L3js.e.call(void 0, i.chainId),d=u.find(e=>e.id===p);if(!d)throw new Error(`Error finding chain object for smart wallet network ${i.chainId} in app config. Please ensure you have a chain object for ${i.chainId} in app config.`);let C=await c.getEthereumProvider(),{sendTransaction:S,signMessage:y,signTypedData:W,...a}=await Z({owner:C,smartWalletType:P,chain:d,paymasterContext:T,...i});return{...a,sendTransaction:async e=>{if(o.embeddedWallets.noPromptOnSignature||t.current)return await S(e);let m=[];"calls"in e&&typeof e.calls<"u"?m=[...e.calls]:"to"in e&&(m=[{to:e.to,value:e.value||BigInt(0),data:e.data||"0x"}]);let g=async()=>{if(!a.paymaster)return!1;let{paymasterAndData:f,paymasterData:v}=await a.prepareUserOperation({calls:m,maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0});return Number(_nullishCoalesce(_nullishCoalesce(f, () => (v)), () => (0)))>0};return new Promise(async(f,v)=>{t.current=!0,l({connectWallet:{onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:()=>{}},sendTransaction:{transactionRequests:J({calls:m,chain:d,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:g,onConfirm:()=>S(e),onSuccess:k=>f(k.hash),onFailure:v,uiOptions:{}}}),n("EMBEDDED_WALLET_CONNECTING_SCREEN")}).finally(()=>{t.current=!1})},signMessage:async({message:e})=>o.embeddedWallets.noPromptOnSignature||t.current?await y({message:e}):new Promise(async(m,g)=>{t.current=!0,l({connectWallet:{onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>y({message:e}),onSuccess:f=>m(f),onFailure:g,uiOptions:{}}}),n("EMBEDDED_WALLET_CONNECTING_SCREEN")}).finally(()=>{t.current=!1}),signTypedData:async e=>t.current?await W(e):new Promise(async(m,g)=>{t.current=!0,l({connectWallet:{onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>W(e),onSuccess:f=>m(f),onFailure:g,uiOptions:{}}}),n("EMBEDDED_WALLET_CONNECTING_SCREEN")}).finally(()=>{t.current=!1})}}}},R={address:_accountabstraction.entryPoint06Address,version:"0.6"},M={address:_accountabstraction.entryPoint07Address,version:"0.7"},X=({owner:r,smartWalletType:t,chain:n})=>{let o=_viem.createPublicClient.call(void 0, {chain:n,transport:_viem.http.call(void 0, )});switch(t){case"safe":return _accounts.toSafeSmartAccount.call(void 0, {client:o,entryPoint:M,owners:[r],version:"1.4.1"});case"kernel":return _accounts.toEcdsaKernelSmartAccount.call(void 0, {client:o,version:"0.3.1",entryPoint:M,owners:[r]});case"biconomy":return _accounts.toBiconomySmartAccount.call(void 0, {client:o,owners:[r],entryPoint:R});case"light_account":return _accounts.toLightSmartAccount.call(void 0, {client:o,entryPoint:R,owner:r,version:"1.1.0"});default:throw new Error(`Invalid smart account type: ${t}.`)}},Z=async({owner:r,smartWalletType:t,chain:n,bundlerUrl:o,paymasterUrl:l,paymasterContext:c})=>{let P=_viem.createPublicClient.call(void 0, {chain:n,transport:_viem.http.call(void 0, )}),i=await X({owner:r,smartWalletType:t,chain:n}),u=!!l?_pimlico.createPimlicoClient.call(void 0, {transport:_viem.http.call(void 0, l),entryPoint:i.entryPoint}):void 0;return _permissionless.createSmartAccountClient.call(void 0, {account:i,chain:n,paymaster:u,paymasterContext:c,bundlerTransport:_viem.http.call(void 0, o),userOperation:{estimateFeesPerGas:async()=>{let p=await P.estimateFeesPerGas();return{...p,maxFeePerGas:p.maxFeePerGas*115n/100n,maxPriorityFeePerGas:p.maxPriorityFeePerGas*115n/100n}}}})};var _jsxruntime = require('react/jsx-runtime');var U=_react.createContext.call(void 0, {client:void 0}),ne= exports.SmartWalletsProvider =({config:r,children:t})=>{let[n,o]=_react.useState.call(void 0, null),{getSmartWalletClient:l}=H(),{generateSiweMessage:c,linkSmartWallet:P,client:i,noPromptOnSignature:T}=_chunkZ4PCJGI3js.ra.call(void 0, ),{defaultChain:u}=_chunkZ4PCJGI3js.oa.call(void 0, ),{wallets:p}=_chunkZ4PCJGI3js.va.call(void 0, ),{user:d}=_chunkZ4PCJGI3js.ta.call(void 0, ),[C,S]=_react.useState.call(void 0, ),y=_chunkTIACG3L3js.f.call(void 0, p);return _react.useEffect.call(void 0, ()=>{!n&&i&&(async()=>{try{if(!i){console.warn("No client found");return}let a=await i.getSmartWalletsConfig();o(a)}catch(a){console.warn("Error generating smart wallet config: ",a)}})()},[!!i]),_react.useEffect.call(void 0, ()=>{(async()=>{if(!_optionalChain([n, 'optionalAccess', _2 => _2.enabled])||!d||!y){S(void 0);return}if(C)return;let a=n.configuredNetworks.find(s=>s.chainId===`eip155:${u.id}`);if(!a)throw new (0, _chunkZ4PCJGI3js.g)(`The defaultChain ${u.name} (eip155:${u.id}) must be configured in the smart wallet configuration in your dashboard`);if(d.smartWallet)try{let s=await l(y,d.smartWallet.smartWalletType,a,_optionalChain([r, 'optionalAccess', _3 => _3.paymasterContext]));S(s);return}catch(s){console.error("Error loading smart wallet:",s);return}try{let s=await l(y,n.smartWalletType,a,_optionalChain([r, 'optionalAccess', _4 => _4.paymasterContext])),w=await c({address:s.account.address,chainId:a.chainId});T.current=!0;let D=await s.signMessage({message:w});await P({signature:D,message:w,smartWalletType:n.smartWalletType}),S(s)}catch(s){console.error("Error creating smart wallet:",s)}finally{T.current=!1}})()},[!!_optionalChain([n, 'optionalAccess', _5 => _5.enabled]),!!_optionalChain([d, 'optionalAccess', _6 => _6.smartWallet]),!!y]),_jsxruntime.jsx.call(void 0, U.Provider,{value:{client:C},children:t})},ae= exports.useSmartWallets =()=>_react.useContext.call(void 0, U);exports.SmartWalletsProvider = ne; exports.useSmartWallets = ae;
package/dist/solana.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { az as ConnectedSolanaWallet, q as Wallet } from './types-fcce0fc5.js';
2
- export { S as SolanaAdapterConnector, aA as toSolanaWalletConnectors } from './types-fcce0fc5.js';
1
+ import { aA as ConnectedSolanaWallet, r as Wallet } from './types-2f8e9783.js';
2
+ export { S as SolanaAdapterConnector, aB as toSolanaWalletConnectors } from './types-2f8e9783.js';
3
3
  import { Transaction, VersionedTransaction, ParsedTransactionWithMeta } from '@solana/web3.js';
4
4
  import '@metamask/eth-sig-util';
5
5
  import '@ethersproject/providers';
@@ -11,10 +11,20 @@ import 'react';
11
11
  import 'viem';
12
12
  import 'web3-core';
13
13
 
14
+ /**
15
+ * A transaction that can be sent to the Solana network. Legacy transactions or v0 transactions (versioned) are supported.
16
+ * Refer to {@link https://solana-labs.github.io/solana-web3.js/classes/Transaction.html Transaction} and {@link https://solana-labs.github.io/solana-web3.js/classes/VersionedTransaction.html VersionedTransaction}
17
+ */
14
18
  type SupportedSolanaTransaction = Transaction | VersionedTransaction;
19
+ /**
20
+ * Result of the transaction sent to the Solana network.
21
+ */
15
22
  type SolanaTransactionReceipt = {
23
+ /** The signature of the transaction */
16
24
  signature: string;
25
+ /** The parsed transaction result. Refer to {@link https://solana-labs.github.io/solana-web3.js/types/ParsedTransactionWithMeta.html ParsedTransactionWithMeta}*/
17
26
  parsedTransaction: ParsedTransactionWithMeta | null;
27
+ /** The fees payed for the transaction in lamports */
18
28
  fees: bigint;
19
29
  };
20
30
 
package/dist/solana.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkQTSNS7VFjs = require('./chunk-QTSNS7VF.js');require('./chunk-LEABMTNM.js');require('./chunk-3AGMJGHJ.js');require('./chunk-XKAIXCX7.js');var _walletadapterbase = require('@solana/wallet-adapter-base');var _walletstandardwalletadapterbase = require('@solana/wallet-standard-wallet-adapter-base');var _app = require('@wallet-standard/app');var u=l=>{let{get:r,on:c}=_app.getWallets.call(void 0, ),p=_nullishCoalesce(_optionalChain([l, 'optionalAccess', _ => _.shouldAutoConnect]), () => (!0)),t=i(r()),e=t.map(o=>new (0, _chunkQTSNS7VFjs.e)(o,p)),s=[],d;return{_setOnConnectorsUpdated:o=>{d=o},onMount:()=>{s.push(c("register",(...o)=>{t=t.concat(...i(o)),e=t.map(n=>new (0, _chunkQTSNS7VFjs.e)(n,p)),_optionalChain([d, 'optionalCall', _2 => _2(e)])}),c("unregister",(...o)=>{t=t.filter(n=>o.some(W=>n.wallet===W)),e=t.map(n=>new (0, _chunkQTSNS7VFjs.e)(n,p)),_optionalChain([d, 'optionalCall', _3 => _3(e)])}))},onUnmount:()=>{let o=s.pop();for(;o;)o(),o=s.pop()},get:()=>e}},i=l=>l.filter(_walletadapterbase.isWalletAdapterCompatibleStandardWallet).map(r=>new (0, _walletstandardwalletadapterbase.StandardWalletAdapter)({wallet:r}));exports.SolanaAdapterConnector = _chunkQTSNS7VFjs.e; exports.toSolanaWalletConnectors = u; exports.useSolanaWallets = _chunkQTSNS7VFjs.x;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunk7M4DBJFWjs = require('./chunk-7M4DBJFW.js');require('./chunk-QVSCWGK3.js');require('./chunk-TIACG3L3.js');require('./chunk-Z4PCJGI3.js');var _walletadapterbase = require('@solana/wallet-adapter-base');var _walletstandardwalletadapterbase = require('@solana/wallet-standard-wallet-adapter-base');var _app = require('@wallet-standard/app');var u=l=>{let{get:r,on:c}=_app.getWallets.call(void 0, ),p=_nullishCoalesce(_optionalChain([l, 'optionalAccess', _ => _.shouldAutoConnect]), () => (!0)),t=i(r()),e=t.map(o=>new (0, _chunk7M4DBJFWjs.e)(o,p)),s=[],d;return{_setOnConnectorsUpdated:o=>{d=o},onMount:()=>{s.push(c("register",(...o)=>{t=t.concat(...i(o)),e=t.map(n=>new (0, _chunk7M4DBJFWjs.e)(n,p)),_optionalChain([d, 'optionalCall', _2 => _2(e)])}),c("unregister",(...o)=>{t=t.filter(n=>o.some(W=>n.wallet===W)),e=t.map(n=>new (0, _chunk7M4DBJFWjs.e)(n,p)),_optionalChain([d, 'optionalCall', _3 => _3(e)])}))},onUnmount:()=>{let o=s.pop();for(;o;)o(),o=s.pop()},get:()=>e}},i=l=>l.filter(_walletadapterbase.isWalletAdapterCompatibleStandardWallet).map(r=>new (0, _walletstandardwalletadapterbase.StandardWalletAdapter)({wallet:r}));exports.SolanaAdapterConnector = _chunk7M4DBJFWjs.e; exports.toSolanaWalletConnectors = u; exports.useSolanaWallets = _chunk7M4DBJFWjs.x;
@@ -225,7 +225,8 @@ declare enum PrivyErrorCode {
225
225
  DISALLOWED_LOGIN_METHOD = "disallowed_login_method",
226
226
  PASSKEY_NOT_ALLOWED = "passkey_not_allowed",
227
227
  USER_DOES_NOT_EXIST = "user_does_not_exist",
228
- INSUFFICIENT_BALANCE = "insufficient_balance"
228
+ INSUFFICIENT_BALANCE = "insufficient_balance",
229
+ ACCOUNT_TRANSFER_REQUIRED = "account_transfer_required"
229
230
  }
230
231
 
231
232
  declare class WalletTimeoutError extends PrivyConnectorError {
@@ -1768,6 +1769,20 @@ interface PrivyClientConfig {
1768
1769
  };
1769
1770
  };
1770
1771
  }
1772
+ /**
1773
+ * The data received from Telegram when the user is authenticated.
1774
+ *
1775
+ * @see https://core.telegram.org/widgets/login#receiving-authorization-data
1776
+ */
1777
+ interface TelegramAuthResult {
1778
+ id: number;
1779
+ first_name: string;
1780
+ auth_date: number;
1781
+ hash: string;
1782
+ last_name?: string;
1783
+ photo_url?: string;
1784
+ username?: string;
1785
+ }
1771
1786
  /**
1772
1787
  * Configuration for the Privy Smart Wallet SDK.
1773
1788
  * This configuration is used to enable the Smart Wallet SDK and configure the networks that the Smart Wallet will be used on.
@@ -2176,4 +2191,4 @@ type EthereumRpcResponseType = eth_signTransactionResponse | eth_populateTransac
2176
2191
  type SolanaRpcRequestType = solana_signMessage;
2177
2192
  type SolanaRpcResponseType = solana_signMessageResponse;
2178
2193
 
2179
- export { Quantity as $, LoginMethod as A, BaseConnectedEthereumWallet as B, Chain as C, LinkedAccountWithMetadata as D, Embedded1193Provider as E, FundWalletConfig as F, UserRecoveryMethod as G, FundingMethod as H, LoginWithCode as I, OtpFlowState as J, UnsignedTransactionRequestWithChainId as K, LoginModalOptions as L, MoonpaySignRequest as M, CustomAuthFlowState as N, OAuthTokens as O, PrivyProxyProvider as P, AsExternalProvider as Q, RuntimeLoginOverridableOptions as R, SolanaWalletConnector as S, TransactionReceipt as T, User as U, TypedMessage as V, WalletConnector as W, MessageTypes as X, MoonpayConfig as Y, MoonpayCurrencyCode as Z, MoonpayPaymentMethod as _, RpcConfig as a, TransactionLog as a0, NonEmptyArray as a1, EmailWithMetadata as a2, PhoneWithMetadata as a3, WalletWithMetadata as a4, Google as a5, Twitter as a6, Discord as a7, Github as a8, LinkedIn as a9, toSolanaWalletConnectors as aA, Apple as aa, Tiktok as ab, Telegram as ac, CrossAppAccount as ad, GoogleOAuthWithMetadata as ae, TwitterOAuthWithMetadata as af, DiscordOAuthWithMetadata as ag, GithubOAuthWithMetadata as ah, TiktokOAuthWithMetadata as ai, LinkedInOAuthWithMetadata as aj, AppleOAuthWithMetadata as ak, FarcasterWithMetadata as al, TelegramWithMetadata as am, CrossAppAccountWithMetadata as an, PasskeyWithMetadata as ao, Email as ap, Phone as aq, TransactionUIOptions as ar, ContractUIOptions as as, NativeFundingConfig as at, MoonpayFundingConfig as au, PriceDisplayOptions as av, Farcaster as aw, Passkey as ax, LoginMethodOrderOption as ay, ConnectedSolanaWallet as az, WalletClientType as b, ConnectedWalletMetadata as c, ConnectorType as d, WalletListEntry as e, ExternalWalletsConfig as f, BaseConnectedWallet as g, EIP1193Provider as h, OAuthProviderType as i, MoonpaySignResponse as j, SmartWalletConfig as k, PrivyServerConfig as l, PrivyFarcasterSignerInitResponse as m, PrivyClientConfig as n, ConnectWalletModalOptions as o, CreateWalletOptions as p, Wallet as q, SetWalletRecoveryOptions as r, SignMessageModalUIOptions as s, SignTypedDataParams as t, MfaMethod as u, UnsignedTransactionRequest as v, SendTransactionModalUIOptions as w, ConnectedWallet as x, PrivyIframeErrorTypesType as y, PrivyErrorCode as z };
2194
+ export { MoonpayPaymentMethod as $, PrivyIframeErrorTypesType as A, BaseConnectedEthereumWallet as B, Chain as C, PrivyErrorCode as D, Embedded1193Provider as E, FundWalletConfig as F, LinkedAccountWithMetadata as G, UserRecoveryMethod as H, FundingMethod as I, LoginWithCode as J, OtpFlowState as K, LoginMethod as L, MoonpaySignRequest as M, UnsignedTransactionRequestWithChainId as N, OAuthTokens as O, PrivyProxyProvider as P, CustomAuthFlowState as Q, RuntimeLoginOverridableOptions as R, SolanaWalletConnector as S, TelegramAuthResult as T, User as U, AsExternalProvider as V, WalletConnector as W, TypedMessage as X, MessageTypes as Y, MoonpayConfig as Z, MoonpayCurrencyCode as _, RpcConfig as a, Quantity as a0, TransactionLog as a1, NonEmptyArray as a2, EmailWithMetadata as a3, PhoneWithMetadata as a4, WalletWithMetadata as a5, Google as a6, Twitter as a7, Discord as a8, Github as a9, ConnectedSolanaWallet as aA, toSolanaWalletConnectors as aB, LinkedIn as aa, Apple as ab, Tiktok as ac, Telegram as ad, CrossAppAccount as ae, GoogleOAuthWithMetadata as af, TwitterOAuthWithMetadata as ag, DiscordOAuthWithMetadata as ah, GithubOAuthWithMetadata as ai, TiktokOAuthWithMetadata as aj, LinkedInOAuthWithMetadata as ak, AppleOAuthWithMetadata as al, FarcasterWithMetadata as am, TelegramWithMetadata as an, CrossAppAccountWithMetadata as ao, PasskeyWithMetadata as ap, Email as aq, Phone as ar, TransactionUIOptions as as, ContractUIOptions as at, NativeFundingConfig as au, MoonpayFundingConfig as av, PriceDisplayOptions as aw, Farcaster as ax, Passkey as ay, LoginMethodOrderOption as az, WalletClientType as b, ConnectedWalletMetadata as c, ConnectorType as d, WalletListEntry as e, ExternalWalletsConfig as f, BaseConnectedWallet as g, EIP1193Provider as h, OAuthProviderType as i, MoonpaySignResponse as j, SmartWalletConfig as k, PrivyServerConfig as l, PrivyFarcasterSignerInitResponse as m, PrivyClientConfig as n, ConnectWalletModalOptions as o, LoginModalOptions as p, CreateWalletOptions as q, Wallet as r, SetWalletRecoveryOptions as s, SignMessageModalUIOptions as t, SignTypedDataParams as u, MfaMethod as v, UnsignedTransactionRequest as w, SendTransactionModalUIOptions as x, TransactionReceipt as y, ConnectedWallet as z };
package/dist/ui.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { R as RuntimeLoginOverridableOptions } from './types-fcce0fc5.js';
2
+ import { R as RuntimeLoginOverridableOptions } from './types-2f8e9783.js';
3
3
  import '@metamask/eth-sig-util';
4
4
  import '@ethersproject/providers';
5
5
  import 'eventemitter3';