@privy-io/react-auth 2.4.5 → 2.4.6-beta-20250225233939
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/abstract-smart-wallets.js +1 -1
- package/dist/cjs/farcaster.js +1 -1
- package/dist/cjs/{getPublicClient-BjV7zj03.js → getPublicClient-hVv5ZSWd.js} +1 -1
- package/dist/cjs/{importWallet-DbohmIiw.js → importWallet-C9eckAi6.js} +1 -1
- package/dist/cjs/index.js +9 -9
- package/dist/cjs/{internal-context-BFE-DjTn.js → internal-context-DV3MljLU.js} +1 -1
- package/dist/cjs/paths-BGBZ-6Nl.js +1 -0
- package/dist/cjs/{prepareFundingModalData-BdtVxCug.js → prepareFundingModalData-F2vnJ3hL.js} +1 -1
- package/dist/cjs/smart-wallets-Bbw52iem.js +1 -0
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/ui.js +1 -1
- package/dist/cjs/{useActiveWallet-BmSLq25D.js → useActiveWallet-C-yNC7pr.js} +4 -3
- package/dist/cjs/{useFundWallet-DNBXOQPj.js → useFundWallet-BCG2BZm0.js} +1 -1
- package/dist/cjs/useWallets-B1FpiIFv.js +1 -0
- package/dist/dts/farcaster.d.mts +1 -1
- package/dist/dts/farcaster.d.ts +1 -1
- package/dist/dts/index.d.mts +12 -15
- package/dist/dts/index.d.ts +12 -15
- package/dist/dts/smart-wallets.d.mts +1 -1
- package/dist/dts/smart-wallets.d.ts +1 -1
- package/dist/dts/solana.d.mts +5 -5
- package/dist/dts/solana.d.ts +5 -5
- package/dist/dts/{types-BKBPK3tN.d.mts → types-VtXkq8Wj.d.mts} +23 -2
- package/dist/dts/{types-BKBPK3tN.d.ts → types-VtXkq8Wj.d.ts} +23 -2
- package/dist/dts/ui.d.mts +1 -1
- package/dist/dts/ui.d.ts +1 -1
- package/dist/dts/{useSolanaWallets-BkzftCx7.d.mts → useSolanaWallets-Du5sSdUt.d.mts} +1 -1
- package/dist/dts/{useSolanaWallets-BkzftCx7.d.ts → useSolanaWallets-Du5sSdUt.d.ts} +1 -1
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/farcaster.mjs +1 -1
- package/dist/esm/{getPublicClient-BghjDv1y.mjs → getPublicClient-wHgCncHx.mjs} +1 -1
- package/dist/esm/importWallet-BvrVJ2kr.mjs +1 -0
- package/dist/esm/index.mjs +21 -21
- package/dist/esm/{internal-context-DBDJ7qsa.mjs → internal-context-mSHyF0Gq.mjs} +1 -1
- package/dist/esm/paths-Q47X90aK.mjs +1 -0
- package/dist/esm/{prepareFundingModalData-CsN1TYQy.mjs → prepareFundingModalData-B4bmEYDQ.mjs} +1 -1
- package/dist/esm/smart-wallets-BKpHV5bc.mjs +1 -0
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/ui.mjs +2 -2
- package/dist/esm/{useActiveWallet-DvvTjRH_.mjs → useActiveWallet-DZh5_7ym.mjs} +6 -5
- package/dist/esm/{useFundWallet-DS1kytse.mjs → useFundWallet-CI-i6AW7.mjs} +1 -1
- package/dist/esm/useWallets-C6emeO1q.mjs +1 -0
- package/package.json +3 -3
- package/dist/cjs/paths-DJCfoehl.js +0 -1
- package/dist/cjs/smart-wallets-DR6SCvrN.js +0 -1
- package/dist/cjs/useWallets-C7Zst89H.js +0 -1
- package/dist/esm/importWallet-ylHVDCXz.mjs +0 -1
- package/dist/esm/paths-CasJYDld.mjs +0 -1
- package/dist/esm/smart-wallets-gIJUc6-6.mjs +0 -1
- package/dist/esm/useWallets-8w3LVxdW.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getAddress as e}from"viem/utils";import{jsx as t,jsxs as a}from"react/jsx-runtime";import{useState as i,useMemo as r,useEffect as n,useContext as l,createContext as s,useRef as o}from"react";import c from"tinycolor2";import{n as p}from"./internal-context-mSHyF0Gq.mjs";const d="https://auth.privy.io",u=2e4,E=1400,m=2500,h=4e3,_="2.4.6-beta-20250225233939",f="privy:token",y="privy-token",A="privy:refresh_token",g="privy-refresh-token",C="privy:pat",b="privy:id_token",N="privy-id-token",S="privy-session",T="privy:caid",v=e=>`privy:guest:${e}`,w=e=>`privy:cross-app:${e}`,k="privy:state_code",L="privy:code_verifier",O="privy:headless_oauth",R="privy:oauth_disable_signup",I=e=>`privy:wallet:${e}`,D="privy:connectors",W="privy:connections",M=12e4,U=1,P="0x1",x=3e4,F="https://api.moonpay.com/v1",G="https://api.moonpay.com/v1",H="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",B="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",V="deprecated";function j(e){return e?new Date(1e3*e):null}function K(e,t){return e.slice().sort(((e,t)=>(e.firstVerifiedAt??e.verifiedAt).getTime()-(t.firstVerifiedAt??t.verifiedAt).getTime())).find((e=>e.type===t))}const Y=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"ethereum"===e.chainType&&0===e.walletIndex))||null,z=e=>(e?.linkedAccounts??[]).filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"ethereum"===e.chainType)),q=e=>z(e).reduce(((e,t)=>!e||e.walletIndex<t.walletIndex?t:e),null),$=(e,t)=>(e?.linkedAccounts??[]).filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.chainType===t)),X=e=>(e?.linkedAccounts??[]).filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"solana"===e.chainType)),Z=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"solana"===e.chainType&&0===e.walletIndex))||null,J=e=>X(e).reduce(((e,t)=>!e||e.walletIndex<t.walletIndex?t:e),null),Q=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.imported&&"ethereum"===e.chainType))||null,ee=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&e.imported&&"privy"===e.walletClientType&&"solana"===e.chainType))||null,te=(e,t)=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.address===t))||null,ae=e=>Y(e)??Z(e),ie=e=>{if("ethereum"===e.chainType)return{entropyId:e.address,entropyIdVerifier:"ethereum-address-verifier"};if("solana"===e.chainType)return{entropyId:e.address,entropyIdVerifier:"solana-address-verifier"};throw Error("Failed to get account entropy details")},re=e=>{let t=ae(e);if(!t)throw Error("Failed to find primary wallet");return ie(t)},ne=(t,a)=>{let i=$(t,"ethereum").find((t=>e(t.address)===e(a)));return{signingWallet:i,rootWallet:i?i.imported?i:Y(t):void 0}},le=(e,t)=>{let a=$(e,"solana").find((e=>e.address===t));return a?a.imported||0===a.walletIndex?{signingWallet:a,rootWallet:a}:{signingWallet:a,rootWallet:Z(e)}:{}};function se(e){if(!e)return null;let t=function(e){let t=[];for(let a of e){let e=a.type;switch(a.type){case"wallet":let i={id:a.id,address:a.address,type:a.type,imported:a.imported,delegated:a.delegated,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at),chainType:a.chain_type,walletClientType:a.wallet_client_type,connectorType:a.connector_type,recoveryMethod:a.recovery_method,walletIndex:a.wallet_index};t.push(i);break;case"smart_wallet":let r={address:a.address,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at),smartWalletType:a.smart_wallet_type};t.push(r);break;case"cross_app":let n={type:a.type,subject:a.subject,embeddedWallets:a.embedded_wallets,smartWallets:a.smart_wallets,providerApp:{id:a.provider_app_id},verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(n);break;case"email":let l={address:a.address,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(l);break;case"phone":let s={number:a.phoneNumber,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(s);break;case"google_oauth":let o={subject:a.subject,email:a.email,name:a.name,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(o);break;case"spotify_oauth":let c={subject:a.subject,email:a.email,name:a.name,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(c);break;case"instagram_oauth":let p={subject:a.subject,username:a.username,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(p);break;case"twitter_oauth":let d={subject:a.subject,username:a.username,name:a.name,type:a.type,profilePictureUrl:a.profile_picture_url,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(d);break;case"discord_oauth":let u={subject:a.subject,username:a.username,email:a.email,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(u);break;case"github_oauth":let E={subject:a.subject,username:a.username,name:a.name,email:a.email,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(E);break;case"tiktok_oauth":let m={subject:a.subject,username:a.username,name:a.name,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(m);break;case"linkedin_oauth":let h={subject:a.subject,name:a.name,email:a.email,vanityName:a.vanity_name,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(h);break;case"apple_oauth":let _={subject:a.subject,email:a.email,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(_);break;case"custom_auth":t.push({type:a.type,customUserId:a.custom_user_id,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)});break;case"farcaster":let f={type:a.type,fid:a.fid,ownerAddress:a.owner_address,displayName:a.display_name,username:a.username,bio:a.bio,pfp:a.profile_picture_url,url:a.homepage_url,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at),signerPublicKey:a.signer_public_key};t.push(f);break;case"passkey":let y={type:a.type,enrolledInMfa:a.enrolled_in_mfa,credentialId:a.credential_id,authenticatorName:a.authenticator_name,createdWithDevice:a.created_with_device,createdWithOs:a.created_with_os,createdWithBrowser:a.created_with_browser,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(y);break;case"telegram":let A={type:a.type,telegramUserId:a.telegram_user_id,firstName:a.first_name,lastName:a.last_name,username:a.username,photoUrl:a.photo_url,verifiedAt:j(a.first_verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(A);break;case"signer":let g={type:a.type,publicKey:a.public_key,verifiedAt:j(a.first_verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(g);break;default:console.warn(`Unrecognized account type: ${e}. Please consider upgrading the Privy SDK.`)}}return t}(e.linked_accounts),a=K(t,"wallet"),i=K(t,"smart_wallet"),r=K(t,"email"),n=K(t,"phone"),l=K(t,"google_oauth"),s=K(t,"twitter_oauth"),o=K(t,"discord_oauth"),c=K(t,"github_oauth"),p=K(t,"spotify_oauth"),d=K(t,"instagram_oauth"),u=K(t,"tiktok_oauth"),E=K(t,"linkedin_oauth"),m=K(t,"apple_oauth"),h=K(t,"farcaster"),_=K(t,"telegram"),f=e.mfa_methods.map((({type:e,verified_at:t})=>({type:e,verifiedAt:j(t)})));return{id:e.id,createdAt:j(e.created_at),linkedAccounts:t,email:r&&{address:r?.address},phone:n&&{number:n?.number},wallet:a&&{id:a.id,address:a.address,chainType:a.chainType,walletClientType:a.walletClientType,connectorType:a.connectorType,recoveryMethod:a.recoveryMethod,imported:a.imported,delegated:a.delegated,walletIndex:a.walletIndex},smartWallet:i&&{address:i.address,smartWalletType:i.smartWalletType},google:l&&{subject:l.subject,email:l.email,name:l.name},twitter:s&&{subject:s.subject,username:s.username,name:s.name,profilePictureUrl:s.profilePictureUrl},discord:o&&{subject:o.subject,username:o.username,email:o.email},github:c&&{subject:c.subject,username:c.username,name:c.name,email:c.email},spotify:p&&{subject:p.subject,email:p.email,name:p.name},instagram:d&&{subject:d.subject,username:d.username},tiktok:u&&{subject:u.subject,username:u.username,name:u.name},linkedin:E&&{subject:E.subject,name:E.name,email:E.email,vanityName:E.vanityName},apple:m&&{subject:m.subject,email:m.email},farcaster:h&&{fid:h.fid,ownerAddress:h.ownerAddress,displayName:h.displayName,username:h.username,bio:h.bio,pfp:h.pfp,url:h.url,signerPublicKey:h.signerPublicKey},telegram:_&&{telegramUserId:_.telegramUserId,firstName:_.firstName,lastName:_.lastName,username:_.username,photoUrl:_.photoUrl},delegatedWallets:[],mfaMethods:f.map((e=>e.type)),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest,customMetadata:e.custom_metadata}}const oe={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"}}},ce={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},pe={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"}}},de={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},ue={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"}}},Ee={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},me={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},he={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},_e={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"}}},fe={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"}}},ye={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},Ae={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"}}},ge={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},Ce={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},be={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"}}},Ne=[oe,ce,Ce,_e,fe,ye,Ae,ge,me,{id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0},{id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}},{id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}},ue,Ee,{id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0},{id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}},he,{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},pe,de,be,{id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0},{id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},{id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}},{id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}},{id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}}],Se=new Set(Ne.map((e=>e.id)));function Te({src:e,...a}){/*#__PURE__*/return t("img",{src:e,...a,style:{display:"none"}})}const ve={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",externalWallets:{coinbaseWallet:{connectionOptions:"all"}},embeddedWallets:{extendedCalldataDecoding:!1},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let we=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","ronin_wallet","wallet_connect","detected_wallets","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe","solflare","backpack"]),ke=e=>we.has(e),Le=(e,t,a)=>a.indexOf(e)===t;const Oe=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(ke).filter(Le):e?e.filter(ke).filter(Le):ve.appearance.walletList;function Re(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function Ie(e){let t=e.filter((e=>!Se.has(e.id)));return Ne.concat(t)}function De(e,t){return{...e,rpcUrls:{...e.rpcUrls,privy:{http:[t]}}}}const We=792703809,Me="11111111111111111111111111111111",Ue="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";function Pe(e){return e.includes("testnet")?"testnet":e.includes("devnet")?"devnet":"mainnet-beta"}function xe(e,t){return`https://explorer.solana.com/tx/${e}?cluster=${t}`}function Fe(e,t){return`https://explorer.solana.com/account/${e}?cluster=${t}`}function Ge({name:e,rpcUrl:t}){if(t)return t;switch(e){case"mainnet-beta":return"https://api.mainnet-beta.solana.com";case"testnet":return"https://api.testnet.solana.com";case"devnet":return"https://api.devnet.solana.com"}}let He="#FFFFFF";function Be(e,t){let a=Math.max(0,Math.min(1,e.toHsl().l+t));return c({...e.toHsl(),l:a})}function Ve({backgroundTheme:e,accentHex:t}){let a;switch(e){case"light":a=He;break;case"dark":a="#1E1E1D";break;default:a=e}let i=c(a),r=c(t),n=c("#51BA81"),l=c("#FFB74D"),s=c("#EC6351"),o=function(e){return e<.8&&e>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),e>.5?"light":"dark"}(i.getLuminance()),p=Be(i,"light"===o?-.04:.11),d=Be(i,"light"===o?-.08:.16),u=Be(i,"light"===o?-.88:.87),E=Be(i,"light"===o?-.7:.75),m=Be(i,"light"===o?-.43:.45).desaturate("light"===o?60:20),h=Be(i,"light"===o?-.08:.25).desaturate("light"===o?60:20),_=Be(r,.15),f=Be(r,.25),y=Be(r,-.06),A=Be(r,-.6),g=Be(s,.3),C=Be(l,.3),b=c(r.getLuminance()>.5?"#040217":He),N=Be(n,-.16),S=Be(n,.4);return{colorScheme:o,background:i.toHslString(),background2:p.toHslString(),background3:d.toHslString(),foreground:u.toHslString(),foreground2:E.toHslString(),foreground3:m.toHslString(),foreground4:h.toHslString(),accent:r.toHslString(),accentLight:_.toHslString(),accentLightest:f.toHslString(),accentDark:y.toHslString(),accentDarkest:A.toHslString(),foregroundAccent:b.toHslString(),success:n.toHslString(),successDark:N.toHslString(),successLight:S.toHslString(),error:s.toHslString(),errorLight:g.toHslString(),warn:l.toHslString(),warnLight:C.toHslString()}}function je(e,t,a,i){let r,n,l,s,o,c,p,d,u,E,m,h,_,f,y,A=a?console.warn:()=>{};t?.loginMethods?(r=t.loginMethods.includes("email"),n=t.loginMethods.includes("sms"),s=t.loginMethods.includes("wallet"),o=t.loginMethods.includes("google"),c=t.loginMethods.includes("twitter"),p=t.loginMethods.includes("discord"),u=t.loginMethods.includes("spotify"),E=t.loginMethods.includes("instagram"),d=t.loginMethods.includes("tiktok"),h=t.loginMethods.includes("github"),m=t.loginMethods.includes("linkedin"),_=t.loginMethods.includes("apple"),f=t.loginMethods.includes("farcaster"),y=t.loginMethods.includes("telegram"),l=t.loginMethods.includes("passkey")):(r=e.emailAuth,n=e.smsAuth,s=e.walletAuth||e.solanaWalletAuth,o=e.googleOAuth,c=e.twitterOAuth,p=e.discordOAuth,h=e.githubOAuth,u=e.spotifyOAuth,E=e.instagramOAuth,d=e.tiktokOAuth,m=e.linkedinOAuth,_=e.appleOAuth,f=e.farcasterAuth,y=e.telegramAuth,l=e.passkeyAuth),e.passkeyAuth&&(l=!0),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential&&(l=!1);let g=[r,n].filter(Boolean),C=[o,c,p,h,u,E,d,m,_,f,y].filter(Boolean),b=[s].filter(Boolean),N=t?.loginMethods?.includes("passkey")??!1,S=e.passkeysForSignupEnabled??!1,T=[l&&(S||N)].filter(Boolean);if(g.length+C.length+b.length+T.length===0)throw Error("You must enable at least one login method");let v=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;v&&0===b.length?(A("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),v=!1):v||C.length+g.length!==0||(A("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),v=!0);let w=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&A("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let k=Oe({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),L=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],a=[];for(let a of(e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),e.primary.slice(1)))t.includes(a)?console.warn(`Duplicated login method: ${a}`):t.push(a);for(let i of e.overflow??[])t.includes(i)||a.includes(i)?console.warn(`Duplicated login method: ${i}`):a.push(i);return{primary:t,overflow:a}})({input:t?.loginMethodsAndOrder}),O=t?.intl?.defaultCountry??"US",{chains:R,defaultChain:I}=function({supportedChains:e,defaultChainFromConfig:t}){let a;if(e){if(0===e.length)throw Error("`supportedChains` must contain at least one chain");a=e.map((e=>{if(e.rpcUrls.privyWalletOverride)return e;let t=Ne.find((t=>t.id===e.id)),a=t?.rpcUrls.privy?.http[0];return a?De(e,a):e}))}else a=[...Ne];let i=e?a[0]:_e,r=t??i;if(!a.find((e=>e.id===r.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:a,defaultChain:r}}({supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain}),D=!!t?.defaultChain,W=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,M=t?.embeddedWallets?.requireUserPasswordOnCreate,U=t?.embeddedWallets?.createOnLogin,P=W?"all-users":e.embeddedWalletConfig.createOnLogin,x=t?.solanaClusters??[];return e.solanaWalletAuth&&!t?.externalWallets?.solana?.connectors&&console.warn("App configuration has Solana wallet login enabled, but no Solana wallet connectors have been passed to Privy. Make sure to pass Solana connectors to the `config.externalWallets.solana.connectors` field of the `PrivyProvider`"),{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??ve.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,footerLogo:t?.appearance?.footerLogo,palette:Ve({backgroundTheme:t?.appearance?.theme??ve.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??ve.appearance.accentColor}),loginGroupPriority:v?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:k,walletChainType:t?.appearance?.walletChainType??(({evmWalletAuth:e,solanaWalletAuth:t})=>e&&t?"ethereum-and-solana":e?"ethereum-only":t?"solana-only":"ethereum-only")({evmWalletAuth:e.walletAuth??!1,solanaWalletAuth:e.solanaWalletAuth??!1})},loginMethods:{wallet:s,email:r,sms:n,passkey:l,google:o,twitter:c,discord:p,github:h,spotify:u,instagram:E,tiktok:d,linkedin:m,apple:_,farcaster:f,telegram:y},disablePlusEmails:e.disablePlusEmails,loginMethodsAndOrder:L,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??ve.walletConnectCloudProjectId,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},chains:R,solanaClusters:{"mainnet-beta":x.find((e=>"mainnet-beta"===e.name))?.rpcUrl||"https://api.mainnet-beta.solana.com",testnet:x.find((e=>"testnet"===e.name))?.rpcUrl||"https://api.testnet.solana.com",devnet:x.find((e=>"devnet"===e.name))?.rpcUrl||"https://api.devnet.solana.com"},defaultChain:I,intl:{defaultCountry:O},shouldEnforceDefaultChainOnConnect:D,captchaEnabled:e.captchaEnabled??ve.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??ve.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:w},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{requireUserOwnedRecoveryOnCreate:M??(!W&&e.embeddedWalletConfig.requireUserOwnedRecoveryOnCreate),userOwnedRecoveryOptions:W?["user-passcode"]:e.embeddedWalletConfig.userOwnedRecoveryOptions,priceDisplay:t?.embeddedWallets?.priceDisplay??{primary:"fiat-currency",secondary:"native-token"},ethereum:{createOnLogin:U??t?.embeddedWallets?.ethereum?.createOnLogin??P},solana:{createOnLogin:t?.embeddedWallets?.solana?.createOnLogin??"off"},showWalletUIs:t?.embeddedWallets?.showWalletUIs??e.enforceWalletUis??!0,extendedCalldataDecoding:t?.embeddedWallets?.extendedCalldataDecoding??!1,transactionScanning:{enabled:t?.embeddedWallets?.transactionScanning?.enabled??!1,domain:t?.embeddedWallets?.transactionScanning?.domain??i??"https://auth.privy.io"}},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},passkeys:{shouldUnlinkOnUnenrollMfa:t?.passkeys?.shouldUnlinkOnUnenrollMfa,shouldUnenrollMfaOnUnlink:t?.passkeys?.shouldUnenrollMfaOnUnlink},customAuth:W?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration,passkeysForSignupEnabled:e.passkeysForSignupEnabled},headless:!!t?.headless,render:{standalone:t?._render?.standalone??ve._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??ve.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??ve.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??ve.fundingMethodConfig.moonpay.useSandbox}}}}let Ke={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,disablePlusEmails:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:"",enforceWalletUis:!1,legacyWalletUiConfig:!1};const Ye=je(Ke,void 0,!1);let ze=/*#__PURE__*/s({appConfig:Ye,isServerConfigLoaded:!1});const qe=({children:e,client:a,clientConfig:l})=>{let[s,o]=i(null),c=r((()=>je(s??Ke,l,!!s,"undefined"!=typeof window?window.location.origin:void 0)),[s,l]);return n((()=>{if(!s)return;let e=function(e){if(!e)return{};let{appearance:t,supportedChains:a,defaultChain:i,externalWallets:r,...n}=e;return{...n,...a?{supportedChains:a.map((e=>e.id))}:void 0,...i?{defaultChain:i.id}:void 0,...r?{walletConnect:r.walletConnect,coinbaseWallet:r.coinbaseWallet,solana:{connectors:r.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0}}(l),t=function(e,t=0){let a=3735928559^t,i=1103547991^t;for(let t,r=0;r<e.length;r++)a=Math.imul(a^(t=e.charCodeAt(r)),2654435761),i=Math.imul(i^t,1597334677);return a=Math.imul(a^a>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),4294967296*(2097151&(i=Math.imul(i^i>>>16,2246822507)^Math.imul(a^a>>>13,3266489909)))+(a>>>0)}(JSON.stringify(e)).toString(),i=`privy:sent:${s.id}:${t}`;localStorage.getItem(i)||(a.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(i,"t"))}),[l,s]),n((()=>{s||(async()=>{try{let e=await a.getServerConfig();e.customApiUrl&&a.updateApiUrl(e.customApiUrl),o(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),/*#__PURE__*/t(ze.Provider,{value:{appConfig:c,isServerConfigLoaded:!!s},children:e})},$e=()=>{let{appConfig:e}=l(ze);return e},Xe=()=>{let{isServerConfigLoaded:e}=l(ze);return e};var Ze,Je=((Ze={}).LANDING="LANDING",Ze.CONNECT_OR_CREATE="CONNECT_OR_CREATE",Ze.AWAITING_CONNECTION="AWAITING_CONNECTION",Ze.AWAITING_FARCASTER_CONNECTION="AWAITING_FARCASTER_CONNECTION",Ze.AWAITING_FARCASTER_SIGNER="AWAITING_FARCASTER_SIGNER",Ze.AWAITING_OAUTH_SCREEN="AWAITING_OAUTH_SCREEN",Ze.CROSS_APP_AUTH_SCREEN="CROSS_APP_AUTH_SCREEN",Ze.AWAITING_PASSWORDLESS_CODE="AWAITING_PASSWORDLESS_CODE",Ze.AWAITING_PASSKEY_SYSTEM_DIALOGUE="AWAITING_PASSKEY_SYSTEM_DIALOGUE",Ze.SELECT_PASSKEY_SIGNUP_OR_LOGIN="SELECT_PASSKEY_SIGNUP_OR_LOGIN",Ze.LINK_EMAIL_SCREEN="LINK_EMAIL_SCREEN",Ze.LINK_PHONE_SCREEN="LINK_PHONE_SCREEN",Ze.LINK_WALLET_SCREEN="LINK_WALLET_SCREEN",Ze.LINK_PASSKEY_SCREEN="LINK_PASSKEY_SCREEN",Ze.UPDATE_EMAIL_SCREEN="UPDATE_EMAIL_SCREEN",Ze.UPDATE_PHONE_SCREEN="UPDATE_PHONE_SCREEN",Ze.AWAITING_CONNECT_ONLY_CONNECTION="AWAITING_CONNECT_ONLY_CONNECTION",Ze.CONNECT_ONLY_LANDING_SCREEN="CONNECT_ONLY_LANDING_SCREEN",Ze.CONNECT_ONLY_AUTHENTICATED_SCREEN="CONNECT_ONLY_AUTHENTICATED_SCREEN",Ze.LOGIN_FAILED_SCREEN="LOGIN_FAILED_SCREEN",Ze.ALLOWLIST_REJECTION_SCREEN="ALLOWLIST_REJECTION_SCREEN",Ze.ACCOUNT_NOT_FOUND_SCREEN="ACCOUNT_NOT_FOUND_SCREEN",Ze.USER_LIMIT_REACHED_SCREEN="USER_LIMIT_REACHED_SCREEN",Ze.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN="EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN",Ze.EMBEDDED_WALLET_CREATED_SCREEN="EMBEDDED_WALLET_CREATED_SCREEN",Ze.EMBEDDED_WALLET_CONNECTING_SCREEN="EMBEDDED_WALLET_CONNECTING_SCREEN",Ze.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN="EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN",Ze.EMBEDDED_WALLET_KEY_EXPORT_SCREEN="EMBEDDED_WALLET_KEY_EXPORT_SCREEN",Ze.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",Ze.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN",Ze.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN="EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",Ze.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",Ze.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN="EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN",Ze.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN",Ze.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN",Ze.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN="EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN",Ze.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN="EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN",Ze.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN",Ze.EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN",Ze.INSTALL_WALLET_SCREEN="INSTALL_WALLET_SCREEN",Ze.WALLET_INTERSTITIAL_SCREEN="WALLET_INTERSTITIAL_SCREEN",Ze.AFFIRMATIVE_CONSENT_SCREEN="AFFIRMATIVE_CONSENT_SCREEN",Ze.FUNDING_METHOD_SELECTION_SCREEN="FUNDING_METHOD_SELECTION_SCREEN",Ze.FUNDING_TRANSFER_FROM_WALLET_SCREEN="FUNDING_TRANSFER_FROM_WALLET_SCREEN",Ze.FUNDING_EDIT_AMOUNT_SCREEN="FUNDING_EDIT_AMOUNT_SCREEN",Ze.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN",Ze.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN",Ze.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN="FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN",Ze.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN="FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN",Ze.FUNDING_MANUAL_TRANSFER_SCREEN="FUNDING_MANUAL_TRANSFER_SCREEN",Ze.MOONPAY_STATUS_SCREEN="MOONPAY_STATUS_SCREEN",Ze.COINBASE_ONRAMP_STATUS_SCREEN="COINBASE_ONRAMP_STATUS_SCREEN",Ze.MFA_ENROLLMENT_FLOW_SCREEN="MFA_ENROLLMENT_FLOW_SCREEN",Ze.CAPTCHA_SCREEN="CAPTCHA_SCREEN",Ze.ERROR_SCREEN="ERROR_SCREEN",Ze.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE="IN_APP_BROWSER_LOGIN_NOT_POSSIBLE",Ze.TELEGRAM_AUTH_SCREEN="TELEGRAM_AUTH_SCREEN",Ze.LINK_CONFLICT_SCREEN="LINK_CONFLICT_SCREEN",Ze);const Qe=/*#__PURE__*/s({ready:!1,app:Ye,currentScreen:null,lastScreen:null,navigate:p,navigateBack:p,resetNavigation:p,setModalData:p,onUserCloseViaDialogOrKeybindRef:void 0});let et=[Je.LANDING,Je.CONNECT_ONLY_LANDING_SCREEN,null];const tt=e=>{let r=$e(),l=e.authenticated,[s,c]=i(e.initialScreen);n((()=>{l||et.includes(e.initialScreen)||e.setInitialScreen(null)}),[l]);let p=o(null);n((()=>{e.open||(p.current=null)}),[e.open]),n((()=>{p.current=null}),[e.initialScreen]);let d={ready:!!r.id,app:r,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:s,navigate:(t,a=!0)=>{e.setInitialScreen(t),a&&c(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(s)},resetNavigation:()=>{e.setInitialScreen(null),c(null)},onUserCloseViaDialogOrKeybindRef:p};/*#__PURE__*/return a(Qe.Provider,{value:d,children:[("string"==typeof r.appearance.logo||"img"===r.appearance.logo?.type)&&/*#__PURE__*/t(Te,{src:"string"==typeof r.appearance.logo?r.appearance.logo:r.appearance.logo.props.src}),e.children]})},at=()=>l(Qe),it=/*#__PURE__*/s({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:p,login:p,connectOrCreateWallet:p,linkEmail:p,linkPhone:p,linkFarcaster:p,linkWallet:p,startCrossAppAuthFlow:p,linkGoogle:p,linkTwitter:p,linkDiscord:p,linkGithub:p,linkSpotify:p,linkInstagram:p,linkTelegram:p,linkTiktok:p,linkLinkedIn:p,linkApple:p,linkPasskey:p,updateEmail:p,updatePhone:p,logout:p,getAccessToken:p,unlinkEmail:p,unlinkPhone:p,unlinkWallet:p,unlinkGoogle:p,unlinkTwitter:p,unlinkDiscord:p,unlinkGithub:p,unlinkSpotify:p,unlinkInstagram:p,unlinkTiktok:p,unlinkLinkedIn:p,unlinkApple:p,unlinkCrossAppAccount:p,unlinkFarcaster:p,unlinkTelegram:p,unlinkPasskey:p,createWallet:p,signMessage:p,signTypedData:p,enrollInMfa:p,initEnrollmentWithSms:p,initEnrollmentWithTotp:p,initEnrollmentWithPasskey:p,promptMfa:p,init:p,submitEnrollmentWithSms:p,submitEnrollmentWithTotp:p,submitEnrollmentWithPasskey:p,unenroll:p,submit:p,cancel:p,sendTransaction:p,signTransaction:p,exportWallet:p,setWalletPassword:p,setWalletRecovery:p,requestFarcasterSignerFromWarpcast:p,getFarcasterSignerPublicKey:p,signFarcasterMessage:p,createGuestAccount:p,signMessageWithCrossAppWallet:p,signTypedDataWithCrossAppWallet:p,sendTransactionWithCrossAppWallet:p,isModalOpen:!1,mfaMethods:[]}),rt=()=>l(it),nt=/*#__PURE__*/s(null);function lt(){let e=l(nt);return null===e?(console.warn("`useWallets` was called outside the PrivyProvider component"),{wallets:[],ready:!1}):e}export{ee as $,U as A,Pe as B,L as C,Se as D,lt as E,We as F,Me as G,O as H,b as I,h as J,Ge as K,Ue as L,Je as M,_e as N,R as O,C as P,ue as Q,A as R,k as S,fe as T,Ae as U,_ as V,x as W,oe as X,it as Y,Fe as Z,xe as _,M as a,le as a0,qe as a1,Xe as a2,X as a3,z as a4,Q as a5,q as a6,ne as a7,nt as a8,tt as a9,J as aa,re as ab,Ne as ac,Re as ad,De as ae,I as af,P as ag,pe as ah,me as ai,he as aj,be as ak,G as al,F as am,B as an,H as ao,Ce as ap,ye as aq,ge as ar,Ee as as,de as at,ce as au,D as b,ie as c,W as d,f as e,w as f,v as g,S as h,V as i,se as j,y as k,g as l,N as m,d as n,u as o,T as p,$e as q,rt as r,E as s,m as t,at as u,te as v,Y as w,Z as x,ae as y,Ie as z};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@privy-io/react-auth",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.6-beta-20250225233939",
|
|
4
4
|
"description": "React client for the Privy Auth API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"authentication",
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"@heroicons/react": "^2.1.1",
|
|
137
137
|
"@marsidev/react-turnstile": "^0.4.1",
|
|
138
138
|
"@metamask/eth-sig-util": "^6.0.0",
|
|
139
|
-
"@privy-io/js-sdk-core": "0.44.
|
|
139
|
+
"@privy-io/js-sdk-core": "0.44.3-beta-20250225233939",
|
|
140
140
|
"@simplewebauthn/browser": "^9.0.1",
|
|
141
141
|
"@solana/wallet-adapter-base": "^0.9.23",
|
|
142
142
|
"@solana/wallet-standard-wallet-adapter-base": "^1.1.2",
|
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
"@jest/globals": "^29.7.0",
|
|
176
176
|
"@privy-io/build-config": "*",
|
|
177
177
|
"@privy-io/eslint-config-custom": "*",
|
|
178
|
-
"@privy-io/public-api": "2.18.
|
|
178
|
+
"@privy-io/public-api": "2.18.10-beta-20250225233939",
|
|
179
179
|
"@privy-io/testing": "*",
|
|
180
180
|
"@rollup/plugin-commonjs": "^26.0.1",
|
|
181
181
|
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.acceptTermsPath="/api/v1/users/me/accept_terms",exports.analyticsEventsPath="/api/v1/analytics_events",exports.authenticateFarcasterV2Path="api/v2/farcaster/authenticate",exports.coinbaseOnRampInitPath="/api/v1/funding/coinbase_on_ramp/init",exports.coinbaseOnRampStatusPath="/api/v1/funding/coinbase_on_ramp/status",exports.customJwtAccountAuthenticatePath="/api/v1/custom_jwt_account/authenticate",exports.delegatedActionsRevokePath="/api/v1/wallets/revoke",exports.farcasterAuthenticatePath="/api/v1/farcaster/authenticate",exports.farcasterInitPath="/api/v1/farcaster/init",exports.farcasterLinkPath="/api/v1/farcaster/link",exports.farcasterStatusPath="/api/v1/farcaster/status",exports.forkSessionPath="/api/v1/sessions/fork",exports.guestAccountAuthenticatePath="/api/v1/guest/authenticate",exports.initFarcasterV2Path="api/v2/farcaster/init",exports.mfaPasskeyInitPath="/api/v1/mfa/passkeys/init",exports.mfaPasswordlessSmsInitPath="/api/v1/mfa/passwordless_sms/init",exports.moonpayPluginOnRampPath="/api/v1/plugins/moonpay_on_ramp/sign",exports.oAuthAuthenticatePath="/api/v1/oauth/authenticate",exports.oAuthInitPath="/api/v1/oauth/init",exports.oAuthLinkPath="/api/v1/oauth/link",exports.passkeyAuthenticatePath="/api/v1/passkeys/authenticate",exports.passkeyInitAuthenticatePath="/api/v1/passkeys/authenticate/init",exports.passkeyInitLinkPath="/api/v1/passkeys/link/init",exports.passkeyInitRegisterPath="/api/v1/passkeys/register/init",exports.passkeyLinkPath="/api/v1/passkeys/link",exports.passkeyRegisterPath="/api/v1/passkeys/register",exports.passwordlessAuthenticatePath="/api/v1/passwordless/authenticate",exports.passwordlessInitPath="/api/v1/passwordless/init",exports.passwordlessLinkPath="/api/v1/passwordless/link",exports.passwordlessSmsAuthenticatePath="/api/v1/passwordless_sms/authenticate",exports.passwordlessSmsInitPath="/api/v1/passwordless_sms/init",exports.passwordlessSmsLinkPath="/api/v1/passwordless_sms/link",exports.recoverForkedSessionsPath="/api/v1/sessions/fork/recover",exports.recoveryOAuthAuthenticatePath="/api/v1/recovery/oauth/authenticate",exports.recoveryOAuthInitICloudPath="/api/v1/recovery/oauth/init_icloud",exports.recoveryOAuthInitPath="/api/v1/recovery/oauth/init",exports.sessionsLogoutPath="/api/v1/sessions/logout",exports.sessionsRefreshPath="/api/v1/sessions",exports.siweAuthenticatePath="/api/v1/siwe/authenticate",exports.siweInitPath="/api/v1/siwe/init",exports.siweLinkPath="/api/v1/siwe/link",exports.siwsAuthenticatePath="/api/v1/siws/authenticate",exports.siwsInitPath="/api/v1/siws/init",exports.siwsLinkPath="/api/v1/siws/link",exports.siwsUnlinkWalletPath="/api/v1/siws/unlink",exports.smartWalletLinkPath="/api/v1/siwe/link_smart_wallet",exports.telegramAccountAuthenticatePath="/api/v1/telegram/authenticate",exports.telegramAccountLinkPath="/api/v1/telegram/link",exports.telegramAccountTransferPath="/api/v1/telegram/transfer",exports.telegramAccountUnlinkPath="/api/v1/telegram/unlink",exports.transactionScanningPath="/api/v1/scan/transaction",exports.transferEmailPath="/api/v1/passwordless/transfer",exports.transferFarcasterPath="/api/v1/farcaster/transfer",exports.transferOAuthPath="/api/v1/oauth/transfer",exports.transferPhonePath="/api/v1/passwordless_sms/transfer",exports.transferWalletPath="/api/v1/siwe/transfer",exports.unlinkEmailPath="/api/v1/passwordless/unlink",exports.unlinkFarcasterPath="/api/v1/farcaster/unlink",exports.unlinkOAuthPath="/api/v1/oauth/unlink",exports.unlinkPhonePath="/api/v1/passwordless_sms/unlink",exports.unlinkWalletPath="/api/v1/siwe/unlink",exports.updateEmailPath="/api/v1/passwordless/update",exports.updatePhonePath="/api/v1/passwordless_sms/update",exports.usersMePath="/api/v1/users/me";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("react"),t=require("viem"),r=require("./useWallets-C7Zst89H.js"),n=require("./internal-context-BFE-DjTn.js"),a=require("./getPublicClient-BjV7zj03.js"),i=require("./getEmbeddedConnectedWallet-DTU4T9TJ.js"),s=require("permissionless"),o=require("permissionless/accounts"),l=require("permissionless/clients/pimlico"),c=require("viem/account-abstraction"),d=require("@privy-io/js-sdk-core");let u={address:c.entryPoint06Address,version:"0.6"},p={address:c.entryPoint07Address,version:"0.7"},y=({owner:e,smartWalletType:t,publicClient:r})=>{switch(t){case d.SAFE:return o.toSafeSmartAccount({client:r,entryPoint:p,owners:[e],version:"1.4.1"});case d.KERNEL:return o.toEcdsaKernelSmartAccount({client:r,version:"0.3.1",entryPoint:p,owners:[e]});case d.BICONOMY:return o.toBiconomySmartAccount({client:r,owners:[e],entryPoint:u});case d.LIGHT_ACCOUNT:return o.toLightSmartAccount({client:r,entryPoint:u,owner:e,version:"1.1.0"});case d.COINBASE_SMART_WALLET:return async function({client:e,owner:t}){let[r]=await t.request({method:"eth_accounts"});if(!r)throw Error("Unable to request embedded owner for eth_accounts");return await c.toCoinbaseSmartAccount({client:e,owners:[{type:"local",source:"privy",address:r,sign:async({hash:e})=>await t.request({method:"secp256k1_sign",params:[e]})}]})}({client:r,owner:e});case d.THIRDWEB:return o.toThirdwebSmartAccount({client:r,entryPoint:p,owner:e});default:throw Error(`Invalid smart account type: ${t}.`)}},m=["rpc.zerodev.app","public.pimlico.io","api.pimlico.io"];const E=({calls:e,chain:t,maxPriorityFeePerGas:r,maxFeePerGas:n,nonce:a})=>e.map((e=>({to:e.to||void 0,data:e.data,value:e.value,chainId:t.id,nonce:a,maxFeePerGas:n,maxPriorityFeePerGas:r}))),g=async({chain:e,paymasterContext:r,embeddedWallet:i,user:o,smartWalletsConfig:c,rpcConfig:d,privyAppId:u})=>{if(!c?.enabled||!o||!i)return;let p=await i.getEthereumProvider(),E=c?.configuredNetworks.find((t=>t.chainId===`eip155:${e.id}`));if(!E)throw new n.PrivyClientError(`The chain ${e.name} (eip155:${e.id}) must be configured in the smart wallet configuration in your dashboard`);let g=o.smartWallet?.smartWalletType??c.smartWalletType,C=a.getJsonRpcEndpointFromChain(e,d,u),I=t.createPublicClient({chain:e,transport:t.http(C)}),f=r??E.paymasterContext,h=await(async({owner:e,smartWalletType:r,chain:n,publicClient:a,bundlerUrl:i,paymasterUrl:o,paymasterContext:c})=>{let d=await y({owner:e,smartWalletType:r,publicClient:a}),u=l.createPimlicoClient({transport:t.http(i),entryPoint:d.entryPoint}),p=o?l.createPimlicoClient({transport:t.http(o),entryPoint:d.entryPoint}):void 0;return s.createSmartAccountClient({account:d,chain:n,paymaster:p,paymasterContext:c,bundlerTransport:t.http(i),userOperation:{estimateFeesPerGas:async()=>{if(m.some((e=>i.includes(e))))return await u.getUserOperationGasPrice().then((e=>e.fast));{let e=await a.estimateFeesPerGas(),t=i.includes("api.developer.coinbase.com")?175n:150n;return{...e,maxFeePerGas:e.maxFeePerGas*t/100n,maxPriorityFeePerGas:e.maxPriorityFeePerGas*t/100n}}}}})})({owner:p,smartWalletType:g,chain:e,publicClient:I,paymasterContext:f,...E});if(!h)throw new n.PrivyClientError(`Failed to create smart wallet client for chain ${e.name} (eip155:${e.id})`);return h};exports.callsToTransactionRequests=E,exports.getSmartWalletClient=g,exports.useSmartWalletsUIWrapper=()=>{let{hideWalletUIs:e,openPrivyModal:t}=n.usePrivyInternal(),a=r.useAppConfig(),{setModalData:i}=r.usePrivyModal(),{user:s}=r.usePrivyContext();return{wrapSmartAccountClientWithUIs:n=>({...n,sendTransaction:async(o,l)=>{if(!a.embeddedWallets.showWalletUIs)return e.current=!0,await n.sendTransaction(o).finally((()=>e.current=!1));let c=[];"calls"in o&&void 0!==o.calls?c=[...o.calls]:"to"in o&&(c=[{to:o.to,value:o.value||BigInt(0),data:o.data||"0x"}]);let d=async()=>{if(!n.paymaster)return!1;let{paymasterAndData:e,paymasterData:t}=await n.prepareUserOperation({calls:c,maxFeePerGas:o.maxFeePerGas,maxPriorityFeePerGas:o.maxPriorityFeePerGas,nonce:o.nonce?BigInt(o.nonce):void 0});return Number(e??t??0)>0};return new Promise((async(a,u)=>{e.current=!0;let{entropyId:p,entropyIdVerifier:y}=r.getEntropyDetailsFromUser(s);i({connectWallet:{entropyId:p,entropyIdVerifier:y,onCompleteNavigateTo:r.ModalScreen.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:E({calls:c,chain:n.chain,maxPriorityFeePerGas:o.maxPriorityFeePerGas,maxFeePerGas:o.maxFeePerGas,nonce:o.nonce?BigInt(o.nonce):void 0}),entropyId:p,entropyIdVerifier:y,transactingWallet:{address:n.account.address,walletIndex:null},getIsSponsored:d,signOnly:!1,onConfirm:()=>n.sendTransaction(o),onSuccess:e=>a(e.hash),onFailure:u,uiOptions:l?.uiOptions??{}}}),t(r.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{e.current=!1}))},signMessage:async(o,l)=>a.embeddedWallets.showWalletUIs?new Promise((async(a,c)=>{let{entropyId:d,entropyIdVerifier:u}=r.getEntropyDetailsFromUser(s);e.current=!0,i({connectWallet:{entropyId:d,entropyIdVerifier:u,onCompleteNavigateTo:r.ModalScreen.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"personal_sign",data:"string"==typeof o.message?o.message:o.message.raw.toString(),confirmAndSign:()=>n.signMessage(o),onSuccess:e=>a(e),onFailure:c,uiOptions:l?.uiOptions??{}}}),t(r.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{e.current=!1})):(e.current=!0,await n.signMessage(o).finally((()=>e.current=!1))),signTypedData:async(o,l)=>a.embeddedWallets.showWalletUIs?new Promise((async(a,c)=>{e.current=!0;let{entropyId:d,entropyIdVerifier:u}=r.getEntropyDetailsFromUser(s);i({connectWallet:{entropyId:d,entropyIdVerifier:u,onCompleteNavigateTo:r.ModalScreen.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:o,confirmAndSign:()=>n.signTypedData(o),onSuccess:e=>a(e),onFailure:c,uiOptions:l?.uiOptions??{}}}),t(r.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{e.current=!1})):(e.current=!0,await n.signTypedData(o).finally((()=>e.current=!1)))})}},exports.useSmartWalletsWrapper=({clientConfig:t,smartWalletsConfig:a})=>{let{hideWalletUIs:s,openPrivyModal:o,appId:l}=n.usePrivyInternal(),c=r.useAppConfig(),{setModalData:d}=r.usePrivyModal(),{user:u}=r.usePrivyContext(),{chains:p}=r.useAppConfig(),{chainId:y,clients:m,setChainId:C,chainIdState:I}=(()=>{let t=e.useRef(),[r,n]=e.useState();return{clients:e.useRef({}),setChainId:e=>{t.current=e,n(e)},chainId:t,chainIdState:r}})(),f=p.find((e=>e.id===I)),{wallets:h}=r.useWallets(),P=e.useCallback((async()=>y.current),[y]),S=e.useCallback((async({id:e})=>{if(!m.current[e]){let r=i.getEmbeddedConnectedWallet(h),n=await g({chain:p.find((t=>t.id===e)),embeddedWallet:r,user:u,paymasterContext:t?.paymasterContext,smartWalletsConfig:a,rpcConfig:c.rpcConfig,privyAppId:l});n&&(m.current[e]=n)}C(e)}),[p,t,h,u,a]);return{wrapSmartAccountClient:e=>{m.current[e.chain.id]=e,I||C(e.chain.id);return{...e,sendTransaction:async(e,t)=>{let a=m.current[y.current];if(!a)throw new n.PrivyClientError(`Smart wallet client for chain (eip155:${y.current}) not found`);if(delete e.account,!c.embeddedWallets.showWalletUIs)return s.current=!0,await a.sendTransaction(e).finally((()=>s.current=!1));let i=[];"calls"in e&&void 0!==e.calls?i=[...e.calls]:"to"in e&&(i=[{to:e.to,value:e.value||BigInt(0),data:e.data||"0x"}]);let l=async()=>{if(!a.paymaster)return!1;let{paymasterAndData:t,paymasterData:r}=await a.prepareUserOperation({calls:i,maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0});return Number(t??r??0)>0};return new Promise((async(n,c)=>{s.current=!0;let{entropyId:p,entropyIdVerifier:y}=r.getEntropyDetailsFromUser(u);d({connectWallet:{entropyId:p,entropyIdVerifier:y,onCompleteNavigateTo:r.ModalScreen.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:E({calls:i,chain:a.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:p,entropyIdVerifier:y,transactingWallet:{address:a.account.address,walletIndex:null},getIsSponsored:l,signOnly:!1,onConfirm:()=>a.sendTransaction(e),onSuccess:e=>n(e.hash),onFailure:c,uiOptions:t?.uiOptions??{}}}),o(r.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{s.current=!1}))},signMessage:async(e,t)=>{let a=m.current[y.current];if(!a)throw new n.PrivyClientError(`Smart wallet client for chain (eip155:${y.current}) not found`);return c.embeddedWallets.showWalletUIs?new Promise((async(n,i)=>{let{entropyId:l,entropyIdVerifier:c}=r.getEntropyDetailsFromUser(u);s.current=!0,d({connectWallet:{entropyId:l,entropyIdVerifier:c,onCompleteNavigateTo:r.ModalScreen.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"personal_sign",data:"string"==typeof e.message?e.message:e.message.raw.toString(),confirmAndSign:()=>a.signMessage(e),onSuccess:e=>n(e),onFailure:i,uiOptions:t?.uiOptions??{}}}),o(r.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{s.current=!1})):(s.current=!0,await a.signMessage(e).finally((()=>s.current=!1)))},signTypedData:async(e,t)=>{let a=m.current[y.current];if(!a)throw new n.PrivyClientError(`Smart wallet client for chain (eip155:${y.current}) not found`);return delete e.account,c.embeddedWallets.showWalletUIs?new Promise((async(n,i)=>{s.current=!0;let{entropyId:l,entropyIdVerifier:c}=r.getEntropyDetailsFromUser(u);d({connectWallet:{entropyId:l,entropyIdVerifier:c,onCompleteNavigateTo:r.ModalScreen.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>a.signTypedData(e),onSuccess:e=>n(e),onFailure:i,uiOptions:t?.uiOptions??{}}}),o(r.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{s.current=!1})):(s.current=!0,await a.signTypedData(e).finally((()=>s.current=!1)))},getChainId:P,chain:f,switchChain:S}}}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("viem/utils"),t=require("react/jsx-runtime"),a=require("react"),n=require("tinycolor2"),r=require("./internal-context-BFE-DjTn.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=/*#__PURE__*/l(n);function o(e){return e?new Date(1e3*e):null}function s(e,t){return e.slice().sort(((e,t)=>(e.firstVerifiedAt??e.verifiedAt).getTime()-(t.firstVerifiedAt??t.verifiedAt).getTime())).find((e=>e.type===t))}const p=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"ethereum"===e.chainType&&0===e.walletIndex))||null,c=e=>(e?.linkedAccounts??[]).filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"ethereum"===e.chainType)),d=(e,t)=>(e?.linkedAccounts??[]).filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.chainType===t)),u=e=>(e?.linkedAccounts??[]).filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"solana"===e.chainType)),m=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"solana"===e.chainType&&0===e.walletIndex))||null,E=e=>p(e)??m(e),_=e=>{if("ethereum"===e.chainType)return{entropyId:e.address,entropyIdVerifier:"ethereum-address-verifier"};if("solana"===e.chainType)return{entropyId:e.address,entropyIdVerifier:"solana-address-verifier"};throw Error("Failed to get account entropy details")};const h={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"}}},f={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},A={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"}}},y={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},S={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"}}},g={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},C={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},N={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},T={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"}}},b={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"}}},I={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},v={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"}}},O={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},R={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},L={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"}}},w=[h,f,R,T,b,I,v,O,C,{id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0},{id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}},{id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}},S,g,{id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0},{id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}},N,{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},A,y,L,{id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0},{id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},{id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}},{id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}},{id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}}],k=new Set(w.map((e=>e.id)));function D({src:e,...a}){/*#__PURE__*/return t.jsx("img",{src:e,...a,style:{display:"none"}})}const x={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",externalWallets:{coinbaseWallet:{connectionOptions:"all"}},embeddedWallets:{extendedCalldataDecoding:!1},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let W=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","ronin_wallet","wallet_connect","detected_wallets","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe","solflare","backpack"]),U=e=>W.has(e),M=(e,t,a)=>a.indexOf(e)===t;const P=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(U).filter(M):e?e.filter(U).filter(M):x.appearance.walletList;function F(e,t){return{...e,rpcUrls:{...e.rpcUrls,privy:{http:[t]}}}}let G="#FFFFFF";function H(e,t){let a=Math.max(0,Math.min(1,e.toHsl().l+t));return i.default({...e.toHsl(),l:a})}function K({backgroundTheme:e,accentHex:t}){let a;switch(e){case"light":a=G;break;case"dark":a="#1E1E1D";break;default:a=e}let n=i.default(a),r=i.default(t),l=i.default("#51BA81"),o=i.default("#FFB74D"),s=i.default("#EC6351"),p=function(e){return e<.8&&e>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),e>.5?"light":"dark"}(n.getLuminance()),c=H(n,"light"===p?-.04:.11),d=H(n,"light"===p?-.08:.16),u=H(n,"light"===p?-.88:.87),m=H(n,"light"===p?-.7:.75),E=H(n,"light"===p?-.43:.45).desaturate("light"===p?60:20),_=H(n,"light"===p?-.08:.25).desaturate("light"===p?60:20),h=H(r,.15),f=H(r,.25),A=H(r,-.06),y=H(r,-.6),S=H(s,.3),g=H(o,.3),C=i.default(r.getLuminance()>.5?"#040217":G),N=H(l,-.16),T=H(l,.4);return{colorScheme:p,background:n.toHslString(),background2:c.toHslString(),background3:d.toHslString(),foreground:u.toHslString(),foreground2:m.toHslString(),foreground3:E.toHslString(),foreground4:_.toHslString(),accent:r.toHslString(),accentLight:h.toHslString(),accentLightest:f.toHslString(),accentDark:A.toHslString(),accentDarkest:y.toHslString(),foregroundAccent:C.toHslString(),success:l.toHslString(),successDark:N.toHslString(),successLight:T.toHslString(),error:s.toHslString(),errorLight:S.toHslString(),warn:o.toHslString(),warnLight:g.toHslString()}}function B(e,t,a,n){let r,l,i,o,s,p,c,d,u,m,E,_,h,f,A,y=a?console.warn:()=>{};t?.loginMethods?(r=t.loginMethods.includes("email"),l=t.loginMethods.includes("sms"),o=t.loginMethods.includes("wallet"),s=t.loginMethods.includes("google"),p=t.loginMethods.includes("twitter"),c=t.loginMethods.includes("discord"),u=t.loginMethods.includes("spotify"),m=t.loginMethods.includes("instagram"),d=t.loginMethods.includes("tiktok"),_=t.loginMethods.includes("github"),E=t.loginMethods.includes("linkedin"),h=t.loginMethods.includes("apple"),f=t.loginMethods.includes("farcaster"),A=t.loginMethods.includes("telegram"),i=t.loginMethods.includes("passkey")):(r=e.emailAuth,l=e.smsAuth,o=e.walletAuth||e.solanaWalletAuth,s=e.googleOAuth,p=e.twitterOAuth,c=e.discordOAuth,_=e.githubOAuth,u=e.spotifyOAuth,m=e.instagramOAuth,d=e.tiktokOAuth,E=e.linkedinOAuth,h=e.appleOAuth,f=e.farcasterAuth,A=e.telegramAuth,i=e.passkeyAuth),e.passkeyAuth&&(i=!0),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential&&(i=!1);let S=[r,l].filter(Boolean),g=[s,p,c,_,u,m,d,E,h,f,A].filter(Boolean),C=[o].filter(Boolean),N=t?.loginMethods?.includes("passkey")??!1,b=e.passkeysForSignupEnabled??!1,I=[i&&(b||N)].filter(Boolean);if(S.length+g.length+C.length+I.length===0)throw Error("You must enable at least one login method");let v=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;v&&0===C.length?(y("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),v=!1):v||g.length+S.length!==0||(y("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),v=!0);let O=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&y("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let R=P({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),L=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],a=[];for(let a of(e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),e.primary.slice(1)))t.includes(a)?console.warn(`Duplicated login method: ${a}`):t.push(a);for(let n of e.overflow??[])t.includes(n)||a.includes(n)?console.warn(`Duplicated login method: ${n}`):a.push(n);return{primary:t,overflow:a}})({input:t?.loginMethodsAndOrder}),k=t?.intl?.defaultCountry??"US",{chains:D,defaultChain:W}=function({supportedChains:e,defaultChainFromConfig:t}){let a;if(e){if(0===e.length)throw Error("`supportedChains` must contain at least one chain");a=e.map((e=>{if(e.rpcUrls.privyWalletOverride)return e;let t=w.find((t=>t.id===e.id)),a=t?.rpcUrls.privy?.http[0];return a?F(e,a):e}))}else a=[...w];let n=e?a[0]:T,r=t??n;if(!a.find((e=>e.id===r.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:a,defaultChain:r}}({supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain}),U=!!t?.defaultChain,M=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,G=t?.embeddedWallets?.requireUserPasswordOnCreate,H=t?.embeddedWallets?.createOnLogin,B=M?"all-users":e.embeddedWalletConfig.createOnLogin,j=t?.solanaClusters??[];return e.solanaWalletAuth&&!t?.externalWallets?.solana?.connectors&&console.warn("App configuration has Solana wallet login enabled, but no Solana wallet connectors have been passed to Privy. Make sure to pass Solana connectors to the `config.externalWallets.solana.connectors` field of the `PrivyProvider`"),{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??x.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,footerLogo:t?.appearance?.footerLogo,palette:K({backgroundTheme:t?.appearance?.theme??x.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??x.appearance.accentColor}),loginGroupPriority:v?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:R,walletChainType:t?.appearance?.walletChainType??(({evmWalletAuth:e,solanaWalletAuth:t})=>e&&t?"ethereum-and-solana":e?"ethereum-only":t?"solana-only":"ethereum-only")({evmWalletAuth:e.walletAuth??!1,solanaWalletAuth:e.solanaWalletAuth??!1})},loginMethods:{wallet:o,email:r,sms:l,passkey:i,google:s,twitter:p,discord:c,github:_,spotify:u,instagram:m,tiktok:d,linkedin:E,apple:h,farcaster:f,telegram:A},disablePlusEmails:e.disablePlusEmails,loginMethodsAndOrder:L,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??x.walletConnectCloudProjectId,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},chains:D,solanaClusters:{"mainnet-beta":j.find((e=>"mainnet-beta"===e.name))?.rpcUrl||"https://api.mainnet-beta.solana.com",testnet:j.find((e=>"testnet"===e.name))?.rpcUrl||"https://api.testnet.solana.com",devnet:j.find((e=>"devnet"===e.name))?.rpcUrl||"https://api.devnet.solana.com"},defaultChain:W,intl:{defaultCountry:k},shouldEnforceDefaultChainOnConnect:U,captchaEnabled:e.captchaEnabled??x.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??x.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:O},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{requireUserOwnedRecoveryOnCreate:G??(!M&&e.embeddedWalletConfig.requireUserOwnedRecoveryOnCreate),userOwnedRecoveryOptions:M?["user-passcode"]:e.embeddedWalletConfig.userOwnedRecoveryOptions,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},ethereum:{createOnLogin:H??t?.embeddedWallets?.ethereum?.createOnLogin??B},solana:{createOnLogin:t?.embeddedWallets?.solana?.createOnLogin??"off"},showWalletUIs:t?.embeddedWallets?.showWalletUIs??e.enforceWalletUis??!0,extendedCalldataDecoding:t?.embeddedWallets?.extendedCalldataDecoding??!1,transactionScanning:{enabled:t?.embeddedWallets?.transactionScanning?.enabled??!1,domain:t?.embeddedWallets?.transactionScanning?.domain??n??"https://auth.privy.io"}},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},passkeys:{shouldUnlinkOnUnenrollMfa:t?.passkeys?.shouldUnlinkOnUnenrollMfa,shouldUnenrollMfaOnUnlink:t?.passkeys?.shouldUnenrollMfaOnUnlink},customAuth:M?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration,passkeysForSignupEnabled:e.passkeysForSignupEnabled},headless:!!t?.headless,render:{standalone:t?._render?.standalone??x._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??x.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??x.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??x.fundingMethodConfig.moonpay.useSandbox}}}}let j={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,disablePlusEmails:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:"",enforceWalletUis:!1,legacyWalletUiConfig:!1};const V=B(j,void 0,!1);let Y=/*#__PURE__*/a.createContext({appConfig:V,isServerConfigLoaded:!1});const z=()=>{let{appConfig:e}=a.useContext(Y);return e};var q,X=((q={}).LANDING="LANDING",q.CONNECT_OR_CREATE="CONNECT_OR_CREATE",q.AWAITING_CONNECTION="AWAITING_CONNECTION",q.AWAITING_FARCASTER_CONNECTION="AWAITING_FARCASTER_CONNECTION",q.AWAITING_FARCASTER_SIGNER="AWAITING_FARCASTER_SIGNER",q.AWAITING_OAUTH_SCREEN="AWAITING_OAUTH_SCREEN",q.CROSS_APP_AUTH_SCREEN="CROSS_APP_AUTH_SCREEN",q.AWAITING_PASSWORDLESS_CODE="AWAITING_PASSWORDLESS_CODE",q.AWAITING_PASSKEY_SYSTEM_DIALOGUE="AWAITING_PASSKEY_SYSTEM_DIALOGUE",q.SELECT_PASSKEY_SIGNUP_OR_LOGIN="SELECT_PASSKEY_SIGNUP_OR_LOGIN",q.LINK_EMAIL_SCREEN="LINK_EMAIL_SCREEN",q.LINK_PHONE_SCREEN="LINK_PHONE_SCREEN",q.LINK_WALLET_SCREEN="LINK_WALLET_SCREEN",q.LINK_PASSKEY_SCREEN="LINK_PASSKEY_SCREEN",q.UPDATE_EMAIL_SCREEN="UPDATE_EMAIL_SCREEN",q.UPDATE_PHONE_SCREEN="UPDATE_PHONE_SCREEN",q.AWAITING_CONNECT_ONLY_CONNECTION="AWAITING_CONNECT_ONLY_CONNECTION",q.CONNECT_ONLY_LANDING_SCREEN="CONNECT_ONLY_LANDING_SCREEN",q.CONNECT_ONLY_AUTHENTICATED_SCREEN="CONNECT_ONLY_AUTHENTICATED_SCREEN",q.LOGIN_FAILED_SCREEN="LOGIN_FAILED_SCREEN",q.ALLOWLIST_REJECTION_SCREEN="ALLOWLIST_REJECTION_SCREEN",q.ACCOUNT_NOT_FOUND_SCREEN="ACCOUNT_NOT_FOUND_SCREEN",q.USER_LIMIT_REACHED_SCREEN="USER_LIMIT_REACHED_SCREEN",q.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN="EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN",q.EMBEDDED_WALLET_CREATED_SCREEN="EMBEDDED_WALLET_CREATED_SCREEN",q.EMBEDDED_WALLET_CONNECTING_SCREEN="EMBEDDED_WALLET_CONNECTING_SCREEN",q.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN="EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN",q.EMBEDDED_WALLET_KEY_EXPORT_SCREEN="EMBEDDED_WALLET_KEY_EXPORT_SCREEN",q.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",q.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN",q.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN="EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",q.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",q.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN="EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN",q.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN",q.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN",q.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN="EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN",q.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN="EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN",q.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN",q.EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN",q.INSTALL_WALLET_SCREEN="INSTALL_WALLET_SCREEN",q.WALLET_INTERSTITIAL_SCREEN="WALLET_INTERSTITIAL_SCREEN",q.AFFIRMATIVE_CONSENT_SCREEN="AFFIRMATIVE_CONSENT_SCREEN",q.FUNDING_METHOD_SELECTION_SCREEN="FUNDING_METHOD_SELECTION_SCREEN",q.FUNDING_TRANSFER_FROM_WALLET_SCREEN="FUNDING_TRANSFER_FROM_WALLET_SCREEN",q.FUNDING_EDIT_AMOUNT_SCREEN="FUNDING_EDIT_AMOUNT_SCREEN",q.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN",q.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN",q.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN="FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN",q.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN="FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN",q.FUNDING_MANUAL_TRANSFER_SCREEN="FUNDING_MANUAL_TRANSFER_SCREEN",q.MOONPAY_STATUS_SCREEN="MOONPAY_STATUS_SCREEN",q.COINBASE_ONRAMP_STATUS_SCREEN="COINBASE_ONRAMP_STATUS_SCREEN",q.MFA_ENROLLMENT_FLOW_SCREEN="MFA_ENROLLMENT_FLOW_SCREEN",q.CAPTCHA_SCREEN="CAPTCHA_SCREEN",q.ERROR_SCREEN="ERROR_SCREEN",q.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE="IN_APP_BROWSER_LOGIN_NOT_POSSIBLE",q.TELEGRAM_AUTH_SCREEN="TELEGRAM_AUTH_SCREEN",q.LINK_CONFLICT_SCREEN="LINK_CONFLICT_SCREEN",q);const $=/*#__PURE__*/a.createContext({ready:!1,app:V,currentScreen:null,lastScreen:null,navigate:r.notImplemented,navigateBack:r.notImplemented,resetNavigation:r.notImplemented,setModalData:r.notImplemented,onUserCloseViaDialogOrKeybindRef:void 0});let Z=[X.LANDING,X.CONNECT_ONLY_LANDING_SCREEN,null];const J=/*#__PURE__*/a.createContext({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:r.notImplemented,login:r.notImplemented,connectOrCreateWallet:r.notImplemented,linkEmail:r.notImplemented,linkPhone:r.notImplemented,linkFarcaster:r.notImplemented,linkWallet:r.notImplemented,startCrossAppAuthFlow:r.notImplemented,linkGoogle:r.notImplemented,linkTwitter:r.notImplemented,linkDiscord:r.notImplemented,linkGithub:r.notImplemented,linkSpotify:r.notImplemented,linkInstagram:r.notImplemented,linkTelegram:r.notImplemented,linkTiktok:r.notImplemented,linkLinkedIn:r.notImplemented,linkApple:r.notImplemented,linkPasskey:r.notImplemented,updateEmail:r.notImplemented,updatePhone:r.notImplemented,logout:r.notImplemented,getAccessToken:r.notImplemented,unlinkEmail:r.notImplemented,unlinkPhone:r.notImplemented,unlinkWallet:r.notImplemented,unlinkGoogle:r.notImplemented,unlinkTwitter:r.notImplemented,unlinkDiscord:r.notImplemented,unlinkGithub:r.notImplemented,unlinkSpotify:r.notImplemented,unlinkInstagram:r.notImplemented,unlinkTiktok:r.notImplemented,unlinkLinkedIn:r.notImplemented,unlinkApple:r.notImplemented,unlinkCrossAppAccount:r.notImplemented,unlinkFarcaster:r.notImplemented,unlinkTelegram:r.notImplemented,unlinkPasskey:r.notImplemented,createWallet:r.notImplemented,signMessage:r.notImplemented,signTypedData:r.notImplemented,enrollInMfa:r.notImplemented,initEnrollmentWithSms:r.notImplemented,initEnrollmentWithTotp:r.notImplemented,initEnrollmentWithPasskey:r.notImplemented,promptMfa:r.notImplemented,init:r.notImplemented,submitEnrollmentWithSms:r.notImplemented,submitEnrollmentWithTotp:r.notImplemented,submitEnrollmentWithPasskey:r.notImplemented,unenroll:r.notImplemented,submit:r.notImplemented,cancel:r.notImplemented,sendTransaction:r.notImplemented,signTransaction:r.notImplemented,exportWallet:r.notImplemented,setWalletPassword:r.notImplemented,setWalletRecovery:r.notImplemented,requestFarcasterSignerFromWarpcast:r.notImplemented,getFarcasterSignerPublicKey:r.notImplemented,signFarcasterMessage:r.notImplemented,createGuestAccount:r.notImplemented,signMessageWithCrossAppWallet:r.notImplemented,signTypedDataWithCrossAppWallet:r.notImplemented,sendTransactionWithCrossAppWallet:r.notImplemented,isModalOpen:!1,mfaMethods:[]}),Q=/*#__PURE__*/a.createContext(null);exports.CHAIN_ID_MAINNET=1,exports.CLIENT_ANALYTICS_ID_KEY="privy:caid",exports.CODE_VERIFIER_KEY="privy:code_verifier",exports.CONNECTIONS_HISTORY_KEY="privy:connections",exports.CONNECTORS_STATE_KEY="privy:connectors",exports.CUSTOMER_ACCESS_TOKEN_COOKIE_KEY="privy-token",exports.CUSTOMER_ACCESS_TOKEN_STORAGE_KEY="privy:token",exports.DEFAULT_API_TIMEOUT_MS=2e4,exports.DEFAULT_NETWORK="0x1",exports.DEFAULT_PRIVY_API_URL="https://auth.privy.io",exports.DEFAULT_RPC_TIMEOUT=12e4,exports.DEFAULT_SUCCESS_SCREEN_DURATION_MS=1400,exports.DEFAULT_SUCCESS_SCREEN_EXTRA_LONG_DURATION_MS=4e3,exports.DEFAULT_SUCCESS_SCREEN_LONG_DURATION_MS=2500,exports.DEFAULT_SUPPORTED_CHAINS=w,exports.DEFAULT_SUPPORTED_CHAIN_IDS=k,exports.DEPRECATED_REFRESH_TOKEN="deprecated",exports.FORKED_TOKEN_STORAGE_KEY="privy:session_transfer_token",exports.HEADLESS_OAUTH_KEY="privy:headless_oauth",exports.IDENTITY_TOKEN_COOKIE_KEY="privy-id-token",exports.IDENTITY_TOKEN_STORAGE_KEY="privy:id_token",exports.MOONPAY_API_URL="https://api.moonpay.com/v1",exports.MOONPAY_API_URL_SANDBOX="https://api.moonpay.com/v1",exports.MOONPAY_PUBLIC_KEY="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",exports.MOONPAY_PUBLIC_KEY_SANDBOX="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",exports.ModalProvider=e=>{let n=z(),r=e.authenticated,[l,i]=a.useState(e.initialScreen);a.useEffect((()=>{r||Z.includes(e.initialScreen)||e.setInitialScreen(null)}),[r]);let o=a.useRef(null);a.useEffect((()=>{e.open||(o.current=null)}),[e.open]),a.useEffect((()=>{o.current=null}),[e.initialScreen]);let s={ready:!!n.id,app:n,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:l,navigate:(t,a=!0)=>{e.setInitialScreen(t),a&&i(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(l)},resetNavigation:()=>{e.setInitialScreen(null),i(null)},onUserCloseViaDialogOrKeybindRef:o};/*#__PURE__*/return t.jsxs($.Provider,{value:s,children:[("string"==typeof n.appearance.logo||"img"===n.appearance.logo?.type)&&/*#__PURE__*/t.jsx(D,{src:"string"==typeof n.appearance.logo?n.appearance.logo:n.appearance.logo.props.src}),e.children]})},exports.ModalScreen=X,exports.OAUTH_DISABLE_SIGNUP_KEY="privy:oauth_disable_signup",exports.PRIVY_ACCESS_TOKEN_STORAGE_KEY="privy:pat",exports.PrivyAppConfigProvider=({children:e,client:n,clientConfig:r})=>{let[l,i]=a.useState(null),o=a.useMemo((()=>B(l??j,r,!!l,"undefined"!=typeof window?window.location.origin:void 0)),[l,r]);return a.useEffect((()=>{if(!l)return;let e=function(e){if(!e)return{};let{appearance:t,supportedChains:a,defaultChain:n,externalWallets:r,...l}=e;return{...l,...a?{supportedChains:a.map((e=>e.id))}:void 0,...n?{defaultChain:n.id}:void 0,...r?{walletConnect:r.walletConnect,coinbaseWallet:r.coinbaseWallet,solana:{connectors:r.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0}}(r),t=function(e,t=0){let a=3735928559^t,n=1103547991^t;for(let t,r=0;r<e.length;r++)a=Math.imul(a^(t=e.charCodeAt(r)),2654435761),n=Math.imul(n^t,1597334677);return a=Math.imul(a^a>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),4294967296*(2097151&(n=Math.imul(n^n>>>16,2246822507)^Math.imul(a^a>>>13,3266489909)))+(a>>>0)}(JSON.stringify(e)).toString(),a=`privy:sent:${l.id}:${t}`;localStorage.getItem(a)||(n.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(a,"t"))}),[r,l]),a.useEffect((()=>{l||(async()=>{try{let e=await n.getServerConfig();e.customApiUrl&&n.updateApiUrl(e.customApiUrl),i(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),/*#__PURE__*/t.jsx(Y.Provider,{value:{appConfig:o,isServerConfigLoaded:!!l},children:e})},exports.PrivyContext=J,exports.REFRESH_TOKEN_COOKIE_KEY="privy-refresh-token",exports.REFRESH_TOKEN_STORAGE_KEY="privy:refresh_token",exports.RELAY_SOLANA_MAINNET_CLUSTER_CHAIN_ID=792703809,exports.RELAY_SOLANA_NATIVE_CURRENCY_ID="11111111111111111111111111111111",exports.RELAY_SOLANA_USDC_TOKEN_ID="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",exports.SESSION_COOKIE_KEY="privy-session",exports.STATE_CODE_KEY="privy:state_code",exports.UseWalletsContext=Q,exports.VERSION="2.4.5",exports.WALLET_PROXY_TIMEOUT=3e4,exports.addPrivyRpcToChain=F,exports.addRpcUrlOverrideToChain=function(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}},exports.addToDefaultChains=function(e){let t=e.filter((e=>!k.has(e.id)));return w.concat(t)},exports.arbitrum=h,exports.arbitrumSepolia=f,exports.avalanche=A,exports.avalancheFuji=y,exports.base=S,exports.baseSepolia=g,exports.celo=C,exports.convertUserResponseToUser=function(e){if(!e)return null;let t=function(e){let t=[];for(let a of e){let e=a.type;switch(a.type){case"wallet":let n={id:a.id,address:a.address,type:a.type,imported:a.imported,delegated:a.delegated,verifiedAt:o(a.verified_at),firstVerifiedAt:o(a.first_verified_at),latestVerifiedAt:o(a.latest_verified_at),chainType:a.chain_type,walletClientType:a.wallet_client_type,connectorType:a.connector_type,recoveryMethod:a.recovery_method,walletIndex:a.wallet_index};t.push(n);break;case"smart_wallet":let r={address:a.address,type:a.type,verifiedAt:o(a.verified_at),firstVerifiedAt:o(a.first_verified_at),latestVerifiedAt:o(a.latest_verified_at),smartWalletType:a.smart_wallet_type};t.push(r);break;case"cross_app":let l={type:a.type,subject:a.subject,embeddedWallets:a.embedded_wallets,smartWallets:a.smart_wallets,providerApp:{id:a.provider_app_id},verifiedAt:o(a.verified_at),firstVerifiedAt:o(a.first_verified_at),latestVerifiedAt:o(a.latest_verified_at)};t.push(l);break;case"email":let i={address:a.address,type:a.type,verifiedAt:o(a.verified_at),firstVerifiedAt:o(a.first_verified_at),latestVerifiedAt:o(a.latest_verified_at)};t.push(i);break;case"phone":let s={number:a.phoneNumber,type:a.type,verifiedAt:o(a.verified_at),firstVerifiedAt:o(a.first_verified_at),latestVerifiedAt:o(a.latest_verified_at)};t.push(s);break;case"google_oauth":let p={subject:a.subject,email:a.email,name:a.name,type:a.type,verifiedAt:o(a.verified_at),firstVerifiedAt:o(a.first_verified_at),latestVerifiedAt:o(a.latest_verified_at)};t.push(p);break;case"spotify_oauth":let c={subject:a.subject,email:a.email,name:a.name,type:a.type,verifiedAt:o(a.verified_at),firstVerifiedAt:o(a.first_verified_at),latestVerifiedAt:o(a.latest_verified_at)};t.push(c);break;case"instagram_oauth":let d={subject:a.subject,username:a.username,type:a.type,verifiedAt:o(a.verified_at),firstVerifiedAt:o(a.first_verified_at),latestVerifiedAt:o(a.latest_verified_at)};t.push(d);break;case"twitter_oauth":let u={subject:a.subject,username:a.username,name:a.name,type:a.type,profilePictureUrl:a.profile_picture_url,verifiedAt:o(a.verified_at),firstVerifiedAt:o(a.first_verified_at),latestVerifiedAt:o(a.latest_verified_at)};t.push(u);break;case"discord_oauth":let m={subject:a.subject,username:a.username,email:a.email,type:a.type,verifiedAt:o(a.verified_at),firstVerifiedAt:o(a.first_verified_at),latestVerifiedAt:o(a.latest_verified_at)};t.push(m);break;case"github_oauth":let E={subject:a.subject,username:a.username,name:a.name,email:a.email,type:a.type,verifiedAt:o(a.verified_at),firstVerifiedAt:o(a.first_verified_at),latestVerifiedAt:o(a.latest_verified_at)};t.push(E);break;case"tiktok_oauth":let _={subject:a.subject,username:a.username,name:a.name,type:a.type,verifiedAt:o(a.verified_at),firstVerifiedAt:o(a.first_verified_at),latestVerifiedAt:o(a.latest_verified_at)};t.push(_);break;case"linkedin_oauth":let h={subject:a.subject,name:a.name,email:a.email,vanityName:a.vanity_name,type:a.type,verifiedAt:o(a.verified_at),firstVerifiedAt:o(a.first_verified_at),latestVerifiedAt:o(a.latest_verified_at)};t.push(h);break;case"apple_oauth":let f={subject:a.subject,email:a.email,type:a.type,verifiedAt:o(a.verified_at),firstVerifiedAt:o(a.first_verified_at),latestVerifiedAt:o(a.latest_verified_at)};t.push(f);break;case"custom_auth":t.push({type:a.type,customUserId:a.custom_user_id,verifiedAt:o(a.verified_at),firstVerifiedAt:o(a.first_verified_at),latestVerifiedAt:o(a.latest_verified_at)});break;case"farcaster":let A={type:a.type,fid:a.fid,ownerAddress:a.owner_address,displayName:a.display_name,username:a.username,bio:a.bio,pfp:a.profile_picture_url,url:a.homepage_url,verifiedAt:o(a.verified_at),firstVerifiedAt:o(a.first_verified_at),latestVerifiedAt:o(a.latest_verified_at),signerPublicKey:a.signer_public_key};t.push(A);break;case"passkey":let y={type:a.type,enrolledInMfa:a.enrolled_in_mfa,credentialId:a.credential_id,authenticatorName:a.authenticator_name,createdWithDevice:a.created_with_device,createdWithOs:a.created_with_os,createdWithBrowser:a.created_with_browser,verifiedAt:o(a.verified_at),firstVerifiedAt:o(a.first_verified_at),latestVerifiedAt:o(a.latest_verified_at)};t.push(y);break;case"telegram":let S={type:a.type,telegramUserId:a.telegram_user_id,firstName:a.first_name,lastName:a.last_name,username:a.username,photoUrl:a.photo_url,verifiedAt:o(a.first_verified_at),firstVerifiedAt:o(a.first_verified_at),latestVerifiedAt:o(a.latest_verified_at)};t.push(S);break;default:console.warn(`Unrecognized account type: ${e}. Please consider upgrading the Privy SDK.`)}}return t}(e.linked_accounts),a=s(t,"wallet"),n=s(t,"smart_wallet"),r=s(t,"email"),l=s(t,"phone"),i=s(t,"google_oauth"),p=s(t,"twitter_oauth"),c=s(t,"discord_oauth"),d=s(t,"github_oauth"),u=s(t,"spotify_oauth"),m=s(t,"instagram_oauth"),E=s(t,"tiktok_oauth"),_=s(t,"linkedin_oauth"),h=s(t,"apple_oauth"),f=s(t,"farcaster"),A=s(t,"telegram"),y=e.mfa_methods.map((({type:e,verified_at:t})=>({type:e,verifiedAt:o(t)})));return{id:e.id,createdAt:o(e.created_at),linkedAccounts:t,email:r&&{address:r?.address},phone:l&&{number:l?.number},wallet:a&&{id:a.id,address:a.address,chainType:a.chainType,walletClientType:a.walletClientType,connectorType:a.connectorType,recoveryMethod:a.recoveryMethod,imported:a.imported,delegated:a.delegated,walletIndex:a.walletIndex},smartWallet:n&&{address:n.address,smartWalletType:n.smartWalletType},google:i&&{subject:i.subject,email:i.email,name:i.name},twitter:p&&{subject:p.subject,username:p.username,name:p.name,profilePictureUrl:p.profilePictureUrl},discord:c&&{subject:c.subject,username:c.username,email:c.email},github:d&&{subject:d.subject,username:d.username,name:d.name,email:d.email},spotify:u&&{subject:u.subject,email:u.email,name:u.name},instagram:m&&{subject:m.subject,username:m.username},tiktok:E&&{subject:E.subject,username:E.username,name:E.name},linkedin:_&&{subject:_.subject,name:_.name,email:_.email,vanityName:_.vanityName},apple:h&&{subject:h.subject,email:h.email},farcaster:f&&{fid:f.fid,ownerAddress:f.ownerAddress,displayName:f.displayName,username:f.username,bio:f.bio,pfp:f.pfp,url:f.url,signerPublicKey:f.signerPublicKey},telegram:A&&{telegramUserId:A.telegramUserId,firstName:A.firstName,lastName:A.lastName,username:A.username,photoUrl:A.photoUrl},delegatedWallets:[],mfaMethods:y.map((e=>e.type)),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest,customMetadata:e.custom_metadata}},exports.getEntropyDetailsFromAccount=_,exports.getEntropyDetailsFromUser=e=>{let t=E(e);if(!t)throw Error("Failed to find primary wallet");return _(t)},exports.getEthereumSigningAndRootWallet=(t,a)=>{let n=d(t,"ethereum").find((t=>e.getAddress(t.address)===e.getAddress(a)));return{signingWallet:n,rootWallet:n?n.imported?n:p(t):void 0}},exports.getGuestCredentialStorageKey=e=>`privy:guest:${e}`,exports.getImportedPrivyEthereumWallet=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.imported&&"ethereum"===e.chainType))||null,exports.getImportedPrivySolanaWallet=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&e.imported&&"privy"===e.walletClientType&&"solana"===e.chainType))||null,exports.getLatestPrivyEthereumWallet=e=>c(e).reduce(((e,t)=>!e||e.walletIndex<t.walletIndex?t:e),null),exports.getLatestPrivySolanaWallet=e=>u(e).reduce(((e,t)=>!e||e.walletIndex<t.walletIndex?t:e),null),exports.getPrivyEthereumHDWallets=c,exports.getPrivyEthereumWallet=p,exports.getPrivyPrimaryWallet=E,exports.getPrivySolanaHDWallets=u,exports.getPrivySolanaWallet=m,exports.getPrivyWalletKey=e=>`privy:wallet:${e}`,exports.getPrivyWalletWithAddress=(e,t)=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.address===t))||null,exports.getProviderAccessTokenStorageKey=e=>`privy:cross-app:${e}`,exports.getSolanaNetworkFromRpcEndpoint=function(e){return e.includes("testnet")?"testnet":e.includes("devnet")?"devnet":"mainnet-beta"},exports.getSolanaRpcEndpointForCluster=function({name:e,rpcUrl:t}){if(t)return t;switch(e){case"mainnet-beta":return"https://api.mainnet-beta.solana.com";case"testnet":return"https://api.testnet.solana.com";case"devnet":return"https://api.devnet.solana.com"}},exports.getSolanaSigningAndRootWallet=(e,t)=>{let a=d(e,"solana").find((e=>e.address===t));return a?a.imported||0===a.walletIndex?{signingWallet:a,rootWallet:a}:{signingWallet:a,rootWallet:m(e)}:{}},exports.getSolanaTransactionExplorerUrl=function(e,t){return`https://explorer.solana.com/tx/${e}?cluster=${t}`},exports.getSolanaWalletExplorerUrl=function(e,t){return`https://explorer.solana.com/account/${e}?cluster=${t}`},exports.linea=N,exports.mainnet=T,exports.optimism=b,exports.optimismSepolia=I,exports.polygon=v,exports.polygonAmoy=O,exports.sepolia=R,exports.useAppConfig=z,exports.useIsServerConfigLoaded=()=>{let{isServerConfigLoaded:e}=a.useContext(Y);return e},exports.usePrivyContext=()=>a.useContext(J),exports.usePrivyModal=()=>a.useContext($),exports.useWallets=function(){let e=a.useContext(Q);return null===e?(console.warn("`useWallets` was called outside the PrivyProvider component"),{wallets:[],ready:!1}):e},exports.zora=L;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a0 as e,a6 as t}from"./useWallets-8w3LVxdW.mjs";import{a,P as r}from"./internal-context-DBDJ7qsa.mjs";const i=async({emitPrivyEvent:i,getAccessToken:n,initializeWalletProxy:o,refreshSessionAndUser:s,user:l},{privateKey:c,chainType:E})=>{if(!l)throw i("linkAccount","onError",a.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new r("User must be authenticated before linking an account.");let[T,m]=await Promise.all([n(),o(15e3)]);if(!m||!T)throw i("linkAccount","onError",a.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new r("User must be authenticated before linking an account.");await m.importWallet({privateKey:c,accessToken:T,chainType:E});let u=await s(),w="solana"===E?e(u):t(u);if(!w)throw i("createWallet","onError",a.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to import wallet");return i("createWallet","onSuccess",{wallet:w}),w};export{i};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const a="/api/v1/sessions",s="/api/v1/sessions/logout",i="/api/v1/sessions/fork",e="/api/v1/sessions/fork/recover",t="/api/v1/siwe/init",p="/api/v1/siwe/authenticate",n="/api/v1/siwe/link",v="/api/v1/siwe/link_smart_wallet",r="/api/v1/siwe/unlink",o="/api/v1/siwe/transfer",l="/api/v1/siws/init",u="/api/v1/siws/authenticate",c="/api/v1/siws/link",k="/api/v1/siws/unlink",w="/api/v1/farcaster/init",m="/api/v1/farcaster/authenticate",h="/api/v1/farcaster/link",f="/api/v1/farcaster/status",_="/api/v1/farcaster/unlink",d="/api/v1/farcaster/transfer",g="api/v2/farcaster/init",y="api/v2/farcaster/authenticate",b="/api/v1/passwordless/init",j="/api/v1/passwordless/authenticate",x="/api/v1/passwordless/link",q="/api/v1/passwordless/unlink",z="/api/v1/passwordless/update",A="/api/v1/passwordless/transfer",B="/api/v1/passwordless_sms/init",C="/api/v1/passwordless_sms/link",D="/api/v1/passwordless_sms/unlink",E="/api/v1/passwordless_sms/authenticate",F="/api/v1/passwordless_sms/update",G="/api/v1/passwordless_sms/transfer",H="/api/v1/oauth/init",I="/api/v1/oauth/authenticate",J="/api/v1/oauth/link",K="/api/v1/oauth/unlink",L="/api/v1/oauth/transfer",M="/api/v1/recovery/oauth/init",N="/api/v1/recovery/oauth/init_icloud",O="/api/v1/recovery/oauth/authenticate",P="/api/v1/passkeys/link/init",Q="/api/v1/passkeys/authenticate/init",R="/api/v1/passkeys/register/init",S="/api/v1/passkeys/link",T="/api/v1/passkeys/authenticate",U="/api/v1/passkeys/register",V="/api/v1/telegram/authenticate",W="/api/v1/telegram/link",X="/api/v1/telegram/unlink",Y="/api/v1/telegram/transfer",Z="/api/v1/mfa/passwordless_sms/init",$="/api/v1/mfa/passkeys/init",aa="/api/v1/users/me/accept_terms",sa="/api/v1/analytics_events",ia="/api/v1/custom_jwt_account/authenticate",ea="/api/v1/guest/authenticate",ta="/api/v1/plugins/moonpay_on_ramp/sign",pa="/api/v1/funding/coinbase_on_ramp/init",na="/api/v1/funding/coinbase_on_ramp/status",va="/api/v1/wallets/revoke",ra="/api/v1/users/me",oa="/api/v1/scan/transaction";export{o as $,e as A,s as B,sa as C,i as D,Z as E,$ as F,aa as G,q as H,D as I,r as J,k as K,K as L,_ as M,X as N,va as O,ta as P,pa as Q,na as R,t as S,p as T,n as U,v as V,l as W,u as X,L as Y,Y as Z,d as _,x as a,G as a0,A as a1,c as a2,ra as a3,oa as a4,N as a5,M as a6,O as a7,g as a8,y as a9,b,ia as c,h as d,w as e,m as f,f as g,ea as h,J as i,H as j,U as k,T as l,S as m,R as n,I as o,j as p,Q as q,P as r,E as s,C as t,z as u,B as v,F as w,V as x,W as y,a as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useRef as e,useState as n,useCallback as t}from"react";import{http as a,createPublicClient as r}from"viem";import{q as i,u as s,r as o,E as l,ac as c,M as d}from"./useWallets-8w3LVxdW.mjs";import{P as u,u as p}from"./internal-context-DBDJ7qsa.mjs";import{a as m}from"./getPublicClient-BghjDv1y.mjs";import{g as y}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import{createSmartAccountClient as E}from"permissionless";import{toThirdwebSmartAccount as f,toLightSmartAccount as g,toBiconomySmartAccount as I,toEcdsaKernelSmartAccount as h,toSafeSmartAccount as w}from"permissionless/accounts";import{createPimlicoClient as C}from"permissionless/clients/pimlico";import{toCoinbaseSmartAccount as P,entryPoint06Address as T,entryPoint07Address as D}from"viem/account-abstraction";import{THIRDWEB as _,COINBASE_SMART_WALLET as N,LIGHT_ACCOUNT as W,BICONOMY as S,KERNEL as v,SAFE as F}from"@privy-io/js-sdk-core";let x={address:T,version:"0.6"},G={address:D,version:"0.7"},M=({owner:e,smartWalletType:n,publicClient:t})=>{switch(n){case F:return w({client:t,entryPoint:G,owners:[e],version:"1.4.1"});case v:return h({client:t,version:"0.3.1",entryPoint:G,owners:[e]});case S:return I({client:t,owners:[e],entryPoint:x});case W:return g({client:t,entryPoint:x,owner:e,version:"1.1.0"});case N:return async function({client:e,owner:n}){let[t]=await n.request({method:"eth_accounts"});if(!t)throw Error("Unable to request embedded owner for eth_accounts");return await P({client:e,owners:[{type:"local",source:"privy",address:t,sign:async({hash:e})=>await n.request({method:"secp256k1_sign",params:[e]})}]})}({client:t,owner:e});case _:return f({client:t,entryPoint:G,owner:e});default:throw Error(`Invalid smart account type: ${n}.`)}},b=["rpc.zerodev.app","public.pimlico.io","api.pimlico.io"];const A=({calls:e,chain:n,maxPriorityFeePerGas:t,maxFeePerGas:a,nonce:r})=>e.map((e=>({to:e.to||void 0,data:e.data,value:e.value,chainId:n.id,nonce:r,maxFeePerGas:a,maxPriorityFeePerGas:t}))),O=async({chain:e,paymasterContext:n,embeddedWallet:t,user:i,smartWalletsConfig:s,rpcConfig:o,privyAppId:l})=>{if(!s?.enabled||!i||!t)return;let c=await t.getEthereumProvider(),d=s?.configuredNetworks.find((n=>n.chainId===`eip155:${e.id}`));if(!d)throw new u(`The chain ${e.name} (eip155:${e.id}) must be configured in the smart wallet configuration in your dashboard`);let p=i.smartWallet?.smartWalletType??s.smartWalletType,y=m(e,o,l),f=r({chain:e,transport:a(y)}),g=n??d.paymasterContext,I=await(async({owner:e,smartWalletType:n,chain:t,publicClient:r,bundlerUrl:i,paymasterUrl:s,paymasterContext:o})=>{let l=await M({owner:e,smartWalletType:n,publicClient:r}),c=C({transport:a(i),entryPoint:l.entryPoint}),d=s?C({transport:a(s),entryPoint:l.entryPoint}):void 0;return E({account:l,chain:t,paymaster:d,paymasterContext:o,bundlerTransport:a(i),userOperation:{estimateFeesPerGas:async()=>{if(b.some((e=>i.includes(e))))return await c.getUserOperationGasPrice().then((e=>e.fast));{let e=await r.estimateFeesPerGas(),n=i.includes("api.developer.coinbase.com")?175n:150n;return{...e,maxFeePerGas:e.maxFeePerGas*n/100n,maxPriorityFeePerGas:e.maxPriorityFeePerGas*n/100n}}}}})})({owner:c,smartWalletType:p,chain:e,publicClient:f,paymasterContext:g,...d});if(!I)throw new u(`Failed to create smart wallet client for chain ${e.name} (eip155:${e.id})`);return I},L=({clientConfig:a,smartWalletsConfig:r})=>{let{hideWalletUIs:m,openPrivyModal:E,appId:f}=p(),g=i(),{setModalData:I}=s(),{user:h}=o(),{chains:w}=i(),{chainId:C,clients:P,setChainId:T,chainIdState:D}=(()=>{let t=e(),[a,r]=n();return{clients:e({}),setChainId:e=>{t.current=e,r(e)},chainId:t,chainIdState:a}})(),_=w.find((e=>e.id===D)),{wallets:N}=l(),W=t((async()=>C.current),[C]),S=t((async({id:e})=>{if(!P.current[e]){let n=y(N),t=await O({chain:w.find((n=>n.id===e)),embeddedWallet:n,user:h,paymasterContext:a?.paymasterContext,smartWalletsConfig:r,rpcConfig:g.rpcConfig,privyAppId:f});t&&(P.current[e]=t)}T(e)}),[w,a,N,h,r]);return{wrapSmartAccountClient:e=>{P.current[e.chain.id]=e,D||T(e.chain.id);return{...e,sendTransaction:async(e,n)=>{let t=P.current[C.current];if(!t)throw new u(`Smart wallet client for chain (eip155:${C.current}) not found`);if(delete e.account,!g.embeddedWallets.showWalletUIs)return m.current=!0,await t.sendTransaction(e).finally((()=>m.current=!1));let a=[];"calls"in e&&void 0!==e.calls?a=[...e.calls]:"to"in e&&(a=[{to:e.to,value:e.value||BigInt(0),data:e.data||"0x"}]);let r=async()=>{if(!t.paymaster)return!1;let{paymasterAndData:n,paymasterData:r}=await t.prepareUserOperation({calls:a,maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0});return Number(n??r??0)>0};return new Promise((async(i,s)=>{m.current=!0;let{entropyId:o,entropyIdVerifier:l}=c(h);I({connectWallet:{entropyId:o,entropyIdVerifier:l,onCompleteNavigateTo:d.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:A({calls:a,chain:t.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:o,entropyIdVerifier:l,transactingWallet:{address:t.account.address,walletIndex:null},getIsSponsored:r,signOnly:!1,onConfirm:()=>t.sendTransaction(e),onSuccess:e=>i(e.hash),onFailure:s,uiOptions:n?.uiOptions??{}}}),E(d.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{m.current=!1}))},signMessage:async(e,n)=>{let t=P.current[C.current];if(!t)throw new u(`Smart wallet client for chain (eip155:${C.current}) not found`);return g.embeddedWallets.showWalletUIs?new Promise((async(a,r)=>{let{entropyId:i,entropyIdVerifier:s}=c(h);m.current=!0,I({connectWallet:{entropyId:i,entropyIdVerifier:s,onCompleteNavigateTo:d.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"personal_sign",data:"string"==typeof e.message?e.message:e.message.raw.toString(),confirmAndSign:()=>t.signMessage(e),onSuccess:e=>a(e),onFailure:r,uiOptions:n?.uiOptions??{}}}),E(d.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{m.current=!1})):(m.current=!0,await t.signMessage(e).finally((()=>m.current=!1)))},signTypedData:async(e,n)=>{let t=P.current[C.current];if(!t)throw new u(`Smart wallet client for chain (eip155:${C.current}) not found`);return delete e.account,g.embeddedWallets.showWalletUIs?new Promise((async(a,r)=>{m.current=!0;let{entropyId:i,entropyIdVerifier:s}=c(h);I({connectWallet:{entropyId:i,entropyIdVerifier:s,onCompleteNavigateTo:d.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>t.signTypedData(e),onSuccess:e=>a(e),onFailure:r,uiOptions:n?.uiOptions??{}}}),E(d.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{m.current=!1})):(m.current=!0,await t.signTypedData(e).finally((()=>m.current=!1)))},getChainId:W,chain:_,switchChain:S}}}},R=()=>{let{hideWalletUIs:e,openPrivyModal:n}=p(),t=i(),{setModalData:a}=s(),{user:r}=o();return{wrapSmartAccountClientWithUIs:i=>({...i,sendTransaction:async(s,o)=>{if(!t.embeddedWallets.showWalletUIs)return e.current=!0,await i.sendTransaction(s).finally((()=>e.current=!1));let l=[];"calls"in s&&void 0!==s.calls?l=[...s.calls]:"to"in s&&(l=[{to:s.to,value:s.value||BigInt(0),data:s.data||"0x"}]);let u=async()=>{if(!i.paymaster)return!1;let{paymasterAndData:e,paymasterData:n}=await i.prepareUserOperation({calls:l,maxFeePerGas:s.maxFeePerGas,maxPriorityFeePerGas:s.maxPriorityFeePerGas,nonce:s.nonce?BigInt(s.nonce):void 0});return Number(e??n??0)>0};return new Promise((async(t,p)=>{e.current=!0;let{entropyId:m,entropyIdVerifier:y}=c(r);a({connectWallet:{entropyId:m,entropyIdVerifier:y,onCompleteNavigateTo:d.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:A({calls:l,chain:i.chain,maxPriorityFeePerGas:s.maxPriorityFeePerGas,maxFeePerGas:s.maxFeePerGas,nonce:s.nonce?BigInt(s.nonce):void 0}),entropyId:m,entropyIdVerifier:y,transactingWallet:{address:i.account.address,walletIndex:null},getIsSponsored:u,signOnly:!1,onConfirm:()=>i.sendTransaction(s),onSuccess:e=>t(e.hash),onFailure:p,uiOptions:o?.uiOptions??{}}}),n(d.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{e.current=!1}))},signMessage:async(s,o)=>t.embeddedWallets.showWalletUIs?new Promise((async(t,l)=>{let{entropyId:u,entropyIdVerifier:p}=c(r);e.current=!0,a({connectWallet:{entropyId:u,entropyIdVerifier:p,onCompleteNavigateTo:d.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"personal_sign",data:"string"==typeof s.message?s.message:s.message.raw.toString(),confirmAndSign:()=>i.signMessage(s),onSuccess:e=>t(e),onFailure:l,uiOptions:o?.uiOptions??{}}}),n(d.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{e.current=!1})):(e.current=!0,await i.signMessage(s).finally((()=>e.current=!1))),signTypedData:async(s,o)=>t.embeddedWallets.showWalletUIs?new Promise((async(t,l)=>{e.current=!0;let{entropyId:u,entropyIdVerifier:p}=c(r);a({connectWallet:{entropyId:u,entropyIdVerifier:p,onCompleteNavigateTo:d.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:s,confirmAndSign:()=>i.signTypedData(s),onSuccess:e=>t(e),onFailure:l,uiOptions:o?.uiOptions??{}}}),n(d.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{e.current=!1})):(e.current=!0,await i.signTypedData(s).finally((()=>e.current=!1)))})}};export{L as a,A as c,O as g,R as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{getAddress as e}from"viem/utils";import{jsx as t,jsxs as a}from"react/jsx-runtime";import{useState as i,useMemo as r,useEffect as n,useContext as l,createContext as s,useRef as o}from"react";import c from"tinycolor2";import{n as p}from"./internal-context-DBDJ7qsa.mjs";const d="https://auth.privy.io",u=2e4,E=1400,m=2500,h=4e3,_="2.4.5",f="privy:token",y="privy-token",A="privy:refresh_token",g="privy-refresh-token",C="privy:pat",N="privy:id_token",b="privy-id-token",S="privy-session",T="privy:session_transfer_token",v="privy:caid",w=e=>`privy:guest:${e}`,k=e=>`privy:cross-app:${e}`,L="privy:state_code",O="privy:code_verifier",R="privy:headless_oauth",I="privy:oauth_disable_signup",D=e=>`privy:wallet:${e}`,W="privy:connectors",M="privy:connections",U=12e4,P=1,x="0x1",F=3e4,G="https://api.moonpay.com/v1",H="https://api.moonpay.com/v1",B="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",j="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",V="deprecated";function K(e){return e?new Date(1e3*e):null}function Y(e,t){return e.slice().sort(((e,t)=>(e.firstVerifiedAt??e.verifiedAt).getTime()-(t.firstVerifiedAt??t.verifiedAt).getTime())).find((e=>e.type===t))}const z=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"ethereum"===e.chainType&&0===e.walletIndex))||null,q=e=>(e?.linkedAccounts??[]).filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"ethereum"===e.chainType)),$=e=>q(e).reduce(((e,t)=>!e||e.walletIndex<t.walletIndex?t:e),null),X=(e,t)=>(e?.linkedAccounts??[]).filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.chainType===t)),Z=e=>(e?.linkedAccounts??[]).filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"solana"===e.chainType)),J=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"solana"===e.chainType&&0===e.walletIndex))||null,Q=e=>Z(e).reduce(((e,t)=>!e||e.walletIndex<t.walletIndex?t:e),null),ee=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.imported&&"ethereum"===e.chainType))||null,te=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&e.imported&&"privy"===e.walletClientType&&"solana"===e.chainType))||null,ae=(e,t)=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.address===t))||null,ie=e=>z(e)??J(e),re=e=>{if("ethereum"===e.chainType)return{entropyId:e.address,entropyIdVerifier:"ethereum-address-verifier"};if("solana"===e.chainType)return{entropyId:e.address,entropyIdVerifier:"solana-address-verifier"};throw Error("Failed to get account entropy details")},ne=e=>{let t=ie(e);if(!t)throw Error("Failed to find primary wallet");return re(t)},le=(t,a)=>{let i=X(t,"ethereum").find((t=>e(t.address)===e(a)));return{signingWallet:i,rootWallet:i?i.imported?i:z(t):void 0}},se=(e,t)=>{let a=X(e,"solana").find((e=>e.address===t));return a?a.imported||0===a.walletIndex?{signingWallet:a,rootWallet:a}:{signingWallet:a,rootWallet:J(e)}:{}};function oe(e){if(!e)return null;let t=function(e){let t=[];for(let a of e){let e=a.type;switch(a.type){case"wallet":let i={id:a.id,address:a.address,type:a.type,imported:a.imported,delegated:a.delegated,verifiedAt:K(a.verified_at),firstVerifiedAt:K(a.first_verified_at),latestVerifiedAt:K(a.latest_verified_at),chainType:a.chain_type,walletClientType:a.wallet_client_type,connectorType:a.connector_type,recoveryMethod:a.recovery_method,walletIndex:a.wallet_index};t.push(i);break;case"smart_wallet":let r={address:a.address,type:a.type,verifiedAt:K(a.verified_at),firstVerifiedAt:K(a.first_verified_at),latestVerifiedAt:K(a.latest_verified_at),smartWalletType:a.smart_wallet_type};t.push(r);break;case"cross_app":let n={type:a.type,subject:a.subject,embeddedWallets:a.embedded_wallets,smartWallets:a.smart_wallets,providerApp:{id:a.provider_app_id},verifiedAt:K(a.verified_at),firstVerifiedAt:K(a.first_verified_at),latestVerifiedAt:K(a.latest_verified_at)};t.push(n);break;case"email":let l={address:a.address,type:a.type,verifiedAt:K(a.verified_at),firstVerifiedAt:K(a.first_verified_at),latestVerifiedAt:K(a.latest_verified_at)};t.push(l);break;case"phone":let s={number:a.phoneNumber,type:a.type,verifiedAt:K(a.verified_at),firstVerifiedAt:K(a.first_verified_at),latestVerifiedAt:K(a.latest_verified_at)};t.push(s);break;case"google_oauth":let o={subject:a.subject,email:a.email,name:a.name,type:a.type,verifiedAt:K(a.verified_at),firstVerifiedAt:K(a.first_verified_at),latestVerifiedAt:K(a.latest_verified_at)};t.push(o);break;case"spotify_oauth":let c={subject:a.subject,email:a.email,name:a.name,type:a.type,verifiedAt:K(a.verified_at),firstVerifiedAt:K(a.first_verified_at),latestVerifiedAt:K(a.latest_verified_at)};t.push(c);break;case"instagram_oauth":let p={subject:a.subject,username:a.username,type:a.type,verifiedAt:K(a.verified_at),firstVerifiedAt:K(a.first_verified_at),latestVerifiedAt:K(a.latest_verified_at)};t.push(p);break;case"twitter_oauth":let d={subject:a.subject,username:a.username,name:a.name,type:a.type,profilePictureUrl:a.profile_picture_url,verifiedAt:K(a.verified_at),firstVerifiedAt:K(a.first_verified_at),latestVerifiedAt:K(a.latest_verified_at)};t.push(d);break;case"discord_oauth":let u={subject:a.subject,username:a.username,email:a.email,type:a.type,verifiedAt:K(a.verified_at),firstVerifiedAt:K(a.first_verified_at),latestVerifiedAt:K(a.latest_verified_at)};t.push(u);break;case"github_oauth":let E={subject:a.subject,username:a.username,name:a.name,email:a.email,type:a.type,verifiedAt:K(a.verified_at),firstVerifiedAt:K(a.first_verified_at),latestVerifiedAt:K(a.latest_verified_at)};t.push(E);break;case"tiktok_oauth":let m={subject:a.subject,username:a.username,name:a.name,type:a.type,verifiedAt:K(a.verified_at),firstVerifiedAt:K(a.first_verified_at),latestVerifiedAt:K(a.latest_verified_at)};t.push(m);break;case"linkedin_oauth":let h={subject:a.subject,name:a.name,email:a.email,vanityName:a.vanity_name,type:a.type,verifiedAt:K(a.verified_at),firstVerifiedAt:K(a.first_verified_at),latestVerifiedAt:K(a.latest_verified_at)};t.push(h);break;case"apple_oauth":let _={subject:a.subject,email:a.email,type:a.type,verifiedAt:K(a.verified_at),firstVerifiedAt:K(a.first_verified_at),latestVerifiedAt:K(a.latest_verified_at)};t.push(_);break;case"custom_auth":t.push({type:a.type,customUserId:a.custom_user_id,verifiedAt:K(a.verified_at),firstVerifiedAt:K(a.first_verified_at),latestVerifiedAt:K(a.latest_verified_at)});break;case"farcaster":let f={type:a.type,fid:a.fid,ownerAddress:a.owner_address,displayName:a.display_name,username:a.username,bio:a.bio,pfp:a.profile_picture_url,url:a.homepage_url,verifiedAt:K(a.verified_at),firstVerifiedAt:K(a.first_verified_at),latestVerifiedAt:K(a.latest_verified_at),signerPublicKey:a.signer_public_key};t.push(f);break;case"passkey":let y={type:a.type,enrolledInMfa:a.enrolled_in_mfa,credentialId:a.credential_id,authenticatorName:a.authenticator_name,createdWithDevice:a.created_with_device,createdWithOs:a.created_with_os,createdWithBrowser:a.created_with_browser,verifiedAt:K(a.verified_at),firstVerifiedAt:K(a.first_verified_at),latestVerifiedAt:K(a.latest_verified_at)};t.push(y);break;case"telegram":let A={type:a.type,telegramUserId:a.telegram_user_id,firstName:a.first_name,lastName:a.last_name,username:a.username,photoUrl:a.photo_url,verifiedAt:K(a.first_verified_at),firstVerifiedAt:K(a.first_verified_at),latestVerifiedAt:K(a.latest_verified_at)};t.push(A);break;default:console.warn(`Unrecognized account type: ${e}. Please consider upgrading the Privy SDK.`)}}return t}(e.linked_accounts),a=Y(t,"wallet"),i=Y(t,"smart_wallet"),r=Y(t,"email"),n=Y(t,"phone"),l=Y(t,"google_oauth"),s=Y(t,"twitter_oauth"),o=Y(t,"discord_oauth"),c=Y(t,"github_oauth"),p=Y(t,"spotify_oauth"),d=Y(t,"instagram_oauth"),u=Y(t,"tiktok_oauth"),E=Y(t,"linkedin_oauth"),m=Y(t,"apple_oauth"),h=Y(t,"farcaster"),_=Y(t,"telegram"),f=e.mfa_methods.map((({type:e,verified_at:t})=>({type:e,verifiedAt:K(t)})));return{id:e.id,createdAt:K(e.created_at),linkedAccounts:t,email:r&&{address:r?.address},phone:n&&{number:n?.number},wallet:a&&{id:a.id,address:a.address,chainType:a.chainType,walletClientType:a.walletClientType,connectorType:a.connectorType,recoveryMethod:a.recoveryMethod,imported:a.imported,delegated:a.delegated,walletIndex:a.walletIndex},smartWallet:i&&{address:i.address,smartWalletType:i.smartWalletType},google:l&&{subject:l.subject,email:l.email,name:l.name},twitter:s&&{subject:s.subject,username:s.username,name:s.name,profilePictureUrl:s.profilePictureUrl},discord:o&&{subject:o.subject,username:o.username,email:o.email},github:c&&{subject:c.subject,username:c.username,name:c.name,email:c.email},spotify:p&&{subject:p.subject,email:p.email,name:p.name},instagram:d&&{subject:d.subject,username:d.username},tiktok:u&&{subject:u.subject,username:u.username,name:u.name},linkedin:E&&{subject:E.subject,name:E.name,email:E.email,vanityName:E.vanityName},apple:m&&{subject:m.subject,email:m.email},farcaster:h&&{fid:h.fid,ownerAddress:h.ownerAddress,displayName:h.displayName,username:h.username,bio:h.bio,pfp:h.pfp,url:h.url,signerPublicKey:h.signerPublicKey},telegram:_&&{telegramUserId:_.telegramUserId,firstName:_.firstName,lastName:_.lastName,username:_.username,photoUrl:_.photoUrl},delegatedWallets:[],mfaMethods:f.map((e=>e.type)),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest,customMetadata:e.custom_metadata}}const ce={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"}}},pe={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0},de={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}},ue={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},Ee={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"}}},me={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},he={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},_e={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},fe={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"}}},ye={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"}}},Ae={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},ge={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"}}},Ce={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},Ne={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},be={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"}}},Se=[ce,pe,Ne,fe,ye,Ae,ge,Ce,he,{id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0},{id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}},{id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}},Ee,me,{id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0},{id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}},_e,{id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0},de,ue,be,{id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0},{id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},{id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}},{id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}},{id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}}],Te=new Set(Se.map((e=>e.id)));function ve({src:e,...a}){/*#__PURE__*/return t("img",{src:e,...a,style:{display:"none"}})}const we={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",externalWallets:{coinbaseWallet:{connectionOptions:"all"}},embeddedWallets:{extendedCalldataDecoding:!1},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let ke=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","ronin_wallet","wallet_connect","detected_wallets","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe","solflare","backpack"]),Le=e=>ke.has(e),Oe=(e,t,a)=>a.indexOf(e)===t;const Re=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(Le).filter(Oe):e?e.filter(Le).filter(Oe):we.appearance.walletList;function Ie(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function De(e){let t=e.filter((e=>!Te.has(e.id)));return Se.concat(t)}function We(e,t){return{...e,rpcUrls:{...e.rpcUrls,privy:{http:[t]}}}}const Me=792703809,Ue="11111111111111111111111111111111",Pe="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";function xe(e){return e.includes("testnet")?"testnet":e.includes("devnet")?"devnet":"mainnet-beta"}function Fe(e,t){return`https://explorer.solana.com/tx/${e}?cluster=${t}`}function Ge(e,t){return`https://explorer.solana.com/account/${e}?cluster=${t}`}function He({name:e,rpcUrl:t}){if(t)return t;switch(e){case"mainnet-beta":return"https://api.mainnet-beta.solana.com";case"testnet":return"https://api.testnet.solana.com";case"devnet":return"https://api.devnet.solana.com"}}let Be="#FFFFFF";function je(e,t){let a=Math.max(0,Math.min(1,e.toHsl().l+t));return c({...e.toHsl(),l:a})}function Ve({backgroundTheme:e,accentHex:t}){let a;switch(e){case"light":a=Be;break;case"dark":a="#1E1E1D";break;default:a=e}let i=c(a),r=c(t),n=c("#51BA81"),l=c("#FFB74D"),s=c("#EC6351"),o=function(e){return e<.8&&e>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),e>.5?"light":"dark"}(i.getLuminance()),p=je(i,"light"===o?-.04:.11),d=je(i,"light"===o?-.08:.16),u=je(i,"light"===o?-.88:.87),E=je(i,"light"===o?-.7:.75),m=je(i,"light"===o?-.43:.45).desaturate("light"===o?60:20),h=je(i,"light"===o?-.08:.25).desaturate("light"===o?60:20),_=je(r,.15),f=je(r,.25),y=je(r,-.06),A=je(r,-.6),g=je(s,.3),C=je(l,.3),N=c(r.getLuminance()>.5?"#040217":Be),b=je(n,-.16),S=je(n,.4);return{colorScheme:o,background:i.toHslString(),background2:p.toHslString(),background3:d.toHslString(),foreground:u.toHslString(),foreground2:E.toHslString(),foreground3:m.toHslString(),foreground4:h.toHslString(),accent:r.toHslString(),accentLight:_.toHslString(),accentLightest:f.toHslString(),accentDark:y.toHslString(),accentDarkest:A.toHslString(),foregroundAccent:N.toHslString(),success:n.toHslString(),successDark:b.toHslString(),successLight:S.toHslString(),error:s.toHslString(),errorLight:g.toHslString(),warn:l.toHslString(),warnLight:C.toHslString()}}function Ke(e,t,a,i){let r,n,l,s,o,c,p,d,u,E,m,h,_,f,y,A=a?console.warn:()=>{};t?.loginMethods?(r=t.loginMethods.includes("email"),n=t.loginMethods.includes("sms"),s=t.loginMethods.includes("wallet"),o=t.loginMethods.includes("google"),c=t.loginMethods.includes("twitter"),p=t.loginMethods.includes("discord"),u=t.loginMethods.includes("spotify"),E=t.loginMethods.includes("instagram"),d=t.loginMethods.includes("tiktok"),h=t.loginMethods.includes("github"),m=t.loginMethods.includes("linkedin"),_=t.loginMethods.includes("apple"),f=t.loginMethods.includes("farcaster"),y=t.loginMethods.includes("telegram"),l=t.loginMethods.includes("passkey")):(r=e.emailAuth,n=e.smsAuth,s=e.walletAuth||e.solanaWalletAuth,o=e.googleOAuth,c=e.twitterOAuth,p=e.discordOAuth,h=e.githubOAuth,u=e.spotifyOAuth,E=e.instagramOAuth,d=e.tiktokOAuth,m=e.linkedinOAuth,_=e.appleOAuth,f=e.farcasterAuth,y=e.telegramAuth,l=e.passkeyAuth),e.passkeyAuth&&(l=!0),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential&&(l=!1);let g=[r,n].filter(Boolean),C=[o,c,p,h,u,E,d,m,_,f,y].filter(Boolean),N=[s].filter(Boolean),b=t?.loginMethods?.includes("passkey")??!1,S=e.passkeysForSignupEnabled??!1,T=[l&&(S||b)].filter(Boolean);if(g.length+C.length+N.length+T.length===0)throw Error("You must enable at least one login method");let v=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;v&&0===N.length?(A("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),v=!1):v||C.length+g.length!==0||(A("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),v=!0);let w=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&A("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let k=Re({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),L=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],a=[];for(let a of(e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),e.primary.slice(1)))t.includes(a)?console.warn(`Duplicated login method: ${a}`):t.push(a);for(let i of e.overflow??[])t.includes(i)||a.includes(i)?console.warn(`Duplicated login method: ${i}`):a.push(i);return{primary:t,overflow:a}})({input:t?.loginMethodsAndOrder}),O=t?.intl?.defaultCountry??"US",{chains:R,defaultChain:I}=function({supportedChains:e,defaultChainFromConfig:t}){let a;if(e){if(0===e.length)throw Error("`supportedChains` must contain at least one chain");a=e.map((e=>{if(e.rpcUrls.privyWalletOverride)return e;let t=Se.find((t=>t.id===e.id)),a=t?.rpcUrls.privy?.http[0];return a?We(e,a):e}))}else a=[...Se];let i=e?a[0]:fe,r=t??i;if(!a.find((e=>e.id===r.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:a,defaultChain:r}}({supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain}),D=!!t?.defaultChain,W=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,M=t?.embeddedWallets?.requireUserPasswordOnCreate,U=t?.embeddedWallets?.createOnLogin,P=W?"all-users":e.embeddedWalletConfig.createOnLogin,x=t?.solanaClusters??[];return e.solanaWalletAuth&&!t?.externalWallets?.solana?.connectors&&console.warn("App configuration has Solana wallet login enabled, but no Solana wallet connectors have been passed to Privy. Make sure to pass Solana connectors to the `config.externalWallets.solana.connectors` field of the `PrivyProvider`"),{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??we.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,footerLogo:t?.appearance?.footerLogo,palette:Ve({backgroundTheme:t?.appearance?.theme??we.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??we.appearance.accentColor}),loginGroupPriority:v?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:k,walletChainType:t?.appearance?.walletChainType??(({evmWalletAuth:e,solanaWalletAuth:t})=>e&&t?"ethereum-and-solana":e?"ethereum-only":t?"solana-only":"ethereum-only")({evmWalletAuth:e.walletAuth??!1,solanaWalletAuth:e.solanaWalletAuth??!1})},loginMethods:{wallet:s,email:r,sms:n,passkey:l,google:o,twitter:c,discord:p,github:h,spotify:u,instagram:E,tiktok:d,linkedin:m,apple:_,farcaster:f,telegram:y},disablePlusEmails:e.disablePlusEmails,loginMethodsAndOrder:L,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??we.walletConnectCloudProjectId,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},chains:R,solanaClusters:{"mainnet-beta":x.find((e=>"mainnet-beta"===e.name))?.rpcUrl||"https://api.mainnet-beta.solana.com",testnet:x.find((e=>"testnet"===e.name))?.rpcUrl||"https://api.testnet.solana.com",devnet:x.find((e=>"devnet"===e.name))?.rpcUrl||"https://api.devnet.solana.com"},defaultChain:I,intl:{defaultCountry:O},shouldEnforceDefaultChainOnConnect:D,captchaEnabled:e.captchaEnabled??we.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??we.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:w},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{requireUserOwnedRecoveryOnCreate:M??(!W&&e.embeddedWalletConfig.requireUserOwnedRecoveryOnCreate),userOwnedRecoveryOptions:W?["user-passcode"]:e.embeddedWalletConfig.userOwnedRecoveryOptions,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},ethereum:{createOnLogin:U??t?.embeddedWallets?.ethereum?.createOnLogin??P},solana:{createOnLogin:t?.embeddedWallets?.solana?.createOnLogin??"off"},showWalletUIs:t?.embeddedWallets?.showWalletUIs??e.enforceWalletUis??!0,extendedCalldataDecoding:t?.embeddedWallets?.extendedCalldataDecoding??!1,transactionScanning:{enabled:t?.embeddedWallets?.transactionScanning?.enabled??!1,domain:t?.embeddedWallets?.transactionScanning?.domain??i??"https://auth.privy.io"}},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},passkeys:{shouldUnlinkOnUnenrollMfa:t?.passkeys?.shouldUnlinkOnUnenrollMfa,shouldUnenrollMfaOnUnlink:t?.passkeys?.shouldUnenrollMfaOnUnlink},customAuth:W?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration,passkeysForSignupEnabled:e.passkeysForSignupEnabled},headless:!!t?.headless,render:{standalone:t?._render?.standalone??we._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??we.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??we.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??we.fundingMethodConfig.moonpay.useSandbox}}}}let Ye={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,disablePlusEmails:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:"",enforceWalletUis:!1,legacyWalletUiConfig:!1};const ze=Ke(Ye,void 0,!1);let qe=/*#__PURE__*/s({appConfig:ze,isServerConfigLoaded:!1});const $e=({children:e,client:a,clientConfig:l})=>{let[s,o]=i(null),c=r((()=>Ke(s??Ye,l,!!s,"undefined"!=typeof window?window.location.origin:void 0)),[s,l]);return n((()=>{if(!s)return;let e=function(e){if(!e)return{};let{appearance:t,supportedChains:a,defaultChain:i,externalWallets:r,...n}=e;return{...n,...a?{supportedChains:a.map((e=>e.id))}:void 0,...i?{defaultChain:i.id}:void 0,...r?{walletConnect:r.walletConnect,coinbaseWallet:r.coinbaseWallet,solana:{connectors:r.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0}}(l),t=function(e,t=0){let a=3735928559^t,i=1103547991^t;for(let t,r=0;r<e.length;r++)a=Math.imul(a^(t=e.charCodeAt(r)),2654435761),i=Math.imul(i^t,1597334677);return a=Math.imul(a^a>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),4294967296*(2097151&(i=Math.imul(i^i>>>16,2246822507)^Math.imul(a^a>>>13,3266489909)))+(a>>>0)}(JSON.stringify(e)).toString(),i=`privy:sent:${s.id}:${t}`;localStorage.getItem(i)||(a.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(i,"t"))}),[l,s]),n((()=>{s||(async()=>{try{let e=await a.getServerConfig();e.customApiUrl&&a.updateApiUrl(e.customApiUrl),o(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),/*#__PURE__*/t(qe.Provider,{value:{appConfig:c,isServerConfigLoaded:!!s},children:e})},Xe=()=>{let{appConfig:e}=l(qe);return e},Ze=()=>{let{isServerConfigLoaded:e}=l(qe);return e};var Je,Qe=((Je={}).LANDING="LANDING",Je.CONNECT_OR_CREATE="CONNECT_OR_CREATE",Je.AWAITING_CONNECTION="AWAITING_CONNECTION",Je.AWAITING_FARCASTER_CONNECTION="AWAITING_FARCASTER_CONNECTION",Je.AWAITING_FARCASTER_SIGNER="AWAITING_FARCASTER_SIGNER",Je.AWAITING_OAUTH_SCREEN="AWAITING_OAUTH_SCREEN",Je.CROSS_APP_AUTH_SCREEN="CROSS_APP_AUTH_SCREEN",Je.AWAITING_PASSWORDLESS_CODE="AWAITING_PASSWORDLESS_CODE",Je.AWAITING_PASSKEY_SYSTEM_DIALOGUE="AWAITING_PASSKEY_SYSTEM_DIALOGUE",Je.SELECT_PASSKEY_SIGNUP_OR_LOGIN="SELECT_PASSKEY_SIGNUP_OR_LOGIN",Je.LINK_EMAIL_SCREEN="LINK_EMAIL_SCREEN",Je.LINK_PHONE_SCREEN="LINK_PHONE_SCREEN",Je.LINK_WALLET_SCREEN="LINK_WALLET_SCREEN",Je.LINK_PASSKEY_SCREEN="LINK_PASSKEY_SCREEN",Je.UPDATE_EMAIL_SCREEN="UPDATE_EMAIL_SCREEN",Je.UPDATE_PHONE_SCREEN="UPDATE_PHONE_SCREEN",Je.AWAITING_CONNECT_ONLY_CONNECTION="AWAITING_CONNECT_ONLY_CONNECTION",Je.CONNECT_ONLY_LANDING_SCREEN="CONNECT_ONLY_LANDING_SCREEN",Je.CONNECT_ONLY_AUTHENTICATED_SCREEN="CONNECT_ONLY_AUTHENTICATED_SCREEN",Je.LOGIN_FAILED_SCREEN="LOGIN_FAILED_SCREEN",Je.ALLOWLIST_REJECTION_SCREEN="ALLOWLIST_REJECTION_SCREEN",Je.ACCOUNT_NOT_FOUND_SCREEN="ACCOUNT_NOT_FOUND_SCREEN",Je.USER_LIMIT_REACHED_SCREEN="USER_LIMIT_REACHED_SCREEN",Je.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN="EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN",Je.EMBEDDED_WALLET_CREATED_SCREEN="EMBEDDED_WALLET_CREATED_SCREEN",Je.EMBEDDED_WALLET_CONNECTING_SCREEN="EMBEDDED_WALLET_CONNECTING_SCREEN",Je.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN="EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN",Je.EMBEDDED_WALLET_KEY_EXPORT_SCREEN="EMBEDDED_WALLET_KEY_EXPORT_SCREEN",Je.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",Je.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN",Je.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN="EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",Je.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",Je.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN="EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN",Je.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN",Je.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN",Je.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN="EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN",Je.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN="EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN",Je.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN",Je.EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN",Je.INSTALL_WALLET_SCREEN="INSTALL_WALLET_SCREEN",Je.WALLET_INTERSTITIAL_SCREEN="WALLET_INTERSTITIAL_SCREEN",Je.AFFIRMATIVE_CONSENT_SCREEN="AFFIRMATIVE_CONSENT_SCREEN",Je.FUNDING_METHOD_SELECTION_SCREEN="FUNDING_METHOD_SELECTION_SCREEN",Je.FUNDING_TRANSFER_FROM_WALLET_SCREEN="FUNDING_TRANSFER_FROM_WALLET_SCREEN",Je.FUNDING_EDIT_AMOUNT_SCREEN="FUNDING_EDIT_AMOUNT_SCREEN",Je.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN",Je.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN",Je.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN="FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN",Je.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN="FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN",Je.FUNDING_MANUAL_TRANSFER_SCREEN="FUNDING_MANUAL_TRANSFER_SCREEN",Je.MOONPAY_STATUS_SCREEN="MOONPAY_STATUS_SCREEN",Je.COINBASE_ONRAMP_STATUS_SCREEN="COINBASE_ONRAMP_STATUS_SCREEN",Je.MFA_ENROLLMENT_FLOW_SCREEN="MFA_ENROLLMENT_FLOW_SCREEN",Je.CAPTCHA_SCREEN="CAPTCHA_SCREEN",Je.ERROR_SCREEN="ERROR_SCREEN",Je.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE="IN_APP_BROWSER_LOGIN_NOT_POSSIBLE",Je.TELEGRAM_AUTH_SCREEN="TELEGRAM_AUTH_SCREEN",Je.LINK_CONFLICT_SCREEN="LINK_CONFLICT_SCREEN",Je);const et=/*#__PURE__*/s({ready:!1,app:ze,currentScreen:null,lastScreen:null,navigate:p,navigateBack:p,resetNavigation:p,setModalData:p,onUserCloseViaDialogOrKeybindRef:void 0});let tt=[Qe.LANDING,Qe.CONNECT_ONLY_LANDING_SCREEN,null];const at=e=>{let r=Xe(),l=e.authenticated,[s,c]=i(e.initialScreen);n((()=>{l||tt.includes(e.initialScreen)||e.setInitialScreen(null)}),[l]);let p=o(null);n((()=>{e.open||(p.current=null)}),[e.open]),n((()=>{p.current=null}),[e.initialScreen]);let d={ready:!!r.id,app:r,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:s,navigate:(t,a=!0)=>{e.setInitialScreen(t),a&&c(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(s)},resetNavigation:()=>{e.setInitialScreen(null),c(null)},onUserCloseViaDialogOrKeybindRef:p};/*#__PURE__*/return a(et.Provider,{value:d,children:[("string"==typeof r.appearance.logo||"img"===r.appearance.logo?.type)&&/*#__PURE__*/t(ve,{src:"string"==typeof r.appearance.logo?r.appearance.logo:r.appearance.logo.props.src}),e.children]})},it=()=>l(et),rt=/*#__PURE__*/s({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:p,login:p,connectOrCreateWallet:p,linkEmail:p,linkPhone:p,linkFarcaster:p,linkWallet:p,startCrossAppAuthFlow:p,linkGoogle:p,linkTwitter:p,linkDiscord:p,linkGithub:p,linkSpotify:p,linkInstagram:p,linkTelegram:p,linkTiktok:p,linkLinkedIn:p,linkApple:p,linkPasskey:p,updateEmail:p,updatePhone:p,logout:p,getAccessToken:p,unlinkEmail:p,unlinkPhone:p,unlinkWallet:p,unlinkGoogle:p,unlinkTwitter:p,unlinkDiscord:p,unlinkGithub:p,unlinkSpotify:p,unlinkInstagram:p,unlinkTiktok:p,unlinkLinkedIn:p,unlinkApple:p,unlinkCrossAppAccount:p,unlinkFarcaster:p,unlinkTelegram:p,unlinkPasskey:p,createWallet:p,signMessage:p,signTypedData:p,enrollInMfa:p,initEnrollmentWithSms:p,initEnrollmentWithTotp:p,initEnrollmentWithPasskey:p,promptMfa:p,init:p,submitEnrollmentWithSms:p,submitEnrollmentWithTotp:p,submitEnrollmentWithPasskey:p,unenroll:p,submit:p,cancel:p,sendTransaction:p,signTransaction:p,exportWallet:p,setWalletPassword:p,setWalletRecovery:p,requestFarcasterSignerFromWarpcast:p,getFarcasterSignerPublicKey:p,signFarcasterMessage:p,createGuestAccount:p,signMessageWithCrossAppWallet:p,signTypedDataWithCrossAppWallet:p,sendTransactionWithCrossAppWallet:p,isModalOpen:!1,mfaMethods:[]}),nt=()=>l(rt),lt=/*#__PURE__*/s(null);function st(){let e=l(lt);return null===e?(console.warn("`useWallets` was called outside the PrivyProvider component"),{wallets:[],ready:!1}):e}export{Fe as $,P as A,xe as B,O as C,Te as D,st as E,T as F,Me as G,R as H,N as I,Ue as J,h as K,He as L,Qe as M,Pe as N,I as O,C as P,fe as Q,A as R,L as S,Ee as T,ye as U,_ as V,F as W,ge as X,ce as Y,rt as Z,Ge as _,U as a,te as a0,se as a1,$e as a2,Ze as a3,Z as a4,q as a5,ee as a6,$ as a7,le as a8,lt as a9,at as aa,Q as ab,ne as ac,Se as ad,Ie as ae,We as af,D as ag,x as ah,de as ai,he as aj,_e as ak,be as al,H as am,G as an,j as ao,B as ap,Ne as aq,Ae as ar,Ce as as,me as at,ue as au,pe as av,W as b,re as c,M as d,f as e,k as f,w as g,S as h,V as i,oe as j,y as k,g as l,b as m,d as n,u as o,v as p,Xe as q,nt as r,E as s,m as t,it as u,ae as v,z as w,J as x,ie as y,De as z};
|